@herbertgao/pi-extensions 2026.8.11 → 2026.8.13
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 +23 -10
- package/{node_modules/@herbertgao/pi-mermaid-open/LICENSE → THIRD_PARTY_NOTICES.md} +19 -1
- package/node_modules/@czottmann/pi-automode/CHANGELOG.md +15 -0
- package/node_modules/@czottmann/pi-automode/README.md +5 -3
- package/node_modules/@czottmann/pi-automode/docs/adr/ADR-001-permission-precedence-and-trust-boundaries.md +2 -0
- package/node_modules/@czottmann/pi-automode/docs/adr/ADR-002-global-config-in-extension-data-directory.md +60 -0
- package/node_modules/@czottmann/pi-automode/docs/adr/INDEX.md +1 -0
- package/node_modules/@czottmann/pi-automode/docs/automode-classifier-flow.md +4 -4
- package/node_modules/@czottmann/pi-automode/docs/configuration.md +20 -4
- package/node_modules/@czottmann/pi-automode/docs/observability-logging.md +1 -1
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/bash.ts +692 -0
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/config.ts +181 -3
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/constants.ts +4 -1
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/extension.ts +143 -36
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/hard-deny.ts +103 -148
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/paths.ts +32 -6
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/permissions.ts +344 -22
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode.ts +1 -0
- package/node_modules/@czottmann/pi-automode/package.json +4 -1
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +2 -1
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +2 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +4 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +21 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/core.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +19 -19
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +4 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +2 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +10 -2
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +3 -3
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +10 -0
- package/node_modules/@herbertgao/pi-subagents/README.md +21 -15
- package/node_modules/@herbertgao/pi-subagents/package.json +3 -3
- package/node_modules/@herbertgao/pi-subagents/src/agent-file-toggle.ts +11 -8
- package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +184 -106
- package/node_modules/@herbertgao/pi-subagents/src/cross-extension-rpc.ts +31 -11
- package/node_modules/@herbertgao/pi-subagents/src/custom-agents.ts +9 -1
- package/node_modules/@herbertgao/pi-subagents/src/index.ts +156 -31
- package/node_modules/@herbertgao/pi-subagents/src/invocation-config.ts +17 -0
- package/node_modules/@herbertgao/pi-subagents/src/model-resolver.ts +14 -0
- package/node_modules/@herbertgao/pi-subagents/src/schedule.ts +8 -0
- package/node_modules/@herbertgao/pi-subagents/src/settings.ts +32 -1
- package/node_modules/@herbertgao/pi-subagents/src/types.ts +17 -2
- package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +23 -2
- package/node_modules/@herbertgao/pi-subagents/src/ui/conversation-viewer.ts +259 -24
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +2 -2
- package/node_modules/@luxusai/pi-hindsight/CHANGELOG.md +376 -0
- package/node_modules/@luxusai/pi-hindsight/README.md +92 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/001-memory-lifecycle-and-scope.md +56 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/002-explicit-routing-strategy-seam.md +169 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/003-tui-memory-mode-vocabulary.md +107 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/004-lifeos-dual-bank-design.md +89 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/005-domain-banks-and-agent-first-surface.md +189 -0
- package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark.webp +0 -0
- package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark@2x.webp +0 -0
- package/node_modules/@luxusai/pi-hindsight/docs/coding-memory-evaluation.md +54 -0
- package/node_modules/@luxusai/pi-hindsight/docs/compatibility.md +75 -0
- package/node_modules/@luxusai/pi-hindsight/docs/hindsight-core-functions.md +300 -0
- package/node_modules/@luxusai/pi-hindsight/docs/mission-and-mental-model-quality.md +158 -0
- package/node_modules/@luxusai/pi-hindsight/docs/next-opt-out-design.md +164 -0
- package/node_modules/@luxusai/pi-hindsight/docs/risky-memory-modes.md +139 -0
- package/node_modules/@luxusai/pi-hindsight/docs/starter-mental-model-suggestions.md +74 -0
- package/node_modules/@luxusai/pi-hindsight/docs/surface-reference.md +261 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-operations.ts +151 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-selection.ts +18 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-settings-presenter.ts +46 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-templates.ts +383 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/banking.ts +240 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/knowledge-page-seed.ts +176 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/retain-strategies.ts +178 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/client/client-retry.ts +41 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/client/client.ts +386 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/client/fetch-compat.ts +39 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/client/timeout.ts +34 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-defaults.ts +140 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-model.ts +61 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-registry.ts +925 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-field-paths.ts +247 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-normalize.ts +547 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-writer.ts +480 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config.ts +182 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/setup-gate.ts +86 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-execute.ts +1010 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-parse.ts +175 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-plan.ts +425 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-presentation.ts +210 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-sessions.ts +817 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/index.ts +25 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/git-seed.ts +319 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-recall.ts +196 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-retain.ts +189 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-runtime.ts +65 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle.ts +260 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/mental-models.ts +244 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/observation-scopes.ts +59 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-cleanup.ts +82 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-visibility.ts +45 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall.ts +331 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-cursor.ts +354 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-job-builder.ts +66 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-receipts.ts +132 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain.ts +228 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-bank-template-operations.ts +74 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-config-operations.ts +16 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-control-operations.ts +648 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-diagnostics-operations.ts +105 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-identity.ts +68 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-service.ts +71 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-types.ts +13 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-recall-operations.ts +162 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-retain-operations.ts +131 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-scope.ts +104 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-session-operations.ts +37 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/operation-catalog.ts +893 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/reflect-presenter.ts +35 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/scope-migrate.ts +177 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/tools.ts +7 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/flush-presenter.ts +21 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/jsonl-queue-store.ts +112 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-delivery.ts +111 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-lock.ts +214 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-operations.ts +70 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue.ts +392 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/bank-template-presentation.ts +45 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/commands.ts +9 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/guided-setup.ts +860 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/prefill-input.ts +105 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-flow.ts +189 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-server-probe.ts +299 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-actions.ts +201 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-facts.ts +47 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-render.ts +239 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-types.ts +50 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui.ts +259 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/tool-presenters.ts +77 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/types.ts +534 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/diagnostics.ts +319 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/messages.ts +325 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/sanitize.ts +42 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-memory-meta.ts +244 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-operations.ts +56 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/session.ts +50 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-fields.ts +167 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-health.ts +207 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/status.ts +120 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/version.ts +8 -0
- package/node_modules/@luxusai/pi-hindsight/package.json +118 -0
- package/node_modules/@luxusai/pi-hindsight/skills/hindsight-memory-doctor/SKILL.md +75 -0
- package/node_modules/@narumitw/pi-btw/dist/index.ts +143 -46
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +3 -3
- package/node_modules/@narumitw/pi-btw/package.json +6 -6
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +136 -22
- package/node_modules/{@herbertgao → @tifan}/pi-copy-response/README.md +2 -4
- package/node_modules/{@herbertgao → @tifan}/pi-copy-response/package.json +5 -15
- package/node_modules/{@herbertgao → @tifan}/pi-handoff/README.md +4 -6
- package/node_modules/@tifan/pi-handoff/package.json +43 -0
- package/node_modules/{@herbertgao → @tifan}/pi-handoff/src/index.ts +1 -1
- package/node_modules/{@herbertgao → @tifan}/pi-inline-skills/README.md +2 -4
- package/node_modules/{@herbertgao → @tifan}/pi-inline-skills/package.json +5 -15
- package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/README.md +5 -7
- package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/package.json +5 -19
- package/node_modules/{@herbertgao → @tifan}/pi-preferred-thinking/README.md +4 -6
- package/node_modules/{@herbertgao → @tifan}/pi-preferred-thinking/package.json +6 -16
- package/node_modules/{@herbertgao → @tifan}/pi-preferred-thinking/src/index.ts +1 -6
- package/node_modules/{@herbertgao → @tifan}/pi-recap/README.md +4 -6
- package/node_modules/@tifan/pi-recap/package.json +42 -0
- package/node_modules/{@herbertgao → @tifan}/pi-recap/src/models.ts +1 -6
- package/node_modules/{@herbertgao → @tifan}/pi-rename/README.md +13 -8
- package/node_modules/@tifan/pi-rename/package.json +47 -0
- package/node_modules/@tifan/pi-rename/src/herdr-label.ts +4 -0
- package/node_modules/{@herbertgao → @tifan}/pi-rename/src/index.ts +4 -16
- package/node_modules/{@herbertgao → @tifan}/pi-rename/src/models.ts +1 -6
- package/node_modules/{@herbertgao → @tifan}/pi-titlebar-spinner/README.md +2 -4
- package/node_modules/{@herbertgao → @tifan}/pi-titlebar-spinner/package.json +5 -15
- package/node_modules/pi-lens/CHANGELOG.md +96 -1
- package/node_modules/pi-lens/dist/clients/actionable-warnings-logger.js +2 -1
- package/node_modules/pi-lens/dist/clients/actionable-warnings.js +14 -5
- package/node_modules/pi-lens/dist/clients/advisory-provenance.js +48 -18
- package/node_modules/pi-lens/dist/clients/ast-grep-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/atomic-write-staging.js +16 -4
- package/node_modules/pi-lens/dist/clients/bash-file-access.js +3 -1
- package/node_modules/pi-lens/dist/clients/biome-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/blocker-freshness.js +21 -8
- package/node_modules/pi-lens/dist/clients/bounded-cache.js +24 -8
- package/node_modules/pi-lens/dist/clients/bounded-pid-file-lock.js +4 -3
- package/node_modules/pi-lens/dist/clients/cache-manager.js +6 -7
- package/node_modules/pi-lens/dist/clients/cache-observability.js +461 -66
- package/node_modules/pi-lens/dist/clients/call-graph.js +238 -63
- package/node_modules/pi-lens/dist/clients/codebase-model.js +13 -5
- package/node_modules/pi-lens/dist/clients/complexity-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/dead-code-client.js +19 -8
- package/node_modules/pi-lens/dist/clients/dead-code-logger.js +1 -2
- package/node_modules/pi-lens/dist/clients/deadline-utils.js +3 -1
- package/node_modules/pi-lens/dist/clients/debug-heap.js +8 -1
- package/node_modules/pi-lens/dist/clients/degradation-ledger.js +1 -1
- package/node_modules/pi-lens/dist/clients/dependency-checker.js +11 -7
- package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +39 -2
- package/node_modules/pi-lens/dist/clients/diagnostic-line-freshness.js +5 -1
- package/node_modules/pi-lens/dist/clients/dispatch/auxiliary-lsp.js +2 -3
- package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +13 -1
- package/node_modules/pi-lens/dist/clients/dispatch/facts/function-facts.js +3 -1
- package/node_modules/pi-lens/dist/clients/dispatch/facts/import-facts.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/facts/tree-sitter-facts.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/integration.js +9 -4
- package/node_modules/pi-lens/dist/clients/dispatch/rules/error-swallowing.js +3 -1
- package/node_modules/pi-lens/dist/clients/dispatch/rules/pass-through-wrappers.js +6 -2
- package/node_modules/pi-lens/dist/clients/dispatch/rules/unsafe-boundary.js +31 -7
- package/node_modules/pi-lens/dist/clients/dispatch/runners/actionlint.js +5 -2
- package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +10 -14
- package/node_modules/pi-lens/dist/clients/dispatch/runners/cpp-check.js +5 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/dotnet-build.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/elixir-check.js +3 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/eslint.js +25 -6
- package/node_modules/pi-lens/dist/clients/dispatch/runners/fish-indent.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/gleam-check.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/golangci-lint.js +3 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/hadolint.js +13 -8
- package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +4 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/htmlhint.js +25 -10
- package/node_modules/pi-lens/dist/clients/dispatch/runners/javac.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ktlint.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +28 -4
- package/node_modules/pi-lens/dist/clients/dispatch/runners/mypy.js +6 -8
- package/node_modules/pi-lens/dist/clients/dispatch/runners/oxlint.js +212 -11
- package/node_modules/pi-lens/dist/clients/dispatch/runners/php-lint.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/phpstan.js +8 -4
- package/node_modules/pi-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +10 -6
- package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +23 -14
- package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/shellcheck.js +7 -9
- package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +5 -2
- package/node_modules/pi-lens/dist/clients/dispatch/runners/sqlfluff.js +7 -7
- package/node_modules/pi-lens/dist/clients/dispatch/runners/stylelint.js +6 -8
- package/node_modules/pi-lens/dist/clients/dispatch/runners/terragrunt.js +13 -8
- package/node_modules/pi-lens/dist/clients/dispatch/runners/tflint.js +13 -8
- package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +17 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/candidate-probe.js +7 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +24 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/tool-failure.js +35 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/yaml-rule-parser.js +1 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/yamllint.js +6 -8
- package/node_modules/pi-lens/dist/clients/dispatch/runners/zig-check.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/suppress-writer.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/types.js +6 -1
- package/node_modules/pi-lens/dist/clients/dispatch/utils/lsp-diagnostics.js +6 -2
- package/node_modules/pi-lens/dist/clients/extension-log.js +5 -3
- package/node_modules/pi-lens/dist/clients/feature-hints.js +8 -1
- package/node_modules/pi-lens/dist/clients/file-kinds.js +34 -129
- package/node_modules/pi-lens/dist/clients/file-utils.js +17 -1
- package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +57 -2
- package/node_modules/pi-lens/dist/clients/formatters.js +144 -27
- package/node_modules/pi-lens/dist/clients/freshness.js +38 -0
- package/node_modules/pi-lens/dist/clients/git-guard.js +43 -13
- package/node_modules/pi-lens/dist/clients/go-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/grammar-source.js +1 -1
- package/node_modules/pi-lens/dist/clients/gzip-stage-write.js +30 -4
- package/node_modules/pi-lens/dist/clients/host-edit-normalize.js +1 -3
- package/node_modules/pi-lens/dist/clients/install-diagnostics.js +4 -2
- package/node_modules/pi-lens/dist/clients/installer/index.js +86 -77
- package/node_modules/pi-lens/dist/clients/instance-reaper.js +5 -2
- package/node_modules/pi-lens/dist/clients/instance-registry.js +4 -2
- package/node_modules/pi-lens/dist/clients/jscpd-client.js +6 -1
- package/node_modules/pi-lens/dist/clients/knip-client.js +29 -15
- package/node_modules/pi-lens/dist/clients/language-profile.js +4 -1
- package/node_modules/pi-lens/dist/clients/latency-logger.js +13 -2
- package/node_modules/pi-lens/dist/clients/lens-config.js +1 -1
- package/node_modules/pi-lens/dist/clients/lens-map.js +8 -3
- package/node_modules/pi-lens/dist/clients/live-bus-emitter.js +1 -1
- package/node_modules/pi-lens/dist/clients/lsp/config.js +4 -6
- package/node_modules/pi-lens/dist/clients/lsp/edits.js +119 -32
- package/node_modules/pi-lens/dist/clients/lsp/index.js +94 -35
- package/node_modules/pi-lens/dist/clients/lsp/inferred-project.js +2 -1
- package/node_modules/pi-lens/dist/clients/lsp/jvm-runtime.js +4 -1
- package/node_modules/pi-lens/dist/clients/lsp/launch.js +11 -3
- package/node_modules/pi-lens/dist/clients/lsp/pending-aux-coverage.js +152 -0
- package/node_modules/pi-lens/dist/clients/lsp/server.js +19 -7
- package/node_modules/pi-lens/dist/clients/lsp/tsserver-sync.js +10 -2
- package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +9 -4
- package/node_modules/pi-lens/dist/clients/lsp-document-symbols.js +1 -3
- package/node_modules/pi-lens/dist/clients/lsp-mutation.js +10 -20
- package/node_modules/pi-lens/dist/clients/mcp/host-shim.js +1 -1
- package/node_modules/pi-lens/dist/clients/memory-sampler.js +73 -7
- package/node_modules/pi-lens/dist/clients/metrics-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/middle-man-analysis.js +8 -3
- package/node_modules/pi-lens/dist/clients/module-report-lsp.js +7 -1
- package/node_modules/pi-lens/dist/clients/module-report.js +14 -17
- package/node_modules/pi-lens/dist/clients/ndjson-logger.js +3 -5
- package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +220 -0
- package/node_modules/pi-lens/dist/clients/package-manager.js +6 -1
- package/node_modules/pi-lens/dist/clients/pipeline.js +57 -9
- package/node_modules/pi-lens/dist/clients/project-conventions.js +2 -8
- package/node_modules/pi-lens/dist/clients/project-diagnostics/cache.js +10 -7
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/call-graph-impact.js +2 -1
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/gitleaks.js +3 -1
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +13 -9
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/trivy.js +3 -1
- package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +5 -2
- package/node_modules/pi-lens/dist/clients/project-lens-config.js +12 -5
- package/node_modules/pi-lens/dist/clients/project-snapshot-fingerprint.js +48 -0
- package/node_modules/pi-lens/dist/clients/project-snapshot-persist-worker.js +15 -1
- package/node_modules/pi-lens/dist/clients/project-snapshot.js +472 -66
- package/node_modules/pi-lens/dist/clients/read-expansion.js +12 -2
- package/node_modules/pi-lens/dist/clients/read-guard-logger.js +5 -4
- package/node_modules/pi-lens/dist/clients/read-guard-tool-lines.js +5 -2
- package/node_modules/pi-lens/dist/clients/read-guard.js +1 -1
- package/node_modules/pi-lens/dist/clients/resource-sampler.js +1 -1
- package/node_modules/pi-lens/dist/clients/reverse-deps.js +6 -5
- package/node_modules/pi-lens/dist/clients/review-graph/builder.js +42 -17
- package/node_modules/pi-lens/dist/clients/review-graph/git-identity.js +8 -2
- package/node_modules/pi-lens/dist/clients/review-graph/import-resolvers.js +10 -1
- package/node_modules/pi-lens/dist/clients/review-graph/query.js +2 -1
- package/node_modules/pi-lens/dist/clients/review-graph/tsconfig-paths.js +4 -2
- package/node_modules/pi-lens/dist/clients/review-graph/workspace-modules.js +2 -2
- package/node_modules/pi-lens/dist/clients/ruff-client.js +6 -5
- package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +63 -31
- package/node_modules/pi-lens/dist/clients/runtime-context.js +12 -4
- package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +83 -4
- package/node_modules/pi-lens/dist/clients/runtime-session.js +14 -0
- package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +59 -3
- package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +148 -34
- package/node_modules/pi-lens/dist/clients/runtime-turn.js +147 -6
- package/node_modules/pi-lens/dist/clients/rust-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/safe-spawn.js +150 -11
- package/node_modules/pi-lens/dist/clients/security-scan-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/session-summary.js +3 -1
- package/node_modules/pi-lens/dist/clients/sg-runner.js +1 -3
- package/node_modules/pi-lens/dist/clients/source-filter.js +10 -6
- package/node_modules/pi-lens/dist/clients/source-walker.js +1 -1
- package/node_modules/pi-lens/dist/clients/spawn-timeout-cooldown.js +96 -0
- package/node_modules/pi-lens/dist/clients/startup-scan.js +4 -1
- package/node_modules/pi-lens/dist/clients/tool-definition.js +7 -0
- package/node_modules/pi-lens/dist/clients/tool-policy.js +26 -11
- package/node_modules/pi-lens/dist/clients/tool-render.js +2 -1
- package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +10 -4
- package/node_modules/pi-lens/dist/clients/tree-sitter-logger.js +2 -2
- package/node_modules/pi-lens/dist/clients/tree-sitter-symbol-extractor.js +12 -5
- package/node_modules/pi-lens/dist/clients/warm-attach.js +12 -5
- package/node_modules/pi-lens/dist/clients/widget-state.js +27 -11
- package/node_modules/pi-lens/dist/clients/word-index.js +3 -1
- package/node_modules/pi-lens/dist/clients/workspace-topology.js +8 -2
- package/node_modules/pi-lens/dist/clients/zizmor-config.js +9 -1
- package/node_modules/pi-lens/dist/i18n.js +13 -5
- package/node_modules/pi-lens/dist/index.js +10797 -8627
- package/node_modules/pi-lens/dist/mcp/server.js +3 -1
- package/node_modules/pi-lens/dist/tools/ast-grep-replace.js +68 -12
- package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +21 -7
- package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +164 -35
- package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +24 -7
- package/node_modules/pi-lens/dist/tools/lsp-navigation.js +3 -1
- package/node_modules/pi-lens/dist/tools/module-report.js +1 -1
- package/node_modules/pi-lens/dist/tools/project-report.js +1 -1
- package/node_modules/pi-lens/dist/tools/symbol-search.js +5 -2
- package/node_modules/pi-lens/docs/durable-store-audit-1202.md +1 -1
- package/node_modules/pi-lens/docs/servercapabilities.md +1 -1
- package/node_modules/pi-lens/package.json +160 -156
- package/node_modules/pi-lens/rules/typos/_typos.toml +2 -2
- package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +31 -13
- package/node_modules/pi-lens/scripts/download-grammars.js +9 -3
- package/node_modules/pi-lens/scripts/rpc-load-check.mjs +30 -9
- package/node_modules/pi-mcp-adapter/CHANGELOG.md +47 -0
- package/node_modules/pi-mcp-adapter/README.md +42 -13
- package/node_modules/pi-mcp-adapter/commands.ts +4 -2
- package/node_modules/pi-mcp-adapter/config.ts +45 -5
- package/node_modules/pi-mcp-adapter/direct-tools.ts +103 -92
- package/node_modules/pi-mcp-adapter/dist/agent-dir.d.ts +10 -0
- package/node_modules/pi-mcp-adapter/dist/agent-dir.js +63 -0
- package/node_modules/pi-mcp-adapter/dist/agent-dir.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.d.ts +8 -0
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js +356 -0
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/config.d.ts +123 -0
- package/node_modules/pi-mcp-adapter/dist/config.js +1087 -0
- package/node_modules/pi-mcp-adapter/dist/config.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.d.ts +19 -0
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.js +319 -0
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.d.ts +2 -0
- package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js +156 -0
- package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/resource-tools.d.ts +1 -0
- package/node_modules/pi-mcp-adapter/dist/resource-tools.js +15 -0
- package/node_modules/pi-mcp-adapter/dist/resource-tools.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/types.d.ts +564 -0
- package/node_modules/pi-mcp-adapter/dist/types.js +287 -0
- package/node_modules/pi-mcp-adapter/dist/types.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.d.ts +6 -0
- package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js +37 -0
- package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/ui-stream-types.d.ts +104 -0
- package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js +59 -0
- package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.d.ts +4 -0
- package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js +27 -0
- package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/utils.d.ts +32 -0
- package/node_modules/pi-mcp-adapter/dist/utils.js +338 -0
- package/node_modules/pi-mcp-adapter/dist/utils.js.map +1 -0
- package/node_modules/pi-mcp-adapter/failure-backoff.ts +23 -0
- package/node_modules/pi-mcp-adapter/index.ts +204 -82
- package/node_modules/pi-mcp-adapter/init.ts +41 -30
- package/node_modules/pi-mcp-adapter/lifecycle.ts +16 -8
- package/node_modules/pi-mcp-adapter/mcp-code.ts +2 -0
- package/node_modules/pi-mcp-adapter/mcp-oauth-provider.ts +66 -16
- package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +95 -7
- package/node_modules/pi-mcp-adapter/mcp-probe.ts +18 -4
- package/node_modules/pi-mcp-adapter/mcp-references.ts +368 -0
- package/node_modules/pi-mcp-adapter/mcp-status.ts +8 -19
- package/node_modules/pi-mcp-adapter/metadata-cache.ts +20 -12
- package/node_modules/pi-mcp-adapter/namespace-tools.ts +276 -0
- package/node_modules/pi-mcp-adapter/package.json +24 -6
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +66 -10
- package/node_modules/pi-mcp-adapter/search-ranking.ts +2 -0
- package/node_modules/pi-mcp-adapter/server-manager.ts +63 -12
- package/node_modules/pi-mcp-adapter/state.ts +1 -3
- package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +16 -2
- package/node_modules/pi-mcp-adapter/types.ts +48 -1
- package/node_modules/pi-mcp-adapter/ui-server.ts +3 -19
- package/node_modules/pi-mcp-adapter/ui-session.ts +2 -1
- package/node_modules/pi-mcp-adapter/utils.ts +21 -19
- package/node_modules/pi-web-access/CHANGELOG.md +26 -0
- package/node_modules/pi-web-access/README.md +71 -14
- package/node_modules/pi-web-access/chrome-cookies.ts +115 -35
- package/node_modules/pi-web-access/credential-source.ts +6 -2
- 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 +89 -9
- package/node_modules/pi-web-access/fetch-params.ts +13 -0
- package/node_modules/pi-web-access/gemini-adc.ts +298 -0
- package/node_modules/pi-web-access/gemini-api.ts +59 -15
- package/node_modules/pi-web-access/gemini-search.ts +58 -18
- package/node_modules/pi-web-access/gemini-url-context.ts +3 -2
- package/node_modules/pi-web-access/gemini-web-config.ts +57 -7
- package/node_modules/pi-web-access/gemini-web.ts +9 -3
- package/node_modules/pi-web-access/github-api.ts +5 -4
- package/node_modules/pi-web-access/github-issue-pr.ts +700 -0
- package/node_modules/pi-web-access/index.ts +403 -297
- package/node_modules/pi-web-access/kimi-search.ts +234 -0
- package/node_modules/pi-web-access/openai-search.ts +118 -21
- package/node_modules/pi-web-access/package.json +3 -2
- package/node_modules/pi-web-access/ssrf-protection.ts +4 -1
- package/node_modules/pi-web-access/utils.ts +307 -1
- package/node_modules/pi-web-access/youtube-extract.ts +2 -2
- package/package.json +46 -37
- package/node_modules/@herbertgao/pi-copy-response/CHANGELOG.md +0 -49
- package/node_modules/@herbertgao/pi-copy-response/LICENSE +0 -22
- package/node_modules/@herbertgao/pi-handoff/CHANGELOG.md +0 -83
- package/node_modules/@herbertgao/pi-handoff/LICENSE +0 -22
- package/node_modules/@herbertgao/pi-handoff/package.json +0 -60
- package/node_modules/@herbertgao/pi-inline-skills/CHANGELOG.md +0 -57
- package/node_modules/@herbertgao/pi-inline-skills/LICENSE +0 -22
- package/node_modules/@herbertgao/pi-mermaid-open/CHANGELOG.md +0 -39
- package/node_modules/@herbertgao/pi-preferred-thinking/CHANGELOG.md +0 -63
- package/node_modules/@herbertgao/pi-preferred-thinking/LICENSE +0 -22
- package/node_modules/@herbertgao/pi-recap/CHANGELOG.md +0 -101
- package/node_modules/@herbertgao/pi-recap/LICENSE +0 -22
- package/node_modules/@herbertgao/pi-recap/package.json +0 -55
- package/node_modules/@herbertgao/pi-rename/CHANGELOG.md +0 -49
- package/node_modules/@herbertgao/pi-rename/LICENSE +0 -22
- package/node_modules/@herbertgao/pi-rename/package.json +0 -63
- package/node_modules/@herbertgao/pi-titlebar-spinner/CHANGELOG.md +0 -25
- package/node_modules/@herbertgao/pi-titlebar-spinner/LICENSE +0 -22
- /package/node_modules/{@herbertgao → @tifan}/pi-copy-response/src/index.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-handoff/src/complete-text.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-handoff/src/session-query.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-inline-skills/src/index.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/herdr-plugin/herdr-plugin.toml +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/herdr-plugin/viewer.mjs +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/src/index.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-recap/src/index.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-recap/src/model-picker.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-recap/src/sanitize.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-recap/src/tui.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-rename/src/model-picker.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-rename/src/naming.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-rename/src/sanitize.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-titlebar-spinner/src/index.ts +0 -0
|
@@ -96,7 +96,12 @@ const ENCLOSING_TYPES = {
|
|
|
96
96
|
"enum_declaration",
|
|
97
97
|
],
|
|
98
98
|
kotlin: ["function_declaration", "class_declaration", "object_declaration"],
|
|
99
|
-
dart: [
|
|
99
|
+
dart: [
|
|
100
|
+
"function_declaration",
|
|
101
|
+
"method_declaration",
|
|
102
|
+
"class_definition",
|
|
103
|
+
"mixin_declaration",
|
|
104
|
+
],
|
|
100
105
|
elixir: ["call"],
|
|
101
106
|
c: ["function_definition"],
|
|
102
107
|
cpp: ["function_definition", "class_specifier", "struct_specifier"],
|
|
@@ -108,7 +113,12 @@ const ENCLOSING_TYPES = {
|
|
|
108
113
|
"struct_declaration",
|
|
109
114
|
],
|
|
110
115
|
php: ["function_definition", "method_declaration", "class_declaration"],
|
|
111
|
-
swift: [
|
|
116
|
+
swift: [
|
|
117
|
+
"function_declaration",
|
|
118
|
+
"class_declaration",
|
|
119
|
+
"protocol_declaration",
|
|
120
|
+
"init_declaration",
|
|
121
|
+
],
|
|
112
122
|
lua: ["function_declaration", "function_definition"],
|
|
113
123
|
ocaml: ["value_definition", "module_definition"],
|
|
114
124
|
zig: ["function_declaration"],
|
|
@@ -44,8 +44,7 @@ export function getReadGuardCorrelationId(event) {
|
|
|
44
44
|
if (sanitized)
|
|
45
45
|
return sanitized;
|
|
46
46
|
}
|
|
47
|
-
generatedCorrelationCounter =
|
|
48
|
-
(generatedCorrelationCounter + 1) % 1_000_000;
|
|
47
|
+
generatedCorrelationCounter = (generatedCorrelationCounter + 1) % 1_000_000;
|
|
49
48
|
return `rg-${Date.now().toString(36)}-${generatedCorrelationCounter}`;
|
|
50
49
|
}
|
|
51
50
|
function validIndexes(indexes) {
|
|
@@ -101,8 +100,10 @@ export function createReadGuardEditBatchSummary(args) {
|
|
|
101
100
|
appliedIndexes,
|
|
102
101
|
participantIds,
|
|
103
102
|
participantTotal: args.participantTotal ?? participantSource.length,
|
|
104
|
-
participantIdsTruncated: (args.participantTotal ?? participantSource.length) >
|
|
105
|
-
|
|
103
|
+
participantIdsTruncated: (args.participantTotal ?? participantSource.length) >
|
|
104
|
+
participantIds.length,
|
|
105
|
+
indexesTruncated: (args.requestedTotal ?? requestedSource.length) >
|
|
106
|
+
requestedIndexes.length ||
|
|
106
107
|
(args.resolvedTotal ?? resolvedSource.length) > resolvedIndexes.length ||
|
|
107
108
|
(args.rejectedTotal ?? rejectedSource.length) > rejectedIndexes.length ||
|
|
108
109
|
(args.appliedTotal ?? appliedSource.length) > appliedIndexes.length,
|
|
@@ -68,7 +68,9 @@ function findSimilarLines(content, target, options = {}) {
|
|
|
68
68
|
return [];
|
|
69
69
|
const lines = content.split("\n");
|
|
70
70
|
const start = nearLine ? Math.max(0, nearLine - 1 - window) : 0;
|
|
71
|
-
const end = nearLine
|
|
71
|
+
const end = nearLine
|
|
72
|
+
? Math.min(lines.length, nearLine - 1 + window)
|
|
73
|
+
: lines.length;
|
|
72
74
|
const scored = [];
|
|
73
75
|
for (let i = start; i < end; i += 1) {
|
|
74
76
|
const text = lines[i];
|
|
@@ -822,7 +824,8 @@ function findBlankLineInsensitiveCandidate(content, oldText) {
|
|
|
822
824
|
let end = start;
|
|
823
825
|
let ok = true;
|
|
824
826
|
while (oldIdx < oldNonBlank.length) {
|
|
825
|
-
while (contentIdx < contentLines.length &&
|
|
827
|
+
while (contentIdx < contentLines.length &&
|
|
828
|
+
isBlank(contentLines[contentIdx]))
|
|
826
829
|
contentIdx += 1;
|
|
827
830
|
if (contentIdx >= contentLines.length ||
|
|
828
831
|
stripIndent(contentLines[contentIdx]) !== oldNonBlank[oldIdx]) {
|
|
@@ -399,7 +399,7 @@ export class ReadGuard {
|
|
|
399
399
|
// eviction starts, so it stops showing growth. `rawReadCountForFile` keeps
|
|
400
400
|
// the real arrival count observable alongside `evictedRecordCount`.
|
|
401
401
|
const rawReadCountForFile = arr.length;
|
|
402
|
-
const { evictedCount: evictedRecordCount, evictedCreditCount, evictedGenuineCount } = enforceRecordCapForFile(arr);
|
|
402
|
+
const { evictedCount: evictedRecordCount, evictedCreditCount, evictedGenuineCount, } = enforceRecordCapForFile(arr);
|
|
403
403
|
this.touchFile(storedRecord.filePath);
|
|
404
404
|
this.enforceFileCap();
|
|
405
405
|
logReadGuardEvent({
|
|
@@ -115,7 +115,7 @@ async function findDescendantPidsWindows(rootPid) {
|
|
|
115
115
|
// One WQL query pulls every process's (pid, parentPid) pair; walk the BFS
|
|
116
116
|
// in JS rather than issuing N queries for N tree levels.
|
|
117
117
|
const psScript = "Get-CimInstance Win32_Process " +
|
|
118
|
-
|
|
118
|
+
"| Select-Object -Property ProcessId,ParentProcessId " +
|
|
119
119
|
'| ForEach-Object { "$($_.ProcessId),$($_.ParentProcessId)" }';
|
|
120
120
|
const powershell = path.join(process.env.SystemRoot ?? String.raw `C:\Windows`, "WindowsPowerShell", "v1.0", "powershell.exe");
|
|
121
121
|
// Fire-and-forget, per-poll-tick spawn (#1155): `spawnCollectStdout` unrefs
|
|
@@ -12,12 +12,10 @@ export function rankFilesByReverseDependencyCentrality(index) {
|
|
|
12
12
|
...Object.keys(index.importedBy),
|
|
13
13
|
]);
|
|
14
14
|
return [...files].sort((a, b) => {
|
|
15
|
-
const fanIn = (index.importedBy[b]?.length ?? 0) -
|
|
16
|
-
(index.importedBy[a]?.length ?? 0);
|
|
15
|
+
const fanIn = (index.importedBy[b]?.length ?? 0) - (index.importedBy[a]?.length ?? 0);
|
|
17
16
|
if (fanIn !== 0)
|
|
18
17
|
return fanIn;
|
|
19
|
-
const fanOut = (index.imports[b]?.length ?? 0) -
|
|
20
|
-
(index.imports[a]?.length ?? 0);
|
|
18
|
+
const fanOut = (index.imports[b]?.length ?? 0) - (index.imports[a]?.length ?? 0);
|
|
21
19
|
return fanOut || a.localeCompare(b);
|
|
22
20
|
});
|
|
23
21
|
}
|
|
@@ -104,7 +102,10 @@ export function patchReverseDependencyIndex(index, changes) {
|
|
|
104
102
|
imports[file] = newTargets;
|
|
105
103
|
importedBy[file] ??= [];
|
|
106
104
|
for (const target of newTargets) {
|
|
107
|
-
importedBy[target] = sortedUnique([
|
|
105
|
+
importedBy[target] = sortedUnique([
|
|
106
|
+
...(importedBy[target] ?? []),
|
|
107
|
+
file,
|
|
108
|
+
]);
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
else {
|
|
@@ -123,7 +123,9 @@ function workspaceCacheEpoch(key) {
|
|
|
123
123
|
}
|
|
124
124
|
function reviewGraphIdleEvictMs() {
|
|
125
125
|
const value = Number.parseInt(process.env.PI_LENS_REVIEW_GRAPH_IDLE_EVICT_MS ?? "", 10);
|
|
126
|
-
return Number.isSafeInteger(value) && value > 0
|
|
126
|
+
return Number.isSafeInteger(value) && value > 0
|
|
127
|
+
? value
|
|
128
|
+
: REVIEW_GRAPH_IDLE_EVICT_MS_DEFAULT;
|
|
127
129
|
}
|
|
128
130
|
function clearWorkspaceGraphTimer(entry) {
|
|
129
131
|
if (entry.idleTimer)
|
|
@@ -172,7 +174,8 @@ function scheduleWorkspaceGraphEviction(key, entry) {
|
|
|
172
174
|
const epoch = workspaceCacheEpoch(key);
|
|
173
175
|
entry.idleTimer = setTimeout(() => {
|
|
174
176
|
entry.idleTimer = undefined;
|
|
175
|
-
if (_workspaceGraphCache.get(key) !== entry ||
|
|
177
|
+
if (_workspaceGraphCache.get(key) !== entry ||
|
|
178
|
+
workspaceCacheEpoch(key) !== epoch)
|
|
176
179
|
return;
|
|
177
180
|
evictWorkspaceGraph(key, entry);
|
|
178
181
|
}, reviewGraphIdleEvictMs());
|
|
@@ -188,7 +191,10 @@ function touchWorkspaceGraph(key) {
|
|
|
188
191
|
function setWorkspaceGraph(key, entry, epoch) {
|
|
189
192
|
if (epoch !== undefined && workspaceCacheEpoch(key) !== epoch)
|
|
190
193
|
return false;
|
|
191
|
-
const resident = {
|
|
194
|
+
const resident = {
|
|
195
|
+
...entry,
|
|
196
|
+
lastUsedAt: Date.now(),
|
|
197
|
+
};
|
|
192
198
|
_workspaceGraphCache.set(key, resident);
|
|
193
199
|
scheduleWorkspaceGraphEviction(key, resident);
|
|
194
200
|
while (_workspaceGraphCache.size > REVIEW_GRAPH_MAX_WARM_WORKSPACES) {
|
|
@@ -372,7 +378,8 @@ export function getReviewGraphCacheIdentity(cwd, graph) {
|
|
|
372
378
|
// stored instance — anything else unstamped must not resolve an identity
|
|
373
379
|
// (e.g. the size-skip empty graph racing a hydrated entry).
|
|
374
380
|
if (graph) {
|
|
375
|
-
if (cached.buildGeneration === undefined &&
|
|
381
|
+
if (cached.buildGeneration === undefined &&
|
|
382
|
+
graph.buildGeneration === undefined) {
|
|
376
383
|
if (cached.graph !== graph)
|
|
377
384
|
return undefined;
|
|
378
385
|
}
|
|
@@ -381,7 +388,8 @@ export function getReviewGraphCacheIdentity(cwd, graph) {
|
|
|
381
388
|
}
|
|
382
389
|
}
|
|
383
390
|
const version = graph?.version ?? cached.graph.version;
|
|
384
|
-
if (typeof version !== "string" ||
|
|
391
|
+
if (typeof version !== "string" ||
|
|
392
|
+
version.length === 0 ||
|
|
385
393
|
typeof cached.signature !== "string") {
|
|
386
394
|
return undefined;
|
|
387
395
|
}
|
|
@@ -1928,7 +1936,9 @@ function reviewGraphCheckpointPath(cwd) {
|
|
|
1928
1936
|
function hashIgnoredIds(ignoredIds) {
|
|
1929
1937
|
if (ignoredIds === undefined)
|
|
1930
1938
|
return "unavailable";
|
|
1931
|
-
const joined = [...ignoredIds]
|
|
1939
|
+
const joined = [...ignoredIds]
|
|
1940
|
+
.sort((a, b) => a.localeCompare(b))
|
|
1941
|
+
.join("\u0000");
|
|
1932
1942
|
return createHash("sha256").update(joined).digest("hex");
|
|
1933
1943
|
}
|
|
1934
1944
|
/** Assemble the checkpoint DTO from the current PRE-resolution graph. Isolated
|
|
@@ -2553,7 +2563,8 @@ function addJsTsFile(graph, cwd, filePath, facts, ignoredIds) {
|
|
|
2553
2563
|
// lens-map performs the separate presentation-level twin merge.
|
|
2554
2564
|
const warmCallCoverage = facts.getFileFact(normalized, "file.functionFactsCoverage") ??
|
|
2555
2565
|
"unavailable";
|
|
2556
|
-
const importCoverage = facts.getFileFact(normalized, "file.importFactsCoverage") ??
|
|
2566
|
+
const importCoverage = facts.getFileFact(normalized, "file.importFactsCoverage") ??
|
|
2567
|
+
"unavailable";
|
|
2557
2568
|
addNode(graph, {
|
|
2558
2569
|
id: fileNodeId,
|
|
2559
2570
|
kind: "file",
|
|
@@ -2877,10 +2888,8 @@ export async function captureReviewGraphStructuralIr(filePath, cwd, content, fac
|
|
|
2877
2888
|
const parsed = await withTreeSitterRoot(filePath, content, () => true);
|
|
2878
2889
|
if (!parsed.parsed)
|
|
2879
2890
|
return { complete: false };
|
|
2880
|
-
const functionCoverage = facts.getFileFact(filePath, "file.functionFactsCoverage") ??
|
|
2881
|
-
|
|
2882
|
-
const importCoverage = facts.getFileFact(filePath, "file.importFactsCoverage") ??
|
|
2883
|
-
"unavailable";
|
|
2891
|
+
const functionCoverage = facts.getFileFact(filePath, "file.functionFactsCoverage") ?? "unavailable";
|
|
2892
|
+
const importCoverage = facts.getFileFact(filePath, "file.importFactsCoverage") ?? "unavailable";
|
|
2884
2893
|
const coverage = {
|
|
2885
2894
|
definitions: functionCoverage,
|
|
2886
2895
|
references: functionCoverage,
|
|
@@ -4099,6 +4108,10 @@ async function _doBuildGraph(cwd, changedFiles, facts, seqHint, buildId) {
|
|
|
4099
4108
|
fileCount: filesToBuild.length,
|
|
4100
4109
|
durationMs: Date.now() - extractionStartedAt,
|
|
4101
4110
|
stats,
|
|
4111
|
+
// #1982: this scope never runs an ast-grep pass (extraction is
|
|
4112
|
+
// tree-sitter only), so durationMs carries none and explicit
|
|
4113
|
+
// zeros keep every cache_stats record uniformly parseable.
|
|
4114
|
+
astGrep: { durationMs: 0, fileCount: 0 },
|
|
4102
4115
|
});
|
|
4103
4116
|
});
|
|
4104
4117
|
}
|
|
@@ -4326,12 +4339,15 @@ export function extractSymbolsAndRefsFromGraph(graph) {
|
|
|
4326
4339
|
unsupportedEvidence: 0,
|
|
4327
4340
|
sameFileEvidence: 0,
|
|
4328
4341
|
duplicateEvidence: 0,
|
|
4329
|
-
complete: graph.persistCoverage?.partial !== true &&
|
|
4342
|
+
complete: graph.persistCoverage?.partial !== true &&
|
|
4343
|
+
graph.persistCoverage?.inProgress !== true,
|
|
4330
4344
|
languages: {},
|
|
4331
4345
|
};
|
|
4332
4346
|
const numberMetadata = (node, key) => {
|
|
4333
4347
|
const value = node?.metadata?.[key];
|
|
4334
|
-
return typeof value === "number" && Number.isFinite(value)
|
|
4348
|
+
return typeof value === "number" && Number.isFinite(value)
|
|
4349
|
+
? value
|
|
4350
|
+
: undefined;
|
|
4335
4351
|
};
|
|
4336
4352
|
const symbolKind = (node) => {
|
|
4337
4353
|
switch (node.symbolKind) {
|
|
@@ -4399,14 +4415,21 @@ export function extractSymbolsAndRefsFromGraph(graph) {
|
|
|
4399
4415
|
: metadata.referenceKind === "type"
|
|
4400
4416
|
? "type"
|
|
4401
4417
|
: "unknown";
|
|
4402
|
-
const resolution = edge.resolution ??
|
|
4418
|
+
const resolution = edge.resolution ??
|
|
4419
|
+
(targetNode && !targetNode.metadata?.unresolvedName
|
|
4420
|
+
? "exact"
|
|
4421
|
+
: "unresolved");
|
|
4403
4422
|
const targetSymbol = nodeSymbols.get(edge.to);
|
|
4404
4423
|
const targetName = targetNode?.symbolName ??
|
|
4405
4424
|
(edge.to.startsWith("symbol-name:")
|
|
4406
4425
|
? edge.to.slice("symbol-name:".length)
|
|
4407
4426
|
: undefined);
|
|
4408
|
-
const line = typeof metadata.line === "number"
|
|
4409
|
-
|
|
4427
|
+
const line = typeof metadata.line === "number"
|
|
4428
|
+
? metadata.line
|
|
4429
|
+
: (numberMetadata(fromNode, "line") ?? 1);
|
|
4430
|
+
const column = typeof metadata.column === "number"
|
|
4431
|
+
? metadata.column
|
|
4432
|
+
: (numberMetadata(fromNode, "column") ?? 1);
|
|
4410
4433
|
addRef({
|
|
4411
4434
|
symbolId: targetName ? `${callerFile}:${targetName}` : edge.to,
|
|
4412
4435
|
filePath: callerFile,
|
|
@@ -4427,7 +4450,9 @@ export function extractSymbolsAndRefsFromGraph(graph) {
|
|
|
4427
4450
|
coverage.typeOnlyEvidence++;
|
|
4428
4451
|
else if (referenceKind !== "call")
|
|
4429
4452
|
coverage.unsupportedEvidence++;
|
|
4430
|
-
else if (!targetSymbol ||
|
|
4453
|
+
else if (!targetSymbol ||
|
|
4454
|
+
resolution === "name-only" ||
|
|
4455
|
+
resolution === "unresolved") {
|
|
4431
4456
|
coverage.unresolvedEvidence++;
|
|
4432
4457
|
}
|
|
4433
4458
|
else {
|
|
@@ -49,7 +49,11 @@ function resolveGitDir(cwd) {
|
|
|
49
49
|
continue;
|
|
50
50
|
}
|
|
51
51
|
if (stat.isDirectory()) {
|
|
52
|
-
return {
|
|
52
|
+
return {
|
|
53
|
+
gitDir: gitPath,
|
|
54
|
+
commonDir: readCommonDir(gitPath),
|
|
55
|
+
worktreeRoot: dir,
|
|
56
|
+
};
|
|
53
57
|
}
|
|
54
58
|
if (stat.isFile()) {
|
|
55
59
|
// Linked worktree: ".git" is a file with a single "gitdir: <path>" line.
|
|
@@ -129,7 +133,9 @@ export function resolveGitIdentity(cwd) {
|
|
|
129
133
|
const resolved = getResolvedGitDir(cwd);
|
|
130
134
|
if (!resolved)
|
|
131
135
|
return undefined;
|
|
132
|
-
const headRaw = fs
|
|
136
|
+
const headRaw = fs
|
|
137
|
+
.readFileSync(path.join(resolved.gitDir, "HEAD"), "utf-8")
|
|
138
|
+
.trim();
|
|
133
139
|
const refMatch = headRaw.match(/^ref:\s*(.+)$/);
|
|
134
140
|
let headCommit;
|
|
135
141
|
if (refMatch) {
|
|
@@ -130,7 +130,16 @@ function jsTsExtensionCandidates(base, strippedBase, ext) {
|
|
|
130
130
|
// The literal specifier path (covers both "no extension in the specifier"
|
|
131
131
|
// — base === strippedBase — and the compiled/as-written extension itself).
|
|
132
132
|
candidates.push(base, `${strippedBase}.js`, `${strippedBase}.jsx`, `${strippedBase}.mjs`, `${strippedBase}.cjs`);
|
|
133
|
-
for (const index of [
|
|
133
|
+
for (const index of [
|
|
134
|
+
"index.ts",
|
|
135
|
+
"index.tsx",
|
|
136
|
+
"index.mts",
|
|
137
|
+
"index.cts",
|
|
138
|
+
"index.js",
|
|
139
|
+
"index.jsx",
|
|
140
|
+
"index.mjs",
|
|
141
|
+
"index.cjs",
|
|
142
|
+
]) {
|
|
134
143
|
candidates.push(path.join(base, index));
|
|
135
144
|
}
|
|
136
145
|
return [...new Set(candidates)];
|
|
@@ -103,7 +103,8 @@ function describeMissingNode(graph, normalizedFile) {
|
|
|
103
103
|
sameDirSibling ??= known;
|
|
104
104
|
// A same-stem twin in the same directory is the strongest hint —
|
|
105
105
|
// an extension/compiled-twin resolution miss rather than an absent file.
|
|
106
|
-
if (sameStemTwin === undefined &&
|
|
106
|
+
if (sameStemTwin === undefined &&
|
|
107
|
+
knownBase.replace(/\.[^./]*$/, "") === stem) {
|
|
107
108
|
sameStemTwin = known;
|
|
108
109
|
}
|
|
109
110
|
}
|
|
@@ -118,7 +118,7 @@ function readConfig(configPath, seen) {
|
|
|
118
118
|
const options = json.compilerOptions;
|
|
119
119
|
const baseUrl = typeof options?.baseUrl === "string"
|
|
120
120
|
? path.resolve(path.dirname(normalized), options.baseUrl)
|
|
121
|
-
: inherited?.baseUrl ?? path.dirname(normalized);
|
|
121
|
+
: (inherited?.baseUrl ?? path.dirname(normalized));
|
|
122
122
|
const paths = options?.paths && typeof options.paths === "object"
|
|
123
123
|
? Object.fromEntries(Object.entries(options.paths).map(([pattern, targets]) => [
|
|
124
124
|
pattern,
|
|
@@ -274,7 +274,9 @@ export function aliasedImportTargets(specifier, importerDir) {
|
|
|
274
274
|
export function referencedProjectImportTarget(specifier, importerDir) {
|
|
275
275
|
const normalizedImporterDir = path.resolve(importerDir);
|
|
276
276
|
const governingDir = findGoverningTsconfigDir(normalizedImporterDir);
|
|
277
|
-
const governingPath = governingDir
|
|
277
|
+
const governingPath = governingDir
|
|
278
|
+
? path.join(governingDir, "tsconfig.json")
|
|
279
|
+
: "";
|
|
278
280
|
const key = `${normalizedImporterDir}|${governingPath}|${governingPath ? dependencySignature(governingPath) : "missing"}`;
|
|
279
281
|
let projects = referencesCache.get(key);
|
|
280
282
|
if (!projects) {
|
|
@@ -100,7 +100,7 @@ function expandWorkspacePattern(cwd, pattern) {
|
|
|
100
100
|
return [];
|
|
101
101
|
}
|
|
102
102
|
const ignoreMatcher = getProjectIgnoreMatcher(cwd);
|
|
103
|
-
return entries
|
|
103
|
+
return (entries
|
|
104
104
|
.filter((entry) => {
|
|
105
105
|
const fullPath = path.join(baseDir, entry.name);
|
|
106
106
|
return (entry.isDirectory() &&
|
|
@@ -113,7 +113,7 @@ function expandWorkspacePattern(cwd, pattern) {
|
|
|
113
113
|
.map((entry) => path.join(baseDir, entry.name))
|
|
114
114
|
.filter((root) => fs.existsSync(path.join(root, "package.json")) ||
|
|
115
115
|
fs.existsSync(path.join(root, "Cargo.toml")) ||
|
|
116
|
-
fs.existsSync(path.join(root, "go.mod")));
|
|
116
|
+
fs.existsSync(path.join(root, "go.mod"))));
|
|
117
117
|
}
|
|
118
118
|
function depsFromPackageJson(pkgJson) {
|
|
119
119
|
return Object.keys({
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { createSubsystemLogger } from "./extension-log.js";
|
|
11
11
|
import * as fs from "node:fs";
|
|
12
12
|
import * as path from "node:path";
|
|
13
|
-
import { createAvailabilityChecker, resolveAvailableOrInstall } from "./dispatch/runners/utils/runner-helpers.js";
|
|
13
|
+
import { createAvailabilityChecker, resolveAvailableOrInstall, } from "./dispatch/runners/utils/runner-helpers.js";
|
|
14
14
|
import { isFileKind } from "./file-kinds.js";
|
|
15
15
|
import { safeSpawnAsync } from "./safe-spawn.js";
|
|
16
16
|
import { ruffConfigArgs } from "./tool-policy.js";
|
|
@@ -20,9 +20,7 @@ export class RuffClient {
|
|
|
20
20
|
ruffCommand = "ruff";
|
|
21
21
|
log;
|
|
22
22
|
constructor(verbose = false) {
|
|
23
|
-
this.log = verbose
|
|
24
|
-
? createSubsystemLogger("ruff")
|
|
25
|
-
: () => { };
|
|
23
|
+
this.log = verbose ? createSubsystemLogger("ruff") : () => { };
|
|
26
24
|
}
|
|
27
25
|
/**
|
|
28
26
|
* Check if ruff CLI is available, auto-install if not.
|
|
@@ -74,7 +72,10 @@ export class RuffClient {
|
|
|
74
72
|
// set when the project lacks its own config and the package-owned
|
|
75
73
|
// core.toml fallback applies.
|
|
76
74
|
const configArgs = ruffConfigArgs(cwd ?? path.dirname(absolutePath));
|
|
77
|
-
const spawnOpts = {
|
|
75
|
+
const spawnOpts = {
|
|
76
|
+
timeout: 10000,
|
|
77
|
+
cwd: cwd ?? path.dirname(absolutePath),
|
|
78
|
+
};
|
|
78
79
|
const pre = await safeSpawnAsync(this.ruffCommand, [
|
|
79
80
|
"check",
|
|
80
81
|
"--output-format",
|
|
@@ -6,11 +6,10 @@ import { publishAutofixStart, publishFormatStart, } from "./format-events-publis
|
|
|
6
6
|
import { logLatency } from "./latency-logger.js";
|
|
7
7
|
import { isPathIgnoredByProject } from "./file-utils.js";
|
|
8
8
|
import { admitBounded, emitBounded } from "./bounded-telemetry.js";
|
|
9
|
-
import { newLspMutationCorrelationId } from "./lsp-mutation.js";
|
|
9
|
+
import { newLspMutationCorrelationId, } from "./lsp-mutation.js";
|
|
10
10
|
import { getGlobalActionableWarningMaxFixes, } from "./lens-config.js";
|
|
11
11
|
import { resyncLspFile, runAutofix, runFormatPhase } from "./pipeline.js";
|
|
12
12
|
import { getAmbientAbortSignal } from "./safe-spawn.js";
|
|
13
|
-
import { appendProjectChange, } from "./project-changes.js";
|
|
14
13
|
import { getAutofixPolicyForFile, hasBiomeConfig, hasDetektConfig, hasEslintConfig, hasGolangciConfig, hasKtfmtConfig, hasKtlintConfig, hasOxlintConfig, hasRubocopConfig, hasSqlfluffConfig, hasStylelintConfig, } from "./tool-policy.js";
|
|
15
14
|
/**
|
|
16
15
|
* A queued file is claimed by any flush once it has sat unclaimed by its own
|
|
@@ -23,24 +22,15 @@ import { getAutofixPolicyForFile, hasBiomeConfig, hasDetektConfig, hasEslintConf
|
|
|
23
22
|
export const DEFERRED_FORMAT_STALE_AFTER_MS = 10 * 60_000;
|
|
24
23
|
const DEFERRED_FORMAT_CONCURRENCY = 3;
|
|
25
24
|
function recordProjectChange(args) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
turnIndex: args.runtime.turnIndex,
|
|
36
|
-
source: args.source,
|
|
37
|
-
filePath: path.resolve(args.filePath),
|
|
38
|
-
fileSeq,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
catch (err) {
|
|
42
|
-
args.dbg(`project change log append failed for ${args.filePath}: ${err}`);
|
|
43
|
-
}
|
|
25
|
+
// One mutation seam (#2000 phase 1): bump + receipt + change-log live in
|
|
26
|
+
// RuntimeCoordinator.recordProjectMutation; this wrapper only carries the
|
|
27
|
+
// legacy dbg shape.
|
|
28
|
+
args.runtime.recordProjectMutation?.({
|
|
29
|
+
filePath: args.filePath,
|
|
30
|
+
source: args.source,
|
|
31
|
+
cwd: args.cwd,
|
|
32
|
+
onAppendError: (err) => args.dbg(`project change log append failed for ${args.filePath}: ${err}`),
|
|
33
|
+
});
|
|
44
34
|
}
|
|
45
35
|
export async function handleAgentEnd({ ctxCwd, getFlag, getFlagSource, notify, dbg, runtime, cacheManager, getFormatService, biomeClient, ruffClient, getAutofixClients, currentSessionId, staleAfterMs = DEFERRED_FORMAT_STALE_AFTER_MS, }) {
|
|
46
36
|
// #791: ownership-filtered drain — records queued by a DIFFERENT known
|
|
@@ -213,7 +203,9 @@ export async function handleAgentEnd({ ctxCwd, getFlag, getFlagSource, notify, d
|
|
|
213
203
|
const ambientSignal = getAmbientAbortSignal();
|
|
214
204
|
const executedAutofixScopes = new Set();
|
|
215
205
|
const autofixRecords = records.filter((candidate) => candidate.kinds.has("autofix"));
|
|
216
|
-
if (autofixRecords.length > 0 &&
|
|
206
|
+
if (autofixRecords.length > 0 &&
|
|
207
|
+
(!biomeClient || !ruffClient) &&
|
|
208
|
+
getAutofixClients) {
|
|
217
209
|
({ biomeClient, ruffClient } = await getAutofixClients());
|
|
218
210
|
}
|
|
219
211
|
for (let autofixIndex = 0; autofixIndex < autofixRecords.length; autofixIndex++) {
|
|
@@ -233,7 +225,13 @@ export async function handleAgentEnd({ ctxCwd, getFlag, getFlagSource, notify, d
|
|
|
233
225
|
}
|
|
234
226
|
if (!biomeClient || !ruffClient) {
|
|
235
227
|
dbg(`agent_end deferred_autofix: clients unavailable for ${filePath}`);
|
|
236
|
-
requeue([
|
|
228
|
+
requeue([
|
|
229
|
+
{
|
|
230
|
+
...record,
|
|
231
|
+
kinds: new Set(["autofix"]),
|
|
232
|
+
toolNames: new Set(record.toolNames),
|
|
233
|
+
},
|
|
234
|
+
], "clients-unavailable");
|
|
237
235
|
continue;
|
|
238
236
|
}
|
|
239
237
|
const policy = getAutofixPolicyForFile(filePath, {
|
|
@@ -261,10 +259,20 @@ export async function handleAgentEnd({ ctxCwd, getFlag, getFlagSource, notify, d
|
|
|
261
259
|
const changedPath = path.resolve(changed);
|
|
262
260
|
deferredAutofixChanged.add(changedPath);
|
|
263
261
|
for (const tool of tools)
|
|
264
|
-
deferredAutofixFixes.push({
|
|
262
|
+
deferredAutofixFixes.push({
|
|
263
|
+
path: changedPath,
|
|
264
|
+
tool,
|
|
265
|
+
kind: "autofix",
|
|
266
|
+
});
|
|
265
267
|
if (!nodeFs.existsSync(changedPath))
|
|
266
268
|
continue;
|
|
267
|
-
recordProjectChange({
|
|
269
|
+
recordProjectChange({
|
|
270
|
+
runtime,
|
|
271
|
+
cwd: record.turnStateCwd,
|
|
272
|
+
filePath: changedPath,
|
|
273
|
+
source: "autofix",
|
|
274
|
+
dbg,
|
|
275
|
+
});
|
|
268
276
|
if (!getFlag("no-read-guard"))
|
|
269
277
|
runtime.readGuard.recordWritten(changedPath);
|
|
270
278
|
const content = nodeFs.readFileSync(changedPath, "utf-8");
|
|
@@ -274,7 +282,13 @@ export async function handleAgentEnd({ ctxCwd, getFlag, getFlagSource, notify, d
|
|
|
274
282
|
catch (err) {
|
|
275
283
|
const message = err instanceof Error ? err.message : String(err);
|
|
276
284
|
summary.failed.push({ filePath, errors: [message] });
|
|
277
|
-
requeue([
|
|
285
|
+
requeue([
|
|
286
|
+
{
|
|
287
|
+
...record,
|
|
288
|
+
kinds: new Set(["autofix"]),
|
|
289
|
+
toolNames: new Set(record.toolNames),
|
|
290
|
+
},
|
|
291
|
+
], "autofix-failed");
|
|
278
292
|
}
|
|
279
293
|
}
|
|
280
294
|
if (deferredAutofixFixes.length > 0) {
|
|
@@ -319,7 +333,9 @@ export async function handleAgentEnd({ ctxCwd, getFlag, getFlagSource, notify, d
|
|
|
319
333
|
kinds: [...new Set(records.flatMap((record) => [...record.kinds]))],
|
|
320
334
|
});
|
|
321
335
|
}
|
|
322
|
-
const formatRecords = records
|
|
336
|
+
const formatRecords = records
|
|
337
|
+
.filter((record) => record.kinds.has("format"))
|
|
338
|
+
.filter((record) => {
|
|
323
339
|
const disabled = !!getFlag("no-autoformat", record.filePath);
|
|
324
340
|
if (disabled) {
|
|
325
341
|
const source = getFlagSource?.("no-autoformat", record.filePath);
|
|
@@ -368,7 +384,9 @@ export async function handleAgentEnd({ ctxCwd, getFlag, getFlagSource, notify, d
|
|
|
368
384
|
};
|
|
369
385
|
await Promise.all(Array.from({ length: Math.min(DEFERRED_FORMAT_CONCURRENCY, formatRecords.length) }, () => worker()));
|
|
370
386
|
if (ambientSignal?.aborted) {
|
|
371
|
-
requeue(formatRecords
|
|
387
|
+
requeue(formatRecords
|
|
388
|
+
.filter((_, index) => !started.has(index))
|
|
389
|
+
.map((record) => ({
|
|
372
390
|
...record,
|
|
373
391
|
kinds: new Set(["format"]),
|
|
374
392
|
toolNames: new Set(record.toolNames),
|
|
@@ -389,7 +407,13 @@ export async function handleAgentEnd({ ctxCwd, getFlag, getFlagSource, notify, d
|
|
|
389
407
|
if (entry.error) {
|
|
390
408
|
dbg(`agent_end deferred_format failed for ${filePath}: ${entry.error}`);
|
|
391
409
|
summary.failed.push({ filePath, errors: [entry.error] });
|
|
392
|
-
requeue([
|
|
410
|
+
requeue([
|
|
411
|
+
{
|
|
412
|
+
...record,
|
|
413
|
+
kinds: new Set(["format"]),
|
|
414
|
+
toolNames: new Set(record.toolNames),
|
|
415
|
+
},
|
|
416
|
+
], "format-failed");
|
|
393
417
|
continue;
|
|
394
418
|
}
|
|
395
419
|
const result = entry.result;
|
|
@@ -398,7 +422,13 @@ export async function handleAgentEnd({ ctxCwd, getFlag, getFlagSource, notify, d
|
|
|
398
422
|
summary.formatted++;
|
|
399
423
|
if (result.formatFailures.length > 0) {
|
|
400
424
|
summary.failed.push({ filePath, errors: result.formatFailures });
|
|
401
|
-
requeue([
|
|
425
|
+
requeue([
|
|
426
|
+
{
|
|
427
|
+
...record,
|
|
428
|
+
kinds: new Set(["format"]),
|
|
429
|
+
toolNames: new Set(record.toolNames),
|
|
430
|
+
},
|
|
431
|
+
], "format-failed");
|
|
402
432
|
}
|
|
403
433
|
if (result.formatChanged) {
|
|
404
434
|
summary.changed.push(filePath);
|
|
@@ -560,7 +590,9 @@ export async function handleAgentEnd({ ctxCwd, getFlag, getFlagSource, notify, d
|
|
|
560
590
|
cacheManager,
|
|
561
591
|
readGuard: getFlag("no-read-guard") ? undefined : runtime.readGuard,
|
|
562
592
|
recordAutofix: getFlag("lens-turn-summary")
|
|
563
|
-
? (filePath) => runtime.turnSummary.recordAutofix(filePath, {
|
|
593
|
+
? (filePath) => runtime.turnSummary.recordAutofix(filePath, {
|
|
594
|
+
tool: "lsp-quickfix",
|
|
595
|
+
})
|
|
564
596
|
: undefined,
|
|
565
597
|
dbg,
|
|
566
598
|
};
|
|
@@ -616,7 +648,7 @@ export async function handleAgentEnd({ ctxCwd, getFlag, getFlagSource, notify, d
|
|
|
616
648
|
autofixRecords: autofixRecords.length,
|
|
617
649
|
formatRecords: formatRecords.length,
|
|
618
650
|
coalescedPaths: records.length,
|
|
619
|
-
requeuedKinds: [...requeuedKinds].sort((a, b) =>
|
|
651
|
+
requeuedKinds: [...requeuedKinds].sort((a, b) => a < b ? -1 : a > b ? 1 : 0),
|
|
620
652
|
},
|
|
621
653
|
});
|
|
622
654
|
logLatency({
|
|
@@ -58,7 +58,9 @@ export function peekTurnEndFindings(cacheManager, cwd, runtime, logDelivery = fa
|
|
|
58
58
|
if (validation.allFilesDeleted)
|
|
59
59
|
return;
|
|
60
60
|
return {
|
|
61
|
-
messages: [
|
|
61
|
+
messages: [
|
|
62
|
+
turnEndMessage(findings.data.content, validation.status === "current", findings.data.provenance),
|
|
63
|
+
],
|
|
62
64
|
};
|
|
63
65
|
}
|
|
64
66
|
export function consumeTurnEndFindings(cacheManager, cwd, runtime) {
|
|
@@ -80,7 +82,9 @@ export function consumeTurnEndFindings(cacheManager, cwd, runtime) {
|
|
|
80
82
|
if (validation.allFilesDeleted)
|
|
81
83
|
return;
|
|
82
84
|
return {
|
|
83
|
-
messages: [
|
|
85
|
+
messages: [
|
|
86
|
+
turnEndMessage(findings.data.content, validation.status === "current", findings.data.provenance),
|
|
87
|
+
],
|
|
84
88
|
};
|
|
85
89
|
}
|
|
86
90
|
/** Read test findings without consuming them; used by acknowledged IPC delivery. */
|
|
@@ -118,7 +122,10 @@ export function consumeTestFindings(cacheManager, cwd, runtime) {
|
|
|
118
122
|
// one-shot advisory with stale results. An empty-content record peeks as
|
|
119
123
|
// undelivered while keeping late-generation ordering intact.
|
|
120
124
|
const priorGeneration = cacheManager.readCache("test-runner-findings", cwd)?.data?.testRunGeneration;
|
|
121
|
-
cacheManager.writeCache("test-runner-findings", {
|
|
125
|
+
cacheManager.writeCache("test-runner-findings", {
|
|
126
|
+
content: "",
|
|
127
|
+
testRunGeneration: priorGeneration,
|
|
128
|
+
}, cwd);
|
|
122
129
|
return findings;
|
|
123
130
|
}
|
|
124
131
|
/** Complete an acknowledged MCP delivery without re-validating or re-rendering it. */
|
|
@@ -126,7 +133,8 @@ export function acknowledgeTurnEndFindings(cacheManager, cwd) {
|
|
|
126
133
|
const findings = cacheManager.readCache("turn-end-findings", cwd);
|
|
127
134
|
if (!findings?.data?.content || findings.data.consumed === true)
|
|
128
135
|
return;
|
|
129
|
-
if (findings.data.hasBlockers === true &&
|
|
136
|
+
if (findings.data.hasBlockers === true &&
|
|
137
|
+
typeof findings.data.sessionId === "string") {
|
|
130
138
|
cacheManager.writeCache("turn-end-findings", { ...findings.data, consumed: true }, cwd);
|
|
131
139
|
}
|
|
132
140
|
else {
|