@herbertgao/pi-extensions 2026.9.0 → 2026.9.1
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/node_modules/@czottmann/pi-automode/CHANGELOG.md +13 -1
- package/node_modules/@czottmann/pi-automode/README.md +20 -0
- package/node_modules/@czottmann/pi-automode/docs/GLOSSARY.md +1 -1
- package/node_modules/@czottmann/pi-automode/docs/automode-classifier-flow.md +2 -1
- package/node_modules/@czottmann/pi-automode/docs/defaults.md +3 -2
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/classifier.ts +38 -2
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/constants.ts +5 -3
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/extension.ts +11 -3
- package/node_modules/@czottmann/pi-automode/package.json +1 -1
- package/node_modules/@pi-plugins/fast-mode/README.md +5 -3
- package/node_modules/@pi-plugins/fast-mode/dist/index.d.mts.map +1 -1
- package/node_modules/@pi-plugins/fast-mode/dist/index.mjs +20 -55
- package/node_modules/@pi-plugins/fast-mode/dist/index.mjs.map +1 -1
- package/node_modules/@pi-plugins/fast-mode/package.json +1 -1
- package/node_modules/pi-lens/CHANGELOG.md +988 -0
- package/node_modules/pi-lens/README.md +3 -0
- package/node_modules/pi-lens/config/biome/core.jsonc +11 -2
- package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +13 -1
- package/node_modules/pi-lens/dist/clients/actionable-warnings-logger.js +2 -2
- package/node_modules/pi-lens/dist/clients/actionable-warnings.js +927 -80
- package/node_modules/pi-lens/dist/clients/agent-behavior-client.js +13 -4
- package/node_modules/pi-lens/dist/clients/ast-grep-client.js +123 -3
- package/node_modules/pi-lens/dist/clients/ast-grep-rule-manager.js +60 -5
- package/node_modules/pi-lens/dist/clients/ast-grep-tool-logger.js +2 -2
- package/node_modules/pi-lens/dist/clients/bash-file-access.js +1 -3
- package/node_modules/pi-lens/dist/clients/biome-client.js +9 -2
- package/node_modules/pi-lens/dist/clients/blocker-freshness.js +14 -0
- package/node_modules/pi-lens/dist/clients/bootstrap.js +509 -73
- package/node_modules/pi-lens/dist/clients/bounded-cache.js +152 -12
- package/node_modules/pi-lens/dist/clients/bounded-telemetry.js +59 -4
- package/node_modules/pi-lens/dist/clients/bundled-resource-health.js +113 -0
- package/node_modules/pi-lens/dist/clients/bus-events-logger.js +2 -2
- package/node_modules/pi-lens/dist/clients/cache/rule-cache.js +31 -4
- package/node_modules/pi-lens/dist/clients/cache-manager.js +105 -6
- package/node_modules/pi-lens/dist/clients/cache-observability.js +44 -18
- package/node_modules/pi-lens/dist/clients/cargo-manifest.js +422 -0
- package/node_modules/pi-lens/dist/clients/cascade-logger.js +2 -2
- package/node_modules/pi-lens/dist/clients/code-quality-warnings.js +13 -3
- package/node_modules/pi-lens/dist/clients/complexity-client.js +16 -5
- package/node_modules/pi-lens/dist/clients/config-core/deny.js +221 -0
- package/node_modules/pi-lens/dist/clients/config-core/index.js +47 -0
- package/node_modules/pi-lens/dist/clients/config-core/merge.js +357 -0
- package/node_modules/pi-lens/dist/clients/config-core/normalize.js +340 -0
- package/node_modules/pi-lens/dist/clients/config-core/process-spec.js +248 -0
- package/node_modules/pi-lens/dist/clients/config-core/provenance.js +171 -0
- package/node_modules/pi-lens/dist/clients/config-core/records.js +218 -0
- package/node_modules/pi-lens/dist/clients/config-core/resolve.js +125 -0
- package/node_modules/pi-lens/dist/clients/config-core/safe-object.js +78 -0
- package/node_modules/pi-lens/dist/clients/config-core/schema.js +167 -0
- package/node_modules/pi-lens/dist/clients/config-diagnostic-codes.js +281 -0
- package/node_modules/pi-lens/dist/clients/config-locations.js +160 -0
- package/node_modules/pi-lens/dist/clients/config-resolve.js +789 -0
- package/node_modules/pi-lens/dist/clients/config-schema.js +197 -0
- package/node_modules/pi-lens/dist/clients/config-warn.js +407 -0
- package/node_modules/pi-lens/dist/clients/dead-code-client.js +19 -14
- package/node_modules/pi-lens/dist/clients/dead-code-logger.js +2 -2
- package/node_modules/pi-lens/dist/clients/deadline-utils.js +178 -0
- package/node_modules/pi-lens/dist/clients/debug-handles.js +2 -2
- package/node_modules/pi-lens/dist/clients/debug-heap.js +3 -3
- package/node_modules/pi-lens/dist/clients/deferred-lsp-work.js +106 -0
- package/node_modules/pi-lens/dist/clients/degradation-ledger.js +113 -7
- package/node_modules/pi-lens/dist/clients/dependency-checker.js +8 -19
- package/node_modules/pi-lens/dist/clients/diagnostic-line-freshness.js +12 -9
- package/node_modules/pi-lens/dist/clients/diagnostic-logger.js +14 -4
- package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +162 -18
- package/node_modules/pi-lens/dist/clients/dispatch/fact-store.js +97 -0
- package/node_modules/pi-lens/dist/clients/dispatch/integration.js +9 -7
- package/node_modules/pi-lens/dist/clients/dispatch/runners/actionlint.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +380 -26
- package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/cpp-check.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/credo.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/cue-vet.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/dart-analyze.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/detekt.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/dotnet-build.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/elixir-check.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/eslint.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/fact-rules.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/fish-indent.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/gleam-check.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/go-vet.js +1 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/golangci-lint.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/hadolint.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-render.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/htmlhint.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/javac.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ktlint.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/mypy.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/oxlint.js +13 -18
- package/node_modules/pi-lens/dist/clients/dispatch/runners/php-lint.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/phpstan.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/prisma-validate.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +7 -4
- package/node_modules/pi-lens/dist/clients/dispatch/runners/rubocop.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ruff.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +1 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/shellcheck.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/spellcheck.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/spotbugs.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/sqlfluff.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/stylelint.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/swiftlint.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/taplo.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/terragrunt.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/tflint.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/trivy-config.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/availability-policy.js +3 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/diagnostic-parsers.js +3 -4
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +194 -80
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/toolchain-availability.js +84 -15
- package/node_modules/pi-lens/dist/clients/dispatch/runners/vale.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/yamllint.js +0 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/zig-check.js +0 -1
- package/node_modules/pi-lens/dist/clients/disposition-logger.js +3 -3
- package/node_modules/pi-lens/dist/clients/effective-config.js +403 -0
- package/node_modules/pi-lens/dist/clients/error-class.js +23 -0
- package/node_modules/pi-lens/dist/clients/event-loop-hold.js +274 -0
- package/node_modules/pi-lens/dist/clients/extension-log.js +2 -2
- package/node_modules/pi-lens/dist/clients/feature-hints.js +2 -1
- package/node_modules/pi-lens/dist/clients/file-time.js +6 -1
- package/node_modules/pi-lens/dist/clients/file-utils.js +112 -9
- package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +50 -13
- package/node_modules/pi-lens/dist/clients/format-service.js +6 -1
- package/node_modules/pi-lens/dist/clients/formatters.js +276 -102
- package/node_modules/pi-lens/dist/clients/freshness-cadence.js +17 -0
- package/node_modules/pi-lens/dist/clients/generated-artifacts.js +114 -19
- package/node_modules/pi-lens/dist/clients/generation-guard.js +4 -9
- package/node_modules/pi-lens/dist/clients/git-guard.js +1 -1
- package/node_modules/pi-lens/dist/clients/go-client.js +39 -0
- package/node_modules/pi-lens/dist/clients/gradle-ktfmt-style.js +252 -0
- package/node_modules/pi-lens/dist/clients/hashline-anchor.js +424 -0
- package/node_modules/pi-lens/dist/clients/hook-budgets.js +76 -0
- package/node_modules/pi-lens/dist/clients/host-edit-normalize.js +5 -2
- package/node_modules/pi-lens/dist/clients/host-ports.js +1 -1
- package/node_modules/pi-lens/dist/clients/installer/index.js +71 -52
- package/node_modules/pi-lens/dist/clients/instance-reaper.js +104 -230
- package/node_modules/pi-lens/dist/clients/instance-registry.js +6 -3
- package/node_modules/pi-lens/dist/clients/language-registry.js +595 -0
- package/node_modules/pi-lens/dist/clients/latency-logger.js +160 -2
- package/node_modules/pi-lens/dist/clients/ledger-bounds.js +13 -0
- package/node_modules/pi-lens/dist/clients/lens-config.js +141 -30
- package/node_modules/pi-lens/dist/clients/lens-engine.js +30 -37
- package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +59 -6
- package/node_modules/pi-lens/dist/clients/log-cleanup.js +2 -2
- package/node_modules/pi-lens/dist/clients/lsp/aggregation.js +3 -1
- package/node_modules/pi-lens/dist/clients/lsp/client.js +168 -30
- package/node_modules/pi-lens/dist/clients/lsp/config.js +483 -158
- package/node_modules/pi-lens/dist/clients/lsp/diagnostic-binding.js +1 -1
- package/node_modules/pi-lens/dist/clients/lsp/edits.js +15 -2
- package/node_modules/pi-lens/dist/clients/lsp/index.js +676 -71
- package/node_modules/pi-lens/dist/clients/lsp/language.js +18 -169
- package/node_modules/pi-lens/dist/clients/lsp/launch.js +2 -1
- package/node_modules/pi-lens/dist/clients/lsp/pending-aux-coverage.js +5 -16
- package/node_modules/pi-lens/dist/clients/lsp/server.js +284 -147
- package/node_modules/pi-lens/dist/clients/lsp/session-roots.js +116 -23
- package/node_modules/pi-lens/dist/clients/lsp/spawn-history.js +2 -7
- package/node_modules/pi-lens/dist/clients/lsp/tsserver-sync.js +9 -2
- package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +1 -1
- package/node_modules/pi-lens/dist/clients/lsp-mutation.js +163 -21
- package/node_modules/pi-lens/dist/clients/map-with-concurrency.js +36 -0
- package/node_modules/pi-lens/dist/clients/mcp/analyze.js +33 -4
- package/node_modules/pi-lens/dist/clients/mcp/session.js +5 -16
- package/node_modules/pi-lens/dist/clients/memory-sampler.js +8 -3
- package/node_modules/pi-lens/dist/clients/middle-man-analysis.js +2 -4
- package/node_modules/pi-lens/dist/clients/module-report.js +20 -45
- package/node_modules/pi-lens/dist/clients/mutating-tool.js +651 -0
- package/node_modules/pi-lens/dist/clients/mutation-attribution.js +368 -0
- package/node_modules/pi-lens/dist/clients/mutation-bridge.js +240 -0
- package/node_modules/pi-lens/dist/clients/ndjson-logger.js +247 -20
- package/node_modules/pi-lens/dist/clients/observed-mutation-sources.js +101 -0
- package/node_modules/pi-lens/dist/clients/observed-mutation.js +1215 -0
- package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +68 -22
- package/node_modules/pi-lens/dist/clients/opengrep-config.js +4 -0
- package/node_modules/pi-lens/dist/clients/package-manager.js +195 -26
- package/node_modules/pi-lens/dist/clients/partial-edit-apply.js +359 -80
- package/node_modules/pi-lens/dist/clients/path-attribution-telemetry.js +23 -7
- package/node_modules/pi-lens/dist/clients/path-keyed-map.js +21 -2
- package/node_modules/pi-lens/dist/clients/path-utils.js +428 -13
- package/node_modules/pi-lens/dist/clients/persist-debounce.js +8 -1
- package/node_modules/pi-lens/dist/clients/php-cs-fixer-config.js +114 -0
- package/node_modules/pi-lens/dist/clients/pipeline.js +77 -16
- package/node_modules/pi-lens/dist/clients/probe-home-state.js +228 -0
- package/node_modules/pi-lens/dist/clients/process-bridge.js +66 -0
- package/node_modules/pi-lens/dist/clients/process-snapshot.js +68 -0
- package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +4 -3
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +27 -3
- package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +51 -20
- package/node_modules/pi-lens/dist/clients/project-lens-config.js +393 -122
- package/node_modules/pi-lens/dist/clients/project-snapshot.js +52 -24
- package/node_modules/pi-lens/dist/clients/python-environment.js +217 -0
- package/node_modules/pi-lens/dist/clients/python-provenance.js +639 -0
- package/node_modules/pi-lens/dist/clients/quiet-window.js +6 -1
- package/node_modules/pi-lens/dist/clients/read-bridge.js +13 -21
- package/node_modules/pi-lens/dist/clients/read-expansion.js +9 -46
- package/node_modules/pi-lens/dist/clients/read-guard-logger.js +15 -4
- package/node_modules/pi-lens/dist/clients/read-guard-tool-lines.js +364 -212
- package/node_modules/pi-lens/dist/clients/read-guard.js +21 -0
- package/node_modules/pi-lens/dist/clients/resource-sampler.js +195 -96
- package/node_modules/pi-lens/dist/clients/review-graph/builder.js +152 -109
- package/node_modules/pi-lens/dist/clients/review-graph/service.js +55 -3
- package/node_modules/pi-lens/dist/clients/review-graph/shared-extraction-ir.js +7 -15
- package/node_modules/pi-lens/dist/clients/review-graph/workspace-modules.js +10 -74
- package/node_modules/pi-lens/dist/clients/review-graph-logger.js +9 -3
- package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +18 -2
- package/node_modules/pi-lens/dist/clients/runtime-context.js +49 -16
- package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +25 -6
- package/node_modules/pi-lens/dist/clients/runtime-session.js +139 -22
- package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +168 -35
- package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +797 -243
- package/node_modules/pi-lens/dist/clients/runtime-turn.js +1028 -53
- package/node_modules/pi-lens/dist/clients/rust-client.js +31 -0
- package/node_modules/pi-lens/dist/clients/safe-spawn.js +33 -10
- package/node_modules/pi-lens/dist/clients/sanitize.js +7 -1
- package/node_modules/pi-lens/dist/clients/scratch-tree-policy.js +1 -3
- package/node_modules/pi-lens/dist/clients/security-scan-client.js +3 -0
- package/node_modules/pi-lens/dist/clients/session-lifecycle.js +1 -1
- package/node_modules/pi-lens/dist/clients/session-start-observability.js +79 -0
- package/node_modules/pi-lens/dist/clients/sessionstart-logger.js +12 -3
- package/node_modules/pi-lens/dist/clients/sgconfig.js +6 -1
- package/node_modules/pi-lens/dist/clients/skills-resolver.js +105 -0
- package/node_modules/pi-lens/dist/clients/smells-rollup.js +2 -2
- package/node_modules/pi-lens/dist/clients/string-utils.js +13 -0
- package/node_modules/pi-lens/dist/clients/subagent-mode.js +17 -4
- package/node_modules/pi-lens/dist/clients/test-runner-client.js +176 -39
- package/node_modules/pi-lens/dist/clients/test-runner-delivery.js +239 -0
- package/node_modules/pi-lens/dist/clients/tool-definition.js +41 -1
- package/node_modules/pi-lens/dist/clients/tool-policy.js +91 -21
- package/node_modules/pi-lens/dist/clients/tree-sitter-cache.js +40 -40
- package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +86 -48
- package/node_modules/pi-lens/dist/clients/tree-sitter-logger.js +2 -2
- package/node_modules/pi-lens/dist/clients/tree-sitter-query-loader.js +81 -1
- package/node_modules/pi-lens/dist/clients/tree-sitter-shared.js +51 -46
- package/node_modules/pi-lens/dist/clients/tree-sitter-symbol-extractor.js +28 -0
- package/node_modules/pi-lens/dist/clients/typos-config.js +5 -0
- package/node_modules/pi-lens/dist/clients/user-notify.js +6 -2
- package/node_modules/pi-lens/dist/clients/widget-state.js +191 -26
- package/node_modules/pi-lens/dist/clients/word-index-logger.js +2 -2
- package/node_modules/pi-lens/dist/clients/word-index-store.js +20 -5
- package/node_modules/pi-lens/dist/clients/word-index.js +243 -31
- package/node_modules/pi-lens/dist/clients/workspace-topology.js +8 -1
- package/node_modules/pi-lens/dist/clients/zizmor-config.js +3 -0
- package/node_modules/pi-lens/dist/index.js +64335 -54300
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +3 -1
- package/node_modules/pi-lens/dist/mcp/server.js +127 -5
- package/node_modules/pi-lens/dist/scripts/lib/process-scan.mjs +583 -0
- package/node_modules/pi-lens/dist/scripts/lib/skills-predicate.mjs +129 -0
- package/node_modules/pi-lens/dist/tools/effective-config.js +89 -0
- package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +95 -24
- package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +67 -80
- package/node_modules/pi-lens/dist/tools/lsp-navigation.js +37 -16
- package/node_modules/pi-lens/dist/tools/shared.js +0 -1
- package/node_modules/pi-lens/docs/agent-guide.md +64 -1
- package/node_modules/pi-lens/docs/configuration.md +222 -0
- package/node_modules/pi-lens/docs/dependencies.md +3 -3
- package/node_modules/pi-lens/docs/features.md +44 -5
- package/node_modules/pi-lens/docs/language-coverage.md +2 -2
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +25 -0
- package/node_modules/pi-lens/docs/pi-lens-investigator.md +25 -0
- package/node_modules/pi-lens/docs/pi-lens-reviewer.md +27 -0
- package/node_modules/pi-lens/docs/pi-lens-subagent.md +38 -0
- package/node_modules/pi-lens/docs/pi-lens-warden.md +55 -0
- package/node_modules/pi-lens/docs/public-api-stability.md +359 -0
- package/node_modules/pi-lens/docs/release-qa-baseline.md +182 -0
- package/node_modules/pi-lens/docs/subagent-compat.md +110 -30
- package/node_modules/pi-lens/docs/tree-sitter_rules_catalog.md +2 -2
- package/node_modules/pi-lens/package.json +15 -23
- package/node_modules/pi-lens/rules/tree-sitter-queries/python/python-cross-language-method.yml +3 -3
- package/node_modules/pi-lens/rules/tree-sitter-queries/python/python-hallucinated-import.yml +2 -2
- package/node_modules/pi-lens/rules/tree-sitter-queries/python/python-sql-injection.yml +12 -2
- package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +192 -1
- package/node_modules/pi-lens/scripts/install-selftest.mjs +58 -2
- package/node_modules/pi-lens/scripts/lib/skills-predicate.mjs +129 -0
- package/node_modules/pi-lens/scripts/rpc-load-check.mjs +3 -1
- package/node_modules/pi-web-access/CHANGELOG.md +28 -0
- package/node_modules/pi-web-access/README.md +62 -15
- package/node_modules/pi-web-access/curator-page.ts +3 -1
- package/node_modules/pi-web-access/curator-server.ts +5 -1
- package/node_modules/pi-web-access/gemini-search.ts +8 -4
- package/node_modules/pi-web-access/github-extract.ts +242 -1
- package/node_modules/pi-web-access/index.ts +118 -64
- package/node_modules/pi-web-access/mistral-search.ts +281 -0
- package/node_modules/pi-web-access/package.json +2 -2
- package/node_modules/pi-web-access/perplexity.ts +14 -1
- package/node_modules/pi-web-access/utils.ts +23 -6
- package/node_modules/pi-web-access/xai-search.ts +96 -33
- package/package.json +5 -5
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
* `_turnSummaryEmitCtx`), so flag changes take effect immediately.
|
|
58
58
|
*/
|
|
59
59
|
/** Stable Symbol key — identical across module reloads in the same process. */
|
|
60
|
+
import { registerProcessBridge } from "./process-bridge.js";
|
|
60
61
|
import { captureReadContentBinding, } from "./read-guard.js";
|
|
61
62
|
export const READ_BRIDGE_KEY = Symbol.for("pi-lens:read-bridge");
|
|
62
63
|
/**
|
|
@@ -96,15 +97,12 @@ function isValidEntry(entry) {
|
|
|
96
97
|
}
|
|
97
98
|
/**
|
|
98
99
|
* Mount the bridge singleton. Call once from inside the extension factory
|
|
99
|
-
* (protected by the `_readBridgeRegistered` module-level flag).
|
|
100
|
-
*
|
|
100
|
+
* (protected by the `_readBridgeRegistered` module-level flag). Subsequent
|
|
101
|
+
* calls are no-ops (first-wins, `clients/process-bridge.ts` owns the mount
|
|
102
|
+
* body — see that module's header, #2437).
|
|
101
103
|
*/
|
|
102
104
|
export function registerReadBridge(deps) {
|
|
103
|
-
|
|
104
|
-
// on a redundant defineProperty attempt.
|
|
105
|
-
if (READ_BRIDGE_KEY in globalThis)
|
|
106
|
-
return;
|
|
107
|
-
const bridge = Object.freeze({
|
|
105
|
+
registerProcessBridge(READ_BRIDGE_KEY, () => ({
|
|
108
106
|
version: 1,
|
|
109
107
|
recordRead(entry) {
|
|
110
108
|
// Validate the payload before doing anything else — this catches
|
|
@@ -114,8 +112,9 @@ export function registerReadBridge(deps) {
|
|
|
114
112
|
if (!deps.isRecordable(entry.filePath))
|
|
115
113
|
return;
|
|
116
114
|
const offset = entry.requestedOffset;
|
|
117
|
-
// When no limit is given treat the whole file as covered — the
|
|
118
|
-
// clips to the actual line count via its own file-length
|
|
115
|
+
// When no limit is given treat the whole file as covered — the
|
|
116
|
+
// guard clips to the actual line count via its own file-length
|
|
117
|
+
// probe.
|
|
119
118
|
const limit = entry.requestedLimit ?? Number.MAX_SAFE_INTEGER;
|
|
120
119
|
const contentBinding = captureReadContentBinding(entry.filePath, offset, limit);
|
|
121
120
|
deps.getReadGuard().recordRead({
|
|
@@ -127,21 +126,14 @@ export function registerReadBridge(deps) {
|
|
|
127
126
|
expandedByLsp: false,
|
|
128
127
|
turnIndex: deps.getTurnIndex(),
|
|
129
128
|
writeIndex: deps.peekWriteIndex(),
|
|
130
|
-
// Stamp the timestamp here, matching exactly how the internal
|
|
131
|
-
// path works (runtime-tool-call.ts always uses Date.now()).
|
|
129
|
+
// Stamp the timestamp here, matching exactly how the internal
|
|
130
|
+
// read path works (runtime-tool-call.ts always uses Date.now()).
|
|
132
131
|
timestamp: Date.now(),
|
|
133
|
-
// Provenance: identifies this record as bridge-sourced in
|
|
132
|
+
// Provenance: identifies this record as bridge-sourced in
|
|
133
|
+
// read-guard.log.
|
|
134
134
|
source: `bridge:${entry.consumer ?? "unknown"}`,
|
|
135
135
|
...(contentBinding !== undefined && { contentBinding }),
|
|
136
136
|
});
|
|
137
137
|
},
|
|
138
|
-
});
|
|
139
|
-
// Register as non-writable, non-configurable so no subsequent code can
|
|
140
|
-
// silently overwrite the bridge (first-wins is the contract).
|
|
141
|
-
Object.defineProperty(globalThis, READ_BRIDGE_KEY, {
|
|
142
|
-
value: bridge,
|
|
143
|
-
writable: false,
|
|
144
|
-
configurable: false,
|
|
145
|
-
enumerable: false,
|
|
146
|
-
});
|
|
138
|
+
}));
|
|
147
139
|
}
|
|
@@ -7,60 +7,23 @@
|
|
|
7
7
|
* within the symbol pass without requiring the agent to have read every line.
|
|
8
8
|
*/
|
|
9
9
|
import * as fs from "node:fs";
|
|
10
|
+
import { extname } from "node:path";
|
|
10
11
|
import { withBudget } from "./deadline-utils.js";
|
|
12
|
+
import { EXTENSION_TO_GRAMMAR } from "./language-registry.js";
|
|
11
13
|
/** Only expand reads smaller than this (lines). Larger reads don't benefit. */
|
|
12
14
|
export const EXPANSION_LIMIT_LINES = 100;
|
|
13
15
|
/** Don't expand to a symbol larger than this. */
|
|
14
16
|
const EXPANDED_SIZE_CAP_LINES = 300;
|
|
15
17
|
/** Async budget for tree-sitter parse + walk. */
|
|
16
18
|
export const EXPANSION_BUDGET_MS = 200;
|
|
17
|
-
/** File extensions we can parse — mirrors tree-sitter runner. */
|
|
18
|
-
const EXT_TO_LANG = {
|
|
19
|
-
".ts": "typescript",
|
|
20
|
-
".mts": "typescript",
|
|
21
|
-
".cts": "typescript",
|
|
22
|
-
".tsx": "tsx",
|
|
23
|
-
".js": "javascript",
|
|
24
|
-
".mjs": "javascript",
|
|
25
|
-
".cjs": "javascript",
|
|
26
|
-
".jsx": "javascript",
|
|
27
|
-
".py": "python",
|
|
28
|
-
".go": "go",
|
|
29
|
-
".rs": "rust",
|
|
30
|
-
".rb": "ruby",
|
|
31
|
-
".java": "java",
|
|
32
|
-
".kt": "kotlin",
|
|
33
|
-
".kts": "kotlin",
|
|
34
|
-
".dart": "dart",
|
|
35
|
-
".ex": "elixir",
|
|
36
|
-
".exs": "elixir",
|
|
37
|
-
".c": "c",
|
|
38
|
-
".h": "c",
|
|
39
|
-
".cc": "cpp",
|
|
40
|
-
".cpp": "cpp",
|
|
41
|
-
".cxx": "cpp",
|
|
42
|
-
".c++": "cpp",
|
|
43
|
-
".hh": "cpp",
|
|
44
|
-
".hpp": "cpp",
|
|
45
|
-
".hxx": "cpp",
|
|
46
|
-
".cs": "csharp",
|
|
47
|
-
".php": "php",
|
|
48
|
-
".phtml": "php",
|
|
49
|
-
".swift": "swift",
|
|
50
|
-
".lua": "lua",
|
|
51
|
-
".ml": "ocaml",
|
|
52
|
-
".mli": "ocaml",
|
|
53
|
-
".zig": "zig",
|
|
54
|
-
".sh": "bash",
|
|
55
|
-
".bash": "bash",
|
|
56
|
-
};
|
|
57
19
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* supported language instead of a hardcoded subset (#262).
|
|
20
|
+
* The grammar this module would parse `filePath` with, or undefined when read
|
|
21
|
+
* expansion does not understand the extension. Exported so the
|
|
22
|
+
* language-identity golden snapshot can record this consumer's answer.
|
|
62
23
|
*/
|
|
63
|
-
export
|
|
24
|
+
export function readExpansionLanguage(filePath) {
|
|
25
|
+
return EXTENSION_TO_GRAMMAR[extname(filePath).toLowerCase()];
|
|
26
|
+
}
|
|
64
27
|
/** AST node types considered "enclosing symbols" for coverage purposes. */
|
|
65
28
|
const ENCLOSING_TYPES = {
|
|
66
29
|
typescript: [
|
|
@@ -241,7 +204,7 @@ export async function tryExpandRead(filePath, requestedOffset, requestedLimit, t
|
|
|
241
204
|
return undefined;
|
|
242
205
|
return { ...result, durationMs: Date.now() - startedAt };
|
|
243
206
|
}
|
|
244
|
-
const languageId =
|
|
207
|
+
const languageId = readExpansionLanguage(filePath);
|
|
245
208
|
if (!languageId)
|
|
246
209
|
return undefined;
|
|
247
210
|
const enclosingTypes = ENCLOSING_TYPES[languageId];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as path from "node:path";
|
|
2
2
|
import { isTestMode } from "./env-utils.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getGlobalPiLensLogDir } from "./probe-home-state.js";
|
|
4
4
|
import { createNdjsonLogger } from "./ndjson-logger.js";
|
|
5
5
|
import { normalizeFilePath } from "./path-utils.js";
|
|
6
|
-
const READ_GUARD_LOG_DIR =
|
|
6
|
+
const READ_GUARD_LOG_DIR = getGlobalPiLensLogDir();
|
|
7
7
|
const READ_GUARD_LOG_FILE = path.join(READ_GUARD_LOG_DIR, "read-guard.log");
|
|
8
8
|
const READ_GUARD_LOG_BACKUP_FILE = path.join(READ_GUARD_LOG_DIR, "read-guard.log.1");
|
|
9
9
|
const MAX_LOG_BYTES = Math.max(128 * 1024, Number.parseInt(process.env.PI_LENS_READ_GUARD_MAX_BYTES ?? "1048576", 10) ||
|
|
@@ -68,11 +68,13 @@ export function createReadGuardEditBatchSummary(args) {
|
|
|
68
68
|
const resolvedSource = validIndexes(args.resolvedIndexes ?? []);
|
|
69
69
|
const rejectedSource = (args.rejectedReasons ?? []).filter((entry) => Number.isInteger(entry.index) && entry.index >= 0);
|
|
70
70
|
const appliedSource = validIndexes(args.appliedIndexes ?? []);
|
|
71
|
+
const alreadyAppliedSource = validIndexes(args.alreadyAppliedIndexes ?? []);
|
|
71
72
|
const requestedIndexes = boundedEditIndexes(requestedSource);
|
|
72
73
|
const resolvedIndexes = boundedEditIndexes(resolvedSource);
|
|
73
74
|
const rejectedReasons = rejectedSource.slice(0, MAX_EDIT_BATCH_ITEMS);
|
|
74
75
|
const rejectedIndexes = boundedEditIndexes(rejectedSource.map((entry) => entry.index));
|
|
75
76
|
const appliedIndexes = boundedEditIndexes(appliedSource);
|
|
77
|
+
const alreadyAppliedIndexes = boundedEditIndexes(alreadyAppliedSource);
|
|
76
78
|
const participantSource = (args.participantIds ?? []).filter((id) => typeof id === "string" && id.length > 0);
|
|
77
79
|
const participantIds = [...new Set(participantSource)].slice(0, MAX_EDIT_BATCH_ITEMS);
|
|
78
80
|
const commitStatus = args.commitStatus ?? "not_attempted";
|
|
@@ -99,6 +101,9 @@ export function createReadGuardEditBatchSummary(args) {
|
|
|
99
101
|
appliedCount: appliedSource.length,
|
|
100
102
|
appliedTotal: args.appliedTotal ?? appliedSource.length,
|
|
101
103
|
appliedIndexes,
|
|
104
|
+
alreadyAppliedCount: alreadyAppliedSource.length,
|
|
105
|
+
alreadyAppliedTotal: args.alreadyAppliedTotal ?? alreadyAppliedSource.length,
|
|
106
|
+
alreadyAppliedIndexes,
|
|
102
107
|
participantIds,
|
|
103
108
|
participantTotal: args.participantTotal ?? participantSource.length,
|
|
104
109
|
participantIdsTruncated: (args.participantTotal ?? participantSource.length) >
|
|
@@ -107,7 +112,9 @@ export function createReadGuardEditBatchSummary(args) {
|
|
|
107
112
|
requestedIndexes.length ||
|
|
108
113
|
(args.resolvedTotal ?? resolvedSource.length) > resolvedIndexes.length ||
|
|
109
114
|
(args.rejectedTotal ?? rejectedSource.length) > rejectedIndexes.length ||
|
|
110
|
-
(args.appliedTotal ?? appliedSource.length) > appliedIndexes.length
|
|
115
|
+
(args.appliedTotal ?? appliedSource.length) > appliedIndexes.length ||
|
|
116
|
+
(args.alreadyAppliedTotal ?? alreadyAppliedSource.length) >
|
|
117
|
+
alreadyAppliedIndexes.length,
|
|
111
118
|
commitStatus,
|
|
112
119
|
postEditStatus,
|
|
113
120
|
terminalStatus,
|
|
@@ -133,6 +140,10 @@ export function shouldLogEvent(event) {
|
|
|
133
140
|
event === "edit_preflight_blocked" ||
|
|
134
141
|
event === "edit_partial_apply" ||
|
|
135
142
|
event === "edit_partial_apply_skipped" ||
|
|
143
|
+
// #2402: pre-write batch rejections and recognized exact retries are the
|
|
144
|
+
// two new partial-apply outcomes; each is rare by construction.
|
|
145
|
+
event === "edit_partial_apply_rejected" ||
|
|
146
|
+
event === "edit_already_applied_retry" ||
|
|
136
147
|
event === "edit_post_edit_pipeline_failed" ||
|
|
137
148
|
event === "edit_batch_summary" ||
|
|
138
149
|
event === "edit_batch_summary_overflow" ||
|
|
@@ -204,7 +215,7 @@ export function logReadGuardEvent(entry) {
|
|
|
204
215
|
return;
|
|
205
216
|
}
|
|
206
217
|
const rawMetadata = entry.correlationId
|
|
207
|
-
? { ...
|
|
218
|
+
? { ...entry.metadata, correlationId: entry.correlationId }
|
|
208
219
|
: entry.metadata;
|
|
209
220
|
const bounded = boundTelemetryValue(rawMetadata, "metadata", 0);
|
|
210
221
|
const metadata = bounded.truncated && bounded.value && typeof bounded.value === "object"
|