@duckmind/dm-darwin-x64 0.67.4 → 0.67.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1062) hide show
  1. package/README.md +2 -2
  2. package/dm +2 -2
  3. package/extensions/.dm-extensions.json +93 -27
  4. package/extensions/dm-lens/clients/actionable-warnings.js +12 -5
  5. package/extensions/dm-lens/clients/advisory-provenance.js +6 -2
  6. package/extensions/dm-lens/clients/agent-behavior-client.js +32 -2
  7. package/extensions/dm-lens/clients/agent-nudge.js +10 -0
  8. package/extensions/dm-lens/clients/analysis-root.js +3 -6
  9. package/extensions/dm-lens/clients/ast-grep-client.js +123 -33
  10. package/extensions/dm-lens/clients/ast-grep-tool-logger.js +1 -0
  11. package/extensions/dm-lens/clients/background-write-drains.js +16 -0
  12. package/extensions/dm-lens/clients/bash-file-access.js +556 -78
  13. package/extensions/dm-lens/clients/blocker-freshness.js +9 -5
  14. package/extensions/dm-lens/clients/bootstrap.js +0 -3
  15. package/extensions/dm-lens/clients/bounded-pid-file-lock.js +3 -12
  16. package/extensions/dm-lens/clients/bounded-telemetry.js +1 -0
  17. package/extensions/dm-lens/clients/bundled-resource-health.js +1 -0
  18. package/extensions/dm-lens/clients/bus-event-rollup.js +5 -0
  19. package/extensions/dm-lens/clients/bus-publish.js +45 -85
  20. package/extensions/dm-lens/clients/cache-manager.js +7 -14
  21. package/extensions/dm-lens/clients/cache-observability.js +36 -58
  22. package/extensions/dm-lens/clients/cargo-manifest.js +7 -3
  23. package/extensions/dm-lens/clients/cascade-budget.js +2 -3
  24. package/extensions/dm-lens/clients/cascade-format.js +21 -9
  25. package/extensions/dm-lens/clients/command-path.js +29 -0
  26. package/extensions/dm-lens/clients/complexity-client.js +25 -259
  27. package/extensions/dm-lens/clients/config-diagnostic-codes.js +1 -1
  28. package/extensions/dm-lens/clients/config-locations.js +10 -3
  29. package/extensions/dm-lens/clients/config-resolve.js +5 -3
  30. package/extensions/dm-lens/clients/config-schema.js +28 -2
  31. package/extensions/dm-lens/clients/context-injection-ledger.js +3 -0
  32. package/extensions/dm-lens/clients/dead-code-client.js +13 -13
  33. package/extensions/dm-lens/clients/deadline-utils.js +22 -13
  34. package/extensions/dm-lens/clients/deferred-runner-blockers.js +1 -1
  35. package/extensions/dm-lens/clients/degradation-ledger.js +29 -8
  36. package/extensions/dm-lens/clients/dependency-checker.js +7 -9
  37. package/extensions/dm-lens/clients/diagnostic-dispositions.js +94 -9
  38. package/extensions/dm-lens/clients/diagnostics-publish.js +38 -83
  39. package/extensions/dm-lens/clients/dispatch/adopted-root-runners.js +1 -0
  40. package/extensions/dm-lens/clients/dispatch/auxiliary-lsp.js +54 -3
  41. package/extensions/dm-lens/clients/dispatch/collect-later-tier.js +61 -4
  42. package/extensions/dm-lens/clients/dispatch/disabled-runners.js +66 -0
  43. package/extensions/dm-lens/clients/dispatch/dispatcher.js +289 -247
  44. package/extensions/dm-lens/clients/dispatch/fact-rule-runner.js +3 -0
  45. package/extensions/dm-lens/clients/dispatch/fact-runner.js +3 -0
  46. package/extensions/dm-lens/clients/dispatch/fact-store.js +1 -1
  47. package/extensions/dm-lens/clients/dispatch/facts/comment-facts.js +2 -1
  48. package/extensions/dm-lens/clients/dispatch/facts/function-facts.js +13 -85
  49. package/extensions/dm-lens/clients/dispatch/facts/try-catch-facts.js +2 -1
  50. package/extensions/dm-lens/clients/dispatch/finding-policy.js +65 -6
  51. package/extensions/dm-lens/clients/dispatch/integration.js +316 -114
  52. package/extensions/dm-lens/clients/dispatch/pending-runner-findings.js +4 -1
  53. package/extensions/dm-lens/clients/dispatch/plan.js +5 -0
  54. package/extensions/dm-lens/clients/dispatch/pre-edit-seed.js +28 -7
  55. package/extensions/dm-lens/clients/dispatch/rule-id-normalize.js +67 -0
  56. package/extensions/dm-lens/clients/dispatch/rule-ignores.js +4 -4
  57. package/extensions/dm-lens/clients/dispatch/rule-policy.js +158 -33
  58. package/extensions/dm-lens/clients/dispatch/rules/async-noise.js +2 -1
  59. package/extensions/dm-lens/clients/dispatch/rules/async-unnecessary-wrapper.js +2 -1
  60. package/extensions/dm-lens/clients/dispatch/rules/cors-wildcard.js +2 -1
  61. package/extensions/dm-lens/clients/dispatch/rules/error-obscuring.js +2 -1
  62. package/extensions/dm-lens/clients/dispatch/rules/error-swallowing.js +2 -1
  63. package/extensions/dm-lens/clients/dispatch/rules/high-complexity.js +5 -4
  64. package/extensions/dm-lens/clients/dispatch/rules/high-fan-out.js +3 -2
  65. package/extensions/dm-lens/clients/dispatch/rules/high-import-coupling.js +2 -1
  66. package/extensions/dm-lens/clients/dispatch/rules/missing-error-propagation.js +2 -1
  67. package/extensions/dm-lens/clients/dispatch/rules/no-commented-credentials.js +7 -2
  68. package/extensions/dm-lens/clients/dispatch/rules/pass-through-wrappers.js +2 -1
  69. package/extensions/dm-lens/clients/dispatch/rules/placeholder-comments.js +2 -1
  70. package/extensions/dm-lens/clients/dispatch/rules/unsafe-boundary.js +2 -1
  71. package/extensions/dm-lens/clients/dispatch/runner-context.js +5 -7
  72. package/extensions/dm-lens/clients/dispatch/runners/actionlint.js +6 -13
  73. package/extensions/dm-lens/clients/dispatch/runners/ast-grep-napi.js +4 -3
  74. package/extensions/dm-lens/clients/dispatch/runners/biome-check.js +7 -4
  75. package/extensions/dm-lens/clients/dispatch/runners/cpp-check.js +2 -1
  76. package/extensions/dm-lens/clients/dispatch/runners/credo.js +263 -14
  77. package/extensions/dm-lens/clients/dispatch/runners/cue-vet.js +8 -3
  78. package/extensions/dm-lens/clients/dispatch/runners/dart-analyze.js +4 -2
  79. package/extensions/dm-lens/clients/dispatch/runners/detekt.js +145 -37
  80. package/extensions/dm-lens/clients/dispatch/runners/dotnet-build.js +5 -3
  81. package/extensions/dm-lens/clients/dispatch/runners/elixir-check.js +8 -7
  82. package/extensions/dm-lens/clients/dispatch/runners/eslint.js +29 -18
  83. package/extensions/dm-lens/clients/dispatch/runners/fish-indent.js +2 -1
  84. package/extensions/dm-lens/clients/dispatch/runners/gleam-check.js +8 -5
  85. package/extensions/dm-lens/clients/dispatch/runners/go-vet.js +6 -5
  86. package/extensions/dm-lens/clients/dispatch/runners/golangci-lint.js +15 -13
  87. package/extensions/dm-lens/clients/dispatch/runners/hadolint.js +8 -14
  88. package/extensions/dm-lens/clients/dispatch/runners/helm-lint.js +16 -15
  89. package/extensions/dm-lens/clients/dispatch/runners/helm-render.js +29 -23
  90. package/extensions/dm-lens/clients/dispatch/runners/htmlhint.js +8 -14
  91. package/extensions/dm-lens/clients/dispatch/runners/javac.js +8 -5
  92. package/extensions/dm-lens/clients/dispatch/runners/ktlint.js +6 -13
  93. package/extensions/dm-lens/clients/dispatch/runners/lsp.js +37 -14
  94. package/extensions/dm-lens/clients/dispatch/runners/markdownlint.js +13 -36
  95. package/extensions/dm-lens/clients/dispatch/runners/mypy.js +11 -16
  96. package/extensions/dm-lens/clients/dispatch/runners/oxlint.js +25 -21
  97. package/extensions/dm-lens/clients/dispatch/runners/php-lint.js +2 -1
  98. package/extensions/dm-lens/clients/dispatch/runners/phpstan.js +221 -8
  99. package/extensions/dm-lens/clients/dispatch/runners/prisma-validate.js +14 -7
  100. package/extensions/dm-lens/clients/dispatch/runners/psscriptanalyzer.js +27 -12
  101. package/extensions/dm-lens/clients/dispatch/runners/pyright.js +13 -7
  102. package/extensions/dm-lens/clients/dispatch/runners/rubocop.js +12 -12
  103. package/extensions/dm-lens/clients/dispatch/runners/ruff.js +26 -12
  104. package/extensions/dm-lens/clients/dispatch/runners/rust-clippy.js +14 -4
  105. package/extensions/dm-lens/clients/dispatch/runners/shellcheck.js +14 -60
  106. package/extensions/dm-lens/clients/dispatch/runners/shfmt.js +7 -8
  107. package/extensions/dm-lens/clients/dispatch/runners/spellcheck.js +14 -11
  108. package/extensions/dm-lens/clients/dispatch/runners/spotbugs.js +10 -10
  109. package/extensions/dm-lens/clients/dispatch/runners/sqlfluff.js +9 -17
  110. package/extensions/dm-lens/clients/dispatch/runners/stylelint.js +11 -19
  111. package/extensions/dm-lens/clients/dispatch/runners/swiftlint.js +15 -25
  112. package/extensions/dm-lens/clients/dispatch/runners/taplo.js +31 -23
  113. package/extensions/dm-lens/clients/dispatch/runners/terragrunt.js +12 -10
  114. package/extensions/dm-lens/clients/dispatch/runners/tflint.js +8 -12
  115. package/extensions/dm-lens/clients/dispatch/runners/tree-sitter.js +7 -2
  116. package/extensions/dm-lens/clients/dispatch/runners/trivy-config.js +16 -17
  117. package/extensions/dm-lens/clients/dispatch/runners/utils/availability-policy.js +18 -0
  118. package/extensions/dm-lens/clients/dispatch/runners/utils/diagnostic-parsers.js +8 -4
  119. package/extensions/dm-lens/clients/dispatch/runners/utils/ignore-anchor.js +105 -0
  120. package/extensions/dm-lens/clients/dispatch/runners/utils/lazy-installer.js +10 -0
  121. package/extensions/dm-lens/clients/dispatch/runners/utils/markdownlint-api.js +52 -0
  122. package/extensions/dm-lens/clients/dispatch/runners/utils/runner-helpers.js +263 -395
  123. package/extensions/dm-lens/clients/dispatch/runners/utils/spawn-outcome.js +8 -3
  124. package/extensions/dm-lens/clients/dispatch/runners/utils/tool-failure.js +45 -16
  125. package/extensions/dm-lens/clients/dispatch/runners/vale.js +24 -33
  126. package/extensions/dm-lens/clients/dispatch/runners/yamllint.js +13 -17
  127. package/extensions/dm-lens/clients/dispatch/runners/zig-check.js +4 -2
  128. package/extensions/dm-lens/clients/dispatch/types.js +119 -2
  129. package/extensions/dm-lens/clients/dispatch/utils/lsp-diagnostics.js +2 -1
  130. package/extensions/dm-lens/clients/disposition-publish.js +14 -63
  131. package/extensions/dm-lens/clients/effective-config.js +44 -17
  132. package/extensions/dm-lens/clients/env-utils.js +13 -0
  133. package/extensions/dm-lens/clients/event-loop-hold.js +1 -1
  134. package/extensions/dm-lens/clients/feature-hints.js +2 -1
  135. package/extensions/dm-lens/clients/file-kinds.js +13 -0
  136. package/extensions/dm-lens/clients/file-role.js +3 -4
  137. package/extensions/dm-lens/clients/file-time.js +1 -16
  138. package/extensions/dm-lens/clients/file-utils.js +61 -52
  139. package/extensions/dm-lens/clients/finding-delivery-gate.js +2 -1
  140. package/extensions/dm-lens/clients/finding-identity.js +12 -2
  141. package/extensions/dm-lens/clients/fix-run-restore.js +3 -6
  142. package/extensions/dm-lens/clients/fix-worklog.js +0 -22
  143. package/extensions/dm-lens/clients/format-events-publish.js +85 -268
  144. package/extensions/dm-lens/clients/format-service.js +3 -10
  145. package/extensions/dm-lens/clients/formatters.js +150 -135
  146. package/extensions/dm-lens/clients/generation-lock.js +2 -11
  147. package/extensions/dm-lens/clients/git-guard.js +531 -161
  148. package/extensions/dm-lens/clients/gitleaks-client.js +60 -79
  149. package/extensions/dm-lens/clients/govulncheck-client.js +9 -0
  150. package/extensions/dm-lens/clients/gradle-ktfmt-style.js +10 -11
  151. package/extensions/dm-lens/clients/grammar-source.js +10 -3
  152. package/extensions/dm-lens/clients/inline-blocker-dispositions.js +23 -31
  153. package/extensions/dm-lens/clients/inline-blocker-fields.js +36 -3
  154. package/extensions/dm-lens/clients/install-diagnostics.js +1 -1
  155. package/extensions/dm-lens/clients/installer/index.js +176 -100
  156. package/extensions/dm-lens/clients/installer/managed-tool-refresh.js +12 -18
  157. package/extensions/dm-lens/clients/instance-reaper.js +10 -14
  158. package/extensions/dm-lens/clients/instance-registry.js +1 -7
  159. package/extensions/dm-lens/clients/issues-status.js +19 -0
  160. package/extensions/dm-lens/clients/jscpd-client.js +105 -130
  161. package/extensions/dm-lens/clients/knip-client.js +7 -9
  162. package/extensions/dm-lens/clients/language-policy.js +2 -0
  163. package/extensions/dm-lens/clients/language-registry.js +46 -2
  164. package/extensions/dm-lens/clients/lens-config.js +24 -10
  165. package/extensions/dm-lens/clients/lens-engine.js +117 -22
  166. package/extensions/dm-lens/clients/lens-events.js +16 -45
  167. package/extensions/dm-lens/clients/lens-flag-registry.js +55 -5
  168. package/extensions/dm-lens/clients/live-bus-emitter.js +134 -3
  169. package/extensions/dm-lens/clients/lsp/client-registry.js +75 -38
  170. package/extensions/dm-lens/clients/lsp/client.js +327 -78
  171. package/extensions/dm-lens/clients/lsp/config.js +151 -41
  172. package/extensions/dm-lens/clients/lsp/content-limits.js +24 -4
  173. package/extensions/dm-lens/clients/lsp/diagnostic-binding.js +23 -2
  174. package/extensions/dm-lens/clients/lsp/document-drift.js +2 -4
  175. package/extensions/dm-lens/clients/lsp/edits.js +38 -27
  176. package/extensions/dm-lens/clients/lsp/environment-gap.js +11 -14
  177. package/extensions/dm-lens/clients/lsp/grouping.js +5 -1
  178. package/extensions/dm-lens/clients/lsp/index.js +256 -163
  179. package/extensions/dm-lens/clients/lsp/inferred-project.js +2 -11
  180. package/extensions/dm-lens/clients/lsp/jvm-runtime.js +3 -90
  181. package/extensions/dm-lens/clients/lsp/launch.js +18 -14
  182. package/extensions/dm-lens/clients/lsp/request-timeout-error.js +18 -0
  183. package/extensions/dm-lens/clients/lsp/resolved-config.js +2 -1
  184. package/extensions/dm-lens/clients/lsp/server-config-files.js +8 -1
  185. package/extensions/dm-lens/clients/lsp/server.js +281 -140
  186. package/extensions/dm-lens/clients/lsp/session-roots.js +1 -6
  187. package/extensions/dm-lens/clients/lsp/wait-policy/strategies.js +7 -14
  188. package/extensions/dm-lens/clients/lsp/workspace-diagnostics-cache.js +8 -10
  189. package/extensions/dm-lens/clients/lsp/workspace-sweep-hold.js +1 -1
  190. package/extensions/dm-lens/clients/lsp-document-symbols.js +14 -11
  191. package/extensions/dm-lens/clients/lsp-mutation.js +114 -82
  192. package/extensions/dm-lens/clients/mcp/analyze.js +9 -4
  193. package/extensions/dm-lens/clients/mcp/ipc.js +28 -9
  194. package/extensions/dm-lens/clients/mcp/review.js +2 -1
  195. package/extensions/dm-lens/clients/mcp/session.js +15 -10
  196. package/extensions/dm-lens/clients/memory-sampler.js +11 -10
  197. package/extensions/dm-lens/clients/metrics/complexity-baseline.js +288 -0
  198. package/extensions/dm-lens/clients/metrics/function-metrics.js +388 -0
  199. package/extensions/dm-lens/clients/metrics-history.js +9 -4
  200. package/extensions/dm-lens/clients/module-report-lsp.js +7 -6
  201. package/extensions/dm-lens/clients/module-report.js +290 -116
  202. package/extensions/dm-lens/clients/mutating-tool.js +11 -5
  203. package/extensions/dm-lens/clients/mutation-bridge.js +40 -9
  204. package/extensions/dm-lens/clients/observed-mutation.js +3 -2
  205. package/extensions/dm-lens/clients/opaque-mutation-scan.js +80 -11
  206. package/extensions/dm-lens/clients/opengrep-client.js +64 -77
  207. package/extensions/dm-lens/clients/out-of-band-changes.js +109 -24
  208. package/extensions/dm-lens/clients/package-manager.js +31 -16
  209. package/extensions/dm-lens/clients/package-root.js +2 -2
  210. package/extensions/dm-lens/clients/partial-edit-apply.js +3 -233
  211. package/extensions/dm-lens/clients/path-globs.js +90 -0
  212. package/extensions/dm-lens/clients/path-utils.js +42 -29
  213. package/extensions/dm-lens/clients/performance-report.js +8 -3
  214. package/extensions/dm-lens/clients/persistent-reverify.js +26 -15
  215. package/extensions/dm-lens/clients/pid-liveness.js +21 -0
  216. package/extensions/dm-lens/clients/pipeline.js +97 -86
  217. package/extensions/dm-lens/clients/post-autofix-notice.js +1 -0
  218. package/extensions/dm-lens/clients/pre-edit-capture.js +67 -0
  219. package/extensions/dm-lens/clients/probe-home-state.js +3 -14
  220. package/extensions/dm-lens/clients/project-diagnostics/fresh-fetch.js +8 -16
  221. package/extensions/dm-lens/clients/project-diagnostics/scanner.js +2 -10
  222. package/extensions/dm-lens/clients/project-lens-config.js +164 -74
  223. package/extensions/dm-lens/clients/project-report.js +138 -47
  224. package/extensions/dm-lens/clients/project-snapshot.js +12 -4
  225. package/extensions/dm-lens/clients/project-trust.js +39 -1
  226. package/extensions/dm-lens/clients/python-environment.js +13 -8
  227. package/extensions/dm-lens/clients/quiet-window.js +3 -13
  228. package/extensions/dm-lens/clients/read-expansion.js +16 -7
  229. package/extensions/dm-lens/clients/read-guard-logger.js +1 -2
  230. package/extensions/dm-lens/clients/read-guard-tool-lines.js +18 -96
  231. package/extensions/dm-lens/clients/read-guard.js +4 -1
  232. package/extensions/dm-lens/clients/recent-touches.js +42 -26
  233. package/extensions/dm-lens/clients/report-scan.js +92 -0
  234. package/extensions/dm-lens/clients/resource-sampler.js +6 -1
  235. package/extensions/dm-lens/clients/review-graph/builder.js +40 -22
  236. package/extensions/dm-lens/clients/review-graph/git-identity.js +5 -11
  237. package/extensions/dm-lens/clients/review-graph/import-resolvers.js +13 -18
  238. package/extensions/dm-lens/clients/review-graph/query.js +11 -1
  239. package/extensions/dm-lens/clients/review-graph/types.js +1 -0
  240. package/extensions/dm-lens/clients/review-graph/workspace-modules.js +8 -11
  241. package/extensions/dm-lens/clients/ruff-client.js +23 -20
  242. package/extensions/dm-lens/clients/rules-scanner.js +2 -1
  243. package/extensions/dm-lens/clients/runtime-agent-end.js +82 -90
  244. package/extensions/dm-lens/clients/runtime-config.js +1 -0
  245. package/extensions/dm-lens/clients/runtime-context.js +75 -11
  246. package/extensions/dm-lens/clients/runtime-coordinator.js +269 -87
  247. package/extensions/dm-lens/clients/runtime-session.js +106 -152
  248. package/extensions/dm-lens/clients/runtime-tool-call.js +202 -227
  249. package/extensions/dm-lens/clients/runtime-tool-result.js +390 -80
  250. package/extensions/dm-lens/clients/runtime-turn.js +356 -98
  251. package/extensions/dm-lens/clients/safe-spawn.js +43 -27
  252. package/extensions/dm-lens/clients/scratch-tree-policy.js +29 -13
  253. package/extensions/dm-lens/clients/secret-findings.js +8 -5
  254. package/extensions/dm-lens/clients/security-scan-client.js +18 -0
  255. package/extensions/dm-lens/clients/session-lifecycle.js +13 -1
  256. package/extensions/dm-lens/clients/session-scope.js +41 -0
  257. package/extensions/dm-lens/clients/sg-runner.js +84 -33
  258. package/extensions/dm-lens/clients/sgconfig.js +2 -2
  259. package/extensions/dm-lens/clients/shell-dialect.js +62 -0
  260. package/extensions/dm-lens/clients/single-flight.js +4 -2
  261. package/extensions/dm-lens/clients/source-filter.js +7 -2
  262. package/extensions/dm-lens/clients/spawn-abort-scope.js +10 -0
  263. package/extensions/dm-lens/clients/spawn-timeout-cooldown.js +2 -1
  264. package/extensions/dm-lens/clients/staged-delta.js +461 -0
  265. package/extensions/dm-lens/clients/startup-scan.js +3 -2
  266. package/extensions/dm-lens/clients/startup-timing.js +2 -2
  267. package/extensions/dm-lens/clients/test-runner-client.js +50 -17
  268. package/extensions/dm-lens/clients/test-runner-delivery.js +31 -4
  269. package/extensions/dm-lens/clients/tool-agreement.js +25 -49
  270. package/extensions/dm-lens/clients/tool-config-presence.js +476 -0
  271. package/extensions/dm-lens/clients/tool-config.js +2 -2
  272. package/extensions/dm-lens/clients/tool-cwd.js +33 -11
  273. package/extensions/dm-lens/clients/tool-policy.js +187 -633
  274. package/extensions/dm-lens/clients/tool-probe.js +1 -1
  275. package/extensions/dm-lens/clients/tool-set-policy.js +5 -1
  276. package/extensions/dm-lens/clients/tree-sitter-client.js +83 -10
  277. package/extensions/dm-lens/clients/tree-sitter-query-loader.js +3 -2
  278. package/extensions/dm-lens/clients/tree-sitter-symbol-extractor.js +177 -3
  279. package/extensions/dm-lens/clients/trivy-client.js +68 -83
  280. package/extensions/dm-lens/clients/turn-end/delivery-holds.js +7 -3
  281. package/extensions/dm-lens/clients/turn-end/lanes/govulncheck.js +13 -1
  282. package/extensions/dm-lens/clients/turn-end/lanes/secrets.js +11 -9
  283. package/extensions/dm-lens/clients/warm-attach.js +7 -5
  284. package/extensions/dm-lens/clients/widget-state.js +228 -47
  285. package/extensions/dm-lens/clients/word-index.js +32 -19
  286. package/extensions/dm-lens/clients/write-source-file.js +30 -0
  287. package/extensions/dm-lens/clients/writers.js +529 -0
  288. package/extensions/dm-lens/clients/zizmor-config.js +3 -3
  289. package/extensions/dm-lens/config/dependency-cruiser-eager-allowlist.json +2 -1
  290. package/extensions/dm-lens/config/markdownlint/run-no-fix.mjs +23 -0
  291. package/extensions/dm-lens/dist/clients/actionable-warnings.js +11 -5
  292. package/extensions/dm-lens/dist/clients/advisory-provenance.js +6 -2
  293. package/extensions/dm-lens/dist/clients/agent-behavior-client.js +32 -2
  294. package/extensions/dm-lens/dist/clients/agent-nudge.js +10 -0
  295. package/extensions/dm-lens/dist/clients/analysis-root.js +3 -6
  296. package/extensions/dm-lens/dist/clients/ast-grep-client.js +123 -33
  297. package/extensions/dm-lens/dist/clients/ast-grep-tool-logger.js +1 -0
  298. package/extensions/dm-lens/dist/clients/background-write-drains.js +16 -0
  299. package/extensions/dm-lens/dist/clients/bash-file-access.js +556 -78
  300. package/extensions/dm-lens/dist/clients/blocker-freshness.js +5 -5
  301. package/extensions/dm-lens/dist/clients/bootstrap.js +1 -3
  302. package/extensions/dm-lens/dist/clients/bounded-pid-file-lock.js +3 -12
  303. package/extensions/dm-lens/dist/clients/bounded-telemetry.js +1 -0
  304. package/extensions/dm-lens/dist/clients/bundled-resource-health.js +1 -0
  305. package/extensions/dm-lens/dist/clients/bus-event-rollup.js +1 -0
  306. package/extensions/dm-lens/dist/clients/bus-publish.js +44 -83
  307. package/extensions/dm-lens/dist/clients/cache-manager.js +7 -14
  308. package/extensions/dm-lens/dist/clients/cache-observability.js +32 -58
  309. package/extensions/dm-lens/dist/clients/cargo-manifest.js +3 -3
  310. package/extensions/dm-lens/dist/clients/cascade-budget.js +2 -3
  311. package/extensions/dm-lens/dist/clients/cascade-format.js +21 -9
  312. package/extensions/dm-lens/dist/clients/command-path.js +26 -0
  313. package/extensions/dm-lens/dist/clients/complexity-client.js +23 -259
  314. package/extensions/dm-lens/dist/clients/config-diagnostic-codes.js +1 -1
  315. package/extensions/dm-lens/dist/clients/config-locations.js +10 -4
  316. package/extensions/dm-lens/dist/clients/config-resolve.js +5 -3
  317. package/extensions/dm-lens/dist/clients/config-schema.js +28 -2
  318. package/extensions/dm-lens/dist/clients/context-injection-ledger.js +3 -0
  319. package/extensions/dm-lens/dist/clients/dead-code-client.js +10 -13
  320. package/extensions/dm-lens/dist/clients/deadline-utils.js +22 -13
  321. package/extensions/dm-lens/dist/clients/deferred-runner-blockers.js +1 -1
  322. package/extensions/dm-lens/dist/clients/degradation-ledger.js +23 -9
  323. package/extensions/dm-lens/dist/clients/dependency-checker.js +7 -9
  324. package/extensions/dm-lens/dist/clients/diagnostic-dispositions.js +93 -10
  325. package/extensions/dm-lens/dist/clients/diagnostics-publish.js +37 -81
  326. package/extensions/dm-lens/dist/clients/dispatch/adopted-root-runners.js +1 -0
  327. package/extensions/dm-lens/dist/clients/dispatch/auxiliary-lsp.js +54 -3
  328. package/extensions/dm-lens/dist/clients/dispatch/collect-later-tier.js +61 -4
  329. package/extensions/dm-lens/dist/clients/dispatch/disabled-runners.js +57 -0
  330. package/extensions/dm-lens/dist/clients/dispatch/dispatcher.js +264 -235
  331. package/extensions/dm-lens/dist/clients/dispatch/fact-rule-runner.js +3 -0
  332. package/extensions/dm-lens/dist/clients/dispatch/fact-runner.js +3 -0
  333. package/extensions/dm-lens/dist/clients/dispatch/fact-store.js +1 -1
  334. package/extensions/dm-lens/dist/clients/dispatch/facts/comment-facts.js +2 -1
  335. package/extensions/dm-lens/dist/clients/dispatch/facts/function-facts.js +10 -85
  336. package/extensions/dm-lens/dist/clients/dispatch/facts/try-catch-facts.js +2 -1
  337. package/extensions/dm-lens/dist/clients/dispatch/finding-policy.js +64 -6
  338. package/extensions/dm-lens/dist/clients/dispatch/integration.js +298 -111
  339. package/extensions/dm-lens/dist/clients/dispatch/pending-runner-findings.js +4 -1
  340. package/extensions/dm-lens/dist/clients/dispatch/plan.js +5 -0
  341. package/extensions/dm-lens/dist/clients/dispatch/pre-edit-seed.js +28 -7
  342. package/extensions/dm-lens/dist/clients/dispatch/rule-id-normalize.js +67 -0
  343. package/extensions/dm-lens/dist/clients/dispatch/rule-ignores.js +4 -4
  344. package/extensions/dm-lens/dist/clients/dispatch/rule-policy.js +147 -33
  345. package/extensions/dm-lens/dist/clients/dispatch/rules/async-noise.js +2 -1
  346. package/extensions/dm-lens/dist/clients/dispatch/rules/async-unnecessary-wrapper.js +2 -1
  347. package/extensions/dm-lens/dist/clients/dispatch/rules/cors-wildcard.js +2 -1
  348. package/extensions/dm-lens/dist/clients/dispatch/rules/error-obscuring.js +2 -1
  349. package/extensions/dm-lens/dist/clients/dispatch/rules/error-swallowing.js +2 -1
  350. package/extensions/dm-lens/dist/clients/dispatch/rules/high-complexity.js +5 -4
  351. package/extensions/dm-lens/dist/clients/dispatch/rules/high-fan-out.js +3 -2
  352. package/extensions/dm-lens/dist/clients/dispatch/rules/high-import-coupling.js +2 -1
  353. package/extensions/dm-lens/dist/clients/dispatch/rules/missing-error-propagation.js +2 -1
  354. package/extensions/dm-lens/dist/clients/dispatch/rules/no-commented-credentials.js +7 -2
  355. package/extensions/dm-lens/dist/clients/dispatch/rules/pass-through-wrappers.js +2 -1
  356. package/extensions/dm-lens/dist/clients/dispatch/rules/placeholder-comments.js +2 -1
  357. package/extensions/dm-lens/dist/clients/dispatch/rules/unsafe-boundary.js +2 -1
  358. package/extensions/dm-lens/dist/clients/dispatch/runner-context.js +4 -8
  359. package/extensions/dm-lens/dist/clients/dispatch/runners/actionlint.js +6 -10
  360. package/extensions/dm-lens/dist/clients/dispatch/runners/ast-grep-napi.js +4 -3
  361. package/extensions/dm-lens/dist/clients/dispatch/runners/biome-check.js +7 -4
  362. package/extensions/dm-lens/dist/clients/dispatch/runners/cpp-check.js +2 -1
  363. package/extensions/dm-lens/dist/clients/dispatch/runners/credo.js +263 -14
  364. package/extensions/dm-lens/dist/clients/dispatch/runners/cue-vet.js +8 -3
  365. package/extensions/dm-lens/dist/clients/dispatch/runners/dart-analyze.js +4 -2
  366. package/extensions/dm-lens/dist/clients/dispatch/runners/detekt.js +137 -37
  367. package/extensions/dm-lens/dist/clients/dispatch/runners/dotnet-build.js +5 -3
  368. package/extensions/dm-lens/dist/clients/dispatch/runners/elixir-check.js +8 -7
  369. package/extensions/dm-lens/dist/clients/dispatch/runners/eslint.js +29 -18
  370. package/extensions/dm-lens/dist/clients/dispatch/runners/fish-indent.js +2 -1
  371. package/extensions/dm-lens/dist/clients/dispatch/runners/gleam-check.js +8 -5
  372. package/extensions/dm-lens/dist/clients/dispatch/runners/go-vet.js +6 -5
  373. package/extensions/dm-lens/dist/clients/dispatch/runners/golangci-lint.js +14 -12
  374. package/extensions/dm-lens/dist/clients/dispatch/runners/hadolint.js +8 -11
  375. package/extensions/dm-lens/dist/clients/dispatch/runners/helm-lint.js +15 -14
  376. package/extensions/dm-lens/dist/clients/dispatch/runners/helm-render.js +23 -22
  377. package/extensions/dm-lens/dist/clients/dispatch/runners/htmlhint.js +8 -11
  378. package/extensions/dm-lens/dist/clients/dispatch/runners/javac.js +8 -5
  379. package/extensions/dm-lens/dist/clients/dispatch/runners/ktlint.js +6 -10
  380. package/extensions/dm-lens/dist/clients/dispatch/runners/lsp.js +33 -15
  381. package/extensions/dm-lens/dist/clients/dispatch/runners/markdownlint.js +12 -30
  382. package/extensions/dm-lens/dist/clients/dispatch/runners/mypy.js +11 -13
  383. package/extensions/dm-lens/dist/clients/dispatch/runners/oxlint.js +25 -18
  384. package/extensions/dm-lens/dist/clients/dispatch/runners/php-lint.js +2 -1
  385. package/extensions/dm-lens/dist/clients/dispatch/runners/phpstan.js +212 -8
  386. package/extensions/dm-lens/dist/clients/dispatch/runners/prisma-validate.js +10 -7
  387. package/extensions/dm-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +25 -12
  388. package/extensions/dm-lens/dist/clients/dispatch/runners/pyright.js +13 -7
  389. package/extensions/dm-lens/dist/clients/dispatch/runners/rubocop.js +9 -12
  390. package/extensions/dm-lens/dist/clients/dispatch/runners/ruff.js +26 -11
  391. package/extensions/dm-lens/dist/clients/dispatch/runners/rust-clippy.js +14 -4
  392. package/extensions/dm-lens/dist/clients/dispatch/runners/shellcheck.js +11 -60
  393. package/extensions/dm-lens/dist/clients/dispatch/runners/shfmt.js +7 -8
  394. package/extensions/dm-lens/dist/clients/dispatch/runners/spellcheck.js +14 -11
  395. package/extensions/dm-lens/dist/clients/dispatch/runners/spotbugs.js +9 -9
  396. package/extensions/dm-lens/dist/clients/dispatch/runners/sqlfluff.js +9 -14
  397. package/extensions/dm-lens/dist/clients/dispatch/runners/stylelint.js +11 -13
  398. package/extensions/dm-lens/dist/clients/dispatch/runners/swiftlint.js +15 -22
  399. package/extensions/dm-lens/dist/clients/dispatch/runners/taplo.js +28 -23
  400. package/extensions/dm-lens/dist/clients/dispatch/runners/terragrunt.js +12 -10
  401. package/extensions/dm-lens/dist/clients/dispatch/runners/tflint.js +8 -12
  402. package/extensions/dm-lens/dist/clients/dispatch/runners/tree-sitter.js +3 -2
  403. package/extensions/dm-lens/dist/clients/dispatch/runners/trivy-config.js +13 -14
  404. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/availability-policy.js +18 -0
  405. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/diagnostic-parsers.js +8 -4
  406. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/ignore-anchor.js +105 -0
  407. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/lazy-installer.js +10 -0
  408. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/markdownlint-api.js +52 -0
  409. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +257 -391
  410. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/spawn-outcome.js +8 -3
  411. package/extensions/dm-lens/dist/clients/dispatch/runners/utils/tool-failure.js +44 -17
  412. package/extensions/dm-lens/dist/clients/dispatch/runners/vale.js +24 -30
  413. package/extensions/dm-lens/dist/clients/dispatch/runners/yamllint.js +14 -17
  414. package/extensions/dm-lens/dist/clients/dispatch/runners/zig-check.js +4 -2
  415. package/extensions/dm-lens/dist/clients/dispatch/types.js +119 -2
  416. package/extensions/dm-lens/dist/clients/dispatch/utils/lsp-diagnostics.js +2 -1
  417. package/extensions/dm-lens/dist/clients/disposition-publish.js +13 -61
  418. package/extensions/dm-lens/dist/clients/effective-config.js +43 -18
  419. package/extensions/dm-lens/dist/clients/env-utils.js +13 -0
  420. package/extensions/dm-lens/dist/clients/event-loop-hold.js +1 -1
  421. package/extensions/dm-lens/dist/clients/feature-hints.js +2 -1
  422. package/extensions/dm-lens/dist/clients/file-kinds.js +13 -0
  423. package/extensions/dm-lens/dist/clients/file-role.js +3 -4
  424. package/extensions/dm-lens/dist/clients/file-time.js +1 -16
  425. package/extensions/dm-lens/dist/clients/file-utils.js +59 -49
  426. package/extensions/dm-lens/dist/clients/finding-delivery-gate.js +2 -1
  427. package/extensions/dm-lens/dist/clients/finding-identity.js +12 -2
  428. package/extensions/dm-lens/dist/clients/fix-run-restore.js +3 -6
  429. package/extensions/dm-lens/dist/clients/fix-worklog.js +0 -22
  430. package/extensions/dm-lens/dist/clients/format-events-publish.js +84 -266
  431. package/extensions/dm-lens/dist/clients/format-service.js +3 -10
  432. package/extensions/dm-lens/dist/clients/formatters.js +146 -109
  433. package/extensions/dm-lens/dist/clients/generation-lock.js +2 -11
  434. package/extensions/dm-lens/dist/clients/git-guard.js +518 -161
  435. package/extensions/dm-lens/dist/clients/gitleaks-client.js +53 -79
  436. package/extensions/dm-lens/dist/clients/govulncheck-client.js +9 -0
  437. package/extensions/dm-lens/dist/clients/gradle-ktfmt-style.js +10 -11
  438. package/extensions/dm-lens/dist/clients/grammar-source.js +10 -3
  439. package/extensions/dm-lens/dist/clients/inline-blocker-dispositions.js +22 -30
  440. package/extensions/dm-lens/dist/clients/inline-blocker-fields.js +36 -3
  441. package/extensions/dm-lens/dist/clients/install-diagnostics.js +1 -1
  442. package/extensions/dm-lens/dist/clients/installer/index.js +176 -100
  443. package/extensions/dm-lens/dist/clients/installer/managed-tool-refresh.js +12 -18
  444. package/extensions/dm-lens/dist/clients/instance-reaper.js +10 -14
  445. package/extensions/dm-lens/dist/clients/instance-registry.js +1 -7
  446. package/extensions/dm-lens/dist/clients/issues-status.js +19 -0
  447. package/extensions/dm-lens/dist/clients/jscpd-client.js +105 -130
  448. package/extensions/dm-lens/dist/clients/knip-client.js +5 -6
  449. package/extensions/dm-lens/dist/clients/language-policy.js +2 -0
  450. package/extensions/dm-lens/dist/clients/language-registry.js +42 -2
  451. package/extensions/dm-lens/dist/clients/lens-config.js +24 -10
  452. package/extensions/dm-lens/dist/clients/lens-engine.js +109 -24
  453. package/extensions/dm-lens/dist/clients/lens-events.js +15 -43
  454. package/extensions/dm-lens/dist/clients/lens-flag-registry.js +52 -4
  455. package/extensions/dm-lens/dist/clients/live-bus-emitter.js +134 -3
  456. package/extensions/dm-lens/dist/clients/lsp/client-registry.js +75 -39
  457. package/extensions/dm-lens/dist/clients/lsp/client.js +326 -79
  458. package/extensions/dm-lens/dist/clients/lsp/config.js +150 -43
  459. package/extensions/dm-lens/dist/clients/lsp/content-limits.js +21 -4
  460. package/extensions/dm-lens/dist/clients/lsp/diagnostic-binding.js +23 -2
  461. package/extensions/dm-lens/dist/clients/lsp/document-drift.js +2 -4
  462. package/extensions/dm-lens/dist/clients/lsp/edits.js +35 -27
  463. package/extensions/dm-lens/dist/clients/lsp/environment-gap.js +11 -14
  464. package/extensions/dm-lens/dist/clients/lsp/grouping.js +5 -1
  465. package/extensions/dm-lens/dist/clients/lsp/index.js +243 -164
  466. package/extensions/dm-lens/dist/clients/lsp/inferred-project.js +2 -11
  467. package/extensions/dm-lens/dist/clients/lsp/jvm-runtime.js +3 -85
  468. package/extensions/dm-lens/dist/clients/lsp/launch.js +14 -14
  469. package/extensions/dm-lens/dist/clients/lsp/request-timeout-error.js +18 -0
  470. package/extensions/dm-lens/dist/clients/lsp/resolved-config.js +2 -1
  471. package/extensions/dm-lens/dist/clients/lsp/server-config-files.js +8 -1
  472. package/extensions/dm-lens/dist/clients/lsp/server.js +272 -140
  473. package/extensions/dm-lens/dist/clients/lsp/session-roots.js +1 -6
  474. package/extensions/dm-lens/dist/clients/lsp/wait-policy/strategies.js +7 -14
  475. package/extensions/dm-lens/dist/clients/lsp/workspace-diagnostics-cache.js +3 -10
  476. package/extensions/dm-lens/dist/clients/lsp/workspace-sweep-hold.js +1 -1
  477. package/extensions/dm-lens/dist/clients/lsp-document-symbols.js +11 -11
  478. package/extensions/dm-lens/dist/clients/lsp-mutation.js +111 -82
  479. package/extensions/dm-lens/dist/clients/mcp/analyze.js +7 -4
  480. package/extensions/dm-lens/dist/clients/mcp/ipc.js +28 -9
  481. package/extensions/dm-lens/dist/clients/mcp/review.js +2 -1
  482. package/extensions/dm-lens/dist/clients/mcp/session.js +15 -10
  483. package/extensions/dm-lens/dist/clients/memory-sampler.js +11 -10
  484. package/extensions/dm-lens/dist/clients/metrics/complexity-baseline.js +276 -0
  485. package/extensions/dm-lens/dist/clients/metrics/function-metrics.js +386 -0
  486. package/extensions/dm-lens/dist/clients/metrics-history.js +5 -4
  487. package/extensions/dm-lens/dist/clients/module-report-lsp.js +7 -6
  488. package/extensions/dm-lens/dist/clients/module-report.js +285 -116
  489. package/extensions/dm-lens/dist/clients/mutating-tool.js +11 -5
  490. package/extensions/dm-lens/dist/clients/mutation-bridge.js +40 -9
  491. package/extensions/dm-lens/dist/clients/observed-mutation.js +3 -2
  492. package/extensions/dm-lens/dist/clients/opaque-mutation-scan.js +80 -12
  493. package/extensions/dm-lens/dist/clients/opengrep-client.js +64 -77
  494. package/extensions/dm-lens/dist/clients/out-of-band-changes.js +105 -24
  495. package/extensions/dm-lens/dist/clients/package-manager.js +31 -16
  496. package/extensions/dm-lens/dist/clients/package-root.js +2 -2
  497. package/extensions/dm-lens/dist/clients/partial-edit-apply.js +3 -224
  498. package/extensions/dm-lens/dist/clients/path-globs.js +87 -0
  499. package/extensions/dm-lens/dist/clients/path-utils.js +42 -29
  500. package/extensions/dm-lens/dist/clients/performance-report.js +5 -3
  501. package/extensions/dm-lens/dist/clients/persistent-reverify.js +26 -15
  502. package/extensions/dm-lens/dist/clients/pid-liveness.js +21 -0
  503. package/extensions/dm-lens/dist/clients/pipeline.js +93 -76
  504. package/extensions/dm-lens/dist/clients/post-autofix-notice.js +1 -0
  505. package/extensions/dm-lens/dist/clients/pre-edit-capture.js +67 -0
  506. package/extensions/dm-lens/dist/clients/probe-home-state.js +3 -14
  507. package/extensions/dm-lens/dist/clients/project-diagnostics/fresh-fetch.js +8 -16
  508. package/extensions/dm-lens/dist/clients/project-diagnostics/scanner.js +2 -10
  509. package/extensions/dm-lens/dist/clients/project-lens-config.js +163 -76
  510. package/extensions/dm-lens/dist/clients/project-report.js +138 -47
  511. package/extensions/dm-lens/dist/clients/project-snapshot.js +12 -4
  512. package/extensions/dm-lens/dist/clients/project-trust.js +36 -1
  513. package/extensions/dm-lens/dist/clients/python-environment.js +13 -8
  514. package/extensions/dm-lens/dist/clients/quiet-window.js +3 -13
  515. package/extensions/dm-lens/dist/clients/read-expansion.js +16 -7
  516. package/extensions/dm-lens/dist/clients/read-guard-logger.js +1 -2
  517. package/extensions/dm-lens/dist/clients/read-guard-tool-lines.js +18 -96
  518. package/extensions/dm-lens/dist/clients/read-guard.js +4 -1
  519. package/extensions/dm-lens/dist/clients/recent-touches.js +42 -26
  520. package/extensions/dm-lens/dist/clients/report-scan.js +92 -0
  521. package/extensions/dm-lens/dist/clients/resource-sampler.js +6 -1
  522. package/extensions/dm-lens/dist/clients/review-graph/builder.js +38 -23
  523. package/extensions/dm-lens/dist/clients/review-graph/git-identity.js +5 -12
  524. package/extensions/dm-lens/dist/clients/review-graph/import-resolvers.js +13 -18
  525. package/extensions/dm-lens/dist/clients/review-graph/query.js +9 -1
  526. package/extensions/dm-lens/dist/clients/review-graph/types.js +1 -1
  527. package/extensions/dm-lens/dist/clients/review-graph/workspace-modules.js +8 -11
  528. package/extensions/dm-lens/dist/clients/ruff-client.js +23 -17
  529. package/extensions/dm-lens/dist/clients/rules-scanner.js +2 -1
  530. package/extensions/dm-lens/dist/clients/runtime-agent-end.js +82 -83
  531. package/extensions/dm-lens/dist/clients/runtime-config.js +1 -0
  532. package/extensions/dm-lens/dist/clients/runtime-context.js +75 -12
  533. package/extensions/dm-lens/dist/clients/runtime-coordinator.js +256 -86
  534. package/extensions/dm-lens/dist/clients/runtime-session.js +99 -152
  535. package/extensions/dm-lens/dist/clients/runtime-tool-call.js +193 -221
  536. package/extensions/dm-lens/dist/clients/runtime-tool-result.js +372 -83
  537. package/extensions/dm-lens/dist/clients/runtime-turn.js +356 -101
  538. package/extensions/dm-lens/dist/clients/safe-spawn.js +40 -27
  539. package/extensions/dm-lens/dist/clients/scratch-tree-policy.js +29 -10
  540. package/extensions/dm-lens/dist/clients/secret-findings.js +8 -5
  541. package/extensions/dm-lens/dist/clients/security-scan-client.js +16 -0
  542. package/extensions/dm-lens/dist/clients/session-lifecycle.js +13 -1
  543. package/extensions/dm-lens/dist/clients/session-scope.js +41 -0
  544. package/extensions/dm-lens/dist/clients/sg-runner.js +84 -30
  545. package/extensions/dm-lens/dist/clients/sgconfig.js +2 -2
  546. package/extensions/dm-lens/dist/clients/shell-dialect.js +62 -0
  547. package/extensions/dm-lens/dist/clients/single-flight.js +4 -2
  548. package/extensions/dm-lens/dist/clients/source-filter.js +3 -2
  549. package/extensions/dm-lens/dist/clients/spawn-abort-scope.js +10 -0
  550. package/extensions/dm-lens/dist/clients/spawn-timeout-cooldown.js +2 -1
  551. package/extensions/dm-lens/dist/clients/staged-delta.js +452 -0
  552. package/extensions/dm-lens/dist/clients/startup-scan.js +3 -2
  553. package/extensions/dm-lens/dist/clients/startup-timing.js +2 -2
  554. package/extensions/dm-lens/dist/clients/test-runner-client.js +47 -17
  555. package/extensions/dm-lens/dist/clients/test-runner-delivery.js +31 -4
  556. package/extensions/dm-lens/dist/clients/tool-agreement.js +25 -27
  557. package/extensions/dm-lens/dist/clients/tool-config-presence.js +476 -0
  558. package/extensions/dm-lens/dist/clients/tool-config.js +2 -2
  559. package/extensions/dm-lens/dist/clients/tool-cwd.js +28 -10
  560. package/extensions/dm-lens/dist/clients/tool-policy.js +185 -629
  561. package/extensions/dm-lens/dist/clients/tool-probe.js +1 -1
  562. package/extensions/dm-lens/dist/clients/tool-set-policy.js +5 -1
  563. package/extensions/dm-lens/dist/clients/tree-sitter-client.js +83 -10
  564. package/extensions/dm-lens/dist/clients/tree-sitter-query-loader.js +3 -2
  565. package/extensions/dm-lens/dist/clients/tree-sitter-symbol-extractor.js +177 -3
  566. package/extensions/dm-lens/dist/clients/trivy-client.js +63 -83
  567. package/extensions/dm-lens/dist/clients/turn-end/delivery-holds.js +7 -3
  568. package/extensions/dm-lens/dist/clients/turn-end/lanes/govulncheck.js +13 -1
  569. package/extensions/dm-lens/dist/clients/turn-end/lanes/secrets.js +11 -9
  570. package/extensions/dm-lens/dist/clients/warm-attach.js +7 -6
  571. package/extensions/dm-lens/dist/clients/widget-state.js +221 -48
  572. package/extensions/dm-lens/dist/clients/word-index.js +32 -19
  573. package/extensions/dm-lens/dist/clients/write-source-file.js +30 -0
  574. package/extensions/dm-lens/dist/clients/writers.js +529 -0
  575. package/extensions/dm-lens/dist/clients/zizmor-config.js +3 -3
  576. package/extensions/dm-lens/dist/index.js +159 -51
  577. package/extensions/dm-lens/dist/mcp/analyze-cli.js +7 -9
  578. package/extensions/dm-lens/dist/mcp/build-staleness.js +16 -0
  579. package/extensions/dm-lens/dist/mcp/input-schema.js +23 -0
  580. package/extensions/dm-lens/dist/mcp/server.js +146 -306
  581. package/extensions/dm-lens/dist/mcp/tool-arguments.js +15 -2
  582. package/extensions/dm-lens/dist/scripts/lib/latency-log-phases.mjs +81 -0
  583. package/extensions/dm-lens/dist/scripts/lib/process-scan.mjs +1 -1
  584. package/extensions/dm-lens/dist/tools/activate-tools.js +2 -0
  585. package/extensions/dm-lens/dist/tools/ast-grep-outline.js +45 -28
  586. package/extensions/dm-lens/dist/tools/ast-grep-replace.js +68 -10
  587. package/extensions/dm-lens/dist/tools/ast-grep-search.js +15 -19
  588. package/extensions/dm-lens/dist/tools/effective-config.js +19 -5
  589. package/extensions/dm-lens/dist/tools/lens-diagnostic-mark.js +80 -66
  590. package/extensions/dm-lens/dist/tools/lens-diagnostics.js +229 -82
  591. package/extensions/dm-lens/dist/tools/lsp-diagnostics.js +109 -66
  592. package/extensions/dm-lens/dist/tools/lsp-navigation-text.js +438 -0
  593. package/extensions/dm-lens/dist/tools/lsp-navigation.js +141 -57
  594. package/extensions/dm-lens/dist/tools/lsp-structured-output.js +37 -32
  595. package/extensions/dm-lens/dist/tools/module-report.js +16 -16
  596. package/extensions/dm-lens/dist/tools/project-report.js +12 -10
  597. package/extensions/dm-lens/dist/tools/render-compact.js +40 -0
  598. package/extensions/dm-lens/dist/tools/shared.js +123 -6
  599. package/extensions/dm-lens/dist/tools/symbol-search.js +26 -55
  600. package/extensions/dm-lens/index.js +176 -49
  601. package/extensions/dm-lens/mcp/analyze-cli.js +7 -9
  602. package/extensions/dm-lens/mcp/build-staleness.js +16 -0
  603. package/extensions/dm-lens/mcp/input-schema.js +23 -0
  604. package/extensions/dm-lens/mcp/server.js +159 -313
  605. package/extensions/dm-lens/mcp/tool-arguments.js +15 -2
  606. package/extensions/dm-lens/package.json +1 -1
  607. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/c/security/dont-call-system-c.yml +2 -1
  608. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/c/security/file-access-before-action-c.yml +2 -1
  609. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/c/security/file-stat-before-action-c.yml +2 -1
  610. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/c/security/insecure-hash-c.yml +2 -1
  611. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/c/security/libxml2-audit-parser-c.yml +2 -1
  612. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/c/security/null-library-function-c.yml +2 -1
  613. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/c/security/sizeof-this-c.yml +2 -1
  614. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/c/security/small-key-size-c.yml +2 -1
  615. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/c/security/world-writable-file-c.yml +2 -1
  616. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/dont-call-system-cpp.yml +2 -1
  617. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/file-access-before-action-cpp.yml +2 -1
  618. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/file-stat-before-action-cpp.yml +2 -1
  619. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/fix-format-security-error-cpp.yml +2 -1
  620. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/insecure-hash-cpp.yml +2 -1
  621. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/libxml2-audit-parser-cpp.yml +2 -1
  622. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/missing-nul-cpp-string-memcpy-cpp.yml +2 -1
  623. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/null-library-function-cpp.yml +2 -1
  624. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/return-c-str-cpp.yml +2 -1
  625. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/sizeof-this-cpp.yml +2 -1
  626. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/small-key-size-cpp.yml +2 -1
  627. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/std-return-data-cpp.yml +2 -1
  628. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/std-vector-invalidation-cpp.yml +2 -1
  629. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/string-view-temporary-string-cpp.yml +2 -1
  630. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/cpp/security/world-writable-file-cpp.yml +2 -1
  631. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/csharp/security/httponly-false-csharp.yml +2 -1
  632. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/csharp/security/insecure-binaryformatter-deserialization-csharp.yml +2 -1
  633. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/csharp/security/jwt-decode-without-verify-csharp.yml +2 -1
  634. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/csharp/security/jwt-hardcoded-secret-csharp.yml +2 -1
  635. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/csharp/security/jwt-tokenvalidationparameters-no-expiry-validation-csharp.yml +2 -1
  636. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/csharp/security/networkcredential-hardcoded-secret-python.yml +2 -1
  637. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/csharp/security/npgsqlconnectionstringbuilder-hardcoded-secret-csharp.yml +2 -1
  638. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/csharp/security/oracleconnectionstringbuilder-hardcoded-secret-csharp.yml +2 -1
  639. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/csharp/security/sqlconnectionstringbuilder-hardcoded-secret-csharp.yml +2 -1
  640. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/csharp/security/stacktrace-disclosure-csharp.yml +2 -1
  641. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/csharp/security/use-ecb-mode-csharp.yml +2 -1
  642. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/go/security/avoid-bind-to-all-interfaces-go.yml +2 -1
  643. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/go/security/gorilla-cookie-store-hardcoded-session-key-go.yml +2 -1
  644. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/go/security/gorilla-csrf-hardcoded-auth-key-go.yml +2 -1
  645. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/go/security/grpc-client-insecure-connection-go.yml +2 -1
  646. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/go/security/jwt-go-none-algorithm-go.yml +2 -1
  647. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/go/security/missing-ssl-minversion-go.yml +2 -1
  648. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/go/security/openai-empty-secret-go.yml +2 -1
  649. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/go/security/openai-hardcoded-secret-go.yml +2 -1
  650. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/go/security/ssl-v3-is-insecure-go.yml +2 -1
  651. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/go/security/tls-with-insecure-cipher-go.yml +2 -1
  652. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/go/security/use-of-weak-rsa-key-go.yml +2 -1
  653. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/html/security/plaintext-http-link-html.yml +2 -1
  654. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/cbc-padding-oracle-java.yml +2 -1
  655. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/cookie-httponly-false-java.yml +2 -1
  656. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/cookie-missing-httponly-java.yml +2 -1
  657. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/cookie-missing-samesite-java.yml +2 -1
  658. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/cookie-missing-secure-flag-java.yml +2 -1
  659. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/cookie-secure-flag-false-java.yml +2 -1
  660. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/datanucleus-hardcoded-connection-password-java.yml +2 -1
  661. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/des-is-deprecated-java.yml +2 -1
  662. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/desede-is-deprecated-java.yml +2 -1
  663. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/documentbuilderfactory-disallow-doctype-decl-false-java.yml +2 -1
  664. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/documentbuilderfactory-external-general-entities-true-java.yml +2 -1
  665. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/documentbuilderfactory-external-parameter-entities-true-java.yml +2 -1
  666. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/drivermanager-hardcoded-secret-java.yml +2 -1
  667. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/ecb-cipher-java.yml +2 -1
  668. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/hardcoded-connection-password-java.yml +2 -1
  669. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/hardcoded-secret-in-credentials-java.yml +2 -1
  670. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/java-jwt-hardcoded-secret-java.yml +2 -1
  671. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/jedis-jedisclientconfig-hardcoded-password-java.yml +2 -1
  672. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/jedis-jedisfactory-hardcoded-password-java.yml +2 -1
  673. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/missing-httponly-java.yml +2 -1
  674. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/missing-secure-java.yml +2 -1
  675. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/no-null-cipher-java.yml +2 -1
  676. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/passwordauthentication-hardcoded-password-java.yml +2 -1
  677. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/rsa-no-padding-java.yml +2 -1
  678. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/simple-command-injection-direct-input-java.yml +2 -1
  679. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/system-setproperty-hardcoded-secret-java.yml +2 -1
  680. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/unencrypted-socket-java.yml +2 -1
  681. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-aes-ecb-java.yml +2 -1
  682. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-blowfish-java.yml +2 -1
  683. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-default-aes-java.yml +2 -1
  684. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-md5-digest-utils-java.yml +2 -1
  685. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-md5-java.yml +2 -1
  686. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-rc2-java.yml +2 -1
  687. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-rc4-java.yml +2 -1
  688. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-sha1-java.yml +2 -1
  689. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/java/security/weak-ssl-context-java.yml +2 -1
  690. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/javascript/security/detect-angular-sce-disabled-javascript.yml +2 -1
  691. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/javascript/security/express-jwt-hardcoded-secret-javascript.yml +2 -1
  692. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/javascript/security/express-session-hardcoded-secret-javascript.yml +2 -1
  693. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/javascript/security/jwt-simple-noverify-javascript.yml +2 -1
  694. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/javascript/security/node-rsa-weak-key-javascript.yml +2 -1
  695. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/javascript/security/node-sequelize-empty-password-argument-javascript.yml +2 -1
  696. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/javascript/security/node-sequelize-hardcoded-secret-argument-javascript.yml +2 -1
  697. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/kotlin/security/des-is-deprecated-kotlin.yml +2 -1
  698. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/kotlin/security/desede-is-deprecated-kotlin.yml +2 -1
  699. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/kotlin/security/jwt-hardcode-kotlin.yml +2 -1
  700. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/kotlin/security/rsa-no-padding-kotlin.yml +2 -1
  701. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/kotlin/security/system-setproperty-hardcoded-secret-kotlin.yml +2 -1
  702. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/php/security/openssl-cbc-static-iv-php.yml +2 -1
  703. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/php/security/search-active-debug-php.yml +2 -1
  704. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/avoid-mktemp-python.yml +2 -1
  705. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/avoid_app_run_with_bad_host-python.yml +2 -1
  706. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/debug-enabled-python.yml +2 -1
  707. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/hashids-with-django-secret-python.yml +2 -1
  708. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/hashids-with-flask-secret-python.yml +2 -1
  709. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/insecure-cipher-algorithm-rc4-python.yml +2 -1
  710. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/jwt-python-hardcoded-secret-python.yml +2 -1
  711. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/openai-hardcoded-secret-python.yml +2 -1
  712. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-cassandra-empty-password-python.yml +2 -1
  713. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-cassandra-hardcoded-secret-python.yml +2 -1
  714. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-couchbase-empty-password-python.yml +2 -1
  715. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-couchbase-hardcoded-secret-python.yml +2 -1
  716. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-elasticsearch-hardcoded-bearer-auth-python.yml +2 -1
  717. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-ldap3-empty-password-python.yml +2 -1
  718. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-ldap3-hardcoded-secret-python.yml +2 -1
  719. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-mariadb-empty-password-python.yml +2 -1
  720. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-mariadb-hardcoded-secret-python.yml +2 -1
  721. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-mysql-empty-password-python.yml +2 -1
  722. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-mysql-hardcoded-secret-python.yml +2 -1
  723. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-mysqlclient-empty-password-python.yml +2 -1
  724. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-mysqlclient-hardcoded-secret-python.yml +2 -1
  725. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-neo4j-empty-password-python.yml +2 -1
  726. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-neo4j-hardcoded-secret-python.yml +2 -1
  727. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-peewee-mysql-empty-password-python.yml +2 -1
  728. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-peewee-mysql-hardcoded-secret-python.yml +2 -1
  729. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-peewee-pg-empty-password-python.yml +2 -1
  730. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-peewee-pg-hardcoded-secret-python.yml +2 -1
  731. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-pg8000-empty-password-python.yml +2 -1
  732. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-pg8000-hardcoded-secret-python.yml +2 -1
  733. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-psycopg2-empty-password-python.yml +2 -1
  734. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-psycopg2-hardcoded-secret-python.yml +2 -1
  735. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-pyjwt-hardcoded-secret-python.yml +2 -1
  736. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-pymongo-empty-password-python.yml +2 -1
  737. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-pymongo-hardcoded-secret-python.yml +2 -1
  738. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-pymssql-empty-password-python.yml +2 -1
  739. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-pymssql-hardcoded-secret-python.yml +2 -1
  740. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-pymysql-empty-password-python.yml +2 -1
  741. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-pymysql-hardcoded-secret-python.yml +2 -1
  742. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-redis-empty-password-python.yml +2 -1
  743. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-redis-hardcoded-secret-python.yml +2 -1
  744. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-requests-empty-password-python.yml +2 -1
  745. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-requests-hardcoded-secret-python.yml +2 -1
  746. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-requests-oauth-hardcoded-secret-python.yml +2 -1
  747. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-tormysql-empty-password-python.yml +2 -1
  748. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-tormysql-hardcoded-secret-python.yml +2 -1
  749. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-urllib3-hardcoded-secret-python.yml +2 -1
  750. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-webrepl-empty-password-python.yml +2 -1
  751. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/python/security/python-webrepl-hardcoded-secret-python.yml +2 -1
  752. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/force-ssl-false-ruby.yml +2 -1
  753. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/hardcoded-http-auth-in-controller-ruby.yml +2 -1
  754. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/hardcoded-secret-rsa-passphrase-ruby.yml +2 -1
  755. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/insufficient-rsa-key-size-ruby.yml +2 -1
  756. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-aws-sdk-hardcoded-secret-ruby.yml +2 -1
  757. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-cassandra-empty-password-ruby.yml +2 -1
  758. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-cassandra-hardcoded-secret-ruby.yml +2 -1
  759. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-excon-hardcoded-secret-ruby.yml +2 -1
  760. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-faraday-hardcoded-secret-ruby.yml +2 -1
  761. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-mongo-empty-password-ruby.yml +2 -1
  762. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-mongo-hardcoded-secret-ruby.yml +2 -1
  763. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-mysql2-empty-password-ruby.yml +2 -1
  764. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-mysql2-hardcoded-secret-ruby.yml +2 -1
  765. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-octokit-hardcoded-secret-ruby.yml +2 -1
  766. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-pg-empty-password-ruby.yml +2 -1
  767. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-pg-hardcoded-secret-ruby.yml +2 -1
  768. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-redis-empty-password-ruby.yml +2 -1
  769. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-redis-hardcoded-secret-ruby.yml +2 -1
  770. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/rust/security/empty-password-rust.yml +2 -1
  771. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/rust/security/hardcoded-password-rust.yml +2 -1
  772. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/rust/security/postgres-empty-password-rust.yml +2 -1
  773. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/rust/security/reqwest-accept-invalid-rust.yml +2 -1
  774. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/rust/security/secrets-reqwest-hardcoded-auth-rust.yml +2 -1
  775. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/rust/security/ssl-verify-none-rust.yml +2 -1
  776. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/rust/security/tokio-postgres-empty-password-rust.yml +2 -1
  777. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/rust/security/tokio-postgres-hardcoded-password-rust.yml +2 -1
  778. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/scala/security/jwt-scala-hardcode-scala.yml +2 -1
  779. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/scala/security/scala-jwt-hardcoded-secret-scala.yml +2 -1
  780. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/swift/security/aes-hardcoded-secret-swift.yml +2 -1
  781. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/swift/security/blowfish-hardcoded-secret-swift.yml +2 -1
  782. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/swift/security/chacha20-hardcoded-secret-swift.yml +2 -1
  783. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/swift/security/insecure-biometrics-swift.yml +2 -1
  784. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/swift/security/rabbit-hardcoded-secret-swift.yml +2 -1
  785. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/typescript/security/detect-angular-sce-disabled-typescript.yml +2 -1
  786. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/typescript/security/express-session-hardcoded-secret-typescript.yml +2 -1
  787. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/typescript/security/jwt-simple-noverify-typescript.yml +2 -1
  788. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/typescript/security/node-rsa-weak-key-typescript.yml +2 -1
  789. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/typescript/security/node-sequelize-empty-password-argument-typescript.yml +2 -1
  790. package/extensions/dm-lens/rules/ast-grep-rules/coderabbit/rules/typescript/security/node-sequelize-hardcoded-secret-argument-typescript.yml +2 -1
  791. package/extensions/dm-lens/rules/ast-grep-rules/rule-schema.json +1 -1
  792. package/extensions/dm-lens/rules/ast-grep-rules/rule-tests/array-callback-return-js-test.yml +23 -0
  793. package/extensions/dm-lens/rules/ast-grep-rules/rule-tests/array-callback-return-test.yml +23 -0
  794. package/extensions/dm-lens/rules/ast-grep-rules/rule-tests/no-accumulating-spread-js-test.yml +37 -0
  795. package/extensions/dm-lens/rules/ast-grep-rules/rule-tests/no-negation-in-equality-check-js-test.yml +8 -0
  796. package/extensions/dm-lens/rules/ast-grep-rules/rule-tests/no-negation-in-equality-check-test.yml +8 -0
  797. package/extensions/dm-lens/rules/ast-grep-rules/rule-tests/ts-redundant-filter-map-test.yml +12 -1
  798. package/extensions/dm-lens/rules/ast-grep-rules/rule-tests/unchecked-throwing-call-js-test.yml +16 -0
  799. package/extensions/dm-lens/rules/ast-grep-rules/rule-tests/unchecked-throwing-call-test.yml +16 -0
  800. package/extensions/dm-lens/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-js-test.yml +12 -0
  801. package/extensions/dm-lens/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-test.yml +25 -0
  802. package/extensions/dm-lens/rules/ast-grep-rules/rules/array-callback-return-js.yml +8 -0
  803. package/extensions/dm-lens/rules/ast-grep-rules/rules/array-callback-return.yml +8 -0
  804. package/extensions/dm-lens/rules/ast-grep-rules/rules/c-no-malloc-free.yml +13 -12
  805. package/extensions/dm-lens/rules/ast-grep-rules/rules/cpp-no-malloc-free.yml +11 -10
  806. package/extensions/dm-lens/rules/ast-grep-rules/rules/cpp-no-printf.yml +10 -9
  807. package/extensions/dm-lens/rules/ast-grep-rules/rules/go-defer-func-call-antipattern.yml +14 -13
  808. package/extensions/dm-lens/rules/ast-grep-rules/rules/go-no-fmt-println.yml +14 -13
  809. package/extensions/dm-lens/rules/ast-grep-rules/rules/go-no-panic-in-lib.yml +20 -19
  810. package/extensions/dm-lens/rules/ast-grep-rules/rules/go-no-underscore-func-name.yml +14 -13
  811. package/extensions/dm-lens/rules/ast-grep-rules/rules/go-prefer-errors-is.yml +14 -13
  812. package/extensions/dm-lens/rules/ast-grep-rules/rules/go-prefer-string-builder.yml +19 -18
  813. package/extensions/dm-lens/rules/ast-grep-rules/rules/go-test-functions.yml +14 -13
  814. package/extensions/dm-lens/rules/ast-grep-rules/rules/hyphenated-svg-attribute.yml +10 -9
  815. package/extensions/dm-lens/rules/ast-grep-rules/rules/kotlin-no-lateinit.yml +12 -11
  816. package/extensions/dm-lens/rules/ast-grep-rules/rules/kotlin-no-nullable-boolean.yml +11 -10
  817. package/extensions/dm-lens/rules/ast-grep-rules/rules/kotlin-no-println.yml +15 -14
  818. package/extensions/dm-lens/rules/ast-grep-rules/rules/kotlin-no-unnecessary-let.yml +10 -9
  819. package/extensions/dm-lens/rules/ast-grep-rules/rules/kotlin-no-unsafe-cast.yml +10 -9
  820. package/extensions/dm-lens/rules/ast-grep-rules/rules/kotlin-no-var.yml +11 -10
  821. package/extensions/dm-lens/rules/ast-grep-rules/rules/kotlin-prefer-data-class.yml +10 -9
  822. package/extensions/dm-lens/rules/ast-grep-rules/rules/kotlin-prefer-is-empty.yml +10 -9
  823. package/extensions/dm-lens/rules/ast-grep-rules/rules/no-accumulating-spread-js.yml +49 -1
  824. package/extensions/dm-lens/rules/ast-grep-rules/rules/no-aws-access-key-literal.yml +1 -1
  825. package/extensions/dm-lens/rules/ast-grep-rules/rules/no-compile-call.yml +13 -12
  826. package/extensions/dm-lens/rules/ast-grep-rules/rules/no-flask-secret-key-literal.yml +1 -1
  827. package/extensions/dm-lens/rules/ast-grep-rules/rules/no-hardcoded-password.yml +1 -1
  828. package/extensions/dm-lens/rules/ast-grep-rules/rules/no-marshal-load.yml +12 -11
  829. package/extensions/dm-lens/rules/ast-grep-rules/rules/no-negation-in-equality-check-js.yml +17 -5
  830. package/extensions/dm-lens/rules/ast-grep-rules/rules/no-negation-in-equality-check.yml +17 -5
  831. package/extensions/dm-lens/rules/ast-grep-rules/rules/no-python-sql-string-concat.yml +12 -11
  832. package/extensions/dm-lens/rules/ast-grep-rules/rules/no-requests-verify-false.yml +13 -12
  833. package/extensions/dm-lens/rules/ast-grep-rules/rules/no-secret-in-env-var-name.yml +1 -1
  834. package/extensions/dm-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +1 -2
  835. package/extensions/dm-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +1 -2
  836. package/extensions/dm-lens/rules/ast-grep-rules/rules/python-optional-type.yml +9 -8
  837. package/extensions/dm-lens/rules/ast-grep-rules/rules/reducible-list-comprehension.yml +8 -7
  838. package/extensions/dm-lens/rules/ast-grep-rules/rules/ruby-detect-path-traversal.yml +14 -13
  839. package/extensions/dm-lens/rules/ast-grep-rules/rules/ruby-symbol-to-proc-candidate.yml +8 -7
  840. package/extensions/dm-lens/rules/ast-grep-rules/rules/rust-no-chars-enumerate.yml +9 -8
  841. package/extensions/dm-lens/rules/ast-grep-rules/rules/ts-redundant-filter-map.yml +9 -1
  842. package/extensions/dm-lens/rules/ast-grep-rules/rules/unchecked-throwing-call-js.yml +8 -1
  843. package/extensions/dm-lens/rules/ast-grep-rules/rules/unchecked-throwing-call.yml +8 -1
  844. package/extensions/dm-lens/rules/ast-grep-rules/rules-disabled/filter-then-map-js.yml +17 -0
  845. package/extensions/dm-lens/rules/ast-grep-rules/rules-disabled/filter-then-map.yml +36 -0
  846. package/extensions/dm-lens/rules/ast-grep-rules/rules-disabled/gorm-unbounded-preload.yml +7 -6
  847. package/extensions/dm-lens/rules/ast-grep-rules/rules-disabled/shadow-err-variable.yml +6 -5
  848. package/extensions/dm-lens/rules/ast-grep-rules/self-scan-baseline.json +1 -1
  849. package/extensions/dm-lens/rules/tree-sitter-queries/typescript/ts-react-antipatterns.yml +8 -0
  850. package/extensions/dm-lens/scripts/lib/latency-log-phases.mjs +81 -0
  851. package/extensions/dm-lens/scripts/lib/process-scan.mjs +1 -1
  852. package/extensions/dm-lens/skills/dm-lens-lsp-navigation/SKILL.md +5 -1
  853. package/extensions/dm-lens/tools/activate-tools.js +2 -0
  854. package/extensions/dm-lens/tools/ast-grep-outline.js +50 -28
  855. package/extensions/dm-lens/tools/ast-grep-replace.js +73 -10
  856. package/extensions/dm-lens/tools/ast-grep-search.js +21 -22
  857. package/extensions/dm-lens/tools/effective-config.js +19 -5
  858. package/extensions/dm-lens/tools/lens-diagnostic-mark.js +83 -66
  859. package/extensions/dm-lens/tools/lens-diagnostics.js +241 -80
  860. package/extensions/dm-lens/tools/lsp-diagnostics.js +117 -61
  861. package/extensions/dm-lens/tools/lsp-navigation-text.js +441 -0
  862. package/extensions/dm-lens/tools/lsp-navigation.js +153 -57
  863. package/extensions/dm-lens/tools/lsp-structured-output.js +37 -32
  864. package/extensions/dm-lens/tools/module-report.js +21 -16
  865. package/extensions/dm-lens/tools/project-report.js +13 -9
  866. package/extensions/dm-lens/tools/render-compact.js +40 -0
  867. package/extensions/dm-lens/tools/shared.js +127 -6
  868. package/extensions/dm-lens/tools/symbol-search.js +26 -54
  869. package/extensions/dm-lens/vendor/grammars/tree-sitter-groovy.wasm +0 -0
  870. package/extensions/dm-mcp-adapter/THIRD_PARTY_NOTICES.md +1 -1
  871. package/extensions/dm-mcp-adapter/app-bridge.bundle.js +7082 -5121
  872. package/extensions/dm-mcp-adapter/cli.js +3 -4
  873. package/extensions/dm-mcp-adapter/commands.js +3 -6
  874. package/extensions/dm-mcp-adapter/deferred-tool-surface.js +2 -6
  875. package/extensions/dm-mcp-adapter/direct-tools.js +2 -2
  876. package/extensions/dm-mcp-adapter/dist/elicitation-handler.js +12 -2
  877. package/extensions/dm-mcp-adapter/dist/json-schema-validator.js +3 -2
  878. package/extensions/dm-mcp-adapter/dist/mcp-auth-flow.js +0 -13
  879. package/extensions/dm-mcp-adapter/dist/sampling-handler.js +2 -0
  880. package/extensions/dm-mcp-adapter/dist/server-log.js +2 -1
  881. package/extensions/dm-mcp-adapter/dist/server-manager.js +5 -4
  882. package/extensions/dm-mcp-adapter/dist/session-recovery.js +1 -1
  883. package/extensions/dm-mcp-adapter/dist/task-jobs.js +50 -19
  884. package/extensions/dm-mcp-adapter/dist/types.js +34 -20
  885. package/extensions/dm-mcp-adapter/dist/utils.js +14 -0
  886. package/extensions/dm-mcp-adapter/elicitation-handler.js +12 -2
  887. package/extensions/dm-mcp-adapter/index.js +29 -1
  888. package/extensions/dm-mcp-adapter/init.js +69 -27
  889. package/extensions/dm-mcp-adapter/json-schema-validator.js +3 -2
  890. package/extensions/dm-mcp-adapter/mcp-auth-flow.js +0 -13
  891. package/extensions/dm-mcp-adapter/mcp-references.js +3 -2
  892. package/extensions/dm-mcp-adapter/package.json +1 -1
  893. package/extensions/dm-mcp-adapter/pi-signin-import.js +1 -2
  894. package/extensions/dm-mcp-adapter/prompts.js +4 -6
  895. package/extensions/dm-mcp-adapter/proxy-modes.js +19 -11
  896. package/extensions/dm-mcp-adapter/sampling-handler.js +2 -0
  897. package/extensions/dm-mcp-adapter/server-log.js +2 -1
  898. package/extensions/dm-mcp-adapter/server-manager.js +6 -4
  899. package/extensions/dm-mcp-adapter/session-recovery.js +1 -1
  900. package/extensions/dm-mcp-adapter/task-jobs.js +50 -19
  901. package/extensions/dm-mcp-adapter/types.js +34 -20
  902. package/extensions/dm-mcp-adapter/utils.js +14 -0
  903. package/extensions/dm-ponytail/hooks/band/metrics.js +4 -9
  904. package/extensions/dm-ponytail/hooks/band/register.js +33 -38
  905. package/extensions/dm-ponytail/package.json +1 -1
  906. package/extensions/dm-subagents/package.json +1 -1
  907. package/extensions/dm-subagents/skills/dm-subagents/SKILL.md +15 -6
  908. package/extensions/dm-subagents/skills/dm-subagents/references/prompting-and-roles.md +1 -0
  909. package/extensions/dm-subagents/src/agents/agent-management.js +41 -17
  910. package/extensions/dm-subagents/src/agents/agent-serializer.js +1 -1
  911. package/extensions/dm-subagents/src/agents/agents.js +44 -16
  912. package/extensions/dm-subagents/src/agents/global-npm-root.js +10 -2
  913. package/extensions/dm-subagents/src/api/preflight.js +4 -2
  914. package/extensions/dm-subagents/src/extension/config.js +9 -1
  915. package/extensions/dm-subagents/src/extension/herdr-dm-bridge.js +83 -24
  916. package/extensions/dm-subagents/src/extension/index.js +89 -43
  917. package/extensions/dm-subagents/src/extension/public-execution.js +4 -0
  918. package/extensions/dm-subagents/src/extension/reply-workflow-script.js +24 -4
  919. package/extensions/dm-subagents/src/extension/schemas.js +8 -1
  920. package/extensions/dm-subagents/src/extension/session-switch.js +130 -0
  921. package/extensions/dm-subagents/src/extension/subagent-launch-tool.js +81 -0
  922. package/extensions/dm-subagents/src/extension/subagent-options.js +4 -0
  923. package/extensions/dm-subagents/src/extension/tool-activation.js +37 -15
  924. package/extensions/dm-subagents/src/extension/tool-description.js +14 -8
  925. package/extensions/dm-subagents/src/integrations/herdr-status.js +3 -8
  926. package/extensions/dm-subagents/src/intercom/native-supervisor-channel.js +62 -9
  927. package/extensions/dm-subagents/src/intercom/result-intercom.js +3 -2
  928. package/extensions/dm-subagents/src/runs/background/async-execution.js +70 -18
  929. package/extensions/dm-subagents/src/runs/background/async-job-tracker.js +11 -0
  930. package/extensions/dm-subagents/src/runs/background/async-resume.js +74 -34
  931. package/extensions/dm-subagents/src/runs/background/async-retention.js +26 -16
  932. package/extensions/dm-subagents/src/runs/background/async-status.js +4 -0
  933. package/extensions/dm-subagents/src/runs/background/auto-drain.js +2 -1
  934. package/extensions/dm-subagents/src/runs/background/fleet-view.js +2 -1
  935. package/extensions/dm-subagents/src/runs/background/notify.js +7 -2
  936. package/extensions/dm-subagents/src/runs/background/result-watcher.js +54 -29
  937. package/extensions/dm-subagents/src/runs/background/resume-guidance.js +4 -2
  938. package/extensions/dm-subagents/src/runs/background/retained-children.js +2 -1
  939. package/extensions/dm-subagents/src/runs/background/run-child-session.js +9 -8
  940. package/extensions/dm-subagents/src/runs/background/run-status.js +12 -9
  941. package/extensions/dm-subagents/src/runs/background/runner-aliases.js +11 -0
  942. package/extensions/dm-subagents/src/runs/background/runner-child-launch.js +1 -0
  943. package/extensions/dm-subagents/src/runs/background/scheduled-runs.js +8 -3
  944. package/extensions/dm-subagents/src/runs/background/stale-run-reconciler.js +11 -8
  945. package/extensions/dm-subagents/src/runs/background/steering.js +11 -6
  946. package/extensions/dm-subagents/src/runs/background/subagent-runner.js +87 -72
  947. package/extensions/dm-subagents/src/runs/background/subagent-wait.js +11 -10
  948. package/extensions/dm-subagents/src/runs/background/wait-config.js +17 -4
  949. package/extensions/dm-subagents/src/runs/background/wait-subscriptions.js +104 -13
  950. package/extensions/dm-subagents/src/runs/background/wait-tool.js +4 -2
  951. package/extensions/dm-subagents/src/runs/foreground/async-steering-action.js +23 -8
  952. package/extensions/dm-subagents/src/runs/foreground/async-stop-action.js +9 -1
  953. package/extensions/dm-subagents/src/runs/foreground/execution.js +94 -30
  954. package/extensions/dm-subagents/src/runs/foreground/prompt-audit.js +1 -0
  955. package/extensions/dm-subagents/src/runs/foreground/subagent-executor.js +195 -61
  956. package/extensions/dm-subagents/src/runs/shared/acceptance.js +57 -22
  957. package/extensions/dm-subagents/src/runs/shared/async-status-projection.js +11 -1
  958. package/extensions/dm-subagents/src/runs/shared/child-commands.js +13 -2
  959. package/extensions/dm-subagents/src/runs/shared/child-hooks.js +10 -5
  960. package/extensions/dm-subagents/src/runs/shared/child-launch.js +12 -6
  961. package/extensions/dm-subagents/src/runs/shared/child-session.js +98 -59
  962. package/extensions/dm-subagents/src/runs/shared/claude-code-adapter.js +6 -0
  963. package/extensions/dm-subagents/src/runs/shared/external-cli-contract.js +15 -13
  964. package/extensions/dm-subagents/src/runs/shared/external-cli-runner.js +22 -6
  965. package/extensions/dm-subagents/src/runs/shared/herdr-connection.js +10 -2
  966. package/extensions/dm-subagents/src/runs/shared/herdr-dm-protocol.js +3 -2
  967. package/extensions/dm-subagents/src/runs/shared/herdr-machine.js +42 -21
  968. package/extensions/dm-subagents/src/runs/shared/herdr-pane-host.js +40 -21
  969. package/extensions/dm-subagents/src/runs/shared/herdr-placed-run.js +48 -25
  970. package/extensions/dm-subagents/src/runs/shared/kept-branch-text.js +22 -0
  971. package/extensions/dm-subagents/src/runs/shared/local-machine-access.js +2 -2
  972. package/extensions/dm-subagents/src/runs/shared/mcp-config-sources.js +1 -1
  973. package/extensions/dm-subagents/src/runs/shared/mcp-direct-tool-allowlist.js +27 -19
  974. package/extensions/dm-subagents/src/runs/shared/mcp-direct-tool-grant.js +7 -1
  975. package/extensions/dm-subagents/src/runs/shared/model-resolution-diagnostic.js +19 -0
  976. package/extensions/dm-subagents/src/runs/shared/model-resolution.js +46 -42
  977. package/extensions/dm-subagents/src/runs/shared/mutation-evidence.js +68 -7
  978. package/extensions/dm-subagents/src/runs/shared/nested-events.js +1 -1
  979. package/extensions/dm-subagents/src/runs/shared/parallel-handoff.js +18 -7
  980. package/extensions/dm-subagents/src/runs/shared/permissions.js +5 -3
  981. package/extensions/dm-subagents/src/runs/shared/placed-run-owner.js +13 -8
  982. package/extensions/dm-subagents/src/runs/shared/rex-machine.js +10 -7
  983. package/extensions/dm-subagents/src/runs/shared/rex-pane-host.js +7 -24
  984. package/extensions/dm-subagents/src/runs/shared/run-launch-folder.js +11 -0
  985. package/extensions/dm-subagents/src/runs/shared/runner-launcher.js +12 -0
  986. package/extensions/dm-subagents/src/runs/shared/single-output.js +4 -2
  987. package/extensions/dm-subagents/src/runs/shared/structured-output.js +35 -5
  988. package/extensions/dm-subagents/src/runs/shared/subagent-prompt-runtime.js +16 -1
  989. package/extensions/dm-subagents/src/runs/shared/supervisor-wait-timer.js +59 -0
  990. package/extensions/dm-subagents/src/runs/shared/tool-timeout.js +2 -1
  991. package/extensions/dm-subagents/src/runs/shared/worktree-cleanup-plan.js +2 -2
  992. package/extensions/dm-subagents/src/runs/shared/worktree.js +61 -8
  993. package/extensions/dm-subagents/src/shared/artifacts.js +108 -18
  994. package/extensions/dm-subagents/src/shared/compaction-interruption.js +39 -0
  995. package/extensions/dm-subagents/src/shared/fleet-transcript-reader.js +317 -0
  996. package/extensions/dm-subagents/src/shared/parent-wake.js +14 -5
  997. package/extensions/dm-subagents/src/shared/pruned-fork.js +2 -2
  998. package/extensions/dm-subagents/src/shared/reported-progress.js +12 -0
  999. package/extensions/dm-subagents/src/shared/required-child-extensions.js +24 -0
  1000. package/extensions/dm-subagents/src/shared/session-succession.js +28 -1
  1001. package/extensions/dm-subagents/src/shared/session-warnings.js +21 -0
  1002. package/extensions/dm-subagents/src/shared/status-format.js +1 -1
  1003. package/extensions/dm-subagents/src/shared/utils.js +4 -0
  1004. package/extensions/dm-subagents/src/shared/wait-tool-name.js +8 -0
  1005. package/extensions/dm-subagents/src/slash/slash-commands.js +2 -1
  1006. package/extensions/dm-subagents/src/slash/subagent-cost.js +15 -1
  1007. package/extensions/dm-subagents/src/tui/fleet-status.js +4 -20
  1008. package/extensions/dm-subagents/src/tui/fleet-transcript.js +1 -316
  1009. package/extensions/dm-subagents/src/tui/fleet.js +22 -4
  1010. package/extensions/dm-subagents/src/tui/render.js +174 -57
  1011. package/extensions/dm-subagents/src/tui/subagent-messages.js +3 -2
  1012. package/extensions/dm-subagents/src/watchdog/model-selection.js +2 -2
  1013. package/extensions/dm-subagents/src/watchdog/permission-arbiter.js +1 -0
  1014. package/extensions/dm-subagents/src/watchdog/review.js +4 -3
  1015. package/extensions/dm-subagents/src/watchdog/turn-delta.js +2 -1
  1016. package/extensions/dm-subagents/src/workflows/scripted-workflow.js +307 -1135
  1017. package/extensions/dm-subagents/src/workflows/structured-workflow-scripts.js +28 -10
  1018. package/extensions/dm-subagents/src/workflows/workflow-launch-record.js +29 -12
  1019. package/extensions/dm-subagents/src/workflows/workflow-receipt.js +37 -48
  1020. package/extensions/dm-subagents/src/workflows/workflow-resources.js +4 -4
  1021. package/extensions/dm-subagents/src/workflows/workflow-resume-claim.js +3 -3
  1022. package/extensions/dm-subagents/src/workflows/workflow-resume.js +11 -8
  1023. package/extensions/dm-subagents/src/workflows/workflow-script-worker.js +76 -0
  1024. package/extensions/dm-subagents/workflow-script-process.cjs +38 -0
  1025. package/extensions/dm-subagents/workflow-script-worker.cjs +1389 -0
  1026. package/extensions/dm-web-access/anysearch.js +6 -3
  1027. package/extensions/dm-web-access/autom.js +181 -0
  1028. package/extensions/dm-web-access/cloro.js +217 -0
  1029. package/extensions/dm-web-access/cloudflare-search.js +205 -0
  1030. package/extensions/dm-web-access/curator-page.js +22 -1
  1031. package/extensions/dm-web-access/curator-server.js +16 -0
  1032. package/extensions/dm-web-access/domain-filter-normalization.js +31 -0
  1033. package/extensions/dm-web-access/duckduckgo-rate-limit.js +113 -25
  1034. package/extensions/dm-web-access/duckduckgo.js +8 -2
  1035. package/extensions/dm-web-access/exa.js +72 -9
  1036. package/extensions/dm-web-access/extract.js +105 -13
  1037. package/extensions/dm-web-access/gemini-search.js +64 -8
  1038. package/extensions/dm-web-access/github-api.js +2 -2
  1039. package/extensions/dm-web-access/github-extract.js +4 -3
  1040. package/extensions/dm-web-access/index.js +21 -4
  1041. package/extensions/dm-web-access/mcp-tool-definitions.js +44 -33
  1042. package/extensions/dm-web-access/openai-search.js +4 -3
  1043. package/extensions/dm-web-access/outcrawl.js +185 -0
  1044. package/extensions/dm-web-access/package.json +1 -1
  1045. package/extensions/dm-web-access/page-query.js +16 -3
  1046. package/extensions/dm-web-access/pdf-extract.js +0 -2
  1047. package/extensions/dm-web-access/searchapi.js +183 -0
  1048. package/extensions/dm-web-access/sofya.js +182 -0
  1049. package/extensions/dm-web-access/source-check.js +3 -1
  1050. package/extensions/dm-web-access/specstream.js +235 -0
  1051. package/extensions/dm-web-access/ssrf-protection.js +19 -1
  1052. package/extensions/dm-web-access/summary-review.js +19 -9
  1053. package/extensions/dm-web-access/tabstack.js +222 -0
  1054. package/extensions/dm-web-access/tool-activation.js +18 -4
  1055. package/extensions/dm-web-access/utils.js +61 -21
  1056. package/extensions/dm-web-access/video-extract.js +3 -1
  1057. package/extensions/dm-web-access/web-tool-core.js +10 -4
  1058. package/extensions/dm-web-access/xai-search.js +4 -3
  1059. package/extensions/dm-web-access/youtube-extract.js +3 -1
  1060. package/package.json +4 -4
  1061. package/extensions/dm-lens/clients/bus-events-logger.js +0 -48
  1062. package/extensions/dm-lens/clients/metrics-client.js +0 -80
@@ -5,6 +5,7 @@ import { performance } from "node:perf_hooks";
5
5
  import { pathToFileURL } from "node:url";
6
6
  import { installRunnerHttpDispatcher } from "./runner-http-dispatcher.js";
7
7
  import { writeAtomicJson } from "../../shared/atomic-json.js";
8
+ import { extractReportedProgress } from "../../shared/reported-progress.js";
8
9
  import { withResultRunLease, writeAsyncResultFile, writePendingAsyncResultFile } from "./result-files.js";
9
10
  import { createFileCoalescer } from "../../shared/file-coalescer.js";
10
11
  import { createCapacityResilientJsonWriter } from "../../shared/capacity-resilient-json.js";
@@ -48,6 +49,7 @@ import { buildRunnerChildLaunch } from "./runner-child-launch.js";
48
49
  import { normalizeExtensionBindings } from "../shared/extension-bindings.js";
49
50
  import { dmRetryDelay, implementationMutationError, implementationToolsError } from "../../shared/dm-safeguards.js";
50
51
  import { runChildSession } from "./run-child-session.js";
52
+ import { isBlockingSupervisorTool, pauseForSupervisorWait, startPausableTimer } from "../shared/supervisor-wait-timer.js";
51
53
  import { loadRunnerChildSessionFactory } from "./runner-child-sessions.js";
52
54
  import { SUBAGENT_CHILD_ENV, SUBAGENT_RUNNER_PID_ENV } from "../shared/child-runtime-config.js";
53
55
  import { deriveChildSessionName } from "../../shared/child-session-name.js";
@@ -56,7 +58,7 @@ import { outputEntryFromAsyncResult, resolveOutputReferences } from "../shared/c
56
58
  import { clearStructuredOutputCaptures, createStructuredOutputFileCapture, createStructuredOutputRuntime, formatStructuredOutputRejectionError, MISSING_STRUCTURED_OUTPUT_CALL_ERROR, readStructuredOutput, readStructuredOutputAcceptanceReport } from "../shared/structured-output.js";
57
59
  import { formatMidToolExitError, isOrdinaryToolForMidToolExit, isUnexplainedProcessSignal } from "../shared/process-signal.js";
58
60
  import { formatChildToolDiagnostic } from "../shared/tool-availability.js";
59
- import { buildTimeoutRecoverySummary, collectTrackedMutationEvidence, snapshotTrackedMutations } from "../shared/mutation-evidence.js";
61
+ import { buildTimeoutRecoverySummary, collectTrackedMutationEvidence, remoteMutationEvidence, remoteMutationSnapshot, snapshotTrackedMutations } from "../shared/mutation-evidence.js";
60
62
  import { collectDynamicResults, DynamicFanoutError, materializeDynamicParallelStep, validateDynamicCollection } from "../shared/dynamic-fanout.js";
61
63
  import { claimRunFanoutBatch, getRunFanoutBudgetSnapshot } from "../shared/run-fanout-budget.js";
62
64
  import { nestedSummaryFromAsyncStatus, projectNestedEvents, resolveNestedAsyncDir, writeNestedEvent } from "../shared/nested-events.js";
@@ -65,7 +67,7 @@ import { processTerminalPath, writeProcessTerminalCandidate } from "./process-te
65
67
  import { persistRunnerStartupFailure } from "./runner-startup-failure.js";
66
68
  import { currentRecordedPid } from "./boot-id.js";
67
69
  import { createSteeringStatus, recordSteeringRequest, steeringStatus, terminalSteeringNoticeState, unconsumedSteerReason, updateSteeringTarget } from "./steering.js";
68
- import { PROMPT_REDACTED, SUBAGENT_STOPPED_MESSAGE, SUBAGENT_TIMED_OUT_MESSAGE, detectSubagentError, extractTextFromContent, extractToolArgsPreview, formatEmptyTerminalAssistantResponseError, getAgentDir, hasEmptyTerminalAssistantResponse, readStatus } from "../../shared/utils.js";
70
+ import { PROMPT_REDACTED, SUBAGENT_STOPPED_MESSAGE, SUBAGENT_TIMED_OUT_MESSAGE, TRUNCATED_RESPONSE_ERROR, detectSubagentError, extractTextFromContent, extractToolArgsPreview, formatEmptyTerminalAssistantResponseError, getAgentDir, getTerminalAssistantStopReason, hasEmptyTerminalAssistantResponse, readStatus } from "../../shared/utils.js";
69
71
  import { planBackgroundRunHistory, recordRun } from "../shared/run-history.js";
70
72
  import { planAbortRecovery } from "../shared/abort-recovery.js";
71
73
  import {
@@ -112,10 +114,11 @@ import { resolveCodexExecLaunch } from "../shared/codex-exec-adapter.js";
112
114
  import { resolveCursorAgentLaunch } from "../shared/cursor-agent-adapter.js";
113
115
  import { resolveExternalCliRunnerStatus } from "../shared/external-cli-contract.js";
114
116
  import { formatHerdrMachineHint, prepareHerdrMachineExternalCliRun } from "../shared/herdr-machine.js";
115
- import { isRexLocalMachine } from "../shared/rex-machine.js";
117
+ import { editsLocalDisk } from "../shared/rex-machine.js";
116
118
  import { HerdrExternalNeedsAttentionError, createHerdrExternalAdapter, prepareInternalHerdrExternalAdapter } from "../shared/herdr-external-adapters.js";
117
119
  import { runExternalJob } from "../shared/external-job-runner.js";
118
120
  import { createOrcaProgressTab } from "../shared/orca-progress-tabs.js";
121
+ import { setWaitToolName } from "../../shared/wait-tool-name.js";
119
122
  import {
120
123
  acceptChildWatchdogEvent,
121
124
  applyChildWatchdogMessage,
@@ -207,15 +210,6 @@ function appendDiagnosticJsonl(filePath, line, droppedEventType) {
207
210
  }
208
211
  state.diagnosticsTruncated = true;
209
212
  }
210
- function isBlockingSupervisorTool(toolName, args) {
211
- if (!args || typeof args !== "object" || Array.isArray(args))
212
- return false;
213
- if (toolName === "contact_supervisor") {
214
- const reason = args.reason;
215
- return reason === "need_decision" || reason === "interview_request";
216
- }
217
- return toolName === "intercom" && args.action === "ask";
218
- }
219
213
  function findLatestSessionFile(sessionDir) {
220
214
  try {
221
215
  const files = fs.readdirSync(sessionDir).filter((f) => f.endsWith(".jsonl")).map((f) => path.join(sessionDir, f));
@@ -624,6 +618,8 @@ ${resolvedOutput.saveError}` : resolvedOutput.saveError : external.error;
624
618
  if (step.machine) {
625
619
  if (step.machine.provider !== "herdr")
626
620
  throw new Error("Rex supports native DM children only.");
621
+ if (!("target" in step.machine))
622
+ throw new Error("Machine 'local' runs native DM children only.");
627
623
  const runner = resolveExternalCliRunnerStatus({ ...step.runner, machine: step.machine });
628
624
  const outputSnapshot = captureSingleOutputSnapshot(step.outputPath);
629
625
  const placedRunId = `${ctx.id}-${ctx.flatIndex}`;
@@ -778,7 +774,7 @@ ${resolvedOutput.saveError}` : resolvedOutput.saveError : external.error;
778
774
  });
779
775
  }
780
776
  const effectiveCwd = step.cwd ?? ctx.cwd;
781
- const cwdError = preflightLaunchCwd(step.requestedCwd ?? effectiveCwd, effectiveCwd);
777
+ const cwdError = step.machine && !editsLocalDisk(step.machine) ? undefined : preflightLaunchCwd(step.requestedCwd ?? effectiveCwd, effectiveCwd);
782
778
  if (cwdError)
783
779
  return { agent: step.agent, output: cwdError, error: cwdError, exitCode: 1, context: step.context };
784
780
  if (step.context === "fork" && step.sessionFile && fs.existsSync(step.sessionFile)) {
@@ -799,8 +795,8 @@ ${resolvedOutput.saveError}` : resolvedOutput.saveError : external.error;
799
795
  let toolBudget = step.toolBudget ? initialToolBudgetState(step.toolBudget) : undefined;
800
796
  let toolBudgetBlocked = false;
801
797
  let actualLaunchContractDigest = step.launchContractDigest;
802
- const mutationSnapshot = step.machine && !isRexLocalMachine(step.machine) ? { source: "tracked-files", trackedOnly: true, cwd: step.cwd ?? ctx.cwd, dirtyFiles: [], fingerprints: {}, unavailable: "Local Git evidence is not authoritative for a pane-native remote run." } : snapshotTrackedMutations(step.cwd ?? ctx.cwd);
803
- let finalMutationEvidence = collectTrackedMutationEvidence(mutationSnapshot, step.cwd ?? ctx.cwd);
798
+ const mutationSnapshot = step.machine && !editsLocalDisk(step.machine) ? remoteMutationSnapshot(step.cwd ?? ctx.cwd) : snapshotTrackedMutations(step.cwd ?? ctx.cwd);
799
+ let finalMutationEvidence = await collectTrackedMutationEvidence(mutationSnapshot, step.cwd ?? ctx.cwd);
804
800
  let contextOverflow = false;
805
801
  let launchWarningsEmitted = false;
806
802
  const aggregateUsage = emptyUsage();
@@ -941,11 +937,11 @@ ${resolvedOutput.saveError}` : resolvedOutput.saveError : external.error;
941
937
  onContextWindow: (contextLimit) => ctx.onAttemptStart?.({ ...attemptModel, contextLimit }),
942
938
  transcriptWriter,
943
939
  toolTimeoutMs: ctx.toolTimeoutMs,
944
- runDeadlineAt: ctx.deadlineAt,
945
940
  expectedModelForVerification,
946
941
  modelVerificationRegistry: step.modelVerificationRegistry,
947
942
  modelResponseAliases: step.modelResponseAliases,
948
- mutationTools: step.mutationTools
943
+ mutationTools: step.mutationTools,
944
+ parentExtensionProvider: step.parentExtensionProvider
949
945
  }));
950
946
  launched = true;
951
947
  aggregateUsage.input += run.usage.input;
@@ -989,8 +985,8 @@ ${resolvedOutput.saveError}` : resolvedOutput.saveError : external.error;
989
985
  const hiddenError = terminalDiagnosticsEligible && run.exitCode === 0 && !run.error && !toolAvailabilityError && !structuredError && !midToolExitError ? detectSubagentError(errorMessages) : null;
990
986
  const terminalEmptyAfterUsefulWork = !validatedStructuredOutput && hasEmptyTerminalAssistantResponse(run.messages) && (run.toolCount > 0 || Boolean(run.finalOutput.trim()));
991
987
  const emptyOutputError = terminalDiagnosticsEligible && run.exitCode === 0 && !run.error && !toolAvailabilityError && !structuredError && !validatedStructuredOutput && (!run.finalOutput.trim() || terminalEmptyAfterUsefulWork) && (!hiddenError?.hasError || hasEmptyTerminalAssistantResponse(run.messages)) ? formatEmptyTerminalAssistantResponseError(run.messages) : undefined;
992
- const remoteGitChanged = run.nativeMachine?.initialGit && run.nativeMachine.finalGit ? run.nativeMachine.initialGit.head !== run.nativeMachine.finalGit.head || run.nativeMachine.initialGit.dirty !== run.nativeMachine.finalGit.dirty : undefined;
993
- const mutationEvidence = run.nativeMachine && !isRexLocalMachine(step.machine) ? { source: "tracked-files", trackedOnly: true, changedFiles: [], attemptedMutation: remoteGitChanged === true, ...remoteGitChanged === undefined ? { unavailable: "Remote Git before/after evidence was incomplete." } : {} } : collectTrackedMutationEvidence(mutationSnapshot, step.cwd ?? ctx.cwd);
988
+ const truncatedResponseError = hiddenError && !hiddenError.hasError && !validatedStructuredOutput && getTerminalAssistantStopReason(run.messages) === "length" ? TRUNCATED_RESPONSE_ERROR : undefined;
989
+ const mutationEvidence = run.nativeMachine && !editsLocalDisk(step.machine) ? remoteMutationEvidence(run.nativeMachine) : await collectTrackedMutationEvidence(mutationSnapshot, step.cwd ?? ctx.cwd);
994
990
  finalMutationEvidence = mutationEvidence;
995
991
  const mutationAttemptObserved = run.observedMutationAttempt === true || mutationEvidence.attemptedMutation === true;
996
992
  const finalOutputHasPersistableFileContent = run.exitCode === 0 && !run.error && !emptyOutputError && (Boolean(stripAcceptanceReport(run.finalOutput).trim()) || validatedStructuredOutput);
@@ -998,8 +994,8 @@ ${resolvedOutput.saveError}` : resolvedOutput.saveError : external.error;
998
994
  finalRequiredOutputMissing = requiredOutput?.missing;
999
995
  const missingRequiredOutputError = terminalDiagnosticsEligible ? formatRequiredOutputError(requiredOutput) : undefined;
1000
996
  const missingRequiredOutputAfterMutation = Boolean(missingRequiredOutputError) && (mutationAttemptObserved || Boolean(mutationEvidence.changedFiles.length));
1001
- const effectiveExitCode = toolAvailabilityError || midToolExitError || structuredError || emptyOutputError || missingRequiredOutputError ? 1 : hiddenError?.hasError ? hiddenError.exitCode ?? 1 : run.error && run.exitCode === 0 ? 1 : run.exitCode;
1002
- const underlyingError = toolAvailabilityError ?? midToolExitError ?? structuredError ?? run.error ?? emptyOutputError ?? (missingRequiredOutputAfterMutation ? missingRequiredOutputError : undefined) ?? (hiddenError?.hasError ? hiddenError.details ? `${hiddenError.errorType} failed (exit ${effectiveExitCode}): ${hiddenError.details}` : `${hiddenError.errorType} failed with exit code ${effectiveExitCode}` : undefined);
997
+ const effectiveExitCode = toolAvailabilityError || midToolExitError || structuredError || truncatedResponseError || emptyOutputError || missingRequiredOutputError ? 1 : hiddenError?.hasError ? hiddenError.exitCode ?? 1 : run.error && run.exitCode === 0 ? 1 : run.exitCode;
998
+ const underlyingError = toolAvailabilityError ?? midToolExitError ?? structuredError ?? run.error ?? emptyOutputError ?? truncatedResponseError ?? (missingRequiredOutputAfterMutation ? missingRequiredOutputError : undefined) ?? (hiddenError?.hasError ? hiddenError.details ? `${hiddenError.errorType} failed (exit ${effectiveExitCode}): ${hiddenError.details}` : `${hiddenError.errorType} failed with exit code ${effectiveExitCode}` : undefined);
1003
999
  const mutationGuardError = effectiveExitCode === 0 && !underlyingError && !missingRequiredOutputError && !step.runner ? implementationMutationError({
1004
1000
  agent: step.agent,
1005
1001
  task,
@@ -1234,9 +1230,9 @@ async function runSingleStep(step, ctx) {
1234
1230
  ctx.orcaProgressTab?.section({ agent: step.agent, index: ctx.flatIndex, count: ctx.flatStepCount });
1235
1231
  return runSingleStepInner(step, ctx);
1236
1232
  }
1237
- function externalRunnerStatus(runner) {
1233
+ function externalRunnerStatus(runner, machine) {
1238
1234
  if (runner?.type === "external-cli") {
1239
- return resolveExternalCliRunnerStatus(runner);
1235
+ return resolveExternalCliRunnerStatus(machine?.provider === "herdr" && "target" in machine ? { ...runner, machine } : runner);
1240
1236
  }
1241
1237
  if (runner?.type === "external-job") {
1242
1238
  return {
@@ -1406,15 +1402,11 @@ function combinedAbortSignal(signals) {
1406
1402
  }
1407
1403
  return controller.signal;
1408
1404
  }
1409
- async function runSingleStepWithTimeout(step, ctx, parentDeadlineAt) {
1410
- if (step.timeoutMs === undefined)
1411
- return runSingleStep(step, parentDeadlineAt === undefined ? ctx : {
1412
- ...ctx,
1413
- deadlineAt: ctx.deadlineAt === undefined ? parentDeadlineAt : Math.min(ctx.deadlineAt, parentDeadlineAt)
1414
- });
1415
- const parentRemainingMs = parentDeadlineAt === undefined ? undefined : Math.max(0, parentDeadlineAt - Date.now());
1416
- const timeoutMs = parentRemainingMs === undefined ? step.timeoutMs : Math.min(step.timeoutMs, parentRemainingMs);
1417
- const timeoutMessage = parentRemainingMs !== undefined && parentRemainingMs <= step.timeoutMs ? ctx.timeoutMessage : `Subagent timed out after ${step.timeoutMs}ms.`;
1405
+ async function runSingleStepWithTimeout(step, ctx, runRemainingMs) {
1406
+ const runRemainingAtStart = runRemainingMs();
1407
+ if (step.timeoutMs === undefined || runRemainingAtStart !== undefined && runRemainingAtStart <= step.timeoutMs) {
1408
+ return runSingleStep(step, ctx);
1409
+ }
1418
1410
  const timeoutController = new AbortController;
1419
1411
  let timeoutAction;
1420
1412
  let timeoutTriggered = false;
@@ -1431,23 +1423,27 @@ async function runSingleStepWithTimeout(step, ctx, parentDeadlineAt) {
1431
1423
  if (action && timeoutTriggered)
1432
1424
  action();
1433
1425
  };
1434
- const timer = setTimeout(triggerTimeout, timeoutMs);
1435
- timer.unref?.();
1426
+ const timer = startPausableTimer(step.timeoutMs, triggerTimeout);
1436
1427
  try {
1437
1428
  return await runSingleStep(step, {
1438
1429
  ...ctx,
1439
1430
  registerTimeout,
1440
- deadlineAt: Date.now() + timeoutMs,
1431
+ onChildEvent: (event) => {
1432
+ pauseForSupervisorWait(timer, event);
1433
+ ctx.onChildEvent?.(event);
1434
+ },
1441
1435
  timeoutSignal: combinedAbortSignal([ctx.timeoutSignal, timeoutController.signal]),
1442
- timeoutMessage
1436
+ timeoutMessage: `Subagent timed out after ${step.timeoutMs}ms.`
1443
1437
  });
1444
1438
  } finally {
1445
- clearTimeout(timer);
1439
+ timer.clear();
1446
1440
  ctx.registerTimeout?.(undefined);
1447
1441
  }
1448
1442
  }
1449
1443
  export async function runSubagent(config, childSessions) {
1450
1444
  const { id, steps, resultPath, cwd, placeholder, taskIndex, totalTasks, maxOutput, artifactsDir, artifactConfig } = config;
1445
+ if (config.waitToolName)
1446
+ setWaitToolName(config.waitToolName);
1451
1447
  const globalSemaphore = new Semaphore(config.globalConcurrencyLimit ?? DEFAULT_GLOBAL_CONCURRENCY_LIMIT);
1452
1448
  let previousOutput = "";
1453
1449
  const outputs = {};
@@ -1474,6 +1470,12 @@ export async function runSubagent(config, childSessions) {
1474
1470
  let activityTimer;
1475
1471
  let timeoutTimer;
1476
1472
  let checkpointTimer;
1473
+ const runRemainingMs = () => timeoutTimer?.remainingMs();
1474
+ const runDeadlineAt = () => {
1475
+ const remainingMs = runRemainingMs();
1476
+ return remainingMs === undefined ? undefined : Date.now() + remainingMs;
1477
+ };
1478
+ const runDeadlineExpired = () => runRemainingMs() === 0;
1477
1479
  let timedOut = false;
1478
1480
  let stopped = false;
1479
1481
  let usageBudgetExceeded = false;
@@ -1503,7 +1505,7 @@ export async function runSubagent(config, childSessions) {
1503
1505
  agent: task.agent,
1504
1506
  ...task.lane ? { lane: task.lane } : config.lane ? { lane: config.lane } : {},
1505
1507
  ...taskSessionName ? { sessionName: taskSessionName } : {},
1506
- ...externalRunnerStatus(task.runner) ? { runner: externalRunnerStatus(task.runner) } : {},
1508
+ ...externalRunnerStatus(task.runner, task.machine) ? { runner: externalRunnerStatus(task.runner, task.machine) } : {},
1507
1509
  ...statusStepDescription(task.task) ? { description: statusStepDescription(task.task) } : {},
1508
1510
  ...task.context ? { context: task.context } : {},
1509
1511
  phase: task.phase,
@@ -1533,7 +1535,7 @@ export async function runSubagent(config, childSessions) {
1533
1535
  parallelGroups.push({ start: flatStepCount, count: 1, stepIndex });
1534
1536
  initialStatusSteps.push(omitUndefinedProperties({
1535
1537
  agent: `expand:${step.parallel.agent}`,
1536
- ...externalRunnerStatus(step.parallel.runner) ? { runner: externalRunnerStatus(step.parallel.runner) } : {},
1538
+ ...externalRunnerStatus(step.parallel.runner, step.parallel.machine) ? { runner: externalRunnerStatus(step.parallel.runner, step.parallel.machine) } : {},
1537
1539
  ...step.parallel.context ? { context: step.parallel.context } : {},
1538
1540
  phase: step.phase ?? step.parallel.phase,
1539
1541
  label: step.label ?? step.parallel.label ?? `Dynamic fanout (${step.collect.as})`,
@@ -1557,7 +1559,7 @@ export async function runSubagent(config, childSessions) {
1557
1559
  agent: step.agent,
1558
1560
  ...step.lane ? { lane: step.lane } : config.lane ? { lane: config.lane } : {},
1559
1561
  ...stepSessionName ? { sessionName: stepSessionName } : {},
1560
- ...externalRunnerStatus(step.runner) ? { runner: externalRunnerStatus(step.runner) } : {},
1562
+ ...externalRunnerStatus(step.runner, step.machine) ? { runner: externalRunnerStatus(step.runner, step.machine) } : {},
1561
1563
  ...statusStepDescription(step.task) ? { description: statusStepDescription(step.task) } : {},
1562
1564
  ...step.context ? { context: step.context } : {},
1563
1565
  phase: step.phase,
@@ -2531,9 +2533,11 @@ export async function runSubagent(config, childSessions) {
2531
2533
  const target = request?.targets.find((candidate) => candidate.index === index);
2532
2534
  if (!request || !target)
2533
2535
  return;
2534
- if (target.state === "delivered" || target.state === "late" || target.state === "failed")
2536
+ if (target.state === "delivered" || target.state === "late")
2535
2537
  return;
2536
- if (target.state === delivery.state)
2538
+ if (target.state === "failed" && !(target.failureKind === "unconsumed" && delivery.failureKind === "rejected"))
2539
+ return;
2540
+ if (target.state === delivery.state && target.failureKind === delivery.failureKind)
2537
2541
  return;
2538
2542
  const late = fs.existsSync(steeringMarkerPath(requestId));
2539
2543
  const now = Date.now();
@@ -2545,7 +2549,7 @@ export async function runSubagent(config, childSessions) {
2545
2549
  emitSteeringEvent("subagent.steer.queued", { type: "steer", id: requestId, ts: now, message: delivery.message }, index, { deliveryStatus: "queued", message: delivery.message });
2546
2550
  } else {
2547
2551
  markSteeringAttention(index);
2548
- updateSteeringLifecycleTarget(requestId, index, "failed", now, { reason: delivery.message });
2552
+ updateSteeringLifecycleTarget(requestId, index, "failed", now, { reason: delivery.message, failureKind: delivery.failureKind ?? "rejected" });
2549
2553
  emitSteeringEvent("subagent.steer.failed", { type: "steer", id: requestId, ts: now, message: delivery.message }, index, { reason: delivery.message });
2550
2554
  }
2551
2555
  emitTerminalSteeringNotice(requestId, `Steering failed for run ${id}: ${delivery.message}`);
@@ -2585,8 +2589,17 @@ export async function runSubagent(config, childSessions) {
2585
2589
  statusPayload.lastUpdate = now;
2586
2590
  writeStatusPayload();
2587
2591
  };
2592
+ const pauseRunTimers = (flatIndex) => {
2593
+ timeoutTimer?.pause(String(flatIndex));
2594
+ checkpointTimer?.pause(String(flatIndex));
2595
+ };
2596
+ const resumeRunTimers = (flatIndex) => {
2597
+ timeoutTimer?.resume(String(flatIndex));
2598
+ checkpointTimer?.resume(String(flatIndex));
2599
+ };
2588
2600
  const recordStepResult = (fi, singleResult, startedAt, endedAt, recordLaunchContractDigest = false) => {
2589
2601
  const step = requiredStatusStep(statusPayload, fi);
2602
+ resumeRunTimers(fi);
2590
2603
  const childStopped = singleResult.stopped === true;
2591
2604
  const childInterrupted = singleResult.interrupted === true;
2592
2605
  step.status = stopped || childStopped ? "stopped" : timedOut ? "failed" : childInterrupted ? "paused" : singleResult.execution?.status === "partial" ? "partial" : singleResult.exitCode === 0 ? "complete" : "failed";
@@ -2687,7 +2700,9 @@ export async function runSubagent(config, childSessions) {
2687
2700
  statusPayload.toolBudget = step.toolBudget;
2688
2701
  }
2689
2702
  recordActiveToolCall(flatIndex, { toolCallId: event.toolCallId, toolName: event.toolName }, { argsPreview, currentPath, blocksSupervisor, now });
2690
- const pending = omitUndefinedProperties({ tool: event.toolName, path: currentPath, mutates, startedAt: now });
2703
+ if (blocksSupervisor)
2704
+ pauseRunTimers(flatIndex);
2705
+ const pending = omitUndefinedProperties({ tool: event.toolName, path: currentPath, mutates, startedAt: now, progressText: extractReportedProgress(event.toolName, event.args) });
2691
2706
  pendingToolResults[flatIndex] = pending;
2692
2707
  const startedCallId = event.toolCallId;
2693
2708
  if (typeof startedCallId === "string" && startedCallId)
@@ -2729,6 +2744,8 @@ export async function runSubagent(config, childSessions) {
2729
2744
  const supervisorPreviousActivity = supervisorAttentionSteps.get(flatIndex);
2730
2745
  const stillBlockingSupervisor = [...activeToolCalls[flatIndex]?.values() ?? []].some((active) => active.blocksSupervisor);
2731
2746
  const clearedSupervisorAttention = endedTool?.blocksSupervisor && !stillBlockingSupervisor ? supervisorAttentionSteps.delete(flatIndex) : false;
2747
+ if (!stillBlockingSupervisor)
2748
+ resumeRunTimers(flatIndex);
2732
2749
  if (clearedSupervisorAttention && step.activityState === "needs_attention") {
2733
2750
  setOptionalProperty(step, "activityState", supervisorPreviousActivity);
2734
2751
  syncAggregateActivityState();
@@ -2745,6 +2762,10 @@ export async function runSubagent(config, childSessions) {
2745
2762
  pendingToolResults[flatIndex] = undefined;
2746
2763
  const resultText = extractTextFromContent(event.message.content);
2747
2764
  const resultToolName = event.message.toolName;
2765
+ if (event.message.isError !== true && resultToolName === toolSnapshot?.tool && toolSnapshot?.progressText) {
2766
+ step.progressText = toolSnapshot.progressText;
2767
+ step.progressUpdatedAt = now;
2768
+ }
2748
2769
  const blockedTool = (typeof resultToolName === "string" && resultToolName.length > 0 ? resultToolName : undefined) ?? toolSnapshot?.tool;
2749
2770
  const configuredToolBudget = flatSteps[flatIndex]?.toolBudget;
2750
2771
  const budgetBlocked = configuredToolBudget !== undefined && isToolBudgetBlockedMessage(configuredToolBudget, resultText, blockedTool);
@@ -3001,7 +3022,7 @@ export async function runSubagent(config, childSessions) {
3001
3022
  cleanup
3002
3023
  });
3003
3024
  writeStatusPayload();
3004
- }, config.deadlineAt);
3025
+ }, runDeadlineAt());
3005
3026
  const interruptRunner = () => {
3006
3027
  consumeInterruptRequest(asyncDir);
3007
3028
  if (interrupted || statusPayload.state !== "running")
@@ -3124,20 +3145,19 @@ export async function runSubagent(config, childSessions) {
3124
3145
  });
3125
3146
  if (config.deadlineAt !== undefined) {
3126
3147
  const remainingMs = Math.max(0, config.deadlineAt - Date.now());
3127
- timeoutTimer = setTimeout(timeoutRunner, remainingMs);
3128
- timeoutTimer.unref?.();
3148
+ const runTimer = startPausableTimer(remainingMs, timeoutRunner);
3149
+ timeoutTimer = runTimer;
3129
3150
  const checkpointBeforeDeadlineMs = config.checkpointBeforeDeadlineMs;
3130
3151
  const checkpointDelayMs = checkpointBeforeDeadlineMs === undefined || !Number.isInteger(checkpointBeforeDeadlineMs) || checkpointBeforeDeadlineMs <= 0 ? undefined : remainingMs - checkpointBeforeDeadlineMs;
3131
3152
  if (checkpointDelayMs !== undefined && checkpointDelayMs >= 1000) {
3132
- const deadlineAt = config.deadlineAt;
3133
- checkpointTimer = setTimeout(() => {
3153
+ checkpointTimer = startPausableTimer(checkpointDelayMs, () => {
3134
3154
  checkpointTimer = undefined;
3135
3155
  if (timedOut || stopped || interrupted)
3136
3156
  return;
3137
3157
  if (!statusPayload.steps.some((step) => step.status === "running"))
3138
3158
  return;
3139
3159
  const now = Date.now();
3140
- const seconds = Math.round(Math.max(0, deadlineAt - now) / 1000);
3160
+ const seconds = Math.round(runTimer.remainingMs() / 1000);
3141
3161
  deliverSteerRequest({
3142
3162
  type: "steer",
3143
3163
  id: `deadline-checkpoint-${now}`,
@@ -3146,8 +3166,7 @@ export async function runSubagent(config, childSessions) {
3146
3166
  source: "deadline-checkpoint",
3147
3167
  message: `Deadline checkpoint from the runner: this run is killed in about ${seconds} seconds. Finish the current tool call only, then stop and reply with a handoff: changed files, build/test state, remaining work, and commit/PR state. Do not start new work.`
3148
3168
  });
3149
- }, checkpointDelayMs);
3150
- checkpointTimer.unref?.();
3169
+ });
3151
3170
  }
3152
3171
  }
3153
3172
  appendJsonl(eventsPath, JSON.stringify({
@@ -3297,7 +3316,7 @@ export async function runSubagent(config, childSessions) {
3297
3316
  const thinking = thinkingOverride ? resolveEffectiveThinking(model, thinkingOverride) : undefined;
3298
3317
  const outputPath = step.parallel.namespaceOutputPath && step.parallel.outputPath ? path.join(path.dirname(step.parallel.outputPath), `dynamic-${stepIndex}`, `${itemIndex}-${step.parallel.agent}`, path.basename(step.parallel.outputPath)) : step.parallel.outputPath;
3299
3318
  const taskText = task.task ?? step.parallel.task;
3300
- const materializedTask = step.parallel.namespaceOutputPath ? injectSingleOutputInstruction(taskText, outputPath, step.parallel) : taskText;
3319
+ const materializedTask = step.parallel.namespaceOutputPath ? injectSingleOutputInstruction(taskText, outputPath, step.parallel, step.parallel.machine) : taskText;
3301
3320
  const sessionName = deriveChildSessionName({ agent: step.parallel.agent, task: taskText, label: task.label ?? step.parallel.label });
3302
3321
  return omitUndefinedProperties({
3303
3322
  ...step.parallel,
@@ -3330,7 +3349,7 @@ export async function runSubagent(config, childSessions) {
3330
3349
  return omitUndefinedProperties({
3331
3350
  agent: task.agent,
3332
3351
  ...task.sessionName ? { sessionName: task.sessionName } : {},
3333
- ...externalRunnerStatus(task.runner) ? { runner: externalRunnerStatus(task.runner) } : {},
3352
+ ...externalRunnerStatus(task.runner, task.machine) ? { runner: externalRunnerStatus(task.runner, task.machine) } : {},
3334
3353
  ...statusStepDescription(task.task) ? { description: statusStepDescription(task.task) } : {},
3335
3354
  ...task.context ? { context: task.context } : {},
3336
3355
  ...task.phase ?? step.phase ? { phase: task.phase ?? step.phase } : {},
@@ -3496,7 +3515,7 @@ export async function runSubagent(config, childSessions) {
3496
3515
  usageBudgetExhausted: continuationUsageBudgetExhausted,
3497
3516
  usageBudget: config.usageBudget,
3498
3517
  orcaProgressTab
3499
- }), config.deadlineAt);
3518
+ }), runRemainingMs);
3500
3519
  const taskEndTime = Date.now();
3501
3520
  const childInterrupted = singleResult.interrupted === true;
3502
3521
  const childStopped = singleResult.stopped === true;
@@ -3686,7 +3705,7 @@ export async function runSubagent(config, childSessions) {
3686
3705
  try {
3687
3706
  worktreeSetup = await createWorktrees(cwd, `${id}-s${stepIndex}`, group.parallel.length, omitUndefinedProperties({
3688
3707
  signal: setupSignal,
3689
- deadlineAt: config.deadlineAt,
3708
+ deadlineAt: runDeadlineAt(),
3690
3709
  agents: group.parallel.map((task) => task.agent),
3691
3710
  labels: group.parallel.map((task) => task.lane?.key ?? config.workflowKey ?? task.outputName ?? task.label),
3692
3711
  tasks: group.parallel.map((task) => task.task),
@@ -3717,14 +3736,14 @@ export async function runSubagent(config, childSessions) {
3717
3736
  writeStatusPayload();
3718
3737
  }
3719
3738
  }));
3720
- if (config.deadlineAt !== undefined && Date.now() >= config.deadlineAt)
3739
+ if (runDeadlineExpired())
3721
3740
  timeoutRunner();
3722
3741
  if (setupSignal.aborted)
3723
3742
  throw new Error(stopped ? stopMessage : timedOut ? timeoutMessage ?? SUBAGENT_TIMED_OUT_MESSAGE : "Subagent paused during worktree setup.");
3724
3743
  } catch (error) {
3725
3744
  if (worktreeSetup)
3726
3745
  await cleanupRemainingWorktree(worktreeSetup, stepIndex, groupStartFlatIndex);
3727
- if (config.deadlineAt !== undefined && Date.now() >= config.deadlineAt)
3746
+ if (runDeadlineExpired())
3728
3747
  timeoutRunner();
3729
3748
  const setupError = error instanceof Error ? error.message : String(error);
3730
3749
  if (error instanceof WorktreeSetupError)
@@ -3892,7 +3911,7 @@ export async function runSubagent(config, childSessions) {
3892
3911
  usageBudgetExhausted: continuationUsageBudgetExhausted,
3893
3912
  usageBudget: config.usageBudget,
3894
3913
  orcaProgressTab
3895
- }), config.deadlineAt);
3914
+ }), runRemainingMs);
3896
3915
  if (task.sessionFile) {
3897
3916
  latestSessionFile = task.sessionFile;
3898
3917
  }
@@ -4106,7 +4125,7 @@ ${formatParallelHandoffError(error)}`;
4106
4125
  try {
4107
4126
  singleWorktreeSetup = await createWorktrees(cwd, `${id}-s${stepIndex}`, 1, omitUndefinedProperties({
4108
4127
  signal: setupSignal,
4109
- deadlineAt: config.deadlineAt,
4128
+ deadlineAt: runDeadlineAt(),
4110
4129
  agents: [seqStep.agent],
4111
4130
  labels: [seqStep.lane?.key ?? config.workflowKey ?? seqStep.outputName ?? seqStep.label],
4112
4131
  tasks: [seqStep.task],
@@ -4142,7 +4161,7 @@ ${formatParallelHandoffError(error)}`;
4142
4161
  } catch (error) {
4143
4162
  if (error instanceof WorktreeSetupError)
4144
4163
  publishSetupUnknown(error.snapshot);
4145
- if (config.deadlineAt !== undefined && Date.now() >= config.deadlineAt)
4164
+ if (runDeadlineExpired())
4146
4165
  timeoutRunner();
4147
4166
  const message = error instanceof Error ? error.message : String(error);
4148
4167
  if (childStopRequests.has(flatIndex))
@@ -4159,7 +4178,7 @@ ${formatParallelHandoffError(error)}`;
4159
4178
  break;
4160
4179
  }
4161
4180
  }
4162
- if (singleWorktreeSetup && config.deadlineAt !== undefined && Date.now() >= config.deadlineAt)
4181
+ if (singleWorktreeSetup && runDeadlineExpired())
4163
4182
  timeoutRunner();
4164
4183
  if (singleWorktreeSetup && (timedOut || stopped || interrupted || childStopRequests.has(flatIndex))) {
4165
4184
  await cleanupRemainingWorktree(singleWorktreeSetup, stepIndex, flatIndex);
@@ -4237,7 +4256,7 @@ ${formatParallelHandoffError(error)}`;
4237
4256
  usageBudgetExhausted: continuationUsageBudgetExhausted,
4238
4257
  usageBudget: config.usageBudget,
4239
4258
  orcaProgressTab
4240
- }), config.deadlineAt);
4259
+ }), runRemainingMs);
4241
4260
  } catch (error) {
4242
4261
  if (singleWorktreeSetup)
4243
4262
  await cleanupRemainingWorktree(singleWorktreeSetup, stepIndex, flatIndex);
@@ -4493,14 +4512,10 @@ ${r.output || (r.exitCode !== 0 ? r.error : undefined) || "(no output)"}`).join(
4493
4512
  clearInterval(activityTimer);
4494
4513
  activityTimer = undefined;
4495
4514
  }
4496
- if (timeoutTimer) {
4497
- clearTimeout(timeoutTimer);
4498
- timeoutTimer = undefined;
4499
- }
4500
- if (checkpointTimer) {
4501
- clearTimeout(checkpointTimer);
4502
- checkpointTimer = undefined;
4503
- }
4515
+ timeoutTimer?.clear();
4516
+ timeoutTimer = undefined;
4517
+ checkpointTimer?.clear();
4518
+ checkpointTimer = undefined;
4504
4519
  if (!timedOut && !stopped && !interrupted && config.timeoutMs !== undefined && timeoutMessage !== undefined && results.some((result) => result.timedOut === true && result.error?.startsWith(timeoutMessage))) {
4505
4520
  timedOut = true;
4506
4521
  }
@@ -4536,7 +4551,7 @@ ${r.output || (r.exitCode !== 0 ? r.error : undefined) || "(no output)"}`).join(
4536
4551
  continue;
4537
4552
  changed = true;
4538
4553
  const reason = target.state === "queued" ? unconsumedSteerReason() : "child terminated before steering delivery";
4539
- updateSteeringLifecycleTarget(request.id, target.index, "failed", Date.now(), { reason });
4554
+ updateSteeringLifecycleTarget(request.id, target.index, "failed", Date.now(), { reason, failureKind: "unconsumed" });
4540
4555
  markSteeringAttention(target.index);
4541
4556
  emitSteeringEvent("subagent.steer.failed", { type: "steer", id: request.id, ts: request.requestedAt, message: reason }, target.index, { reason });
4542
4557
  }
@@ -20,6 +20,7 @@ import { toAgentToolUsage } from "../../shared/utils.js";
20
20
  import { collectWaitCompletions } from "./wait-completions.js";
21
21
  import { formatResumeFirstFailedRunsNote } from "./resume-guidance.js";
22
22
  import { formatTimeoutRecoveryLines } from "../shared/mutation-evidence.js";
23
+ import { waitToolName } from "../../shared/wait-tool-name.js";
23
24
  export { WAIT_TOOL_DEFAULT_TIMEOUT_MS_ENV, WAIT_TOOL_ENABLED_ENV, resolveWaitToolConfig } from "./wait-config.js";
24
25
  const ACTIVE_STATES = ["queued", "running"];
25
26
  const DEFAULT_TIMEOUT_MS = 30 * 60 * 1000;
@@ -126,7 +127,7 @@ function foregroundChildrenNeedingAttention(run, indices) {
126
127
  }
127
128
  function formatForegroundAttention(run, children, elapsedMs) {
128
129
  const childList = children.map((child) => `${child.agent}${child.index !== undefined ? `#${child.index}` : ""}`).join(", ");
129
- return result(`Waited ${formatDuration(elapsedMs)} for remembered detached foreground run "${run.runId}"; attention required. ${children.length} child run(s) need attention: ${childList}. Reply to any pending supervisor request, then call bg_wait({ id: "${run.runId}" }) again or inspect status; do not resume or launch a replacement while it remains detached.`);
130
+ return result(`Waited ${formatDuration(elapsedMs)} for remembered detached foreground run "${run.runId}"; attention required. ${children.length} child run(s) need attention: ${childList}. Reply to any pending supervisor request, then call ${waitToolName()}({ id: "${run.runId}" }) again or inspect status; do not resume or launch a replacement while it remains detached.`);
130
131
  }
131
132
  function needsAttention(run) {
132
133
  return run.activityState === "needs_attention" || run.steps.some((step) => step.activityState === "needs_attention");
@@ -140,7 +141,7 @@ function backgroundWorkIdentity(item) {
140
141
  function backgroundWorkForSession(deps, nowMs) {
141
142
  const sessionId = deps.state.currentSessionId;
142
143
  if (!sessionId)
143
- throw new Error("bg_wait requires an active session identity to scope background work safely.");
144
+ throw new Error(`${waitToolName()} requires an active session identity to scope background work safely.`);
144
145
  const runtimeId = deps.state.supervisorOwnerSessionId;
145
146
  const sessionIds = runtimeId ? [sessionId, runtimeId] : [sessionId];
146
147
  return deps.backgroundWork?.snapshot(sessionIds, nowMs) ?? snapshotBackgroundWork(sessionIds, nowMs);
@@ -446,7 +447,7 @@ async function waitForDetachedForegroundRun(run, signal, deps, startedAt, now, p
446
447
  return result(`Wait aborted after ${formatDuration(now() - startedAt)}. Remembered foreground run "${run.runId}" remains detached. Reply to any pending supervisor request before resuming or launching a replacement.`, true);
447
448
  }
448
449
  if (now() - startedAt >= timeoutMs) {
449
- return windowElapsedResult(`Wait window elapsed after ${formatDuration(timeoutMs)} with remembered foreground run "${run.runId}" still detached. Reply to any pending supervisor request, then call bg_wait({ id: "${run.runId}" }) again or inspect status; do not resume or launch a replacement while it remains detached.`, [run.runId]);
450
+ return windowElapsedResult(`Wait window elapsed after ${formatDuration(timeoutMs)} with remembered foreground run "${run.runId}" still detached. Reply to any pending supervisor request, then call ${waitToolName()}({ id: "${run.runId}" }) again or inspect status; do not resume or launch a replacement while it remains detached.`, [run.runId]);
450
451
  }
451
452
  await waitForWake(pollIntervalMs, wake, deps);
452
453
  }
@@ -477,10 +478,10 @@ async function waitForSessionDetachedForegroundRuns(runs, signal, deps, startedA
477
478
  }
478
479
  export async function waitForSubagents(params, signal, deps) {
479
480
  if (deps.enabled === false) {
480
- return result('bg_wait is disabled by config.waitTool or DM_SUBAGENT_WAIT_TOOL_ENABLED; returning immediately without blocking background work. Active work keeps going, and you can inspect subagents with subagent({ action: "status" }) or rely on completion notifications.');
481
+ return result(`${waitToolName()} is disabled by config.waitTool or DM_SUBAGENT_WAIT_TOOL_ENABLED; returning immediately without blocking background work. Active work keeps going, and you can inspect subagents with subagent({ action: "status" }) or rely on completion notifications.`);
481
482
  }
482
483
  if (!deps.state.currentSessionId) {
483
- return result("bg_wait requires an active session identity to scope background work safely.", true);
484
+ return result(`${waitToolName()} requires an active session identity to scope background work safely.`, true);
484
485
  }
485
486
  const now = deps.now ?? Date.now;
486
487
  const pollIntervalMs = Math.max(MIN_POLL_INTERVAL_MS, deps.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS);
@@ -532,7 +533,7 @@ ${references.join(`
532
533
  }
533
534
  if (selected && params.nonBlocking) {
534
535
  if (!deps.subscribe) {
535
- return result("Non-blocking wait subscriptions require a long-lived interactive subagent runtime; this runtime can only use blocking bg_wait calls.", true);
536
+ return result(`Non-blocking wait subscriptions require a long-lived interactive subagent runtime; this runtime can only use blocking ${waitToolName()} calls.`, true);
536
537
  }
537
538
  try {
538
539
  const registration = deps.subscribe({ targetKind: selected.kind, runId: selected.id, requestedId: params.id, timeoutMs });
@@ -602,7 +603,7 @@ ${references.join(`
602
603
  return result(`Wait aborted after ${formatDuration(now() - startedAt)}. Still active: ${stillActive}.`, true);
603
604
  }
604
605
  if (now() - startedAt >= timeoutMs) {
605
- return windowElapsedResult(`Wait window elapsed after ${formatDuration(timeoutMs)} with ${activeInitialRuns.length} async run(s) and ${activeInitialProviderItems.length} provider item(s) still active: ${stillActive}. The work keeps going; call bg_wait again or inspect subagent status.`, activeInitialRuns.map((run) => run.id), activeInitialProviderItems);
606
+ return windowElapsedResult(`Wait window elapsed after ${formatDuration(timeoutMs)} with ${activeInitialRuns.length} async run(s) and ${activeInitialProviderItems.length} provider item(s) still active: ${stillActive}. The work keeps going; call ${waitToolName()} again or inspect subagent status.`, activeInitialRuns.map((run) => run.id), activeInitialProviderItems);
606
607
  }
607
608
  try {
608
609
  await waitForWake(pollIntervalMs, wake, deps);
@@ -613,7 +614,7 @@ ${references.join(`
613
614
  providerSnapshot = params.id ? providerSnapshot : backgroundWorkForSession(deps, now());
614
615
  for (const provider of initialProviderNames) {
615
616
  if (!providerSnapshot.providers.includes(provider)) {
616
- return result(`Background-work provider '${provider}' disappeared while bg_wait was tracking its active work; completion cannot be confirmed.`, true);
617
+ return result(`Background-work provider '${provider}' disappeared while ${waitToolName()} was tracking its active work; completion cannot be confirmed.`, true);
617
618
  }
618
619
  }
619
620
  providerActive = providerSnapshot.items;
@@ -645,7 +646,7 @@ ${references.join(`
645
646
  }
646
647
  const relevantAttention = attention.filter((run) => initialAsyncIds.has(run.id));
647
648
  const supervisorAttentionHint = relevantAttention.some(hasSupervisorTool) ? ' Reply to any pending supervisor request. If subagent_supervisor({ action: "pending" }) is empty, check intercom({ action: "pending" }) because an external intercom tool may own the request.' : "";
648
- const keepWaitingHint = stopOnAttention && supervisorAttentionHint === "" && (waitForAll || finishedAsyncCount + providerFinishedCount === 0) ? " These runs are still running and none is waiting on a supervisor reply. To keep waiting through this kind of attention, call bg_wait again with stopOnAttention: false; supervisor requests still end that wait." : "";
649
+ const keepWaitingHint = stopOnAttention && supervisorAttentionHint === "" && (waitForAll || finishedAsyncCount + providerFinishedCount === 0) ? ` These runs are still running and none is waiting on a supervisor reply. To keep waiting through this kind of attention, call ${waitToolName()} again with stopOnAttention: false; supervisor requests still end that wait.` : "";
649
650
  const attentionNote = relevantAttention.length > 0 ? ` ${relevantAttention.length} run(s) need attention: ${relevantAttention.map((run) => run.id).join(", ")} —${supervisorAttentionHint} inspect with subagent({ action: "status" }) then steer a top-level live async child, resume a paused/completed/failed child, or interrupt explicitly.${keepWaitingHint}` : "";
650
651
  const stillRunning = active.filter((run) => initialAsyncIds.has(run.id)).length + providerActive.filter((item) => initialProviderIds.has(backgroundWorkIdentity(item))).length;
651
652
  const elapsed = formatDuration(now() - startedAt);
@@ -669,7 +670,7 @@ ${foregroundResult.content.map((part) => part.type === "text" ? part.text : "").
669
670
  }
670
671
  const finishedCount = finishedAsyncCount + providerFinishedCount;
671
672
  const subject = initialProviderIds.size === 0 ? "run(s)" : "item(s)";
672
- const remainder = stillRunning > 0 ? ` ${stillRunning} ${subject} still in flight — call bg_wait again to catch the next one.` : relevantAttention.length > 0 ? " No other work is waitable until attention is handled." : initialProviderIds.size === 0 ? " No runs remain in flight." : " No work remains in flight.";
673
+ const remainder = stillRunning > 0 ? ` ${stillRunning} ${subject} still in flight — call ${waitToolName()} again to catch the next one.` : relevantAttention.length > 0 ? " No other work is waitable until attention is handled." : initialProviderIds.size === 0 ? " No runs remain in flight." : " No work remains in flight.";
673
674
  const progress = relevantAttention.length > 0 && finishedCount === 0 ? `${relevantAttention.length} of ${initialCount} ${subject} need attention` : `${finishedCount} of ${initialCount} ${subject} finished`;
674
675
  return result(`Waited ${elapsed}; ${progress}.${outcome}${recoveryNote}${resumeGuidance}${attentionNote}${remainder} Relevant completion/control events have been observed; inspect status if a notification is not visible yet.`, deps.failOnFailedRuns === true && failedAsyncCount > 0 || deps.failOnAttention === true && relevantAttention.length > 0, completions);
675
676
  }
@@ -1,5 +1,8 @@
1
+ import { DEFAULT_WAIT_TOOL_NAME } from "../../shared/wait-tool-name.js";
1
2
  export const WAIT_TOOL_ENABLED_ENV = "DM_SUBAGENT_WAIT_TOOL_ENABLED";
2
3
  export const WAIT_TOOL_DEFAULT_TIMEOUT_MS_ENV = "DM_SUBAGENT_WAIT_TOOL_DEFAULT_TIMEOUT_MS";
4
+ const WAIT_TOOL_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9_]{0,63}$/;
5
+ const RESERVED_TOOL_NAMES = new Set(["subagent", "subagents_enable", "subagent_supervisor", "contact_supervisor", "intercom", "structured_output", "subagent_launch", "subagent_command", "watchdog_diff", "watchdog_ask", "watchdog_warn", "watchdog_permission_decision"]);
3
6
  const TRUE_VALUES = new Set(["1", "true", "yes", "on", "enabled"]);
4
7
  const FALSE_VALUES = new Set(["0", "false", "no", "off", "disabled"]);
5
8
  function environmentValue(value) {
@@ -26,21 +29,31 @@ function configuredValue(config) {
26
29
  if (typeof config === "boolean")
27
30
  return { enabled: config };
28
31
  if (!config || typeof config !== "object" || Array.isArray(config)) {
29
- throw new Error("config.waitTool must be a boolean or an object with optional enabled and defaultTimeoutMs values.");
32
+ throw new Error("config.waitTool must be a boolean or an object with optional enabled, defaultTimeoutMs and name values.");
30
33
  }
31
- const { enabled, defaultTimeoutMs } = config;
34
+ const { enabled, defaultTimeoutMs, name } = config;
32
35
  if (enabled !== undefined && typeof enabled !== "boolean")
33
36
  throw new Error("config.waitTool.enabled must be a boolean.");
34
37
  if (defaultTimeoutMs !== undefined && (!Number.isInteger(defaultTimeoutMs) || defaultTimeoutMs < 1)) {
35
38
  throw new Error("config.waitTool.defaultTimeoutMs must be a positive integer.");
36
39
  }
37
- return { enabled, ...defaultTimeoutMs !== undefined ? { defaultTimeoutMs } : {} };
40
+ if (name !== undefined && (typeof name !== "string" || !WAIT_TOOL_NAME_PATTERN.test(name))) {
41
+ throw new Error("config.waitTool.name must start with a letter and contain only letters, digits and underscores (at most 64 characters).");
42
+ }
43
+ if (typeof name === "string" && RESERVED_TOOL_NAMES.has(name))
44
+ throw new Error(`config.waitTool.name "${name}" is already a dm-subagents tool.`);
45
+ return {
46
+ enabled,
47
+ ...defaultTimeoutMs !== undefined ? { defaultTimeoutMs } : {},
48
+ ...name !== undefined && name !== DEFAULT_WAIT_TOOL_NAME ? { name } : {}
49
+ };
38
50
  }
39
51
  export function resolveWaitToolConfig(config, env = process.env) {
40
52
  const configured = configuredValue(config);
41
53
  const envDefaultTimeoutMs = environmentDefaultTimeoutMs(env[WAIT_TOOL_DEFAULT_TIMEOUT_MS_ENV]);
42
54
  return {
43
55
  enabled: environmentValue(env[WAIT_TOOL_ENABLED_ENV]) ?? configured.enabled ?? true,
44
- ...envDefaultTimeoutMs ?? configured.defaultTimeoutMs !== undefined ? { defaultTimeoutMs: envDefaultTimeoutMs ?? configured.defaultTimeoutMs } : {}
56
+ ...envDefaultTimeoutMs ?? configured.defaultTimeoutMs !== undefined ? { defaultTimeoutMs: envDefaultTimeoutMs ?? configured.defaultTimeoutMs } : {},
57
+ ...configured.name ? { name: configured.name } : {}
45
58
  };
46
59
  }