@herbertgao/pi-extensions 2026.8.4 → 2026.8.6
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 +11 -3
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +11 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +24 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +91 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +7 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +74 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/index.ts +7 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +21 -12
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +4 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/markdown-enhance.ts +53 -14
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +22 -12
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/result.ts +2 -4
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +3 -3
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +18 -0
- package/node_modules/@herbertgao/pi-subagents/package.json +8 -4
- package/node_modules/@herbertgao/pi-subagents/src/agent-color.ts +72 -67
- package/node_modules/@herbertgao/pi-subagents/src/agent-file-toggle.ts +255 -0
- package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +191 -3
- package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +20 -4
- package/node_modules/@herbertgao/pi-subagents/src/index.ts +289 -113
- package/node_modules/@herbertgao/pi-subagents/src/output-file.ts +24 -1
- package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +24 -2
- package/node_modules/@herbertgao/pi-subagents/src/ui/fleet-list.ts +15 -6
- package/node_modules/@herbertgao/pi-subagents/src/ui/schedule-menu.ts +9 -8
- package/node_modules/@herbertgao/pi-subagents/src/ui/select-item.ts +48 -0
- package/node_modules/@herbertgao/pi-subagents/src/worktree.ts +9 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/README.md +2 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/ask-user-question.ts +20 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/hosts.md +6 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/keyboard.md +7 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +7 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +16 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +4 -2
- package/node_modules/@narumitw/pi-btw/README.md +32 -24
- package/node_modules/@narumitw/pi-btw/package.json +6 -6
- package/node_modules/@narumitw/pi-btw/src/btw.ts +4 -2
- package/node_modules/@narumitw/pi-btw/src/menu.ts +34 -13
- package/node_modules/@narumitw/pi-btw/src/settings.ts +22 -2
- package/node_modules/pi-lens/CHANGELOG.md +2535 -954
- package/node_modules/pi-lens/README.md +13 -0
- package/node_modules/pi-lens/dist/clients/actionable-warnings.js +73 -18
- package/node_modules/pi-lens/dist/clients/advisory-provenance.js +314 -0
- package/node_modules/pi-lens/dist/clients/agent-behavior-client.js +21 -4
- package/node_modules/pi-lens/dist/clients/agent-nudge.js +14 -7
- package/node_modules/pi-lens/dist/clients/ast-grep-client.js +68 -16
- package/node_modules/pi-lens/dist/clients/ast-grep-types.js +0 -1
- package/node_modules/pi-lens/dist/clients/ast-grep-yaml-synth.js +37 -10
- package/node_modules/pi-lens/dist/clients/atomic-write-staging.js +63 -0
- package/node_modules/pi-lens/dist/clients/atomic-write.js +114 -14
- package/node_modules/pi-lens/dist/clients/bash-file-access.js +193 -23
- package/node_modules/pi-lens/dist/clients/biome-client.js +136 -24
- package/node_modules/pi-lens/dist/clients/bootstrap.js +11 -2
- package/node_modules/pi-lens/dist/clients/bounded-cache.js +34 -0
- package/node_modules/pi-lens/dist/clients/bounded-pid-file-lock.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 +19 -4
- package/node_modules/pi-lens/dist/clients/cache/rule-cache.js +47 -5
- package/node_modules/pi-lens/dist/clients/cache-manager.js +97 -9
- package/node_modules/pi-lens/dist/clients/cache-observability.js +301 -14
- package/node_modules/pi-lens/dist/clients/call-graph.js +449 -117
- package/node_modules/pi-lens/dist/clients/cascade-format.js +57 -2
- package/node_modules/pi-lens/dist/clients/child-unref.js +85 -0
- package/node_modules/pi-lens/dist/clients/codebase-model.js +52 -23
- package/node_modules/pi-lens/dist/clients/collateral-test-role.js +40 -0
- package/node_modules/pi-lens/dist/clients/complexity-client.js +2 -1
- package/node_modules/pi-lens/dist/clients/console-guard-install.js +26 -0
- package/node_modules/pi-lens/dist/clients/cooperative-budget.js +42 -0
- package/node_modules/pi-lens/dist/clients/dead-code-client.js +137 -31
- package/node_modules/pi-lens/dist/clients/debug-handles.js +206 -0
- package/node_modules/pi-lens/dist/clients/debug-heap.js +167 -0
- package/node_modules/pi-lens/dist/clients/degradation-ledger.js +153 -0
- package/node_modules/pi-lens/dist/clients/dependency-checker.js +361 -77
- package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +65 -13
- package/node_modules/pi-lens/dist/clients/diagnostics-publish.js +18 -4
- package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +176 -29
- package/node_modules/pi-lens/dist/clients/dispatch/facts/function-facts.js +23 -7
- package/node_modules/pi-lens/dist/clients/dispatch/facts/import-facts.js +8 -18
- package/node_modules/pi-lens/dist/clients/dispatch/facts/tree-sitter-facts.js +8 -5
- package/node_modules/pi-lens/dist/clients/dispatch/indent-detect.js +35 -0
- package/node_modules/pi-lens/dist/clients/dispatch/inline-suppressions.js +17 -8
- package/node_modules/pi-lens/dist/clients/dispatch/integration.js +1172 -683
- package/node_modules/pi-lens/dist/clients/dispatch/lazy.js +14 -0
- package/node_modules/pi-lens/dist/clients/dispatch/plan.js +11 -1
- package/node_modules/pi-lens/dist/clients/dispatch/rule-id-normalize.js +50 -0
- package/node_modules/pi-lens/dist/clients/dispatch/rule-policy.js +135 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +23 -5
- package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +5 -9
- package/node_modules/pi-lens/dist/clients/dispatch/runners/detekt.js +3 -2
- package/node_modules/pi-lens/dist/clients/dispatch/runners/hadolint.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +154 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/htmlhint.js +3 -2
- package/node_modules/pi-lens/dist/clients/dispatch/runners/index.js +5 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +47 -6
- package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +4 -9
- package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +9 -5
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ruff.js +4 -8
- package/node_modules/pi-lens/dist/clients/dispatch/runners/shellcheck.js +2 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +2 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/spotbugs.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/taplo.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/terragrunt.js +163 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/tflint.js +37 -5
- package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +3 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/trivy-config.js +13 -7
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/availability-policy.js +226 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/candidate-probe.js +69 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/lazy-installer.js +3 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +473 -42
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/spawn-outcome.js +22 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/toolchain-availability.js +97 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/yaml-rule-parser.js +5 -4
- package/node_modules/pi-lens/dist/clients/disposition-publish.js +18 -4
- package/node_modules/pi-lens/dist/clients/durable-store.js +97 -0
- package/node_modules/pi-lens/dist/clients/eval-timestamp.js +17 -0
- package/node_modules/pi-lens/dist/clients/event-loop-monitor.js +94 -3
- package/node_modules/pi-lens/dist/clients/extension-log.js +432 -0
- package/node_modules/pi-lens/dist/clients/extension-mode.js +73 -0
- package/node_modules/pi-lens/dist/clients/file-kinds.js +57 -0
- package/node_modules/pi-lens/dist/clients/file-role.js +18 -3
- package/node_modules/pi-lens/dist/clients/file-utils.js +56 -34
- package/node_modules/pi-lens/dist/clients/fix-worklog.js +5 -1
- package/node_modules/pi-lens/dist/clients/format-events-publish.js +51 -7
- package/node_modules/pi-lens/dist/clients/format-service.js +24 -8
- package/node_modules/pi-lens/dist/clients/formatters-lazy.js +8 -0
- package/node_modules/pi-lens/dist/clients/formatters.js +358 -61
- package/node_modules/pi-lens/dist/clients/generated-artifacts.js +148 -15
- package/node_modules/pi-lens/dist/clients/git-guard.js +678 -11
- package/node_modules/pi-lens/dist/clients/git-tracked-ignore.js +4 -0
- package/node_modules/pi-lens/dist/clients/go-client.js +23 -40
- package/node_modules/pi-lens/dist/clients/govulncheck-client.js +124 -7
- package/node_modules/pi-lens/dist/clients/grammar-source.js +12 -4
- package/node_modules/pi-lens/dist/clients/gzip-stage-write.js +21 -3
- package/node_modules/pi-lens/dist/clients/host-ports.js +31 -0
- package/node_modules/pi-lens/dist/clients/installer/index.js +395 -100
- package/node_modules/pi-lens/dist/clients/instance-reaper.js +142 -172
- package/node_modules/pi-lens/dist/clients/jscpd-client.js +27 -55
- package/node_modules/pi-lens/dist/clients/knip-client.js +58 -42
- package/node_modules/pi-lens/dist/clients/language-policy.js +14 -2
- package/node_modules/pi-lens/dist/clients/language-profile.js +13 -7
- package/node_modules/pi-lens/dist/clients/latency-logger.js +72 -1
- package/node_modules/pi-lens/dist/clients/lens-config.js +12 -1
- package/node_modules/pi-lens/dist/clients/lens-engine.js +86 -17
- package/node_modules/pi-lens/dist/clients/lens-events.js +63 -9
- package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +16 -0
- package/node_modules/pi-lens/dist/clients/lens-map.js +94 -19
- package/node_modules/pi-lens/dist/clients/live-bus-emitter.js +73 -0
- package/node_modules/pi-lens/dist/clients/log-cleanup.js +2 -1
- package/node_modules/pi-lens/dist/clients/lsp/aggregation.js +30 -4
- package/node_modules/pi-lens/dist/clients/lsp/cascade-tier.js +59 -14
- package/node_modules/pi-lens/dist/clients/lsp/client.js +662 -56
- package/node_modules/pi-lens/dist/clients/lsp/config.js +13 -2
- package/node_modules/pi-lens/dist/clients/lsp/diagnostic-binding.js +115 -0
- package/node_modules/pi-lens/dist/clients/lsp/edits.js +1012 -121
- package/node_modules/pi-lens/dist/clients/lsp/index.js +2025 -800
- package/node_modules/pi-lens/dist/clients/lsp/launch.js +32 -26
- package/node_modules/pi-lens/dist/clients/lsp/path-utils.js +1 -1
- package/node_modules/pi-lens/dist/clients/lsp/ruby-drive-dirs.js +83 -0
- package/node_modules/pi-lens/dist/clients/lsp/server.js +437 -86
- package/node_modules/pi-lens/dist/clients/lsp/tsserver-sync.js +96 -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 +18 -3
- package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +28 -4
- package/node_modules/pi-lens/dist/clients/lsp-lazy.js +8 -0
- package/node_modules/pi-lens/dist/clients/lsp-mutation.js +248 -0
- package/node_modules/pi-lens/dist/clients/mcp/analyze.js +127 -32
- package/node_modules/pi-lens/dist/clients/mcp/ipc.js +157 -24
- package/node_modules/pi-lens/dist/clients/mcp/session.js +235 -14
- package/node_modules/pi-lens/dist/clients/memory-sampler.js +115 -0
- package/node_modules/pi-lens/dist/clients/metrics-client.js +2 -1
- package/node_modules/pi-lens/dist/clients/metrics-history.js +2 -1
- package/node_modules/pi-lens/dist/clients/model-provider.js +53 -0
- package/node_modules/pi-lens/dist/clients/module-report-lsp.js +5 -0
- package/node_modules/pi-lens/dist/clients/module-report.js +168 -3
- package/node_modules/pi-lens/dist/clients/ndjson-logger.js +319 -118
- package/node_modules/pi-lens/dist/clients/opengrep-client.js +1 -1
- package/node_modules/pi-lens/dist/clients/partial-edit-apply.js +120 -5
- package/node_modules/pi-lens/dist/clients/path-utils.js +110 -9
- package/node_modules/pi-lens/dist/clients/pipeline.js +76 -15
- package/node_modules/pi-lens/dist/clients/print-mode.js +21 -0
- package/node_modules/pi-lens/dist/clients/project-changes.js +40 -0
- package/node_modules/pi-lens/dist/clients/project-diagnostics/cache.js +3 -2
- package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +1 -1
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/call-graph-impact.js +8 -0
- 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/scanner.js +21 -1
- package/node_modules/pi-lens/dist/clients/project-lens-config.js +86 -9
- package/node_modules/pi-lens/dist/clients/project-report.js +27 -13
- package/node_modules/pi-lens/dist/clients/project-snapshot.js +175 -20
- package/node_modules/pi-lens/dist/clients/project-trust.js +181 -0
- package/node_modules/pi-lens/dist/clients/quiet-window.js +18 -4
- package/node_modules/pi-lens/dist/clients/read-bridge.js +147 -0
- package/node_modules/pi-lens/dist/clients/read-guard-logger.js +159 -1
- package/node_modules/pi-lens/dist/clients/read-guard-tool-lines.js +150 -29
- package/node_modules/pi-lens/dist/clients/read-guard.js +185 -4
- package/node_modules/pi-lens/dist/clients/resource-sampler.js +70 -84
- package/node_modules/pi-lens/dist/clients/review-graph/builder.js +1122 -221
- package/node_modules/pi-lens/dist/clients/review-graph/git-identity.js +2 -1
- package/node_modules/pi-lens/dist/clients/review-graph/import-resolvers.js +21 -10
- package/node_modules/pi-lens/dist/clients/review-graph/query.js +24 -0
- package/node_modules/pi-lens/dist/clients/review-graph/symbol-id.js +46 -0
- package/node_modules/pi-lens/dist/clients/review-graph/tsconfig-paths.js +57 -6
- package/node_modules/pi-lens/dist/clients/review-graph/workspace-modules.js +51 -3
- package/node_modules/pi-lens/dist/clients/review-graph-logger.js +30 -1
- package/node_modules/pi-lens/dist/clients/ruff-client.js +27 -44
- package/node_modules/pi-lens/dist/clients/run-duration.js +55 -0
- package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +257 -77
- package/node_modules/pi-lens/dist/clients/runtime-context.js +129 -12
- package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +242 -26
- package/node_modules/pi-lens/dist/clients/runtime-session.js +428 -117
- package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +71 -48
- package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +342 -33
- package/node_modules/pi-lens/dist/clients/runtime-turn.js +619 -93
- package/node_modules/pi-lens/dist/clients/rust-client.js +23 -38
- package/node_modules/pi-lens/dist/clients/safe-spawn.js +777 -62
- package/node_modules/pi-lens/dist/clients/security-scan-client.js +90 -6
- package/node_modules/pi-lens/dist/clients/session-state-store.js +3 -2
- package/node_modules/pi-lens/dist/clients/sg-runner.js +424 -196
- package/node_modules/pi-lens/dist/clients/slow-fs.js +2 -1
- package/node_modules/pi-lens/dist/clients/smells-rollup.js +231 -0
- package/node_modules/pi-lens/dist/clients/source-filter.js +184 -20
- package/node_modules/pi-lens/dist/clients/source-walker.js +66 -10
- package/node_modules/pi-lens/dist/clients/startup-scan.js +15 -16
- package/node_modules/pi-lens/dist/clients/startup-timing.js +7 -1
- package/node_modules/pi-lens/dist/clients/test-runner-client.js +469 -32
- package/node_modules/pi-lens/dist/clients/tool-event.js +35 -0
- package/node_modules/pi-lens/dist/clients/tool-policy.js +390 -39
- package/node_modules/pi-lens/dist/clients/tool-render.js +155 -0
- package/node_modules/pi-lens/dist/clients/tool-set-policy.js +76 -0
- package/node_modules/pi-lens/dist/clients/tree-sitter-cache.js +6 -1
- package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +419 -50
- package/node_modules/pi-lens/dist/clients/tree-sitter-logger.js +21 -0
- package/node_modules/pi-lens/dist/clients/tree-sitter-query-loader.js +7 -1
- package/node_modules/pi-lens/dist/clients/tree-sitter-shared.js +7 -2
- package/node_modules/pi-lens/dist/clients/tree-sitter-symbol-extractor.js +44 -7
- package/node_modules/pi-lens/dist/clients/user-notify.js +51 -0
- package/node_modules/pi-lens/dist/clients/vanished-instance-marker.js +57 -0
- package/node_modules/pi-lens/dist/clients/warm-attach.js +50 -13
- package/node_modules/pi-lens/dist/clients/widget-state.js +300 -43
- package/node_modules/pi-lens/dist/clients/word-index.js +680 -81
- package/node_modules/pi-lens/dist/clients/workspace-topology.js +89 -6
- package/node_modules/pi-lens/dist/index.js +51785 -36118
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +182 -29
- package/node_modules/pi-lens/dist/mcp/server.js +219 -46
- 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/ast-grep-search.js +93 -27
- package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +5 -2
- package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +203 -38
- package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +210 -42
- package/node_modules/pi-lens/dist/tools/lsp-navigation.js +46 -3
- package/node_modules/pi-lens/dist/tools/module-report.js +9 -0
- package/node_modules/pi-lens/dist/tools/symbol-search.js +1 -1
- package/node_modules/pi-lens/docs/agent-guide.md +40 -15
- package/node_modules/pi-lens/docs/agent-tools.md +21 -10
- package/node_modules/pi-lens/docs/analysisall.md +192 -0
- package/node_modules/pi-lens/docs/api-ports-inventory.md +165 -0
- package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +14 -3
- package/node_modules/pi-lens/docs/durable-store-audit-1202.md +32 -0
- package/node_modules/pi-lens/docs/environment-variables.md +44 -0
- package/node_modules/pi-lens/docs/fable.md +27 -0
- package/node_modules/pi-lens/docs/features.md +45 -3
- package/node_modules/pi-lens/docs/globalconfig.md +56 -1
- package/node_modules/pi-lens/docs/language-coverage.md +4 -3
- package/node_modules/pi-lens/docs/lsp-capability-matrix.md +2 -2
- package/node_modules/pi-lens/docs/mcp.md +37 -4
- package/node_modules/pi-lens/docs/servercapabilities.md +3 -3
- package/node_modules/pi-lens/docs/settings.md +18 -1
- package/node_modules/pi-lens/docs/tools.md +4 -1
- package/node_modules/pi-lens/docs/usage.md +41 -5
- package/node_modules/pi-lens/docs/word-index.md +35 -0
- package/node_modules/pi-lens/package.json +10 -10
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-bare-except-test.yml +49 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-bare-host-path-in-win32-branch-test.yml +87 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-chained-type-assertions-test.yml +8 -0
- 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-nested-links-test.yml +11 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-raw-json-store-write-test.yml +17 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-reflect-apply-js-test.yml +7 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-reflect-apply-test.yml +7 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-reflect-get-js-test.yml +8 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-reflect-get-test.yml +8 -0
- 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-win32-isabsolute-for-qualification-test.yml +16 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-bare-except.yml +3 -15
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-bare-host-path-in-win32-branch.yml +25 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-chained-type-assertions.yml +21 -0
- 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-nested-links.yml +7 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-raw-json-store-write.yml +30 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-reflect-apply-js.yml +9 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-reflect-apply.yml +9 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-reflect-get-js.yml +13 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-reflect-get.yml +16 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-unknown-laundering.yml +27 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-win32-isabsolute-for-qualification.yml +23 -0
- package/node_modules/pi-lens/rules/tree-sitter-queries/tsx/no-nested-links.yml +4 -6
- package/node_modules/pi-lens/rules/tree-sitter-queries/typescript/duplicate-function-arg.yml +2 -2
- package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +134 -2
- package/node_modules/pi-lens/skills/pi-lens-ast-grep/SKILL.md +10 -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 +8 -114
- package/node_modules/pi-lens/skills/pi-lens-write-ast-grep-rule/reference.md +129 -0
- package/node_modules/pi-lens/skills/pi-lens-write-tree-sitter-rule/SKILL.md +3 -1
- package/node_modules/pi-mcp-adapter/CHANGELOG.md +38 -0
- package/node_modules/pi-mcp-adapter/README.md +38 -4
- package/node_modules/pi-mcp-adapter/agent-dir.ts +12 -4
- package/node_modules/pi-mcp-adapter/agent-plugin-loader.ts +1 -1
- package/node_modules/pi-mcp-adapter/cli.js +25 -4
- package/node_modules/pi-mcp-adapter/commands.ts +15 -7
- package/node_modules/pi-mcp-adapter/config.ts +4 -4
- package/node_modules/pi-mcp-adapter/direct-tools.ts +58 -8
- package/node_modules/pi-mcp-adapter/host-html-template.ts +0 -8
- package/node_modules/pi-mcp-adapter/index.ts +8 -3
- package/node_modules/pi-mcp-adapter/init.ts +29 -5
- package/node_modules/pi-mcp-adapter/lifecycle.ts +0 -4
- package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +1 -2
- package/node_modules/pi-mcp-adapter/mcp-auth.ts +60 -2
- package/node_modules/pi-mcp-adapter/mcp-panel.ts +45 -9
- package/node_modules/pi-mcp-adapter/mcp-script-worker.mjs +22 -20
- package/node_modules/pi-mcp-adapter/mcp-setup-panel.ts +2 -1
- package/node_modules/pi-mcp-adapter/metadata-cache.ts +37 -4
- package/node_modules/pi-mcp-adapter/npx-resolver.ts +81 -26
- package/node_modules/pi-mcp-adapter/package.json +4 -3
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +108 -26
- package/node_modules/pi-mcp-adapter/request-headers-command.ts +336 -0
- package/node_modules/pi-mcp-adapter/search-ranking.ts +86 -7
- package/node_modules/pi-mcp-adapter/server-manager.ts +41 -7
- package/node_modules/pi-mcp-adapter/session-recovery.ts +8 -2
- package/node_modules/pi-mcp-adapter/tool-approval.ts +48 -7
- package/node_modules/pi-mcp-adapter/tool-metadata.ts +62 -4
- package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +138 -12
- package/node_modules/pi-mcp-adapter/types.ts +176 -27
- package/node_modules/pi-mcp-adapter/ui-server.ts +20 -1
- package/node_modules/pi-web-access/CHANGELOG.md +14 -0
- package/node_modules/pi-web-access/README.md +18 -12
- package/node_modules/pi-web-access/auth-fetch.ts +148 -0
- package/node_modules/pi-web-access/chrome-cookies.ts +110 -23
- package/node_modules/pi-web-access/curator-page.ts +5 -3
- package/node_modules/pi-web-access/curator-server.ts +2 -1
- package/node_modules/pi-web-access/extract.ts +106 -34
- 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 +18 -4
- package/node_modules/pi-web-access/index.ts +120 -48
- package/node_modules/pi-web-access/package.json +2 -2
- package/node_modules/pi-web-access/summary-review.ts +11 -5
- package/node_modules/pi-web-access/youtube-extract.ts +2 -2
- package/package.json +12 -13
- package/node_modules/pi-lens/dist/clients/ast-grep-parser.js +0 -86
- package/node_modules/pi-lens/dist/clients/lsp/interactive-install.js +0 -367
- package/node_modules/pi-lens/dist/clients/lsp/lsp-index.js +0 -10
- package/node_modules/pi-lens/dist/clients/lsp/server-strategies.js +0 -5
- package/node_modules/pi-lens/dist/clients/project-metadata.js +0 -690
- package/node_modules/pi-lens/dist/clients/source-groups.js +0 -96
- package/node_modules/pi-lens/dist/clients/startup-marker.js +0 -6
- package/node_modules/pi-lens/dist/clients/types.js +0 -11
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import * as fs from "node:fs";
|
|
10
10
|
import * as path from "node:path";
|
|
11
|
+
import { isWindowsPath } from "./path-utils.js";
|
|
12
|
+
import { BoundedLruCache } from "./bounded-cache.js";
|
|
11
13
|
const DEFAULT_HEADER_BYTES = 4096;
|
|
12
14
|
const GENERATED_DIR_NAMES = new Set([
|
|
13
15
|
"generated",
|
|
@@ -16,6 +18,7 @@ const GENERATED_DIR_NAMES = new Set([
|
|
|
16
18
|
"__codegen__",
|
|
17
19
|
"generated-sources",
|
|
18
20
|
"generated_sources",
|
|
21
|
+
"dist",
|
|
19
22
|
"openapi-generated",
|
|
20
23
|
".openapi-generator",
|
|
21
24
|
]);
|
|
@@ -60,6 +63,30 @@ const GENERATED_FILE_PATTERNS = [
|
|
|
60
63
|
/\.sql\.(go|ts|js)$/i,
|
|
61
64
|
/_sqlc\.go$/i,
|
|
62
65
|
/\.g\.([jt]sx?|mjs|cjs|rs|go)$/i,
|
|
66
|
+
];
|
|
67
|
+
// #1107 phase 2 review (P2, maintainer decision): minified/bundle/chunk
|
|
68
|
+
// output is intentionally NOT eligible for the content-probe escape hatch
|
|
69
|
+
// below and lives in the STRONG tier instead, alongside lockfiles — the
|
|
70
|
+
// escape hatch's premises fail structurally for this class:
|
|
71
|
+
// - Hand-written-with-this-name probability is ~0 (nobody names a source
|
|
72
|
+
// file `app.min.js`/`vendor.bundle.js` by hand).
|
|
73
|
+
// - The header-probe leg is dead for it: minifiers strip comments/banners
|
|
74
|
+
// by design, so a real minified bundle essentially never carries a
|
|
75
|
+
// `GENERATED_HEADER_PATTERNS` match — the probe can never confirm it, so
|
|
76
|
+
// under the WEAK-tier escape hatch this class would ALWAYS be "kept" via
|
|
77
|
+
// the no-evidence branch, not "kept sometimes." That inverts the
|
|
78
|
+
// heuristic from "usually right, occasionally rescued" to "never right."
|
|
79
|
+
// - The sibling-probe leg is also dead for it: `findSourceSibling` looks
|
|
80
|
+
// for a `.ts`/`.tsx`/etc. twin at the SAME stem (`app.min.ts` next to
|
|
81
|
+
// `app.min.js`), which is never how minified bundles are produced — the
|
|
82
|
+
// real source twin is `app.ts`/`app.js` at a DIFFERENT stem, which the
|
|
83
|
+
// sibling probe does not check. So the "does a hand-written source twin
|
|
84
|
+
// exist" question this class actually needs answered is structurally
|
|
85
|
+
// unreachable, not merely unresolved.
|
|
86
|
+
// Both dead legs mean this class would be a permanent override — never
|
|
87
|
+
// re-confirmed by either evidence check — so it is excluded from the WEAK
|
|
88
|
+
// tier entirely and always skipped, like a lockfile.
|
|
89
|
+
const MINIFIED_BUNDLE_FILE_PATTERNS = [
|
|
63
90
|
/\.min\.(js|mjs|cjs|css)$/i,
|
|
64
91
|
/\.(bundle|chunk)\.(js|mjs|cjs|css)$/i,
|
|
65
92
|
];
|
|
@@ -70,22 +97,70 @@ function pathSegments(filePath) {
|
|
|
70
97
|
.split(/[\\/]+/)
|
|
71
98
|
.filter(Boolean);
|
|
72
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Shape-aware basename: a WINDOWS-SHAPED path (drive letter or UNC prefix,
|
|
102
|
+
* per `isWindowsPath`) is parsed with `path.win32.basename` regardless of the
|
|
103
|
+
* running OS, mirroring the `detectFileRole` fix in `file-role.ts` (refs
|
|
104
|
+
* #1152, #1150, #1161 — defect shape 2: a host-default `path` fn inside a
|
|
105
|
+
* shape-committed branch follows the *host* OS, so on Linux CI a `C:\...`
|
|
106
|
+
* path has no POSIX separator and the module-default `basename` returns the
|
|
107
|
+
* whole string unchanged, missing exact-name lookups like `LOCKFILE_NAMES`).
|
|
108
|
+
* Native same-OS paths (POSIX on Linux, win32 on Windows) are unaffected —
|
|
109
|
+
* on win32 this is a no-op since `win32.basename` already equals the module
|
|
110
|
+
* default there.
|
|
111
|
+
*/
|
|
112
|
+
function basenameForShape(filePath) {
|
|
113
|
+
return isWindowsPath(filePath)
|
|
114
|
+
? path.win32.basename(filePath)
|
|
115
|
+
: path.basename(filePath);
|
|
116
|
+
}
|
|
73
117
|
export function isGeneratedArtifactDirectoryName(dirName) {
|
|
74
118
|
return GENERATED_DIR_NAMES.has(dirName.trim().toLowerCase());
|
|
75
119
|
}
|
|
76
120
|
export function isDeclarationFile(filePath) {
|
|
77
|
-
const base =
|
|
121
|
+
const base = basenameForShape(filePath).toLowerCase();
|
|
78
122
|
return DECLARATION_FILE_PATTERNS.some((pattern) => pattern.test(base));
|
|
79
123
|
}
|
|
80
|
-
|
|
124
|
+
/**
|
|
125
|
+
* STRONG evidence a path is generated/artifact output: it lives under a
|
|
126
|
+
* directory segment that itself looks generated (`generated/`, `codegen/`,
|
|
127
|
+
* …), its basename is a known package-manager lockfile, or it matches a
|
|
128
|
+
* minified/bundle/chunk output pattern (see
|
|
129
|
+
* {@link MINIFIED_BUNDLE_FILE_PATTERNS}'s doc for why that class is STRONG,
|
|
130
|
+
* not WEAK). All three are treated as conclusive — no content-probe escape
|
|
131
|
+
* hatch (#1107 phase 2) applies to any of them. A lockfile is never
|
|
132
|
+
* hand-written; a generated-dir SEGMENT match here only fires for callers
|
|
133
|
+
* that check a single path without having walked (directory-level pruning
|
|
134
|
+
* already removes the walk-time case in `shouldRecurseIntoDir`, so this
|
|
135
|
+
* branch is effectively a belt-and-braces check for non-walk callers like
|
|
136
|
+
* `file-role.ts` and `project-scan-policy.ts`).
|
|
137
|
+
*/
|
|
138
|
+
function hasStrongGeneratedArtifactPath(filePath) {
|
|
81
139
|
const segments = pathSegments(filePath);
|
|
82
140
|
const dirSegments = segments.slice(0, -1);
|
|
83
141
|
if (dirSegments.some((segment) => isGeneratedArtifactDirectoryName(segment))) {
|
|
84
142
|
return true;
|
|
85
143
|
}
|
|
86
|
-
const base =
|
|
144
|
+
const base = basenameForShape(filePath);
|
|
87
145
|
if (LOCKFILE_NAMES.has(base.toLowerCase()))
|
|
88
146
|
return true;
|
|
147
|
+
return MINIFIED_BUNDLE_FILE_PATTERNS.some((pattern) => pattern.test(base));
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* WEAK evidence: the basename alone matches a generated-file NAME pattern
|
|
151
|
+
* (e.g. `gen.ts`, `foo_generated.go`, `user.pb.go`). Unlike the strong path
|
|
152
|
+
* check above, a name-only match is not conclusive — a hand-written file can
|
|
153
|
+
* innocently contain "gen" in its name. #1107 phase 2's content-probe escape
|
|
154
|
+
* hatch (see `classifyGeneratedOrArtifactDetailed`) requires corroborating
|
|
155
|
+
* evidence (a source sibling, checked upstream by walk-driven callers, or a
|
|
156
|
+
* generated-code header) before treating a WEAK-only match as an artifact.
|
|
157
|
+
* Minified/bundle/chunk output (`bar.min.js`, `vendor.bundle.js`) is
|
|
158
|
+
* deliberately NOT in this WEAK set — see
|
|
159
|
+
* {@link MINIFIED_BUNDLE_FILE_PATTERNS}'s doc for why that class is STRONG
|
|
160
|
+
* instead (the escape hatch's evidence checks are structurally dead for it).
|
|
161
|
+
*/
|
|
162
|
+
function hasWeakGeneratedFileNamePattern(filePath) {
|
|
163
|
+
const base = basenameForShape(filePath);
|
|
89
164
|
return GENERATED_FILE_PATTERNS.some((pattern) => pattern.test(base));
|
|
90
165
|
}
|
|
91
166
|
function hasGeneratedArtifactContent(content) {
|
|
@@ -100,7 +175,7 @@ function hasGeneratedArtifactContent(content) {
|
|
|
100
175
|
// an edited file misses the cache and is re-read. A single stat replaces the
|
|
101
176
|
// open/read/close on a hit. Bounded to avoid unbounded growth on giant repos.
|
|
102
177
|
const HEADER_VERDICT_MEMO_CAP = 50_000;
|
|
103
|
-
const headerVerdictMemo = new
|
|
178
|
+
const headerVerdictMemo = new BoundedLruCache(HEADER_VERDICT_MEMO_CAP);
|
|
104
179
|
/** Test-only: drop the header-verdict memo so fixtures don't leak across cases. */
|
|
105
180
|
export function _resetGeneratedArtifactCaches() {
|
|
106
181
|
headerVerdictMemo.clear();
|
|
@@ -146,22 +221,80 @@ function fileHeaderLooksGenerated(filePath, maxBytes) {
|
|
|
146
221
|
return cached;
|
|
147
222
|
const header = readFileHeader(filePath, maxBytes);
|
|
148
223
|
const verdict = header !== undefined && hasGeneratedArtifactContent(header);
|
|
149
|
-
if (headerVerdictMemo.size >= HEADER_VERDICT_MEMO_CAP) {
|
|
150
|
-
headerVerdictMemo.clear();
|
|
151
|
-
}
|
|
152
224
|
headerVerdictMemo.set(key, verdict);
|
|
153
225
|
return verdict;
|
|
154
226
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
227
|
+
/**
|
|
228
|
+
* The full verdict (+ evidence tier) behind {@link isGeneratedOrArtifact}'s
|
|
229
|
+
* boolean, exposing the #1107 phase 2 content-probe escape hatch: a WEAK
|
|
230
|
+
* name-only match (see {@link hasWeakGeneratedFileNamePattern}) is no longer
|
|
231
|
+
* skipped on the name alone — it additionally requires a generated-code
|
|
232
|
+
* header in the first few KB (`hasGeneratedArtifactContent`/
|
|
233
|
+
* `fileHeaderLooksGenerated`) before being treated as an artifact. Evidence
|
|
234
|
+
* check order is cheapest-first: STRONG path (dir segment/lockfile/minified-
|
|
235
|
+
* bundle, no filesystem probe) → declaration opt-in → content/header probe,
|
|
236
|
+
* so the (often already-open) file read only happens for the WEAK-match case
|
|
237
|
+
* that actually needs it.
|
|
238
|
+
*
|
|
239
|
+
* Evidence class (a) from the issue — "does a higher-precedence hand-written
|
|
240
|
+
* source SIBLING exist?" — is deliberately NOT re-implemented here: it is
|
|
241
|
+
* `source-filter.ts`'s `findSourceSibling`/`isBuildArtifact` (this module has
|
|
242
|
+
* no filesystem-sibling-probe cache, and `source-filter.ts` already imports
|
|
243
|
+
* this module, so adding a reverse import would be circular). Both call
|
|
244
|
+
* sites that matter (`classifyEntry`, `filterSourceFiles` in
|
|
245
|
+
* `source-filter.ts`) already probe for a sibling BEFORE reaching this
|
|
246
|
+
* function and short-circuit on a hit, so by the time this function runs for
|
|
247
|
+
* those callers evidence (a) has already come back negative. Non-walk
|
|
248
|
+
* callers with no upstream sibling probe (`file-role.ts`'s content-based
|
|
249
|
+
* check, `project-scan-policy.ts`'s single-path `shouldSkipProjectPath`)
|
|
250
|
+
* evaluate evidence (b) only — a documented, narrower guarantee than the
|
|
251
|
+
* walk path's.
|
|
252
|
+
*
|
|
253
|
+
* Tradeoff (documented per the issue): when NEITHER piece of evidence
|
|
254
|
+
* confirms a WEAK name match, the file is KEPT. This can rescue a real
|
|
255
|
+
* headerless generated file with no source twin into a walk/graph/index that
|
|
256
|
+
* previously silently dropped it — accepted per #1107: a false-KEEP (an
|
|
257
|
+
* agent sees one extra file it must itself judge) is strictly less harmful
|
|
258
|
+
* than a silent false-DROP (a real file invisibly never analyzed at all).
|
|
259
|
+
* This tradeoff deliberately does NOT extend to minified/bundle/chunk output
|
|
260
|
+
* — see {@link MINIFIED_BUNDLE_FILE_PATTERNS}'s doc for why that class is
|
|
261
|
+
* STRONG (always skipped, no escape hatch) rather than WEAK.
|
|
262
|
+
*/
|
|
263
|
+
export function classifyGeneratedOrArtifactDetailed(filePath, options = {}) {
|
|
264
|
+
if (hasStrongGeneratedArtifactPath(filePath)) {
|
|
265
|
+
return { verdict: "generated", evidence: "strong" };
|
|
266
|
+
}
|
|
267
|
+
if (options.includeDeclarations && isDeclarationFile(filePath)) {
|
|
268
|
+
return { verdict: "generated", evidence: "strong" };
|
|
269
|
+
}
|
|
270
|
+
const weakNameMatch = hasWeakGeneratedFileNamePattern(filePath);
|
|
160
271
|
if (options.content !== undefined) {
|
|
161
|
-
|
|
272
|
+
if (hasGeneratedArtifactContent(options.content)) {
|
|
273
|
+
return { verdict: "generated", evidence: "content" };
|
|
274
|
+
}
|
|
275
|
+
return { verdict: weakNameMatch ? "override" : "clean" };
|
|
162
276
|
}
|
|
163
277
|
if (options.readContentHeader) {
|
|
164
|
-
|
|
278
|
+
if (fileHeaderLooksGenerated(filePath, options.maxHeaderBytes ?? DEFAULT_HEADER_BYTES)) {
|
|
279
|
+
return { verdict: "generated", evidence: "content" };
|
|
280
|
+
}
|
|
281
|
+
return { verdict: weakNameMatch ? "override" : "clean" };
|
|
165
282
|
}
|
|
166
|
-
|
|
283
|
+
// No content/header probe was supplied or enabled: there is no cheap way
|
|
284
|
+
// to evaluate evidence (b) here, so a WEAK name match falls back to the
|
|
285
|
+
// pre-#1107-phase-2 behavior (trust the name, skip it) rather than
|
|
286
|
+
// silently activating the escape hatch for callers that opted out of the
|
|
287
|
+
// probe for performance. The escape hatch only activates when a header
|
|
288
|
+
// probe actually ran and did not confirm. Evidence "name-only" — the one
|
|
289
|
+
// residual at-risk bucket, see {@link GeneratedArtifactEvidence}.
|
|
290
|
+
return weakNameMatch
|
|
291
|
+
? { verdict: "generated", evidence: "name-only" }
|
|
292
|
+
: { verdict: "clean" };
|
|
293
|
+
}
|
|
294
|
+
/** Verdict-only convenience wrapper over {@link classifyGeneratedOrArtifactDetailed}. */
|
|
295
|
+
export function classifyGeneratedOrArtifact(filePath, options = {}) {
|
|
296
|
+
return classifyGeneratedOrArtifactDetailed(filePath, options).verdict;
|
|
297
|
+
}
|
|
298
|
+
export function isGeneratedOrArtifact(filePath, options = {}) {
|
|
299
|
+
return classifyGeneratedOrArtifact(filePath, options) === "generated";
|
|
167
300
|
}
|