@ran-sh/dsh-crew 0.5.1 → 0.5.2

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.
@@ -8,7 +8,7 @@
8
8
  // Keep this module pure and dependency-free so Hub, MCP and tests all use the
9
9
  // exact same compatibility rules.
10
10
 
11
- export const RUNTIME_VERSION = '0.5.1';
11
+ export const RUNTIME_VERSION = '0.5.2';
12
12
  export const HUB_PROTOCOL_VERSION = 1;
13
13
 
14
14
  export const HUB_CAPABILITIES = Object.freeze([
@@ -0,0 +1,55 @@
1
+ @echo off
2
+ setlocal EnableExtensions
3
+ title DSH Crew Launcher
4
+
5
+ set "CREW_HOME=%USERPROFILE%\.config\dsh-crew\harness"
6
+ set "OFFICIAL_HOME=%USERPROFILE%\.dsh"
7
+ set "DSH_CLI=%CREW_HOME%\runtime\node_modules\.bin\dsh.cmd"
8
+ set "CREW_URL=http://127.0.0.1:3210"
9
+ set "UI_URL=http://127.0.0.1:3080"
10
+ set "LAUNCH_LOG=%TEMP%\dsh-crew-launcher.log"
11
+
12
+ if not exist "%DSH_CLI%" goto :not_installed
13
+ if not exist "%CREW_HOME%\profiles\dsh-crew\package.json" goto :not_installed
14
+ if not exist "%OFFICIAL_HOME%\profiles\web\package.json" goto :official_missing
15
+
16
+ call :ensure_service 3210 dsh-crew "%CREW_HOME%" "%CREW_URL%"
17
+ if errorlevel 1 goto :failed
18
+ call :ensure_service 3080 web "%OFFICIAL_HOME%" "%UI_URL%"
19
+ if errorlevel 1 goto :failed
20
+ exit /b 0
21
+
22
+ :ensure_service
23
+ set "LAUNCH_PORT=%~1"
24
+ set "LAUNCH_PROFILE=%~2"
25
+ set "LAUNCH_HOME=%~3"
26
+ set "LAUNCH_URL=%~4"
27
+
28
+ call :health_check "%LAUNCH_URL%"
29
+ if not errorlevel 1 exit /b 0
30
+
31
+ powershell.exe -NoLogo -NoProfile -NonInteractive -Command "$listener=Get-NetTCPConnection -State Listen -LocalPort $env:LAUNCH_PORT -ErrorAction SilentlyContinue; if ($listener) { exit 0 } else { exit 1 }" >nul 2>&1
32
+ if not errorlevel 1 exit /b 1
33
+
34
+ powershell.exe -NoLogo -NoProfile -NonInteractive -WindowStyle Hidden -Command "try { $env:DSH_HOME=$env:LAUNCH_HOME; Start-Process -FilePath $env:DSH_CLI -ArgumentList @('--profile',$env:LAUNCH_PROFILE,'--host','127.0.0.1','--port',$env:LAUNCH_PORT,'--no-open') -WindowStyle Hidden -ErrorAction Stop } catch { ('['+(Get-Date -Format s)+'] Failed to start '+$env:LAUNCH_PROFILE+': '+$_.Exception.Message) | Add-Content -LiteralPath $env:LAUNCH_LOG; exit 1 }" >nul 2>&1
35
+ if errorlevel 1 exit /b 1
36
+
37
+ powershell.exe -NoLogo -NoProfile -NonInteractive -Command "$lastError=$null; $deadline=(Get-Date).AddSeconds(90); do { try { $r=Invoke-RestMethod -Uri ($env:LAUNCH_URL+'/_dsh/dsh-crew/extension') -TimeoutSec 2; if ($r.ok -eq $true -and $r.extension.runtime.runtime_version) { exit 0 } } catch { $lastError=$_.Exception.Message }; Start-Sleep -Milliseconds 500 } while ((Get-Date) -lt $deadline); if (-not $lastError) { $lastError='No healthy response before the startup deadline.' }; ('['+(Get-Date -Format s)+'] '+$env:LAUNCH_PROFILE+' health check failed: '+$lastError) | Add-Content -LiteralPath $env:LAUNCH_LOG; exit 1" >nul 2>&1
38
+ exit /b %ERRORLEVEL%
39
+
40
+ :health_check
41
+ set "HEALTH_URL=%~1"
42
+ powershell.exe -NoLogo -NoProfile -NonInteractive -Command "try { $r=Invoke-RestMethod -Uri ($env:HEALTH_URL+'/_dsh/dsh-crew/extension') -TimeoutSec 2; if ($r.ok -eq $true -and $r.extension.runtime.runtime_version) { exit 0 } } catch {}; exit 1" >nul 2>&1
43
+ exit /b %ERRORLEVEL%
44
+
45
+ :not_installed
46
+ echo [%date% %time%] DSH Crew is not installed completely.>>"%LAUNCH_LOG%"
47
+ exit /b 1
48
+
49
+ :official_missing
50
+ echo [%date% %time%] Official DeepSeek Harness web profile was not found.>>"%LAUNCH_LOG%"
51
+ exit /b 1
52
+
53
+ :failed
54
+ echo [%date% %time%] DSH Crew startup failed.>>"%LAUNCH_LOG%"
55
+ exit /b 1
@@ -0,0 +1,9 @@
1
+ Option Explicit
2
+
3
+ Dim shell, launcher, command
4
+ Set shell = CreateObject("WScript.Shell")
5
+ launcher = "__LAUNCHER__"
6
+ command = shell.ExpandEnvironmentStrings("%COMSPEC%") & " /d /c " & _
7
+ Chr(34) & Chr(34) & launcher & Chr(34) & Chr(34)
8
+
9
+ shell.Run command, 0, False
@@ -0,0 +1,21 @@
1
+ # Global capability-aware delegation policy for ZCode
2
+
3
+ ZCode is a host adapter for DSH Crew. Use the `dsh-crew` MCP server for Crew
4
+ work only after its live capability and readiness surfaces have been checked.
5
+
6
+ - Discover the current Crew configuration, capabilities, activation state and
7
+ readiness before delegating substantial work. Installed, configured, enabled
8
+ and callable are different states; do not infer one from another.
9
+ - Match a bounded work unit to an available Crew role/model and preserve the
10
+ repository/worktree and Result Contract boundaries. Keep planning, ambiguous
11
+ requirements, integration, external side effects and final communication in
12
+ the host agent.
13
+ - If Crew is selected and any required capability is unavailable, non-callable,
14
+ or returns an unknown/runtime/configuration/credential/routing/timeout error,
15
+ pause. Report the evidence and wait for the operator to choose repair Crew or
16
+ continue locally; never silently fall back or retry blindly.
17
+ - Validate returned evidence, changed scope, tests and completion state before
18
+ accepting delegated work. Do not expose credentials or raw provider payloads.
19
+
20
+ This file is installed as a managed block in `~/.zcode/AGENTS.md`; user-authored
21
+ instructions outside the block are preserved.
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: ds-reviewer
3
+ description: Independent DSH Crew reviewer dispatcher. Inspect completed changes read-only and return a structured verdict.
4
+ mcpServers:
5
+ - dsh-crew
6
+ tools:
7
+ - mcp__dsh-crew__dsh_run_worker
8
+ - mcp__dsh-crew__dsh_worker_status
9
+ - mcp__dsh-crew__dsh_worker_result
10
+ - mcp__dsh-crew__dsh_worker_cancel
11
+ - mcp__dsh-crew__dsh_worker_config
12
+ ---
13
+
14
+ You are a thin, read-only dispatcher. Never edit files or implement fixes.
15
+
16
+ Pass the review request verbatim to `dsh_run_worker` with role `reviewer` and
17
+ the current workspace as `cwd`; omit effort unless explicitly requested. Wait
18
+ for the result and return its Review Findings, Evidence, Risks and Verdict.
19
+ Treat failing tests or incomplete evidence as not approved.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: ds-worker
3
+ description: DSH Crew worker dispatcher for implementation, fixes, tests, search and analysis. Never implement locally; return the auditable Crew result.
4
+ mcpServers:
5
+ - dsh-crew
6
+ tools:
7
+ - mcp__dsh-crew__dsh_run_worker
8
+ - mcp__dsh-crew__dsh_spawn_worker
9
+ - mcp__dsh-crew__dsh_worker_status
10
+ - mcp__dsh-crew__dsh_worker_result
11
+ - mcp__dsh-crew__dsh_worker_cancel
12
+ - mcp__dsh-crew__dsh_worker_config
13
+ ---
14
+
15
+ You are a thin dispatcher. You never do the task yourself.
16
+
17
+ Pass the task verbatim to `dsh_run_worker` with role `worker` and the current
18
+ workspace as `cwd`; omit effort unless the task explicitly requests it. Wait
19
+ for the result. If it is `done`, return the result and its evidence footer. If
20
+ it is not done, report the error and stop reason clearly and stop.
@@ -0,0 +1,6 @@
1
+ Parse arguments after this command as key=value pairs and call the
2
+ `dsh_worker_config` tool. Supported keys include enabled, tier, effort, mode,
3
+ timeout, policy, escalate, collab, main, flash, pro, review and reset. With no
4
+ arguments read the current configuration. Show one compact table including
5
+ hub_reachable, effective flash/pro state, effective policy and routing guidance.
6
+ Name changed fields. Reply in the user's language and do nothing else.
@@ -0,0 +1,4 @@
1
+ Call the `dsh_worker_status` tool and show one compact table with job id,
2
+ tier/effort, status and current tool, progress, tokens and task summary. If
3
+ there are no jobs, say so in one line. Reply in the user's language and do
4
+ nothing else.