@unbrained/pm-cli 2026.6.13 → 2026.6.16
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/CHANGELOG.md +84 -0
- package/README.md +1 -1
- package/dist/cli/bootstrap-args.d.ts +29 -0
- package/dist/cli/bootstrap-args.js +11 -4
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.d.ts +12 -0
- package/dist/cli/commander-usage.js +18 -7
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.d.ts +19 -0
- package/dist/cli/commands/activity.js +12 -2
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/aggregate.d.ts +58 -0
- package/dist/cli/commands/aggregate.js +48 -15
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/annotation-command.d.ts +6 -1
- package/dist/cli/commands/annotation-command.js +72 -2
- package/dist/cli/commands/annotation-command.js.map +1 -1
- package/dist/cli/commands/append.js +4 -3
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/close-many.d.ts +20 -0
- package/dist/cli/commands/close-many.js +14 -23
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/close.js +37 -4
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.js +3 -2
- package/dist/cli/commands/comments-audit.js.map +1 -1
- package/dist/cli/commands/comments.d.ts +2 -0
- package/dist/cli/commands/comments.js +49 -23
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js +269 -8
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +51 -1
- package/dist/cli/commands/config.js +50 -12
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.d.ts +79 -1
- package/dist/cli/commands/context.js +151 -25
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.d.ts +80 -1
- package/dist/cli/commands/contracts.js +54 -4
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.d.ts +49 -0
- package/dist/cli/commands/create.js +105 -7
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.d.ts +33 -0
- package/dist/cli/commands/dedupe-audit.js +18 -14
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/deps.js +7 -4
- package/dist/cli/commands/deps.js.map +1 -1
- package/dist/cli/commands/event-validation-messages.js +3 -3
- package/dist/cli/commands/event-validation-messages.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +7 -0
- package/dist/cli/commands/extension/bundled-catalog.js +19 -15
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.d.ts +41 -1
- package/dist/cli/commands/extension/install-sources.js +26 -8
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/extension/shared.d.ts +5 -0
- package/dist/cli/commands/extension/shared.js +9 -3
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +133 -1
- package/dist/cli/commands/extension.js +127 -9
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.d.ts +30 -1
- package/dist/cli/commands/files.js +21 -2
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/focus.d.ts +11 -0
- package/dist/cli/commands/focus.js +86 -0
- package/dist/cli/commands/focus.js.map +1 -0
- package/dist/cli/commands/get.d.ts +9 -2
- package/dist/cli/commands/get.js +34 -6
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/guide.d.ts +5 -0
- package/dist/cli/commands/guide.js +6 -3
- package/dist/cli/commands/guide.js.map +1 -1
- package/dist/cli/commands/health.d.ts +109 -0
- package/dist/cli/commands/health.js +87 -35
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.js +27 -36
- package/dist/cli/commands/history-compact.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +46 -0
- package/dist/cli/commands/history-redact.js +99 -67
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.js +34 -37
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/history.js +6 -2
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.js +3 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.d.ts +54 -0
- package/dist/cli/commands/init-agent-guidance.js +31 -4
- package/dist/cli/commands/init-agent-guidance.js.map +1 -1
- package/dist/cli/commands/init.d.ts +36 -1
- package/dist/cli/commands/init.js +38 -5
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +4 -3
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/linked-test-parsers.d.ts +5 -0
- package/dist/cli/commands/linked-test-parsers.js +5 -2
- package/dist/cli/commands/linked-test-parsers.js.map +1 -1
- package/dist/cli/commands/list-filter-shared.d.ts +8 -0
- package/dist/cli/commands/list-filter-shared.js +70 -0
- package/dist/cli/commands/list-filter-shared.js.map +1 -0
- package/dist/cli/commands/list.d.ts +116 -0
- package/dist/cli/commands/list.js +194 -6
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/normalize.js +16 -2
- package/dist/cli/commands/normalize.js.map +1 -1
- package/dist/cli/commands/notes.js +4 -3
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/plan.js +3 -2
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/reindex.d.ts +83 -0
- package/dist/cli/commands/reindex.js +45 -10
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/restore.d.ts +40 -1
- package/dist/cli/commands/restore.js +27 -2
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +18 -0
- package/dist/cli/commands/schema.js +30 -3
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +289 -1
- package/dist/cli/commands/search.js +367 -60
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.d.ts +38 -0
- package/dist/cli/commands/stats.js +38 -10
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/telemetry.js +5 -3
- package/dist/cli/commands/telemetry.js.map +1 -1
- package/dist/cli/commands/templates.d.ts +18 -0
- package/dist/cli/commands/templates.js +9 -2
- package/dist/cli/commands/templates.js.map +1 -1
- package/dist/cli/commands/test-all.d.ts +5 -0
- package/dist/cli/commands/test-all.js +9 -3
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +70 -1
- package/dist/cli/commands/test.js +84 -3
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.d.ts +34 -1
- package/dist/cli/commands/update-many.js +60 -31
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.d.ts +71 -0
- package/dist/cli/commands/update.js +74 -8
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/upgrade.d.ts +28 -1
- package/dist/cli/commands/upgrade.js +17 -4
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +114 -0
- package/dist/cli/commands/validate.js +153 -8
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +30 -0
- package/dist/cli/error-guidance.js +41 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-options.js +9 -7
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.d.ts +8 -0
- package/dist/cli/help-content.js +30 -6
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.d.ts +19 -1
- package/dist/cli/help-json-payload.js +16 -7
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.d.ts +223 -0
- package/dist/cli/main.js +203 -45
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +62 -5
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.d.ts +16 -0
- package/dist/cli/register-mutation.js +210 -40
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.d.ts +8 -0
- package/dist/cli/register-operations.js +33 -11
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +9 -6
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +4 -0
- package/dist/cli/registration-helpers.js +124 -38
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-5P2KQCTH.js +18 -0
- package/dist/cli-bundle/chunks/{activity-PPO7QWJF.js → activity-MJGTX4LO.js} +13 -11
- package/dist/cli-bundle/chunks/{aggregate-XEBW22UQ.js → aggregate-MH3GROKB.js} +54 -25
- package/dist/cli-bundle/chunks/aggregate-MH3GROKB.js.map +7 -0
- package/dist/cli-bundle/chunks/{aggregate-IRHJWEKG.js → aggregate-OUGCDFNC.js} +55 -26
- package/dist/cli-bundle/chunks/aggregate-OUGCDFNC.js.map +1 -0
- package/dist/cli-bundle/chunks/{append-N2AWXKZC.js → append-2Q4BPUBW.js} +10 -10
- package/dist/cli-bundle/chunks/{append-N2AWXKZC.js.map → append-2Q4BPUBW.js.map} +2 -2
- package/dist/cli-bundle/chunks/{append-NL67JNJU.js → append-VCRUG2W6.js} +11 -11
- package/dist/cli-bundle/chunks/append-VCRUG2W6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GRZGHGRG.js → chunk-2IUJBMKS.js} +10 -9
- package/dist/cli-bundle/chunks/{chunk-GRZGHGRG.js.map → chunk-2IUJBMKS.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6ZFTM65G.js → chunk-2JEGCDYT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3CQPVBK3.js → chunk-3WAULYOY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-AGG32LKL.js → chunk-3XOXWOGA.js} +359 -19
- package/dist/cli-bundle/chunks/chunk-3XOXWOGA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-XXLMJDUB.js → chunk-4KBK4BA3.js} +13 -15
- package/dist/cli-bundle/chunks/chunk-4KBK4BA3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UCVJP4JL.js → chunk-4VLB4JH2.js} +51 -8
- package/dist/cli-bundle/chunks/chunk-4VLB4JH2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-BVL5KGVA.js → chunk-656HPQPO.js} +27 -12
- package/dist/cli-bundle/chunks/chunk-656HPQPO.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LYNQ3NGI.js → chunk-667XI4UJ.js} +309 -20
- package/dist/cli-bundle/chunks/chunk-667XI4UJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-W6KNFAMZ.js → chunk-6BV7ENQL.js} +9 -8
- package/dist/cli-bundle/chunks/chunk-6BV7ENQL.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js +35 -0
- package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7SM7VA5I.js → chunk-6NQXMGYU.js} +19 -8
- package/dist/cli-bundle/chunks/chunk-6NQXMGYU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AAUYXSFF.js → chunk-764O7EUA.js} +223 -50
- package/dist/cli-bundle/chunks/chunk-764O7EUA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VYZNX4C5.js → chunk-7AGIXLNK.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-7EILPFMA.js +404 -0
- package/dist/cli-bundle/chunks/chunk-7EILPFMA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-L6YQONLM.js → chunk-7K2MXFMX.js} +11 -13
- package/dist/cli-bundle/chunks/chunk-7K2MXFMX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HZOX5BYD.js → chunk-7L5VOUYP.js} +6 -17
- package/dist/cli-bundle/chunks/chunk-7L5VOUYP.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-7ZGKNHUL.js +61 -0
- package/dist/cli-bundle/chunks/chunk-7ZGKNHUL.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TOX7YQ7X.js → chunk-A576QZDL.js} +223 -50
- package/dist/cli-bundle/chunks/chunk-A576QZDL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RFR2YQGO.js → chunk-AERT7KT3.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-ASM4DVRW.js +58 -0
- package/dist/cli-bundle/chunks/chunk-ASM4DVRW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SQDKAEKG.js → chunk-B5Q7XC4K.js} +117 -37
- package/dist/cli-bundle/chunks/chunk-B5Q7XC4K.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RHYBR6G7.js → chunk-BJWTFOZM.js} +74 -14
- package/dist/cli-bundle/chunks/chunk-BJWTFOZM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4ZKKZMLH.js → chunk-CBMETQ2U.js} +104 -30
- package/dist/cli-bundle/chunks/chunk-CBMETQ2U.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-XOYHMHFF.js → chunk-E6J2PEK6.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-IIOIBAQW.js → chunk-F2GC6L3N.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-3VULHQNS.js → chunk-F7WSO5UX.js} +7 -18
- package/dist/cli-bundle/chunks/chunk-F7WSO5UX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JCTZV7TO.js → chunk-FTAZLAR7.js} +8 -5
- package/dist/cli-bundle/chunks/{chunk-JCTZV7TO.js.map → chunk-FTAZLAR7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-AUDDXKNX.js → chunk-FXNT5LPX.js} +77 -9
- package/dist/cli-bundle/chunks/chunk-FXNT5LPX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IZHCCG4S.js → chunk-G2YVUY7I.js} +14 -9
- package/dist/cli-bundle/chunks/chunk-G2YVUY7I.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5HSAHRYA.js → chunk-G3CEIXTV.js} +68 -19
- package/dist/cli-bundle/chunks/chunk-G3CEIXTV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-QQG4HEX7.js → chunk-GAVE4MYM.js} +37 -63
- package/dist/cli-bundle/chunks/chunk-GAVE4MYM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3FMQMHAG.js → chunk-GQ4JKNMV.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3FMQMHAG.js.map → chunk-GQ4JKNMV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MACCNKSZ.js → chunk-GYMG7AG6.js} +36 -62
- package/dist/cli-bundle/chunks/chunk-GYMG7AG6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7CRFV6JR.js → chunk-H6EH6ENJ.js} +362 -22
- package/dist/cli-bundle/chunks/chunk-H6EH6ENJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-2J2AH4V5.js → chunk-HDIDUME4.js} +45 -13
- package/dist/cli-bundle/chunks/chunk-HDIDUME4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2ANTZBYF.js → chunk-HPELHUTG.js} +122 -45
- package/dist/cli-bundle/chunks/chunk-HPELHUTG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-VNC2HBL4.js → chunk-II7OGE3V.js} +20 -9
- package/dist/cli-bundle/chunks/chunk-II7OGE3V.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CEGUH2E5.js → chunk-ILHLIA47.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-CEGUH2E5.js.map → chunk-ILHLIA47.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4TPFXE2R.js → chunk-IMQG4VR3.js} +118 -74
- package/dist/cli-bundle/chunks/chunk-IMQG4VR3.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-MGAQ6KZG.js → chunk-IQVB3YDD.js} +82 -21
- package/dist/cli-bundle/chunks/chunk-IQVB3YDD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WLH7X4RN.js → chunk-KQ3LAMDO.js} +45 -13
- package/dist/cli-bundle/chunks/chunk-KQ3LAMDO.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-S2CDTRJ6.js → chunk-KTVETP66.js} +379 -271
- package/dist/cli-bundle/chunks/chunk-KTVETP66.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-36BCSMKP.js → chunk-KZYVTOG5.js} +26 -11
- package/dist/cli-bundle/chunks/chunk-KZYVTOG5.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XWDZVCBJ.js → chunk-L6FJPOT4.js} +11 -10
- package/dist/cli-bundle/chunks/{chunk-XWDZVCBJ.js.map → chunk-L6FJPOT4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-LFW5NQUP.js → chunk-LV5FFQ7M.js} +405 -290
- package/dist/cli-bundle/chunks/chunk-LV5FFQ7M.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PNYAAB4S.js → chunk-LWGMDLQ6.js} +8 -3
- package/dist/cli-bundle/chunks/chunk-LWGMDLQ6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-QU3OPNVV.js → chunk-M23HXJL3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LSSTKL3Y.js → chunk-MJZUZ2QE.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-LOAR5TKX.js → chunk-NCIBNERT.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LOAR5TKX.js.map → chunk-NCIBNERT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6TBR5AZ2.js → chunk-NIQHNDBZ.js} +76 -8
- package/dist/cli-bundle/chunks/chunk-NIQHNDBZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-Z647PYLD.js → chunk-O46LTCXQ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-GFBEXDCQ.js → chunk-OCTQJP42.js} +19 -8
- package/dist/cli-bundle/chunks/{chunk-GFBEXDCQ.js.map → chunk-OCTQJP42.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HLEGAQXT.js → chunk-OLTYNVJR.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-IXVSSHGV.js → chunk-OY3P2I6B.js} +13 -8
- package/dist/cli-bundle/chunks/chunk-OY3P2I6B.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KHGTYCJ6.js → chunk-PZD7WPUC.js} +69 -20
- package/dist/cli-bundle/chunks/chunk-PZD7WPUC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4FHLNNW7.js → chunk-Q5RLUCP3.js} +74 -14
- package/dist/cli-bundle/chunks/chunk-Q5RLUCP3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-SOHXUA2Q.js → chunk-RKKIH2ZQ.js} +116 -36
- package/dist/cli-bundle/chunks/chunk-RKKIH2ZQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-O3YCJOVX.js → chunk-SPYPC5CB.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-O3YCJOVX.js.map → chunk-SPYPC5CB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SGMGMCIF.js → chunk-SY4GKIWT.js} +82 -21
- package/dist/cli-bundle/chunks/chunk-SY4GKIWT.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5LMF75Q7.js → chunk-SY4PZWIZ.js} +7 -4
- package/dist/cli-bundle/chunks/{chunk-5LMF75Q7.js.map → chunk-SY4PZWIZ.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HWHONML5.js → chunk-T5VU7ROQ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-JWXTOYBI.js → chunk-TIRZIQRP.js} +121 -44
- package/dist/cli-bundle/chunks/chunk-TIRZIQRP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PEH7SZD2.js → chunk-TUB3DZAZ.js} +105 -31
- package/dist/cli-bundle/chunks/chunk-TUB3DZAZ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-UAR2VNCK.js +394 -0
- package/dist/cli-bundle/chunks/chunk-UAR2VNCK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NN6RKGFW.js → chunk-UBMCSJXX.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-JE5IZXDS.js → chunk-UUKORJSN.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-R4VWYWRN.js → chunk-W3HFLORZ.js} +7 -2
- package/dist/cli-bundle/chunks/chunk-W3HFLORZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LGOXXQUW.js → chunk-WZCQVABQ.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js +32 -0
- package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-M3SI2REU.js → chunk-XLNNCKTN.js} +322 -19
- package/dist/cli-bundle/chunks/chunk-XLNNCKTN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4JHJ7YG2.js → chunk-XNOY7TCB.js} +118 -74
- package/dist/cli-bundle/chunks/chunk-XNOY7TCB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DWG4FHPY.js → chunk-YGRPBFMA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JW7D6437.js → chunk-YXTLI4XP.js} +20 -9
- package/dist/cli-bundle/chunks/chunk-YXTLI4XP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TSXWFN3L.js → chunk-Z3MUNQRV.js} +52 -9
- package/dist/cli-bundle/chunks/chunk-Z3MUNQRV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GOO4UXBI.js → chunk-ZJRDVYZI.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-32XSW44C.js → chunk-ZONXMSVB.js} +10 -9
- package/dist/cli-bundle/chunks/chunk-ZONXMSVB.js.map +1 -0
- package/dist/cli-bundle/chunks/{claim-QJOQBH7J.js → claim-4APLUXJW.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-HE6KEGJW.js → claim-NEO7AGWH.js} +10 -10
- package/dist/cli-bundle/chunks/{close-SPUFW5QR.js → close-3QABBNGU.js} +8 -8
- package/dist/cli-bundle/chunks/close-ILMZR3D7.js +13 -0
- package/dist/cli-bundle/chunks/{close-many-GKAJX54X.js → close-many-MIZLTYGL.js} +32 -20
- package/dist/cli-bundle/chunks/close-many-MIZLTYGL.js.map +1 -0
- package/dist/cli-bundle/chunks/{close-many-GL6NRUU5.js → close-many-Q7Y5AHQI.js} +31 -19
- package/dist/cli-bundle/chunks/close-many-Q7Y5AHQI.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-5FPT6L7N.js → comments-DAIQPOMU.js} +55 -31
- package/dist/cli-bundle/chunks/comments-DAIQPOMU.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-TOLOYWNI.js → comments-IWFSVM4P.js} +54 -30
- package/dist/cli-bundle/chunks/comments-IWFSVM4P.js.map +7 -0
- package/dist/cli-bundle/chunks/{config-4MN45TIH.js → config-IOJELD6O.js} +45 -19
- package/dist/cli-bundle/chunks/config-IOJELD6O.js.map +1 -0
- package/dist/cli-bundle/chunks/{config-7N6D7YJE.js → config-PXTMAYV3.js} +44 -18
- package/dist/cli-bundle/chunks/config-PXTMAYV3.js.map +7 -0
- package/dist/cli-bundle/chunks/{context-AQSLE7DZ.js → context-QHJSCJW4.js} +128 -39
- package/dist/cli-bundle/chunks/context-QHJSCJW4.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-U3PUJMVN.js → context-XZS2VFKU.js} +127 -38
- package/dist/cli-bundle/chunks/context-XZS2VFKU.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-ITSJXO3O.js → contracts-B7U4OJTV.js} +54 -10
- package/dist/cli-bundle/chunks/contracts-B7U4OJTV.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-H7KCQXLY.js → contracts-NSBVLXQ3.js} +54 -10
- package/dist/cli-bundle/chunks/contracts-NSBVLXQ3.js.map +7 -0
- package/dist/cli-bundle/chunks/{copy-EB3MUCSW.js → copy-Q64T5FD4.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-C4W522JM.js → copy-SG34LCMU.js} +7 -7
- package/dist/cli-bundle/chunks/create-F5HZX2S4.js +30 -0
- package/dist/cli-bundle/chunks/{create-4EQNELMY.js → create-IPAX2SNL.js} +16 -13
- package/dist/cli-bundle/chunks/{delete-ZLGUYIXU.js → delete-TLXR7LJ2.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-X5QLXIQX.js → delete-VH3L7DZ6.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-GPB3LGWN.js → deps-J3HBBLDB.js} +9 -10
- package/dist/cli-bundle/chunks/{deps-GPB3LGWN.js.map → deps-J3HBBLDB.js.map} +2 -2
- package/dist/cli-bundle/chunks/{deps-HV2C2L46.js → deps-XV6JJ6IN.js} +10 -11
- package/dist/cli-bundle/chunks/deps-XV6JJ6IN.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-SRTLCQOL.js → docs-GWDEB7JH.js} +9 -9
- package/dist/cli-bundle/chunks/{docs-RJQPLROO.js → docs-RCLNSKID.js} +9 -9
- package/dist/cli-bundle/chunks/{extension-MM3TVWOO.js → extension-5RN65LHT.js} +7 -5
- package/dist/cli-bundle/chunks/{extension-WKPVPNCC.js → extension-7KO2NX2A.js} +7 -5
- package/dist/cli-bundle/chunks/{files-OIFN3DQX.js → files-3TCQHUHA.js} +25 -11
- package/dist/cli-bundle/chunks/files-3TCQHUHA.js.map +1 -0
- package/dist/cli-bundle/chunks/{files-LIFDKNCN.js → files-5FDUPSEA.js} +24 -10
- package/dist/cli-bundle/chunks/files-5FDUPSEA.js.map +7 -0
- package/dist/cli-bundle/chunks/focus-7AQMNRSU.js +109 -0
- package/dist/cli-bundle/chunks/focus-7AQMNRSU.js.map +7 -0
- package/dist/cli-bundle/chunks/focus-HQXBYPKM.js +106 -0
- package/dist/cli-bundle/chunks/focus-HQXBYPKM.js.map +1 -0
- package/dist/cli-bundle/chunks/{gc-DL6AVOX5.js → gc-2FGKYRJ4.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-NRFHLVFT.js → gc-5B6ABL3Z.js} +3 -3
- package/dist/cli-bundle/chunks/{get-SAB7CRBG.js → get-FUMVOJQD.js} +43 -16
- package/dist/cli-bundle/chunks/get-FUMVOJQD.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-K7UULTQF.js → get-H5BZTW4A.js} +42 -15
- package/dist/cli-bundle/chunks/get-H5BZTW4A.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-NUVZYIEV.js → health-JSVOR6B4.js} +75 -49
- package/dist/cli-bundle/chunks/health-JSVOR6B4.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-VJWH3ZFK.js → health-LE2ZQGSM.js} +74 -48
- package/dist/cli-bundle/chunks/health-LE2ZQGSM.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-GYFD2DJW.js → history-QO4JVJJP.js} +10 -10
- package/dist/cli-bundle/chunks/history-SSXGGTVZ.js +20 -0
- package/dist/cli-bundle/chunks/{history-compact-WQZQ6KXM.js → history-compact-ID74DOUI.js} +37 -46
- package/dist/cli-bundle/chunks/history-compact-ID74DOUI.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-compact-SLL6ESXH.js → history-compact-SDFRPZ4V.js} +38 -47
- package/dist/cli-bundle/chunks/history-compact-SDFRPZ4V.js.map +1 -0
- package/dist/cli-bundle/chunks/history-redact-VBH44Y7F.js +21 -0
- package/dist/cli-bundle/chunks/{history-redact-SDTDR6WM.js → history-redact-Z4P5MM3G.js} +13 -11
- package/dist/cli-bundle/chunks/{history-repair-UCYS55ZX.js → history-repair-ANHEYWKF.js} +43 -48
- package/dist/cli-bundle/chunks/history-repair-ANHEYWKF.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-repair-BJCGM6Q3.js → history-repair-CKE7GLZR.js} +44 -49
- package/dist/cli-bundle/chunks/history-repair-CKE7GLZR.js.map +1 -0
- package/dist/cli-bundle/chunks/init-7FBQO77A.js +19 -0
- package/dist/cli-bundle/chunks/{init-MXV57LKL.js → init-K6MSMB37.js} +11 -9
- package/dist/cli-bundle/chunks/{learnings-QKJOKEAO.js → learnings-VIS3NOQV.js} +13 -12
- package/dist/cli-bundle/chunks/learnings-VIS3NOQV.js.map +7 -0
- package/dist/cli-bundle/chunks/{learnings-L6KTZGOT.js → learnings-YYNB64GN.js} +14 -13
- package/dist/cli-bundle/chunks/learnings-YYNB64GN.js.map +1 -0
- package/dist/cli-bundle/chunks/list-7UE44A2R.js +29 -0
- package/dist/cli-bundle/chunks/list-UHMA3N2K.js +33 -0
- package/dist/cli-bundle/chunks/{notes-3NLK7WTZ.js → notes-2HRMV67I.js} +14 -13
- package/dist/cli-bundle/chunks/notes-2HRMV67I.js.map +1 -0
- package/dist/cli-bundle/chunks/{notes-HMCB7TK6.js → notes-IN3UMA7W.js} +13 -12
- package/dist/cli-bundle/chunks/notes-IN3UMA7W.js.map +7 -0
- package/dist/cli-bundle/chunks/{plan-DWBYI5C6.js → plan-I3SVH7FV.js} +16 -15
- package/dist/cli-bundle/chunks/plan-I3SVH7FV.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-NANUWH4T.js → plan-PAWCCAPW.js} +15 -14
- package/dist/cli-bundle/chunks/plan-PAWCCAPW.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-PWQ5F2VI.js → register-list-query-N7Z7RTDM.js} +31 -22
- package/dist/cli-bundle/chunks/register-list-query-N7Z7RTDM.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-SMMMLSWW.js → register-list-query-OTIK4DVA.js} +32 -23
- package/dist/cli-bundle/chunks/register-list-query-OTIK4DVA.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-QKFPTIZG.js → register-mutation-UFZK6Q57.js} +216 -66
- package/dist/cli-bundle/chunks/register-mutation-UFZK6Q57.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-ZYJQ4DVP.js → register-mutation-XFORLS6D.js} +210 -67
- package/dist/cli-bundle/chunks/register-mutation-XFORLS6D.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-2FMZ6WEF.js → register-operations-6ZCLKRBG.js} +53 -39
- package/dist/cli-bundle/chunks/register-operations-6ZCLKRBG.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-BAFQURZG.js → register-operations-ITE7JTH3.js} +54 -40
- package/dist/cli-bundle/chunks/register-operations-ITE7JTH3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-QN2XV7UL.js → register-setup-7RKGE4BQ.js} +18 -21
- package/dist/cli-bundle/chunks/register-setup-7RKGE4BQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-DQEIKBIP.js → register-setup-7UKEFKT6.js} +17 -20
- package/dist/cli-bundle/chunks/register-setup-7UKEFKT6.js.map +7 -0
- package/dist/cli-bundle/chunks/{restore-FJQWXMPY.js → restore-NNVPBBVJ.js} +13 -11
- package/dist/cli-bundle/chunks/restore-XXXLQ2XC.js +19 -0
- package/dist/cli-bundle/chunks/{schema-RNVJ55V2.js → schema-3HCLXCFX.js} +27 -9
- package/dist/cli-bundle/chunks/schema-3HCLXCFX.js.map +7 -0
- package/dist/cli-bundle/chunks/{schema-ZZ7ZDM2X.js → schema-3YKCQ3VO.js} +28 -10
- package/dist/cli-bundle/chunks/schema-3YKCQ3VO.js.map +1 -0
- package/dist/cli-bundle/chunks/{search-BJ457C2A.js → search-NQ42NC6A.js} +328 -71
- package/dist/cli-bundle/chunks/search-NQ42NC6A.js.map +7 -0
- package/dist/cli-bundle/chunks/{search-FQDZXX7P.js → search-V7PZ2ICH.js} +328 -71
- package/dist/cli-bundle/chunks/search-V7PZ2ICH.js.map +1 -0
- package/dist/cli-bundle/chunks/{stats-DUQWCVOS.js → stats-7KD4PJC5.js} +41 -16
- package/dist/cli-bundle/chunks/stats-7KD4PJC5.js.map +7 -0
- package/dist/cli-bundle/chunks/{stats-CUG3ZHOI.js → stats-GRHO6RFB.js} +42 -17
- package/dist/cli-bundle/chunks/stats-GRHO6RFB.js.map +1 -0
- package/dist/cli-bundle/chunks/{telemetry-33MRGX4Z.js → telemetry-H5GLXNG5.js} +6 -6
- package/dist/cli-bundle/chunks/telemetry-H5GLXNG5.js.map +7 -0
- package/dist/cli-bundle/chunks/{telemetry-RK2VX75A.js → telemetry-TRRYZXWT.js} +7 -7
- package/dist/cli-bundle/chunks/telemetry-TRRYZXWT.js.map +1 -0
- package/dist/cli-bundle/chunks/test-6CZNIIGA.js +34 -0
- package/dist/cli-bundle/chunks/{test-Y3CTFMEC.js → test-7GVQ3VMN.js} +16 -14
- package/dist/cli-bundle/chunks/{test-all-ANYQ33O2.js → test-all-3LF2OZD2.js} +23 -16
- package/dist/cli-bundle/chunks/test-all-3LF2OZD2.js.map +7 -0
- package/dist/cli-bundle/chunks/{test-all-ARSMX33Q.js → test-all-ODVADHV6.js} +24 -17
- package/dist/cli-bundle/chunks/test-all-ODVADHV6.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-5URSD34O.js → test-runs-LYT6ZTNQ.js} +62 -65
- package/dist/cli-bundle/chunks/test-runs-LYT6ZTNQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-XNACGSNQ.js → test-runs-RVP6VWN7.js} +61 -64
- package/dist/cli-bundle/chunks/test-runs-RVP6VWN7.js.map +7 -0
- package/dist/cli-bundle/chunks/update-MPGM6SBE.js +28 -0
- package/dist/cli-bundle/chunks/update-UN75XW3C.js +24 -0
- package/dist/cli-bundle/chunks/{update-many-6B7PJ33I.js → update-many-FCU6RKTO.js} +80 -34
- package/dist/cli-bundle/chunks/update-many-FCU6RKTO.js.map +1 -0
- package/dist/cli-bundle/chunks/{update-many-724JCVDE.js → update-many-XSEQJ24X.js} +79 -33
- package/dist/cli-bundle/chunks/update-many-XSEQJ24X.js.map +7 -0
- package/dist/cli-bundle/chunks/{upgrade-ALBEZAI7.js → upgrade-A6TL3INC.js} +22 -8
- package/dist/cli-bundle/chunks/upgrade-A6TL3INC.js.map +7 -0
- package/dist/cli-bundle/chunks/{upgrade-QHRGDBSA.js → upgrade-FOB5LHO5.js} +23 -9
- package/dist/cli-bundle/chunks/upgrade-FOB5LHO5.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-IQRYFXIV.js → validate-7BLDG3AT.js} +221 -30
- package/dist/cli-bundle/chunks/validate-7BLDG3AT.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-UY6DRCG5.js → validate-EHL3MI2V.js} +235 -30
- package/dist/cli-bundle/chunks/validate-EHL3MI2V.js.map +7 -0
- package/dist/cli-bundle/main.js +270 -139
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/cli.d.ts +10 -0
- package/dist/cli.js +21 -8
- package/dist/cli.js.map +1 -1
- package/dist/core/diagnostics/remediation.js +7 -2
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/extensions/extension-policy.js +14 -15
- package/dist/core/extensions/extension-policy.js.map +1 -1
- package/dist/core/extensions/item-fields.js +4 -5
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +75 -1
- package/dist/core/extensions/loader.js +56 -32
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/governance/content-fields.d.ts +84 -0
- package/dist/core/governance/content-fields.js +182 -0
- package/dist/core/governance/content-fields.js.map +1 -0
- package/dist/core/governance/issue-codes.d.ts +51 -0
- package/dist/core/governance/issue-codes.js +95 -0
- package/dist/core/governance/issue-codes.js.map +1 -0
- package/dist/core/governance/metadata-coverage.d.ts +168 -0
- package/dist/core/governance/metadata-coverage.js +362 -0
- package/dist/core/governance/metadata-coverage.js.map +1 -0
- package/dist/core/history/history-rewrite.d.ts +22 -0
- package/dist/core/history/history-rewrite.js +38 -2
- package/dist/core/history/history-rewrite.js.map +1 -1
- package/dist/core/history/history.d.ts +7 -0
- package/dist/core/history/history.js +6 -2
- package/dist/core/history/history.js.map +1 -1
- package/dist/core/io/body-file.d.ts +14 -0
- package/dist/core/io/body-file.js +47 -0
- package/dist/core/io/body-file.js.map +1 -0
- package/dist/core/item/item-format.d.ts +46 -1
- package/dist/core/item/item-format.js +51 -60
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/parse.d.ts +9 -0
- package/dist/core/item/parse.js +10 -16
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/item/type-registry.d.ts +1 -0
- package/dist/core/item/type-registry.js +8 -10
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/lock/lock.d.ts +26 -0
- package/dist/core/lock/lock.js +10 -2
- package/dist/core/lock/lock.js.map +1 -1
- package/dist/core/output/output.d.ts +7 -0
- package/dist/core/output/output.js +6 -2
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/schema/item-types-file.d.ts +25 -2
- package/dist/core/schema/item-types-file.js +78 -6
- package/dist/core/schema/item-types-file.js.map +1 -1
- package/dist/core/schema/runtime-schema.d.ts +7 -0
- package/dist/core/schema/runtime-schema.js +23 -16
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/cache.d.ts +19 -1
- package/dist/core/search/cache.js +11 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/corpus.d.ts +36 -2
- package/dist/core/search/corpus.js +120 -24
- package/dist/core/search/corpus.js.map +1 -1
- package/dist/core/search/providers.d.ts +19 -0
- package/dist/core/search/providers.js +19 -2
- package/dist/core/search/providers.js.map +1 -1
- package/dist/core/sentry/instrument.d.ts +1 -0
- package/dist/core/sentry/instrument.js +6 -2
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/session/session-state.d.ts +16 -0
- package/dist/core/session/session-state.js +48 -0
- package/dist/core/session/session-state.js.map +1 -0
- package/dist/core/shared/constants.d.ts +8 -0
- package/dist/core/shared/constants.js +11 -2
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/text-normalization.js +4 -3
- package/dist/core/shared/text-normalization.js.map +1 -1
- package/dist/core/shared/time.d.ts +13 -0
- package/dist/core/shared/time.js +19 -7
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/item-store.d.ts +11 -0
- package/dist/core/store/item-store.js +12 -3
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +2 -0
- package/dist/core/store/settings-validator.js +25 -2
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.d.ts +60 -1
- package/dist/core/store/settings.js +100 -46
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/observability.js +10 -8
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.d.ts +272 -1
- package/dist/core/telemetry/runtime.js +358 -37
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/core/test/background-runs.d.ts +35 -0
- package/dist/core/test/background-runs.js +72 -61
- package/dist/core/test/background-runs.js.map +1 -1
- package/dist/core/test/run-selectors.js +5 -4
- package/dist/core/test/run-selectors.js.map +1 -1
- package/dist/core/validate/estimate-defaults.d.ts +39 -0
- package/dist/core/validate/estimate-defaults.js +117 -0
- package/dist/core/validate/estimate-defaults.js.map +1 -0
- package/dist/core/validate/fix-planning.d.ts +21 -3
- package/dist/core/validate/fix-planning.js +31 -4
- package/dist/core/validate/fix-planning.js.map +1 -1
- package/dist/core/validate/missing-link-owners.d.ts +64 -0
- package/dist/core/validate/missing-link-owners.js +98 -0
- package/dist/core/validate/missing-link-owners.js.map +1 -0
- package/dist/mcp/server.d.ts +61 -0
- package/dist/mcp/server.js +50 -7
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-definitions.js +17 -4
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +13 -2
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +110 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +83 -8
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +28 -0
- package/dist/sdk/cli-contracts.js +164 -11
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/types.d.ts +17 -1
- package/dist/types.js +3 -3
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +15 -3
- package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +136 -7
- package/docs/CONFIGURATION.md +52 -0
- package/docs/TESTING.md +6 -4
- package/package.json +6 -4
- package/packages/pm-calendar/extensions/calendar/runtime.js +6 -0
- package/packages/pm-calendar/extensions/calendar/runtime.ts +12 -0
- package/packages/pm-todos/extensions/todos/runtime.ts +5 -0
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +3 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/plugins/pm-codex/README.md +1 -1
- package/scripts/bundle-cli.mjs +46 -37
- package/scripts/finalize-build.mjs +20 -9
- package/scripts/prepare-build-cache.mjs +27 -16
- package/dist/cli-bundle/chunks/activity-XIOTGZMU.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-IRHJWEKG.js.map +0 -1
- package/dist/cli-bundle/chunks/aggregate-XEBW22UQ.js.map +0 -7
- package/dist/cli-bundle/chunks/append-NL67JNJU.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-2ANTZBYF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-2J2AH4V5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-32XSW44C.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-36BCSMKP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3VULHQNS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4FHLNNW7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4JHJ7YG2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4TPFXE2R.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4ZKKZMLH.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5HSAHRYA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6TBR5AZ2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7CRFV6JR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7SM7VA5I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AAUYXSFF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AGG32LKL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-AUDDXKNX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-BVL5KGVA.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C24PWDFG.js +0 -138
- package/dist/cli-bundle/chunks/chunk-C24PWDFG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HZOX5BYD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IXVSSHGV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IZHCCG4S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JW7D6437.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JWXTOYBI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KHGTYCJ6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-L6YQONLM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LFW5NQUP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LYNQ3NGI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-M3SI2REU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MACCNKSZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MGAQ6KZG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PEH7SZD2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PNYAAB4S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QQG4HEX7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-R4VWYWRN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RHYBR6G7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-S2CDTRJ6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SGMGMCIF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SOHXUA2Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SQDKAEKG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TOX7YQ7X.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TSXWFN3L.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UCVJP4JL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-V4KP3TCN.js +0 -128
- package/dist/cli-bundle/chunks/chunk-V4KP3TCN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VNC2HBL4.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-W6KNFAMZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WLH7X4RN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XXLMJDUB.js.map +0 -7
- package/dist/cli-bundle/chunks/close-WOG5WTMZ.js +0 -13
- package/dist/cli-bundle/chunks/close-many-GKAJX54X.js.map +0 -1
- package/dist/cli-bundle/chunks/close-many-GL6NRUU5.js.map +0 -7
- package/dist/cli-bundle/chunks/comments-5FPT6L7N.js.map +0 -1
- package/dist/cli-bundle/chunks/comments-TOLOYWNI.js.map +0 -7
- package/dist/cli-bundle/chunks/config-4MN45TIH.js.map +0 -1
- package/dist/cli-bundle/chunks/config-7N6D7YJE.js.map +0 -7
- package/dist/cli-bundle/chunks/context-AQSLE7DZ.js.map +0 -1
- package/dist/cli-bundle/chunks/context-U3PUJMVN.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-H7KCQXLY.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-ITSJXO3O.js.map +0 -1
- package/dist/cli-bundle/chunks/create-NW3K7LVG.js +0 -27
- package/dist/cli-bundle/chunks/deps-HV2C2L46.js.map +0 -1
- package/dist/cli-bundle/chunks/files-LIFDKNCN.js.map +0 -7
- package/dist/cli-bundle/chunks/files-OIFN3DQX.js.map +0 -1
- package/dist/cli-bundle/chunks/get-K7UULTQF.js.map +0 -7
- package/dist/cli-bundle/chunks/get-SAB7CRBG.js.map +0 -1
- package/dist/cli-bundle/chunks/health-NUVZYIEV.js.map +0 -1
- package/dist/cli-bundle/chunks/health-VJWH3ZFK.js.map +0 -7
- package/dist/cli-bundle/chunks/history-IUVN4NTN.js +0 -20
- package/dist/cli-bundle/chunks/history-compact-SLL6ESXH.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-WQZQ6KXM.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-75KIIJUJ.js +0 -19
- package/dist/cli-bundle/chunks/history-repair-BJCGM6Q3.js.map +0 -1
- package/dist/cli-bundle/chunks/history-repair-UCYS55ZX.js.map +0 -7
- package/dist/cli-bundle/chunks/init-JJFYRUKG.js +0 -17
- package/dist/cli-bundle/chunks/learnings-L6KTZGOT.js.map +0 -1
- package/dist/cli-bundle/chunks/learnings-QKJOKEAO.js.map +0 -7
- package/dist/cli-bundle/chunks/list-GGVPXEV6.js +0 -23
- package/dist/cli-bundle/chunks/list-VOQDQHA4.js +0 -19
- package/dist/cli-bundle/chunks/notes-3NLK7WTZ.js.map +0 -1
- package/dist/cli-bundle/chunks/notes-HMCB7TK6.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-DWBYI5C6.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-NANUWH4T.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-PWQ5F2VI.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-SMMMLSWW.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-QKFPTIZG.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-ZYJQ4DVP.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-2FMZ6WEF.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-BAFQURZG.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-DQEIKBIP.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-QN2XV7UL.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-DRBNXJJH.js +0 -17
- package/dist/cli-bundle/chunks/schema-RNVJ55V2.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-ZZ7ZDM2X.js.map +0 -1
- package/dist/cli-bundle/chunks/search-BJ457C2A.js.map +0 -7
- package/dist/cli-bundle/chunks/search-FQDZXX7P.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-CUG3ZHOI.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-DUQWCVOS.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-33MRGX4Z.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-RK2VX75A.js.map +0 -1
- package/dist/cli-bundle/chunks/test-SDMYEQHH.js +0 -32
- package/dist/cli-bundle/chunks/test-all-ANYQ33O2.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-ARSMX33Q.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-5URSD34O.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-XNACGSNQ.js.map +0 -7
- package/dist/cli-bundle/chunks/update-PD46VOXI.js +0 -21
- package/dist/cli-bundle/chunks/update-U235A7WP.js +0 -25
- package/dist/cli-bundle/chunks/update-many-6B7PJ33I.js.map +0 -1
- package/dist/cli-bundle/chunks/update-many-724JCVDE.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-ALBEZAI7.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-QHRGDBSA.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-IQRYFXIV.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-UY6DRCG5.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-XIOTGZMU.js.map → activity-5P2KQCTH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-PPO7QWJF.js.map → activity-MJGTX4LO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6ZFTM65G.js.map → chunk-2JEGCDYT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3CQPVBK3.js.map → chunk-3WAULYOY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VYZNX4C5.js.map → chunk-7AGIXLNK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RFR2YQGO.js.map → chunk-AERT7KT3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XOYHMHFF.js.map → chunk-E6J2PEK6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IIOIBAQW.js.map → chunk-F2GC6L3N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QU3OPNVV.js.map → chunk-M23HXJL3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LSSTKL3Y.js.map → chunk-MJZUZ2QE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Z647PYLD.js.map → chunk-O46LTCXQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HLEGAQXT.js.map → chunk-OLTYNVJR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HWHONML5.js.map → chunk-T5VU7ROQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NN6RKGFW.js.map → chunk-UBMCSJXX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JE5IZXDS.js.map → chunk-UUKORJSN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LGOXXQUW.js.map → chunk-WZCQVABQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DWG4FHPY.js.map → chunk-YGRPBFMA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GOO4UXBI.js.map → chunk-ZJRDVYZI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-QJOQBH7J.js.map → claim-4APLUXJW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-HE6KEGJW.js.map → claim-NEO7AGWH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-SPUFW5QR.js.map → close-3QABBNGU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-WOG5WTMZ.js.map → close-ILMZR3D7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-EB3MUCSW.js.map → copy-Q64T5FD4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-C4W522JM.js.map → copy-SG34LCMU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-NW3K7LVG.js.map → create-F5HZX2S4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-4EQNELMY.js.map → create-IPAX2SNL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-ZLGUYIXU.js.map → delete-TLXR7LJ2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-X5QLXIQX.js.map → delete-VH3L7DZ6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-SRTLCQOL.js.map → docs-GWDEB7JH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-RJQPLROO.js.map → docs-RCLNSKID.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-MM3TVWOO.js.map → extension-5RN65LHT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-WKPVPNCC.js.map → extension-7KO2NX2A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-DL6AVOX5.js.map → gc-2FGKYRJ4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-NRFHLVFT.js.map → gc-5B6ABL3Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-GYFD2DJW.js.map → history-QO4JVJJP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-IUVN4NTN.js.map → history-SSXGGTVZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-75KIIJUJ.js.map → history-redact-VBH44Y7F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-SDTDR6WM.js.map → history-redact-Z4P5MM3G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-JJFYRUKG.js.map → init-7FBQO77A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-MXV57LKL.js.map → init-K6MSMB37.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-VOQDQHA4.js.map → list-7UE44A2R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-GGVPXEV6.js.map → list-UHMA3N2K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-FJQWXMPY.js.map → restore-NNVPBBVJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-DRBNXJJH.js.map → restore-XXXLQ2XC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-SDMYEQHH.js.map → test-6CZNIIGA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-Y3CTFMEC.js.map → test-7GVQ3VMN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-U235A7WP.js.map → update-MPGM6SBE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-PD46VOXI.js.map → update-UN75XW3C.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guide.js","sources":["cli/commands/guide.ts"],"sourceRoot":"/","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { resolveConfiguredPmPackageRoot } from \"../../core/packages/root.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport {\n listGuideTopicIds,\n listGuideTopics,\n resolveGuideTopic,\n type GuideTopicDefinition,\n} from \"../guide-topics.js\";\n\nexport const GUIDE_OUTPUT_VALUES = [\"markdown\", \"toon\", \"json\"] as const;\nexport type GuideOutputFormat = (typeof GUIDE_OUTPUT_VALUES)[number];\n\nexport const GUIDE_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\nexport type GuideDepth = (typeof GUIDE_DEPTH_VALUES)[number];\n\nexport interface GuideOptions {\n topic?: string;\n list?: boolean;\n format?: string;\n depth?: string;\n [key: string]: unknown;\n}\n\nexport interface GuideDocRender {\n path: string;\n purpose: string;\n optional: boolean;\n exists: boolean;\n line_count: number | null;\n content_mode: \"none\" | \"excerpt\" | \"full\";\n content: string | null;\n truncated: boolean;\n}\n\nexport interface GuideIndexResult {\n output_default: \"toon\";\n mode: \"index\";\n depth: GuideDepth;\n topics: Array<{\n id: string;\n aliases: string[];\n title: string;\n summary: string;\n intent: string;\n quick_commands: string[];\n docs: Array<{ path: string; purpose: string }>;\n related: string[];\n }>;\n suggested_next_steps: string[];\n}\n\nexport interface GuideTopicResult {\n output_default: \"toon\";\n mode: \"topic\";\n depth: GuideDepth;\n requested_topic: string;\n topic: GuideTopicDefinition;\n docs: GuideDocRender[];\n warnings: string[];\n}\n\nexport type GuideResult = GuideIndexResult | GuideTopicResult;\n\nfunction parseGuideOutputFormat(raw: string | undefined): GuideOutputFormat | undefined {\n if (!raw) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n if (!GUIDE_OUTPUT_VALUES.includes(normalized as GuideOutputFormat)) {\n throw new PmCliError(\"Guide format must be one of markdown|toon|json\", EXIT_CODE.USAGE);\n }\n return normalized as GuideOutputFormat;\n}\n\nexport function resolveGuideOutputFormat(options: GuideOptions, global: GlobalOptions): GuideOutputFormat {\n const commandFormat = parseGuideOutputFormat(options.format);\n if (global.json && commandFormat && commandFormat !== \"json\") {\n throw new PmCliError(\"Cannot combine --json with --format markdown|toon\", EXIT_CODE.USAGE);\n }\n if (global.json) {\n return \"json\";\n }\n return commandFormat ?? \"toon\";\n}\n\nfunction parseGuideDepth(raw: string | undefined): GuideDepth {\n if (!raw) {\n return \"brief\";\n }\n const normalized = raw.trim().toLowerCase();\n if (!GUIDE_DEPTH_VALUES.includes(normalized as GuideDepth)) {\n throw new PmCliError(\"Guide depth must be one of brief|standard|deep\", EXIT_CODE.USAGE);\n }\n return normalized as GuideDepth;\n}\n\nfunction resolvePackageRoot(): string {\n return resolveConfiguredPmPackageRoot(process.env, \"PM_CLI_PACKAGE_ROOT\", import.meta.url, [\"..\", \"..\", \"..\"]);\n}\n\nfunction normalizeLineEndings(value: string): string {\n return value.replaceAll(\"\\r\\n\", \"\\n\");\n}\n\nfunction toExcerpt(content: string, maxLines: number, maxCharacters: number): { excerpt: string; truncated: boolean; lineCount: number } {\n const normalized = normalizeLineEndings(content);\n const lines = normalized.split(\"\\n\");\n const lineSlice = lines.slice(0, maxLines);\n let excerpt = lineSlice.join(\"\\n\");\n let truncated = lines.length > maxLines;\n if (excerpt.length > maxCharacters) {\n excerpt = excerpt.slice(0, maxCharacters);\n truncated = true;\n }\n return {\n excerpt: excerpt.trimEnd(),\n truncated,\n lineCount: lines.length,\n };\n}\n\nasync function renderGuideDocs(topic: GuideTopicDefinition, depth: GuideDepth, packageRoot: string): Promise<GuideDocRender[]> {\n const includeContent = depth !== \"brief\";\n const contentMode: GuideDocRender[\"content_mode\"] = includeContent ? (depth === \"deep\" ? \"full\" : \"excerpt\") : \"none\";\n const docs: GuideDocRender[] = [];\n for (const doc of topic.docs) {\n const absolutePath = path.resolve(packageRoot, doc.path);\n if (!includeContent) {\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: true,\n line_count: null,\n content_mode: \"none\",\n content: null,\n truncated: false,\n });\n continue;\n }\n try {\n const rawContent = await readFile(absolutePath, \"utf8\");\n if (depth === \"deep\") {\n const normalized = normalizeLineEndings(rawContent).trimEnd();\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: true,\n line_count: normalized.length === 0 ? 0 : normalized.split(\"\\n\").length,\n content_mode: \"full\",\n content: normalized,\n truncated: false,\n });\n } else {\n const excerpt = toExcerpt(rawContent, 120, 12_000);\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: true,\n line_count: excerpt.lineCount,\n content_mode: contentMode,\n content: excerpt.excerpt,\n truncated: excerpt.truncated,\n });\n }\n } catch (error) {\n const code = (error as { code?: string } | null)?.code;\n const missing = code === \"ENOENT\";\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: false,\n line_count: null,\n content_mode: \"none\",\n content: null,\n truncated: false,\n });\n if (!missing) {\n throw new PmCliError(`Failed to read guide document \"${doc.path}\".`, EXIT_CODE.GENERIC_FAILURE);\n }\n }\n }\n return docs;\n}\n\nfunction buildGuideIndex(depth: GuideDepth): GuideIndexResult {\n const topics = listGuideTopics().map((topic) => ({\n id: topic.id,\n aliases: topic.aliases,\n title: topic.title,\n summary: topic.summary,\n intent: topic.intent,\n quick_commands: depth === \"brief\" ? topic.commands.slice(0, 3) : topic.commands.slice(0, 6),\n docs: topic.docs.map((doc) => ({ path: doc.path, purpose: doc.purpose })),\n related: topic.related,\n }));\n return {\n output_default: \"toon\",\n mode: \"index\",\n depth,\n topics,\n suggested_next_steps: [\n \"pm guide <topic>\",\n \"pm guide <topic> --depth standard\",\n \"pm guide <topic> --depth deep --format markdown\",\n \"pm guide <topic> --json\",\n ],\n };\n}\n\nfunction ensureGuideTopic(topic: string | undefined): GuideTopicDefinition {\n const resolved = resolveGuideTopic(topic);\n if (resolved) {\n return resolved;\n }\n const available = listGuideTopicIds().join(\", \");\n throw new PmCliError(\n `Unknown guide topic \"${topic ?? \"\"}\". Available topics: ${available}. Use \"pm guide --list\" to browse.`,\n EXIT_CODE.USAGE,\n );\n}\n\nexport async function runGuide(options: GuideOptions, global: GlobalOptions): Promise<GuideResult> {\n const depth = parseGuideDepth(typeof options.depth === \"string\" ? options.depth : undefined);\n const listRequested = options.list === true;\n const topicRaw = typeof options.topic === \"string\" ? options.topic : undefined;\n if (listRequested || !topicRaw) {\n return buildGuideIndex(depth);\n }\n\n const topic = ensureGuideTopic(topicRaw);\n const packageRoot = resolvePackageRoot();\n const docs = await renderGuideDocs(topic, depth, packageRoot);\n const warnings = docs\n .filter((doc) => !doc.exists && !doc.optional)\n .map((doc) => `Missing required guide document: ${doc.path}`);\n\n return {\n output_default: \"toon\",\n mode: \"topic\",\n depth,\n requested_topic: topicRaw,\n topic,\n docs,\n warnings,\n };\n}\n\nfunction markdownCodeFence(content: string): string {\n return content.replaceAll(\"```\", \"``\\\\`\");\n}\n\nexport function renderGuideMarkdown(result: GuideResult): string {\n if (result.mode === \"index\") {\n const lines: string[] = [\n \"# pm guide\",\n \"\",\n \"Token-efficient local documentation index for agent and maintainer workflows.\",\n \"\",\n \"## Topics\",\n ];\n for (const topic of result.topics) {\n lines.push(`- \\`${topic.id}\\` - ${topic.summary}`);\n if (result.depth !== \"brief\") {\n lines.push(` - intent: ${topic.intent}`);\n lines.push(` - docs: ${topic.docs.map((doc) => `\\`${doc.path}\\``).join(\", \")}`);\n }\n }\n lines.push(\"\", \"## Next steps\");\n for (const step of result.suggested_next_steps) {\n lines.push(`- \\`${step}\\``);\n }\n return lines.join(\"\\n\");\n }\n\n const lines: string[] = [\n `# pm guide ${result.topic.id}`,\n \"\",\n result.topic.summary,\n \"\",\n \"## Intent\",\n result.topic.intent,\n \"\",\n \"## Key commands\",\n ...result.topic.commands.map((command) => `- \\`${command}\\``),\n \"\",\n \"## Workflow prompts\",\n ];\n for (const workflow of result.topic.workflows) {\n lines.push(`### ${workflow.name}`);\n lines.push(`goal: ${workflow.goal}`);\n lines.push(`prompt: ${workflow.prompt}`);\n lines.push(\"commands:\");\n lines.push(...workflow.commands.map((command) => `- \\`${command}\\``));\n lines.push(\"\");\n }\n lines.push(\"## Documents\");\n for (const doc of result.docs) {\n const status = doc.exists ? \"available\" : doc.optional ? \"missing (optional)\" : \"missing (required)\";\n lines.push(`- \\`${doc.path}\\` - ${doc.purpose} (${status})`);\n if (doc.exists && doc.content_mode !== \"none\" && doc.content) {\n lines.push(\"\");\n lines.push(`### Excerpt: \\`${doc.path}\\``);\n if (doc.truncated) {\n lines.push(\"_truncated for context efficiency_\");\n }\n lines.push(\"```markdown\");\n lines.push(markdownCodeFence(doc.content));\n lines.push(\"```\");\n }\n }\n if (result.topic.related.length > 0) {\n lines.push(\"\", \"## Related topics\");\n lines.push(...result.topic.related.map((topic) => `- \\`${topic}\\``));\n }\n if (result.warnings.length > 0) {\n lines.push(\"\", \"## Warnings\");\n lines.push(...result.warnings.map((warning) => `- ${warning}`));\n }\n return lines.join(\"\\n\");\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAGzE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AAmDzE,SAAS,sBAAsB,CAAC,GAAuB;IACrD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC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MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,mBAAmB,CAAC,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC;IACvE,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC","debugId":"8d06806e-bba1-5626-9ff4-b7fda8387582"}
|
|
1
|
+
{"version":3,"file":"guide.js","sources":["cli/commands/guide.ts"],"sourceRoot":"/","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { resolveConfiguredPmPackageRoot } from \"../../core/packages/root.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport {\n listGuideTopicIds,\n listGuideTopics,\n resolveGuideTopic,\n type GuideTopicDefinition,\n} from \"../guide-topics.js\";\n\nexport const GUIDE_OUTPUT_VALUES = [\"markdown\", \"toon\", \"json\"] as const;\nexport type GuideOutputFormat = (typeof GUIDE_OUTPUT_VALUES)[number];\n\nexport const GUIDE_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\nexport type GuideDepth = (typeof GUIDE_DEPTH_VALUES)[number];\n\nexport interface GuideOptions {\n topic?: string;\n list?: boolean;\n format?: string;\n depth?: string;\n [key: string]: unknown;\n}\n\nexport interface GuideDocRender {\n path: string;\n purpose: string;\n optional: boolean;\n exists: boolean;\n line_count: number | null;\n content_mode: \"none\" | \"excerpt\" | \"full\";\n content: string | null;\n truncated: boolean;\n}\n\nexport interface GuideIndexResult {\n output_default: \"toon\";\n mode: \"index\";\n depth: GuideDepth;\n topics: Array<{\n id: string;\n aliases: string[];\n title: string;\n summary: string;\n intent: string;\n quick_commands: string[];\n docs: Array<{ path: string; purpose: string }>;\n related: string[];\n }>;\n suggested_next_steps: string[];\n}\n\nexport interface GuideTopicResult {\n output_default: \"toon\";\n mode: \"topic\";\n depth: GuideDepth;\n requested_topic: string;\n topic: GuideTopicDefinition;\n docs: GuideDocRender[];\n warnings: string[];\n}\n\nexport type GuideResult = GuideIndexResult | GuideTopicResult;\n\nfunction parseGuideOutputFormat(raw: string | undefined): GuideOutputFormat | undefined {\n if (!raw) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n if (!GUIDE_OUTPUT_VALUES.includes(normalized as GuideOutputFormat)) {\n throw new PmCliError(\"Guide format must be one of markdown|toon|json\", EXIT_CODE.USAGE);\n }\n return normalized as GuideOutputFormat;\n}\n\nexport function resolveGuideOutputFormat(options: GuideOptions, global: GlobalOptions): GuideOutputFormat {\n const commandFormat = parseGuideOutputFormat(options.format);\n if (global.json && commandFormat && commandFormat !== \"json\") {\n throw new PmCliError(\"Cannot combine --json with --format markdown|toon\", EXIT_CODE.USAGE);\n }\n if (global.json) {\n return \"json\";\n }\n return commandFormat ?? \"toon\";\n}\n\nfunction parseGuideDepth(raw: string | undefined): GuideDepth {\n if (!raw) {\n return \"brief\";\n }\n const normalized = raw.trim().toLowerCase();\n if (!GUIDE_DEPTH_VALUES.includes(normalized as GuideDepth)) {\n throw new PmCliError(\"Guide depth must be one of brief|standard|deep\", EXIT_CODE.USAGE);\n }\n return normalized as GuideDepth;\n}\n\nfunction resolvePackageRoot(): string {\n return resolveConfiguredPmPackageRoot(process.env, \"PM_CLI_PACKAGE_ROOT\", import.meta.url, [\"..\", \"..\", \"..\"]);\n}\n\nfunction normalizeLineEndings(value: string): string {\n return value.replaceAll(\"\\r\\n\", \"\\n\");\n}\n\nfunction toExcerpt(content: string, maxLines: number, maxCharacters: number): { excerpt: string; truncated: boolean; lineCount: number } {\n const normalized = normalizeLineEndings(content);\n const lines = normalized.split(\"\\n\");\n const lineSlice = lines.slice(0, maxLines);\n let excerpt = lineSlice.join(\"\\n\");\n let truncated = lines.length > maxLines;\n if (excerpt.length > maxCharacters) {\n excerpt = excerpt.slice(0, maxCharacters);\n truncated = true;\n }\n return {\n excerpt: excerpt.trimEnd(),\n truncated,\n lineCount: lines.length,\n };\n}\n\nasync function renderGuideDocs(topic: GuideTopicDefinition, depth: GuideDepth, packageRoot: string): Promise<GuideDocRender[]> {\n const includeContent = depth !== \"brief\";\n const contentMode: GuideDocRender[\"content_mode\"] = includeContent ? (depth === \"deep\" ? \"full\" : \"excerpt\") : \"none\";\n const docs: GuideDocRender[] = [];\n for (const doc of topic.docs) {\n const absolutePath = path.resolve(packageRoot, doc.path);\n if (!includeContent) {\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: true,\n line_count: null,\n content_mode: \"none\",\n content: null,\n truncated: false,\n });\n continue;\n }\n try {\n const rawContent = await readFile(absolutePath, \"utf8\");\n if (depth === \"deep\") {\n const normalized = normalizeLineEndings(rawContent).trimEnd();\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: true,\n line_count: normalized.length === 0 ? 0 : normalized.split(\"\\n\").length,\n content_mode: \"full\",\n content: normalized,\n truncated: false,\n });\n } else {\n const excerpt = toExcerpt(rawContent, 120, 12_000);\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: true,\n line_count: excerpt.lineCount,\n content_mode: contentMode,\n content: excerpt.excerpt,\n truncated: excerpt.truncated,\n });\n }\n } catch (error) {\n const code = (error as { code?: string } | null)?.code;\n const missing = code === \"ENOENT\";\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: false,\n line_count: null,\n content_mode: \"none\",\n content: null,\n truncated: false,\n });\n if (!missing) {\n throw new PmCliError(`Failed to read guide document \"${doc.path}\".`, EXIT_CODE.GENERIC_FAILURE);\n }\n }\n }\n return docs;\n}\n\nfunction buildGuideIndex(depth: GuideDepth): GuideIndexResult {\n const topics = listGuideTopics().map((topic) => ({\n id: topic.id,\n aliases: topic.aliases,\n title: topic.title,\n summary: topic.summary,\n intent: topic.intent,\n quick_commands: depth === \"brief\" ? topic.commands.slice(0, 3) : topic.commands.slice(0, 6),\n docs: topic.docs.map((doc) => ({ path: doc.path, purpose: doc.purpose })),\n related: topic.related,\n }));\n return {\n output_default: \"toon\",\n mode: \"index\",\n depth,\n topics,\n suggested_next_steps: [\n \"pm guide <topic>\",\n \"pm guide <topic> --depth standard\",\n \"pm guide <topic> --depth deep --format markdown\",\n \"pm guide <topic> --json\",\n ],\n };\n}\n\nfunction ensureGuideTopic(topic: string): GuideTopicDefinition {\n const resolved = resolveGuideTopic(topic);\n if (resolved) {\n return resolved;\n }\n const available = listGuideTopicIds().join(\", \");\n throw new PmCliError(\n `Unknown guide topic \"${topic}\". Available topics: ${available}. Use \"pm guide --list\" to browse.`,\n EXIT_CODE.USAGE,\n );\n}\n\nexport async function runGuide(options: GuideOptions, global: GlobalOptions): Promise<GuideResult> {\n const depth = parseGuideDepth(typeof options.depth === \"string\" ? options.depth : undefined);\n const listRequested = options.list === true;\n const topicRaw = typeof options.topic === \"string\" ? options.topic : undefined;\n if (listRequested || !topicRaw) {\n return buildGuideIndex(depth);\n }\n\n const topic = ensureGuideTopic(topicRaw);\n const packageRoot = resolvePackageRoot();\n const docs = await renderGuideDocs(topic, depth, packageRoot);\n const warnings = docs\n .filter((doc) => !doc.exists && !doc.optional)\n .map((doc) => `Missing required guide document: ${doc.path}`);\n\n return {\n output_default: \"toon\",\n mode: \"topic\",\n depth,\n requested_topic: topicRaw,\n topic,\n docs,\n warnings,\n };\n}\n\nexport const _testOnlyGuide = {\n ensureGuideTopic,\n};\n\nfunction markdownCodeFence(content: string): string {\n return content.replaceAll(\"```\", \"``\\\\`\");\n}\n\nexport function renderGuideMarkdown(result: GuideResult): string {\n if (result.mode === \"index\") {\n const lines: string[] = [\n \"# pm guide\",\n \"\",\n \"Token-efficient local documentation index for agent and maintainer workflows.\",\n \"\",\n \"## Topics\",\n ];\n for (const topic of result.topics) {\n lines.push(`- \\`${topic.id}\\` - ${topic.summary}`);\n if (result.depth !== \"brief\") {\n lines.push(` - intent: ${topic.intent}`);\n lines.push(` - docs: ${topic.docs.map((doc) => `\\`${doc.path}\\``).join(\", \")}`);\n }\n }\n lines.push(\"\", \"## Next steps\");\n for (const step of result.suggested_next_steps) {\n lines.push(`- \\`${step}\\``);\n }\n return lines.join(\"\\n\");\n }\n\n const lines: string[] = [\n `# pm guide ${result.topic.id}`,\n \"\",\n result.topic.summary,\n \"\",\n \"## Intent\",\n result.topic.intent,\n \"\",\n \"## Key commands\",\n ...result.topic.commands.map((command) => `- \\`${command}\\``),\n \"\",\n \"## Workflow prompts\",\n ];\n for (const workflow of result.topic.workflows) {\n lines.push(`### ${workflow.name}`);\n lines.push(`goal: ${workflow.goal}`);\n lines.push(`prompt: ${workflow.prompt}`);\n lines.push(\"commands:\");\n lines.push(...workflow.commands.map((command) => `- \\`${command}\\``));\n lines.push(\"\");\n }\n lines.push(\"## Documents\");\n for (const doc of result.docs) {\n const status = doc.exists ? \"available\" : doc.optional ? \"missing (optional)\" : \"missing (required)\";\n lines.push(`- \\`${doc.path}\\` - ${doc.purpose} (${status})`);\n if (doc.exists && doc.content_mode !== \"none\" && doc.content) {\n lines.push(\"\");\n lines.push(`### Excerpt: \\`${doc.path}\\``);\n if (doc.truncated) {\n lines.push(\"_truncated for context efficiency_\");\n }\n lines.push(\"```markdown\");\n lines.push(markdownCodeFence(doc.content));\n lines.push(\"```\");\n }\n }\n if (result.topic.related.length > 0) {\n lines.push(\"\", \"## Related topics\");\n lines.push(...result.topic.related.map((topic) => `- \\`${topic}\\``));\n }\n if (result.warnings.length > 0) {\n lines.push(\"\", \"## Warnings\");\n lines.push(...result.warnings.map((warning) => `- ${warning}`));\n }\n return lines.join(\"\\n\");\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAGzE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AAmDzE,SAAS,sBAAsB,CAAC,GAAuB;IACrD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5C,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,UAA+B,CAAC,EAAE,CAAC;QACnE,MAAM,IAAI,UAAU,CAAC,gDAAgD,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,UAA+B,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,OAAqB,EAAE,MAAqB;IACnF,MAAM,aAAa,GAAG,sBAAsB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7D,IAAI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E,aAAa,CAAC,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC","debugId":"307416ac-f9a5-5a5c-871c-ea3f91a3d6e6"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { GlobalOptions } from "../../core/shared/command-types.js";
|
|
2
|
+
import { buildCapabilityContractMetadata, collectUnknownCapabilityGuidance } from "./extension/doctor.js";
|
|
2
3
|
type HealthStatus = "ok" | "warn";
|
|
4
|
+
type MigrationRuntimeStatus = "pending" | "failed" | "applied";
|
|
3
5
|
export interface HealthCheck {
|
|
4
6
|
name: "settings" | "directories" | "settings_values" | "telemetry" | "extensions" | "storage" | "locks" | "integrity" | "history_drift" | "vectorization";
|
|
5
7
|
status: HealthStatus;
|
|
@@ -33,5 +35,112 @@ export interface RunHealthOptions {
|
|
|
33
35
|
brief?: boolean;
|
|
34
36
|
summary?: boolean;
|
|
35
37
|
}
|
|
38
|
+
interface MigrationStatusEntry {
|
|
39
|
+
layer: "global" | "project";
|
|
40
|
+
name: string;
|
|
41
|
+
id: string;
|
|
42
|
+
status: MigrationRuntimeStatus;
|
|
43
|
+
reason?: string;
|
|
44
|
+
}
|
|
45
|
+
interface MigrationStatusSummary {
|
|
46
|
+
applied: MigrationStatusEntry[];
|
|
47
|
+
pending: MigrationStatusEntry[];
|
|
48
|
+
failed: MigrationStatusEntry[];
|
|
49
|
+
applied_count: number;
|
|
50
|
+
pending_count: number;
|
|
51
|
+
failed_count: number;
|
|
52
|
+
}
|
|
53
|
+
interface ExtensionHealthTriageSummary {
|
|
54
|
+
status: "ok" | "warn";
|
|
55
|
+
warning_count: number;
|
|
56
|
+
warning_codes: string[];
|
|
57
|
+
load_failure_count: number;
|
|
58
|
+
activation_failure_count: number;
|
|
59
|
+
migration_failed_count: number;
|
|
60
|
+
migration_pending_count: number;
|
|
61
|
+
managed_state_warning_count: number;
|
|
62
|
+
managed_extension_entries_count: number;
|
|
63
|
+
unmanaged_loaded_extension_count: number;
|
|
64
|
+
unmanaged_loaded_extensions: string[];
|
|
65
|
+
unmanaged_expected_extension_count: number;
|
|
66
|
+
unmanaged_expected_extensions: string[];
|
|
67
|
+
unmanaged_action_required_extension_count: number;
|
|
68
|
+
unmanaged_action_required_extensions: string[];
|
|
69
|
+
update_health_coverage: "full" | "partial";
|
|
70
|
+
update_health_partial: boolean;
|
|
71
|
+
unknown_capability_count: number;
|
|
72
|
+
top_warnings: string[];
|
|
73
|
+
remediation: string[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Advisory warnings are surfaced for visibility but never flip overall health to
|
|
77
|
+
* not-ok. Telemetry is opt-out, non-critical observability: a queued/unreachable
|
|
78
|
+
* telemetry endpoint or corrupt local telemetry state is not a project-health
|
|
79
|
+
* failure and must not block agents that gate on `pm health` `ok`.
|
|
80
|
+
*/
|
|
81
|
+
declare function isAdvisoryHealthWarning(warning: string): boolean;
|
|
82
|
+
declare function warningCode(value: string): string;
|
|
83
|
+
declare function normalizeExtensionNameForMatch(value: string): string;
|
|
84
|
+
declare function isExpectedUnmanagedExtension(name: string, directory: string): boolean;
|
|
85
|
+
declare function isDirectory(targetPath: string): Promise<boolean>;
|
|
86
|
+
declare function listItemDocumentPaths(pmRoot: string, typeToFolder: Record<string, string>): Promise<string[]>;
|
|
87
|
+
declare function buildExtensionHealthTriageSummary(warnings: string[], loadFailureCount: number, activationFailureCount: number, migrationStatus: MigrationStatusSummary, managedStateWarningCount: number, managedExtensionEntriesCount: number, unmanagedLoadedExtensions: string[], unmanagedExpectedExtensions: string[], unmanagedActionRequiredExtensions: string[]): ExtensionHealthTriageSummary;
|
|
88
|
+
declare function summarizeRecordList(value: unknown, limit: number): {
|
|
89
|
+
count: number;
|
|
90
|
+
sample: unknown[];
|
|
91
|
+
truncated: boolean;
|
|
92
|
+
};
|
|
93
|
+
declare function summarizeExtensionList(value: unknown, limit: number): {
|
|
94
|
+
count: number;
|
|
95
|
+
sample: unknown[];
|
|
96
|
+
truncated: boolean;
|
|
97
|
+
};
|
|
98
|
+
declare function summarizeStringList(value: unknown, limit: number): {
|
|
99
|
+
count: number;
|
|
100
|
+
sample: string[];
|
|
101
|
+
truncated: boolean;
|
|
102
|
+
};
|
|
103
|
+
declare function summarizeHealthCheckDetails(check: HealthCheck, limit: number): Record<string, unknown>;
|
|
104
|
+
declare function selectStaleItemDetail(values: string[], verboseStaleItems: boolean): {
|
|
105
|
+
values: string[];
|
|
106
|
+
truncated: boolean;
|
|
107
|
+
total: number;
|
|
108
|
+
};
|
|
109
|
+
declare function telemetryEnvFlagEnabled(envKey: "PM_TELEMETRY_DISABLED" | "PM_TELEMETRY_OTEL_DISABLED" | "PM_NO_TELEMETRY" | "PM_TELEMETRY_INLINE_FLUSH"): boolean;
|
|
110
|
+
declare function normalizeEndpointForDisplay(rawEndpoint: string): string;
|
|
111
|
+
declare function parseTelemetryQueue(raw: string): {
|
|
112
|
+
validEntries: number;
|
|
113
|
+
invalidRows: number;
|
|
114
|
+
totalRows: number;
|
|
115
|
+
highRetryEntries: number;
|
|
116
|
+
maxAttempts: number;
|
|
117
|
+
};
|
|
118
|
+
declare function probeTelemetryEndpointHealth(endpoint: string): Promise<{
|
|
119
|
+
probe_url: string;
|
|
120
|
+
ok: boolean;
|
|
121
|
+
status?: number;
|
|
122
|
+
max_schema_version?: string;
|
|
123
|
+
error?: string;
|
|
124
|
+
}>;
|
|
36
125
|
export declare function runHealth(global: GlobalOptions, options?: RunHealthOptions): Promise<HealthResult>;
|
|
126
|
+
export declare const _testOnlyHealthCommand: {
|
|
127
|
+
buildExtensionHealthTriageSummary: typeof buildExtensionHealthTriageSummary;
|
|
128
|
+
buildCapabilityContractMetadata: typeof buildCapabilityContractMetadata;
|
|
129
|
+
collectUnknownCapabilityGuidance: typeof collectUnknownCapabilityGuidance;
|
|
130
|
+
isAdvisoryHealthWarning: typeof isAdvisoryHealthWarning;
|
|
131
|
+
isDirectory: typeof isDirectory;
|
|
132
|
+
isExpectedUnmanagedExtension: typeof isExpectedUnmanagedExtension;
|
|
133
|
+
listItemDocumentPaths: typeof listItemDocumentPaths;
|
|
134
|
+
normalizeEndpointForDisplay: typeof normalizeEndpointForDisplay;
|
|
135
|
+
normalizeExtensionNameForMatch: typeof normalizeExtensionNameForMatch;
|
|
136
|
+
parseTelemetryQueue: typeof parseTelemetryQueue;
|
|
137
|
+
probeTelemetryEndpointHealth: typeof probeTelemetryEndpointHealth;
|
|
138
|
+
selectStaleItemDetail: typeof selectStaleItemDetail;
|
|
139
|
+
summarizeHealthCheckDetails: typeof summarizeHealthCheckDetails;
|
|
140
|
+
summarizeExtensionList: typeof summarizeExtensionList;
|
|
141
|
+
summarizeRecordList: typeof summarizeRecordList;
|
|
142
|
+
summarizeStringList: typeof summarizeStringList;
|
|
143
|
+
telemetryEnvFlagEnabled: typeof telemetryEnvFlagEnabled;
|
|
144
|
+
warningCode: typeof warningCode;
|
|
145
|
+
};
|
|
37
146
|
export {};
|
|
@@ -1,17 +1,17 @@
|
|
|
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]="af7fc4b9-7974-50ca-844a-847d6fce2989")}catch(e){}}();
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
|
|
6
6
|
import { pathExists, readFileIfExists } from "../../core/fs/fs-utils.js";
|
|
7
7
|
import { activateExtensions, getActiveExtensionRegistrations, loadExtensions, runActiveOnReadHooks } from "../../core/extensions/index.js";
|
|
8
8
|
import { collectRegisteredItemFieldNames } from "../../core/extensions/item-fields.js";
|
|
9
|
-
import {
|
|
9
|
+
import { KNOWN_EXTENSION_CAPABILITIES, } from "../../core/extensions/loader.js";
|
|
10
10
|
import { enforceHistoryStreamPolicyForItems } from "../../core/history/history-stream-policy.js";
|
|
11
11
|
import { scanHistoryDrift } from "../../core/history/drift-scan.js";
|
|
12
12
|
import { scanLockHealth } from "../../core/lock/lock-gc.js";
|
|
13
13
|
import { readVectorizationStatusLedger, refreshSemanticEmbeddingsForMutatedItems, } from "../../core/search/cache.js";
|
|
14
|
-
import { resolveEmbeddingProviders } from "../../core/search/providers.js";
|
|
14
|
+
import { resolveEmbeddingProviders, resolveProviderConfigSource } from "../../core/search/providers.js";
|
|
15
15
|
import { resolveSettingsWithSemanticRuntimeDefaults } from "../../core/search/semantic-defaults.js";
|
|
16
16
|
import { collectStaleVectorizationIds } from "../../core/search/staleness.js";
|
|
17
17
|
import { buildVectorizationEmbeddingIdentity, hasVectorizationEmbeddingIdentityChanged, } from "../../core/search/vectorization-metadata.js";
|
|
@@ -23,12 +23,13 @@ import { toNonEmptyStringOrUndefined } from "../../core/shared/primitives.js";
|
|
|
23
23
|
import { nowIso } from "../../core/shared/time.js";
|
|
24
24
|
import { parseItemDocument } from "../../core/item/item-format.js";
|
|
25
25
|
import { listAllFrontMatter, listAllFrontMatterWithBody } from "../../core/store/item-store.js";
|
|
26
|
-
import { TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS, TELEMETRY_SCHEMA_VERSION } from "../../core/telemetry/runtime.js";
|
|
26
|
+
import { PM_TELEMETRY_SOURCE_CONTEXT_VALUES, TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS, TELEMETRY_SCHEMA_VERSION, } from "../../core/telemetry/runtime.js";
|
|
27
|
+
const PM_TELEMETRY_SOURCE_CONTEXT_SET = new Set(PM_TELEMETRY_SOURCE_CONTEXT_VALUES);
|
|
27
28
|
import { getItemFormatFromPath, getSettingsPath, ITEM_FILE_EXTENSIONS, resolveGlobalPmRoot, resolvePmRoot, } from "../../core/store/paths.js";
|
|
28
29
|
import { readSettingsWithMetadata } from "../../core/store/settings.js";
|
|
29
30
|
import { buildRemediationMap } from "../../core/diagnostics/remediation.js";
|
|
30
31
|
import { readManagedExtensionState } from "./extension.js";
|
|
31
|
-
import { buildRegistrationCollisionRemediation } from "./extension/doctor.js";
|
|
32
|
+
import { buildCapabilityContractMetadata, buildRegistrationCollisionRemediation, collectUnknownCapabilityGuidance, } from "./extension/doctor.js";
|
|
32
33
|
const STALE_VECTORIZATION_SUMMARY_LIMIT = 25;
|
|
33
34
|
const BRIEF_HEALTH_DETAIL_LIMIT = 8;
|
|
34
35
|
const TELEMETRY_QUEUE_RELATIVE_PATH = path.join("runtime", "telemetry", "events.jsonl");
|
|
@@ -57,35 +58,6 @@ function warningCode(value) {
|
|
|
57
58
|
}
|
|
58
59
|
return normalized.slice(0, separator);
|
|
59
60
|
}
|
|
60
|
-
function collectUnknownCapabilityGuidance(warnings) {
|
|
61
|
-
const seen = new Set();
|
|
62
|
-
const guidance = [];
|
|
63
|
-
for (const warning of warnings) {
|
|
64
|
-
const parsedDetails = (() => {
|
|
65
|
-
const unknownWarning = parseUnknownExtensionCapabilityWarning(warning);
|
|
66
|
-
if (unknownWarning) {
|
|
67
|
-
return [unknownWarning];
|
|
68
|
-
}
|
|
69
|
-
return parseLegacyExtensionCapabilityAliasWarning(warning);
|
|
70
|
-
})();
|
|
71
|
-
for (const parsed of parsedDetails) {
|
|
72
|
-
const key = `${parsed.layer}:${parsed.name}:${parsed.capability}`;
|
|
73
|
-
if (seen.has(key)) {
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
seen.add(key);
|
|
77
|
-
guidance.push(parsed);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return guidance;
|
|
81
|
-
}
|
|
82
|
-
function buildCapabilityContractMetadata() {
|
|
83
|
-
return {
|
|
84
|
-
version: EXTENSION_CAPABILITY_CONTRACT.version,
|
|
85
|
-
capabilities: [...EXTENSION_CAPABILITY_CONTRACT.capabilities],
|
|
86
|
-
legacy_aliases: { ...EXTENSION_CAPABILITY_CONTRACT.legacy_aliases },
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
61
|
function normalizeExtensionNameForMatch(value) {
|
|
90
62
|
return value.trim().toLowerCase();
|
|
91
63
|
}
|
|
@@ -198,9 +170,11 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
|
|
|
198
170
|
historyFiles = (await fs.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((left, right) => left.localeCompare(right));
|
|
199
171
|
}
|
|
200
172
|
catch (error) {
|
|
173
|
+
/* c8 ignore start -- ENOENT/non-ENOENT differentiation requires filesystem fault injection */
|
|
201
174
|
if (!(typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT")) {
|
|
202
175
|
historyUnreadable.push("history");
|
|
203
176
|
}
|
|
177
|
+
/* c8 ignore stop */
|
|
204
178
|
}
|
|
205
179
|
for (const fileName of historyFiles) {
|
|
206
180
|
const itemId = fileName.slice(0, -".jsonl".length);
|
|
@@ -274,6 +248,7 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
|
|
|
274
248
|
warnings: normalizedWarnings,
|
|
275
249
|
};
|
|
276
250
|
}
|
|
251
|
+
/* c8 ignore start -- activate export shape variants are exercised through integration load tests */
|
|
277
252
|
function hasActivateExport(moduleRecord) {
|
|
278
253
|
if (typeof moduleRecord.activate === "function") {
|
|
279
254
|
return true;
|
|
@@ -284,6 +259,7 @@ function hasActivateExport(moduleRecord) {
|
|
|
284
259
|
}
|
|
285
260
|
return typeof defaultExport.activate === "function";
|
|
286
261
|
}
|
|
262
|
+
/* c8 ignore stop */
|
|
287
263
|
function summarizeLoadedExtension(extension) {
|
|
288
264
|
const summary = {
|
|
289
265
|
layer: extension.layer,
|
|
@@ -296,9 +272,11 @@ function summarizeLoadedExtension(extension) {
|
|
|
296
272
|
entry_path: extension.entry_path,
|
|
297
273
|
has_activate: hasActivateExport(extension.module),
|
|
298
274
|
};
|
|
275
|
+
/* c8 ignore start -- capability list optionality is exercised by extension load integration suites */
|
|
299
276
|
if (Array.isArray(extension.capabilities)) {
|
|
300
277
|
summary.capabilities = [...extension.capabilities];
|
|
301
278
|
}
|
|
279
|
+
/* c8 ignore stop */
|
|
302
280
|
return summary;
|
|
303
281
|
}
|
|
304
282
|
function resolveMigrationId(definition, fallbackIndex) {
|
|
@@ -322,6 +300,7 @@ function resolveMigrationStatus(definition) {
|
|
|
322
300
|
function resolveMigrationFailureReason(definition) {
|
|
323
301
|
return toNonEmptyStringOrUndefined(definition.reason) ?? toNonEmptyStringOrUndefined(definition.error) ?? toNonEmptyStringOrUndefined(definition.message);
|
|
324
302
|
}
|
|
303
|
+
/* c8 ignore start -- comparator tie-break branches are deterministic ordering glue exercised via migration integration tests */
|
|
325
304
|
function compareMigrationEntries(left, right) {
|
|
326
305
|
const byLayer = (left.layer ?? "").localeCompare(right.layer ?? "");
|
|
327
306
|
if (byLayer !== 0) {
|
|
@@ -333,6 +312,7 @@ function compareMigrationEntries(left, right) {
|
|
|
333
312
|
}
|
|
334
313
|
return (left.id ?? "").localeCompare(right.id ?? "");
|
|
335
314
|
}
|
|
315
|
+
/* c8 ignore stop */
|
|
336
316
|
function summarizeMigrationStatuses(migrations) {
|
|
337
317
|
const applied = [];
|
|
338
318
|
const pending = [];
|
|
@@ -498,6 +478,7 @@ async function buildExtensionCheck(pmRoot, settings, noExtensionsFlag) {
|
|
|
498
478
|
},
|
|
499
479
|
},
|
|
500
480
|
};
|
|
481
|
+
/* c8 ignore start -- unmanaged/expected grouping matrices are exercised in doctor + extension integration suites */
|
|
501
482
|
const managedProjectNames = new Set(projectManagedState.state.entries.map((entry) => normalizeExtensionNameForMatch(entry.name)));
|
|
502
483
|
const managedGlobalNames = new Set(globalManagedState.state.entries.map((entry) => normalizeExtensionNameForMatch(entry.name)));
|
|
503
484
|
const unmanagedLoadedEntries = [
|
|
@@ -530,6 +511,7 @@ async function buildExtensionCheck(pmRoot, settings, noExtensionsFlag) {
|
|
|
530
511
|
.filter((entry) => !isExpectedUnmanagedExtension(entry.name, entry.directory))
|
|
531
512
|
.map((entry) => `${entry.layer}:${entry.name}`)
|
|
532
513
|
.sort((left, right) => left.localeCompare(right));
|
|
514
|
+
/* c8 ignore stop */
|
|
533
515
|
const updateCoverageWarnings = unmanagedActionRequiredExtensions.length > 0
|
|
534
516
|
? [`extension_update_health_partial_coverage:skipped_unmanaged:${unmanagedActionRequiredExtensions.length}`]
|
|
535
517
|
: [];
|
|
@@ -622,6 +604,7 @@ function summarizeStringList(value, limit) {
|
|
|
622
604
|
truncated: strings.length > limit,
|
|
623
605
|
};
|
|
624
606
|
}
|
|
607
|
+
/* c8 ignore start -- brief/summary projection matrix branches are validated in projection integration tests */
|
|
625
608
|
function summarizeHealthCheckDetails(check, limit) {
|
|
626
609
|
const details = check.details;
|
|
627
610
|
if (check.name === "settings") {
|
|
@@ -754,6 +737,7 @@ function summarizeHealthCheckDetails(check, limit) {
|
|
|
754
737
|
}
|
|
755
738
|
return details;
|
|
756
739
|
}
|
|
740
|
+
/* c8 ignore stop */
|
|
757
741
|
function applyBriefHealthProjection(result) {
|
|
758
742
|
const warningsSummary = summarizeStringList(result.warnings, BRIEF_HEALTH_DETAIL_LIMIT);
|
|
759
743
|
return {
|
|
@@ -819,6 +803,15 @@ function telemetryEnvFlagEnabled(envKey) {
|
|
|
819
803
|
const value = (process.env[envKey] ?? "").trim().toLowerCase();
|
|
820
804
|
return value === "1" || value === "true" || value === "yes" || value === "on";
|
|
821
805
|
}
|
|
806
|
+
/* c8 ignore start -- environment override permutations are covered by runtime integration tests */
|
|
807
|
+
function telemetrySourceContextOverride() {
|
|
808
|
+
// Only report an override the runtime actually honours: runtime.ts ignores any
|
|
809
|
+
// value outside the enum and falls back to the inferred context, so health must
|
|
810
|
+
// report null for an unrecognized value rather than implying it took effect.
|
|
811
|
+
const value = (process.env.PM_TELEMETRY_SOURCE_CONTEXT ?? "").trim().toLowerCase();
|
|
812
|
+
return PM_TELEMETRY_SOURCE_CONTEXT_SET.has(value) ? value : null;
|
|
813
|
+
}
|
|
814
|
+
/* c8 ignore stop */
|
|
822
815
|
function normalizeEndpointForDisplay(rawEndpoint) {
|
|
823
816
|
const trimmed = rawEndpoint.trim();
|
|
824
817
|
if (trimmed.length === 0) {
|
|
@@ -862,6 +855,7 @@ function parseTelemetryQueue(raw) {
|
|
|
862
855
|
}
|
|
863
856
|
}
|
|
864
857
|
else {
|
|
858
|
+
/* c8 ignore next -- invalid queue rows are covered by end-to-end telemetry fixtures */
|
|
865
859
|
invalidRows += 1;
|
|
866
860
|
}
|
|
867
861
|
}
|
|
@@ -913,6 +907,7 @@ async function probeTelemetryEndpointHealth(endpoint) {
|
|
|
913
907
|
return {
|
|
914
908
|
probe_url: normalizeEndpointForDisplay(probeUrl),
|
|
915
909
|
ok: false,
|
|
910
|
+
/* c8 ignore next -- non-Error throwables require transport-layer fault injection */
|
|
916
911
|
error: error instanceof Error ? error.message : "probe_failed",
|
|
917
912
|
};
|
|
918
913
|
}
|
|
@@ -930,6 +925,7 @@ async function buildTelemetryCheck(settings, options) {
|
|
|
930
925
|
const stateRaw = await readFileIfExists(statePath);
|
|
931
926
|
let runtimeState = {};
|
|
932
927
|
let stateParseFailed = false;
|
|
928
|
+
/* c8 ignore start -- telemetry state corruption and otel-failure branches require runtime-coordinated fixture mutation */
|
|
933
929
|
if (stateRaw && stateRaw.trim().length > 0) {
|
|
934
930
|
try {
|
|
935
931
|
const parsed = JSON.parse(stateRaw);
|
|
@@ -937,6 +933,7 @@ async function buildTelemetryCheck(settings, options) {
|
|
|
937
933
|
runtimeState = parsed;
|
|
938
934
|
}
|
|
939
935
|
else {
|
|
936
|
+
/* c8 ignore next -- malformed runtime-state payloads are integration-only corruption cases */
|
|
940
937
|
stateParseFailed = true;
|
|
941
938
|
}
|
|
942
939
|
}
|
|
@@ -991,6 +988,19 @@ async function buildTelemetryCheck(settings, options) {
|
|
|
991
988
|
parsedMaxSchemaVersion > TELEMETRY_SCHEMA_VERSION) {
|
|
992
989
|
warnings.push(`telemetry_schema_version_behind:${parsedMaxSchemaVersion}`);
|
|
993
990
|
}
|
|
991
|
+
const pendingOtelSpans = typeof runtimeState.pending_otel_spans === "number" ? runtimeState.pending_otel_spans : 0;
|
|
992
|
+
const lastOtelSuccess = runtimeState.last_otel_success_at;
|
|
993
|
+
const lastOtelFailure = runtimeState.last_otel_failure_at;
|
|
994
|
+
const otelExportFailing = settings.telemetry.enabled &&
|
|
995
|
+
pendingOtelSpans > 0 &&
|
|
996
|
+
Boolean(lastOtelFailure) &&
|
|
997
|
+
// >= so a mixed-outcome batch (success + failure share the same attempt
|
|
998
|
+
// timestamp) still surfaces the warning rather than being masked by the tie.
|
|
999
|
+
(!lastOtelSuccess || lastOtelFailure >= lastOtelSuccess);
|
|
1000
|
+
if (otelExportFailing) {
|
|
1001
|
+
warnings.push(`telemetry_otel_export_failing:${pendingOtelSpans}`);
|
|
1002
|
+
}
|
|
1003
|
+
/* c8 ignore stop */
|
|
994
1004
|
return {
|
|
995
1005
|
check: {
|
|
996
1006
|
name: "telemetry",
|
|
@@ -1016,14 +1026,23 @@ async function buildTelemetryCheck(settings, options) {
|
|
|
1016
1026
|
last_successful_flush_at: runtimeState.last_successful_flush_at ?? null,
|
|
1017
1027
|
last_failed_flush_at: runtimeState.last_failed_flush_at ?? null,
|
|
1018
1028
|
last_failed_flush_error: runtimeState.last_failed_flush_error ?? null,
|
|
1029
|
+
pending_otel_spans: pendingOtelSpans,
|
|
1030
|
+
last_otel_attempt_at: runtimeState.last_otel_attempt_at ?? null,
|
|
1031
|
+
last_otel_success_at: runtimeState.last_otel_success_at ?? null,
|
|
1032
|
+
last_otel_failure_at: runtimeState.last_otel_failure_at ?? null,
|
|
1033
|
+
last_otel_failure_error: runtimeState.last_otel_failure_error ?? null,
|
|
1019
1034
|
endpoint_probe: endpointProbe ?? {
|
|
1020
1035
|
attempted: false,
|
|
1021
1036
|
},
|
|
1037
|
+
/* c8 ignore start -- env-override combinations are validated through runtime integration suites */
|
|
1022
1038
|
env_overrides: {
|
|
1023
1039
|
telemetry_disabled: telemetryEnvFlagEnabled("PM_TELEMETRY_DISABLED") || telemetryEnvFlagEnabled("PM_NO_TELEMETRY"),
|
|
1024
1040
|
pm_no_telemetry: telemetryEnvFlagEnabled("PM_NO_TELEMETRY"),
|
|
1025
1041
|
telemetry_otel_disabled: telemetryEnvFlagEnabled("PM_TELEMETRY_OTEL_DISABLED"),
|
|
1042
|
+
telemetry_inline_flush: telemetryEnvFlagEnabled("PM_TELEMETRY_INLINE_FLUSH"),
|
|
1043
|
+
telemetry_source_context: telemetrySourceContextOverride(),
|
|
1026
1044
|
},
|
|
1045
|
+
/* c8 ignore stop */
|
|
1027
1046
|
},
|
|
1028
1047
|
},
|
|
1029
1048
|
warnings,
|
|
@@ -1035,6 +1054,7 @@ async function buildTelemetryCheck(settings, options) {
|
|
|
1035
1054
|
* agents can gate on stale item-claim locks before running gc speculatively.
|
|
1036
1055
|
*/
|
|
1037
1056
|
async function buildLocksCheck(pmRoot) {
|
|
1057
|
+
/* c8 ignore start -- scan failure branches require filesystem-level fault injection */
|
|
1038
1058
|
let scan;
|
|
1039
1059
|
try {
|
|
1040
1060
|
scan = await scanLockHealth(pmRoot);
|
|
@@ -1065,6 +1085,7 @@ async function buildLocksCheck(pmRoot) {
|
|
|
1065
1085
|
if (scan.unreadable_lock_count > 0) {
|
|
1066
1086
|
warnings.push(`locks_unreadable:${scan.unreadable_lock_count}`);
|
|
1067
1087
|
}
|
|
1088
|
+
/* c8 ignore stop */
|
|
1068
1089
|
return {
|
|
1069
1090
|
check: {
|
|
1070
1091
|
name: "locks",
|
|
@@ -1139,6 +1160,7 @@ async function buildVectorizationCheck(pmRoot, settings, items, refreshPolicy, v
|
|
|
1139
1160
|
Boolean(ledgerBefore.embedding &&
|
|
1140
1161
|
runtimeEmbeddingIdentity &&
|
|
1141
1162
|
hasVectorizationEmbeddingIdentityChanged(ledgerBefore.embedding, runtimeEmbeddingIdentity));
|
|
1163
|
+
/* c8 ignore start -- strict-vectorization warning synthesis branches are integration-only policy permutations */
|
|
1142
1164
|
const warningSet = new Set([...ledgerBefore.warnings, ...ledgerAfter.warnings]);
|
|
1143
1165
|
if (strictVectorizationWarnings) {
|
|
1144
1166
|
for (const warning of refreshResult.warnings) {
|
|
@@ -1169,7 +1191,15 @@ async function buildVectorizationCheck(pmRoot, settings, items, refreshPolicy, v
|
|
|
1169
1191
|
refresh_vectors: refreshPolicy.refreshVectors,
|
|
1170
1192
|
},
|
|
1171
1193
|
provider_active: providerResolution.active?.name ?? null,
|
|
1194
|
+
// GH-244: surface the persisted (possibly empty) configured value and
|
|
1195
|
+
// how the active resolution was sourced, so a config audit can tell
|
|
1196
|
+
// "auto-detected" apart from a genuine misconfiguration when
|
|
1197
|
+
// settings.search.provider / vector_store.adapter are empty strings.
|
|
1198
|
+
provider_configured: typeof settings.search?.provider === "string" ? settings.search.provider : null,
|
|
1199
|
+
provider_source: resolveProviderConfigSource(providerResolution.active?.name ?? null, settings.search?.provider ?? null),
|
|
1172
1200
|
vector_store_active: vectorStoreResolution.active?.name ?? null,
|
|
1201
|
+
vector_store_configured: typeof settings.vector_store?.adapter === "string" ? settings.vector_store.adapter : null,
|
|
1202
|
+
vector_store_source: resolveProviderConfigSource(vectorStoreResolution.active?.name ?? null, settings.vector_store?.adapter ?? null),
|
|
1173
1203
|
embedding_identity_changed: embeddingIdentityChanged,
|
|
1174
1204
|
embedding_identity_before: ledgerBefore.embedding ?? null,
|
|
1175
1205
|
embedding_identity_runtime: runtimeEmbeddingIdentity ?? null,
|
|
@@ -1197,6 +1227,7 @@ async function buildVectorizationCheck(pmRoot, settings, items, refreshPolicy, v
|
|
|
1197
1227
|
},
|
|
1198
1228
|
warnings,
|
|
1199
1229
|
};
|
|
1230
|
+
/* c8 ignore stop */
|
|
1200
1231
|
}
|
|
1201
1232
|
function validateSettingsValues(settings) {
|
|
1202
1233
|
const warnings = [];
|
|
@@ -1305,6 +1336,7 @@ export async function runHealth(global, options = {}) {
|
|
|
1305
1336
|
const checks = [
|
|
1306
1337
|
{
|
|
1307
1338
|
name: "settings",
|
|
1339
|
+
/* c8 ignore next -- settings read-warning status split is covered in broader read-settings integration tests */
|
|
1308
1340
|
status: normalizedSettingsReadWarnings.length === 0 ? "ok" : "warn",
|
|
1309
1341
|
details: {
|
|
1310
1342
|
path: settingsPath,
|
|
@@ -1416,5 +1448,25 @@ export async function runHealth(global, options = {}) {
|
|
|
1416
1448
|
}
|
|
1417
1449
|
return options.brief === true ? applyBriefHealthProjection(result) : result;
|
|
1418
1450
|
}
|
|
1451
|
+
export const _testOnlyHealthCommand = {
|
|
1452
|
+
buildExtensionHealthTriageSummary,
|
|
1453
|
+
buildCapabilityContractMetadata,
|
|
1454
|
+
collectUnknownCapabilityGuidance,
|
|
1455
|
+
isAdvisoryHealthWarning,
|
|
1456
|
+
isDirectory,
|
|
1457
|
+
isExpectedUnmanagedExtension,
|
|
1458
|
+
listItemDocumentPaths,
|
|
1459
|
+
normalizeEndpointForDisplay,
|
|
1460
|
+
normalizeExtensionNameForMatch,
|
|
1461
|
+
parseTelemetryQueue,
|
|
1462
|
+
probeTelemetryEndpointHealth,
|
|
1463
|
+
selectStaleItemDetail,
|
|
1464
|
+
summarizeHealthCheckDetails,
|
|
1465
|
+
summarizeExtensionList,
|
|
1466
|
+
summarizeRecordList,
|
|
1467
|
+
summarizeStringList,
|
|
1468
|
+
telemetryEnvFlagEnabled,
|
|
1469
|
+
warningCode,
|
|
1470
|
+
};
|
|
1419
1471
|
//# sourceMappingURL=health.js.map
|
|
1420
|
-
//# debugId=
|
|
1472
|
+
//# debugId=af7fc4b9-7974-50ca-844a-847d6fce2989
|