@herbertgao/pi-extensions 2026.11.11 → 2026.11.12
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 +20 -0
- package/README.md +10 -10
- package/THIRD_PARTY_NOTICES.md +3 -3
- package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +10 -0
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +3 -4
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +3 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/core.ts +22 -15
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/index.ts +22 -8
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +0 -29
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/prompt-editor.ts +5 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +60 -39
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +3 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/codemode.ts +0 -40
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-parse.ts +4 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +21 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/format.ts +15 -0
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
- package/node_modules/@herbertgao/pi-impeccable/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-impeccable/README.md +2 -2
- package/node_modules/@herbertgao/pi-impeccable/package.json +4 -4
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/SKILL.md +2 -2
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/adapt.md +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/animate.md +17 -0
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/critique-rubric.md +496 -0
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/critique.md +12 -504
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/motion-reviewer.md +29 -0
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/hooks.md +3 -3
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/new-work-comp.md +24 -0
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/new-work-world.md +20 -0
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/new-work.md +5 -34
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/typeset.md +6 -0
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/VERSION +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/engine-checksums.txt +5 -5
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/live-browser.js +17 -18
- package/node_modules/pi-antigravity/README.md +58 -9
- package/node_modules/pi-antigravity/docs/reader-guarantees.md +35 -0
- package/node_modules/pi-antigravity/package.json +15 -6
- package/node_modules/pi-antigravity/src/client/client.ts +63 -14
- package/node_modules/pi-antigravity/src/client/enterprise.ts +150 -0
- package/node_modules/pi-antigravity/src/client/index.ts +1 -0
- package/node_modules/pi-antigravity/src/diagnostics/diagnostics.ts +7 -0
- package/node_modules/pi-antigravity/src/features/generate-image.ts +56 -2
- package/node_modules/pi-antigravity/src/features/read-url-content.ts +124 -0
- package/node_modules/pi-antigravity/src/image/image.ts +16 -2
- package/node_modules/pi-antigravity/src/index.ts +145 -2
- package/node_modules/pi-antigravity/src/models/discovery.ts +3 -4
- package/node_modules/pi-antigravity/src/models/grouping.ts +39 -15
- package/node_modules/pi-antigravity/src/models/models.ts +126 -14
- package/node_modules/pi-antigravity/src/stream/stream.ts +189 -30
- package/node_modules/pi-antigravity/src/types/types.ts +30 -1
- package/node_modules/pi-antigravity/src/usage/usage.ts +58 -0
- package/node_modules/pi-antigravity/src/utils/address.ts +180 -0
- package/node_modules/pi-antigravity/src/utils/credits.ts +149 -0
- package/node_modules/pi-antigravity/src/utils/html.ts +31 -0
- package/node_modules/pi-antigravity/src/utils/index.ts +2 -0
- package/node_modules/pi-antigravity/src/utils/security.ts +172 -13
- package/node_modules/pi-antigravity/src/utils/text.ts +66 -0
- package/node_modules/pi-antigravity/src/utils/util.ts +5 -4
- package/node_modules/pi-antigravity/src/web-fetch/document.ts +83 -0
- package/node_modules/pi-antigravity/src/web-fetch/fences.ts +24 -0
- package/node_modules/pi-antigravity/src/web-fetch/header.ts +97 -0
- package/node_modules/pi-antigravity/src/web-fetch/index.ts +3 -0
- package/node_modules/pi-antigravity/src/web-fetch/inspect.ts +328 -0
- package/node_modules/pi-antigravity/src/web-fetch/limits.ts +4 -0
- package/node_modules/pi-antigravity/src/web-fetch/markdown.ts +744 -0
- package/node_modules/pi-antigravity/src/web-fetch/mdn.ts +164 -0
- package/node_modules/pi-antigravity/src/web-fetch/media.ts +11 -0
- package/node_modules/pi-antigravity/src/web-fetch/metadata.ts +9 -0
- package/node_modules/pi-antigravity/src/web-fetch/representation.ts +93 -0
- package/node_modules/pi-antigravity/src/web-fetch/save.ts +71 -0
- package/node_modules/pi-antigravity/src/web-fetch/sites.ts +138 -0
- package/node_modules/pi-antigravity/src/web-fetch/vendor.d.ts +9 -0
- package/node_modules/pi-antigravity/src/web-fetch/web-fetch.ts +957 -0
- package/node_modules/pi-antigravity/tsconfig.json +2 -2
- package/node_modules/pi-commandcode-provider/CHANGELOG.md +10 -0
- package/node_modules/pi-commandcode-provider/README.md +2 -2
- package/node_modules/pi-commandcode-provider/package.json +1 -1
- package/node_modules/pi-commandcode-provider/src/commandcode-catalog.ts +15 -9
- package/node_modules/pi-commandcode-provider/src/oauth.ts +69 -12
- package/node_modules/pi-lens/CHANGELOG-USER.md +6 -6
- package/node_modules/pi-lens/CHANGELOG.md +172 -0
- package/node_modules/pi-lens/README.md +103 -217
- package/node_modules/pi-lens/dist/{chunk-KXDQD34C.js → chunk-27JQHK7Y.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-W6VLB6LL.js → chunk-2APSZHHI.js} +61 -3
- package/node_modules/pi-lens/dist/{chunk-5EEWCJG7.js → chunk-2H5GHZKC.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-TS5EIWEF.js → chunk-2H7NFZ4Q.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-6GWCYEP7.js → chunk-37IDWT6O.js} +64 -16
- package/node_modules/pi-lens/dist/{chunk-OEPWTSUG.js → chunk-3PAS2ERX.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-ET3DSSFZ.js → chunk-3PO4YYOX.js} +9 -17
- package/node_modules/pi-lens/dist/{chunk-C6V2DSZZ.js → chunk-3QXFUP6T.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-HWMNTQBJ.js → chunk-3TSMQZG6.js} +32 -11
- package/node_modules/pi-lens/dist/{chunk-QY6J2FTK.js → chunk-4DAHGU3V.js} +15 -14
- package/node_modules/pi-lens/dist/{chunk-PCREZ4HJ.js → chunk-4IZZEN63.js} +33 -34
- package/node_modules/pi-lens/dist/{chunk-OYXD2MOM.js → chunk-5HBQL7DH.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-B4FAFEBP.js → chunk-5JB4WENL.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-5YJXF2IS.js +56 -0
- package/node_modules/pi-lens/dist/{chunk-GHATCG2A.js → chunk-6CFSDLHE.js} +22 -18
- package/node_modules/pi-lens/dist/{chunk-FVQKX5KI.js → chunk-6E5QLMWI.js} +24 -22
- package/node_modules/pi-lens/dist/{chunk-AVBEPUCD.js → chunk-6GLMMGCX.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-YTXFNCVN.js → chunk-74AMPWNC.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-K2GV34T2.js → chunk-7CLWC2UH.js} +26 -37
- package/node_modules/pi-lens/dist/{chunk-MOEWCPMC.js → chunk-7DPXUPRF.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-7BEADGAZ.js → chunk-7U36VQL6.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-PPYUBO6Y.js → chunk-7WKVCZI4.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-ILC2B7IJ.js → chunk-7ZVTFLCC.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-IT7MFVGP.js → chunk-ADYQRETD.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-NCDH2JB7.js → chunk-ARTYCUGF.js} +25 -10
- package/node_modules/pi-lens/dist/{chunk-Z6WTLVUL.js → chunk-AXAR5ZW2.js} +225 -104
- package/node_modules/pi-lens/dist/{chunk-PK3GDU4M.js → chunk-AZG5UJYY.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-NRVWLTOY.js → chunk-B2OXE4AH.js} +60 -21
- package/node_modules/pi-lens/dist/{chunk-ORYQGVC3.js → chunk-B42AIWPJ.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-IC4L65U7.js → chunk-BBSDJTOV.js} +12 -13
- package/node_modules/pi-lens/dist/{chunk-HJWF7CGW.js → chunk-BKWFDWYM.js} +16 -16
- package/node_modules/pi-lens/dist/{chunk-D2ZYRI7M.js → chunk-C5PLBTNR.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-SRXYSLMW.js → chunk-CQY2HEH7.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-7424ANRU.js → chunk-CXQYK4YT.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-HYR25MV3.js → chunk-CZJGAOKL.js} +8 -7
- package/node_modules/pi-lens/dist/{chunk-DIIDMDZU.js → chunk-DCA2MXVQ.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-K2LD6YNH.js → chunk-DFKOA74L.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-AYDE7RFV.js → chunk-DI4AZZNY.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-6EXGCXM5.js → chunk-G53LBDNU.js} +99 -5
- package/node_modules/pi-lens/dist/chunk-GCSDF5IE.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-5KLRCUDT.js → chunk-H5API74E.js} +6 -6
- package/node_modules/pi-lens/dist/chunk-HBX55MWO.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-JRSS6KM4.js → chunk-HIJ4CHFF.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-3MHY4BQY.js → chunk-HIRBC72R.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-F7AMFFVK.js → chunk-HRLF35WL.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-HSTN27NR.js → chunk-I2FYOZNW.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-5FDUKJZO.js → chunk-I3NZVAMN.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-NZINZCHB.js → chunk-INBK3HIT.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-PXGVB2CY.js → chunk-J2ZB5MDS.js} +20 -18
- package/node_modules/pi-lens/dist/{chunk-HYDJUVOE.js → chunk-JGUDT5KD.js} +4 -4
- package/node_modules/pi-lens/dist/chunk-JOIKBUQN.js +88 -0
- package/node_modules/pi-lens/dist/{chunk-AZXTLZHE.js → chunk-K4Z7MK6T.js} +169 -165
- package/node_modules/pi-lens/dist/{chunk-WTSQKJAR.js → chunk-K7O6AHSJ.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-S6ZQFPOX.js → chunk-KNJH6WJQ.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-SUIZOCSY.js → chunk-KNSOA43J.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-3QMLB4TI.js → chunk-KXGTLAUW.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-OHEUOWYT.js → chunk-KZ732ZVW.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-G3LR6V6N.js → chunk-L6BDRYUK.js} +19 -17
- package/node_modules/pi-lens/dist/{chunk-OVPR3GQ6.js → chunk-LGH2HHZG.js} +24 -6
- package/node_modules/pi-lens/dist/{chunk-3R3Z54J7.js → chunk-LOEJFTF2.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-HGEE5LDW.js → chunk-LQQNFCQJ.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-LVLPA32Q.js +810 -0
- package/node_modules/pi-lens/dist/chunk-M2YMBT5G.js +73 -0
- package/node_modules/pi-lens/dist/{chunk-Z2W5YJBW.js → chunk-MJRGPEQ5.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-3EIZMRXI.js → chunk-MOAVEPC4.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-TOOXNL6M.js → chunk-NGNBJIUO.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-AGEQRJ5A.js → chunk-NHA5K226.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-YLW26OHX.js → chunk-NNEQOC3U.js} +31 -59
- package/node_modules/pi-lens/dist/{chunk-ZWZD4TJ5.js → chunk-O2MHF7QM.js} +35 -36
- package/node_modules/pi-lens/dist/{chunk-PTJXMYRY.js → chunk-OLWGYBYT.js} +15 -16
- package/node_modules/pi-lens/dist/{chunk-JKAVKTMY.js → chunk-OZQQ3AIR.js} +17 -20
- package/node_modules/pi-lens/dist/{chunk-6JLNZ6DP.js → chunk-P5MSLVUW.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-OF2YGDUE.js → chunk-PFJLYRO3.js} +37 -38
- package/node_modules/pi-lens/dist/chunk-PKWEBMCA.js +2957 -0
- package/node_modules/pi-lens/dist/{chunk-JLMS7EMD.js → chunk-PPQHMSPH.js} +16 -15
- package/node_modules/pi-lens/dist/{chunk-6EIV3H7O.js → chunk-PQF6YGYB.js} +12 -5
- package/node_modules/pi-lens/dist/{chunk-VU2PRGRI.js → chunk-PQXUZYTQ.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-MV6ST2KT.js → chunk-Q7J3JYJ2.js} +13 -12
- package/node_modules/pi-lens/dist/{chunk-BMMRLJA4.js → chunk-QE5DJ7MX.js} +27 -10
- package/node_modules/pi-lens/dist/{chunk-IZ36G463.js → chunk-QE7BJQ6K.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-E5SSUV2A.js → chunk-QMWKSYWB.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-QJ4T73J5.js → chunk-QV3JPCMK.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-3PMLYGJN.js → chunk-R4L7KZ7R.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-7ZVEFWOE.js → chunk-RIH3UBK4.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-T5EGSBM2.js → chunk-RJ3APNIP.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-AAIVSSUU.js → chunk-S6MCMD27.js} +35 -12
- package/node_modules/pi-lens/dist/{chunk-SF7KSXB5.js → chunk-SCU62JLX.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-FDLGJFAE.js → chunk-SDYLT45T.js} +3 -3
- package/node_modules/pi-lens/dist/chunk-TFKN5EIR.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-Y7XMKBFP.js → chunk-TKOFTLGB.js} +34 -26
- package/node_modules/pi-lens/dist/chunk-TQWRH25U.js +35 -0
- package/node_modules/pi-lens/dist/{chunk-DZSQXG66.js → chunk-TWEOJE3D.js} +277 -62
- package/node_modules/pi-lens/dist/{chunk-R67WQ5RY.js → chunk-UN72ZAJ5.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-AD7JDEI6.js → chunk-UNP6Y4JV.js} +16 -16
- package/node_modules/pi-lens/dist/{chunk-D6ANA6YU.js → chunk-VGRGW4UL.js} +63 -55
- package/node_modules/pi-lens/dist/{chunk-DFAY7JUN.js → chunk-VSQT6IHZ.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-7T64QA5D.js → chunk-VWEBZ2JV.js} +39 -38
- package/node_modules/pi-lens/dist/{chunk-HRQTYU2T.js → chunk-W26QZ3OM.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-2HWVG3IM.js → chunk-XDNWR7SG.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-75TVYCQW.js → chunk-XSC3BCN3.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-ME6MF2N2.js → chunk-YCR6ZYTE.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-LD7SXICE.js → chunk-ZI7YHV6I.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-E3PNZDPH.js → chunk-ZQSSO7LO.js} +33 -1
- package/node_modules/pi-lens/dist/{chunk-T6PPK3T6.js → chunk-ZULZS2I6.js} +385 -407
- package/node_modules/pi-lens/dist/index.js +6508 -5413
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +9 -9
- package/node_modules/pi-lens/dist/mcp/cli.js +39 -38
- package/node_modules/pi-lens/dist/mcp/server.js +602 -345
- package/node_modules/pi-lens/dist/mcp/worker.js +57 -58
- package/node_modules/pi-lens/dist/probes/installer.js +19 -17
- package/node_modules/pi-lens/docs/architecture.md +113 -0
- package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +2 -2
- package/node_modules/pi-lens/docs/ci.md +18 -4
- package/node_modules/pi-lens/docs/defect-shapes.md +41 -3
- package/node_modules/pi-lens/docs/dependencies.md +10 -10
- package/node_modules/pi-lens/docs/features.md +3 -3
- package/node_modules/pi-lens/docs/invariants/dispatch-runners.md +13 -1
- package/node_modules/pi-lens/docs/invariants/lsp-trust-exec.md +19 -0
- package/node_modules/pi-lens/docs/language-coverage.md +39 -0
- package/node_modules/pi-lens/docs/lsp-capability-matrix.md +10 -4
- package/node_modules/pi-lens/docs/lsp-idle-eviction.md +1 -1
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +4 -0
- package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +1 -1
- package/node_modules/pi-lens/docs/pi-lens-reviewer.md +4 -5
- package/node_modules/pi-lens/docs/pi-lens-subagent.md +5 -2
- package/node_modules/pi-lens/docs/prose-standard.md +112 -0
- package/node_modules/pi-lens/docs/servercapabilities.md +1 -1
- package/node_modules/pi-lens/docs/usage.md +50 -0
- package/node_modules/pi-lens/package.json +1 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/array-callback-return-js-test.yml +23 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/array-callback-return-test.yml +23 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-negation-in-equality-check-js-test.yml +8 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-negation-in-equality-check-test.yml +8 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/unchecked-throwing-call-js-test.yml +16 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/unchecked-throwing-call-test.yml +16 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/array-callback-return-js.yml +8 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/array-callback-return.yml +8 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-negation-in-equality-check-js.yml +17 -5
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-negation-in-equality-check.yml +17 -5
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/unchecked-throwing-call-js.yml +8 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/unchecked-throwing-call.yml +8 -1
- package/node_modules/pi-lens/rules/tree-sitter-queries/typescript/ts-react-antipatterns.yml +8 -0
- package/node_modules/pi-web-access/CHANGELOG.md +29 -0
- package/node_modules/pi-web-access/README.md +35 -15
- package/node_modules/pi-web-access/anysearch.ts +7 -3
- package/node_modules/pi-web-access/autom.ts +196 -0
- package/node_modules/pi-web-access/cloro.ts +254 -0
- package/node_modules/pi-web-access/curator-page.ts +7 -1
- package/node_modules/pi-web-access/curator-server.ts +3 -0
- package/node_modules/pi-web-access/dist/index.js +12931 -12111
- package/node_modules/pi-web-access/dist/mcp-cli.js +1188 -416
- package/node_modules/pi-web-access/domain-filter-normalization.ts +30 -0
- package/node_modules/pi-web-access/duckduckgo-rate-limit.ts +144 -34
- package/node_modules/pi-web-access/duckduckgo.ts +11 -3
- package/node_modules/pi-web-access/extract.ts +60 -4
- package/node_modules/pi-web-access/gemini-search.ts +25 -5
- package/node_modules/pi-web-access/index.ts +9 -1
- package/node_modules/pi-web-access/package.json +2 -2
- package/node_modules/pi-web-access/page-query.ts +12 -3
- package/node_modules/pi-web-access/specstream.ts +276 -0
- package/node_modules/pi-web-access/tool-activation.ts +21 -6
- package/node_modules/pi-web-access/utils.ts +4 -0
- package/node_modules/pi-web-access/video-extract.ts +2 -2
- package/node_modules/pi-web-access/web-tool-core.ts +24 -5
- package/node_modules/pi-web-access/youtube-extract.ts +2 -2
- package/package.json +10 -7
- package/node_modules/pi-lens/dist/chunk-3VWEZ6H2.js +0 -72
- package/node_modules/pi-lens/dist/chunk-7KWI5UHL.js +0 -28
- package/node_modules/pi-lens/dist/chunk-7M64NTAK.js +0 -38
- package/node_modules/pi-lens/dist/chunk-BEIPWPVR.js +0 -1037
- package/node_modules/pi-lens/dist/chunk-D7OEGXDX.js +0 -2417
- package/node_modules/pi-lens/dist/chunk-KUDUKKQE.js +0 -89
- package/node_modules/pi-lens/dist/chunk-TM3A3K7T.js +0 -28
- package/node_modules/pi-lens/dist/chunk-VD7MQFEV.js +0 -56
- package/node_modules/pi-lens/dist/chunk-YLHJWAQS.js +0 -256
- package/node_modules/pi-lens/dist/chunk-YULIERZW.js +0 -27
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
+
COLLECT_LATER_THRESHOLD_MS,
|
|
4
|
+
classifyObservedRunner,
|
|
3
5
|
getLazyInstallAttempt,
|
|
6
|
+
holdFlight,
|
|
7
|
+
observeRunnerLatency,
|
|
8
|
+
runCollectLater,
|
|
9
|
+
runnerFlightKey,
|
|
4
10
|
tryLazyInstall
|
|
5
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-G53LBDNU.js";
|
|
6
12
|
import {
|
|
7
13
|
computeImpactCascade
|
|
8
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-HIJ4CHFF.js";
|
|
9
15
|
import {
|
|
10
16
|
goClient
|
|
11
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7DPXUPRF.js";
|
|
12
18
|
import {
|
|
13
19
|
isTrivyEnabled,
|
|
14
20
|
resolveSeverityFloor
|
|
15
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-CZJGAOKL.js";
|
|
16
22
|
import {
|
|
17
23
|
faultIfCutShort,
|
|
18
24
|
finishParsedRun,
|
|
@@ -22,15 +28,23 @@ import {
|
|
|
22
28
|
skipUnlessToolRan,
|
|
23
29
|
spawnFailedWithNoOutput,
|
|
24
30
|
spawnTimedOut
|
|
25
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-SDYLT45T.js";
|
|
26
32
|
import {
|
|
27
33
|
rustClient
|
|
28
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-XDNWR7SG.js";
|
|
29
35
|
import {
|
|
36
|
+
biomeConfigArgs,
|
|
30
37
|
coveringLaneAvailable,
|
|
31
38
|
createAvailabilityChecker,
|
|
32
39
|
createCwdCachedProbe,
|
|
40
|
+
findCompiledClassesDir,
|
|
41
|
+
getAutofixCapability,
|
|
42
|
+
getJstsLintPolicyForCwd,
|
|
43
|
+
getLinterPolicyForCwd,
|
|
44
|
+
getRubocopCommand,
|
|
33
45
|
lspPrimaryCoversFile,
|
|
46
|
+
markdownlintConfigArgs,
|
|
47
|
+
optionSafeTargetArg,
|
|
34
48
|
resolveAdoptedRootCommand,
|
|
35
49
|
resolveAvailableOrInstall,
|
|
36
50
|
resolveCommandArgsWithInstallFallback,
|
|
@@ -38,44 +52,25 @@ import {
|
|
|
38
52
|
resolveRunnerCwd as resolveRunnerCwd2,
|
|
39
53
|
resolveToolCommand,
|
|
40
54
|
resolveToolCommandWithInstallFallback,
|
|
41
|
-
resolveVendorToolCommand
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
findToolConfig,
|
|
47
|
-
getAutofixCapability,
|
|
48
|
-
getJstsLintPolicyForCwd,
|
|
49
|
-
getLinterPolicyForCwd,
|
|
50
|
-
getRubocopCommand,
|
|
51
|
-
hasEslintConfig,
|
|
52
|
-
hasGolangciConfig,
|
|
53
|
-
hasJavaBuildDescriptor,
|
|
54
|
-
hasMypyConfig,
|
|
55
|
-
hasPhpstanConfig,
|
|
56
|
-
hasSqlfluffConfig,
|
|
57
|
-
hasStylelintConfig,
|
|
58
|
-
hasToolConfig,
|
|
59
|
-
hasVitePlusConfig,
|
|
60
|
-
hasYamllintConfig,
|
|
61
|
-
markdownlintConfigArgs,
|
|
62
|
-
readFileContent,
|
|
63
|
-
ruffConfigArgs
|
|
64
|
-
} from "./chunk-D7OEGXDX.js";
|
|
55
|
+
resolveVendorToolCommand,
|
|
56
|
+
ruffConfigArgs,
|
|
57
|
+
toolAbsentSkip,
|
|
58
|
+
toolBinaryVerdict
|
|
59
|
+
} from "./chunk-PKWEBMCA.js";
|
|
65
60
|
import {
|
|
66
61
|
importFactProvider
|
|
67
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-HIRBC72R.js";
|
|
68
63
|
import {
|
|
69
64
|
functionFactProvider
|
|
70
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-PQXUZYTQ.js";
|
|
71
66
|
import {
|
|
72
67
|
extractFactsFromTree
|
|
73
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-KZ732ZVW.js";
|
|
74
69
|
import {
|
|
75
70
|
buildOrUpdateGraph,
|
|
76
71
|
clearReviewGraphWorkspaceCache,
|
|
77
72
|
fileContentProvider
|
|
78
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-4DAHGU3V.js";
|
|
79
74
|
import {
|
|
80
75
|
MAX_BLOCKING_RULE_COMPLEXITY,
|
|
81
76
|
PRIMARY_UNAVAILABLE_CAUSE,
|
|
@@ -112,13 +107,13 @@ import {
|
|
|
112
107
|
tryWarmAttachedCodeActions,
|
|
113
108
|
tryWarmAttachedDiagnostics,
|
|
114
109
|
warmAnswerBinding
|
|
115
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-TWEOJE3D.js";
|
|
116
111
|
import {
|
|
117
112
|
ANY_POSITION,
|
|
118
113
|
displayedMessage,
|
|
119
114
|
hashText,
|
|
120
115
|
retainRecordedFindings
|
|
121
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-VSQT6IHZ.js";
|
|
122
117
|
import {
|
|
123
118
|
mapWithConcurrency
|
|
124
119
|
} from "./chunk-XIMYZ3JA.js";
|
|
@@ -134,7 +129,7 @@ import {
|
|
|
134
129
|
resolveSessionConfigRoot,
|
|
135
130
|
resolveShellFileDialect,
|
|
136
131
|
runnerIdentityPopulated
|
|
137
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-AXAR5ZW2.js";
|
|
138
133
|
import {
|
|
139
134
|
augmentPythonEnvironment,
|
|
140
135
|
describePythonCompileWithheld,
|
|
@@ -143,25 +138,23 @@ import {
|
|
|
143
138
|
emitBounded,
|
|
144
139
|
partitionOutrankedPythonCompileVerdicts,
|
|
145
140
|
recordPythonCompileVerdictDrop
|
|
146
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-2H5GHZKC.js";
|
|
147
142
|
import {
|
|
148
143
|
scannerReportParentDir
|
|
149
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-QV3JPCMK.js";
|
|
150
145
|
import {
|
|
151
|
-
loadProjectSnapshot
|
|
152
|
-
|
|
153
|
-
readJsonCacheAsync
|
|
154
|
-
} from "./chunk-YLW26OHX.js";
|
|
146
|
+
loadProjectSnapshot
|
|
147
|
+
} from "./chunk-NNEQOC3U.js";
|
|
155
148
|
import {
|
|
156
149
|
RUNTIME_CONFIG,
|
|
157
150
|
exceedsLspSyncLimits,
|
|
158
151
|
getRunnerTimeoutFloorMs,
|
|
159
152
|
loadAstGrepNapi
|
|
160
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-ARTYCUGF.js";
|
|
161
154
|
import {
|
|
162
155
|
buildModuleGraph,
|
|
163
156
|
clearModuleGraphCache
|
|
164
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-JGUDT5KD.js";
|
|
165
158
|
import {
|
|
166
159
|
BUNDLED_QUERIES_ROOT,
|
|
167
160
|
classifyTreeSitterWasmError,
|
|
@@ -181,10 +174,10 @@ import {
|
|
|
181
174
|
ruleFilesForLanguage,
|
|
182
175
|
ruleSourceLanguages,
|
|
183
176
|
walk
|
|
184
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-37IDWT6O.js";
|
|
185
178
|
import {
|
|
186
179
|
resolvePackagePath
|
|
187
|
-
} from "./chunk-
|
|
180
|
+
} from "./chunk-ZQSSO7LO.js";
|
|
188
181
|
import {
|
|
189
182
|
stripAnsi
|
|
190
183
|
} from "./chunk-6HWVI6MI.js";
|
|
@@ -196,14 +189,20 @@ import {
|
|
|
196
189
|
scheduleWordIndexPersist,
|
|
197
190
|
setWordIndexPublishedListener,
|
|
198
191
|
updateWordIndexDocumentForEdit
|
|
199
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-P5MSLVUW.js";
|
|
200
193
|
import {
|
|
201
194
|
isTypeScriptFile
|
|
202
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-DI4AZZNY.js";
|
|
196
|
+
import {
|
|
197
|
+
WARM_CODE_ACTION_LOOKUP_LIMIT,
|
|
198
|
+
contentHash
|
|
199
|
+
} from "./chunk-3TSMQZG6.js";
|
|
203
200
|
import {
|
|
204
201
|
IN_FLIGHT_REASON,
|
|
205
202
|
NO_ANALYZER_REASON,
|
|
206
203
|
NO_SERVER_REASON,
|
|
204
|
+
SKIP_REASON_PHRASE,
|
|
205
|
+
TOOL_UNUSABLE_SKIP_REASONS,
|
|
207
206
|
checkedVerdict,
|
|
208
207
|
emptyDispatchResult,
|
|
209
208
|
faultResult,
|
|
@@ -216,13 +215,10 @@ import {
|
|
|
216
215
|
reachedNoVerdict,
|
|
217
216
|
recordedUnchecked,
|
|
218
217
|
semanticFor,
|
|
218
|
+
skipped,
|
|
219
219
|
spanOverlapsModifiedRanges,
|
|
220
220
|
unchecked
|
|
221
|
-
} from "./chunk-
|
|
222
|
-
import {
|
|
223
|
-
WARM_CODE_ACTION_LOOKUP_LIMIT,
|
|
224
|
-
contentHash
|
|
225
|
-
} from "./chunk-HWMNTQBJ.js";
|
|
221
|
+
} from "./chunk-2APSZHHI.js";
|
|
226
222
|
import {
|
|
227
223
|
resolveRunnerPath,
|
|
228
224
|
toRunnerDisplayPath
|
|
@@ -230,20 +226,28 @@ import {
|
|
|
230
226
|
import {
|
|
231
227
|
findCommandOnPath,
|
|
232
228
|
isSpawnableCommand
|
|
233
|
-
} from "./chunk-
|
|
229
|
+
} from "./chunk-B2OXE4AH.js";
|
|
234
230
|
import {
|
|
231
|
+
findToolConfig,
|
|
232
|
+
hasToolConfig,
|
|
235
233
|
logRunnerAdvisoryOnce,
|
|
234
|
+
readFileContent,
|
|
236
235
|
resolveRunnerCwd,
|
|
237
236
|
resolveRunnerCwdWithReason
|
|
238
|
-
} from "./chunk-
|
|
237
|
+
} from "./chunk-LVLPA32Q.js";
|
|
239
238
|
import {
|
|
240
239
|
findLocalBinUpwards,
|
|
240
|
+
isLocalBinTrustRefusal,
|
|
241
241
|
localBinPath
|
|
242
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-LGH2HHZG.js";
|
|
243
243
|
import {
|
|
244
244
|
getIsolatedNpxSpawnOptions,
|
|
245
245
|
probeToolAsync
|
|
246
|
-
} from "./chunk-
|
|
246
|
+
} from "./chunk-KXGTLAUW.js";
|
|
247
|
+
import {
|
|
248
|
+
readJsonCache,
|
|
249
|
+
readJsonCacheAsync
|
|
250
|
+
} from "./chunk-TQWRH25U.js";
|
|
247
251
|
import {
|
|
248
252
|
classifyProbeFailure,
|
|
249
253
|
createAvailabilityLatch,
|
|
@@ -252,12 +256,12 @@ import {
|
|
|
252
256
|
isLatchingOutcome,
|
|
253
257
|
logAvailabilityDecision,
|
|
254
258
|
startHostStallSampler
|
|
255
|
-
} from "./chunk-
|
|
259
|
+
} from "./chunk-6GLMMGCX.js";
|
|
256
260
|
import {
|
|
257
261
|
getLspCapableKinds,
|
|
258
262
|
getPrimaryDispatchGroup,
|
|
259
263
|
resolveLanguageRootForFile
|
|
260
|
-
} from "./chunk-
|
|
264
|
+
} from "./chunk-XSC3BCN3.js";
|
|
261
265
|
import {
|
|
262
266
|
getGlobalPiLensDir,
|
|
263
267
|
getProjectDataDir,
|
|
@@ -268,13 +272,13 @@ import {
|
|
|
268
272
|
realIsPidAlive,
|
|
269
273
|
resolvePiLensFlag,
|
|
270
274
|
safeSpawnAsync
|
|
271
|
-
} from "./chunk-
|
|
275
|
+
} from "./chunk-3PO4YYOX.js";
|
|
272
276
|
import {
|
|
273
277
|
DOTNET_CSHARP_PROJECT_MARKERS,
|
|
274
278
|
DOTNET_CSHARP_SOLUTION_MARKERS,
|
|
275
279
|
detectFileKind,
|
|
276
280
|
isJstsFactFile
|
|
277
|
-
} from "./chunk-
|
|
281
|
+
} from "./chunk-CQY2HEH7.js";
|
|
278
282
|
import {
|
|
279
283
|
PathKeyedMap,
|
|
280
284
|
boundedKeyLabel,
|
|
@@ -287,11 +291,11 @@ import {
|
|
|
287
291
|
resolveOnePiLensConfigDocument,
|
|
288
292
|
resolvePiLensConfig,
|
|
289
293
|
spawnCooldownScope
|
|
290
|
-
} from "./chunk-
|
|
294
|
+
} from "./chunk-PQF6YGYB.js";
|
|
291
295
|
import {
|
|
292
296
|
findNearestDirWithMarker,
|
|
293
297
|
getPiLensGlobalConfigPath
|
|
294
|
-
} from "./chunk-
|
|
298
|
+
} from "./chunk-LOEJFTF2.js";
|
|
295
299
|
import {
|
|
296
300
|
getProjectTrustState,
|
|
297
301
|
killedForOutputCap,
|
|
@@ -299,13 +303,13 @@ import {
|
|
|
299
303
|
truncatedByOutputCap,
|
|
300
304
|
withBudget,
|
|
301
305
|
writeFileAtomic
|
|
302
|
-
} from "./chunk-
|
|
306
|
+
} from "./chunk-W26QZ3OM.js";
|
|
303
307
|
import {
|
|
304
308
|
createSubsystemLogger,
|
|
305
309
|
incrementDegradationCount,
|
|
306
310
|
logExtension,
|
|
307
311
|
recordDegradationOnce
|
|
308
|
-
} from "./chunk-
|
|
312
|
+
} from "./chunk-NHA5K226.js";
|
|
309
313
|
import {
|
|
310
314
|
createNdjsonLogger,
|
|
311
315
|
getGlobalPiLensLogDir,
|
|
@@ -315,7 +319,7 @@ import {
|
|
|
315
319
|
nonNegativeIntEnv,
|
|
316
320
|
phaseFinished,
|
|
317
321
|
phaseStarted
|
|
318
|
-
} from "./chunk-
|
|
322
|
+
} from "./chunk-7CLWC2UH.js";
|
|
319
323
|
import {
|
|
320
324
|
FactStore,
|
|
321
325
|
setFactStoreEvictionReporter
|
|
@@ -324,7 +328,6 @@ import {
|
|
|
324
328
|
BoundedFifoMap,
|
|
325
329
|
BoundedLruCache,
|
|
326
330
|
direntsHaveMarkerGlobMatch,
|
|
327
|
-
findLocalToolConfig,
|
|
328
331
|
isAbsoluteFilePath,
|
|
329
332
|
isUnderDir,
|
|
330
333
|
isWindowsPath,
|
|
@@ -335,6 +338,7 @@ import {
|
|
|
335
338
|
pathsEqual,
|
|
336
339
|
realpathOrResolve,
|
|
337
340
|
relativeInside,
|
|
341
|
+
resolveHostToolPath,
|
|
338
342
|
toPosix,
|
|
339
343
|
toProjectRelativePath
|
|
340
344
|
} from "./chunk-WLD6BGON.js";
|
|
@@ -412,8 +416,8 @@ var CacheManager = class {
|
|
|
412
416
|
}
|
|
413
417
|
getTurnFileState(filePath, cwd) {
|
|
414
418
|
const state = this.readTurnState(cwd);
|
|
415
|
-
const
|
|
416
|
-
return state.files[
|
|
419
|
+
const key = this.toTurnStateKey(filePath, cwd);
|
|
420
|
+
return state.files[key];
|
|
417
421
|
}
|
|
418
422
|
// ---- Scanner Cache ----
|
|
419
423
|
/**
|
|
@@ -1197,9 +1201,9 @@ function applyInlineSuppressions(diagnostics, content) {
|
|
|
1197
1201
|
const suppressedLine = i + 1;
|
|
1198
1202
|
const nextLine = i + 2;
|
|
1199
1203
|
for (const ruleId of rules2) {
|
|
1200
|
-
for (const
|
|
1201
|
-
suppressed.add(`${suppressedLine}:${
|
|
1202
|
-
suppressed.add(`${nextLine}:${
|
|
1204
|
+
for (const key of /* @__PURE__ */ new Set([ruleId, normalizeRuleId(ruleId)])) {
|
|
1205
|
+
suppressed.add(`${suppressedLine}:${key}`);
|
|
1206
|
+
suppressed.add(`${nextLine}:${key}`);
|
|
1203
1207
|
}
|
|
1204
1208
|
}
|
|
1205
1209
|
}
|
|
@@ -1242,10 +1246,10 @@ function rulePolicyMapFromResolution(resolution, root) {
|
|
|
1242
1246
|
return map;
|
|
1243
1247
|
}
|
|
1244
1248
|
const anchored = anchoredIgnorePaths(resolution.documents, root);
|
|
1245
|
-
for (const [
|
|
1249
|
+
for (const [key, entry] of Object.entries(map)) {
|
|
1246
1250
|
if (!entry?.ignorePaths)
|
|
1247
1251
|
continue;
|
|
1248
|
-
const paths = anchored.get(
|
|
1252
|
+
const paths = anchored.get(key);
|
|
1249
1253
|
if (paths && paths.length > 0)
|
|
1250
1254
|
entry.ignorePaths = paths;
|
|
1251
1255
|
}
|
|
@@ -1261,7 +1265,7 @@ function anchoredIgnorePaths(documents, root) {
|
|
|
1261
1265
|
continue;
|
|
1262
1266
|
const prefix = document.tier === "global" ? void 0 : anchorPrefix(document, root);
|
|
1263
1267
|
const baseDir = prefix ? nodePath.resolve(root, prefix) : root;
|
|
1264
|
-
for (const [
|
|
1268
|
+
for (const [key, rawEntry] of Object.entries(rules2)) {
|
|
1265
1269
|
const ignorePaths = rawEntry?.ignorePaths;
|
|
1266
1270
|
if (!Array.isArray(ignorePaths))
|
|
1267
1271
|
continue;
|
|
@@ -1270,9 +1274,9 @@ function anchoredIgnorePaths(documents, root) {
|
|
|
1270
1274
|
if (typeof pattern === "string")
|
|
1271
1275
|
patterns.push(pattern);
|
|
1272
1276
|
}
|
|
1273
|
-
const scopes = byKey.get(
|
|
1277
|
+
const scopes = byKey.get(key) ?? [];
|
|
1274
1278
|
scopes.push({ baseDir, patterns });
|
|
1275
|
-
byKey.set(
|
|
1279
|
+
byKey.set(key, scopes);
|
|
1276
1280
|
}
|
|
1277
1281
|
}
|
|
1278
1282
|
return byKey;
|
|
@@ -1406,7 +1410,7 @@ function rulePolicyMapFromConfig(rules2) {
|
|
|
1406
1410
|
return trimmed.length > 0 ? [trimmed] : [];
|
|
1407
1411
|
}) : [];
|
|
1408
1412
|
let built;
|
|
1409
|
-
for (const [
|
|
1413
|
+
for (const [key, rawEntry] of Object.entries(rules2)) {
|
|
1410
1414
|
if (!rawEntry || typeof rawEntry !== "object" || Array.isArray(rawEntry)) {
|
|
1411
1415
|
continue;
|
|
1412
1416
|
}
|
|
@@ -1418,7 +1422,7 @@ function rulePolicyMapFromConfig(rules2) {
|
|
|
1418
1422
|
continue;
|
|
1419
1423
|
}
|
|
1420
1424
|
built ??= {};
|
|
1421
|
-
built[
|
|
1425
|
+
built[key] = {
|
|
1422
1426
|
...disable.length > 0 ? { disable } : {},
|
|
1423
1427
|
...select.length > 0 ? { select } : {},
|
|
1424
1428
|
...hasIgnorePaths ? { ignorePaths: entry.ignorePaths } : {}
|
|
@@ -1437,7 +1441,7 @@ function convertLspDiagnostics(diags, filePath, options = {}) {
|
|
|
1437
1441
|
4: "hint"
|
|
1438
1442
|
};
|
|
1439
1443
|
const severity = severityMap[d.severity] ?? "info";
|
|
1440
|
-
const semantic = d.severity === 1 || d.severity === 2 || d.severity === 3 ? semanticFor(severity) : "none";
|
|
1444
|
+
const semantic = d.severity === 1 || d.severity === 2 || d.severity === 3 || d.severity === 4 ? semanticFor(severity) : "none";
|
|
1441
1445
|
const code = String(d.code ?? "unknown");
|
|
1442
1446
|
const source = d.source ?? tool;
|
|
1443
1447
|
const hasSuggestion = options.fixSuggestionByIndex?.has(idx) ?? false;
|
|
@@ -1622,10 +1626,10 @@ function expandRenderedIdentities(rendered) {
|
|
|
1622
1626
|
const seen = /* @__PURE__ */ new Set();
|
|
1623
1627
|
for (const [tool, rule] of rendered) {
|
|
1624
1628
|
for (const candidateTool of [tool, void 0]) {
|
|
1625
|
-
const
|
|
1626
|
-
if (seen.has(
|
|
1629
|
+
const key = `${candidateTool ?? ""}\0${rule ?? ""}`;
|
|
1630
|
+
if (seen.has(key))
|
|
1627
1631
|
continue;
|
|
1628
|
-
seen.add(
|
|
1632
|
+
seen.add(key);
|
|
1629
1633
|
out.push({
|
|
1630
1634
|
...candidateTool !== void 0 && { tool: candidateTool },
|
|
1631
1635
|
...rule !== void 0 && { rule }
|
|
@@ -1997,76 +2001,6 @@ function getToolPlan(kind) {
|
|
|
1997
2001
|
return TOOL_PLANS[kind];
|
|
1998
2002
|
}
|
|
1999
2003
|
|
|
2000
|
-
// dist/clients/dispatch/collect-later-tier.js
|
|
2001
|
-
var COLLECT_LATER_THRESHOLD_MS = 5e3;
|
|
2002
|
-
var slowRunners = /* @__PURE__ */ new Map();
|
|
2003
|
-
function key(projectRoot, runnerId) {
|
|
2004
|
-
return `${normalizeMapKey(projectRoot)}\0${runnerId}`;
|
|
2005
|
-
}
|
|
2006
|
-
function classifyObservedRunner(projectRoot, runnerId) {
|
|
2007
|
-
return slowRunners.has(key(projectRoot, runnerId)) ? "collect-later" : "inline";
|
|
2008
|
-
}
|
|
2009
|
-
function observeRunnerLatency(options) {
|
|
2010
|
-
const normalizedProjectRoot = normalizeMapKey(options.projectRoot);
|
|
2011
|
-
const runnerKey = key(normalizedProjectRoot, options.runnerId);
|
|
2012
|
-
if (options.timedOut === true || options.durationMs > COLLECT_LATER_THRESHOLD_MS) {
|
|
2013
|
-
slowRunners.set(runnerKey, {
|
|
2014
|
-
projectRoot: normalizedProjectRoot,
|
|
2015
|
-
runnerId: options.runnerId
|
|
2016
|
-
});
|
|
2017
|
-
return "collect-later";
|
|
2018
|
-
}
|
|
2019
|
-
slowRunners.delete(runnerKey);
|
|
2020
|
-
return "inline";
|
|
2021
|
-
}
|
|
2022
|
-
var flights = /* @__PURE__ */ new Map();
|
|
2023
|
-
var DROPPED_BY_RESET = {
|
|
2024
|
-
status: "skipped",
|
|
2025
|
-
diagnostics: [],
|
|
2026
|
-
semantic: "none"
|
|
2027
|
-
};
|
|
2028
|
-
function runCollectLater(options) {
|
|
2029
|
-
const flightKey = key(options.projectRoot, options.runnerId);
|
|
2030
|
-
const flight = flights.get(flightKey);
|
|
2031
|
-
if (flight) {
|
|
2032
|
-
const fileKey = normalizeMapKey(options.filePath);
|
|
2033
|
-
const queued = flight.queued.get(fileKey);
|
|
2034
|
-
if (queued) {
|
|
2035
|
-
queued.start = options.start;
|
|
2036
|
-
return { promise: queued.promise, coalesced: true };
|
|
2037
|
-
}
|
|
2038
|
-
const slot = {
|
|
2039
|
-
start: options.start,
|
|
2040
|
-
promise: Promise.allSettled([flight.tail]).then(() => startQueued(flightKey, flight, fileKey, slot))
|
|
2041
|
-
};
|
|
2042
|
-
flight.queued.set(fileKey, slot);
|
|
2043
|
-
chain(flightKey, flight, slot.promise);
|
|
2044
|
-
return { promise: slot.promise, coalesced: true };
|
|
2045
|
-
}
|
|
2046
|
-
const promise = options.start();
|
|
2047
|
-
const started = { tail: promise, queued: /* @__PURE__ */ new Map() };
|
|
2048
|
-
flights.set(flightKey, started);
|
|
2049
|
-
chain(flightKey, started, promise);
|
|
2050
|
-
return { promise, coalesced: false };
|
|
2051
|
-
}
|
|
2052
|
-
function startQueued(flightKey, flight, fileKey, slot) {
|
|
2053
|
-
if (flights.get(flightKey) !== flight)
|
|
2054
|
-
return DROPPED_BY_RESET;
|
|
2055
|
-
flight.queued.delete(fileKey);
|
|
2056
|
-
return slot.start();
|
|
2057
|
-
}
|
|
2058
|
-
function chain(flightKey, flight, run) {
|
|
2059
|
-
flight.tail = run;
|
|
2060
|
-
void Promise.allSettled([run]).then(() => {
|
|
2061
|
-
if (flight.tail === run && flights.get(flightKey) === flight)
|
|
2062
|
-
flights.delete(flightKey);
|
|
2063
|
-
});
|
|
2064
|
-
}
|
|
2065
|
-
function resetObservedRunnerLatency() {
|
|
2066
|
-
slowRunners.clear();
|
|
2067
|
-
flights.clear();
|
|
2068
|
-
}
|
|
2069
|
-
|
|
2070
2004
|
// dist/clients/dispatch/pending-runner-findings.js
|
|
2071
2005
|
var pending = [];
|
|
2072
2006
|
function settledSnapshot(entry) {
|
|
@@ -2235,8 +2169,8 @@ function laneKey(d) {
|
|
|
2235
2169
|
function laneCopyStandsFor(lane) {
|
|
2236
2170
|
const rankByKey = /* @__PURE__ */ new Map();
|
|
2237
2171
|
for (const d of lane) {
|
|
2238
|
-
const
|
|
2239
|
-
rankByKey.set(
|
|
2172
|
+
const key = laneKey(d);
|
|
2173
|
+
rankByKey.set(key, Math.max(rankByKey.get(key) ?? 0, semanticRank(d.semantic)));
|
|
2240
2174
|
}
|
|
2241
2175
|
return (d) => (rankByKey.get(laneKey(d)) ?? -1) >= semanticRank(d.semantic);
|
|
2242
2176
|
}
|
|
@@ -2482,8 +2416,8 @@ var commandCheckers = /* @__PURE__ */ new Map();
|
|
|
2482
2416
|
async function checkToolAvailability(command) {
|
|
2483
2417
|
if (!await isSpawnableCommand(command))
|
|
2484
2418
|
return false;
|
|
2485
|
-
const
|
|
2486
|
-
let checker = commandCheckers.get(
|
|
2419
|
+
const key = normalizeCacheKey(command);
|
|
2420
|
+
let checker = commandCheckers.get(key);
|
|
2487
2421
|
if (!checker) {
|
|
2488
2422
|
checker = createAvailabilityChecker(command, "", ["--version"], {
|
|
2489
2423
|
pathOnly: true,
|
|
@@ -2492,7 +2426,7 @@ async function checkToolAvailability(command) {
|
|
|
2492
2426
|
// durable, cached for the session.
|
|
2493
2427
|
unclassifiedFailureOutcome: "missing"
|
|
2494
2428
|
});
|
|
2495
|
-
commandCheckers.set(
|
|
2429
|
+
commandCheckers.set(key, checker);
|
|
2496
2430
|
}
|
|
2497
2431
|
return checker.isAvailableAsync();
|
|
2498
2432
|
}
|
|
@@ -2580,10 +2514,10 @@ function filterDelta(after, before, copyOf) {
|
|
|
2580
2514
|
const ids = new Set(side.map((d) => d.id));
|
|
2581
2515
|
const lanesByKey = /* @__PURE__ */ new Map();
|
|
2582
2516
|
for (const d of side) {
|
|
2583
|
-
const
|
|
2584
|
-
const lanes = lanesByKey.get(
|
|
2517
|
+
const key = copyOf.key(d);
|
|
2518
|
+
const lanes = lanesByKey.get(key) ?? /* @__PURE__ */ new Set();
|
|
2585
2519
|
lanes.add(copyOf.lane(d));
|
|
2586
|
-
lanesByKey.set(
|
|
2520
|
+
lanesByKey.set(key, lanes);
|
|
2587
2521
|
}
|
|
2588
2522
|
return (d) => {
|
|
2589
2523
|
if (ids.has(d.id))
|
|
@@ -2615,16 +2549,16 @@ function dedupeOverlappingDiagnostics(diagnostics) {
|
|
|
2615
2549
|
const byKey = /* @__PURE__ */ new Map();
|
|
2616
2550
|
for (const d of diagnostics) {
|
|
2617
2551
|
const defectClass = d.defectClass ?? classifyDiagnostic(d);
|
|
2618
|
-
const
|
|
2619
|
-
const current = byKey.get(
|
|
2552
|
+
const key = findingKey(d, defectClass);
|
|
2553
|
+
const current = byKey.get(key);
|
|
2620
2554
|
if (!current) {
|
|
2621
|
-
byKey.set(
|
|
2555
|
+
byKey.set(key, { ...d, defectClass });
|
|
2622
2556
|
continue;
|
|
2623
2557
|
}
|
|
2624
2558
|
const currScore = semanticRank(current.semantic) * 100 + toolPriority(current.tool, defectClass);
|
|
2625
2559
|
const nextScore = semanticRank(d.semantic) * 100 + toolPriority(d.tool, defectClass);
|
|
2626
2560
|
if (nextScore > currScore) {
|
|
2627
|
-
byKey.set(
|
|
2561
|
+
byKey.set(key, { ...d, defectClass });
|
|
2628
2562
|
}
|
|
2629
2563
|
}
|
|
2630
2564
|
return [...byKey.values()];
|
|
@@ -2638,15 +2572,15 @@ function mergeFindingClasses(visible, held) {
|
|
|
2638
2572
|
const slotByKey = /* @__PURE__ */ new Map();
|
|
2639
2573
|
const merged = [];
|
|
2640
2574
|
for (const d of visible) {
|
|
2641
|
-
const
|
|
2642
|
-
if (
|
|
2575
|
+
const key = findingClassKey(d);
|
|
2576
|
+
if (key === void 0 || heldKeys.has(key)) {
|
|
2643
2577
|
merged.push(d);
|
|
2644
2578
|
continue;
|
|
2645
2579
|
}
|
|
2646
2580
|
const raised = withClassSeverity(d);
|
|
2647
|
-
const slot = slotByKey.get(
|
|
2581
|
+
const slot = slotByKey.get(key);
|
|
2648
2582
|
if (slot === void 0) {
|
|
2649
|
-
slotByKey.set(
|
|
2583
|
+
slotByKey.set(key, merged.push(raised) - 1);
|
|
2650
2584
|
} else if (score(raised) > score(merged[slot])) {
|
|
2651
2585
|
merged[slot] = raised;
|
|
2652
2586
|
}
|
|
@@ -2678,8 +2612,8 @@ function suppressLintOverlapsWithLsp(diagnostics) {
|
|
|
2678
2612
|
return true;
|
|
2679
2613
|
const line = d.line ?? 1;
|
|
2680
2614
|
const defectClass = d.defectClass ?? classifyDiagnostic(d);
|
|
2681
|
-
const
|
|
2682
|
-
if (lspBySpanClass.has(
|
|
2615
|
+
const key = `${d.filePath}:${line}:${defectClass}`;
|
|
2616
|
+
if (lspBySpanClass.has(key))
|
|
2683
2617
|
return false;
|
|
2684
2618
|
if (defectClass === "unknown") {
|
|
2685
2619
|
return !lspByLine.has(`${d.filePath}:${line}`);
|
|
@@ -2821,7 +2755,14 @@ function buildCoverageNotice(ctx, runnerLatencies, dedupe) {
|
|
|
2821
2755
|
const deniedRunnerIds = relevant.filter((r) => r.skipReason === DISABLED_BY_CONFIG_SKIP_REASON).map((r) => r.runnerId);
|
|
2822
2756
|
const deniedNote = `${deniedRunnerIds.join(", ")} disabled in config by dispatch.disabledRunners`;
|
|
2823
2757
|
const onlySwitchedOff = relevant.every((r) => r.skipReason === DISABLED_BY_CONFIG_SKIP_REASON || isNotApplicableSkipReason(r.skipReason) || r.primaryUnavailableCause === "disabled" || r.primaryUnavailableCause === "disabledFallback");
|
|
2824
|
-
const
|
|
2758
|
+
const statedRows = relevant.filter((r) => r.status === "skipped" && r.skipReason !== void 0);
|
|
2759
|
+
const causesOf = (rows) => [
|
|
2760
|
+
...new Set(rows.map((r) => `${r.runnerId}: ${SKIP_REASON_PHRASE[r.skipReason]}`))
|
|
2761
|
+
];
|
|
2762
|
+
const statedCauses = causesOf(statedRows);
|
|
2763
|
+
const everyRowStated = statedRows.length === relevant.length;
|
|
2764
|
+
const unexplainedCauses = causesOf(statedRows.filter((r) => !isNotApplicableSkipReason(r.skipReason)));
|
|
2765
|
+
const unavailableReason = cause ? `no primary language server answered (${PRIMARY_UNAVAILABLE_CAUSE[cause]})${deniedRunnerIds.length > 0 ? `; ${deniedNote}` : ""}` : deniedRunnerIds.length > 0 ? onlySwitchedOff ? `not checked (${deniedNote})` : `not fully checked (a language tool is missing, timed out, or failed to run; ${deniedNote})` : everyRowStated ? `not checked (${statedCauses.join("; ")})` : `not fully checked (a language tool is missing, timed out, or failed to run${unexplainedCauses.length > 0 ? `; ${unexplainedCauses.join("; ")}` : ""})`;
|
|
2825
2766
|
const verdict = unchecked(unavailableReason);
|
|
2826
2767
|
if (ctx.analysisRootMode === "adopted") {
|
|
2827
2768
|
return { verdict: unchecked(`not analyzed (${unavailableReason})`) };
|
|
@@ -2835,10 +2776,10 @@ function buildCoverageNotice(ctx, runnerLatencies, dedupe) {
|
|
|
2835
2776
|
...deniedRunnerIds.map((id) => `disabled-runner:${id}`)
|
|
2836
2777
|
];
|
|
2837
2778
|
if (dedupe) {
|
|
2838
|
-
if (onceKeys.every((
|
|
2779
|
+
if (onceKeys.every((key) => coverageNoticeSeen.has(key)))
|
|
2839
2780
|
return { verdict };
|
|
2840
|
-
for (const
|
|
2841
|
-
coverageNoticeSeen.add(
|
|
2781
|
+
for (const key of onceKeys)
|
|
2782
|
+
coverageNoticeSeen.add(key);
|
|
2842
2783
|
}
|
|
2843
2784
|
return {
|
|
2844
2785
|
notice: {
|
|
@@ -2861,7 +2802,7 @@ function buildCoverageNotice(ctx, runnerLatencies, dedupe) {
|
|
|
2861
2802
|
return {
|
|
2862
2803
|
notice: {
|
|
2863
2804
|
id: `coverage-unavailable:${ctx.kind}:${path4.basename(ctx.filePath)}`,
|
|
2864
|
-
message: `Pi-lens ${ctx.kind} analysis unavailable \u2014 a language tool is missing, timed out, or failed to run, or the LSP server isn't ready yet, so this file was not fully checked (not a clean result).${deniedRunnerIds.length > 0 ? ` Runner (${deniedRunnerIds.join(", ")}) is also disabled in config by dispatch.disabledRunners.` : ""}`,
|
|
2805
|
+
message: everyRowStated && deniedRunnerIds.length === 0 ? `Pi-lens ${ctx.kind} analysis unavailable \u2014 ${statedCauses.join("; ")}, so this file was not checked (not a clean result).` : `Pi-lens ${ctx.kind} analysis unavailable \u2014 a language tool is missing, timed out, or failed to run, or the LSP server isn't ready yet, so this file was not fully checked (not a clean result).${unexplainedCauses.length > 0 ? ` Stated: ${unexplainedCauses.join("; ")}.` : ""}${deniedRunnerIds.length > 0 ? ` Runner (${deniedRunnerIds.join(", ")}) is also disabled in config by dispatch.disabledRunners.` : ""}`,
|
|
2865
2806
|
filePath: ctx.filePath,
|
|
2866
2807
|
severity: "warning",
|
|
2867
2808
|
semantic: "warning",
|
|
@@ -3034,12 +2975,14 @@ async function runGroup(ctx, group, registry, onRunnerResult) {
|
|
|
3034
2975
|
}
|
|
3035
2976
|
const projectRoot = ctx.projectRoot ?? ctx.cwd;
|
|
3036
2977
|
const runnerCtx = runnerDispatchContext(ctx, runner.id);
|
|
3037
|
-
const observedTier = ctx.writeIndex === void 0 ? "inline" : classifyObservedRunner(projectRoot, runner.id);
|
|
2978
|
+
const observedTier = ctx.writeIndex === void 0 ? "inline" : classifyObservedRunner(projectRoot, runner.id, ctx);
|
|
3038
2979
|
if (observedTier === "collect-later") {
|
|
3039
2980
|
const markedAtMs = Date.now();
|
|
3040
2981
|
const run = async () => {
|
|
3041
2982
|
const startedAtMs = Date.now();
|
|
3042
|
-
const result2 = await runRunner(runnerCtx, runner, semantic
|
|
2983
|
+
const result2 = await runRunner(runnerCtx, runner, semantic, {
|
|
2984
|
+
holdFlightUntilSettled: true
|
|
2985
|
+
});
|
|
3043
2986
|
const durationMs = Date.now() - startedAtMs;
|
|
3044
2987
|
observeRunnerTier({
|
|
3045
2988
|
filePath: ctx.filePath,
|
|
@@ -3111,7 +3054,9 @@ async function runGroup(ctx, group, registry, onRunnerResult) {
|
|
|
3111
3054
|
});
|
|
3112
3055
|
continue;
|
|
3113
3056
|
}
|
|
3114
|
-
const result = await runRunner(runnerCtx, runner, semantic
|
|
3057
|
+
const result = await runRunner(runnerCtx, runner, semantic, {
|
|
3058
|
+
dispatch: ctx
|
|
3059
|
+
});
|
|
3115
3060
|
onRunnerResult?.(runnerId, result);
|
|
3116
3061
|
const runnerEnd = Date.now();
|
|
3117
3062
|
const duration = runnerEnd - runnerStart;
|
|
@@ -3127,6 +3072,12 @@ async function runGroup(ctx, group, registry, onRunnerResult) {
|
|
|
3127
3072
|
}
|
|
3128
3073
|
const skipReason = result.status === "skipped" && isRunnerSkipReason(result.skipReason) ? result.skipReason : void 0;
|
|
3129
3074
|
const claimSource = result.status === "skipped" && isRunnerClaimSource(result.claimSource) ? result.claimSource : void 0;
|
|
3075
|
+
if (skipReason !== void 0 && TOOL_UNUSABLE_SKIP_REASONS.some((reason) => reason === skipReason))
|
|
3076
|
+
recordDegradationOnce({
|
|
3077
|
+
kind: "runner-skip-cause",
|
|
3078
|
+
subject: `${runnerId}:${skipReason}`,
|
|
3079
|
+
reason: `${runnerId} did not run: ${SKIP_REASON_PHRASE[skipReason]}`
|
|
3080
|
+
});
|
|
3130
3081
|
latencies.push({
|
|
3131
3082
|
runnerId,
|
|
3132
3083
|
startTime: runnerStart,
|
|
@@ -3397,14 +3348,14 @@ async function dispatchForFile(ctx, groups, registry, onRunnerResult, options) {
|
|
|
3397
3348
|
provider: ctx.telemetryProvider
|
|
3398
3349
|
};
|
|
3399
3350
|
if (fixedItems.length > 0) {
|
|
3400
|
-
import("./chunk-
|
|
3351
|
+
import("./chunk-SCU62JLX.js").then(({ appendToWorklog }) => {
|
|
3401
3352
|
appendToWorklog(ctx.cwd, fixedItems, true, worklogIdentity);
|
|
3402
3353
|
}).catch(() => {
|
|
3403
3354
|
});
|
|
3404
3355
|
}
|
|
3405
3356
|
const fixableWarnings = warnings.filter((d) => d.fixable);
|
|
3406
3357
|
if (fixableWarnings.length > 0) {
|
|
3407
|
-
import("./chunk-
|
|
3358
|
+
import("./chunk-SCU62JLX.js").then(({ appendToWorklog }) => {
|
|
3408
3359
|
appendToWorklog(ctx.cwd, fixableWarnings, false, worklogIdentity);
|
|
3409
3360
|
}).catch(() => {
|
|
3410
3361
|
});
|
|
@@ -3587,7 +3538,7 @@ function observeRunnerTier(options) {
|
|
|
3587
3538
|
});
|
|
3588
3539
|
}
|
|
3589
3540
|
}
|
|
3590
|
-
async function runRunner(ctx, runner, defaultSemantic) {
|
|
3541
|
+
async function runRunner(ctx, runner, defaultSemantic, options = {}) {
|
|
3591
3542
|
if (isInSpawnTimeoutCooldown(runner.id)) {
|
|
3592
3543
|
recordDegradationOnce({
|
|
3593
3544
|
kind: "runner-spawn-timeout-cooldown",
|
|
@@ -3599,8 +3550,14 @@ async function runRunner(ctx, runner, defaultSemantic) {
|
|
|
3599
3550
|
const timeoutMs = Math.max(runner.timeoutMs ?? RUNNER_TIMEOUT_MS, getRunnerTimeoutFloorMs());
|
|
3600
3551
|
const phaseToken = phaseStarted(runner.id);
|
|
3601
3552
|
try {
|
|
3602
|
-
const
|
|
3553
|
+
const runnerPromise = spawnCooldownScope.run({ tool: runner.id, subject: runner.id, phase: "lint" }, () => runner.run(ctx)).then((value) => ({ value }));
|
|
3554
|
+
if (ctx.writeIndex !== void 0 && !options.holdFlightUntilSettled) {
|
|
3555
|
+
holdFlight(runnerFlightKey(ctx.projectRoot ?? ctx.cwd, runner.id), runnerPromise, options.dispatch);
|
|
3556
|
+
}
|
|
3557
|
+
const outcome = await withBudget(runnerPromise, timeoutMs);
|
|
3603
3558
|
if (outcome === void 0) {
|
|
3559
|
+
if (options.holdFlightUntilSettled)
|
|
3560
|
+
await Promise.allSettled([runnerPromise]);
|
|
3604
3561
|
throw new Error(`Runner ${runner.id} timed out after ${timeoutMs}ms`);
|
|
3605
3562
|
}
|
|
3606
3563
|
const result = outcome.value;
|
|
@@ -4019,8 +3976,8 @@ function cascadeStillPresentSince(filePath, diagnostic, turn) {
|
|
|
4019
3976
|
return first !== void 0 && first.turn < turn ? first.turn : void 0;
|
|
4020
3977
|
}
|
|
4021
3978
|
function recordDeliveredCascadeNeighbor(filePath, diagnostics, turn, checkedAt) {
|
|
4022
|
-
const
|
|
4023
|
-
const previous = pendingNeighbors.get(
|
|
3979
|
+
const key = normalizeMapKey(filePath);
|
|
3980
|
+
const previous = pendingNeighbors.get(key);
|
|
4024
3981
|
const errors = /* @__PURE__ */ new Map();
|
|
4025
3982
|
for (const d of diagnostics) {
|
|
4026
3983
|
const k = cascadeErrorKey(d);
|
|
@@ -4036,10 +3993,10 @@ function recordDeliveredCascadeNeighbor(filePath, diagnostics, turn, checkedAt)
|
|
|
4036
3993
|
}
|
|
4037
3994
|
});
|
|
4038
3995
|
}
|
|
4039
|
-
pendingNeighbors.delete(
|
|
3996
|
+
pendingNeighbors.delete(key);
|
|
4040
3997
|
if (errors.size === 0)
|
|
4041
3998
|
return;
|
|
4042
|
-
if (pendingNeighbors.set(
|
|
3999
|
+
if (pendingNeighbors.set(key, { filePath, errors, checkedAt }).length > 0) {
|
|
4043
4000
|
recordDegradationOnce({
|
|
4044
4001
|
kind: "cascade-pending-neighbors-evicted",
|
|
4045
4002
|
subject: `cap=${MAX_PENDING_NEIGHBORS}`,
|
|
@@ -4048,13 +4005,13 @@ function recordDeliveredCascadeNeighbor(filePath, diagnostics, turn, checkedAt)
|
|
|
4048
4005
|
}
|
|
4049
4006
|
}
|
|
4050
4007
|
function forgetCascadePendingNeighbor(filePath, observedAt) {
|
|
4051
|
-
const
|
|
4052
|
-
const entry = pendingNeighbors.get(
|
|
4008
|
+
const key = normalizeMapKey(filePath);
|
|
4009
|
+
const entry = pendingNeighbors.get(key);
|
|
4053
4010
|
if (!entry)
|
|
4054
4011
|
return;
|
|
4055
4012
|
if (observedAt !== void 0 && observedAt <= entry.checkedAt)
|
|
4056
4013
|
return;
|
|
4057
|
-
pendingNeighbors.delete(
|
|
4014
|
+
pendingNeighbors.delete(key);
|
|
4058
4015
|
}
|
|
4059
4016
|
function listCascadePendingNeighbors() {
|
|
4060
4017
|
return [...pendingNeighbors.values()].map((entry) => ({
|
|
@@ -4101,13 +4058,13 @@ function createDiagnosticTracker() {
|
|
|
4101
4058
|
let totalShown = 0;
|
|
4102
4059
|
let totalAutoFixed = 0;
|
|
4103
4060
|
let totalAgentFixed = 0;
|
|
4104
|
-
const
|
|
4061
|
+
const key = (filePath, ruleId, line) => `${filePath}:${ruleId}:${line}`;
|
|
4105
4062
|
return {
|
|
4106
4063
|
trackShown(diagnostics) {
|
|
4107
4064
|
for (const d of diagnostics) {
|
|
4108
4065
|
const ruleId = d.rule || d.id || "unknown";
|
|
4109
4066
|
const line = d.line || 1;
|
|
4110
|
-
const k =
|
|
4067
|
+
const k = key(d.filePath, ruleId, line);
|
|
4111
4068
|
occurrenceCounts.set(k, (occurrenceCounts.get(k) ?? 0) + 1);
|
|
4112
4069
|
if (!shown.has(k)) {
|
|
4113
4070
|
shown.set(k, {
|
|
@@ -4187,10 +4144,10 @@ var _evictedSinceLastSweep = 0;
|
|
|
4187
4144
|
var MAX_LOGGED_PATHS = 20;
|
|
4188
4145
|
function pruneExpiredOutstandingTouches(now, guard, reads = /* @__PURE__ */ new Map()) {
|
|
4189
4146
|
const expired = [];
|
|
4190
|
-
for (const [
|
|
4147
|
+
for (const [key, touch] of _outstandingTouches) {
|
|
4191
4148
|
if (now - touch.touchedAt <= OUTSTANDING_TOUCH_MAX_AGE_MS)
|
|
4192
4149
|
break;
|
|
4193
|
-
_outstandingTouches.delete(
|
|
4150
|
+
_outstandingTouches.delete(key);
|
|
4194
4151
|
_expiredSinceLastSweep++;
|
|
4195
4152
|
expired.push(touch);
|
|
4196
4153
|
}
|
|
@@ -4297,11 +4254,11 @@ function peekOutstandingCascadeTouches(guard) {
|
|
|
4297
4254
|
return;
|
|
4298
4255
|
let found = 0;
|
|
4299
4256
|
let clean = 0;
|
|
4300
|
-
for (const [
|
|
4257
|
+
for (const [key, touch] of _outstandingTouches) {
|
|
4301
4258
|
const outcome = readTouchedClient(touch, now, reads);
|
|
4302
4259
|
if (!outcome)
|
|
4303
4260
|
continue;
|
|
4304
|
-
_outstandingTouches.delete(
|
|
4261
|
+
_outstandingTouches.delete(key);
|
|
4305
4262
|
if (outcome.outcome === "resolved-found")
|
|
4306
4263
|
found++;
|
|
4307
4264
|
else
|
|
@@ -4370,7 +4327,7 @@ function requirementOf(node, utils, resolving) {
|
|
|
4370
4327
|
const of = (child) => requirementOf(child, utils, resolving);
|
|
4371
4328
|
const parts = [
|
|
4372
4329
|
...ownLiterals(node),
|
|
4373
|
-
...RELATIONAL_KEYS.map((
|
|
4330
|
+
...RELATIONAL_KEYS.map((key) => of(node[key])),
|
|
4374
4331
|
...Array.isArray(node.all) ? node.all.map(of) : [],
|
|
4375
4332
|
Array.isArray(node.any) ? anyOf(node.any.map(of)) : true
|
|
4376
4333
|
];
|
|
@@ -4533,8 +4490,8 @@ function deliveryRouteForRuleLanguage(ruleLanguage) {
|
|
|
4533
4490
|
return "napi";
|
|
4534
4491
|
return LSP_ONLY_RULE_LANGUAGES.has(ruleLanguage) ? "ast-grep-lsp-cli" : "unclassified";
|
|
4535
4492
|
}
|
|
4536
|
-
function skipRouteFor(
|
|
4537
|
-
return
|
|
4493
|
+
function skipRouteFor(key) {
|
|
4494
|
+
return key.startsWith("mismatch:") ? "napi" : deliveryRouteForRuleLanguage(key);
|
|
4538
4495
|
}
|
|
4539
4496
|
var MAX_MATCHES_PER_RULE = 10;
|
|
4540
4497
|
var MAX_TOTAL_DIAGNOSTICS = 50;
|
|
@@ -4800,7 +4757,7 @@ function evaluateAstGrepRules(filePath, rootNode, cwd, kind, options = {}) {
|
|
|
4800
4757
|
const log = options.log;
|
|
4801
4758
|
const unsupportedLanguageLog = options.unsupportedLanguageLog ?? defaultUnsupportedLanguageLog;
|
|
4802
4759
|
const diagnostics = [];
|
|
4803
|
-
const suppressLinterOverlap = kind === "jsts" &&
|
|
4760
|
+
const suppressLinterOverlap = kind === "jsts" && hasToolConfig("eslint", cwd);
|
|
4804
4761
|
const fileLang = ruleLanguageForFile(filePath);
|
|
4805
4762
|
const htmlCollection = fileLang === "html" && options.content !== void 0 && options.sgModule !== void 0 ? collectHtmlScriptInjections(rootNode, options.sgModule) : {
|
|
4806
4763
|
injections: [],
|
|
@@ -4901,11 +4858,11 @@ function evaluateAstGrepRules(filePath, rootNode, cwd, kind, options = {}) {
|
|
|
4901
4858
|
if (lang && fileLang && lang !== fileLang) {
|
|
4902
4859
|
const runsAsTsOnTsx = fileLang === "tsx" && lang === "typescript";
|
|
4903
4860
|
if (!runsAsTsOnTsx && !runsInsideHtmlScript) {
|
|
4904
|
-
const
|
|
4905
|
-
if (!unsupportedLanguageLog.has(
|
|
4906
|
-
const ids = newlyUnsupported.get(
|
|
4861
|
+
const key = `mismatch:${lang}->${fileLang}`;
|
|
4862
|
+
if (!unsupportedLanguageLog.has(key)) {
|
|
4863
|
+
const ids = newlyUnsupported.get(key) ?? [];
|
|
4907
4864
|
ids.push(rule.id);
|
|
4908
|
-
newlyUnsupported.set(
|
|
4865
|
+
newlyUnsupported.set(key, ids);
|
|
4909
4866
|
}
|
|
4910
4867
|
continue;
|
|
4911
4868
|
}
|
|
@@ -5185,18 +5142,18 @@ function recordEntitySnapshotDiff(facts, filePath, nextSnapshot) {
|
|
|
5185
5142
|
const added = [];
|
|
5186
5143
|
const removed = [];
|
|
5187
5144
|
const modified = [];
|
|
5188
|
-
for (const [
|
|
5189
|
-
if (!prev.has(
|
|
5190
|
-
added.push(
|
|
5191
|
-
else if (prev.get(
|
|
5192
|
-
modified.push(
|
|
5145
|
+
for (const [key, value] of nextSnapshot.entries()) {
|
|
5146
|
+
if (!prev.has(key))
|
|
5147
|
+
added.push(key);
|
|
5148
|
+
else if (prev.get(key) !== value)
|
|
5149
|
+
modified.push(key);
|
|
5193
5150
|
}
|
|
5194
|
-
for (const
|
|
5195
|
-
if (!nextSnapshot.has(
|
|
5196
|
-
removed.push(
|
|
5151
|
+
for (const key of prev.keys()) {
|
|
5152
|
+
if (!nextSnapshot.has(key))
|
|
5153
|
+
removed.push(key);
|
|
5197
5154
|
}
|
|
5198
5155
|
const changedSymbols = [
|
|
5199
|
-
...new Set([...added, ...modified, ...removed].map((
|
|
5156
|
+
...new Set([...added, ...modified, ...removed].map((key) => key.split(":")[1]).filter(Boolean))
|
|
5200
5157
|
];
|
|
5201
5158
|
facts.setBoundedSessionFact(snapshotKey, new Map(nextSnapshot));
|
|
5202
5159
|
facts.setBoundedSessionFact(changedSymbolsKey, changedSymbols);
|
|
@@ -5209,8 +5166,8 @@ function scheduleProviders(providers2) {
|
|
|
5209
5166
|
return providers2.slice();
|
|
5210
5167
|
const factToProvider = /* @__PURE__ */ new Map();
|
|
5211
5168
|
for (const p of providers2) {
|
|
5212
|
-
for (const
|
|
5213
|
-
factToProvider.set(
|
|
5169
|
+
for (const key of p.provides) {
|
|
5170
|
+
factToProvider.set(key, p);
|
|
5214
5171
|
}
|
|
5215
5172
|
}
|
|
5216
5173
|
const inDegree = /* @__PURE__ */ new Map();
|
|
@@ -5266,7 +5223,7 @@ async function runProviders(ctx) {
|
|
|
5266
5223
|
const applicable = providers.filter((p) => p.appliesTo(ctx));
|
|
5267
5224
|
const ordered = scheduleProviders(applicable);
|
|
5268
5225
|
for (const provider of ordered) {
|
|
5269
|
-
const allPresent = provider.provides.every((
|
|
5226
|
+
const allPresent = provider.provides.every((key) => ctx.facts.hasFileFact(ctx.filePath, key));
|
|
5270
5227
|
if (allPresent)
|
|
5271
5228
|
continue;
|
|
5272
5229
|
await provider.run(ctx, ctx.facts);
|
|
@@ -5458,7 +5415,7 @@ var actionlintRunner = {
|
|
|
5458
5415
|
let cmd = null;
|
|
5459
5416
|
cmd = await resolveToolCommandWithInstallFallback(cwd, "actionlint");
|
|
5460
5417
|
if (!cmd)
|
|
5461
|
-
return
|
|
5418
|
+
return toolAbsentSkip(cwd, { id: "actionlint" });
|
|
5462
5419
|
const relativeFilePath = path7.relative(cwd, ctx.filePath) || ctx.filePath;
|
|
5463
5420
|
const result = await safeSpawnAsync(cmd, ["-format", "{{json .}}", relativeFilePath], {
|
|
5464
5421
|
cwd,
|
|
@@ -5626,7 +5583,7 @@ var biomeCheckJsonRunner = {
|
|
|
5626
5583
|
}
|
|
5627
5584
|
const cmd = await resolveToolCommandWithInstallFallback(cwd, "biome");
|
|
5628
5585
|
if (!cmd) {
|
|
5629
|
-
return
|
|
5586
|
+
return toolAbsentSkip(cwd, { id: "biome" });
|
|
5630
5587
|
}
|
|
5631
5588
|
const configArg = biomeConfigArgs(cwd);
|
|
5632
5589
|
const checkResult = await safeSpawnAsync(cmd, [
|
|
@@ -5833,7 +5790,7 @@ var cppCheckRunner = {
|
|
|
5833
5790
|
const absPath = path9.resolve(cwd, ctx.filePath);
|
|
5834
5791
|
const compiler = await resolveCompiler(absPath, cwd);
|
|
5835
5792
|
if (!compiler) {
|
|
5836
|
-
return
|
|
5793
|
+
return toolAbsentSkip(cwd);
|
|
5837
5794
|
}
|
|
5838
5795
|
const result = await safeSpawnAsync(compiler.command, compiler.args, {
|
|
5839
5796
|
cwd,
|
|
@@ -5899,10 +5856,10 @@ var credoRunner = {
|
|
|
5899
5856
|
async run(ctx) {
|
|
5900
5857
|
const cwd = resolveRunnerCwd(ctx, "credo");
|
|
5901
5858
|
if (!credoRunner.requiresConfig?.(cwd)) {
|
|
5902
|
-
return
|
|
5859
|
+
return skipped("not-configured");
|
|
5903
5860
|
}
|
|
5904
5861
|
if (!await probeCredo(cwd)) {
|
|
5905
|
-
return
|
|
5862
|
+
return toolAbsentSkip(cwd, { checker: probeCredo });
|
|
5906
5863
|
}
|
|
5907
5864
|
const absPath = path10.resolve(cwd, ctx.filePath);
|
|
5908
5865
|
const result = await safeSpawnAsync("mix", ["credo", "--format", "json", "--strict", absPath], { timeout: 3e4, cwd });
|
|
@@ -6022,7 +5979,7 @@ var cueVetRunner = {
|
|
|
6022
5979
|
cmd = await resolveAvailableOrInstall(cue, "cue", cwd);
|
|
6023
5980
|
}
|
|
6024
5981
|
if (!cmd)
|
|
6025
|
-
return {
|
|
5982
|
+
return toolAbsentSkip(cwd, { id: "cue", checker: cue });
|
|
6026
5983
|
const absPath = path11.resolve(cwd, ctx.filePath);
|
|
6027
5984
|
const fileDir = path11.dirname(absPath);
|
|
6028
5985
|
const fileName = path11.basename(absPath);
|
|
@@ -6218,7 +6175,7 @@ var dartAnalyzeRunner = {
|
|
|
6218
6175
|
const dartAvailable = await dart.isAvailableAsync(cwd);
|
|
6219
6176
|
const flutterAvailable = !dartAvailable && await flutter.isAvailableAsync(cwd);
|
|
6220
6177
|
if (!dartAvailable && !flutterAvailable) {
|
|
6221
|
-
return
|
|
6178
|
+
return toolAbsentSkip(cwd, { checker: dart });
|
|
6222
6179
|
}
|
|
6223
6180
|
const cmd = dartAvailable ? dart.getCommand(cwd) : flutter.getCommand(cwd);
|
|
6224
6181
|
const args = dartAvailable ? ["analyze", "--format=machine", absPath] : ["analyze", "--machine", absPath];
|
|
@@ -6247,7 +6204,6 @@ var dart_analyze_default = dartAnalyzeRunner;
|
|
|
6247
6204
|
|
|
6248
6205
|
// dist/clients/dispatch/runners/detekt.js
|
|
6249
6206
|
import * as path13 from "node:path";
|
|
6250
|
-
var detekt = createAvailabilityChecker("detekt", ".bat");
|
|
6251
6207
|
var DETEKT_FIXABLE_RULES = /* @__PURE__ */ new Set([
|
|
6252
6208
|
// formatting (ktlint wrapper) — every rule supports autocorrect
|
|
6253
6209
|
"AnnotationOnSeparateLine",
|
|
@@ -6355,15 +6311,15 @@ var detektRunner = {
|
|
|
6355
6311
|
const cwd = resolveRunnerCwd(ctx, "detekt");
|
|
6356
6312
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
6357
6313
|
if (policy && !policy.preferredRunners.includes("detekt")) {
|
|
6358
|
-
return
|
|
6314
|
+
return skipped("not-preferred");
|
|
6359
6315
|
}
|
|
6360
6316
|
const configPath = findToolConfig("detekt", cwd)?.file;
|
|
6361
6317
|
if (!configPath) {
|
|
6362
|
-
return
|
|
6318
|
+
return skipped("not-configured");
|
|
6363
6319
|
}
|
|
6364
|
-
const cmd = await
|
|
6320
|
+
const cmd = await resolveToolCommandWithInstallFallback(cwd, "detekt");
|
|
6365
6321
|
if (!cmd)
|
|
6366
|
-
return
|
|
6322
|
+
return toolAbsentSkip(cwd, { id: "detekt" });
|
|
6367
6323
|
const absPath = path13.resolve(cwd, ctx.filePath);
|
|
6368
6324
|
const result = await safeSpawnAsync(cmd, ["--input", absPath, "--config", configPath], { cwd, timeout: 6e4 });
|
|
6369
6325
|
const raw = `${result.stdout ?? ""}${result.stderr ?? ""}`;
|
|
@@ -6520,11 +6476,11 @@ var dotnetBuildRunner = {
|
|
|
6520
6476
|
async run(ctx) {
|
|
6521
6477
|
const cwd = resolveRunnerCwd(ctx, "dotnet-build");
|
|
6522
6478
|
if (!await dotnet.isAvailableAsync(cwd)) {
|
|
6523
|
-
return
|
|
6479
|
+
return toolAbsentSkip(cwd, { checker: dotnet });
|
|
6524
6480
|
}
|
|
6525
6481
|
const cmd = dotnet.getCommand(cwd);
|
|
6526
6482
|
if (!cmd) {
|
|
6527
|
-
return
|
|
6483
|
+
return toolAbsentSkip(cwd, { checker: dotnet });
|
|
6528
6484
|
}
|
|
6529
6485
|
const target = findProjectTarget(cwd);
|
|
6530
6486
|
if (!target) {
|
|
@@ -6659,7 +6615,8 @@ var elixirCheckRunner = {
|
|
|
6659
6615
|
const absPath = path15.resolve(cwd, ctx.filePath);
|
|
6660
6616
|
let command;
|
|
6661
6617
|
let args = [];
|
|
6662
|
-
|
|
6618
|
+
const mixProject = hasToolConfig("mix", cwd);
|
|
6619
|
+
if (mixProject && await mix.isAvailableAsync(cwd)) {
|
|
6663
6620
|
command = "mix";
|
|
6664
6621
|
args = ["compile", "--warnings-as-errors"];
|
|
6665
6622
|
} else if (await elixirc.isAvailableAsync(cwd)) {
|
|
@@ -6669,7 +6626,7 @@ var elixirCheckRunner = {
|
|
|
6669
6626
|
args = ["-o", outDir, absPath];
|
|
6670
6627
|
}
|
|
6671
6628
|
if (!command) {
|
|
6672
|
-
return {
|
|
6629
|
+
return toolAbsentSkip(cwd, { checker: mixProject ? mix : elixirc });
|
|
6673
6630
|
}
|
|
6674
6631
|
const result = await safeSpawnAsync(command, args, {
|
|
6675
6632
|
cwd,
|
|
@@ -6769,15 +6726,18 @@ var eslintRunner = {
|
|
|
6769
6726
|
id: "eslint",
|
|
6770
6727
|
appliesTo: ["jsts"],
|
|
6771
6728
|
priority: PRIORITY.LINT_SECONDARY,
|
|
6772
|
-
requiresConfig: (cwd) =>
|
|
6729
|
+
requiresConfig: (cwd) => hasToolConfig("eslint", cwd),
|
|
6773
6730
|
async run(ctx) {
|
|
6774
|
-
const
|
|
6731
|
+
const resolution = resolveRunnerCwdWithReason(ctx, "eslint");
|
|
6732
|
+
const cwd = resolution.cwd;
|
|
6733
|
+
const packageDir = resolution.packageDir ?? cwd;
|
|
6775
6734
|
if (!eslintRunner.requiresConfig?.(cwd)) {
|
|
6776
|
-
return
|
|
6735
|
+
return skipped("not-configured");
|
|
6777
6736
|
}
|
|
6778
|
-
const cmd = resolveToolCommand(
|
|
6779
|
-
|
|
6780
|
-
|
|
6737
|
+
const cmd = resolveToolCommand(packageDir, "eslint") ?? "eslint";
|
|
6738
|
+
const eslintProbe = getEslintProbe(cmd);
|
|
6739
|
+
if (!await eslintProbe(packageDir)) {
|
|
6740
|
+
return toolAbsentSkip(packageDir, { checker: eslintProbe });
|
|
6781
6741
|
}
|
|
6782
6742
|
const result = await safeSpawnAsync(cmd, ["--format", "json", "--no-error-on-unmatched-pattern", ctx.filePath], { timeout: 3e4, cwd });
|
|
6783
6743
|
const parsed = parseToolRun("eslint", {
|
|
@@ -6893,7 +6853,7 @@ var gleamCheckRunner = {
|
|
|
6893
6853
|
async run(ctx) {
|
|
6894
6854
|
const cwd = resolveRunnerCwd(ctx, "gleam-check");
|
|
6895
6855
|
if (!await gleam.isAvailableAsync(cwd)) {
|
|
6896
|
-
return
|
|
6856
|
+
return toolAbsentSkip(cwd, { checker: gleam });
|
|
6897
6857
|
}
|
|
6898
6858
|
const cmd = gleam.getCommand(cwd);
|
|
6899
6859
|
const result = await safeSpawnAsync(cmd, ["check"], {
|
|
@@ -7006,7 +6966,7 @@ var goVetRunner = {
|
|
|
7006
6966
|
async run(ctx) {
|
|
7007
6967
|
const goExe = await goClient.findGoPathAsync();
|
|
7008
6968
|
if (!goExe) {
|
|
7009
|
-
return
|
|
6969
|
+
return toolAbsentSkip(ctx.cwd);
|
|
7010
6970
|
}
|
|
7011
6971
|
const cwd = resolveRunnerCwd(ctx, "go-vet");
|
|
7012
6972
|
const fileRel = relativeInside(cwd, ctx.filePath);
|
|
@@ -7022,12 +6982,12 @@ var goVetRunner = {
|
|
|
7022
6982
|
});
|
|
7023
6983
|
const raw = stripAnsi(result.stdout + result.stderr);
|
|
7024
6984
|
const parsableLines = raw.split("\n").filter((line) => /^.+?:\d+:\d+:/.test(line)).join("\n");
|
|
7025
|
-
const
|
|
6985
|
+
const skipped2 = skipUnlessToolRan("go-vet", {
|
|
7026
6986
|
result,
|
|
7027
6987
|
output: parsableLines
|
|
7028
6988
|
});
|
|
7029
|
-
if (
|
|
7030
|
-
return
|
|
6989
|
+
if (skipped2)
|
|
6990
|
+
return skipped2;
|
|
7031
6991
|
if (result.status === 0 && !raw.trim()) {
|
|
7032
6992
|
return { status: "succeeded", diagnostics: [], semantic: "none" };
|
|
7033
6993
|
}
|
|
@@ -7044,7 +7004,6 @@ var go_vet_default = goVetRunner;
|
|
|
7044
7004
|
|
|
7045
7005
|
// dist/clients/dispatch/runners/golangci-lint.js
|
|
7046
7006
|
import * as path19 from "node:path";
|
|
7047
|
-
var golangci = createAvailabilityChecker("golangci-lint", ".exe");
|
|
7048
7007
|
var OTHER_OUTPUT_FORMATS = [
|
|
7049
7008
|
"text",
|
|
7050
7009
|
"tab",
|
|
@@ -7103,19 +7062,19 @@ var golangciRunner = {
|
|
|
7103
7062
|
appliesTo: ["go"],
|
|
7104
7063
|
priority: PRIORITY.GENERAL_ANALYSIS,
|
|
7105
7064
|
timeoutMs: 9e4,
|
|
7106
|
-
requiresConfig: (cwd) =>
|
|
7065
|
+
requiresConfig: (cwd) => hasToolConfig("golangci-lint", cwd),
|
|
7107
7066
|
async run(ctx) {
|
|
7108
7067
|
const cwd = resolveRunnerCwd(ctx, "golangci-lint");
|
|
7109
7068
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
7110
7069
|
if (policy && !policy.preferredRunners.includes("golangci-lint")) {
|
|
7111
|
-
return
|
|
7070
|
+
return skipped("not-preferred");
|
|
7112
7071
|
}
|
|
7113
7072
|
if (!golangciRunner.requiresConfig?.(cwd)) {
|
|
7114
|
-
return
|
|
7073
|
+
return skipped("not-configured");
|
|
7115
7074
|
}
|
|
7116
|
-
const cmd = await
|
|
7075
|
+
const cmd = await resolveToolCommandWithInstallFallback(cwd, "golangci-lint");
|
|
7117
7076
|
if (!cmd)
|
|
7118
|
-
return
|
|
7077
|
+
return toolAbsentSkip(cwd, { id: "golangci-lint" });
|
|
7119
7078
|
const result = await safeSpawnAsync(cmd, [
|
|
7120
7079
|
"run",
|
|
7121
7080
|
"--fix=false",
|
|
@@ -7181,11 +7140,11 @@ var hadolintRunner = {
|
|
|
7181
7140
|
const cwd = resolveRunnerCwd(ctx, "hadolint");
|
|
7182
7141
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
7183
7142
|
if (policy && !policy.preferredRunners.includes("hadolint")) {
|
|
7184
|
-
return
|
|
7143
|
+
return skipped("not-preferred");
|
|
7185
7144
|
}
|
|
7186
7145
|
const cmd = await resolveToolCommandWithInstallFallback(cwd, "hadolint");
|
|
7187
7146
|
if (!cmd) {
|
|
7188
|
-
return
|
|
7147
|
+
return toolAbsentSkip(cwd, { id: "hadolint" });
|
|
7189
7148
|
}
|
|
7190
7149
|
const result = await safeSpawnAsync(cmd, ["--format", "json", "--no-fail", path20.resolve(cwd, ctx.filePath)], { cwd });
|
|
7191
7150
|
const run = parseToolRun("hadolint", {
|
|
@@ -7215,7 +7174,6 @@ var hadolint_default = hadolintRunner;
|
|
|
7215
7174
|
|
|
7216
7175
|
// dist/clients/dispatch/runners/helm-lint.js
|
|
7217
7176
|
import * as path21 from "node:path";
|
|
7218
|
-
var helm = createAvailabilityChecker("helm", ".exe", ["version", "--short"]);
|
|
7219
7177
|
var inFlightByChartRoot = new PathKeyedMap(normalizeMapKey);
|
|
7220
7178
|
var HELM_LINT_TIMEOUT_MS = 3e4;
|
|
7221
7179
|
var MAX_HELM_LINT_OUTPUT_BYTES = 8 * 1024 * 1024;
|
|
@@ -7279,9 +7237,9 @@ function failedResult(kind, message) {
|
|
|
7279
7237
|
};
|
|
7280
7238
|
}
|
|
7281
7239
|
async function lintChart(chartRoot, cwd) {
|
|
7282
|
-
const cmd = await
|
|
7240
|
+
const cmd = await resolveToolCommandWithInstallFallback(cwd, "helm");
|
|
7283
7241
|
if (!cmd) {
|
|
7284
|
-
const outcome = helm
|
|
7242
|
+
const outcome = toolBinaryVerdict("helm", cwd).outcome;
|
|
7285
7243
|
return {
|
|
7286
7244
|
status: "failed",
|
|
7287
7245
|
diagnostics: [],
|
|
@@ -7355,8 +7313,6 @@ var helm_lint_default = helmLintRunner;
|
|
|
7355
7313
|
// dist/clients/dispatch/runners/helm-render.js
|
|
7356
7314
|
import * as fs9 from "node:fs";
|
|
7357
7315
|
import * as path22 from "node:path";
|
|
7358
|
-
var helm2 = createAvailabilityChecker("helm", ".exe", ["version", "--short"]);
|
|
7359
|
-
var trivy = createAvailabilityChecker("trivy", ".exe");
|
|
7360
7316
|
var inFlightByChartRoot2 = new PathKeyedMap(normalizeMapKey);
|
|
7361
7317
|
var RENDER_TIMEOUT_MS = 3e4;
|
|
7362
7318
|
var TRIVY_TIMEOUT_MS = 45e3;
|
|
@@ -7571,7 +7527,7 @@ function parseRenderedTrivyOutput(raw, locate) {
|
|
|
7571
7527
|
return { understood: true, diagnostics };
|
|
7572
7528
|
}
|
|
7573
7529
|
function helmUnavailableResult(cwd) {
|
|
7574
|
-
const verdict =
|
|
7530
|
+
const verdict = toolBinaryVerdict("helm", cwd);
|
|
7575
7531
|
return {
|
|
7576
7532
|
status: "failed",
|
|
7577
7533
|
diagnostics: [],
|
|
@@ -7714,9 +7670,9 @@ function coverageGap(chartRoot, rule, message) {
|
|
|
7714
7670
|
}
|
|
7715
7671
|
async function runIacPass(options) {
|
|
7716
7672
|
const { chartRoot, cwd, outputDir } = options;
|
|
7717
|
-
const trivyCmd = await
|
|
7673
|
+
const trivyCmd = await resolveToolCommandWithInstallFallback(cwd, "trivy");
|
|
7718
7674
|
if (!trivyCmd) {
|
|
7719
|
-
const verdict = trivy
|
|
7675
|
+
const verdict = toolBinaryVerdict("trivy", cwd);
|
|
7720
7676
|
return [
|
|
7721
7677
|
coverageGap(chartRoot, "iac-pass-unavailable", `Rendered-manifest IaC checks did not run: ${describeUnavailability({
|
|
7722
7678
|
tool: "trivy",
|
|
@@ -7813,7 +7769,7 @@ function discardScratchDir(outputDir, filePath, remove = (target) => fs9.rmSync(
|
|
|
7813
7769
|
}
|
|
7814
7770
|
async function renderAndValidate(chartRoot, cwd, filePath) {
|
|
7815
7771
|
const startedAt = Date.now();
|
|
7816
|
-
const helmCmd = await
|
|
7772
|
+
const helmCmd = await resolveToolCommandWithInstallFallback(cwd, "helm");
|
|
7817
7773
|
if (!helmCmd)
|
|
7818
7774
|
return helmUnavailableResult(cwd);
|
|
7819
7775
|
const outputDir = fs9.mkdtempSync(path22.join(scannerReportParentDir(), "pi-lens-helm-render-"));
|
|
@@ -7997,11 +7953,11 @@ var htmlhintRunner = {
|
|
|
7997
7953
|
const cwd = resolveRunnerCwd(ctx, "htmlhint");
|
|
7998
7954
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
7999
7955
|
if (policy && !policy.preferredRunners.includes("htmlhint")) {
|
|
8000
|
-
return
|
|
7956
|
+
return skipped("not-preferred");
|
|
8001
7957
|
}
|
|
8002
7958
|
const cmd = await resolveToolCommandWithInstallFallback(cwd, "htmlhint");
|
|
8003
7959
|
if (!cmd) {
|
|
8004
|
-
return
|
|
7960
|
+
return toolAbsentSkip(cwd, { id: "htmlhint" });
|
|
8005
7961
|
}
|
|
8006
7962
|
const rulesArg = Object.entries(HTMLHINT_RULES).flatMap(([rule, enabled]) => enabled === true ? [rule] : []).join(",");
|
|
8007
7963
|
const result = await safeSpawnAsync(cmd, [
|
|
@@ -8079,16 +8035,18 @@ var javacRunner = {
|
|
|
8079
8035
|
async run(ctx) {
|
|
8080
8036
|
const cwd = resolveRunnerCwd(ctx, "javac");
|
|
8081
8037
|
const absPath = path24.resolve(cwd, ctx.filePath);
|
|
8082
|
-
if (
|
|
8038
|
+
if (hasToolConfig("javaBuild", path24.dirname(absPath), {
|
|
8039
|
+
ceiling: ctx.projectRoot ?? ctx.cwd
|
|
8040
|
+
})) {
|
|
8083
8041
|
ctx.log?.("javac: skipped \u2014 file is inside a Maven/Gradle project; a classpath-less compile would emit false positives");
|
|
8084
8042
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
8085
8043
|
}
|
|
8086
8044
|
if (!await javac.isAvailableAsync(cwd)) {
|
|
8087
|
-
return
|
|
8045
|
+
return toolAbsentSkip(cwd, { checker: javac });
|
|
8088
8046
|
}
|
|
8089
8047
|
const cmd = javac.getCommand(cwd);
|
|
8090
8048
|
if (!cmd) {
|
|
8091
|
-
return
|
|
8049
|
+
return toolAbsentSkip(cwd, { checker: javac });
|
|
8092
8050
|
}
|
|
8093
8051
|
const result = await safeSpawnAsync(cmd, ["-Xlint:none", "-proc:none", absPath], {
|
|
8094
8052
|
cwd,
|
|
@@ -8193,11 +8151,11 @@ var ktlintRunner = {
|
|
|
8193
8151
|
const cwd = resolveRunnerCwd(ctx, "ktlint");
|
|
8194
8152
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
8195
8153
|
if (policy && !policy.preferredRunners.includes("ktlint")) {
|
|
8196
|
-
return
|
|
8154
|
+
return skipped("not-preferred");
|
|
8197
8155
|
}
|
|
8198
8156
|
const cmd = await resolveToolCommandWithInstallFallback(cwd, "ktlint");
|
|
8199
8157
|
if (!cmd)
|
|
8200
|
-
return
|
|
8158
|
+
return toolAbsentSkip(cwd, { id: "ktlint" });
|
|
8201
8159
|
const absPath = path25.resolve(cwd, ctx.filePath);
|
|
8202
8160
|
const result = await safeSpawnAsync(cmd, ["--reporter=json", absPath], {
|
|
8203
8161
|
cwd,
|
|
@@ -8230,7 +8188,7 @@ var LSP_RUNNER_TIMEOUT_MS = Math.max(LSP_SPAWN_BUDGET_MS, ...LSP_SERVERS.map((se
|
|
|
8230
8188
|
function normalizeActionTitle(title) {
|
|
8231
8189
|
return title.replace(/\s+/g, " ").trim();
|
|
8232
8190
|
}
|
|
8233
|
-
function buildCodeActionSuggestion(actions) {
|
|
8191
|
+
function buildCodeActionSuggestion(actions = []) {
|
|
8234
8192
|
if (!actions.length)
|
|
8235
8193
|
return void 0;
|
|
8236
8194
|
const quickFixes = actions.filter((action) => action.kind?.startsWith("quickfix"));
|
|
@@ -8649,20 +8607,26 @@ var markdownlintRunner = {
|
|
|
8649
8607
|
const cwd = resolveRunnerCwd(ctx, "markdownlint");
|
|
8650
8608
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
8651
8609
|
if (policy && !policy.preferredRunners.includes("markdownlint")) {
|
|
8652
|
-
return
|
|
8610
|
+
return skipped("not-preferred");
|
|
8653
8611
|
}
|
|
8654
8612
|
const cmd = await resolveToolCommandWithInstallFallback(cwd, "markdownlint");
|
|
8655
8613
|
if (!cmd)
|
|
8656
|
-
return
|
|
8614
|
+
return toolAbsentSkip(cwd, { id: "markdownlint" });
|
|
8657
8615
|
const configArgs = markdownlintConfigArgs(cwd);
|
|
8658
|
-
const args = [...configArgs, ctx.filePath];
|
|
8616
|
+
const args = [...configArgs, optionSafeTargetArg(cwd, ctx.filePath)];
|
|
8659
8617
|
const invocation = markdownlintNoFixInvocation({ command: cmd, cwd, args });
|
|
8660
8618
|
const result = await safeSpawnAsync(invocation.command, invocation.args, {
|
|
8661
8619
|
timeout: 15e3,
|
|
8662
8620
|
cwd
|
|
8663
8621
|
});
|
|
8664
8622
|
const raw = `${result.stdout ?? ""}${result.stderr ?? ""}`;
|
|
8665
|
-
const run = parseToolRun(
|
|
8623
|
+
const run = parseToolRun(
|
|
8624
|
+
"markdownlint",
|
|
8625
|
+
{ result, output: raw, exitCodes: MARKDOWNLINT_EXIT_CODES },
|
|
8626
|
+
// ADR 0009: the finding is attributed to the dispatched path; the parser
|
|
8627
|
+
// resolves the tool's project-relative report against the spawn cwd.
|
|
8628
|
+
(out) => parseMarkdownlintOutput(out, ctx.filePath, cwd)
|
|
8629
|
+
);
|
|
8666
8630
|
if (run.skipped)
|
|
8667
8631
|
return run.skipped;
|
|
8668
8632
|
const diagnostics = run.diagnostics;
|
|
@@ -8712,15 +8676,15 @@ var mypyRunner = {
|
|
|
8712
8676
|
appliesTo: ["python"],
|
|
8713
8677
|
priority: PRIORITY.GENERAL_ANALYSIS,
|
|
8714
8678
|
skipTestFiles: false,
|
|
8715
|
-
requiresConfig: (cwd) =>
|
|
8679
|
+
requiresConfig: (cwd) => hasToolConfig("mypy", cwd),
|
|
8716
8680
|
async run(ctx) {
|
|
8717
8681
|
const cwd = resolveRunnerCwd(ctx, "mypy");
|
|
8718
8682
|
if (!mypyRunner.requiresConfig?.(cwd)) {
|
|
8719
|
-
return
|
|
8683
|
+
return skipped("not-configured");
|
|
8720
8684
|
}
|
|
8721
8685
|
const cmd = await resolveToolCommandWithInstallFallback(cwd, "mypy");
|
|
8722
8686
|
if (!cmd)
|
|
8723
|
-
return
|
|
8687
|
+
return toolAbsentSkip(cwd, { id: "mypy" });
|
|
8724
8688
|
const result = await safeSpawnAsync(cmd, ["--no-error-summary", "--show-column-numbers", ctx.filePath], { timeout: 3e4, cwd });
|
|
8725
8689
|
const raw = `${result.stdout ?? ""}${result.stderr ?? ""}`;
|
|
8726
8690
|
const run = parseToolRun("mypy", { result, output: result.stdout, exitCodes: MYPY_EXIT_CODES }, (out) => parseMypyOutput(out, ctx.filePath, cwd), { parseOutput: raw });
|
|
@@ -8753,8 +8717,8 @@ var OXLINT_NO_FILES_REPORT_KEYS = /* @__PURE__ */ new Set([
|
|
|
8753
8717
|
function resolveLocalVp(cwd) {
|
|
8754
8718
|
return localBinPath(findLocalBinUpwards("vp", cwd)) ?? null;
|
|
8755
8719
|
}
|
|
8756
|
-
async function resolveVitePlusCommand(cwd) {
|
|
8757
|
-
const local = resolveLocalVp(
|
|
8720
|
+
async function resolveVitePlusCommand(packageDir, cwd) {
|
|
8721
|
+
const local = resolveLocalVp(packageDir);
|
|
8758
8722
|
if (local)
|
|
8759
8723
|
return local;
|
|
8760
8724
|
const version = await safeSpawnAsync("vp", ["--version"], {
|
|
@@ -8769,24 +8733,27 @@ var oxlintRunner = {
|
|
|
8769
8733
|
priority: PRIORITY.LINT_SECONDARY,
|
|
8770
8734
|
skipTestFiles: false,
|
|
8771
8735
|
async run(ctx) {
|
|
8772
|
-
const
|
|
8773
|
-
const
|
|
8736
|
+
const resolution = resolveRunnerCwdWithReason(ctx, "oxlint");
|
|
8737
|
+
const cwd = resolution.cwd;
|
|
8738
|
+
const packageDir = resolution.packageDir ?? cwd;
|
|
8739
|
+
const policy = getJstsLintPolicyForCwd(packageDir);
|
|
8774
8740
|
if (!policy.preferredRunners.includes("oxlint")) {
|
|
8775
|
-
return
|
|
8741
|
+
return skipped("not-preferred");
|
|
8776
8742
|
}
|
|
8777
8743
|
let cmd = null;
|
|
8778
8744
|
let args;
|
|
8779
|
-
if (
|
|
8780
|
-
cmd = await resolveVitePlusCommand(cwd);
|
|
8745
|
+
if (hasToolConfig("vitePlus", packageDir)) {
|
|
8746
|
+
cmd = await resolveVitePlusCommand(packageDir, cwd);
|
|
8781
8747
|
}
|
|
8748
|
+
const target = optionSafeTargetArg(cwd, ctx.filePath);
|
|
8782
8749
|
if (cmd) {
|
|
8783
|
-
args = ["lint", "--format", "json",
|
|
8750
|
+
args = ["lint", "--format", "json", target];
|
|
8784
8751
|
} else {
|
|
8785
|
-
cmd = await resolveToolCommandWithInstallFallback(
|
|
8786
|
-
args = ["--format", "json",
|
|
8752
|
+
cmd = await resolveToolCommandWithInstallFallback(packageDir, "oxlint");
|
|
8753
|
+
args = ["--format", "json", target];
|
|
8787
8754
|
}
|
|
8788
8755
|
if (!cmd) {
|
|
8789
|
-
return
|
|
8756
|
+
return toolAbsentSkip(packageDir, { id: "oxlint" });
|
|
8790
8757
|
}
|
|
8791
8758
|
const result = await safeSpawnAsync(cmd, args, {
|
|
8792
8759
|
cwd,
|
|
@@ -8927,10 +8894,10 @@ function decideOxlintNoFiles(result, stdout, stderr) {
|
|
|
8927
8894
|
return { kind: "unconfirmed-no-files", reason: "json-malformed" };
|
|
8928
8895
|
}
|
|
8929
8896
|
const keys = Object.keys(report);
|
|
8930
|
-
if (keys.some((
|
|
8897
|
+
if (keys.some((key) => !OXLINT_NO_FILES_REPORT_KEYS.has(key))) {
|
|
8931
8898
|
return { kind: "unconfirmed-no-files", reason: "json-unknown-key" };
|
|
8932
8899
|
}
|
|
8933
|
-
if (OXLINT_NO_FILES_REPORT_KEYS.size !== keys.length || [...OXLINT_NO_FILES_REPORT_KEYS].some((
|
|
8900
|
+
if (OXLINT_NO_FILES_REPORT_KEYS.size !== keys.length || [...OXLINT_NO_FILES_REPORT_KEYS].some((key) => !Object.prototype.hasOwnProperty.call(report, key))) {
|
|
8934
8901
|
return { kind: "unconfirmed-no-files", reason: "json-missing-key" };
|
|
8935
8902
|
}
|
|
8936
8903
|
if (!Array.isArray(report.diagnostics) || !isNonnegativeInteger(report.number_of_files) || !isNonnegativeInteger(report.number_of_rules) || !isPositiveInteger(report.threads_count) || !isNonnegativeFinite(report.start_time)) {
|
|
@@ -9065,7 +9032,7 @@ var phpLintRunner = {
|
|
|
9065
9032
|
const cwd = resolveRunnerCwd(ctx, "php-lint");
|
|
9066
9033
|
const cmd = ctx.analysisRootMode === "adopted" ? resolveAdoptedRootCommand("php", ctx, cwd) : await php.isAvailableAsync(cwd) ? php.getCommand(cwd) : null;
|
|
9067
9034
|
if (!cmd)
|
|
9068
|
-
return
|
|
9035
|
+
return toolAbsentSkip(cwd, { checker: php });
|
|
9069
9036
|
const absPath = path30.resolve(cwd, ctx.filePath);
|
|
9070
9037
|
const result = await safeSpawnAsync(cmd, ["-l", absPath], {
|
|
9071
9038
|
timeout: 15e3,
|
|
@@ -9146,19 +9113,23 @@ var phpstanRunner = {
|
|
|
9146
9113
|
appliesTo: ["php"],
|
|
9147
9114
|
priority: PRIORITY.GENERAL_ANALYSIS,
|
|
9148
9115
|
skipTestFiles: false,
|
|
9149
|
-
requiresConfig: (cwd) =>
|
|
9116
|
+
requiresConfig: (cwd) => hasToolConfig("phpstan", cwd),
|
|
9150
9117
|
async run(ctx) {
|
|
9151
9118
|
const cwd = resolveRunnerCwd(ctx, "phpstan");
|
|
9152
9119
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
9153
9120
|
if (policy && !policy.preferredRunners.includes("phpstan")) {
|
|
9154
|
-
return
|
|
9121
|
+
return skipped("not-preferred");
|
|
9155
9122
|
}
|
|
9156
9123
|
if (!phpstanRunner.requiresConfig?.(cwd)) {
|
|
9157
|
-
return
|
|
9124
|
+
return skipped("not-configured");
|
|
9158
9125
|
}
|
|
9159
|
-
const
|
|
9126
|
+
const lookup = await resolvePhpstan(cwd) ?? void 0;
|
|
9127
|
+
const cmd = localBinPath(lookup);
|
|
9160
9128
|
if (!cmd)
|
|
9161
|
-
return
|
|
9129
|
+
return toolAbsentSkip(cwd, {
|
|
9130
|
+
checker: phpstan,
|
|
9131
|
+
trustRefused: isLocalBinTrustRefusal(lookup)
|
|
9132
|
+
});
|
|
9162
9133
|
const absPath = path31.resolve(cwd, ctx.filePath);
|
|
9163
9134
|
const result = await safeSpawnAsync(cmd, ["analyse", "--error-format=json", "--no-progress", absPath], { timeout: 3e4, cwd });
|
|
9164
9135
|
const run = parseToolRun("phpstan", { result, exitCodes: PHPSTAN_EXIT_CODES }, (out) => parsePhpstanJson(out, ctx.filePath, cwd), { parseOutput: result.stdout ?? "" });
|
|
@@ -9224,9 +9195,9 @@ ${result.stderr ?? ""}`;
|
|
|
9224
9195
|
const diagnostics = parsePrismaValidateOutput(output, ctx.filePath);
|
|
9225
9196
|
const findings = PRISMA_VALIDATION_REPORT.test(output) ? diagnostics : [];
|
|
9226
9197
|
if (findings.length === 0) {
|
|
9227
|
-
const
|
|
9228
|
-
if (
|
|
9229
|
-
return
|
|
9198
|
+
const skipped2 = skipUnlessToolRan("prisma-validate", { result, output });
|
|
9199
|
+
if (skipped2)
|
|
9200
|
+
return skipped2;
|
|
9230
9201
|
}
|
|
9231
9202
|
const cutShort = faultIfCutShort(result, findings);
|
|
9232
9203
|
if (cutShort)
|
|
@@ -9342,6 +9313,17 @@ async function resolvePowerShellCmd() {
|
|
|
9342
9313
|
});
|
|
9343
9314
|
return null;
|
|
9344
9315
|
}
|
|
9316
|
+
function moduleVerdict(cmd) {
|
|
9317
|
+
const latch = psAnalyzerLatchByCmd.get(cmd);
|
|
9318
|
+
const outcome = latch?.getOutcome() ?? null;
|
|
9319
|
+
return {
|
|
9320
|
+
outcome,
|
|
9321
|
+
cause: latch?.getCause() ?? null,
|
|
9322
|
+
elapsedMs: 0,
|
|
9323
|
+
latched: outcome !== null,
|
|
9324
|
+
retryAtMs: latch?.getRetryAtMs() ?? 0
|
|
9325
|
+
};
|
|
9326
|
+
}
|
|
9345
9327
|
async function checkModuleAvailable(cmd) {
|
|
9346
9328
|
let latch = psAnalyzerLatchByCmd.get(cmd);
|
|
9347
9329
|
if (!latch) {
|
|
@@ -9427,9 +9409,9 @@ var psScriptAnalyzerRunner = {
|
|
|
9427
9409
|
async run(ctx) {
|
|
9428
9410
|
const cmd = await resolvePowerShellCmd();
|
|
9429
9411
|
if (!cmd)
|
|
9430
|
-
return
|
|
9412
|
+
return toolAbsentSkip(ctx.cwd);
|
|
9431
9413
|
if (!await checkModuleAvailable(cmd)) {
|
|
9432
|
-
return
|
|
9414
|
+
return toolAbsentSkip(ctx.cwd, { verdict: moduleVerdict(cmd) });
|
|
9433
9415
|
}
|
|
9434
9416
|
let execLatch = psExecLatchByCmd.get(cmd);
|
|
9435
9417
|
if (!execLatch) {
|
|
@@ -9475,7 +9457,7 @@ var psScriptAnalyzerRunner = {
|
|
|
9475
9457
|
subject: "psscriptanalyzer",
|
|
9476
9458
|
reason: `PowerShell (${cmd}) -File analysis exited with no status -- crash or signal-killed process`
|
|
9477
9459
|
});
|
|
9478
|
-
return
|
|
9460
|
+
return faultSkip("did-not-run");
|
|
9479
9461
|
}
|
|
9480
9462
|
if (result.status !== 0) {
|
|
9481
9463
|
const stderrText = result.stderr ?? "";
|
|
@@ -9501,7 +9483,7 @@ var psScriptAnalyzerRunner = {
|
|
|
9501
9483
|
subject: "psscriptanalyzer",
|
|
9502
9484
|
reason: policyDenied ? `PowerShell execution policy blocked -File analysis for ${cmd}: ${stderrText.trim().split("\n")[0] || "SecurityError"}` : `PowerShell -File analysis for ${cmd} exited ${result.status}: ${stderrText.trim().slice(0, 200) || "no stderr"}`
|
|
9503
9485
|
});
|
|
9504
|
-
return
|
|
9486
|
+
return faultSkip("rejected-invocation");
|
|
9505
9487
|
}
|
|
9506
9488
|
if (execLatch.read() === null) {
|
|
9507
9489
|
notePsDecision(execLatch, "psscriptanalyzer-exec", {
|
|
@@ -9531,7 +9513,7 @@ var psScriptAnalyzerRunner = {
|
|
|
9531
9513
|
subject: "psscriptanalyzer",
|
|
9532
9514
|
reason: `PowerShell -File analysis for ${cmd} exited 0 but stdout was ${unreadableReason}`
|
|
9533
9515
|
});
|
|
9534
|
-
return
|
|
9516
|
+
return faultSkip("report-missing");
|
|
9535
9517
|
}
|
|
9536
9518
|
if (diagnostics.length === 0) {
|
|
9537
9519
|
return { status: "succeeded", diagnostics: [], semantic: "none" };
|
|
@@ -9572,13 +9554,13 @@ var pyrightRunner = {
|
|
|
9572
9554
|
cmd = installedPath;
|
|
9573
9555
|
}
|
|
9574
9556
|
if (!cmd) {
|
|
9575
|
-
const { findCommandAsync } = await import("./chunk-
|
|
9557
|
+
const { findCommandAsync } = await import("./chunk-H5API74E.js");
|
|
9576
9558
|
const foundCmd = await findCommandAsync("pyright");
|
|
9577
9559
|
if (foundCmd)
|
|
9578
9560
|
cmd = foundCmd;
|
|
9579
9561
|
}
|
|
9580
9562
|
if (!cmd) {
|
|
9581
|
-
return {
|
|
9563
|
+
return toolAbsentSkip(cwd, { id: "pyright", checker: pyright });
|
|
9582
9564
|
}
|
|
9583
9565
|
const pythonEnvironment = await detectPythonEnvironment(cwd);
|
|
9584
9566
|
const env = augmentPythonEnvironment(process.env, pythonEnvironment);
|
|
@@ -9725,11 +9707,14 @@ var rubocopRunner = {
|
|
|
9725
9707
|
const cwd = resolveRunnerCwd(ctx, "rubocop");
|
|
9726
9708
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
9727
9709
|
if (policy && !policy.preferredRunners.includes("rubocop")) {
|
|
9728
|
-
return
|
|
9710
|
+
return skipped("not-preferred");
|
|
9729
9711
|
}
|
|
9730
|
-
|
|
9712
|
+
let verdict = null;
|
|
9713
|
+
const resolved = await resolveCommandArgsWithInstallFallback(getRubocopCommand(cwd), "rubocop", cwd, ["--version"], 1e4, (found) => {
|
|
9714
|
+
verdict = found;
|
|
9715
|
+
});
|
|
9731
9716
|
if (!resolved) {
|
|
9732
|
-
return {
|
|
9717
|
+
return toolAbsentSkip(cwd, { id: "rubocop", verdict });
|
|
9733
9718
|
}
|
|
9734
9719
|
const { cmd, args } = resolved;
|
|
9735
9720
|
const result = await safeSpawnAsync(cmd, [...args, "--format", "json", "--no-color", ctx.filePath], { timeout: 3e4, cwd });
|
|
@@ -9747,7 +9732,6 @@ var rubocopRunner = {
|
|
|
9747
9732
|
var rubocop_default = rubocopRunner;
|
|
9748
9733
|
|
|
9749
9734
|
// dist/clients/dispatch/runners/ruff.js
|
|
9750
|
-
var ruff = createAvailabilityChecker("ruff", ".exe");
|
|
9751
9735
|
function parseRuffJson(raw, filePath) {
|
|
9752
9736
|
try {
|
|
9753
9737
|
const parsed = JSON.parse(raw);
|
|
@@ -9785,11 +9769,11 @@ var ruffRunner = {
|
|
|
9785
9769
|
const cwd = resolveRunnerCwd2(ctx, "ruff");
|
|
9786
9770
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
9787
9771
|
if (policy && !policy.preferredRunners.includes("ruff-lint")) {
|
|
9788
|
-
return
|
|
9772
|
+
return skipped("not-preferred");
|
|
9789
9773
|
}
|
|
9790
|
-
const cmd = await
|
|
9774
|
+
const cmd = await resolveToolCommandWithInstallFallback(cwd, "ruff");
|
|
9791
9775
|
if (!cmd) {
|
|
9792
|
-
return
|
|
9776
|
+
return toolAbsentSkip(cwd, { id: "ruff" });
|
|
9793
9777
|
}
|
|
9794
9778
|
const configArgs = ruffConfigArgs(cwd);
|
|
9795
9779
|
const checkResult = await safeSpawnAsync(cmd, [
|
|
@@ -9847,7 +9831,7 @@ var rustClippyRunner = {
|
|
|
9847
9831
|
async run(ctx) {
|
|
9848
9832
|
const cargoExe = await rustClient.findCargoPathAsync();
|
|
9849
9833
|
if (!cargoExe) {
|
|
9850
|
-
return
|
|
9834
|
+
return toolAbsentSkip(ctx.cwd);
|
|
9851
9835
|
}
|
|
9852
9836
|
const clippyProbe = getClippyProbe(cargoExe);
|
|
9853
9837
|
if (!await clippyProbe(ctx.cwd)) {
|
|
@@ -9868,7 +9852,7 @@ var rustClippyRunner = {
|
|
|
9868
9852
|
elapsedMs: 0,
|
|
9869
9853
|
latched: false
|
|
9870
9854
|
});
|
|
9871
|
-
return
|
|
9855
|
+
return toolAbsentSkip(ctx.cwd, { checker: refreshedProbe });
|
|
9872
9856
|
}
|
|
9873
9857
|
}
|
|
9874
9858
|
const cargoResolution = resolveRunnerCwdWithReason(ctx, "rust-clippy");
|
|
@@ -9898,8 +9882,8 @@ var rustClippyRunner = {
|
|
|
9898
9882
|
const hasBlocking = diagnostics.some((d) => d.semantic === "blocking");
|
|
9899
9883
|
const semantic = hasBlocking ? "blocking" : diagnostics.length > 0 ? "warning" : "none";
|
|
9900
9884
|
if (spawnTimedOut(result)) {
|
|
9901
|
-
const
|
|
9902
|
-
const cut =
|
|
9885
|
+
const skipped2 = diagnostics.length === 0 ? skipUnlessToolRan("rust-clippy", { result }) : null;
|
|
9886
|
+
const cut = skipped2 ?? faultIfCutShort(result, diagnostics);
|
|
9903
9887
|
if (cut)
|
|
9904
9888
|
return cut;
|
|
9905
9889
|
}
|
|
@@ -9986,7 +9970,6 @@ var rust_clippy_default = rustClippyRunner;
|
|
|
9986
9970
|
import { randomUUID } from "node:crypto";
|
|
9987
9971
|
import * as fs12 from "node:fs";
|
|
9988
9972
|
import * as path35 from "node:path";
|
|
9989
|
-
var java = createAvailabilityChecker("java", ".exe", ["-version"]);
|
|
9990
9973
|
var spotbugs = createAvailabilityChecker("spotbugs", ".bat", ["-version"]);
|
|
9991
9974
|
var MAX_DIAGNOSTICS = 50;
|
|
9992
9975
|
var MAX_XML_BYTES = 4 * 1024 * 1024;
|
|
@@ -10125,6 +10108,7 @@ var spotbugsRunner = {
|
|
|
10125
10108
|
id: "spotbugs",
|
|
10126
10109
|
appliesTo: ["java", "kotlin"],
|
|
10127
10110
|
priority: PRIORITY.DEEP_LANGUAGE_ANALYSIS,
|
|
10111
|
+
timeoutMs: 12e4,
|
|
10128
10112
|
async run(ctx) {
|
|
10129
10113
|
const cwd = resolveRunnerCwd(ctx, "spotbugs");
|
|
10130
10114
|
const classesDir = findCompiledClassesDir(cwd);
|
|
@@ -10132,8 +10116,8 @@ var spotbugsRunner = {
|
|
|
10132
10116
|
ctx.log?.("spotbugs: Java project detected but no compiled .class files found \u2014 run `mvn compile` / `gradle build` first");
|
|
10133
10117
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
10134
10118
|
}
|
|
10135
|
-
if (!await
|
|
10136
|
-
return {
|
|
10119
|
+
if (!await resolveToolCommandWithInstallFallback(cwd, "java")) {
|
|
10120
|
+
return toolAbsentSkip(cwd, { id: "java", runtime: true });
|
|
10137
10121
|
}
|
|
10138
10122
|
const signature = classesSignature(classesDir);
|
|
10139
10123
|
const cached = scanCache.get(classesDir);
|
|
@@ -10146,7 +10130,7 @@ var spotbugsRunner = {
|
|
|
10146
10130
|
}
|
|
10147
10131
|
const cmd = await resolveAvailableOrInstall(spotbugs, "spotbugs", cwd);
|
|
10148
10132
|
if (!cmd)
|
|
10149
|
-
return {
|
|
10133
|
+
return toolAbsentSkip(cwd, { id: "spotbugs", checker: spotbugs });
|
|
10150
10134
|
const tmpXml = path35.join(scannerReportParentDir(), `pi-lens-spotbugs-${process.pid}-${randomUUID()}.xml`);
|
|
10151
10135
|
const result = await safeSpawnAsync(cmd, [
|
|
10152
10136
|
"-textui",
|
|
@@ -10191,9 +10175,6 @@ var spotbugs_default = spotbugsRunner;
|
|
|
10191
10175
|
import * as path36 from "node:path";
|
|
10192
10176
|
var shellcheck = createAvailabilityChecker("shellcheck", ".exe");
|
|
10193
10177
|
var SHELLCHECK_EXIT_CODES = { ran: [1] };
|
|
10194
|
-
function findShellcheckConfig(cwd) {
|
|
10195
|
-
return findLocalToolConfig(cwd, [".shellcheckrc"]);
|
|
10196
|
-
}
|
|
10197
10178
|
function parseShellcheckOutput(raw, filePath, cwd) {
|
|
10198
10179
|
const diagnostics = [];
|
|
10199
10180
|
const absTarget = path36.resolve(cwd, filePath);
|
|
@@ -10279,13 +10260,13 @@ var shellcheckRunner = {
|
|
|
10279
10260
|
cmd = managed;
|
|
10280
10261
|
}
|
|
10281
10262
|
if (!cmd)
|
|
10282
|
-
return {
|
|
10263
|
+
return toolAbsentSkip(cwd, { id: "shellcheck", checker: shellcheck });
|
|
10283
10264
|
const args = ["--format", "json"];
|
|
10284
10265
|
if (!dialectInfo.shebang && !dialectInfo.directive) {
|
|
10285
10266
|
args.push("--shell", dialectInfo.dialect);
|
|
10286
10267
|
}
|
|
10287
|
-
const
|
|
10288
|
-
if (!
|
|
10268
|
+
const configDir = path36.dirname(path36.resolve(cwd, ctx.filePath));
|
|
10269
|
+
if (!hasToolConfig("shellcheck", configDir)) {
|
|
10289
10270
|
args.push("--severity", "info");
|
|
10290
10271
|
}
|
|
10291
10272
|
args.push(ctx.filePath);
|
|
@@ -10347,7 +10328,7 @@ var fishIndentRunner = {
|
|
|
10347
10328
|
const cwd = resolveRunnerCwd(ctx, "fish-indent");
|
|
10348
10329
|
const cmd = ctx.analysisRootMode === "adopted" ? resolveAdoptedRootCommand("fish_indent", ctx, cwd) : await fishIndent.isAvailableAsync(cwd) ? fishIndent.getCommand(cwd) : null;
|
|
10349
10330
|
if (!cmd)
|
|
10350
|
-
return
|
|
10331
|
+
return toolAbsentSkip(cwd, { checker: fishIndent });
|
|
10351
10332
|
const fishCmd = ctx.analysisRootMode === "adopted" ? resolveAdoptedRootCommand("fish", ctx, cwd) : await fish.isAvailableAsync(cwd) ? fish.getCommand(cwd) : null;
|
|
10352
10333
|
if (fishCmd) {
|
|
10353
10334
|
const syntax = await safeSpawnAsync(fishCmd, ["--no-config", "--no-execute", ctx.filePath], { timeout: 1e4, cwd });
|
|
@@ -10433,12 +10414,12 @@ var shfmtRunner = {
|
|
|
10433
10414
|
} else {
|
|
10434
10415
|
const installed = await resolveAvailableOrInstall(shfmt, "shfmt", cwd);
|
|
10435
10416
|
if (!installed) {
|
|
10436
|
-
return {
|
|
10417
|
+
return toolAbsentSkip(cwd, { id: "shfmt", checker: shfmt });
|
|
10437
10418
|
}
|
|
10438
10419
|
cmd = installed;
|
|
10439
10420
|
}
|
|
10440
10421
|
if (!cmd)
|
|
10441
|
-
return {
|
|
10422
|
+
return toolAbsentSkip(cwd, { id: "shfmt", checker: shfmt });
|
|
10442
10423
|
const result = await safeSpawnAsync(cmd, ["--diff", ctx.filePath], {
|
|
10443
10424
|
timeout: 1e4,
|
|
10444
10425
|
cwd
|
|
@@ -10473,7 +10454,7 @@ var shfmtRunner = {
|
|
|
10473
10454
|
});
|
|
10474
10455
|
}
|
|
10475
10456
|
if (!hasToolConfig("editorconfig", cwd)) {
|
|
10476
|
-
return
|
|
10457
|
+
return skipped("not-configured");
|
|
10477
10458
|
}
|
|
10478
10459
|
const diffOutput = result.stdout ?? result.stderr ?? "";
|
|
10479
10460
|
let line = 1;
|
|
@@ -10555,7 +10536,7 @@ var spellcheckRunner = {
|
|
|
10555
10536
|
async run(ctx) {
|
|
10556
10537
|
const cwd = resolveRunnerCwd2(ctx, "spellcheck/typos");
|
|
10557
10538
|
if (!await typos.isAvailableAsync(cwd)) {
|
|
10558
|
-
return {
|
|
10539
|
+
return toolAbsentSkip(cwd, { id: "typos", checker: typos });
|
|
10559
10540
|
}
|
|
10560
10541
|
const args = ["--format", "json", ctx.filePath];
|
|
10561
10542
|
const result = await safeSpawnAsync(typos.getCommand(cwd), args, {
|
|
@@ -10670,15 +10651,15 @@ var sqlfluffRunner = {
|
|
|
10670
10651
|
const cwd = resolveRunnerCwd(ctx, "sqlfluff");
|
|
10671
10652
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
10672
10653
|
if (policy && !policy.preferredRunners.includes("sqlfluff")) {
|
|
10673
|
-
return
|
|
10654
|
+
return skipped("not-preferred");
|
|
10674
10655
|
}
|
|
10675
|
-
const hasConfig =
|
|
10656
|
+
const hasConfig = hasToolConfig("sqlfluff", cwd);
|
|
10676
10657
|
if (!hasConfig) {
|
|
10677
10658
|
logRunnerAdvisoryOnce(ctx, "sqlfluff", cwd, "sqlfluff: no config detected, using ANSI dialect defaults");
|
|
10678
10659
|
}
|
|
10679
10660
|
const cmd = await resolveToolCommandWithInstallFallback(cwd, "sqlfluff");
|
|
10680
10661
|
if (!cmd)
|
|
10681
|
-
return
|
|
10662
|
+
return toolAbsentSkip(cwd, { id: "sqlfluff" });
|
|
10682
10663
|
const args = ["lint", "--format", "json"];
|
|
10683
10664
|
if (!hasConfig) {
|
|
10684
10665
|
args.push("--dialect", "ansi");
|
|
@@ -10784,16 +10765,16 @@ var stylelintRunner = {
|
|
|
10784
10765
|
const cwd = resolveRunnerCwd(ctx, "stylelint");
|
|
10785
10766
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
10786
10767
|
if (policy && !policy.preferredRunners.includes("stylelint")) {
|
|
10787
|
-
return
|
|
10768
|
+
return skipped("not-preferred");
|
|
10788
10769
|
}
|
|
10789
10770
|
const fileDir = path39.dirname(path39.resolve(cwd, ctx.filePath));
|
|
10790
|
-
const hasConfig =
|
|
10771
|
+
const hasConfig = hasToolConfig("stylelint", fileDir) || hasToolConfig("stylelint", cwd);
|
|
10791
10772
|
if (!hasConfig) {
|
|
10792
10773
|
logRunnerAdvisoryOnce(ctx, "stylelint", cwd, "stylelint: no config detected, running with default rules");
|
|
10793
10774
|
}
|
|
10794
10775
|
const cmd = await resolveToolCommandWithInstallFallback(cwd, "stylelint");
|
|
10795
10776
|
if (!cmd)
|
|
10796
|
-
return
|
|
10777
|
+
return toolAbsentSkip(cwd, { id: "stylelint" });
|
|
10797
10778
|
const result = await safeSpawnAsync(cmd, ["--formatter", "json", ctx.filePath], { timeout: 2e4, cwd });
|
|
10798
10779
|
const raw = stylelintReport(result.stdout, result.stderr);
|
|
10799
10780
|
const run = parseToolRun("stylelint", { result, output: raw, exitCodes: STYLELINT_EXIT_CODES }, (out) => parseStylelintJson(out, ctx.filePath, cwd));
|
|
@@ -10920,7 +10901,7 @@ var swiftlintRunner = {
|
|
|
10920
10901
|
const cwd = resolveRunnerCwd(ctx, "swiftlint");
|
|
10921
10902
|
const cmd = await resolveToolCommandWithInstallFallback(cwd, "swiftlint");
|
|
10922
10903
|
if (!cmd)
|
|
10923
|
-
return
|
|
10904
|
+
return toolAbsentSkip(cwd, { id: "swiftlint" });
|
|
10924
10905
|
const result = await safeSpawnAsync(cmd, ["--reporter", "json", path40.resolve(cwd, ctx.filePath)], { cwd, timeout: 15e3 });
|
|
10925
10906
|
const run = parseToolRun("swiftlint", {
|
|
10926
10907
|
result,
|
|
@@ -11006,7 +10987,7 @@ var taploRunner = {
|
|
|
11006
10987
|
const cwd = resolveRunnerCwd(ctx, "taplo");
|
|
11007
10988
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
11008
10989
|
if (policy && !policy.preferredRunners.includes("taplo")) {
|
|
11009
|
-
return
|
|
10990
|
+
return skipped("not-preferred");
|
|
11010
10991
|
}
|
|
11011
10992
|
const cover = lspPrimaryCoversFile(ctx, "taplo");
|
|
11012
10993
|
if (cover && await coveringLaneAvailable(ctx, cover)) {
|
|
@@ -11025,12 +11006,16 @@ var taploRunner = {
|
|
|
11025
11006
|
coveredBy: { runnerId: "lsp", serverId: cover.serverId }
|
|
11026
11007
|
};
|
|
11027
11008
|
}
|
|
11028
|
-
|
|
11009
|
+
const projectTaplo = findLocalBinUpwards("taplo", cwd);
|
|
11010
|
+
let cmd = localBinPath(projectTaplo) ?? null;
|
|
11029
11011
|
if (!cmd) {
|
|
11030
11012
|
cmd = await resolveToolCommandWithInstallFallback(cwd, "taplo");
|
|
11031
11013
|
}
|
|
11032
11014
|
if (!cmd)
|
|
11033
|
-
return
|
|
11015
|
+
return toolAbsentSkip(cwd, {
|
|
11016
|
+
id: "taplo",
|
|
11017
|
+
trustRefused: isLocalBinTrustRefusal(projectTaplo)
|
|
11018
|
+
});
|
|
11034
11019
|
const absPath = path41.resolve(cwd, ctx.filePath);
|
|
11035
11020
|
const result = await safeSpawnAsync(cmd, ["check", "--colors", "never", absPath], { cwd, timeout: 15e3 });
|
|
11036
11021
|
const raw = result.stderr?.trim() ? result.stderr : result.stdout ?? "";
|
|
@@ -11105,11 +11090,6 @@ function parseTerragruntOutput(raw, filePath, absPath = path42.resolve(filePath)
|
|
|
11105
11090
|
}
|
|
11106
11091
|
return diagnostics;
|
|
11107
11092
|
}
|
|
11108
|
-
var SKIPPED3 = {
|
|
11109
|
-
status: "skipped",
|
|
11110
|
-
diagnostics: [],
|
|
11111
|
-
semantic: "none"
|
|
11112
|
-
};
|
|
11113
11093
|
var terragruntRunner = {
|
|
11114
11094
|
id: "terragrunt",
|
|
11115
11095
|
appliesTo: ["terragrunt"],
|
|
@@ -11119,7 +11099,7 @@ var terragruntRunner = {
|
|
|
11119
11099
|
const cwd = resolveRunnerCwd(ctx, "terragrunt");
|
|
11120
11100
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
11121
11101
|
if (policy && !policy.preferredRunners.includes("terragrunt"))
|
|
11122
|
-
return
|
|
11102
|
+
return skipped("not-preferred");
|
|
11123
11103
|
let cmd = null;
|
|
11124
11104
|
if (await terragrunt.isAvailableAsync(cwd)) {
|
|
11125
11105
|
cmd = terragrunt.getCommand(cwd);
|
|
@@ -11129,7 +11109,7 @@ var terragruntRunner = {
|
|
|
11129
11109
|
cmd = managed;
|
|
11130
11110
|
}
|
|
11131
11111
|
if (!cmd)
|
|
11132
|
-
return
|
|
11112
|
+
return toolAbsentSkip(cwd, { id: "terragrunt", checker: terragrunt });
|
|
11133
11113
|
const absPath = path42.resolve(cwd, ctx.filePath);
|
|
11134
11114
|
const fileDir = path42.dirname(absPath);
|
|
11135
11115
|
const result = await safeSpawnAsync(cmd, ["hcl", "validate", "--json", "--non-interactive"], { cwd: fileDir, timeout: 3e4 });
|
|
@@ -11196,7 +11176,7 @@ var tflintRunner = {
|
|
|
11196
11176
|
const cwd = resolveRunnerCwd(ctx, "tflint");
|
|
11197
11177
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
11198
11178
|
if (policy && !policy.preferredRunners.includes("tflint")) {
|
|
11199
|
-
return
|
|
11179
|
+
return skipped("not-preferred");
|
|
11200
11180
|
}
|
|
11201
11181
|
let cmd = null;
|
|
11202
11182
|
if (await tflint.isAvailableAsync(cwd)) {
|
|
@@ -11207,7 +11187,7 @@ var tflintRunner = {
|
|
|
11207
11187
|
cmd = managed;
|
|
11208
11188
|
}
|
|
11209
11189
|
if (!cmd)
|
|
11210
|
-
return {
|
|
11190
|
+
return toolAbsentSkip(cwd, { id: "tflint", checker: tflint });
|
|
11211
11191
|
const absPath = path43.resolve(cwd, ctx.filePath);
|
|
11212
11192
|
const fileDir = path43.dirname(absPath);
|
|
11213
11193
|
const args = [
|
|
@@ -11250,7 +11230,6 @@ var tflint_default = tflintRunner;
|
|
|
11250
11230
|
// dist/clients/dispatch/runners/trivy-config.js
|
|
11251
11231
|
import * as fs13 from "node:fs";
|
|
11252
11232
|
import * as path44 from "node:path";
|
|
11253
|
-
var trivy2 = createAvailabilityChecker("trivy", ".exe");
|
|
11254
11233
|
function looksLikeKubernetesManifest(content) {
|
|
11255
11234
|
for (const doc of content.split(/^---\s*$/m)) {
|
|
11256
11235
|
if (/^apiVersion:\s*\S/m.test(doc) && /^kind:\s*\S/m.test(doc)) {
|
|
@@ -11329,6 +11308,7 @@ var trivyConfigRunner = {
|
|
|
11329
11308
|
id: "trivy-config",
|
|
11330
11309
|
appliesTo: ["docker", "yaml", "terraform", "json"],
|
|
11331
11310
|
priority: PRIORITY.GENERAL_ANALYSIS,
|
|
11311
|
+
timeoutMs: 6e4,
|
|
11332
11312
|
skipTestFiles: false,
|
|
11333
11313
|
async run(ctx) {
|
|
11334
11314
|
const cwd = resolveRunnerCwd(ctx, "trivy-config");
|
|
@@ -11353,16 +11333,9 @@ var trivyConfigRunner = {
|
|
|
11353
11333
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
11354
11334
|
}
|
|
11355
11335
|
}
|
|
11356
|
-
|
|
11357
|
-
if (await trivy2.isAvailableAsync(cwd)) {
|
|
11358
|
-
cmd = trivy2.getCommand(cwd);
|
|
11359
|
-
} else {
|
|
11360
|
-
const managed = await resolveAvailableOrInstall(trivy2, "trivy", cwd);
|
|
11361
|
-
if (managed)
|
|
11362
|
-
cmd = managed;
|
|
11363
|
-
}
|
|
11336
|
+
const cmd = await resolveToolCommandWithInstallFallback(cwd, "trivy");
|
|
11364
11337
|
if (!cmd)
|
|
11365
|
-
return
|
|
11338
|
+
return toolAbsentSkip(cwd, { id: "trivy" });
|
|
11366
11339
|
const severities = resolveSeverityFloor(cwd).join(",");
|
|
11367
11340
|
const result = await safeSpawnAsync(cmd, [
|
|
11368
11341
|
"config",
|
|
@@ -11413,9 +11386,6 @@ var trivy_config_default = trivyConfigRunner;
|
|
|
11413
11386
|
|
|
11414
11387
|
// dist/clients/dispatch/runners/vale.js
|
|
11415
11388
|
import * as path45 from "node:path";
|
|
11416
|
-
function findValeConfig(cwd) {
|
|
11417
|
-
return findLocalToolConfig(cwd, [".vale.ini"]);
|
|
11418
|
-
}
|
|
11419
11389
|
function parseValeOutput(raw, filePath, cwd) {
|
|
11420
11390
|
const diagnostics = [];
|
|
11421
11391
|
if (!raw.trim())
|
|
@@ -11464,15 +11434,15 @@ var valeRunner = {
|
|
|
11464
11434
|
appliesTo: ["markdown"],
|
|
11465
11435
|
priority: PRIORITY.DOC_QUALITY,
|
|
11466
11436
|
skipTestFiles: false,
|
|
11467
|
-
requiresConfig: (cwd) =>
|
|
11437
|
+
requiresConfig: (cwd) => hasToolConfig("vale", cwd),
|
|
11468
11438
|
async run(ctx) {
|
|
11469
11439
|
const cwd = resolveRunnerCwd(ctx, "vale");
|
|
11470
11440
|
if (!valeRunner.requiresConfig?.(cwd)) {
|
|
11471
|
-
return
|
|
11441
|
+
return skipped("not-configured");
|
|
11472
11442
|
}
|
|
11473
11443
|
const cmd = await resolveToolCommandWithInstallFallback(cwd, "vale");
|
|
11474
11444
|
if (!cmd)
|
|
11475
|
-
return
|
|
11445
|
+
return toolAbsentSkip(cwd, { id: "vale" });
|
|
11476
11446
|
const result = await safeSpawnAsync(cmd, ["--output", "JSON", ctx.filePath], { cwd, timeout: 15e3 });
|
|
11477
11447
|
const run = parseToolRun("vale", {
|
|
11478
11448
|
result,
|
|
@@ -11818,8 +11788,8 @@ async function extractEntitySnapshot(client, filePath, languageId, contentOverri
|
|
|
11818
11788
|
const name = match.captures.NAME?.trim();
|
|
11819
11789
|
if (!name)
|
|
11820
11790
|
continue;
|
|
11821
|
-
const
|
|
11822
|
-
snapshot.set(
|
|
11791
|
+
const key = `${def.kind}:${name}`;
|
|
11792
|
+
snapshot.set(key, `${match.line}:${match.matchedText.slice(0, 400)}`);
|
|
11823
11793
|
}
|
|
11824
11794
|
}
|
|
11825
11795
|
return snapshot;
|
|
@@ -12164,26 +12134,34 @@ var yamllintRunner = {
|
|
|
12164
12134
|
const cwd = resolveRunnerCwd2(ctx, "yamllint");
|
|
12165
12135
|
const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
|
|
12166
12136
|
if (policy && !policy.preferredRunners.includes("yamllint")) {
|
|
12167
|
-
return
|
|
12137
|
+
return skipped("not-preferred");
|
|
12168
12138
|
}
|
|
12169
|
-
const hasConfig =
|
|
12139
|
+
const hasConfig = hasToolConfig("yamllint", cwd);
|
|
12170
12140
|
if (!hasConfig) {
|
|
12171
12141
|
logRunnerAdvisoryOnce(ctx, "yamllint", cwd, "yamllint: no config detected, running with default rules");
|
|
12172
12142
|
}
|
|
12173
12143
|
const cmd = await resolveToolCommandWithInstallFallback(cwd, "yamllint");
|
|
12174
12144
|
if (!cmd)
|
|
12175
|
-
return
|
|
12176
|
-
const
|
|
12145
|
+
return toolAbsentSkip(cwd, { id: "yamllint" });
|
|
12146
|
+
const targetRel = relativeInside(cwd, ctx.filePath) ?? ctx.filePath;
|
|
12147
|
+
const result = await safeSpawnAsync(cmd, ["-f", "parsable", "--", targetRel], {
|
|
12177
12148
|
cwd,
|
|
12178
12149
|
timeout: 15e3
|
|
12179
12150
|
});
|
|
12180
12151
|
const raw = `${result.stdout ?? ""}${result.stderr ?? ""}`;
|
|
12181
|
-
const run = parseToolRun(
|
|
12182
|
-
|
|
12183
|
-
|
|
12184
|
-
|
|
12185
|
-
|
|
12186
|
-
|
|
12152
|
+
const run = parseToolRun(
|
|
12153
|
+
"yamllint",
|
|
12154
|
+
{
|
|
12155
|
+
result,
|
|
12156
|
+
output: result.stdout,
|
|
12157
|
+
// EXIT TABLE (yamllint 1.35 docs https://yamllint.readthedocs.io/en/stable/): 0 clean; 1 findings; 2 error; other nonzero rejected.
|
|
12158
|
+
exitCodes: { ran: [1, 2] }
|
|
12159
|
+
},
|
|
12160
|
+
// ADR 0009: the finding is attributed to the dispatched path; the parser
|
|
12161
|
+
// resolves the tool's project-relative report against the spawn cwd.
|
|
12162
|
+
(out) => parseYamllintParsable(out, ctx.filePath, cwd),
|
|
12163
|
+
{ parseOutput: raw }
|
|
12164
|
+
);
|
|
12187
12165
|
if (run.skipped)
|
|
12188
12166
|
return run.skipped;
|
|
12189
12167
|
const diagnostics = run.diagnostics;
|
|
@@ -12236,7 +12214,7 @@ var zigCheckRunner = {
|
|
|
12236
12214
|
async run(ctx) {
|
|
12237
12215
|
const cwd = resolveRunnerCwd(ctx, "zig-check");
|
|
12238
12216
|
if (!await zig.isAvailableAsync(cwd)) {
|
|
12239
|
-
return
|
|
12217
|
+
return toolAbsentSkip(cwd, { checker: zig });
|
|
12240
12218
|
}
|
|
12241
12219
|
const cmd = zig.getCommand(cwd);
|
|
12242
12220
|
const absPath = path49.resolve(cwd, ctx.filePath);
|
|
@@ -13063,7 +13041,7 @@ function withSpotbugsGroup(kind, groups, ctx) {
|
|
|
13063
13041
|
return groups;
|
|
13064
13042
|
if (!ctx.pi.getFlag("lens-spotbugs"))
|
|
13065
13043
|
return groups;
|
|
13066
|
-
if (!
|
|
13044
|
+
if (!hasToolConfig("javaBuild", ctx.cwd) || !findCompiledClassesDir(ctx.cwd)) {
|
|
13067
13045
|
return groups;
|
|
13068
13046
|
}
|
|
13069
13047
|
if (groups.some((group) => group.runnerIds.includes("spotbugs")))
|
|
@@ -13157,17 +13135,17 @@ var MAX_FILES = RUNTIME_CONFIG.pipeline.cascadeMaxFiles;
|
|
|
13157
13135
|
var MAX_POLICY_INPUT_PER_FILE = MAX_PER_FILE * 4;
|
|
13158
13136
|
var reverseDepsIndexCache = /* @__PURE__ */ new Map();
|
|
13159
13137
|
var REVERSE_DEPS_IDLE_EVICT_MS_DEFAULT = 20 * 6e4;
|
|
13160
|
-
function deleteReverseDepsEntry(
|
|
13161
|
-
const entry = reverseDepsIndexCache.get(
|
|
13138
|
+
function deleteReverseDepsEntry(key) {
|
|
13139
|
+
const entry = reverseDepsIndexCache.get(key);
|
|
13162
13140
|
if (entry?.idleTimer !== void 0)
|
|
13163
13141
|
clearTimeout(entry.idleTimer);
|
|
13164
13142
|
if (entry)
|
|
13165
13143
|
entry.idleTimer = void 0;
|
|
13166
|
-
reverseDepsIndexCache.delete(
|
|
13144
|
+
reverseDepsIndexCache.delete(key);
|
|
13167
13145
|
}
|
|
13168
13146
|
function clearReverseDepsIndexCache() {
|
|
13169
|
-
for (const
|
|
13170
|
-
deleteReverseDepsEntry(
|
|
13147
|
+
for (const key of reverseDepsIndexCache.keys())
|
|
13148
|
+
deleteReverseDepsEntry(key);
|
|
13171
13149
|
}
|
|
13172
13150
|
var CASCADE_TRANSITIVE_DEPTH = Math.max(1, Number.parseInt(process.env.PI_LENS_CASCADE_TRANSITIVE_DEPTH ?? "2", 10) || 2);
|
|
13173
13151
|
var CASCADE_GRAPH_KINDS = /* @__PURE__ */ new Set([
|
|
@@ -13266,28 +13244,28 @@ function clearWarmWordIndexTimer(entry) {
|
|
|
13266
13244
|
clearTimeout(entry.timer);
|
|
13267
13245
|
entry.timer = void 0;
|
|
13268
13246
|
}
|
|
13269
|
-
function evictWarmWordIndex(
|
|
13270
|
-
if (entry.leases > 0 || warmWordIndexes.get(
|
|
13247
|
+
function evictWarmWordIndex(key, entry, reason) {
|
|
13248
|
+
if (entry.leases > 0 || warmWordIndexes.get(key) !== entry)
|
|
13271
13249
|
return false;
|
|
13272
13250
|
clearWarmWordIndexTimer(entry);
|
|
13273
|
-
warmWordIndexes.delete(
|
|
13251
|
+
warmWordIndexes.delete(key);
|
|
13274
13252
|
logWordIndex({
|
|
13275
13253
|
phase: "warm_cache_evicted",
|
|
13276
|
-
cwd:
|
|
13254
|
+
cwd: key,
|
|
13277
13255
|
trigger: "mcp",
|
|
13278
13256
|
reason
|
|
13279
13257
|
});
|
|
13280
13258
|
return true;
|
|
13281
13259
|
}
|
|
13282
|
-
function scheduleWarmWordIndexIdleEviction(
|
|
13260
|
+
function scheduleWarmWordIndexIdleEviction(key, entry) {
|
|
13283
13261
|
clearWarmWordIndexTimer(entry);
|
|
13284
13262
|
const generation = ++entry.generation;
|
|
13285
13263
|
const timer = setTimeout(() => {
|
|
13286
13264
|
entry.timer = void 0;
|
|
13287
|
-
if (warmWordIndexes.get(
|
|
13265
|
+
if (warmWordIndexes.get(key) !== entry || entry.generation !== generation)
|
|
13288
13266
|
return;
|
|
13289
|
-
if (!evictWarmWordIndex(
|
|
13290
|
-
scheduleWarmWordIndexIdleEviction(
|
|
13267
|
+
if (!evictWarmWordIndex(key, entry, "idle"))
|
|
13268
|
+
scheduleWarmWordIndexIdleEviction(key, entry);
|
|
13291
13269
|
}, idleEvictMs());
|
|
13292
13270
|
timer.unref?.();
|
|
13293
13271
|
entry.timer = timer;
|
|
@@ -13303,10 +13281,10 @@ function usableWarmWordIndex(index) {
|
|
|
13303
13281
|
return index?.forward ? index : void 0;
|
|
13304
13282
|
}
|
|
13305
13283
|
function acquireWarmWordIndex(cwd) {
|
|
13306
|
-
const
|
|
13307
|
-
let entry = warmWordIndexes.get(
|
|
13284
|
+
const key = path50.resolve(cwd);
|
|
13285
|
+
let entry = warmWordIndexes.get(key);
|
|
13308
13286
|
if (!entry) {
|
|
13309
|
-
const snapshot = loadProjectSnapshot(
|
|
13287
|
+
const snapshot = loadProjectSnapshot(key);
|
|
13310
13288
|
const index = usableWarmWordIndex(deserializeWordIndex(snapshot?.wordIndex) ?? void 0);
|
|
13311
13289
|
entry = {
|
|
13312
13290
|
index,
|
|
@@ -13315,11 +13293,11 @@ function acquireWarmWordIndex(cwd) {
|
|
|
13315
13293
|
lastUsedAt: Date.now(),
|
|
13316
13294
|
generation: 0
|
|
13317
13295
|
};
|
|
13318
|
-
warmWordIndexes.set(
|
|
13296
|
+
warmWordIndexes.set(key, entry);
|
|
13319
13297
|
}
|
|
13320
13298
|
entry.leases++;
|
|
13321
13299
|
entry.lastUsedAt = Date.now();
|
|
13322
|
-
scheduleWarmWordIndexIdleEviction(
|
|
13300
|
+
scheduleWarmWordIndexIdleEviction(key, entry);
|
|
13323
13301
|
enforceWarmWordIndexLruCap();
|
|
13324
13302
|
let released = false;
|
|
13325
13303
|
return {
|
|
@@ -13330,8 +13308,8 @@ function acquireWarmWordIndex(cwd) {
|
|
|
13330
13308
|
released = true;
|
|
13331
13309
|
entry.leases = Math.max(0, entry.leases - 1);
|
|
13332
13310
|
entry.lastUsedAt = Date.now();
|
|
13333
|
-
if (warmWordIndexes.get(
|
|
13334
|
-
scheduleWarmWordIndexIdleEviction(
|
|
13311
|
+
if (warmWordIndexes.get(key) === entry) {
|
|
13312
|
+
scheduleWarmWordIndexIdleEviction(key, entry);
|
|
13335
13313
|
enforceWarmWordIndexLruCap();
|
|
13336
13314
|
}
|
|
13337
13315
|
}
|
|
@@ -13341,16 +13319,16 @@ function adoptPublishedWarmWordIndex(cwd, published, trigger) {
|
|
|
13341
13319
|
const index = usableWarmWordIndex(published);
|
|
13342
13320
|
if (!index)
|
|
13343
13321
|
return;
|
|
13344
|
-
const
|
|
13345
|
-
const entry = warmWordIndexes.get(
|
|
13322
|
+
const key = path50.resolve(cwd);
|
|
13323
|
+
const entry = warmWordIndexes.get(key);
|
|
13346
13324
|
if (!entry || entry.index)
|
|
13347
13325
|
return;
|
|
13348
13326
|
entry.index = index;
|
|
13349
13327
|
entry.lastUsedAt = Date.now();
|
|
13350
|
-
scheduleWarmWordIndexIdleEviction(
|
|
13328
|
+
scheduleWarmWordIndexIdleEviction(key, entry);
|
|
13351
13329
|
logWordIndex({
|
|
13352
13330
|
phase: "warm_cache_adopted",
|
|
13353
|
-
cwd:
|
|
13331
|
+
cwd: key,
|
|
13354
13332
|
trigger,
|
|
13355
13333
|
indexedFileCount: index.docCount,
|
|
13356
13334
|
tokens: index.postings.size
|
|
@@ -13430,8 +13408,9 @@ async function warmLspForFile(absPath, host) {
|
|
|
13430
13408
|
} catch {
|
|
13431
13409
|
}
|
|
13432
13410
|
}
|
|
13433
|
-
async function analyzeFile(filePath,
|
|
13434
|
-
const
|
|
13411
|
+
async function analyzeFile(filePath, workspaceCwd, options = {}) {
|
|
13412
|
+
const cwd = resolveHostToolPath(".", workspaceCwd);
|
|
13413
|
+
const absPath = resolveHostToolPath(filePath, cwd);
|
|
13435
13414
|
const host = createMcpHost({ "no-delta": true, ...options.flags }, cwd);
|
|
13436
13415
|
const observedAt = Date.now();
|
|
13437
13416
|
const analysisRootMode = resolveAnalysisRoot(absPath, cwd);
|
|
@@ -13581,7 +13560,6 @@ export {
|
|
|
13581
13560
|
stampLineHashes,
|
|
13582
13561
|
owedByContentOnly,
|
|
13583
13562
|
getToolPlan,
|
|
13584
|
-
resetObservedRunnerLatency,
|
|
13585
13563
|
requeueRunnerFindings,
|
|
13586
13564
|
drainPendingRunnerFindings,
|
|
13587
13565
|
dropStaleRunnerFindings,
|