@herbertgao/pi-extensions 2026.10.12 → 2026.10.14
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/README.md +11 -11
- package/THIRD_PARTY_NOTICES.md +3 -3
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +7 -9
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +7 -9
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +1 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +14 -8
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +22 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer.ts +28 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/prompt-editor.ts +33 -12
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +60 -17
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +1 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/index.ts +20 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/markdown-enhance.ts +4 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +42 -18
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/layout.ts +12 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/ccstyle-tool.ts +131 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +217 -113
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/names.ts +12 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/subagent-notification.ts +556 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/ansi-text.ts +50 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/format.ts +11 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/patch-keys.ts +4 -0
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/README.md +1 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/ask-user-question.ts +27 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/config.ts +23 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/configuration.md +15 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/keyboard.md +9 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/de.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/en.json +8 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/es.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/fr.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/pt-BR.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/pt.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/ru.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/uk.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/zh.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +4 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/presentation.ts +11 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +6 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +49 -8
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +6 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state-reducer.ts +13 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state.ts +2 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-block-renderer.ts +19 -7
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-builder.ts +36 -7
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-copy.ts +13 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-content-strategy.ts +24 -8
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/transcript.ts +144 -0
- package/node_modules/@narumitw/pi-btw/README.md +7 -2
- package/node_modules/@narumitw/pi-btw/dist/index.ts +371 -118
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +4 -4
- package/node_modules/@narumitw/pi-btw/docs/main-context-runtime.md +45 -0
- package/node_modules/@narumitw/pi-btw/docs/workflows.md +48 -5
- package/node_modules/@narumitw/pi-btw/package.json +1 -1
- package/node_modules/@narumitw/pi-btw/src/btw.ts +39 -14
- package/node_modules/@narumitw/pi-btw/src/import-main-updates.ts +84 -0
- package/node_modules/@narumitw/pi-btw/src/keybindings.ts +29 -4
- package/node_modules/@narumitw/pi-btw/src/main-context-snapshot.ts +125 -0
- package/node_modules/@narumitw/pi-btw/src/menu.ts +1 -0
- package/node_modules/@narumitw/pi-btw/src/side-thread.ts +66 -17
- package/node_modules/@narumitw/pi-btw/src/transcript-markdown.ts +5 -5
- package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +47 -6
- package/node_modules/pi-lens/CHANGELOG.md +440 -0
- package/node_modules/pi-lens/README.md +13 -3
- package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +1 -0
- package/node_modules/pi-lens/dist/chunk-22Y2BM7H.js +23 -0
- package/node_modules/pi-lens/dist/{chunk-ATKJFDQN.js → chunk-27VWVB23.js} +12 -14
- package/node_modules/pi-lens/dist/{chunk-S2HEXIWI.js → chunk-2FYKETQJ.js} +10 -6
- package/node_modules/pi-lens/dist/{chunk-SRYEJNES.js → chunk-2LDMXL2M.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-ZHH37KZL.js → chunk-2SDHYHHO.js} +17 -17
- package/node_modules/pi-lens/dist/chunk-2Y6OJRSI.js +38 -0
- package/node_modules/pi-lens/dist/chunk-3SNDVPOR.js +507 -0
- package/node_modules/pi-lens/dist/{chunk-5OFV52AM.js → chunk-3WCEHYOI.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-44X7VIKR.js +73 -0
- package/node_modules/pi-lens/dist/{chunk-DEL2U6CM.js → chunk-4FHUGDKU.js} +16 -14
- package/node_modules/pi-lens/dist/{chunk-CT4MN5IU.js → chunk-4ODSZ35Z.js} +353 -359
- package/node_modules/pi-lens/dist/{chunk-ZIVJBOO3.js → chunk-4U7GDSZQ.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-54NIOJJZ.js +25 -0
- package/node_modules/pi-lens/dist/{chunk-N5FLEO7W.js → chunk-5DKE4HGX.js} +37 -37
- package/node_modules/pi-lens/dist/{chunk-P63GXC37.js → chunk-5LRUKYFA.js} +31 -4
- package/node_modules/pi-lens/dist/{chunk-HRNHZA3N.js → chunk-63NMUNYP.js} +12 -16
- package/node_modules/pi-lens/dist/{chunk-HWCCCQNX.js → chunk-6XSESGWD.js} +13 -6
- package/node_modules/pi-lens/dist/{chunk-UMS2MFPZ.js → chunk-72J27ICO.js} +2 -3
- package/node_modules/pi-lens/dist/{chunk-ED36RF6Y.js → chunk-7FLRUH6B.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-7IYC4ENJ.js +297 -0
- package/node_modules/pi-lens/dist/chunk-7WWQAW5P.js +30 -0
- package/node_modules/pi-lens/dist/{chunk-3DA2JDOL.js → chunk-7ZS7MC24.js} +551 -203
- package/node_modules/pi-lens/dist/{chunk-WMYE35PX.js → chunk-AHWA4AKM.js} +7 -5
- package/node_modules/pi-lens/dist/{chunk-JW3YWBVB.js → chunk-AI3GP74G.js} +17 -19
- package/node_modules/pi-lens/dist/{chunk-AGSS7277.js → chunk-APFJKOP6.js} +6 -23
- package/node_modules/pi-lens/dist/{chunk-ZVUL7QYY.js → chunk-ASRAO7KG.js} +29 -32
- package/node_modules/pi-lens/dist/{chunk-BW5KFIQC.js → chunk-AWQWXSW4.js} +1 -0
- package/node_modules/pi-lens/dist/{chunk-TLX72JTG.js → chunk-CG5V25HX.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-CKEQFGLT.js +32 -0
- package/node_modules/pi-lens/dist/{chunk-Y6GZHWSJ.js → chunk-COOUUC5W.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-XTBDCR27.js → chunk-CPZ5JJW6.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-RKKOYPRA.js → chunk-DS2USX5G.js} +13 -15
- package/node_modules/pi-lens/dist/chunk-EA2ZRG44.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-GSLNCYGG.js → chunk-EDMLIW6W.js} +13 -14
- package/node_modules/pi-lens/dist/{chunk-2EECBNC5.js → chunk-EIKRZ32J.js} +75 -0
- package/node_modules/pi-lens/dist/chunk-EKNWOL2I.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-R3T7CLQ2.js → chunk-ELZRSR5N.js} +41 -41
- package/node_modules/pi-lens/dist/{chunk-GMX5OS7B.js → chunk-EN5AM7PX.js} +11 -12
- package/node_modules/pi-lens/dist/{chunk-3RKP3FMS.js → chunk-EWXXLS26.js} +226 -24
- package/node_modules/pi-lens/dist/chunk-EX4EXBW7.js +37 -0
- package/node_modules/pi-lens/dist/{chunk-XHJBS436.js → chunk-EXVXBSGN.js} +25 -25
- package/node_modules/pi-lens/dist/{chunk-MZGQNL3Y.js → chunk-F7BO6FWH.js} +12 -13
- package/node_modules/pi-lens/dist/{chunk-V35JG4JB.js → chunk-FEDWAYDS.js} +152 -334
- package/node_modules/pi-lens/dist/{chunk-J64T55EI.js → chunk-FWZRGGGY.js} +73 -9
- package/node_modules/pi-lens/dist/{chunk-T57LYLZT.js → chunk-G224FADB.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-G5UCJFT7.js +26 -0
- package/node_modules/pi-lens/dist/{chunk-LLJNQKQW.js → chunk-GLW3YDZZ.js} +20 -13
- package/node_modules/pi-lens/dist/{chunk-GXFV6MYU.js → chunk-GTDSYEA2.js} +72 -39
- package/node_modules/pi-lens/dist/{chunk-DUO2TU77.js → chunk-GYRZ72R4.js} +10 -4
- package/node_modules/pi-lens/dist/chunk-HYVXA3BB.js +49 -0
- package/node_modules/pi-lens/dist/{chunk-W66O5E25.js → chunk-IEBJF3PN.js} +13 -15
- package/node_modules/pi-lens/dist/{chunk-GAQ7OQG6.js → chunk-IL7K66ZQ.js} +83 -94
- package/node_modules/pi-lens/dist/{chunk-T7FEBKXN.js → chunk-JWOVP5BL.js} +7 -9
- package/node_modules/pi-lens/dist/{chunk-UBOQLVT2.js → chunk-K2GUZ4DN.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-5VSF4UUQ.js → chunk-K4SZB56V.js} +34 -39
- package/node_modules/pi-lens/dist/{chunk-7D6L4MTX.js → chunk-KCBRHV5E.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-GSM5UU7A.js → chunk-KFXCL4OV.js} +38 -28
- package/node_modules/pi-lens/dist/{chunk-J6MPGQTS.js → chunk-KJJAVH3X.js} +81 -15
- package/node_modules/pi-lens/dist/{chunk-BWD5EPKO.js → chunk-KPVLQHCZ.js} +4 -6
- package/node_modules/pi-lens/dist/{chunk-MPNJLASA.js → chunk-KX56K73G.js} +10 -13
- package/node_modules/pi-lens/dist/{chunk-AWSCPCN2.js → chunk-LMCTHJ2H.js} +19 -19
- package/node_modules/pi-lens/dist/{chunk-IWDLU6K3.js → chunk-MEFLGBCS.js} +4 -6
- package/node_modules/pi-lens/dist/{chunk-TOY6QKOH.js → chunk-MKPCELNI.js} +17 -17
- package/node_modules/pi-lens/dist/{chunk-POMLXPMY.js → chunk-N3PLNNCW.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-N5FBM25N.js +22 -0
- package/node_modules/pi-lens/dist/{chunk-CYRKQRPM.js → chunk-NFNVDDGB.js} +2 -4
- package/node_modules/pi-lens/dist/{chunk-RMLC67LF.js → chunk-NLIVE7L6.js} +2 -30
- package/node_modules/pi-lens/dist/{chunk-24AKHFGP.js → chunk-OMJ3OFBJ.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-IQWN5JCP.js → chunk-OZNCKLOX.js} +13 -14
- package/node_modules/pi-lens/dist/chunk-P5XUGPIX.js +31 -0
- package/node_modules/pi-lens/dist/{chunk-2KXTHF3M.js → chunk-PJXNTPB2.js} +253 -33
- package/node_modules/pi-lens/dist/chunk-PKOXJIVT.js +88 -0
- package/node_modules/pi-lens/dist/{chunk-DGUKIYSI.js → chunk-PP2A5V2T.js} +8 -10
- package/node_modules/pi-lens/dist/{chunk-KAPJINKN.js → chunk-Q42LJANT.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-UZ2XCLYS.js → chunk-Q4BKKOVC.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-TIQ2PKDW.js → chunk-QT66NEYN.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-U44DJXQP.js → chunk-RCHO5W7M.js} +15 -18
- package/node_modules/pi-lens/dist/{chunk-YH5MVY2U.js → chunk-RG3MXTRI.js} +7 -7
- package/node_modules/pi-lens/dist/chunk-RG7OODGM.js +57 -0
- package/node_modules/pi-lens/dist/{chunk-OHKJ7PQF.js → chunk-RU34BA4D.js} +43 -39
- package/node_modules/pi-lens/dist/{chunk-JMYYOTQG.js → chunk-S26LC76R.js} +13 -1
- package/node_modules/pi-lens/dist/{chunk-XBJVAEEO.js → chunk-S55TEC7I.js} +3 -2
- package/node_modules/pi-lens/dist/{chunk-RVK72CZX.js → chunk-SJHC3BCZ.js} +1397 -481
- package/node_modules/pi-lens/dist/{chunk-IYNJ6YPZ.js → chunk-SNEUMLM7.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-S67KYG37.js → chunk-T4NGVFYI.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-YCWYO6TQ.js → chunk-THEXI2QO.js} +48 -45
- package/node_modules/pi-lens/dist/{chunk-AMERCH6V.js → chunk-TL2TCJYL.js} +15 -16
- package/node_modules/pi-lens/dist/{chunk-KUA4OJ5Y.js → chunk-TPYYEDP5.js} +823 -350
- package/node_modules/pi-lens/dist/{chunk-YNE3RP52.js → chunk-TVZRLTG6.js} +8 -1
- package/node_modules/pi-lens/dist/{chunk-ROYSX2S5.js → chunk-UCVMSOXF.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-UL5SXQVX.js +32 -0
- package/node_modules/pi-lens/dist/{chunk-7HXE67BN.js → chunk-UO66IMVP.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-VOOAPROD.js → chunk-UVY4TOJH.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-RKBXZN3A.js → chunk-VIDEKABZ.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-2FN63LPV.js → chunk-VITFDI3O.js} +13 -14
- package/node_modules/pi-lens/dist/{chunk-6DLWKFEX.js → chunk-VUAVE3QC.js} +41 -42
- package/node_modules/pi-lens/dist/{chunk-FM4RDMKT.js → chunk-WUY4BZEP.js} +10 -12
- package/node_modules/pi-lens/dist/{chunk-SD4I7ZO4.js → chunk-X3UTCXAA.js} +43 -53
- package/node_modules/pi-lens/dist/chunk-XHDBJODR.js +45 -0
- package/node_modules/pi-lens/dist/{chunk-5IUSNGOC.js → chunk-XHLK33VM.js} +28 -21
- package/node_modules/pi-lens/dist/{chunk-3KAZU3VR.js → chunk-XI34NWDI.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-QBFBRV2B.js → chunk-XWFIHYCH.js} +4 -2
- package/node_modules/pi-lens/dist/{chunk-JUKMK5Y4.js → chunk-Y2TPADJR.js} +10 -11
- package/node_modules/pi-lens/dist/{chunk-EBC36LNN.js → chunk-Y5KTA2OB.js} +17 -17
- package/node_modules/pi-lens/dist/{chunk-HYGZEMX6.js → chunk-YKVDBNPO.js} +11 -5
- package/node_modules/pi-lens/dist/{chunk-KN35K52N.js → chunk-YSDPVDFC.js} +3 -3
- package/node_modules/pi-lens/dist/chunk-YWNO5Q4R.js +44 -0
- package/node_modules/pi-lens/dist/{chunk-US7ECLD7.js → chunk-YWWG4AQA.js} +119 -28
- package/node_modules/pi-lens/dist/{chunk-O4NWQT6I.js → chunk-YXDCRUKQ.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-XYURS6EN.js → chunk-YXGRRORB.js} +15 -17
- package/node_modules/pi-lens/dist/{chunk-IUE7SSKV.js → chunk-ZAPSUBLU.js} +13 -7
- package/node_modules/pi-lens/dist/{chunk-EUXZEFTV.js → chunk-ZPJM7DID.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-5HSRT26B.js → chunk-ZSUX7KEM.js} +16 -15
- package/node_modules/pi-lens/dist/index.js +37155 -32210
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +11 -12
- package/node_modules/pi-lens/dist/mcp/cli.js +46 -45
- package/node_modules/pi-lens/dist/mcp/server.js +1210 -574
- package/node_modules/pi-lens/dist/mcp/worker.js +65 -65
- package/node_modules/pi-lens/dist/probes/installer.js +21 -23
- package/node_modules/pi-lens/docs/adr/0010-trace-validation-session-lifecycle.md +390 -0
- package/node_modules/pi-lens/docs/adr/README.md +1 -0
- package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +5 -3
- package/node_modules/pi-lens/docs/configuration.md +9 -0
- package/node_modules/pi-lens/docs/engineering-principles.md +12 -0
- package/node_modules/pi-lens/docs/environment-variables.md +20 -0
- package/node_modules/pi-lens/docs/features.md +16 -1
- package/node_modules/pi-lens/docs/globalconfig.md +37 -8
- package/node_modules/pi-lens/docs/lsp-capability-matrix.md +105 -12
- package/node_modules/pi-lens/docs/lsp-idle-eviction.md +37 -18
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +22 -1
- package/node_modules/pi-lens/docs/pi-lens-investigator.md +14 -0
- package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +23 -10
- package/node_modules/pi-lens/docs/pi-lens-monitor.md +64 -8
- package/node_modules/pi-lens/docs/pi-lens-retro.md +2 -2
- package/node_modules/pi-lens/docs/pi-lens-reviewer.md +48 -1
- package/node_modules/pi-lens/docs/pi-lens-subagent.md +8 -1
- package/node_modules/pi-lens/docs/release-qa-baseline.md +19 -7
- package/node_modules/pi-lens/docs/servercapabilities.md +47 -47
- package/node_modules/pi-lens/docs/settings.md +9 -5
- package/node_modules/pi-lens/docs/subagent-compat.md +1 -1
- package/node_modules/pi-lens/docs/usage.md +1 -0
- package/node_modules/pi-lens/package.json +6 -4
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-return-value-in-generator-test.yml +17 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-js-test.yml +86 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-test.yml +86 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/unchecked-numeric-parse-python-test.yml +15 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-return-value-in-generator.yml +9 -4
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +119 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +119 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/unchecked-numeric-parse-python.yml +13 -2
- package/node_modules/pi-lens/rules/rule-catalog.json +25 -1
- package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +15 -5
- package/node_modules/pi-lens/scripts/lib/is-main-module.mjs +27 -0
- package/node_modules/pi-lens/scripts/lib/scratch-home-env.mjs +21 -0
- package/node_modules/pi-lens/scripts/rpc-load-check.mjs +4 -6
- package/node_modules/pi-lens/scripts/warm-loader-cache.mjs +2 -5
- package/node_modules/pi-next-cue/package.json +4 -1
- package/node_modules/pi-provider-qoder/dist/index.js +438 -283
- package/node_modules/pi-provider-qoder/package.json +1 -1
- package/node_modules/pi-typesafe/README.md +6 -6
- package/node_modules/pi-typesafe/dist/ask.js +9 -2
- package/node_modules/pi-typesafe/dist/auth.d.ts +3 -2
- package/node_modules/pi-typesafe/dist/auth.js +2 -2
- package/node_modules/pi-typesafe/dist/backends.d.ts +20 -5
- package/node_modules/pi-typesafe/dist/backends.js +32 -8
- package/node_modules/pi-typesafe/dist/batch.d.ts +1 -1
- package/node_modules/pi-typesafe/dist/batch.js +2 -2
- package/node_modules/pi-typesafe/dist/client.d.ts +1 -1
- package/node_modules/pi-typesafe/dist/client.js +24 -12
- package/node_modules/pi-typesafe/dist/credentials.d.ts +8 -6
- package/node_modules/pi-typesafe/dist/credentials.js +70 -16
- package/node_modules/pi-typesafe/dist/extension.js +118 -26
- package/node_modules/pi-typesafe/dist/index.d.ts +1 -1
- package/node_modules/pi-typesafe/dist/index.js +1 -1
- package/node_modules/pi-typesafe/dist/key-prompt.d.ts +1 -1
- package/node_modules/pi-typesafe/dist/key-prompt.js +6 -6
- package/node_modules/pi-typesafe/dist/login.d.ts +11 -10
- package/node_modules/pi-typesafe/dist/login.js +24 -21
- package/node_modules/pi-typesafe/dist/schema.d.ts +8 -8
- package/node_modules/pi-typesafe/dist/schema.js +29 -7
- package/node_modules/pi-typesafe/package.json +2 -2
- package/package.json +12 -12
- package/node_modules/pi-lens/dist/chunk-3PTHXJXR.js +0 -28
- package/node_modules/pi-lens/dist/chunk-3QED2P4V.js +0 -31
- package/node_modules/pi-lens/dist/chunk-5WRPDP2A.js +0 -47
- package/node_modules/pi-lens/dist/chunk-ABBOA7UD.js +0 -157
- package/node_modules/pi-lens/dist/chunk-CUHSHSB6.js +0 -273
- package/node_modules/pi-lens/dist/chunk-GL5LUMZE.js +0 -51
- package/node_modules/pi-lens/dist/chunk-HAD7QRQI.js +0 -30
- package/node_modules/pi-lens/dist/chunk-JORED7EX.js +0 -44
- package/node_modules/pi-lens/dist/chunk-KYUB6QDC.js +0 -72
- package/node_modules/pi-lens/dist/chunk-LZSEQW6A.js +0 -57
- package/node_modules/pi-lens/dist/chunk-M2IFVFWU.js +0 -79
- package/node_modules/pi-lens/dist/chunk-M2UD3LPU.js +0 -88
- package/node_modules/pi-lens/dist/chunk-MBKQHGA7.js +0 -39
- package/node_modules/pi-lens/dist/chunk-R7YOCSNV.js +0 -23
- package/node_modules/pi-lens/dist/chunk-SKAMFC7A.js +0 -28
- package/node_modules/pi-lens/dist/chunk-SYE6T2EB.js +0 -28
- package/node_modules/pi-lens/dist/chunk-TRETHTQO.js +0 -26
- package/node_modules/pi-lens/dist/chunk-UA7ZXYDR.js +0 -184
- package/node_modules/pi-lens/dist/chunk-XTFDJI3T.js +0 -24
- package/node_modules/pi-lens/dist/chunk-Z3CCVDUB.js +0 -76
- package/node_modules/pi-next-cue/.github/workflows/publish.yml +0 -20
|
@@ -15,22 +15,21 @@ import {
|
|
|
15
15
|
getFilterStats,
|
|
16
16
|
isBuildArtifact,
|
|
17
17
|
sourceTwinCandidates
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-PP2A5V2T.js";
|
|
19
|
+
import "./chunk-S55TEC7I.js";
|
|
20
|
+
import "./chunk-TPYYEDP5.js";
|
|
21
21
|
import "./chunk-QYF5S6P6.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-GYRZ72R4.js";
|
|
23
|
+
import "./chunk-KJJAVH3X.js";
|
|
24
|
+
import "./chunk-ZSUX7KEM.js";
|
|
25
|
+
import "./chunk-EIKRZ32J.js";
|
|
26
|
+
import "./chunk-FWZRGGGY.js";
|
|
27
|
+
import "./chunk-N3PLNNCW.js";
|
|
28
|
+
import "./chunk-S26LC76R.js";
|
|
29
|
+
import "./chunk-XWFIHYCH.js";
|
|
30
|
+
import "./chunk-TVZRLTG6.js";
|
|
31
31
|
import "./chunk-LJDODBBZ.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-3RKP3FMS.js";
|
|
32
|
+
import "./chunk-EWXXLS26.js";
|
|
34
33
|
import "./chunk-NXL4FFQQ.js";
|
|
35
34
|
export {
|
|
36
35
|
ALL_SCANNABLE_EXTENSIONS,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
calcCyclomaticComplexity,
|
|
4
|
+
functionFactProvider
|
|
5
|
+
} from "./chunk-ZPJM7DID.js";
|
|
6
|
+
import "./chunk-G224FADB.js";
|
|
7
|
+
import "./chunk-5W3R6LFT.js";
|
|
8
|
+
import "./chunk-YWWG4AQA.js";
|
|
9
|
+
import "./chunk-Z54ZSOBZ.js";
|
|
10
|
+
import "./chunk-2Y6OJRSI.js";
|
|
11
|
+
import "./chunk-WUY4BZEP.js";
|
|
12
|
+
import "./chunk-GTDSYEA2.js";
|
|
13
|
+
import "./chunk-NLIVE7L6.js";
|
|
14
|
+
import "./chunk-5LRUKYFA.js";
|
|
15
|
+
import "./chunk-TPYYEDP5.js";
|
|
16
|
+
import "./chunk-GYRZ72R4.js";
|
|
17
|
+
import "./chunk-KJJAVH3X.js";
|
|
18
|
+
import "./chunk-ZSUX7KEM.js";
|
|
19
|
+
import "./chunk-EIKRZ32J.js";
|
|
20
|
+
import "./chunk-FWZRGGGY.js";
|
|
21
|
+
import "./chunk-N3PLNNCW.js";
|
|
22
|
+
import "./chunk-S26LC76R.js";
|
|
23
|
+
import "./chunk-XWFIHYCH.js";
|
|
24
|
+
import "./chunk-TVZRLTG6.js";
|
|
25
|
+
import "./chunk-LJDODBBZ.js";
|
|
26
|
+
import "./chunk-EWXXLS26.js";
|
|
27
|
+
import "./chunk-NXL4FFQQ.js";
|
|
28
|
+
export {
|
|
29
|
+
calcCyclomaticComplexity,
|
|
30
|
+
functionFactProvider
|
|
31
|
+
};
|
|
@@ -4,12 +4,22 @@ import {
|
|
|
4
4
|
reserveManagedToolRefreshSlot
|
|
5
5
|
} from "./chunk-UXVNL3D7.js";
|
|
6
6
|
import {
|
|
7
|
-
|
|
7
|
+
stripAnsi
|
|
8
|
+
} from "./chunk-6HWVI6MI.js";
|
|
9
|
+
import {
|
|
10
|
+
OPENGREP_REGISTRY_PACK_URL,
|
|
11
|
+
cachedOpengrepPackPath
|
|
12
|
+
} from "./chunk-UL5SXQVX.js";
|
|
13
|
+
import {
|
|
14
|
+
HOOK_WALL_BUDGET_MS
|
|
15
|
+
} from "./chunk-CKEQFGLT.js";
|
|
16
|
+
import {
|
|
8
17
|
bounded
|
|
9
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NLIVE7L6.js";
|
|
10
19
|
import {
|
|
11
20
|
acquireManagedInstallGate,
|
|
12
21
|
commitDurableStoreAsync,
|
|
22
|
+
findManagedToolBinary,
|
|
13
23
|
getManagedToolsDir,
|
|
14
24
|
getRefreshableManagedTools,
|
|
15
25
|
invalidateManagedToolResolution,
|
|
@@ -19,42 +29,45 @@ import {
|
|
|
19
29
|
refreshManagedTool,
|
|
20
30
|
resolveManagedNpmBinPath,
|
|
21
31
|
verifyToolBinary
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
32
|
+
} from "./chunk-IL7K66ZQ.js";
|
|
33
|
+
import "./chunk-4FHUGDKU.js";
|
|
24
34
|
import {
|
|
25
35
|
pmBinary,
|
|
26
36
|
resolveNodePackageManager,
|
|
27
37
|
updateArgs
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-K4SZB56V.js";
|
|
39
|
+
import "./chunk-XI34NWDI.js";
|
|
40
|
+
import "./chunk-5LRUKYFA.js";
|
|
41
|
+
import "./chunk-63NMUNYP.js";
|
|
42
|
+
import "./chunk-CG5V25HX.js";
|
|
43
|
+
import "./chunk-PP2A5V2T.js";
|
|
44
|
+
import "./chunk-S55TEC7I.js";
|
|
35
45
|
import {
|
|
36
46
|
safeSpawnAsync
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-
|
|
47
|
+
} from "./chunk-TPYYEDP5.js";
|
|
48
|
+
import "./chunk-AWQWXSW4.js";
|
|
39
49
|
import "./chunk-QYF5S6P6.js";
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import
|
|
44
|
-
|
|
50
|
+
import "./chunk-GYRZ72R4.js";
|
|
51
|
+
import "./chunk-KJJAVH3X.js";
|
|
52
|
+
import "./chunk-ZSUX7KEM.js";
|
|
53
|
+
import {
|
|
54
|
+
writeFileAtomicAsync
|
|
55
|
+
} from "./chunk-EIKRZ32J.js";
|
|
45
56
|
import {
|
|
46
57
|
recordDegradationOnce
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import
|
|
58
|
+
} from "./chunk-FWZRGGGY.js";
|
|
59
|
+
import "./chunk-N3PLNNCW.js";
|
|
60
|
+
import "./chunk-S26LC76R.js";
|
|
61
|
+
import "./chunk-XWFIHYCH.js";
|
|
62
|
+
import {
|
|
63
|
+
isTestMode
|
|
64
|
+
} from "./chunk-TVZRLTG6.js";
|
|
52
65
|
import "./chunk-LJDODBBZ.js";
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-3RKP3FMS.js";
|
|
66
|
+
import "./chunk-EWXXLS26.js";
|
|
55
67
|
import "./chunk-NXL4FFQQ.js";
|
|
56
68
|
|
|
57
69
|
// dist/clients/installer/managed-tool-refresh.js
|
|
70
|
+
import * as crypto from "node:crypto";
|
|
58
71
|
import * as fs from "node:fs/promises";
|
|
59
72
|
import * as path from "node:path";
|
|
60
73
|
var STATE_FILENAME = ".refresh-state.json";
|
|
@@ -142,10 +155,10 @@ async function readManagedToolRefreshState() {
|
|
|
142
155
|
return { status: "unreadable", reason: err.message };
|
|
143
156
|
}
|
|
144
157
|
}
|
|
145
|
-
async function writeRefreshStamp(toolId, entry) {
|
|
158
|
+
async function writeRefreshStamp(toolId, entry, options = {}) {
|
|
146
159
|
try {
|
|
147
160
|
await fs.mkdir(getManagedToolsDir(), { recursive: true });
|
|
148
|
-
await commitDurableStoreAsync({
|
|
161
|
+
const committed = await commitDurableStoreAsync({
|
|
149
162
|
path: getManagedToolRefreshStatePath(),
|
|
150
163
|
deserialize: (contents) => {
|
|
151
164
|
if (contents === void 0)
|
|
@@ -157,6 +170,10 @@ async function writeRefreshStamp(toolId, entry) {
|
|
|
157
170
|
}
|
|
158
171
|
},
|
|
159
172
|
merge: (disk) => {
|
|
173
|
+
const current = disk.tools[toolId];
|
|
174
|
+
if (options.retainNewerSuccess === true && entry.failed === true && current !== void 0 && current.failed !== true && current.checkedAt >= entry.checkedAt) {
|
|
175
|
+
return disk;
|
|
176
|
+
}
|
|
160
177
|
disk.tools[toolId] = entry;
|
|
161
178
|
return disk;
|
|
162
179
|
},
|
|
@@ -170,6 +187,9 @@ async function writeRefreshStamp(toolId, entry) {
|
|
|
170
187
|
logSessionStart(`managed-tool-refresh ${toolId}: stamp deferred because another process owns the lock`);
|
|
171
188
|
}
|
|
172
189
|
});
|
|
190
|
+
if (committed !== void 0 && committed.tools[toolId] !== entry) {
|
|
191
|
+
logSessionStart(`managed-tool-refresh ${toolId}: kept a newer successful stamp (checkedAt ${committed.tools[toolId]?.checkedAt ?? "unknown"}) \u2014 this failure does not replace it`);
|
|
192
|
+
}
|
|
173
193
|
} catch (err) {
|
|
174
194
|
recordDegradationOnce({
|
|
175
195
|
kind: "managed-tool-refresh",
|
|
@@ -303,7 +323,7 @@ async function refreshNonNpmOne(candidate, entry, now) {
|
|
|
303
323
|
// Deliberately NOT carrying `entry.etag` forward: a stamp that replays
|
|
304
324
|
// the validator of a run whose download failed would get a 304 next
|
|
305
325
|
// time and skip the install that never happened.
|
|
306
|
-
});
|
|
326
|
+
}, { retainNewerSuccess: true });
|
|
307
327
|
return {
|
|
308
328
|
toolId: candidate.toolId,
|
|
309
329
|
strategy: candidate.strategy,
|
|
@@ -405,7 +425,7 @@ async function performNpmRefresh(candidate, packageName, now) {
|
|
|
405
425
|
checkedAt: now,
|
|
406
426
|
failed: true,
|
|
407
427
|
...onDisk !== void 0 && { version: onDisk }
|
|
408
|
-
});
|
|
428
|
+
}, { retainNewerSuccess: true });
|
|
409
429
|
return {
|
|
410
430
|
toolId: candidate.toolId,
|
|
411
431
|
strategy: "npm",
|
|
@@ -446,7 +466,7 @@ async function performNpmRefresh(candidate, packageName, now) {
|
|
|
446
466
|
checkedAt: now,
|
|
447
467
|
failed: true,
|
|
448
468
|
...currentVersion !== void 0 && { version: currentVersion }
|
|
449
|
-
});
|
|
469
|
+
}, { retainNewerSuccess: true });
|
|
450
470
|
return {
|
|
451
471
|
toolId: candidate.toolId,
|
|
452
472
|
strategy: "npm",
|
|
@@ -479,13 +499,17 @@ async function performNpmRefresh(candidate, packageName, now) {
|
|
|
479
499
|
var refreshInFlight = null;
|
|
480
500
|
var noopTap = () => {
|
|
481
501
|
};
|
|
482
|
-
function runManagedToolRefresh(now = Date.now()) {
|
|
502
|
+
function runManagedToolRefresh(now = Date.now(), options = {}) {
|
|
483
503
|
const joined = refreshInFlight;
|
|
484
504
|
if (joined) {
|
|
485
505
|
logSessionStart("managed-tool-refresh: joining the refresh already in flight");
|
|
486
506
|
return joined;
|
|
487
507
|
}
|
|
488
|
-
const run = executeManagedToolRefresh(now, noopTap).
|
|
508
|
+
const run = executeManagedToolRefresh(now, noopTap).then(async (outcome) => {
|
|
509
|
+
if (options.rulePack !== false)
|
|
510
|
+
await refreshOpengrepRulePack(now);
|
|
511
|
+
return outcome;
|
|
512
|
+
}).finally(() => {
|
|
489
513
|
refreshInFlight = null;
|
|
490
514
|
});
|
|
491
515
|
refreshInFlight = run;
|
|
@@ -565,7 +589,7 @@ async function executeManagedToolRefresh(now, tap = noopTap) {
|
|
|
565
589
|
version: result.currentVersion
|
|
566
590
|
},
|
|
567
591
|
...result.ok ? {} : { failed: true }
|
|
568
|
-
}), {
|
|
592
|
+
}, { retainNewerSuccess: true }), {
|
|
569
593
|
ms: HOOK_WALL_BUDGET_MS.session_start,
|
|
570
594
|
// The unref'd timer runs after session_start returns, so no
|
|
571
595
|
// live turn signal belongs to this background refresh.
|
|
@@ -589,9 +613,205 @@ async function executeManagedToolRefresh(now, tap = noopTap) {
|
|
|
589
613
|
releaseReservation();
|
|
590
614
|
}
|
|
591
615
|
}
|
|
616
|
+
var OPENGREP_PACK_STAMP_ID = "opengrep-rules";
|
|
617
|
+
var PACK_FETCH_TIMEOUT_MS = 6e4;
|
|
618
|
+
var PACK_VALIDATE_TIMEOUT_MS = 18e4;
|
|
619
|
+
var PACK_MAX_BYTES = 16 * 1024 * 1024;
|
|
620
|
+
var PACK_MIN_RULES = 100;
|
|
621
|
+
function opengrepPackUrl() {
|
|
622
|
+
if (isTestMode()) {
|
|
623
|
+
return process.env.PI_LENS_TEST_OPENGREP_PACK_URL;
|
|
624
|
+
}
|
|
625
|
+
return OPENGREP_REGISTRY_PACK_URL;
|
|
626
|
+
}
|
|
627
|
+
async function downloadOpengrepPack(url) {
|
|
628
|
+
const res = await fetch(url, {
|
|
629
|
+
signal: AbortSignal.timeout(PACK_FETCH_TIMEOUT_MS),
|
|
630
|
+
// `identity` is load-bearing: semgrep.dev/c/auto answers a client that
|
|
631
|
+
// accepts gzip (Node's fetch does by default) with the rule set as JSON,
|
|
632
|
+
// and one that does not with YAML (measured 2026-10-23). The CLI loads
|
|
633
|
+
// either from a `.yaml` file; the language server loads the JSON as zero
|
|
634
|
+
// rules and publishes empty diagnostics, which would turn a cached pack
|
|
635
|
+
// into a silent clean scan.
|
|
636
|
+
headers: { "User-Agent": "pi-lens/1.0", "Accept-Encoding": "identity" }
|
|
637
|
+
});
|
|
638
|
+
if (!res.ok)
|
|
639
|
+
throw new Error(`HTTP ${res.status}`);
|
|
640
|
+
if (!res.body)
|
|
641
|
+
throw new Error("empty response body");
|
|
642
|
+
const chunks = [];
|
|
643
|
+
let total = 0;
|
|
644
|
+
const reader = res.body.getReader();
|
|
645
|
+
for (; ; ) {
|
|
646
|
+
const { done, value } = await reader.read();
|
|
647
|
+
if (done)
|
|
648
|
+
break;
|
|
649
|
+
total += value.byteLength;
|
|
650
|
+
if (total > PACK_MAX_BYTES) {
|
|
651
|
+
await reader.cancel();
|
|
652
|
+
throw new Error(`body exceeds ${PACK_MAX_BYTES} bytes`);
|
|
653
|
+
}
|
|
654
|
+
chunks.push(value);
|
|
655
|
+
}
|
|
656
|
+
const bytes = Buffer.concat(chunks);
|
|
657
|
+
if (bytes.toString("utf-8", 0, 64).trimStart().startsWith("{"))
|
|
658
|
+
throw new Error("registry answered JSON, not the YAML rule file");
|
|
659
|
+
return bytes;
|
|
660
|
+
}
|
|
661
|
+
async function validateOpengrepPack(binary, candidate) {
|
|
662
|
+
const spawned = await safeSpawnAsync(binary, ["scan", "--validate", "--config", candidate, "--disable-version-check"], {
|
|
663
|
+
cwd: path.dirname(candidate),
|
|
664
|
+
timeout: PACK_VALIDATE_TIMEOUT_MS,
|
|
665
|
+
ignoreAmbientSignal: true,
|
|
666
|
+
lifetimeCoupled: true
|
|
667
|
+
});
|
|
668
|
+
if (spawned.status !== 0) {
|
|
669
|
+
const detail = spawned.stderr.trim() || spawned.failure || `exit ${spawned.status}`;
|
|
670
|
+
return `opengrep --validate failed: ${detail}`.slice(0, 240);
|
|
671
|
+
}
|
|
672
|
+
const count = /(\d+) rule\(s\)/.exec(stripAnsi(`${spawned.stdout}
|
|
673
|
+
${spawned.stderr}`));
|
|
674
|
+
const rules = count ? Number(count[1]) : 0;
|
|
675
|
+
if (rules < PACK_MIN_RULES) {
|
|
676
|
+
return `opengrep --validate reported ${count ? rules : "no"} rules (floor ${PACK_MIN_RULES})`;
|
|
677
|
+
}
|
|
678
|
+
return void 0;
|
|
679
|
+
}
|
|
680
|
+
var PACK_CANDIDATE_MAX_AGE_MS = 60 * 60 * 1e3;
|
|
681
|
+
async function sweepStaleCandidates(finalPath) {
|
|
682
|
+
const dir = path.dirname(finalPath);
|
|
683
|
+
const prefix = `${path.basename(finalPath)}.candidate-`;
|
|
684
|
+
try {
|
|
685
|
+
for (const name of await fs.readdir(dir)) {
|
|
686
|
+
if (!name.startsWith(prefix))
|
|
687
|
+
continue;
|
|
688
|
+
const file = path.join(dir, name);
|
|
689
|
+
const { mtimeMs } = await fs.stat(file);
|
|
690
|
+
if (Date.now() - mtimeMs > PACK_CANDIDATE_MAX_AGE_MS)
|
|
691
|
+
await fs.rm(file, { force: true });
|
|
692
|
+
}
|
|
693
|
+
} catch (err) {
|
|
694
|
+
logSessionStart(`managed-tool-refresh ${OPENGREP_PACK_STAMP_ID}: could not sweep stale candidates (${err.message})`);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
async function refreshOpengrepRulePack(now = Date.now()) {
|
|
698
|
+
try {
|
|
699
|
+
if (process.env.PI_LENS_DISABLE_TOOL_REFRESH === "1")
|
|
700
|
+
return "skipped";
|
|
701
|
+
const url = opengrepPackUrl();
|
|
702
|
+
if (!url)
|
|
703
|
+
return "skipped";
|
|
704
|
+
const binary = await findManagedToolBinary("opengrep");
|
|
705
|
+
if (!binary)
|
|
706
|
+
return "skipped";
|
|
707
|
+
const read = await readManagedToolRefreshState();
|
|
708
|
+
if (read.status === "unreadable") {
|
|
709
|
+
recordDegradationOnce({
|
|
710
|
+
kind: "managed-tool-refresh",
|
|
711
|
+
subject: "refresh-state",
|
|
712
|
+
reason: `refresh state unreadable (${read.reason}); skipping refresh this session`
|
|
713
|
+
});
|
|
714
|
+
return "skipped";
|
|
715
|
+
}
|
|
716
|
+
const entry = read.state.tools[OPENGREP_PACK_STAMP_ID];
|
|
717
|
+
if (entry && now - entry.checkedAt < (entry.failed ? retryIntervalMs() : refreshIntervalMs())) {
|
|
718
|
+
return "skipped";
|
|
719
|
+
}
|
|
720
|
+
const declined = async (phase) => {
|
|
721
|
+
logSessionStart(`managed-tool-refresh ${OPENGREP_PACK_STAMP_ID}: declined (${phase}) \u2014 no stamp written, retried next session`);
|
|
722
|
+
return "declined";
|
|
723
|
+
};
|
|
724
|
+
const pre = await acquireManagedInstallGate(`managed tool refresh: ${OPENGREP_PACK_STAMP_ID}`);
|
|
725
|
+
if (!pre.ok)
|
|
726
|
+
return declined(pre.reason ?? "unknown");
|
|
727
|
+
await pre.release?.();
|
|
728
|
+
const finalPath = cachedOpengrepPackPath();
|
|
729
|
+
const candidate = `${finalPath}.candidate-${process.pid}-${crypto.randomBytes(4).toString("hex")}`;
|
|
730
|
+
const startedAt = Date.now();
|
|
731
|
+
try {
|
|
732
|
+
await fs.mkdir(path.dirname(finalPath), { recursive: true });
|
|
733
|
+
await sweepStaleCandidates(finalPath);
|
|
734
|
+
const bytes = await downloadOpengrepPack(url);
|
|
735
|
+
const digest = crypto.createHash("sha256").update(bytes).digest("hex");
|
|
736
|
+
let current;
|
|
737
|
+
try {
|
|
738
|
+
current = await fs.readFile(finalPath);
|
|
739
|
+
} catch (err) {
|
|
740
|
+
if (err.code !== "ENOENT")
|
|
741
|
+
throw err;
|
|
742
|
+
}
|
|
743
|
+
if (current && crypto.createHash("sha256").update(current).digest("hex") === digest) {
|
|
744
|
+
await writeRefreshStamp(OPENGREP_PACK_STAMP_ID, {
|
|
745
|
+
checkedAt: now,
|
|
746
|
+
version: digest.slice(0, 12)
|
|
747
|
+
});
|
|
748
|
+
logSessionStart(`managed-tool-refresh ${OPENGREP_PACK_STAMP_ID}: unchanged at ${digest.slice(0, 12)} (${Date.now() - startedAt}ms)`);
|
|
749
|
+
return "unchanged";
|
|
750
|
+
}
|
|
751
|
+
await writeFileAtomicAsync(candidate, bytes, { bestEffort: false });
|
|
752
|
+
const rejected = await validateOpengrepPack(binary, candidate);
|
|
753
|
+
if (rejected)
|
|
754
|
+
throw new Error(rejected);
|
|
755
|
+
const swap = await acquireManagedInstallGate(`managed tool refresh: ${OPENGREP_PACK_STAMP_ID} (swap)`);
|
|
756
|
+
if (!swap.ok)
|
|
757
|
+
return await declined(swap.reason ?? "unknown");
|
|
758
|
+
try {
|
|
759
|
+
const after = await readManagedToolRefreshState();
|
|
760
|
+
const latest = after.status === "ok" ? after.state.tools[OPENGREP_PACK_STAMP_ID] : void 0;
|
|
761
|
+
if (latest && !latest.failed && latest.checkedAt !== entry?.checkedAt) {
|
|
762
|
+
logSessionStart(`managed-tool-refresh ${OPENGREP_PACK_STAMP_ID}: another process refreshed first \u2014 keeping its pack`);
|
|
763
|
+
return "skipped";
|
|
764
|
+
}
|
|
765
|
+
await fs.rename(candidate, finalPath);
|
|
766
|
+
await writeRefreshStamp(OPENGREP_PACK_STAMP_ID, {
|
|
767
|
+
checkedAt: now,
|
|
768
|
+
version: digest.slice(0, 12)
|
|
769
|
+
});
|
|
770
|
+
} finally {
|
|
771
|
+
await swap.release?.();
|
|
772
|
+
}
|
|
773
|
+
logSessionStart(`managed-tool-refresh ${OPENGREP_PACK_STAMP_ID}: cached pack now ${digest.slice(0, 12)} (${bytes.byteLength} bytes, ${Date.now() - startedAt}ms)`);
|
|
774
|
+
return "refreshed";
|
|
775
|
+
} catch (err) {
|
|
776
|
+
const reason = err.message;
|
|
777
|
+
recordDegradationOnce({
|
|
778
|
+
kind: "managed-tool-refresh",
|
|
779
|
+
subject: OPENGREP_PACK_STAMP_ID,
|
|
780
|
+
reason: `rule pack refresh failed: ${reason}`
|
|
781
|
+
});
|
|
782
|
+
logSessionStart(`managed-tool-refresh ${OPENGREP_PACK_STAMP_ID}: refresh failed after ${Date.now() - startedAt}ms \u2014 keeping the current pack (${reason})`);
|
|
783
|
+
await writeRefreshStamp(
|
|
784
|
+
OPENGREP_PACK_STAMP_ID,
|
|
785
|
+
{
|
|
786
|
+
checkedAt: now,
|
|
787
|
+
failed: true,
|
|
788
|
+
...entry?.version !== void 0 && { version: entry.version }
|
|
789
|
+
},
|
|
790
|
+
// A winner that stamped while this attempt was validating keeps its
|
|
791
|
+
// `{checkedAt, version}` and its weekly cadence (shape 21).
|
|
792
|
+
{ retainNewerSuccess: true }
|
|
793
|
+
);
|
|
794
|
+
return "failed";
|
|
795
|
+
} finally {
|
|
796
|
+
try {
|
|
797
|
+
await fs.rm(candidate, { force: true });
|
|
798
|
+
} catch (err) {
|
|
799
|
+
logSessionStart(`managed-tool-refresh ${OPENGREP_PACK_STAMP_ID}: could not remove ${candidate} (${err.message})`);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
} catch (err) {
|
|
803
|
+
recordDegradationOnce({
|
|
804
|
+
kind: "managed-tool-refresh",
|
|
805
|
+
subject: OPENGREP_PACK_STAMP_ID,
|
|
806
|
+
reason: `rule pack refresh threw: ${err.message}`
|
|
807
|
+
});
|
|
808
|
+
return "failed";
|
|
809
|
+
}
|
|
810
|
+
}
|
|
592
811
|
export {
|
|
593
812
|
getManagedToolRefreshStatePath,
|
|
594
813
|
readManagedToolRefreshState,
|
|
814
|
+
refreshOpengrepRulePack,
|
|
595
815
|
runManagedToolRefresh,
|
|
596
816
|
runManagedToolRefreshForExploration,
|
|
597
817
|
selectStaleTools,
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
_getWarmWordIndexCacheStateForTests,
|
|
4
|
+
_resetWarmWordIndexCacheForTests,
|
|
5
|
+
acquireWarmWordIndex,
|
|
6
|
+
analyzeFile,
|
|
7
|
+
summarizeWarningTiers
|
|
8
|
+
} from "./chunk-4ODSZ35Z.js";
|
|
9
|
+
import "./chunk-K2GUZ4DN.js";
|
|
10
|
+
import "./chunk-3WCEHYOI.js";
|
|
11
|
+
import "./chunk-VIDEKABZ.js";
|
|
12
|
+
import "./chunk-T4NGVFYI.js";
|
|
13
|
+
import "./chunk-YSDPVDFC.js";
|
|
14
|
+
import "./chunk-UCVMSOXF.js";
|
|
15
|
+
import "./chunk-RG3MXTRI.js";
|
|
16
|
+
import "./chunk-7FLRUH6B.js";
|
|
17
|
+
import "./chunk-KPVLQHCZ.js";
|
|
18
|
+
import "./chunk-QT66NEYN.js";
|
|
19
|
+
import "./chunk-Y5KTA2OB.js";
|
|
20
|
+
import "./chunk-YKVDBNPO.js";
|
|
21
|
+
import "./chunk-Q4BKKOVC.js";
|
|
22
|
+
import "./chunk-2SDHYHHO.js";
|
|
23
|
+
import "./chunk-COOUUC5W.js";
|
|
24
|
+
import "./chunk-SNEUMLM7.js";
|
|
25
|
+
import "./chunk-ZPJM7DID.js";
|
|
26
|
+
import "./chunk-G224FADB.js";
|
|
27
|
+
import "./chunk-EXVXBSGN.js";
|
|
28
|
+
import "./chunk-3MED75HT.js";
|
|
29
|
+
import "./chunk-SJHC3BCZ.js";
|
|
30
|
+
import "./chunk-MEFLGBCS.js";
|
|
31
|
+
import "./chunk-XIMYZ3JA.js";
|
|
32
|
+
import "./chunk-7ZS7MC24.js";
|
|
33
|
+
import "./chunk-6XSESGWD.js";
|
|
34
|
+
import "./chunk-3SNDVPOR.js";
|
|
35
|
+
import "./chunk-JWOVP5BL.js";
|
|
36
|
+
import "./chunk-2LDMXL2M.js";
|
|
37
|
+
import "./chunk-5W3R6LFT.js";
|
|
38
|
+
import "./chunk-FEDWAYDS.js";
|
|
39
|
+
import "./chunk-CPZ5JJW6.js";
|
|
40
|
+
import "./chunk-7IYC4ENJ.js";
|
|
41
|
+
import "./chunk-KX56K73G.js";
|
|
42
|
+
import "./chunk-YWWG4AQA.js";
|
|
43
|
+
import "./chunk-Z54ZSOBZ.js";
|
|
44
|
+
import "./chunk-2Y6OJRSI.js";
|
|
45
|
+
import "./chunk-WUY4BZEP.js";
|
|
46
|
+
import "./chunk-GTDSYEA2.js";
|
|
47
|
+
import "./chunk-6HWVI6MI.js";
|
|
48
|
+
import "./chunk-UL5SXQVX.js";
|
|
49
|
+
import "./chunk-CKEQFGLT.js";
|
|
50
|
+
import "./chunk-NLIVE7L6.js";
|
|
51
|
+
import "./chunk-IEBJF3PN.js";
|
|
52
|
+
import "./chunk-UO66IMVP.js";
|
|
53
|
+
import "./chunk-Q42LJANT.js";
|
|
54
|
+
import "./chunk-APFJKOP6.js";
|
|
55
|
+
import "./chunk-2BEMIWEW.js";
|
|
56
|
+
import "./chunk-IJYGIDF4.js";
|
|
57
|
+
import "./chunk-IL7K66ZQ.js";
|
|
58
|
+
import "./chunk-4FHUGDKU.js";
|
|
59
|
+
import "./chunk-K4SZB56V.js";
|
|
60
|
+
import "./chunk-XI34NWDI.js";
|
|
61
|
+
import "./chunk-5LRUKYFA.js";
|
|
62
|
+
import "./chunk-63NMUNYP.js";
|
|
63
|
+
import "./chunk-CG5V25HX.js";
|
|
64
|
+
import "./chunk-PP2A5V2T.js";
|
|
65
|
+
import "./chunk-S55TEC7I.js";
|
|
66
|
+
import "./chunk-TPYYEDP5.js";
|
|
67
|
+
import "./chunk-AWQWXSW4.js";
|
|
68
|
+
import "./chunk-QYF5S6P6.js";
|
|
69
|
+
import "./chunk-GYRZ72R4.js";
|
|
70
|
+
import "./chunk-KJJAVH3X.js";
|
|
71
|
+
import "./chunk-ZSUX7KEM.js";
|
|
72
|
+
import "./chunk-EIKRZ32J.js";
|
|
73
|
+
import "./chunk-FWZRGGGY.js";
|
|
74
|
+
import "./chunk-N3PLNNCW.js";
|
|
75
|
+
import "./chunk-S26LC76R.js";
|
|
76
|
+
import "./chunk-XWFIHYCH.js";
|
|
77
|
+
import "./chunk-TVZRLTG6.js";
|
|
78
|
+
import "./chunk-LJDODBBZ.js";
|
|
79
|
+
import "./chunk-NFNVDDGB.js";
|
|
80
|
+
import "./chunk-EWXXLS26.js";
|
|
81
|
+
import "./chunk-NXL4FFQQ.js";
|
|
82
|
+
export {
|
|
83
|
+
_getWarmWordIndexCacheStateForTests,
|
|
84
|
+
_resetWarmWordIndexCacheForTests,
|
|
85
|
+
acquireWarmWordIndex,
|
|
86
|
+
analyzeFile,
|
|
87
|
+
summarizeWarningTiers
|
|
88
|
+
};
|
|
@@ -3,31 +3,29 @@ import {
|
|
|
3
3
|
shouldRecurseIntoDir,
|
|
4
4
|
walkTreeRecursiveSync,
|
|
5
5
|
walkTreeStackAsync
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-S55TEC7I.js";
|
|
7
7
|
import {
|
|
8
8
|
getProjectIgnoreMatcher
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TPYYEDP5.js";
|
|
10
10
|
import {
|
|
11
11
|
KIND_EXTENSIONS,
|
|
12
12
|
isCodeKindFile
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GYRZ72R4.js";
|
|
14
14
|
import {
|
|
15
15
|
classifyGeneratedOrArtifactDetailed,
|
|
16
16
|
isDeclarationFile
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KJJAVH3X.js";
|
|
18
18
|
import {
|
|
19
19
|
logLatency
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XWFIHYCH.js";
|
|
21
21
|
import {
|
|
22
22
|
toPositiveFinite
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import {
|
|
25
|
-
BoundedLruCache
|
|
26
|
-
} from "./chunk-ABBOA7UD.js";
|
|
23
|
+
} from "./chunk-TVZRLTG6.js";
|
|
27
24
|
import {
|
|
25
|
+
BoundedLruCache,
|
|
28
26
|
normalizeEphemeralMapKey,
|
|
29
27
|
normalizeFilePath
|
|
30
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-EWXXLS26.js";
|
|
31
29
|
|
|
32
30
|
// dist/clients/source-filter.js
|
|
33
31
|
import * as fs2 from "node:fs";
|
|
@@ -2,10 +2,10 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
DEFAULT_MAX_OUTPUT_BYTES,
|
|
4
4
|
writeFileAtomic
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EIKRZ32J.js";
|
|
6
6
|
import {
|
|
7
7
|
incrementDegradationCount
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FWZRGGGY.js";
|
|
9
9
|
|
|
10
10
|
// dist/clients/mcp/ipc.js
|
|
11
11
|
import * as crypto from "node:crypto";
|
|
@@ -4,32 +4,32 @@ import {
|
|
|
4
4
|
discoverManagedTool,
|
|
5
5
|
getManagedToolEnvironment,
|
|
6
6
|
resolveAvailableOrInstall
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2SDHYHHO.js";
|
|
8
8
|
import {
|
|
9
9
|
mapWithConcurrency
|
|
10
10
|
} from "./chunk-XIMYZ3JA.js";
|
|
11
11
|
import {
|
|
12
12
|
findNodeToolBinary
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-K4SZB56V.js";
|
|
14
14
|
import {
|
|
15
15
|
getIsolatedNpxSpawnOptions
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XI34NWDI.js";
|
|
17
17
|
import {
|
|
18
18
|
createAvailabilityLatch
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5LRUKYFA.js";
|
|
20
20
|
import {
|
|
21
21
|
safeSpawnAsync
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TPYYEDP5.js";
|
|
23
23
|
import {
|
|
24
24
|
compareOrdinal,
|
|
25
25
|
recordDegradationOnce
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FWZRGGGY.js";
|
|
27
27
|
import {
|
|
28
28
|
createSubsystemLogger
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-N3PLNNCW.js";
|
|
30
30
|
import {
|
|
31
31
|
isFullyQualified
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-EWXXLS26.js";
|
|
33
33
|
|
|
34
34
|
// dist/clients/dependency-checker.js
|
|
35
35
|
import * as fs from "node:fs";
|
|
@@ -2,7 +2,7 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
createAvailabilityProbeFlight,
|
|
4
4
|
probeToolAsync
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XI34NWDI.js";
|
|
6
6
|
import {
|
|
7
7
|
classifyProbeFailure,
|
|
8
8
|
createAvailabilityLatch,
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
describeProbeEvidence,
|
|
11
11
|
logAvailabilityDecision,
|
|
12
12
|
startHostStallSampler
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5LRUKYFA.js";
|
|
14
14
|
import {
|
|
15
15
|
createSingleFlight
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AWQWXSW4.js";
|
|
17
17
|
import {
|
|
18
18
|
createSubsystemLogger
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-N3PLNNCW.js";
|
|
20
20
|
|
|
21
21
|
// dist/clients/security-scan-client.js
|
|
22
22
|
import * as path from "node:path";
|