@herbertgao/pi-extensions 2026.8.5 → 2026.8.7
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 +5 -5
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +19 -7
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +30 -9
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +272 -22
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +74 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +94 -77
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/markdown-enhance.ts +48 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/message-display.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/hover.ts +14 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +55 -17
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/layout.ts +41 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-renderer.ts +75 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/types.ts +7 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +64 -1
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +3 -3
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +16 -0
- package/node_modules/@herbertgao/pi-subagents/README.md +30 -22
- package/node_modules/@herbertgao/pi-subagents/examples/agent-tool-description.md +5 -5
- package/node_modules/@herbertgao/pi-subagents/package.json +7 -7
- package/node_modules/@herbertgao/pi-subagents/src/agent-file-toggle.ts +7 -1
- package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +48 -19
- package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +22 -15
- package/node_modules/@herbertgao/pi-subagents/src/custom-agents.ts +26 -2
- package/node_modules/@herbertgao/pi-subagents/src/index.ts +219 -40
- package/node_modules/@herbertgao/pi-subagents/src/invocation-config.ts +101 -3
- package/node_modules/@herbertgao/pi-subagents/src/nested-tools.ts +18 -4
- package/node_modules/@herbertgao/pi-subagents/src/settings.ts +99 -0
- package/node_modules/@herbertgao/pi-subagents/src/types.ts +22 -3
- package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +51 -3
- package/node_modules/@herbertgao/pi-subagents/src/ui/conversation-viewer.ts +20 -2
- package/node_modules/@herbertgao/pi-subagents/src/ui/fleet-list.ts +34 -10
- package/node_modules/@herbertgao/pi-subagents/src/usage.ts +129 -1
- package/node_modules/@herbertgao/pi-subagents/src/worktree.ts +29 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/README.md +3 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/ask-user-question.ts +46 -10
- package/node_modules/@juicesharp/rpiv-ask-user-question/config.ts +25 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/configuration.md +13 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/hosts.md +8 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/localization.md +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/en.json +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/zh.json +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +3 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +10 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +30 -7
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state.ts +14 -6
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-builder.ts +30 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-content-strategy.ts +26 -5
- package/node_modules/@narumitw/pi-btw/README.md +119 -103
- package/node_modules/@narumitw/pi-btw/dist/index.ts +2898 -0
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +7 -0
- package/node_modules/@narumitw/pi-btw/package.json +13 -9
- package/node_modules/@narumitw/pi-btw/src/btw.ts +40 -42
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +55 -10
- package/node_modules/@narumitw/pi-btw/src/main-tree-picker.ts +390 -0
- package/node_modules/@narumitw/pi-btw/src/menu.ts +78 -15
- package/node_modules/@narumitw/pi-btw/src/settings.ts +22 -2
- package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +136 -45
- package/node_modules/pi-lens/CHANGELOG.md +1004 -0
- package/node_modules/pi-lens/README.md +11 -3
- package/node_modules/pi-lens/config/ruff/core.toml +42 -0
- package/node_modules/pi-lens/dist/clients/actionable-warnings.js +130 -27
- package/node_modules/pi-lens/dist/clients/advisory-provenance.js +427 -0
- package/node_modules/pi-lens/dist/clients/agent-nudge.js +79 -16
- package/node_modules/pi-lens/dist/clients/ast-grep-client.js +9 -3
- package/node_modules/pi-lens/dist/clients/atomic-write.js +9 -3
- package/node_modules/pi-lens/dist/clients/bash-file-access.js +285 -8
- package/node_modules/pi-lens/dist/clients/biome-client.js +176 -37
- package/node_modules/pi-lens/dist/clients/blocker-freshness.js +428 -0
- package/node_modules/pi-lens/dist/clients/blocker-past-eof.js +119 -0
- package/node_modules/pi-lens/dist/clients/bootstrap.js +12 -1
- package/node_modules/pi-lens/dist/clients/bounded-pid-file-lock.js +12 -3
- package/node_modules/pi-lens/dist/clients/bounded-telemetry.js +192 -0
- package/node_modules/pi-lens/dist/clients/bus-events-logger.js +62 -6
- package/node_modules/pi-lens/dist/clients/bus-publish.js +11 -3
- package/node_modules/pi-lens/dist/clients/cascade-budget.js +196 -0
- package/node_modules/pi-lens/dist/clients/cascade-format.js +76 -2
- package/node_modules/pi-lens/dist/clients/cascade-types.js +9 -1
- package/node_modules/pi-lens/dist/clients/child-unref.js +54 -6
- package/node_modules/pi-lens/dist/clients/code-quality-warnings.js +76 -24
- package/node_modules/pi-lens/dist/clients/console-guard-install.js +16 -4
- package/node_modules/pi-lens/dist/clients/dead-code-client.js +249 -52
- package/node_modules/pi-lens/dist/clients/deadline-utils.js +8 -1
- package/node_modules/pi-lens/dist/clients/debug-handles.js +5 -0
- package/node_modules/pi-lens/dist/clients/degradation-ledger.js +62 -13
- package/node_modules/pi-lens/dist/clients/dependency-checker.js +43 -9
- package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +153 -37
- package/node_modules/pi-lens/dist/clients/diagnostic-line-freshness.js +298 -0
- package/node_modules/pi-lens/dist/clients/diagnostics-publish.js +10 -3
- package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +165 -11
- package/node_modules/pi-lens/dist/clients/dispatch/integration.js +325 -72
- package/node_modules/pi-lens/dist/clients/dispatch/lazy.js +7 -4
- package/node_modules/pi-lens/dist/clients/dispatch/plan.js +5 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +234 -18
- package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +187 -19
- package/node_modules/pi-lens/dist/clients/dispatch/runners/cpp-check.js +6 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/credo.js +11 -9
- package/node_modules/pi-lens/dist/clients/dispatch/runners/cue-vet.js +398 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/elixir-check.js +11 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/eslint.js +12 -7
- package/node_modules/pi-lens/dist/clients/dispatch/runners/go-vet.js +18 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-render.js +895 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/index.js +4 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/javac.js +16 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +81 -41
- package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +16 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/mypy.js +23 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +331 -55
- package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +38 -5
- package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +97 -19
- package/node_modules/pi-lens/dist/clients/dispatch/runners/spellcheck.js +14 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/sqlfluff.js +20 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/stylelint.js +22 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/swiftlint.js +10 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/taplo.js +18 -6
- package/node_modules/pi-lens/dist/clients/dispatch/runners/trivy-config.js +73 -12
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/availability-policy.js +488 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/candidate-probe.js +84 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/lazy-installer.js +260 -27
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +943 -93
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/spawn-outcome.js +86 -11
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/tool-failure.js +72 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/toolchain-availability.js +106 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/vale.js +9 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/yamllint.js +18 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/zig-check.js +4 -2
- package/node_modules/pi-lens/dist/clients/disposition-publish.js +10 -3
- package/node_modules/pi-lens/dist/clients/eval-timestamp.js +17 -0
- package/node_modules/pi-lens/dist/clients/event-loop-monitor.js +28 -5
- package/node_modules/pi-lens/dist/clients/extension-log.js +317 -3
- package/node_modules/pi-lens/dist/clients/file-kinds.js +8 -2
- package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +294 -0
- package/node_modules/pi-lens/dist/clients/finding-identity.js +88 -0
- package/node_modules/pi-lens/dist/clients/fix-worklog.js +5 -1
- package/node_modules/pi-lens/dist/clients/format-events-publish.js +39 -8
- package/node_modules/pi-lens/dist/clients/formatters-lazy.js +3 -2
- package/node_modules/pi-lens/dist/clients/formatters.js +500 -115
- package/node_modules/pi-lens/dist/clients/generation-guard.js +216 -0
- package/node_modules/pi-lens/dist/clients/git-guard.js +49 -21
- package/node_modules/pi-lens/dist/clients/gitleaks-client.js +181 -8
- package/node_modules/pi-lens/dist/clients/go-client.js +21 -39
- package/node_modules/pi-lens/dist/clients/govulncheck-client.js +219 -10
- package/node_modules/pi-lens/dist/clients/grammar-source.js +333 -10
- package/node_modules/pi-lens/dist/clients/host-ports.js +9 -1
- package/node_modules/pi-lens/dist/clients/installer/index.js +1119 -101
- package/node_modules/pi-lens/dist/clients/installer/managed-tool-refresh-session.js +58 -0
- package/node_modules/pi-lens/dist/clients/installer/managed-tool-refresh.js +715 -0
- package/node_modules/pi-lens/dist/clients/instance-reaper.js +643 -97
- package/node_modules/pi-lens/dist/clients/instance-registry.js +87 -17
- package/node_modules/pi-lens/dist/clients/jscpd-client.js +86 -15
- package/node_modules/pi-lens/dist/clients/knip-client.js +361 -24
- package/node_modules/pi-lens/dist/clients/language-policy.js +8 -2
- package/node_modules/pi-lens/dist/clients/language-profile.js +2 -0
- package/node_modules/pi-lens/dist/clients/latency-logger.js +487 -9
- package/node_modules/pi-lens/dist/clients/lazy-import.js +21 -0
- package/node_modules/pi-lens/dist/clients/ledger-bounds.js +21 -0
- package/node_modules/pi-lens/dist/clients/lens-events.js +56 -25
- package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +16 -0
- package/node_modules/pi-lens/dist/clients/live-bus-emitter.js +45 -2
- package/node_modules/pi-lens/dist/clients/lsp/aggregation.js +30 -4
- package/node_modules/pi-lens/dist/clients/lsp/cascade-tier.js +160 -20
- package/node_modules/pi-lens/dist/clients/lsp/client.js +1666 -148
- package/node_modules/pi-lens/dist/clients/lsp/diagnostic-binding.js +111 -0
- package/node_modules/pi-lens/dist/clients/lsp/document-drift.js +389 -0
- package/node_modules/pi-lens/dist/clients/lsp/index.js +2496 -171
- package/node_modules/pi-lens/dist/clients/lsp/inferred-project.js +215 -0
- package/node_modules/pi-lens/dist/clients/lsp/jvm-runtime.js +146 -14
- package/node_modules/pi-lens/dist/clients/lsp/language.js +48 -4
- package/node_modules/pi-lens/dist/clients/lsp/server.js +517 -69
- package/node_modules/pi-lens/dist/clients/lsp/spawn-history.js +22 -0
- package/node_modules/pi-lens/dist/clients/lsp/sync-kind.js +43 -0
- package/node_modules/pi-lens/dist/clients/lsp/tsserver-sync.js +172 -0
- package/node_modules/pi-lens/dist/clients/lsp/wait-policy/classification.js +21 -5
- package/node_modules/pi-lens/dist/clients/lsp/wait-policy/strategies.js +61 -3
- package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +422 -28
- package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-session.js +30 -0
- package/node_modules/pi-lens/dist/clients/lsp/workspace-sweep-hold.js +175 -0
- package/node_modules/pi-lens/dist/clients/lsp-lazy.js +3 -2
- package/node_modules/pi-lens/dist/clients/mcp/analyze.js +4 -0
- package/node_modules/pi-lens/dist/clients/mcp/session.js +39 -18
- package/node_modules/pi-lens/dist/clients/model-provider.js +53 -0
- package/node_modules/pi-lens/dist/clients/module-report.js +8 -0
- package/node_modules/pi-lens/dist/clients/opengrep-client.js +15 -1
- package/node_modules/pi-lens/dist/clients/package-manager.js +170 -14
- package/node_modules/pi-lens/dist/clients/path-attribution-telemetry.js +27 -0
- package/node_modules/pi-lens/dist/clients/path-utils.js +160 -0
- package/node_modules/pi-lens/dist/clients/pipeline.js +178 -30
- package/node_modules/pi-lens/dist/clients/post-autofix-notice.js +37 -0
- package/node_modules/pi-lens/dist/clients/project-diagnostics/cache.js +17 -3
- package/node_modules/pi-lens/dist/clients/project-diagnostics/extractors.js +89 -22
- package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +85 -15
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/gitleaks.js +15 -3
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +23 -2
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/trivy.js +50 -2
- package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +5 -0
- package/node_modules/pi-lens/dist/clients/project-lens-config.js +3 -0
- package/node_modules/pi-lens/dist/clients/project-snapshot.js +299 -0
- package/node_modules/pi-lens/dist/clients/quiet-window-config.js +47 -0
- package/node_modules/pi-lens/dist/clients/quiet-window.js +11 -25
- package/node_modules/pi-lens/dist/clients/read-guard-logger.js +1 -1
- package/node_modules/pi-lens/dist/clients/read-guard.js +184 -10
- package/node_modules/pi-lens/dist/clients/resource-sampler.js +49 -17
- package/node_modules/pi-lens/dist/clients/reverse-deps.js +50 -11
- package/node_modules/pi-lens/dist/clients/review-graph/query.js +76 -4
- package/node_modules/pi-lens/dist/clients/run-duration.js +55 -0
- package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +248 -13
- package/node_modules/pi-lens/dist/clients/runtime-context.js +112 -12
- package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +472 -61
- package/node_modules/pi-lens/dist/clients/runtime-session.js +359 -13
- package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +217 -22
- package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +269 -22
- package/node_modules/pi-lens/dist/clients/runtime-turn.js +948 -87
- package/node_modules/pi-lens/dist/clients/rust-client.js +21 -37
- package/node_modules/pi-lens/dist/clients/safe-spawn.js +220 -7
- package/node_modules/pi-lens/dist/clients/scratch-tree-policy.js +161 -0
- package/node_modules/pi-lens/dist/clients/search-read-registration.js +34 -6
- package/node_modules/pi-lens/dist/clients/security-scan-client.js +224 -8
- package/node_modules/pi-lens/dist/clients/sg-runner.js +249 -37
- package/node_modules/pi-lens/dist/clients/single-flight.js +158 -0
- package/node_modules/pi-lens/dist/clients/smells-rollup.js +18 -11
- package/node_modules/pi-lens/dist/clients/stale-marker.js +17 -0
- package/node_modules/pi-lens/dist/clients/startup-timing.js +26 -2
- package/node_modules/pi-lens/dist/clients/test-runner-client.js +574 -32
- package/node_modules/pi-lens/dist/clients/tool-event.js +56 -5
- package/node_modules/pi-lens/dist/clients/tool-policy.js +127 -20
- package/node_modules/pi-lens/dist/clients/tool-set-policy.js +76 -0
- package/node_modules/pi-lens/dist/clients/tree-sitter-cache.js +75 -1
- package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +769 -64
- package/node_modules/pi-lens/dist/clients/tree-sitter-shared.js +11 -0
- package/node_modules/pi-lens/dist/clients/tree-sitter-symbol-extractor.js +90 -0
- package/node_modules/pi-lens/dist/clients/trivy-client.js +19 -1
- package/node_modules/pi-lens/dist/clients/warm-attach.js +17 -0
- package/node_modules/pi-lens/dist/clients/widget-state.js +336 -36
- package/node_modules/pi-lens/dist/clients/word-index.js +305 -33
- package/node_modules/pi-lens/dist/clients/zizmor-config.js +214 -14
- package/node_modules/pi-lens/dist/index.js +64677 -49484
- package/node_modules/pi-lens/dist/mcp/server.js +8 -2
- package/node_modules/pi-lens/dist/tools/activate-tools.js +17 -5
- package/node_modules/pi-lens/dist/tools/ast-grep-replace.js +9 -4
- package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +5 -2
- package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +469 -56
- package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +190 -46
- package/node_modules/pi-lens/dist/tools/lsp-navigation.js +46 -7
- package/node_modules/pi-lens/dist/tools/symbol-search.js +1 -1
- package/node_modules/pi-lens/docs/agent-guide.md +44 -14
- package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +518 -501
- package/node_modules/pi-lens/docs/dispositions.md +21 -0
- package/node_modules/pi-lens/docs/features.md +33 -6
- package/node_modules/pi-lens/docs/globalconfig.md +14 -0
- package/node_modules/pi-lens/docs/language-coverage.md +71 -5
- package/node_modules/pi-lens/docs/mcp.md +2 -2
- package/node_modules/pi-lens/docs/servercapabilities.md +4 -1
- package/node_modules/pi-lens/docs/settings.md +25 -1
- package/node_modules/pi-lens/docs/usage.md +24 -5
- package/node_modules/pi-lens/docs/word-index.md +35 -0
- package/node_modules/pi-lens/package.json +10 -6
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/__snapshots__/no-reflect-get-js-snapshot.yml +23 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/__snapshots__/no-reflect-get-snapshot.yml +23 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/__snapshots__/ts-void-zero-snapshot.yml +23 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-bare-object-param-test.yml +16 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-chained-type-assertions-test.yml +22 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-compile-call-test.yml +29 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-conditional-empty-object-spread-js-test.yml +9 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-conditional-empty-object-spread-test.yml +9 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-dupe-class-members-test.yml +33 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-inner-html-js-test.yml +7 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-inner-html-test.yml +7 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-known-value-widening-test.yml +9 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-non-null-assertion-test.yml +216 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-reflect-apply-js-test.yml +9 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-reflect-apply-test.yml +9 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-reflect-get-js-test.yml +9 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-reflect-get-test.yml +9 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-return-value-in-generator-test.yml +12 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-runtime-typeof-test.yml +33 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-server-bind-wildcard-test.yml +9 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-shape-in-symbol-names-test.yml +13 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-sql-in-code-js-test.yml +5 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-sql-in-code-test.yml +5 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-unknown-laundering-test.yml +11 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-unknown-parameters-test.yml +12 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-unknown-returns-test.yml +16 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-unsafe-dictionary-any-test.yml +10 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-unsafe-dictionary-unknown-test.yml +8 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/redundant-unsafe-function-test.yml +35 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/require-safety-comment-for-as-unknown-as-test.yml +177 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/ts-void-zero-test.yml +1 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-await-expression-member-js.yml +13 -2
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-await-expression-member.yml +13 -2
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-bare-host-path-in-win32-branch.yml +2 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-bare-object-param.yml +60 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-chained-type-assertions.yml +66 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-compile-call.yml +63 -5
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-conditional-empty-object-spread-js.yml +21 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-conditional-empty-object-spread.yml +29 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-dupe-class-members.yml +52 -8
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-inner-html-js.yml +27 -2
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-inner-html.yml +27 -2
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-known-value-widening.yml +71 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-non-null-assertion.yml +316 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-raw-json-store-write.yml +7 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-reflect-apply-js.yml +29 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-reflect-apply.yml +30 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-reflect-get-js.yml +41 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-reflect-get.yml +42 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-return-value-in-generator.yml +22 -5
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-runtime-typeof.yml +121 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-server-bind-wildcard.yml +23 -7
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-shape-in-symbol-names.yml +68 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-sql-in-code-js.yml +41 -2
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-sql-in-code.yml +41 -2
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-unknown-laundering.yml +32 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-unknown-parameters.yml +67 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-unknown-returns.yml +106 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-unsafe-dictionary-any.yml +50 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-unsafe-dictionary-unknown.yml +56 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-win32-isabsolute-for-qualification.yml +2 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/redundant-unsafe-function.yml +32 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/require-safety-comment-for-as-unknown-as.yml +184 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/ts-void-zero.yml +5 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/self-scan-baseline.json +5 -0
- package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +132 -1
- package/node_modules/pi-lens/scripts/download-grammars.js +25 -0
- package/node_modules/pi-lens/scripts/grammars.lock.json +9 -0
- package/node_modules/pi-lens/skills/pi-lens-ast-grep/SKILL.md +12 -11
- package/node_modules/pi-lens/skills/pi-lens-lsp-navigation/SKILL.md +22 -22
- package/node_modules/pi-lens/skills/pi-lens-write-ast-grep-rule/SKILL.md +87 -116
- package/node_modules/pi-lens/skills/pi-lens-write-ast-grep-rule/reference.md +170 -0
- package/node_modules/pi-lens/skills/pi-lens-write-tree-sitter-rule/SKILL.md +3 -1
- package/node_modules/pi-lens/vendor/grammars/tree-sitter-cue.wasm +0 -0
- package/node_modules/pi-mcp-adapter/CHANGELOG.md +49 -0
- package/node_modules/pi-mcp-adapter/README.md +51 -6
- package/node_modules/pi-mcp-adapter/agent-dir.ts +12 -4
- package/node_modules/pi-mcp-adapter/cli.js +188 -5
- package/node_modules/pi-mcp-adapter/commands.ts +128 -22
- package/node_modules/pi-mcp-adapter/config.ts +28 -10
- package/node_modules/pi-mcp-adapter/direct-tools.ts +23 -19
- package/node_modules/pi-mcp-adapter/index.ts +219 -32
- package/node_modules/pi-mcp-adapter/init.ts +36 -4
- package/node_modules/pi-mcp-adapter/lifecycle.ts +315 -24
- package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +39 -6
- package/node_modules/pi-mcp-adapter/mcp-bearer-store.ts +387 -0
- package/node_modules/pi-mcp-adapter/mcp-callback-server.ts +27 -3
- package/node_modules/pi-mcp-adapter/mcp-code.ts +4 -0
- package/node_modules/pi-mcp-adapter/mcp-panel.ts +42 -13
- package/node_modules/pi-mcp-adapter/mcp-setup-panel.ts +2 -1
- package/node_modules/pi-mcp-adapter/metadata-cache.ts +46 -25
- package/node_modules/pi-mcp-adapter/package-mcp-loader.ts +168 -0
- package/node_modules/pi-mcp-adapter/package.json +4 -1
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +5 -4
- package/node_modules/pi-mcp-adapter/request-headers-command.ts +330 -0
- package/node_modules/pi-mcp-adapter/search-ranking.ts +92 -22
- package/node_modules/pi-mcp-adapter/server-manager.ts +145 -2
- package/node_modules/pi-mcp-adapter/session-recovery.ts +7 -0
- package/node_modules/pi-mcp-adapter/tool-approval.ts +15 -2
- package/node_modules/pi-mcp-adapter/tool-metadata.ts +38 -18
- package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +44 -4
- package/node_modules/pi-mcp-adapter/types.ts +95 -10
- package/node_modules/pi-mcp-adapter/ui-server.ts +18 -16
- package/node_modules/pi-mcp-adapter/utils.ts +70 -0
- package/node_modules/pi-web-access/CHANGELOG.md +37 -0
- package/node_modules/pi-web-access/README.md +38 -14
- package/node_modules/pi-web-access/anysearch.ts +4 -2
- package/node_modules/pi-web-access/auth-fetch.ts +148 -0
- package/node_modules/pi-web-access/brave.ts +16 -4
- package/node_modules/pi-web-access/chrome-cookies.ts +110 -23
- package/node_modules/pi-web-access/curator-page.ts +8 -3
- package/node_modules/pi-web-access/curator-server.ts +5 -1
- package/node_modules/pi-web-access/exa.ts +18 -7
- package/node_modules/pi-web-access/extract.ts +134 -37
- package/node_modules/pi-web-access/fetch-params.ts +17 -3
- package/node_modules/pi-web-access/firecrawl.ts +172 -12
- package/node_modules/pi-web-access/gemini-search.ts +33 -7
- package/node_modules/pi-web-access/index.ts +160 -104
- package/node_modules/pi-web-access/package.json +2 -2
- package/node_modules/pi-web-access/page-query.ts +4 -2
- package/node_modules/pi-web-access/parallel-mcp.ts +249 -0
- package/node_modules/pi-web-access/parallel.ts +2 -2
- package/node_modules/pi-web-access/query-rewrite.ts +51 -0
- package/node_modules/pi-web-access/serper.ts +211 -0
- package/node_modules/pi-web-access/summary-model-scope.ts +12 -4
- package/node_modules/pi-web-access/summary-review.ts +51 -23
- package/node_modules/pi-web-access/tavily.ts +16 -4
- package/node_modules/pi-web-access/utils.ts +87 -0
- package/node_modules/pi-web-access/valyu.ts +199 -0
- package/node_modules/pi-web-access/youtube-extract.ts +2 -2
- package/package.json +13 -13
|
@@ -67,6 +67,27 @@ const x = risky();
|
|
|
67
67
|
This is the same convention every runner/profile honors, so a suppression is
|
|
68
68
|
portable, git-tracked, and visible in review — not private pi-lens metadata.
|
|
69
69
|
|
|
70
|
+
## Dual-scanner secrets need two marks
|
|
71
|
+
|
|
72
|
+
gitleaks and trivy scan for secrets independently. When both flag the same
|
|
73
|
+
credential on the same line, each finding gets its own anchor (`tool` +
|
|
74
|
+
`rule` differ: `gitleaks:<ruleId>` vs `trivy-secret:<ruleId>`), so one
|
|
75
|
+
`lens_diagnostic_mark` call clears only one of the two copies. The 🔴 STOP
|
|
76
|
+
blocker stays up, citing the still-unmarked copy, until both are marked
|
|
77
|
+
false-positive.
|
|
78
|
+
|
|
79
|
+
This is deliberate defense-in-depth, not a bug: a real credential that one
|
|
80
|
+
scanner misses still blocks. It is also strictly better than before #1691,
|
|
81
|
+
when the trivy copy of a corroborated finding had no anchor at all and could
|
|
82
|
+
never be cleared. Expect to call `lens_diagnostic_mark` twice — once per
|
|
83
|
+
`tool` — when `lens_diagnostics` shows the same line flagged under both
|
|
84
|
+
`gitleaks` and `trivy`.
|
|
85
|
+
|
|
86
|
+
The 🔴 STOP line's own bracket names which scanners still hold the finding —
|
|
87
|
+
`[gitleaks + trivy]` before either mark, narrowing to `[trivy]` after the
|
|
88
|
+
gitleaks copy clears — so a shrinking bracket, not a vanished blocker, is the
|
|
89
|
+
signal that one copy remains.
|
|
90
|
+
|
|
70
91
|
## Telemetry
|
|
71
92
|
|
|
72
93
|
Every mark (including in-memory `defer`) is appended as NDJSON to
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
### LSP Support
|
|
4
4
|
|
|
5
|
-
pi-lens includes **
|
|
5
|
+
pi-lens includes **45 language server definitions** (including four cross-cutting *auxiliary* scanners that attach alongside the file's language server — Opengrep, ast-grep, zizmor, and typos — see below). LSP is **enabled by default**; use `--no-lsp` to disable it for a session. Servers are auto-discovered from PATH, project `node_modules`, and managed installs. When a server is not installed, pi-lens offers an interactive install prompt.
|
|
6
6
|
|
|
7
7
|
**LSP Idle Management:** LSP servers shut down after 240 seconds of inactivity (no files modified) to free resources. The timer resets when you resume editing, preventing cold-start penalties during active development.
|
|
8
8
|
|
|
@@ -19,13 +19,13 @@ pi-lens includes **42 language server definitions** (including four cross-cuttin
|
|
|
19
19
|
- **`capabilities`** — shows which operations are supported by the active LSP server(s) for a file, read directly from the cached `initialize` response (no round-trip).
|
|
20
20
|
- **Symbol column resolution** — passing `symbol: "myFunc"` instead of an exact `character` position resolves the correct column automatically. Use `symbol: "foo#2"` for the second occurrence of `foo` on the line.
|
|
21
21
|
|
|
22
|
-
LSP servers for: TypeScript, Deno, Python (pyright/basedpyright + jedi), Go, Rust, Ruby (ruby-lsp + solargraph), PHP, C# (omnisharp), F#, Java (JDT LS, with Lombok javaagent support when a Lombok jar is available), Kotlin, Swift, Dart, Lua, C/C++, Zig, Haskell, Elixir, Gleam, OCaml, Clojure, Terraform, Nix, Bash, Docker, YAML, JSON, HTML, TOML, Prisma, Vue, Svelte, CSS.
|
|
22
|
+
LSP servers for: TypeScript, Deno, Python (pyright/basedpyright + jedi), Go, Rust, Ruby (ruby-lsp + solargraph), PHP, C# (omnisharp), F#, Java (JDT LS, with Lombok javaagent support when a Lombok jar is available), Kotlin, Swift, Dart, Lua, C/C++, Zig, Haskell, Elixir, Gleam, OCaml, Clojure, CUE (syntax and parse diagnostics; evaluation errors via the cue-vet auxiliary runner), Terraform, Nix, Bash, Docker, YAML, JSON, HTML, TOML, Prisma, Vue, Svelte, CSS.
|
|
23
23
|
|
|
24
24
|
### Formatters
|
|
25
25
|
|
|
26
|
-
pi-lens auto-detects and runs **
|
|
26
|
+
pi-lens auto-detects and runs **34 formatters** based on project config:
|
|
27
27
|
|
|
28
|
-
biome, prettier, oxfmt, ruff, black, sqlfluff, gofmt, rustfmt, zig fmt, dart format, shfmt, nixfmt, mix format, ocamlformat, clang-format, ktlint, rubocop, standardrb, gleam format, terraform fmt, php-cs-fixer, csharpier, fantomas, swiftformat, stylua, ormolu, taplo, fish_indent, google-java-format, cljfmt, cmake-format, psscriptanalyzer-format
|
|
28
|
+
biome, prettier, oxfmt, ruff, black, sqlfluff, gofmt, rustfmt, zig fmt, dart format, shfmt, nixfmt, mix format, ocamlformat, clang-format, ktlint, rubocop, standardrb, gleam format, terraform fmt, php-cs-fixer, csharpier, fantomas, swiftformat, stylua, ormolu, taplo, fish_indent, google-java-format, cljfmt, cmake-format, cue fmt, psscriptanalyzer-format
|
|
29
29
|
|
|
30
30
|
Detection rules:
|
|
31
31
|
|
|
@@ -40,6 +40,19 @@ Repositories can disable all immediate and deferred auto-format mutations with
|
|
|
40
40
|
keeping formatter detection, lint dispatch, LSP synchronization, and
|
|
41
41
|
diagnostics available.
|
|
42
42
|
|
|
43
|
+
**Auto-fix timing depends on the tool.** A `write` (new file, full overwrite,
|
|
44
|
+
or a bash-authored write like `sed -i`/a redirect) still gets pipeline autofix
|
|
45
|
+
immediately, in the same tool result; when it changes the file, the result
|
|
46
|
+
carries the full authoritative post-fix content (capped at 2 MiB per file, one
|
|
47
|
+
shared budget across a multi-file bash write — past that it degrades to a
|
|
48
|
+
re-read warning). An `edit` defers autofix to `agent_end`, where it joins the
|
|
49
|
+
same per-file deferred-mutation queue as deferred formatting — one coalesced
|
|
50
|
+
record per file (`kinds: {autofix, format}`), autofix draining before format
|
|
51
|
+
so the final state is formatter-stable. A `write` immediately followed by an
|
|
52
|
+
`edit` on the same file in the same turn demotes the write's autofix to
|
|
53
|
+
deferred too. See `clients/pipeline.ts`, `clients/runtime-tool-result.ts`, and
|
|
54
|
+
`clients/runtime-agent-end.ts`.
|
|
55
|
+
|
|
43
56
|
Deferred formatting (the `agent_end` default) runs with **bounded
|
|
44
57
|
concurrency**: at most three formatter subprocesses in flight at once, with
|
|
45
58
|
results applied in admission order and cooperative yields between files, so a
|
|
@@ -155,7 +168,7 @@ When `actionableWarnings.autoFix.enabled` is set in global or project config (or
|
|
|
155
168
|
|
|
156
169
|
### Bus Events — `pilens:files:touched` (#482)
|
|
157
170
|
|
|
158
|
-
pi-lens writes files **outside the agent's own tool calls**: dispatch autofix (biome/ruff/eslint/stylelint/sqlfluff/rubocop/ktlint/rust-clippy/dart-fix/golangci-lint/detekt/
|
|
171
|
+
pi-lens writes files **outside the agent's own tool calls**: dispatch autofix (biome/ruff/eslint/stylelint/sqlfluff/rubocop/ktlint/ktfmt/rust-clippy/dart-fix/golangci-lint/detekt/markdownlint/oxlint --fix) mutates the file immediately for a `write` and at `agent_end` for a deferred `edit` (see "Formatters" above); formatter runs (immediate or deferred-at-`agent_end`) do the same; and the conservative actionable-warnings autofix above applies LSP quickfixes at `agent_end` the same way. Other extensions in the same session that track file mutations are otherwise blind to those writes — this event, published either way, is how they find out.
|
|
159
172
|
|
|
160
173
|
pi-lens broadcasts them on pi's shared in-process event bus (`pi.events`, exposed to every extension via the `ExtensionAPI`) as a single named event:
|
|
161
174
|
|
|
@@ -319,7 +332,21 @@ Trivy requires an **explicit** opt-in (rather than just a manifest being present
|
|
|
319
332
|
}
|
|
320
333
|
```
|
|
321
334
|
|
|
322
|
-
**IaC misconfiguration (per-edit, not a session scan).** When `trivy.enabled` is set, pi-lens also runs `trivy config` as an on-write dispatch runner (alongside hadolint/tflint) over **Dockerfiles** and **Kubernetes manifests** (YAML with an `apiVersion:` + `kind:` signature) — Trivy's security-policy engine (runs-as-root, no `HEALTHCHECK`, `privileged: true`, missing resource limits, …), a different class from hadolint's lint. On Dockerfiles, trivy-config findings that hadolint already reports at the same line are suppressed, so it only adds the security checks hadolint lacks.
|
|
335
|
+
**IaC misconfiguration (per-edit, not a session scan).** When `trivy.enabled` is set, pi-lens also runs `trivy config` as an on-write dispatch runner (alongside hadolint/tflint) over **Dockerfiles** and **Kubernetes manifests** (YAML with an `apiVersion:` + `kind:` signature) — Trivy's security-policy engine (runs-as-root, no `HEALTHCHECK`, `privileged: true`, missing resource limits, …), a different class from hadolint's lint. On Dockerfiles, trivy-config findings that hadolint already reports at the same line are suppressed, so it only adds the security checks hadolint lacks. Compose/CloudFormation are tracked as follow-ups; Terraform is covered by the same runner, and Helm charts are covered by rendered-manifest validation below.
|
|
336
|
+
|
|
337
|
+
**Rendered-manifest validation for Helm charts (opt-in).** `helm lint` checks a chart's source; it cannot see what the chart produces. When a project sets
|
|
338
|
+
|
|
339
|
+
```json
|
|
340
|
+
{ "helm": { "renderValidation": { "enabled": true } } }
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
pi-lens also renders the nearest chart with `helm template` into a scratch directory under the system temp dir and validates the output:
|
|
344
|
+
|
|
345
|
+
- a **failed render** (a missing values key, a nil pointer in a template expression, a dependency declared in `Chart.yaml` but absent from `charts/`) is reported as a blocking finding on the template that failed — charts that pass `helm lint` and still cannot be installed;
|
|
346
|
+
- every rendered document must declare `apiVersion` and `kind`, so a conditional that renders a headless fragment is flagged instead of installing as a silent no-op;
|
|
347
|
+
- when `trivy.enabled` is also set, `trivy config` runs over the rendered manifests, which is the only way Trivy's Kubernetes policy checks can see a chart's real output.
|
|
348
|
+
|
|
349
|
+
It is **off by default** because rendering executes chart-authored template code, and the switch alone is not enough: the render also requires **host project trust**, since `.pi-lens.json` is a tracked file a cloned repository could ship pre-enabled. The switch is read from the chart's own project root, not the current directory. In untrusted mode the refusal is reported rather than silently skipped. Nothing is written to the chart directory, `--dependency-update` is never passed, and the scratch directory is removed on every exit path. Findings map back to the source template through helm's own `# Source:` annotations; rendered line numbers travel in the message, since they do not correspond to template lines. Full OpenAPI schema validation (kubeconform) is not included.
|
|
323
350
|
|
|
324
351
|
### MCP Server (Experimental)
|
|
325
352
|
|
|
@@ -25,6 +25,18 @@ Each runtime toggle is settable from the CLI *and* from `config.json`. The two a
|
|
|
25
25
|
| `--lens-actionable-warning-autofix` | `actionableWarnings.autoFix.enabled` | `false` |
|
|
26
26
|
| `--lens-actionable-warning-all` | `actionableWarnings.deltaOnly` (`false`) | `true` |
|
|
27
27
|
| `--lens-compact-tool-line` | `ui.compactToolLine` | `false` |
|
|
28
|
+
| `--no-lazy-tools` | `tools.lazy` | `true` |
|
|
29
|
+
| `--lens-turn-end-madge` | `turnEnd.madge.enabled` | `false` |
|
|
30
|
+
|
|
31
|
+
By default pi-lens registers six situational tools (the `ast_grep_*` family,
|
|
32
|
+
`lsp_navigation`, `lens_diagnostic_mark`) inactive and exposes a small loader,
|
|
33
|
+
`pi_lens_activate_tools`, that the model calls to activate the ones it needs.
|
|
34
|
+
`--no-lazy-tools` turns that off: every pi-lens tool is active from the first
|
|
35
|
+
turn and pi-lens never changes the tool list. Use it if you would rather spend
|
|
36
|
+
the tokens of a longer tool list than have the list change mid-session. The
|
|
37
|
+
loader tool is still registered and still describes itself as activating
|
|
38
|
+
inactive tools; under this flag those tools are already active, so calling it
|
|
39
|
+
does nothing.
|
|
28
40
|
|
|
29
41
|
Keys are positive (`"enabled": true` means the feature runs), so a `--no-*` flag corresponds to setting its key `false`. A `no-*` flag on the command line is a one-way switch: it can disable, never re-enable, so `--no-lsp` wins over `lsp.enabled: true` but nothing on the CLI overrides `lsp.enabled: false`. Set the key back to `true` to re-enable.
|
|
30
42
|
|
|
@@ -79,6 +91,8 @@ Hide the diagnostics widget by default, run formatting immediately after write/e
|
|
|
79
91
|
|
|
80
92
|
`actionableWarnings.enabled` gates the turn_end report. `includeLspCodeActions` fetches LSP code actions for each warning (requires an active language server). `deltaOnly` (default `true`) limits the report to lines touched in the current turn. `autoFix.enabled` applies conservative LSP quickfixes at `agent_end`; `autoFix.maxFixes` caps the number applied per turn (default `5`, must be a non-negative whole number). `maxFixes: 0` keeps the report and applies nothing, which is a useful halfway step before enabling `autoFix` for real. Unlike the toggles in the table above there is no CLI counterpart, since it takes a number rather than being on or off.
|
|
81
93
|
|
|
94
|
+
`turnEnd.madge.enabled` (default `false`) runs the per-turn-end madge circular-dependency check on import-changed files. It is off by default because that pass only writes debug output — user-facing madge diagnostics come from the session-start scan cache and the `lens_diagnostics` extractor — and its subprocess spawns dominated the turn-end latency tail (#766). Enable it with `--lens-turn-end-madge` or `turnEnd.madge.enabled: true` if you want the per-edit circular-dependency note.
|
|
95
|
+
|
|
82
96
|
`ignore` is an array of gitignore-style glob patterns excluded from pi-lens scans across **every** project — the global counterpart to the per-project `.pi-lens.json` `ignore` below. Precedence is lowest: a project `.gitignore` or `.pi-lens.json` (including a `!negation`) overrides it, so you can globally hide e.g. `scratch/**` and still re-include it in one repo.
|
|
83
97
|
|
|
84
98
|
Turn subsystems off globally instead of retyping flags every session:
|
|
@@ -9,7 +9,7 @@ Dispatch is diagnostics-oriented: automatic formatting and safe autofix happen i
|
|
|
9
9
|
| Language | LSP | Dispatch Runners | Formatter |
|
|
10
10
|
| --------------------- | --- | -------------------------------------------------------------------------------------------------------------- | ----------------------- |
|
|
11
11
|
| JavaScript/TypeScript | ✓ | lsp, ts-lsp, biome-check-json, tree-sitter, ast-grep-napi, type-safety, similarity, fact-rules, eslint, oxlint | biome, prettier |
|
|
12
|
-
| Python | ✓ | lsp, pyright, ruff-lint, tree-sitter
|
|
12
|
+
| Python | ✓ | lsp, pyright, mypy (config-first), ruff-lint, tree-sitter | ruff, black |
|
|
13
13
|
| Go | ✓ | lsp, go-vet, golangci-lint, tree-sitter | gofmt |
|
|
14
14
|
| Rust | ✓ | lsp, rust-clippy, tree-sitter | rustfmt |
|
|
15
15
|
| Ruby | ✓ | lsp, rubocop, tree-sitter | rubocop, standardrb |
|
|
@@ -18,13 +18,13 @@ Dispatch is diagnostics-oriented: automatic formatting and safe autofix happen i
|
|
|
18
18
|
| Fish | ✓ (fish-lsp) | lsp, fish-indent | fish_indent |
|
|
19
19
|
| CSS/SCSS/Less | ✓ | lsp, stylelint | biome, prettier |
|
|
20
20
|
| HTML | ✓ | lsp, htmlhint | prettier |
|
|
21
|
-
| YAML | ✓ | lsp, yamllint, actionlint (GitHub workflows)
|
|
22
|
-
| JSON | ✓ | lsp
|
|
21
|
+
| YAML | ✓ | lsp, yamllint, actionlint (GitHub workflows), trivy-config (opt-in; Kubernetes manifests, CloudFormation) | prettier |
|
|
22
|
+
| JSON | ✓ | lsp, trivy-config (opt-in; CloudFormation templates only) | biome, prettier |
|
|
23
23
|
| Svelte | ✓ | lsp | oxfmt (needs `svelte` pkg installed + config `svelte: true`) |
|
|
24
24
|
| Vue | ✓ | lsp | prettier, oxfmt |
|
|
25
25
|
| SQL | — | sqlfluff | sqlfluff |
|
|
26
26
|
| Markdown | — | spellcheck, markdownlint, vale | prettier |
|
|
27
|
-
| Docker | ✓ | lsp, hadolint
|
|
27
|
+
| Docker | ✓ | lsp, hadolint, trivy-config (opt-in) | — |
|
|
28
28
|
| PHP | ✓ | lsp, php-lint, phpstan | php-cs-fixer |
|
|
29
29
|
| PowerShell | ✓ | lsp, psscriptanalyzer | psscriptanalyzer-format |
|
|
30
30
|
| Prisma | ✓ | lsp, prisma-validate | — |
|
|
@@ -46,4 +46,70 @@ Dispatch is diagnostics-oriented: automatic formatting and safe autofix happen i
|
|
|
46
46
|
| Terragrunt | — | terragrunt | terragrunt hcl fmt |
|
|
47
47
|
| Nix | ✓ | lsp | nixfmt |
|
|
48
48
|
| TOML | ✓ | lsp, taplo | taplo |
|
|
49
|
-
| CMake | ✓ (cmake-language-server) | lsp
|
|
49
|
+
| CMake | ✓ (cmake-language-server) | lsp | cmake-format |
|
|
50
|
+
| CUE | ✓ (syntax via cue lsp, evaluation via cue vet) | lsp, cue-vet | cue fmt |
|
|
51
|
+
|
|
52
|
+
`cue lsp` reports load and parse errors as you type but leaves conflicting
|
|
53
|
+
values and failed constraints to `cue vet` — the `cue-vet` auxiliary runner
|
|
54
|
+
(#1522) covers that gap, so together they give full coverage: syntax/parse
|
|
55
|
+
diagnostics, hover, definition, completion, code actions, and formatting from
|
|
56
|
+
the language server, plus evaluation-error validation from `cue vet` on every
|
|
57
|
+
edit (vetted at the PACKAGE level — the touched file's directory — with the
|
|
58
|
+
result filtered back to that file, since CUE packages are directory-scoped).
|
|
59
|
+
`.cue` files parse under tree-sitter with symbol (`#Definition`s, fields,
|
|
60
|
+
`let` bindings) and import queries (#1522), giving CUE the same structural
|
|
61
|
+
symbol search and import extraction as any other language, with two known
|
|
62
|
+
rough edges inherited from the young `tree-sitter-cue` grammar itself (not
|
|
63
|
+
this repo's queries):
|
|
64
|
+
|
|
65
|
+
- **Multi-hash raw strings** (`` ##"..."## ``, two or more `#` delimiters)
|
|
66
|
+
mis-parse regardless of content — the field's value becomes a bare
|
|
67
|
+
`identifier` node instead of a `string`, and the parser emits stray
|
|
68
|
+
top-level nodes outside the field entirely. Because the broken value node
|
|
69
|
+
can carry `#`-prefixed text, this can surface as a spurious symbol
|
|
70
|
+
reference in the extracted refs. Single-hash raw strings (`` #"..."# ``)
|
|
71
|
+
are unaffected.
|
|
72
|
+
- **Aliased field labels** (`X=name: value`) emit the alias identifier (`X`)
|
|
73
|
+
as its own spurious `property` symbol alongside the real field's correct
|
|
74
|
+
symbol, because the grammar exposes both identifiers as untagged siblings
|
|
75
|
+
under the same `label` node with no way to tell them apart structurally.
|
|
76
|
+
|
|
77
|
+
Both are upstream grammar limitations (tracked among
|
|
78
|
+
[eonpatapon/tree-sitter-cue](https://github.com/eonpatapon/tree-sitter-cue)'s
|
|
79
|
+
open issues), not something a query change here can fix.
|
|
80
|
+
|
|
81
|
+
## Considered and skipped (2026-08-20 survey, closed out by #1757)
|
|
82
|
+
|
|
83
|
+
Recorded so these are not re-litigated. The 2026-08-20 survey's first pass
|
|
84
|
+
rejected `bandit` and `checkov` as duplicates of existing lanes; #1752's
|
|
85
|
+
review disproved both "already covered" claims against the actual code, and
|
|
86
|
+
#1757 closed the resulting gaps:
|
|
87
|
+
|
|
88
|
+
- **bandit** (Python SAST) — RESOLVED. ruff's `S` ruleset implements Bandit's
|
|
89
|
+
checks; `config/ruff/core.toml` now selects `S`, with `S101` (assert),
|
|
90
|
+
`S311` (non-cryptographic random), `S603`/`S607` (subprocess without
|
|
91
|
+
`shell=True` / partial executable path) excluded as over-firing on real
|
|
92
|
+
code (measured against the `requests` and `pip` packages — see the config
|
|
93
|
+
file's comments for the exclusion reasoning and hit counts). `C90`
|
|
94
|
+
(mccabe complexity) was evaluated and NOT enabled: it is a maintainability
|
|
95
|
+
metric, not a Bandit-equivalent security check, and its hit volume on a
|
|
96
|
+
large pre-existing codebase (379 in `pandas`) would drown the security
|
|
97
|
+
signal `S` adds. As always, a project-local ruff config overrides the
|
|
98
|
+
bundled one outright.
|
|
99
|
+
- **checkov** (IaC security) — the `trivy config` lane pi-lens's own dispatch
|
|
100
|
+
registry already carries (`clients/dispatch/runners/trivy-config.ts`,
|
|
101
|
+
opt-in via `trivy.enabled`) makes checkov a duplicate, not a gap: no
|
|
102
|
+
second full-scan tool is needed. That lane covers Kubernetes manifests,
|
|
103
|
+
Dockerfiles, and Terraform; #1757 added CloudFormation (yaml and json
|
|
104
|
+
templates, detected via `AWSTemplateFormatVersion` / SAM `Transform` /
|
|
105
|
+
`Type: AWS::*` heuristics) and fixed a real bug found while verifying
|
|
106
|
+
against the installed binary: the runner passed `--no-progress` to `trivy
|
|
107
|
+
config`, a flag that subcommand rejects (only `trivy fs` accepts it) —
|
|
108
|
+
every real invocation exited 1 and, because trivy prints its usage text to
|
|
109
|
+
stdout on a rejected flag, was misreported as a clean `succeeded` scan
|
|
110
|
+
rather than an errored one. Dropping the flag was the fix.
|
|
111
|
+
- **radon / lizard** (complexity) — still not enabled; see the C90 note
|
|
112
|
+
above. Unchanged conclusion, now backed by measurement rather than
|
|
113
|
+
assumption.
|
|
114
|
+
|
|
115
|
+
Known coverage holes with no tool currently clearing the adoption bar: Rust and Java dead-code detection, Ruby type checking (sorbet judged too heavy and idiosyncratic for a default lane).
|
|
@@ -243,8 +243,8 @@ Initial assumption ("knip/jscpd are booboo-only") was **wrong**. Verified:
|
|
|
243
243
|
| layer | handler | runs |
|
|
244
244
|
|-------|---------|------|
|
|
245
245
|
| per-edit | `dispatchLintWithResult` | LSP, tree-sitter, ast-grep, fact-rules, biome/ruff/eslint/oxlint |
|
|
246
|
-
| per-turn | `handleTurnEnd` (`runtime-turn.ts`) | **knip
|
|
247
|
-
| per-session | `handleSessionStart` (`runtime-session.ts`) | **jscpd full scan
|
|
246
|
+
| per-turn | `handleTurnEnd` (`runtime-turn.ts`) | **knip**, **jscpd** (incremental, `getFilesForJscpd`), **madge/dep circular** (opt-in via `--lens-turn-end-madge`), **cascade merge**, **tests**, actionable/code-quality warnings aggregation, project-diagnostics delta |
|
|
247
|
+
| per-session | `handleSessionStart` (`runtime-session.ts`) | **jscpd full scan**, knip, type-coverage, dep, govulncheck, gitleaks, todo, complexity baselines, dominant-language **LSP warm** (#203). The production path does not currently populate the error-debt baseline. |
|
|
248
248
|
|
|
249
249
|
The initial MCP implementation invoked **none** of the lifecycle handlers —
|
|
250
250
|
only the per-edit layer. The shipped server now exposes `pilens_session_start`
|
|
@@ -6,7 +6,7 @@ server's `initialize` handshake. Generated by `node scripts/server-capabilities.
|
|
|
6
6
|
absent on the generating host are listed under *Unavailable* — run in a
|
|
7
7
|
provisioned environment (the nightly) to capture those rows.
|
|
8
8
|
|
|
9
|
-
_Last generated: 2026-08-
|
|
9
|
+
_Last generated: 2026-08-20 on linux; 30 servers captured, 14 unavailable._
|
|
10
10
|
|
|
11
11
|
## Diagnostic mode + navigation/edit operations
|
|
12
12
|
|
|
@@ -19,6 +19,7 @@ Legend: ✓ advertised, · not. **mode** = document diagnostics (`pull` = `textD
|
|
|
19
19
|
| clojure | push-only | · | ✓ | · | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | 62 |
|
|
20
20
|
| csharp | pull | ✓ | ✓ | ✓ | · | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | 0 |
|
|
21
21
|
| css | pull | · | ✓ | · | · | ✓ | ✓ | · | ✓ | · | ✓ | ✓ | · | · | 0 |
|
|
22
|
+
| cue | push-only | · | ✓ | · | · | ✓ | ✓ | · | ✓ | · | ✓ | ✓ | · | · | 1 |
|
|
22
23
|
| dart | push-only | · | ✓ | ✓ | · | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | 18 |
|
|
23
24
|
| deno | pull | · | ✓ | ✓ | · | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | 2 |
|
|
24
25
|
| docker | push-only | · | ✓ | · | · | · | ✓ | ✓ | ✓ | · | · | ✓ | · | · | 0 |
|
|
@@ -54,6 +55,7 @@ Legend: ✓ advertised, · not. **mode** = document diagnostics (`pull` = `textD
|
|
|
54
55
|
- **clojure**: callHierarchyProvider, codeActionProvider, codeLensProvider, completionProvider, declarationProvider, definitionProvider, documentFormattingProvider, documentHighlightProvider, documentRangeFormattingProvider, documentSymbolProvider, executeCommandProvider, experimental, foldingRangeProvider, hoverProvider, implementationProvider, linkedEditingRangeProvider, referencesProvider, renameProvider, selectionRangeProvider, semanticTokensProvider, signatureHelpProvider, textDocumentSync, workspace, workspaceSymbolProvider
|
|
55
56
|
- **csharp**: callHierarchyProvider, codeActionProvider, codeLensProvider, completionProvider, definitionProvider, diagnosticProvider, documentFormattingProvider, documentHighlightProvider, documentOnTypeFormattingProvider, documentRangeFormattingProvider, documentSymbolProvider, foldingRangeProvider, hoverProvider, implementationProvider, inlayHintProvider, referencesProvider, renameProvider, semanticTokensProvider, signatureHelpProvider, textDocumentSync, typeDefinitionProvider, typeHierarchyProvider, workspace, workspaceSymbolProvider
|
|
56
57
|
- **css**: codeActionProvider, colorProvider, definitionProvider, diagnosticProvider, documentFormattingProvider, documentHighlightProvider, documentLinkProvider, documentRangeFormattingProvider, documentSymbolProvider, foldingRangeProvider, hoverProvider, referencesProvider, renameProvider, selectionRangeProvider, textDocumentSync
|
|
58
|
+
- **cue**: codeActionProvider, codeLensProvider, completionProvider, definitionProvider, documentFormattingProvider, documentSymbolProvider, executeCommandProvider, hoverProvider, referencesProvider, renameProvider, textDocumentSync, workspace
|
|
57
59
|
- **dart**: callHierarchyProvider, codeActionProvider, codeLensProvider, colorProvider, completionProvider, definitionProvider, documentFormattingProvider, documentHighlightProvider, documentLinkProvider, documentOnTypeFormattingProvider, documentRangeFormattingProvider, documentSymbolProvider, executeCommandProvider, experimental, foldingRangeProvider, hoverProvider, implementationProvider, inlayHintProvider, inlineValueProvider, referencesProvider, renameProvider, selectionRangeProvider, semanticTokensProvider, signatureHelpProvider, textDocumentSync, typeDefinitionProvider, typeHierarchyProvider, workspace, workspaceSymbolProvider
|
|
58
60
|
- **deno**: callHierarchyProvider, codeActionProvider, codeLensProvider, completionProvider, definitionProvider, diagnosticProvider, documentFormattingProvider, documentHighlightProvider, documentSymbolProvider, executeCommandProvider, experimental, foldingRangeProvider, hoverProvider, implementationProvider, inlayHintProvider, notebookDocumentSync, referencesProvider, renameProvider, selectionRangeProvider, semanticTokensProvider, signatureHelpProvider, textDocumentSync, typeDefinitionProvider, workspace, workspaceSymbolProvider
|
|
59
61
|
- **docker**: codeActionProvider, completionProvider, definitionProvider, documentFormattingProvider, documentHighlightProvider, documentLinkProvider, documentOnTypeFormattingProvider, documentRangeFormattingProvider, documentSymbolProvider, foldingRangeProvider, hoverProvider, renameProvider, signatureHelpProvider, textDocumentSync
|
|
@@ -89,6 +91,7 @@ surface, including providers pi-lens does not yet consume.
|
|
|
89
91
|
|
|
90
92
|
- **ast-grep** (1): ast-grep.applyAllFixes
|
|
91
93
|
- **clojure** (62): add-import-to-namespace, add-missing-import, add-missing-libspec, add-require-suggestion, as-to-refer, backward, backward-barf, backward-select, backward-slurp, change-coll, clean-ns, cond->if-refactor, create-function, create-test, cursor-info, cycle-coll, cycle-keyword-auto-resolve, cycle-privacy, demote-fn, destructure-keys, drag-backward, drag-forward, drag-param-backward, drag-param-forward, expand-let, extract-function, extract-to-def, forward, forward-barf, forward-select, forward-slurp, get-in-all, get-in-less, get-in-more, get-in-none, if->cond-refactor, inline-function, inline-symbol, introduce-let, kill-sexp, …
|
|
94
|
+
- **cue** (1): cuelsp.externalvalidate
|
|
92
95
|
- **dart** (18): dart.edit.codeAction.apply, dart.edit.sortMembers, dart.edit.organizeImports, dart.edit.fixAll, dart.edit.fixAllInWorkspace.preview, dart.edit.fixAllInWorkspace, dart.edit.sendWorkspaceEdit, refactor.perform, refactor.validate, dart.logAction, dart.refactor.add_constructor_name, dart.refactor_add.import_prefix, dart.refactor.convert_all_formal_parameters_to_named, dart.refactor.convert_selected_formal_parameters_to_named, dart.refactor.move_selected_formal_parameters_left, dart.refactor.move_top_level_to_file, dart.refactor.remove_constructor_name, dart.refactor.remove_import_prefix
|
|
93
96
|
- **deno** (2): deno.cache, deno.reloadImportRegistries
|
|
94
97
|
- **expert** (2): Reindex, connectionDetails
|
|
@@ -70,6 +70,13 @@ column is the effective behavior when nothing is set.
|
|
|
70
70
|
| `--lens-actionable-warning-autofix` | `actionableWarnings.autoFix.enabled` | project | **off** |
|
|
71
71
|
| `--lens-actionable-warning-all` | `actionableWarnings.deltaOnly` (`false`) | global | `deltaOnly` **on** (report this turn only) |
|
|
72
72
|
| `--lens-compact-tool-line` | `ui.compactToolLine` | global | **off** (two-row tool rendering) |
|
|
73
|
+
| `--no-lazy-tools` | `tools.lazy` | global | lazy tools **on** (six situational tools start inactive) |
|
|
74
|
+
| `--lens-turn-end-madge` | `turnEnd.madge.enabled` | global | **off** (madge runs at session start, not per turn) |
|
|
75
|
+
|
|
76
|
+
`--no-lazy-tools` keeps every pi-lens tool active for the whole session, so the
|
|
77
|
+
advertised tool list never changes. The `pi_lens_activate_tools` loader stays
|
|
78
|
+
registered and keeps its usual description; under this flag the tools it names
|
|
79
|
+
are already active, so calling it is a no-op.
|
|
73
80
|
|
|
74
81
|
`--lens-guard` is **EXPERIMENTAL and strictly opt-in**. When enabled, actual
|
|
75
82
|
`git commit`/`git push` commands are blocked only for current, structured
|
|
@@ -100,6 +107,7 @@ field docs.
|
|
|
100
107
|
| `maxProjectFiles` | project | `2000` | Base scale knob; derives five subsystem size budgets |
|
|
101
108
|
| `reviewGraph.maxFiles` | project | derived (clamped `100`–`20000`) | Explicit review-graph file budget |
|
|
102
109
|
| `trivy.enabled` / `trivy.minSeverity` | project | off | Opt-in Trivy vulnerability scanning |
|
|
110
|
+
| `helm.renderValidation.enabled` | project | off | Opt-in `helm template` rendering plus rendered-manifest validation. Rendering executes chart templates, so it **also requires host project trust** and is read from the chart's own project root — see below |
|
|
103
111
|
|
|
104
112
|
## Global vs project config
|
|
105
113
|
|
|
@@ -135,7 +143,23 @@ A project file honors **only**:
|
|
|
135
143
|
|
|
136
144
|
- the three mutation controls — `format.enabled`, `autofix.enabled`,
|
|
137
145
|
`actionableWarnings.autoFix.enabled`;
|
|
138
|
-
- `ignore`, `rules`, `maxProjectFiles`, `reviewGraph`, and `
|
|
146
|
+
- `ignore`, `rules`, `maxProjectFiles`, `reviewGraph`, `trivy`, and `helm`.
|
|
147
|
+
|
|
148
|
+
### `helm.renderValidation.enabled` needs trust as well as consent
|
|
149
|
+
|
|
150
|
+
Rendering a Helm chart runs the chart's own Go templates, so this switch is not
|
|
151
|
+
sufficient on its own. Two independent conditions must both hold:
|
|
152
|
+
|
|
153
|
+
1. **The project consents.** `helm.renderValidation.enabled` must be `true`,
|
|
154
|
+
read from the `.pi-lens.json` that governs the **chart's own project root** —
|
|
155
|
+
not the current working directory. An opt-in in an unrelated directory does
|
|
156
|
+
not authorize rendering another project's chart.
|
|
157
|
+
2. **The host trusts the project.** `.pi-lens.json` is a tracked file, so a
|
|
158
|
+
cloned repository can arrive with the switch already on and would otherwise
|
|
159
|
+
authorize execution of its own templates. In untrusted mode pi-lens refuses
|
|
160
|
+
to render and reports the refusal, naming trust as the reason, rather than
|
|
161
|
+
skipping silently. This is the same trust gate that governs LSP server spawns
|
|
162
|
+
and tool auto-installs.
|
|
139
163
|
|
|
140
164
|
Most toggles are **global-only**. Putting a global-only key such as
|
|
141
165
|
`"lsp": { "enabled": false }` in a `.pi-lens.json` is **not** honored at project
|
|
@@ -18,17 +18,34 @@ pi-lens hooks into the pi agent lifecycle:
|
|
|
18
18
|
|
|
19
19
|
## On-write pipeline
|
|
20
20
|
|
|
21
|
-
For each write/edit, pi-lens runs a language-aware pipeline
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
For each write/edit, pi-lens runs a language-aware pipeline. Format and safe
|
|
22
|
+
autofix (steps 1–2) run on different schedules depending on the tool:
|
|
23
|
+
|
|
24
|
+
- **`write`** (new file, full overwrite, bash-authored write): autofix runs
|
|
25
|
+
immediately, in the same tool result, carrying the fixed file's full content
|
|
26
|
+
back to the agent when it fits under the per-file cap.
|
|
27
|
+
- **`edit`**: autofix defers to `agent_end`, joining the same per-file queue as
|
|
28
|
+
deferred formatting; autofix drains before format so the final state is
|
|
29
|
+
formatter-stable. A `write` followed by an `edit` on the same file in the
|
|
30
|
+
same turn demotes the write's autofix to deferred too.
|
|
31
|
+
|
|
32
|
+
1. Format queue / immediate formatting when configured (deferred to
|
|
33
|
+
`agent_end` for an `edit` even under `--immediate-format`, so it lands
|
|
34
|
+
after autofix reformats the file).
|
|
35
|
+
2. Safe autofix from tools with deterministic fix support — immediate for
|
|
36
|
+
`write`, deferred to `agent_end` for `edit` (see above).
|
|
25
37
|
3. LSP file sync and diagnostic wait.
|
|
26
38
|
4. Parallel dispatch runners: LSP, ast-grep, tree-sitter, fact rules, and
|
|
27
|
-
language-specific linters/security scanners.
|
|
39
|
+
language-specific linters/security scanners. For a deferred `edit`, these
|
|
40
|
+
run against the not-yet-autofixed disk state, so a lint finding autofix
|
|
41
|
+
would have cleared may appear here and resolve itself at `agent_end`.
|
|
28
42
|
5. Cascade diagnostics for likely affected neighbors.
|
|
29
43
|
6. Deduplication and routing to blockers, actionable warnings, or code-quality
|
|
30
44
|
history.
|
|
31
45
|
|
|
46
|
+
See [`docs/agent-guide.md`](agent-guide.md#6-auto-format--auto-fix-timing--dont-be-surprised)
|
|
47
|
+
for the consumer-facing version of this routing.
|
|
48
|
+
|
|
32
49
|
## Agent tools
|
|
33
50
|
|
|
34
51
|
pi-lens exposes these high-value tools to agents:
|
|
@@ -92,6 +109,8 @@ pi --no-opengrep # Disable the Opengrep security scanner (default-on aux
|
|
|
92
109
|
pi --no-read-guard # Disable the read-before-edit behavior monitor
|
|
93
110
|
pi --lens-turn-summary # Persist a per-turn summary of diagnostics, autofixes, and autoformats
|
|
94
111
|
pi --lens-compact-tool-line # Render tool results as one compact, theme-aware line (closes #1327)
|
|
112
|
+
pi --no-lazy-tools # Keep every pi-lens tool active instead of activating the situational ones on demand
|
|
113
|
+
pi --lens-turn-end-madge # Run the madge circular-dependency check at every turn end, not just at session start
|
|
95
114
|
|
|
96
115
|
# Actionable warnings (all default off)
|
|
97
116
|
pi --lens-actionable-warnings # Report fixable warnings at turn end
|
|
@@ -42,6 +42,41 @@ HTTPServer → httpserver, http, server
|
|
|
42
42
|
each through `splitIdentifier`; queries are tokenized the same way so
|
|
43
43
|
`"authenticate user"` matches `authenticateUser`, `auth_user`, etc.
|
|
44
44
|
|
|
45
|
+
## Query prefix filters (#1450)
|
|
46
|
+
|
|
47
|
+
The query string can mix plain terms with composable `key:value` filters,
|
|
48
|
+
parsed by `parseWordIndexQuery` (`clients/word-index.ts`) before tokenization:
|
|
49
|
+
|
|
50
|
+
- `lang:<kind>` — restrict to a file kind's extensions, drawn from
|
|
51
|
+
`KIND_EXTENSIONS` (`clients/file-kinds.ts`) — the single source of truth
|
|
52
|
+
(#894 invariant), so there is no second, hand-maintained language list here.
|
|
53
|
+
- `file:<substr>` — path substring match against the index's own stored path,
|
|
54
|
+
normalized through `wordIndexKey` (case-folded on win32 only, matching how
|
|
55
|
+
the index's own path-keyed maps already fold win32 paths, #1025).
|
|
56
|
+
- `ext:<ext>` — literal extension match (`ext:ts` and `ext:.ts` are
|
|
57
|
+
equivalent).
|
|
58
|
+
- Any filter may be negated with a leading `-` (`-file:test`).
|
|
59
|
+
|
|
60
|
+
Example: `lang:jsts file:clients/ -file:test rank`. Multiple positive filters
|
|
61
|
+
of the SAME key OR together; different keys AND; negations always subtract.
|
|
62
|
+
Filters are applied as a `fileFilter` predicate BEFORE BM25/priors/centrality
|
|
63
|
+
scoring (same seam as the pre-existing `paths`/`lang` structured options,
|
|
64
|
+
#771), so a surviving file's score is unaffected by filtering. An unrecognized
|
|
65
|
+
`key:` token passes through as an ordinary search term (colon-bearing terms
|
|
66
|
+
like `std::vector`, URLs, and Windows paths search normally). Only a
|
|
67
|
+
recognized key with a bad value — an unrecognized `lang:` kind — throws
|
|
68
|
+
`WordIndexQueryError`
|
|
69
|
+
naming the supported list — never silently falls through as a literal search
|
|
70
|
+
term. Both the pi `symbol_search` tool and the MCP `pilens_symbol_search`
|
|
71
|
+
mirror inherit the syntax for free since both pass their `query` argument
|
|
72
|
+
straight through to `searchWordIndex` (the entry point where parsing happens).
|
|
73
|
+
|
|
74
|
+
DF-normalization: BM25's per-token `idf` is computed from the FULL,
|
|
75
|
+
unfiltered posting for that token before `fileFilter` is applied per
|
|
76
|
+
candidate file — a filtered query reuses the global, corpus-wide document
|
|
77
|
+
frequency rather than recomputing it over the filtered subset. Documented as
|
|
78
|
+
an acceptable approximation (see the doc comment on `searchWordIndex`).
|
|
79
|
+
|
|
45
80
|
## Lifecycle
|
|
46
81
|
|
|
47
82
|
The index is built/refreshed in **every** startup mode: load the persisted
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-lens",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Real-time code feedback for pi — LSP, linters, formatters, type-checking, structural analysis & booboo",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,10 @@
|
|
|
32
32
|
"audit:tree-sitter": "node scripts/audit-tree-sitter-rules.mjs",
|
|
33
33
|
"audit:rule-catalog": "node scripts/validate-rule-catalog.mjs",
|
|
34
34
|
"audit:astgrep-rule-pairs": "node scripts/audit-astgrep-rule-pairs.mjs",
|
|
35
|
+
"astgrep:self-scan": "node scripts/run-astgrep-pi-lens.mjs",
|
|
36
|
+
"astgrep:self-scan:update-baseline": "node scripts/run-astgrep-pi-lens.mjs --update-baseline",
|
|
35
37
|
"audit:playground": "node scripts/playground-verify-rule.mjs",
|
|
38
|
+
"bench:cascade-budget": "node scripts/bench-cascade-budget.mjs",
|
|
36
39
|
"logs:smells": "node scripts/analyze-pi-lens-logs.mjs",
|
|
37
40
|
"changelog:check": "node scripts/rollup-changelog.mjs --check",
|
|
38
41
|
"changelog:release": "node scripts/changelog-release.mjs",
|
|
@@ -42,11 +45,11 @@
|
|
|
42
45
|
"docs:rule-catalogs": "node scripts/gen-rule-catalogs.mjs",
|
|
43
46
|
"banner": "npx -y sharp-cli --input banner.svg --output banner.png resize 2200 620",
|
|
44
47
|
"download-grammars": "node scripts/download-grammars.js",
|
|
45
|
-
"harness:poc": "node scripts/run-harness.mjs cases/ts/pipeline-dispatch-poc
|
|
46
|
-
"harness:python-poc": "node scripts/run-harness.mjs cases/python/pipeline-dispatch-poc
|
|
47
|
-
"harness:ts-format-poc": "node scripts/run-harness.mjs cases/ts/format-default-poc
|
|
48
|
-
"harness:python-autofix-poc": "node scripts/run-harness.mjs cases/python/autofix-default-poc
|
|
49
|
-
"harness:go-poc": "node scripts/run-harness.mjs cases/go/pipeline-dispatch-poc
|
|
48
|
+
"harness:poc": "node scripts/run-harness.mjs cases/ts/pipeline-dispatch-poc",
|
|
49
|
+
"harness:python-poc": "node scripts/run-harness.mjs cases/python/pipeline-dispatch-poc",
|
|
50
|
+
"harness:ts-format-poc": "node scripts/run-harness.mjs cases/ts/format-default-poc",
|
|
51
|
+
"harness:python-autofix-poc": "node scripts/run-harness.mjs cases/python/autofix-default-poc",
|
|
52
|
+
"harness:go-poc": "node scripts/run-harness.mjs cases/go/pipeline-dispatch-poc"
|
|
50
53
|
},
|
|
51
54
|
"keywords": [
|
|
52
55
|
"pi",
|
|
@@ -69,6 +72,7 @@
|
|
|
69
72
|
"dist/",
|
|
70
73
|
"docs/",
|
|
71
74
|
"grammars/",
|
|
75
|
+
"vendor/grammars/",
|
|
72
76
|
"config/",
|
|
73
77
|
"rules/",
|
|
74
78
|
"skills/",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
id: no-reflect-get-js
|
|
2
|
+
snapshots:
|
|
3
|
+
Reflect.get(obj, "key"):
|
|
4
|
+
fixed: obj["key"]
|
|
5
|
+
labels:
|
|
6
|
+
- source: Reflect.get(obj, "key")
|
|
7
|
+
style: primary
|
|
8
|
+
start: 0
|
|
9
|
+
end: 23
|
|
10
|
+
const ordinary = { get(target, prop, receiver) { return Reflect.get(target, prop, receiver); } };:
|
|
11
|
+
fixed: const ordinary = { get(target, prop, receiver) { return Reflect.get(target, prop, receiver); } };
|
|
12
|
+
labels:
|
|
13
|
+
- source: Reflect.get(target, prop, receiver)
|
|
14
|
+
style: primary
|
|
15
|
+
start: 56
|
|
16
|
+
end: 91
|
|
17
|
+
const v = Reflect.get(target, prop);:
|
|
18
|
+
fixed: const v = target[prop];
|
|
19
|
+
labels:
|
|
20
|
+
- source: Reflect.get(target, prop)
|
|
21
|
+
style: primary
|
|
22
|
+
start: 10
|
|
23
|
+
end: 35
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
id: no-reflect-get
|
|
2
|
+
snapshots:
|
|
3
|
+
Reflect.get(obj, "key"):
|
|
4
|
+
fixed: obj["key"]
|
|
5
|
+
labels:
|
|
6
|
+
- source: Reflect.get(obj, "key")
|
|
7
|
+
style: primary
|
|
8
|
+
start: 0
|
|
9
|
+
end: 23
|
|
10
|
+
const ordinary = { get(target, prop, receiver) { return Reflect.get(target, prop, receiver); } };:
|
|
11
|
+
fixed: const ordinary = { get(target, prop, receiver) { return Reflect.get(target, prop, receiver); } };
|
|
12
|
+
labels:
|
|
13
|
+
- source: Reflect.get(target, prop, receiver)
|
|
14
|
+
style: primary
|
|
15
|
+
start: 56
|
|
16
|
+
end: 91
|
|
17
|
+
const v = Reflect.get(target, prop);:
|
|
18
|
+
fixed: const v = target[prop];
|
|
19
|
+
labels:
|
|
20
|
+
- source: Reflect.get(target, prop)
|
|
21
|
+
style: primary
|
|
22
|
+
start: 10
|
|
23
|
+
end: 35
|
package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/__snapshots__/ts-void-zero-snapshot.yml
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
id: ts-void-zero
|
|
2
|
+
snapshots:
|
|
3
|
+
const x = void 0:
|
|
4
|
+
fixed: const x = undefined
|
|
5
|
+
labels:
|
|
6
|
+
- source: void 0
|
|
7
|
+
style: primary
|
|
8
|
+
start: 10
|
|
9
|
+
end: 16
|
|
10
|
+
return void 0:
|
|
11
|
+
fixed: return undefined
|
|
12
|
+
labels:
|
|
13
|
+
- source: void 0
|
|
14
|
+
style: primary
|
|
15
|
+
start: 7
|
|
16
|
+
end: 13
|
|
17
|
+
void 0:
|
|
18
|
+
fixed: undefined
|
|
19
|
+
labels:
|
|
20
|
+
- source: void 0
|
|
21
|
+
style: primary
|
|
22
|
+
start: 0
|
|
23
|
+
end: 6
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
id: no-bare-object-param
|
|
2
|
+
valid:
|
|
3
|
+
- "function f(x: string) {}"
|
|
4
|
+
- "function f(x: Record<string, unknown>) {}"
|
|
5
|
+
- "function f(x: { a: string }) {}"
|
|
6
|
+
- "function f(x: Object) {}"
|
|
7
|
+
- "function f(x: object | null) {}"
|
|
8
|
+
- "function f(...rest: object[]) {}"
|
|
9
|
+
- "type H = (entry: Record<string, unknown>) => void;"
|
|
10
|
+
invalid:
|
|
11
|
+
- "function f(x: object) {}"
|
|
12
|
+
- "const g = (x: object) => {};"
|
|
13
|
+
- "class C { m(x: object) {} }"
|
|
14
|
+
- "interface I { m(x: object): void; }"
|
|
15
|
+
- "type H = (entry: object) => void;"
|
|
16
|
+
- "function f(x?: object) {}"
|
package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-chained-type-assertions-test.yml
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
id: no-chained-type-assertions
|
|
2
|
+
valid:
|
|
3
|
+
- 'const v = x as A'
|
|
4
|
+
- 'const w = x as A as const'
|
|
5
|
+
# 2026-08-20 (#1727/#1777): the `as unknown as` shape is delegated wholly to
|
|
6
|
+
# require-safety-comment-for-as-unknown-as.yml. This rule owns the concrete
|
|
7
|
+
# chain only, so BOTH the commented and the uncommented `unknown` forms are
|
|
8
|
+
# valid here. Deleting the `not: { pattern: $X as unknown as $B }` guard reds
|
|
9
|
+
# all three.
|
|
10
|
+
- |
|
|
11
|
+
// SAFETY: checked above
|
|
12
|
+
const u = x as unknown as Foo;
|
|
13
|
+
- 'const u = /* SAFETY: inline */ x as unknown as Foo;'
|
|
14
|
+
- 'const u = x as unknown as Foo;'
|
|
15
|
+
invalid:
|
|
16
|
+
- 'const v = x as A as B'
|
|
17
|
+
- 'const v = foo.bar() as A as B;'
|
|
18
|
+
# A concrete chain has no escape valve: a SAFETY comment does NOT excuse it.
|
|
19
|
+
# Re-adding a comment-based exemption to this rule reds this case.
|
|
20
|
+
- |
|
|
21
|
+
// SAFETY: I promise
|
|
22
|
+
const v = x as A as B;
|