@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,12 +1,12 @@
|
|
|
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]="8d33a904-e001-5f2c-9161-4554353f8ca6")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
parseLimit
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-UBMCSJXX.js";
|
|
6
|
+
import "./chunk-ZONXMSVB.js";
|
|
7
7
|
import {
|
|
8
8
|
nowIso
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-G2YVUY7I.js";
|
|
10
10
|
import {
|
|
11
11
|
EXIT_CODE,
|
|
12
12
|
PmCliError,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
resolveGlobalPmRoot,
|
|
28
28
|
resolvePmRoot,
|
|
29
29
|
writeFileAtomic
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-KTVETP66.js";
|
|
31
31
|
|
|
32
32
|
// dist/cli/commands/test-runs.js
|
|
33
33
|
import os from "node:os";
|
|
@@ -124,46 +124,48 @@ async function listBackgroundRunRecordPaths(pmRoot) {
|
|
|
124
124
|
const entries = await fs.readdir(recordsRoot, { withFileTypes: true });
|
|
125
125
|
return entries.filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => path.join(recordsRoot, entry.name)).sort((left, right) => right.localeCompare(left));
|
|
126
126
|
}
|
|
127
|
+
function parseLinuxRssStatus(raw) {
|
|
128
|
+
const match = raw.match(/^VmRSS:\s+(\d+)\s+kB$/m);
|
|
129
|
+
if (!match) {
|
|
130
|
+
return void 0;
|
|
131
|
+
}
|
|
132
|
+
return Number.parseInt(match[1], 10) * 1024;
|
|
133
|
+
}
|
|
127
134
|
async function readLinuxRssBytes(pid) {
|
|
128
135
|
if (process.platform !== "linux") {
|
|
129
136
|
return void 0;
|
|
130
137
|
}
|
|
131
138
|
try {
|
|
132
139
|
const raw = await fs.readFile(`/proc/${pid}/status`, "utf8");
|
|
133
|
-
|
|
134
|
-
if (!match) {
|
|
135
|
-
return void 0;
|
|
136
|
-
}
|
|
137
|
-
const value = Number.parseInt(match[1] ?? "", 10);
|
|
138
|
-
if (!Number.isFinite(value)) {
|
|
139
|
-
return void 0;
|
|
140
|
-
}
|
|
141
|
-
return value * 1024;
|
|
140
|
+
return parseLinuxRssStatus(raw);
|
|
142
141
|
} catch {
|
|
143
142
|
return void 0;
|
|
144
143
|
}
|
|
145
144
|
}
|
|
145
|
+
function parseLinuxCpuStat(raw) {
|
|
146
|
+
const closeParenIndex = raw.lastIndexOf(")");
|
|
147
|
+
if (closeParenIndex < 0) {
|
|
148
|
+
return {};
|
|
149
|
+
}
|
|
150
|
+
const remainder = raw.slice(closeParenIndex + 2).trim();
|
|
151
|
+
const parts = remainder.split(/\s+/);
|
|
152
|
+
const utimeTicks = Number.parseInt(parts[11], 10);
|
|
153
|
+
const stimeTicks = Number.parseInt(parts[12], 10);
|
|
154
|
+
if (!Number.isFinite(utimeTicks) || !Number.isFinite(stimeTicks)) {
|
|
155
|
+
return {};
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
cpu_user_seconds: utimeTicks / PROC_STAT_TICKS_PER_SECOND,
|
|
159
|
+
cpu_system_seconds: stimeTicks / PROC_STAT_TICKS_PER_SECOND
|
|
160
|
+
};
|
|
161
|
+
}
|
|
146
162
|
async function readLinuxCpuSeconds(pid) {
|
|
147
163
|
if (process.platform !== "linux") {
|
|
148
164
|
return {};
|
|
149
165
|
}
|
|
150
166
|
try {
|
|
151
167
|
const raw = await fs.readFile(`/proc/${pid}/stat`, "utf8");
|
|
152
|
-
|
|
153
|
-
if (closeParenIndex < 0) {
|
|
154
|
-
return {};
|
|
155
|
-
}
|
|
156
|
-
const remainder = raw.slice(closeParenIndex + 2).trim();
|
|
157
|
-
const parts = remainder.split(/\s+/);
|
|
158
|
-
const utimeTicks = Number.parseInt(parts[11] ?? "", 10);
|
|
159
|
-
const stimeTicks = Number.parseInt(parts[12] ?? "", 10);
|
|
160
|
-
if (!Number.isFinite(utimeTicks) || !Number.isFinite(stimeTicks)) {
|
|
161
|
-
return {};
|
|
162
|
-
}
|
|
163
|
-
return {
|
|
164
|
-
cpu_user_seconds: utimeTicks / PROC_STAT_TICKS_PER_SECOND,
|
|
165
|
-
cpu_system_seconds: stimeTicks / PROC_STAT_TICKS_PER_SECOND
|
|
166
|
-
};
|
|
168
|
+
return parseLinuxCpuStat(raw);
|
|
167
169
|
} catch {
|
|
168
170
|
return {};
|
|
169
171
|
}
|
|
@@ -252,12 +254,12 @@ function parseProgressLine(stderrLine) {
|
|
|
252
254
|
if (!match) {
|
|
253
255
|
return null;
|
|
254
256
|
}
|
|
255
|
-
const index = Number.parseInt(match[1]
|
|
256
|
-
const total = Number.parseInt(match[2]
|
|
257
|
+
const index = Number.parseInt(match[1], 10);
|
|
258
|
+
const total = Number.parseInt(match[2], 10);
|
|
257
259
|
const elapsed = match[4] ? Number.parseInt(match[4], 10) : void 0;
|
|
258
260
|
return {
|
|
259
|
-
linked_test_index:
|
|
260
|
-
linked_test_total:
|
|
261
|
+
linked_test_index: index,
|
|
262
|
+
linked_test_total: total,
|
|
261
263
|
elapsed_ms: Number.isFinite(elapsed) ? elapsed : void 0,
|
|
262
264
|
heartbeat_at: nowIso(),
|
|
263
265
|
phase: match[3]?.toLowerCase() === "end" ? "finished" : "running"
|
|
@@ -330,10 +332,7 @@ async function startBackgroundTestRun(options) {
|
|
|
330
332
|
if (refreshed.fingerprint !== fingerprint) {
|
|
331
333
|
continue;
|
|
332
334
|
}
|
|
333
|
-
if (!BACKGROUND_RUN_ACTIVE_STATUSES.has(refreshed.status)) {
|
|
334
|
-
continue;
|
|
335
|
-
}
|
|
336
|
-
if (!isPidRunning(refreshed.worker_pid)) {
|
|
335
|
+
if (!BACKGROUND_RUN_ACTIVE_STATUSES.has(refreshed.status) || !isPidRunning(refreshed.worker_pid)) {
|
|
337
336
|
continue;
|
|
338
337
|
}
|
|
339
338
|
return {
|
|
@@ -418,7 +417,7 @@ async function spawnBackgroundTestRunWorker(options) {
|
|
|
418
417
|
const next = {
|
|
419
418
|
...record,
|
|
420
419
|
status: "queued",
|
|
421
|
-
worker_pid: child.pid
|
|
420
|
+
worker_pid: child.pid,
|
|
422
421
|
progress: {
|
|
423
422
|
phase: "queued",
|
|
424
423
|
message: "Worker process started.",
|
|
@@ -464,12 +463,14 @@ async function runBackgroundTestRunWorker(pmRoot, runId, noExtensions = false) {
|
|
|
464
463
|
stdio: ["ignore", "pipe", "pipe"],
|
|
465
464
|
windowsHide: true
|
|
466
465
|
});
|
|
467
|
-
record.child_pid = child.pid
|
|
466
|
+
record.child_pid = child.pid;
|
|
468
467
|
let writeQueue = Promise.resolve();
|
|
469
468
|
const scheduleRecordWrite = () => {
|
|
470
469
|
writeQueue = writeQueue.then(async () => {
|
|
471
|
-
|
|
472
|
-
|
|
470
|
+
try {
|
|
471
|
+
await writeBackgroundRunRecord(pmRoot, record);
|
|
472
|
+
} catch {
|
|
473
|
+
}
|
|
473
474
|
});
|
|
474
475
|
};
|
|
475
476
|
let stdoutWriteQueue = Promise.resolve();
|
|
@@ -489,9 +490,6 @@ async function runBackgroundTestRunWorker(pmRoot, runId, noExtensions = false) {
|
|
|
489
490
|
heartbeat_at: nowIso()
|
|
490
491
|
};
|
|
491
492
|
scheduleRecordWrite();
|
|
492
|
-
if (!child.pid || child.pid <= 0) {
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
493
|
try {
|
|
496
494
|
child.kill("SIGTERM");
|
|
497
495
|
} catch {
|
|
@@ -516,38 +514,37 @@ async function runBackgroundTestRunWorker(pmRoot, runId, noExtensions = false) {
|
|
|
516
514
|
const resourceTimer = setInterval(() => {
|
|
517
515
|
void (async () => {
|
|
518
516
|
record.resource = await buildResourceSnapshot(record);
|
|
519
|
-
|
|
520
|
-
record.progress.heartbeat_at = nowIso();
|
|
521
|
-
}
|
|
517
|
+
record.progress.heartbeat_at = nowIso();
|
|
522
518
|
scheduleRecordWrite();
|
|
523
519
|
})();
|
|
524
520
|
}, resourceInterval);
|
|
525
521
|
resourceTimer.unref?.();
|
|
526
522
|
child.stdout?.on("data", (chunk) => {
|
|
527
|
-
const text =
|
|
523
|
+
const text = chunk.toString("utf8");
|
|
528
524
|
stdoutBuffer += text;
|
|
529
525
|
stdoutWriteQueue = appendFileOrdered(stdoutWriteQueue, record.stdout_path, text);
|
|
530
526
|
});
|
|
531
527
|
child.stderr?.on("data", (chunk) => {
|
|
532
|
-
const text =
|
|
528
|
+
const text = chunk.toString("utf8");
|
|
533
529
|
stderrWriteQueue = appendFileOrdered(stderrWriteQueue, record.stderr_path, text);
|
|
534
530
|
const lines = splitLines(text);
|
|
535
531
|
const latestLine = lines.at(-1);
|
|
536
|
-
if (latestLine) {
|
|
537
|
-
|
|
538
|
-
record.progress = {
|
|
539
|
-
phase: record.progress?.phase ?? "running",
|
|
540
|
-
message: latestLine,
|
|
541
|
-
heartbeat_at: nowIso(),
|
|
542
|
-
linked_test_index: progressPatch?.linked_test_index ?? record.progress?.linked_test_index,
|
|
543
|
-
linked_test_total: progressPatch?.linked_test_total ?? record.progress?.linked_test_total,
|
|
544
|
-
elapsed_ms: progressPatch?.elapsed_ms ?? record.progress?.elapsed_ms
|
|
545
|
-
};
|
|
546
|
-
if (progressPatch?.phase === "finished" && !stopRequested) {
|
|
547
|
-
record.progress.phase = "running";
|
|
548
|
-
}
|
|
549
|
-
scheduleRecordWrite();
|
|
532
|
+
if (!latestLine) {
|
|
533
|
+
return;
|
|
550
534
|
}
|
|
535
|
+
const progressPatch = parseProgressLine(latestLine);
|
|
536
|
+
record.progress = {
|
|
537
|
+
phase: record.progress.phase === "stopping" ? "stopping" : "running",
|
|
538
|
+
message: latestLine,
|
|
539
|
+
heartbeat_at: nowIso(),
|
|
540
|
+
linked_test_index: progressPatch?.linked_test_index ?? record.progress?.linked_test_index ?? void 0,
|
|
541
|
+
linked_test_total: progressPatch?.linked_test_total ?? record.progress?.linked_test_total ?? void 0,
|
|
542
|
+
elapsed_ms: progressPatch?.elapsed_ms ?? record.progress?.elapsed_ms ?? void 0
|
|
543
|
+
};
|
|
544
|
+
if (progressPatch?.phase === "finished" && !stopRequested) {
|
|
545
|
+
record.progress.phase = "running";
|
|
546
|
+
}
|
|
547
|
+
scheduleRecordWrite();
|
|
551
548
|
});
|
|
552
549
|
let exitCode = null;
|
|
553
550
|
let signal = null;
|
|
@@ -924,6 +921,6 @@ export {
|
|
|
924
921
|
runTestRunsStop,
|
|
925
922
|
runTestRunsWorker
|
|
926
923
|
};
|
|
927
|
-
//# sourceMappingURL=test-runs-
|
|
924
|
+
//# sourceMappingURL=test-runs-LYT6ZTNQ.js.map
|
|
928
925
|
|
|
929
|
-
//# debugId=
|
|
926
|
+
//# debugId=8d33a904-e001-5f2c-9161-4554353f8ca6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/test-runs.ts","../../../../../../../../core/test/background-runs.ts"],"sourcesContent":["import os from \"node:os\";\nimport { pathExists } from \"../../core/fs/fs-utils.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 type BackgroundLogStream,\n type BackgroundTestRunKind,\n type BackgroundTestRunStatus,\n getBackgroundTestRunStatus,\n listBackgroundTestRuns,\n readBackgroundTestRunLogs,\n resumeBackgroundTestRun,\n runBackgroundTestRunWorker,\n spawnBackgroundTestRunWorker,\n startBackgroundTestRun,\n stopBackgroundTestRun,\n} from \"../../core/test/background-runs.js\";\nimport { getSettingsPath, resolveGlobalPmRoot, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseLimit } from \"../shared-parsers.js\";\n\nconst BACKGROUND_STATUS_VALUES: readonly BackgroundTestRunStatus[] = [\"queued\", \"running\", \"passed\", \"failed\", \"stopped\", \"canceled\"];\nconst BACKGROUND_STREAM_VALUES: readonly BackgroundLogStream[] = [\"stdout\", \"stderr\", \"both\"];\n\nfunction normalizeStatus(value: string | undefined): BackgroundTestRunStatus | undefined {\n if (value === undefined) {\n return undefined;\n }\n const normalized = value.trim().toLowerCase();\n if ((BACKGROUND_STATUS_VALUES as readonly string[]).includes(normalized)) {\n return normalized as BackgroundTestRunStatus;\n }\n throw new PmCliError(`Invalid --status value \"${value}\"`, EXIT_CODE.USAGE);\n}\n\nfunction normalizeStream(value: string | undefined): BackgroundLogStream {\n if (value === undefined || value.trim().length === 0) {\n return \"stderr\";\n }\n const normalized = value.trim().toLowerCase();\n if ((BACKGROUND_STREAM_VALUES as readonly string[]).includes(normalized)) {\n return normalized as BackgroundLogStream;\n }\n throw new PmCliError(`Invalid --stream value \"${value}\"`, EXIT_CODE.USAGE);\n}\n\nfunction resolveWhoamiFallback(): string | undefined {\n try {\n const username = os.userInfo().username.trim();\n if (username.length > 0) {\n return username;\n }\n } catch {\n // Fall back to environment-derived attribution.\n }\n return undefined;\n}\n\nfunction resolveRequestedBy(author: string | undefined, fallback: string): string {\n const candidates = [\n author,\n process.env.PM_AUTHOR,\n fallback,\n process.env.USER,\n process.env.LOGNAME,\n process.env.USERNAME,\n resolveWhoamiFallback(),\n ];\n for (const candidate of candidates) {\n if (typeof candidate !== \"string\") {\n continue;\n }\n const trimmed = candidate.trim();\n if (trimmed.length > 0) {\n return trimmed;\n }\n }\n return \"unknown\";\n}\n\nasync function ensureInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n}\n\nexport interface StartBackgroundRunCommandOptions {\n kind: BackgroundTestRunKind;\n commandArgs: string[];\n targetId?: string;\n statusFilter?: string;\n author?: string;\n noExtensions?: boolean;\n}\n\nexport interface StartBackgroundRunResult {\n started: boolean;\n duplicate_of?: string;\n run: unknown;\n}\n\nexport async function runStartBackgroundRun(\n options: StartBackgroundRunCommandOptions,\n global: GlobalOptions,\n): Promise<StartBackgroundRunResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const globalPmRoot = resolveGlobalPmRoot(process.cwd());\n await ensureInitialized(pmRoot);\n const settings = await readSettings(pmRoot);\n const requestedBy = resolveRequestedBy(options.author, settings.author_default);\n const started = await startBackgroundTestRun({\n pmRoot,\n globalPmRoot,\n kind: options.kind,\n commandArgs: options.commandArgs,\n requestedBy,\n targetId: options.targetId,\n statusFilter: options.statusFilter,\n });\n if (!started.started) {\n return {\n started: false,\n duplicate_of: started.duplicate_of,\n run: started.run,\n };\n }\n const spawned = await spawnBackgroundTestRunWorker({\n pmRoot,\n runId: started.run.id,\n noExtensions: options.noExtensions === true,\n });\n return {\n started: true,\n run: spawned,\n };\n}\n\nexport interface TestRunsListCommandOptions {\n status?: string;\n limit?: string;\n}\n\nexport async function runTestRunsList(options: TestRunsListCommandOptions, global: GlobalOptions): Promise<{\n runs: unknown[];\n count: number;\n filters: {\n status?: BackgroundTestRunStatus;\n limit?: number;\n };\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const status = normalizeStatus(options.status);\n const limit = parseLimit(options.limit, \"limit\");\n const runs = await listBackgroundTestRuns(pmRoot, { status, limit });\n return {\n runs,\n count: runs.length,\n filters: {\n status,\n limit,\n },\n };\n}\n\nexport async function runTestRunsStatus(runId: string, global: GlobalOptions): Promise<{\n run: unknown;\n health: unknown;\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const status = await getBackgroundTestRunStatus(pmRoot, runId);\n return {\n run: status.run,\n health: status.health,\n };\n}\n\nexport interface TestRunsLogsCommandOptions {\n stream?: string;\n tail?: string;\n}\n\nexport async function runTestRunsLogs(\n runId: string,\n options: TestRunsLogsCommandOptions,\n global: GlobalOptions,\n): Promise<{\n run: unknown;\n stream: BackgroundLogStream;\n tail: number;\n stdout: string[];\n stderr: string[];\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const stream = normalizeStream(options.stream);\n const tail = parseLimit(options.tail, \"tail\");\n const logs = await readBackgroundTestRunLogs(pmRoot, runId, stream, tail);\n return {\n run: logs.run,\n stream: logs.stream,\n tail: logs.tail,\n stdout: logs.stdout,\n stderr: logs.stderr,\n };\n}\n\nexport interface TestRunsStopCommandOptions {\n force?: boolean;\n}\n\nexport async function runTestRunsStop(\n runId: string,\n options: TestRunsStopCommandOptions,\n global: GlobalOptions,\n): Promise<{\n run: unknown;\n signal_sent: \"SIGTERM\" | \"SIGKILL\" | \"none\";\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const stopped = await stopBackgroundTestRun(pmRoot, runId, options.force === true);\n return {\n run: stopped.run,\n signal_sent: stopped.signal_sent,\n };\n}\n\nexport interface TestRunsResumeCommandOptions {\n author?: string;\n noExtensions?: boolean;\n}\n\nexport async function runTestRunsResume(\n runId: string,\n options: TestRunsResumeCommandOptions,\n global: GlobalOptions,\n): Promise<{\n resumed_from: string;\n run: unknown;\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const settings = await readSettings(pmRoot);\n const requestedBy = resolveRequestedBy(options.author, settings.author_default);\n const resumed = await resumeBackgroundTestRun(pmRoot, runId, requestedBy, options.noExtensions === true);\n return {\n resumed_from: runId,\n run: resumed,\n };\n}\n\nexport async function runTestRunsWorker(runId: string, global: GlobalOptions): Promise<{\n id: string;\n status: BackgroundTestRunStatus;\n exit_code?: number;\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const finished = await runBackgroundTestRunWorker(pmRoot, runId, global.noExtensions === true);\n return {\n id: finished.id,\n status: finished.status,\n exit_code: finished.exit_code,\n };\n}\n","import fs from \"node:fs/promises\";\nimport { spawn } from \"node:child_process\";\nimport { createHash, randomBytes } from \"node:crypto\";\nimport path from \"node:path\";\nimport { ensureDir, pathExists, readFileIfExists, writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { nowIso } from \"../shared/time.js\";\nimport {\n getTestRunRecordPath,\n getTestRunResultPath,\n getTestRunStderrPath,\n getTestRunStdoutPath,\n getTestRunsPath,\n getTestRunsRecordsPath,\n getTestRunsResultsPath,\n getTestRunsStderrPath,\n getTestRunsStdoutPath,\n} from \"../store/paths.js\";\n\nconst BACKGROUND_RUN_ACTIVE_STATUSES = new Set<BackgroundTestRunStatus>([\"queued\", \"running\"]);\nconst BACKGROUND_RUN_TERMINAL_STATUSES = new Set<BackgroundTestRunStatus>([\"passed\", \"failed\", \"stopped\", \"canceled\"]);\nconst DEFAULT_BACKGROUND_RUN_RESOURCE_SNAPSHOT_INTERVAL_MS = 3000;\nconst DEFAULT_BACKGROUND_RUN_FORCE_KILL_DELAY_MS = 3000;\nconst DEFAULT_BACKGROUND_RUN_HEARTBEAT_STALE_MS = 30000;\nconst DEFAULT_BACKGROUND_RUN_LOG_TAIL_LINES = 100;\nconst PROC_STAT_TICKS_PER_SECOND = 100;\n\nexport type BackgroundTestRunKind = \"test\" | \"test-all\";\n\nexport type BackgroundTestRunStatus = \"queued\" | \"running\" | \"passed\" | \"failed\" | \"stopped\" | \"canceled\";\n\nexport type BackgroundLogStream = \"stdout\" | \"stderr\" | \"both\";\n\nexport interface BackgroundRunProgress {\n phase: \"queued\" | \"running\" | \"stopping\" | \"finished\";\n message?: string;\n linked_test_index?: number;\n linked_test_total?: number;\n elapsed_ms?: number;\n heartbeat_at?: string;\n}\n\nexport interface BackgroundRunResourceSnapshot {\n recorded_at: string;\n rss_bytes?: number;\n cpu_user_seconds?: number;\n cpu_system_seconds?: number;\n uptime_seconds?: number;\n}\n\nexport interface BackgroundRunSummary {\n items?: number;\n linked_tests?: number;\n passed: number;\n failed: number;\n skipped: number;\n fail_on_skipped_triggered?: boolean;\n}\n\nexport interface BackgroundTestRunRecord {\n id: string;\n kind: BackgroundTestRunKind;\n status: BackgroundTestRunStatus;\n created_at: string;\n started_at?: string;\n finished_at?: string;\n updated_at: string;\n requested_by: string;\n fingerprint: string;\n command_args: string[];\n command_label: string;\n pm_root: string;\n global_pm_root: string;\n target_id?: string;\n status_filter?: string;\n attempt: number;\n resumed_from?: string;\n resumed_by?: string;\n worker_pid?: number;\n child_pid?: number;\n exit_code?: number;\n signal?: string;\n stdout_path: string;\n stderr_path: string;\n result_path: string;\n progress?: BackgroundRunProgress;\n resource?: BackgroundRunResourceSnapshot;\n summary?: BackgroundRunSummary;\n stop_requested_at?: string;\n duplicate_of?: string;\n error?: string;\n}\n\nexport interface StartBackgroundTestRunOptions {\n pmRoot: string;\n globalPmRoot: string;\n kind: BackgroundTestRunKind;\n commandArgs: string[];\n requestedBy: string;\n targetId?: string;\n statusFilter?: string;\n resumedFrom?: string;\n resumedBy?: string;\n attempt?: number;\n}\n\nexport interface StartBackgroundTestRunResult {\n started: boolean;\n run: BackgroundTestRunRecord;\n duplicate_of?: string;\n}\n\nexport interface SpawnBackgroundTestRunWorkerOptions {\n pmRoot: string;\n runId: string;\n noExtensions?: boolean;\n}\n\nexport interface StopBackgroundTestRunResult {\n run: BackgroundTestRunRecord;\n signal_sent: \"SIGTERM\" | \"SIGKILL\" | \"none\";\n}\n\nexport interface ListBackgroundTestRunOptions {\n status?: BackgroundTestRunStatus;\n limit?: number;\n}\n\nexport interface BackgroundRunHealth {\n state: \"healthy\" | \"stale\" | \"inactive\";\n last_heartbeat_at?: string;\n heartbeat_lag_ms?: number;\n worker_alive: boolean;\n child_alive: boolean;\n}\n\nexport interface BackgroundRunStatusView {\n run: BackgroundTestRunRecord;\n health: BackgroundRunHealth;\n}\n\nexport interface BackgroundRunLogsResult {\n run: BackgroundTestRunRecord;\n stream: BackgroundLogStream;\n tail: number;\n stdout: string[];\n stderr: string[];\n}\n\ninterface WorkerEvaluationResult {\n summary: BackgroundRunSummary;\n parsedResult: unknown | null;\n}\n\nfunction nowMs(): number {\n return Date.now();\n}\n\nfunction normalizeCommandArgs(args: string[]): string[] {\n return args.map((entry) => entry.trim()).filter((entry) => entry.length > 0);\n}\n\nfunction summarizeCommandLabel(args: string[]): string {\n const joined = args.join(\" \").replaceAll(/\\s+/g, \" \").trim();\n if (joined.length <= 180) {\n return joined;\n }\n return `${joined.slice(0, 177)}...`;\n}\n\nfunction buildRunId(): string {\n const timePart = Date.now().toString(36);\n const randomPart = randomBytes(3).toString(\"hex\");\n return `tr-${timePart}-${randomPart}`;\n}\n\nexport function buildBackgroundTestRunFingerprint(kind: BackgroundTestRunKind, commandArgs: string[], pmRoot: string): string {\n const payload = {\n kind,\n command: normalizeCommandArgs(commandArgs),\n pm_root: path.resolve(pmRoot),\n };\n return createHash(\"sha256\").update(JSON.stringify(payload)).digest(\"hex\");\n}\n\nfunction isPidRunning(pid: number | undefined): boolean {\n if (!Number.isInteger(pid) || !pid || pid <= 0) {\n return false;\n }\n try {\n process.kill(pid, 0);\n return true;\n } catch (error: unknown) {\n const code = typeof error === \"object\" && error !== null && \"code\" in error ? (error as { code?: string }).code : undefined;\n return code === \"EPERM\";\n }\n}\n\nasync function ensureBackgroundRunStorage(pmRoot: string): Promise<void> {\n await ensureDir(getTestRunsPath(pmRoot));\n await ensureDir(getTestRunsRecordsPath(pmRoot));\n await ensureDir(getTestRunsStdoutPath(pmRoot));\n await ensureDir(getTestRunsStderrPath(pmRoot));\n await ensureDir(getTestRunsResultsPath(pmRoot));\n}\n\nasync function parseBackgroundRunRecord(raw: string, recordPath: string): Promise<BackgroundTestRunRecord> {\n try {\n const parsed = JSON.parse(raw) as BackgroundTestRunRecord;\n if (!parsed || typeof parsed !== \"object\" || typeof parsed.id !== \"string\") {\n throw new Error(\"invalid run record payload\");\n }\n return parsed;\n } catch (error: unknown) {\n throw new PmCliError(\n `Failed to parse background test run record at ${recordPath}: ${error instanceof Error ? error.message : String(error)}`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n}\n\nasync function writeBackgroundRunRecord(pmRoot: string, record: BackgroundTestRunRecord): Promise<void> {\n const next: BackgroundTestRunRecord = {\n ...record,\n updated_at: nowIso(),\n };\n await writeFileAtomic(getTestRunRecordPath(pmRoot, record.id), `${JSON.stringify(next, null, 2)}\\n`);\n}\n\nexport async function readBackgroundTestRunRecord(pmRoot: string, runId: string): Promise<BackgroundTestRunRecord | null> {\n const recordPath = getTestRunRecordPath(pmRoot, runId);\n const raw = await readFileIfExists(recordPath);\n if (!raw) {\n return null;\n }\n return parseBackgroundRunRecord(raw, recordPath);\n}\n\nasync function listBackgroundRunRecordPaths(pmRoot: string): Promise<string[]> {\n const recordsRoot = getTestRunsRecordsPath(pmRoot);\n if (!(await pathExists(recordsRoot))) {\n return [];\n }\n const entries = await fs.readdir(recordsRoot, { withFileTypes: true });\n return entries\n .filter((entry) => entry.isFile() && entry.name.endsWith(\".json\"))\n .map((entry) => path.join(recordsRoot, entry.name))\n .sort((left, right) => right.localeCompare(left));\n}\n\nfunction parseLinuxRssStatus(raw: string): number | undefined {\n const match = raw.match(/^VmRSS:\\s+(\\d+)\\s+kB$/m);\n if (!match) {\n return undefined;\n }\n return Number.parseInt(match[1], 10) * 1024;\n}\n\nasync function readLinuxRssBytes(pid: number): Promise<number | undefined> {\n if (process.platform !== \"linux\") {\n return undefined;\n }\n try {\n const raw = await fs.readFile(`/proc/${pid}/status`, \"utf8\");\n return parseLinuxRssStatus(raw);\n } catch {\n return undefined;\n }\n}\n\nfunction parseLinuxCpuStat(raw: string): { cpu_user_seconds?: number; cpu_system_seconds?: number } {\n const closeParenIndex = raw.lastIndexOf(\")\");\n if (closeParenIndex < 0) {\n return {};\n }\n const remainder = raw.slice(closeParenIndex + 2).trim();\n const parts = remainder.split(/\\s+/);\n const utimeTicks = Number.parseInt(parts[11], 10);\n const stimeTicks = Number.parseInt(parts[12], 10);\n if (!Number.isFinite(utimeTicks) || !Number.isFinite(stimeTicks)) {\n return {};\n }\n return {\n cpu_user_seconds: utimeTicks / PROC_STAT_TICKS_PER_SECOND,\n cpu_system_seconds: stimeTicks / PROC_STAT_TICKS_PER_SECOND,\n };\n}\n\nasync function readLinuxCpuSeconds(\n pid: number,\n): Promise<{ cpu_user_seconds?: number; cpu_system_seconds?: number }> {\n if (process.platform !== \"linux\") {\n return {};\n }\n try {\n const raw = await fs.readFile(`/proc/${pid}/stat`, \"utf8\");\n return parseLinuxCpuStat(raw);\n } catch {\n return {};\n }\n}\n\nasync function buildResourceSnapshot(record: BackgroundTestRunRecord): Promise<BackgroundRunResourceSnapshot | undefined> {\n const pid = record.child_pid ?? record.worker_pid;\n if (!isPidRunning(pid)) {\n return undefined;\n }\n const rssBytes = await readLinuxRssBytes(pid as number);\n const cpu = await readLinuxCpuSeconds(pid as number);\n const startedAtMs = record.started_at ? Date.parse(record.started_at) : Number.NaN;\n const uptimeSeconds = Number.isFinite(startedAtMs) ? Math.max(0, (nowMs() - startedAtMs) / 1000) : undefined;\n return {\n recorded_at: nowIso(),\n rss_bytes: rssBytes,\n cpu_user_seconds: cpu.cpu_user_seconds,\n cpu_system_seconds: cpu.cpu_system_seconds,\n uptime_seconds: uptimeSeconds,\n };\n}\n\nfunction readCount(value: unknown): number {\n return typeof value === \"number\" && Number.isFinite(value) ? value : 0;\n}\n\nfunction evaluateWorkerResult(kind: BackgroundTestRunKind, payload: unknown): WorkerEvaluationResult {\n if (!payload || typeof payload !== \"object\") {\n return {\n summary: {\n passed: 0,\n failed: 1,\n skipped: 0,\n },\n parsedResult: null,\n };\n }\n const record = payload as Record<string, unknown>;\n if (kind === \"test-all\") {\n const totals = (record.totals ?? {}) as Record<string, unknown>;\n return {\n summary: {\n items: typeof totals.items === \"number\" ? totals.items : undefined,\n linked_tests: typeof totals.linked_tests === \"number\" ? totals.linked_tests : undefined,\n passed: readCount(totals.passed),\n failed: readCount(totals.failed),\n skipped: readCount(totals.skipped),\n fail_on_skipped_triggered: record.fail_on_skipped_triggered === true ? true : undefined,\n },\n parsedResult: payload,\n };\n }\n const runResults = Array.isArray(record.run_results) ? record.run_results : [];\n let passed = 0;\n let failed = 0;\n let skipped = 0;\n for (const entry of runResults) {\n if (!entry || typeof entry !== \"object\") {\n continue;\n }\n const status = (entry as { status?: unknown }).status;\n if (status === \"passed\") {\n passed += 1;\n continue;\n }\n if (status === \"failed\") {\n failed += 1;\n continue;\n }\n skipped += 1;\n }\n return {\n summary: {\n passed,\n failed,\n skipped,\n fail_on_skipped_triggered: record.fail_on_skipped_triggered === true ? true : undefined,\n },\n parsedResult: payload,\n };\n}\n\nfunction parseProgressLine(stderrLine: string): Partial<BackgroundRunProgress> | null {\n const line = stderrLine.trim();\n if (line.length === 0) {\n return null;\n }\n const match = line.match(/\\[pm test\\]\\s+linked-test\\s+(\\d+)\\/(\\d+)\\s+(start|running|end)(?:.*elapsed_ms=(\\d+))?/i);\n if (!match) {\n return null;\n }\n const index = Number.parseInt(match[1], 10);\n const total = Number.parseInt(match[2], 10);\n const elapsed = match[4] ? Number.parseInt(match[4], 10) : undefined;\n return {\n linked_test_index: index,\n linked_test_total: total,\n elapsed_ms: Number.isFinite(elapsed) ? elapsed : undefined,\n heartbeat_at: nowIso(),\n phase: match[3]?.toLowerCase() === \"end\" ? \"finished\" : \"running\",\n };\n}\n\nfunction splitLines(value: string): string[] {\n return value\n .split(/\\r?\\n/)\n .map((entry) => entry.trimEnd())\n .filter((entry) => entry.length > 0);\n}\n\nfunction tailLines(value: string, limit: number): string[] {\n if (limit <= 0) {\n return [];\n }\n const lines = splitLines(value);\n if (lines.length <= limit) {\n return lines;\n }\n return lines.slice(lines.length - limit);\n}\n\nasync function resolveBackgroundCliEntry(cwd: string): Promise<string> {\n const configured = process.env.PM_BACKGROUND_CLI_ENTRY?.trim();\n if (configured && configured.length > 0) {\n const resolvedConfigured = path.resolve(cwd, configured);\n if (await pathExists(resolvedConfigured)) {\n return resolvedConfigured;\n }\n }\n const distEntry = path.resolve(cwd, \"dist\", \"cli.js\");\n if (await pathExists(distEntry)) {\n return distEntry;\n }\n const argvEntry = process.argv[1]?.trim();\n if (argvEntry && argvEntry.length > 0) {\n const resolvedArgvEntry = path.resolve(cwd, argvEntry);\n if (await pathExists(resolvedArgvEntry)) {\n return resolvedArgvEntry;\n }\n }\n throw new PmCliError(\n \"Unable to resolve a CLI entrypoint for background test runs. Build the project or set PM_BACKGROUND_CLI_ENTRY.\",\n EXIT_CODE.GENERIC_FAILURE,\n );\n}\n\nasync function refreshRunIfStale(pmRoot: string, record: BackgroundTestRunRecord): Promise<BackgroundTestRunRecord> {\n if (!BACKGROUND_RUN_ACTIVE_STATUSES.has(record.status)) {\n return record;\n }\n const workerAlive = isPidRunning(record.worker_pid);\n if (workerAlive) {\n return record;\n }\n if (record.finished_at) {\n return record;\n }\n const next: BackgroundTestRunRecord = {\n ...record,\n status: \"failed\",\n finished_at: nowIso(),\n error: record.error ?? \"Background test run worker exited before writing terminal status.\",\n };\n await writeBackgroundRunRecord(pmRoot, next);\n return next;\n}\n\nexport async function startBackgroundTestRun(options: StartBackgroundTestRunOptions): Promise<StartBackgroundTestRunResult> {\n await ensureBackgroundRunStorage(options.pmRoot);\n const normalizedArgs = normalizeCommandArgs(options.commandArgs);\n if (normalizedArgs.length === 0) {\n throw new PmCliError(\"Background test run requires command arguments.\", EXIT_CODE.USAGE);\n }\n const fingerprint = buildBackgroundTestRunFingerprint(options.kind, normalizedArgs, options.pmRoot);\n const existingRuns = await listBackgroundTestRuns(options.pmRoot, {});\n for (const existing of existingRuns) {\n const refreshed = await refreshRunIfStale(options.pmRoot, existing);\n if (refreshed.fingerprint !== fingerprint) {\n continue;\n }\n if (!BACKGROUND_RUN_ACTIVE_STATUSES.has(refreshed.status) || !isPidRunning(refreshed.worker_pid)) {\n continue;\n }\n return {\n started: false,\n run: {\n ...refreshed,\n duplicate_of: refreshed.id,\n },\n duplicate_of: refreshed.id,\n };\n }\n\n const runId = buildRunId();\n const createdAt = nowIso();\n const stdoutPath = getTestRunStdoutPath(options.pmRoot, runId);\n const stderrPath = getTestRunStderrPath(options.pmRoot, runId);\n const resultPath = getTestRunResultPath(options.pmRoot, runId);\n await fs.writeFile(stdoutPath, \"\", \"utf8\");\n await fs.writeFile(stderrPath, \"\", \"utf8\");\n const record: BackgroundTestRunRecord = {\n id: runId,\n kind: options.kind,\n status: \"queued\",\n created_at: createdAt,\n updated_at: createdAt,\n requested_by: options.requestedBy,\n fingerprint,\n command_args: normalizedArgs,\n command_label: summarizeCommandLabel(normalizedArgs),\n pm_root: options.pmRoot,\n global_pm_root: options.globalPmRoot,\n target_id: options.targetId,\n status_filter: options.statusFilter,\n attempt: typeof options.attempt === \"number\" && Number.isFinite(options.attempt) && options.attempt >= 1\n ? Math.floor(options.attempt)\n : 1,\n resumed_from: options.resumedFrom,\n resumed_by: options.resumedBy,\n stdout_path: stdoutPath,\n stderr_path: stderrPath,\n result_path: resultPath,\n progress: {\n phase: \"queued\",\n message: \"Queued for background execution.\",\n heartbeat_at: createdAt,\n },\n };\n await writeBackgroundRunRecord(options.pmRoot, record);\n return {\n started: true,\n run: record,\n };\n}\n\nexport async function spawnBackgroundTestRunWorker(options: SpawnBackgroundTestRunWorkerOptions): Promise<BackgroundTestRunRecord> {\n const record = await readBackgroundTestRunRecord(options.pmRoot, options.runId);\n if (!record) {\n throw new PmCliError(`Background test run ${options.runId} not found`, EXIT_CODE.NOT_FOUND);\n }\n if (BACKGROUND_RUN_TERMINAL_STATUSES.has(record.status)) {\n throw new PmCliError(`Background test run ${record.id} is already terminal (${record.status}).`, EXIT_CODE.CONFLICT);\n }\n const cliEntry = await resolveBackgroundCliEntry(process.cwd());\n const args: string[] = [];\n if (options.noExtensions === true) {\n args.push(\"--no-extensions\");\n }\n args.push(\"--path\", record.pm_root, \"test-runs-worker\", record.id);\n const env: NodeJS.ProcessEnv = {\n ...process.env,\n PM_PATH: record.pm_root,\n PM_GLOBAL_PATH: record.global_pm_root,\n PM_BACKGROUND_TEST_RUN_ID: record.id,\n PM_BACKGROUND_TEST_RUN_ATTEMPT: String(record.attempt),\n PM_BACKGROUND_TEST_RUN_RESUMED_FROM: record.resumed_from ?? \"\",\n FORCE_COLOR: \"0\",\n };\n const child = spawn(process.execPath, [cliEntry, ...args], {\n cwd: process.cwd(),\n env,\n detached: true,\n stdio: \"ignore\",\n windowsHide: true,\n });\n child.unref();\n const next: BackgroundTestRunRecord = {\n ...record,\n status: \"queued\",\n worker_pid: child.pid as number | undefined,\n progress: {\n phase: \"queued\",\n message: \"Worker process started.\",\n heartbeat_at: nowIso(),\n },\n };\n await writeBackgroundRunRecord(options.pmRoot, next);\n return next;\n}\n\nasync function appendFileOrdered(queue: Promise<void>, filePath: string, text: string): Promise<void> {\n await queue;\n await fs.appendFile(filePath, text, \"utf8\");\n}\n\nexport async function runBackgroundTestRunWorker(pmRoot: string, runId: string, noExtensions = false): Promise<BackgroundTestRunRecord> {\n const loaded = await readBackgroundTestRunRecord(pmRoot, runId);\n if (!loaded) {\n throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);\n }\n const record: BackgroundTestRunRecord = {\n ...loaded,\n status: \"running\",\n started_at: loaded.started_at ?? nowIso(),\n worker_pid: process.pid,\n progress: {\n phase: \"running\",\n message: \"Worker started.\",\n heartbeat_at: nowIso(),\n },\n };\n const cliEntry = await resolveBackgroundCliEntry(process.cwd());\n const env: NodeJS.ProcessEnv = {\n ...process.env,\n PM_PATH: record.pm_root,\n PM_GLOBAL_PATH: record.global_pm_root,\n FORCE_COLOR: \"0\",\n };\n await writeBackgroundRunRecord(pmRoot, record);\n\n const childArgs = noExtensions ? [\"--no-extensions\", ...record.command_args] : [...record.command_args];\n const child = spawn(process.execPath, [cliEntry, ...childArgs], {\n cwd: process.cwd(),\n env,\n detached: false,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n windowsHide: true,\n });\n record.child_pid = child.pid as number | undefined;\n\n let writeQueue: Promise<void> = Promise.resolve();\n const scheduleRecordWrite = (): void => {\n writeQueue = writeQueue.then(async () => {\n try {\n await writeBackgroundRunRecord(pmRoot, record);\n } catch {\n // Keep worker alive even if a single metadata write fails.\n }\n });\n };\n\n let stdoutWriteQueue: Promise<void> = Promise.resolve();\n let stderrWriteQueue: Promise<void> = Promise.resolve();\n let stdoutBuffer = \"\";\n let stopRequested = false;\n\n const requestStop = async (): Promise<void> => {\n if (stopRequested) {\n return;\n }\n stopRequested = true;\n record.stop_requested_at = nowIso();\n record.progress = {\n ...record.progress,\n phase: \"stopping\",\n message: \"Stop requested for background run.\",\n heartbeat_at: nowIso(),\n };\n scheduleRecordWrite();\n try {\n child.kill(\"SIGTERM\");\n } catch {\n // Child may already be gone.\n }\n const forceKillDelayMs = Number.parseInt(process.env.PM_BACKGROUND_RUN_FORCE_KILL_DELAY_MS ?? \"\", 10);\n const delay = Number.isFinite(forceKillDelayMs) && forceKillDelayMs > 0\n ? forceKillDelayMs\n : DEFAULT_BACKGROUND_RUN_FORCE_KILL_DELAY_MS;\n const forceTimer = setTimeout(() => {\n try {\n child.kill(\"SIGKILL\");\n } catch {\n // Child may already be gone.\n }\n }, delay);\n forceTimer.unref?.();\n };\n\n const onSignal = (): void => {\n void requestStop();\n };\n process.on(\"SIGTERM\", onSignal);\n process.on(\"SIGINT\", onSignal);\n\n const resourceIntervalMs = Number.parseInt(process.env.PM_BACKGROUND_RUN_RESOURCE_INTERVAL_MS ?? \"\", 10);\n const resourceInterval = Number.isFinite(resourceIntervalMs) && resourceIntervalMs > 0\n ? resourceIntervalMs\n : DEFAULT_BACKGROUND_RUN_RESOURCE_SNAPSHOT_INTERVAL_MS;\n const resourceTimer = setInterval(() => {\n void (async () => {\n record.resource = await buildResourceSnapshot(record);\n (record.progress as BackgroundRunProgress).heartbeat_at = nowIso();\n scheduleRecordWrite();\n })();\n }, resourceInterval);\n resourceTimer.unref?.();\n\n child.stdout?.on(\"data\", (chunk) => {\n const text = chunk.toString(\"utf8\");\n stdoutBuffer += text;\n stdoutWriteQueue = appendFileOrdered(stdoutWriteQueue, record.stdout_path, text);\n });\n child.stderr?.on(\"data\", (chunk) => {\n const text = chunk.toString(\"utf8\");\n stderrWriteQueue = appendFileOrdered(stderrWriteQueue, record.stderr_path, text);\n const lines = splitLines(text);\n const latestLine = lines.at(-1);\n if (!latestLine) {\n return;\n }\n const progressPatch = parseProgressLine(latestLine);\n record.progress = {\n phase: (record.progress as BackgroundRunProgress).phase === \"stopping\" ? \"stopping\" : \"running\",\n message: latestLine,\n heartbeat_at: nowIso(),\n linked_test_index: progressPatch?.linked_test_index ?? record.progress?.linked_test_index ?? undefined,\n linked_test_total: progressPatch?.linked_test_total ?? record.progress?.linked_test_total ?? undefined,\n elapsed_ms: progressPatch?.elapsed_ms ?? record.progress?.elapsed_ms ?? undefined,\n };\n if (progressPatch?.phase === \"finished\" && !stopRequested) {\n record.progress.phase = \"running\";\n }\n scheduleRecordWrite();\n });\n\n let exitCode: number | null = null;\n let signal: NodeJS.Signals | null = null;\n try {\n ({ code: exitCode, signal } = await new Promise<{ code: number | null; signal: NodeJS.Signals | null }>((resolve) => {\n child.on(\"close\", (code, closeSignal) => {\n resolve({ code, signal: closeSignal });\n });\n }));\n } finally {\n clearInterval(resourceTimer);\n process.off(\"SIGTERM\", onSignal);\n process.off(\"SIGINT\", onSignal);\n }\n\n await stdoutWriteQueue;\n await stderrWriteQueue;\n\n let parsedResult: unknown | null = null;\n if (stdoutBuffer.trim().length > 0) {\n try {\n parsedResult = JSON.parse(stdoutBuffer);\n } catch {\n parsedResult = null;\n }\n }\n const evaluated = evaluateWorkerResult(record.kind, parsedResult);\n record.summary = evaluated.summary;\n record.exit_code = typeof exitCode === \"number\" ? exitCode : undefined;\n record.signal = signal ?? undefined;\n record.finished_at = nowIso();\n record.status = stopRequested\n ? \"stopped\"\n : (record.exit_code === 0 &&\n (record.summary.failed ?? 0) === 0 &&\n record.summary.fail_on_skipped_triggered !== true)\n ? \"passed\"\n : \"failed\";\n record.progress = {\n phase: \"finished\",\n message: stopRequested ? \"Background run stopped.\" : `Background run finished with status=${record.status}.`,\n heartbeat_at: nowIso(),\n linked_test_index: record.progress?.linked_test_index,\n linked_test_total: record.progress?.linked_test_total,\n elapsed_ms: record.progress?.elapsed_ms,\n };\n record.resource = await buildResourceSnapshot(record);\n if (parsedResult !== null) {\n await writeFileAtomic(record.result_path, `${JSON.stringify(parsedResult, null, 2)}\\n`);\n } else {\n await writeFileAtomic(\n record.result_path,\n `${JSON.stringify(\n {\n parse_error: \"Background run output was not valid JSON.\",\n stdout_excerpt: tailLines(stdoutBuffer, DEFAULT_BACKGROUND_RUN_LOG_TAIL_LINES),\n },\n null,\n 2,\n )}\\n`,\n );\n }\n await writeBackgroundRunRecord(pmRoot, record);\n await writeQueue;\n return record;\n}\n\nexport async function listBackgroundTestRuns(\n pmRoot: string,\n options: ListBackgroundTestRunOptions,\n): Promise<BackgroundTestRunRecord[]> {\n const recordPaths = await listBackgroundRunRecordPaths(pmRoot);\n const runs: BackgroundTestRunRecord[] = [];\n for (const recordPath of recordPaths) {\n const raw = await readFileIfExists(recordPath);\n if (!raw) {\n continue;\n }\n const parsed = await parseBackgroundRunRecord(raw, recordPath);\n runs.push(parsed);\n }\n const refreshed: BackgroundTestRunRecord[] = [];\n for (const run of runs) {\n refreshed.push(await refreshRunIfStale(pmRoot, run));\n }\n const filtered = options.status ? refreshed.filter((entry) => entry.status === options.status) : refreshed;\n const sorted = filtered.sort((left, right) => {\n const byUpdated = Date.parse(right.updated_at) - Date.parse(left.updated_at);\n if (Number.isFinite(byUpdated) && byUpdated !== 0) {\n return byUpdated;\n }\n return right.id.localeCompare(left.id);\n });\n const limit = typeof options.limit === \"number\" && options.limit >= 0 ? options.limit : undefined;\n return limit === undefined ? sorted : sorted.slice(0, limit);\n}\n\nexport async function getBackgroundTestRunStatus(pmRoot: string, runId: string): Promise<BackgroundRunStatusView> {\n const loaded = await readBackgroundTestRunRecord(pmRoot, runId);\n if (!loaded) {\n throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);\n }\n const refreshed = await refreshRunIfStale(pmRoot, loaded);\n const workerAlive = isPidRunning(refreshed.worker_pid);\n const childAlive = isPidRunning(refreshed.child_pid);\n if (refreshed.status === \"running\" && !childAlive && !refreshed.finished_at && !workerAlive) {\n refreshed.status = \"failed\";\n refreshed.finished_at = nowIso();\n refreshed.error = refreshed.error ?? \"Background run process exited unexpectedly.\";\n await writeBackgroundRunRecord(pmRoot, refreshed);\n }\n if (refreshed.status === \"running\") {\n refreshed.resource = await buildResourceSnapshot(refreshed);\n await writeBackgroundRunRecord(pmRoot, refreshed);\n }\n const heartbeatAt = refreshed.progress?.heartbeat_at;\n const heartbeatAtMs = heartbeatAt ? Date.parse(heartbeatAt) : Number.NaN;\n const lagMs = Number.isFinite(heartbeatAtMs) ? Math.max(0, nowMs() - heartbeatAtMs) : undefined;\n const staleMs = Number.parseInt(process.env.PM_BACKGROUND_RUN_HEARTBEAT_STALE_MS ?? \"\", 10);\n const staleThresholdMs = Number.isFinite(staleMs) && staleMs > 0 ? staleMs : DEFAULT_BACKGROUND_RUN_HEARTBEAT_STALE_MS;\n const healthState = refreshed.status === \"running\"\n ? lagMs !== undefined && lagMs > staleThresholdMs\n ? \"stale\"\n : \"healthy\"\n : \"inactive\";\n return {\n run: refreshed,\n health: {\n state: healthState,\n last_heartbeat_at: heartbeatAt,\n heartbeat_lag_ms: lagMs,\n worker_alive: workerAlive,\n child_alive: childAlive,\n },\n };\n}\n\nexport async function stopBackgroundTestRun(pmRoot: string, runId: string, force = false): Promise<StopBackgroundTestRunResult> {\n const loaded = await readBackgroundTestRunRecord(pmRoot, runId);\n if (!loaded) {\n throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);\n }\n const refreshed = await refreshRunIfStale(pmRoot, loaded);\n if (BACKGROUND_RUN_TERMINAL_STATUSES.has(refreshed.status)) {\n return {\n run: refreshed,\n signal_sent: \"none\",\n };\n }\n let signalSent: \"SIGTERM\" | \"SIGKILL\" | \"none\" = \"none\";\n const signal: NodeJS.Signals = force ? \"SIGKILL\" : \"SIGTERM\";\n if (isPidRunning(refreshed.worker_pid) && refreshed.worker_pid) {\n try {\n process.kill(refreshed.worker_pid, signal);\n signalSent = signal;\n } catch {\n signalSent = \"none\";\n }\n }\n if (signalSent === \"none\") {\n refreshed.status = \"stopped\";\n refreshed.finished_at = refreshed.finished_at ?? nowIso();\n }\n refreshed.stop_requested_at = nowIso();\n refreshed.progress = {\n phase: \"stopping\",\n message: signalSent === \"none\" ? \"Run marked stopped.\" : `Stop requested via ${signalSent}.`,\n heartbeat_at: nowIso(),\n linked_test_index: refreshed.progress?.linked_test_index,\n linked_test_total: refreshed.progress?.linked_test_total,\n elapsed_ms: refreshed.progress?.elapsed_ms,\n };\n await writeBackgroundRunRecord(pmRoot, refreshed);\n return {\n run: refreshed,\n signal_sent: signalSent,\n };\n}\n\nexport async function resumeBackgroundTestRun(\n pmRoot: string,\n runId: string,\n requestedBy: string,\n noExtensions = false,\n): Promise<BackgroundTestRunRecord> {\n const loaded = await readBackgroundTestRunRecord(pmRoot, runId);\n if (!loaded) {\n throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);\n }\n const refreshed = await refreshRunIfStale(pmRoot, loaded);\n if (!BACKGROUND_RUN_TERMINAL_STATUSES.has(refreshed.status)) {\n throw new PmCliError(`Background test run ${runId} is not terminal and cannot be resumed.`, EXIT_CODE.CONFLICT);\n }\n const started = await startBackgroundTestRun({\n pmRoot: refreshed.pm_root,\n globalPmRoot: refreshed.global_pm_root,\n kind: refreshed.kind,\n commandArgs: refreshed.command_args,\n requestedBy,\n targetId: refreshed.target_id,\n statusFilter: refreshed.status_filter,\n resumedFrom: refreshed.id,\n resumedBy: requestedBy,\n attempt: refreshed.attempt + 1,\n });\n if (!started.started) {\n return started.run;\n }\n const spawned = await spawnBackgroundTestRunWorker({\n pmRoot,\n runId: started.run.id,\n noExtensions,\n });\n const prior: BackgroundTestRunRecord = {\n ...refreshed,\n resumed_by: spawned.id,\n };\n await writeBackgroundRunRecord(pmRoot, prior);\n return spawned;\n}\n\nexport async function readBackgroundTestRunLogs(\n pmRoot: string,\n runId: string,\n stream: BackgroundLogStream,\n tail: number | undefined,\n): Promise<BackgroundRunLogsResult> {\n const loaded = await readBackgroundTestRunRecord(pmRoot, runId);\n if (!loaded) {\n throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);\n }\n const resolvedTail = typeof tail === \"number\" && Number.isFinite(tail) && tail >= 0 ? Math.floor(tail) : DEFAULT_BACKGROUND_RUN_LOG_TAIL_LINES;\n const stdoutRaw = stream === \"stdout\" || stream === \"both\" ? (await readFileIfExists(loaded.stdout_path)) ?? \"\" : \"\";\n const stderrRaw = stream === \"stderr\" || stream === \"both\" ? (await readFileIfExists(loaded.stderr_path)) ?? \"\" : \"\";\n return {\n run: loaded,\n stream,\n tail: resolvedTail,\n stdout: stream === \"stdout\" || stream === \"both\" ? tailLines(stdoutRaw, resolvedTail) : [],\n stderr: stream === \"stderr\" || stream === \"both\" ? tailLines(stderrRaw, resolvedTail) : [],\n };\n}\n\nexport const _testOnly = {\n buildResourceSnapshot,\n evaluateWorkerResult,\n isPidRunning,\n parseLinuxCpuStat,\n parseLinuxRssStatus,\n parseProgressLine,\n readLinuxCpuSeconds,\n readLinuxRssBytes,\n refreshRunIfStale,\n splitLines,\n tailLines,\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;;;ACAf,OAAO,QAAQ;AACf,SAAS,aAAa;AACtB,SAAS,YAAY,mBAAmB;AACxC,OAAO,UAAU;AAiBjB,IAAM,iCAAiC,oBAAI,IAA6B,CAAC,UAAU,SAAS,CAAC;AAC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AiB,IAAI;AACvG,SAAO;IACL,cAAc;IACd,KAAK;;AAET;AAEA,eAAsB,kBAAkB,OAAe,QAAqB;AAK1E,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAI,OAAO,IAAI;AACvD,QAAM,kBAAkB,MAAM;AAC9B,QAAM,WAAW,MAAM,2BAA2B,QAAQ,OAAO,OAAO,iBAAiB,IAAI;AAC7F,SAAO;IACL,IAAI,SAAS;IACb,QAAQ,SAAS;IACjB,WAAW,SAAS;;AAExB","debugId":"8d33a904-e001-5f2c-9161-4554353f8ca6"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseLimit
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-7AGIXLNK.js";
|
|
4
|
+
import "./chunk-6BV7ENQL.js";
|
|
5
5
|
import {
|
|
6
6
|
nowIso
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OY3P2I6B.js";
|
|
8
8
|
import {
|
|
9
9
|
EXIT_CODE,
|
|
10
10
|
PmCliError,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
resolveGlobalPmRoot,
|
|
26
26
|
resolvePmRoot,
|
|
27
27
|
writeFileAtomic
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-LV5FFQ7M.js";
|
|
29
29
|
|
|
30
30
|
// dist/cli/commands/test-runs.js
|
|
31
31
|
import os from "node:os";
|
|
@@ -38,7 +38,7 @@ import path from "node:path";
|
|
|
38
38
|
!(function() {
|
|
39
39
|
try {
|
|
40
40
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
41
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
41
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "6d6c09d7-3b95-5342-b83c-d5e2c6e201ae");
|
|
42
42
|
} catch (e2) {
|
|
43
43
|
}
|
|
44
44
|
})();
|
|
@@ -129,46 +129,48 @@ async function listBackgroundRunRecordPaths(pmRoot) {
|
|
|
129
129
|
const entries = await fs.readdir(recordsRoot, { withFileTypes: true });
|
|
130
130
|
return entries.filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => path.join(recordsRoot, entry.name)).sort((left, right) => right.localeCompare(left));
|
|
131
131
|
}
|
|
132
|
+
function parseLinuxRssStatus(raw) {
|
|
133
|
+
const match = raw.match(/^VmRSS:\s+(\d+)\s+kB$/m);
|
|
134
|
+
if (!match) {
|
|
135
|
+
return void 0;
|
|
136
|
+
}
|
|
137
|
+
return Number.parseInt(match[1], 10) * 1024;
|
|
138
|
+
}
|
|
132
139
|
async function readLinuxRssBytes(pid) {
|
|
133
140
|
if (process.platform !== "linux") {
|
|
134
141
|
return void 0;
|
|
135
142
|
}
|
|
136
143
|
try {
|
|
137
144
|
const raw = await fs.readFile(`/proc/${pid}/status`, "utf8");
|
|
138
|
-
|
|
139
|
-
if (!match) {
|
|
140
|
-
return void 0;
|
|
141
|
-
}
|
|
142
|
-
const value = Number.parseInt(match[1] ?? "", 10);
|
|
143
|
-
if (!Number.isFinite(value)) {
|
|
144
|
-
return void 0;
|
|
145
|
-
}
|
|
146
|
-
return value * 1024;
|
|
145
|
+
return parseLinuxRssStatus(raw);
|
|
147
146
|
} catch {
|
|
148
147
|
return void 0;
|
|
149
148
|
}
|
|
150
149
|
}
|
|
150
|
+
function parseLinuxCpuStat(raw) {
|
|
151
|
+
const closeParenIndex = raw.lastIndexOf(")");
|
|
152
|
+
if (closeParenIndex < 0) {
|
|
153
|
+
return {};
|
|
154
|
+
}
|
|
155
|
+
const remainder = raw.slice(closeParenIndex + 2).trim();
|
|
156
|
+
const parts = remainder.split(/\s+/);
|
|
157
|
+
const utimeTicks = Number.parseInt(parts[11], 10);
|
|
158
|
+
const stimeTicks = Number.parseInt(parts[12], 10);
|
|
159
|
+
if (!Number.isFinite(utimeTicks) || !Number.isFinite(stimeTicks)) {
|
|
160
|
+
return {};
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
cpu_user_seconds: utimeTicks / PROC_STAT_TICKS_PER_SECOND,
|
|
164
|
+
cpu_system_seconds: stimeTicks / PROC_STAT_TICKS_PER_SECOND
|
|
165
|
+
};
|
|
166
|
+
}
|
|
151
167
|
async function readLinuxCpuSeconds(pid) {
|
|
152
168
|
if (process.platform !== "linux") {
|
|
153
169
|
return {};
|
|
154
170
|
}
|
|
155
171
|
try {
|
|
156
172
|
const raw = await fs.readFile(`/proc/${pid}/stat`, "utf8");
|
|
157
|
-
|
|
158
|
-
if (closeParenIndex < 0) {
|
|
159
|
-
return {};
|
|
160
|
-
}
|
|
161
|
-
const remainder = raw.slice(closeParenIndex + 2).trim();
|
|
162
|
-
const parts = remainder.split(/\s+/);
|
|
163
|
-
const utimeTicks = Number.parseInt(parts[11] ?? "", 10);
|
|
164
|
-
const stimeTicks = Number.parseInt(parts[12] ?? "", 10);
|
|
165
|
-
if (!Number.isFinite(utimeTicks) || !Number.isFinite(stimeTicks)) {
|
|
166
|
-
return {};
|
|
167
|
-
}
|
|
168
|
-
return {
|
|
169
|
-
cpu_user_seconds: utimeTicks / PROC_STAT_TICKS_PER_SECOND,
|
|
170
|
-
cpu_system_seconds: stimeTicks / PROC_STAT_TICKS_PER_SECOND
|
|
171
|
-
};
|
|
173
|
+
return parseLinuxCpuStat(raw);
|
|
172
174
|
} catch {
|
|
173
175
|
return {};
|
|
174
176
|
}
|
|
@@ -257,12 +259,12 @@ function parseProgressLine(stderrLine) {
|
|
|
257
259
|
if (!match) {
|
|
258
260
|
return null;
|
|
259
261
|
}
|
|
260
|
-
const index = Number.parseInt(match[1]
|
|
261
|
-
const total = Number.parseInt(match[2]
|
|
262
|
+
const index = Number.parseInt(match[1], 10);
|
|
263
|
+
const total = Number.parseInt(match[2], 10);
|
|
262
264
|
const elapsed = match[4] ? Number.parseInt(match[4], 10) : void 0;
|
|
263
265
|
return {
|
|
264
|
-
linked_test_index:
|
|
265
|
-
linked_test_total:
|
|
266
|
+
linked_test_index: index,
|
|
267
|
+
linked_test_total: total,
|
|
266
268
|
elapsed_ms: Number.isFinite(elapsed) ? elapsed : void 0,
|
|
267
269
|
heartbeat_at: nowIso(),
|
|
268
270
|
phase: match[3]?.toLowerCase() === "end" ? "finished" : "running"
|
|
@@ -335,10 +337,7 @@ async function startBackgroundTestRun(options) {
|
|
|
335
337
|
if (refreshed.fingerprint !== fingerprint) {
|
|
336
338
|
continue;
|
|
337
339
|
}
|
|
338
|
-
if (!BACKGROUND_RUN_ACTIVE_STATUSES.has(refreshed.status)) {
|
|
339
|
-
continue;
|
|
340
|
-
}
|
|
341
|
-
if (!isPidRunning(refreshed.worker_pid)) {
|
|
340
|
+
if (!BACKGROUND_RUN_ACTIVE_STATUSES.has(refreshed.status) || !isPidRunning(refreshed.worker_pid)) {
|
|
342
341
|
continue;
|
|
343
342
|
}
|
|
344
343
|
return {
|
|
@@ -423,7 +422,7 @@ async function spawnBackgroundTestRunWorker(options) {
|
|
|
423
422
|
const next = {
|
|
424
423
|
...record,
|
|
425
424
|
status: "queued",
|
|
426
|
-
worker_pid: child.pid
|
|
425
|
+
worker_pid: child.pid,
|
|
427
426
|
progress: {
|
|
428
427
|
phase: "queued",
|
|
429
428
|
message: "Worker process started.",
|
|
@@ -469,12 +468,14 @@ async function runBackgroundTestRunWorker(pmRoot, runId, noExtensions = false) {
|
|
|
469
468
|
stdio: ["ignore", "pipe", "pipe"],
|
|
470
469
|
windowsHide: true
|
|
471
470
|
});
|
|
472
|
-
record.child_pid = child.pid
|
|
471
|
+
record.child_pid = child.pid;
|
|
473
472
|
let writeQueue = Promise.resolve();
|
|
474
473
|
const scheduleRecordWrite = () => {
|
|
475
474
|
writeQueue = writeQueue.then(async () => {
|
|
476
|
-
|
|
477
|
-
|
|
475
|
+
try {
|
|
476
|
+
await writeBackgroundRunRecord(pmRoot, record);
|
|
477
|
+
} catch {
|
|
478
|
+
}
|
|
478
479
|
});
|
|
479
480
|
};
|
|
480
481
|
let stdoutWriteQueue = Promise.resolve();
|
|
@@ -494,9 +495,6 @@ async function runBackgroundTestRunWorker(pmRoot, runId, noExtensions = false) {
|
|
|
494
495
|
heartbeat_at: nowIso()
|
|
495
496
|
};
|
|
496
497
|
scheduleRecordWrite();
|
|
497
|
-
if (!child.pid || child.pid <= 0) {
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
500
498
|
try {
|
|
501
499
|
child.kill("SIGTERM");
|
|
502
500
|
} catch {
|
|
@@ -521,38 +519,37 @@ async function runBackgroundTestRunWorker(pmRoot, runId, noExtensions = false) {
|
|
|
521
519
|
const resourceTimer = setInterval(() => {
|
|
522
520
|
void (async () => {
|
|
523
521
|
record.resource = await buildResourceSnapshot(record);
|
|
524
|
-
|
|
525
|
-
record.progress.heartbeat_at = nowIso();
|
|
526
|
-
}
|
|
522
|
+
record.progress.heartbeat_at = nowIso();
|
|
527
523
|
scheduleRecordWrite();
|
|
528
524
|
})();
|
|
529
525
|
}, resourceInterval);
|
|
530
526
|
resourceTimer.unref?.();
|
|
531
527
|
child.stdout?.on("data", (chunk) => {
|
|
532
|
-
const text =
|
|
528
|
+
const text = chunk.toString("utf8");
|
|
533
529
|
stdoutBuffer += text;
|
|
534
530
|
stdoutWriteQueue = appendFileOrdered(stdoutWriteQueue, record.stdout_path, text);
|
|
535
531
|
});
|
|
536
532
|
child.stderr?.on("data", (chunk) => {
|
|
537
|
-
const text =
|
|
533
|
+
const text = chunk.toString("utf8");
|
|
538
534
|
stderrWriteQueue = appendFileOrdered(stderrWriteQueue, record.stderr_path, text);
|
|
539
535
|
const lines = splitLines(text);
|
|
540
536
|
const latestLine = lines.at(-1);
|
|
541
|
-
if (latestLine) {
|
|
542
|
-
|
|
543
|
-
record.progress = {
|
|
544
|
-
phase: record.progress?.phase ?? "running",
|
|
545
|
-
message: latestLine,
|
|
546
|
-
heartbeat_at: nowIso(),
|
|
547
|
-
linked_test_index: progressPatch?.linked_test_index ?? record.progress?.linked_test_index,
|
|
548
|
-
linked_test_total: progressPatch?.linked_test_total ?? record.progress?.linked_test_total,
|
|
549
|
-
elapsed_ms: progressPatch?.elapsed_ms ?? record.progress?.elapsed_ms
|
|
550
|
-
};
|
|
551
|
-
if (progressPatch?.phase === "finished" && !stopRequested) {
|
|
552
|
-
record.progress.phase = "running";
|
|
553
|
-
}
|
|
554
|
-
scheduleRecordWrite();
|
|
537
|
+
if (!latestLine) {
|
|
538
|
+
return;
|
|
555
539
|
}
|
|
540
|
+
const progressPatch = parseProgressLine(latestLine);
|
|
541
|
+
record.progress = {
|
|
542
|
+
phase: record.progress.phase === "stopping" ? "stopping" : "running",
|
|
543
|
+
message: latestLine,
|
|
544
|
+
heartbeat_at: nowIso(),
|
|
545
|
+
linked_test_index: progressPatch?.linked_test_index ?? record.progress?.linked_test_index ?? void 0,
|
|
546
|
+
linked_test_total: progressPatch?.linked_test_total ?? record.progress?.linked_test_total ?? void 0,
|
|
547
|
+
elapsed_ms: progressPatch?.elapsed_ms ?? record.progress?.elapsed_ms ?? void 0
|
|
548
|
+
};
|
|
549
|
+
if (progressPatch?.phase === "finished" && !stopRequested) {
|
|
550
|
+
record.progress.phase = "running";
|
|
551
|
+
}
|
|
552
|
+
scheduleRecordWrite();
|
|
556
553
|
});
|
|
557
554
|
let exitCode = null;
|
|
558
555
|
let signal = null;
|
|
@@ -936,4 +933,4 @@ export {
|
|
|
936
933
|
runTestRunsStop,
|
|
937
934
|
runTestRunsWorker
|
|
938
935
|
};
|
|
939
|
-
//# sourceMappingURL=test-runs-
|
|
936
|
+
//# sourceMappingURL=test-runs-RVP6VWN7.js.map
|