@herbertgao/pi-extensions 2026.10.1 → 2026.10.2
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 +13 -9
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-audit.md +2 -2
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-debt.md +2 -2
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-gain.md +1 -1
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-help.md +1 -1
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-review.md +2 -2
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail.md +1 -1
- package/node_modules/@dietrichgebert/ponytail/.qoder/rules/ponytail.md +21 -21
- package/node_modules/@dietrichgebert/ponytail/.qoder-plugin/plugin.json +1 -1
- package/node_modules/@dietrichgebert/ponytail/AGENTS.md +21 -21
- package/node_modules/@dietrichgebert/ponytail/README.md +68 -72
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-activate.js +7 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-instructions.js +30 -30
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-map.js +103 -0
- package/node_modules/@dietrichgebert/ponytail/package.json +2 -2
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail/SKILL.md +33 -101
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-audit/SKILL.md +89 -32
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-debt/SKILL.md +13 -12
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-gain/SKILL.md +17 -16
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-help/SKILL.md +9 -10
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-review/SKILL.md +96 -57
- package/node_modules/@herbertgao/pi-agency/LICENSE +21 -0
- package/node_modules/@herbertgao/pi-agency/README.md +40 -0
- package/node_modules/@herbertgao/pi-agency/package.json +53 -0
- package/node_modules/@herbertgao/pi-agency/src/index.ts +441 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +12 -12
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +30 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +15 -9
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +27 -9
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/codemode.ts +4 -1
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +2 -2
- package/node_modules/@narumitw/pi-caffeinate/package.json +3 -3
- package/node_modules/@tifan/pi-mermaid-open/package.json +5 -1
- package/node_modules/@tifan/pi-mermaid-open/src/index.ts +26 -9
- package/node_modules/@tifan/pi-recap/package.json +1 -1
- package/node_modules/@tifan/pi-recap/src/index.ts +104 -20
- package/node_modules/@tifan/pi-recap/src/models.ts +46 -4
- package/node_modules/pi-antigravity/README.md +23 -2
- package/node_modules/pi-antigravity/package.json +5 -3
- package/node_modules/pi-antigravity/src/diagnostics/diagnostics.ts +3 -2
- package/node_modules/pi-antigravity/src/features/generate-image.ts +72 -0
- package/node_modules/pi-antigravity/src/features/google-search.ts +71 -0
- package/node_modules/pi-antigravity/src/image/image.ts +86 -47
- package/node_modules/pi-antigravity/src/image/native.ts +69 -0
- package/node_modules/pi-antigravity/src/index.ts +52 -137
- package/node_modules/pi-antigravity/src/search/search.ts +130 -31
- package/node_modules/pi-antigravity/src/stream/stream.ts +162 -113
- package/node_modules/pi-antigravity/src/types/enums.ts +1 -0
- package/node_modules/pi-antigravity/src/types/types.ts +1 -1
- package/node_modules/pi-antigravity/src/utils/security.ts +47 -1
- package/node_modules/pi-antigravity/src/utils/util.ts +38 -6
- package/node_modules/pi-lens/CHANGELOG.md +1064 -0
- package/node_modules/pi-lens/README.md +115 -25
- package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +6 -2
- package/node_modules/pi-lens/dist/chunk-22AVIGXS.js +560 -0
- package/node_modules/pi-lens/dist/chunk-27BBHSZC.js +106 -0
- package/node_modules/pi-lens/dist/chunk-2BEMIWEW.js +51 -0
- package/node_modules/pi-lens/dist/chunk-2EECBNC5.js +89 -0
- package/node_modules/pi-lens/dist/chunk-34U7PLGE.js +23 -0
- package/node_modules/pi-lens/dist/chunk-3I5QFT3N.js +181 -0
- package/node_modules/pi-lens/dist/chunk-3MED75HT.js +37 -0
- package/node_modules/pi-lens/dist/chunk-47D2BO4S.js +87 -0
- package/node_modules/pi-lens/dist/chunk-4RERDEXR.js +348 -0
- package/node_modules/pi-lens/dist/chunk-4W2PLC4J.js +27 -0
- package/node_modules/pi-lens/dist/chunk-52H5B5TC.js +202 -0
- package/node_modules/pi-lens/dist/chunk-54B42YRX.js +27 -0
- package/node_modules/pi-lens/dist/chunk-5RXBNSW2.js +266 -0
- package/node_modules/pi-lens/dist/chunk-5THXD6X5.js +201 -0
- package/node_modules/pi-lens/dist/chunk-5W3R6LFT.js +24 -0
- package/node_modules/pi-lens/dist/chunk-5ZEJHV35.js +341 -0
- package/node_modules/pi-lens/dist/chunk-6P62QVEA.js +118 -0
- package/node_modules/pi-lens/dist/chunk-6QIUX4EP.js +459 -0
- package/node_modules/pi-lens/dist/chunk-6VCD4VKZ.js +78 -0
- package/node_modules/pi-lens/dist/chunk-7F72PXY2.js +326 -0
- package/node_modules/pi-lens/dist/chunk-7FBF7NPR.js +998 -0
- package/node_modules/pi-lens/dist/chunk-7U2IDNXN.js +37 -0
- package/node_modules/pi-lens/dist/chunk-ABBOA7UD.js +157 -0
- package/node_modules/pi-lens/dist/chunk-AHDW3GPE.js +50 -0
- package/node_modules/pi-lens/dist/chunk-AJ3QXTRQ.js +756 -0
- package/node_modules/pi-lens/dist/chunk-AJVLWNFN.js +1610 -0
- package/node_modules/pi-lens/dist/chunk-AJXODZY6.js +112 -0
- package/node_modules/pi-lens/dist/chunk-ARFCXG7S.js +84 -0
- package/node_modules/pi-lens/dist/chunk-AS44CFQ4.js +708 -0
- package/node_modules/pi-lens/dist/chunk-AWE5TMPO.js +38 -0
- package/node_modules/pi-lens/dist/chunk-B3I2UUT4.js +4692 -0
- package/node_modules/pi-lens/dist/chunk-BRJKOBZP.js +331 -0
- package/node_modules/pi-lens/dist/chunk-BW5KFIQC.js +59 -0
- package/node_modules/pi-lens/dist/chunk-C2AUYXQH.js +149 -0
- package/node_modules/pi-lens/dist/chunk-CGGAIP7J.js +29 -0
- package/node_modules/pi-lens/dist/chunk-D6QS3U6M.js +30 -0
- package/node_modules/pi-lens/dist/chunk-DFVMIKMQ.js +349 -0
- package/node_modules/pi-lens/dist/chunk-DIULIWKU.js +169 -0
- package/node_modules/pi-lens/dist/chunk-DQ2NZ7C4.js +2317 -0
- package/node_modules/pi-lens/dist/chunk-E2WFBRHM.js +213 -0
- package/node_modules/pi-lens/dist/chunk-E4MAEDPM.js +50 -0
- package/node_modules/pi-lens/dist/chunk-EOKRQ3SA.js +30 -0
- package/node_modules/pi-lens/dist/chunk-F3AU2TMM.js +2626 -0
- package/node_modules/pi-lens/dist/chunk-F3P7VQ7H.js +170 -0
- package/node_modules/pi-lens/dist/chunk-FC4RP4I2.js +12 -0
- package/node_modules/pi-lens/dist/chunk-FJNKANOS.js +32 -0
- package/node_modules/pi-lens/dist/chunk-GUOGVTCQ.js +146 -0
- package/node_modules/pi-lens/dist/chunk-GVXA6CCE.js +18 -0
- package/node_modules/pi-lens/dist/chunk-HHYAELLJ.js +2334 -0
- package/node_modules/pi-lens/dist/chunk-HMFXILPV.js +83 -0
- package/node_modules/pi-lens/dist/chunk-HVUZXSWK.js +421 -0
- package/node_modules/pi-lens/dist/chunk-HWBZIGMJ.js +62 -0
- package/node_modules/pi-lens/dist/chunk-I3R7GKDR.js +17 -0
- package/node_modules/pi-lens/dist/chunk-I7SPGOWI.js +55 -0
- package/node_modules/pi-lens/dist/chunk-IIXOAGHR.js +38 -0
- package/node_modules/pi-lens/dist/chunk-IVP5KAB7.js +2250 -0
- package/node_modules/pi-lens/dist/chunk-IXEBJSUE.js +22 -0
- package/node_modules/pi-lens/dist/chunk-JOLITGCC.js +27 -0
- package/node_modules/pi-lens/dist/chunk-K6VYLB2U.js +145 -0
- package/node_modules/pi-lens/dist/chunk-LJDODBBZ.js +78 -0
- package/node_modules/pi-lens/dist/chunk-LNAKEO63.js +78 -0
- package/node_modules/pi-lens/dist/chunk-LSMJ6KBE.js +4139 -0
- package/node_modules/pi-lens/dist/chunk-LW6XKDZQ.js +5565 -0
- package/node_modules/pi-lens/dist/chunk-N3YQJI6O.js +899 -0
- package/node_modules/pi-lens/dist/chunk-NABLC7W3.js +148 -0
- package/node_modules/pi-lens/dist/chunk-NKOUFPQF.js +659 -0
- package/node_modules/pi-lens/dist/chunk-NL5GLMFI.js +211 -0
- package/node_modules/pi-lens/dist/chunk-NMABWBZN.js +327 -0
- package/node_modules/pi-lens/dist/chunk-NTHH2J74.js +27 -0
- package/node_modules/pi-lens/dist/chunk-NTUJEGDZ.js +59 -0
- package/node_modules/pi-lens/dist/chunk-NXL4FFQQ.js +47 -0
- package/node_modules/pi-lens/dist/chunk-NXPS2L6U.js +466 -0
- package/node_modules/pi-lens/dist/chunk-O5WILGMI.js +42 -0
- package/node_modules/pi-lens/dist/chunk-O6TQT6RI.js +48 -0
- package/node_modules/pi-lens/dist/chunk-OAXNDZJ7.js +323 -0
- package/node_modules/pi-lens/dist/chunk-ODEEOXPH.js +44 -0
- package/node_modules/pi-lens/dist/chunk-OQGFCZJ4.js +4533 -0
- package/node_modules/pi-lens/dist/chunk-ORTMY4Q4.js +282 -0
- package/node_modules/pi-lens/dist/chunk-OS32RNR2.js +442 -0
- package/node_modules/pi-lens/dist/chunk-PAK6IDME.js +189 -0
- package/node_modules/pi-lens/dist/chunk-PWFHBTSF.js +406 -0
- package/node_modules/pi-lens/dist/chunk-Q5U6FMDI.js +2352 -0
- package/node_modules/pi-lens/dist/chunk-QOZXJ4NA.js +3364 -0
- package/node_modules/pi-lens/dist/chunk-QYF5S6P6.js +45 -0
- package/node_modules/pi-lens/dist/chunk-RIISMHKN.js +36 -0
- package/node_modules/pi-lens/dist/chunk-RPD4ZSB7.js +25 -0
- package/node_modules/pi-lens/dist/chunk-RPD5K5NC.js +79 -0
- package/node_modules/pi-lens/dist/chunk-RUOG5D2C.js +262 -0
- package/node_modules/pi-lens/dist/chunk-T4ERT73Y.js +599 -0
- package/node_modules/pi-lens/dist/chunk-T6D4Q4AQ.js +54 -0
- package/node_modules/pi-lens/dist/chunk-TGPXLY2J.js +391 -0
- package/node_modules/pi-lens/dist/chunk-TLGFBM3F.js +12116 -0
- package/node_modules/pi-lens/dist/chunk-TO6WL3GM.js +88 -0
- package/node_modules/pi-lens/dist/chunk-TT22N74J.js +517 -0
- package/node_modules/pi-lens/dist/chunk-TVN5N6GY.js +21216 -0
- package/node_modules/pi-lens/dist/chunk-U3VGR4VU.js +308 -0
- package/node_modules/pi-lens/dist/chunk-UK3CMEAL.js +1250 -0
- package/node_modules/pi-lens/dist/chunk-UOPVJQ4N.js +103 -0
- package/node_modules/pi-lens/dist/chunk-UXVNL3D7.js +23 -0
- package/node_modules/pi-lens/dist/chunk-UY752QSN.js +45 -0
- package/node_modules/pi-lens/dist/chunk-V5PXFSZK.js +188 -0
- package/node_modules/pi-lens/dist/chunk-V7R425XG.js +398 -0
- package/node_modules/pi-lens/dist/chunk-VCSRSYLF.js +81 -0
- package/node_modules/pi-lens/dist/chunk-VD4JQCQC.js +162 -0
- package/node_modules/pi-lens/dist/chunk-VDBPVIKD.js +62 -0
- package/node_modules/pi-lens/dist/chunk-VHQLPIRJ.js +114 -0
- package/node_modules/pi-lens/dist/chunk-VN2AXLEX.js +5414 -0
- package/node_modules/pi-lens/dist/chunk-VNMT7C64.js +478 -0
- package/node_modules/pi-lens/dist/chunk-WONERJTP.js +309 -0
- package/node_modules/pi-lens/dist/chunk-XECLWQZN.js +85 -0
- package/node_modules/pi-lens/dist/chunk-XIMYZ3JA.js +27 -0
- package/node_modules/pi-lens/dist/chunk-XK4CIILI.js +144 -0
- package/node_modules/pi-lens/dist/chunk-Y4T27COV.js +562 -0
- package/node_modules/pi-lens/dist/chunk-YGVYKNSN.js +1860 -0
- package/node_modules/pi-lens/dist/chunk-YLF3PPT5.js +308 -0
- package/node_modules/pi-lens/dist/chunk-YSNFMJKN.js +14 -0
- package/node_modules/pi-lens/dist/chunk-Z3CCVDUB.js +76 -0
- package/node_modules/pi-lens/dist/chunk-Z54ZSOBZ.js +61 -0
- package/node_modules/pi-lens/dist/chunk-ZAWW3AF6.js +97 -0
- package/node_modules/pi-lens/dist/chunk-ZMOL6RQC.js +167 -0
- package/node_modules/pi-lens/dist/index.js +16456 -8335
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +186 -232
- package/node_modules/pi-lens/dist/mcp/cli.js +137 -98
- package/node_modules/pi-lens/dist/mcp/server.js +22589 -1573
- package/node_modules/pi-lens/dist/mcp/worker.js +97 -38
- package/node_modules/pi-lens/dist/probes/installer.js +135 -0
- package/node_modules/pi-lens/dist/workers/project-snapshot-persist-worker.js +22 -0
- package/node_modules/pi-lens/dist/workers/review-graph-persist-worker.js +15 -0
- package/node_modules/pi-lens/docs/agent-guide.md +13 -4
- package/node_modules/pi-lens/docs/agent-tools.md +42 -0
- package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +3 -2
- package/node_modules/pi-lens/docs/configuration.md +20 -1
- package/node_modules/pi-lens/docs/environment-variables.md +52 -2
- package/node_modules/pi-lens/docs/features.md +8 -4
- package/node_modules/pi-lens/docs/globalconfig.md +1 -0
- package/node_modules/pi-lens/docs/io-bridge-v2-migration.md +94 -0
- package/node_modules/pi-lens/docs/lsp-capability-matrix.md +36 -4
- package/node_modules/pi-lens/docs/lsp-idle-eviction.md +124 -0
- package/node_modules/pi-lens/docs/mcp.md +21 -5
- package/node_modules/pi-lens/docs/merge-queue-rollout.md +77 -0
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +156 -88
- package/node_modules/pi-lens/docs/pi-lens-investigator.md +74 -26
- package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +694 -0
- package/node_modules/pi-lens/docs/pi-lens-monitor.md +73 -7
- package/node_modules/pi-lens/docs/pi-lens-retro.md +6 -4
- package/node_modules/pi-lens/docs/pi-lens-reviewer.md +188 -48
- package/node_modules/pi-lens/docs/pi-lens-subagent.md +246 -45
- package/node_modules/pi-lens/docs/pi-lens-warden.md +18 -7
- package/node_modules/pi-lens/docs/public-api-stability.md +55 -0
- package/node_modules/pi-lens/docs/release-qa-baseline.md +84 -17
- package/node_modules/pi-lens/docs/rfcs/3654-unified-io-bridge-v2.md +316 -0
- package/node_modules/pi-lens/docs/servercapabilities.md +53 -49
- package/node_modules/pi-lens/docs/settings.md +1 -0
- package/node_modules/pi-lens/docs/usage.md +5 -1
- package/node_modules/pi-lens/grammars/tree-sitter-bash.wasm +0 -0
- package/node_modules/pi-lens/grammars/tree-sitter-bash.wasm.json +3 -3
- package/node_modules/pi-lens/package.json +18 -6
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/advisory-registry-subset-test.yml +41 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/advisory-registry-subset.yml +50 -0
- package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +1275 -62
- package/node_modules/pi-lens/scripts/download-grammars.js +5 -0
- package/node_modules/pi-lens/scripts/grammars.lock.json +6 -1
- package/node_modules/pi-lens/scripts/install-selftest.mjs +33 -34
- package/node_modules/pi-lens/scripts/lib/host-provided-deps.mjs +13 -4
- package/node_modules/pi-lens/scripts/lib/web-tree-sitter-dir.mjs +18 -0
- package/package.json +15 -10
- package/node_modules/@dietrichgebert/ponytail/README.es.md +0 -212
- package/node_modules/@dietrichgebert/ponytail/README.ja.md +0 -212
- package/node_modules/@dietrichgebert/ponytail/README.ko.md +0 -212
- package/node_modules/@dietrichgebert/ponytail/README.zh-CN.md +0 -212
- package/node_modules/pi-lens/dist/clients/actionable-warnings-logger.js +0 -35
- package/node_modules/pi-lens/dist/clients/actionable-warnings.js +0 -1610
- package/node_modules/pi-lens/dist/clients/advisory-provenance.js +0 -593
- package/node_modules/pi-lens/dist/clients/agent-behavior-client.js +0 -147
- package/node_modules/pi-lens/dist/clients/agent-nudge.js +0 -325
- package/node_modules/pi-lens/dist/clients/analysed-root.js +0 -1
- package/node_modules/pi-lens/dist/clients/ast-grep-client.js +0 -731
- package/node_modules/pi-lens/dist/clients/ast-grep-rule-manager.js +0 -146
- package/node_modules/pi-lens/dist/clients/ast-grep-tool-logger.js +0 -118
- package/node_modules/pi-lens/dist/clients/ast-grep-types.js +0 -10
- package/node_modules/pi-lens/dist/clients/ast-grep-yaml-synth.js +0 -154
- package/node_modules/pi-lens/dist/clients/atomic-write-staging.js +0 -75
- package/node_modules/pi-lens/dist/clients/atomic-write.js +0 -189
- package/node_modules/pi-lens/dist/clients/availability-probe-flight.js +0 -12
- package/node_modules/pi-lens/dist/clients/bash-file-access.js +0 -1056
- package/node_modules/pi-lens/dist/clients/biome-client.js +0 -357
- package/node_modules/pi-lens/dist/clients/blocker-freshness.js +0 -837
- package/node_modules/pi-lens/dist/clients/blocker-past-eof.js +0 -129
- package/node_modules/pi-lens/dist/clients/bootstrap.js +0 -569
- package/node_modules/pi-lens/dist/clients/bounded-cache.js +0 -190
- package/node_modules/pi-lens/dist/clients/bounded-pid-file-lock.js +0 -202
- package/node_modules/pi-lens/dist/clients/bounded-telemetry.js +0 -295
- package/node_modules/pi-lens/dist/clients/build-identity.js +0 -95
- package/node_modules/pi-lens/dist/clients/bundled-resource-health.js +0 -113
- package/node_modules/pi-lens/dist/clients/bus-events-logger.js +0 -105
- package/node_modules/pi-lens/dist/clients/bus-publish.js +0 -171
- package/node_modules/pi-lens/dist/clients/cache/rule-cache.js +0 -190
- package/node_modules/pi-lens/dist/clients/cache-manager.js +0 -524
- package/node_modules/pi-lens/dist/clients/cache-observability.js +0 -1313
- package/node_modules/pi-lens/dist/clients/call-graph.js +0 -852
- package/node_modules/pi-lens/dist/clients/cargo-manifest.js +0 -422
- package/node_modules/pi-lens/dist/clients/cascade-budget.js +0 -196
- package/node_modules/pi-lens/dist/clients/cascade-format.js +0 -315
- package/node_modules/pi-lens/dist/clients/cascade-logger.js +0 -31
- package/node_modules/pi-lens/dist/clients/cascade-types.js +0 -9
- package/node_modules/pi-lens/dist/clients/child-unref.js +0 -124
- package/node_modules/pi-lens/dist/clients/code-quality-warnings.js +0 -286
- package/node_modules/pi-lens/dist/clients/codebase-model.js +0 -173
- package/node_modules/pi-lens/dist/clients/collateral-test-role.js +0 -40
- package/node_modules/pi-lens/dist/clients/complexity-client.js +0 -462
- package/node_modules/pi-lens/dist/clients/config-core/deny.js +0 -221
- package/node_modules/pi-lens/dist/clients/config-core/index.js +0 -50
- package/node_modules/pi-lens/dist/clients/config-core/merge.js +0 -357
- package/node_modules/pi-lens/dist/clients/config-core/normalize.js +0 -340
- package/node_modules/pi-lens/dist/clients/config-core/process-spec.js +0 -248
- package/node_modules/pi-lens/dist/clients/config-core/provenance.js +0 -164
- package/node_modules/pi-lens/dist/clients/config-core/records.js +0 -218
- package/node_modules/pi-lens/dist/clients/config-core/resolve.js +0 -125
- package/node_modules/pi-lens/dist/clients/config-core/safe-object.js +0 -78
- package/node_modules/pi-lens/dist/clients/config-core/schema.js +0 -165
- package/node_modules/pi-lens/dist/clients/config-diagnostic-codes.js +0 -285
- package/node_modules/pi-lens/dist/clients/config-locations.js +0 -388
- package/node_modules/pi-lens/dist/clients/config-resolve.js +0 -798
- package/node_modules/pi-lens/dist/clients/config-schema.js +0 -251
- package/node_modules/pi-lens/dist/clients/config-warn.js +0 -407
- package/node_modules/pi-lens/dist/clients/console-guard-install.js +0 -26
- package/node_modules/pi-lens/dist/clients/cooperative-budget.js +0 -42
- package/node_modules/pi-lens/dist/clients/dead-code-client.js +0 -510
- package/node_modules/pi-lens/dist/clients/dead-code-logger.js +0 -30
- package/node_modules/pi-lens/dist/clients/deadline-utils.js +0 -280
- package/node_modules/pi-lens/dist/clients/debug-handles.js +0 -211
- package/node_modules/pi-lens/dist/clients/debug-heap.js +0 -174
- package/node_modules/pi-lens/dist/clients/deferred-lsp-work.js +0 -106
- package/node_modules/pi-lens/dist/clients/degradation-ledger.js +0 -426
- package/node_modules/pi-lens/dist/clients/demoted-finding-render.js +0 -169
- package/node_modules/pi-lens/dist/clients/dependency-checker.js +0 -885
- package/node_modules/pi-lens/dist/clients/deps/ast-grep-napi.js +0 -22
- package/node_modules/pi-lens/dist/clients/deps/js-yaml.js +0 -9
- package/node_modules/pi-lens/dist/clients/deps/minimatch.js +0 -4
- package/node_modules/pi-lens/dist/clients/deps/pi-tui.js +0 -14
- package/node_modules/pi-lens/dist/clients/deps/typebox.js +0 -14
- package/node_modules/pi-lens/dist/clients/deps/vscode-jsonrpc.js +0 -1
- package/node_modules/pi-lens/dist/clients/deps/web-tree-sitter.js +0 -24
- package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +0 -630
- package/node_modules/pi-lens/dist/clients/diagnostic-line-freshness.js +0 -305
- package/node_modules/pi-lens/dist/clients/diagnostic-logger.js +0 -73
- package/node_modules/pi-lens/dist/clients/diagnostic-tracker.js +0 -105
- package/node_modules/pi-lens/dist/clients/diagnostics-publish.js +0 -230
- package/node_modules/pi-lens/dist/clients/dispatch/ast-grep-catalog.js +0 -65
- package/node_modules/pi-lens/dist/clients/dispatch/auxiliary-lsp.js +0 -343
- package/node_modules/pi-lens/dist/clients/dispatch/collect-later-tier.js +0 -35
- package/node_modules/pi-lens/dist/clients/dispatch/diagnostic-taxonomy.js +0 -66
- package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +0 -1269
- package/node_modules/pi-lens/dist/clients/dispatch/fact-provider-types.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/fact-rule-runner.js +0 -17
- package/node_modules/pi-lens/dist/clients/dispatch/fact-runner.js +0 -30
- package/node_modules/pi-lens/dist/clients/dispatch/fact-scheduler.js +0 -68
- package/node_modules/pi-lens/dist/clients/dispatch/fact-store.js +0 -377
- package/node_modules/pi-lens/dist/clients/dispatch/facts/comment-facts.js +0 -22
- package/node_modules/pi-lens/dist/clients/dispatch/facts/file-content.js +0 -19
- package/node_modules/pi-lens/dist/clients/dispatch/facts/function-facts.js +0 -348
- package/node_modules/pi-lens/dist/clients/dispatch/facts/import-facts.js +0 -204
- package/node_modules/pi-lens/dist/clients/dispatch/facts/tree-sitter-facts.js +0 -34
- package/node_modules/pi-lens/dist/clients/dispatch/facts/try-catch-facts.js +0 -119
- package/node_modules/pi-lens/dist/clients/dispatch/finding-policy.js +0 -339
- package/node_modules/pi-lens/dist/clients/dispatch/indent-detect.js +0 -417
- package/node_modules/pi-lens/dist/clients/dispatch/inline-suppressions.js +0 -89
- package/node_modules/pi-lens/dist/clients/dispatch/integration.js +0 -2377
- package/node_modules/pi-lens/dist/clients/dispatch/lazy.js +0 -11
- package/node_modules/pi-lens/dist/clients/dispatch/pending-runner-findings.js +0 -87
- package/node_modules/pi-lens/dist/clients/dispatch/plan.js +0 -278
- package/node_modules/pi-lens/dist/clients/dispatch/priorities.js +0 -20
- package/node_modules/pi-lens/dist/clients/dispatch/rule-id-normalize.js +0 -50
- package/node_modules/pi-lens/dist/clients/dispatch/rule-ignores.js +0 -69
- package/node_modules/pi-lens/dist/clients/dispatch/rule-policy.js +0 -135
- package/node_modules/pi-lens/dist/clients/dispatch/rules/async-noise.js +0 -40
- package/node_modules/pi-lens/dist/clients/dispatch/rules/async-unnecessary-wrapper.js +0 -27
- package/node_modules/pi-lens/dist/clients/dispatch/rules/cors-wildcard.js +0 -54
- package/node_modules/pi-lens/dist/clients/dispatch/rules/error-obscuring.js +0 -32
- package/node_modules/pi-lens/dist/clients/dispatch/rules/error-swallowing.js +0 -31
- package/node_modules/pi-lens/dist/clients/dispatch/rules/framework-call-noise.js +0 -67
- package/node_modules/pi-lens/dist/clients/dispatch/rules/high-complexity.js +0 -72
- package/node_modules/pi-lens/dist/clients/dispatch/rules/high-fan-out.js +0 -74
- package/node_modules/pi-lens/dist/clients/dispatch/rules/high-import-coupling.js +0 -37
- package/node_modules/pi-lens/dist/clients/dispatch/rules/missing-error-propagation.js +0 -62
- package/node_modules/pi-lens/dist/clients/dispatch/rules/no-commented-credentials.js +0 -52
- package/node_modules/pi-lens/dist/clients/dispatch/rules/pass-through-wrappers.js +0 -42
- package/node_modules/pi-lens/dist/clients/dispatch/rules/placeholder-comments.js +0 -40
- package/node_modules/pi-lens/dist/clients/dispatch/rules/unsafe-boundary.js +0 -126
- package/node_modules/pi-lens/dist/clients/dispatch/runner-context.js +0 -52
- package/node_modules/pi-lens/dist/clients/dispatch/runners/actionlint.js +0 -111
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +0 -1196
- package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +0 -296
- package/node_modules/pi-lens/dist/clients/dispatch/runners/cpp-check.js +0 -219
- package/node_modules/pi-lens/dist/clients/dispatch/runners/credo.js +0 -82
- package/node_modules/pi-lens/dist/clients/dispatch/runners/cue-vet.js +0 -416
- package/node_modules/pi-lens/dist/clients/dispatch/runners/dart-analyze.js +0 -183
- package/node_modules/pi-lens/dist/clients/dispatch/runners/detekt.js +0 -176
- package/node_modules/pi-lens/dist/clients/dispatch/runners/dotnet-build.js +0 -164
- package/node_modules/pi-lens/dist/clients/dispatch/runners/elixir-check.js +0 -195
- package/node_modules/pi-lens/dist/clients/dispatch/runners/eslint.js +0 -137
- package/node_modules/pi-lens/dist/clients/dispatch/runners/fact-rules.js +0 -29
- package/node_modules/pi-lens/dist/clients/dispatch/runners/fish-indent.js +0 -69
- package/node_modules/pi-lens/dist/clients/dispatch/runners/gleam-check.js +0 -167
- package/node_modules/pi-lens/dist/clients/dispatch/runners/go-vet.js +0 -104
- package/node_modules/pi-lens/dist/clients/dispatch/runners/golangci-lint.js +0 -135
- package/node_modules/pi-lens/dist/clients/dispatch/runners/hadolint.js +0 -91
- package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +0 -171
- package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-render.js +0 -940
- package/node_modules/pi-lens/dist/clients/dispatch/runners/htmlhint.js +0 -117
- package/node_modules/pi-lens/dist/clients/dispatch/runners/index.js +0 -108
- package/node_modules/pi-lens/dist/clients/dispatch/runners/javac.js +0 -99
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ktlint.js +0 -110
- package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +0 -379
- package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +0 -167
- package/node_modules/pi-lens/dist/clients/dispatch/runners/mypy.js +0 -102
- package/node_modules/pi-lens/dist/clients/dispatch/runners/oxlint.js +0 -414
- package/node_modules/pi-lens/dist/clients/dispatch/runners/php-lint.js +0 -85
- package/node_modules/pi-lens/dist/clients/dispatch/runners/phpstan.js +0 -120
- package/node_modules/pi-lens/dist/clients/dispatch/runners/prisma-validate.js +0 -62
- package/node_modules/pi-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +0 -445
- package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +0 -169
- package/node_modules/pi-lens/dist/clients/dispatch/runners/rubocop.js +0 -99
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ruff.js +0 -88
- package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +0 -256
- package/node_modules/pi-lens/dist/clients/dispatch/runners/shellcheck.js +0 -173
- package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +0 -102
- package/node_modules/pi-lens/dist/clients/dispatch/runners/spellcheck.js +0 -128
- package/node_modules/pi-lens/dist/clients/dispatch/runners/spotbugs.js +0 -259
- package/node_modules/pi-lens/dist/clients/dispatch/runners/sqlfluff.js +0 -183
- package/node_modules/pi-lens/dist/clients/dispatch/runners/stylelint.js +0 -166
- package/node_modules/pi-lens/dist/clients/dispatch/runners/swiftlint.js +0 -163
- package/node_modules/pi-lens/dist/clients/dispatch/runners/taplo.js +0 -174
- package/node_modules/pi-lens/dist/clients/dispatch/runners/terragrunt.js +0 -168
- package/node_modules/pi-lens/dist/clients/dispatch/runners/tflint.js +0 -125
- package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +0 -643
- package/node_modules/pi-lens/dist/clients/dispatch/runners/trivy-config.js +0 -253
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/availability-policy.js +0 -496
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/candidate-probe.js +0 -90
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/diagnostic-parsers.js +0 -95
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/lazy-installer.js +0 -274
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +0 -1701
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/spawn-outcome.js +0 -101
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/tool-failure.js +0 -235
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/toolchain-availability.js +0 -169
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils.js +0 -15
- package/node_modules/pi-lens/dist/clients/dispatch/runners/vale.js +0 -128
- package/node_modules/pi-lens/dist/clients/dispatch/runners/yaml-rule-parser.js +0 -242
- package/node_modules/pi-lens/dist/clients/dispatch/runners/yamllint.js +0 -95
- package/node_modules/pi-lens/dist/clients/dispatch/runners/zig-check.js +0 -79
- package/node_modules/pi-lens/dist/clients/dispatch/suppress-writer.js +0 -79
- package/node_modules/pi-lens/dist/clients/dispatch/tool-profile.js +0 -30
- package/node_modules/pi-lens/dist/clients/dispatch/types.js +0 -21
- package/node_modules/pi-lens/dist/clients/dispatch/utils/format-utils.js +0 -45
- package/node_modules/pi-lens/dist/clients/dispatch/utils/lsp-diagnostics.js +0 -35
- package/node_modules/pi-lens/dist/clients/disposition-logger.js +0 -32
- package/node_modules/pi-lens/dist/clients/disposition-publish.js +0 -124
- package/node_modules/pi-lens/dist/clients/durable-store.js +0 -97
- package/node_modules/pi-lens/dist/clients/effective-config.js +0 -415
- package/node_modules/pi-lens/dist/clients/env-utils.js +0 -83
- package/node_modules/pi-lens/dist/clients/error-class.js +0 -23
- package/node_modules/pi-lens/dist/clients/eval-timestamp.js +0 -17
- package/node_modules/pi-lens/dist/clients/event-loop-hold.js +0 -274
- package/node_modules/pi-lens/dist/clients/event-loop-monitor.js +0 -250
- package/node_modules/pi-lens/dist/clients/extension-log.js +0 -504
- package/node_modules/pi-lens/dist/clients/extension-mode.js +0 -73
- package/node_modules/pi-lens/dist/clients/feature-hints.js +0 -103
- package/node_modules/pi-lens/dist/clients/file-kinds.js +0 -412
- package/node_modules/pi-lens/dist/clients/file-role.js +0 -134
- package/node_modules/pi-lens/dist/clients/file-time.js +0 -160
- package/node_modules/pi-lens/dist/clients/file-utils.js +0 -1032
- package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +0 -494
- package/node_modules/pi-lens/dist/clients/finding-identity.js +0 -88
- package/node_modules/pi-lens/dist/clients/fix-worklog.js +0 -103
- package/node_modules/pi-lens/dist/clients/format-events-publish.js +0 -343
- package/node_modules/pi-lens/dist/clients/format-service.js +0 -222
- package/node_modules/pi-lens/dist/clients/formatters-lazy.js +0 -9
- package/node_modules/pi-lens/dist/clients/formatters.js +0 -2032
- package/node_modules/pi-lens/dist/clients/freshness-cadence.js +0 -17
- package/node_modules/pi-lens/dist/clients/freshness.js +0 -38
- package/node_modules/pi-lens/dist/clients/generated-artifacts.js +0 -394
- package/node_modules/pi-lens/dist/clients/generation-guard.js +0 -215
- package/node_modules/pi-lens/dist/clients/git-guard.js +0 -1136
- package/node_modules/pi-lens/dist/clients/git-tracked-ignore.js +0 -243
- package/node_modules/pi-lens/dist/clients/gitleaks-client.js +0 -509
- package/node_modules/pi-lens/dist/clients/go-client.js +0 -104
- package/node_modules/pi-lens/dist/clients/govulncheck-client.js +0 -605
- package/node_modules/pi-lens/dist/clients/gradle-ktfmt-style.js +0 -348
- package/node_modules/pi-lens/dist/clients/grammar-source.js +0 -465
- package/node_modules/pi-lens/dist/clients/gzip-stage-write.js +0 -135
- package/node_modules/pi-lens/dist/clients/hashline-anchor.js +0 -424
- package/node_modules/pi-lens/dist/clients/hook-budgets.js +0 -76
- package/node_modules/pi-lens/dist/clients/host-edit-normalize.js +0 -140
- package/node_modules/pi-lens/dist/clients/host-ports.js +0 -39
- package/node_modules/pi-lens/dist/clients/indent-retarget.js +0 -154
- package/node_modules/pi-lens/dist/clients/inline-blocker-dispositions.js +0 -186
- package/node_modules/pi-lens/dist/clients/install-diagnostics.js +0 -156
- package/node_modules/pi-lens/dist/clients/installer/index.js +0 -5416
- package/node_modules/pi-lens/dist/clients/installer/managed-tool-refresh-session.js +0 -58
- package/node_modules/pi-lens/dist/clients/installer/managed-tool-refresh.js +0 -783
- package/node_modules/pi-lens/dist/clients/instance-reaper-state.js +0 -7
- package/node_modules/pi-lens/dist/clients/instance-reaper.js +0 -1137
- package/node_modules/pi-lens/dist/clients/instance-registry-lock.js +0 -145
- package/node_modules/pi-lens/dist/clients/instance-registry.js +0 -773
- package/node_modules/pi-lens/dist/clients/jscpd-client.js +0 -378
- package/node_modules/pi-lens/dist/clients/json-cache-read.js +0 -65
- package/node_modules/pi-lens/dist/clients/knip-client.js +0 -788
- package/node_modules/pi-lens/dist/clients/language-policy.js +0 -252
- package/node_modules/pi-lens/dist/clients/language-profile.js +0 -361
- package/node_modules/pi-lens/dist/clients/language-registry.js +0 -603
- package/node_modules/pi-lens/dist/clients/latency-logger.js +0 -727
- package/node_modules/pi-lens/dist/clients/lazy-import.js +0 -21
- package/node_modules/pi-lens/dist/clients/ledger-bounds.js +0 -54
- package/node_modules/pi-lens/dist/clients/lens-config.js +0 -404
- package/node_modules/pi-lens/dist/clients/lens-engine.js +0 -358
- package/node_modules/pi-lens/dist/clients/lens-events.js +0 -125
- package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +0 -467
- package/node_modules/pi-lens/dist/clients/lens-map.js +0 -1156
- package/node_modules/pi-lens/dist/clients/live-bus-emitter.js +0 -74
- package/node_modules/pi-lens/dist/clients/log-cleanup.js +0 -222
- package/node_modules/pi-lens/dist/clients/lsp/aggregation.js +0 -178
- package/node_modules/pi-lens/dist/clients/lsp/cascade-tier.js +0 -421
- package/node_modules/pi-lens/dist/clients/lsp/client.js +0 -4593
- package/node_modules/pi-lens/dist/clients/lsp/config.js +0 -691
- package/node_modules/pi-lens/dist/clients/lsp/content-limits.js +0 -41
- package/node_modules/pi-lens/dist/clients/lsp/diagnostic-binding.js +0 -225
- package/node_modules/pi-lens/dist/clients/lsp/document-drift.js +0 -467
- package/node_modules/pi-lens/dist/clients/lsp/edits.js +0 -1219
- package/node_modules/pi-lens/dist/clients/lsp/index.js +0 -8305
- package/node_modules/pi-lens/dist/clients/lsp/inferred-project.js +0 -216
- package/node_modules/pi-lens/dist/clients/lsp/jvm-runtime.js +0 -298
- package/node_modules/pi-lens/dist/clients/lsp/language.js +0 -63
- package/node_modules/pi-lens/dist/clients/lsp/launch.js +0 -746
- package/node_modules/pi-lens/dist/clients/lsp/lombok.js +0 -158
- package/node_modules/pi-lens/dist/clients/lsp/path-utils.js +0 -5
- package/node_modules/pi-lens/dist/clients/lsp/pending-aux-coverage.js +0 -251
- package/node_modules/pi-lens/dist/clients/lsp/position-encoding.js +0 -61
- package/node_modules/pi-lens/dist/clients/lsp/ruby-drive-dirs.js +0 -83
- package/node_modules/pi-lens/dist/clients/lsp/server.js +0 -3290
- package/node_modules/pi-lens/dist/clients/lsp/session-roots.js +0 -192
- package/node_modules/pi-lens/dist/clients/lsp/spawn-history.js +0 -17
- package/node_modules/pi-lens/dist/clients/lsp/sync-kind.js +0 -56
- package/node_modules/pi-lens/dist/clients/lsp/tsserver-sync.js +0 -332
- package/node_modules/pi-lens/dist/clients/lsp/wait-policy/capability-snapshot.js +0 -1
- package/node_modules/pi-lens/dist/clients/lsp/wait-policy/classification.js +0 -85
- package/node_modules/pi-lens/dist/clients/lsp/wait-policy/index.js +0 -10
- package/node_modules/pi-lens/dist/clients/lsp/wait-policy/strategies.js +0 -392
- package/node_modules/pi-lens/dist/clients/lsp/watch-queue.js +0 -61
- package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +0 -639
- package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-session.js +0 -30
- package/node_modules/pi-lens/dist/clients/lsp/workspace-sweep-hold.js +0 -184
- package/node_modules/pi-lens/dist/clients/lsp-budget.js +0 -186
- package/node_modules/pi-lens/dist/clients/lsp-document-symbols.js +0 -110
- package/node_modules/pi-lens/dist/clients/lsp-lazy.js +0 -9
- package/node_modules/pi-lens/dist/clients/lsp-mutation.js +0 -396
- package/node_modules/pi-lens/dist/clients/lsp-status.js +0 -59
- package/node_modules/pi-lens/dist/clients/map-with-concurrency.js +0 -40
- package/node_modules/pi-lens/dist/clients/mcp/analyze.js +0 -420
- package/node_modules/pi-lens/dist/clients/mcp/host-shim.js +0 -31
- package/node_modules/pi-lens/dist/clients/mcp/ipc.js +0 -523
- package/node_modules/pi-lens/dist/clients/mcp/review.js +0 -197
- package/node_modules/pi-lens/dist/clients/mcp/session.js +0 -412
- package/node_modules/pi-lens/dist/clients/memory-sampler.js +0 -208
- package/node_modules/pi-lens/dist/clients/message-end-attribution.js +0 -30
- package/node_modules/pi-lens/dist/clients/metrics-client.js +0 -107
- package/node_modules/pi-lens/dist/clients/metrics-history.js +0 -327
- package/node_modules/pi-lens/dist/clients/middle-man-analysis.js +0 -263
- package/node_modules/pi-lens/dist/clients/model-provider.js +0 -53
- package/node_modules/pi-lens/dist/clients/module-report-lsp.js +0 -189
- package/node_modules/pi-lens/dist/clients/module-report.js +0 -2150
- package/node_modules/pi-lens/dist/clients/mutating-tool.js +0 -651
- package/node_modules/pi-lens/dist/clients/mutation-attribution.js +0 -368
- package/node_modules/pi-lens/dist/clients/mutation-bridge.js +0 -240
- package/node_modules/pi-lens/dist/clients/ndjson-logger.js +0 -734
- package/node_modules/pi-lens/dist/clients/observed-mutation-sources.js +0 -101
- package/node_modules/pi-lens/dist/clients/observed-mutation.js +0 -1253
- package/node_modules/pi-lens/dist/clients/oldtext-autopatch.js +0 -128
- package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +0 -496
- package/node_modules/pi-lens/dist/clients/opengrep-client.js +0 -333
- package/node_modules/pi-lens/dist/clients/opengrep-config.js +0 -76
- package/node_modules/pi-lens/dist/clients/package-manager.js +0 -607
- package/node_modules/pi-lens/dist/clients/package-root.js +0 -38
- package/node_modules/pi-lens/dist/clients/partial-edit-apply.js +0 -439
- package/node_modules/pi-lens/dist/clients/path-attribution-telemetry.js +0 -43
- package/node_modules/pi-lens/dist/clients/path-keyed-map.js +0 -108
- package/node_modules/pi-lens/dist/clients/path-utils.js +0 -1244
- package/node_modules/pi-lens/dist/clients/performance-report.js +0 -331
- package/node_modules/pi-lens/dist/clients/persist-debounce.js +0 -70
- package/node_modules/pi-lens/dist/clients/persistent-reverify.js +0 -271
- package/node_modules/pi-lens/dist/clients/php-cs-fixer-config.js +0 -119
- package/node_modules/pi-lens/dist/clients/pipeline.js +0 -1480
- package/node_modules/pi-lens/dist/clients/post-autofix-notice.js +0 -37
- package/node_modules/pi-lens/dist/clients/print-mode.js +0 -21
- package/node_modules/pi-lens/dist/clients/probe-home-state.js +0 -228
- package/node_modules/pi-lens/dist/clients/process-bridge.js +0 -66
- package/node_modules/pi-lens/dist/clients/process-singletons.js +0 -210
- package/node_modules/pi-lens/dist/clients/process-snapshot.js +0 -68
- package/node_modules/pi-lens/dist/clients/project-changes.js +0 -181
- package/node_modules/pi-lens/dist/clients/project-conventions.js +0 -171
- package/node_modules/pi-lens/dist/clients/project-diagnostics/cache.js +0 -137
- package/node_modules/pi-lens/dist/clients/project-diagnostics/extractors.js +0 -109
- package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +0 -668
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/call-graph-impact.js +0 -118
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/dead-code.js +0 -47
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/gitleaks.js +0 -40
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/govulncheck.js +0 -34
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/jscpd.js +0 -38
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/knip.js +0 -47
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/madge.js +0 -48
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/opengrep.js +0 -40
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +0 -127
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/trivy.js +0 -81
- package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +0 -520
- package/node_modules/pi-lens/dist/clients/project-diagnostics/types.js +0 -1
- package/node_modules/pi-lens/dist/clients/project-lens-config.js +0 -807
- package/node_modules/pi-lens/dist/clients/project-report.js +0 -701
- package/node_modules/pi-lens/dist/clients/project-scale.js +0 -237
- package/node_modules/pi-lens/dist/clients/project-scan-policy.js +0 -11
- package/node_modules/pi-lens/dist/clients/project-snapshot-fingerprint.js +0 -48
- package/node_modules/pi-lens/dist/clients/project-snapshot-persist-worker.js +0 -20
- package/node_modules/pi-lens/dist/clients/project-snapshot.js +0 -1653
- package/node_modules/pi-lens/dist/clients/project-trust.js +0 -181
- package/node_modules/pi-lens/dist/clients/python-environment.js +0 -217
- package/node_modules/pi-lens/dist/clients/python-provenance.js +0 -639
- package/node_modules/pi-lens/dist/clients/quiet-window-config.js +0 -47
- package/node_modules/pi-lens/dist/clients/quiet-window.js +0 -236
- package/node_modules/pi-lens/dist/clients/read-bridge.js +0 -139
- package/node_modules/pi-lens/dist/clients/read-expansion.js +0 -266
- package/node_modules/pi-lens/dist/clients/read-guard-logger.js +0 -251
- package/node_modules/pi-lens/dist/clients/read-guard-tool-lines.js +0 -1306
- package/node_modules/pi-lens/dist/clients/read-guard.js +0 -1561
- package/node_modules/pi-lens/dist/clients/recent-touches.js +0 -240
- package/node_modules/pi-lens/dist/clients/redact/secrets.js +0 -449
- package/node_modules/pi-lens/dist/clients/resource-sampler.js +0 -628
- package/node_modules/pi-lens/dist/clients/reverse-deps.js +0 -270
- package/node_modules/pi-lens/dist/clients/review-graph/builder.js +0 -5126
- package/node_modules/pi-lens/dist/clients/review-graph/format.js +0 -33
- package/node_modules/pi-lens/dist/clients/review-graph/git-identity.js +0 -163
- package/node_modules/pi-lens/dist/clients/review-graph/import-resolvers.js +0 -481
- package/node_modules/pi-lens/dist/clients/review-graph/persist-worker.js +0 -10
- package/node_modules/pi-lens/dist/clients/review-graph/query.js +0 -244
- package/node_modules/pi-lens/dist/clients/review-graph/revision-drift.js +0 -21
- package/node_modules/pi-lens/dist/clients/review-graph/service.js +0 -96
- package/node_modules/pi-lens/dist/clients/review-graph/shared-extraction-ir.js +0 -82
- package/node_modules/pi-lens/dist/clients/review-graph/symbol-id.js +0 -103
- package/node_modules/pi-lens/dist/clients/review-graph/tsconfig-paths.js +0 -299
- package/node_modules/pi-lens/dist/clients/review-graph/types.js +0 -1
- package/node_modules/pi-lens/dist/clients/review-graph/workspace-modules.js +0 -449
- package/node_modules/pi-lens/dist/clients/review-graph-logger.js +0 -81
- package/node_modules/pi-lens/dist/clients/ruff-client.js +0 -179
- package/node_modules/pi-lens/dist/clients/rules-scanner.js +0 -131
- package/node_modules/pi-lens/dist/clients/run-duration.js +0 -55
- package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +0 -746
- package/node_modules/pi-lens/dist/clients/runtime-config.js +0 -77
- package/node_modules/pi-lens/dist/clients/runtime-context.js +0 -211
- package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +0 -1324
- package/node_modules/pi-lens/dist/clients/runtime-session.js +0 -2485
- package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +0 -1295
- package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +0 -2049
- package/node_modules/pi-lens/dist/clients/runtime-turn.js +0 -3767
- package/node_modules/pi-lens/dist/clients/rust-client.js +0 -97
- package/node_modules/pi-lens/dist/clients/safe-spawn.js +0 -2357
- package/node_modules/pi-lens/dist/clients/sanitize.js +0 -286
- package/node_modules/pi-lens/dist/clients/scan-utils.js +0 -25
- package/node_modules/pi-lens/dist/clients/scratch-tree-policy.js +0 -165
- package/node_modules/pi-lens/dist/clients/search-read-registration.js +0 -94
- package/node_modules/pi-lens/dist/clients/secret-findings.js +0 -114
- package/node_modules/pi-lens/dist/clients/security-scan-client.js +0 -352
- package/node_modules/pi-lens/dist/clients/session-event-guard.js +0 -297
- package/node_modules/pi-lens/dist/clients/session-lifecycle.js +0 -484
- package/node_modules/pi-lens/dist/clients/session-start-observability.js +0 -94
- package/node_modules/pi-lens/dist/clients/session-state-store.js +0 -101
- package/node_modules/pi-lens/dist/clients/session-summary.js +0 -15
- package/node_modules/pi-lens/dist/clients/sessionstart-logger.js +0 -27
- package/node_modules/pi-lens/dist/clients/sg-runner.js +0 -876
- package/node_modules/pi-lens/dist/clients/sgconfig.js +0 -347
- package/node_modules/pi-lens/dist/clients/shared-checkout-guard.js +0 -338
- package/node_modules/pi-lens/dist/clients/single-flight.js +0 -158
- package/node_modules/pi-lens/dist/clients/situational-tool-telemetry.js +0 -108
- package/node_modules/pi-lens/dist/clients/skills-resolver.js +0 -141
- package/node_modules/pi-lens/dist/clients/slow-fs.js +0 -138
- package/node_modules/pi-lens/dist/clients/smells-rollup.js +0 -231
- package/node_modules/pi-lens/dist/clients/source-filter.js +0 -596
- package/node_modules/pi-lens/dist/clients/source-walker.js +0 -211
- package/node_modules/pi-lens/dist/clients/spawn-output-cap.js +0 -120
- package/node_modules/pi-lens/dist/clients/spawn-timeout-cooldown.js +0 -110
- package/node_modules/pi-lens/dist/clients/stale-marker.js +0 -17
- package/node_modules/pi-lens/dist/clients/startup-scan.js +0 -400
- package/node_modules/pi-lens/dist/clients/startup-timing.js +0 -130
- package/node_modules/pi-lens/dist/clients/string-utils.js +0 -33
- package/node_modules/pi-lens/dist/clients/subagent-mode.js +0 -111
- package/node_modules/pi-lens/dist/clients/symbol-containment.js +0 -24
- package/node_modules/pi-lens/dist/clients/symbol-types.js +0 -5
- package/node_modules/pi-lens/dist/clients/test-runner-client.js +0 -2507
- package/node_modules/pi-lens/dist/clients/test-runner-delivery.js +0 -287
- package/node_modules/pi-lens/dist/clients/todo-scanner.js +0 -229
- package/node_modules/pi-lens/dist/clients/tool-agreement.js +0 -423
- package/node_modules/pi-lens/dist/clients/tool-config.js +0 -249
- package/node_modules/pi-lens/dist/clients/tool-cwd.js +0 -270
- package/node_modules/pi-lens/dist/clients/tool-definition.js +0 -47
- package/node_modules/pi-lens/dist/clients/tool-event.js +0 -105
- package/node_modules/pi-lens/dist/clients/tool-policy.js +0 -2755
- package/node_modules/pi-lens/dist/clients/tool-probe.js +0 -53
- package/node_modules/pi-lens/dist/clients/tool-render.js +0 -156
- package/node_modules/pi-lens/dist/clients/tool-set-policy.js +0 -118
- package/node_modules/pi-lens/dist/clients/tree-sitter-cache.js +0 -364
- package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +0 -4195
- package/node_modules/pi-lens/dist/clients/tree-sitter-logger.js +0 -100
- package/node_modules/pi-lens/dist/clients/tree-sitter-navigator.js +0 -269
- package/node_modules/pi-lens/dist/clients/tree-sitter-query-loader.js +0 -569
- package/node_modules/pi-lens/dist/clients/tree-sitter-shared.js +0 -158
- package/node_modules/pi-lens/dist/clients/tree-sitter-symbol-extractor.js +0 -1265
- package/node_modules/pi-lens/dist/clients/trivy-client.js +0 -467
- package/node_modules/pi-lens/dist/clients/tui-fit.js +0 -50
- package/node_modules/pi-lens/dist/clients/turn-context.js +0 -52
- package/node_modules/pi-lens/dist/clients/turn-end/lane.js +0 -51
- package/node_modules/pi-lens/dist/clients/turn-end/lanes/govulncheck.js +0 -112
- package/node_modules/pi-lens/dist/clients/turn-end/lanes/secrets.js +0 -204
- package/node_modules/pi-lens/dist/clients/turn-summary-render.js +0 -72
- package/node_modules/pi-lens/dist/clients/turn-summary.js +0 -132
- package/node_modules/pi-lens/dist/clients/typos-config.js +0 -29
- package/node_modules/pi-lens/dist/clients/user-notify.js +0 -51
- package/node_modules/pi-lens/dist/clients/vanished-instance-marker.js +0 -57
- package/node_modules/pi-lens/dist/clients/warm-attach.js +0 -305
- package/node_modules/pi-lens/dist/clients/widget-state.js +0 -1808
- package/node_modules/pi-lens/dist/clients/word-index-logger.js +0 -49
- package/node_modules/pi-lens/dist/clients/word-index-store.js +0 -459
- package/node_modules/pi-lens/dist/clients/word-index.js +0 -2080
- package/node_modules/pi-lens/dist/clients/workspace-topology.js +0 -443
- package/node_modules/pi-lens/dist/clients/write-ordering-guard.js +0 -65
- package/node_modules/pi-lens/dist/clients/zizmor-config.js +0 -340
- package/node_modules/pi-lens/dist/i18n.js +0 -69
- package/node_modules/pi-lens/dist/mcp/build-staleness.js +0 -124
- package/node_modules/pi-lens/dist/scripts/lib/process-scan.mjs +0 -583
- package/node_modules/pi-lens/dist/scripts/lib/skills-predicate.mjs +0 -129
- package/node_modules/pi-lens/dist/scripts/lib/web-tree-sitter-dir.mjs +0 -123
- package/node_modules/pi-lens/dist/tools/activate-tools.js +0 -87
- package/node_modules/pi-lens/dist/tools/ast-grep-outline.js +0 -137
- package/node_modules/pi-lens/dist/tools/ast-grep-replace.js +0 -244
- package/node_modules/pi-lens/dist/tools/ast-grep-search.js +0 -762
- package/node_modules/pi-lens/dist/tools/effective-config.js +0 -90
- package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +0 -375
- package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +0 -2571
- package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +0 -1745
- package/node_modules/pi-lens/dist/tools/lsp-navigation.js +0 -1367
- package/node_modules/pi-lens/dist/tools/lsp-structured-output.js +0 -294
- package/node_modules/pi-lens/dist/tools/module-report.js +0 -382
- package/node_modules/pi-lens/dist/tools/project-report.js +0 -86
- package/node_modules/pi-lens/dist/tools/render-compact.js +0 -374
- package/node_modules/pi-lens/dist/tools/scan-progress.js +0 -53
- package/node_modules/pi-lens/dist/tools/shared.js +0 -29
- package/node_modules/pi-lens/dist/tools/symbol-search.js +0 -155
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cross-process touched-files record (#492).
|
|
3
|
-
*
|
|
4
|
-
* #485 (clients/agent-nudge.ts) delivers an inline "these files were
|
|
5
|
-
* autoformatted by pi-lens" context nudge, fed by the IN-PROCESS
|
|
6
|
-
* `pilens:files:touched` bus event (#482, clients/bus-publish.ts). That
|
|
7
|
-
* covers every run/turn of the SAME pi process, but subagents spawn real
|
|
8
|
-
* child `pi` processes — a separate process, a separate in-memory bus, a
|
|
9
|
-
* separate accumulator. Nothing about #485 crosses that boundary in either
|
|
10
|
-
* direction:
|
|
11
|
-
*
|
|
12
|
-
* - Child blind to parent: parent's turn_end autoformat dirties the tree;
|
|
13
|
-
* a child asked to commit runs `git status`, finds unexplained `M`
|
|
14
|
-
* files, burns turns investigating.
|
|
15
|
-
* - Parent blind to child: the child is ephemeral, but the parent keeps
|
|
16
|
-
* working in the same tree after the child returns and its pi-lens
|
|
17
|
-
* autoformatted on top of the child's edits.
|
|
18
|
-
*
|
|
19
|
-
* This module is the shared substrate: a single project-scoped
|
|
20
|
-
* `recent-touches.json` (via `getProjectDataDir(cwd)` — NEVER a hardcoded
|
|
21
|
-
* `.pi-lens` path) that every pi-lens instance (parent or child) both
|
|
22
|
-
* appends to (on publish) and reads from (session_start / turn_start). Ring
|
|
23
|
-
* buffer capped at ~50 entries; atomic tmp+rename writes, same pattern as
|
|
24
|
-
* the instance registry (#474, clients/instance-registry.ts). `pid` is what
|
|
25
|
-
* makes consumption self-excluding: a process must never see its own writes
|
|
26
|
-
* come back around as a "cross-process" nudge.
|
|
27
|
-
*
|
|
28
|
-
* Non-goals (#492): no IPC, no daemon, no `fs.watch` — a passive file,
|
|
29
|
-
* appended on publish and read at session_start / mtime-gated at
|
|
30
|
-
* turn_start. Not a general cross-process event bus; one record for one
|
|
31
|
-
* nudge feed.
|
|
32
|
-
*/
|
|
33
|
-
import * as fs from "node:fs";
|
|
34
|
-
import * as path from "node:path";
|
|
35
|
-
import { writeFileAtomicAsync } from "./atomic-write.js";
|
|
36
|
-
import { getProjectDataDir } from "./file-utils.js";
|
|
37
|
-
import { normalizeFilePath } from "./path-utils.js";
|
|
38
|
-
export const RECENT_TOUCHES_MAX_ENTRIES = 50;
|
|
39
|
-
/** Freshness window for the CHILD session_start consumer (15 minutes). */
|
|
40
|
-
const RECENT_TOUCHES_FRESHNESS_MS = 15 * 60 * 1000;
|
|
41
|
-
function recentTouchesPath(cwd) {
|
|
42
|
-
return path.join(getProjectDataDir(cwd), "recent-touches.json");
|
|
43
|
-
}
|
|
44
|
-
// --- Kill switch: reuse the #485 flag (house style per clients/agent-nudge.ts) ---
|
|
45
|
-
// This module does not define its own env var — #492 is explicitly a feed
|
|
46
|
-
// INTO the same nudge pipeline, so one switch governs the whole path
|
|
47
|
-
// (producer, both consumers) as specified in the issue.
|
|
48
|
-
let _enabledCache;
|
|
49
|
-
function isRecentTouchesEnabled() {
|
|
50
|
-
if (_enabledCache === undefined) {
|
|
51
|
-
_enabledCache = process.env.PI_LENS_AGENT_NUDGE !== "0";
|
|
52
|
-
}
|
|
53
|
-
return _enabledCache;
|
|
54
|
-
}
|
|
55
|
-
/** Test-only: reset all module state between test files/cases. */
|
|
56
|
-
export function _resetRecentTouchesForTests() {
|
|
57
|
-
_enabledCache = undefined;
|
|
58
|
-
_lastSeenMtimeMs = undefined;
|
|
59
|
-
_lastSeenSizeBytes = undefined;
|
|
60
|
-
_lastConsumedCursor.clear();
|
|
61
|
-
}
|
|
62
|
-
// --- Read (never throws — missing file, corrupt JSON, or wrong shape ⇒ empty) ---
|
|
63
|
-
async function readRecentTouchesAsync(cwd) {
|
|
64
|
-
try {
|
|
65
|
-
const raw = await fs.promises.readFile(recentTouchesPath(cwd), "utf-8");
|
|
66
|
-
const parsed = JSON.parse(raw);
|
|
67
|
-
if (parsed && Array.isArray(parsed.entries)) {
|
|
68
|
-
return parsed;
|
|
69
|
-
}
|
|
70
|
-
return { entries: [] };
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
return { entries: [] };
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// --- Write (atomic tmp + rename via clients/atomic-write.ts, #762) ---
|
|
77
|
-
async function writeRecentTouchesAsync(cwd, file) {
|
|
78
|
-
const dir = getProjectDataDir(cwd);
|
|
79
|
-
const target = recentTouchesPath(cwd);
|
|
80
|
-
try {
|
|
81
|
-
await fs.promises.mkdir(dir, { recursive: true });
|
|
82
|
-
}
|
|
83
|
-
catch {
|
|
84
|
-
// Best-effort record — a failed mkdir just means this batch of touches
|
|
85
|
-
// never reaches other instances; never throw for the caller (the
|
|
86
|
-
// producer seam is the fire-and-forget bus-publish path).
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
// bestEffort (default): same reasoning as the mkdir failure above.
|
|
90
|
-
await writeFileAtomicAsync(target, JSON.stringify(file));
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Append this process's touched paths to the shared record (read-modify-
|
|
94
|
-
* write-whole-file, ring-buffer capped at `RECENT_TOUCHES_MAX_ENTRIES` —
|
|
95
|
-
* oldest entries drop first). Called from the SAME seam as
|
|
96
|
-
* `publishFilesTouched` (clients/bus-publish.ts) so parent and child run
|
|
97
|
-
* identical code. Never throws — callers must swallow/log failures
|
|
98
|
-
* themselves (this function already does internally via the write helper).
|
|
99
|
-
*/
|
|
100
|
-
export async function appendRecentTouches(args) {
|
|
101
|
-
if (!isRecentTouchesEnabled())
|
|
102
|
-
return;
|
|
103
|
-
if (args.paths.length === 0)
|
|
104
|
-
return;
|
|
105
|
-
const now = Date.now();
|
|
106
|
-
const pid = process.pid;
|
|
107
|
-
const newEntries = args.paths.map((p) => ({
|
|
108
|
-
path: normalizeFilePath(p),
|
|
109
|
-
reason: args.reason,
|
|
110
|
-
ts: now,
|
|
111
|
-
pid,
|
|
112
|
-
sessionId: args.sessionId,
|
|
113
|
-
}));
|
|
114
|
-
const file = await readRecentTouchesAsync(args.cwd);
|
|
115
|
-
const merged = [...file.entries, ...newEntries];
|
|
116
|
-
// Ring buffer: keep the newest N (oldest-first array, so slice from the tail).
|
|
117
|
-
const capped = merged.length > RECENT_TOUCHES_MAX_ENTRIES
|
|
118
|
-
? merged.slice(merged.length - RECENT_TOUCHES_MAX_ENTRIES)
|
|
119
|
-
: merged;
|
|
120
|
-
await writeRecentTouchesAsync(args.cwd, { entries: capped });
|
|
121
|
-
}
|
|
122
|
-
// --- Shared foreign-entry filter (both consumers) ---
|
|
123
|
-
/**
|
|
124
|
-
* The baseline relevance filter EVERY consumer applies: not our own pid,
|
|
125
|
-
* within the freshness window, and the file still exists on disk. Shared so
|
|
126
|
-
* the turn_start reader can never drift from the session_start reader again
|
|
127
|
-
* — the original turn_start implementation only filtered pid + cursor, which
|
|
128
|
-
* meant a fresh process's FIRST turn_start (unset mtime watermark, cursor 0)
|
|
129
|
-
* would surface every entry in the record, including days-old touches of
|
|
130
|
-
* since-deleted files (the ring buffer caps count, not age — nothing ever
|
|
131
|
-
* expires entries in place).
|
|
132
|
-
*/
|
|
133
|
-
function passesForeignEntryFilter(entry, selfPid, now, freshnessMs) {
|
|
134
|
-
if (entry.pid === selfPid)
|
|
135
|
-
return false;
|
|
136
|
-
if (now - entry.ts > freshnessMs)
|
|
137
|
-
return false;
|
|
138
|
-
try {
|
|
139
|
-
return fs.existsSync(entry.path);
|
|
140
|
-
}
|
|
141
|
-
catch {
|
|
142
|
-
return false;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Read entries for the CHILD-at-session_start consumer: `pid !== self`,
|
|
147
|
-
* newer than the freshness window, and whose file still exists on disk.
|
|
148
|
-
* The child has no read-guard history yet (it just started), so relevance
|
|
149
|
-
* here is recency + existence only — the read-guard-based relevance filter
|
|
150
|
-
* is applied later, upstream, by the caller feeding these into #485's
|
|
151
|
-
* accumulator (agent-nudge.ts intentionally has no session-agnostic
|
|
152
|
-
* "cross-process" bypass of its own relevance filter — this function is
|
|
153
|
-
* the point where that decision is made, per #492 point 6).
|
|
154
|
-
*
|
|
155
|
-
* Never throws: ENOENT / EACCES / parse errors on the record file already
|
|
156
|
-
* collapse to an empty read inside `readRecentTouchesAsync`; a
|
|
157
|
-
* `fs.existsSync` per candidate is wrapped defensively too.
|
|
158
|
-
*/
|
|
159
|
-
export async function readCrossProcessTouchesForSessionStart(args) {
|
|
160
|
-
if (!isRecentTouchesEnabled())
|
|
161
|
-
return [];
|
|
162
|
-
try {
|
|
163
|
-
const selfPid = args.selfPid ?? process.pid;
|
|
164
|
-
const now = args.now ?? Date.now();
|
|
165
|
-
const freshnessMs = args.freshnessMs ?? RECENT_TOUCHES_FRESHNESS_MS;
|
|
166
|
-
const file = await readRecentTouchesAsync(args.cwd);
|
|
167
|
-
return file.entries.filter((e) => passesForeignEntryFilter(e, selfPid, now, freshnessMs));
|
|
168
|
-
}
|
|
169
|
-
catch {
|
|
170
|
-
return [];
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
// --- Consumer: parent at turn_start (mtime-gated hot path) ---
|
|
174
|
-
// Module state: the last mtime (+ size, #2300) we've already consumed, and a
|
|
175
|
-
// per-cwd cursor (max ts already surfaced) so repeated reads of an
|
|
176
|
-
// unchanged-since-last-check file never re-emit the same entries into the
|
|
177
|
-
// accumulator twice.
|
|
178
|
-
let _lastSeenMtimeMs;
|
|
179
|
-
let _lastSeenSizeBytes;
|
|
180
|
-
const _lastConsumedCursor = new Map();
|
|
181
|
-
/**
|
|
182
|
-
* Parent-at-turn_start consumer. Hot path: ONE `fs.stat` per call; when the
|
|
183
|
-
* mtime matches the last-seen mtime, returns `[]` immediately — no read, no
|
|
184
|
-
* JSON parse. On a changed mtime, reads the file and applies TWO filters:
|
|
185
|
-
* 1. the shared foreign-entry filter (`pid !== self`, within the
|
|
186
|
-
* freshness window, file still exists) — the same baseline the
|
|
187
|
-
* session_start reader applies, so a fresh process's first turn_start
|
|
188
|
-
* can never nudge about days-old touches of since-deleted files;
|
|
189
|
-
* 2. `ts` newer than this cwd's last-consumed cursor (dedupes identical
|
|
190
|
-
* path+ts across repeated reads — a touch already surfaced once must
|
|
191
|
-
* never come back), then advances both the mtime watermark and the
|
|
192
|
-
* cursor.
|
|
193
|
-
*
|
|
194
|
-
* Wrapped so ENOENT/EACCES/parse errors NEVER throw into turn_start — a
|
|
195
|
-
* missing record file (no cross-process activity yet) is the common case
|
|
196
|
-
* and must be silent, not logged as an error.
|
|
197
|
-
*/
|
|
198
|
-
export async function readCrossProcessTouchesForTurnStart(args) {
|
|
199
|
-
if (!isRecentTouchesEnabled())
|
|
200
|
-
return [];
|
|
201
|
-
try {
|
|
202
|
-
const target = recentTouchesPath(args.cwd);
|
|
203
|
-
let mtimeMs;
|
|
204
|
-
let sizeBytes;
|
|
205
|
-
try {
|
|
206
|
-
const stat = await fs.promises.stat(target);
|
|
207
|
-
mtimeMs = stat.mtimeMs;
|
|
208
|
-
sizeBytes = stat.size;
|
|
209
|
-
}
|
|
210
|
-
catch {
|
|
211
|
-
// No record file yet (ENOENT) or inaccessible (EACCES) — nothing to
|
|
212
|
-
// report; do not disturb the mtime watermark.
|
|
213
|
-
return [];
|
|
214
|
-
}
|
|
215
|
-
// #2300: size alongside mtime — a same-mtime-bucket rewrite (a sibling
|
|
216
|
-
// process's write landing in the same coarse-granularity mtime tick)
|
|
217
|
-
// changes the file's length, so mtime equality alone would wrongly
|
|
218
|
-
// short-circuit to "nothing new" and drop its entries.
|
|
219
|
-
if (_lastSeenMtimeMs === mtimeMs && _lastSeenSizeBytes === sizeBytes) {
|
|
220
|
-
return [];
|
|
221
|
-
}
|
|
222
|
-
_lastSeenMtimeMs = mtimeMs;
|
|
223
|
-
_lastSeenSizeBytes = sizeBytes;
|
|
224
|
-
const selfPid = args.selfPid ?? process.pid;
|
|
225
|
-
const now = args.now ?? Date.now();
|
|
226
|
-
const freshnessMs = args.freshnessMs ?? RECENT_TOUCHES_FRESHNESS_MS;
|
|
227
|
-
const file = await readRecentTouchesAsync(args.cwd);
|
|
228
|
-
const cursorKey = normalizeFilePath(args.cwd);
|
|
229
|
-
const cursor = _lastConsumedCursor.get(cursorKey) ?? 0;
|
|
230
|
-
const fresh = file.entries.filter((e) => e.ts > cursor && passesForeignEntryFilter(e, selfPid, now, freshnessMs));
|
|
231
|
-
if (file.entries.length > 0) {
|
|
232
|
-
const maxTs = Math.max(...file.entries.map((e) => e.ts));
|
|
233
|
-
_lastConsumedCursor.set(cursorKey, Math.max(cursor, maxTs));
|
|
234
|
-
}
|
|
235
|
-
return fresh;
|
|
236
|
-
}
|
|
237
|
-
catch {
|
|
238
|
-
return [];
|
|
239
|
-
}
|
|
240
|
-
}
|
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
const PEM_BEGIN = "-----BEGIN ";
|
|
2
|
-
const PEM_DELIMITER = "-----";
|
|
3
|
-
function codePointOf(char) {
|
|
4
|
-
return char?.codePointAt(0) ?? -1;
|
|
5
|
-
}
|
|
6
|
-
function isAsciiAlphaNumeric(char) {
|
|
7
|
-
const code = codePointOf(char);
|
|
8
|
-
return ((code >= 48 && code <= 57) ||
|
|
9
|
-
(code >= 65 && code <= 90) ||
|
|
10
|
-
(code >= 97 && code <= 122));
|
|
11
|
-
}
|
|
12
|
-
function isUpperAlphaNumeric(char) {
|
|
13
|
-
const code = codePointOf(char);
|
|
14
|
-
return (code >= 48 && code <= 57) || (code >= 65 && code <= 90);
|
|
15
|
-
}
|
|
16
|
-
function isIdentifierChar(char) {
|
|
17
|
-
return char === "_" || isAsciiAlphaNumeric(char);
|
|
18
|
-
}
|
|
19
|
-
function isTokenChar(char) {
|
|
20
|
-
return char === "-" || isIdentifierChar(char);
|
|
21
|
-
}
|
|
22
|
-
const PREFIXED_SECRETS = [
|
|
23
|
-
{
|
|
24
|
-
prefix: "ghp_",
|
|
25
|
-
minSuffixLength: 20,
|
|
26
|
-
predicate: isAsciiAlphaNumeric,
|
|
27
|
-
replacement: "[REDACTED:github-token]",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
prefix: "gho_",
|
|
31
|
-
minSuffixLength: 20,
|
|
32
|
-
predicate: isAsciiAlphaNumeric,
|
|
33
|
-
replacement: "[REDACTED:github-token]",
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
prefix: "ghu_",
|
|
37
|
-
minSuffixLength: 20,
|
|
38
|
-
predicate: isAsciiAlphaNumeric,
|
|
39
|
-
replacement: "[REDACTED:github-token]",
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
prefix: "ghs_",
|
|
43
|
-
minSuffixLength: 20,
|
|
44
|
-
predicate: isAsciiAlphaNumeric,
|
|
45
|
-
replacement: "[REDACTED:github-token]",
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
prefix: "ghr_",
|
|
49
|
-
minSuffixLength: 20,
|
|
50
|
-
predicate: isAsciiAlphaNumeric,
|
|
51
|
-
replacement: "[REDACTED:github-token]",
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
prefix: "github_pat_",
|
|
55
|
-
minSuffixLength: 20,
|
|
56
|
-
predicate: isTokenChar,
|
|
57
|
-
replacement: "[REDACTED:github-token]",
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
prefix: "AKIA",
|
|
61
|
-
minSuffixLength: 16,
|
|
62
|
-
predicate: isUpperAlphaNumeric,
|
|
63
|
-
replacement: "[REDACTED:aws-access-key]",
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
prefix: "ASIA",
|
|
67
|
-
minSuffixLength: 16,
|
|
68
|
-
predicate: isUpperAlphaNumeric,
|
|
69
|
-
replacement: "[REDACTED:aws-access-key]",
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
prefix: "sk_live_",
|
|
73
|
-
minSuffixLength: 16,
|
|
74
|
-
predicate: isAsciiAlphaNumeric,
|
|
75
|
-
replacement: "[REDACTED:stripe-key]",
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
prefix: "sk_test_",
|
|
79
|
-
minSuffixLength: 16,
|
|
80
|
-
predicate: isAsciiAlphaNumeric,
|
|
81
|
-
replacement: "[REDACTED:stripe-key]",
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
prefix: "rk_live_",
|
|
85
|
-
minSuffixLength: 16,
|
|
86
|
-
predicate: isAsciiAlphaNumeric,
|
|
87
|
-
replacement: "[REDACTED:stripe-key]",
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
prefix: "rk_test_",
|
|
91
|
-
minSuffixLength: 16,
|
|
92
|
-
predicate: isAsciiAlphaNumeric,
|
|
93
|
-
replacement: "[REDACTED:stripe-key]",
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
prefix: "glpat-",
|
|
97
|
-
minSuffixLength: 20,
|
|
98
|
-
predicate: isTokenChar,
|
|
99
|
-
replacement: "[REDACTED:gitlab-token]",
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
prefix: "AIza",
|
|
103
|
-
minSuffixLength: 35,
|
|
104
|
-
predicate: isTokenChar,
|
|
105
|
-
replacement: "[REDACTED:google-api-key]",
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
prefix: "GOCSPX-",
|
|
109
|
-
minSuffixLength: 20,
|
|
110
|
-
predicate: isTokenChar,
|
|
111
|
-
replacement: "[REDACTED:google-oauth-secret]",
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
prefix: "sk-proj-",
|
|
115
|
-
minSuffixLength: 20,
|
|
116
|
-
predicate: isTokenChar,
|
|
117
|
-
replacement: "[REDACTED:openai-key]",
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
prefix: "sk-svcacct-",
|
|
121
|
-
minSuffixLength: 20,
|
|
122
|
-
predicate: isTokenChar,
|
|
123
|
-
replacement: "[REDACTED:openai-key]",
|
|
124
|
-
},
|
|
125
|
-
];
|
|
126
|
-
/**
|
|
127
|
-
* Minimum suffix length for a legacy `sk-<base62>` OpenAI key. Legacy keys are
|
|
128
|
-
* 48 base62 chars; require a high bar so ordinary kebab-case identifiers
|
|
129
|
-
* (`sk-skeleton-loading-placeholder`, `sk-button-large`) never match.
|
|
130
|
-
*/
|
|
131
|
-
const OPENAI_LEGACY_MIN_SUFFIX = 40;
|
|
132
|
-
function consumeWhile(options) {
|
|
133
|
-
let end = options.start;
|
|
134
|
-
while (end < options.text.length && options.predicate(options.text[end])) {
|
|
135
|
-
end++;
|
|
136
|
-
}
|
|
137
|
-
return end;
|
|
138
|
-
}
|
|
139
|
-
function scanPrefixedSecret(position) {
|
|
140
|
-
for (const secret of PREFIXED_SECRETS) {
|
|
141
|
-
if (position.text[position.start] !== secret.prefix[0] ||
|
|
142
|
-
!position.text.startsWith(secret.prefix, position.start)) {
|
|
143
|
-
continue;
|
|
144
|
-
}
|
|
145
|
-
const suffixStart = position.start + secret.prefix.length;
|
|
146
|
-
const end = consumeWhile({
|
|
147
|
-
text: position.text,
|
|
148
|
-
start: suffixStart,
|
|
149
|
-
predicate: secret.predicate,
|
|
150
|
-
});
|
|
151
|
-
return end - suffixStart >= secret.minSuffixLength
|
|
152
|
-
? { end, replacement: secret.replacement }
|
|
153
|
-
: { end: Math.max(end, suffixStart) };
|
|
154
|
-
}
|
|
155
|
-
return undefined;
|
|
156
|
-
}
|
|
157
|
-
function scanSlackToken(position) {
|
|
158
|
-
const variant = position.text[position.start + 3];
|
|
159
|
-
if (!position.text.startsWith("xox", position.start) ||
|
|
160
|
-
variant === undefined ||
|
|
161
|
-
variant < "a" ||
|
|
162
|
-
variant > "z" ||
|
|
163
|
-
position.text[position.start + 4] !== "-") {
|
|
164
|
-
return undefined;
|
|
165
|
-
}
|
|
166
|
-
const suffixStart = position.start + 5;
|
|
167
|
-
const end = consumeWhile({
|
|
168
|
-
text: position.text,
|
|
169
|
-
start: suffixStart,
|
|
170
|
-
predicate: isTokenChar,
|
|
171
|
-
});
|
|
172
|
-
return end - suffixStart >= 10
|
|
173
|
-
? { end, replacement: "[REDACTED:slack-token]" }
|
|
174
|
-
: { end: Math.max(end, suffixStart) };
|
|
175
|
-
}
|
|
176
|
-
function scanSendGridKey(position) {
|
|
177
|
-
if (!position.text.startsWith("SG.", position.start))
|
|
178
|
-
return undefined;
|
|
179
|
-
const retryAt = position.start + 1;
|
|
180
|
-
const firstStart = position.start + 3;
|
|
181
|
-
const firstEnd = firstStart + 22;
|
|
182
|
-
for (let index = firstStart; index < firstEnd; index++) {
|
|
183
|
-
if (!isTokenChar(position.text[index]))
|
|
184
|
-
return { end: retryAt };
|
|
185
|
-
}
|
|
186
|
-
if (position.text[firstEnd] !== ".")
|
|
187
|
-
return { end: retryAt };
|
|
188
|
-
const secondStart = firstEnd + 1;
|
|
189
|
-
const end = secondStart + 43;
|
|
190
|
-
for (let index = secondStart; index < end; index++) {
|
|
191
|
-
if (!isTokenChar(position.text[index]))
|
|
192
|
-
return { end: retryAt };
|
|
193
|
-
}
|
|
194
|
-
return isTokenChar(position.text[end])
|
|
195
|
-
? { end: retryAt }
|
|
196
|
-
: { end, replacement: "[REDACTED:sendgrid-key]" };
|
|
197
|
-
}
|
|
198
|
-
function createJwtSegment(options) {
|
|
199
|
-
const possibleCandidate = options.text.indexOf("eyJ", options.start);
|
|
200
|
-
const candidate = possibleCandidate !== -1 &&
|
|
201
|
-
possibleCandidate < options.end &&
|
|
202
|
-
options.end - (possibleCandidate + 3) >= 5
|
|
203
|
-
? possibleCandidate
|
|
204
|
-
: -1;
|
|
205
|
-
return {
|
|
206
|
-
candidate,
|
|
207
|
-
length: options.end - options.start,
|
|
208
|
-
end: options.end,
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
function chooseSecretRange(options) {
|
|
212
|
-
if (!options.candidate)
|
|
213
|
-
return options.current;
|
|
214
|
-
if (!options.current)
|
|
215
|
-
return options.candidate;
|
|
216
|
-
return options.candidate.start < options.current.start ||
|
|
217
|
-
(options.candidate.start === options.current.start &&
|
|
218
|
-
options.candidate.end > options.current.end)
|
|
219
|
-
? options.candidate
|
|
220
|
-
: options.current;
|
|
221
|
-
}
|
|
222
|
-
function findNestedJwtRange(segments) {
|
|
223
|
-
let result;
|
|
224
|
-
const jweStart = segments.length - 5;
|
|
225
|
-
if (jweStart >= 0 &&
|
|
226
|
-
segments[jweStart].candidate !== -1 &&
|
|
227
|
-
segments[jweStart + 2].length > 0 &&
|
|
228
|
-
segments[jweStart + 3].length > 0 &&
|
|
229
|
-
segments[jweStart + 4].length > 0) {
|
|
230
|
-
result = {
|
|
231
|
-
start: segments[jweStart].candidate,
|
|
232
|
-
end: segments[jweStart + 4].end,
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
const jwtStart = segments.length - 3;
|
|
236
|
-
const isJwt = jwtStart >= 0 &&
|
|
237
|
-
segments[jwtStart].candidate !== -1 &&
|
|
238
|
-
segments[jwtStart + 1].length > 0 &&
|
|
239
|
-
segments[jwtStart + 2].length > 0;
|
|
240
|
-
return isJwt
|
|
241
|
-
? chooseSecretRange({
|
|
242
|
-
current: result,
|
|
243
|
-
candidate: {
|
|
244
|
-
start: segments[jwtStart].candidate,
|
|
245
|
-
end: segments[jwtStart + 2].end,
|
|
246
|
-
},
|
|
247
|
-
})
|
|
248
|
-
: result;
|
|
249
|
-
}
|
|
250
|
-
function topLevelJwtEnd(options) {
|
|
251
|
-
if (options.segmentCount >= 5 &&
|
|
252
|
-
options.segmentLengths[2] > 0 &&
|
|
253
|
-
options.segmentLengths[3] > 0 &&
|
|
254
|
-
options.segmentLengths[4] > 0) {
|
|
255
|
-
return options.segmentEnds[4];
|
|
256
|
-
}
|
|
257
|
-
return options.segmentCount >= 3 &&
|
|
258
|
-
options.segmentLengths[1] > 0 &&
|
|
259
|
-
options.segmentLengths[2] > 0
|
|
260
|
-
? options.segmentEnds[2]
|
|
261
|
-
: undefined;
|
|
262
|
-
}
|
|
263
|
-
function scanJwt(position) {
|
|
264
|
-
if (!position.text.startsWith("eyJ", position.start))
|
|
265
|
-
return undefined;
|
|
266
|
-
let segmentStart = position.start + 3;
|
|
267
|
-
let cursor = consumeWhile({
|
|
268
|
-
text: position.text,
|
|
269
|
-
start: segmentStart,
|
|
270
|
-
predicate: isTokenChar,
|
|
271
|
-
});
|
|
272
|
-
if (cursor - segmentStart < 5)
|
|
273
|
-
return { end: cursor };
|
|
274
|
-
const segmentLengths = [cursor - segmentStart];
|
|
275
|
-
const segmentEnds = [cursor];
|
|
276
|
-
const recentSegments = [
|
|
277
|
-
createJwtSegment({ text: position.text, start: segmentStart, end: cursor }),
|
|
278
|
-
];
|
|
279
|
-
let segmentCount = 1;
|
|
280
|
-
let nestedRange;
|
|
281
|
-
while (position.text[cursor] === ".") {
|
|
282
|
-
segmentStart = cursor + 1;
|
|
283
|
-
cursor = consumeWhile({
|
|
284
|
-
text: position.text,
|
|
285
|
-
start: segmentStart,
|
|
286
|
-
predicate: isTokenChar,
|
|
287
|
-
});
|
|
288
|
-
segmentCount++;
|
|
289
|
-
recentSegments.push(createJwtSegment({
|
|
290
|
-
text: position.text,
|
|
291
|
-
start: segmentStart,
|
|
292
|
-
end: cursor,
|
|
293
|
-
}));
|
|
294
|
-
if (recentSegments.length > 5)
|
|
295
|
-
recentSegments.shift();
|
|
296
|
-
nestedRange = chooseSecretRange({
|
|
297
|
-
current: nestedRange,
|
|
298
|
-
candidate: findNestedJwtRange(recentSegments),
|
|
299
|
-
});
|
|
300
|
-
if (segmentLengths.length < 5) {
|
|
301
|
-
segmentLengths.push(cursor - segmentStart);
|
|
302
|
-
segmentEnds.push(cursor);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
const topLevelEnd = topLevelJwtEnd({
|
|
306
|
-
segmentCount,
|
|
307
|
-
segmentLengths,
|
|
308
|
-
segmentEnds,
|
|
309
|
-
});
|
|
310
|
-
if (topLevelEnd !== undefined) {
|
|
311
|
-
return { end: topLevelEnd, replacement: "[REDACTED:jwt]" };
|
|
312
|
-
}
|
|
313
|
-
return nestedRange
|
|
314
|
-
? { ...nestedRange, replacement: "[REDACTED:jwt]" }
|
|
315
|
-
: { end: cursor };
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Legacy OpenAI keys are `sk-` followed by base62 (ASCII alphanumeric only —
|
|
319
|
-
* no `-`/`_`). Redact only on a strict shape: at least
|
|
320
|
-
* OPENAI_LEGACY_MIN_SUFFIX alphanumeric chars AND at least one digit. Stopping
|
|
321
|
-
* the suffix at the first non-alphanumeric char means a hyphenated identifier
|
|
322
|
-
* such as `sk-skeleton-loading-placeholder` yields only `skeleton` (8 chars) —
|
|
323
|
-
* far below the bar — so ordinary kebab-case slugs are never touched.
|
|
324
|
-
*/
|
|
325
|
-
function scanOpenAiLegacyKey(position) {
|
|
326
|
-
if (!position.text.startsWith("sk-", position.start))
|
|
327
|
-
return undefined;
|
|
328
|
-
const suffixStart = position.start + 3;
|
|
329
|
-
let end = suffixStart;
|
|
330
|
-
let hasDigit = false;
|
|
331
|
-
while (end < position.text.length &&
|
|
332
|
-
isAsciiAlphaNumeric(position.text[end])) {
|
|
333
|
-
const code = codePointOf(position.text[end]);
|
|
334
|
-
if (code >= 48 && code <= 57)
|
|
335
|
-
hasDigit = true;
|
|
336
|
-
end++;
|
|
337
|
-
}
|
|
338
|
-
return end - suffixStart >= OPENAI_LEGACY_MIN_SUFFIX && hasDigit
|
|
339
|
-
? { end, replacement: "[REDACTED:openai-key]" }
|
|
340
|
-
: { end: Math.max(end, suffixStart) };
|
|
341
|
-
}
|
|
342
|
-
function scanSecretAt(position) {
|
|
343
|
-
const initial = position.text[position.start];
|
|
344
|
-
if (initial === "S")
|
|
345
|
-
return scanSendGridKey(position);
|
|
346
|
-
if (initial === "x")
|
|
347
|
-
return scanSlackToken(position);
|
|
348
|
-
// `s`: modern `sk-proj-`/`sk-svcacct-`/`sk_live_`/`sk_test_` via the prefix
|
|
349
|
-
// registry, else fall back to the strict legacy `sk-<base62>` scanner.
|
|
350
|
-
if (initial === "s") {
|
|
351
|
-
return scanPrefixedSecret(position) ?? scanOpenAiLegacyKey(position);
|
|
352
|
-
}
|
|
353
|
-
if (initial === "A" ||
|
|
354
|
-
initial === "G" ||
|
|
355
|
-
initial === "g" ||
|
|
356
|
-
initial === "r") {
|
|
357
|
-
return scanPrefixedSecret(position);
|
|
358
|
-
}
|
|
359
|
-
return undefined;
|
|
360
|
-
}
|
|
361
|
-
function redactScannedSecrets(options) {
|
|
362
|
-
let cursor = 0;
|
|
363
|
-
let copyFrom = 0;
|
|
364
|
-
let result = "";
|
|
365
|
-
const position = { text: options.text, start: 0 };
|
|
366
|
-
while (cursor < options.text.length) {
|
|
367
|
-
position.start = cursor;
|
|
368
|
-
const scan = options.scanner(position);
|
|
369
|
-
if (!scan) {
|
|
370
|
-
cursor++;
|
|
371
|
-
continue;
|
|
372
|
-
}
|
|
373
|
-
if (scan.replacement) {
|
|
374
|
-
const replacementStart = scan.start ?? cursor;
|
|
375
|
-
result +=
|
|
376
|
-
options.text.slice(copyFrom, replacementStart) + scan.replacement;
|
|
377
|
-
copyFrom = scan.end;
|
|
378
|
-
}
|
|
379
|
-
cursor = Math.max(cursor + 1, scan.end);
|
|
380
|
-
}
|
|
381
|
-
return copyFrom === 0 ? options.text : result + options.text.slice(copyFrom);
|
|
382
|
-
}
|
|
383
|
-
function redactTokenSecrets(text) {
|
|
384
|
-
return redactScannedSecrets({ text, scanner: scanSecretAt });
|
|
385
|
-
}
|
|
386
|
-
function redactJwtSecrets(text) {
|
|
387
|
-
return redactScannedSecrets({ text, scanner: scanJwt });
|
|
388
|
-
}
|
|
389
|
-
function isPrivateKeyLabel(label) {
|
|
390
|
-
if (label.length === 0 ||
|
|
391
|
-
label.length > 64 ||
|
|
392
|
-
!label.includes("PRIVATE KEY")) {
|
|
393
|
-
return false;
|
|
394
|
-
}
|
|
395
|
-
for (const char of label) {
|
|
396
|
-
const code = codePointOf(char);
|
|
397
|
-
if (char !== " " && (code < 48 || code > 57) && (code < 65 || code > 90)) {
|
|
398
|
-
return false;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
return true;
|
|
402
|
-
}
|
|
403
|
-
function findUnescapedQuote(position) {
|
|
404
|
-
let escaped = false;
|
|
405
|
-
for (let index = position.start; index < position.text.length; index++) {
|
|
406
|
-
const char = position.text[index];
|
|
407
|
-
if (char === "\\") {
|
|
408
|
-
escaped = !escaped;
|
|
409
|
-
continue;
|
|
410
|
-
}
|
|
411
|
-
if (char === '"' && !escaped)
|
|
412
|
-
return index;
|
|
413
|
-
escaped = false;
|
|
414
|
-
}
|
|
415
|
-
return position.text.length;
|
|
416
|
-
}
|
|
417
|
-
function redactPrivateKeyBlocks(text) {
|
|
418
|
-
let cursor = 0;
|
|
419
|
-
let result = "";
|
|
420
|
-
while (cursor < text.length) {
|
|
421
|
-
const begin = text.indexOf(PEM_BEGIN, cursor);
|
|
422
|
-
if (begin === -1)
|
|
423
|
-
return result + text.slice(cursor);
|
|
424
|
-
const labelStart = begin + PEM_BEGIN.length;
|
|
425
|
-
const labelEnd = text.indexOf(PEM_DELIMITER, labelStart);
|
|
426
|
-
if (labelEnd === -1)
|
|
427
|
-
return result + text.slice(cursor);
|
|
428
|
-
const label = text.slice(labelStart, labelEnd);
|
|
429
|
-
if (!isPrivateKeyLabel(label)) {
|
|
430
|
-
const next = labelEnd + PEM_DELIMITER.length;
|
|
431
|
-
result += text.slice(cursor, next);
|
|
432
|
-
cursor = next;
|
|
433
|
-
continue;
|
|
434
|
-
}
|
|
435
|
-
const contentStart = labelEnd + PEM_DELIMITER.length;
|
|
436
|
-
const endMarker = `-----END ${label}-----`;
|
|
437
|
-
const end = text.indexOf(endMarker, contentStart);
|
|
438
|
-
result += text.slice(cursor, begin) + "[REDACTED:private-key]";
|
|
439
|
-
if (end === -1) {
|
|
440
|
-
cursor = findUnescapedQuote({ text, start: contentStart });
|
|
441
|
-
continue;
|
|
442
|
-
}
|
|
443
|
-
cursor = end + endMarker.length;
|
|
444
|
-
}
|
|
445
|
-
return result;
|
|
446
|
-
}
|
|
447
|
-
export function redactSecrets(text) {
|
|
448
|
-
return redactJwtSecrets(redactTokenSecrets(redactPrivateKeyBlocks(text)));
|
|
449
|
-
}
|