dsh-crew-x

mcp
Security Audit
Warn
Health Warn
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 6 GitHub stars
Code Pass
  • Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

Production-grade DeepSeek Harness (DSH) worker orchestrator: persistent sessions, stall & approval resilience guards, 5 orthogonal primitives, zero-polling watcher, per-task permissions, Windows worktree isolation, and indexed report offload

README.md

DSH Crew X — DeepSeek Harness Multi-Agent Orchestrator

Delegate parallel audits, builds, and multi-turn debugging from Claude Code, Codex, Antigravity, or Grok
to DeepSeek Harness workers — with persistent sessions, resilience guards, and zero context bloat.

English  ·  简体中文

npm version GitHub Release Node.js >= 18 License: MIT Forked from ZSeven-W/dsh-crew

Quick Start  ·  Meet the Crew  ·  Capabilities  ·  Control Plane  ·  Architecture  ·  Workflows  ·  MCP Reference  ·  Changelog


Quick Start

1. Install into DeepSeek Harness

dsh plugin --profile web add dsh-crew-x
dsh web

2. Connect Your AI Coding Host

# Connect all 4 supported hosts (Claude Code, Codex, Antigravity, Grok)
node src/install/cli.mjs all

# Or connect a single host:
node src/install/cli.mjs agy --agy-permissions=safe  # Antigravity (4 safe tools auto-allowed, timeoutSeconds: 7200)
node src/install/cli.mjs claude --statusline        # Claude Code (installs statusline.sh; use `hud` for claude-hud)
node src/install/cli.mjs codex                      # OpenAI Codex CLI (tool_timeout_sec = 7200)
node src/install/cli.mjs grok                       # Grok Build CLI
Alternative: Build from source or run in Standalone fallback mode

Local development build:

git clone https://github.com/xiaobaijiadepugongyingpai-coder/dsh-crew-x.git
cd dsh-crew-x
pnpm install
npm run build
dsh plugin --profile web add link:/path/to/dsh-crew-x
dsh web

Standalone fallback: When no DSH Hub is running, workers can fall back to standalone SDK execution if DEEPSEEK_API_KEY is configured in ~/.config/dsh-crew/.env (see .env.example).

[!IMPORTANT]
Compatibility & Upgrade Notes:

  • Do not mix with upstream: Never enable @zseven-w/dsh-crew and dsh-crew-x in the same host simultaneously (MCP tool names collide).
  • v0.2.2 defaults: stall_timeout_sec defaults to 120 and on_approval defaults to 'abort' (pass 'wait' to hold for approvals).
  • v0.3.0 breaking change — one dispatch tool: dsh_run_worker and dsh_spawn_worker are merged into dsh_swarm_worker (task vs tasks[], wait: false|true), and dsh_worker_result no longer takes a wait argument. Re-run the installer (node src/install/cli.mjs all, or the panel's Update button) so your host allowlists drop the two dead rules and pick up dsh_swarm_worker; dispatch is refused without it.

Meet the Crew

DSH Crew X Mascot Crest — Main Agent & Subagent A

Main Agent × DeepSeek Whale Worker

Main Agent (The Commander) — Your primary AI coding host (Claude Code, Codex, Antigravity, or Grok). Stays focused on architecture, task decomposition, and final review without drowning in raw tool logs.

Subagent A (DeepSeek Worker) — Specialized flash / pro workers running inside DeepSeek Harness. Fans out parallel read-only audits, holds multi-turn persistent sessions, degrades safely into isolated Windows Git Worktrees, and hands back a clean VERDICT: PASS while offloading bulky reports to .dsh-reports/.

Original Comic Poster ("Stop everything and applaud Subagent A!")

DSH Crew X Comic — Main Agent applauding Subagent A


Core Capabilities

dsh-crew-x is a production-hardened hard fork of ZSeven-W/dsh-crew (0.1.0-rc.15), built for multi-turn engineering, concurrent fan-out, and Windows desktop environments.

Opt-In Persistent Sessions
Bind a subagent 1:1 to a DSH Hub session (persistent: true) across turns with a monotonic turnEpoch watchdog, idle reaper (1–1440m), and explicit tombstone teardown via dsh_session_close.
5 Orthogonal Resilience Guards
Combine stall_timeout_sec, on_approval, max_steps, max_output_tokens, and inline_max_chars per dispatch. Stalls and approvals fast-abort with partial state preserved instead of hanging indefinitely.
Zero-Polling Background Fan-Out
Run parallel read-only workers on the same repo (allow_concurrent_cwd: true) while self-healing write locks protect edits. Pair with scripts/dsh-watch.mjs to wait silently and wake the host with one < 150-char JSON line.
Indexed Char Offload
Outputs over inline_max_chars (default 20000; 0 forces offload) automatically save to <cwd>/.dsh-reports/, returning a compact summary, 1-based report_index heading ranges, and tail_summary.
Dynamic Hub Discovery & Route Probe
DSH Hub atomically broadcasts its live loopback port to ~/.config/dsh-crew/hub.json. The MCP client hot-reconnects via CAS across DSH Desktop restarts, with live provider dropdowns and a no-op tool-call probe in the UI.
4-Tier Sandbox & Windows Worktree Fallback
Enforce per-task least privilege (read-only, workspace-write, auto, full-access) under DSH_CREW_MAX_PERMISSION. On Windows ACL denial (Win32 5), auto seamlessly degrades to an isolated %TEMP% Git Worktree.
Full comparison: Upstream ZSeven-W/dsh-crew vs. dsh-crew-x
Capability Upstream ZSeven-W/dsh-crew Enhanced dsh-crew-x
Session Lifecycle Strictly stateless (one-shot) Opt-in persistent sessions (persistent: true), 1:1 binding, idle reaper, turnEpoch watchdog
Hub Discovery Static loopback port (3080) Atomic hub.json discovery + CAS hot reconnect across randomized Desktop ports
Model Routing Manual config.json edits Visual provider/model catalog dropdowns, inline custom IDs, one-click tool-call route probe
Sandbox & Windows ACL Global mode; fails on Win32 5 4-tier per-task permissions + ceiling + automatic %TEMP%\dsh-crew-worktrees fallback
Output Management Full raw output inlined to host Char-threshold offload (inline_max_chars: 20000) + 1-based report_index + tail_summary
Workspace Concurrency Strict single worker per CWD Self-healing exclusive write lock + allow_concurrent_cwd for parallel read-only workers
Stall & Budget Guards Unbounded hangs on stalls/loops stall_timeout_sec, on_approval, max_steps, max_output_tokens, bounded 5s dispose()
Background Waiting Manual dsh_worker_status polling Zero-dependency scripts/dsh-watch.mjs (--mode all|any, single < 150-char wake line)

Control Plane UI

dsh-crew-x mounts natively inside the DSH Settings Panel as a live configuration center and multi-workspace jobs board:

DSH Crew X Dispatch Policy and Model Bindings

Dispatch Policy & Route Probe — Live flash / pro provider & model bindings, presets, one-click tool-call probe, and persistent session toggle.

DSH Crew X Active Sessions and Worker Jobs Board

Sessions & Multi-Workspace Jobs Board — Live persistent session pool, per-workspace job grouping, ↻ session #turn badges, and parallel read-only tracking.


Architecture

DSH Crew X Three-Surface Architecture


Production Workflows

1. Parallel Read-Only Auditing & Indexed Offload

Unbounded Inline vs Indexed Char Offload

Fan out concurrent read-only auditors against the same workspace and wait without polling:

// 1. Dispatch the batch in ONE call via dsh_swarm_worker (single approval, one enqueue)
{
  "tasks": [
    { "task": "Audit src/auth for JWT refresh replay risks", "tier": "flash", "permission": "read-only", "allow_concurrent_cwd": true },
    { "task": "Audit src/db for SQL injection & missing indexes", "tier": "flash", "permission": "read-only", "allow_concurrent_cwd": true }
  ],
  "wait": false
}
// -> { ok: true, jobs, job_ids: ["hub-17-...", "hub-18-..."], watch_cmd: "node .../dsh-watch.mjs --job hub-17-...,hub-18-... --mode any --coalesce 0 --deadline 0" }
# 2. Run the returned watch_cmd in a background shell. It consumes the hub's
#    event-driven long-poll and prints ONE line on settlement, ids intact.
node scripts/dsh-watch.mjs --job <id1[,id2...]> --mode any|all --coalesce <sec> --deadline 0
# -> { ok, r, settled: [{ id, st, sr, s, summary, report_path, report_index }], run: [...], next_watch_cmd }

Re-arm exactly the returned next_watch_cmd while run is non-empty. Every id is printed in full — no output path truncates a job id.

2. Multi-Turn Persistent Debugging

Available in DSH Hub + Antigravity (opt-in via DSH Settings or dsh_worker_config({ persistent_sessions: true })). Full conversation history and tool outputs stay warm across turns until explicitly torn down:

// Turn 1 — dsh_swarm_worker: open persistent session & diagnose (wait defaults to true here)
{ "task": "Diagnose intermittent timeout in src/hub/index.mjs", "tier": "pro", "persistent": true }
// -> returns { session_id: "session-9b1c4f8a-...", turnIndex: 1 }

// Turn 2 — dsh_swarm_worker: apply fix on the same session (zero repo re-read)
{ "session_id": "session-9b1c4f8a-...", "task": "Apply the turnEpoch guard and run tests" }

// Turn 3 — dsh_session_close: destroy handle & record tombstone (future reuse -> SESSION_CLOSED)
{ "session_id": "session-9b1c4f8a-..." }

3. Windows Desktop Resilience

  • Zero-Config Port Hot-Reconnect: DSH Hub updates ~/.config/dsh-crew/hub.json atomically; MCP clients fail over via CAS with zero manual port config across DSH Desktop restarts.
  • Automatic ACL Worktree Degradation: When permission: "auto" hits Windows directory ACL denial (SetNamedSecurityInfoW / Win32 5), the Hub provisions an isolated Git Worktree under %TEMP%\dsh-crew-worktrees\<id> with .degradation.json metadata and returns worktree_path, isolation: "git-worktree", and degraded_from.

Reference

7 MCP Tools

Tool Purpose Key Arguments
dsh_swarm_worker Unified dispatch: one task or a batch, blocking or async task | tasks[], wait, tier, effort, worker, cwd, timeout_seconds, allow_concurrent_cwd, permission, preset, inline_limit, inline_max_chars, full_reply, stall_timeout_sec, on_approval, max_steps, max_output_tokens, persistent, session_id
dsh_worker_status Live Hub / Standalone / CLI jobs & self-healing CWD locks (none)
dsh_worker_result Instantaneous read of a settled job with report_index — never waits or polls job_id, inline_limit, inline_max_chars, full_reply
dsh_worker_cancel Soft-cancel + bounded 5s dispose + release CWD lock job_id
dsh_worker_config Inspect or override runtime defaults persistent_sessions, default_tier, default_effort, stall_timeout_sec, on_approval, max_steps, max_output_tokens, inline_max_chars, reset
dsh_worker_probe Zero-side-effect tool-call connectivity probe tier, provider, model
dsh_session_close Explicitly destroy a persistent session (tombstone) session_id

dsh_swarm_worker is one tool with orthogonal axes rather than several overlapping ones:

Axis Values Behaviour
task / tasks[] one string / one array Mutually exclusive. Batch items may override the shared dispatch defaults.
wait false (default) / true false returns { ok, jobs, job_ids, watch_cmd }; true waits in ≤60 s slices and returns results.
persistent / session_id single task only Reusable hub session across turns. Always blocking; refused on tasks[] (PERSISTENT_BATCH_UNSUPPORTED) and with explicit wait: false (PERSISTENT_ASYNC_UNSUPPORTED).

Zero-Polling Watcher (scripts/dsh-watch.mjs)

node scripts/dsh-watch.mjs --job <id1[,id2...]> [--mode all|any] [--coalesce <sec>] [--deadline <sec>] [--poll <sec>]

Event-driven: it consumes the hub's multi-job long-poll GET /jobs/wait in ≤60 s slices and wakes on settlement, falling back to per-job polling only against a hub too old to serve that route. Nothing is printed while watching; on exit, one single-line JSON with complete job ids, settled details (summary, report_path, report_index), the still-run list and a ready-to-run next_watch_cmd.

--deadline 0 (the default) means no wall-clock deadline — a stuck worker is the hub's stall_timeout_sec business. A positive --deadline bounds the wait and exits 2 with a snapshot plus next_watch_cmd, so a timeout is a re-arm rather than a lost round.

Exit codes: 0 settled · 1 bad arguments or unreachable Hub · 2 deadline reached.

Configuration (config.json), Environment Variables & Verification Gates

~/.config/dsh-crew/config.json

{
  "mode": "auto",                                    // auto | hub | standalone
  "default_tier": "flash",                           // flash | pro
  "default_effort": "max",                           // off | high | max
  "persistent_sessions": false,                      // Global opt-in toggle
  "persistent_session_idle_timeout_enabled": true,   // Auto-reap idle sessions
  "persistent_session_idle_timeout_minutes": 30,     // Idle TTL (1–1440 min)
  "preset_flash": "default",                         // DSH agent preset for flash
  "preset_pro": "default",                           // DSH agent preset for pro
  "report_dir": "",                                  // Empty = <cwd>/.dsh-reports/
  "stall_timeout_sec": 120,                          // Silence watchdog in seconds (0 disables)
  "on_approval": "abort",                            // abort | wait on approval/asked
  "max_steps": null,                                 // Hard step cap (null = unlimited)
  "max_output_tokens": null,                         // Hard output token cap (null = unlimited)
  "inline_max_chars": 20000                          // >0 threshold | 0 force offload | -1 never offload
}

Environment Variables

  • DSH_CREW_MAX_PERMISSION — Non-escalating permission ceiling (read-only | workspace-write | auto | full-access).
  • DSHPLUGIN_CREW_HUB — Override hub.json discovery with a fixed loopback Hub URL.
  • DSH_CREW_ORIGIN_CHAIN / DSH_CREW_DEPTH — Cross-process dispatch cycle guard & recursion depth cap (default 3).

Local Verification Gates

npx tsc -p tsconfig.client.json --noEmit
npm run build
npm test
node scripts/verify-wpc10-client.mjs
npm run smoke:cwd
npm run smoke:mcp

Credits & License

Licensed under the MIT License.

  • Upstream Protocol & Foundation: Copyright (c) 2026 ZSeven-W/dsh-crew (0.1.0-rc.15) — full credit for designing the clean Host ↔ MCP ↔ DSH Hub three-surface protocol.
  • Hard Fork & Production Hardening: Copyright (c) 2026 xiaobaijiadepugongyingpai-coder.

Reviews (0)

No results found