@herbertgao/pi-extensions 2026.9.1 → 2026.9.3

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.
Files changed (341) hide show
  1. package/README.md +3 -2
  2. package/THIRD_PARTY_NOTICES.md +24 -0
  3. package/node_modules/@herbertgao/sol-pi/LICENSE +19 -0
  4. package/node_modules/@herbertgao/sol-pi/README.md +159 -0
  5. package/node_modules/@herbertgao/sol-pi/SECURITY.md +26 -0
  6. package/node_modules/@herbertgao/sol-pi/THIRD_PARTY_NOTICES.md +19 -0
  7. package/node_modules/@herbertgao/sol-pi/agents-install.md +150 -0
  8. package/node_modules/@herbertgao/sol-pi/assets/sol-pi-hero.png +0 -0
  9. package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +69 -0
  10. package/node_modules/@herbertgao/sol-pi/docs/configuration.md +75 -0
  11. package/node_modules/@herbertgao/sol-pi/package.json +76 -0
  12. package/node_modules/@herbertgao/sol-pi/scripts/check-pi-compat.mjs +32 -0
  13. package/node_modules/@herbertgao/sol-pi/scripts/check-sol-pi-config.mjs +120 -0
  14. package/node_modules/@herbertgao/sol-pi/sol-pi.example.json +10 -0
  15. package/node_modules/@herbertgao/sol-pi/src/sol-pi/config.ts +135 -0
  16. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/file-queue.ts +74 -0
  17. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/index.ts +185 -0
  18. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/then-run.ts +128 -0
  19. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/archive.ts +53 -0
  20. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/candidate.ts +101 -0
  21. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/config.ts +71 -0
  22. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/index.ts +220 -0
  23. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/journal.ts +25 -0
  24. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/provider.ts +164 -0
  25. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/receipt.ts +177 -0
  26. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/observation-pack/index.ts +227 -0
  27. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/observation-pack/ledger.ts +20 -0
  28. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/observation-pack/observation.ts +252 -0
  29. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/economics.ts +237 -0
  30. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/extension.ts +455 -0
  31. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/index.ts +49 -0
  32. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/plan.ts +79 -0
  33. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/state.ts +208 -0
  34. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/tools.ts +100 -0
  35. package/node_modules/@herbertgao/sol-pi/src/sol-pi/index.ts +42 -0
  36. package/node_modules/@herbertgao/sol-pi/src/sol-pi/runtime-paths.ts +17 -0
  37. package/node_modules/@herbertgao/sol-pi/src/sol-pi/tui.ts +71 -0
  38. package/node_modules/@narumitw/pi-btw/README.md +57 -141
  39. package/node_modules/@narumitw/pi-btw/dist/index.ts +478 -43
  40. package/node_modules/@narumitw/pi-btw/dist/index.ts.map +4 -4
  41. package/node_modules/@narumitw/pi-btw/docs/workflows.md +74 -0
  42. package/node_modules/@narumitw/pi-btw/package.json +2 -1
  43. package/node_modules/@narumitw/pi-btw/src/btw.ts +28 -3
  44. package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +32 -2
  45. package/node_modules/@narumitw/pi-btw/src/keybindings.ts +330 -0
  46. package/node_modules/@narumitw/pi-btw/src/menu.ts +136 -19
  47. package/node_modules/@narumitw/pi-btw/src/settings.ts +32 -0
  48. package/node_modules/@narumitw/pi-btw/src/side-thread.ts +57 -5
  49. package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +52 -30
  50. package/node_modules/pi-lens/CHANGELOG.md +260 -0
  51. package/node_modules/pi-lens/README.md +13 -8
  52. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +3 -1
  53. package/node_modules/pi-lens/dist/clients/actionable-warnings-logger.js +0 -7
  54. package/node_modules/pi-lens/dist/clients/advisory-provenance.js +1 -1
  55. package/node_modules/pi-lens/dist/clients/analysed-root.js +1 -0
  56. package/node_modules/pi-lens/dist/clients/ast-grep-client.js +1 -1
  57. package/node_modules/pi-lens/dist/clients/ast-grep-tool-logger.js +1 -8
  58. package/node_modules/pi-lens/dist/clients/ast-grep-types.js +2 -0
  59. package/node_modules/pi-lens/dist/clients/bash-file-access.js +133 -1
  60. package/node_modules/pi-lens/dist/clients/biome-client.js +13 -2
  61. package/node_modules/pi-lens/dist/clients/blocker-freshness.js +0 -6
  62. package/node_modules/pi-lens/dist/clients/bootstrap.js +4 -4
  63. package/node_modules/pi-lens/dist/clients/bounded-pid-file-lock.js +1 -1
  64. package/node_modules/pi-lens/dist/clients/bounded-telemetry.js +2 -5
  65. package/node_modules/pi-lens/dist/clients/bus-events-logger.js +1 -9
  66. package/node_modules/pi-lens/dist/clients/cache-observability.js +122 -6
  67. package/node_modules/pi-lens/dist/clients/cargo-manifest.js +2 -2
  68. package/node_modules/pi-lens/dist/clients/cascade-logger.js +0 -7
  69. package/node_modules/pi-lens/dist/clients/child-unref.js +1 -19
  70. package/node_modules/pi-lens/dist/clients/complexity-client.js +5 -0
  71. package/node_modules/pi-lens/dist/clients/config-core/index.js +11 -8
  72. package/node_modules/pi-lens/dist/clients/config-core/process-spec.js +1 -1
  73. package/node_modules/pi-lens/dist/clients/config-core/provenance.js +2 -9
  74. package/node_modules/pi-lens/dist/clients/config-core/records.js +1 -1
  75. package/node_modules/pi-lens/dist/clients/config-core/schema.js +3 -5
  76. package/node_modules/pi-lens/dist/clients/config-diagnostic-codes.js +3 -1
  77. package/node_modules/pi-lens/dist/clients/config-resolve.js +10 -7
  78. package/node_modules/pi-lens/dist/clients/config-schema.js +56 -2
  79. package/node_modules/pi-lens/dist/clients/config-warn.js +2 -2
  80. package/node_modules/pi-lens/dist/clients/dead-code-client.js +8 -1
  81. package/node_modules/pi-lens/dist/clients/dead-code-logger.js +0 -4
  82. package/node_modules/pi-lens/dist/clients/dependency-checker.js +5 -1
  83. package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +1 -1
  84. package/node_modules/pi-lens/dist/clients/diagnostic-logger.js +1 -1
  85. package/node_modules/pi-lens/dist/clients/dispatch/collect-later-tier.js +0 -4
  86. package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +38 -41
  87. package/node_modules/pi-lens/dist/clients/dispatch/facts/function-facts.js +1 -1
  88. package/node_modules/pi-lens/dist/clients/dispatch/facts/import-facts.js +5 -1
  89. package/node_modules/pi-lens/dist/clients/dispatch/integration.js +18 -1
  90. package/node_modules/pi-lens/dist/clients/dispatch/lazy.js +0 -6
  91. package/node_modules/pi-lens/dist/clients/dispatch/pending-runner-findings.js +1 -1
  92. package/node_modules/pi-lens/dist/clients/dispatch/plan.js +0 -3
  93. package/node_modules/pi-lens/dist/clients/dispatch/rules/high-complexity.js +2 -2
  94. package/node_modules/pi-lens/dist/clients/dispatch/rules/high-fan-out.js +1 -1
  95. package/node_modules/pi-lens/dist/clients/dispatch/runners/actionlint.js +2 -1
  96. package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +3 -1
  97. package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +2 -3
  98. package/node_modules/pi-lens/dist/clients/dispatch/runners/cpp-check.js +7 -2
  99. package/node_modules/pi-lens/dist/clients/dispatch/runners/credo.js +2 -1
  100. package/node_modules/pi-lens/dist/clients/dispatch/runners/cue-vet.js +2 -1
  101. package/node_modules/pi-lens/dist/clients/dispatch/runners/dart-analyze.js +2 -1
  102. package/node_modules/pi-lens/dist/clients/dispatch/runners/detekt.js +2 -1
  103. package/node_modules/pi-lens/dist/clients/dispatch/runners/dotnet-build.js +2 -1
  104. package/node_modules/pi-lens/dist/clients/dispatch/runners/elixir-check.js +2 -1
  105. package/node_modules/pi-lens/dist/clients/dispatch/runners/eslint.js +2 -1
  106. package/node_modules/pi-lens/dist/clients/dispatch/runners/fish-indent.js +2 -1
  107. package/node_modules/pi-lens/dist/clients/dispatch/runners/gleam-check.js +2 -1
  108. package/node_modules/pi-lens/dist/clients/dispatch/runners/go-vet.js +2 -1
  109. package/node_modules/pi-lens/dist/clients/dispatch/runners/golangci-lint.js +2 -1
  110. package/node_modules/pi-lens/dist/clients/dispatch/runners/hadolint.js +2 -1
  111. package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +3 -1
  112. package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-render.js +3 -2
  113. package/node_modules/pi-lens/dist/clients/dispatch/runners/htmlhint.js +2 -1
  114. package/node_modules/pi-lens/dist/clients/dispatch/runners/javac.js +2 -1
  115. package/node_modules/pi-lens/dist/clients/dispatch/runners/ktlint.js +2 -1
  116. package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +19 -1
  117. package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +3 -2
  118. package/node_modules/pi-lens/dist/clients/dispatch/runners/mypy.js +2 -1
  119. package/node_modules/pi-lens/dist/clients/dispatch/runners/oxlint.js +3 -1
  120. package/node_modules/pi-lens/dist/clients/dispatch/runners/php-lint.js +2 -1
  121. package/node_modules/pi-lens/dist/clients/dispatch/runners/phpstan.js +2 -1
  122. package/node_modules/pi-lens/dist/clients/dispatch/runners/prisma-validate.js +2 -1
  123. package/node_modules/pi-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +15 -11
  124. package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +2 -1
  125. package/node_modules/pi-lens/dist/clients/dispatch/runners/rubocop.js +2 -1
  126. package/node_modules/pi-lens/dist/clients/dispatch/runners/ruff.js +3 -3
  127. package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +12 -11
  128. package/node_modules/pi-lens/dist/clients/dispatch/runners/shellcheck.js +3 -2
  129. package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +2 -1
  130. package/node_modules/pi-lens/dist/clients/dispatch/runners/spellcheck.js +5 -3
  131. package/node_modules/pi-lens/dist/clients/dispatch/runners/spotbugs.js +2 -1
  132. package/node_modules/pi-lens/dist/clients/dispatch/runners/sqlfluff.js +3 -2
  133. package/node_modules/pi-lens/dist/clients/dispatch/runners/stylelint.js +3 -2
  134. package/node_modules/pi-lens/dist/clients/dispatch/runners/swiftlint.js +2 -1
  135. package/node_modules/pi-lens/dist/clients/dispatch/runners/taplo.js +2 -1
  136. package/node_modules/pi-lens/dist/clients/dispatch/runners/terragrunt.js +2 -1
  137. package/node_modules/pi-lens/dist/clients/dispatch/runners/tflint.js +2 -1
  138. package/node_modules/pi-lens/dist/clients/dispatch/runners/trivy-config.js +2 -1
  139. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/availability-policy.js +5 -0
  140. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/candidate-probe.js +2 -2
  141. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/diagnostic-parsers.js +1 -64
  142. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +8 -2
  143. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils.js +0 -21
  144. package/node_modules/pi-lens/dist/clients/dispatch/runners/vale.js +2 -1
  145. package/node_modules/pi-lens/dist/clients/dispatch/runners/yaml-rule-parser.js +2 -20
  146. package/node_modules/pi-lens/dist/clients/dispatch/runners/yamllint.js +5 -3
  147. package/node_modules/pi-lens/dist/clients/dispatch/runners/zig-check.js +2 -1
  148. package/node_modules/pi-lens/dist/clients/dispatch/utils/format-utils.js +2 -2
  149. package/node_modules/pi-lens/dist/clients/disposition-logger.js +0 -7
  150. package/node_modules/pi-lens/dist/clients/effective-config.js +12 -2
  151. package/node_modules/pi-lens/dist/clients/event-loop-monitor.js +2 -2
  152. package/node_modules/pi-lens/dist/clients/extension-log.js +2 -0
  153. package/node_modules/pi-lens/dist/clients/file-kinds.js +1 -38
  154. package/node_modules/pi-lens/dist/clients/file-role.js +18 -1
  155. package/node_modules/pi-lens/dist/clients/file-time.js +1 -1
  156. package/node_modules/pi-lens/dist/clients/file-utils.js +5 -1
  157. package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +4 -0
  158. package/node_modules/pi-lens/dist/clients/format-service.js +0 -1
  159. package/node_modules/pi-lens/dist/clients/formatters.js +66 -93
  160. package/node_modules/pi-lens/dist/clients/generated-artifacts.js +3 -4
  161. package/node_modules/pi-lens/dist/clients/generation-guard.js +4 -0
  162. package/node_modules/pi-lens/dist/clients/git-guard.js +5 -0
  163. package/node_modules/pi-lens/dist/clients/gitleaks-client.js +42 -6
  164. package/node_modules/pi-lens/dist/clients/govulncheck-client.js +48 -7
  165. package/node_modules/pi-lens/dist/clients/grammar-source.js +3 -3
  166. package/node_modules/pi-lens/dist/clients/installer/index.js +416 -61
  167. package/node_modules/pi-lens/dist/clients/installer/managed-tool-refresh.js +84 -18
  168. package/node_modules/pi-lens/dist/clients/instance-reaper.js +6 -6
  169. package/node_modules/pi-lens/dist/clients/jscpd-client.js +9 -1
  170. package/node_modules/pi-lens/dist/clients/knip-client.js +9 -2
  171. package/node_modules/pi-lens/dist/clients/language-profile.js +12 -11
  172. package/node_modules/pi-lens/dist/clients/language-registry.js +5 -1
  173. package/node_modules/pi-lens/dist/clients/latency-logger.js +7 -7
  174. package/node_modules/pi-lens/dist/clients/ledger-bounds.js +21 -1
  175. package/node_modules/pi-lens/dist/clients/lens-config.js +23 -0
  176. package/node_modules/pi-lens/dist/clients/lens-engine.js +3 -4
  177. package/node_modules/pi-lens/dist/clients/lens-events.js +1 -1
  178. package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +18 -0
  179. package/node_modules/pi-lens/dist/clients/lens-map.js +1 -1
  180. package/node_modules/pi-lens/dist/clients/log-cleanup.js +0 -36
  181. package/node_modules/pi-lens/dist/clients/lsp/client.js +4 -3
  182. package/node_modules/pi-lens/dist/clients/lsp/config.js +37 -7
  183. package/node_modules/pi-lens/dist/clients/lsp/diagnostic-binding.js +24 -1
  184. package/node_modules/pi-lens/dist/clients/lsp/document-drift.js +79 -1
  185. package/node_modules/pi-lens/dist/clients/lsp/edits.js +3 -3
  186. package/node_modules/pi-lens/dist/clients/lsp/index.js +491 -64
  187. package/node_modules/pi-lens/dist/clients/lsp/inferred-project.js +1 -1
  188. package/node_modules/pi-lens/dist/clients/lsp/language.js +0 -8
  189. package/node_modules/pi-lens/dist/clients/lsp/path-utils.js +1 -1
  190. package/node_modules/pi-lens/dist/clients/lsp/pending-aux-coverage.js +0 -2
  191. package/node_modules/pi-lens/dist/clients/lsp/server.js +62 -15
  192. package/node_modules/pi-lens/dist/clients/lsp/sync-kind.js +0 -1
  193. package/node_modules/pi-lens/dist/clients/lsp/tsserver-sync.js +5 -5
  194. package/node_modules/pi-lens/dist/clients/lsp/wait-policy/classification.js +6 -0
  195. package/node_modules/pi-lens/dist/clients/lsp/wait-policy/strategies.js +2 -1
  196. package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +37 -4
  197. package/node_modules/pi-lens/dist/clients/lsp-document-symbols.js +1 -1
  198. package/node_modules/pi-lens/dist/clients/mcp/analyze.js +3 -0
  199. package/node_modules/pi-lens/dist/clients/mcp/session.js +2 -0
  200. package/node_modules/pi-lens/dist/clients/metrics-history.js +28 -107
  201. package/node_modules/pi-lens/dist/clients/middle-man-analysis.js +1 -1
  202. package/node_modules/pi-lens/dist/clients/module-report.js +1 -1
  203. package/node_modules/pi-lens/dist/clients/mutating-tool.js +3 -3
  204. package/node_modules/pi-lens/dist/clients/mutation-attribution.js +3 -3
  205. package/node_modules/pi-lens/dist/clients/ndjson-logger.js +0 -4
  206. package/node_modules/pi-lens/dist/clients/observed-mutation.js +9 -9
  207. package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +2 -6
  208. package/node_modules/pi-lens/dist/clients/opengrep-client.js +2 -0
  209. package/node_modules/pi-lens/dist/clients/opengrep-config.js +1 -1
  210. package/node_modules/pi-lens/dist/clients/package-manager.js +2 -1
  211. package/node_modules/pi-lens/dist/clients/path-utils.js +23 -2
  212. package/node_modules/pi-lens/dist/clients/performance-report.js +2 -2
  213. package/node_modules/pi-lens/dist/clients/php-cs-fixer-config.js +9 -4
  214. package/node_modules/pi-lens/dist/clients/pipeline.js +5 -4
  215. package/node_modules/pi-lens/dist/clients/project-changes.js +1 -1
  216. package/node_modules/pi-lens/dist/clients/project-diagnostics/extractors.js +1 -1
  217. package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +38 -10
  218. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/gitleaks.js +10 -9
  219. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/jscpd.js +1 -1
  220. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/knip.js +1 -1
  221. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/madge.js +1 -1
  222. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/opengrep.js +1 -1
  223. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +1 -1
  224. package/node_modules/pi-lens/dist/clients/project-lens-config.js +49 -1
  225. package/node_modules/pi-lens/dist/clients/project-scan-policy.js +3 -51
  226. package/node_modules/pi-lens/dist/clients/python-provenance.js +1 -1
  227. package/node_modules/pi-lens/dist/clients/read-guard-logger.js +3 -1
  228. package/node_modules/pi-lens/dist/clients/read-guard.js +5 -2
  229. package/node_modules/pi-lens/dist/clients/recent-touches.js +2 -2
  230. package/node_modules/pi-lens/dist/clients/review-graph/builder.js +3 -5
  231. package/node_modules/pi-lens/dist/clients/review-graph/import-resolvers.js +1 -1
  232. package/node_modules/pi-lens/dist/clients/review-graph-logger.js +2 -0
  233. package/node_modules/pi-lens/dist/clients/ruff-client.js +18 -9
  234. package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +10 -1
  235. package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +5 -0
  236. package/node_modules/pi-lens/dist/clients/runtime-session.js +58 -14
  237. package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +11 -1
  238. package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +4 -1
  239. package/node_modules/pi-lens/dist/clients/runtime-turn.js +48 -1
  240. package/node_modules/pi-lens/dist/clients/sanitize.js +0 -11
  241. package/node_modules/pi-lens/dist/clients/scan-utils.js +1 -56
  242. package/node_modules/pi-lens/dist/clients/security-scan-client.js +2 -2
  243. package/node_modules/pi-lens/dist/clients/session-event-guard.js +69 -1
  244. package/node_modules/pi-lens/dist/clients/session-summary.js +0 -24
  245. package/node_modules/pi-lens/dist/clients/sg-runner.js +2 -1
  246. package/node_modules/pi-lens/dist/clients/sgconfig.js +1 -5
  247. package/node_modules/pi-lens/dist/clients/shared-checkout-guard.js +1 -1
  248. package/node_modules/pi-lens/dist/clients/situational-tool-telemetry.js +108 -0
  249. package/node_modules/pi-lens/dist/clients/smells-rollup.js +2 -2
  250. package/node_modules/pi-lens/dist/clients/startup-scan.js +2 -10
  251. package/node_modules/pi-lens/dist/clients/test-runner-client.js +291 -76
  252. package/node_modules/pi-lens/dist/clients/test-runner-delivery.js +77 -72
  253. package/node_modules/pi-lens/dist/clients/tool-config.js +199 -0
  254. package/node_modules/pi-lens/dist/clients/tool-cwd.js +299 -0
  255. package/node_modules/pi-lens/dist/clients/tool-policy.js +1 -1
  256. package/node_modules/pi-lens/dist/clients/tool-probe.js +53 -0
  257. package/node_modules/pi-lens/dist/clients/tool-set-policy.js +42 -0
  258. package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +1 -52
  259. package/node_modules/pi-lens/dist/clients/trivy-client.js +9 -1
  260. package/node_modules/pi-lens/dist/clients/tui-fit.js +0 -4
  261. package/node_modules/pi-lens/dist/clients/turn-context.js +52 -0
  262. package/node_modules/pi-lens/dist/clients/user-notify.js +0 -4
  263. package/node_modules/pi-lens/dist/clients/widget-state.js +4 -3
  264. package/node_modules/pi-lens/dist/clients/word-index-logger.js +0 -7
  265. package/node_modules/pi-lens/dist/clients/word-index-store.js +3 -7
  266. package/node_modules/pi-lens/dist/clients/word-index.js +9 -16
  267. package/node_modules/pi-lens/dist/clients/zizmor-config.js +1 -1
  268. package/node_modules/pi-lens/dist/index.js +19969 -17481
  269. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +3 -2
  270. package/node_modules/pi-lens/dist/mcp/build-staleness.js +1 -1
  271. package/node_modules/pi-lens/dist/mcp/server.js +135 -159
  272. package/node_modules/pi-lens/dist/scripts/lib/process-scan.mjs +1 -1
  273. package/node_modules/pi-lens/dist/scripts/lib/skills-predicate.mjs +1 -1
  274. package/node_modules/pi-lens/dist/tools/activate-tools.js +10 -7
  275. package/node_modules/pi-lens/dist/tools/ast-grep-outline.js +2 -13
  276. package/node_modules/pi-lens/dist/tools/ast-grep-replace.js +8 -13
  277. package/node_modules/pi-lens/dist/tools/ast-grep-search.js +83 -39
  278. package/node_modules/pi-lens/dist/tools/effective-config.js +4 -3
  279. package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +1 -10
  280. package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +354 -86
  281. package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +54 -112
  282. package/node_modules/pi-lens/dist/tools/lsp-navigation.js +20 -44
  283. package/node_modules/pi-lens/dist/tools/lsp-structured-output.js +3 -3
  284. package/node_modules/pi-lens/dist/tools/module-report.js +5 -9
  285. package/node_modules/pi-lens/dist/tools/project-report.js +9 -17
  286. package/node_modules/pi-lens/dist/tools/render-compact.js +281 -2
  287. package/node_modules/pi-lens/dist/tools/symbol-search.js +3 -4
  288. package/node_modules/pi-lens/docs/agent-guide.md +3 -4
  289. package/node_modules/pi-lens/docs/agent-tools.md +46 -22
  290. package/node_modules/pi-lens/docs/configuration.md +9 -0
  291. package/node_modules/pi-lens/docs/environment-variables.md +0 -5
  292. package/node_modules/pi-lens/docs/features.md +5 -5
  293. package/node_modules/pi-lens/docs/globalconfig.md +31 -1
  294. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +9 -1
  295. package/node_modules/pi-lens/docs/mcp.md +13 -1
  296. package/node_modules/pi-lens/docs/pi-lens-fixer.md +71 -0
  297. package/node_modules/pi-lens/docs/pi-lens-investigator.md +15 -0
  298. package/node_modules/pi-lens/docs/pi-lens-monitor.md +88 -0
  299. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +41 -0
  300. package/node_modules/pi-lens/docs/pi-lens-subagent.md +21 -2
  301. package/node_modules/pi-lens/docs/public-api-stability.md +1 -0
  302. package/node_modules/pi-lens/docs/real-harness.md +46 -0
  303. package/node_modules/pi-lens/docs/release-qa-baseline.md +17 -5
  304. package/node_modules/pi-lens/docs/servercapabilities.md +2 -3
  305. package/node_modules/pi-lens/docs/settings.md +37 -2
  306. package/node_modules/pi-lens/docs/tools_improvement2.md +4 -4
  307. package/node_modules/pi-lens/docs/tree-sitter_rules_catalog.md +1 -1
  308. package/node_modules/pi-lens/docs/usage.md +13 -3
  309. package/node_modules/pi-lens/docs/word-index.md +1 -1
  310. package/node_modules/pi-lens/package.json +15 -15
  311. package/node_modules/pi-lens/rules/tree-sitter-queries/typescript/sql-injection.yml +7 -3
  312. package/node_modules/pi-lens/rules/typos/_typos.toml +4 -2
  313. package/node_modules/pi-lens/scripts/lib/skills-predicate.mjs +1 -1
  314. package/node_modules/pi-lens/scripts/lib/warm-loader-cache.mjs +1 -1
  315. package/node_modules/pi-lens/scripts/warm-loader-cache.mjs +4 -2
  316. package/node_modules/pi-lens/skills/pi-lens-ast-grep/SKILL.md +8 -6
  317. package/node_modules/pi-lens/skills/pi-lens-lsp-navigation/SKILL.md +19 -9
  318. package/node_modules/pi-web-access/CHANGELOG.md +29 -0
  319. package/node_modules/pi-web-access/README.md +33 -22
  320. package/node_modules/pi-web-access/abortable.ts +17 -0
  321. package/node_modules/pi-web-access/crawl4ai.ts +204 -0
  322. package/node_modules/pi-web-access/credential-source.ts +1 -0
  323. package/node_modules/pi-web-access/curator-page.ts +20 -2
  324. package/node_modules/pi-web-access/curator-run.ts +44 -0
  325. package/node_modules/pi-web-access/curator-server.ts +3 -1
  326. package/node_modules/pi-web-access/duckduckgo.ts +1 -1
  327. package/node_modules/pi-web-access/extract.ts +57 -12
  328. package/node_modules/pi-web-access/fetch-params.ts +1 -1
  329. package/node_modules/pi-web-access/gemini-search.ts +9 -5
  330. package/node_modules/pi-web-access/index.ts +25 -18
  331. package/node_modules/pi-web-access/openai-search.ts +35 -13
  332. package/node_modules/pi-web-access/package.json +2 -2
  333. package/node_modules/pi-web-access/page-query.ts +5 -2
  334. package/node_modules/pi-web-access/query-rewrite.ts +5 -2
  335. package/node_modules/pi-web-access/serpapi.ts +220 -0
  336. package/node_modules/pi-web-access/ssrf-protection.ts +5 -1
  337. package/node_modules/pi-web-access/storage.ts +10 -0
  338. package/node_modules/pi-web-access/summary-review.ts +34 -21
  339. package/node_modules/pi-web-access/utils.ts +6 -4
  340. package/package.json +7 -4
  341. package/node_modules/pi-lens/dist/tools/ast-dump.js +0 -103
@@ -2,17 +2,14 @@
2
2
  * Automatic test-runner delivery for the post-agent idle window (#2366).
3
3
  *
4
4
  * Test results remain in `test-runner-findings` for pull diagnostics and the
5
- * commit guard. This module only stages an owner-qualified pointer and
6
- * appends a non-context custom entry after the host proves that the agent is
5
+ * commit guard. This module stages an owner-qualified pointer and marks it
6
+ * eligible for the next context build after the host proves that the agent is
7
7
  * idle. Provenance validation stays in `peekTestFindings`, the one shared
8
8
  * delivery gate for this cache.
9
9
  */
10
10
  import { emitBounded } from "./bounded-telemetry.js";
11
- import { peekTestFindings } from "./runtime-context.js";
12
- import { fitLines } from "./tui-fit.js";
13
- export const TEST_RUNNER_ENTRY_TYPE = "pilens:test-runner-findings";
11
+ import { consumeTestFindings, peekTestFindings } from "./runtime-context.js";
14
12
  const MAX_PENDING_DELIVERIES = 32;
15
- const MAX_ENTRY_CONTENT = 12_000;
16
13
  const pending = new Map();
17
14
  function key(cwd, sessionId, ownerId) {
18
15
  // `cwd` comes from the same host session field at turn_end and settle. Keep
@@ -20,14 +17,6 @@ function key(cwd, sessionId, ownerId) {
20
17
  // identity; dispatch contexts already normalize their own path fields.
21
18
  return `${ownerId ?? "direct"}\u0000${cwd}\u0000${sessionId}`;
22
19
  }
23
- function boundedContent(content) {
24
- if (content.length <= MAX_ENTRY_CONTENT)
25
- return { content, droppedDetailCount: 0 };
26
- return {
27
- content: `${content.slice(0, MAX_ENTRY_CONTENT)}\n[…details truncated]`,
28
- droppedDetailCount: content.length - MAX_ENTRY_CONTENT,
29
- };
30
- }
31
20
  function record(identity, outcome, delivery, metadata = {}) {
32
21
  emitBounded("test_runner_delivery", identity, {
33
22
  filePath: delivery.cwd,
@@ -44,9 +33,7 @@ function record(identity, outcome, delivery, metadata = {}) {
44
33
  },
45
34
  }, {
46
35
  capPerTurn: { limit: 8, turnIndex: delivery.generation },
47
- ledgerKind: outcome === "delivery-failed" || outcome === "capability-unavailable"
48
- ? "test-runner-delivery"
49
- : undefined,
36
+ ledgerKind: outcome === "delivery-failed" ? "test-runner-delivery" : undefined,
50
37
  reason: `test runner delivery ${outcome}`,
51
38
  });
52
39
  }
@@ -70,6 +57,7 @@ export function stageTestRunnerDelivery(args) {
70
57
  generation: args.generation,
71
58
  targetCount: args.targetCount,
72
59
  createdAt: Date.now(),
60
+ eligible: false,
73
61
  owner: args.owner,
74
62
  };
75
63
  record(deliveryKey, "superseded", superseded, {
@@ -95,13 +83,14 @@ export function stageTestRunnerDelivery(args) {
95
83
  generation: args.generation,
96
84
  targetCount: args.targetCount,
97
85
  createdAt: Date.now(),
86
+ eligible: false,
98
87
  owner: args.owner,
99
88
  };
100
89
  pending.set(deliveryKey, delivery);
101
90
  prunePending();
102
91
  record(deliveryKey, "staged", delivery);
103
92
  }
104
- /** Deliver the latest staged result during a host-confirmed idle window. */
93
+ /** Mark the latest staged result eligible during a host-confirmed idle window. */
105
94
  export function deliverTestRunnerFindings(args) {
106
95
  const cwd = args.ctx.cwd ?? process.cwd();
107
96
  const deliveryKey = key(cwd, args.sessionId, args.ownerId);
@@ -112,16 +101,11 @@ export function deliverTestRunnerFindings(args) {
112
101
  if (currentGeneration !== undefined &&
113
102
  currentGeneration > delivery.generation) {
114
103
  pending.delete(deliveryKey);
115
- record(deliveryKey, "superseded", delivery, {
116
- currentGeneration,
117
- });
104
+ record(deliveryKey, "superseded", delivery, { currentGeneration });
118
105
  return;
119
106
  }
120
107
  if (typeof args.ctx.isIdle !== "function") {
121
108
  pending.delete(deliveryKey);
122
- record(deliveryKey, "capability-unavailable", delivery, {
123
- reason: "host does not expose ctx.isIdle",
124
- });
125
109
  return;
126
110
  }
127
111
  try {
@@ -136,14 +120,13 @@ export function deliverTestRunnerFindings(args) {
136
120
  });
137
121
  return;
138
122
  }
139
- const findings = peekTestFindings(args.cacheManager, cwd, args.runtime, true);
140
- if (!findings) {
123
+ if (!peekTestFindings(args.cacheManager, cwd, args.runtime, true)) {
141
124
  pending.delete(deliveryKey);
142
125
  record(deliveryKey, "superseded", delivery);
143
126
  return;
144
127
  }
145
- // Recheck immediately before append. The host may accept a prompt between
146
- // the first check and this synchronous call.
128
+ // Recheck immediately before marking eligible. The host may accept a prompt
129
+ // between the first check and this synchronous call.
147
130
  try {
148
131
  if (!args.ctx.isIdle()) {
149
132
  record(deliveryKey, "carried", delivery);
@@ -156,32 +139,23 @@ export function deliverTestRunnerFindings(args) {
156
139
  });
157
140
  return;
158
141
  }
159
- // SAFETY: appendEntry is an optional host capability absent from older Pi SDKs.
160
- const appendEntry = args.pi.appendEntry;
161
- if (typeof appendEntry !== "function") {
142
+ delivery.eligible = true;
143
+ const current = args.cacheManager.readCache("test-runner-findings", cwd)?.data;
144
+ if (!current?.content || current.testRunGeneration !== delivery.generation) {
162
145
  pending.delete(deliveryKey);
163
- record(deliveryKey, "capability-unavailable", delivery);
164
146
  return;
165
147
  }
166
- const bounded = boundedContent(findings.messages[0]?.content ?? "");
167
- try {
168
- appendEntry.call(args.pi, TEST_RUNNER_ENTRY_TYPE, {
169
- ...bounded,
148
+ args.cacheManager.writeCache("test-runner-findings", {
149
+ ...current,
150
+ deliveryEligible: {
170
151
  sessionId: delivery.sessionId,
171
152
  generation: delivery.generation,
172
- targetCount: delivery.targetCount,
173
- });
174
- pending.delete(deliveryKey);
175
- record(deliveryKey, "delivered", delivery, {
176
- droppedDetailCount: bounded.droppedDetailCount,
177
- ageMs: Math.max(0, Date.now() - delivery.createdAt),
178
- });
179
- }
180
- catch (error) {
181
- record(deliveryKey, "delivery-failed", delivery, {
182
- error: String(error).slice(0, 500),
183
- });
184
- }
153
+ eligibleAt: Date.now(),
154
+ },
155
+ }, cwd);
156
+ record(deliveryKey, "eligible", delivery, {
157
+ ageMs: Math.max(0, Date.now() - delivery.createdAt),
158
+ });
185
159
  }
186
160
  /** Deliver only the result staged by this activation and settled session. */
187
161
  export function deliverStagedTestRunnerFindings(args) {
@@ -195,7 +169,6 @@ export function deliverStagedTestRunnerFindings(args) {
195
169
  if (!delivery?.owner)
196
170
  return;
197
171
  deliverTestRunnerFindings({
198
- pi: delivery.owner.pi,
199
172
  ctx: delivery.owner.getCtx(),
200
173
  cacheManager: delivery.owner.cacheManager,
201
174
  runtime: delivery.owner.runtime,
@@ -203,31 +176,63 @@ export function deliverStagedTestRunnerFindings(args) {
203
176
  ownerId: delivery.ownerId,
204
177
  });
205
178
  }
206
- export function registerTestRunnerEntryRenderer(pi) {
207
- // SAFETY: registerEntryRenderer is an optional host capability absent from older Pi SDKs.
208
- const register = pi.registerEntryRenderer;
209
- if (typeof register !== "function")
210
- return false;
211
- try {
212
- register.call(pi, TEST_RUNNER_ENTRY_TYPE, renderTestRunnerEntry);
213
- return true;
179
+ /** Consume the result made eligible by the settled idle boundary. */
180
+ export function consumeStagedTestRunnerFindings(args) {
181
+ const deliveryKey = key(args.cwd, args.sessionId, args.ownerId);
182
+ let delivery = pending.get(deliveryKey);
183
+ const persisted = args.cacheManager.readCache("test-runner-findings", args.cwd)?.data;
184
+ const eligible = persisted?.deliveryEligible;
185
+ if (!delivery && persisted?.content && eligible) {
186
+ const sameSession = eligible.sessionId === args.sessionId;
187
+ if (!sameSession) {
188
+ const foreignDelivery = {
189
+ cwd: args.cwd,
190
+ sessionId: eligible.sessionId,
191
+ generation: eligible.generation,
192
+ targetCount: 0,
193
+ createdAt: eligible.eligibleAt,
194
+ eligible: true,
195
+ rehydrated: true,
196
+ };
197
+ record(deliveryKey, "foreign-session", foreignDelivery, {
198
+ currentSessionId: args.sessionId,
199
+ currentOwnerId: args.ownerId,
200
+ reason: "session-mismatch",
201
+ });
202
+ return undefined;
203
+ }
204
+ delivery = {
205
+ cwd: args.cwd,
206
+ sessionId: args.sessionId,
207
+ ownerId: args.ownerId,
208
+ generation: eligible.generation,
209
+ targetCount: 0,
210
+ createdAt: eligible.eligibleAt,
211
+ eligible: true,
212
+ rehydrated: true,
213
+ };
214
+ pending.set(deliveryKey, delivery);
214
215
  }
215
- catch {
216
- return false;
216
+ if (!delivery?.eligible)
217
+ return undefined;
218
+ const currentGeneration = persisted?.testRunGeneration;
219
+ if (currentGeneration !== delivery.generation) {
220
+ pending.delete(deliveryKey);
221
+ record(deliveryKey, "superseded", delivery, { currentGeneration });
222
+ return undefined;
217
223
  }
218
- }
219
- function renderTestRunnerEntry(entry, _options, theme) {
220
- const content = entry.data?.content;
221
- if (typeof content !== "string")
224
+ const findings = consumeTestFindings(args.cacheManager, args.cwd, args.runtime);
225
+ if (!findings) {
226
+ pending.delete(deliveryKey);
227
+ record(deliveryKey, "superseded", delivery);
222
228
  return undefined;
223
- const lines = [
224
- theme.fg("error", "pi-lens test failures"),
225
- ...content.split("\n"),
226
- ];
227
- return {
228
- render: (width) => fitLines(lines, width),
229
- invalidate: () => { },
230
- };
229
+ }
230
+ pending.delete(deliveryKey);
231
+ record(deliveryKey, "delivered", delivery, {
232
+ ageMs: Math.max(0, Date.now() - delivery.createdAt),
233
+ rehydrated: delivery.rehydrated === true,
234
+ });
235
+ return findings;
231
236
  }
232
237
  /** Test-only reset; session ownership prevents cross-session consumption. */
233
238
  export function _resetTestRunnerDeliveryForTests() {
@@ -0,0 +1,199 @@
1
+ /** Shared resolver for model-facing tool availability (#2800). */
2
+ import { readFlagConfigValue } from "./lens-flag-registry.js";
3
+ /** The complete model-facing tool population on pi and MCP. */
4
+ export const TOOL_REGISTRY = [
5
+ {
6
+ name: "ast_grep_search",
7
+ piName: "ast_grep_search",
8
+ mcpName: "pilens_ast_grep_search",
9
+ situational: true,
10
+ summary: "AST-aware structural code search across ~40 languages (ast-grep patterns).",
11
+ disableable: true,
12
+ },
13
+ {
14
+ name: "ast_grep_replace",
15
+ piName: "ast_grep_replace",
16
+ mcpName: "pilens_ast_grep_replace",
17
+ situational: true,
18
+ summary: "AST-aware structural code rewrite/refactor (ast-grep patterns).",
19
+ disableable: true,
20
+ },
21
+ {
22
+ name: "ast_grep_outline",
23
+ piName: "ast_grep_outline",
24
+ mcpName: undefined,
25
+ situational: true,
26
+ summary: "Syntax-only file/dir structure (symbols/imports/exports/members) via ast-grep outline — no index/LSP.",
27
+ disableable: true,
28
+ },
29
+ {
30
+ name: "lsp_navigation",
31
+ piName: "lsp_navigation",
32
+ mcpName: "pilens_lsp_navigation",
33
+ situational: true,
34
+ summary: "IDE-style LSP navigation: definition, references, implementation, rename, call hierarchy.",
35
+ disableable: true,
36
+ },
37
+ {
38
+ name: "lens_diagnostics",
39
+ piName: "lens_diagnostics",
40
+ mcpName: "pilens_diagnostics",
41
+ disableable: true,
42
+ },
43
+ {
44
+ name: "lens_diagnostic_mark",
45
+ piName: "lens_diagnostic_mark",
46
+ mcpName: undefined,
47
+ situational: true,
48
+ summary: "Record a disposition for a diagnostic: false-positive / suppress (inline ignore comment) / defer (this session) / flagged (to fix).",
49
+ disableable: true,
50
+ },
51
+ {
52
+ name: "symbol_search",
53
+ piName: "symbol_search",
54
+ mcpName: "pilens_symbol_search",
55
+ disableable: true,
56
+ },
57
+ {
58
+ name: "module_report",
59
+ piName: "module_report",
60
+ mcpName: "pilens_module_report",
61
+ disableable: true,
62
+ },
63
+ {
64
+ name: "project_report",
65
+ piName: "project_report",
66
+ mcpName: "pilens_project_report",
67
+ disableable: true,
68
+ },
69
+ {
70
+ name: "read_symbol",
71
+ piName: "read_symbol",
72
+ mcpName: "pilens_read_symbol",
73
+ disableable: true,
74
+ },
75
+ {
76
+ name: "read_enclosing",
77
+ piName: "read_enclosing",
78
+ mcpName: "pilens_read_enclosing",
79
+ disableable: true,
80
+ },
81
+ {
82
+ name: "effective_config",
83
+ piName: "effective_config",
84
+ mcpName: "pilens_effective_config",
85
+ disableable: true,
86
+ },
87
+ {
88
+ name: "pi_lens_activate_tools",
89
+ piName: "pi_lens_activate_tools",
90
+ mcpName: undefined,
91
+ disableable: false,
92
+ },
93
+ {
94
+ name: "analyze",
95
+ piName: undefined,
96
+ mcpName: "pilens_analyze",
97
+ disableable: true,
98
+ },
99
+ {
100
+ name: "health",
101
+ piName: undefined,
102
+ mcpName: "pilens_health",
103
+ disableable: true,
104
+ },
105
+ {
106
+ name: "latency",
107
+ piName: undefined,
108
+ mcpName: "pilens_latency",
109
+ disableable: true,
110
+ },
111
+ {
112
+ name: "project_scan",
113
+ piName: undefined,
114
+ mcpName: "pilens_project_scan",
115
+ disableable: true,
116
+ },
117
+ {
118
+ name: "rebuild",
119
+ piName: undefined,
120
+ mcpName: "pilens_rebuild",
121
+ disableable: true,
122
+ },
123
+ {
124
+ name: "session_start",
125
+ piName: undefined,
126
+ mcpName: "pilens_session_start",
127
+ disableable: false,
128
+ },
129
+ {
130
+ name: "turn_end",
131
+ piName: undefined,
132
+ mcpName: "pilens_turn_end",
133
+ disableable: false,
134
+ },
135
+ {
136
+ name: "session_end",
137
+ piName: undefined,
138
+ mcpName: "pilens_session_end",
139
+ disableable: false,
140
+ },
141
+ ];
142
+ export const LENS_TOOL_NAMES = TOOL_REGISTRY.map((tool) => tool.name);
143
+ export function toolRegistryEntryForPi(name) {
144
+ return TOOL_REGISTRY.find((tool) => tool.piName === name);
145
+ }
146
+ export function toolRegistryEntryForMcp(name) {
147
+ return TOOL_REGISTRY.find((tool) => tool.mcpName === name);
148
+ }
149
+ /** Resolve one tool. CLI names are comma-separated to support repeatable flags. */
150
+ export function resolveLensToolEnabled(name, globalConfig, projectConfig, cliNoTools) {
151
+ const entry = TOOL_REGISTRY.find((tool) => tool.name === name);
152
+ if (entry?.disableable === false)
153
+ return true;
154
+ const cliNames = Array.isArray(cliNoTools)
155
+ ? cliNoTools
156
+ : typeof cliNoTools === "string"
157
+ ? cliNoTools.split(",")
158
+ : [];
159
+ if (cliNames.some((entry) => entry.trim() === name))
160
+ return false;
161
+ const project = readFlagConfigValue(projectConfig, `tools.${name}.enabled`);
162
+ if (project !== undefined)
163
+ return project;
164
+ const global = readFlagConfigValue(globalConfig, `tools.${name}.enabled`);
165
+ return global ?? true;
166
+ }
167
+ /** Copy and validate the known per-tool leaves from one config document. */
168
+ export function readToolConfig(raw, warnInvalid) {
169
+ if (!raw || typeof raw !== "object" || Array.isArray(raw))
170
+ return undefined;
171
+ const section = raw.tools;
172
+ if (!section || typeof section !== "object" || Array.isArray(section))
173
+ return undefined;
174
+ const result = {};
175
+ for (const [name, value] of Object.entries(section)) {
176
+ if (name === "lazy")
177
+ continue;
178
+ const entry = TOOL_REGISTRY.find((tool) => tool.name === name);
179
+ if (!entry) {
180
+ warnInvalid(`unknown key "tools.${name}.enabled" is not a recognized pi-lens tool`, "PILENS_CFG_0009");
181
+ continue;
182
+ }
183
+ if (!entry.disableable) {
184
+ warnInvalid(`key "tools.${name}.enabled" cannot be disabled because it is required for the ${entry.mcpName ? "MCP session" : "pi tool activation"} contract`, "PILENS_CFG_0009");
185
+ continue;
186
+ }
187
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
188
+ warnInvalid(`tools.${name} must be an object with enabled`);
189
+ continue;
190
+ }
191
+ const enabled = value.enabled;
192
+ if (enabled !== undefined && typeof enabled !== "boolean") {
193
+ warnInvalid(`tools.${name}.enabled must be a boolean`);
194
+ continue;
195
+ }
196
+ result[name] = enabled === undefined ? {} : { enabled };
197
+ }
198
+ return Object.keys(result).length > 0 ? result : undefined;
199
+ }