@duckmind/dm-windows-x64 0.61.5 → 0.62.1
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/dm.exe +0 -0
- package/extensions/.dm-extensions.json +215 -71
- package/extensions/dm-cua/bin/browser-cua.mjs +6 -1
- package/extensions/dm-cua/index.js +3 -2
- package/extensions/dm-cua/src/browser-cua-lib.mjs +69 -13
- package/extensions/dm-subagents/agents/claude-code-writer.md +15 -0
- package/extensions/dm-subagents/agents/claude-code.md +15 -0
- package/extensions/dm-subagents/agents/codex-exec-writer.md +15 -0
- package/extensions/dm-subagents/agents/codex-exec.md +15 -0
- package/extensions/dm-subagents/agents/cursor-agent-writer.md +14 -0
- package/extensions/dm-subagents/agents/cursor-agent.md +14 -0
- package/extensions/dm-subagents/agents/delegate.md +3 -2
- package/extensions/dm-subagents/agents/oracle.md +10 -5
- package/extensions/dm-subagents/agents/researcher.md +2 -2
- package/extensions/dm-subagents/agents/reviewer.md +17 -7
- package/extensions/dm-subagents/agents/scout.md +5 -5
- package/extensions/dm-subagents/agents/worker.md +6 -2
- package/extensions/dm-subagents/async-retention-discovery-worker.mjs +167 -0
- package/extensions/dm-subagents/index.js +4 -0
- package/extensions/dm-subagents/inspector-runner.mjs +10 -0
- package/extensions/dm-subagents/install.mjs +3 -2
- package/extensions/dm-subagents/package.json +2 -2
- package/extensions/dm-subagents/prompts/council.md +60 -0
- package/extensions/dm-subagents/prompts/parallel-review.md +5 -1
- package/extensions/dm-subagents/prompts/review-loop.md +13 -7
- package/extensions/dm-subagents/skills/council-mode/SKILL.md +59 -0
- package/extensions/dm-subagents/skills/council-mode/references/pass-contracts.md +150 -0
- package/extensions/dm-subagents/skills/dm-subagents/SKILL.md +96 -911
- package/extensions/dm-subagents/skills/dm-subagents/references/constraints-and-recipes.md +70 -0
- package/extensions/dm-subagents/skills/dm-subagents/references/execution-controls.md +539 -0
- package/extensions/dm-subagents/skills/dm-subagents/references/management-authoring-rpc.md +161 -0
- package/extensions/dm-subagents/skills/dm-subagents/references/multi-lane-orchestration.md +51 -0
- package/extensions/dm-subagents/skills/dm-subagents/references/prompting-and-roles.md +295 -0
- package/extensions/dm-subagents/skills/dm-subagents/references/review-and-validation.md +73 -0
- package/extensions/dm-subagents/src/agents/agent-management.js +716 -484
- package/extensions/dm-subagents/src/agents/agent-refinements.js +563 -0
- package/extensions/dm-subagents/src/agents/agent-serializer.js +70 -5
- package/extensions/dm-subagents/src/agents/agents.js +1447 -299
- package/extensions/dm-subagents/src/agents/builtin-names.js +15 -0
- package/extensions/dm-subagents/src/agents/chain-serializer.js +12 -7
- package/extensions/dm-subagents/src/agents/frontmatter.js +64 -14
- package/extensions/dm-subagents/src/agents/identity.js +1 -1
- package/extensions/dm-subagents/src/agents/proactive-skills.js +14 -11
- package/extensions/dm-subagents/src/agents/runtime-agent-events.js +49 -0
- package/extensions/dm-subagents/src/agents/runtime-agent-registry.js +412 -0
- package/extensions/dm-subagents/src/agents/skills.js +52 -35
- package/extensions/dm-subagents/src/api/agents.js +6 -0
- package/extensions/dm-subagents/src/api/background-work.js +151 -0
- package/extensions/dm-subagents/src/api/capability-ceiling.js +12 -0
- package/extensions/dm-subagents/src/api/control-channel.js +3 -0
- package/extensions/dm-subagents/src/api/delegation.js +5 -0
- package/extensions/dm-subagents/src/api/dm-args.js +3 -0
- package/extensions/dm-subagents/src/api/external-job-provider.js +137 -0
- package/extensions/dm-subagents/src/api/external-runs.js +233 -0
- package/extensions/dm-subagents/src/api/intercom-bridge.js +3 -0
- package/extensions/dm-subagents/src/api/preflight.js +322 -0
- package/extensions/dm-subagents/src/api/project-panes.js +11 -0
- package/extensions/dm-subagents/src/api/shared-types.js +4 -0
- package/extensions/dm-subagents/src/extension/config.js +175 -0
- package/extensions/dm-subagents/src/extension/control-notices.js +4 -43
- package/extensions/dm-subagents/src/extension/doctor.js +71 -17
- package/extensions/dm-subagents/src/extension/fanout-child.js +49 -32
- package/extensions/dm-subagents/src/extension/index.js +711 -265
- package/extensions/dm-subagents/src/extension/public-execution.js +114 -0
- package/extensions/dm-subagents/src/extension/rpc.js +427 -22
- package/extensions/dm-subagents/src/extension/schemas.js +158 -65
- package/extensions/dm-subagents/src/extension/steering-notices.js +23 -0
- package/extensions/dm-subagents/src/extension/subagent-guide.js +31 -0
- package/extensions/dm-subagents/src/extension/tool-description.js +92 -74
- package/extensions/dm-subagents/src/extension/tool-result.js +7 -0
- package/extensions/dm-subagents/src/inspectors/herdr/actions.js +218 -0
- package/extensions/dm-subagents/src/inspectors/herdr/client.js +123 -0
- package/extensions/dm-subagents/src/inspectors/herdr/focus.js +47 -0
- package/extensions/dm-subagents/src/inspectors/herdr/inspector-runner.js +160 -0
- package/extensions/dm-subagents/src/inspectors/herdr/project-panes.js +618 -0
- package/extensions/dm-subagents/src/inspectors/herdr/session-roots-codec.js +21 -0
- package/extensions/dm-subagents/src/inspectors/herdr/shell-command.js +15 -0
- package/extensions/dm-subagents/src/integrations/herdr-status.js +377 -0
- package/extensions/dm-subagents/src/intercom/intercom-bridge.js +17 -13
- package/extensions/dm-subagents/src/intercom/native-supervisor-channel.js +371 -79
- package/extensions/dm-subagents/src/intercom/result-intercom.js +47 -7
- package/extensions/dm-subagents/src/missions/actions.js +394 -0
- package/extensions/dm-subagents/src/missions/goal-driver.js +149 -0
- package/extensions/dm-subagents/src/missions/lifecycle.js +331 -0
- package/extensions/dm-subagents/src/missions/store.js +548 -0
- package/extensions/dm-subagents/src/missions/types.js +9 -0
- package/extensions/dm-subagents/src/missions/workflow-state.js +245 -0
- package/extensions/dm-subagents/src/policy/authority.js +37 -0
- package/extensions/dm-subagents/src/profiles/profiles.js +36 -18
- package/extensions/dm-subagents/src/runs/background/active-async-capacity.js +427 -0
- package/extensions/dm-subagents/src/runs/background/active-run-index.js +122 -0
- package/extensions/dm-subagents/src/runs/background/async-execution.js +925 -137
- package/extensions/dm-subagents/src/runs/background/async-job-tracker.js +515 -148
- package/extensions/dm-subagents/src/runs/background/async-resume.js +378 -51
- package/extensions/dm-subagents/src/runs/background/async-retention.js +828 -0
- package/extensions/dm-subagents/src/runs/background/async-status-snapshot.js +31 -0
- package/extensions/dm-subagents/src/runs/background/async-status.js +259 -22
- package/extensions/dm-subagents/src/runs/background/auto-drain.js +46 -0
- package/extensions/dm-subagents/src/runs/background/chain-append.js +50 -15
- package/extensions/dm-subagents/src/runs/background/chain-root-attachment.js +67 -12
- package/extensions/dm-subagents/src/runs/background/completion-batcher.js +5 -1
- package/extensions/dm-subagents/src/runs/background/completion-dedupe.js +3 -11
- package/extensions/dm-subagents/src/runs/background/completion-replay.js +245 -0
- package/extensions/dm-subagents/src/runs/background/control-channel.js +423 -36
- package/extensions/dm-subagents/src/runs/background/fleet-view.js +132 -59
- package/extensions/dm-subagents/src/runs/background/index-segment.js +38 -0
- package/extensions/dm-subagents/src/runs/background/inspect-rpc.js +373 -0
- package/extensions/dm-subagents/src/runs/background/notify.js +357 -57
- package/extensions/dm-subagents/src/runs/background/owned-process-tree.js +86 -0
- package/extensions/dm-subagents/src/runs/background/process-terminal.js +269 -0
- package/extensions/dm-subagents/src/runs/background/result-delivery-ownership.js +34 -0
- package/extensions/dm-subagents/src/runs/background/result-files.js +469 -0
- package/extensions/dm-subagents/src/runs/background/result-watcher.js +540 -75
- package/extensions/dm-subagents/src/runs/background/resume-guidance.js +44 -0
- package/extensions/dm-subagents/src/runs/background/retained-children.js +119 -0
- package/extensions/dm-subagents/src/runs/background/run-id-query.js +5 -0
- package/extensions/dm-subagents/src/runs/background/run-id-resolver.js +93 -9
- package/extensions/dm-subagents/src/runs/background/run-status.js +303 -32
- package/extensions/dm-subagents/src/runs/background/scheduled-runs.js +784 -376
- package/extensions/dm-subagents/src/runs/background/stale-run-reconciler.js +75 -34
- package/extensions/dm-subagents/src/runs/background/steering.js +221 -0
- package/extensions/dm-subagents/src/runs/background/subagent-runner.js +3106 -844
- package/extensions/dm-subagents/src/runs/background/subagent-wait.js +529 -0
- package/extensions/dm-subagents/src/runs/background/terminal-run-index.js +106 -0
- package/extensions/dm-subagents/src/runs/background/top-level-async.js +1 -1
- package/extensions/dm-subagents/src/runs/background/wait-completions.js +155 -0
- package/extensions/dm-subagents/src/runs/background/wait-config.js +46 -0
- package/extensions/dm-subagents/src/runs/background/wait-subscriptions.js +278 -0
- package/extensions/dm-subagents/src/runs/background/wait-tool.js +47 -0
- package/extensions/dm-subagents/src/runs/foreground/async-dismiss-action.js +81 -0
- package/extensions/dm-subagents/src/runs/foreground/async-steering-action.js +245 -0
- package/extensions/dm-subagents/src/runs/foreground/async-stop-action.js +74 -0
- package/extensions/dm-subagents/src/runs/foreground/execution.js +1401 -342
- package/extensions/dm-subagents/src/runs/foreground/foreground-control.js +133 -0
- package/extensions/dm-subagents/src/runs/foreground/foreground-history.js +148 -0
- package/extensions/dm-subagents/src/runs/foreground/prompt-audit.js +139 -0
- package/extensions/dm-subagents/src/runs/foreground/subagent-executor.js +4278 -1441
- package/extensions/dm-subagents/src/runs/foreground/workflow-detach-reconcile.js +278 -0
- package/extensions/dm-subagents/src/runs/foreground/workflow-foreground-steering.js +155 -0
- package/extensions/dm-subagents/src/runs/shared/abort-recovery.js +97 -0
- package/extensions/dm-subagents/src/runs/shared/acceptance.js +597 -148
- package/extensions/dm-subagents/src/runs/shared/agent-contract.js +35 -0
- package/extensions/dm-subagents/src/runs/shared/async-status-projection.js +472 -0
- package/extensions/dm-subagents/src/runs/shared/background-process-options.js +6 -0
- package/extensions/dm-subagents/src/runs/shared/capability-ceiling.js +175 -0
- package/extensions/dm-subagents/src/runs/shared/child-identity.js +32 -0
- package/extensions/dm-subagents/src/runs/shared/child-launch-plan.js +65 -0
- package/extensions/dm-subagents/src/runs/shared/child-protocol.js +447 -0
- package/extensions/dm-subagents/src/runs/shared/claude-code-adapter.js +120 -0
- package/extensions/dm-subagents/src/runs/shared/codex-exec-adapter.js +129 -0
- package/extensions/dm-subagents/src/runs/shared/completion-evidence.js +40 -0
- package/extensions/dm-subagents/src/runs/shared/completion-guard.js +140 -83
- package/extensions/dm-subagents/src/runs/shared/context-mode.js +38 -0
- package/extensions/dm-subagents/src/runs/shared/cursor-agent-adapter.js +101 -0
- package/extensions/dm-subagents/src/runs/shared/dm-args.js +445 -72
- package/extensions/dm-subagents/src/runs/shared/dm-spawn.js +27 -16
- package/extensions/dm-subagents/src/runs/shared/dynamic-fanout.js +19 -6
- package/extensions/dm-subagents/src/runs/shared/extension-bindings.js +81 -0
- package/extensions/dm-subagents/src/runs/shared/external-cli-contract.js +134 -0
- package/extensions/dm-subagents/src/runs/shared/external-cli-preflight.js +98 -0
- package/extensions/dm-subagents/src/runs/shared/external-cli-runner.js +419 -0
- package/extensions/dm-subagents/src/runs/shared/external-job-bridge.js +404 -0
- package/extensions/dm-subagents/src/runs/shared/external-job-runner.js +334 -0
- package/extensions/dm-subagents/src/runs/shared/fast-mode-extension.js +8 -0
- package/extensions/dm-subagents/src/runs/shared/host-step-status.js +228 -0
- package/extensions/dm-subagents/src/runs/shared/lane-metadata.js +104 -0
- package/extensions/dm-subagents/src/runs/shared/launch-cwd.js +17 -0
- package/extensions/dm-subagents/src/runs/shared/llm-intent-arbiter.js +190 -0
- package/extensions/dm-subagents/src/runs/shared/long-running-guard.js +48 -3
- package/extensions/dm-subagents/src/runs/shared/mcp-config-sources.js +387 -0
- package/extensions/dm-subagents/src/runs/shared/mcp-direct-tool-allowlist.js +212 -137
- package/extensions/dm-subagents/src/runs/shared/mcp-direct-tool-grant.js +131 -0
- package/extensions/dm-subagents/src/runs/shared/model-exclusions.js +207 -0
- package/extensions/dm-subagents/src/runs/shared/model-fallback.js +225 -55
- package/extensions/dm-subagents/src/runs/shared/model-scope.js +85 -28
- package/extensions/dm-subagents/src/runs/shared/mutation-evidence.js +182 -0
- package/extensions/dm-subagents/src/runs/shared/nested-events.js +264 -102
- package/extensions/dm-subagents/src/runs/shared/nested-render.js +15 -5
- package/extensions/dm-subagents/src/runs/shared/orca-progress-tabs.js +505 -0
- package/extensions/dm-subagents/src/runs/shared/parallel-handoff.js +653 -0
- package/extensions/dm-subagents/src/runs/shared/parallel-utils.js +29 -12
- package/extensions/dm-subagents/src/runs/shared/permissions.js +108 -0
- package/extensions/dm-subagents/src/runs/shared/process-signal.js +13 -0
- package/extensions/dm-subagents/src/runs/shared/run-fanout-budget.js +257 -0
- package/extensions/dm-subagents/src/runs/shared/run-history.js +133 -13
- package/extensions/dm-subagents/src/runs/shared/runtime-acknowledged-extensions.js +62 -0
- package/extensions/dm-subagents/src/runs/shared/session-lease.js +225 -0
- package/extensions/dm-subagents/src/runs/shared/single-output.js +129 -27
- package/extensions/dm-subagents/src/runs/shared/spawn-budget.js +95 -0
- package/extensions/dm-subagents/src/runs/shared/structured-output.js +129 -10
- package/extensions/dm-subagents/src/runs/shared/subagent-control.js +66 -11
- package/extensions/dm-subagents/src/runs/shared/subagent-prompt-runtime.js +548 -70
- package/extensions/dm-subagents/src/runs/shared/subagent-startup-retry.js +50 -0
- package/extensions/dm-subagents/src/runs/shared/task-intent.js +130 -0
- package/extensions/dm-subagents/src/runs/shared/tool-availability.js +59 -0
- package/extensions/dm-subagents/src/runs/shared/tool-budget.js +7 -5
- package/extensions/dm-subagents/src/runs/shared/tool-timeout.js +64 -0
- package/extensions/dm-subagents/src/runs/shared/usage-budget.js +74 -0
- package/extensions/dm-subagents/src/runs/shared/workflow-graph.js +22 -0
- package/extensions/dm-subagents/src/runs/shared/worktree-cleanup-plan.js +721 -0
- package/extensions/dm-subagents/src/runs/shared/worktree.js +168 -19
- package/extensions/dm-subagents/src/shared/accessible-dir.js +35 -0
- package/extensions/dm-subagents/src/shared/agent-stream-options.js +3 -0
- package/extensions/dm-subagents/src/shared/artifacts.js +170 -11
- package/extensions/dm-subagents/src/shared/atomic-json.js +36 -38
- package/extensions/dm-subagents/src/shared/capacity-resilient-json.js +77 -0
- package/extensions/dm-subagents/src/shared/child-session-name.js +15 -0
- package/extensions/dm-subagents/src/shared/child-transcript.js +57 -2
- package/extensions/dm-subagents/src/shared/completion-owner.js +7 -0
- package/extensions/dm-subagents/src/shared/display-text.js +142 -0
- package/extensions/dm-subagents/src/shared/extension-context.js +17 -0
- package/extensions/dm-subagents/src/shared/file-coalescer.js +9 -0
- package/extensions/dm-subagents/src/shared/file-system-retry.js +56 -0
- package/extensions/dm-subagents/src/shared/fork-context.js +96 -33
- package/extensions/dm-subagents/src/shared/formatters.js +21 -7
- package/extensions/dm-subagents/src/shared/launch-contract.js +94 -0
- package/extensions/dm-subagents/src/shared/model-info.js +10 -5
- package/extensions/dm-subagents/src/shared/node-executable.js +19 -0
- package/extensions/dm-subagents/src/shared/prompt-resources.js +10 -0
- package/extensions/dm-subagents/src/shared/pruned-fork.js +427 -0
- package/extensions/dm-subagents/src/shared/session-file-trust.js +19 -0
- package/extensions/dm-subagents/src/shared/session-tokens.js +14 -3
- package/extensions/dm-subagents/src/shared/settings.js +39 -47
- package/extensions/dm-subagents/src/shared/shortcuts.js +16 -0
- package/extensions/dm-subagents/src/shared/status-format.js +9 -2
- package/extensions/dm-subagents/src/shared/thinking-ceiling.js +41 -0
- package/extensions/dm-subagents/src/shared/types.js +47 -7
- package/extensions/dm-subagents/src/shared/utf8.js +12 -0
- package/extensions/dm-subagents/src/shared/utils.js +151 -131
- package/extensions/dm-subagents/src/shared/watch-strategy.js +3 -0
- package/extensions/dm-subagents/src/shared/workflow-child-permit.js +84 -0
- package/extensions/dm-subagents/src/slash/delegation-adapters.js +274 -0
- package/extensions/dm-subagents/src/slash/delegation-json.js +113 -0
- package/extensions/dm-subagents/src/slash/delegation-request.js +152 -0
- package/extensions/dm-subagents/src/slash/prompt-template-bridge.js +294 -243
- package/extensions/dm-subagents/src/slash/prompt-workflows.js +35 -73
- package/extensions/dm-subagents/src/slash/selector.js +101 -0
- package/extensions/dm-subagents/src/slash/slash-bridge.js +17 -1
- package/extensions/dm-subagents/src/slash/slash-commands.js +722 -732
- package/extensions/dm-subagents/src/slash/slash-live-state.js +37 -19
- package/extensions/dm-subagents/src/slash/subagents-admin.js +410 -0
- package/extensions/dm-subagents/src/tui/fleet-status.js +824 -0
- package/extensions/dm-subagents/src/tui/fleet-transcript.js +479 -0
- package/extensions/dm-subagents/src/tui/fleet.js +1326 -0
- package/extensions/dm-subagents/src/tui/render-helpers.js +22 -0
- package/extensions/dm-subagents/src/tui/render.js +1511 -261
- package/extensions/dm-subagents/src/watchdog/change-signature.js +220 -0
- package/extensions/dm-subagents/src/watchdog/child-status.js +151 -0
- package/extensions/dm-subagents/src/watchdog/emission-guard.js +90 -0
- package/extensions/dm-subagents/src/watchdog/lsp-diagnostics.js +484 -0
- package/extensions/dm-subagents/src/watchdog/model-selection.js +154 -0
- package/extensions/dm-subagents/src/watchdog/permission-arbiter.js +138 -0
- package/extensions/dm-subagents/src/watchdog/register-child.js +112 -0
- package/extensions/dm-subagents/src/watchdog/register-main.js +419 -0
- package/extensions/dm-subagents/src/watchdog/render.js +54 -0
- package/extensions/dm-subagents/src/watchdog/review.js +251 -0
- package/extensions/dm-subagents/src/watchdog/runtime.js +803 -0
- package/extensions/dm-subagents/src/watchdog/scope.js +56 -0
- package/extensions/dm-subagents/src/watchdog/settings.js +515 -0
- package/extensions/dm-subagents/src/watchdog/tool-actions.js +151 -0
- package/extensions/dm-subagents/src/watchdog/turn-delta.js +169 -0
- package/extensions/dm-subagents/src/watchdog/types.js +29 -0
- package/extensions/dm-subagents/src/watchdog/warning-format.js +58 -0
- package/extensions/dm-subagents/src/workflows/chat-progress.js +116 -0
- package/extensions/dm-subagents/src/workflows/host-command.js +227 -0
- package/extensions/dm-subagents/src/workflows/scripted-workflow.js +2011 -0
- package/extensions/dm-subagents/src/workflows/workflow-child-summary.js +116 -0
- package/extensions/dm-subagents/src/workflows/workflow-preflight.js +243 -0
- package/extensions/dm-subagents/src/workflows/workflow-receipt.js +387 -0
- package/extensions/dm-subagents/src/workflows/workflow-settlement.js +189 -0
- package/extensions/greedysearch-dm/bin/cdp.mjs +28 -3
- package/extensions/greedysearch-dm/bin/launch.mjs +2 -3
- package/extensions/greedysearch-dm/src/search/constants.mjs +5 -2
- package/package.json +4 -3
- package/extensions/dm-fff/package.json +0 -21
- package/extensions/dm-fff/src/index.js +0 -691
- package/extensions/dm-fff/src/query.js +0 -60
- package/extensions/dm-subagents/agents/context-builder.md +0 -46
- package/extensions/dm-subagents/agents/planner.md +0 -55
- package/extensions/dm-subagents/prompts/parallel-context-build.md +0 -55
- package/extensions/dm-subagents/prompts/parallel-handoff-plan.md +0 -61
- package/extensions/dm-subagents/src/runs/background/wait.js +0 -206
- package/extensions/dm-subagents/src/runs/foreground/chain-clarify.js +0 -1013
- package/extensions/dm-subagents/src/runs/foreground/chain-execution.js +0 -981
- package/extensions/dm-subagents/src/runs/shared/turn-budget.js +0 -50
|
@@ -44,7 +44,8 @@ export function resolveBrowserRuntimeConfig(env = process.env, scope = process.c
|
|
|
44
44
|
const browserExecutablePath = resolveBrowserExecutablePath(env, browserKind);
|
|
45
45
|
const port = parsePort(env.DM_CUA_PORT) ?? parsePort(env.GREEDY_SEARCH_PORT) ?? DEFAULT_CUA_PORT_BASE + Number.parseInt(scopeHash.slice(0, 8), 16) % DEFAULT_CUA_PORT_RANGE;
|
|
46
46
|
const profileSuffix = browserKind === "chrome" ? "chrome" : browserKind;
|
|
47
|
-
const
|
|
47
|
+
const defaultProfileDir = env.DM_CUA_EPHEMERAL === "1" ? join(tmpdir(), `dm-cua-${profileSuffix}-profile-${instanceId}`) : join(resolveAgentDir(env), "cua", "profiles", `${profileSuffix}-${scopeHash}`);
|
|
48
|
+
const profileDir = resolve(env.DM_CUA_PROFILE_DIR || defaultProfileDir);
|
|
48
49
|
const socketBaseDir = platform() === "win32" ? tmpdir() : "/tmp";
|
|
49
50
|
return {
|
|
50
51
|
instanceId,
|
|
@@ -133,8 +134,8 @@ export function resolveBrowserHelperPaths() {
|
|
|
133
134
|
}
|
|
134
135
|
return candidates[0];
|
|
135
136
|
}
|
|
136
|
-
export function resolveBrowserProcessEnv(config = BROWSER_CONFIG, env = process.env) {
|
|
137
|
-
const
|
|
137
|
+
export function resolveBrowserProcessEnv(config = BROWSER_CONFIG, env = process.env, { visible } = {}) {
|
|
138
|
+
const visibleMode = visible === true ? "1" : visible === false ? "0" : env.GREEDY_SEARCH_VISIBLE ?? env.DM_CUA_VISIBLE ?? env.DM_BROWSER_CUA_VISIBLE;
|
|
138
139
|
return {
|
|
139
140
|
...env,
|
|
140
141
|
...config.browserExecutablePath ? { CHROME_PATH: config.browserExecutablePath } : {},
|
|
@@ -147,11 +148,11 @@ export function resolveBrowserProcessEnv(config = BROWSER_CONFIG, env = process.
|
|
|
147
148
|
GREEDY_SEARCH_PID_FILE: config.pidFile.replace(/\\/g, "/"),
|
|
148
149
|
GREEDY_SEARCH_MODE_FILE: config.modeFile.replace(/\\/g, "/"),
|
|
149
150
|
GREEDY_SEARCH_ALLOW_PORT_CLEANUP: env.GREEDY_SEARCH_ALLOW_PORT_CLEANUP ?? "0",
|
|
150
|
-
...
|
|
151
|
+
...visibleMode === undefined ? {} : { GREEDY_SEARCH_VISIBLE: visibleMode }
|
|
151
152
|
};
|
|
152
153
|
}
|
|
153
|
-
function browserEnv() {
|
|
154
|
-
return resolveBrowserProcessEnv(BROWSER_CONFIG, process.env);
|
|
154
|
+
function browserEnv(options) {
|
|
155
|
+
return resolveBrowserProcessEnv(BROWSER_CONFIG, process.env, options);
|
|
155
156
|
}
|
|
156
157
|
function looksLikeUrl(value) {
|
|
157
158
|
return URLISH_PATTERN.test(value);
|
|
@@ -184,8 +185,8 @@ export function validateBrowserSelector(selector) {
|
|
|
184
185
|
}
|
|
185
186
|
return value;
|
|
186
187
|
}
|
|
187
|
-
function resolveAgentDir() {
|
|
188
|
-
const explicit =
|
|
188
|
+
function resolveAgentDir(env = process.env) {
|
|
189
|
+
const explicit = env.DM_CODING_AGENT_DIR || env.PI_CODING_AGENT_DIR;
|
|
189
190
|
return explicit ? resolve(explicit) : join(homedir(), ".dm", "agent");
|
|
190
191
|
}
|
|
191
192
|
function defaultScreenshotPath() {
|
|
@@ -269,7 +270,10 @@ async function createBlankTarget(url = "about:blank") {
|
|
|
269
270
|
}
|
|
270
271
|
async function runCdp(args, options = {}) {
|
|
271
272
|
const { cdpScript } = resolveBrowserHelperPaths();
|
|
272
|
-
return runNodeScript(cdpScript, args, {
|
|
273
|
+
return runNodeScript(cdpScript, args, {
|
|
274
|
+
env: browserEnv({ visible: options.visible }),
|
|
275
|
+
timeoutMs: options.timeoutMs ?? DEFAULT_TIMEOUT_MS
|
|
276
|
+
});
|
|
273
277
|
}
|
|
274
278
|
async function listPages() {
|
|
275
279
|
const result = await runCdp(["list"]);
|
|
@@ -288,10 +292,13 @@ async function ensureBrowserHelpersExist() {
|
|
|
288
292
|
}
|
|
289
293
|
return { launchScript, cdpScript };
|
|
290
294
|
}
|
|
291
|
-
export async function ensureBrowserReady() {
|
|
295
|
+
export async function ensureBrowserReady({ visible = false } = {}) {
|
|
292
296
|
const { launchScript } = await ensureBrowserHelpersExist();
|
|
293
297
|
await ensureConfiguredBrowserSelectionUsable();
|
|
294
|
-
await runNodeScript(launchScript, [], {
|
|
298
|
+
await runNodeScript(launchScript, [], {
|
|
299
|
+
env: browserEnv({ visible }),
|
|
300
|
+
timeoutMs: DEFAULT_TIMEOUT_MS
|
|
301
|
+
});
|
|
295
302
|
let pages = await listPages();
|
|
296
303
|
if (pages.length === 0) {
|
|
297
304
|
await createBlankTarget("about:blank");
|
|
@@ -310,6 +317,17 @@ async function resolveTabContext(tabPrefix) {
|
|
|
310
317
|
}
|
|
311
318
|
return { tab: page.target, page, pages };
|
|
312
319
|
}
|
|
320
|
+
export function classifyHumanInteraction(value) {
|
|
321
|
+
const text = String(value ?? "");
|
|
322
|
+
const match = text.match(/cloudflare|turnstile|recaptcha|hcaptcha|aws waf|geetest|verify (?:you are )?human|just a moment|checking your browser|login required|sign[ -]?in required|authentication required/i);
|
|
323
|
+
return match ? {
|
|
324
|
+
needed: true,
|
|
325
|
+
reason: match[0]
|
|
326
|
+
} : {
|
|
327
|
+
needed: false,
|
|
328
|
+
reason: null
|
|
329
|
+
};
|
|
330
|
+
}
|
|
313
331
|
export async function runBrowserAction({
|
|
314
332
|
action,
|
|
315
333
|
tab,
|
|
@@ -347,6 +365,7 @@ export async function runBrowserAction({
|
|
|
347
365
|
case "snapshot": {
|
|
348
366
|
const context = await resolveTabContext(tab);
|
|
349
367
|
const result = await runCdp(["snap", context.tab]);
|
|
368
|
+
const snapshot = result.stdout.trim();
|
|
350
369
|
return {
|
|
351
370
|
status: "ok",
|
|
352
371
|
action,
|
|
@@ -354,7 +373,33 @@ export async function runBrowserAction({
|
|
|
354
373
|
tab: context.tab,
|
|
355
374
|
title: context.page?.title || "",
|
|
356
375
|
url: context.page?.url || "",
|
|
357
|
-
snapshot
|
|
376
|
+
snapshot,
|
|
377
|
+
humanInteraction: classifyHumanInteraction(`${context.page?.title || ""}
|
|
378
|
+
${context.page?.url || ""}
|
|
379
|
+
${snapshot}`)
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
case "handoff": {
|
|
383
|
+
try {
|
|
384
|
+
await runCdp(["stop"]);
|
|
385
|
+
} catch {}
|
|
386
|
+
const pages = await ensureBrowserReady({ visible: true });
|
|
387
|
+
const page = findPage(pages, tab);
|
|
388
|
+
if (!page) {
|
|
389
|
+
throw new Error(tab ? `No browser tab matching prefix "${tab}". Run browser_cua(list) first.` : "No browser tab available after browser bootstrap.");
|
|
390
|
+
}
|
|
391
|
+
const snapshot = await runCdp(["snap", page.target], { visible: true }).then((result) => result.stdout.trim());
|
|
392
|
+
return {
|
|
393
|
+
status: "ok",
|
|
394
|
+
action,
|
|
395
|
+
browser: browserSummary(),
|
|
396
|
+
tab: page.target,
|
|
397
|
+
title: page.title || "",
|
|
398
|
+
url: page.url || "",
|
|
399
|
+
humanInteraction: classifyHumanInteraction(`${page.title || ""}
|
|
400
|
+
${page.url || ""}
|
|
401
|
+
${snapshot}`),
|
|
402
|
+
message: "Opened the dedicated DM browser window for human interaction. Complete only the site interaction you authorize, then return to DM; this scoped profile is retained for future CUA sessions."
|
|
358
403
|
};
|
|
359
404
|
}
|
|
360
405
|
case "screenshot": {
|
|
@@ -465,7 +510,18 @@ export function renderBrowserActionText(result) {
|
|
|
465
510
|
return [`Navigated browser tab ${result.tab} to ${result.url || "(unknown URL)"}`, result.title ? `Title: ${result.title}` : ""].filter(Boolean).join(`
|
|
466
511
|
`);
|
|
467
512
|
case "snapshot":
|
|
468
|
-
return [
|
|
513
|
+
return [
|
|
514
|
+
`Browser snapshot for ${result.tab}`,
|
|
515
|
+
result.snapshot || "(empty snapshot)",
|
|
516
|
+
result.humanInteraction?.needed ? `Human interaction may be required: ${result.humanInteraction.reason}. Use browser_cua(handoff) to open the DM browser window.` : ""
|
|
517
|
+
].filter(Boolean).join(`
|
|
518
|
+
`);
|
|
519
|
+
case "handoff":
|
|
520
|
+
return [
|
|
521
|
+
result.message,
|
|
522
|
+
result.humanInteraction?.needed ? `Detected: ${result.humanInteraction.reason}.` : "No known verification marker was detected; the visible browser remains available if the page still needs you.",
|
|
523
|
+
"DM does not solve challenges or enter credentials for you."
|
|
524
|
+
].join(`
|
|
469
525
|
`);
|
|
470
526
|
case "screenshot":
|
|
471
527
|
return [
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: claude-code-writer
|
|
3
|
+
description: Explicit file-writing Claude Code CLI mode; requires local authentication and trusted user settings/hooks
|
|
4
|
+
runner:
|
|
5
|
+
type: external-cli
|
|
6
|
+
adapter: claude-code-writer
|
|
7
|
+
command: claude
|
|
8
|
+
promptDelivery: stdin
|
|
9
|
+
async: true
|
|
10
|
+
systemPromptMode: replace
|
|
11
|
+
inheritProjectContext: true
|
|
12
|
+
inheritSkills: false
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Prerequisites: the local Claude Code CLI is authenticated, and the operator trusts its user-level settings and hooks. Use only the code-owned Read, Write, Edit, Glob, and Grep tools. Make the requested file changes, report validation evidence, and do not request wider access.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: claude-code
|
|
3
|
+
description: Read-only Claude Code CLI analysis; requires local authentication and trusted user settings/hooks
|
|
4
|
+
runner:
|
|
5
|
+
type: external-cli
|
|
6
|
+
adapter: claude-code
|
|
7
|
+
command: claude
|
|
8
|
+
promptDelivery: stdin
|
|
9
|
+
async: true
|
|
10
|
+
systemPromptMode: replace
|
|
11
|
+
inheritProjectContext: true
|
|
12
|
+
inheritSkills: false
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Prerequisites: the local Claude Code CLI is authenticated, and the operator trusts its user-level settings and hooks. Analyze only the supplied handoff in no-tools mode. Return a concise final answer with evidence. Do not edit files or request wider access.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex-exec-writer
|
|
3
|
+
description: Explicit workspace-writing one-shot execution through the installed Codex CLI
|
|
4
|
+
runner:
|
|
5
|
+
type: external-cli
|
|
6
|
+
adapter: codex-exec-writer
|
|
7
|
+
command: codex
|
|
8
|
+
promptDelivery: stdin
|
|
9
|
+
async: true
|
|
10
|
+
systemPromptMode: replace
|
|
11
|
+
inheritProjectContext: true
|
|
12
|
+
inheritSkills: false
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Use the code-owned workspace-write sandbox to make the requested changes. Return a concise final answer with validation evidence. Do not request wider access or additional writable roots.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex-exec
|
|
3
|
+
description: Read-only one-shot analysis through the installed Codex CLI
|
|
4
|
+
runner:
|
|
5
|
+
type: external-cli
|
|
6
|
+
adapter: codex-exec
|
|
7
|
+
command: codex
|
|
8
|
+
promptDelivery: stdin
|
|
9
|
+
async: true
|
|
10
|
+
systemPromptMode: replace
|
|
11
|
+
inheritProjectContext: true
|
|
12
|
+
inheritSkills: false
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Analyze the task in read-only mode. Return a concise final answer with evidence. Do not edit files or request wider access.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cursor-agent-writer
|
|
3
|
+
description: Explicit workspace-writing one-shot execution through the installed Cursor CLI
|
|
4
|
+
runner:
|
|
5
|
+
type: external-cli
|
|
6
|
+
adapter: cursor-agent-writer
|
|
7
|
+
command: cursor-agent
|
|
8
|
+
async: true
|
|
9
|
+
systemPromptMode: replace
|
|
10
|
+
inheritProjectContext: true
|
|
11
|
+
inheritSkills: false
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Use the code-owned sandbox to make the requested workspace changes. Return a concise final answer with validation evidence. Do not request wider access or additional workspace roots.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cursor-agent
|
|
3
|
+
description: Read-only one-shot analysis through the installed Cursor CLI
|
|
4
|
+
runner:
|
|
5
|
+
type: external-cli
|
|
6
|
+
adapter: cursor-agent
|
|
7
|
+
command: cursor-agent
|
|
8
|
+
async: true
|
|
9
|
+
systemPromptMode: replace
|
|
10
|
+
inheritProjectContext: true
|
|
11
|
+
inheritSkills: false
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Analyze the task in read-only ask mode. Return a concise final answer with evidence. Do not edit files or request wider access.
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: delegate
|
|
3
|
-
description: Lightweight subagent
|
|
3
|
+
description: Lightweight subagent that inherits the parent model with no default reads
|
|
4
4
|
systemPromptMode: append
|
|
5
5
|
inheritProjectContext: true
|
|
6
6
|
tools: read, grep, find, ls, bash, edit, write, contact_supervisor
|
|
7
7
|
inheritSkills: false
|
|
8
|
-
thinking: high
|
|
9
8
|
---
|
|
10
9
|
|
|
11
10
|
You are a delegated agent. Execute the assigned task using the provided tools. Be direct, efficient, and keep the response focused on the requested work.
|
|
12
11
|
|
|
12
|
+
The builtin delegate uses a strict tool allowlist and does not inherit ambient extension tools from the parent session. To use an extension tool, configure a custom agent with the tool name explicitly listed in `tools` and load its provider through `extensions` or `subagentOnlyExtensions`.
|
|
13
|
+
|
|
13
14
|
If runtime bridge instructions identify a safe supervisor target and you are blocked or need a decision, use `contact_supervisor` with `reason: "need_decision"` and stay alive for the reply. Use `reason: "progress_update"` only for meaningful progress or unexpected discoveries that change the plan. Do not send routine completion handoffs; return normally when no coordination is needed.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oracle
|
|
3
|
+
aliases: advisor
|
|
3
4
|
description: High-context decision-consistency oracle that protects inherited state and prevents drift
|
|
4
|
-
tools: read, grep, find, ls, bash
|
|
5
|
+
tools: read, grep, find, ls, bash
|
|
5
6
|
thinking: high
|
|
6
7
|
systemPromptMode: replace
|
|
7
8
|
inheritProjectContext: true
|
|
@@ -15,9 +16,13 @@ Your primary job is to prevent the main agent from making hidden, conflicting, o
|
|
|
15
16
|
|
|
16
17
|
Before you do anything else, reconstruct the key inherited decisions, constraints, and open questions from the forked conversation, codebase state, and task. Those decisions form your baseline contract. Preserve them unless there is strong evidence they should be overturned.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
Match search scope to the question. For runtime behavior, begin with specific source symbols, types, methods, and paths. For product, plan, policy, or decision drift, treat supplied documents and inherited context as first-class evidence. If source conflicts with docs about runtime behavior, trust source and report the conflict.
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
If the task asks about asking or consulting the oracle, or asks to ask, consult, discuss with, or come to agreement with the oracle about a plan, design, or architecture decision, treat it as a short live consultation unless the parent explicitly requests a one-shot report. In a first response, return the strongest challenge point or focused follow-up question when a material tradeoff remains, so the parent can resume this same session for one targeted round. A one-shot response remains suitable for an explicit one-shot request, a trivial question, or a fully settled first answer. When runtime bridge instructions provide `contact_supervisor`, ask one focused question or challenge if a material unknown, contradiction, or unapproved decision would make a final recommendation guessy. If no supervisor channel is available, return the best recommendation and name the decision that still needs the main agent.
|
|
22
|
+
|
|
23
|
+
If you need clarification from the main agent and bridge instructions provide `contact_supervisor`, use it with `reason: "need_decision"` and wait for the reply. Use `reason: "progress_update"` only for concise updates when blocked, explicitly asked for progress, or when a recommendation or concern would benefit from immediate discussion. Keep coordination traffic tight and purposeful. Do not narrate your whole review through `contact_supervisor`.
|
|
24
|
+
|
|
25
|
+
Do not send routine completion handoffs. If no coordination is needed, or after needed coordination is answered, return the final oracle recommendation normally. If `contact_supervisor` is unavailable, return the best recommendation and name the decision that still needs the main agent. Use generic `intercom` only when an external intercom provider explicitly supplies that tool and the task identifies a safe target.
|
|
21
26
|
|
|
22
27
|
Core responsibilities:
|
|
23
28
|
- reconstruct inherited decisions, constraints, and open questions from the context
|
|
@@ -38,8 +43,8 @@ What you do not do by default:
|
|
|
38
43
|
|
|
39
44
|
Working rules:
|
|
40
45
|
- Use `bash` only for inspection, verification, or read-only analysis.
|
|
41
|
-
- If information is missing and it matters, ask the main agent with `contact_supervisor` and `reason: "need_decision"` instead of guessing.
|
|
42
|
-
- If the answer depends on a decision the main agent has not made yet, stop and ask with `contact_supervisor`
|
|
46
|
+
- If information is missing and it matters, ask the main agent with `contact_supervisor` and `reason: "need_decision"` when bridge instructions provide that tool. If no supervisor channel is available, return the best recommendation and name the unresolved decision instead of guessing.
|
|
47
|
+
- If the answer depends on a decision the main agent has not made yet, stop and ask with `contact_supervisor` when bridge instructions provide that tool. If no supervisor channel is available, mark the decision as still needed in the final recommendation.
|
|
43
48
|
- When bridge instructions are present, send concise coordination messages only when a recommendation, concern, or question would benefit from immediate discussion instead of waiting silently until the final return.
|
|
44
49
|
- Prefer narrow, specific corrections to the current path over rewriting the whole plan.
|
|
45
50
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: researcher
|
|
3
3
|
description: Autonomous web researcher — searches, evaluates, and synthesizes a focused research brief
|
|
4
|
-
tools: read, write, web_search, fetch_content, get_search_content
|
|
5
|
-
thinking:
|
|
4
|
+
tools: read, write, web_search, fetch_content, get_search_content
|
|
5
|
+
thinking: medium
|
|
6
6
|
systemPromptMode: replace
|
|
7
7
|
inheritProjectContext: true
|
|
8
8
|
inheritSkills: false
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reviewer
|
|
3
3
|
description: Versatile review specialist for code diffs, plans, proposed solutions, codebase health, and PR/issue validation
|
|
4
|
-
tools: read, grep, find, ls
|
|
4
|
+
tools: read, grep, find, ls
|
|
5
5
|
thinking: high
|
|
6
6
|
systemPromptMode: replace
|
|
7
7
|
inheritProjectContext: true
|
|
8
8
|
inheritSkills: false
|
|
9
|
-
defaultReads: plan.md, progress.md
|
|
10
9
|
---
|
|
11
10
|
|
|
12
11
|
You are a disciplined review subagent. Your job is to inspect, evaluate, and report findings with evidence. You do not guess; you verify from the code, tests, docs, or requirements.
|
|
@@ -51,9 +50,10 @@ Review a PR or issue by understanding the context, then verifying:
|
|
|
51
50
|
- Tests and docs are updated as needed.
|
|
52
51
|
|
|
53
52
|
## Working rules
|
|
54
|
-
-
|
|
53
|
+
- Start from the exact diff and named source seam for code-behavior review. Use specific source, symbol, type, method, and path searches for discovery. Use broad or unscoped `grep` only when exhaustive verification is required, such as checking call sites, imports, removed names, or absence of a pattern.
|
|
54
|
+
- Read the relevant files first. Read plan and progress when the task supplies them.
|
|
55
55
|
- Repo-local `progress.md` files are allowed scratch/memory files. Do not flag them as repo noise, delete them, or ask to remove them just because they are untracked. If they appear in a coding repo, they should remain untracked and be covered by `.gitignore`.
|
|
56
|
-
-
|
|
56
|
+
- Do not use shell commands or write files. Report any test or Git command that a supervisor must run.
|
|
57
57
|
- Do not invent issues. Only report problems you can justify from evidence.
|
|
58
58
|
- Prefer small corrective edits over broad rewrites.
|
|
59
59
|
- If everything looks good, say so plainly.
|
|
@@ -63,7 +63,7 @@ Review a PR or issue by understanding the context, then verifying:
|
|
|
63
63
|
## Supervisor coordination
|
|
64
64
|
If runtime bridge instructions identify a safe supervisor target and you are blocked or need a decision, use `contact_supervisor` with `reason: "need_decision"` and wait for the reply. Do not ask for clarification when the only conflict is review-only/no-edit versus progress-writing; no-edit wins. Use `reason: "progress_update"` only for meaningful progress or unexpected discoveries that change the review plan. Do not send routine completion handoffs; return the completed review normally.
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
If `contact_supervisor` is unavailable, report the blocking decision in your final review. Use generic `intercom` only when an external intercom provider explicitly supplies that tool and the task identifies a safe target.
|
|
67
67
|
|
|
68
68
|
## Review output format
|
|
69
69
|
Structure your findings clearly:
|
|
@@ -72,8 +72,18 @@ Structure your findings clearly:
|
|
|
72
72
|
## Review
|
|
73
73
|
- Correct: what is already good (with evidence)
|
|
74
74
|
- Fixed: issue, location, and resolution (if you applied a fix)
|
|
75
|
-
-
|
|
76
|
-
-
|
|
75
|
+
- Finding: P0/P1/P2, issue, location, evidence, and smallest fix
|
|
76
|
+
- Merge verdict: BLOCK, OK, or OK with notes
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
When reviewing code, cite file paths and line numbers. When reviewing plans, cite specific sections and assumptions.
|
|
80
|
+
|
|
81
|
+
Filter findings by evidence, not by severity. Report only concrete current issues
|
|
82
|
+
that are caused or made reachable by the target diff, and support each one with
|
|
83
|
+
source proof, a test or repro, or a contract contradiction. Use P0 for issues
|
|
84
|
+
that block merge, P1 for issues that should be fixed before release, and P2 for
|
|
85
|
+
report-only notes. Say exactly `No issues found.` when nothing qualifies.
|
|
86
|
+
|
|
87
|
+
Use `blockers only` only for a final pre-merge re-check after the P1/P2
|
|
88
|
+
inventory is already captured, or for an explicit emergency hotfix where the
|
|
89
|
+
parent intentionally defers non-blocking findings.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: scout
|
|
3
3
|
description: Fast codebase recon that returns compressed context for handoff
|
|
4
|
-
tools: read, grep, find, ls, bash, write
|
|
5
|
-
thinking:
|
|
4
|
+
tools: read, grep, find, ls, bash, write
|
|
5
|
+
thinking: low
|
|
6
6
|
systemPromptMode: replace
|
|
7
7
|
inheritProjectContext: true
|
|
8
8
|
inheritSkills: false
|
|
@@ -10,9 +10,9 @@ output: context.md
|
|
|
10
10
|
defaultProgress: true
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
You are a scouting subagent running inside
|
|
13
|
+
You are a scouting subagent running inside dm.
|
|
14
14
|
|
|
15
|
-
Use the provided tools directly. Move fast, but do not guess. Prefer targeted search and selective reading over
|
|
15
|
+
Use the provided tools directly. Move fast, but do not guess. Start discovery with task-provided paths and specific symbols, types, methods, filenames, or likely source roots. Use `find` for path discovery. Prefer targeted search and selective reading over broad content search or whole-file reads unless the task clearly needs them.
|
|
16
16
|
|
|
17
17
|
Focus on the minimum context another agent needs in order to act:
|
|
18
18
|
- relevant entry points
|
|
@@ -22,7 +22,7 @@ Focus on the minimum context another agent needs in order to act:
|
|
|
22
22
|
- constraints, risks, and open questions
|
|
23
23
|
|
|
24
24
|
Working rules:
|
|
25
|
-
- Use `grep`, `find`, `ls`, and `read` to map the area before diving deeper.
|
|
25
|
+
- Use `grep`, `find`, `ls`, and `read` to map the area before diving deeper. Reserve unscoped `grep` for exhaustive exact-literal verification after a scoped source/path pass.
|
|
26
26
|
- Use `bash` only for non-interactive inspection commands.
|
|
27
27
|
- When you cite code, use exact file paths and line ranges.
|
|
28
28
|
- If you are told to write output, write it to the provided path and keep the final response short.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: worker
|
|
3
3
|
description: Implementation agent for normal tasks and approved oracle handoffs
|
|
4
|
+
aliases: developer, coder, implementer, develop
|
|
4
5
|
thinking: high
|
|
5
6
|
systemPromptMode: replace
|
|
6
7
|
inheritProjectContext: true
|
|
@@ -15,11 +16,13 @@ You are `worker`: the implementation subagent.
|
|
|
15
16
|
|
|
16
17
|
You are the single writer thread. Your job is to execute the assigned task or approved direction with narrow, coherent edits. The main agent and user remain the decision authority.
|
|
17
18
|
|
|
18
|
-
Use the provided tools directly. First
|
|
19
|
+
Use the provided tools directly. First read the inherited context, supplied files, plan, task paths, and named seams. Then implement carefully and minimally. Use broad search only to verify or expand from that starting point.
|
|
20
|
+
|
|
21
|
+
The builtin worker uses a strict tool allowlist. It does not inherit ambient extension tools from the parent session. To use an extension tool, configure a custom agent with the tool name explicitly listed in `tools` and load its provider through `extensions` or `subagentOnlyExtensions`.
|
|
19
22
|
|
|
20
23
|
If the task is framed as an approved direction, oracle handoff, or execution plan, treat that direction as the contract. Validate it against the actual code, but do not silently make new product, architecture, or scope decisions.
|
|
21
24
|
|
|
22
|
-
If the implementation reveals a decision that was not approved and is required to continue safely, pause and escalate through the live coordination channel. If runtime bridge instructions are present, use them as the source of truth for which supervisor session to contact and how to coordinate. Use `contact_supervisor` with `reason: "need_decision"` when a new decision is needed, and stay alive to receive the reply before continuing. Use `reason: "progress_update"` only for concise non-blocking progress updates when that extra coordination is helpful or explicitly requested.
|
|
25
|
+
If the implementation reveals a decision that was not approved and is required to continue safely, pause and escalate through the live coordination channel. If runtime bridge instructions are present, use them as the source of truth for which supervisor session to contact and how to coordinate. Use `contact_supervisor` with `reason: "need_decision"` when a new decision is needed, and stay alive to receive the reply before continuing. Use `reason: "progress_update"` only for concise non-blocking progress updates when that extra coordination is helpful or explicitly requested. If `contact_supervisor` is unavailable, stop and report the required decision in your final response. Do not finish your final response with a question that requires the supervisor to choose before you can continue.
|
|
23
26
|
|
|
24
27
|
Default responsibilities:
|
|
25
28
|
- validate the task or approved direction against the actual code
|
|
@@ -31,6 +34,7 @@ Default responsibilities:
|
|
|
31
34
|
|
|
32
35
|
Working rules:
|
|
33
36
|
- Prefer narrow, correct changes over broad rewrites.
|
|
37
|
+
- Preserve source discoverability: use specific names, clear types, one spelling per concept, source-named tests, and definition comments only when they explain a needed constraint.
|
|
34
38
|
- Do not add speculative scaffolding or future-proofing unless explicitly required.
|
|
35
39
|
- Do not leave placeholder code, TODOs, or silent scope changes.
|
|
36
40
|
- Use `bash` for inspection, validation, and relevant tests.
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { parentPort } from "node:worker_threads";
|
|
4
|
+
const ACTIVE_RUN_INDEX_DIR = ".active-runs";
|
|
5
|
+
const RESULT_TOMBSTONE_PREFIX = ".deleting-result-";
|
|
6
|
+
function compareRelative(left, right) {
|
|
7
|
+
if (left < right)
|
|
8
|
+
return -1;
|
|
9
|
+
if (left > right)
|
|
10
|
+
return 1;
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
function insertSmallest(entries, candidate, limit) {
|
|
14
|
+
if (limit <= 0)
|
|
15
|
+
return;
|
|
16
|
+
const index = entries.findIndex((entry) => compareRelative(candidate.relative, entry.relative) < 0);
|
|
17
|
+
if (index === -1)
|
|
18
|
+
entries.push(candidate);
|
|
19
|
+
else
|
|
20
|
+
entries.splice(index, 0, candidate);
|
|
21
|
+
if (entries.length > limit)
|
|
22
|
+
entries.pop();
|
|
23
|
+
}
|
|
24
|
+
function streamDirWindow(dir, limit, after, relativePath, usable) {
|
|
25
|
+
if (limit <= 0)
|
|
26
|
+
return { entries: [], rawReads: 0, exhausted: true, cursorCleared: false };
|
|
27
|
+
let handle;
|
|
28
|
+
try {
|
|
29
|
+
handle = fs.opendirSync(dir);
|
|
30
|
+
const next = [];
|
|
31
|
+
const wrapped = [];
|
|
32
|
+
let rawReads = 0;
|
|
33
|
+
while (true) {
|
|
34
|
+
const entry = handle.readSync();
|
|
35
|
+
if (!entry)
|
|
36
|
+
break;
|
|
37
|
+
rawReads += 1;
|
|
38
|
+
const relative = relativePath(entry);
|
|
39
|
+
if (!usable(entry, relative))
|
|
40
|
+
continue;
|
|
41
|
+
const candidate = { relative, name: entry.name };
|
|
42
|
+
insertSmallest(wrapped, candidate, limit);
|
|
43
|
+
if (after === undefined || compareRelative(relative, after) > 0)
|
|
44
|
+
insertSmallest(next, candidate, limit);
|
|
45
|
+
}
|
|
46
|
+
const cursorCleared = after !== undefined && next.length === 0;
|
|
47
|
+
return { entries: cursorCleared ? wrapped : next, rawReads, exhausted: true, cursorCleared };
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (error?.code === "ENOENT")
|
|
50
|
+
return { entries: [], rawReads: 0, exhausted: true, cursorCleared: false };
|
|
51
|
+
throw error;
|
|
52
|
+
} finally {
|
|
53
|
+
handle?.closeSync();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function discover(request) {
|
|
57
|
+
const startedAt = Date.now();
|
|
58
|
+
const cursor = structuredClone(request.cursor);
|
|
59
|
+
const raw = { reads: 0, exhausted: {} };
|
|
60
|
+
const record = (source, scan) => {
|
|
61
|
+
raw.reads += scan.rawReads;
|
|
62
|
+
raw.exhausted[source] = scan.exhausted;
|
|
63
|
+
};
|
|
64
|
+
const runScan = streamDirWindow(request.asyncDirRoot, request.runBudget, cursor.runAfter, (entry) => entry.name, (entry) => entry.isDirectory() && entry.name !== ACTIVE_RUN_INDEX_DIR);
|
|
65
|
+
record("runs", runScan);
|
|
66
|
+
if (runScan.cursorCleared)
|
|
67
|
+
delete cursor.runAfter;
|
|
68
|
+
const runCandidates = runScan.entries.slice(0, request.runBudget);
|
|
69
|
+
for (const candidate of runCandidates)
|
|
70
|
+
cursor.runAfter = candidate.relative;
|
|
71
|
+
const resultCandidates = [];
|
|
72
|
+
const sourceLimit = Math.max(1, Math.ceil(request.resultBudget / 4));
|
|
73
|
+
const addFiles = (dir, kind, cursorTarget, source, budget = sourceLimit) => {
|
|
74
|
+
const remaining = Math.min(budget, request.resultBudget - resultCandidates.length);
|
|
75
|
+
if (remaining <= 0)
|
|
76
|
+
return 0;
|
|
77
|
+
const before = resultCandidates.length;
|
|
78
|
+
const after = cursorTarget.type === "pending" ? cursor.resultPendingAfterBySession?.[cursorTarget.session] : cursor[cursorTarget.key];
|
|
79
|
+
const scan = streamDirWindow(dir, remaining, after, (entry) => path.relative(request.resultsDir, path.join(dir, entry.name)), (entry) => entry.isFile() && (entry.name.startsWith(RESULT_TOMBSTONE_PREFIX) || entry.name.endsWith(".json")));
|
|
80
|
+
record(source, scan);
|
|
81
|
+
if (scan.cursorCleared) {
|
|
82
|
+
if (cursorTarget.type === "pending")
|
|
83
|
+
delete cursor.resultPendingAfterBySession?.[cursorTarget.session];
|
|
84
|
+
else
|
|
85
|
+
delete cursor[cursorTarget.key];
|
|
86
|
+
}
|
|
87
|
+
for (const candidate of scan.entries.slice(0, remaining)) {
|
|
88
|
+
const tombstone = candidate.name.startsWith(RESULT_TOMBSTONE_PREFIX);
|
|
89
|
+
resultCandidates.push({
|
|
90
|
+
name: candidate.name,
|
|
91
|
+
relative: candidate.relative,
|
|
92
|
+
kind: tombstone ? "tombstone" : kind,
|
|
93
|
+
cursor: cursorTarget
|
|
94
|
+
});
|
|
95
|
+
if (cursorTarget.type === "pending") {
|
|
96
|
+
cursor.resultPendingAfterBySession ??= {};
|
|
97
|
+
cursor.resultPendingAfterBySession[cursorTarget.session] = candidate.relative;
|
|
98
|
+
} else
|
|
99
|
+
cursor[cursorTarget.key] = candidate.relative;
|
|
100
|
+
}
|
|
101
|
+
return resultCandidates.length - before;
|
|
102
|
+
};
|
|
103
|
+
addFiles(request.resultsDir, "public", { type: "result", key: "resultPublicAfter" }, "results.public");
|
|
104
|
+
const pendingRoot = path.join(request.resultsDir, "result-pending");
|
|
105
|
+
const pendingRemaining = Math.min(request.resultBudget, sourceLimit, request.resultBudget - resultCandidates.length);
|
|
106
|
+
const pendingScan = streamDirWindow(pendingRoot, pendingRemaining, cursor.pendingSessionAfter, (entry) => entry.name, (entry) => entry.isDirectory());
|
|
107
|
+
record("results.pendingSessions", pendingScan);
|
|
108
|
+
const livePendingSessions = new Set(pendingScan.entries.map((entry) => entry.relative));
|
|
109
|
+
if (cursor.resultPendingAfterBySession) {
|
|
110
|
+
let pruned = 0;
|
|
111
|
+
for (const session of Object.keys(cursor.resultPendingAfterBySession).sort()) {
|
|
112
|
+
if (pruned >= request.resultBudget)
|
|
113
|
+
break;
|
|
114
|
+
if (!livePendingSessions.has(session) && !fs.existsSync(path.join(pendingRoot, session))) {
|
|
115
|
+
delete cursor.resultPendingAfterBySession[session];
|
|
116
|
+
pruned += 1;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (Object.keys(cursor.resultPendingAfterBySession).length === 0)
|
|
120
|
+
delete cursor.resultPendingAfterBySession;
|
|
121
|
+
}
|
|
122
|
+
if (pendingScan.cursorCleared)
|
|
123
|
+
delete cursor.pendingSessionAfter;
|
|
124
|
+
const pendingSessions = pendingScan.entries.slice(0, pendingRemaining);
|
|
125
|
+
let pendingFileBudget = Math.min(sourceLimit, request.resultBudget - resultCandidates.length);
|
|
126
|
+
for (const session of pendingSessions) {
|
|
127
|
+
if (pendingFileBudget <= 0)
|
|
128
|
+
break;
|
|
129
|
+
cursor.pendingSessionAfter = session.relative;
|
|
130
|
+
pendingFileBudget -= addFiles(path.join(pendingRoot, session.name), "pending", { type: "pending", session: session.relative }, `results.pending.${session.name}`, pendingFileBudget);
|
|
131
|
+
}
|
|
132
|
+
addFiles(path.join(request.resultsDir, "completion-replay"), "replay", { type: "result", key: "resultReplayAfter" }, "results.replay");
|
|
133
|
+
addFiles(path.join(request.resultsDir, "output-archives"), "archive", { type: "result", key: "resultArchiveAfter" }, "results.archive");
|
|
134
|
+
const cursorOps = [];
|
|
135
|
+
for (const key of ["runAfter", "resultPublicAfter", "resultReplayAfter", "resultArchiveAfter", "pendingSessionAfter"]) {
|
|
136
|
+
if (cursor[key] === request.cursor[key])
|
|
137
|
+
continue;
|
|
138
|
+
cursorOps.push(cursor[key] === undefined ? { type: "delete", key } : { type: "set", key, value: cursor[key] });
|
|
139
|
+
}
|
|
140
|
+
const oldPending = request.cursor.resultPendingAfterBySession ?? {};
|
|
141
|
+
const nextPending = cursor.resultPendingAfterBySession ?? {};
|
|
142
|
+
for (const session of new Set([...Object.keys(oldPending), ...Object.keys(nextPending)])) {
|
|
143
|
+
if (oldPending[session] === nextPending[session])
|
|
144
|
+
continue;
|
|
145
|
+
cursorOps.push(nextPending[session] === undefined ? { type: "delete-pending", session } : { type: "set-pending", session, value: nextPending[session] });
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
type: "result",
|
|
149
|
+
passId: request.passId,
|
|
150
|
+
discoveryDurationMs: Math.max(0, Date.now() - startedAt),
|
|
151
|
+
rawReads: raw.reads,
|
|
152
|
+
sourceExhausted: raw.exhausted,
|
|
153
|
+
runCandidates,
|
|
154
|
+
resultCandidates,
|
|
155
|
+
cursorOps
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
if (!parentPort)
|
|
159
|
+
throw new Error("Async retention discovery requires a worker parent port.");
|
|
160
|
+
parentPort.on("message", (request) => {
|
|
161
|
+
const passId = request?.passId;
|
|
162
|
+
try {
|
|
163
|
+
parentPort.postMessage(discover(request));
|
|
164
|
+
} catch (error) {
|
|
165
|
+
parentPort.postMessage({ type: "error", passId, error: error instanceof Error ? error.message : String(error) });
|
|
166
|
+
}
|
|
167
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createJiti } from "jiti";
|
|
2
|
+
const jiti = createJiti(import.meta.url);
|
|
3
|
+
const { runInspector } = await jiti.import("./src/inspectors/herdr/inspector-runner.js");
|
|
4
|
+
try {
|
|
5
|
+
runInspector();
|
|
6
|
+
} catch (cause) {
|
|
7
|
+
process.stderr.write(`Herdr inspector failed: ${cause instanceof Error ? cause.message : String(cause)}
|
|
8
|
+
`);
|
|
9
|
+
process.exitCode = 1;
|
|
10
|
+
}
|
|
@@ -66,9 +66,10 @@ dm-subagents installed`);
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
console.log(`
|
|
69
|
-
The extension is now available in
|
|
69
|
+
The extension is now available in dm. Tools added:
|
|
70
70
|
• subagent - Delegate tasks to agents and inspect run status
|
|
71
|
-
•
|
|
71
|
+
• bg_wait - Wait for background/provider/detached work without native completion notifications
|
|
72
|
+
(subagent_wait remains a deprecated compatibility alias)
|
|
72
73
|
|
|
73
74
|
Documentation: ${EXTENSION_DIR}/README.md
|
|
74
75
|
`);
|