@unbrained/pm-cli 2026.7.20 → 2026.7.21
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 +11 -0
- package/dist/cli/commander-usage.d.ts +1 -1
- package/dist/cli/commander-usage.js +5 -5
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/completion.js +13 -5
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/contracts.js +4 -3
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +2 -0
- package/dist/cli/error-guidance.js +7 -2
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/main.d.ts +1 -5
- package/dist/cli/main.js +12 -50
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +13 -3
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +45 -3
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-structured-mutation.d.ts +14 -0
- package/dist/cli/register-structured-mutation.js +62 -0
- package/dist/cli/register-structured-mutation.js.map +1 -0
- package/dist/cli/registration-helpers.js +5 -3
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/bundle-manifest.json +280 -296
- package/dist/cli-bundle/chunks/{append-E6V54WOQ.js → append-7OVFYR3C.js} +3 -3
- package/dist/cli-bundle/chunks/{append-NNJ3EFIT.js → append-DFETHAZL.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-C3KD7U3T.js → chunk-2L6ZP22J.js} +241 -10
- package/dist/cli-bundle/chunks/chunk-2L6ZP22J.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KZEANWJS.js → chunk-4PUUNQDV.js} +98 -30
- package/dist/cli-bundle/chunks/chunk-4PUUNQDV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RDV4ZFYS.js → chunk-4QOB7L7I.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-RDV4ZFYS.js.map → chunk-4QOB7L7I.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3LPFHE3P.js → chunk-4QSQ6XDK.js} +62 -20
- package/dist/cli-bundle/chunks/chunk-4QSQ6XDK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-QJKL5PHS.js → chunk-7656MAUL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3AO5VSDR.js → chunk-7RW4JCU2.js} +328 -6
- package/dist/cli-bundle/chunks/chunk-7RW4JCU2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-X6K5XTTN.js → chunk-7W2UAXXT.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-SSKOQNMS.js → chunk-ABWCF646.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-SSKOQNMS.js.map → chunk-ABWCF646.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-WVA4DVNV.js → chunk-ADBTSVGK.js} +71 -33
- package/dist/cli-bundle/chunks/chunk-ADBTSVGK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-J4FBIFU6.js → chunk-AELMUANP.js} +12 -6
- package/dist/cli-bundle/chunks/chunk-AELMUANP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4F6BWJ4J.js → chunk-AMJPSANK.js} +57 -36
- package/dist/cli-bundle/chunks/chunk-AMJPSANK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6VIJ7UA5.js → chunk-AS4SAZ5R.js} +850 -819
- package/dist/cli-bundle/chunks/chunk-AS4SAZ5R.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-SG74J6MV.js → chunk-ATBCUC7Y.js} +574 -5
- package/dist/cli-bundle/chunks/chunk-ATBCUC7Y.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5OK4UGFV.js → chunk-BXNDKOR2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KSPWRNVP.js → chunk-CPX275C6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JH2ZSLO3.js → chunk-DZRV2OPA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-L7BH7IWU.js → chunk-E5XMKOSB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CQTQKUUV.js → chunk-EWJWSNRU.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-DAQ45GCS.js → chunk-F2LBF7XJ.js} +22 -15
- package/dist/cli-bundle/chunks/chunk-F2LBF7XJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6XMUURSS.js → chunk-FJIFFBJX.js} +64 -33
- package/dist/cli-bundle/chunks/chunk-FJIFFBJX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-E7ICD63T.js → chunk-FO6OSVEN.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-E7ICD63T.js.map → chunk-FO6OSVEN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3MCTMJXI.js → chunk-FPBMLYPI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UZDQXNUB.js → chunk-FSE2IKJQ.js} +46 -5
- package/dist/cli-bundle/chunks/chunk-FSE2IKJQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IX677TRO.js → chunk-GKX4NJ7U.js} +8 -10
- package/dist/cli-bundle/chunks/{chunk-IX677TRO.js.map → chunk-GKX4NJ7U.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DVDBQA3B.js → chunk-GTK4DTEW.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-H7EAER5L.js +974 -0
- package/dist/cli-bundle/chunks/chunk-H7EAER5L.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5UX66S6U.js → chunk-ICDAQ4TD.js} +316 -8
- package/dist/cli-bundle/chunks/chunk-ICDAQ4TD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-YQQNAKW3.js → chunk-JFD5LPMI.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-YQQNAKW3.js.map → chunk-JFD5LPMI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-QANSTTC7.js → chunk-JXCW2TI2.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-QANSTTC7.js.map → chunk-JXCW2TI2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GSJSM5BJ.js → chunk-K36WV5J6.js} +76 -13
- package/dist/cli-bundle/chunks/chunk-K36WV5J6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GVI6FAFG.js → chunk-K55VMLSS.js} +7 -5
- package/dist/cli-bundle/chunks/chunk-K55VMLSS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GIQSU6S2.js → chunk-KBLZ3AA5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XJF7CDNH.js → chunk-KH44WBAT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GV2262OF.js → chunk-LAV26CQG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VDO2JMD4.js → chunk-LVC72YRD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3VY6MIEO.js → chunk-LZYP423P.js} +35 -6
- package/dist/cli-bundle/chunks/chunk-LZYP423P.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZYPFOO3L.js → chunk-MATHDCGG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OV7MSW3I.js → chunk-MWQ2HC2A.js} +99 -31
- package/dist/cli-bundle/chunks/chunk-MWQ2HC2A.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NHT3F4WZ.js → chunk-NUF7ROFH.js} +840 -816
- package/dist/cli-bundle/chunks/chunk-NUF7ROFH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AOEOYL3S.js → chunk-O4BCOJTZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RJO3YAFM.js → chunk-OCUBRA6D.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5IZJWSDB.js → chunk-OG5DVFMA.js} +22 -15
- package/dist/cli-bundle/chunks/chunk-OG5DVFMA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-I577UHC7.js → chunk-OR42SO64.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZOJ3LR7O.js → chunk-OY7DMU5P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HEWM6CEN.js → chunk-P7MTHPJQ.js} +50 -9
- package/dist/cli-bundle/chunks/chunk-P7MTHPJQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-2BO4CA46.js → chunk-PFNHX655.js} +236 -12
- package/dist/cli-bundle/chunks/{chunk-2BO4CA46.js.map → chunk-PFNHX655.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZV2NTVMJ.js → chunk-PONKZPCJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-THAOZG4U.js → chunk-PQSEQD6E.js} +8 -6
- package/dist/cli-bundle/chunks/chunk-PQSEQD6E.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-PWDEHT3L.js +991 -0
- package/dist/cli-bundle/chunks/chunk-PWDEHT3L.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UX6SSO2I.js → chunk-PZC2FUOQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WUVEBQW6.js → chunk-QG4GFLQ6.js} +3 -5
- package/dist/cli-bundle/chunks/{chunk-WUVEBQW6.js.map → chunk-QG4GFLQ6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VQIHNHMJ.js → chunk-QIH77CAG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-R3EWPG4A.js → chunk-QJIKE24M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QLZ643FM.js → chunk-QOOTOD3W.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-QLZ643FM.js.map → chunk-QOOTOD3W.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MYSS5H2A.js → chunk-R3P6FZJW.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-MYSS5H2A.js.map → chunk-R3P6FZJW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-G3COA6GS.js → chunk-RNPZYNHS.js} +56 -35
- package/dist/cli-bundle/chunks/chunk-RNPZYNHS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-T44FMVRL.js → chunk-RPESLSO5.js} +62 -20
- package/dist/cli-bundle/chunks/chunk-RPESLSO5.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-INSTSQNZ.js → chunk-SY4SFZSD.js} +595 -3
- package/dist/cli-bundle/chunks/chunk-SY4SFZSD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HB3P4M52.js → chunk-TRSHFPRZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HRW7GF6T.js → chunk-UCBDQI5E.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4U4Z6AHI.js → chunk-V22ZPOKN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JM6YAXTR.js → chunk-VHXHVTUU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LPEYZRUR.js → chunk-VJQG4BIM.js} +35 -6
- package/dist/cli-bundle/chunks/chunk-VJQG4BIM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D6NXDNP3.js → chunk-VLRGDBLY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JAPE62Y5.js → chunk-VNTCM3VW.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-FDHPAVVB.js → chunk-VXOOB6YX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GFQP7HAZ.js → chunk-VZIZB6QH.js} +3 -5
- package/dist/cli-bundle/chunks/{chunk-GFQP7HAZ.js.map → chunk-VZIZB6QH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HQ3SB4CN.js → chunk-X3W65QK3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RZJLNXFG.js → chunk-XJTABV3X.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GVT754PX.js → chunk-YCIUJJOD.js} +11 -5
- package/dist/cli-bundle/chunks/chunk-YCIUJJOD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IJNK6WW2.js → chunk-Z75ONV25.js} +75 -12
- package/dist/cli-bundle/chunks/chunk-Z75ONV25.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4L23AGQ7.js → chunk-Z7VWXXJM.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-4L23AGQ7.js.map → chunk-Z7VWXXJM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YBT7O4KT.js → chunk-ZTVA4KLN.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-YBT7O4KT.js.map → chunk-ZTVA4KLN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-TYHJDFYW.js → chunk-ZVZGXPQ5.js} +2 -2
- package/dist/cli-bundle/chunks/{close-many-SDA426VT.js → close-many-5RZXVN4J.js} +5 -6
- package/dist/cli-bundle/chunks/{close-many-UTZANOCQ.js → close-many-RZVTUGBG.js} +5 -6
- package/dist/cli-bundle/chunks/{comments-LZN6FXXC.js → comments-TPU7QRBL.js} +4 -4
- package/dist/cli-bundle/chunks/{comments-VBQ345ND.js → comments-Z4KV6FU3.js} +4 -4
- package/dist/cli-bundle/chunks/{create-GG4RBCGC.js → create-EIFBIVNQ.js} +6 -6
- package/dist/cli-bundle/chunks/{create-JBC5KUW6.js → create-RGSPN5GD.js} +6 -6
- package/dist/cli-bundle/chunks/{deps-FI4O6NQS.js → deps-UH5EQQUY.js} +3 -3
- package/dist/cli-bundle/chunks/{deps-DELOO4TL.js → deps-YG7UF3VR.js} +3 -3
- package/dist/cli-bundle/chunks/{docs-6Z2MP526.js → docs-G32TK6XS.js} +4 -4
- package/dist/cli-bundle/chunks/{docs-2UYBP5D6.js → docs-JWWNRC27.js} +4 -4
- package/dist/cli-bundle/chunks/{files-HKEAN5MA.js → files-3H32UQ4K.js} +4 -4
- package/dist/cli-bundle/chunks/{files-HEUGSJZL.js → files-4ALMCSKB.js} +4 -4
- package/dist/cli-bundle/chunks/{history-compact-7NDVP3PT.js → history-compact-77BT2LUB.js} +3 -4
- package/dist/cli-bundle/chunks/{history-compact-65YVN5DB.js → history-compact-VCKGTX64.js} +3 -4
- package/dist/cli-bundle/chunks/{history-redact-7YBL4XSG.js → history-redact-LJPZPNFA.js} +2 -3
- package/dist/cli-bundle/chunks/{history-redact-IZGNJBU4.js → history-redact-PWTTJ3XS.js} +2 -3
- package/dist/cli-bundle/chunks/{history-repair-7M4PYQUH.js → history-repair-I7CBNCV3.js} +5 -6
- package/dist/cli-bundle/chunks/{history-repair-GNGETJLI.js → history-repair-YTDZRK5E.js} +5 -6
- package/dist/cli-bundle/chunks/{learnings-3YXDRWFT.js → learnings-CYNOICKR.js} +4 -4
- package/dist/cli-bundle/chunks/{learnings-ALC6IMNL.js → learnings-KTYW3AL7.js} +4 -4
- package/dist/cli-bundle/chunks/{notes-7JMLQ447.js → notes-FGO63FXL.js} +4 -4
- package/dist/cli-bundle/chunks/{notes-JFCLTC5C.js → notes-ZERD3KB2.js} +4 -4
- package/dist/cli-bundle/chunks/{plan-T3XB3WTK.js → plan-OFJUBIM5.js} +7 -7
- package/dist/cli-bundle/chunks/{plan-KOIPWVOZ.js → plan-SGCDDTYR.js} +7 -7
- package/dist/cli-bundle/chunks/{profile-OILJHKUW.js → profile-3THJPIQY.js} +4 -5
- package/dist/cli-bundle/chunks/{profile-RJXA7PGS.js → profile-XEZAMMBW.js} +4 -5
- package/dist/cli-bundle/chunks/{register-list-query-CFVG75P3.js → register-list-query-BR435Q2H.js} +19 -16
- package/dist/cli-bundle/chunks/register-list-query-BR435Q2H.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-E7UVY4TN.js → register-list-query-RWTWLOBE.js} +18 -15
- package/dist/cli-bundle/chunks/register-list-query-RWTWLOBE.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-IQ55E25C.js → register-mutation-HLWC2WNP.js} +167 -31
- package/dist/cli-bundle/chunks/register-mutation-HLWC2WNP.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-4VJTXBZW.js → register-mutation-ZJX5AZM5.js} +173 -30
- package/dist/cli-bundle/chunks/register-mutation-ZJX5AZM5.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-AR7RMX4W.js → register-operations-744YBJMV.js} +23 -25
- package/dist/cli-bundle/chunks/{register-operations-AR7RMX4W.js.map → register-operations-744YBJMV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-NOLZGORC.js → register-operations-UEBJH6AN.js} +21 -23
- package/dist/cli-bundle/chunks/{register-operations-NOLZGORC.js.map → register-operations-UEBJH6AN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-EYZ7VTPZ.js → register-setup-5DA4UZXI.js} +7 -8
- package/dist/cli-bundle/chunks/{register-setup-EYZ7VTPZ.js.map → register-setup-5DA4UZXI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-BB77VUEE.js → register-setup-6H25M3BH.js} +9 -10
- package/dist/cli-bundle/chunks/{register-setup-BB77VUEE.js.map → register-setup-6H25M3BH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{restore-ZH65GZFB.js → restore-6TDVSATY.js} +4 -5
- package/dist/cli-bundle/chunks/{restore-L6IAGOD7.js → restore-RSL7C7LO.js} +4 -5
- package/dist/cli-bundle/chunks/{schema-4ERWM5QJ.js → schema-HFXFSGPG.js} +2 -3
- package/dist/cli-bundle/chunks/{schema-55DL3Q52.js → schema-TPVTIJPO.js} +2 -3
- package/dist/cli-bundle/chunks/{update-FW6FKDOP.js → update-LJZCL5SI.js} +7 -7
- package/dist/cli-bundle/chunks/{update-TJHSPRPT.js → update-SIA7LH5Y.js} +7 -7
- package/dist/cli-bundle/chunks/{update-many-PWXX5WHO.js → update-many-BDBZVGQL.js} +11 -12
- package/dist/cli-bundle/chunks/{update-many-NNALYQCN.js → update-many-MOY3A5B3.js} +11 -12
- package/dist/cli-bundle/main.js +60 -85
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +37 -37
- package/dist/cli-bundle/sdk.js +126 -291
- package/dist/cli-bundle/sdk.js.map +4 -4
- package/dist/core/item/parse.d.ts +1 -1
- package/dist/core/item/parse.js +13 -7
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/output/mutation-projection.d.ts +2 -0
- package/dist/core/output/mutation-projection.js +33 -2
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/output/output.d.ts +4 -0
- package/dist/core/output/output.js +18 -13
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/shared/command-types.d.ts +4 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/command-types.js.map +1 -1
- package/dist/mcp/server.js +39 -4
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-definitions.js +45 -4
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/cli-bootstrap.d.ts +2 -0
- package/dist/sdk/cli-bootstrap.js +20 -27
- package/dist/sdk/cli-bootstrap.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +21 -2
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +10 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +16 -3
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +6 -2
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +3 -3
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/cli-program.js +4 -2
- package/dist/sdk/cli-program.js.map +1 -1
- package/dist/sdk/dependencies.d.ts +3 -2
- package/dist/sdk/dependencies.js +13 -12
- package/dist/sdk/dependencies.js.map +1 -1
- package/dist/sdk/error-runtime.d.ts +10 -0
- package/dist/sdk/error-runtime.js +59 -0
- package/dist/sdk/error-runtime.js.map +1 -0
- package/dist/sdk/graph/analytics.d.ts +9 -0
- package/dist/sdk/graph/analytics.js +24 -13
- package/dist/sdk/graph/analytics.js.map +1 -1
- package/dist/sdk/graph/assembly.d.ts +39 -0
- package/dist/sdk/graph/assembly.js +92 -12
- package/dist/sdk/graph/assembly.js.map +1 -1
- package/dist/sdk/graph/cache.d.ts +4 -1
- package/dist/sdk/graph/cache.js +17 -4
- package/dist/sdk/graph/cache.js.map +1 -1
- package/dist/sdk/graph/centrality.d.ts +82 -0
- package/dist/sdk/graph/centrality.js +259 -0
- package/dist/sdk/graph/centrality.js.map +1 -0
- package/dist/sdk/graph/durable-cache.d.ts +71 -0
- package/dist/sdk/graph/durable-cache.js +205 -0
- package/dist/sdk/graph/durable-cache.js.map +1 -0
- package/dist/sdk/graph/governance.d.ts +69 -1
- package/dist/sdk/graph/governance.js +143 -35
- package/dist/sdk/graph/governance.js.map +1 -1
- package/dist/sdk/graph/index.d.ts +7 -4
- package/dist/sdk/graph/index.js +8 -5
- package/dist/sdk/graph/index.js.map +1 -1
- package/dist/sdk/graph/mutation-advisory.d.ts +35 -4
- package/dist/sdk/graph/mutation-advisory.js +124 -35
- package/dist/sdk/graph/mutation-advisory.js.map +1 -1
- package/dist/sdk/graph/remediation.js +12 -2
- package/dist/sdk/graph/remediation.js.map +1 -1
- package/dist/sdk/graph/run.d.ts +133 -2
- package/dist/sdk/graph/run.js +217 -8
- package/dist/sdk/graph/run.js.map +1 -1
- package/dist/sdk/graph/scheduling.d.ts +59 -0
- package/dist/sdk/graph/scheduling.js +125 -0
- package/dist/sdk/graph/scheduling.js.map +1 -0
- package/dist/sdk/graph/traversal.d.ts +11 -0
- package/dist/sdk/graph/traversal.js +16 -2
- package/dist/sdk/graph/traversal.js.map +1 -1
- package/dist/sdk/index.d.ts +4 -0
- package/dist/sdk/index.js +6 -2
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime-input.js +7 -2
- package/dist/sdk/runtime-input.js.map +1 -1
- package/dist/sdk/runtime-primitives.d.ts +10 -0
- package/dist/sdk/runtime-primitives.js +14 -0
- package/dist/sdk/runtime-primitives.js.map +1 -0
- package/dist/sdk/runtime.d.ts +15 -0
- package/dist/sdk/runtime.js +16 -3
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/structured-mutations.d.ts +21 -0
- package/dist/sdk/structured-mutations.js +375 -0
- package/dist/sdk/structured-mutations.js.map +1 -0
- package/docs/COMMANDS.md +85 -5
- package/docs/RELATIONSHIP_GRAPH.md +48 -7
- package/docs/SDK.md +78 -3
- package/marketplace.json +2 -2
- package/package.json +1 -1
- 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/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/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +5 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/dist/cli-bundle/chunks/chunk-3AO5VSDR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3LPFHE3P.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3VY6MIEO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4F6BWJ4J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5IZJWSDB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5UX66S6U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-6C2ZZX5Z.js +0 -286
- package/dist/cli-bundle/chunks/chunk-6C2ZZX5Z.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-6VIJ7UA5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6XMUURSS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C3KD7U3T.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js +0 -334
- package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DAQ45GCS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-E6LEMURX.js +0 -249
- package/dist/cli-bundle/chunks/chunk-E6LEMURX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-G3COA6GS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GSJSM5BJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GVI6FAFG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GVT754PX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HEWM6CEN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IJNK6WW2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-INSTSQNZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-J4FBIFU6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KZEANWJS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LPEYZRUR.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NHT3F4WZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OV7MSW3I.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js +0 -246
- package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js +0 -344
- package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SG74J6MV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-T44FMVRL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-THAOZG4U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UQLXSG72.js +0 -289
- package/dist/cli-bundle/chunks/chunk-UQLXSG72.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-UZDQXNUB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WVA4DVNV.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-CFVG75P3.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-E7UVY4TN.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-4VJTXBZW.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-IQ55E25C.js.map +0 -1
- /package/dist/cli-bundle/chunks/{append-E6V54WOQ.js.map → append-7OVFYR3C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-NNJ3EFIT.js.map → append-DFETHAZL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QJKL5PHS.js.map → chunk-7656MAUL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X6K5XTTN.js.map → chunk-7W2UAXXT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5OK4UGFV.js.map → chunk-BXNDKOR2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KSPWRNVP.js.map → chunk-CPX275C6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JH2ZSLO3.js.map → chunk-DZRV2OPA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L7BH7IWU.js.map → chunk-E5XMKOSB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CQTQKUUV.js.map → chunk-EWJWSNRU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3MCTMJXI.js.map → chunk-FPBMLYPI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DVDBQA3B.js.map → chunk-GTK4DTEW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GIQSU6S2.js.map → chunk-KBLZ3AA5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XJF7CDNH.js.map → chunk-KH44WBAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GV2262OF.js.map → chunk-LAV26CQG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VDO2JMD4.js.map → chunk-LVC72YRD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZYPFOO3L.js.map → chunk-MATHDCGG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AOEOYL3S.js.map → chunk-O4BCOJTZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RJO3YAFM.js.map → chunk-OCUBRA6D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I577UHC7.js.map → chunk-OR42SO64.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZOJ3LR7O.js.map → chunk-OY7DMU5P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZV2NTVMJ.js.map → chunk-PONKZPCJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UX6SSO2I.js.map → chunk-PZC2FUOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VQIHNHMJ.js.map → chunk-QIH77CAG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R3EWPG4A.js.map → chunk-QJIKE24M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HB3P4M52.js.map → chunk-TRSHFPRZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HRW7GF6T.js.map → chunk-UCBDQI5E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4U4Z6AHI.js.map → chunk-V22ZPOKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JM6YAXTR.js.map → chunk-VHXHVTUU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D6NXDNP3.js.map → chunk-VLRGDBLY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JAPE62Y5.js.map → chunk-VNTCM3VW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FDHPAVVB.js.map → chunk-VXOOB6YX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HQ3SB4CN.js.map → chunk-X3W65QK3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RZJLNXFG.js.map → chunk-XJTABV3X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TYHJDFYW.js.map → chunk-ZVZGXPQ5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-SDA426VT.js.map → close-many-5RZXVN4J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-UTZANOCQ.js.map → close-many-RZVTUGBG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-LZN6FXXC.js.map → comments-TPU7QRBL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-VBQ345ND.js.map → comments-Z4KV6FU3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-GG4RBCGC.js.map → create-EIFBIVNQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-JBC5KUW6.js.map → create-RGSPN5GD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-FI4O6NQS.js.map → deps-UH5EQQUY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-DELOO4TL.js.map → deps-YG7UF3VR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-6Z2MP526.js.map → docs-G32TK6XS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-2UYBP5D6.js.map → docs-JWWNRC27.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-HKEAN5MA.js.map → files-3H32UQ4K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-HEUGSJZL.js.map → files-4ALMCSKB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-7NDVP3PT.js.map → history-compact-77BT2LUB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-65YVN5DB.js.map → history-compact-VCKGTX64.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-7YBL4XSG.js.map → history-redact-LJPZPNFA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-IZGNJBU4.js.map → history-redact-PWTTJ3XS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-7M4PYQUH.js.map → history-repair-I7CBNCV3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-GNGETJLI.js.map → history-repair-YTDZRK5E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-3YXDRWFT.js.map → learnings-CYNOICKR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-ALC6IMNL.js.map → learnings-KTYW3AL7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-7JMLQ447.js.map → notes-FGO63FXL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-JFCLTC5C.js.map → notes-ZERD3KB2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-T3XB3WTK.js.map → plan-OFJUBIM5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-KOIPWVOZ.js.map → plan-SGCDDTYR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-OILJHKUW.js.map → profile-3THJPIQY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-RJXA7PGS.js.map → profile-XEZAMMBW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-ZH65GZFB.js.map → restore-6TDVSATY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-L6IAGOD7.js.map → restore-RSL7C7LO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-4ERWM5QJ.js.map → schema-HFXFSGPG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-55DL3Q52.js.map → schema-TPVTIJPO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-FW6FKDOP.js.map → update-LJZCL5SI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-TJHSPRPT.js.map → update-SIA7LH5Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-PWXX5WHO.js.map → update-many-BDBZVGQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-NNALYQCN.js.map → update-many-MOY3A5B3.js.map} +0 -0
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.",
|
|
9
|
-
"version": "2026.7.
|
|
9
|
+
"version": "2026.7.21"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "pm-claude",
|
|
14
14
|
"source": "./plugins/pm-claude",
|
|
15
15
|
"description": "Native pm CLI integration for Claude Code — 28 MCP tools, 5 workflow skills, 14 slash commands, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.",
|
|
16
|
-
"version": "2026.7.
|
|
16
|
+
"version": "2026.7.21",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "unbrained",
|
|
19
19
|
"url": "https://github.com/unbraind/pm-cli"
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026.7.21 - 2026-07-21
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Graph planning & structural analytics: critical-path slack, betweenness/closeness centrality, and articulation points/bridges ([pm-efuo34](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-efuo34.toon))
|
|
8
|
+
- CLI+MCP surface for atomic bulk item mutations: JSON mutation batch on stdin over commitItemMutations ([pm-xm7c](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-xm7c.toon))
|
|
9
|
+
- GH-438: accept a full item JSON document on stdin for pm create / pm update ([pm-kipd](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-kipd.toon))
|
|
10
|
+
- GH-435: lean JSON output mode omitting null/empty fields (~50% token cut for --json) ([pm-cfed](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-cfed.toon))
|
|
11
|
+
- GH-437: make lean mutation output the CLI default (parity with MCP compact envelope) ([pm-nilh](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-nilh.toon))
|
|
12
|
+
- GH-443: lean error mode — drop constant required/why boilerplate from structured errors ([pm-g9xk](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-g9xk.toon))
|
|
13
|
+
|
|
3
14
|
## 2026.7.20 - 2026-07-20
|
|
4
15
|
|
|
5
16
|
### Added
|
|
@@ -38,7 +38,7 @@ export declare function resolveCommanderUsageContext(error: unknown, rootProgram
|
|
|
38
38
|
/** Implements format commander usage message for the public runtime surface of this module. */
|
|
39
39
|
export declare function formatCommanderUsageMessage(error: unknown, rootProgram: Command, extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>): Promise<string>;
|
|
40
40
|
/** Implements format commander usage json for the public runtime surface of this module. */
|
|
41
|
-
export declare function formatCommanderUsageJson(error: unknown, rootProgram: Command, extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor
|
|
41
|
+
export declare function formatCommanderUsageJson(error: unknown, rootProgram: Command, extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>, lean?: boolean): Promise<string>;
|
|
42
42
|
/** Public contract for test only, shared by SDK and presentation-layer consumers. */
|
|
43
43
|
export declare const _testOnly: {
|
|
44
44
|
collectKnownLongFlags: typeof collectKnownLongFlags;
|
|
@@ -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]="04cd5219-f0a4-5eb4-b587-452c2eacfb32")}catch(e){}}();
|
|
3
3
|
import { pathExists } from "../core/fs/fs-utils.js";
|
|
4
4
|
import { resolveItemTypeRegistry } from "../core/item/type-registry.js";
|
|
5
5
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
@@ -8,7 +8,7 @@ import { readSettings } from "../core/store/settings.js";
|
|
|
8
8
|
import { BUILTIN_ITEM_TYPE_VALUES } from "../types/index.js";
|
|
9
9
|
import { getActiveExtensionRegistrations, runActiveServiceOverride, } from "../core/extensions/index.js";
|
|
10
10
|
import { PM_CORE_COMMAND_NAMES, resolveSubcommandFlagContractsForCommand, } from "../sdk/cli-contracts.js";
|
|
11
|
-
import { formatCommanderErrorForDisplay, formatCommanderErrorForJson, } from "./error-guidance.js";
|
|
11
|
+
import { formatCommanderErrorForDisplay, formatCommanderErrorForJson, projectLeanErrorEnvelope, } from "./error-guidance.js";
|
|
12
12
|
import { normalizeHelpCommandPath } from "./help-content.js";
|
|
13
13
|
import { getCommandPath } from "./registration-helpers.js";
|
|
14
14
|
import { EXECUTABLE_COMMAND_ALIASES, normalizeBootstrapInvocation, parseBootstrapGlobalOptions, parseBootstrapCommandName, } from "./bootstrap-args.js";
|
|
@@ -582,7 +582,7 @@ export async function formatCommanderUsageMessage(error, rootProgram, extensionD
|
|
|
582
582
|
return formatted;
|
|
583
583
|
}
|
|
584
584
|
/** Implements format commander usage json for the public runtime surface of this module. */
|
|
585
|
-
export async function formatCommanderUsageJson(error, rootProgram, extensionDescriptors) {
|
|
585
|
+
export async function formatCommanderUsageJson(error, rootProgram, extensionDescriptors, lean = false) {
|
|
586
586
|
const usageContext = await resolveCommanderUsageContext(error, rootProgram, extensionDescriptors);
|
|
587
587
|
const envelope = formatCommanderErrorForJson(usageContext.message, usageContext.commandName, usageContext.allowedTypes, EXIT_CODE.USAGE, {
|
|
588
588
|
unknownCommandExamples: usageContext.unknownCommandExamples,
|
|
@@ -594,7 +594,7 @@ export async function formatCommanderUsageJson(error, rootProgram, extensionDesc
|
|
|
594
594
|
unknownOptionOtherCommands: usageContext.unknownOptionOtherCommands,
|
|
595
595
|
suggestedRetryCommand: usageContext.suggestedRetryCommand,
|
|
596
596
|
});
|
|
597
|
-
return JSON.stringify(envelope, null, 2);
|
|
597
|
+
return JSON.stringify(lean ? projectLeanErrorEnvelope(envelope) : envelope, null, 2);
|
|
598
598
|
}
|
|
599
599
|
/** Public contract for test only, shared by SDK and presentation-layer consumers. */
|
|
600
600
|
export const _testOnly = {
|
|
@@ -605,4 +605,4 @@ export const _testOnly = {
|
|
|
605
605
|
suggestNearestLongFlags,
|
|
606
606
|
};
|
|
607
607
|
//# sourceMappingURL=commander-usage.js.map
|
|
608
|
-
//# debugId=
|
|
608
|
+
//# debugId=04cd5219-f0a4-5eb4-b587-452c2eacfb32
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commander-usage.js","sources":["cli/commander-usage.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commander-usage\n *\n * Provides CLI runtime support for Commander Usage.\n */\nimport { Command } from \"commander\";\nimport { pathExists } from \"../core/fs/fs-utils.js\";\nimport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nimport { readSettings } from \"../core/store/settings.js\";\nimport { BUILTIN_ITEM_TYPE_VALUES } from \"../types/index.js\";\nimport {\n getActiveExtensionRegistrations,\n runActiveServiceOverride,\n} from \"../core/extensions/index.js\";\nimport {\n PM_CORE_COMMAND_NAMES,\n resolveSubcommandFlagContractsForCommand,\n type CliFlagContract,\n} from \"../sdk/cli-contracts.js\";\nimport {\n type CommanderGuidanceContext,\n formatCommanderErrorForDisplay,\n formatCommanderErrorForJson,\n} from \"./error-guidance.js\";\nimport { normalizeHelpCommandPath } from \"./help-content.js\";\nimport { getCommandPath } from \"./registration-helpers.js\";\nimport {\n EXECUTABLE_COMMAND_ALIASES,\n normalizeBootstrapInvocation,\n parseBootstrapGlobalOptions,\n parseBootstrapCommandName,\n} from \"./bootstrap-args.js\";\nimport {\n extractProvidedOptionFlags,\n normalizeLongFlag,\n renderPmCommand,\n} from \"./argv-utils.js\";\nimport { levenshteinDistanceWithinLimit } from \"../core/shared/levenshtein.js\";\nimport type { ExtensionCommandHelpDescriptor } from \"./extension-command-help.js\";\nimport { normalizeExtensionNameForMatch } from \"./commands/extension/shared.js\";\n\n/** Supported values accepted by the builtin type help contract. */\nexport const BUILTIN_TYPE_HELP_VALUES = BUILTIN_ITEM_TYPE_VALUES.join(\"|\");\n\nconst OPTIONAL_PACKAGE_INSTALL_HINTS: Record<string, string> = {\n calendar: \"calendar\",\n cal: \"calendar\",\n reindex: \"search-advanced\",\n \"search-advanced\": \"search-advanced\",\n guide: \"guide-shell\",\n completion: \"guide-shell\",\n templates: \"templates\",\n \"test-runs\": \"linked-test-adapters\",\n beads: \"beads\",\n todos: \"todos\",\n};\n\nconst SEMANTIC_UNKNOWN_OPTION_SUGGESTIONS: Record<\n string,\n Record<string, string[]>\n> = {\n comments: {\n \"--body\": [\"--add\"],\n \"--text\": [\"--add\"],\n \"--comment\": [\"--add\"],\n },\n notes: {\n \"--body\": [\"--add\"],\n \"--text\": [\"--add\"],\n \"--note\": [\"--add\"],\n },\n learnings: {\n \"--body\": [\"--add\"],\n \"--text\": [\"--add\"],\n \"--learning\": [\"--add\"],\n },\n // pm update / pm create now accept --add-tags natively, so the singular\n // --add-tag and the old \"--tag\" mistype still need to be redirected at the\n // canonical additive flag (not at --tags, which would silently replace).\n update: {\n \"--add-tag\": [\"--add-tags\"],\n \"--remove-tag\": [\"--remove-tags\"],\n \"--tag\": [\"--tags\"],\n },\n create: {\n \"--add-tag\": [\"--add-tags\"],\n \"--tag\": [\"--tags\"],\n },\n};\n\nfunction getSemanticUnknownOptionSuggestions(\n commandName: string,\n unknownOption: string,\n): string[] {\n const commandSuggestions = SEMANTIC_UNKNOWN_OPTION_SUGGESTIONS[commandName];\n if (!commandSuggestions) {\n return [];\n }\n const normalizedUnknown = normalizeLongFlag(unknownOption);\n for (const [flag, suggestions] of Object.entries(commandSuggestions)) {\n if (normalizeLongFlag(flag) === normalizedUnknown) {\n return suggestions;\n }\n }\n return [];\n}\n\n/** Documents the commander usage context payload exchanged by command, SDK, and package integrations. */\nexport interface CommanderUsageContext extends CommanderGuidanceContext {\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message: string;\n /** Value that configures or reports command name for this contract. */\n commandName: string | undefined;\n /** Value that configures or reports allowed types for this contract. */\n allowedTypes: string;\n}\n\n/** Implements collect runtime command paths for the public runtime surface of this module. */\nexport function collectRuntimeCommandPaths(\n root: Command,\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>,\n): string[] {\n const commandPaths = new Set<string>();\n const queue: Command[] = [...root.commands];\n while (queue.length > 0) {\n const current = queue.shift();\n if (!current) {\n continue;\n }\n const normalizedPath = normalizeHelpCommandPath(getCommandPath(current));\n const hasInternalSegment = normalizedPath\n .split(\" \")\n .some((segment) => segment.startsWith(\"_\"));\n if (normalizedPath.length > 0 && !hasInternalSegment) {\n commandPaths.add(normalizedPath);\n }\n queue.push(...current.commands);\n }\n for (const descriptorPath of extensionDescriptors.keys()) {\n const normalizedPath = normalizeHelpCommandPath(descriptorPath);\n const hasInternalSegment = normalizedPath\n .split(\" \")\n .some((segment) => segment.startsWith(\"_\"));\n if (normalizedPath.length > 0 && !hasInternalSegment) {\n commandPaths.add(normalizedPath);\n }\n }\n return [...commandPaths].sort((left, right) => left.localeCompare(right));\n}\n\n/** Implements score command path match for the public runtime surface of this module. */\nexport function scoreCommandPathMatch(\n commandPath: string,\n queryToken: string,\n): number {\n const normalizedPath = commandPath.trim().toLowerCase();\n const normalizedToken = queryToken.trim().toLowerCase();\n if (normalizedToken.length === 0) {\n return Number.POSITIVE_INFINITY;\n }\n const pathSegments = normalizedPath.split(\" \");\n if (normalizedPath === normalizedToken) {\n return 0;\n }\n if (pathSegments.includes(normalizedToken)) {\n return 1;\n }\n if (pathSegments.some((segment) => segment.startsWith(normalizedToken))) {\n return 2;\n }\n if (normalizedPath.includes(normalizedToken)) {\n return 3;\n }\n // Fall back to edit distance so transposition/typo cases (e.g. \"lst\" -> \"list\") still rank.\n const maxDistance = normalizedToken.length >= 5 ? 2 : 1;\n let bestDistance = Number.POSITIVE_INFINITY;\n for (const segment of pathSegments) {\n const distance = levenshteinDistanceWithinLimit(\n segment,\n normalizedToken,\n maxDistance,\n );\n if (distance !== null) {\n bestDistance = Math.min(bestDistance, distance);\n }\n }\n if (Number.isFinite(bestDistance)) {\n return 4 + bestDistance;\n }\n return Number.POSITIVE_INFINITY;\n}\n\nfunction toComparableFlag(flag: string): string {\n return normalizeLongFlag(flag).slice(2).replace(/-/g, \"\");\n}\n\nfunction renderAttemptedCommand(argv: string[]): string {\n return renderPmCommand(argv);\n}\n\nfunction resolveOptionalPackageInstallHint(commandPath: string): string | null {\n const topLevel = commandPath.split(\" \")[0]?.trim().toLowerCase();\n if (!topLevel) {\n return null;\n }\n const packageAlias = OPTIONAL_PACKAGE_INSTALL_HINTS[topLevel];\n if (!packageAlias) {\n return null;\n }\n return `If this command comes from an optional package, install it with: pm install ${packageAlias}`;\n}\n\nfunction normalizePackageCommandAliasToken(value: string): string {\n let normalized = normalizeExtensionNameForMatch(value);\n // Strip outer package/source prefixes and then the pm- package stem so scoped\n // and builtin package guesses converge on the exported command alias.\n for (const prefix of [\"@unbraind/\", \"@unbrained/\", \"builtin-\", \"pm-\"]) {\n if (normalized.startsWith(prefix)) {\n normalized = normalized.slice(prefix.length);\n }\n }\n return normalized;\n}\n\nfunction collectInstalledPackageCommandPathHints(\n unknownToken: string,\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>,\n): string[] {\n const normalizedUnknown = normalizePackageCommandAliasToken(unknownToken);\n if (normalizedUnknown.length === 0) {\n return [];\n }\n const hints: string[] = [];\n for (const descriptor of extensionDescriptors.values()) {\n const identifiers = new Set<string>();\n const source = descriptor.source;\n if (source) {\n for (const identifier of [source.name, source.package]) {\n const normalizedIdentifier = normalizePackageCommandAliasToken(\n identifier ?? \"\",\n );\n if (normalizedIdentifier.length > 0) {\n identifiers.add(normalizedIdentifier);\n }\n }\n }\n if (identifiers.size === 0) {\n continue;\n }\n const matches = [...identifiers].some(\n (identifier) =>\n identifier === normalizedUnknown ||\n identifier.includes(normalizedUnknown) ||\n normalizedUnknown.includes(identifier),\n );\n if (matches) {\n hints.push(descriptor.command);\n }\n }\n return [...new Set(hints)].sort((left, right) => left.localeCompare(right));\n}\n\nfunction collectKnownLongFlags(\n commandName: string | undefined,\n contractsOverride?: CliFlagContract[],\n): string[] {\n const flags = new Set<string>();\n const contracts =\n contractsOverride ?? resolveSubcommandFlagContractsForCommand(commandName);\n for (const contract of contracts) {\n if (contract.flag.startsWith(\"--\")) {\n flags.add(normalizeLongFlag(contract.flag));\n }\n for (const alias of contract.aliases ?? []) {\n if (alias.startsWith(\"--\")) {\n flags.add(normalizeLongFlag(alias));\n }\n }\n }\n return [...flags].sort((left, right) => left.localeCompare(right));\n}\n\nfunction suggestNearestLongFlags(\n unknownOption: string,\n knownFlags: string[],\n): string[] {\n if (!unknownOption.startsWith(\"--\")) {\n return [];\n }\n const unknownComparable = toComparableFlag(unknownOption);\n if (unknownComparable.length === 0) {\n return [];\n }\n const maxDistance = unknownComparable.length >= 8 ? 2 : 1;\n // rank 0 = abbreviation/prefix match (e.g. --desc -> --description), rank 1 = edit-distance typo.\n const candidates: Array<{ flag: string; rank: number; distance: number }> =\n [];\n for (const flag of knownFlags) {\n const flagComparable = toComparableFlag(flag);\n if (flagComparable === unknownComparable) {\n continue;\n }\n if (\n unknownComparable.length >= 3 &&\n flagComparable.startsWith(unknownComparable)\n ) {\n candidates.push({\n flag,\n rank: 0,\n distance: flagComparable.length - unknownComparable.length,\n });\n continue;\n }\n const distance = levenshteinDistanceWithinLimit(\n unknownComparable,\n flagComparable,\n maxDistance,\n );\n if (distance === null || distance <= 0) {\n continue;\n }\n candidates.push({ flag, rank: 1, distance });\n }\n return candidates\n .sort((left, right) => {\n if (left.rank !== right.rank) {\n return left.rank - right.rank;\n }\n if (left.distance !== right.distance) {\n return left.distance - right.distance;\n }\n return left.flag.localeCompare(right.flag);\n })\n .map((entry) => entry.flag)\n .slice(0, 3);\n}\n\nlet crossCommandFlagIndexCache: Map<string, string[]> | undefined;\n\n// Alias/shortcut command names that duplicate a canonical command. Excluding them\n// keeps cross-command flag hints focused on the primary commands an agent should use.\nconst CROSS_COMMAND_FLAG_EXCLUSIONS = new Set<string>([\n \"ctx\",\n \"packages\",\n \"list-draft\",\n \"list-open\",\n \"list-in-progress\",\n \"list-blocked\",\n \"list-closed\",\n \"list-canceled\",\n \"start-task\",\n \"pause-task\",\n \"close-task\",\n \"help\",\n]);\n\n// Index of long flag -> command names that accept it (in declaration order), so an\n// unknown flag on one command can be recognised as valid elsewhere (e.g. --type is\n// rejected on test-all but valid on create/list). Built once from core command contracts.\nfunction getCrossCommandFlagIndex(): Map<string, string[]> {\n if (crossCommandFlagIndexCache) {\n return crossCommandFlagIndexCache;\n }\n const index = new Map<string, string[]>();\n for (const command of PM_CORE_COMMAND_NAMES) {\n if (CROSS_COMMAND_FLAG_EXCLUSIONS.has(command)) {\n continue;\n }\n for (const flag of collectKnownLongFlags(command)) {\n const commands = index.get(flag) ?? [];\n commands.push(command);\n index.set(flag, commands);\n }\n }\n crossCommandFlagIndexCache = index;\n return crossCommandFlagIndexCache;\n}\n\nfunction findOtherCommandsForFlag(\n unknownOption: string,\n currentCommand: string | undefined,\n): string[] {\n if (!unknownOption.startsWith(\"--\")) {\n return [];\n }\n const commands = getCrossCommandFlagIndex().get(\n normalizeLongFlag(unknownOption),\n );\n if (!commands) {\n return [];\n }\n const normalizedCurrent = currentCommand?.trim().toLowerCase();\n return commands\n .filter((command) => command !== normalizedCurrent)\n .slice(0, 3);\n}\n\nfunction rewriteUnknownOptionArgv(\n argv: string[],\n unknownOption: string,\n replacementFlag: string,\n): string[] | undefined {\n for (let index = 0; index < argv.length; index += 1) {\n const token = argv[index];\n if (!token.startsWith(\"--\")) {\n continue;\n }\n const equalsIndex = token.indexOf(\"=\");\n const key = equalsIndex >= 0 ? token.slice(0, equalsIndex) : token;\n if (normalizeLongFlag(key) !== normalizeLongFlag(unknownOption)) {\n continue;\n }\n const next = [...argv];\n next[index] =\n equalsIndex >= 0\n ? `${replacementFlag}${token.slice(equalsIndex)}`\n : replacementFlag;\n return next;\n }\n return undefined;\n}\n\nfunction scoreRuntimeCommandCandidates(params: {\n commandPaths: string[];\n normalizedUnknown: string;\n primaryToken: string;\n}): string[] {\n const commandPathSet = new Set(params.commandPaths);\n const scoreAgainstUnknown = (candidatePath: string): number =>\n Math.min(\n scoreCommandPathMatch(candidatePath, params.normalizedUnknown),\n params.primaryToken !== params.normalizedUnknown\n ? scoreCommandPathMatch(candidatePath, params.primaryToken)\n : Number.POSITIVE_INFINITY,\n );\n const scoresByCommandPath = new Map<string, number>();\n const recordCandidateScore = (commandPath: string, score: number): void => {\n if (!Number.isFinite(score) || !commandPathSet.has(commandPath)) {\n return;\n }\n const existing = scoresByCommandPath.get(commandPath);\n if (existing === undefined || score < existing) {\n scoresByCommandPath.set(commandPath, score);\n }\n };\n for (const commandPath of params.commandPaths) {\n recordCandidateScore(commandPath, scoreAgainstUnknown(commandPath));\n }\n for (const [aliasToken, canonicalPath] of Object.entries(\n EXECUTABLE_COMMAND_ALIASES,\n )) {\n recordCandidateScore(canonicalPath, scoreAgainstUnknown(aliasToken));\n }\n return [...scoresByCommandPath.entries()]\n .sort(([leftPath, leftScore], [rightPath, rightScore]) =>\n leftScore !== rightScore\n ? leftScore - rightScore\n : leftPath.localeCompare(rightPath),\n )\n .map(([commandPath]) => commandPath);\n}\n\nfunction resolveUnknownCommandCandidates(params: {\n commandPaths: string[];\n normalizedUnknown: string;\n primaryToken: string;\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>;\n}): string[] {\n const rankedCandidates = scoreRuntimeCommandCandidates(params);\n const installedPackageCandidates = collectInstalledPackageCommandPathHints(\n params.primaryToken,\n params.extensionDescriptors,\n ).filter((commandPath) => params.commandPaths.includes(commandPath));\n return dedupeStrings([...rankedCandidates, ...installedPackageCandidates]);\n}\n\nfunction resolveUnknownCommandFallbacks(commandPaths: string[]): string[] {\n const topLevel = [\n ...new Set(\n commandPaths\n .map((commandPath) => commandPath.split(\" \")[0])\n .filter((segment) => segment.length > 0),\n ),\n ];\n return topLevel.sort((left, right) => left.localeCompare(right));\n}\n\nfunction buildUnknownCommandExamples(\n suggestedPaths: string[],\n hasConcreteCandidates: boolean,\n): string[] {\n const suggestedExamples = suggestedPaths.map((path) => `pm ${path} --help`);\n if (hasConcreteCandidates) {\n return [...new Set([...suggestedExamples, \"pm --help\"])];\n }\n return [...new Set([\"pm --help\", ...suggestedExamples])];\n}\n\n/** Implements build unknown command guidance from runtime for the public runtime surface of this module. */\nexport function buildUnknownCommandGuidanceFromRuntime(\n rawMessage: string,\n root: Command,\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>,\n): CommanderGuidanceContext | undefined {\n const unknownCommandMatch = rawMessage.match(/unknown command '([^']+)'/i);\n if (!unknownCommandMatch || typeof unknownCommandMatch[1] !== \"string\") {\n return undefined;\n }\n const normalizedUnknown = normalizeHelpCommandPath(unknownCommandMatch[1]);\n if (normalizedUnknown.length === 0) {\n return undefined;\n }\n const commandPaths = collectRuntimeCommandPaths(root, extensionDescriptors);\n if (commandPaths.length === 0) {\n return undefined;\n }\n\n const primaryToken = normalizedUnknown.split(\" \")[0];\n // Executable aliases are scored against their canonical runtime command, so a\n // typo of an alias still points at the command path that would actually run.\n const combinedCandidates = resolveUnknownCommandCandidates({\n commandPaths,\n normalizedUnknown,\n primaryToken,\n extensionDescriptors,\n });\n const fallbackTopLevel = resolveUnknownCommandFallbacks(commandPaths);\n const suggestedPaths = (\n combinedCandidates.length > 0 ? combinedCandidates : fallbackTopLevel\n ).slice(0, 3);\n const examples = buildUnknownCommandExamples(\n suggestedPaths,\n combinedCandidates.length > 0,\n );\n const optionalPackageHint =\n resolveOptionalPackageInstallHint(normalizedUnknown);\n const didYouMean =\n combinedCandidates.length > 0\n ? `Did you mean: ${suggestedPaths.join(\", \")}?`\n : null;\n\n return {\n unknownCommandExamples: examples,\n unknownCommandNextSteps: [\n ...(didYouMean ? [didYouMean] : []),\n 'Run \"pm --help\" to list commands available in this runtime, including active extensions.',\n \"Use one of the suggested command paths above with --help to inspect valid flags and usage.\",\n ...(optionalPackageHint ? [optionalPackageHint] : []),\n ],\n };\n}\n\nfunction dedupeStrings(values: string[]): string[] {\n return Array.from(new Set(values));\n}\n\nfunction firstWhitespaceSeparatedToken(input: string): string {\n let token = \"\";\n for (const character of input) {\n if (\n character === \" \" ||\n character === \"\\t\" ||\n character === \"\\n\" ||\n character === \"\\r\" ||\n character === \"\\f\" ||\n character === \"\\v\"\n ) {\n break;\n }\n token += character;\n }\n return token;\n}\n\nfunction trimTrailingPunctuationToken(token: string): string {\n let end = token.length;\n while (end > 0) {\n const character = token[end - 1];\n if (character !== \",\" && character !== \":\" && character !== \";\") {\n break;\n }\n end -= 1;\n }\n return token.slice(0, end);\n}\n\n/** Implements resolve child command by token for the public runtime surface of this module. */\nexport function resolveChildCommandByToken(\n parent: Command,\n token: string,\n): Command | undefined {\n const normalizedToken = token.trim().toLowerCase();\n return parent.commands.find((candidate) => {\n if (candidate.name().trim().toLowerCase() === normalizedToken) {\n return true;\n }\n const aliases =\n typeof candidate.aliases === \"function\" ? candidate.aliases() : [];\n return aliases.some(\n (alias) => alias.trim().toLowerCase() === normalizedToken,\n );\n });\n}\n\n/** Implements check whether known help command path for the public runtime surface of this module. */\nexport function isKnownHelpCommandPath(\n root: Command,\n commandPathTokens: string[],\n): boolean {\n if (commandPathTokens.length === 0) {\n return true;\n }\n let current = root;\n let matchedAny = false;\n for (const token of commandPathTokens) {\n const next = resolveChildCommandByToken(current, token);\n if (!next) {\n return matchedAny;\n }\n matchedAny = true;\n current = next;\n }\n return matchedAny;\n}\n\nasync function resolveAllowedTypesForUsage(\n bootstrapGlobal: ReturnType<typeof parseBootstrapGlobalOptions>,\n): Promise<string> {\n try {\n const pmRoot = resolvePmRoot(process.cwd(), bootstrapGlobal.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n return BUILTIN_TYPE_HELP_VALUES;\n }\n const settings = await readSettings(pmRoot);\n const extensionRegistrations = bootstrapGlobal.noExtensions\n ? undefined\n : getActiveExtensionRegistrations();\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n extensionRegistrations,\n );\n return typeRegistry.types.length > 0\n ? typeRegistry.types.join(\"|\")\n : BUILTIN_TYPE_HELP_VALUES;\n } catch {\n /* v8 ignore start -- defensive fallback for corrupted settings during usage-error rendering; command behavior is covered through normal settings paths */\n return BUILTIN_TYPE_HELP_VALUES;\n /* v8 ignore stop */\n }\n}\n\nfunction resolveUnknownOptionSuggestions(\n message: string,\n commandName: string | undefined,\n): {\n match: RegExpMatchArray | null;\n suggestions: string[] | undefined;\n otherCommands: string[];\n} {\n const match = message.match(/unknown option '([^']+)'/i);\n const suggestions =\n match && commandName\n ? dedupeStrings([\n ...getSemanticUnknownOptionSuggestions(commandName, match[1]),\n ...suggestNearestLongFlags(\n match[1],\n collectKnownLongFlags(commandName),\n ),\n ])\n : undefined;\n return {\n match,\n suggestions,\n otherCommands: match ? findOtherCommandsForFlag(match[1], commandName) : [],\n };\n}\n\nfunction resolveSuggestedRetryForUnknownOption(\n invocationArgv: string[],\n unknownOptionMatch: RegExpMatchArray | null,\n unknownOptionSuggestions: string[] | undefined,\n): string | undefined {\n if (\n !unknownOptionMatch ||\n !unknownOptionSuggestions ||\n unknownOptionSuggestions.length === 0\n ) {\n return undefined;\n }\n const rewritten = rewriteUnknownOptionArgv(\n invocationArgv,\n unknownOptionMatch[1],\n unknownOptionSuggestions[0],\n );\n return rewritten ? renderAttemptedCommand(rewritten) : undefined;\n}\n\nfunction resolveSuggestedRetryForMissingOption(\n message: string,\n invocationArgv: string[],\n): string | undefined {\n const missingRequiredOption = message.match(\n /required option '([^']+)' not specified/i,\n );\n const requiredOptionToken = missingRequiredOption?.[1]\n ? trimTrailingPunctuationToken(\n firstWhitespaceSeparatedToken(missingRequiredOption[1].trim()),\n )\n : undefined;\n if (!requiredOptionToken?.startsWith(\"--\")) {\n return undefined;\n }\n const hasFlag = invocationArgv.some(\n (token) =>\n token === requiredOptionToken ||\n token.startsWith(`${requiredOptionToken}=`),\n );\n return hasFlag\n ? undefined\n : renderAttemptedCommand([\n ...invocationArgv,\n requiredOptionToken,\n \"<value>\",\n ]);\n}\n\n/** Implements resolve commander usage context for the public runtime surface of this module. */\nexport async function resolveCommanderUsageContext(\n error: unknown,\n rootProgram: Command,\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>,\n): Promise<CommanderUsageContext> {\n const rawMessage =\n typeof error === \"object\" && error !== null\n ? (error as { message?: string }).message\n : undefined;\n const message = rawMessage ?? \"Invalid command usage\";\n const invocationArgv = normalizeBootstrapInvocation(\n process.argv.slice(2),\n ).argv;\n const bootstrapGlobal = parseBootstrapGlobalOptions(invocationArgv);\n const commandName = parseBootstrapCommandName(invocationArgv);\n const attemptedCommand = renderAttemptedCommand(invocationArgv);\n const providedOptionFlags = extractProvidedOptionFlags(invocationArgv);\n const allowedTypes = await resolveAllowedTypesForUsage(bootstrapGlobal);\n const unknownCommandGuidance = buildUnknownCommandGuidanceFromRuntime(\n message,\n rootProgram,\n extensionDescriptors,\n );\n const unknownOption = resolveUnknownOptionSuggestions(message, commandName);\n const suggestedRetryCommand =\n resolveSuggestedRetryForUnknownOption(\n invocationArgv,\n unknownOption.match,\n unknownOption.suggestions,\n ) ?? resolveSuggestedRetryForMissingOption(message, invocationArgv);\n return {\n message,\n commandName,\n allowedTypes,\n attemptedCommand,\n normalizedInvocationArgs: [...invocationArgv],\n providedOptionFlags,\n unknownOptionSuggestions: unknownOption.suggestions,\n unknownOptionOtherCommands:\n unknownOption.otherCommands.length > 0\n ? unknownOption.otherCommands\n : undefined,\n suggestedRetryCommand,\n ...unknownCommandGuidance,\n };\n}\n\n/** Implements format commander usage message for the public runtime surface of this module. */\nexport async function formatCommanderUsageMessage(\n error: unknown,\n rootProgram: Command,\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>,\n): Promise<string> {\n const usageContext = await resolveCommanderUsageContext(\n error,\n rootProgram,\n extensionDescriptors,\n );\n const {\n message,\n commandName,\n allowedTypes,\n unknownCommandExamples,\n unknownCommandNextSteps,\n attemptedCommand,\n normalizedInvocationArgs,\n providedOptionFlags,\n unknownOptionSuggestions,\n unknownOptionOtherCommands,\n suggestedRetryCommand,\n } = usageContext;\n const formatted = formatCommanderErrorForDisplay(\n message,\n commandName,\n allowedTypes,\n {\n unknownCommandExamples,\n unknownCommandNextSteps,\n attemptedCommand,\n normalizedInvocationArgs,\n providedOptionFlags,\n unknownOptionSuggestions,\n unknownOptionOtherCommands,\n suggestedRetryCommand,\n },\n );\n const serviceOverride = await runActiveServiceOverride(\"help_format\", {\n message: formatted,\n command: commandName,\n allowed_types: allowedTypes,\n });\n if (serviceOverride.handled && typeof serviceOverride.result === \"string\") {\n return serviceOverride.result;\n }\n return formatted;\n}\n\n/** Implements format commander usage json for the public runtime surface of this module. */\nexport async function formatCommanderUsageJson(\n error: unknown,\n rootProgram: Command,\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>,\n): Promise<string> {\n const usageContext = await resolveCommanderUsageContext(\n error,\n rootProgram,\n extensionDescriptors,\n );\n const envelope = formatCommanderErrorForJson(\n usageContext.message,\n usageContext.commandName,\n usageContext.allowedTypes,\n EXIT_CODE.USAGE,\n {\n unknownCommandExamples: usageContext.unknownCommandExamples,\n unknownCommandNextSteps: usageContext.unknownCommandNextSteps,\n attemptedCommand: usageContext.attemptedCommand,\n normalizedInvocationArgs: usageContext.normalizedInvocationArgs,\n providedOptionFlags: usageContext.providedOptionFlags,\n unknownOptionSuggestions: usageContext.unknownOptionSuggestions,\n unknownOptionOtherCommands: usageContext.unknownOptionOtherCommands,\n suggestedRetryCommand: usageContext.suggestedRetryCommand,\n },\n );\n return JSON.stringify(envelope, null, 2);\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n collectKnownLongFlags,\n collectInstalledPackageCommandPathHints,\n resolveOptionalPackageInstallHint,\n resolveSuggestedRetryForMissingOption,\n suggestNearestLongFlags,\n};\n"],"names":[],"mappings":";;AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,qBAAqB,EACrB,wCAAwC,GAEzC,MAAM,yBAAyB,CAAC;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OAAO,eAAe,CAAC,MAAM,CAAC;IAChC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,4FAA4F;AAC5F,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,KAAc,EACd,WAAoB,EACpB,oBAAyE;IAEzE,MAAM,YAAY,GAAG,MAAM,4BAA4B,CACrD,KAAK,EACL,WAAW,EACX,oBAAoB,CACrB,CAAC;IACF,MAAM,QAAQ,GAAG,2BAA2B,CAC1C,YAAY,CAAC,OAAO,EACpB,YAAY,CAAC,WAAW,EACxB,YAAY,CAAC,YAAY,EACzB,SAAS,CAAC,KAAK,EACf;QACE,sBAAsB,EAAE,YAAY,CAAC,sBAAsB;QAC3D,uBAAuB,EAAE,YAAY,CAAC,uBAAuB;QAC7D,gBAAgB,EAAE,YAAY,CAAC,gBAAgB;QAC/C,wBAAwB,EAAE,YAAY,CAAC,wBAAwB;QAC/D,mBAAmB,EAAE,YAAY,CAAC,mBAAmB;QACrD,wBAAwB,EAAE,YAAY,CAAC,wBAAwB;QAC/D,0BAA0B,EAAE,YAAY,CAAC,0BAA0B;QACnE,qBAAqB,EAAE,YAAY,CAAC,qBAAqB;KAC1D,CACF,CAAC;IACF,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,qFAAqF;AACrF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,qBAAqB;IACrB,uCAAuC;IACvC,iCAAiC;IACjC,qCAAqC;IACrC,uBAAuB;CACxB,CAAC","debugId":"2725c3e6-4c5f-576d-93b2-914b27beb245"}
|
|
1
|
+
{"version":3,"file":"commander-usage.js","sources":["cli/commander-usage.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commander-usage\n *\n * Provides CLI runtime support for Commander Usage.\n */\nimport { Command } from \"commander\";\nimport { pathExists } from \"../core/fs/fs-utils.js\";\nimport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nimport { readSettings } from \"../core/store/settings.js\";\nimport { BUILTIN_ITEM_TYPE_VALUES } from \"../types/index.js\";\nimport {\n getActiveExtensionRegistrations,\n runActiveServiceOverride,\n} from \"../core/extensions/index.js\";\nimport {\n PM_CORE_COMMAND_NAMES,\n resolveSubcommandFlagContractsForCommand,\n type CliFlagContract,\n} from \"../sdk/cli-contracts.js\";\nimport {\n type CommanderGuidanceContext,\n formatCommanderErrorForDisplay,\n formatCommanderErrorForJson,\n projectLeanErrorEnvelope,\n} from \"./error-guidance.js\";\nimport { normalizeHelpCommandPath } from \"./help-content.js\";\nimport { getCommandPath } from \"./registration-helpers.js\";\nimport {\n EXECUTABLE_COMMAND_ALIASES,\n normalizeBootstrapInvocation,\n parseBootstrapGlobalOptions,\n parseBootstrapCommandName,\n} from \"./bootstrap-args.js\";\nimport {\n extractProvidedOptionFlags,\n normalizeLongFlag,\n renderPmCommand,\n} from \"./argv-utils.js\";\nimport { levenshteinDistanceWithinLimit } from \"../core/shared/levenshtein.js\";\nimport type { ExtensionCommandHelpDescriptor } from \"./extension-command-help.js\";\nimport { normalizeExtensionNameForMatch } from \"./commands/extension/shared.js\";\n\n/** Supported values accepted by the builtin type help contract. */\nexport const BUILTIN_TYPE_HELP_VALUES = BUILTIN_ITEM_TYPE_VALUES.join(\"|\");\n\nconst OPTIONAL_PACKAGE_INSTALL_HINTS: Record<string, string> = {\n calendar: \"calendar\",\n cal: \"calendar\",\n reindex: \"search-advanced\",\n \"search-advanced\": \"search-advanced\",\n guide: \"guide-shell\",\n completion: \"guide-shell\",\n templates: \"templates\",\n \"test-runs\": \"linked-test-adapters\",\n beads: \"beads\",\n todos: \"todos\",\n};\n\nconst SEMANTIC_UNKNOWN_OPTION_SUGGESTIONS: Record<\n string,\n Record<string, string[]>\n> = {\n comments: {\n \"--body\": [\"--add\"],\n \"--text\": [\"--add\"],\n \"--comment\": [\"--add\"],\n },\n notes: {\n \"--body\": [\"--add\"],\n \"--text\": [\"--add\"],\n \"--note\": [\"--add\"],\n },\n learnings: {\n \"--body\": [\"--add\"],\n \"--text\": [\"--add\"],\n \"--learning\": [\"--add\"],\n },\n // pm update / pm create now accept --add-tags natively, so the singular\n // --add-tag and the old \"--tag\" mistype still need to be redirected at the\n // canonical additive flag (not at --tags, which would silently replace).\n update: {\n \"--add-tag\": [\"--add-tags\"],\n \"--remove-tag\": [\"--remove-tags\"],\n \"--tag\": [\"--tags\"],\n },\n create: {\n \"--add-tag\": [\"--add-tags\"],\n \"--tag\": [\"--tags\"],\n },\n};\n\nfunction getSemanticUnknownOptionSuggestions(\n commandName: string,\n unknownOption: string,\n): string[] {\n const commandSuggestions = SEMANTIC_UNKNOWN_OPTION_SUGGESTIONS[commandName];\n if (!commandSuggestions) {\n return [];\n }\n const normalizedUnknown = normalizeLongFlag(unknownOption);\n for (const [flag, suggestions] of Object.entries(commandSuggestions)) {\n if (normalizeLongFlag(flag) === normalizedUnknown) {\n return suggestions;\n }\n }\n return [];\n}\n\n/** Documents the commander usage context payload exchanged by command, SDK, and package integrations. */\nexport interface CommanderUsageContext extends CommanderGuidanceContext {\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message: string;\n /** Value that configures or reports command name for this contract. */\n commandName: string | undefined;\n /** Value that configures or reports allowed types for this contract. */\n allowedTypes: string;\n}\n\n/** Implements collect runtime command paths for the public runtime surface of this module. */\nexport function collectRuntimeCommandPaths(\n root: Command,\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>,\n): string[] {\n const commandPaths = new Set<string>();\n const queue: Command[] = [...root.commands];\n while (queue.length > 0) {\n const current = queue.shift();\n if (!current) {\n continue;\n }\n const normalizedPath = normalizeHelpCommandPath(getCommandPath(current));\n const hasInternalSegment = normalizedPath\n .split(\" \")\n .some((segment) => segment.startsWith(\"_\"));\n if (normalizedPath.length > 0 && !hasInternalSegment) {\n commandPaths.add(normalizedPath);\n }\n queue.push(...current.commands);\n }\n for (const descriptorPath of extensionDescriptors.keys()) {\n const normalizedPath = normalizeHelpCommandPath(descriptorPath);\n const hasInternalSegment = normalizedPath\n .split(\" \")\n .some((segment) => segment.startsWith(\"_\"));\n if (normalizedPath.length > 0 && !hasInternalSegment) {\n commandPaths.add(normalizedPath);\n }\n }\n return [...commandPaths].sort((left, right) => left.localeCompare(right));\n}\n\n/** Implements score command path match for the public runtime surface of this module. */\nexport function scoreCommandPathMatch(\n commandPath: string,\n queryToken: string,\n): number {\n const normalizedPath = commandPath.trim().toLowerCase();\n const normalizedToken = queryToken.trim().toLowerCase();\n if (normalizedToken.length === 0) {\n return Number.POSITIVE_INFINITY;\n }\n const pathSegments = normalizedPath.split(\" \");\n if (normalizedPath === normalizedToken) {\n return 0;\n }\n if (pathSegments.includes(normalizedToken)) {\n return 1;\n }\n if (pathSegments.some((segment) => segment.startsWith(normalizedToken))) {\n return 2;\n }\n if (normalizedPath.includes(normalizedToken)) {\n return 3;\n }\n // Fall back to edit distance so transposition/typo cases (e.g. \"lst\" -> \"list\") still rank.\n const maxDistance = normalizedToken.length >= 5 ? 2 : 1;\n let bestDistance = Number.POSITIVE_INFINITY;\n for (const segment of pathSegments) {\n const distance = levenshteinDistanceWithinLimit(\n segment,\n normalizedToken,\n maxDistance,\n );\n if (distance !== null) {\n bestDistance = Math.min(bestDistance, distance);\n }\n }\n if (Number.isFinite(bestDistance)) {\n return 4 + bestDistance;\n }\n return Number.POSITIVE_INFINITY;\n}\n\nfunction toComparableFlag(flag: string): string {\n return normalizeLongFlag(flag).slice(2).replace(/-/g, \"\");\n}\n\nfunction renderAttemptedCommand(argv: string[]): string {\n return renderPmCommand(argv);\n}\n\nfunction resolveOptionalPackageInstallHint(commandPath: string): string | null {\n const topLevel = commandPath.split(\" \")[0]?.trim().toLowerCase();\n if (!topLevel) {\n return null;\n }\n const packageAlias = OPTIONAL_PACKAGE_INSTALL_HINTS[topLevel];\n if (!packageAlias) {\n return null;\n }\n return `If this command comes from an optional package, install it with: pm install ${packageAlias}`;\n}\n\nfunction normalizePackageCommandAliasToken(value: string): string {\n let normalized = normalizeExtensionNameForMatch(value);\n // Strip outer package/source prefixes and then the pm- package stem so scoped\n // and builtin package guesses converge on the exported command alias.\n for (const prefix of [\"@unbraind/\", \"@unbrained/\", \"builtin-\", \"pm-\"]) {\n if (normalized.startsWith(prefix)) {\n normalized = normalized.slice(prefix.length);\n }\n }\n return normalized;\n}\n\nfunction collectInstalledPackageCommandPathHints(\n unknownToken: string,\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>,\n): string[] {\n const normalizedUnknown = normalizePackageCommandAliasToken(unknownToken);\n if (normalizedUnknown.length === 0) {\n return [];\n }\n const hints: string[] = [];\n for (const descriptor of extensionDescriptors.values()) {\n const identifiers = new Set<string>();\n const source = descriptor.source;\n if (source) {\n for (const identifier of [source.name, source.package]) {\n const normalizedIdentifier = normalizePackageCommandAliasToken(\n identifier ?? \"\",\n );\n if (normalizedIdentifier.length > 0) {\n identifiers.add(normalizedIdentifier);\n }\n }\n }\n if (identifiers.size === 0) {\n continue;\n }\n const matches = [...identifiers].some(\n (identifier) =>\n identifier === normalizedUnknown ||\n identifier.includes(normalizedUnknown) ||\n normalizedUnknown.includes(identifier),\n );\n if (matches) {\n hints.push(descriptor.command);\n }\n }\n return [...new Set(hints)].sort((left, right) => left.localeCompare(right));\n}\n\nfunction collectKnownLongFlags(\n commandName: string | undefined,\n contractsOverride?: CliFlagContract[],\n): string[] {\n const flags = new Set<string>();\n const contracts =\n contractsOverride ?? resolveSubcommandFlagContractsForCommand(commandName);\n for (const contract of contracts) {\n if (contract.flag.startsWith(\"--\")) {\n flags.add(normalizeLongFlag(contract.flag));\n }\n for (const alias of contract.aliases ?? []) {\n if (alias.startsWith(\"--\")) {\n flags.add(normalizeLongFlag(alias));\n }\n }\n }\n return [...flags].sort((left, right) => left.localeCompare(right));\n}\n\nfunction suggestNearestLongFlags(\n unknownOption: string,\n knownFlags: string[],\n): string[] {\n if (!unknownOption.startsWith(\"--\")) {\n return [];\n }\n const unknownComparable = toComparableFlag(unknownOption);\n if (unknownComparable.length === 0) {\n return [];\n }\n const maxDistance = unknownComparable.length >= 8 ? 2 : 1;\n // rank 0 = abbreviation/prefix match (e.g. --desc -> --description), rank 1 = edit-distance typo.\n const candidates: Array<{ flag: string; rank: number; distance: number }> =\n [];\n for (const flag of knownFlags) {\n const flagComparable = toComparableFlag(flag);\n if (flagComparable === unknownComparable) {\n continue;\n }\n if (\n unknownComparable.length >= 3 &&\n flagComparable.startsWith(unknownComparable)\n ) {\n candidates.push({\n flag,\n rank: 0,\n distance: flagComparable.length - unknownComparable.length,\n });\n continue;\n }\n const distance = levenshteinDistanceWithinLimit(\n unknownComparable,\n flagComparable,\n maxDistance,\n );\n if (distance === null || distance <= 0) {\n continue;\n }\n candidates.push({ flag, rank: 1, distance });\n }\n return candidates\n .sort((left, right) => {\n if (left.rank !== right.rank) {\n return left.rank - right.rank;\n }\n if (left.distance !== right.distance) {\n return left.distance - right.distance;\n }\n return left.flag.localeCompare(right.flag);\n })\n .map((entry) => entry.flag)\n .slice(0, 3);\n}\n\nlet crossCommandFlagIndexCache: Map<string, string[]> | undefined;\n\n// Alias/shortcut command names that duplicate a canonical command. Excluding them\n// keeps cross-command flag hints focused on the primary commands an agent should use.\nconst CROSS_COMMAND_FLAG_EXCLUSIONS = new Set<string>([\n \"ctx\",\n \"packages\",\n \"list-draft\",\n \"list-open\",\n \"list-in-progress\",\n \"list-blocked\",\n \"list-closed\",\n \"list-canceled\",\n \"start-task\",\n \"pause-task\",\n \"close-task\",\n \"help\",\n]);\n\n// Index of long flag -> command names that accept it (in declaration order), so an\n// unknown flag on one command can be recognised as valid elsewhere (e.g. --type is\n// rejected on test-all but valid on create/list). Built once from core command contracts.\nfunction getCrossCommandFlagIndex(): Map<string, string[]> {\n if (crossCommandFlagIndexCache) {\n return crossCommandFlagIndexCache;\n }\n const index = new Map<string, string[]>();\n for (const command of PM_CORE_COMMAND_NAMES) {\n if (CROSS_COMMAND_FLAG_EXCLUSIONS.has(command)) {\n continue;\n }\n for (const flag of collectKnownLongFlags(command)) {\n const commands = index.get(flag) ?? [];\n commands.push(command);\n index.set(flag, commands);\n }\n }\n crossCommandFlagIndexCache = index;\n return crossCommandFlagIndexCache;\n}\n\nfunction findOtherCommandsForFlag(\n unknownOption: string,\n currentCommand: string | undefined,\n): string[] {\n if (!unknownOption.startsWith(\"--\")) {\n return [];\n }\n const commands = getCrossCommandFlagIndex().get(\n normalizeLongFlag(unknownOption),\n );\n if (!commands) {\n return [];\n }\n const normalizedCurrent = currentCommand?.trim().toLowerCase();\n return commands\n .filter((command) => command !== normalizedCurrent)\n .slice(0, 3);\n}\n\nfunction rewriteUnknownOptionArgv(\n argv: string[],\n unknownOption: string,\n replacementFlag: string,\n): string[] | undefined {\n for (let index = 0; index < argv.length; index += 1) {\n const token = argv[index];\n if (!token.startsWith(\"--\")) {\n continue;\n }\n const equalsIndex = token.indexOf(\"=\");\n const key = equalsIndex >= 0 ? token.slice(0, equalsIndex) : token;\n if (normalizeLongFlag(key) !== normalizeLongFlag(unknownOption)) {\n continue;\n }\n const next = [...argv];\n next[index] =\n equalsIndex >= 0\n ? `${replacementFlag}${token.slice(equalsIndex)}`\n : replacementFlag;\n return next;\n }\n return undefined;\n}\n\nfunction scoreRuntimeCommandCandidates(params: {\n commandPaths: string[];\n normalizedUnknown: string;\n primaryToken: string;\n}): string[] {\n const commandPathSet = new Set(params.commandPaths);\n const scoreAgainstUnknown = (candidatePath: string): number =>\n Math.min(\n scoreCommandPathMatch(candidatePath, params.normalizedUnknown),\n params.primaryToken !== params.normalizedUnknown\n ? scoreCommandPathMatch(candidatePath, params.primaryToken)\n : Number.POSITIVE_INFINITY,\n );\n const scoresByCommandPath = new Map<string, number>();\n const recordCandidateScore = (commandPath: string, score: number): void => {\n if (!Number.isFinite(score) || !commandPathSet.has(commandPath)) {\n return;\n }\n const existing = scoresByCommandPath.get(commandPath);\n if (existing === undefined || score < existing) {\n scoresByCommandPath.set(commandPath, score);\n }\n };\n for (const commandPath of params.commandPaths) {\n recordCandidateScore(commandPath, scoreAgainstUnknown(commandPath));\n }\n for (const [aliasToken, canonicalPath] of Object.entries(\n EXECUTABLE_COMMAND_ALIASES,\n )) {\n recordCandidateScore(canonicalPath, scoreAgainstUnknown(aliasToken));\n }\n return [...scoresByCommandPath.entries()]\n .sort(([leftPath, leftScore], [rightPath, rightScore]) =>\n leftScore !== rightScore\n ? leftScore - rightScore\n : leftPath.localeCompare(rightPath),\n )\n .map(([commandPath]) => commandPath);\n}\n\nfunction resolveUnknownCommandCandidates(params: {\n commandPaths: string[];\n normalizedUnknown: string;\n primaryToken: string;\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>;\n}): string[] {\n const rankedCandidates = scoreRuntimeCommandCandidates(params);\n const installedPackageCandidates = collectInstalledPackageCommandPathHints(\n params.primaryToken,\n params.extensionDescriptors,\n ).filter((commandPath) => params.commandPaths.includes(commandPath));\n return dedupeStrings([...rankedCandidates, ...installedPackageCandidates]);\n}\n\nfunction resolveUnknownCommandFallbacks(commandPaths: string[]): string[] {\n const topLevel = [\n ...new Set(\n commandPaths\n .map((commandPath) => commandPath.split(\" \")[0])\n .filter((segment) => segment.length > 0),\n ),\n ];\n return topLevel.sort((left, right) => left.localeCompare(right));\n}\n\nfunction buildUnknownCommandExamples(\n suggestedPaths: string[],\n hasConcreteCandidates: boolean,\n): string[] {\n const suggestedExamples = suggestedPaths.map((path) => `pm ${path} --help`);\n if (hasConcreteCandidates) {\n return [...new Set([...suggestedExamples, \"pm --help\"])];\n }\n return [...new Set([\"pm --help\", ...suggestedExamples])];\n}\n\n/** Implements build unknown command guidance from runtime for the public runtime surface of this module. */\nexport function buildUnknownCommandGuidanceFromRuntime(\n rawMessage: string,\n root: Command,\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>,\n): CommanderGuidanceContext | undefined {\n const unknownCommandMatch = rawMessage.match(/unknown command '([^']+)'/i);\n if (!unknownCommandMatch || typeof unknownCommandMatch[1] !== \"string\") {\n return undefined;\n }\n const normalizedUnknown = normalizeHelpCommandPath(unknownCommandMatch[1]);\n if (normalizedUnknown.length === 0) {\n return undefined;\n }\n const commandPaths = collectRuntimeCommandPaths(root, extensionDescriptors);\n if (commandPaths.length === 0) {\n return undefined;\n }\n\n const primaryToken = normalizedUnknown.split(\" \")[0];\n // Executable aliases are scored against their canonical runtime command, so a\n // typo of an alias still points at the command path that would actually run.\n const combinedCandidates = resolveUnknownCommandCandidates({\n commandPaths,\n normalizedUnknown,\n primaryToken,\n extensionDescriptors,\n });\n const fallbackTopLevel = resolveUnknownCommandFallbacks(commandPaths);\n const suggestedPaths = (\n combinedCandidates.length > 0 ? combinedCandidates : fallbackTopLevel\n ).slice(0, 3);\n const examples = buildUnknownCommandExamples(\n suggestedPaths,\n combinedCandidates.length > 0,\n );\n const optionalPackageHint =\n resolveOptionalPackageInstallHint(normalizedUnknown);\n const didYouMean =\n combinedCandidates.length > 0\n ? `Did you mean: ${suggestedPaths.join(\", \")}?`\n : null;\n\n return {\n unknownCommandExamples: examples,\n unknownCommandNextSteps: [\n ...(didYouMean ? [didYouMean] : []),\n 'Run \"pm --help\" to list commands available in this runtime, including active extensions.',\n \"Use one of the suggested command paths above with --help to inspect valid flags and usage.\",\n ...(optionalPackageHint ? [optionalPackageHint] : []),\n ],\n };\n}\n\nfunction dedupeStrings(values: string[]): string[] {\n return Array.from(new Set(values));\n}\n\nfunction firstWhitespaceSeparatedToken(input: string): string {\n let token = \"\";\n for (const character of input) {\n if (\n character === \" \" ||\n character === \"\\t\" ||\n character === \"\\n\" ||\n character === \"\\r\" ||\n character === \"\\f\" ||\n character === \"\\v\"\n ) {\n break;\n }\n token += character;\n }\n return token;\n}\n\nfunction trimTrailingPunctuationToken(token: string): string {\n let end = token.length;\n while (end > 0) {\n const character = token[end - 1];\n if (character !== \",\" && character !== \":\" && character !== \";\") {\n break;\n }\n end -= 1;\n }\n return token.slice(0, end);\n}\n\n/** Implements resolve child command by token for the public runtime surface of this module. */\nexport function resolveChildCommandByToken(\n parent: Command,\n token: string,\n): Command | undefined {\n const normalizedToken = token.trim().toLowerCase();\n return parent.commands.find((candidate) => {\n if (candidate.name().trim().toLowerCase() === normalizedToken) {\n return true;\n }\n const aliases =\n typeof candidate.aliases === \"function\" ? candidate.aliases() : [];\n return aliases.some(\n (alias) => alias.trim().toLowerCase() === normalizedToken,\n );\n });\n}\n\n/** Implements check whether known help command path for the public runtime surface of this module. */\nexport function isKnownHelpCommandPath(\n root: Command,\n commandPathTokens: string[],\n): boolean {\n if (commandPathTokens.length === 0) {\n return true;\n }\n let current = root;\n let matchedAny = false;\n for (const token of commandPathTokens) {\n const next = resolveChildCommandByToken(current, token);\n if (!next) {\n return matchedAny;\n }\n matchedAny = true;\n current = next;\n }\n return matchedAny;\n}\n\nasync function resolveAllowedTypesForUsage(\n bootstrapGlobal: ReturnType<typeof parseBootstrapGlobalOptions>,\n): Promise<string> {\n try {\n const pmRoot = resolvePmRoot(process.cwd(), bootstrapGlobal.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n return BUILTIN_TYPE_HELP_VALUES;\n }\n const settings = await readSettings(pmRoot);\n const extensionRegistrations = bootstrapGlobal.noExtensions\n ? undefined\n : getActiveExtensionRegistrations();\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n extensionRegistrations,\n );\n return typeRegistry.types.length > 0\n ? typeRegistry.types.join(\"|\")\n : BUILTIN_TYPE_HELP_VALUES;\n } catch {\n /* v8 ignore start -- defensive fallback for corrupted settings during usage-error rendering; command behavior is covered through normal settings paths */\n return BUILTIN_TYPE_HELP_VALUES;\n /* v8 ignore stop */\n }\n}\n\nfunction resolveUnknownOptionSuggestions(\n message: string,\n commandName: string | undefined,\n): {\n match: RegExpMatchArray | null;\n suggestions: string[] | undefined;\n otherCommands: string[];\n} {\n const match = message.match(/unknown option '([^']+)'/i);\n const suggestions =\n match && commandName\n ? dedupeStrings([\n ...getSemanticUnknownOptionSuggestions(commandName, match[1]),\n ...suggestNearestLongFlags(\n match[1],\n collectKnownLongFlags(commandName),\n ),\n ])\n : undefined;\n return {\n match,\n suggestions,\n otherCommands: match ? findOtherCommandsForFlag(match[1], commandName) : [],\n };\n}\n\nfunction resolveSuggestedRetryForUnknownOption(\n invocationArgv: string[],\n unknownOptionMatch: RegExpMatchArray | null,\n unknownOptionSuggestions: string[] | undefined,\n): string | undefined {\n if (\n !unknownOptionMatch ||\n !unknownOptionSuggestions ||\n unknownOptionSuggestions.length === 0\n ) {\n return undefined;\n }\n const rewritten = rewriteUnknownOptionArgv(\n invocationArgv,\n unknownOptionMatch[1],\n unknownOptionSuggestions[0],\n );\n return rewritten ? renderAttemptedCommand(rewritten) : undefined;\n}\n\nfunction resolveSuggestedRetryForMissingOption(\n message: string,\n invocationArgv: string[],\n): string | undefined {\n const missingRequiredOption = message.match(\n /required option '([^']+)' not specified/i,\n );\n const requiredOptionToken = missingRequiredOption?.[1]\n ? trimTrailingPunctuationToken(\n firstWhitespaceSeparatedToken(missingRequiredOption[1].trim()),\n )\n : undefined;\n if (!requiredOptionToken?.startsWith(\"--\")) {\n return undefined;\n }\n const hasFlag = invocationArgv.some(\n (token) =>\n token === requiredOptionToken ||\n token.startsWith(`${requiredOptionToken}=`),\n );\n return hasFlag\n ? undefined\n : renderAttemptedCommand([\n ...invocationArgv,\n requiredOptionToken,\n \"<value>\",\n ]);\n}\n\n/** Implements resolve commander usage context for the public runtime surface of this module. */\nexport async function resolveCommanderUsageContext(\n error: unknown,\n rootProgram: Command,\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>,\n): Promise<CommanderUsageContext> {\n const rawMessage =\n typeof error === \"object\" && error !== null\n ? (error as { message?: string }).message\n : undefined;\n const message = rawMessage ?? \"Invalid command usage\";\n const invocationArgv = normalizeBootstrapInvocation(\n process.argv.slice(2),\n ).argv;\n const bootstrapGlobal = parseBootstrapGlobalOptions(invocationArgv);\n const commandName = parseBootstrapCommandName(invocationArgv);\n const attemptedCommand = renderAttemptedCommand(invocationArgv);\n const providedOptionFlags = extractProvidedOptionFlags(invocationArgv);\n const allowedTypes = await resolveAllowedTypesForUsage(bootstrapGlobal);\n const unknownCommandGuidance = buildUnknownCommandGuidanceFromRuntime(\n message,\n rootProgram,\n extensionDescriptors,\n );\n const unknownOption = resolveUnknownOptionSuggestions(message, commandName);\n const suggestedRetryCommand =\n resolveSuggestedRetryForUnknownOption(\n invocationArgv,\n unknownOption.match,\n unknownOption.suggestions,\n ) ?? resolveSuggestedRetryForMissingOption(message, invocationArgv);\n return {\n message,\n commandName,\n allowedTypes,\n attemptedCommand,\n normalizedInvocationArgs: [...invocationArgv],\n providedOptionFlags,\n unknownOptionSuggestions: unknownOption.suggestions,\n unknownOptionOtherCommands:\n unknownOption.otherCommands.length > 0\n ? unknownOption.otherCommands\n : undefined,\n suggestedRetryCommand,\n ...unknownCommandGuidance,\n };\n}\n\n/** Implements format commander usage message for the public runtime surface of this module. */\nexport async function formatCommanderUsageMessage(\n error: unknown,\n rootProgram: Command,\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>,\n): Promise<string> {\n const usageContext = await resolveCommanderUsageContext(\n error,\n rootProgram,\n extensionDescriptors,\n );\n const {\n message,\n commandName,\n allowedTypes,\n unknownCommandExamples,\n unknownCommandNextSteps,\n attemptedCommand,\n normalizedInvocationArgs,\n providedOptionFlags,\n unknownOptionSuggestions,\n unknownOptionOtherCommands,\n suggestedRetryCommand,\n } = usageContext;\n const formatted = formatCommanderErrorForDisplay(\n message,\n commandName,\n allowedTypes,\n {\n unknownCommandExamples,\n unknownCommandNextSteps,\n attemptedCommand,\n normalizedInvocationArgs,\n providedOptionFlags,\n unknownOptionSuggestions,\n unknownOptionOtherCommands,\n suggestedRetryCommand,\n },\n );\n const serviceOverride = await runActiveServiceOverride(\"help_format\", {\n message: formatted,\n command: commandName,\n allowed_types: allowedTypes,\n });\n if (serviceOverride.handled && typeof serviceOverride.result === \"string\") {\n return serviceOverride.result;\n }\n return formatted;\n}\n\n/** Implements format commander usage json for the public runtime surface of this module. */\nexport async function formatCommanderUsageJson(\n error: unknown,\n rootProgram: Command,\n extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>,\n lean = false,\n): Promise<string> {\n const usageContext = await resolveCommanderUsageContext(\n error,\n rootProgram,\n extensionDescriptors,\n );\n const envelope = formatCommanderErrorForJson(\n usageContext.message,\n usageContext.commandName,\n usageContext.allowedTypes,\n EXIT_CODE.USAGE,\n {\n unknownCommandExamples: usageContext.unknownCommandExamples,\n unknownCommandNextSteps: usageContext.unknownCommandNextSteps,\n attemptedCommand: usageContext.attemptedCommand,\n normalizedInvocationArgs: usageContext.normalizedInvocationArgs,\n providedOptionFlags: usageContext.providedOptionFlags,\n unknownOptionSuggestions: usageContext.unknownOptionSuggestions,\n unknownOptionOtherCommands: usageContext.unknownOptionOtherCommands,\n suggestedRetryCommand: usageContext.suggestedRetryCommand,\n },\n );\n return JSON.stringify(\n lean ? projectLeanErrorEnvelope(envelope) : envelope,\n null,\n 2,\n );\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n collectKnownLongFlags,\n collectInstalledPackageCommandPathHints,\n resolveOptionalPackageInstallHint,\n resolveSuggestedRetryForMissingOption,\n suggestNearestLongFlags,\n};\n"],"names":[],"mappings":";;AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC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587-452c2eacfb32"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm completion command surface and its agent-facing runtime behavior.
|
|
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]="4bbc8031-7403-596f-9aa7-21bcad9dc94c")}catch(e){}}();
|
|
8
8
|
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
9
9
|
import { PmCliError } from "../../core/shared/errors.js";
|
|
10
10
|
import { SCAFFOLD_CAPABILITIES } from "./extension/scaffold.js";
|
|
@@ -611,7 +611,7 @@ export function generateBashScript(itemTypes = [], tags = [], eagerTagExpansion
|
|
|
611
611
|
` COMPREPLY=(${compgen(DEPS_FLAGS)})`,
|
|
612
612
|
" ;;",
|
|
613
613
|
" graph)",
|
|
614
|
-
` COMPREPLY=(${compgen(`ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators plan ${GRAPH_FLAGS}`)})`,
|
|
614
|
+
` COMPREPLY=(${compgen(`ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators slack centrality articulation plan index ${GRAPH_FLAGS}`)})`,
|
|
615
615
|
" ;;",
|
|
616
616
|
" test)",
|
|
617
617
|
` COMPREPLY=(${compgen("--add --add-json --remove --list --run --match --only-index --only-last --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
@@ -1340,7 +1340,7 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
|
|
|
1340
1340
|
;;
|
|
1341
1341
|
graph)
|
|
1342
1342
|
_arguments \\
|
|
1343
|
-
'1:subcommand:(ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators plan)' \\
|
|
1343
|
+
'1:subcommand:(ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators slack centrality articulation plan index)' \\
|
|
1344
1344
|
'--kind[Restrict traversal to registered relationship kinds]:kind' \\
|
|
1345
1345
|
'--max-depth[Maximum traversal depth]:depth' \\
|
|
1346
1346
|
'--limit[Maximum returned rows per bounded collection]:number' \\
|
|
@@ -1349,6 +1349,10 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
|
|
|
1349
1349
|
'--max-paths[Maximum enumerated paths]:number' \\
|
|
1350
1350
|
'--sample[Maximum evidence sample entries per audit finding]:number' \\
|
|
1351
1351
|
'--exempt-isolate[Item ids treated as explicitly valid isolates]:id' \\
|
|
1352
|
+
'--exempt-isolate-type[Item types whose active isolates are policy-valid]:type' \\
|
|
1353
|
+
'--save-baseline[Persist the audit census as the comparison baseline]' \\
|
|
1354
|
+
'--rebuild[Rebuild and warm the durable graph index]' \\
|
|
1355
|
+
'--clear[Delete the durable graph index]' \\
|
|
1352
1356
|
'--summary[Return counts-first envelopes without row collections]' \\
|
|
1353
1357
|
'--json[Output JSON]' \\
|
|
1354
1358
|
'--quiet[Suppress stdout]'
|
|
@@ -2232,7 +2236,7 @@ complete -c pm -n '__fish_seen_subcommand_from deps' -l token-budget -d 'Maximum
|
|
|
2232
2236
|
complete -c pm -n '__fish_seen_subcommand_from deps' -l cursor -d 'Continue an equivalent context query' -r
|
|
2233
2237
|
complete -c pm -n '__fish_seen_subcommand_from deps' -l direction -d 'Context traversal direction' -r -a 'outgoing incoming both'
|
|
2234
2238
|
complete -c pm -n '__fish_seen_subcommand_from deps' -l kind -d 'Restrict context traversal to relationship kinds' -r
|
|
2235
|
-
complete -c pm -n '__fish_seen_subcommand_from graph' -a 'ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators plan' -d 'Graph query'
|
|
2239
|
+
complete -c pm -n '__fish_seen_subcommand_from graph' -a 'ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators slack centrality articulation plan index' -d 'Graph query'
|
|
2236
2240
|
complete -c pm -n '__fish_seen_subcommand_from graph' -l kind -d 'Restrict traversal to registered relationship kinds' -r
|
|
2237
2241
|
complete -c pm -n '__fish_seen_subcommand_from graph' -l max-depth -d 'Maximum traversal depth' -r
|
|
2238
2242
|
complete -c pm -n '__fish_seen_subcommand_from graph' -l limit -d 'Maximum returned rows per bounded collection' -r
|
|
@@ -2241,6 +2245,10 @@ complete -c pm -n '__fish_seen_subcommand_from graph' -l direction -d 'Edge orie
|
|
|
2241
2245
|
complete -c pm -n '__fish_seen_subcommand_from graph' -l max-paths -d 'Maximum enumerated paths' -r
|
|
2242
2246
|
complete -c pm -n '__fish_seen_subcommand_from graph' -l sample -d 'Maximum evidence sample entries per audit finding' -r
|
|
2243
2247
|
complete -c pm -n '__fish_seen_subcommand_from graph' -l exempt-isolate -d 'Item ids treated as explicitly valid isolates' -r
|
|
2248
|
+
complete -c pm -n '__fish_seen_subcommand_from graph' -l exempt-isolate-type -d 'Item types whose active isolates are policy-valid' -r
|
|
2249
|
+
complete -c pm -n '__fish_seen_subcommand_from graph' -l save-baseline -d 'Persist the audit census as the comparison baseline'
|
|
2250
|
+
complete -c pm -n '__fish_seen_subcommand_from graph' -l rebuild -d 'Rebuild and warm the durable graph index'
|
|
2251
|
+
complete -c pm -n '__fish_seen_subcommand_from graph' -l clear -d 'Delete the durable graph index'
|
|
2244
2252
|
complete -c pm -n '__fish_seen_subcommand_from graph' -l summary -d 'Return counts-first envelopes without row collections'
|
|
2245
2253
|
|
|
2246
2254
|
# comments / notes / learnings flags
|
|
@@ -2574,4 +2582,4 @@ export function runCompletion(shell, itemTypes = [], tags = [], eagerTagExpansio
|
|
|
2574
2582
|
};
|
|
2575
2583
|
}
|
|
2576
2584
|
//# sourceMappingURL=completion.js.map
|
|
2577
|
-
//# debugId=
|
|
2585
|
+
//# debugId=4bbc8031-7403-596f-9aa7-21bcad9dc94c
|