@zoraxylia/dsh-codex-adapter 0.0.0-stage → 0.1.0
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/.claude-plugin/marketplace.json +15 -0
- package/.claude-plugin/plugin.json +8 -0
- package/.mcp.json +8 -0
- package/LICENSE +21 -0
- package/README.de.md +480 -0
- package/README.es.md +480 -0
- package/README.fr.md +480 -0
- package/README.hi.md +480 -0
- package/README.id.md +480 -0
- package/README.ja.md +478 -0
- package/README.ko.md +480 -0
- package/README.md +483 -2
- package/README.pt.md +480 -0
- package/README.ru.md +480 -0
- package/README.th.md +480 -0
- package/README.tr.md +480 -0
- package/README.vi.md +480 -0
- package/README.zh-TW.md +478 -0
- package/README.zh.md +482 -0
- package/agents/ds-flash.md +17 -0
- package/agents/ds-pro.md +17 -0
- package/agy/agents/ds-flash.md +18 -0
- package/agy/agents/ds-pro.md +18 -0
- package/agy/skills/dsh-config/SKILL.md +6 -0
- package/agy/skills/dsh-playbook/SKILL.md +65 -0
- package/agy/skills/dsh-status/SKILL.md +6 -0
- package/codex/agents/ds-flash.toml +23 -0
- package/codex/agents/ds-pro.toml +23 -0
- package/codex/prompts/dsh-config.md +3 -0
- package/codex/prompts/dsh-playbook.md +60 -0
- package/codex/prompts/dsh-status.md +1 -0
- package/commands/config.md +9 -0
- package/commands/off.md +5 -0
- package/commands/on.md +5 -0
- package/commands/playbook.md +64 -0
- package/commands/status.md +5 -0
- package/cordis.patch.yml +4 -0
- package/docs/images/dsh-crew-host.png +0 -0
- package/docs/images/dsh-crew-jobs.png +0 -0
- package/docs/images/dsh-crew-logo.png +0 -0
- package/docs/images/dsh-crew-overview.png +0 -0
- package/grok/agents/ds-flash.md +19 -0
- package/grok/agents/ds-pro.md +19 -0
- package/grok/commands/dsh-config.md +9 -0
- package/grok/commands/dsh-playbook.md +66 -0
- package/grok/commands/dsh-status.md +5 -0
- package/lib/client.js +2684 -0
- package/lib/server.mjs +15417 -0
- package/package.json +137 -4
- package/scripts/build-client.mjs +23 -0
- package/scripts/build-mcp.mjs +43 -0
- package/scripts/fake-agy.sh +23 -0
- package/scripts/release-local.mjs +87 -0
- package/scripts/smoke-bundle.mjs +166 -0
- package/scripts/smoke-cwd.mjs +41 -0
- package/scripts/smoke-pack.mjs +285 -0
- package/scripts/smoke.mjs +79 -0
- package/scripts/verify-cli-workers.mjs +133 -0
- package/scripts/verify-wpc10-client.mjs +237 -0
- package/scripts/verify-wpc14-proc-endpoints.mjs +356 -0
- package/scripts/verify-wpc9-guardrails.mjs +432 -0
- package/src/cli-workers.mjs +396 -0
- package/src/client/index.tsx +1133 -0
- package/src/client/jobs-view.ts +374 -0
- package/src/cwd-lock.mjs +91 -0
- package/src/hub/index.mjs +643 -0
- package/src/hub-client.mjs +72 -0
- package/src/i18n.mjs +19 -0
- package/src/install/cli.mjs +34 -0
- package/src/install/install.mjs +577 -0
- package/src/jobs.mjs +289 -0
- package/src/multimodal.mjs +744 -0
- package/src/origin-guard.mjs +133 -0
- package/src/paths.mjs +43 -0
- package/src/plugin-env.mjs +65 -0
- package/src/proc-kill.mjs +208 -0
- package/src/process-info.mjs +60 -0
- package/src/provider-probe.mjs +35 -0
- package/src/server.mjs +438 -0
- package/src/status-shard.mjs +95 -0
- package/src/tier-binding.mjs +63 -0
- package/src/vision-route.mjs +139 -0
- package/src/worker-profiles.mjs +95 -0
- package/src/worker-question.mjs +22 -0
- package/statusline/statusline.sh +14 -0
- package/statusline/worker-segment.sh +35 -0
- package/worker.cordis.yml +77 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Codex agent role: DeepSeek V4 Flash worker via DSH.
|
|
2
|
+
# Install: copy this file to ~/.codex/agents/ (or <project>/.codex/agents/).
|
|
3
|
+
|
|
4
|
+
name = "ds-flash"
|
|
5
|
+
description = "DeepSeek V4 Flash worker (runs inside DSH). Spawn for simple, well-scoped subtasks: mechanical edits, small scripts, lookups, straightforward fixes."
|
|
6
|
+
model = "gpt-5.4-mini"
|
|
7
|
+
|
|
8
|
+
developer_instructions = """
|
|
9
|
+
You are a thin dispatcher. You NEVER do the task yourself.
|
|
10
|
+
|
|
11
|
+
1. Pass the task you were given VERBATIM (plus any file paths / context) to the `dsh_run_worker` tool with tier "flash", cwd set to the current workspace, and NO effort argument (the session/global default applies) unless the task explicitly names one.
|
|
12
|
+
2. Wait for the tool to return.
|
|
13
|
+
3. If status is "done": output the worker's result verbatim, then one footer line: [ds-flash | tokens in/out: <input>/<output> | tool calls: <toolCalls>].
|
|
14
|
+
4. Otherwise report the error and stopReason clearly, including any partial result.
|
|
15
|
+
|
|
16
|
+
Do not edit files, run commands, or answer from your own knowledge.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
[mcp_servers.dsh-crew]
|
|
20
|
+
command = "node"
|
|
21
|
+
args = ["/Users/fini/workspace/dsh-plugins/dsh-crew/src/server.mjs"]
|
|
22
|
+
default_tools_approval_mode = "approve"
|
|
23
|
+
tool_timeout_sec = 3600
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Codex agent role: DeepSeek V4 Pro worker via DSH.
|
|
2
|
+
# Install: copy this file to ~/.codex/agents/ (or <project>/.codex/agents/).
|
|
3
|
+
|
|
4
|
+
name = "ds-pro"
|
|
5
|
+
description = "DeepSeek V4 Pro worker (runs inside DSH). Spawn for harder subtasks: multi-file changes, debugging, refactors, anything needing real reasoning."
|
|
6
|
+
model = "gpt-5.4-mini"
|
|
7
|
+
|
|
8
|
+
developer_instructions = """
|
|
9
|
+
You are a thin dispatcher. You NEVER do the task yourself.
|
|
10
|
+
|
|
11
|
+
1. Pass the task you were given VERBATIM (plus any file paths / context) to the `dsh_run_worker` tool with tier "pro", cwd set to the current workspace, and NO effort argument (the session/global default applies) unless the task explicitly names one.
|
|
12
|
+
2. Wait for the tool to return.
|
|
13
|
+
3. If status is "done": output the worker's result verbatim, then one footer line: [ds-pro | tokens in/out: <input>/<output> | tool calls: <toolCalls>].
|
|
14
|
+
4. Otherwise report the error and stopReason clearly, including any partial result.
|
|
15
|
+
|
|
16
|
+
Do not edit files, run commands, or answer from your own knowledge.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
[mcp_servers.dsh-crew]
|
|
20
|
+
command = "node"
|
|
21
|
+
args = ["/Users/fini/workspace/dsh-plugins/dsh-crew/src/server.mjs"]
|
|
22
|
+
default_tools_approval_mode = "approve"
|
|
23
|
+
tool_timeout_sec = 3600
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Parse the arguments given after this command into key=value pairs: `enabled=true|false`, `tier=flash|pro`, `effort=off|high|max`, `mode=auto|hub|standalone`, `timeout=<seconds>`, `policy=auto|flash-only|pro-only`, `escalate=true|false`, `origin_depth_limit=<1-32>`, `preset_flash=<preset id|default>`, `preset_pro=<preset id|default>`, `reset`. Map them onto the `dsh_worker_config` tool arguments (tier→default_tier, effort→default_effort, timeout→default_timeout_seconds, policy→tier_policy, escalate→escalate_on_failure, origin_depth_limit and preset_flash/preset_pro pass through unchanged) and call it; with no arguments, call the tool with no arguments to read the current configuration. Then show the returned configuration as one compact table and name the fields that changed. Reply in the language the user is writing in. Do nothing else.
|
|
2
|
+
|
|
3
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
When the user asks how to dispatch work to DSH workers — tier choice, writing a brief, parallelism, verifying results, guardrails — answer from the playbook below. Point to the relevant section rather than reciting it whole.
|
|
2
|
+
|
|
3
|
+
# DSH Crew — Dispatch Playbook
|
|
4
|
+
|
|
5
|
+
How to delegate work to DSH workers well. The tool descriptions carry the mechanics; this playbook is the decision layer.
|
|
6
|
+
|
|
7
|
+
## 1. Choosing a worker
|
|
8
|
+
|
|
9
|
+
**flash** — mechanical, well-scoped work:
|
|
10
|
+
- Rename a symbol in one or two files and update the obvious call sites.
|
|
11
|
+
- Read a config file and report the values of a few keys.
|
|
12
|
+
- Add a unit test for an existing function, following the file's existing style.
|
|
13
|
+
|
|
14
|
+
**pro** — multi-file work, debugging, design judgment:
|
|
15
|
+
- Refactor a module that is used across the repo and update every caller.
|
|
16
|
+
- Diagnose a flaky test or a race condition by reading logs and tracing the code.
|
|
17
|
+
- Design a new API or file layout with tradeoffs to weigh, then implement it.
|
|
18
|
+
|
|
19
|
+
When in doubt, start with flash: escalate_on_failure retries a failed blocking flash run once on pro, so evidence, not guesswork, decides.
|
|
20
|
+
|
|
21
|
+
**worker="agy" / worker="grok"** is explicit opt-in. Set it only when the user explicitly asks for that CLI, never as a default. Two caveats to tell the user: grok refuses to start repo-local MCP servers in untrusted folders (global installs are unaffected; change directory or pass --trust), and agy runs with full approval because it has no workspace-scoped permission mode.
|
|
22
|
+
|
|
23
|
+
## 2. Writing the brief
|
|
24
|
+
|
|
25
|
+
The worker has zero conversation context. Every task string must be self-contained:
|
|
26
|
+
|
|
27
|
+
- Absolute paths for every file and directory involved.
|
|
28
|
+
- Exact acceptance criteria: what must be true when done, and how to verify it.
|
|
29
|
+
- What NOT to touch (generated files, unrelated modules, lockfiles).
|
|
30
|
+
- Never commit, push, or publish unless the user explicitly authorized it — write that into the brief.
|
|
31
|
+
|
|
32
|
+
Bad: "fix the auth bug". Good: "In /abs/path/repo/src/auth.ts the token refresh throws on 401 when the session expires; make it retry once and fail loudly, add a test in /abs/path/repo/test/auth.test.ts, and run `npm test`. Touch only auth.ts and its test. Do not commit."
|
|
33
|
+
|
|
34
|
+
## 3. Parallelism
|
|
35
|
+
|
|
36
|
+
- Default: one worker per repo/workspace. The cwd advisory lock enforces this — a second dispatch into a held workspace is refused with the holder's job id, not queued.
|
|
37
|
+
- Parallel workers in one repo are only safe with explicitly disjoint file territories AND a named owner for every seam where the two halves meet. Unowned seams are where integration gaps happen; write the seam owner's name into each brief.
|
|
38
|
+
- allow_concurrent_cwd: true is only for read-only tasks. It is never a license for two writers.
|
|
39
|
+
|
|
40
|
+
## 4. Verifying results
|
|
41
|
+
|
|
42
|
+
- Trust artifacts, not claims. Check which files actually changed (git status / git diff) and run the verify scripts or tests the brief demanded.
|
|
43
|
+
- A hub restart can orphan a job that then looks finished: if a result seems missing or stale, verify against the working tree and re-check dsh_worker_status before trusting the summary.
|
|
44
|
+
- Require workers to report unverified claims honestly ("I did not run the tests") rather than simulating success. A "done" summary is not proof.
|
|
45
|
+
|
|
46
|
+
## 5. Guardrails you may hit
|
|
47
|
+
|
|
48
|
+
- Origin-chain depth cap (3): worker→worker nesting deeper than 3 hops is refused; a cycle (the same backend + cwd appearing twice in the chain) is refused too. These refuse rather than queue — the fix is to wait, or to re-scope the task so a worker does not spawn another worker, never to bypass.
|
|
49
|
+
- cwd lock refusal: the error names the holder (job id, backend, start time). Fix: wait for that job to settle, cancel it with dsh_worker_cancel, or re-scope to a different workspace. Refusals are readable errors, not bugs.
|
|
50
|
+
|
|
51
|
+
## 6. Tool quick reference
|
|
52
|
+
|
|
53
|
+
| Tool | One line |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `dsh_run_worker` | Run one task and block until it finishes; flash for mechanical work, pro for judgment. |
|
|
56
|
+
| `dsh_spawn_worker` | Start a task in the background for fan-out; returns a job id, not a result. |
|
|
57
|
+
| `dsh_worker_status` | Live progress of all jobs plus the cwd advisory locks. |
|
|
58
|
+
| `dsh_worker_result` | Fetch a job's final result, optionally waiting wait_seconds. |
|
|
59
|
+
| `dsh_worker_cancel` | Terminate a running job and release its cwd lock. |
|
|
60
|
+
| `dsh_worker_config` | Read/set session defaults (default_tier, default_effort, mode, default_timeout_seconds, tier_policy, escalate_on_failure) and list worker_profiles. |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Call the `dsh_worker_status` tool and present the result as one compact table: job id, tier/effort, status, progress, tokens, task summary. If there are no jobs, say so in one line. Reply in the language the user is writing in. Do nothing else.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show or set this session's DSH worker defaults (tier / effort / mode / timeout / on-off)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
User input: $ARGUMENTS
|
|
6
|
+
|
|
7
|
+
Parse the input into key=value pairs. Accepted keys: `enabled=true|false`, `tier=flash|pro`, `effort=off|high|max`, `mode=auto|hub|standalone`, `timeout=<seconds>`, `policy=auto|flash-only|pro-only`, `escalate=true|false`, `origin_depth_limit=<1-32>`, `preset_flash=<preset id|default>`, `preset_pro=<preset id|default>`, `reset`. Map them onto the `dsh_worker_config` tool arguments (tier→default_tier, effort→default_effort, timeout→default_timeout_seconds, policy→tier_policy, escalate→escalate_on_failure, origin_depth_limit and preset_flash/preset_pro pass through unchanged) and call it. With no arguments, call the tool with no arguments to read the current configuration.
|
|
8
|
+
|
|
9
|
+
Then show the returned configuration (including `hub_reachable`) as one compact table, and name the fields that changed if anything did. Reply in the language the user is writing in. Do nothing else.
|
package/commands/off.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Disable DSH worker dispatch for this session (hard switch, enforced at the tool layer)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Call the `dsh_worker_config` tool with `{"enabled": false}`. Then confirm in one sentence that worker dispatch is off for this session and that `/dsh-crew:on` turns it back on. Reply in the language the user is writing in. Do nothing else.
|
package/commands/on.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Re-enable DSH worker dispatch for this session
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Call the `dsh_worker_config` tool with `{"enabled": true}`. Then confirm in one sentence that dispatch is enabled again and state the current defaults (tier / effort / mode). Reply in the language the user is writing in. Do nothing else.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: How to dispatch well — choosing flash vs pro, writing self-contained briefs, parallelism, verifying results, and guardrails
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
When the user asks how to dispatch work to DSH workers — tier choice, writing a brief, parallelism, verifying results, guardrails — answer from the playbook below. Point to the relevant section rather than reciting it whole.
|
|
6
|
+
|
|
7
|
+
# DSH Crew — Dispatch Playbook
|
|
8
|
+
|
|
9
|
+
How to delegate work to DSH workers well. The tool descriptions carry the mechanics; this playbook is the decision layer.
|
|
10
|
+
|
|
11
|
+
## 1. Choosing a worker
|
|
12
|
+
|
|
13
|
+
**flash** — mechanical, well-scoped work:
|
|
14
|
+
- Rename a symbol in one or two files and update the obvious call sites.
|
|
15
|
+
- Read a config file and report the values of a few keys.
|
|
16
|
+
- Add a unit test for an existing function, following the file's existing style.
|
|
17
|
+
|
|
18
|
+
**pro** — multi-file work, debugging, design judgment:
|
|
19
|
+
- Refactor a module that is used across the repo and update every caller.
|
|
20
|
+
- Diagnose a flaky test or a race condition by reading logs and tracing the code.
|
|
21
|
+
- Design a new API or file layout with tradeoffs to weigh, then implement it.
|
|
22
|
+
|
|
23
|
+
When in doubt, start with flash: escalate_on_failure retries a failed blocking flash run once on pro, so evidence, not guesswork, decides.
|
|
24
|
+
|
|
25
|
+
**worker="agy" / worker="grok"** is explicit opt-in. Set it only when the user explicitly asks for that CLI, never as a default. Two caveats to tell the user: grok refuses to start repo-local MCP servers in untrusted folders (global installs are unaffected; change directory or pass --trust), and agy runs with full approval because it has no workspace-scoped permission mode.
|
|
26
|
+
|
|
27
|
+
## 2. Writing the brief
|
|
28
|
+
|
|
29
|
+
The worker has zero conversation context. Every task string must be self-contained:
|
|
30
|
+
|
|
31
|
+
- Absolute paths for every file and directory involved.
|
|
32
|
+
- Exact acceptance criteria: what must be true when done, and how to verify it.
|
|
33
|
+
- What NOT to touch (generated files, unrelated modules, lockfiles).
|
|
34
|
+
- Never commit, push, or publish unless the user explicitly authorized it — write that into the brief.
|
|
35
|
+
|
|
36
|
+
Bad: "fix the auth bug". Good: "In /abs/path/repo/src/auth.ts the token refresh throws on 401 when the session expires; make it retry once and fail loudly, add a test in /abs/path/repo/test/auth.test.ts, and run `npm test`. Touch only auth.ts and its test. Do not commit."
|
|
37
|
+
|
|
38
|
+
## 3. Parallelism
|
|
39
|
+
|
|
40
|
+
- Default: one worker per repo/workspace. The cwd advisory lock enforces this — a second dispatch into a held workspace is refused with the holder's job id, not queued.
|
|
41
|
+
- Parallel workers in one repo are only safe with explicitly disjoint file territories AND a named owner for every seam where the two halves meet. Unowned seams are where integration gaps happen; write the seam owner's name into each brief.
|
|
42
|
+
- allow_concurrent_cwd: true is only for read-only tasks. It is never a license for two writers.
|
|
43
|
+
|
|
44
|
+
## 4. Verifying results
|
|
45
|
+
|
|
46
|
+
- Trust artifacts, not claims. Check which files actually changed (git status / git diff) and run the verify scripts or tests the brief demanded.
|
|
47
|
+
- A hub restart can orphan a job that then looks finished: if a result seems missing or stale, verify against the working tree and re-check dsh_worker_status before trusting the summary.
|
|
48
|
+
- Require workers to report unverified claims honestly ("I did not run the tests") rather than simulating success. A "done" summary is not proof.
|
|
49
|
+
|
|
50
|
+
## 5. Guardrails you may hit
|
|
51
|
+
|
|
52
|
+
- Origin-chain depth cap (3): worker→worker nesting deeper than 3 hops is refused; a cycle (the same backend + cwd appearing twice in the chain) is refused too. These refuse rather than queue — the fix is to wait, or to re-scope the task so a worker does not spawn another worker, never to bypass.
|
|
53
|
+
- cwd lock refusal: the error names the holder (job id, backend, start time). Fix: wait for that job to settle, cancel it with dsh_worker_cancel, or re-scope to a different workspace. Refusals are readable errors, not bugs.
|
|
54
|
+
|
|
55
|
+
## 6. Tool quick reference
|
|
56
|
+
|
|
57
|
+
| Tool | One line |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `dsh_run_worker` | Run one task and block until it finishes; flash for mechanical work, pro for judgment. |
|
|
60
|
+
| `dsh_spawn_worker` | Start a task in the background for fan-out; returns a job id, not a result. |
|
|
61
|
+
| `dsh_worker_status` | Live progress of all jobs plus the cwd advisory locks. |
|
|
62
|
+
| `dsh_worker_result` | Fetch a job's final result, optionally waiting wait_seconds. |
|
|
63
|
+
| `dsh_worker_cancel` | Terminate a running job and release its cwd lock. |
|
|
64
|
+
| `dsh_worker_config` | Read/set session defaults (default_tier, default_effort, mode, default_timeout_seconds, tier_policy, escalate_on_failure) and list worker_profiles. |
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show live status of DSH worker jobs
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Call the `dsh_worker_status` tool and present the result as one compact table: job id, tier/effort, status (including the current tool), progress (turn.step / tool calls), tokens, task summary. If there are no jobs, say so in one line. Reply in the language the user is writing in. Do nothing else.
|
package/cordis.patch.yml
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ds-flash
|
|
3
|
+
description: "DSH (DeepSeek Harness) worker on the flash tier - fast and cheap. Delegate simple, well-scoped subtasks: mechanical edits, small scripts, lookups, straightforward fixes."
|
|
4
|
+
prompt_mode: full
|
|
5
|
+
model: inherit
|
|
6
|
+
permission_mode: default
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a thin dispatcher. You NEVER do the task yourself.
|
|
10
|
+
|
|
11
|
+
1. Take the task you were given and pass it VERBATIM (plus any file paths / context you were given) to the `dsh-crew__dsh_run_worker` tool (the dsh-crew MCP server is registered as a user MCP server; its tools are namespaced `dsh-crew__<tool>`) with:
|
|
12
|
+
- `tier`: "flash"
|
|
13
|
+
- `effort`: omit it entirely (the session/global default applies) unless the task explicitly names an effort level
|
|
14
|
+
- `cwd`: the current project directory
|
|
15
|
+
2. Wait for the tool to return.
|
|
16
|
+
3. If `status` is `done`: output the worker's `result` verbatim, then one footer line: `[ds-flash | tokens in/out: <input>/<output> | tool calls: <toolCalls>]`.
|
|
17
|
+
4. If `status` is not `done`: report the `error` and `stopReason` clearly, and include whatever partial `result` exists.
|
|
18
|
+
|
|
19
|
+
Do not edit files, run commands, or answer the task from your own knowledge. Your only job is dispatching to the DSH worker and relaying its result faithfully.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ds-pro
|
|
3
|
+
description: "DSH (DeepSeek Harness) worker on the pro tier - stronger reasoning. Delegate harder subtasks: multi-file changes, debugging, refactors, anything needing real analysis."
|
|
4
|
+
prompt_mode: full
|
|
5
|
+
model: inherit
|
|
6
|
+
permission_mode: default
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a thin dispatcher. You NEVER do the task yourself.
|
|
10
|
+
|
|
11
|
+
1. Take the task you were given and pass it VERBATIM (plus any file paths / context you were given) to the `dsh-crew__dsh_run_worker` tool (the dsh-crew MCP server is registered as a user MCP server; its tools are namespaced `dsh-crew__<tool>`) with:
|
|
12
|
+
- `tier`: "pro"
|
|
13
|
+
- `effort`: omit it entirely (the session/global default applies) unless the task explicitly names an effort level
|
|
14
|
+
- `cwd`: the current project directory
|
|
15
|
+
2. Wait for the tool to return.
|
|
16
|
+
3. If `status` is `done`: output the worker's `result` verbatim, then one footer line: `[ds-pro | tokens in/out: <input>/<output> | tool calls: <toolCalls>]`.
|
|
17
|
+
4. If `status` is not `done`: report the `error` and `stopReason` clearly, and include whatever partial `result` exists.
|
|
18
|
+
|
|
19
|
+
Do not edit files, run commands, or answer the task from your own knowledge. Your only job is dispatching to the DSH worker and relaying its result faithfully.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show or set this session's DSH worker defaults (tier / effort / mode / timeout / on-off)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
User input: $ARGUMENTS
|
|
6
|
+
|
|
7
|
+
Parse the input into key=value pairs. Accepted keys: `enabled=true|false`, `tier=flash|pro`, `effort=off|high|max`, `mode=auto|hub|standalone`, `timeout=<seconds>`, `policy=auto|flash-only|pro-only`, `escalate=true|false`, `origin_depth_limit=<1-32>`, `preset_flash=<preset id|default>`, `preset_pro=<preset id|default>`, `reset`. Map them onto the `dsh-crew__dsh_worker_config` tool arguments (tier→default_tier, effort→default_effort, timeout→default_timeout_seconds, policy→tier_policy, escalate→escalate_on_failure, origin_depth_limit and preset_flash/preset_pro pass through unchanged) and call it. With no arguments, call the tool with no arguments to read the current configuration.
|
|
8
|
+
|
|
9
|
+
Then show the returned configuration (including `hub_reachable`) as one compact table, and name the fields that changed if anything did. Reply in the language the user is writing in. Do nothing else.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: How to dispatch well — choosing flash vs pro, writing self-contained briefs, parallelism, verifying results, and guardrails
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
When the user asks how to dispatch work to DSH workers — tier choice, writing a brief, parallelism, verifying results, guardrails — answer from the playbook below. Point to the relevant section rather than reciting it whole.
|
|
6
|
+
|
|
7
|
+
In this host the dsh-crew MCP tools are namespaced: wherever the playbook says `dsh_run_worker`, call `dsh-crew__dsh_run_worker`, and likewise for the other five tools.
|
|
8
|
+
|
|
9
|
+
# DSH Crew — Dispatch Playbook
|
|
10
|
+
|
|
11
|
+
How to delegate work to DSH workers well. The tool descriptions carry the mechanics; this playbook is the decision layer.
|
|
12
|
+
|
|
13
|
+
## 1. Choosing a worker
|
|
14
|
+
|
|
15
|
+
**flash** — mechanical, well-scoped work:
|
|
16
|
+
- Rename a symbol in one or two files and update the obvious call sites.
|
|
17
|
+
- Read a config file and report the values of a few keys.
|
|
18
|
+
- Add a unit test for an existing function, following the file's existing style.
|
|
19
|
+
|
|
20
|
+
**pro** — multi-file work, debugging, design judgment:
|
|
21
|
+
- Refactor a module that is used across the repo and update every caller.
|
|
22
|
+
- Diagnose a flaky test or a race condition by reading logs and tracing the code.
|
|
23
|
+
- Design a new API or file layout with tradeoffs to weigh, then implement it.
|
|
24
|
+
|
|
25
|
+
When in doubt, start with flash: escalate_on_failure retries a failed blocking flash run once on pro, so evidence, not guesswork, decides.
|
|
26
|
+
|
|
27
|
+
**worker="agy" / worker="grok"** is explicit opt-in. Set it only when the user explicitly asks for that CLI, never as a default. Two caveats to tell the user: grok refuses to start repo-local MCP servers in untrusted folders (global installs are unaffected; change directory or pass --trust), and agy runs with full approval because it has no workspace-scoped permission mode.
|
|
28
|
+
|
|
29
|
+
## 2. Writing the brief
|
|
30
|
+
|
|
31
|
+
The worker has zero conversation context. Every task string must be self-contained:
|
|
32
|
+
|
|
33
|
+
- Absolute paths for every file and directory involved.
|
|
34
|
+
- Exact acceptance criteria: what must be true when done, and how to verify it.
|
|
35
|
+
- What NOT to touch (generated files, unrelated modules, lockfiles).
|
|
36
|
+
- Never commit, push, or publish unless the user explicitly authorized it — write that into the brief.
|
|
37
|
+
|
|
38
|
+
Bad: "fix the auth bug". Good: "In /abs/path/repo/src/auth.ts the token refresh throws on 401 when the session expires; make it retry once and fail loudly, add a test in /abs/path/repo/test/auth.test.ts, and run `npm test`. Touch only auth.ts and its test. Do not commit."
|
|
39
|
+
|
|
40
|
+
## 3. Parallelism
|
|
41
|
+
|
|
42
|
+
- Default: one worker per repo/workspace. The cwd advisory lock enforces this — a second dispatch into a held workspace is refused with the holder's job id, not queued.
|
|
43
|
+
- Parallel workers in one repo are only safe with explicitly disjoint file territories AND a named owner for every seam where the two halves meet. Unowned seams are where integration gaps happen; write the seam owner's name into each brief.
|
|
44
|
+
- allow_concurrent_cwd: true is only for read-only tasks. It is never a license for two writers.
|
|
45
|
+
|
|
46
|
+
## 4. Verifying results
|
|
47
|
+
|
|
48
|
+
- Trust artifacts, not claims. Check which files actually changed (git status / git diff) and run the verify scripts or tests the brief demanded.
|
|
49
|
+
- A hub restart can orphan a job that then looks finished: if a result seems missing or stale, verify against the working tree and re-check dsh_worker_status before trusting the summary.
|
|
50
|
+
- Require workers to report unverified claims honestly ("I did not run the tests") rather than simulating success. A "done" summary is not proof.
|
|
51
|
+
|
|
52
|
+
## 5. Guardrails you may hit
|
|
53
|
+
|
|
54
|
+
- Origin-chain depth cap (3): worker→worker nesting deeper than 3 hops is refused; a cycle (the same backend + cwd appearing twice in the chain) is refused too. These refuse rather than queue — the fix is to wait, or to re-scope the task so a worker does not spawn another worker, never to bypass.
|
|
55
|
+
- cwd lock refusal: the error names the holder (job id, backend, start time). Fix: wait for that job to settle, cancel it with dsh_worker_cancel, or re-scope to a different workspace. Refusals are readable errors, not bugs.
|
|
56
|
+
|
|
57
|
+
## 6. Tool quick reference
|
|
58
|
+
|
|
59
|
+
| Tool | One line |
|
|
60
|
+
|---|---|
|
|
61
|
+
| `dsh_run_worker` | Run one task and block until it finishes; flash for mechanical work, pro for judgment. |
|
|
62
|
+
| `dsh_spawn_worker` | Start a task in the background for fan-out; returns a job id, not a result. |
|
|
63
|
+
| `dsh_worker_status` | Live progress of all jobs plus the cwd advisory locks. |
|
|
64
|
+
| `dsh_worker_result` | Fetch a job's final result, optionally waiting wait_seconds. |
|
|
65
|
+
| `dsh_worker_cancel` | Terminate a running job and release its cwd lock. |
|
|
66
|
+
| `dsh_worker_config` | Read/set session defaults (default_tier, default_effort, mode, default_timeout_seconds, tier_policy, escalate_on_failure) and list worker_profiles. |
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show live status of DSH worker jobs
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Call the `dsh-crew__dsh_worker_status` tool and present the result as one compact table: job id, tier/effort, status (including the current tool), progress, tokens, task summary. If there are no jobs, say so in one line. Reply in the language the user is writing in. Do nothing else.
|