@duckmind/dm-darwin-x64 0.67.1 → 0.67.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dm +2 -2
- package/extensions/.dm-extensions.json +147 -32
- package/extensions/dm-lens/clients/actionable-warnings.js +12 -4
- package/extensions/dm-lens/clients/advisory-provenance.js +11 -10
- package/extensions/dm-lens/clients/agent-nudge.js +1 -1
- package/extensions/dm-lens/clients/analysis-root.js +75 -34
- package/extensions/dm-lens/clients/bash-file-access.js +550 -123
- package/extensions/dm-lens/clients/blocker-freshness.js +202 -19
- package/extensions/dm-lens/clients/blocker-past-eof.js +3 -1
- package/extensions/dm-lens/clients/bounded-telemetry.js +3 -0
- package/extensions/dm-lens/clients/cache-manager.js +22 -1
- package/extensions/dm-lens/clients/cache-observability.js +278 -17
- package/extensions/dm-lens/clients/cargo-manifest.js +8 -12
- package/extensions/dm-lens/clients/cascade-format.js +162 -19
- package/extensions/dm-lens/clients/codebase-model.js +2 -2
- package/extensions/dm-lens/clients/config-locations.js +1 -8
- package/extensions/dm-lens/clients/content-stamp.js +16 -0
- package/extensions/dm-lens/clients/context-injection-ledger.js +160 -0
- package/extensions/dm-lens/clients/deferred-runner-blockers.js +46 -6
- package/extensions/dm-lens/clients/degradation-ledger.js +21 -1
- package/extensions/dm-lens/clients/deps/ast-grep-napi.js +10 -0
- package/extensions/dm-lens/clients/diagnostic-dispositions.js +28 -12
- package/extensions/dm-lens/clients/disk-change-consumers.js +312 -0
- package/extensions/dm-lens/clients/disk-change-subscribers.js +197 -0
- package/extensions/dm-lens/clients/disk-changes.js +168 -0
- package/extensions/dm-lens/clients/dispatch/auxiliary-lsp.js +10 -6
- package/extensions/dm-lens/clients/dispatch/dispatcher.js +300 -61
- package/extensions/dm-lens/clients/dispatch/fact-store.js +2 -8
- package/extensions/dm-lens/clients/dispatch/facts/function-facts.js +87 -94
- package/extensions/dm-lens/clients/dispatch/finding-policy.js +25 -1
- package/extensions/dm-lens/clients/dispatch/indent-detect.js +1 -1
- package/extensions/dm-lens/clients/dispatch/integration.js +349 -135
- package/extensions/dm-lens/clients/dispatch/lane-copies.js +23 -0
- package/extensions/dm-lens/clients/dispatch/pending-runner-findings.js +3 -0
- package/extensions/dm-lens/clients/dispatch/pre-edit-seed.js +57 -0
- package/extensions/dm-lens/clients/dispatch/rule-id-normalize.js +6 -1
- package/extensions/dm-lens/clients/dispatch/rules/high-complexity.js +2 -17
- package/extensions/dm-lens/clients/dispatch/rules/high-fan-out.js +1 -9
- package/extensions/dm-lens/clients/dispatch/runner-context.js +9 -10
- package/extensions/dm-lens/clients/dispatch/runners/ast-grep-literal-anchors.js +58 -0
- package/extensions/dm-lens/clients/dispatch/runners/ast-grep-napi.js +59 -14
- package/extensions/dm-lens/clients/dispatch/runners/biome-check.js +9 -18
- package/extensions/dm-lens/clients/dispatch/runners/cue-vet.js +11 -21
- package/extensions/dm-lens/clients/dispatch/runners/dart-analyze.js +1 -1
- package/extensions/dm-lens/clients/dispatch/runners/detekt.js +4 -3
- package/extensions/dm-lens/clients/dispatch/runners/dotnet-build.js +15 -6
- package/extensions/dm-lens/clients/dispatch/runners/fish-indent.js +59 -5
- package/extensions/dm-lens/clients/dispatch/runners/gleam-check.js +9 -19
- package/extensions/dm-lens/clients/dispatch/runners/go-vet.js +2 -2
- package/extensions/dm-lens/clients/dispatch/runners/golangci-lint.js +17 -1
- package/extensions/dm-lens/clients/dispatch/runners/helm-lint.js +8 -5
- package/extensions/dm-lens/clients/dispatch/runners/helm-render.js +1 -1
- package/extensions/dm-lens/clients/dispatch/runners/ktlint.js +27 -5
- package/extensions/dm-lens/clients/dispatch/runners/lsp.js +91 -30
- package/extensions/dm-lens/clients/dispatch/runners/oxlint.js +9 -18
- package/extensions/dm-lens/clients/dispatch/runners/shellcheck.js +11 -20
- package/extensions/dm-lens/clients/dispatch/runners/shfmt.js +7 -0
- package/extensions/dm-lens/clients/dispatch/runners/taplo.js +2 -1
- package/extensions/dm-lens/clients/dispatch/runners/tree-sitter.js +29 -16
- package/extensions/dm-lens/clients/dispatch/runners/utils/availability-policy.js +32 -4
- package/extensions/dm-lens/clients/dispatch/runners/utils/candidate-probe.js +8 -0
- package/extensions/dm-lens/clients/dispatch/runners/utils/diagnostic-parsers.js +2 -1
- package/extensions/dm-lens/clients/dispatch/runners/utils/runner-helpers.js +1 -1
- package/extensions/dm-lens/clients/dispatch/runners/utils/tool-failure.js +9 -18
- package/extensions/dm-lens/clients/dispatch/runners/vale.js +2 -16
- package/extensions/dm-lens/clients/dispatch/types.js +45 -0
- package/extensions/dm-lens/clients/dispatch/utils/lsp-diagnostics.js +2 -1
- package/extensions/dm-lens/clients/ephemeral-root.js +10 -20
- package/extensions/dm-lens/clients/file-kinds.js +6 -2
- package/extensions/dm-lens/clients/file-mutation-queue.js +4 -8
- package/extensions/dm-lens/clients/file-utils.js +167 -28
- package/extensions/dm-lens/clients/finding-delivery-gate.js +15 -1
- package/extensions/dm-lens/clients/finding-identity.js +56 -0
- package/extensions/dm-lens/clients/fix-run-restore.js +10 -0
- package/extensions/dm-lens/clients/format-service.js +23 -5
- package/extensions/dm-lens/clients/formatters.js +33 -25
- package/extensions/dm-lens/clients/git-guard.js +516 -85
- package/extensions/dm-lens/clients/govulncheck-client.js +8 -0
- package/extensions/dm-lens/clients/grammar-source.js +39 -5
- package/extensions/dm-lens/clients/gzip-stage-write.js +99 -18
- package/extensions/dm-lens/clients/inline-blocker-fields.js +1 -1
- package/extensions/dm-lens/clients/installer/index.js +83 -85
- package/extensions/dm-lens/clients/installer/managed-tool-refresh.js +211 -8
- package/extensions/dm-lens/clients/instance-reaper.js +19 -8
- package/extensions/dm-lens/clients/instance-registry.js +12 -0
- package/extensions/dm-lens/clients/jscpd-client.js +20 -4
- package/extensions/dm-lens/clients/language-profile.js +8 -7
- package/extensions/dm-lens/clients/language-registry.js +45 -4
- package/extensions/dm-lens/clients/latency-logger.js +10 -2
- package/extensions/dm-lens/clients/lens-config.js +14 -4
- package/extensions/dm-lens/clients/lens-engine.js +10 -2
- package/extensions/dm-lens/clients/lens-flag-registry.js +19 -3
- package/extensions/dm-lens/clients/line-alignment.js +200 -0
- package/extensions/dm-lens/clients/lsp/capabilities.js +2 -2
- package/extensions/dm-lens/clients/lsp/cascade-tier.js +148 -38
- package/extensions/dm-lens/clients/lsp/client-registry.js +906 -0
- package/extensions/dm-lens/clients/lsp/client.js +413 -108
- package/extensions/dm-lens/clients/lsp/config.js +151 -47
- package/extensions/dm-lens/clients/lsp/content-limits.js +2 -2
- package/extensions/dm-lens/clients/lsp/content-scan.js +69 -0
- package/extensions/dm-lens/clients/lsp/created-import-targets.js +134 -0
- package/extensions/dm-lens/clients/lsp/diagnostic-binding.js +34 -0
- package/extensions/dm-lens/clients/lsp/document-drift.js +63 -15
- package/extensions/dm-lens/clients/lsp/edits.js +109 -26
- package/extensions/dm-lens/clients/lsp/environment-gap.js +186 -0
- package/extensions/dm-lens/clients/lsp/file-server-match.js +26 -0
- package/extensions/dm-lens/clients/lsp/implicit-scope.js +208 -0
- package/extensions/dm-lens/clients/lsp/index.js +574 -916
- package/extensions/dm-lens/clients/lsp/inferred-project.js +37 -15
- package/extensions/dm-lens/clients/lsp/jvm-runtime.js +15 -9
- package/extensions/dm-lens/clients/lsp/language.js +8 -1
- package/extensions/dm-lens/clients/lsp/launch.js +93 -43
- package/extensions/dm-lens/clients/lsp/lombok.js +0 -13
- package/extensions/dm-lens/clients/lsp/path-utils.js +2 -0
- package/extensions/dm-lens/clients/lsp/position-encoding.js +0 -7
- package/extensions/dm-lens/clients/lsp/server-config-files.js +11 -0
- package/extensions/dm-lens/clients/lsp/server-traits.js +8 -2
- package/extensions/dm-lens/clients/lsp/server.js +273 -76
- package/extensions/dm-lens/clients/lsp/session-roots.js +38 -3
- package/extensions/dm-lens/clients/lsp/wait-policy/strategies.js +87 -5
- package/extensions/dm-lens/clients/lsp/watch-queue.js +23 -2
- package/extensions/dm-lens/clients/lsp/workspace-diagnostics-cache.js +183 -47
- package/extensions/dm-lens/clients/lsp/workspace-diagnostics-session.js +35 -0
- package/extensions/dm-lens/clients/lsp-mutation.js +1 -1
- package/extensions/dm-lens/clients/mcp/analyze.js +51 -13
- package/extensions/dm-lens/clients/mcp/ipc.js +24 -1
- package/extensions/dm-lens/clients/mcp/session.js +2 -7
- package/extensions/dm-lens/clients/memory-sampler.js +19 -1
- package/extensions/dm-lens/clients/metrics-history.js +16 -29
- package/extensions/dm-lens/clients/mutating-tool.js +4 -2
- package/extensions/dm-lens/clients/mutation-attribution.js +1 -4
- package/extensions/dm-lens/clients/observed-mutation.js +7 -1
- package/extensions/dm-lens/clients/opaque-mutation-scan.js +273 -59
- package/extensions/dm-lens/clients/opengrep-client.js +6 -1
- package/extensions/dm-lens/clients/opengrep-config.js +10 -5
- package/extensions/dm-lens/clients/opengrep-rule-pack.js +19 -0
- package/extensions/dm-lens/clients/out-of-band-changes.js +342 -0
- package/extensions/dm-lens/clients/package-manager.js +51 -62
- package/extensions/dm-lens/clients/package-root.js +8 -12
- package/extensions/dm-lens/clients/partial-edit-apply.js +8 -4
- package/extensions/dm-lens/clients/path-birth.js +58 -0
- package/extensions/dm-lens/clients/path-utils.js +145 -23
- package/extensions/dm-lens/clients/persist-worker-stats.js +8 -0
- package/extensions/dm-lens/clients/persistent-reverify.js +2 -1
- package/extensions/dm-lens/clients/pipeline.js +248 -35
- package/extensions/dm-lens/clients/probe-home-state.js +6 -0
- package/extensions/dm-lens/clients/project-changes.js +9 -3
- package/extensions/dm-lens/clients/project-diagnostics/fresh-fetch.js +1 -1
- package/extensions/dm-lens/clients/project-diagnostics/scanner.js +4 -2
- package/extensions/dm-lens/clients/project-lens-config.js +4 -6
- package/extensions/dm-lens/clients/project-root-markers.js +8 -0
- package/extensions/dm-lens/clients/project-snapshot-persist-worker.js +26 -8
- package/extensions/dm-lens/clients/project-snapshot.js +36 -10
- package/extensions/dm-lens/clients/python-environment.js +239 -12
- package/extensions/dm-lens/clients/read-guard-tool-lines.js +2 -8
- package/extensions/dm-lens/clients/read-guard.js +130 -43
- package/extensions/dm-lens/clients/review-graph/builder.js +102 -19
- package/extensions/dm-lens/clients/review-graph/git-identity.js +7 -2
- package/extensions/dm-lens/clients/review-graph/import-resolvers.js +9 -0
- package/extensions/dm-lens/clients/review-graph/tsconfig-paths.js +35 -2
- package/extensions/dm-lens/clients/ruff-client.js +0 -2
- package/extensions/dm-lens/clients/rules-scanner.js +0 -43
- package/extensions/dm-lens/clients/runtime-agent-end.js +37 -6
- package/extensions/dm-lens/clients/runtime-coordinator.js +177 -31
- package/extensions/dm-lens/clients/runtime-session.js +106 -66
- package/extensions/dm-lens/clients/runtime-tool-call.js +162 -65
- package/extensions/dm-lens/clients/runtime-tool-result.js +634 -147
- package/extensions/dm-lens/clients/runtime-turn.js +472 -150
- package/extensions/dm-lens/clients/rust-client.js +11 -13
- package/extensions/dm-lens/clients/safe-spawn.js +149 -17
- package/extensions/dm-lens/clients/sanitize.js +0 -169
- package/extensions/dm-lens/clients/search-read-registration.js +22 -4
- package/extensions/dm-lens/clients/session-lifecycle.js +44 -1
- package/extensions/dm-lens/clients/session-repository.js +119 -0
- package/extensions/dm-lens/clients/session-scope.js +1 -1
- package/extensions/dm-lens/clients/session-start-observability.js +12 -0
- package/extensions/dm-lens/clients/session-state-store.js +6 -1
- package/extensions/dm-lens/clients/sg-runner.js +5 -8
- package/extensions/dm-lens/clients/sgconfig.js +7 -14
- package/extensions/dm-lens/clients/single-flight.js +1 -0
- package/extensions/dm-lens/clients/source-filter.js +19 -16
- package/extensions/dm-lens/clients/source-walker.js +21 -3
- package/extensions/dm-lens/clients/startup-scan.js +18 -23
- package/extensions/dm-lens/clients/test-runner-client.js +21 -27
- package/extensions/dm-lens/clients/test-runner-delivery.js +2 -10
- package/extensions/dm-lens/clients/tool-config.js +24 -4
- package/extensions/dm-lens/clients/tool-cwd.js +11 -9
- package/extensions/dm-lens/clients/tool-policy.js +1 -8
- package/extensions/dm-lens/clients/tool-set-policy.js +32 -3
- package/extensions/dm-lens/clients/tree-sitter-client.js +70 -24
- package/extensions/dm-lens/clients/tree-sitter-query-loader.js +13 -1
- package/extensions/dm-lens/clients/tree-sitter-symbol-extractor.js +81 -56
- package/extensions/dm-lens/clients/warm-attach.js +33 -8
- package/extensions/dm-lens/clients/widget-state.js +48 -31
- package/extensions/dm-lens/clients/word-index-logger.js +3 -0
- package/extensions/dm-lens/clients/word-index.js +15 -2
- package/extensions/dm-lens/clients/workspace-topology.js +10 -8
- package/extensions/dm-lens/config/biome/core.jsonc +3 -3
- package/extensions/dm-lens/config/dependency-cruiser-eager-allowlist.json +1 -0
- package/extensions/dm-lens/dist/clients/actionable-warnings.js +8 -4
- package/extensions/dm-lens/dist/clients/advisory-provenance.js +11 -10
- package/extensions/dm-lens/dist/clients/agent-nudge.js +1 -1
- package/extensions/dm-lens/dist/clients/analysis-root.js +67 -34
- package/extensions/dm-lens/dist/clients/bash-file-access.js +550 -123
- package/extensions/dm-lens/dist/clients/blocker-freshness.js +195 -19
- package/extensions/dm-lens/dist/clients/blocker-past-eof.js +3 -1
- package/extensions/dm-lens/dist/clients/bounded-telemetry.js +3 -0
- package/extensions/dm-lens/dist/clients/cache-manager.js +22 -1
- package/extensions/dm-lens/dist/clients/cache-observability.js +275 -17
- package/extensions/dm-lens/dist/clients/cargo-manifest.js +8 -12
- package/extensions/dm-lens/dist/clients/cascade-format.js +160 -19
- package/extensions/dm-lens/dist/clients/codebase-model.js +2 -2
- package/extensions/dm-lens/dist/clients/config-locations.js +2 -8
- package/extensions/dm-lens/dist/clients/content-stamp.js +16 -0
- package/extensions/dm-lens/dist/clients/context-injection-ledger.js +157 -0
- package/extensions/dm-lens/dist/clients/deferred-runner-blockers.js +46 -6
- package/extensions/dm-lens/dist/clients/degradation-ledger.js +18 -1
- package/extensions/dm-lens/dist/clients/deps/ast-grep-napi.js +10 -0
- package/extensions/dm-lens/dist/clients/diagnostic-dispositions.js +28 -12
- package/extensions/dm-lens/dist/clients/disk-change-consumers.js +312 -0
- package/extensions/dm-lens/dist/clients/disk-change-subscribers.js +191 -0
- package/extensions/dm-lens/dist/clients/disk-changes.js +165 -0
- package/extensions/dm-lens/dist/clients/dispatch/auxiliary-lsp.js +10 -6
- package/extensions/dm-lens/dist/clients/dispatch/dispatcher.js +284 -61
- package/extensions/dm-lens/dist/clients/dispatch/fact-store.js +2 -8
- package/extensions/dm-lens/dist/clients/dispatch/facts/function-facts.js +87 -94
- package/extensions/dm-lens/dist/clients/dispatch/finding-policy.js +25 -1
- package/extensions/dm-lens/dist/clients/dispatch/indent-detect.js +1 -1
- package/extensions/dm-lens/dist/clients/dispatch/integration.js +333 -137
- package/extensions/dm-lens/dist/clients/dispatch/lane-copies.js +23 -0
- package/extensions/dm-lens/dist/clients/dispatch/pending-runner-findings.js +3 -0
- package/extensions/dm-lens/dist/clients/dispatch/pre-edit-seed.js +57 -0
- package/extensions/dm-lens/dist/clients/dispatch/rule-id-normalize.js +6 -1
- package/extensions/dm-lens/dist/clients/dispatch/rules/high-complexity.js +2 -17
- package/extensions/dm-lens/dist/clients/dispatch/rules/high-fan-out.js +1 -9
- package/extensions/dm-lens/dist/clients/dispatch/runner-context.js +5 -10
- package/extensions/dm-lens/dist/clients/dispatch/runners/ast-grep-literal-anchors.js +58 -0
- package/extensions/dm-lens/dist/clients/dispatch/runners/ast-grep-napi.js +59 -14
- package/extensions/dm-lens/dist/clients/dispatch/runners/biome-check.js +9 -18
- package/extensions/dm-lens/dist/clients/dispatch/runners/cue-vet.js +11 -21
- package/extensions/dm-lens/dist/clients/dispatch/runners/dart-analyze.js +1 -1
- package/extensions/dm-lens/dist/clients/dispatch/runners/detekt.js +4 -3
- package/extensions/dm-lens/dist/clients/dispatch/runners/dotnet-build.js +12 -6
- package/extensions/dm-lens/dist/clients/dispatch/runners/fish-indent.js +59 -5
- package/extensions/dm-lens/dist/clients/dispatch/runners/gleam-check.js +9 -19
- package/extensions/dm-lens/dist/clients/dispatch/runners/go-vet.js +2 -2
- package/extensions/dm-lens/dist/clients/dispatch/runners/golangci-lint.js +17 -1
- package/extensions/dm-lens/dist/clients/dispatch/runners/helm-lint.js +8 -5
- package/extensions/dm-lens/dist/clients/dispatch/runners/helm-render.js +1 -1
- package/extensions/dm-lens/dist/clients/dispatch/runners/ktlint.js +27 -5
- package/extensions/dm-lens/dist/clients/dispatch/runners/lsp.js +79 -30
- package/extensions/dm-lens/dist/clients/dispatch/runners/oxlint.js +9 -18
- package/extensions/dm-lens/dist/clients/dispatch/runners/shellcheck.js +11 -20
- package/extensions/dm-lens/dist/clients/dispatch/runners/shfmt.js +7 -0
- package/extensions/dm-lens/dist/clients/dispatch/runners/taplo.js +2 -1
- package/extensions/dm-lens/dist/clients/dispatch/runners/tree-sitter.js +29 -16
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils/availability-policy.js +32 -4
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils/candidate-probe.js +5 -0
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils/diagnostic-parsers.js +2 -1
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +1 -1
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils/tool-failure.js +9 -19
- package/extensions/dm-lens/dist/clients/dispatch/runners/vale.js +2 -16
- package/extensions/dm-lens/dist/clients/dispatch/types.js +45 -0
- package/extensions/dm-lens/dist/clients/dispatch/utils/lsp-diagnostics.js +2 -1
- package/extensions/dm-lens/dist/clients/ephemeral-root.js +8 -20
- package/extensions/dm-lens/dist/clients/file-kinds.js +6 -2
- package/extensions/dm-lens/dist/clients/file-mutation-queue.js +4 -8
- package/extensions/dm-lens/dist/clients/file-utils.js +163 -29
- package/extensions/dm-lens/dist/clients/finding-delivery-gate.js +15 -1
- package/extensions/dm-lens/dist/clients/finding-identity.js +56 -0
- package/extensions/dm-lens/dist/clients/fix-run-restore.js +10 -0
- package/extensions/dm-lens/dist/clients/format-service.js +23 -5
- package/extensions/dm-lens/dist/clients/formatters.js +25 -25
- package/extensions/dm-lens/dist/clients/git-guard.js +507 -85
- package/extensions/dm-lens/dist/clients/govulncheck-client.js +5 -0
- package/extensions/dm-lens/dist/clients/grammar-source.js +39 -5
- package/extensions/dm-lens/dist/clients/gzip-stage-write.js +99 -18
- package/extensions/dm-lens/dist/clients/inline-blocker-fields.js +1 -1
- package/extensions/dm-lens/dist/clients/installer/index.js +76 -83
- package/extensions/dm-lens/dist/clients/installer/managed-tool-refresh.js +208 -9
- package/extensions/dm-lens/dist/clients/instance-reaper.js +19 -8
- package/extensions/dm-lens/dist/clients/instance-registry.js +12 -0
- package/extensions/dm-lens/dist/clients/jscpd-client.js +15 -4
- package/extensions/dm-lens/dist/clients/language-profile.js +3 -7
- package/extensions/dm-lens/dist/clients/language-registry.js +45 -4
- package/extensions/dm-lens/dist/clients/latency-logger.js +10 -2
- package/extensions/dm-lens/dist/clients/lens-config.js +12 -4
- package/extensions/dm-lens/dist/clients/lens-engine.js +10 -3
- package/extensions/dm-lens/dist/clients/lens-flag-registry.js +19 -3
- package/extensions/dm-lens/dist/clients/line-alignment.js +200 -0
- package/extensions/dm-lens/dist/clients/lsp/capabilities.js +2 -2
- package/extensions/dm-lens/dist/clients/lsp/cascade-tier.js +148 -38
- package/extensions/dm-lens/dist/clients/lsp/client-registry.js +877 -0
- package/extensions/dm-lens/dist/clients/lsp/client.js +398 -109
- package/extensions/dm-lens/dist/clients/lsp/config.js +147 -47
- package/extensions/dm-lens/dist/clients/lsp/content-limits.js +2 -2
- package/extensions/dm-lens/dist/clients/lsp/content-scan.js +69 -0
- package/extensions/dm-lens/dist/clients/lsp/created-import-targets.js +134 -0
- package/extensions/dm-lens/dist/clients/lsp/diagnostic-binding.js +34 -0
- package/extensions/dm-lens/dist/clients/lsp/document-drift.js +63 -15
- package/extensions/dm-lens/dist/clients/lsp/edits.js +104 -26
- package/extensions/dm-lens/dist/clients/lsp/environment-gap.js +186 -0
- package/extensions/dm-lens/dist/clients/lsp/file-server-match.js +26 -0
- package/extensions/dm-lens/dist/clients/lsp/implicit-scope.js +205 -0
- package/extensions/dm-lens/dist/clients/lsp/index.js +547 -894
- package/extensions/dm-lens/dist/clients/lsp/inferred-project.js +34 -15
- package/extensions/dm-lens/dist/clients/lsp/jvm-runtime.js +15 -9
- package/extensions/dm-lens/dist/clients/lsp/language.js +4 -1
- package/extensions/dm-lens/dist/clients/lsp/launch.js +85 -43
- package/extensions/dm-lens/dist/clients/lsp/lombok.js +0 -13
- package/extensions/dm-lens/dist/clients/lsp/path-utils.js +1 -1
- package/extensions/dm-lens/dist/clients/lsp/position-encoding.js +0 -7
- package/extensions/dm-lens/dist/clients/lsp/server-config-files.js +11 -0
- package/extensions/dm-lens/dist/clients/lsp/server-traits.js +8 -2
- package/extensions/dm-lens/dist/clients/lsp/server.js +267 -80
- package/extensions/dm-lens/dist/clients/lsp/session-roots.js +34 -3
- package/extensions/dm-lens/dist/clients/lsp/wait-policy/strategies.js +85 -5
- package/extensions/dm-lens/dist/clients/lsp/watch-queue.js +23 -2
- package/extensions/dm-lens/dist/clients/lsp/workspace-diagnostics-cache.js +172 -47
- package/extensions/dm-lens/dist/clients/lsp/workspace-diagnostics-session.js +35 -0
- package/extensions/dm-lens/dist/clients/lsp-mutation.js +1 -1
- package/extensions/dm-lens/dist/clients/mcp/analyze.js +51 -14
- package/extensions/dm-lens/dist/clients/mcp/ipc.js +24 -1
- package/extensions/dm-lens/dist/clients/mcp/session.js +2 -7
- package/extensions/dm-lens/dist/clients/memory-sampler.js +19 -1
- package/extensions/dm-lens/dist/clients/metrics-history.js +16 -29
- package/extensions/dm-lens/dist/clients/mutating-tool.js +4 -2
- package/extensions/dm-lens/dist/clients/mutation-attribution.js +1 -4
- package/extensions/dm-lens/dist/clients/observed-mutation.js +7 -1
- package/extensions/dm-lens/dist/clients/opaque-mutation-scan.js +260 -59
- package/extensions/dm-lens/dist/clients/opengrep-client.js +6 -1
- package/extensions/dm-lens/dist/clients/opengrep-config.js +10 -5
- package/extensions/dm-lens/dist/clients/opengrep-rule-pack.js +19 -0
- package/extensions/dm-lens/dist/clients/out-of-band-changes.js +329 -0
- package/extensions/dm-lens/dist/clients/package-manager.js +36 -62
- package/extensions/dm-lens/dist/clients/package-root.js +8 -12
- package/extensions/dm-lens/dist/clients/partial-edit-apply.js +8 -4
- package/extensions/dm-lens/dist/clients/path-birth.js +58 -0
- package/extensions/dm-lens/dist/clients/path-utils.js +142 -23
- package/extensions/dm-lens/dist/clients/persist-worker-stats.js +8 -0
- package/extensions/dm-lens/dist/clients/persistent-reverify.js +2 -1
- package/extensions/dm-lens/dist/clients/pipeline.js +229 -35
- package/extensions/dm-lens/dist/clients/probe-home-state.js +6 -0
- package/extensions/dm-lens/dist/clients/project-changes.js +9 -3
- package/extensions/dm-lens/dist/clients/project-diagnostics/fresh-fetch.js +1 -1
- package/extensions/dm-lens/dist/clients/project-diagnostics/scanner.js +4 -2
- package/extensions/dm-lens/dist/clients/project-lens-config.js +4 -6
- package/extensions/dm-lens/dist/clients/project-root-markers.js +8 -0
- package/extensions/dm-lens/dist/clients/project-snapshot-persist-worker.js +26 -8
- package/extensions/dm-lens/dist/clients/project-snapshot.js +33 -11
- package/extensions/dm-lens/dist/clients/python-environment.js +239 -13
- package/extensions/dm-lens/dist/clients/read-guard-tool-lines.js +2 -8
- package/extensions/dm-lens/dist/clients/read-guard.js +127 -39
- package/extensions/dm-lens/dist/clients/review-graph/builder.js +94 -22
- package/extensions/dm-lens/dist/clients/review-graph/git-identity.js +7 -2
- package/extensions/dm-lens/dist/clients/review-graph/import-resolvers.js +9 -0
- package/extensions/dm-lens/dist/clients/review-graph/tsconfig-paths.js +35 -2
- package/extensions/dm-lens/dist/clients/ruff-client.js +0 -2
- package/extensions/dm-lens/dist/clients/rules-scanner.js +0 -43
- package/extensions/dm-lens/dist/clients/runtime-agent-end.js +37 -6
- package/extensions/dm-lens/dist/clients/runtime-coordinator.js +168 -31
- package/extensions/dm-lens/dist/clients/runtime-session.js +103 -65
- package/extensions/dm-lens/dist/clients/runtime-tool-call.js +155 -64
- package/extensions/dm-lens/dist/clients/runtime-tool-result.js +586 -148
- package/extensions/dm-lens/dist/clients/runtime-turn.js +450 -152
- package/extensions/dm-lens/dist/clients/rust-client.js +11 -13
- package/extensions/dm-lens/dist/clients/safe-spawn.js +144 -17
- package/extensions/dm-lens/dist/clients/sanitize.js +0 -169
- package/extensions/dm-lens/dist/clients/search-read-registration.js +20 -4
- package/extensions/dm-lens/dist/clients/session-lifecycle.js +41 -1
- package/extensions/dm-lens/dist/clients/session-repository.js +113 -0
- package/extensions/dm-lens/dist/clients/session-scope.js +1 -1
- package/extensions/dm-lens/dist/clients/session-start-observability.js +12 -0
- package/extensions/dm-lens/dist/clients/session-state-store.js +6 -1
- package/extensions/dm-lens/dist/clients/sg-runner.js +5 -8
- package/extensions/dm-lens/dist/clients/sgconfig.js +7 -14
- package/extensions/dm-lens/dist/clients/single-flight.js +1 -0
- package/extensions/dm-lens/dist/clients/source-filter.js +19 -16
- package/extensions/dm-lens/dist/clients/source-walker.js +21 -3
- package/extensions/dm-lens/dist/clients/startup-scan.js +14 -23
- package/extensions/dm-lens/dist/clients/test-runner-client.js +17 -28
- package/extensions/dm-lens/dist/clients/test-runner-delivery.js +2 -10
- package/extensions/dm-lens/dist/clients/tool-config.js +24 -4
- package/extensions/dm-lens/dist/clients/tool-cwd.js +10 -9
- package/extensions/dm-lens/dist/clients/tool-policy.js +1 -8
- package/extensions/dm-lens/dist/clients/tool-set-policy.js +32 -3
- package/extensions/dm-lens/dist/clients/tree-sitter-client.js +69 -25
- package/extensions/dm-lens/dist/clients/tree-sitter-query-loader.js +13 -1
- package/extensions/dm-lens/dist/clients/tree-sitter-symbol-extractor.js +81 -56
- package/extensions/dm-lens/dist/clients/warm-attach.js +31 -9
- package/extensions/dm-lens/dist/clients/widget-state.js +48 -31
- package/extensions/dm-lens/dist/clients/word-index-logger.js +3 -0
- package/extensions/dm-lens/dist/clients/word-index.js +11 -2
- package/extensions/dm-lens/dist/clients/workspace-topology.js +10 -4
- package/extensions/dm-lens/dist/index.js +315 -144
- package/extensions/dm-lens/dist/mcp/analyze-cli.js +1 -1
- package/extensions/dm-lens/dist/mcp/cli.js +1 -1
- package/extensions/dm-lens/dist/mcp/server.js +16 -14
- package/extensions/dm-lens/dist/mcp/worker.js +1 -1
- package/extensions/dm-lens/dist/scripts/lib/process-scan.mjs +1 -1
- package/extensions/dm-lens/dist/tools/activate-tools.js +3 -2
- package/extensions/dm-lens/dist/tools/ast-grep-outline.js +6 -4
- package/extensions/dm-lens/dist/tools/ast-grep-replace.js +17 -10
- package/extensions/dm-lens/dist/tools/ast-grep-search.js +22 -19
- package/extensions/dm-lens/dist/tools/lens-diagnostic-mark.js +3 -3
- package/extensions/dm-lens/dist/tools/lens-diagnostics.js +245 -70
- package/extensions/dm-lens/dist/tools/lsp-diagnostics.js +276 -77
- package/extensions/dm-lens/dist/tools/lsp-navigation.js +152 -100
- package/extensions/dm-lens/dist/tools/module-report.js +2 -1
- package/extensions/dm-lens/dist/tools/shared.js +16 -2
- package/extensions/dm-lens/index.js +336 -141
- package/extensions/dm-lens/mcp/analyze-cli.js +1 -1
- package/extensions/dm-lens/mcp/cli.js +1 -1
- package/extensions/dm-lens/mcp/server.js +16 -13
- package/extensions/dm-lens/mcp/worker.js +1 -1
- package/extensions/dm-lens/package.json +1 -1
- package/extensions/dm-lens/rules/ast-grep-rules/rule-tests/no-return-value-in-generator-test.yml +17 -0
- package/extensions/dm-lens/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-js-test.yml +86 -0
- package/extensions/dm-lens/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-test.yml +86 -0
- package/extensions/dm-lens/rules/ast-grep-rules/rule-tests/unchecked-numeric-parse-python-test.yml +15 -0
- package/extensions/dm-lens/rules/ast-grep-rules/rules/no-return-value-in-generator.yml +9 -4
- package/extensions/dm-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +119 -0
- package/extensions/dm-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +119 -0
- package/extensions/dm-lens/rules/ast-grep-rules/rules/unchecked-numeric-parse-python.yml +13 -2
- package/extensions/dm-lens/rules/rule-catalog.json +25 -1
- package/extensions/dm-lens/scripts/lib/process-scan.mjs +1 -1
- package/extensions/dm-lens/skills/{pi-lens-ast-grep → dm-lens-ast-grep}/SKILL.md +1 -1
- package/extensions/dm-lens/tools/activate-tools.js +3 -2
- package/extensions/dm-lens/tools/ast-grep-outline.js +6 -4
- package/extensions/dm-lens/tools/ast-grep-replace.js +17 -10
- package/extensions/dm-lens/tools/ast-grep-search.js +27 -19
- package/extensions/dm-lens/tools/lens-diagnostic-mark.js +3 -3
- package/extensions/dm-lens/tools/lens-diagnostics.js +260 -68
- package/extensions/dm-lens/tools/lsp-diagnostics.js +303 -76
- package/extensions/dm-lens/tools/lsp-navigation.js +168 -102
- package/extensions/dm-lens/tools/module-report.js +2 -1
- package/extensions/dm-lens/tools/shared.js +16 -2
- package/extensions/dm-mcp-adapter/.github/workflows/ci.yml +82 -0
- package/extensions/dm-mcp-adapter/THIRD_PARTY_NOTICES.md +1 -1
- package/extensions/dm-mcp-adapter/VISION.md +94 -0
- package/extensions/dm-mcp-adapter/agent-dir.js +2 -2
- package/extensions/dm-mcp-adapter/bearer-command-resolver.js +5 -3
- package/extensions/dm-mcp-adapter/bench/server-memory.mjs +432 -0
- package/extensions/dm-mcp-adapter/bench/session.js +105 -0
- package/extensions/dm-mcp-adapter/bench/token-cost/data.mjs +231 -0
- package/extensions/dm-mcp-adapter/bench/token-cost/run.mjs +190 -0
- package/extensions/dm-mcp-adapter/bench/token-cost/server.mjs +109 -0
- package/extensions/dm-mcp-adapter/cli.js +55 -100
- package/extensions/dm-mcp-adapter/codemode-bridge.js +92 -0
- package/extensions/dm-mcp-adapter/commands.js +143 -26
- package/extensions/dm-mcp-adapter/config.js +303 -78
- package/extensions/dm-mcp-adapter/conformance/baseline-client.yml +22 -0
- package/extensions/dm-mcp-adapter/conformance/driver.js +200 -0
- package/extensions/dm-mcp-adapter/conformance/driver.sh +24 -0
- package/extensions/dm-mcp-adapter/conformance/run.sh +130 -0
- package/extensions/dm-mcp-adapter/deferred-tool-surface.js +69 -0
- package/extensions/dm-mcp-adapter/direct-tool-surface.js +96 -72
- package/extensions/dm-mcp-adapter/direct-tools.js +76 -53
- package/extensions/dm-mcp-adapter/dist/agent-dir.js +2 -2
- package/extensions/dm-mcp-adapter/dist/bearer-command-resolver.js +5 -3
- package/extensions/dm-mcp-adapter/dist/config.js +304 -55
- package/extensions/dm-mcp-adapter/dist/elicitation-handler.js +4 -0
- package/extensions/dm-mcp-adapter/dist/extraction-settings.js +43 -0
- package/extensions/dm-mcp-adapter/dist/mcp-probe.js +1 -1
- package/extensions/dm-mcp-adapter/dist/mcp-tasks.js +46 -7
- package/extensions/dm-mcp-adapter/dist/metadata-cache.js +93 -5
- package/extensions/dm-mcp-adapter/dist/output-shape.js +1 -1
- package/extensions/dm-mcp-adapter/dist/project-server-trust.js +108 -20
- package/extensions/dm-mcp-adapter/dist/request-headers-command.js +17 -1
- package/extensions/dm-mcp-adapter/dist/runtime-owner.js +7 -6
- package/extensions/dm-mcp-adapter/dist/sampling-handler.js +8 -2
- package/extensions/dm-mcp-adapter/dist/script-tools.js +72 -0
- package/extensions/dm-mcp-adapter/dist/semantic-settings.js +51 -0
- package/extensions/dm-mcp-adapter/dist/server-log.js +19 -0
- package/extensions/dm-mcp-adapter/dist/server-manager.js +62 -21
- package/extensions/dm-mcp-adapter/dist/task-entries.js +60 -0
- package/extensions/dm-mcp-adapter/dist/task-jobs.js +259 -0
- package/extensions/dm-mcp-adapter/dist/types.js +7 -0
- package/extensions/dm-mcp-adapter/dist/utils.js +33 -7
- package/extensions/dm-mcp-adapter/dm-host-tool-context.js +0 -0
- package/extensions/dm-mcp-adapter/elicitation-handler.js +4 -0
- package/extensions/dm-mcp-adapter/error-signal.js +12 -1
- package/extensions/dm-mcp-adapter/executor-accounts.js +192 -0
- package/extensions/dm-mcp-adapter/executor-app-tools.js +61 -0
- package/extensions/dm-mcp-adapter/executor-catalog.js +157 -0
- package/extensions/dm-mcp-adapter/executor-pauses.js +105 -0
- package/extensions/dm-mcp-adapter/extraction-settings.js +43 -0
- package/extensions/dm-mcp-adapter/extraction.js +396 -0
- package/extensions/dm-mcp-adapter/host-html-template.js +1 -1
- package/extensions/dm-mcp-adapter/host-managed.js +24 -5
- package/extensions/dm-mcp-adapter/index.js +761 -76
- package/extensions/dm-mcp-adapter/init.js +235 -11
- package/extensions/dm-mcp-adapter/jev-semantic-search.js +161 -0
- package/extensions/dm-mcp-adapter/mcp-code.js +12 -11
- package/extensions/dm-mcp-adapter/mcp-keyring-helper.cjs +1 -1
- package/extensions/dm-mcp-adapter/mcp-output-guard.js +7 -0
- package/extensions/dm-mcp-adapter/mcp-panel.js +23 -21
- package/extensions/dm-mcp-adapter/mcp-probe.js +1 -1
- package/extensions/dm-mcp-adapter/mcp-status.js +2 -1
- package/extensions/dm-mcp-adapter/mcp-tasks.js +46 -7
- package/extensions/dm-mcp-adapter/metadata-cache.js +93 -5
- package/extensions/dm-mcp-adapter/namespace-tools.js +12 -4
- package/extensions/dm-mcp-adapter/output-shape.js +1 -1
- package/extensions/dm-mcp-adapter/package.json +1 -1
- package/extensions/dm-mcp-adapter/pi-mcp.mp4 +0 -0
- package/extensions/dm-mcp-adapter/pi-signin-import.js +1 -1
- package/extensions/dm-mcp-adapter/project-server-trust.js +108 -20
- package/extensions/dm-mcp-adapter/proxy-modes.js +320 -110
- package/extensions/dm-mcp-adapter/request-headers-command.js +17 -1
- package/extensions/dm-mcp-adapter/runtime-owner.js +7 -6
- package/extensions/dm-mcp-adapter/sampling-handler.js +8 -2
- package/extensions/dm-mcp-adapter/script-tool-save.js +251 -0
- package/extensions/dm-mcp-adapter/script-tool-surface.js +100 -0
- package/extensions/dm-mcp-adapter/script-tools.js +72 -0
- package/extensions/dm-mcp-adapter/semantic-search.js +176 -50
- package/extensions/dm-mcp-adapter/semantic-settings.js +51 -0
- package/extensions/dm-mcp-adapter/server-log.js +19 -0
- package/extensions/dm-mcp-adapter/server-manager.js +64 -21
- package/extensions/dm-mcp-adapter/task-entries.js +60 -0
- package/extensions/dm-mcp-adapter/task-jobs.js +263 -0
- package/extensions/dm-mcp-adapter/tool-approval.js +49 -2
- package/extensions/dm-mcp-adapter/tool-metadata.js +70 -3
- package/extensions/dm-mcp-adapter/tool-registrar.js +8 -1
- package/extensions/dm-mcp-adapter/tool-result-renderer.js +10 -6
- package/extensions/dm-mcp-adapter/types.js +7 -0
- package/extensions/dm-mcp-adapter/ui-server.js +24 -18
- package/extensions/dm-mcp-adapter/ui-session.js +3 -3
- package/extensions/dm-mcp-adapter/upgrade-notice.js +42 -0
- package/extensions/dm-mcp-adapter/utils.js +33 -7
- package/extensions/dm-ponytail/extensions/ponytail.mjs +11 -3
- package/extensions/dm-ponytail/hooks/band/board.js +524 -0
- package/extensions/dm-ponytail/hooks/band/logo.js +2 -0
- package/extensions/dm-ponytail/hooks/band/metrics.js +238 -0
- package/extensions/dm-ponytail/hooks/band/register.js +532 -0
- package/extensions/dm-ponytail/hooks/claude-band.json +6 -0
- package/extensions/dm-ponytail/hooks/claude-codex-hooks.json +6 -6
- package/extensions/dm-ponytail/hooks/copilot-hooks.json +6 -6
- package/extensions/dm-ponytail/hooks/cursor-hooks.json +2 -2
- package/extensions/dm-ponytail/hooks/ponytail-activate.js +105 -70
- package/extensions/dm-ponytail/hooks/ponytail-band-import.js +308 -0
- package/extensions/dm-ponytail/hooks/ponytail-config.js +4 -0
- package/extensions/dm-ponytail/hooks/ponytail-instructions.js +1 -1
- package/extensions/dm-ponytail/hooks/ponytail-map.js +7 -3
- package/extensions/dm-ponytail/hooks/ponytail-mode-tracker.js +41 -4
- package/extensions/dm-ponytail/hooks/ponytail-runtime.js +11 -8
- package/extensions/dm-ponytail/pi-extension/index.js +11 -3
- package/extensions/dm-ponytail/skills/ponytail/SKILL.md +1 -1
- package/extensions/dm-ponytail/skills/ponytail-debt/SKILL.md +4 -5
- package/extensions/dm-ponytail/skills/ponytail-gain/SKILL.md +0 -1
- package/extensions/dm-ponytail/skills/ponytail-help/SKILL.md +6 -0
- package/extensions/dm-skills-manager/package.json +1 -1
- package/extensions/dm-subagents/VISION.md +98 -0
- package/extensions/dm-subagents/agents/evidence-auditor.md +1 -0
- package/extensions/dm-subagents/agents/oracle.md +1 -0
- package/extensions/dm-subagents/agents/reviewer.md +1 -0
- package/extensions/dm-subagents/package.json +2 -1
- package/extensions/dm-subagents/scripts/build-package.mjs +128 -0
- package/extensions/dm-subagents/skills/council-mode/SKILL.md +1 -4
- package/extensions/dm-subagents/skills/dm-subagents/SKILL.md +130 -106
- package/extensions/dm-subagents/skills/dm-subagents/references/execution-controls.md +4 -3
- package/extensions/dm-subagents/skills/dm-subagents/references/orchestration.md +124 -0
- package/extensions/dm-subagents/skills/dm-subagents/references/prompting-and-roles.md +96 -295
- package/extensions/dm-subagents/src/agents/agent-management.js +14 -19
- package/extensions/dm-subagents/src/agents/agent-memory.js +2 -1
- package/extensions/dm-subagents/src/agents/agent-serializer.js +1 -2
- package/extensions/dm-subagents/src/agents/agents.js +7 -8
- package/extensions/dm-subagents/src/agents/frontmatter.js +34 -16
- package/extensions/dm-subagents/src/agents/skills.js +1 -1
- package/extensions/dm-subagents/src/api/background-work.js +8 -5
- package/extensions/dm-subagents/src/api/external-runs.js +3 -4
- package/extensions/dm-subagents/src/extension/active-runs-prompt.js +20 -0
- package/extensions/dm-subagents/src/extension/config.js +12 -0
- package/extensions/dm-subagents/src/extension/declaration-pinning.js +20 -3
- package/extensions/dm-subagents/src/extension/herdr-dm-bridge.js +24 -12
- package/extensions/dm-subagents/src/extension/index.js +125 -20
- package/extensions/dm-subagents/src/extension/public-execution.js +3 -0
- package/extensions/dm-subagents/src/extension/reply-workflow-script.js +3 -2
- package/extensions/dm-subagents/src/extension/rpc.js +5 -3
- package/extensions/dm-subagents/src/extension/schemas.js +6 -5
- package/extensions/dm-subagents/src/extension/subagent-guide.js +1 -2
- package/extensions/dm-subagents/src/extension/tool-activation.js +60 -26
- package/extensions/dm-subagents/src/extension/tool-description.js +2 -2
- package/extensions/dm-subagents/src/extension/upgrade-notice.js +5 -1
- package/extensions/dm-subagents/src/intercom/native-supervisor-channel.js +143 -15
- package/extensions/dm-subagents/src/missions/actions.js +4 -1
- package/extensions/dm-subagents/src/missions/lifecycle.js +32 -8
- package/extensions/dm-subagents/src/missions/store.js +1 -0
- package/extensions/dm-subagents/src/runs/background/active-async-capacity.js +15 -9
- package/extensions/dm-subagents/src/runs/background/async-execution.js +30 -16
- package/extensions/dm-subagents/src/runs/background/async-job-tracker.js +12 -3
- package/extensions/dm-subagents/src/runs/background/async-resume.js +5 -3
- package/extensions/dm-subagents/src/runs/background/async-status-snapshot.js +4 -2
- package/extensions/dm-subagents/src/runs/background/async-status.js +32 -10
- package/extensions/dm-subagents/src/runs/background/auto-drain.js +2 -1
- package/extensions/dm-subagents/src/runs/background/await-async-run.js +2 -7
- package/extensions/dm-subagents/src/runs/background/boot-id.js +36 -0
- package/extensions/dm-subagents/src/runs/background/chain-root-attachment.js +4 -4
- package/extensions/dm-subagents/src/runs/background/index-segment.js +1 -1
- package/extensions/dm-subagents/src/runs/background/inspect-rpc.js +17 -3
- package/extensions/dm-subagents/src/runs/background/interrupted-elsewhere.js +55 -0
- package/extensions/dm-subagents/src/runs/background/notify.js +98 -10
- package/extensions/dm-subagents/src/runs/background/result-delivery-ownership.js +20 -22
- package/extensions/dm-subagents/src/runs/background/result-files.js +9 -6
- package/extensions/dm-subagents/src/runs/background/result-watcher.js +32 -17
- package/extensions/dm-subagents/src/runs/background/resume-guidance.js +2 -1
- package/extensions/dm-subagents/src/runs/background/retained-children.js +1 -1
- package/extensions/dm-subagents/src/runs/background/run-child-session.js +40 -21
- package/extensions/dm-subagents/src/runs/background/run-status.js +12 -5
- package/extensions/dm-subagents/src/runs/background/runner-aliases.js +7 -5
- package/extensions/dm-subagents/src/runs/background/runner-child-launch.js +1 -2
- package/extensions/dm-subagents/src/runs/background/stale-run-reconciler.js +89 -21
- package/extensions/dm-subagents/src/runs/background/subagent-runner-bootstrap.js +2 -0
- package/extensions/dm-subagents/src/runs/background/subagent-runner.js +190 -244
- package/extensions/dm-subagents/src/runs/background/subagent-wait.js +5 -2
- package/extensions/dm-subagents/src/runs/background/terminal-run-index.js +39 -4
- package/extensions/dm-subagents/src/runs/background/wait-subscriptions.js +5 -1
- package/extensions/dm-subagents/src/runs/background/workflow-terminal-proof.js +28 -2
- package/extensions/dm-subagents/src/runs/foreground/async-dismiss-action.js +2 -1
- package/extensions/dm-subagents/src/runs/foreground/async-steering-action.js +21 -7
- package/extensions/dm-subagents/src/runs/foreground/async-stop-action.js +10 -8
- package/extensions/dm-subagents/src/runs/foreground/command-action.js +2 -1
- package/extensions/dm-subagents/src/runs/foreground/execution.js +107 -66
- package/extensions/dm-subagents/src/runs/foreground/foreground-history.js +111 -32
- package/extensions/dm-subagents/src/runs/foreground/prompt-audit.js +2 -2
- package/extensions/dm-subagents/src/runs/foreground/subagent-executor.js +377 -126
- package/extensions/dm-subagents/src/runs/shared/async-status-projection.js +18 -1
- package/extensions/dm-subagents/src/runs/shared/child-commands.js +7 -1
- package/extensions/dm-subagents/src/runs/shared/child-runtime-config.js +1 -0
- package/extensions/dm-subagents/src/runs/shared/child-session.js +184 -65
- package/extensions/dm-subagents/src/runs/shared/child-tool-plan.js +14 -3
- package/extensions/dm-subagents/src/runs/shared/dm-spawn.js +71 -25
- package/extensions/dm-subagents/src/runs/shared/external-cli-runner.js +2 -1
- package/extensions/dm-subagents/src/runs/shared/herdr-connection.js +20 -10
- package/extensions/dm-subagents/src/runs/shared/herdr-external-adapters.js +1 -1
- package/extensions/dm-subagents/src/runs/shared/herdr-machine.js +50 -8
- package/extensions/dm-subagents/src/runs/shared/herdr-pane-host.js +212 -0
- package/extensions/dm-subagents/src/runs/shared/herdr-placed-run.js +47 -503
- package/extensions/dm-subagents/src/runs/shared/local-machine-access.js +29 -0
- package/extensions/dm-subagents/src/runs/shared/long-running-guard.js +70 -17
- package/extensions/dm-subagents/src/runs/shared/model-resolution.js +7 -1
- package/extensions/dm-subagents/src/runs/shared/nested-events.js +2 -0
- package/extensions/dm-subagents/src/runs/shared/orca-progress-tabs.js +2 -24
- package/extensions/dm-subagents/src/runs/shared/parallel-handoff.js +9 -6
- package/extensions/dm-subagents/src/runs/shared/partial-output.js +5 -0
- package/extensions/dm-subagents/src/runs/shared/placed-run-owner.js +157 -0
- package/extensions/dm-subagents/src/runs/shared/placement-host.js +166 -0
- package/extensions/dm-subagents/src/runs/shared/rex-machine.js +75 -0
- package/extensions/dm-subagents/src/runs/shared/rex-pane-host.js +306 -0
- package/extensions/dm-subagents/src/runs/shared/run-ownership.js +7 -0
- package/extensions/dm-subagents/src/runs/shared/single-output.js +29 -6
- package/extensions/dm-subagents/src/runs/shared/structured-output.js +1 -0
- package/extensions/dm-subagents/src/runs/shared/subagent-control.js +2 -1
- package/extensions/dm-subagents/src/runs/shared/subagent-prompt-runtime.js +177 -17
- package/extensions/dm-subagents/src/runs/shared/tool-budget.js +1 -1
- package/extensions/dm-subagents/src/shared/accessible-dir.js +1 -1
- package/extensions/dm-subagents/src/shared/child-transcript.js +1 -1
- package/extensions/dm-subagents/src/shared/completion-owner.js +1 -0
- package/extensions/dm-subagents/src/shared/dm-declarations.js +36 -1
- package/extensions/dm-subagents/src/shared/dm-safeguards.js +1 -1
- package/extensions/dm-subagents/src/shared/dm-settlement.js +2 -0
- package/extensions/dm-subagents/src/shared/extension-context.js +3 -0
- package/extensions/dm-subagents/src/shared/file-lease.js +4 -1
- package/extensions/dm-subagents/src/shared/fork-context.js +21 -8
- package/extensions/dm-subagents/src/shared/parent-wake.js +6 -11
- package/extensions/dm-subagents/src/shared/provider-diagnostics.js +59 -0
- package/extensions/dm-subagents/src/shared/session-identity.js +24 -0
- package/extensions/dm-subagents/src/shared/session-succession.js +18 -0
- package/extensions/dm-subagents/src/shared/types.js +5 -4
- package/extensions/dm-subagents/src/shared/utils.js +13 -0
- package/extensions/dm-subagents/src/slash/delegation-adapters.js +8 -1
- package/extensions/dm-subagents/src/slash/prompt-template-bridge.js +2 -1
- package/extensions/dm-subagents/src/slash/slash-commands.js +6 -4
- package/extensions/dm-subagents/src/slash/subagents-admin.js +3 -2
- package/extensions/dm-subagents/src/tui/dm-mouse-region.js +9 -1
- package/extensions/dm-subagents/src/tui/fleet-layout.js +19 -0
- package/extensions/dm-subagents/src/tui/fleet-status.js +20 -3
- package/extensions/dm-subagents/src/tui/fleet-viewport.js +59 -0
- package/extensions/dm-subagents/src/tui/fleet.js +92 -69
- package/extensions/dm-subagents/src/tui/render.js +45 -19
- package/extensions/dm-subagents/src/tui/subagent-messages.js +1 -0
- package/extensions/dm-subagents/src/watchdog/change-signature.js +1 -3
- package/extensions/dm-subagents/src/watchdog/diff-tool.js +7 -3
- package/extensions/dm-subagents/src/watchdog/permission-arbiter.js +15 -6
- package/extensions/dm-subagents/src/watchdog/register-main.js +10 -9
- package/extensions/dm-subagents/src/watchdog/review.js +9 -1
- package/extensions/dm-subagents/src/watchdog/runtime.js +3 -5
- package/extensions/dm-subagents/src/workflows/scripted-workflow.js +33 -6
- package/extensions/dm-subagents/src/workflows/structured-workflow-scripts.js +21 -8
- package/extensions/dm-subagents/src/workflows/workflow-auto-resume.js +81 -0
- package/extensions/dm-subagents/src/workflows/workflow-child-summary.js +18 -2
- package/extensions/dm-subagents/src/workflows/workflow-launch-record.js +45 -0
- package/extensions/dm-subagents/src/workflows/workflow-resources.js +2 -2
- package/extensions/dm-subagents/src/workflows/workflow-resume-claim.js +171 -0
- package/extensions/dm-subagents/src/workflows/workflow-resume.js +88 -0
- package/extensions/dm-subagents/src/workflows/workflow-reuse.js +72 -3
- package/extensions/dm-subagents/src/workflows/workflow-revival.js +1 -1
- package/extensions/dm-subagents/src/workflows/workflow-stop-cause.js +5 -0
- package/extensions/dm-web-access/.github/workflows/test.yml +28 -0
- package/extensions/dm-web-access/anysearch.js +3 -3
- package/extensions/dm-web-access/bocha.js +3 -3
- package/extensions/dm-web-access/brave-rate-limit.js +2 -2
- package/extensions/dm-web-access/brave.js +5 -10
- package/extensions/dm-web-access/brightdata-unlocker.js +2 -2
- package/extensions/dm-web-access/brightdata.js +3 -3
- package/extensions/dm-web-access/ceramic.js +2 -2
- package/extensions/dm-web-access/chrome-cookies.js +1 -1
- package/extensions/dm-web-access/claim-judge.js +147 -0
- package/extensions/dm-web-access/content-find.js +1 -1
- package/extensions/dm-web-access/credential-source.js +42 -5
- package/extensions/dm-web-access/curator-page.js +8 -2
- package/extensions/dm-web-access/curator-server.js +6 -0
- package/extensions/dm-web-access/deepseek.js +331 -0
- package/extensions/dm-web-access/duckduckgo-rate-limit.js +75 -0
- package/extensions/dm-web-access/duckduckgo.js +49 -43
- package/extensions/dm-web-access/endpoint-pdf-extract.js +30 -77
- package/extensions/dm-web-access/eval/claim-judge.mjs +96 -0
- package/extensions/dm-web-access/eval/field-extract.mjs +84 -0
- package/extensions/dm-web-access/eval/fixtures/claims-calibration.json +1026 -0
- package/extensions/dm-web-access/eval/fixtures/claims-holdout.json +896 -0
- package/extensions/dm-web-access/eval/fixtures/claims-sibling-holdout.json +226 -0
- package/extensions/dm-web-access/eval/fixtures/extract-calibration.json +12 -0
- package/extensions/dm-web-access/eval/fixtures/extract-holdout.json +172 -0
- package/extensions/dm-web-access/eval/fixtures/offtopic-calibration.json +103 -0
- package/extensions/dm-web-access/eval/fixtures/offtopic-holdout.json +307 -0
- package/extensions/dm-web-access/eval/offtopic-judge.mjs +66 -0
- package/extensions/dm-web-access/evidence/CONTRACT-EVIDENCE.md +496 -0
- package/extensions/dm-web-access/evidence/contract-probe.mjs +127 -0
- package/extensions/dm-web-access/exa.js +42 -4
- package/extensions/dm-web-access/extract.js +110 -19
- package/extensions/dm-web-access/fetch-params.js +12 -3
- package/extensions/dm-web-access/field-extract.js +324 -0
- package/extensions/dm-web-access/gemini-adc.js +47 -1
- package/extensions/dm-web-access/gemini-api.js +11 -0
- package/extensions/dm-web-access/gemini-search.js +204 -196
- package/extensions/dm-web-access/github-extract.js +1 -1
- package/extensions/dm-web-access/github-issue-pr.js +6 -6
- package/extensions/dm-web-access/index.js +159 -112
- package/extensions/dm-web-access/jina-search.js +6 -4
- package/extensions/dm-web-access/kagi.js +4 -4
- package/extensions/dm-web-access/keenable.js +2 -2
- package/extensions/dm-web-access/linkup.js +160 -0
- package/extensions/dm-web-access/mistral-search.js +4 -4
- package/extensions/dm-web-access/ninerouter.js +100 -0
- package/extensions/dm-web-access/offtopic-judge.js +56 -0
- package/extensions/dm-web-access/ollama.js +4 -4
- package/extensions/dm-web-access/openai-search.js +32 -12
- package/extensions/dm-web-access/package.json +1 -1
- package/extensions/dm-web-access/page-query.js +7 -4
- package/extensions/dm-web-access/parallel.js +6 -7
- package/extensions/dm-web-access/pdf-extract.js +1 -3
- package/extensions/dm-web-access/perplexity.js +6 -5
- package/extensions/dm-web-access/querit.js +3 -3
- package/extensions/dm-web-access/query-rewrite.js +32 -8
- package/extensions/dm-web-access/scripts/dm-extensions-dist.js +16 -0
- package/extensions/dm-web-access/scripts/publish.js +38 -0
- package/extensions/dm-web-access/search1api.js +3 -3
- package/extensions/dm-web-access/searchinfinity.js +3 -3
- package/extensions/dm-web-access/searxng.js +2 -1
- package/extensions/dm-web-access/serpapi.js +6 -5
- package/extensions/dm-web-access/serpbase.js +4 -4
- package/extensions/dm-web-access/serpdive.js +3 -3
- package/extensions/dm-web-access/serper.js +5 -4
- package/extensions/dm-web-access/serply.js +2 -2
- package/extensions/dm-web-access/source-check.js +22 -14
- package/extensions/dm-web-access/ssrf-protection.js +29 -4
- package/extensions/dm-web-access/summary-model-scope.js +11 -1
- package/extensions/dm-web-access/summary-review.js +36 -43
- package/extensions/dm-web-access/tool-activation.js +11 -2
- package/extensions/dm-web-access/upgrade-notice.js +41 -0
- package/extensions/dm-web-access/utils.js +51 -3
- package/extensions/dm-web-access/valyu.js +3 -3
- package/extensions/dm-web-access/video-extract.js +3 -2
- package/extensions/dm-web-access/web-tool-core.js +161 -51
- package/extensions/dm-web-access/xai-search.js +44 -9
- package/extensions/dm-web-access/xcrawl.js +3 -3
- package/extensions/dm-web-access/you.js +2 -2
- package/package.json +4 -4
- package/extensions/dm-web-access/dist/index.js +0 -28396
- package/extensions/dm-web-access/dist/mcp-cli.js +0 -28185
- /package/extensions/dm-lens/skills/{pi-lens-lsp-navigation → dm-lens-lsp-navigation}/SKILL.md +0 -0
- /package/extensions/dm-lens/skills/{pi-lens-write-ast-grep-rule → dm-lens-write-ast-grep-rule}/SKILL.md +0 -0
- /package/extensions/dm-lens/skills/{pi-lens-write-ast-grep-rule → dm-lens-write-ast-grep-rule}/reference.md +0 -0
- /package/extensions/dm-lens/skills/{pi-lens-write-tree-sitter-rule → dm-lens-write-tree-sitter-rule}/SKILL.md +0 -0
|
@@ -10,14 +10,14 @@ import { childCacheRetentionEnv } from "../../shared/child-cache-retention.js";
|
|
|
10
10
|
import { buildEffectiveSystemPrompt } from "../shared/effective-system-prompt.js";
|
|
11
11
|
import { currentCompletionOwnerId } from "../../shared/completion-owner.js";
|
|
12
12
|
import { planChildLaunch, projectChainOutputSchemas, resolveStepBehavior, suppressProgressForReadOnlyTask } from "../shared/child-launch-plan.js";
|
|
13
|
-
import { formatHerdrMachineRunnerUnsupported,
|
|
13
|
+
import { formatHerdrMachineRunnerUnsupported, resolveMachinePlacement } from "../shared/herdr-machine.js";
|
|
14
14
|
import { applyThinkingSuffix, projectLaunchResolvedChildExtensions, resolvePiLaunchToolPlan } from "../shared/child-tool-plan.js";
|
|
15
15
|
import { assertClaudeCodeModelScope, isClaudeCodeAdapterId, resolveClaudeCodeOverride } from "../shared/claude-code-adapter.js";
|
|
16
16
|
import { injectSingleOutputInstruction, normalizeSingleOutputOverride, resolveSingleOutputPath, validateFileOnlyOutputMode } from "../shared/single-output.js";
|
|
17
17
|
import { applyWatchdogLaunchRules, sendRuleViolationWarning } from "../../watchdog/rules.js";
|
|
18
18
|
import { buildChainInstructions, getStepAgents, isDynamicParallelStep, isParallelStep, resolveExistingReadInstructionPaths, resolveExistingReadPaths, writeInitialProgressFile } from "../../shared/settings.js";
|
|
19
19
|
import { isDynamicRunnerGroup, isParallelGroup } from "../shared/parallel-utils.js";
|
|
20
|
-
import { DM_CODING_AGENT_PACKAGE, resolveBunPiExecutable,
|
|
20
|
+
import { DM_CODING_AGENT_PACKAGE, resolveBunPiExecutable, resolveHostPiPackageRoot } from "../shared/dm-spawn.js";
|
|
21
21
|
import { JITI_ALIAS_ENV, resolveHostPeerAliases } from "./runner-aliases.js";
|
|
22
22
|
import { preflightLaunchCwd } from "../shared/launch-cwd.js";
|
|
23
23
|
import { resolveNodeExecutable } from "../../shared/node-executable.js";
|
|
@@ -55,8 +55,9 @@ import { usageBudgetState } from "../shared/usage-budget.js";
|
|
|
55
55
|
import { finalizeProcessTerminal, initializeProcessTerminal, readProcessTerminal } from "./process-terminal.js";
|
|
56
56
|
import { persistRunnerStartupFailure } from "./runner-startup-failure.js";
|
|
57
57
|
import { statusStepDescription } from "./chain-append.js";
|
|
58
|
+
import { currentBootId, currentRecordedPid } from "./boot-id.js";
|
|
58
59
|
import { currentPidNamespaceScope } from "./pid-namespace.js";
|
|
59
|
-
import {
|
|
60
|
+
import { checkRecordedPidLiveness } from "./stale-run-reconciler.js";
|
|
60
61
|
import { lookupRunnerLauncher, resolveAgentRunnerLauncher, runnerLauncherPlacementError } from "../shared/runner-launcher.js";
|
|
61
62
|
import { SUBAGENT_PROCESS_TERMINAL_EVENT } from "../../shared/types.js";
|
|
62
63
|
import { assertAgentAllowedByCapabilityCeiling, intersectSubagentCapabilityCeilings, resolveCurrentSubagentCapabilityCeiling } from "../shared/capability-ceiling.js";
|
|
@@ -67,10 +68,14 @@ import { omitGitRoutingEnv } from "../shared/git-environment.js";
|
|
|
67
68
|
import { assertWorkflowLaneKey, normalizeWorkflowLaneMetadata } from "../shared/lane-metadata.js";
|
|
68
69
|
import { assertRequiredChildExtensionsAdmitted, resolveRequiredChildExtensions, writeRetainedRequiredChildExtensions } from "../../shared/required-child-extensions.js";
|
|
69
70
|
const require = nodeModule.createRequire(import.meta.url);
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
71
|
+
const piPackageSelection = (() => {
|
|
72
|
+
try {
|
|
73
|
+
return { root: resolveHostPiPackageRoot() };
|
|
74
|
+
} catch (error) {
|
|
75
|
+
return { error };
|
|
76
|
+
}
|
|
77
|
+
})();
|
|
78
|
+
const piPackageRoot = piPackageSelection.root;
|
|
74
79
|
function resolveJitiCliFromPackageJson(packageJsonPath) {
|
|
75
80
|
if (!fs.existsSync(packageJsonPath))
|
|
76
81
|
return;
|
|
@@ -359,6 +364,8 @@ function spawnRunner(cfg, suffix, cwd, initialStatus, initialStatusPath, launchP
|
|
|
359
364
|
if (inconsistentParent)
|
|
360
365
|
return { error: "Background runner steps have inconsistent parent session identities." };
|
|
361
366
|
const binaryHost = resolveBunPiExecutable();
|
|
367
|
+
if (!binaryHost && "error" in piPackageSelection)
|
|
368
|
+
throw piPackageSelection.error;
|
|
362
369
|
const nodeExecutable = resolveNodeExecutable();
|
|
363
370
|
const nativeRunnerSupported = supportsNativeRunner(nodeExecutable);
|
|
364
371
|
const runner = asyncRunnerSourcePath();
|
|
@@ -381,7 +388,9 @@ function spawnRunner(cfg, suffix, cwd, initialStatus, initialStatusPath, launchP
|
|
|
381
388
|
const runnerProcessInstanceId = randomUUID();
|
|
382
389
|
const hasRevivalLease = typeof cfg.revivalLease === "object";
|
|
383
390
|
const launchBarrierToken = hasRevivalLease ? undefined : runnerProcessInstanceId;
|
|
384
|
-
const
|
|
391
|
+
const launcher = cfg.launcher;
|
|
392
|
+
const bootId = launcher ? undefined : currentBootId();
|
|
393
|
+
const launchConfig = { ...cfg, runnerProcessInstanceId, ...launchBarrierToken ? { launchBarrierToken } : {}, ...bootId ? { bootId } : {} };
|
|
385
394
|
writePrivateAtomicJson(cfgPath, launchConfig);
|
|
386
395
|
const command = binaryHost ?? nodeExecutable;
|
|
387
396
|
const launchForStartup = launchConfig;
|
|
@@ -401,7 +410,6 @@ function spawnRunner(cfg, suffix, cwd, initialStatus, initialStatusPath, launchP
|
|
|
401
410
|
fs.rmSync(startupConfirmPath, { force: true });
|
|
402
411
|
if (startupProceedPath)
|
|
403
412
|
fs.rmSync(startupProceedPath, { force: true });
|
|
404
|
-
const launcher = launchConfig.launcher;
|
|
405
413
|
const identityPath = launcher && launchBarrierToken && launchAsyncDir ? path.join(launchAsyncDir, "runner-startup.json") : undefined;
|
|
406
414
|
if (identityPath)
|
|
407
415
|
fs.rmSync(identityPath, { force: true });
|
|
@@ -476,7 +484,7 @@ function spawnRunner(cfg, suffix, cwd, initialStatus, initialStatusPath, launchP
|
|
|
476
484
|
try {
|
|
477
485
|
writePrivateAtomicJson(path.join(asyncDir, "launcher-close.json"), { version: 1, runId, runnerProcessInstanceId, closeObservedAt: Date.now(), exitCode, signal, ...runnerIdentity ? { runnerPid: runnerIdentity.pid } : {} });
|
|
478
486
|
} catch {}
|
|
479
|
-
if (!runnerIdentity || runnerIdentity.pidNamespaceScope !== currentPidNamespaceScope() ||
|
|
487
|
+
if (!runnerIdentity || runnerIdentity.pidNamespaceScope !== currentPidNamespaceScope() || checkRecordedPidLiveness(runnerIdentity) !== "dead")
|
|
480
488
|
return;
|
|
481
489
|
}
|
|
482
490
|
finalizeProcessTerminal(asyncDir, runId, {
|
|
@@ -536,7 +544,7 @@ function spawnRunner(cfg, suffix, cwd, initialStatus, initialStatusPath, launchP
|
|
|
536
544
|
try {
|
|
537
545
|
writePrivateAtomicJson(initialStatusPath, {
|
|
538
546
|
...initialStatus,
|
|
539
|
-
...launcher ? {} : { pid: proc.pid, pidNamespaceScope: currentPidNamespaceScope() },
|
|
547
|
+
...launcher ? {} : { pid: proc.pid, pidNamespaceScope: currentPidNamespaceScope(), ...bootId ? { bootId } : {} },
|
|
540
548
|
processTerminal: { version: 1, state: "pending", runId: initialStatus.runId, runnerProcessInstanceId }
|
|
541
549
|
});
|
|
542
550
|
updateActiveRunIndex(path.dirname(initialStatusPath), initialStatus.state, initialStatus.toolCallId);
|
|
@@ -740,7 +748,7 @@ export function buildAsyncRunnerSteps(id, params) {
|
|
|
740
748
|
let machineEnv;
|
|
741
749
|
if (requestedMachine) {
|
|
742
750
|
try {
|
|
743
|
-
const placement =
|
|
751
|
+
const placement = resolveMachinePlacement({ machine: requestedMachine, cwd: runnerCwd, stepCwd: s.cwd ?? params.machineCwd });
|
|
744
752
|
machine = placement.machine;
|
|
745
753
|
machineEnv = placement.env;
|
|
746
754
|
} catch (error) {
|
|
@@ -1138,7 +1146,8 @@ export function executeAsyncChain(id, params) {
|
|
|
1138
1146
|
const undefinedLauncher = chain.flatMap(getStepAgents).map((name) => agents.find((agent) => agent.name === name)?.launcher).find((name) => name !== undefined && !lookupRunnerLauncher(ctx.runnerLaunchers, name));
|
|
1139
1147
|
if (undefinedLauncher !== undefined)
|
|
1140
1148
|
return formatAsyncStartError(resultMode, `Launcher '${undefinedLauncher}' used by this ${resultMode} is not defined in runnerLaunchers in the user subagent config.`);
|
|
1141
|
-
const
|
|
1149
|
+
const launchParentSessionId = ctx.parentSessionId ?? ctx.currentSessionId;
|
|
1150
|
+
const capabilityCeiling = params.capabilityCeiling ?? resolveCurrentSubagentCapabilityCeiling(launchParentSessionId);
|
|
1142
1151
|
const inheritedNestedRoute = inheritedNestedRouteOf(ctx.childRuntime);
|
|
1143
1152
|
const nestedAddress = inheritedNestedRoute ? inheritedNestedParentAddressOf(ctx.childRuntime) : undefined;
|
|
1144
1153
|
const asyncDir = inheritedNestedRoute ? path.join(TEMP_ROOT_DIR, "nested-subagent-runs", inheritedNestedRoute.rootRunId, id) : path.join(DIRS.async, id);
|
|
@@ -1230,7 +1239,7 @@ export function executeAsyncChain(id, params) {
|
|
|
1230
1239
|
}
|
|
1231
1240
|
const initialStatusAt = Date.now();
|
|
1232
1241
|
const initialCompletionOwnerId = ctx.completionOwnerId ?? currentCompletionOwnerId();
|
|
1233
|
-
const
|
|
1242
|
+
const completionOwnerProcess = currentRecordedPid();
|
|
1234
1243
|
try {
|
|
1235
1244
|
writeRetainedRequiredChildExtensions(asyncDir, params.requiredExtensions ?? ctx.childRuntime?.requiredExtensions ?? resolveRequiredChildExtensions(launchParentSessionId ?? undefined));
|
|
1236
1245
|
} catch (error) {
|
|
@@ -1253,6 +1262,7 @@ export function executeAsyncChain(id, params) {
|
|
|
1253
1262
|
asyncDir,
|
|
1254
1263
|
sessionId: ctx.currentSessionId,
|
|
1255
1264
|
completionOwnerId: ctx.completionOwnerId ?? currentCompletionOwnerId(),
|
|
1265
|
+
completionOwnerProcess,
|
|
1256
1266
|
...capabilityCeiling ? { capabilityCeiling } : {},
|
|
1257
1267
|
piPackageRoot,
|
|
1258
1268
|
childSessionFactoryModule: childSessionFactoryModule(),
|
|
@@ -1291,6 +1301,7 @@ export function executeAsyncChain(id, params) {
|
|
|
1291
1301
|
runId: id,
|
|
1292
1302
|
...ctx.currentSessionId ? { sessionId: ctx.currentSessionId } : {},
|
|
1293
1303
|
...initialCompletionOwnerId ? { completionOwnerId: initialCompletionOwnerId } : {},
|
|
1304
|
+
completionOwnerProcess,
|
|
1294
1305
|
mode: resultMode,
|
|
1295
1306
|
state: "running",
|
|
1296
1307
|
startedAt: initialStatusAt,
|
|
@@ -1490,7 +1501,7 @@ export function executeAsyncSingle(id, params) {
|
|
|
1490
1501
|
if (unsupported.length > 0)
|
|
1491
1502
|
return formatAsyncStartError("single", `Agent '${agentConfig.name}' uses runner.type='${externalRunnerType}' and does not support: ${unsupported.join(", ")}.`);
|
|
1492
1503
|
}
|
|
1493
|
-
const capabilityCeiling = intersectSubagentCapabilityCeilings(params.capabilityCeiling ?? resolveCurrentSubagentCapabilityCeiling(ctx.currentSessionId), ctx.childRuntime?.capabilityCeiling);
|
|
1504
|
+
const capabilityCeiling = intersectSubagentCapabilityCeilings(params.capabilityCeiling ?? resolveCurrentSubagentCapabilityCeiling(ctx.parentSessionId ?? ctx.currentSessionId), ctx.childRuntime?.capabilityCeiling);
|
|
1494
1505
|
try {
|
|
1495
1506
|
assertAgentAllowedByCapabilityCeiling(agentConfig.name, capabilityCeiling);
|
|
1496
1507
|
} catch (error) {
|
|
@@ -1515,7 +1526,7 @@ export function executeAsyncSingle(id, params) {
|
|
|
1515
1526
|
let machineEnv;
|
|
1516
1527
|
if (requestedMachine) {
|
|
1517
1528
|
try {
|
|
1518
|
-
const placement =
|
|
1529
|
+
const placement = resolveMachinePlacement({ machine: requestedMachine, cwd: runnerCwd, stepCwd: params.machineCwd });
|
|
1519
1530
|
machine = placement.machine;
|
|
1520
1531
|
machineEnv = placement.env;
|
|
1521
1532
|
} catch (error) {
|
|
@@ -1760,6 +1771,7 @@ export function executeAsyncSingle(id, params) {
|
|
|
1760
1771
|
let spawnResultOrPromise = {};
|
|
1761
1772
|
const initialStatusAt = Date.now();
|
|
1762
1773
|
const initialCompletionOwnerId = ctx.completionOwnerId ?? currentCompletionOwnerId();
|
|
1774
|
+
const completionOwnerProcess = currentRecordedPid();
|
|
1763
1775
|
const launchParentSessionId = ctx.parentSessionId ?? ctx.currentSessionId;
|
|
1764
1776
|
try {
|
|
1765
1777
|
spawnResultOrPromise = spawnRunner({
|
|
@@ -1840,6 +1852,7 @@ export function executeAsyncSingle(id, params) {
|
|
|
1840
1852
|
asyncDir,
|
|
1841
1853
|
sessionId: ctx.currentSessionId,
|
|
1842
1854
|
completionOwnerId: ctx.completionOwnerId ?? currentCompletionOwnerId(),
|
|
1855
|
+
completionOwnerProcess,
|
|
1843
1856
|
...capabilityCeiling ? { capabilityCeiling } : {},
|
|
1844
1857
|
piPackageRoot,
|
|
1845
1858
|
childSessionFactoryModule: childSessionFactoryModule(),
|
|
@@ -1881,6 +1894,7 @@ export function executeAsyncSingle(id, params) {
|
|
|
1881
1894
|
runId: id,
|
|
1882
1895
|
...ctx.currentSessionId ? { sessionId: ctx.currentSessionId } : {},
|
|
1883
1896
|
...initialCompletionOwnerId ? { completionOwnerId: initialCompletionOwnerId } : {},
|
|
1897
|
+
completionOwnerProcess,
|
|
1884
1898
|
mode: "single",
|
|
1885
1899
|
...params.toolCallId ? { toolCallId: params.toolCallId } : {},
|
|
1886
1900
|
state: "running",
|
|
@@ -18,9 +18,11 @@ import { listAsyncRuns } from "./async-status.js";
|
|
|
18
18
|
import { EXTERNAL_JOB_BRIDGE_REQUEST_DIR, externalJobBridgeEligibility, serviceExternalJobBridgeRequests } from "../shared/external-job-bridge.js";
|
|
19
19
|
import { shouldUseNativeFsWatch } from "../../shared/watch-strategy.js";
|
|
20
20
|
import { parseWorkflowChildSummary } from "../../workflows/workflow-child-summary.js";
|
|
21
|
+
import { withWorkflowChildRunModel } from "./workflow-terminal-proof.js";
|
|
21
22
|
import { validHostStepNodes } from "../shared/host-step-status.js";
|
|
22
23
|
import { readProcessTerminal } from "./process-terminal.js";
|
|
23
24
|
import { withCachedUiContext } from "../../shared/extension-context.js";
|
|
25
|
+
import { OWNING_SESSION_COMPLETION_OWNER } from "../../shared/completion-owner.js";
|
|
24
26
|
const CONTROL_EVENT_READ_CHUNK_BYTES = 64 * 1024;
|
|
25
27
|
const MAX_CONTROL_EVENT_LINE_BYTES = 1024 * 1024;
|
|
26
28
|
const CONTROL_EVENT_SCAN_WINDOW_BYTES = 2 * 1024 * 1024;
|
|
@@ -492,6 +494,8 @@ export function createAsyncJobTracker(dm, state, asyncDirRoot, options = {}) {
|
|
|
492
494
|
job.workflowGraph = status.workflowGraph ?? job.workflowGraph;
|
|
493
495
|
job.hostSteps = validHostStepNodes(status.workflowGraph);
|
|
494
496
|
const workflowChildren = parseWorkflowChildSummary(status.workflowChildren);
|
|
497
|
+
if (workflowChildren && status.mode === "workflow")
|
|
498
|
+
workflowChildren.children = workflowChildren.children.map((child) => withWorkflowChildRunModel(job.asyncDir, child));
|
|
495
499
|
if (workflowChildren && workflowChildren.workflowRunId !== status.runId)
|
|
496
500
|
throw new Error("workflowChildren.workflowRunId does not match async status runId.");
|
|
497
501
|
job.workflowChildren = workflowChildren ?? job.workflowChildren;
|
|
@@ -507,6 +511,11 @@ export function createAsyncJobTracker(dm, state, asyncDirRoot, options = {}) {
|
|
|
507
511
|
const activeGroup = status.currentStep !== undefined ? groups.find((group) => status.currentStep >= group.start && status.currentStep < group.start + group.count) : undefined;
|
|
508
512
|
const visibleSteps = activeGroup ? status.steps.slice(activeGroup.start, activeGroup.start + activeGroup.count).map((step, index) => ({ ...step, index: activeGroup.start + index })) : status.steps.map((step, index) => ({ ...step, index }));
|
|
509
513
|
job.activeParallelGroup = Boolean(activeGroup);
|
|
514
|
+
if (status.mode === "workflow") {
|
|
515
|
+
for (const step of visibleSteps)
|
|
516
|
+
if (step.async === true)
|
|
517
|
+
Object.assign(step, withWorkflowChildRunModel(job.asyncDir, step));
|
|
518
|
+
}
|
|
510
519
|
job.agents = visibleSteps.map((step) => step.agent);
|
|
511
520
|
job.steps = visibleSteps;
|
|
512
521
|
refreshNestedProjection();
|
|
@@ -529,7 +538,7 @@ export function createAsyncJobTracker(dm, state, asyncDirRoot, options = {}) {
|
|
|
529
538
|
job.sessionFile = status.sessionFile ?? job.sessionFile;
|
|
530
539
|
if (isTerminalJobStatus(job.status)) {
|
|
531
540
|
let publication = terminalPublications.get(job.asyncId);
|
|
532
|
-
if (!publication && status.mode !== "workflow" && status.processTerminal?.state === "pending" && status.runId === job.asyncId && status.sessionId === state.currentSessionId && status.completionOwnerId && status.completionOwnerId
|
|
541
|
+
if (!publication && status.mode !== "workflow" && status.processTerminal?.state === "pending" && status.runId === job.asyncId && status.completionOwnerId && (status.sessionId === state.currentSessionId && status.completionOwnerId === state.completionOwnerId || typeof status.sessionId === "string" && options.deliveryOwnerId?.(status.sessionId, status.completionOwnerId, status.completionOwnerProcess, status.parentWorkflowRunId) === OWNING_SESSION_COMPLETION_OWNER)) {
|
|
533
542
|
publication = { instanceId: status.processTerminal.runnerProcessInstanceId, pending: true };
|
|
534
543
|
terminalPublications.set(job.asyncId, publication);
|
|
535
544
|
}
|
|
@@ -836,7 +845,7 @@ export function createAsyncJobTracker(dm, state, asyncDirRoot, options = {}) {
|
|
|
836
845
|
rerenderWidget(ctx, []);
|
|
837
846
|
}
|
|
838
847
|
};
|
|
839
|
-
const restoreActiveJobs = (ctx) => {
|
|
848
|
+
const restoreActiveJobs = (ctx, observeStatus) => {
|
|
840
849
|
if (ctx?.hasUI)
|
|
841
850
|
state.lastUiContext = ctx;
|
|
842
851
|
state.statusProjectionSessionId = null;
|
|
@@ -844,7 +853,7 @@ export function createAsyncJobTracker(dm, state, asyncDirRoot, options = {}) {
|
|
|
844
853
|
return;
|
|
845
854
|
let runs;
|
|
846
855
|
try {
|
|
847
|
-
runs = listAsyncRuns(asyncDirRoot, { states: ["queued", "running"], sessionId: state.currentSessionId, resultsDir, kill: options.kill, now: options.now });
|
|
856
|
+
runs = listAsyncRuns(asyncDirRoot, { states: ["queued", "running"], sessionId: state.currentSessionId, resultsDir, kill: options.kill, now: options.now, adoptCompletionOwnerId: state.completionOwnerId }, observeStatus);
|
|
848
857
|
} catch (error) {
|
|
849
858
|
console.error(`Failed to restore active async jobs from '${asyncDirRoot}':`, error);
|
|
850
859
|
return;
|
|
@@ -8,6 +8,7 @@ import { validateAcceptanceInput } from "../shared/acceptance.js";
|
|
|
8
8
|
import { validateToolBudgetConfig } from "../shared/tool-budget.js";
|
|
9
9
|
import { intersectSubagentCapabilityCeilings, normalizeCapabilityCeilingAllowedAgents, parseSubagentCapabilityCeiling } from "../shared/capability-ceiling.js";
|
|
10
10
|
import { validateRunFanoutBudgetDescriptor } from "../shared/run-fanout-budget.js";
|
|
11
|
+
import { ownsRun } from "../shared/run-ownership.js";
|
|
11
12
|
import { reconcileAsyncRun } from "./stale-run-reconciler.js";
|
|
12
13
|
import { resultFilePath, resultPayloadPathForIndexedRun } from "./result-files.js";
|
|
13
14
|
import { canScanAsyncRunPrefix, MIN_SAFE_ASYNC_RUN_PREFIX_LENGTH } from "./run-id-query.js";
|
|
@@ -519,7 +520,8 @@ export function resolveAsyncResumeTarget(params, deps = {}, options = {}) {
|
|
|
519
520
|
const requireSessionFile = options.requireSessionFile ?? true;
|
|
520
521
|
const location = resolveAsyncRunLocation(params, asyncDirRoot, resultsDir);
|
|
521
522
|
if (!location.asyncDir && !location.resultPath) {
|
|
522
|
-
|
|
523
|
+
const requested = params.id ?? params.runId;
|
|
524
|
+
throw new Error(requested ? `Async run not found for '${requested}'.` : "Async run not found. Provide id or dir.");
|
|
523
525
|
}
|
|
524
526
|
const reconciliation = location.asyncDir ? reconcileAsyncRun(location.asyncDir, { resultsDir, kill: deps.kill, now: deps.now }) : undefined;
|
|
525
527
|
const status = reconciliation?.status ?? null;
|
|
@@ -528,7 +530,7 @@ export function resolveAsyncResumeTarget(params, deps = {}, options = {}) {
|
|
|
528
530
|
const result = location.resultPath ? readResultFile(location.resultPath) : undefined;
|
|
529
531
|
const runId = status?.runId ?? result?.runId ?? result?.id ?? location.resolvedId ?? (location.asyncDir ? path.basename(location.asyncDir) : "unknown");
|
|
530
532
|
const mode = resumeTargetMode(status, result);
|
|
531
|
-
if (options.sessionId && (status &&
|
|
533
|
+
if (options.sessionId && (status && !ownsRun(options.sessionId, status.sessionId) || result && !ownsRun(options.sessionId, result.sessionId))) {
|
|
532
534
|
throw new Error(`Async run '${runId}' was not found in the active session.`);
|
|
533
535
|
}
|
|
534
536
|
if (recoveryDescriptor && recoveryDescriptor.sourceRunId !== runId)
|
|
@@ -631,7 +633,7 @@ export function resolveAsyncResumeTarget(params, deps = {}, options = {}) {
|
|
|
631
633
|
const stepThinking = statusSteps[index]?.thinking ?? resultSteps[index]?.thinking ?? (stepCount === 1 ? result?.thinking : undefined);
|
|
632
634
|
const thinkingCeiling = statusSteps[index]?.thinkingCeiling ?? (stepCount === 1 ? recoveryDescriptor?.thinkingCeiling : undefined);
|
|
633
635
|
const capabilityCeiling = mode === "workflow" ? intersectSubagentCapabilityCeilings(status?.admissionCapabilityCeiling, result?.admissionCapabilityCeiling) : intersectSubagentCapabilityCeilings(status?.capabilityCeiling, statusSteps[index]?.capabilityCeiling, result?.capabilityCeiling, resultSteps[index]?.capabilityCeiling);
|
|
634
|
-
const managedWorktreeCwd = location.asyncDir ? resolveRetainedWorktreeCwd(parallelHandoffPath(location.asyncDir), runId, index) : undefined;
|
|
636
|
+
const managedWorktreeCwd = location.asyncDir ? resolveRetainedWorktreeCwd(parallelHandoffPath(location.asyncDir), runId, index, statusSteps[index]?.worktreePath) : undefined;
|
|
635
637
|
const resumeCwd = validateResumeCwd(runId, managedWorktreeCwd ?? status?.cwd ?? result?.cwd ?? recoveryDescriptor?.cwd);
|
|
636
638
|
return {
|
|
637
639
|
kind: "revive",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ownerSessionIds } from "../shared/run-ownership.js";
|
|
1
2
|
import {
|
|
2
3
|
projectAsyncStatusSnapshot as buildAsyncStatusSnapshot
|
|
3
4
|
} from "../shared/async-status-projection.js";
|
|
@@ -11,13 +12,14 @@ export { buildAsyncStatusSnapshot };
|
|
|
11
12
|
export function asyncStatusSnapshotJobsForState(state, sessionId) {
|
|
12
13
|
if (!state || !sessionId || state.currentSessionId !== sessionId)
|
|
13
14
|
return [];
|
|
15
|
+
const owners = ownerSessionIds(sessionId);
|
|
14
16
|
const jobs = new Map;
|
|
15
17
|
for (const job of state.asyncJobs.values()) {
|
|
16
|
-
if (job.sessionId
|
|
18
|
+
if (owners.has(job.sessionId))
|
|
17
19
|
jobs.set(job.asyncId, job);
|
|
18
20
|
}
|
|
19
21
|
for (const job of state.fleetJobs?.values() ?? []) {
|
|
20
|
-
if (job.sessionId
|
|
22
|
+
if (owners.has(job.sessionId) && !jobs.has(job.asyncId))
|
|
21
23
|
jobs.set(job.asyncId, job);
|
|
22
24
|
}
|
|
23
25
|
return [...jobs.values()];
|
|
@@ -16,6 +16,7 @@ import { readRecentTerminalRunIndex, TERMINAL_RUN_INDEX_DIR } from "./terminal-r
|
|
|
16
16
|
import { canScanAsyncRunPrefix } from "./run-id-query.js";
|
|
17
17
|
import { asyncStatusChildIdentity } from "../shared/child-identity.js";
|
|
18
18
|
import { parseWorkflowChildSummary } from "../../workflows/workflow-child-summary.js";
|
|
19
|
+
import { withWorkflowChildRunModel } from "./workflow-terminal-proof.js";
|
|
19
20
|
import { assertWorkflowGraphHostSteps, hostStepReportName, hostStepVerdictLabel, validHostStepNodes } from "../shared/host-step-status.js";
|
|
20
21
|
import { projectAsyncWorkflowRows } from "../shared/async-status-projection.js";
|
|
21
22
|
import { validateAsyncStatusLaneMetadata } from "../shared/lane-metadata.js";
|
|
@@ -24,6 +25,7 @@ import { workflowGraphStageNodes } from "../shared/workflow-graph.js";
|
|
|
24
25
|
import { formatTimeoutRecoveryLines, projectTimeoutRecovery } from "../shared/mutation-evidence.js";
|
|
25
26
|
import { formatWorkflowChecklistText, projectWorkflowChecklist } from "../../workflows/workflow-checklist.js";
|
|
26
27
|
import { childWatchdogProgressForModel } from "../../watchdog/child-status.js";
|
|
28
|
+
import { ownerSessionIds } from "../shared/run-ownership.js";
|
|
27
29
|
function getErrorMessage(error) {
|
|
28
30
|
return error instanceof Error ? error.message : String(error);
|
|
29
31
|
}
|
|
@@ -32,6 +34,7 @@ function isAsyncStatusIsolationError(asyncDir, error) {
|
|
|
32
34
|
const message = getErrorMessage(error);
|
|
33
35
|
return /^(?:Failed to (?:inspect|read|parse|validate) async status file|Invalid async status file) '/.test(message) || message.startsWith(`Invalid async status '${statusPath}'`) || message.startsWith(`Invalid host step '${statusPath}`) || /^(workflowChildren|Invalid workflowChildren)/.test(message);
|
|
34
36
|
}
|
|
37
|
+
const reportedCorruptStatus = new Map;
|
|
35
38
|
function isolateCorruptActiveRun(asyncDir, runId, error, now) {
|
|
36
39
|
const statusPath = path.join(asyncDir, "status.json");
|
|
37
40
|
const processTerminal = readProcessTerminal(asyncDir, { runId });
|
|
@@ -51,7 +54,18 @@ function isolateCorruptActiveRun(asyncDir, runId, error, now) {
|
|
|
51
54
|
markerAction = `failed to release active marker: ${getErrorMessage(releaseError)}`;
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
|
-
|
|
57
|
+
const line = `[dm-subagents] Skipping corrupt active async run '${runId}' at '${statusPath}': ${getErrorMessage(error)}; ${markerAction}.`;
|
|
58
|
+
let fileSignature = "";
|
|
59
|
+
try {
|
|
60
|
+
const stat = fs.statSync(statusPath);
|
|
61
|
+
fileSignature = `${stat.size}:${stat.mtimeMs}`;
|
|
62
|
+
} catch {}
|
|
63
|
+
const signature = `${fileSignature}
|
|
64
|
+
${line}`;
|
|
65
|
+
if (reportedCorruptStatus.get(statusPath) === signature)
|
|
66
|
+
return;
|
|
67
|
+
reportedCorruptStatus.set(statusPath, signature);
|
|
68
|
+
console.error(line);
|
|
55
69
|
}
|
|
56
70
|
function isNotFoundError(error) {
|
|
57
71
|
return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
|
|
@@ -98,7 +112,7 @@ export function resolveTargetedAsyncRun(asyncDirRoot, id, sessionId) {
|
|
|
98
112
|
}
|
|
99
113
|
if (sessionId !== undefined) {
|
|
100
114
|
const status = readStatus(asyncDir);
|
|
101
|
-
if (status?.sessionId
|
|
115
|
+
if (!ownerSessionIds(sessionId).has(status?.sessionId))
|
|
102
116
|
return canScanAsyncRunPrefix(id) ? { kind: "prefix" } : { kind: "reject" };
|
|
103
117
|
}
|
|
104
118
|
return { kind: "exact", id };
|
|
@@ -130,6 +144,8 @@ function statusToSummary(asyncDir, status, nestedWarnings = [], nestedRoute) {
|
|
|
130
144
|
const statusPath = path.join(asyncDir, "status.json");
|
|
131
145
|
validateAsyncStatusLaneMetadata(status, `Invalid async status '${statusPath}'`);
|
|
132
146
|
const workflowChildren = parseWorkflowChildSummary(status.workflowChildren);
|
|
147
|
+
if (workflowChildren && status.mode === "workflow")
|
|
148
|
+
workflowChildren.children = workflowChildren.children.map((child) => withWorkflowChildRunModel(asyncDir, child));
|
|
133
149
|
if (workflowChildren && workflowChildren.workflowRunId !== status.runId)
|
|
134
150
|
throw new Error(`Invalid async status '${statusPath}': workflowChildren.workflowRunId does not match.`);
|
|
135
151
|
assertWorkflowGraphHostSteps(status.workflowGraph, statusPath, status.runId);
|
|
@@ -165,6 +181,7 @@ function statusToSummary(asyncDir, status, nestedWarnings = [], nestedRoute) {
|
|
|
165
181
|
const stepActivityState = step.activityState;
|
|
166
182
|
const stepLastActivityAt = step.lastActivityAt;
|
|
167
183
|
const timeoutRecovery = projectTimeoutRecovery(step.timeoutRecovery);
|
|
184
|
+
const { model: stepModel, thinking: stepThinking } = status.mode === "workflow" && step.async === true ? withWorkflowChildRunModel(asyncDir, step) : step;
|
|
168
185
|
return {
|
|
169
186
|
index,
|
|
170
187
|
childId: asyncStatusChildIdentity(step, index),
|
|
@@ -201,9 +218,9 @@ function statusToSummary(asyncDir, status, nestedWarnings = [], nestedRoute) {
|
|
|
201
218
|
...step.tokens ? { tokens: step.tokens } : {},
|
|
202
219
|
...step.totalCost ? { totalCost: step.totalCost } : {},
|
|
203
220
|
...step.skills ? { skills: step.skills } : {},
|
|
204
|
-
...
|
|
221
|
+
...stepModel ? { model: stepModel } : {},
|
|
205
222
|
...step.contextLimit !== undefined ? { contextLimit: step.contextLimit } : {},
|
|
206
|
-
...
|
|
223
|
+
...stepThinking ? { thinking: stepThinking } : {},
|
|
207
224
|
...step.thinkingCeiling ? { thinkingCeiling: step.thinkingCeiling } : {},
|
|
208
225
|
...step.requestedModel ? { requestedModel: step.requestedModel } : {},
|
|
209
226
|
...step.sessionFile ? { sessionFile: step.sessionFile } : {},
|
|
@@ -332,6 +349,7 @@ export function listAsyncRuns(asyncDirRoot, options = {}, observeStatus) {
|
|
|
332
349
|
const wantsActive = options.states === undefined || options.states.some(isActiveAsyncState);
|
|
333
350
|
const wantsTerminal = options.states === undefined || options.states.some((state) => !isActiveAsyncState(state));
|
|
334
351
|
const includeNested = options.includeNested !== false;
|
|
352
|
+
const owners = options.sessionId === undefined ? undefined : ownerSessionIds(options.sessionId);
|
|
335
353
|
try {
|
|
336
354
|
if (options.runId !== undefined) {
|
|
337
355
|
const resolution = resolveTargetedAsyncRun(asyncDirRoot, options.runId, options.sessionId);
|
|
@@ -352,8 +370,10 @@ export function listAsyncRuns(asyncDirRoot, options = {}, observeStatus) {
|
|
|
352
370
|
}
|
|
353
371
|
}
|
|
354
372
|
if (wantsTerminal) {
|
|
355
|
-
for (const
|
|
356
|
-
|
|
373
|
+
for (const sessionId of owners ?? [undefined]) {
|
|
374
|
+
for (const entry of readRecentTerminalRunIndex(asyncDirRoot, { sessionId, onCorruptStatus: options.onCorruptStatus, ...options.entryLimit !== undefined ? { limit: options.entryLimit } : {} }))
|
|
375
|
+
indexed.add(entry);
|
|
376
|
+
}
|
|
357
377
|
}
|
|
358
378
|
entries = [...indexed];
|
|
359
379
|
}
|
|
@@ -381,14 +401,16 @@ export function listAsyncRuns(asyncDirRoot, options = {}, observeStatus) {
|
|
|
381
401
|
const asyncDir = path.join(asyncDirRoot, entry);
|
|
382
402
|
let status;
|
|
383
403
|
try {
|
|
384
|
-
|
|
404
|
+
let owned = false;
|
|
405
|
+
if (owners) {
|
|
385
406
|
const stored = readStatus(asyncDir);
|
|
386
|
-
if (stored && stored.sessionId
|
|
407
|
+
if (stored && !owners.has(stored.sessionId)) {
|
|
387
408
|
observeStatus?.(stored);
|
|
388
409
|
continue;
|
|
389
410
|
}
|
|
411
|
+
owned = stored !== null;
|
|
390
412
|
}
|
|
391
|
-
const reconciliation = options.reconcile === false ? undefined : reconcileAsyncRun(asyncDir, { resultsDir: options.resultsDir, kill: options.kill, now: options.now }, observeStatus);
|
|
413
|
+
const reconciliation = options.reconcile === false ? undefined : reconcileAsyncRun(asyncDir, { resultsDir: options.resultsDir, kill: options.kill, now: options.now, adoptCompletionOwnerId: owned ? options.adoptCompletionOwnerId : undefined }, observeStatus);
|
|
392
414
|
status = reconciliation?.status ?? readStatus(asyncDir);
|
|
393
415
|
if (options.reconcile === false)
|
|
394
416
|
observeStatus?.(status);
|
|
@@ -415,7 +437,7 @@ export function listAsyncRuns(asyncDirRoot, options = {}, observeStatus) {
|
|
|
415
437
|
continue;
|
|
416
438
|
if (allowedStates && !allowedStates.has(status.state))
|
|
417
439
|
continue;
|
|
418
|
-
if (
|
|
440
|
+
if (owners && !owners.has(status.sessionId))
|
|
419
441
|
continue;
|
|
420
442
|
const nestedWarnings = [];
|
|
421
443
|
let nestedRoute;
|
|
@@ -14,7 +14,8 @@ function hasOutstandingWork(deps, sessionId, nowMs, observation) {
|
|
|
14
14
|
includeNested: false
|
|
15
15
|
}, observation?.status));
|
|
16
16
|
const detachedForeground = [...deps.state.foregroundRuns?.values() ?? []].some((run) => run.sessionId === sessionId && run.children.some((child) => child.status === "detached"));
|
|
17
|
-
|
|
17
|
+
const runtimeId = deps.state.supervisorOwnerSessionId;
|
|
18
|
+
return asyncRuns.length > 0 || snapshotBackgroundWork(runtimeId ? [sessionId, runtimeId] : [sessionId], nowMs).items.length > 0 || detachedForeground;
|
|
18
19
|
}
|
|
19
20
|
export async function drainOutstandingWork(deps, observation) {
|
|
20
21
|
const sessionId = deps.state.currentSessionId;
|
|
@@ -2,9 +2,8 @@ import * as fs from "node:fs";
|
|
|
2
2
|
import { readStatus } from "../../shared/utils.js";
|
|
3
3
|
import { workflowAwaitedAsyncResultPath } from "./async-execution.js";
|
|
4
4
|
import { waitForImportedAsyncRoot } from "./chain-root-attachment.js";
|
|
5
|
-
import { currentPidNamespaceScope } from "./pid-namespace.js";
|
|
6
5
|
import { resultPayloadPathForSessionRun, resultSnapshotReplaced, withResultRunLease } from "./result-files.js";
|
|
7
|
-
import {
|
|
6
|
+
import { checkRecordedPidLiveness } from "./stale-run-reconciler.js";
|
|
8
7
|
function errorMessage(error) {
|
|
9
8
|
return error instanceof Error ? error.message : String(error);
|
|
10
9
|
}
|
|
@@ -12,11 +11,7 @@ function runnerExitedWithoutResult(asyncDir, runId, resultPath) {
|
|
|
12
11
|
const status = readStatus(asyncDir);
|
|
13
12
|
if (!status || status.state !== "running" && status.state !== "queued" || typeof status.pid !== "number")
|
|
14
13
|
return false;
|
|
15
|
-
|
|
16
|
-
if (status.pidNamespaceScope !== undefined && status.pidNamespaceScope !== observedScope)
|
|
17
|
-
return false;
|
|
18
|
-
const pidScopeVerified = status.pidNamespaceScope !== undefined && status.pidNamespaceScope === observedScope;
|
|
19
|
-
if (checkPidLiveness(status.pid, undefined, pidScopeVerified) !== "dead")
|
|
14
|
+
if (checkRecordedPidLiveness({ pid: status.pid, pidNamespaceScope: status.pidNamespaceScope, bootId: status.bootId }) !== "dead")
|
|
20
15
|
return false;
|
|
21
16
|
return !fs.existsSync(resultPath) && !(status.sessionId && resultPayloadPathForSessionRun(asyncDir, status.sessionId, runId));
|
|
22
17
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
|
+
import { currentPidNamespaceScope } from "./pid-namespace.js";
|
|
4
|
+
function readBootIdFromOs() {
|
|
5
|
+
try {
|
|
6
|
+
if (process.platform === "linux")
|
|
7
|
+
return fs.readFileSync("/proc/sys/kernel/random/boot_id", "utf-8").trim() || undefined;
|
|
8
|
+
if (process.platform === "darwin") {
|
|
9
|
+
return execFileSync("sysctl", ["-n", "kern.bootsessionuuid"], { encoding: "utf-8", timeout: 1000, stdio: ["ignore", "pipe", "ignore"] }).trim() || undefined;
|
|
10
|
+
}
|
|
11
|
+
} catch {}
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const BOOT_ID_KEY = Symbol.for("dm-subagents.boot-id.v1");
|
|
15
|
+
const runtime = globalThis;
|
|
16
|
+
let reader = readBootIdFromOs;
|
|
17
|
+
export function currentBootId() {
|
|
18
|
+
const cached = runtime[BOOT_ID_KEY];
|
|
19
|
+
if (cached)
|
|
20
|
+
return cached.value;
|
|
21
|
+
const value = reader();
|
|
22
|
+
runtime[BOOT_ID_KEY] = { value };
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
export function currentRecordedPid() {
|
|
26
|
+
const pidNamespaceScope = currentPidNamespaceScope();
|
|
27
|
+
const bootId = currentBootId();
|
|
28
|
+
return { pid: process.pid, ...pidNamespaceScope ? { pidNamespaceScope } : {}, ...bootId ? { bootId } : {} };
|
|
29
|
+
}
|
|
30
|
+
export function primeBootId(value) {
|
|
31
|
+
runtime[BOOT_ID_KEY] = { value };
|
|
32
|
+
}
|
|
33
|
+
export function resetBootIdForTesting(nextReader) {
|
|
34
|
+
reader = nextReader ?? readBootIdFromOs;
|
|
35
|
+
delete runtime[BOOT_ID_KEY];
|
|
36
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import { resultFilePath, resultPayloadPathForSessionRun } from "./result-files.js";
|
|
4
|
-
import { readStatus } from "../../shared/utils.js";
|
|
4
|
+
import { SUBAGENT_STOPPED_MESSAGE, SUBAGENT_TIMED_OUT_MESSAGE, readStatus } from "../../shared/utils.js";
|
|
5
5
|
const TERMINAL_STATES = new Set(["complete", "failed", "partial", "paused", "stopped"]);
|
|
6
6
|
const TERMINAL_STEP_STATUSES = new Set(["complete", "completed", "failed", "partial", "paused", "stopped"]);
|
|
7
7
|
function readResultFile(resultPath) {
|
|
@@ -57,7 +57,7 @@ function outputFromTerminalStatus(root, status, step) {
|
|
|
57
57
|
const agent = step?.agent ?? status.steps?.[root.index]?.agent ?? "subagent";
|
|
58
58
|
const timedOut = step?.timedOut === true || status.timedOut === true;
|
|
59
59
|
const stopped = step?.stopped === true || status.stopped === true || status.state === "stopped";
|
|
60
|
-
const message = step?.error ?? status.error ?? (stopped ?
|
|
60
|
+
const message = step?.error ?? status.error ?? (stopped ? SUBAGENT_STOPPED_MESSAGE : `Attached async root ${root.runId} ended without a result file at ${root.resultPath}.`);
|
|
61
61
|
const partialStatus = status.state === "partial" || step?.status === "partial";
|
|
62
62
|
const execution = step?.execution ?? (partialStatus ? { status: "partial", success: false, exitCode: 1, error: message } : undefined);
|
|
63
63
|
return {
|
|
@@ -110,7 +110,7 @@ function buildImportedResult(root, status, { data: result, raw }) {
|
|
|
110
110
|
const timedOut = child?.timedOut === true || step?.timedOut === true || result.timedOut === true || status?.timedOut === true;
|
|
111
111
|
const stopped = child?.stopped === true || step?.stopped === true || result.stopped === true || status?.stopped === true || state === "stopped";
|
|
112
112
|
const success = state === "complete" && !timedOut && !stopped;
|
|
113
|
-
const error = child?.error ?? (success ? undefined : stopped ?
|
|
113
|
+
const error = child?.error ?? (success ? undefined : stopped ? SUBAGENT_STOPPED_MESSAGE : result.error ?? result.summary ?? status?.error ?? `Attached async root ${root.runId} did not complete successfully.`);
|
|
114
114
|
const execution = state ? { status: state === "complete" ? "completed" : state, success, exitCode: success ? 0 : 1, ...error ? { error } : {} } : undefined;
|
|
115
115
|
const usage = child?.usage;
|
|
116
116
|
return {
|
|
@@ -155,7 +155,7 @@ export async function waitForImportedAsyncRoot(root, options = {}) {
|
|
|
155
155
|
for (;; ) {
|
|
156
156
|
const status = readStatus(root.asyncDir);
|
|
157
157
|
if (options.shouldAbort?.())
|
|
158
|
-
return outputFromTimeout(root, status, options.timeoutMessage ??
|
|
158
|
+
return outputFromTimeout(root, status, options.timeoutMessage ?? SUBAGENT_TIMED_OUT_MESSAGE, options.abortedAsStopped === true);
|
|
159
159
|
const result = readImportedResultFile(root, status);
|
|
160
160
|
if (result)
|
|
161
161
|
return buildImportedResult(root, status, result);
|
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
export const MAX_INDEX_SEGMENT_BYTES = 255;
|
|
3
3
|
const HASHED_INDEX_SEGMENT_PREFIX = "~sha256-";
|
|
4
4
|
const WINDOWS_RESERVED_NAME = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i;
|
|
5
|
-
function hashedSegment(value) {
|
|
5
|
+
export function hashedSegment(value) {
|
|
6
6
|
return `${HASHED_INDEX_SEGMENT_PREFIX}${createHash("sha256").update(value).digest("hex")}`;
|
|
7
7
|
}
|
|
8
8
|
function isPortableSegment(value) {
|
|
@@ -8,6 +8,7 @@ import { completionReplayPath, readCompletionArchive, readCompletionReplay } fro
|
|
|
8
8
|
import { resultPayloadPathForSessionRun } from "./result-files.js";
|
|
9
9
|
import { resolveSubagentRunId } from "./run-id-resolver.js";
|
|
10
10
|
import { reconcileAsyncRun, reconcileNestedAsyncDescendants } from "./stale-run-reconciler.js";
|
|
11
|
+
import { ownsRun } from "../shared/run-ownership.js";
|
|
11
12
|
export const INSPECT_REPLY_KIND = "dm-subagents.inspect-reply";
|
|
12
13
|
export const INSPECT_REPLY_VERSION = 1;
|
|
13
14
|
export const INSPECT_WIDGET_KEY = "subagent-inspect";
|
|
@@ -235,6 +236,15 @@ function readResultOutput(resultsDir, sessionId, runId, stepIndex, trustedRoots,
|
|
|
235
236
|
const output = archive?.entries.find((entry) => entry.source === "result-tail" && matches(entry))?.text;
|
|
236
237
|
return output ? { output } : {};
|
|
237
238
|
}
|
|
239
|
+
function workflowChildRunModel(runId, workflowRunId, currentSessionId, asyncDirRoot, resultsDir, state) {
|
|
240
|
+
const resolved = resolveSubagentRunId(runId, { asyncDirRoot, resultsDir, state });
|
|
241
|
+
if (resolved?.kind !== "async" || resolved.id !== runId || !resolved.location.asyncDir)
|
|
242
|
+
return;
|
|
243
|
+
const child = readStatus(resolved.location.asyncDir);
|
|
244
|
+
if (!child || child.runId !== runId || child.parentWorkflowRunId !== workflowRunId || child.mode !== "single" || !ownsRun(currentSessionId, child.sessionId))
|
|
245
|
+
return;
|
|
246
|
+
return child.steps?.[0]?.resolvedModel;
|
|
247
|
+
}
|
|
238
248
|
function toReplyMessage(message) {
|
|
239
249
|
return {
|
|
240
250
|
role: truncateDisplayText(sanitizeDisplayText(message.role), 32),
|
|
@@ -294,14 +304,14 @@ export function buildInspectReply(request, deps = {}) {
|
|
|
294
304
|
}
|
|
295
305
|
if (!status)
|
|
296
306
|
return errorReply(request, "stale", `Async run '${request.asyncId}' artifacts are no longer available.`);
|
|
297
|
-
if (status.sessionId
|
|
307
|
+
if (!ownsRun(currentSessionId, status.sessionId)) {
|
|
298
308
|
return errorReply(request, "foreign_session", "Inspection is only available for async runs owned by the current session.");
|
|
299
309
|
}
|
|
300
310
|
const node = request.childId === undefined ? { asyncDir, status } : findChildNode(status, asyncDir, request.childId);
|
|
301
311
|
if ("error" in node)
|
|
302
312
|
return errorReply(request, "not_found", node.error);
|
|
303
313
|
if (node.asyncDir !== asyncDir) {
|
|
304
|
-
if (node.status.sessionId
|
|
314
|
+
if (!ownsRun(currentSessionId, node.status.sessionId)) {
|
|
305
315
|
return errorReply(request, "foreign_session", "Inspection is only available for async runs owned by the current session.");
|
|
306
316
|
}
|
|
307
317
|
reconcileAsyncRun(node.asyncDir, { resultsDir, kill: deps.kill, now: deps.now });
|
|
@@ -327,7 +337,7 @@ export function buildInspectReply(request, deps = {}) {
|
|
|
327
337
|
}
|
|
328
338
|
}
|
|
329
339
|
}
|
|
330
|
-
const result = readResultOutput(resultsDir, currentSessionId, node.status.runId, node.stepIndex, trustedRoots, step?.agent, deps.now ?? Date.now, deps.state?.trustedSessionFileRoot);
|
|
340
|
+
const result = readResultOutput(resultsDir, node.status.sessionId ?? currentSessionId, node.status.runId, node.stepIndex, trustedRoots, step?.agent, deps.now ?? Date.now, deps.state?.trustedSessionFileRoot);
|
|
331
341
|
const failedText = step?.error ?? node.status.error;
|
|
332
342
|
if (result.output === undefined && result.errorText === undefined && failedText !== undefined) {
|
|
333
343
|
return errorReply(request, "internal", "Inspection could not read the async run artifacts.");
|
|
@@ -341,6 +351,9 @@ export function buildInspectReply(request, deps = {}) {
|
|
|
341
351
|
if (finalOutputRaw !== undefined && boundedFinal !== finalOutputRaw)
|
|
342
352
|
truncated.finalOutput = true;
|
|
343
353
|
const label = publicText(node.label ?? step?.label ?? step?.agent ?? node.status.runId, MAX_LABEL_LENGTH);
|
|
354
|
+
const recordedModel = (step ?? (node.status.mode === "single" ? node.status.steps?.[0] : undefined))?.resolvedModel ?? (step?.runId ? workflowChildRunModel(step.runId, node.status.runId, currentSessionId, asyncDirRoot, resultsDir, deps.state) : undefined);
|
|
355
|
+
const resolvedProvider = publicText(recordedModel?.provider, 64);
|
|
356
|
+
const resolvedModelId = publicText(recordedModel?.model, 160);
|
|
344
357
|
const reply = {
|
|
345
358
|
kind: INSPECT_REPLY_KIND,
|
|
346
359
|
version: INSPECT_REPLY_VERSION,
|
|
@@ -352,6 +365,7 @@ export function buildInspectReply(request, deps = {}) {
|
|
|
352
365
|
...boundedTask !== undefined ? { task: boundedTask } : {},
|
|
353
366
|
...messages && messages.length > 0 ? { messages } : {},
|
|
354
367
|
...boundedFinal !== undefined ? { finalOutput: boundedFinal } : {},
|
|
368
|
+
...resolvedProvider && resolvedModelId ? { resolvedModel: { provider: resolvedProvider, model: resolvedModelId } } : {},
|
|
355
369
|
...truncated.task || truncated.finalOutput || truncated.messages > 0 ? { truncated } : {}
|
|
356
370
|
};
|
|
357
371
|
return enforceByteBudget(reply);
|