@duckmind/dm-darwin-x64 0.67.2 → 0.67.4

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 (606) hide show
  1. package/README.md +2 -2
  2. package/dm +1 -1
  3. package/extensions/.dm-extensions.json +613 -15
  4. package/extensions/dm-lens/clients/dispatch/runners/utils/runner-helpers.js +1 -1
  5. package/extensions/dm-lens/dist/clients/actionable-warnings-logger.js +24 -0
  6. package/extensions/dm-lens/dist/clients/actionable-warnings.js +1066 -0
  7. package/extensions/dm-lens/dist/clients/advisory-provenance.js +388 -0
  8. package/extensions/dm-lens/dist/clients/agent-behavior-client.js +94 -0
  9. package/extensions/dm-lens/dist/clients/agent-nudge.js +253 -0
  10. package/extensions/dm-lens/dist/clients/analysed-root.js +1 -0
  11. package/extensions/dm-lens/dist/clients/analysis-root.js +133 -0
  12. package/extensions/dm-lens/dist/clients/ast-grep-client.js +587 -0
  13. package/extensions/dm-lens/dist/clients/ast-grep-rule-manager.js +137 -0
  14. package/extensions/dm-lens/dist/clients/ast-grep-tool-logger.js +85 -0
  15. package/extensions/dm-lens/dist/clients/ast-grep-types.js +1 -0
  16. package/extensions/dm-lens/dist/clients/ast-grep-yaml-synth.js +109 -0
  17. package/extensions/dm-lens/dist/clients/atomic-write-staging.js +66 -0
  18. package/extensions/dm-lens/dist/clients/atomic-write.js +37 -0
  19. package/extensions/dm-lens/dist/clients/availability-probe-flight.js +11 -0
  20. package/extensions/dm-lens/dist/clients/bash-file-access.js +1257 -0
  21. package/extensions/dm-lens/dist/clients/biome-client.js +223 -0
  22. package/extensions/dm-lens/dist/clients/blocker-freshness.js +553 -0
  23. package/extensions/dm-lens/dist/clients/blocker-past-eof.js +51 -0
  24. package/extensions/dm-lens/dist/clients/bootstrap.js +246 -0
  25. package/extensions/dm-lens/dist/clients/bounded-cache.js +105 -0
  26. package/extensions/dm-lens/dist/clients/bounded-pid-file-lock.js +275 -0
  27. package/extensions/dm-lens/dist/clients/bounded-telemetry.js +110 -0
  28. package/extensions/dm-lens/dist/clients/build-identity.js +45 -0
  29. package/extensions/dm-lens/dist/clients/bundled-resource-health.js +41 -0
  30. package/extensions/dm-lens/dist/clients/bus-events-logger.js +48 -0
  31. package/extensions/dm-lens/dist/clients/bus-publish.js +117 -0
  32. package/extensions/dm-lens/dist/clients/cache/rule-cache.js +87 -0
  33. package/extensions/dm-lens/dist/clients/cache-manager.js +449 -0
  34. package/extensions/dm-lens/dist/clients/cache-observability.js +1105 -0
  35. package/extensions/dm-lens/dist/clients/call-graph.js +628 -0
  36. package/extensions/dm-lens/dist/clients/cargo-manifest.js +167 -0
  37. package/extensions/dm-lens/dist/clients/cascade-budget.js +52 -0
  38. package/extensions/dm-lens/dist/clients/cascade-format.js +301 -0
  39. package/extensions/dm-lens/dist/clients/cascade-logger.js +22 -0
  40. package/extensions/dm-lens/dist/clients/cascade-types.js +1 -0
  41. package/extensions/dm-lens/dist/clients/child-unref.js +59 -0
  42. package/extensions/dm-lens/dist/clients/code-quality-warnings.js +192 -0
  43. package/extensions/dm-lens/dist/clients/codebase-model.js +110 -0
  44. package/extensions/dm-lens/dist/clients/collateral-test-role.js +8 -0
  45. package/extensions/dm-lens/dist/clients/complexity-client.js +398 -0
  46. package/extensions/dm-lens/dist/clients/config-core/deny.js +117 -0
  47. package/extensions/dm-lens/dist/clients/config-core/index.js +2 -0
  48. package/extensions/dm-lens/dist/clients/config-core/merge.js +228 -0
  49. package/extensions/dm-lens/dist/clients/config-core/normalize.js +226 -0
  50. package/extensions/dm-lens/dist/clients/config-core/process-spec.js +147 -0
  51. package/extensions/dm-lens/dist/clients/config-core/provenance.js +54 -0
  52. package/extensions/dm-lens/dist/clients/config-core/records.js +79 -0
  53. package/extensions/dm-lens/dist/clients/config-core/resolve.js +48 -0
  54. package/extensions/dm-lens/dist/clients/config-core/safe-object.js +22 -0
  55. package/extensions/dm-lens/dist/clients/config-core/schema.js +93 -0
  56. package/extensions/dm-lens/dist/clients/config-diagnostic-codes.js +90 -0
  57. package/extensions/dm-lens/dist/clients/config-locations.js +169 -0
  58. package/extensions/dm-lens/dist/clients/config-resolve.js +359 -0
  59. package/extensions/dm-lens/dist/clients/config-schema.js +230 -0
  60. package/extensions/dm-lens/dist/clients/config-warn.js +146 -0
  61. package/extensions/dm-lens/dist/clients/confirmed-delete.js +11 -0
  62. package/extensions/dm-lens/dist/clients/console-guard-install.js +4 -0
  63. package/extensions/dm-lens/dist/clients/content-stamp.js +16 -0
  64. package/extensions/dm-lens/dist/clients/context-injection-ledger.js +157 -0
  65. package/extensions/dm-lens/dist/clients/cooperative-budget.js +36 -0
  66. package/extensions/dm-lens/dist/clients/custom-rule-locations.js +28 -0
  67. package/extensions/dm-lens/dist/clients/dead-code-client.js +408 -0
  68. package/extensions/dm-lens/dist/clients/dead-code-logger.js +18 -0
  69. package/extensions/dm-lens/dist/clients/deadline-utils.js +117 -0
  70. package/extensions/dm-lens/dist/clients/debug-handles.js +121 -0
  71. package/extensions/dm-lens/dist/clients/debug-heap.js +80 -0
  72. package/extensions/dm-lens/dist/clients/deferred-lsp-work.js +33 -0
  73. package/extensions/dm-lens/dist/clients/deferred-runner-blockers.js +146 -0
  74. package/extensions/dm-lens/dist/clients/deferred-test-targets.js +31 -0
  75. package/extensions/dm-lens/dist/clients/degradation-ledger.js +306 -0
  76. package/extensions/dm-lens/dist/clients/demoted-finding-render.js +64 -0
  77. package/extensions/dm-lens/dist/clients/dependency-checker.js +534 -0
  78. package/extensions/dm-lens/dist/clients/deps/ast-grep-napi.js +27 -0
  79. package/extensions/dm-lens/dist/clients/deps/dm-host-deps.js +10 -0
  80. package/extensions/dm-lens/dist/clients/deps/dm-tui-compat.js +58 -0
  81. package/extensions/dm-lens/dist/clients/deps/js-yaml.js +7 -0
  82. package/extensions/dm-lens/dist/clients/deps/minimatch.js +6 -0
  83. package/extensions/dm-lens/dist/clients/deps/pidusage.js +5 -0
  84. package/extensions/dm-lens/dist/clients/deps/typebox.js +5 -0
  85. package/extensions/dm-lens/dist/clients/deps/vscode-jsonrpc.js +8 -0
  86. package/extensions/dm-lens/dist/clients/deps/web-tree-sitter.js +11 -0
  87. package/extensions/dm-lens/dist/clients/diagnostic-dispositions.js +334 -0
  88. package/extensions/dm-lens/dist/clients/diagnostic-line-freshness.js +142 -0
  89. package/extensions/dm-lens/dist/clients/diagnostic-logger.js +60 -0
  90. package/extensions/dm-lens/dist/clients/diagnostic-tracker.js +89 -0
  91. package/extensions/dm-lens/dist/clients/diagnostics-publish.js +134 -0
  92. package/extensions/dm-lens/dist/clients/disk-change-consumers.js +312 -0
  93. package/extensions/dm-lens/dist/clients/disk-change-subscribers.js +191 -0
  94. package/extensions/dm-lens/dist/clients/disk-changes.js +165 -0
  95. package/extensions/dm-lens/dist/clients/dispatch/adopted-root-runners.js +22 -0
  96. package/extensions/dm-lens/dist/clients/dispatch/ast-grep-catalog.js +16 -0
  97. package/extensions/dm-lens/dist/clients/dispatch/auxiliary-lsp.js +162 -0
  98. package/extensions/dm-lens/dist/clients/dispatch/collect-later-tier.js +25 -0
  99. package/extensions/dm-lens/dist/clients/dispatch/diagnostic-taxonomy.js +58 -0
  100. package/extensions/dm-lens/dist/clients/dispatch/dispatcher.js +1240 -0
  101. package/extensions/dm-lens/dist/clients/dispatch/fact-provider-types.js +1 -0
  102. package/extensions/dm-lens/dist/clients/dispatch/fact-rule-runner.js +17 -0
  103. package/extensions/dm-lens/dist/clients/dispatch/fact-runner.js +18 -0
  104. package/extensions/dm-lens/dist/clients/dispatch/fact-scheduler.js +52 -0
  105. package/extensions/dm-lens/dist/clients/dispatch/fact-store.js +193 -0
  106. package/extensions/dm-lens/dist/clients/dispatch/facts/comment-facts.js +23 -0
  107. package/extensions/dm-lens/dist/clients/dispatch/facts/file-content.js +18 -0
  108. package/extensions/dm-lens/dist/clients/dispatch/facts/function-facts.js +274 -0
  109. package/extensions/dm-lens/dist/clients/dispatch/facts/import-facts.js +169 -0
  110. package/extensions/dm-lens/dist/clients/dispatch/facts/tree-sitter-facts.js +19 -0
  111. package/extensions/dm-lens/dist/clients/dispatch/facts/try-catch-facts.js +95 -0
  112. package/extensions/dm-lens/dist/clients/dispatch/finding-policy.js +188 -0
  113. package/extensions/dm-lens/dist/clients/dispatch/indent-detect.js +227 -0
  114. package/extensions/dm-lens/dist/clients/dispatch/inline-suppressions.js +52 -0
  115. package/extensions/dm-lens/dist/clients/dispatch/integration.js +1698 -0
  116. package/extensions/dm-lens/dist/clients/dispatch/known-runner-ids.js +13 -0
  117. package/extensions/dm-lens/dist/clients/dispatch/lane-copies.js +23 -0
  118. package/extensions/dm-lens/dist/clients/dispatch/lazy.js +8 -0
  119. package/extensions/dm-lens/dist/clients/dispatch/pending-runner-findings.js +133 -0
  120. package/extensions/dm-lens/dist/clients/dispatch/plan.js +284 -0
  121. package/extensions/dm-lens/dist/clients/dispatch/pre-edit-seed.js +57 -0
  122. package/extensions/dm-lens/dist/clients/dispatch/priorities.js +14 -0
  123. package/extensions/dm-lens/dist/clients/dispatch/rule-id-normalize.js +54 -0
  124. package/extensions/dm-lens/dist/clients/dispatch/rule-ignores.js +21 -0
  125. package/extensions/dm-lens/dist/clients/dispatch/rule-policy.js +102 -0
  126. package/extensions/dm-lens/dist/clients/dispatch/rules/async-noise.js +31 -0
  127. package/extensions/dm-lens/dist/clients/dispatch/rules/async-unnecessary-wrapper.js +27 -0
  128. package/extensions/dm-lens/dist/clients/dispatch/rules/cors-wildcard.js +35 -0
  129. package/extensions/dm-lens/dist/clients/dispatch/rules/error-obscuring.js +29 -0
  130. package/extensions/dm-lens/dist/clients/dispatch/rules/error-swallowing.js +29 -0
  131. package/extensions/dm-lens/dist/clients/dispatch/rules/framework-call-noise.js +31 -0
  132. package/extensions/dm-lens/dist/clients/dispatch/rules/high-complexity.js +41 -0
  133. package/extensions/dm-lens/dist/clients/dispatch/rules/high-fan-out.js +37 -0
  134. package/extensions/dm-lens/dist/clients/dispatch/rules/high-import-coupling.js +31 -0
  135. package/extensions/dm-lens/dist/clients/dispatch/rules/missing-error-propagation.js +45 -0
  136. package/extensions/dm-lens/dist/clients/dispatch/rules/no-commented-credentials.js +46 -0
  137. package/extensions/dm-lens/dist/clients/dispatch/rules/pass-through-wrappers.js +38 -0
  138. package/extensions/dm-lens/dist/clients/dispatch/rules/placeholder-comments.js +40 -0
  139. package/extensions/dm-lens/dist/clients/dispatch/rules/unsafe-boundary.js +101 -0
  140. package/extensions/dm-lens/dist/clients/dispatch/runner-context.js +41 -0
  141. package/extensions/dm-lens/dist/clients/dispatch/runners/actionlint.js +98 -0
  142. package/extensions/dm-lens/dist/clients/dispatch/runners/ast-grep-literal-anchors.js +58 -0
  143. package/extensions/dm-lens/dist/clients/dispatch/runners/ast-grep-napi.js +739 -0
  144. package/extensions/dm-lens/dist/clients/dispatch/runners/biome-check.js +196 -0
  145. package/extensions/dm-lens/dist/clients/dispatch/runners/cpp-check.js +190 -0
  146. package/extensions/dm-lens/dist/clients/dispatch/runners/credo.js +66 -0
  147. package/extensions/dm-lens/dist/clients/dispatch/runners/cue-vet.js +161 -0
  148. package/extensions/dm-lens/dist/clients/dispatch/runners/dart-analyze.js +151 -0
  149. package/extensions/dm-lens/dist/clients/dispatch/runners/detekt.js +158 -0
  150. package/extensions/dm-lens/dist/clients/dispatch/runners/dotnet-build.js +163 -0
  151. package/extensions/dm-lens/dist/clients/dispatch/runners/elixir-check.js +153 -0
  152. package/extensions/dm-lens/dist/clients/dispatch/runners/eslint.js +99 -0
  153. package/extensions/dm-lens/dist/clients/dispatch/runners/fact-rules.js +20 -0
  154. package/extensions/dm-lens/dist/clients/dispatch/runners/fish-indent.js +120 -0
  155. package/extensions/dm-lens/dist/clients/dispatch/runners/gleam-check.js +100 -0
  156. package/extensions/dm-lens/dist/clients/dispatch/runners/go-vet.js +52 -0
  157. package/extensions/dm-lens/dist/clients/dispatch/runners/golangci-lint.js +105 -0
  158. package/extensions/dm-lens/dist/clients/dispatch/runners/hadolint.js +83 -0
  159. package/extensions/dm-lens/dist/clients/dispatch/runners/helm-lint.js +147 -0
  160. package/extensions/dm-lens/dist/clients/dispatch/runners/helm-render.js +593 -0
  161. package/extensions/dm-lens/dist/clients/dispatch/runners/htmlhint.js +103 -0
  162. package/extensions/dm-lens/dist/clients/dispatch/runners/index.js +100 -0
  163. package/extensions/dm-lens/dist/clients/dispatch/runners/javac.js +82 -0
  164. package/extensions/dm-lens/dist/clients/dispatch/runners/ktlint.js +115 -0
  165. package/extensions/dm-lens/dist/clients/dispatch/runners/lsp.js +275 -0
  166. package/extensions/dm-lens/dist/clients/dispatch/runners/markdownlint.js +129 -0
  167. package/extensions/dm-lens/dist/clients/dispatch/runners/mypy.js +70 -0
  168. package/extensions/dm-lens/dist/clients/dispatch/runners/oxlint.js +296 -0
  169. package/extensions/dm-lens/dist/clients/dispatch/runners/php-lint.js +66 -0
  170. package/extensions/dm-lens/dist/clients/dispatch/runners/phpstan.js +90 -0
  171. package/extensions/dm-lens/dist/clients/dispatch/runners/prisma-validate.js +66 -0
  172. package/extensions/dm-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +307 -0
  173. package/extensions/dm-lens/dist/clients/dispatch/runners/pyright.js +118 -0
  174. package/extensions/dm-lens/dist/clients/dispatch/runners/rubocop.js +79 -0
  175. package/extensions/dm-lens/dist/clients/dispatch/runners/ruff.js +69 -0
  176. package/extensions/dm-lens/dist/clients/dispatch/runners/rust-clippy.js +166 -0
  177. package/extensions/dm-lens/dist/clients/dispatch/runners/shellcheck.js +168 -0
  178. package/extensions/dm-lens/dist/clients/dispatch/runners/shfmt.js +92 -0
  179. package/extensions/dm-lens/dist/clients/dispatch/runners/spellcheck.js +74 -0
  180. package/extensions/dm-lens/dist/clients/dispatch/runners/spotbugs.js +208 -0
  181. package/extensions/dm-lens/dist/clients/dispatch/runners/sqlfluff.js +136 -0
  182. package/extensions/dm-lens/dist/clients/dispatch/runners/stylelint.js +118 -0
  183. package/extensions/dm-lens/dist/clients/dispatch/runners/swiftlint.js +143 -0
  184. package/extensions/dm-lens/dist/clients/dispatch/runners/taplo.js +109 -0
  185. package/extensions/dm-lens/dist/clients/dispatch/runners/terragrunt.js +110 -0
  186. package/extensions/dm-lens/dist/clients/dispatch/runners/tflint.js +104 -0
  187. package/extensions/dm-lens/dist/clients/dispatch/runners/tree-sitter.js +534 -0
  188. package/extensions/dm-lens/dist/clients/dispatch/runners/trivy-config.js +155 -0
  189. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/availability-policy.js +313 -0
  190. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/candidate-probe.js +66 -0
  191. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/diagnostic-parsers.js +62 -0
  192. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/lazy-installer.js +130 -0
  193. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +1143 -0
  194. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/spawn-outcome.js +40 -0
  195. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/tool-failure.js +110 -0
  196. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/toolchain-availability.js +88 -0
  197. package/extensions/dm-lens/dist/clients/dispatch/runners/utils.js +8 -0
  198. package/extensions/dm-lens/dist/clients/dispatch/runners/vale.js +92 -0
  199. package/extensions/dm-lens/dist/clients/dispatch/runners/yaml-rule-parser.js +170 -0
  200. package/extensions/dm-lens/dist/clients/dispatch/runners/yamllint.js +83 -0
  201. package/extensions/dm-lens/dist/clients/dispatch/runners/zig-check.js +72 -0
  202. package/extensions/dm-lens/dist/clients/dispatch/suppress-writer.js +57 -0
  203. package/extensions/dm-lens/dist/clients/dispatch/tool-profile.js +30 -0
  204. package/extensions/dm-lens/dist/clients/dispatch/types.js +72 -0
  205. package/extensions/dm-lens/dist/clients/dispatch/utils/format-utils.js +58 -0
  206. package/extensions/dm-lens/dist/clients/dispatch/utils/lsp-diagnostics.js +32 -0
  207. package/extensions/dm-lens/dist/clients/disposition-logger.js +19 -0
  208. package/extensions/dm-lens/dist/clients/disposition-publish.js +88 -0
  209. package/extensions/dm-lens/dist/clients/durable-store.js +77 -0
  210. package/extensions/dm-lens/dist/clients/effective-config.js +170 -0
  211. package/extensions/dm-lens/dist/clients/env-utils.js +26 -0
  212. package/extensions/dm-lens/dist/clients/ephemeral-root.js +55 -0
  213. package/extensions/dm-lens/dist/clients/error-class.js +3 -0
  214. package/extensions/dm-lens/dist/clients/eval-timestamp.js +2 -0
  215. package/extensions/dm-lens/dist/clients/event-loop-hold.js +119 -0
  216. package/extensions/dm-lens/dist/clients/event-loop-monitor.js +84 -0
  217. package/extensions/dm-lens/dist/clients/extension-log.js +230 -0
  218. package/extensions/dm-lens/dist/clients/extension-mode.js +20 -0
  219. package/extensions/dm-lens/dist/clients/feature-hints.js +88 -0
  220. package/extensions/dm-lens/dist/clients/file-kinds.js +317 -0
  221. package/extensions/dm-lens/dist/clients/file-mutation-queue.js +91 -0
  222. package/extensions/dm-lens/dist/clients/file-role.js +50 -0
  223. package/extensions/dm-lens/dist/clients/file-time.js +112 -0
  224. package/extensions/dm-lens/dist/clients/file-utils.js +840 -0
  225. package/extensions/dm-lens/dist/clients/finding-delivery-gate.js +146 -0
  226. package/extensions/dm-lens/dist/clients/finding-identity.js +79 -0
  227. package/extensions/dm-lens/dist/clients/fix-run-restore.js +423 -0
  228. package/extensions/dm-lens/dist/clients/fix-worklog.js +75 -0
  229. package/extensions/dm-lens/dist/clients/format-events-publish.js +310 -0
  230. package/extensions/dm-lens/dist/clients/format-service.js +177 -0
  231. package/extensions/dm-lens/dist/clients/formatters-lazy.js +8 -0
  232. package/extensions/dm-lens/dist/clients/formatters.js +1367 -0
  233. package/extensions/dm-lens/dist/clients/freshness-cadence.js +1 -0
  234. package/extensions/dm-lens/dist/clients/freshness.js +8 -0
  235. package/extensions/dm-lens/dist/clients/generated-artifacts.js +209 -0
  236. package/extensions/dm-lens/dist/clients/generation-guard.js +147 -0
  237. package/extensions/dm-lens/dist/clients/generation-lock.js +181 -0
  238. package/extensions/dm-lens/dist/clients/git-guard.js +1208 -0
  239. package/extensions/dm-lens/dist/clients/git-tracked-ignore.js +120 -0
  240. package/extensions/dm-lens/dist/clients/gitleaks-client.js +290 -0
  241. package/extensions/dm-lens/dist/clients/go-client.js +47 -0
  242. package/extensions/dm-lens/dist/clients/govulncheck-client.js +416 -0
  243. package/extensions/dm-lens/dist/clients/gradle-ktfmt-style.js +177 -0
  244. package/extensions/dm-lens/dist/clients/grammar-source.js +263 -0
  245. package/extensions/dm-lens/dist/clients/grammar-wasm-imports.js +48 -0
  246. package/extensions/dm-lens/dist/clients/gzip-stage-write.js +174 -0
  247. package/extensions/dm-lens/dist/clients/hard-failure-summary.js +28 -0
  248. package/extensions/dm-lens/dist/clients/hashline-anchor.js +222 -0
  249. package/extensions/dm-lens/dist/clients/hook-budgets.js +17 -0
  250. package/extensions/dm-lens/dist/clients/host-edit-normalize.js +87 -0
  251. package/extensions/dm-lens/dist/clients/host-ports.js +35 -0
  252. package/extensions/dm-lens/dist/clients/indent-retarget.js +102 -0
  253. package/extensions/dm-lens/dist/clients/inline-blocker-dispositions.js +103 -0
  254. package/extensions/dm-lens/dist/clients/inline-blocker-fields.js +8 -0
  255. package/extensions/dm-lens/dist/clients/install-diagnostics.js +135 -0
  256. package/extensions/dm-lens/dist/clients/installer/index.js +3928 -0
  257. package/extensions/dm-lens/dist/clients/installer/managed-tool-refresh-session.js +17 -0
  258. package/extensions/dm-lens/dist/clients/installer/managed-tool-refresh.js +721 -0
  259. package/extensions/dm-lens/dist/clients/instance-reaper-state.js +3 -0
  260. package/extensions/dm-lens/dist/clients/instance-reaper.js +693 -0
  261. package/extensions/dm-lens/dist/clients/instance-registry-lock.js +166 -0
  262. package/extensions/dm-lens/dist/clients/instance-registry-tail.js +17 -0
  263. package/extensions/dm-lens/dist/clients/instance-registry.js +607 -0
  264. package/extensions/dm-lens/dist/clients/io-bridge-contract.js +7 -0
  265. package/extensions/dm-lens/dist/clients/io-bridge.js +357 -0
  266. package/extensions/dm-lens/dist/clients/jscpd-client.js +311 -0
  267. package/extensions/dm-lens/dist/clients/json-cache-read.js +25 -0
  268. package/extensions/dm-lens/dist/clients/knip-client.js +534 -0
  269. package/extensions/dm-lens/dist/clients/knip-scan-roots.js +26 -0
  270. package/extensions/dm-lens/dist/clients/language-policy.js +244 -0
  271. package/extensions/dm-lens/dist/clients/language-profile.js +259 -0
  272. package/extensions/dm-lens/dist/clients/language-registry.js +468 -0
  273. package/extensions/dm-lens/dist/clients/latency-logger.js +210 -0
  274. package/extensions/dm-lens/dist/clients/lazy-import.js +14 -0
  275. package/extensions/dm-lens/dist/clients/ledger-bounds.js +21 -0
  276. package/extensions/dm-lens/dist/clients/lens-config.js +254 -0
  277. package/extensions/dm-lens/dist/clients/lens-engine.js +188 -0
  278. package/extensions/dm-lens/dist/clients/lens-events.js +105 -0
  279. package/extensions/dm-lens/dist/clients/lens-flag-registry.js +308 -0
  280. package/extensions/dm-lens/dist/clients/lens-map.js +980 -0
  281. package/extensions/dm-lens/dist/clients/line-alignment.js +200 -0
  282. package/extensions/dm-lens/dist/clients/live-bus-emitter.js +53 -0
  283. package/extensions/dm-lens/dist/clients/log-cleanup.js +138 -0
  284. package/extensions/dm-lens/dist/clients/lsp/aggregation.js +89 -0
  285. package/extensions/dm-lens/dist/clients/lsp/auxiliary-lifecycle.js +23 -0
  286. package/extensions/dm-lens/dist/clients/lsp/capabilities.js +94 -0
  287. package/extensions/dm-lens/dist/clients/lsp/cascade-tier.js +318 -0
  288. package/extensions/dm-lens/dist/clients/lsp/client-registry.js +877 -0
  289. package/extensions/dm-lens/dist/clients/lsp/client.js +3232 -0
  290. package/extensions/dm-lens/dist/clients/lsp/config.js +571 -0
  291. package/extensions/dm-lens/dist/clients/lsp/content-limits.js +21 -0
  292. package/extensions/dm-lens/dist/clients/lsp/content-scan.js +69 -0
  293. package/extensions/dm-lens/dist/clients/lsp/created-import-targets.js +134 -0
  294. package/extensions/dm-lens/dist/clients/lsp/diagnostic-binding.js +113 -0
  295. package/extensions/dm-lens/dist/clients/lsp/document-drift.js +372 -0
  296. package/extensions/dm-lens/dist/clients/lsp/edits.js +1060 -0
  297. package/extensions/dm-lens/dist/clients/lsp/environment-gap.js +186 -0
  298. package/extensions/dm-lens/dist/clients/lsp/file-server-match.js +26 -0
  299. package/extensions/dm-lens/dist/clients/lsp/grouping.js +38 -0
  300. package/extensions/dm-lens/dist/clients/lsp/implicit-scope.js +205 -0
  301. package/extensions/dm-lens/dist/clients/lsp/index.js +4292 -0
  302. package/extensions/dm-lens/dist/clients/lsp/inferred-project.js +140 -0
  303. package/extensions/dm-lens/dist/clients/lsp/jvm-runtime.js +200 -0
  304. package/extensions/dm-lens/dist/clients/lsp/language.js +26 -0
  305. package/extensions/dm-lens/dist/clients/lsp/launch.js +606 -0
  306. package/extensions/dm-lens/dist/clients/lsp/lombok.js +133 -0
  307. package/extensions/dm-lens/dist/clients/lsp/path-utils.js +1 -0
  308. package/extensions/dm-lens/dist/clients/lsp/pending-aux-coverage.js +120 -0
  309. package/extensions/dm-lens/dist/clients/lsp/position-encoding.js +21 -0
  310. package/extensions/dm-lens/dist/clients/lsp/resolved-config.js +183 -0
  311. package/extensions/dm-lens/dist/clients/lsp/ruby-drive-dirs.js +42 -0
  312. package/extensions/dm-lens/dist/clients/lsp/server-config-files.js +11 -0
  313. package/extensions/dm-lens/dist/clients/lsp/server-covers.js +8 -0
  314. package/extensions/dm-lens/dist/clients/lsp/server-traits.js +45 -0
  315. package/extensions/dm-lens/dist/clients/lsp/server.js +2827 -0
  316. package/extensions/dm-lens/dist/clients/lsp/service-singleton.js +59 -0
  317. package/extensions/dm-lens/dist/clients/lsp/session-roots.js +83 -0
  318. package/extensions/dm-lens/dist/clients/lsp/spawn-history.js +15 -0
  319. package/extensions/dm-lens/dist/clients/lsp/sync-kind.js +30 -0
  320. package/extensions/dm-lens/dist/clients/lsp/tsserver-sync.js +156 -0
  321. package/extensions/dm-lens/dist/clients/lsp/wait-policy/capability-snapshot.js +1 -0
  322. package/extensions/dm-lens/dist/clients/lsp/wait-policy/classification.js +37 -0
  323. package/extensions/dm-lens/dist/clients/lsp/wait-policy/index.js +3 -0
  324. package/extensions/dm-lens/dist/clients/lsp/wait-policy/strategies.js +276 -0
  325. package/extensions/dm-lens/dist/clients/lsp/watch-queue.js +61 -0
  326. package/extensions/dm-lens/dist/clients/lsp/workspace-diagnostics-cache.js +395 -0
  327. package/extensions/dm-lens/dist/clients/lsp/workspace-diagnostics-session.js +42 -0
  328. package/extensions/dm-lens/dist/clients/lsp/workspace-sweep-hold.js +93 -0
  329. package/extensions/dm-lens/dist/clients/lsp-budget.js +87 -0
  330. package/extensions/dm-lens/dist/clients/lsp-document-symbols.js +93 -0
  331. package/extensions/dm-lens/dist/clients/lsp-lazy.js +8 -0
  332. package/extensions/dm-lens/dist/clients/lsp-mutation.js +309 -0
  333. package/extensions/dm-lens/dist/clients/lsp-status.js +35 -0
  334. package/extensions/dm-lens/dist/clients/map-with-concurrency.js +20 -0
  335. package/extensions/dm-lens/dist/clients/mcp/analyze.js +302 -0
  336. package/extensions/dm-lens/dist/clients/mcp/host-shim.js +14 -0
  337. package/extensions/dm-lens/dist/clients/mcp/ipc.js +344 -0
  338. package/extensions/dm-lens/dist/clients/mcp/review.js +137 -0
  339. package/extensions/dm-lens/dist/clients/mcp/session.js +300 -0
  340. package/extensions/dm-lens/dist/clients/memory-sampler.js +163 -0
  341. package/extensions/dm-lens/dist/clients/message-end-attribution.js +18 -0
  342. package/extensions/dm-lens/dist/clients/metrics-client.js +80 -0
  343. package/extensions/dm-lens/dist/clients/metrics-history.js +242 -0
  344. package/extensions/dm-lens/dist/clients/middle-man-analysis.js +161 -0
  345. package/extensions/dm-lens/dist/clients/model-provider.js +31 -0
  346. package/extensions/dm-lens/dist/clients/module-report-lsp.js +140 -0
  347. package/extensions/dm-lens/dist/clients/module-report.js +1648 -0
  348. package/extensions/dm-lens/dist/clients/mutating-tool.js +388 -0
  349. package/extensions/dm-lens/dist/clients/mutation-attribution.js +173 -0
  350. package/extensions/dm-lens/dist/clients/mutation-bridge.js +231 -0
  351. package/extensions/dm-lens/dist/clients/ndjson-logger.js +504 -0
  352. package/extensions/dm-lens/dist/clients/observed-mutation-sources.js +43 -0
  353. package/extensions/dm-lens/dist/clients/observed-mutation.js +735 -0
  354. package/extensions/dm-lens/dist/clients/oldtext-autopatch.js +100 -0
  355. package/extensions/dm-lens/dist/clients/opaque-mutation-scan.js +541 -0
  356. package/extensions/dm-lens/dist/clients/opengrep-client.js +224 -0
  357. package/extensions/dm-lens/dist/clients/opengrep-config.js +57 -0
  358. package/extensions/dm-lens/dist/clients/opengrep-rule-pack.js +19 -0
  359. package/extensions/dm-lens/dist/clients/out-of-band-changes.js +329 -0
  360. package/extensions/dm-lens/dist/clients/package-manager.js +332 -0
  361. package/extensions/dm-lens/dist/clients/package-root.js +21 -0
  362. package/extensions/dm-lens/dist/clients/partial-edit-apply.js +341 -0
  363. package/extensions/dm-lens/dist/clients/path-attribution-telemetry.js +31 -0
  364. package/extensions/dm-lens/dist/clients/path-birth.js +58 -0
  365. package/extensions/dm-lens/dist/clients/path-keyed-map.js +57 -0
  366. package/extensions/dm-lens/dist/clients/path-utils.js +654 -0
  367. package/extensions/dm-lens/dist/clients/performance-report.js +291 -0
  368. package/extensions/dm-lens/dist/clients/persist-debounce.js +37 -0
  369. package/extensions/dm-lens/dist/clients/persist-worker-stats.js +16 -0
  370. package/extensions/dm-lens/dist/clients/persistent-reverify.js +167 -0
  371. package/extensions/dm-lens/dist/clients/php-cs-fixer-config.js +15 -0
  372. package/extensions/dm-lens/dist/clients/pipeline.js +1473 -0
  373. package/extensions/dm-lens/dist/clients/post-autofix-notice.js +19 -0
  374. package/extensions/dm-lens/dist/clients/print-mode.js +3 -0
  375. package/extensions/dm-lens/dist/clients/probe-home-state.js +73 -0
  376. package/extensions/dm-lens/dist/clients/process-bridge.js +48 -0
  377. package/extensions/dm-lens/dist/clients/process-singletons.js +69 -0
  378. package/extensions/dm-lens/dist/clients/process-snapshot.js +130 -0
  379. package/extensions/dm-lens/dist/clients/project-changes.js +180 -0
  380. package/extensions/dm-lens/dist/clients/project-conventions.js +152 -0
  381. package/extensions/dm-lens/dist/clients/project-diagnostics/cache.js +91 -0
  382. package/extensions/dm-lens/dist/clients/project-diagnostics/extractors.js +53 -0
  383. package/extensions/dm-lens/dist/clients/project-diagnostics/fresh-fetch.js +413 -0
  384. package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/call-graph-impact.js +64 -0
  385. package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/dead-code.js +38 -0
  386. package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/gitleaks.js +21 -0
  387. package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/govulncheck.js +23 -0
  388. package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/jscpd.js +28 -0
  389. package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/knip.js +45 -0
  390. package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/madge.js +34 -0
  391. package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/opengrep.js +32 -0
  392. package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +79 -0
  393. package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/trivy.js +41 -0
  394. package/extensions/dm-lens/dist/clients/project-diagnostics/scanner.js +351 -0
  395. package/extensions/dm-lens/dist/clients/project-diagnostics/types.js +1 -0
  396. package/extensions/dm-lens/dist/clients/project-lens-config.js +462 -0
  397. package/extensions/dm-lens/dist/clients/project-report.js +527 -0
  398. package/extensions/dm-lens/dist/clients/project-root-markers.js +8 -0
  399. package/extensions/dm-lens/dist/clients/project-scale.js +60 -0
  400. package/extensions/dm-lens/dist/clients/project-scan-policy.js +4 -0
  401. package/extensions/dm-lens/dist/clients/project-snapshot-fingerprint.js +44 -0
  402. package/extensions/dm-lens/dist/clients/project-snapshot-persist-worker.js +31 -0
  403. package/extensions/dm-lens/dist/clients/project-snapshot.js +1355 -0
  404. package/extensions/dm-lens/dist/clients/project-trust.js +104 -0
  405. package/extensions/dm-lens/dist/clients/python-environment.js +388 -0
  406. package/extensions/dm-lens/dist/clients/python-provenance.js +551 -0
  407. package/extensions/dm-lens/dist/clients/quiet-window-config.js +16 -0
  408. package/extensions/dm-lens/dist/clients/quiet-window.js +129 -0
  409. package/extensions/dm-lens/dist/clients/read-bridge.js +53 -0
  410. package/extensions/dm-lens/dist/clients/read-expansion.js +218 -0
  411. package/extensions/dm-lens/dist/clients/read-guard-branch.js +126 -0
  412. package/extensions/dm-lens/dist/clients/read-guard-logger.js +186 -0
  413. package/extensions/dm-lens/dist/clients/read-guard-tool-lines.js +1044 -0
  414. package/extensions/dm-lens/dist/clients/read-guard.js +1517 -0
  415. package/extensions/dm-lens/dist/clients/recent-touches.js +126 -0
  416. package/extensions/dm-lens/dist/clients/redact/secrets.js +386 -0
  417. package/extensions/dm-lens/dist/clients/resource-sampler.js +344 -0
  418. package/extensions/dm-lens/dist/clients/reverse-deps.js +227 -0
  419. package/extensions/dm-lens/dist/clients/review-graph/builder.js +3780 -0
  420. package/extensions/dm-lens/dist/clients/review-graph/format.js +30 -0
  421. package/extensions/dm-lens/dist/clients/review-graph/git-identity.js +173 -0
  422. package/extensions/dm-lens/dist/clients/review-graph/import-resolvers.js +332 -0
  423. package/extensions/dm-lens/dist/clients/review-graph/persist-worker.js +8 -0
  424. package/extensions/dm-lens/dist/clients/review-graph/query.js +195 -0
  425. package/extensions/dm-lens/dist/clients/review-graph/revision-drift.js +3 -0
  426. package/extensions/dm-lens/dist/clients/review-graph/service.js +60 -0
  427. package/extensions/dm-lens/dist/clients/review-graph/shared-extraction-ir.js +54 -0
  428. package/extensions/dm-lens/dist/clients/review-graph/symbol-id.js +29 -0
  429. package/extensions/dm-lens/dist/clients/review-graph/tsconfig-paths.js +286 -0
  430. package/extensions/dm-lens/dist/clients/review-graph/types.js +1 -0
  431. package/extensions/dm-lens/dist/clients/review-graph/workspace-modules.js +374 -0
  432. package/extensions/dm-lens/dist/clients/review-graph-logger.js +51 -0
  433. package/extensions/dm-lens/dist/clients/ruff-client.js +107 -0
  434. package/extensions/dm-lens/dist/clients/rules-scanner.js +70 -0
  435. package/extensions/dm-lens/dist/clients/run-duration.js +9 -0
  436. package/extensions/dm-lens/dist/clients/runtime-agent-end.js +831 -0
  437. package/extensions/dm-lens/dist/clients/runtime-config.js +39 -0
  438. package/extensions/dm-lens/dist/clients/runtime-context.js +155 -0
  439. package/extensions/dm-lens/dist/clients/runtime-coordinator.js +1254 -0
  440. package/extensions/dm-lens/dist/clients/runtime-session.js +1806 -0
  441. package/extensions/dm-lens/dist/clients/runtime-tool-call.js +1026 -0
  442. package/extensions/dm-lens/dist/clients/runtime-tool-result.js +2068 -0
  443. package/extensions/dm-lens/dist/clients/runtime-turn.js +3198 -0
  444. package/extensions/dm-lens/dist/clients/rust-client.js +46 -0
  445. package/extensions/dm-lens/dist/clients/safe-spawn.js +1402 -0
  446. package/extensions/dm-lens/dist/clients/sanitize.js +5 -0
  447. package/extensions/dm-lens/dist/clients/scan-utils.js +7 -0
  448. package/extensions/dm-lens/dist/clients/scanner-temp-root.js +8 -0
  449. package/extensions/dm-lens/dist/clients/scratch-tree-policy.js +63 -0
  450. package/extensions/dm-lens/dist/clients/search-read-registration.js +76 -0
  451. package/extensions/dm-lens/dist/clients/secret-findings.js +69 -0
  452. package/extensions/dm-lens/dist/clients/security-scan-client.js +208 -0
  453. package/extensions/dm-lens/dist/clients/session-event-guard.js +111 -0
  454. package/extensions/dm-lens/dist/clients/session-lifecycle.js +309 -0
  455. package/extensions/dm-lens/dist/clients/session-repository.js +113 -0
  456. package/extensions/dm-lens/dist/clients/session-scope.js +451 -0
  457. package/extensions/dm-lens/dist/clients/session-start-observability.js +59 -0
  458. package/extensions/dm-lens/dist/clients/session-state-store.js +71 -0
  459. package/extensions/dm-lens/dist/clients/session-summary.js +8 -0
  460. package/extensions/dm-lens/dist/clients/sessionstart-logger.js +22 -0
  461. package/extensions/dm-lens/dist/clients/sg-runner.js +642 -0
  462. package/extensions/dm-lens/dist/clients/sgconfig.js +299 -0
  463. package/extensions/dm-lens/dist/clients/shared-checkout-guard.js +177 -0
  464. package/extensions/dm-lens/dist/clients/single-flight.js +53 -0
  465. package/extensions/dm-lens/dist/clients/situational-tool-telemetry.js +85 -0
  466. package/extensions/dm-lens/dist/clients/skills-resolver.js +38 -0
  467. package/extensions/dm-lens/dist/clients/slow-fs.js +77 -0
  468. package/extensions/dm-lens/dist/clients/smells-rollup.js +118 -0
  469. package/extensions/dm-lens/dist/clients/source-filter.js +323 -0
  470. package/extensions/dm-lens/dist/clients/source-walker.js +114 -0
  471. package/extensions/dm-lens/dist/clients/spawn-output-cap.js +35 -0
  472. package/extensions/dm-lens/dist/clients/spawn-timeout-cooldown.js +51 -0
  473. package/extensions/dm-lens/dist/clients/stale-marker.js +1 -0
  474. package/extensions/dm-lens/dist/clients/startup-scan.js +221 -0
  475. package/extensions/dm-lens/dist/clients/startup-timing.js +67 -0
  476. package/extensions/dm-lens/dist/clients/string-utils.js +6 -0
  477. package/extensions/dm-lens/dist/clients/subagent-mode.js +40 -0
  478. package/extensions/dm-lens/dist/clients/symbol-containment.js +16 -0
  479. package/extensions/dm-lens/dist/clients/symbol-types.js +1 -0
  480. package/extensions/dm-lens/dist/clients/test-runner-client.js +1686 -0
  481. package/extensions/dm-lens/dist/clients/test-runner-delivery.js +285 -0
  482. package/extensions/dm-lens/dist/clients/test-target-roots.js +17 -0
  483. package/extensions/dm-lens/dist/clients/todo-scanner.js +164 -0
  484. package/extensions/dm-lens/dist/clients/tool-agreement.js +640 -0
  485. package/extensions/dm-lens/dist/clients/tool-config.js +239 -0
  486. package/extensions/dm-lens/dist/clients/tool-cwd.js +236 -0
  487. package/extensions/dm-lens/dist/clients/tool-definition.js +22 -0
  488. package/extensions/dm-lens/dist/clients/tool-event.js +24 -0
  489. package/extensions/dm-lens/dist/clients/tool-policy.js +2386 -0
  490. package/extensions/dm-lens/dist/clients/tool-probe.js +13 -0
  491. package/extensions/dm-lens/dist/clients/tool-render.js +79 -0
  492. package/extensions/dm-lens/dist/clients/tool-set-policy.js +106 -0
  493. package/extensions/dm-lens/dist/clients/tree-sitter-cache.js +206 -0
  494. package/extensions/dm-lens/dist/clients/tree-sitter-client.js +3101 -0
  495. package/extensions/dm-lens/dist/clients/tree-sitter-logger.js +77 -0
  496. package/extensions/dm-lens/dist/clients/tree-sitter-navigator.js +198 -0
  497. package/extensions/dm-lens/dist/clients/tree-sitter-query-loader.js +401 -0
  498. package/extensions/dm-lens/dist/clients/tree-sitter-shared.js +87 -0
  499. package/extensions/dm-lens/dist/clients/tree-sitter-symbol-extractor.js +984 -0
  500. package/extensions/dm-lens/dist/clients/trivy-client.js +335 -0
  501. package/extensions/dm-lens/dist/clients/tui-fit.js +26 -0
  502. package/extensions/dm-lens/dist/clients/turn-context.js +48 -0
  503. package/extensions/dm-lens/dist/clients/turn-end/delivery-holds.js +59 -0
  504. package/extensions/dm-lens/dist/clients/turn-end/lane.js +1 -0
  505. package/extensions/dm-lens/dist/clients/turn-end/lanes/govulncheck.js +54 -0
  506. package/extensions/dm-lens/dist/clients/turn-end/lanes/secrets.js +131 -0
  507. package/extensions/dm-lens/dist/clients/turn-summary-render.js +56 -0
  508. package/extensions/dm-lens/dist/clients/turn-summary.js +84 -0
  509. package/extensions/dm-lens/dist/clients/typos-config.js +9 -0
  510. package/extensions/dm-lens/dist/clients/user-notify.js +15 -0
  511. package/extensions/dm-lens/dist/clients/vanished-instance-marker.js +18 -0
  512. package/extensions/dm-lens/dist/clients/warm-attach.js +232 -0
  513. package/extensions/dm-lens/dist/clients/widget-state.js +1014 -0
  514. package/extensions/dm-lens/dist/clients/word-index-logger.js +24 -0
  515. package/extensions/dm-lens/dist/clients/word-index-store.js +222 -0
  516. package/extensions/dm-lens/dist/clients/word-index.js +1503 -0
  517. package/extensions/dm-lens/dist/clients/workspace-topology.js +274 -0
  518. package/extensions/dm-lens/dist/clients/write-ordering-guard.js +28 -0
  519. package/extensions/dm-lens/dist/clients/zizmor-config.js +160 -0
  520. package/extensions/dm-lens/dist/i18n.js +67 -0
  521. package/extensions/dm-lens/dist/index.js +2144 -0
  522. package/extensions/dm-lens/dist/mcp/analyze-cli.js +205 -0
  523. package/extensions/dm-lens/dist/mcp/build-staleness.js +55 -0
  524. package/extensions/dm-lens/dist/mcp/cli.js +96 -0
  525. package/extensions/dm-lens/dist/mcp/server.js +1241 -0
  526. package/extensions/dm-lens/dist/mcp/tool-arguments.js +134 -0
  527. package/extensions/dm-lens/dist/mcp/worker.js +41 -0
  528. package/extensions/dm-lens/dist/scripts/lib/process-scan.mjs +375 -0
  529. package/extensions/dm-lens/dist/scripts/lib/skills-predicate.mjs +53 -0
  530. package/extensions/dm-lens/dist/scripts/lib/web-tree-sitter-dir.mjs +51 -0
  531. package/extensions/dm-lens/dist/tools/activate-tools.js +63 -0
  532. package/extensions/dm-lens/dist/tools/ast-grep-outline.js +128 -0
  533. package/extensions/dm-lens/dist/tools/ast-grep-replace.js +234 -0
  534. package/extensions/dm-lens/dist/tools/ast-grep-search.js +690 -0
  535. package/extensions/dm-lens/dist/tools/effective-config.js +59 -0
  536. package/extensions/dm-lens/dist/tools/lens-diagnostic-mark.js +251 -0
  537. package/extensions/dm-lens/dist/tools/lens-diagnostics.js +1693 -0
  538. package/extensions/dm-lens/dist/tools/lsp-diagnostics.js +1397 -0
  539. package/extensions/dm-lens/dist/tools/lsp-navigation.js +1301 -0
  540. package/extensions/dm-lens/dist/tools/lsp-structured-output.js +277 -0
  541. package/extensions/dm-lens/dist/tools/module-report.js +333 -0
  542. package/extensions/dm-lens/dist/tools/project-report.js +72 -0
  543. package/extensions/dm-lens/dist/tools/render-compact.js +272 -0
  544. package/extensions/dm-lens/dist/tools/scan-progress.js +31 -0
  545. package/extensions/dm-lens/dist/tools/shared.js +46 -0
  546. package/extensions/dm-lens/dist/tools/symbol-search.js +133 -0
  547. package/extensions/dm-mcp-adapter/dist/abort.js +35 -0
  548. package/extensions/dm-mcp-adapter/dist/agent-dir.js +45 -0
  549. package/extensions/dm-mcp-adapter/dist/agent-plugin-loader.js +392 -0
  550. package/extensions/dm-mcp-adapter/dist/agent-plugin-provenance.js +26 -0
  551. package/extensions/dm-mcp-adapter/dist/bearer-command-resolver.js +184 -0
  552. package/extensions/dm-mcp-adapter/dist/claude-plugin-loader.js +350 -0
  553. package/extensions/dm-mcp-adapter/dist/config.js +1984 -0
  554. package/extensions/dm-mcp-adapter/dist/consent-manager.js +84 -0
  555. package/extensions/dm-mcp-adapter/dist/elicitation-handler.js +374 -0
  556. package/extensions/dm-mcp-adapter/dist/errors.js +225 -0
  557. package/extensions/dm-mcp-adapter/dist/extraction-settings.js +43 -0
  558. package/extensions/dm-mcp-adapter/dist/http-ca.js +75 -0
  559. package/extensions/dm-mcp-adapter/dist/jev-client.js +359 -0
  560. package/extensions/dm-mcp-adapter/dist/jev-contracts.js +1 -0
  561. package/extensions/dm-mcp-adapter/dist/jev-key-store.js +189 -0
  562. package/extensions/dm-mcp-adapter/dist/json-schema-validator.js +70 -0
  563. package/extensions/dm-mcp-adapter/dist/lifecycle.js +387 -0
  564. package/extensions/dm-mcp-adapter/dist/logger.js +115 -0
  565. package/extensions/dm-mcp-adapter/dist/mcp-auth-fetch.js +86 -0
  566. package/extensions/dm-mcp-adapter/dist/mcp-auth-flow.js +956 -0
  567. package/extensions/dm-mcp-adapter/dist/mcp-auth.js +998 -0
  568. package/extensions/dm-mcp-adapter/dist/mcp-bearer-store.js +182 -0
  569. package/extensions/dm-mcp-adapter/dist/mcp-callback-server.js +380 -0
  570. package/extensions/dm-mcp-adapter/dist/mcp-oauth-provider.js +525 -0
  571. package/extensions/dm-mcp-adapter/dist/mcp-probe.js +151 -0
  572. package/extensions/dm-mcp-adapter/dist/mcp-tasks.js +339 -0
  573. package/extensions/dm-mcp-adapter/dist/mcp-trace.js +220 -0
  574. package/extensions/dm-mcp-adapter/dist/metadata-cache.js +411 -0
  575. package/extensions/dm-mcp-adapter/dist/npx-resolver.js +465 -0
  576. package/extensions/dm-mcp-adapter/dist/output-shape.js +312 -0
  577. package/extensions/dm-mcp-adapter/dist/package-mcp-loader.js +144 -0
  578. package/extensions/dm-mcp-adapter/dist/project-server-trust.js +274 -0
  579. package/extensions/dm-mcp-adapter/dist/request-headers-command.js +310 -0
  580. package/extensions/dm-mcp-adapter/dist/resource-tools.js +7 -0
  581. package/extensions/dm-mcp-adapter/dist/runtime-owner.js +95 -0
  582. package/extensions/dm-mcp-adapter/dist/sampling-handler.js +219 -0
  583. package/extensions/dm-mcp-adapter/dist/script-tools.js +72 -0
  584. package/extensions/dm-mcp-adapter/dist/secure-keyring.js +191 -0
  585. package/extensions/dm-mcp-adapter/dist/semantic-settings.js +51 -0
  586. package/extensions/dm-mcp-adapter/dist/server-log.js +19 -0
  587. package/extensions/dm-mcp-adapter/dist/server-manager.js +1635 -0
  588. package/extensions/dm-mcp-adapter/dist/session-approvals.js +127 -0
  589. package/extensions/dm-mcp-adapter/dist/session-recovery.js +83 -0
  590. package/extensions/dm-mcp-adapter/dist/state.js +1 -0
  591. package/extensions/dm-mcp-adapter/dist/task-entries.js +60 -0
  592. package/extensions/dm-mcp-adapter/dist/task-jobs.js +259 -0
  593. package/extensions/dm-mcp-adapter/dist/ts-shape.js +157 -0
  594. package/extensions/dm-mcp-adapter/dist/types.js +293 -0
  595. package/extensions/dm-mcp-adapter/dist/ui-app-bridge-helpers.js +36 -0
  596. package/extensions/dm-mcp-adapter/dist/ui-resource-handler.js +204 -0
  597. package/extensions/dm-mcp-adapter/dist/ui-stream-types.js +58 -0
  598. package/extensions/dm-mcp-adapter/dist/ui-tool-visibility.js +26 -0
  599. package/extensions/dm-mcp-adapter/dist/unix-socket-transport.js +83 -0
  600. package/extensions/dm-mcp-adapter/dist/utils.js +444 -0
  601. package/extensions/dm-mcp-adapter/mcp-keyring-helper.cjs +1 -1
  602. package/extensions/dm-ponytail/hooks/ponytail-activate.js +1 -1
  603. package/extensions/dm-ponytail/hooks/ponytail-instructions.js +1 -1
  604. package/extensions/dm-ponytail/hooks/ponytail-mode-tracker.js +1 -1
  605. package/extensions/dm-subagents/src/runs/shared/child-session.js +5 -3
  606. package/package.json +1 -1
@@ -0,0 +1,2386 @@
1
+ import * as fs from "node:fs";
2
+ import * as path from "node:path";
3
+ import { TERRAGRUNT_FILENAMES } from "./file-kinds.js";
4
+ import { recordDegradationOnce } from "./degradation-ledger.js";
5
+ import { logLatency } from "./latency-logger.js";
6
+ import { resolvePackagePath } from "./package-root.js";
7
+ import { findNearestContaining, normalizeMapKey, walkUpDirs } from "./path-utils.js";
8
+ import { loadProjectSnapshotWithoutWordIndex } from "./project-snapshot.js";
9
+ const FORMATTER_POLICY_BY_EXTENSION = new Map([
10
+ [
11
+ ".js",
12
+ {
13
+ formatterNames: ["biome", "prettier", "oxfmt"],
14
+ defaultFormatter: "biome",
15
+ defaultWhenUnconfigured: true,
16
+ gate: "smart-default"
17
+ }
18
+ ],
19
+ [
20
+ ".jsx",
21
+ {
22
+ formatterNames: ["biome", "prettier", "oxfmt"],
23
+ defaultFormatter: "biome",
24
+ defaultWhenUnconfigured: true,
25
+ gate: "smart-default"
26
+ }
27
+ ],
28
+ [
29
+ ".mjs",
30
+ {
31
+ formatterNames: ["biome", "prettier", "oxfmt"],
32
+ defaultFormatter: "biome",
33
+ defaultWhenUnconfigured: true,
34
+ gate: "smart-default"
35
+ }
36
+ ],
37
+ [
38
+ ".cjs",
39
+ {
40
+ formatterNames: ["biome", "prettier", "oxfmt"],
41
+ defaultFormatter: "biome",
42
+ defaultWhenUnconfigured: true,
43
+ gate: "smart-default"
44
+ }
45
+ ],
46
+ [
47
+ ".ts",
48
+ {
49
+ formatterNames: ["biome", "prettier", "oxfmt"],
50
+ defaultFormatter: "biome",
51
+ defaultWhenUnconfigured: true,
52
+ gate: "smart-default"
53
+ }
54
+ ],
55
+ [
56
+ ".tsx",
57
+ {
58
+ formatterNames: ["biome", "prettier", "oxfmt"],
59
+ defaultFormatter: "biome",
60
+ defaultWhenUnconfigured: true,
61
+ gate: "smart-default"
62
+ }
63
+ ],
64
+ [
65
+ ".mts",
66
+ {
67
+ formatterNames: ["biome", "prettier", "oxfmt"],
68
+ defaultFormatter: "biome",
69
+ defaultWhenUnconfigured: true,
70
+ gate: "smart-default"
71
+ }
72
+ ],
73
+ [
74
+ ".cts",
75
+ {
76
+ formatterNames: ["biome", "prettier", "oxfmt"],
77
+ defaultFormatter: "biome",
78
+ defaultWhenUnconfigured: true,
79
+ gate: "smart-default"
80
+ }
81
+ ],
82
+ [
83
+ ".py",
84
+ {
85
+ formatterNames: ["black", "ruff"],
86
+ defaultFormatter: "ruff",
87
+ defaultWhenUnconfigured: true,
88
+ gate: "smart-default"
89
+ }
90
+ ],
91
+ [
92
+ ".pyi",
93
+ {
94
+ formatterNames: ["black", "ruff"],
95
+ defaultFormatter: "ruff",
96
+ defaultWhenUnconfigured: true,
97
+ gate: "smart-default"
98
+ }
99
+ ],
100
+ [
101
+ ".json",
102
+ {
103
+ formatterNames: ["biome", "prettier"],
104
+ defaultFormatter: "biome",
105
+ defaultWhenUnconfigured: false,
106
+ gate: "mixed"
107
+ }
108
+ ],
109
+ [
110
+ ".jsonc",
111
+ {
112
+ formatterNames: ["biome", "prettier"],
113
+ defaultFormatter: "biome",
114
+ defaultWhenUnconfigured: false,
115
+ gate: "mixed"
116
+ }
117
+ ],
118
+ [
119
+ ".css",
120
+ {
121
+ formatterNames: ["biome", "prettier", "oxfmt"],
122
+ defaultFormatter: "biome",
123
+ defaultWhenUnconfigured: true,
124
+ gate: "smart-default"
125
+ }
126
+ ],
127
+ [
128
+ ".scss",
129
+ {
130
+ formatterNames: ["biome", "prettier", "oxfmt"],
131
+ defaultFormatter: "biome",
132
+ defaultWhenUnconfigured: true,
133
+ gate: "smart-default"
134
+ }
135
+ ],
136
+ [
137
+ ".sass",
138
+ {
139
+ formatterNames: ["biome", "prettier"],
140
+ defaultFormatter: "biome",
141
+ defaultWhenUnconfigured: true,
142
+ gate: "smart-default"
143
+ }
144
+ ],
145
+ [
146
+ ".less",
147
+ {
148
+ formatterNames: ["prettier"],
149
+ defaultFormatter: "prettier",
150
+ defaultWhenUnconfigured: true,
151
+ gate: "smart-default"
152
+ }
153
+ ],
154
+ [
155
+ ".html",
156
+ {
157
+ formatterNames: ["prettier"],
158
+ defaultFormatter: "prettier",
159
+ defaultWhenUnconfigured: false,
160
+ gate: "smart-default"
161
+ }
162
+ ],
163
+ [
164
+ ".htm",
165
+ {
166
+ formatterNames: ["prettier"],
167
+ defaultFormatter: "prettier",
168
+ defaultWhenUnconfigured: false,
169
+ gate: "smart-default"
170
+ }
171
+ ],
172
+ [
173
+ ".yaml",
174
+ {
175
+ formatterNames: ["prettier"],
176
+ defaultFormatter: "prettier",
177
+ defaultWhenUnconfigured: false,
178
+ gate: "smart-default"
179
+ }
180
+ ],
181
+ [
182
+ ".yml",
183
+ {
184
+ formatterNames: ["prettier"],
185
+ defaultFormatter: "prettier",
186
+ defaultWhenUnconfigured: false,
187
+ gate: "smart-default"
188
+ }
189
+ ],
190
+ [
191
+ ".md",
192
+ {
193
+ formatterNames: ["prettier"],
194
+ defaultFormatter: "prettier",
195
+ defaultWhenUnconfigured: false,
196
+ gate: "smart-default"
197
+ }
198
+ ],
199
+ [
200
+ ".mdx",
201
+ {
202
+ formatterNames: ["prettier"],
203
+ defaultFormatter: "prettier",
204
+ defaultWhenUnconfigured: false,
205
+ gate: "smart-default"
206
+ }
207
+ ],
208
+ [
209
+ ".graphql",
210
+ {
211
+ formatterNames: ["prettier"],
212
+ defaultFormatter: "prettier",
213
+ defaultWhenUnconfigured: true,
214
+ gate: "smart-default"
215
+ }
216
+ ],
217
+ [
218
+ ".gql",
219
+ {
220
+ formatterNames: ["prettier"],
221
+ defaultFormatter: "prettier",
222
+ defaultWhenUnconfigured: true,
223
+ gate: "smart-default"
224
+ }
225
+ ],
226
+ [
227
+ ".kt",
228
+ {
229
+ formatterNames: ["ktfmt", "ktlint"],
230
+ defaultFormatter: "ktlint",
231
+ defaultWhenUnconfigured: false,
232
+ gate: "smart-default"
233
+ }
234
+ ],
235
+ [
236
+ ".kts",
237
+ {
238
+ formatterNames: ["ktfmt", "ktlint"],
239
+ defaultFormatter: "ktlint",
240
+ defaultWhenUnconfigured: false,
241
+ gate: "smart-default"
242
+ }
243
+ ],
244
+ [
245
+ ".swift",
246
+ {
247
+ formatterNames: ["swiftformat"],
248
+ defaultFormatter: "swiftformat",
249
+ defaultWhenUnconfigured: false,
250
+ gate: "config-first"
251
+ }
252
+ ],
253
+ [
254
+ ".fs",
255
+ {
256
+ formatterNames: ["fantomas"],
257
+ defaultFormatter: "fantomas",
258
+ defaultWhenUnconfigured: false,
259
+ gate: "config-first"
260
+ }
261
+ ],
262
+ [
263
+ ".fsi",
264
+ {
265
+ formatterNames: ["fantomas"],
266
+ defaultFormatter: "fantomas",
267
+ defaultWhenUnconfigured: false,
268
+ gate: "config-first"
269
+ }
270
+ ],
271
+ [
272
+ ".fsx",
273
+ {
274
+ formatterNames: ["fantomas"],
275
+ defaultFormatter: "fantomas",
276
+ defaultWhenUnconfigured: false,
277
+ gate: "config-first"
278
+ }
279
+ ],
280
+ [
281
+ ".nix",
282
+ {
283
+ formatterNames: ["nixfmt"],
284
+ defaultFormatter: "nixfmt",
285
+ defaultWhenUnconfigured: false,
286
+ gate: "smart-default"
287
+ }
288
+ ],
289
+ [
290
+ ".ex",
291
+ {
292
+ formatterNames: ["mix"],
293
+ defaultFormatter: "mix",
294
+ defaultWhenUnconfigured: false,
295
+ gate: "config-first"
296
+ }
297
+ ],
298
+ [
299
+ ".exs",
300
+ {
301
+ formatterNames: ["mix"],
302
+ defaultFormatter: "mix",
303
+ defaultWhenUnconfigured: false,
304
+ gate: "config-first"
305
+ }
306
+ ],
307
+ [
308
+ ".eex",
309
+ {
310
+ formatterNames: ["mix"],
311
+ defaultFormatter: "mix",
312
+ defaultWhenUnconfigured: false,
313
+ gate: "config-first"
314
+ }
315
+ ],
316
+ [
317
+ ".heex",
318
+ {
319
+ formatterNames: ["mix"],
320
+ defaultFormatter: "mix",
321
+ defaultWhenUnconfigured: false,
322
+ gate: "config-first"
323
+ }
324
+ ],
325
+ [
326
+ ".leex",
327
+ {
328
+ formatterNames: ["mix"],
329
+ defaultFormatter: "mix",
330
+ defaultWhenUnconfigured: false,
331
+ gate: "config-first"
332
+ }
333
+ ],
334
+ [
335
+ ".gleam",
336
+ {
337
+ formatterNames: ["gleam"],
338
+ defaultFormatter: "gleam",
339
+ defaultWhenUnconfigured: true,
340
+ gate: "smart-default"
341
+ }
342
+ ],
343
+ [
344
+ ".typ",
345
+ {
346
+ formatterNames: ["typstyle"],
347
+ defaultFormatter: "typstyle",
348
+ defaultWhenUnconfigured: true,
349
+ gate: "smart-default"
350
+ }
351
+ ],
352
+ [
353
+ ".typc",
354
+ {
355
+ formatterNames: ["typstyle"],
356
+ defaultFormatter: "typstyle",
357
+ defaultWhenUnconfigured: true,
358
+ gate: "smart-default"
359
+ }
360
+ ],
361
+ [
362
+ ".c",
363
+ {
364
+ formatterNames: ["clang-format"],
365
+ defaultFormatter: "clang-format",
366
+ defaultWhenUnconfigured: false,
367
+ gate: "config-first"
368
+ }
369
+ ],
370
+ [
371
+ ".cc",
372
+ {
373
+ formatterNames: ["clang-format"],
374
+ defaultFormatter: "clang-format",
375
+ defaultWhenUnconfigured: false,
376
+ gate: "config-first"
377
+ }
378
+ ],
379
+ [
380
+ ".cpp",
381
+ {
382
+ formatterNames: ["clang-format"],
383
+ defaultFormatter: "clang-format",
384
+ defaultWhenUnconfigured: false,
385
+ gate: "config-first"
386
+ }
387
+ ],
388
+ [
389
+ ".cxx",
390
+ {
391
+ formatterNames: ["clang-format"],
392
+ defaultFormatter: "clang-format",
393
+ defaultWhenUnconfigured: false,
394
+ gate: "config-first"
395
+ }
396
+ ],
397
+ [
398
+ ".h",
399
+ {
400
+ formatterNames: ["clang-format"],
401
+ defaultFormatter: "clang-format",
402
+ defaultWhenUnconfigured: false,
403
+ gate: "config-first"
404
+ }
405
+ ],
406
+ [
407
+ ".hpp",
408
+ {
409
+ formatterNames: ["clang-format"],
410
+ defaultFormatter: "clang-format",
411
+ defaultWhenUnconfigured: false,
412
+ gate: "config-first"
413
+ }
414
+ ],
415
+ [
416
+ ".ino",
417
+ {
418
+ formatterNames: ["clang-format"],
419
+ defaultFormatter: "clang-format",
420
+ defaultWhenUnconfigured: false,
421
+ gate: "config-first"
422
+ }
423
+ ],
424
+ [
425
+ ".php",
426
+ {
427
+ formatterNames: ["php-cs-fixer"],
428
+ defaultFormatter: "php-cs-fixer",
429
+ defaultWhenUnconfigured: false,
430
+ gate: "config-first"
431
+ }
432
+ ],
433
+ [
434
+ ".cs",
435
+ {
436
+ formatterNames: ["csharpier"],
437
+ defaultFormatter: "csharpier",
438
+ defaultWhenUnconfigured: false,
439
+ gate: "config-first"
440
+ }
441
+ ],
442
+ [
443
+ ".lua",
444
+ {
445
+ formatterNames: ["stylua"],
446
+ defaultFormatter: "stylua",
447
+ defaultWhenUnconfigured: false,
448
+ gate: "config-first"
449
+ }
450
+ ],
451
+ [
452
+ ".hs",
453
+ {
454
+ formatterNames: ["ormolu"],
455
+ defaultFormatter: "ormolu",
456
+ defaultWhenUnconfigured: false,
457
+ gate: "config-first"
458
+ }
459
+ ],
460
+ [
461
+ ".lhs",
462
+ {
463
+ formatterNames: ["ormolu"],
464
+ defaultFormatter: "ormolu",
465
+ defaultWhenUnconfigured: false,
466
+ gate: "config-first"
467
+ }
468
+ ],
469
+ [
470
+ ".ml",
471
+ {
472
+ formatterNames: ["ocamlformat"],
473
+ defaultFormatter: "ocamlformat",
474
+ defaultWhenUnconfigured: false,
475
+ gate: "config-first"
476
+ }
477
+ ],
478
+ [
479
+ ".mli",
480
+ {
481
+ formatterNames: ["ocamlformat"],
482
+ defaultFormatter: "ocamlformat",
483
+ defaultWhenUnconfigured: false,
484
+ gate: "config-first"
485
+ }
486
+ ],
487
+ [
488
+ ".go",
489
+ {
490
+ formatterNames: ["gofmt"],
491
+ defaultFormatter: "gofmt",
492
+ defaultWhenUnconfigured: true,
493
+ gate: "smart-default"
494
+ }
495
+ ],
496
+ [
497
+ ".rs",
498
+ {
499
+ formatterNames: ["rustfmt"],
500
+ defaultFormatter: "rustfmt",
501
+ defaultWhenUnconfigured: true,
502
+ gate: "smart-default"
503
+ }
504
+ ],
505
+ [
506
+ ".sh",
507
+ {
508
+ formatterNames: ["shfmt"],
509
+ defaultFormatter: "shfmt",
510
+ defaultWhenUnconfigured: true,
511
+ gate: "smart-default"
512
+ }
513
+ ],
514
+ [
515
+ ".bash",
516
+ {
517
+ formatterNames: ["shfmt"],
518
+ defaultFormatter: "shfmt",
519
+ defaultWhenUnconfigured: true,
520
+ gate: "smart-default"
521
+ }
522
+ ],
523
+ [
524
+ ".toml",
525
+ {
526
+ formatterNames: ["taplo"],
527
+ defaultFormatter: "taplo",
528
+ defaultWhenUnconfigured: false,
529
+ gate: "config-first"
530
+ }
531
+ ],
532
+ [
533
+ ".tf",
534
+ {
535
+ formatterNames: ["terraform"],
536
+ defaultFormatter: "terraform",
537
+ defaultWhenUnconfigured: false,
538
+ gate: "config-first"
539
+ }
540
+ ],
541
+ [
542
+ ".tfvars",
543
+ {
544
+ formatterNames: ["terraform"],
545
+ defaultFormatter: "terraform",
546
+ defaultWhenUnconfigured: false,
547
+ gate: "config-first"
548
+ }
549
+ ],
550
+ [
551
+ ".dart",
552
+ {
553
+ formatterNames: ["dart"],
554
+ defaultFormatter: "dart",
555
+ defaultWhenUnconfigured: true,
556
+ gate: "smart-default"
557
+ }
558
+ ],
559
+ [
560
+ ".zig",
561
+ {
562
+ formatterNames: ["zig"],
563
+ defaultFormatter: "zig",
564
+ defaultWhenUnconfigured: true,
565
+ gate: "smart-default"
566
+ }
567
+ ],
568
+ [
569
+ ".zon",
570
+ {
571
+ formatterNames: ["zig"],
572
+ defaultFormatter: "zig",
573
+ defaultWhenUnconfigured: true,
574
+ gate: "smart-default"
575
+ }
576
+ ],
577
+ [
578
+ ".java",
579
+ {
580
+ formatterNames: ["google-java-format"],
581
+ defaultFormatter: "google-java-format",
582
+ defaultWhenUnconfigured: false,
583
+ gate: "config-first"
584
+ }
585
+ ],
586
+ [
587
+ ".clj",
588
+ {
589
+ formatterNames: ["cljfmt"],
590
+ defaultFormatter: "cljfmt",
591
+ defaultWhenUnconfigured: false,
592
+ gate: "config-first"
593
+ }
594
+ ],
595
+ [
596
+ ".cljc",
597
+ {
598
+ formatterNames: ["cljfmt"],
599
+ defaultFormatter: "cljfmt",
600
+ defaultWhenUnconfigured: false,
601
+ gate: "config-first"
602
+ }
603
+ ],
604
+ [
605
+ ".cljs",
606
+ {
607
+ formatterNames: ["cljfmt"],
608
+ defaultFormatter: "cljfmt",
609
+ defaultWhenUnconfigured: false,
610
+ gate: "config-first"
611
+ }
612
+ ],
613
+ [
614
+ ".cmake",
615
+ {
616
+ formatterNames: ["cmake-format"],
617
+ defaultFormatter: "cmake-format",
618
+ defaultWhenUnconfigured: false,
619
+ gate: "config-first"
620
+ }
621
+ ],
622
+ [
623
+ ".ps1",
624
+ {
625
+ formatterNames: ["psscriptanalyzer-format"],
626
+ defaultFormatter: "psscriptanalyzer-format",
627
+ defaultWhenUnconfigured: false,
628
+ gate: "smart-default"
629
+ }
630
+ ],
631
+ [
632
+ ".psm1",
633
+ {
634
+ formatterNames: ["psscriptanalyzer-format"],
635
+ defaultFormatter: "psscriptanalyzer-format",
636
+ defaultWhenUnconfigured: false,
637
+ gate: "smart-default"
638
+ }
639
+ ],
640
+ [
641
+ ".psd1",
642
+ {
643
+ formatterNames: ["psscriptanalyzer-format"],
644
+ defaultFormatter: "psscriptanalyzer-format",
645
+ defaultWhenUnconfigured: false,
646
+ gate: "smart-default"
647
+ }
648
+ ],
649
+ [
650
+ ".cue",
651
+ {
652
+ formatterNames: ["cue"],
653
+ defaultFormatter: "cue",
654
+ defaultWhenUnconfigured: true,
655
+ gate: "smart-default"
656
+ }
657
+ ]
658
+ ]);
659
+ export const OXFMT_SUPPORTED_EXTENSIONS = new Set([
660
+ ".js",
661
+ ".jsx",
662
+ ".mjs",
663
+ ".cjs",
664
+ ".ts",
665
+ ".tsx",
666
+ ".mts",
667
+ ".cts",
668
+ ".vue",
669
+ ".svelte",
670
+ ".css",
671
+ ".scss",
672
+ ".less",
673
+ ".html",
674
+ ".htm",
675
+ ".json",
676
+ ".jsonc",
677
+ ".yaml",
678
+ ".yml",
679
+ ".md",
680
+ ".mdx",
681
+ ".graphql",
682
+ ".gql",
683
+ ".toml"
684
+ ]);
685
+ FORMATTER_POLICY_BY_EXTENSION.set(".vue", {
686
+ formatterNames: ["prettier"],
687
+ defaultFormatter: "prettier",
688
+ defaultWhenUnconfigured: false,
689
+ gate: "config-first"
690
+ });
691
+ FORMATTER_POLICY_BY_EXTENSION.set(".svelte", {
692
+ formatterNames: [],
693
+ defaultFormatter: "oxfmt",
694
+ defaultWhenUnconfigured: false,
695
+ gate: "config-first"
696
+ });
697
+ for (const [ext, policy] of FORMATTER_POLICY_BY_EXTENSION) {
698
+ if (OXFMT_SUPPORTED_EXTENSIONS.has(ext) && !policy.formatterNames.includes("oxfmt")) {
699
+ policy.formatterNames.push("oxfmt");
700
+ }
701
+ }
702
+ const AUTO_INSTALLABLE_DEFAULT_FORMATTERS = new Map([
703
+ ["biome", "biome"],
704
+ ["ruff", "ruff"],
705
+ ["prettier", "prettier"],
706
+ ["shfmt", "shfmt"],
707
+ ["taplo", "taplo"],
708
+ ["ktlint", "ktlint"],
709
+ ["typstyle", "typstyle"]
710
+ ]);
711
+ const TERRAGRUNT_FORMATTER_POLICY = {
712
+ formatterNames: ["terragrunt-hcl"],
713
+ defaultFormatter: "terragrunt-hcl",
714
+ defaultWhenUnconfigured: true,
715
+ gate: "smart-default"
716
+ };
717
+ const FORMATTER_POLICY_BY_FILENAME = new Map(TERRAGRUNT_FILENAMES.map((name) => [name, TERRAGRUNT_FORMATTER_POLICY]));
718
+
719
+ export { AUTO_INSTALLABLE_DEFAULT_FORMATTERS, FORMATTER_POLICY_BY_EXTENSION, FORMATTER_POLICY_BY_FILENAME };
720
+ function getFormatterPolicyForExtension(ext) {
721
+ return FORMATTER_POLICY_BY_EXTENSION.get(ext.toLowerCase());
722
+ }
723
+ export function getFormatterPolicyForFile(filePath) {
724
+ const byFilename = FORMATTER_POLICY_BY_FILENAME.get(path.basename(filePath).toLowerCase());
725
+ if (byFilename)
726
+ return byFilename;
727
+ return getFormatterPolicyForExtension(path.extname(filePath));
728
+ }
729
+ export function getSmartDefaultFormatterName(filePath) {
730
+ const policy = getFormatterPolicyForFile(filePath);
731
+ if (!policy?.defaultWhenUnconfigured)
732
+ return;
733
+ return policy.defaultFormatter;
734
+ }
735
+ export function getAutoInstallToolIdForFormatter(formatterName) {
736
+ return AUTO_INSTALLABLE_DEFAULT_FORMATTERS.get(formatterName);
737
+ }
738
+ export function getToolExecutionPolicy(toolId) {
739
+ return TOOL_EXECUTION_POLICY.get(toolId);
740
+ }
741
+ export function shouldAutoInstallTool(toolId) {
742
+ return getToolExecutionPolicy(toolId)?.autoInstall ?? false;
743
+ }
744
+ export function getAutofixCapability(toolId) {
745
+ return AUTOFIX_CAPABILITIES.get(toolId);
746
+ }
747
+ export function listSafePipelineAutofixTools() {
748
+ return [...AUTOFIX_CAPABILITIES.entries()].filter(([, cap]) => cap.safePipelineAutofix).map(([id]) => id);
749
+ }
750
+ export function getToolCommandSpec(toolId) {
751
+ return TOOL_COMMAND_SPECS.get(toolId);
752
+ }
753
+ const AUTOFIX_CAPABILITIES = new Map([
754
+ [
755
+ "biome",
756
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
757
+ ],
758
+ [
759
+ "eslint",
760
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
761
+ ],
762
+ [
763
+ "ruff",
764
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
765
+ ],
766
+ [
767
+ "stylelint",
768
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
769
+ ],
770
+ [
771
+ "sqlfluff",
772
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
773
+ ],
774
+ [
775
+ "rubocop",
776
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
777
+ ],
778
+ [
779
+ "ktlint",
780
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
781
+ ],
782
+ [
783
+ "ktfmt",
784
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
785
+ ],
786
+ [
787
+ "rust-clippy",
788
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
789
+ ],
790
+ [
791
+ "dart-analyze",
792
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
793
+ ],
794
+ [
795
+ "golangci-lint",
796
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
797
+ ],
798
+ [
799
+ "detekt",
800
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
801
+ ],
802
+ [
803
+ "markdownlint",
804
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
805
+ ],
806
+ [
807
+ "oxlint",
808
+ { toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
809
+ ]
810
+ ]);
811
+ const TOOL_EXECUTION_POLICY = new Map([
812
+ ["pyright", { gate: "smart-default", autoInstall: true }],
813
+ ["shellcheck", { gate: "smart-default", autoInstall: true }],
814
+ ["shfmt", { gate: "smart-default", autoInstall: true }],
815
+ ["tflint", { gate: "smart-default", autoInstall: true }],
816
+ ["terragrunt", { gate: "smart-default", autoInstall: true }],
817
+ ["trivy", { gate: "config-first", autoInstall: true }],
818
+ ["biome", { gate: "smart-default", autoInstall: true }],
819
+ ["ruff", { gate: "smart-default", autoInstall: true }],
820
+ ["jscpd", { gate: "smart-default", autoInstall: true }],
821
+ ["madge", { gate: "smart-default", autoInstall: true }],
822
+ ["knip", { gate: "smart-default", autoInstall: true }],
823
+ ["ast-grep", { gate: "smart-default", autoInstall: true }],
824
+ ["oxlint", { gate: "smart-default", autoInstall: true }],
825
+ ["stylelint", { gate: "smart-default", autoInstall: true }],
826
+ ["sqlfluff", { gate: "smart-default", autoInstall: true }],
827
+ ["rubocop", { gate: "smart-default", autoInstall: true }],
828
+ ["yamllint", { gate: "smart-default", autoInstall: true }],
829
+ ["actionlint", { gate: "smart-default", autoInstall: true }],
830
+ ["markdownlint", { gate: "smart-default", autoInstall: true }],
831
+ ["mypy", { gate: "config-first", autoInstall: true }],
832
+ ["taplo", { gate: "smart-default", autoInstall: true }],
833
+ ["hadolint", { gate: "smart-default", autoInstall: true }],
834
+ ["helm", { gate: "smart-default", autoInstall: true }],
835
+ ["htmlhint", { gate: "smart-default", autoInstall: true }],
836
+ ["ktlint", { gate: "smart-default", autoInstall: true }],
837
+ ["ktfmt", { gate: "config-first", autoInstall: true }],
838
+ ["golangci-lint", { gate: "config-first", autoInstall: true }],
839
+ ["spotbugs", { gate: "config-first", autoInstall: true }],
840
+ ["opengrep", { gate: "config-first", autoInstall: true }],
841
+ ["phpstan", { gate: "config-first", autoInstall: false }],
842
+ ["eslint", { gate: "config-first", autoInstall: false }],
843
+ ["prettier", { gate: "smart-default", autoInstall: true }],
844
+ ["vale", { gate: "config-first", autoInstall: false }],
845
+ ["swiftlint", { gate: "smart-default", autoInstall: true }]
846
+ ]);
847
+ const TOOL_COMMAND_SPECS = new Map([
848
+ [
849
+ "eslint",
850
+ {
851
+ command: "eslint",
852
+ windowsExt: ".cmd",
853
+ versionArgs: ["--version"],
854
+ managedToolId: "eslint"
855
+ }
856
+ ],
857
+ [
858
+ "stylelint",
859
+ {
860
+ command: "stylelint",
861
+ windowsExt: ".cmd",
862
+ versionArgs: ["--version"],
863
+ managedToolId: "stylelint"
864
+ }
865
+ ],
866
+ [
867
+ "sqlfluff",
868
+ {
869
+ command: "sqlfluff",
870
+ windowsExt: ".exe",
871
+ versionArgs: ["--version"],
872
+ managedToolId: "sqlfluff"
873
+ }
874
+ ],
875
+ [
876
+ "oxlint",
877
+ {
878
+ command: "oxlint",
879
+ windowsExt: ".exe",
880
+ versionArgs: ["--version"],
881
+ managedToolId: "oxlint"
882
+ }
883
+ ],
884
+ [
885
+ "ruff",
886
+ {
887
+ command: "ruff",
888
+ windowsExt: ".exe",
889
+ versionArgs: ["--version"],
890
+ managedToolId: "ruff"
891
+ }
892
+ ],
893
+ [
894
+ "biome",
895
+ {
896
+ command: "biome",
897
+ windowsExt: ".cmd",
898
+ versionArgs: ["--version"],
899
+ managedToolId: "biome"
900
+ }
901
+ ],
902
+ [
903
+ "rubocop",
904
+ {
905
+ command: "rubocop",
906
+ versionArgs: ["--version"],
907
+ managedToolId: "rubocop"
908
+ }
909
+ ],
910
+ [
911
+ "yamllint",
912
+ {
913
+ command: "yamllint",
914
+ windowsExt: ".exe",
915
+ versionArgs: ["--version"],
916
+ managedToolId: "yamllint"
917
+ }
918
+ ],
919
+ [
920
+ "actionlint",
921
+ {
922
+ command: "actionlint",
923
+ windowsExt: ".exe",
924
+ versionArgs: ["--version"],
925
+ managedToolId: "actionlint"
926
+ }
927
+ ],
928
+ [
929
+ "markdownlint",
930
+ {
931
+ command: "markdownlint-cli2",
932
+ windowsExt: ".cmd",
933
+ versionArgs: ["--no-globs", "-"],
934
+ managedToolId: "markdownlint"
935
+ }
936
+ ],
937
+ [
938
+ "vale",
939
+ {
940
+ command: "vale",
941
+ windowsExt: ".exe",
942
+ versionArgs: ["--version"],
943
+ managedToolId: "vale"
944
+ }
945
+ ],
946
+ [
947
+ "swiftlint",
948
+ {
949
+ command: "swiftlint",
950
+ versionArgs: ["--version"],
951
+ managedToolId: "swiftlint"
952
+ }
953
+ ],
954
+ [
955
+ "mypy",
956
+ {
957
+ command: "mypy",
958
+ versionArgs: ["--version"],
959
+ managedToolId: "mypy"
960
+ }
961
+ ],
962
+ [
963
+ "phpstan",
964
+ {
965
+ command: "phpstan",
966
+ windowsExt: ".bat",
967
+ versionArgs: ["--version"],
968
+ managedToolId: "phpstan"
969
+ }
970
+ ],
971
+ [
972
+ "taplo",
973
+ {
974
+ command: "taplo",
975
+ windowsExt: ".exe",
976
+ versionArgs: ["--version"],
977
+ managedToolId: "taplo"
978
+ }
979
+ ],
980
+ [
981
+ "hadolint",
982
+ {
983
+ command: "hadolint",
984
+ windowsExt: ".exe",
985
+ versionArgs: ["--version"],
986
+ managedToolId: "hadolint"
987
+ }
988
+ ],
989
+ [
990
+ "htmlhint",
991
+ {
992
+ command: "htmlhint",
993
+ versionArgs: ["--version"],
994
+ managedToolId: "htmlhint"
995
+ }
996
+ ],
997
+ [
998
+ "ktlint",
999
+ {
1000
+ command: "ktlint",
1001
+ windowsExt: ".exe",
1002
+ versionArgs: ["--version"],
1003
+ managedToolId: "ktlint"
1004
+ }
1005
+ ],
1006
+ [
1007
+ "prettier",
1008
+ {
1009
+ command: "prettier",
1010
+ windowsExt: ".cmd",
1011
+ versionArgs: ["--version"],
1012
+ managedToolId: "prettier"
1013
+ }
1014
+ ]
1015
+ ]);
1016
+ const STYLELINT_CONFIGS = [
1017
+ ".stylelintrc",
1018
+ ".stylelintrc.json",
1019
+ ".stylelintrc.jsonc",
1020
+ ".stylelintrc.yaml",
1021
+ ".stylelintrc.yml",
1022
+ ".stylelintrc.js",
1023
+ ".stylelintrc.cjs",
1024
+ "stylelint.config.js",
1025
+ "stylelint.config.cjs",
1026
+ "stylelint.config.mjs"
1027
+ ];
1028
+ const SQLFLUFF_CONFIGS = [
1029
+ ".sqlfluff",
1030
+ "pyproject.toml",
1031
+ "setup.cfg",
1032
+ "tox.ini"
1033
+ ];
1034
+ const RUBOCOP_CONFIGS = [".rubocop.yml", ".rubocop.yaml"];
1035
+ const MYPY_CONFIGS = ["mypy.ini", ".mypy.ini", "setup.cfg", "pyproject.toml"];
1036
+ const YAMLLINT_CONFIGS = [
1037
+ ".yamllint",
1038
+ ".yamllint.yml",
1039
+ ".yamllint.yaml",
1040
+ "pyproject.toml",
1041
+ "setup.cfg",
1042
+ "tox.ini"
1043
+ ];
1044
+ const MARKDOWNLINT_CONFIGS = [
1045
+ ".markdownlint-cli2.jsonc",
1046
+ ".markdownlint-cli2.yaml",
1047
+ ".markdownlint-cli2.yml",
1048
+ ".markdownlint-cli2.cjs",
1049
+ ".markdownlint-cli2.mjs",
1050
+ ".markdownlint.jsonc",
1051
+ ".markdownlint.json",
1052
+ ".markdownlint.yaml",
1053
+ ".markdownlint.yml",
1054
+ ".markdownlint.cjs",
1055
+ ".markdownlint.mjs",
1056
+ ".markdownlintrc"
1057
+ ];
1058
+ const PRETTIER_CONFIGS = [
1059
+ ".prettierrc",
1060
+ ".prettierrc.json",
1061
+ ".prettierrc.yml",
1062
+ ".prettierrc.yaml",
1063
+ ".prettierrc.js",
1064
+ ".prettierrc.cjs",
1065
+ ".prettierrc.mjs",
1066
+ "prettier.config.js",
1067
+ "prettier.config.cjs",
1068
+ "prettier.config.mjs",
1069
+ "prettier.config.ts"
1070
+ ];
1071
+ const RUFF_PROJECT_CONFIGS = ["ruff.toml", ".ruff.toml"];
1072
+ const GOLANGCI_CONFIGS = [
1073
+ ".golangci.yml",
1074
+ ".golangci.yaml",
1075
+ ".golangci.toml",
1076
+ ".golangci.json"
1077
+ ];
1078
+ const PHPSTAN_CONFIGS = [
1079
+ "phpstan.neon",
1080
+ "phpstan.neon.dist",
1081
+ "phpstan.dist.neon"
1082
+ ];
1083
+ const VITE_CONFIGS = [
1084
+ "vite.config.ts",
1085
+ "vite.config.mts",
1086
+ "vite.config.cts",
1087
+ "vite.config.js",
1088
+ "vite.config.mjs",
1089
+ "vite.config.cjs"
1090
+ ];
1091
+ export function getLinterPolicyForFile(filePath, context = {}) {
1092
+ const ext = path.extname(filePath).toLowerCase();
1093
+ if ([".js", ".jsx", ".ts", ".tsx", ".mjs", ".cjs"].includes(ext)) {
1094
+ const policy = getJstsLintPolicy({
1095
+ hasEslintConfig: context.hasEslintConfig,
1096
+ hasOxlintConfig: context.hasOxlintConfig,
1097
+ hasBiomeConfig: context.hasBiomeConfig
1098
+ });
1099
+ return {
1100
+ runnerNames: ["eslint", "oxlint", "biome-check-json"],
1101
+ preferredRunners: policy.preferredRunners,
1102
+ defaultRunner: policy.preferredRunners[0],
1103
+ defaultWhenUnconfigured: !policy.hasEslintConfig && !policy.hasOxlintConfig,
1104
+ gate: policy.hasEslintConfig ? "config-first" : "smart-default"
1105
+ };
1106
+ }
1107
+ if ([".py", ".pyi"].includes(ext)) {
1108
+ const preferredRunners = ["ruff-lint"];
1109
+ if (context.hasMypyConfig)
1110
+ preferredRunners.push("mypy");
1111
+ return {
1112
+ runnerNames: ["ruff-lint", "mypy"],
1113
+ preferredRunners,
1114
+ defaultRunner: "ruff-lint",
1115
+ defaultWhenUnconfigured: true,
1116
+ gate: context.hasMypyConfig ? "mixed" : "smart-default"
1117
+ };
1118
+ }
1119
+ if ([".css", ".scss", ".sass", ".less"].includes(ext)) {
1120
+ return {
1121
+ runnerNames: ["stylelint"],
1122
+ preferredRunners: ["stylelint"],
1123
+ defaultRunner: "stylelint",
1124
+ defaultWhenUnconfigured: true,
1125
+ gate: "smart-default"
1126
+ };
1127
+ }
1128
+ if (ext === ".sql") {
1129
+ return {
1130
+ runnerNames: ["sqlfluff"],
1131
+ preferredRunners: ["sqlfluff"],
1132
+ defaultRunner: "sqlfluff",
1133
+ defaultWhenUnconfigured: false,
1134
+ gate: "config-first"
1135
+ };
1136
+ }
1137
+ if ([".rb", ".rake", ".gemspec", ".ru"].includes(ext)) {
1138
+ return {
1139
+ runnerNames: ["rubocop"],
1140
+ preferredRunners: ["rubocop"],
1141
+ defaultRunner: "rubocop",
1142
+ defaultWhenUnconfigured: true,
1143
+ gate: "smart-default"
1144
+ };
1145
+ }
1146
+ if ([".yaml", ".yml"].includes(ext)) {
1147
+ return {
1148
+ runnerNames: ["yamllint"],
1149
+ preferredRunners: ["yamllint"],
1150
+ defaultRunner: "yamllint",
1151
+ defaultWhenUnconfigured: true,
1152
+ gate: "smart-default"
1153
+ };
1154
+ }
1155
+ if ([".md", ".mdx"].includes(ext)) {
1156
+ return {
1157
+ runnerNames: ["markdownlint"],
1158
+ preferredRunners: ["markdownlint"],
1159
+ defaultRunner: "markdownlint",
1160
+ defaultWhenUnconfigured: true,
1161
+ gate: "smart-default"
1162
+ };
1163
+ }
1164
+ if ([".html", ".htm"].includes(ext)) {
1165
+ return {
1166
+ runnerNames: ["htmlhint"],
1167
+ preferredRunners: ["htmlhint"],
1168
+ defaultRunner: "htmlhint",
1169
+ defaultWhenUnconfigured: true,
1170
+ gate: "smart-default"
1171
+ };
1172
+ }
1173
+ if (path.basename(filePath).toLowerCase() === "dockerfile") {
1174
+ return {
1175
+ runnerNames: ["hadolint"],
1176
+ preferredRunners: ["hadolint"],
1177
+ defaultRunner: "hadolint",
1178
+ defaultWhenUnconfigured: true,
1179
+ gate: "smart-default"
1180
+ };
1181
+ }
1182
+ if (TERRAGRUNT_FILENAMES.includes(path.basename(filePath).toLowerCase())) {
1183
+ return {
1184
+ runnerNames: ["terragrunt"],
1185
+ preferredRunners: ["terragrunt"],
1186
+ defaultRunner: "terragrunt",
1187
+ defaultWhenUnconfigured: true,
1188
+ gate: "smart-default"
1189
+ };
1190
+ }
1191
+ if ([".kt", ".kts"].includes(ext)) {
1192
+ const preferredRunners = [];
1193
+ if (!context.hasKtfmtConfig)
1194
+ preferredRunners.push("ktlint");
1195
+ if (context.hasDetektConfig)
1196
+ preferredRunners.push("detekt");
1197
+ return {
1198
+ runnerNames: ["ktlint", "detekt"],
1199
+ preferredRunners,
1200
+ defaultRunner: preferredRunners[0],
1201
+ defaultWhenUnconfigured: true,
1202
+ gate: context.hasKtfmtConfig ? "config-first" : context.hasDetektConfig ? "mixed" : "smart-default"
1203
+ };
1204
+ }
1205
+ if (ext === ".toml") {
1206
+ return {
1207
+ runnerNames: ["taplo"],
1208
+ preferredRunners: ["taplo"],
1209
+ defaultRunner: "taplo",
1210
+ defaultWhenUnconfigured: true,
1211
+ gate: "smart-default"
1212
+ };
1213
+ }
1214
+ if (ext === ".go") {
1215
+ return {
1216
+ runnerNames: ["golangci-lint"],
1217
+ preferredRunners: context.hasGolangciConfig ? ["golangci-lint"] : [],
1218
+ defaultRunner: "golangci-lint",
1219
+ defaultWhenUnconfigured: false,
1220
+ gate: "config-first"
1221
+ };
1222
+ }
1223
+ if (ext === ".php") {
1224
+ return {
1225
+ runnerNames: ["phpstan"],
1226
+ preferredRunners: context.hasPhpstanConfig ? ["phpstan"] : [],
1227
+ defaultRunner: "phpstan",
1228
+ defaultWhenUnconfigured: false,
1229
+ gate: "config-first"
1230
+ };
1231
+ }
1232
+ if (ext === ".rs") {
1233
+ return {
1234
+ runnerNames: ["rust-clippy"],
1235
+ preferredRunners: ["rust-clippy"],
1236
+ defaultRunner: "rust-clippy",
1237
+ defaultWhenUnconfigured: true,
1238
+ gate: "smart-default"
1239
+ };
1240
+ }
1241
+ if ([".sh", ".bash"].includes(ext)) {
1242
+ return {
1243
+ runnerNames: ["shellcheck"],
1244
+ preferredRunners: ["shellcheck"],
1245
+ defaultRunner: "shellcheck",
1246
+ defaultWhenUnconfigured: true,
1247
+ gate: "smart-default"
1248
+ };
1249
+ }
1250
+ if (ext === ".fish") {
1251
+ return {
1252
+ runnerNames: ["fish-indent"],
1253
+ preferredRunners: ["fish-indent"],
1254
+ defaultRunner: "fish-indent",
1255
+ defaultWhenUnconfigured: true,
1256
+ gate: "smart-default"
1257
+ };
1258
+ }
1259
+ if ([".tf", ".tfvars"].includes(ext)) {
1260
+ return {
1261
+ runnerNames: ["tflint"],
1262
+ preferredRunners: ["tflint"],
1263
+ defaultRunner: "tflint",
1264
+ defaultWhenUnconfigured: true,
1265
+ gate: context.hasTflintConfig ? "config-first" : "smart-default"
1266
+ };
1267
+ }
1268
+ if ([".ex", ".exs", ".eex", ".heex", ".leex"].includes(ext)) {
1269
+ return {
1270
+ runnerNames: ["credo"],
1271
+ preferredRunners: ["credo"],
1272
+ defaultRunner: "credo",
1273
+ defaultWhenUnconfigured: true,
1274
+ gate: "smart-default"
1275
+ };
1276
+ }
1277
+ if ([".c", ".cc", ".cpp", ".cxx", ".h", ".hpp", ".ino"].includes(ext)) {
1278
+ return {
1279
+ runnerNames: ["cpp-check"],
1280
+ preferredRunners: ["cpp-check"],
1281
+ defaultRunner: "cpp-check",
1282
+ defaultWhenUnconfigured: true,
1283
+ gate: "smart-default"
1284
+ };
1285
+ }
1286
+ if (ext === ".dart") {
1287
+ return {
1288
+ runnerNames: ["dart-analyze"],
1289
+ preferredRunners: ["dart-analyze"],
1290
+ defaultRunner: "dart-analyze",
1291
+ defaultWhenUnconfigured: true,
1292
+ gate: "smart-default"
1293
+ };
1294
+ }
1295
+ if (ext === ".gleam") {
1296
+ return {
1297
+ runnerNames: ["gleam-check"],
1298
+ preferredRunners: ["gleam-check"],
1299
+ defaultRunner: "gleam-check",
1300
+ defaultWhenUnconfigured: true,
1301
+ gate: "smart-default"
1302
+ };
1303
+ }
1304
+ if ([".ps1", ".psm1", ".psd1"].includes(ext)) {
1305
+ return {
1306
+ runnerNames: ["psscriptanalyzer"],
1307
+ preferredRunners: ["psscriptanalyzer"],
1308
+ defaultRunner: "psscriptanalyzer",
1309
+ defaultWhenUnconfigured: true,
1310
+ gate: "smart-default"
1311
+ };
1312
+ }
1313
+ if (ext === ".prisma") {
1314
+ return {
1315
+ runnerNames: ["prisma-validate"],
1316
+ preferredRunners: ["prisma-validate"],
1317
+ defaultRunner: "prisma-validate",
1318
+ defaultWhenUnconfigured: true,
1319
+ gate: "smart-default"
1320
+ };
1321
+ }
1322
+ return;
1323
+ }
1324
+ export function getCachedProjectConventions(cwd) {
1325
+ const snapshot = loadProjectSnapshotWithoutWordIndex(cwd);
1326
+ return snapshot?.conventions;
1327
+ }
1328
+ export function getLinterPolicyForCwd(filePath, cwd) {
1329
+ const context = {
1330
+ hasEslintConfig: hasEslintConfig(cwd),
1331
+ hasOxlintConfig: hasOxlintConfig(cwd),
1332
+ hasBiomeConfig: hasBiomeConfig(cwd),
1333
+ hasStylelintConfig: hasStylelintConfig(cwd),
1334
+ hasSqlfluffConfig: hasSqlfluffConfig(cwd),
1335
+ hasRubocopConfig: hasRubocopConfig(cwd),
1336
+ hasYamllintConfig: hasYamllintConfig(cwd),
1337
+ hasMarkdownlintConfig: hasMarkdownlintConfig(cwd),
1338
+ hasGolangciConfig: hasGolangciConfig(cwd),
1339
+ hasPhpstanConfig: hasPhpstanConfig(cwd),
1340
+ hasMypyConfig: hasMypyConfig(cwd),
1341
+ hasDetektConfig: hasDetektConfig(cwd),
1342
+ hasKtfmtConfig: hasKtfmtConfig(cwd),
1343
+ hasTflintConfig: hasTflintConfig(path.dirname(path.resolve(cwd, filePath)))
1344
+ };
1345
+ const policy = getLinterPolicyForFile(filePath, context);
1346
+ if (policy) {
1347
+ const conventions = getCachedProjectConventions(cwd);
1348
+ if (conventions && conventions.frameworks.length > 0) {
1349
+ policy.frameworkHints = conventions.frameworks.map((f) => f.id);
1350
+ }
1351
+ }
1352
+ logLatency({
1353
+ type: "phase",
1354
+ phase: "linter_selected",
1355
+ filePath,
1356
+ durationMs: 0,
1357
+ metadata: {
1358
+ runner: policy?.defaultRunner ?? null,
1359
+ gate: policy?.gate ?? null,
1360
+ cwd,
1361
+ context,
1362
+ frameworkHints: policy?.frameworkHints ?? null
1363
+ }
1364
+ });
1365
+ return policy;
1366
+ }
1367
+ export function getAutofixPolicyForFile(filePath, context = {}) {
1368
+ const ext = path.extname(filePath).toLowerCase();
1369
+ if ([".js", ".jsx", ".ts", ".tsx", ".mjs", ".cjs"].includes(ext)) {
1370
+ if (context.hasEslintConfig) {
1371
+ return {
1372
+ toolNames: ["eslint", "oxlint", "biome"],
1373
+ preferredTools: ["eslint"],
1374
+ defaultTool: "eslint",
1375
+ defaultWhenUnconfigured: false,
1376
+ gate: "config-first",
1377
+ safe: true
1378
+ };
1379
+ }
1380
+ if (context.hasOxlintConfig) {
1381
+ return {
1382
+ toolNames: ["eslint", "oxlint", "biome"],
1383
+ preferredTools: ["oxlint"],
1384
+ defaultTool: "oxlint",
1385
+ defaultWhenUnconfigured: false,
1386
+ gate: "smart-default",
1387
+ safe: true
1388
+ };
1389
+ }
1390
+ return {
1391
+ toolNames: ["eslint", "oxlint", "biome"],
1392
+ preferredTools: ["biome"],
1393
+ defaultTool: "biome",
1394
+ defaultWhenUnconfigured: true,
1395
+ gate: "smart-default",
1396
+ safe: true
1397
+ };
1398
+ }
1399
+ if ([".json", ".jsonc"].includes(ext)) {
1400
+ if (!context.hasBiomeConfig) {
1401
+ return;
1402
+ }
1403
+ return {
1404
+ toolNames: ["biome"],
1405
+ preferredTools: ["biome"],
1406
+ defaultTool: "biome",
1407
+ defaultWhenUnconfigured: false,
1408
+ gate: "config-first",
1409
+ safe: true
1410
+ };
1411
+ }
1412
+ if ([".py", ".pyi"].includes(ext)) {
1413
+ return {
1414
+ toolNames: ["ruff"],
1415
+ preferredTools: ["ruff"],
1416
+ defaultTool: "ruff",
1417
+ defaultWhenUnconfigured: true,
1418
+ gate: "smart-default",
1419
+ safe: true
1420
+ };
1421
+ }
1422
+ if ([".css", ".scss", ".sass", ".less"].includes(ext)) {
1423
+ return {
1424
+ toolNames: ["stylelint"],
1425
+ preferredTools: ["stylelint"],
1426
+ defaultTool: "stylelint",
1427
+ defaultWhenUnconfigured: true,
1428
+ gate: "smart-default",
1429
+ safe: true
1430
+ };
1431
+ }
1432
+ if (ext === ".sql") {
1433
+ return {
1434
+ toolNames: ["sqlfluff"],
1435
+ preferredTools: ["sqlfluff"],
1436
+ defaultTool: "sqlfluff",
1437
+ defaultWhenUnconfigured: false,
1438
+ gate: "config-first",
1439
+ safe: true
1440
+ };
1441
+ }
1442
+ if ([".rb", ".rake", ".gemspec", ".ru"].includes(ext)) {
1443
+ return {
1444
+ toolNames: ["rubocop"],
1445
+ preferredTools: ["rubocop"],
1446
+ defaultTool: "rubocop",
1447
+ defaultWhenUnconfigured: true,
1448
+ gate: "smart-default",
1449
+ safe: true
1450
+ };
1451
+ }
1452
+ if ([".kt", ".kts"].includes(ext)) {
1453
+ if (context.hasKtlintConfig) {
1454
+ return {
1455
+ toolNames: ["ktlint", "ktfmt", "detekt"],
1456
+ preferredTools: ["ktlint"],
1457
+ defaultTool: "ktlint",
1458
+ defaultWhenUnconfigured: false,
1459
+ gate: "config-first",
1460
+ safe: true
1461
+ };
1462
+ }
1463
+ if (context.hasKtfmtConfig) {
1464
+ return {
1465
+ toolNames: ["ktfmt", "detekt", "ktlint"],
1466
+ preferredTools: ["ktfmt"],
1467
+ defaultTool: "ktfmt",
1468
+ defaultWhenUnconfigured: false,
1469
+ gate: "config-first",
1470
+ safe: true
1471
+ };
1472
+ }
1473
+ if (context.hasDetektConfig) {
1474
+ return {
1475
+ toolNames: ["detekt", "ktlint"],
1476
+ preferredTools: ["detekt"],
1477
+ defaultTool: "detekt",
1478
+ defaultWhenUnconfigured: false,
1479
+ gate: "config-first",
1480
+ safe: true
1481
+ };
1482
+ }
1483
+ return {
1484
+ toolNames: ["ktlint", "detekt"],
1485
+ preferredTools: ["ktlint"],
1486
+ defaultTool: "ktlint",
1487
+ defaultWhenUnconfigured: true,
1488
+ gate: "smart-default",
1489
+ safe: true
1490
+ };
1491
+ }
1492
+ if (ext === ".go") {
1493
+ return {
1494
+ toolNames: ["golangci-lint"],
1495
+ preferredTools: context.hasGolangciConfig ? ["golangci-lint"] : [],
1496
+ defaultTool: "golangci-lint",
1497
+ defaultWhenUnconfigured: false,
1498
+ gate: "config-first",
1499
+ safe: true
1500
+ };
1501
+ }
1502
+ if ([".md", ".mdx"].includes(ext)) {
1503
+ return {
1504
+ toolNames: ["markdownlint"],
1505
+ preferredTools: ["markdownlint"],
1506
+ defaultTool: "markdownlint",
1507
+ defaultWhenUnconfigured: true,
1508
+ gate: "smart-default",
1509
+ safe: true
1510
+ };
1511
+ }
1512
+ if (ext === ".rs") {
1513
+ return {
1514
+ toolNames: ["rust-clippy"],
1515
+ preferredTools: ["rust-clippy"],
1516
+ defaultTool: "rust-clippy",
1517
+ defaultWhenUnconfigured: true,
1518
+ gate: "smart-default",
1519
+ safe: true
1520
+ };
1521
+ }
1522
+ if (ext === ".dart") {
1523
+ return {
1524
+ toolNames: ["dart-analyze"],
1525
+ preferredTools: ["dart-analyze"],
1526
+ defaultTool: "dart-analyze",
1527
+ defaultWhenUnconfigured: true,
1528
+ gate: "smart-default",
1529
+ safe: true,
1530
+ scope: "dart-project"
1531
+ };
1532
+ }
1533
+ return;
1534
+ }
1535
+ export function getPreferredAutofixTools(filePath, context) {
1536
+ return getAutofixPolicyForFile(filePath, context)?.preferredTools ?? [];
1537
+ }
1538
+ const ESLINT_FLAT_CONFIGS = [
1539
+ "eslint.config.js",
1540
+ "eslint.config.mjs",
1541
+ "eslint.config.cjs",
1542
+ "eslint.config.ts",
1543
+ "eslint.config.mts",
1544
+ "eslint.config.cts"
1545
+ ];
1546
+ const ESLINT_LEGACY_CONFIGS = [
1547
+ ".eslintrc",
1548
+ ".eslintrc.js",
1549
+ ".eslintrc.cjs",
1550
+ ".eslintrc.json",
1551
+ ".eslintrc.yaml",
1552
+ ".eslintrc.yml"
1553
+ ];
1554
+ function* walkUpDirsUntilPackageJson(cwd) {
1555
+ for (const dir of walkUpDirs(cwd)) {
1556
+ yield dir;
1557
+ if (fs.existsSync(path.join(dir, "package.json")))
1558
+ return;
1559
+ }
1560
+ }
1561
+ function findNearestPackageJsonPath(cwd) {
1562
+ let dir = cwd;
1563
+ const root = path.parse(dir).root;
1564
+ while (true) {
1565
+ const pkgPath = path.join(dir, "package.json");
1566
+ if (fs.existsSync(pkgPath))
1567
+ return pkgPath;
1568
+ if (dir === root)
1569
+ break;
1570
+ const parent = path.dirname(dir);
1571
+ if (parent === dir)
1572
+ break;
1573
+ dir = parent;
1574
+ }
1575
+ return;
1576
+ }
1577
+ export function hasNearestPackageJsonDependency(cwd, dependencyName) {
1578
+ const pkgPath = findNearestPackageJsonPath(cwd);
1579
+ if (!pkgPath)
1580
+ return false;
1581
+ try {
1582
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
1583
+ return Boolean(pkg.dependencies?.[dependencyName] ?? pkg.devDependencies?.[dependencyName]);
1584
+ } catch {}
1585
+ return false;
1586
+ }
1587
+ export function hasNearestPackageJsonField(cwd, fieldName) {
1588
+ const pkgPath = findNearestPackageJsonPath(cwd);
1589
+ if (!pkgPath)
1590
+ return false;
1591
+ try {
1592
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
1593
+ return pkg[fieldName] !== undefined;
1594
+ } catch {}
1595
+ return false;
1596
+ }
1597
+ export function hasEslintConfig(cwd) {
1598
+ for (const dir of walkUpDirs(cwd)) {
1599
+ for (const cfg of ESLINT_FLAT_CONFIGS) {
1600
+ if (fs.existsSync(path.join(dir, cfg)))
1601
+ return true;
1602
+ }
1603
+ }
1604
+ for (const dir of walkUpDirsUntilPackageJson(cwd)) {
1605
+ for (const cfg of ESLINT_LEGACY_CONFIGS) {
1606
+ if (fs.existsSync(path.join(dir, cfg)))
1607
+ return true;
1608
+ }
1609
+ const pkgPath = path.join(dir, "package.json");
1610
+ if (fs.existsSync(pkgPath)) {
1611
+ try {
1612
+ if (JSON.parse(fs.readFileSync(pkgPath, "utf-8")).eslintConfig)
1613
+ return true;
1614
+ } catch {}
1615
+ }
1616
+ }
1617
+ return false;
1618
+ }
1619
+ export function hasBiomeConfig(cwd) {
1620
+ return getBiomeConfigPath(cwd) !== undefined;
1621
+ }
1622
+ export function getBiomeConfigPath(cwd) {
1623
+ for (const dir of walkUpDirs(cwd)) {
1624
+ const jsoncPath = path.join(dir, "biome.jsonc");
1625
+ if (fs.existsSync(jsoncPath))
1626
+ return jsoncPath;
1627
+ const jsonPath = path.join(dir, "biome.json");
1628
+ if (fs.existsSync(jsonPath))
1629
+ return jsonPath;
1630
+ }
1631
+ return;
1632
+ }
1633
+ export function hasOxfmtConfig(cwd) {
1634
+ for (const dir of walkUpDirs(cwd)) {
1635
+ if (fs.existsSync(path.join(dir, "oxfmt.toml")))
1636
+ return true;
1637
+ if (fs.existsSync(path.join(dir, ".oxfmtrc.json")))
1638
+ return true;
1639
+ if (hasVitePlusConfig(dir))
1640
+ return true;
1641
+ const pkgPath = path.join(dir, "package.json");
1642
+ if (fs.existsSync(pkgPath)) {
1643
+ try {
1644
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
1645
+ const deps = {
1646
+ ...pkg.dependencies,
1647
+ ...pkg.devDependencies
1648
+ };
1649
+ if (deps["oxfmt"] || deps["@oxc-project/oxfmt"])
1650
+ return true;
1651
+ } catch {}
1652
+ }
1653
+ }
1654
+ return false;
1655
+ }
1656
+ const OXFMT_SVELTE_TOML_TRUE = /(^|\n)\s*svelte\s*=\s*true\s*(\s*#.*)?(\r?\n|$)/;
1657
+ export function hasOxfmtSvelteConfig(cwd) {
1658
+ if (!hasNearestPackageJsonDependency(cwd, "svelte"))
1659
+ return false;
1660
+ for (const dir of walkUpDirs(cwd)) {
1661
+ const rcPath = path.join(dir, ".oxfmtrc.json");
1662
+ if (fs.existsSync(rcPath)) {
1663
+ try {
1664
+ const cfg = JSON.parse(fs.readFileSync(rcPath, "utf-8"));
1665
+ if (cfg.svelte === true)
1666
+ return true;
1667
+ } catch {}
1668
+ }
1669
+ const tomlPath = path.join(dir, "oxfmt.toml");
1670
+ if (fs.existsSync(tomlPath)) {
1671
+ try {
1672
+ const content = fs.readFileSync(tomlPath, "utf-8");
1673
+ if (OXFMT_SVELTE_TOML_TRUE.test(content))
1674
+ return true;
1675
+ } catch {}
1676
+ }
1677
+ }
1678
+ return false;
1679
+ }
1680
+ export function hasStylelintConfig(cwd) {
1681
+ for (const dir of walkUpDirs(cwd)) {
1682
+ if (STYLELINT_CONFIGS.some((cfg) => fs.existsSync(path.join(dir, cfg)))) {
1683
+ return true;
1684
+ }
1685
+ const pkgPath = path.join(dir, "package.json");
1686
+ if (fs.existsSync(pkgPath)) {
1687
+ try {
1688
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
1689
+ if (pkg.stylelint)
1690
+ return true;
1691
+ } catch {}
1692
+ }
1693
+ }
1694
+ return false;
1695
+ }
1696
+ export function hasSqlfluffConfig(cwd) {
1697
+ for (const dir of walkUpDirs(cwd)) {
1698
+ for (const cfg of SQLFLUFF_CONFIGS) {
1699
+ const cfgPath = path.join(dir, cfg);
1700
+ if (!fs.existsSync(cfgPath))
1701
+ continue;
1702
+ if (cfg === "pyproject.toml") {
1703
+ try {
1704
+ const content = fs.readFileSync(cfgPath, "utf-8");
1705
+ if (content.includes("[tool.sqlfluff]"))
1706
+ return true;
1707
+ } catch {}
1708
+ continue;
1709
+ }
1710
+ if (cfg === "setup.cfg" || cfg === "tox.ini") {
1711
+ try {
1712
+ const content = fs.readFileSync(cfgPath, "utf-8");
1713
+ if (content.includes("[sqlfluff]"))
1714
+ return true;
1715
+ } catch {}
1716
+ continue;
1717
+ }
1718
+ return true;
1719
+ }
1720
+ }
1721
+ for (const dir of walkUpDirs(cwd)) {
1722
+ for (const depFile of ["requirements.txt", "Pipfile", "pyproject.toml"]) {
1723
+ const depPath = path.join(dir, depFile);
1724
+ if (!fs.existsSync(depPath))
1725
+ continue;
1726
+ try {
1727
+ const content = fs.readFileSync(depPath, "utf-8").toLowerCase();
1728
+ if (content.includes("sqlfluff"))
1729
+ return true;
1730
+ } catch {}
1731
+ }
1732
+ }
1733
+ return false;
1734
+ }
1735
+ export function hasRubocopConfig(cwd) {
1736
+ for (const dir of walkUpDirs(cwd)) {
1737
+ for (const cfg of RUBOCOP_CONFIGS) {
1738
+ if (fs.existsSync(path.join(dir, cfg)))
1739
+ return true;
1740
+ }
1741
+ const gemfile = path.join(dir, "Gemfile");
1742
+ if (fs.existsSync(gemfile)) {
1743
+ try {
1744
+ const content = fs.readFileSync(gemfile, "utf-8");
1745
+ if (content.includes("rubocop"))
1746
+ return true;
1747
+ } catch {}
1748
+ }
1749
+ }
1750
+ return false;
1751
+ }
1752
+ export function hasMypyConfig(cwd) {
1753
+ for (const dir of walkUpDirs(cwd)) {
1754
+ for (const cfg of MYPY_CONFIGS) {
1755
+ const cfgPath = path.join(dir, cfg);
1756
+ if (!fs.existsSync(cfgPath))
1757
+ continue;
1758
+ if (cfg === "setup.cfg") {
1759
+ try {
1760
+ if (fs.readFileSync(cfgPath, "utf-8").includes("[mypy]"))
1761
+ return true;
1762
+ } catch {}
1763
+ continue;
1764
+ }
1765
+ if (cfg === "pyproject.toml") {
1766
+ try {
1767
+ if (fs.readFileSync(cfgPath, "utf-8").includes("[tool.mypy]"))
1768
+ return true;
1769
+ } catch {}
1770
+ continue;
1771
+ }
1772
+ return true;
1773
+ }
1774
+ }
1775
+ return false;
1776
+ }
1777
+ export function hasYamllintConfig(cwd) {
1778
+ for (const dir of walkUpDirs(cwd)) {
1779
+ for (const cfg of YAMLLINT_CONFIGS) {
1780
+ const cfgPath = path.join(dir, cfg);
1781
+ if (!fs.existsSync(cfgPath))
1782
+ continue;
1783
+ if (cfg === "pyproject.toml") {
1784
+ try {
1785
+ const content = fs.readFileSync(cfgPath, "utf-8");
1786
+ if (content.includes("[tool.yamllint]"))
1787
+ return true;
1788
+ } catch {}
1789
+ continue;
1790
+ }
1791
+ if (cfg === "setup.cfg" || cfg === "tox.ini") {
1792
+ try {
1793
+ const content = fs.readFileSync(cfgPath, "utf-8");
1794
+ if (content.includes("[yamllint]"))
1795
+ return true;
1796
+ } catch {}
1797
+ continue;
1798
+ }
1799
+ return true;
1800
+ }
1801
+ }
1802
+ for (const dir of walkUpDirs(cwd)) {
1803
+ for (const depFile of ["requirements.txt", "Pipfile", "pyproject.toml"]) {
1804
+ const depPath = path.join(dir, depFile);
1805
+ if (!fs.existsSync(depPath))
1806
+ continue;
1807
+ try {
1808
+ const content = fs.readFileSync(depPath, "utf-8").toLowerCase();
1809
+ if (content.includes("yamllint"))
1810
+ return true;
1811
+ } catch {}
1812
+ }
1813
+ }
1814
+ return false;
1815
+ }
1816
+ export function hasMarkdownlintConfig(cwd) {
1817
+ return findNearestContaining(cwd, MARKDOWNLINT_CONFIGS) !== undefined;
1818
+ }
1819
+ export function hasPrettierConfig(cwd) {
1820
+ for (const dir of walkUpDirs(cwd)) {
1821
+ if (PRETTIER_CONFIGS.some((cfg) => fs.existsSync(path.join(dir, cfg))))
1822
+ return true;
1823
+ const pkgPath = path.join(dir, "package.json");
1824
+ if (fs.existsSync(pkgPath)) {
1825
+ try {
1826
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
1827
+ if (Object.hasOwn(pkg, "prettier"))
1828
+ return true;
1829
+ } catch {}
1830
+ }
1831
+ }
1832
+ return false;
1833
+ }
1834
+ export function hasBlackConfig(cwd) {
1835
+ for (const dir of walkUpDirs(cwd)) {
1836
+ const pyproject = path.join(dir, "pyproject.toml");
1837
+ if (fs.existsSync(pyproject)) {
1838
+ try {
1839
+ if (fs.readFileSync(pyproject, "utf-8").includes("[tool.black]"))
1840
+ return true;
1841
+ } catch {}
1842
+ }
1843
+ }
1844
+ for (const dir of walkUpDirs(cwd)) {
1845
+ for (const depFile of ["requirements.txt", "Pipfile"]) {
1846
+ const depPath = path.join(dir, depFile);
1847
+ if (!fs.existsSync(depPath))
1848
+ continue;
1849
+ try {
1850
+ if (fs.readFileSync(depPath, "utf-8").toLowerCase().includes("black"))
1851
+ return true;
1852
+ } catch {}
1853
+ }
1854
+ }
1855
+ return false;
1856
+ }
1857
+ export function hasRuffConfig(cwd) {
1858
+ for (const dir of walkUpDirs(cwd)) {
1859
+ for (const cfg of RUFF_PROJECT_CONFIGS) {
1860
+ if (fs.existsSync(path.join(dir, cfg)))
1861
+ return true;
1862
+ }
1863
+ const pyproject = path.join(dir, "pyproject.toml");
1864
+ if (fs.existsSync(pyproject)) {
1865
+ try {
1866
+ if (fs.readFileSync(pyproject, "utf-8").includes("[tool.ruff]"))
1867
+ return true;
1868
+ } catch {}
1869
+ }
1870
+ }
1871
+ return false;
1872
+ }
1873
+ function configArgsWithFallback(hasConfig, toolArgs, packageConfigPath) {
1874
+ return hasConfig ? [] : [...toolArgs, resolvePackagePath(import.meta.url, packageConfigPath)];
1875
+ }
1876
+ export function markdownlintConfigArgs(cwd) {
1877
+ return configArgsWithFallback(hasMarkdownlintConfig(cwd), ["--config"], "config/markdownlint/core.json");
1878
+ }
1879
+ export function ruffConfigArgs(cwd) {
1880
+ return configArgsWithFallback(hasRuffConfig(cwd), ["--config"], "config/ruff/core.toml");
1881
+ }
1882
+ export function biomeConfigArgs(cwd) {
1883
+ if (getBiomeConfigPath(cwd))
1884
+ return [];
1885
+ return [
1886
+ "--config-path=" + resolvePackagePath(import.meta.url, "config/biome/core.jsonc")
1887
+ ];
1888
+ }
1889
+ export function hasGolangciConfig(cwd) {
1890
+ return findNearestContaining(cwd, GOLANGCI_CONFIGS) !== undefined;
1891
+ }
1892
+ export function hasTflintConfig(startDir) {
1893
+ return findNearestContaining(startDir, [".tflint.hcl"]) !== undefined;
1894
+ }
1895
+ export function hasClangFormatConfig(cwd) {
1896
+ return findNearestContaining(cwd, [".clang-format", "_clang-format"]) !== undefined;
1897
+ }
1898
+ export function hasPhpCsFixerConfig(cwd) {
1899
+ return findNearestContaining(cwd, [
1900
+ ".php-cs-fixer.php",
1901
+ ".php-cs-fixer.dist.php"
1902
+ ]) !== undefined;
1903
+ }
1904
+ export function hasStyluaConfig(cwd) {
1905
+ return findNearestContaining(cwd, ["stylua.toml", ".stylua.toml"]) !== undefined;
1906
+ }
1907
+ export function hasOcamlformatConfig(cwd) {
1908
+ return findNearestContaining(cwd, [".ocamlformat"]) !== undefined;
1909
+ }
1910
+ export function hasGoogleJavaFormatConfig(cwd) {
1911
+ return findNearestContaining(cwd, [".google-java-format", ".editorconfig"]) !== undefined;
1912
+ }
1913
+ export function hasCljfmtConfig(cwd) {
1914
+ return findNearestContaining(cwd, [".cljfmt.edn", "cljfmt.edn", ".cljfmt"]) !== undefined;
1915
+ }
1916
+ export function hasCmakeFormatConfig(cwd) {
1917
+ return findNearestContaining(cwd, [
1918
+ ".cmake-format",
1919
+ ".cmake-format.yaml",
1920
+ ".cmake-format.yml",
1921
+ ".cmake-format.json",
1922
+ ".cmake-format.py",
1923
+ "cmake-format.yaml",
1924
+ "cmake-format.yml"
1925
+ ]) !== undefined;
1926
+ }
1927
+ const PSSCRIPTANALYZER_SETTINGS_FILES = [
1928
+ "PSScriptAnalyzerSettings.psd1",
1929
+ "ScriptAnalyzerSettings.psd1"
1930
+ ];
1931
+ export function findPSScriptAnalyzerConfigPath(cwd) {
1932
+ for (const dir of walkUpDirs(cwd)) {
1933
+ for (const name of PSSCRIPTANALYZER_SETTINGS_FILES) {
1934
+ const candidate = path.join(dir, name);
1935
+ if (fs.existsSync(candidate))
1936
+ return candidate;
1937
+ }
1938
+ }
1939
+ return;
1940
+ }
1941
+ export function hasPSScriptAnalyzerConfig(cwd) {
1942
+ return findPSScriptAnalyzerConfigPath(cwd) !== undefined;
1943
+ }
1944
+ export function hasCsharpierConfig(cwd) {
1945
+ return findNearestContaining(cwd, [
1946
+ ".csharpierrc",
1947
+ ".csharpierrc.json",
1948
+ ".csharpierrc.yaml",
1949
+ ".csharpierrc.yml"
1950
+ ]) !== undefined;
1951
+ }
1952
+ export function hasOrmoluConfig(cwd) {
1953
+ return findNearestContaining(cwd, [".ormolu"]) !== undefined;
1954
+ }
1955
+ export function hasTaploConfig(cwd) {
1956
+ return findNearestContaining(cwd, ["taplo.toml", ".taplo.toml"]) !== undefined;
1957
+ }
1958
+ export function hasTerraformConfig(cwd) {
1959
+ return findNearestContaining(cwd, [".terraform.lock.hcl"]) !== undefined;
1960
+ }
1961
+ export function hasSwiftformatConfig(cwd) {
1962
+ return findNearestContaining(cwd, [".swiftformat"]) !== undefined;
1963
+ }
1964
+ export function hasFantomasConfig(cwd) {
1965
+ return findNearestContaining(cwd, [".fantomasignore", ".editorconfig"]) !== undefined;
1966
+ }
1967
+ export function hasMixFormatConfig(cwd) {
1968
+ return findNearestContaining(cwd, [".formatter.exs"]) !== undefined;
1969
+ }
1970
+ export function hasPhpstanConfig(cwd) {
1971
+ return findNearestContaining(cwd, PHPSTAN_CONFIGS) !== undefined;
1972
+ }
1973
+ const DETEKT_CONFIGS = [
1974
+ "detekt.yml",
1975
+ ".detekt.yml",
1976
+ path.join("config", "detekt", "detekt.yml"),
1977
+ path.join("detekt", "detekt.yml")
1978
+ ];
1979
+ export function hasDetektConfig(cwd) {
1980
+ for (const dir of walkUpDirs(cwd)) {
1981
+ if (DETEKT_CONFIGS.some((cfg) => fs.existsSync(path.join(dir, cfg))))
1982
+ return true;
1983
+ }
1984
+ return false;
1985
+ }
1986
+ const KTFMT_CONFIG_FILES = [".ktfmt", ".ktfmt.kts"];
1987
+ const KTFMT_GRADLE_FILES = [
1988
+ "build.gradle.kts",
1989
+ "build.gradle",
1990
+ "settings.gradle.kts",
1991
+ "settings.gradle"
1992
+ ];
1993
+ const KOTLIN_GRADLE_FILES = [
1994
+ "build.gradle.kts",
1995
+ "build.gradle",
1996
+ "settings.gradle.kts",
1997
+ "settings.gradle"
1998
+ ];
1999
+ const GRADLE_KTLINT_PLUGIN_PATTERN = /(?:id\s*\(\s*|id\s+|apply\s+plugin\s*:\s*)["']org\.jlleitschuh\.gradle\.ktlint["']/g;
2000
+ const GRADLE_BUILD_LOGIC_DIRS = ["buildSrc", "build-logic"];
2001
+ const GRADLE_BUILD_LOGIC_EXTENSIONS = [".gradle", ".gradle.kts", ".kt"];
2002
+ const GRADLE_INCLUDE_BUILD_PATTERN = /\bincludeBuild\s*\(\s*["']([^"']+)["']/g;
2003
+ export const GRADLE_BUILD_LOGIC_SCAN_MAX_ENTRIES = 1e4;
2004
+ const spotlessKotlinConfigCache = new Map;
2005
+ let spotlessGradleReadCount = 0;
2006
+ export function _getSpotlessGradleReadCountForTests() {
2007
+ return spotlessGradleReadCount;
2008
+ }
2009
+ export function stripGradleCommentsAndStrings(source) {
2010
+ let result = "";
2011
+ let state = "code";
2012
+ let quote = "";
2013
+ for (let index = 0;index < source.length; index += 1) {
2014
+ const char = source[index];
2015
+ const next = source[index + 1];
2016
+ if (state === "code") {
2017
+ if (char === "/" && next === "/") {
2018
+ result += " ";
2019
+ index += 1;
2020
+ state = "line-comment";
2021
+ } else if (char === "/" && next === "*") {
2022
+ result += " ";
2023
+ index += 1;
2024
+ state = "block-comment";
2025
+ } else if (char === '"' || char === "'") {
2026
+ result += " ";
2027
+ quote = char;
2028
+ state = "string";
2029
+ } else {
2030
+ result += char;
2031
+ }
2032
+ continue;
2033
+ }
2034
+ if (state === "line-comment") {
2035
+ if (char === `
2036
+ ` || char === "\r") {
2037
+ result += char;
2038
+ state = "code";
2039
+ } else {
2040
+ result += " ";
2041
+ }
2042
+ continue;
2043
+ }
2044
+ if (state === "block-comment") {
2045
+ if (char === "*" && next === "/") {
2046
+ result += " ";
2047
+ index += 1;
2048
+ state = "code";
2049
+ } else {
2050
+ result += char === `
2051
+ ` || char === "\r" ? char : " ";
2052
+ }
2053
+ continue;
2054
+ }
2055
+ if (char === "\\") {
2056
+ result += " ";
2057
+ if (index + 1 < source.length) {
2058
+ result += source[index + 1] === `
2059
+ ` ? `
2060
+ ` : " ";
2061
+ index += 1;
2062
+ }
2063
+ } else if (char === quote) {
2064
+ result += " ";
2065
+ state = "code";
2066
+ } else {
2067
+ result += char === `
2068
+ ` || char === "\r" ? char : " ";
2069
+ }
2070
+ }
2071
+ return result;
2072
+ }
2073
+ const GRADLE_IDENTIFIER_CHAR = /[A-Za-z0-9_$]/;
2074
+ function gradleBlockNameBefore(source, open) {
2075
+ let index = open - 1;
2076
+ while (index >= 0 && /\s/.test(source[index]))
2077
+ index -= 1;
2078
+ const end = index + 1;
2079
+ while (index >= 0 && GRADLE_IDENTIFIER_CHAR.test(source[index]))
2080
+ index -= 1;
2081
+ return source.slice(index + 1, end);
2082
+ }
2083
+ export function gradleBlockRanges(source) {
2084
+ const ranges = [];
2085
+ const opens = [];
2086
+ for (let index = 0;index < source.length; index += 1) {
2087
+ const char = source[index];
2088
+ if (char === "{") {
2089
+ opens.push(index);
2090
+ continue;
2091
+ }
2092
+ if (char !== "}")
2093
+ continue;
2094
+ const open = opens.pop();
2095
+ if (open === undefined)
2096
+ continue;
2097
+ ranges.push({
2098
+ name: gradleBlockNameBefore(source, open),
2099
+ start: open + 1,
2100
+ end: index
2101
+ });
2102
+ }
2103
+ return ranges.sort((a, b) => a.start - b.start);
2104
+ }
2105
+ function namedGradleBlockRanges(source, name) {
2106
+ return gradleBlockRanges(source).filter((range) => range.name === name);
2107
+ }
2108
+ function namedGradleBlockBodies(source, name) {
2109
+ return namedGradleBlockRanges(source, name).map((range) => source.slice(range.start, range.end));
2110
+ }
2111
+ export function getSpotlessKotlinFormatter(cwd) {
2112
+ for (const dir of walkUpDirs(cwd)) {
2113
+ for (const gradle of KOTLIN_GRADLE_FILES) {
2114
+ const filePath = path.join(dir, gradle);
2115
+ if (!fs.existsSync(filePath))
2116
+ continue;
2117
+ try {
2118
+ const mtime = fs.statSync(filePath).mtimeMs;
2119
+ let config = spotlessKotlinConfigCache.get(filePath);
2120
+ if (!config || config.mtime !== mtime) {
2121
+ const source = stripGradleCommentsAndStrings(fs.readFileSync(filePath, "utf-8"));
2122
+ spotlessGradleReadCount += 1;
2123
+ const kotlinBodies = namedGradleBlockBodies(source, "spotless").flatMap((spotless) => namedGradleBlockBodies(spotless, "kotlin"));
2124
+ config = {
2125
+ mtime,
2126
+ ktlintConfig: kotlinBodies.some((body) => /\bktlint\s*\(/.test(body)),
2127
+ ktfmtConfig: kotlinBodies.some((body) => /\bktfmt\s*\(/.test(body))
2128
+ };
2129
+ spotlessKotlinConfigCache.set(filePath, config);
2130
+ }
2131
+ if (config.ktlintConfig)
2132
+ return "ktlint";
2133
+ if (config.ktfmtConfig)
2134
+ return "ktfmt";
2135
+ } catch {}
2136
+ }
2137
+ }
2138
+ return;
2139
+ }
2140
+ export function hasKtlintConfig(cwd) {
2141
+ return getSpotlessKotlinFormatter(cwd) === "ktlint";
2142
+ }
2143
+ export function hasGradleKtlintPlugin(cwd) {
2144
+ const files = new Set;
2145
+ const scan = { entries: 0, exceeded: false, indeterminate: false };
2146
+ for (const dir of walkUpDirs(cwd)) {
2147
+ for (const gradle of KOTLIN_GRADLE_FILES) {
2148
+ const filePath = path.join(dir, gradle);
2149
+ if (fs.existsSync(filePath))
2150
+ files.add(filePath);
2151
+ }
2152
+ for (const buildLogicDir of GRADLE_BUILD_LOGIC_DIRS) {
2153
+ if (!addGradleBuildLogicFiles(path.join(dir, buildLogicDir), files, scan)) {
2154
+ scan.exceeded = true;
2155
+ }
2156
+ }
2157
+ for (const settings of ["settings.gradle.kts", "settings.gradle"]) {
2158
+ const settingsPath = path.join(dir, settings);
2159
+ if (!fs.existsSync(settingsPath))
2160
+ continue;
2161
+ try {
2162
+ const raw = fs.readFileSync(settingsPath, "utf-8");
2163
+ const stripped = stripGradleCommentsAndStrings(raw);
2164
+ GRADLE_INCLUDE_BUILD_PATTERN.lastIndex = 0;
2165
+ let match;
2166
+ while ((match = GRADLE_INCLUDE_BUILD_PATTERN.exec(raw)) !== null) {
2167
+ const code = stripped.slice(match.index, match.index + match[0].length);
2168
+ const includedBuild = match[1];
2169
+ if (includedBuild && /^\s*includeBuild\s*\(\s*/.test(code)) {
2170
+ if (!addGradleBuildLogicFiles(path.resolve(dir, includedBuild), files, scan)) {
2171
+ scan.exceeded = true;
2172
+ }
2173
+ }
2174
+ }
2175
+ } catch {
2176
+ scan.indeterminate = true;
2177
+ }
2178
+ }
2179
+ }
2180
+ if (scan.exceeded) {
2181
+ recordDegradationOnce({
2182
+ kind: "gradle-ktlint-scan-budget-exceeded",
2183
+ subject: "ktlint:gradle-build-logic",
2184
+ reason: `Gradle build-logic ownership scan exceeded its ${GRADLE_BUILD_LOGIC_SCAN_MAX_ENTRIES}-entry budget; ` + "ownership cannot be established, so ktlint autofix is declined"
2185
+ });
2186
+ return { kind: "indeterminate" };
2187
+ }
2188
+ if (scan.indeterminate)
2189
+ return { kind: "indeterminate" };
2190
+ for (const filePath of files) {
2191
+ try {
2192
+ const raw = fs.readFileSync(filePath, "utf-8");
2193
+ const stripped = stripGradleCommentsAndStrings(raw);
2194
+ GRADLE_KTLINT_PLUGIN_PATTERN.lastIndex = 0;
2195
+ let match;
2196
+ while ((match = GRADLE_KTLINT_PLUGIN_PATTERN.exec(raw)) !== null) {
2197
+ const code = stripped.slice(match.index, match.index + match[0].length);
2198
+ if (!/^\s*$/.test(code))
2199
+ return { kind: "owned" };
2200
+ }
2201
+ } catch {
2202
+ return { kind: "indeterminate" };
2203
+ }
2204
+ }
2205
+ return { kind: "not-owned" };
2206
+ }
2207
+ function addGradleBuildLogicFiles(root, files, scan) {
2208
+ if (!fs.existsSync(root))
2209
+ return true;
2210
+ const pending = [root];
2211
+ while (pending.length > 0) {
2212
+ const dir = pending.pop();
2213
+ if (!dir)
2214
+ continue;
2215
+ let entries;
2216
+ try {
2217
+ entries = fs.readdirSync(dir, { withFileTypes: true });
2218
+ } catch {
2219
+ scan.indeterminate = true;
2220
+ continue;
2221
+ }
2222
+ for (const entry of entries) {
2223
+ scan.entries += 1;
2224
+ if (scan.entries > GRADLE_BUILD_LOGIC_SCAN_MAX_ENTRIES)
2225
+ return false;
2226
+ const entryPath = path.join(dir, entry.name);
2227
+ if (entry.isDirectory()) {
2228
+ pending.push(entryPath);
2229
+ } else if (entry.isFile() && GRADLE_BUILD_LOGIC_EXTENSIONS.some((extension) => entry.name.endsWith(extension))) {
2230
+ files.add(entryPath);
2231
+ }
2232
+ }
2233
+ }
2234
+ return true;
2235
+ }
2236
+ export function hasKtfmtConfig(cwd) {
2237
+ const spotlessFormatter = getSpotlessKotlinFormatter(cwd);
2238
+ if (spotlessFormatter)
2239
+ return spotlessFormatter === "ktfmt";
2240
+ for (const dir of walkUpDirs(cwd)) {
2241
+ if (KTFMT_CONFIG_FILES.some((cfg) => fs.existsSync(path.join(dir, cfg))))
2242
+ return true;
2243
+ for (const gradle of KTFMT_GRADLE_FILES) {
2244
+ const p = path.join(dir, gradle);
2245
+ if (fs.existsSync(p)) {
2246
+ try {
2247
+ if (/ktfmt|com\.facebook\.ktfmt/i.test(fs.readFileSync(p, "utf-8")))
2248
+ return true;
2249
+ } catch {}
2250
+ }
2251
+ }
2252
+ }
2253
+ return false;
2254
+ }
2255
+ const JAVA_BUILD_DESCRIPTORS = [
2256
+ "pom.xml",
2257
+ "build.gradle",
2258
+ "build.gradle.kts",
2259
+ "settings.gradle",
2260
+ "settings.gradle.kts"
2261
+ ];
2262
+ const COMPILED_CLASSES_DIRS = [
2263
+ path.join("target", "classes"),
2264
+ path.join("build", "classes"),
2265
+ path.join("out", "production"),
2266
+ path.join("bin", "main")
2267
+ ];
2268
+ export function hasJavaBuildDescriptor(cwd, ceiling) {
2269
+ const normalizedCeiling = ceiling ? normalizeMapKey(path.resolve(ceiling)) : undefined;
2270
+ for (const dir of walkUpDirs(cwd)) {
2271
+ if (JAVA_BUILD_DESCRIPTORS.some((d) => fs.existsSync(path.join(dir, d))))
2272
+ return true;
2273
+ if (normalizedCeiling && normalizeMapKey(path.resolve(dir)) === normalizedCeiling)
2274
+ break;
2275
+ }
2276
+ return false;
2277
+ }
2278
+ export function findCompiledClassesDir(cwd) {
2279
+ for (const dir of walkUpDirs(cwd)) {
2280
+ for (const rel of COMPILED_CLASSES_DIRS) {
2281
+ const candidate = path.join(dir, rel);
2282
+ if (fs.existsSync(candidate))
2283
+ return candidate;
2284
+ }
2285
+ }
2286
+ return;
2287
+ }
2288
+ export function hasStandardrbConfig(cwd) {
2289
+ for (const dir of walkUpDirs(cwd)) {
2290
+ const gemfile = path.join(dir, "Gemfile");
2291
+ if (fs.existsSync(gemfile)) {
2292
+ try {
2293
+ if (fs.readFileSync(gemfile, "utf-8").includes("standard"))
2294
+ return true;
2295
+ } catch {}
2296
+ }
2297
+ }
2298
+ return false;
2299
+ }
2300
+ export function getRubocopCommand(cwd) {
2301
+ const gemfile = path.join(cwd, "Gemfile");
2302
+ if (fs.existsSync(gemfile)) {
2303
+ try {
2304
+ const content = fs.readFileSync(gemfile, "utf-8");
2305
+ if (content.includes("rubocop")) {
2306
+ return { cmd: "bundle", args: ["exec", "rubocop"] };
2307
+ }
2308
+ } catch {}
2309
+ }
2310
+ return { cmd: "rubocop", args: [] };
2311
+ }
2312
+ export function hasVitePlusConfig(cwd) {
2313
+ for (const dir of walkUpDirs(cwd)) {
2314
+ if (fs.existsSync(path.join(dir, "vite-plus.json")))
2315
+ return true;
2316
+ const pkgPath = path.join(dir, "package.json");
2317
+ if (fs.existsSync(pkgPath)) {
2318
+ try {
2319
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
2320
+ const deps = { ...pkg.dependencies, ...pkg.devDependencies };
2321
+ if (deps["vite-plus"] || deps["@voidzero-dev/vite-plus-core"]) {
2322
+ return true;
2323
+ }
2324
+ } catch {}
2325
+ }
2326
+ for (const cfg of VITE_CONFIGS) {
2327
+ const cfgPath = path.join(dir, cfg);
2328
+ if (!fs.existsSync(cfgPath))
2329
+ continue;
2330
+ try {
2331
+ const content = fs.readFileSync(cfgPath, "utf-8");
2332
+ if (content.includes("vite-plus"))
2333
+ return true;
2334
+ } catch {}
2335
+ }
2336
+ }
2337
+ return false;
2338
+ }
2339
+ const OXLINT_CONFIGS = [
2340
+ ".oxlintrc.json",
2341
+ ".oxlintrc.jsonc",
2342
+ "oxlint.json",
2343
+ "oxlint.config.ts",
2344
+ "oxlint.config.mts"
2345
+ ];
2346
+ export function hasOxlintConfig(cwd) {
2347
+ for (const dir of walkUpDirs(cwd)) {
2348
+ for (const cfg of OXLINT_CONFIGS) {
2349
+ if (fs.existsSync(path.join(dir, cfg)))
2350
+ return true;
2351
+ }
2352
+ }
2353
+ return hasVitePlusConfig(cwd);
2354
+ }
2355
+ export function getPreferredJstsLintRunners(context) {
2356
+ if (context.hasEslintConfig)
2357
+ return ["eslint"];
2358
+ if (context.hasOxlintConfig)
2359
+ return ["oxlint"];
2360
+ if (context.hasBiomeConfig)
2361
+ return ["biome-check-json"];
2362
+ return ["oxlint", "biome-check-json"];
2363
+ }
2364
+ export function getJstsLintPolicy(context) {
2365
+ const hasEslint = !!context.hasEslintConfig;
2366
+ const hasOxlint = !!context.hasOxlintConfig;
2367
+ const hasBiome = !!context.hasBiomeConfig;
2368
+ return {
2369
+ hasEslintConfig: hasEslint,
2370
+ hasOxlintConfig: hasOxlint,
2371
+ hasBiomeConfig: hasBiome,
2372
+ preferredRunners: getPreferredJstsLintRunners({
2373
+ hasEslintConfig: hasEslint,
2374
+ hasOxlintConfig: hasOxlint,
2375
+ hasBiomeConfig: hasBiome
2376
+ }),
2377
+ hasExplicitNonBiomeLinter: hasEslint || hasOxlint
2378
+ };
2379
+ }
2380
+ export function getJstsLintPolicyForCwd(cwd) {
2381
+ return getJstsLintPolicy({
2382
+ hasEslintConfig: hasEslintConfig(cwd),
2383
+ hasOxlintConfig: hasOxlintConfig(cwd),
2384
+ hasBiomeConfig: hasBiomeConfig(cwd)
2385
+ });
2386
+ }