Skip to main content
X

dsh-crew-x

xiaobaijiadepugongyingpai-coder/dsh-crew-x

Enhanced fork of ZSeven-W/dsh-crew for Claude Code, Codex, Antigravity and Grok: adds opt-in persistent sessions, atomic hub.json port discovery, visual provider/model bindings with route probe, 4-tier per-task permissions with Windows auto-worktree fallback, and threshold report offloading across 8 MCP tools. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.

Install

dsh plugin --profile web add github:xiaobaijiadepugongyingpai-coder/dsh-crew-x

README

DSH Crew X — DeepSeek Harness Worker Orchestrator

Production-Grade DeepSeek Harness Worker Orchestrator
Opt-In Persistent Sessions • Dynamic Hub Discovery • 4-Tier Per-Task Permissions • Windows Auto-Worktree • Threshold Auto-Offload

English • 简体中文

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

vs Upstream • Workflows • Quick Start • Architecture & Tools • Changelog


🖥️ Control Plane & Live Orchestration

dsh-crew-x mounts directly into the DSH Settings Panel as both a visual configuration center and a live multi-workspace jobs board:

DSH Crew X Dispatch Policy & Tier Model Bindings

Real DSH Desktop UI: visual flash / pro provider & model bindings, preset controls, route probe, and opt-in persistent session settings

DSH Crew X Active Persistent Sessions & Worker Jobs Board

Real DSH Desktop UI: live persistent session pool & per-workspace worker jobs grouping (↻ session #turn badges & parallel read-only tasks)


📖 Fork Context & Upstream Credit

This repository is a hard fork of ZSeven-W/dsh-crew (0.1.0-rc.15, MIT License).

  • Upstream Credit: Full credit to ZSeven-W for designing the clean three-surface DSH subagent protocol (Host ↔ MCP ↔ DSH Hub).
  • Why dsh-crew-x Exists: Upstream keeps execution strictly stateless and minimal. dsh-crew-x is engineered for heavy-duty, multi-turn, and Windows enterprise workflows—adding opt-in persistent sessions, dynamic port discovery for DSH Desktop, per-task sandboxing with automatic Windows Git Worktree fallback, and threshold-based report offloading.

⚡ Key Differences from Upstream

CapabilityUpstream ZSeven-W/dsh-crewEnhanced dsh-crew-xPractical Impact
Session LifecycleStrictly stateless (one-shot); context discarded every turnOpt-In Persistent Sessions (persistent: true)
1:1 binding, idle reaper (1–1440m), turn-level watchdog (turnEpoch)
Eliminates redundant repo re-reads and token waste in multi-turn debugging
Hub DiscoveryStatic loopback port (3080); breaks on port changeAtomic hub.json Discovery + CAS Hot ReconnectWorks seamlessly with DSH Desktop's randomized ports across restarts
Model RoutingManual config.json edits with no live validationVisual Catalog Dropdowns + Custom IDs + Route ProbeEnumerates live DSH providers and tests real tool-call capability in one click
Sandbox & Windows ACLGlobal mode; restricted paths fail with Win32 5 Access Denied4-Tier Per-Task Permissions + Ceiling + Auto-WorktreeLeast-privilege per task; auto-degrades to %TEMP%\dsh-crew-worktrees on ACL failure
Output ManagementFull multi-thousand-token output inlined into host chatAuto-Offload (<cwd>/.dsh-reports/) + Summary ContractSaves 85%+ host context window while extracting VERDICT / CHANGED blocks
Workspace ConcurrencyOne worker per directory at a timeExclusive Write Lock + allow_concurrent_cwd for ReadsRun multiple parallel flash read-only auditors in the same repo safely

🎯 Production Workflows

1. Parallel Code Auditing Without Context Bloat

Unbounded Inline vs Threshold Auto-Offload

Dispatch multiple read-only workers concurrently against the same repository (allow_concurrent_cwd: true). Any output exceeding inline_limit (default 1500 tokens / 4000 chars) or ending in a non-done state is automatically saved to <cwd>/.dsh-reports/ (with .gitignore managed idempotently), returning only the parsed structured summary to the host:

// MCP tool call: dsh_spawn_worker (Worker 1 — Auth Audit)
{
  "task": "Audit src/auth for JWT refresh replay vulnerabilities",
  "tier": "flash",
  "permission": "read-only",
  "allow_concurrent_cwd": true
}
// MCP tool call: dsh_spawn_worker (Worker 2 — DB Audit, runs concurrently)
{
  "task": "Audit src/db for SQL injection risks and unindexed queries",
  "tier": "flash",
  "permission": "read-only",
  "allow_concurrent_cwd": true
}

2. Multi-Turn Iterative Debugging (Persistent Sessions)

Persistent Session Lifecycle

Available in DSH Hub + Antigravity (opt-in via DSH Settings or dsh_worker_config({ persistent_sessions: true })). A forwarding subagent binds 1:1 to a DSH Hub session across turns and explicitly tears it down when done:

// Turn 1 — Create persistent session
// Tool: dsh_run_worker
{
  "task": "Diagnose why test #104 intermittently times out in src/hub/index.mjs",
  "tier": "pro",
  "persistent": true
}
// -> Returns session_id: "sess-9b1c-4f8a", turnIndex: 1
// Turn 2 — Continue on the same session (full history & tool outputs preserved)
// Tool: dsh_run_worker
{
  "session_id": "sess-9b1c-4f8a",
  "task": "Apply the turnEpoch guard we identified and run the test suite"
}
// Turn 3 — Explicit teardown (registers tombstone; future reuse returns SESSION_CLOSED)
// Tool: dsh_session_close
{
  "session_id": "sess-9b1c-4f8a"
}

3. Windows Desktop Zero-Config & ACL Fallback

  • Dynamic Port Hot-Reconnect: On boot and on loopback requests, the DSH Hub atomically writes its live URL and PID to ~/.config/dsh-crew/hub.json. The MCP client resolves live candidates via CAS-protected failover—surviving DSH Desktop restarts with zero manual config.
  • Resilient auto Worktree Degradation: Tasks using permission: "auto" execute with workspace-write. If Windows restricts directory ACLs (SetNamedSecurityInfoW / Win32 5), the Hub automatically provisions an isolated Git Worktree under %TEMP%\dsh-crew-worktrees\<id> with .degradation.json sidecar metadata—keeping external session_id and cwd validation intact across restarts.

🚀 Quick Start

Install dsh-crew-x directly into your DSH profile from npm:

dsh plugin --profile web add dsh-crew-x
dsh web
Alternative: Build & link from source (for local development)
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 Only: When no DSH instance is running, workers can fall back to standalone execution if DEEPSEEK_API_KEY is configured in ~/.config/dsh-crew/.env (see .env.example).

2. Connect External AI Hosts

Use the built-in installer CLI to register the MCP server, role definitions, skills, and permissions:

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

# Or install individual hosts:
node src/install/cli.mjs agy --agy-permissions=safe  # Antigravity (auto-allows 4 safe query tools)
node src/install/cli.mjs claude --statusline        # Claude Code (with claude-hud status segment)
node src/install/cli.mjs codex                      # OpenAI Codex CLI
node src/install/cli.mjs grok                       # Grok Build CLI

[!WARNING] Migration & Breaking Changes:

  1. Do Not Mix: Never enable upstream @zseven-w/dsh-crew and dsh-crew-x simultaneously in the same host—MCP tool names will collide.
  2. Async Persistent Refusal: dsh_spawn_worker strictly runs in one-shot mode. Passing persistent or session_id (even false or "") is explicitly rejected with PERSISTENT_ASYNC_UNSUPPORTED.
  3. Worktree Metadata: When an auto task triggers Windows ACL fallback, the response explicitly includes worktree_path and isolation: true.

🏗️ Architecture & MCP Reference

DSH Crew X Three-Surface Architecture

🛠️ 8 MCP Tools

ToolRoleKey Parameters
dsh_run_workerBlocking execution (supports persistent sessions)task, tier, effort, cwd, timeout_seconds, permission, preset, allow_concurrent_cwd, persistent, session_id, inline_limit, full_reply
dsh_spawn_workerAsynchronous background dispatch (one-shot only)task, tier, effort, cwd, permission, preset, allow_concurrent_cwd
dsh_worker_statusList live Hub / Standalone / CLI jobs & CWD locks(none)
dsh_worker_resultRetrieve settled output with summary extractionjob_id, wait_seconds, inline_limit, full_reply
dsh_worker_cancelTerminate a running worker and release its CWD lockjob_id
dsh_worker_configInspect or override session configuration at runtimepersistent_sessions, default_tier, mode, report_dir, preset_flash, preset_pro, flash_provider, flash_model, reset, etc.
dsh_worker_probeZero-side-effect no-op tool-call route probetier, provider, model
dsh_session_closeExplicitly destroy a persistent session (tombstone)session_id
⚙️ Configuration, Environment Variables & Verification Gates
Global Config: ~/.config/dsh-crew/config.json
{
  "mode": "auto",                                    // auto | hub | standalone
  "default_tier": "flash",                           // flash | pro
  "default_effort": "high",                          // 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 threshold (1–1440 min)
  "preset_flash": "default",                         // DSH agent preset for flash
  "preset_pro": "default",                           // DSH agent preset for pro
  "report_dir": ""                                   // Custom report path (empty = <cwd>/.dsh-reports/)
}
Environment Variables
  • DSH_CREW_MAX_PERMISSION: Enforces non-escalating permission ceiling (read-only | workspace-write | auto | full-access).
  • DSHPLUGIN_CREW_HUB: Overrides hub.json discovery with a fixed loopback Hub URL.
  • DSH_CREW_ORIGIN_CHAIN / DSH_CREW_DEPTH: Tracks cross-process dispatch chains to block cycles and limit recursion depth (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

📄 License & Credits

Licensed under the MIT License.

Related plugins