@ran-sh/dsh-crew 1.1.1 → 1.2.0-rc.5

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.
Files changed (84) hide show
  1. package/.claude-plugin/marketplace.json +16 -17
  2. package/.claude-plugin/plugin.json +7 -1
  3. package/README.md +44 -15
  4. package/README.zh.md +37 -12
  5. package/agents/ds-flash.md +16 -18
  6. package/agents/ds-pro.md +16 -24
  7. package/agents/ds-reviewer.md +15 -15
  8. package/agents/ds-worker.md +16 -16
  9. package/bin/dsh-crew.mjs +16 -12
  10. package/codex/AGENTS.md +37 -85
  11. package/codex/agents/ds-flash.toml +18 -14
  12. package/codex/agents/ds-pro.toml +18 -15
  13. package/codex/agents/ds-reviewer.toml +17 -13
  14. package/codex/agents/ds-worker.toml +17 -13
  15. package/codex/prompts/dsh-config.md +17 -1
  16. package/codex/prompts/dsh-status.md +5 -1
  17. package/commands/config.md +16 -4
  18. package/commands/status.md +6 -2
  19. package/docs/installation.md +54 -9
  20. package/docs/readiness-matrix.md +14 -6
  21. package/docs/ui-surfaces.md +32 -17
  22. package/lib/client.js +769 -177
  23. package/official-web-bridge/lib/client.js +297 -209
  24. package/official-web-bridge/overlay-entry.mjs +59 -0
  25. package/package.json +6 -3
  26. package/scripts/build-client.mjs +2 -0
  27. package/scripts/setup.mjs +8 -7
  28. package/scripts/verify-crew-ui-polish.mjs +145 -0
  29. package/scripts/verify-history-ui.mjs +97 -0
  30. package/scripts/verify-npm-install.mjs +1 -1
  31. package/src/client/history-panel.tsx +108 -0
  32. package/src/client/host-readiness.mjs +15 -6
  33. package/src/client/index.tsx +91 -69
  34. package/src/client/model-callability-view.mjs +17 -0
  35. package/src/client/panel-chrome.tsx +40 -0
  36. package/src/client/quick-panel.tsx +88 -73
  37. package/src/client/readiness-envelope.mjs +34 -0
  38. package/src/client/task-telemetry.mjs +11 -4
  39. package/src/config-readiness.mjs +181 -115
  40. package/src/extension-contract.mjs +44 -26
  41. package/src/history/admission-gate.mjs +51 -0
  42. package/src/history/archive-store.mjs +261 -0
  43. package/src/history/cleanup-plan.mjs +64 -0
  44. package/src/history/http.mjs +32 -0
  45. package/src/history/operation.mjs +86 -0
  46. package/src/history/runner.mjs +51 -0
  47. package/src/history/runtime.mjs +28 -0
  48. package/src/history/service.mjs +137 -0
  49. package/src/history/state.mjs +27 -0
  50. package/src/hub/index.mjs +141 -24
  51. package/src/hub-client.mjs +17 -15
  52. package/src/image-output.mjs +71 -0
  53. package/src/install/install-legacy.mjs +126 -23
  54. package/src/install/npx-lifecycle.mjs +373 -64
  55. package/src/install/official-frontend-assets.mjs +78 -0
  56. package/src/install/payload-content.mjs +88 -0
  57. package/src/install/windows-startup.mjs +107 -19
  58. package/src/install/windows-supervisor-adapter.mjs +443 -0
  59. package/src/install/windows-supervisor-lifecycle.mjs +782 -0
  60. package/src/install/zcode.mjs +53 -14
  61. package/src/job-contracts.mjs +37 -31
  62. package/src/jobs.mjs +2 -2
  63. package/src/mcp-runtime.mjs +74 -9
  64. package/src/model-callability-contract.mjs +79 -0
  65. package/src/multimodal.mjs +0 -0
  66. package/src/official-web-bridge.mjs +0 -2
  67. package/src/provider-health.mjs +130 -124
  68. package/src/readiness-matrix.mjs +20 -15
  69. package/src/runtime-identity-contract.mjs +34 -0
  70. package/src/runtime-identity.mjs +14 -4
  71. package/src/runtime-readiness-snapshot.mjs +285 -87
  72. package/src/server.mjs +86 -76
  73. package/src/standalone-sdk.mjs +23 -0
  74. package/src/supervisor/restart-request.mjs +64 -10
  75. package/src/workflow-runtime.mjs +28 -13
  76. package/windows/start-dsh-crew.cmd +57 -57
  77. package/windows/start-dsh-crew.ps1 +327 -51
  78. package/windows/supervisor-control.ps1 +467 -0
  79. package/zcode/AGENTS.md +4 -1
  80. package/zcode/agents/ds-reviewer.md +31 -36
  81. package/zcode/agents/ds-worker.md +31 -39
  82. package/zcode/commands/dsh-config.md +17 -6
  83. package/zcode/commands/dsh-status.md +5 -4
  84. package/.mcp.json +0 -8
@@ -1,17 +1,16 @@
1
- {
2
- "name": "dsh-crew",
3
- "owner": {
4
- "name": "Ran-sh"
5
- },
6
- "metadata": {
7
- "description": "DSH Crew plugin marketplace (configurable worker dispatch for Claude Code / Codex)"
8
- },
9
- "plugins": [
10
- {
11
- "name": "dsh-crew",
12
- "version": "0.1.0",
13
- "source": ".",
14
- "description": "Dispatch subtasks to DeepSeek Harness (DSH) agents as native subagents with live progress"
15
- }
16
- ]
17
- }
1
+ {
2
+ "name": "dsh-crew",
3
+ "owner": {
4
+ "name": "Ran-sh"
5
+ },
6
+ "metadata": {
7
+ "description": "DSH Crew plugin marketplace (configurable worker dispatch for Claude Code / Codex)"
8
+ },
9
+ "plugins": [
10
+ {
11
+ "name": "dsh-crew",
12
+ "source": ".",
13
+ "description": "Dispatch subtasks to DeepSeek Harness (DSH) agents as native subagents with live progress"
14
+ }
15
+ ]
16
+ }
@@ -1,8 +1,14 @@
1
1
  {
2
2
  "name": "dsh-crew",
3
- "version": "0.1.0",
3
+ "version": "1.2.0-rc.5",
4
4
  "description": "Dispatch subtasks to DeepSeek Harness (DSH) agents as native subagents with live progress",
5
5
  "author": {
6
6
  "name": "ZSeven-W"
7
+ },
8
+ "mcpServers": {
9
+ "dsh-crew": {
10
+ "command": "node",
11
+ "args": ["${CLAUDE_PLUGIN_ROOT}/src/server.mjs"]
12
+ }
7
13
  }
8
14
  }
package/README.md CHANGED
@@ -1,25 +1,52 @@
1
1
  # DSH Crew
2
2
 
3
- An isolated Crew Harness for Codex Desktop, ZCode, and Claude Code. It
4
- provides Worker/Reviewer dispatch, model priorities, job tracking, and a
5
- capability-aware safety gate.
3
+ A Crew orchestration plugin for the official DeepSeek Harness. It adds
4
+ Worker/Reviewer dispatch, model priorities, job tracking, and a capability-aware
5
+ safety gate for Codex Desktop, ZCode, and Claude Code.
6
6
 
7
7
  [简体中文](./README.zh.md)
8
8
 
9
9
  ## Quick start
10
10
 
11
- Requirements: Node.js and Git.
11
+ Requirements: Windows, Node.js, and Git. Managed 3210 supervision is currently
12
+ supported on Windows; Linux and macOS are not yet production runtime targets.
13
+ The desktop frontend also requires the separately installed official CLI
14
+ (`npm install -g @deepseek-ai/dsh@latest`, providing `dsh.cmd` on PATH).
12
15
 
13
16
  ```bash
14
17
  npm install -g @ran-sh/dsh-crew@latest
15
18
  dsh-crew install
16
- dsh-crew integrate
17
- dsh-crew status
18
19
  ```
19
20
 
20
- Open <http://127.0.0.1:3080> for the daily console. On Windows, installation
21
- also registers login startup for the 3080 console; its official bridge starts
22
- and owns the isolated 3210 Harness backend.
21
+ DSH Crew is installed as a plugin in a dedicated official DeepSeek Harness
22
+ profile named `dsh-crew`, served on 3210. That profile is the canonical Crew
23
+ control and execution surface.
24
+
25
+ The desktop launcher opens the official Harness on 3080 and starts Crew on 3210
26
+ with no console window or automatic backend browser tab. Background/login startup
27
+ starts only Crew. The official profile is not modified by the Crew installer;
28
+ normal official application startup manages its own state.
29
+
30
+ On Windows, installation registers login startup. To start immediately and
31
+ open the Crew control:
32
+
33
+ ```powershell
34
+ & "$env:USERPROFILE\.config\dsh-crew\launchers\start-dsh-crew.cmd" --open
35
+ ```
36
+
37
+ The daily page is <http://127.0.0.1:3080/>. The backend settings remain available
38
+ at <http://127.0.0.1:3210/> when explicitly needed. Desktop launch mounts the
39
+ simple Crew panel using a Crew-owned `--patch` overlay, without installing it
40
+ into the official profile. Its button opens 3210; the backend button opens 3080.
41
+
42
+ Install, update, and rollback also converge the Windows watcher automatically:
43
+ the exact old watcher is handed off, and completion is reported only after the
44
+ new 3210 Crew and DSH versions are verified. No 3080 restart is involved.
45
+
46
+ ```bash
47
+ dsh-crew status
48
+ dsh-crew inspect
49
+ ```
23
50
 
24
51
  Fresh installs contain only the built-in DeepSeek route. Add your own provider
25
52
  credentials, model priorities, and optional integrations in the local Settings;
@@ -27,8 +54,8 @@ they are never bundled into this package.
27
54
 
28
55
  | Surface | Purpose |
29
56
  | --- | --- |
30
- | `3080` | Daily console, Crew settings, integrations, and jobs |
31
- | `3210` | Isolated Crew Harness, Providers, Harness Models, and low-level settings |
57
+ | `3080` | Daily official Harness `web` frontend; opened by the desktop launcher |
58
+ | `3210` | Hidden Crew backend; explicit advanced configuration via its web page |
32
59
 
33
60
  In **Settings → DSH Crew**, refresh Harness Models and order the Worker and
34
61
  Reviewer model lists. Then ask a host agent:
@@ -66,10 +93,12 @@ dsh-crew update # update and repair enabled integrations
66
93
  dsh-crew uninstall # remove managed files, keep backups/config
67
94
  ```
68
95
 
69
- The runtime is isolated under `~/.config/dsh-crew/harness` with `profile: dsh-crew`;
70
- the official `web` profile receives only the 3080 bridge.
71
- All production Worker/Reviewer model calls are executed by the isolated 3210
72
- Crew Harness; 3080 is a control-plane bridge only.
96
+ The dedicated official Harness runtime state is isolated under
97
+ `~/.config/dsh-crew/harness` with `profile: dsh-crew`; DSH Crew itself remains a
98
+ plugin, not a fork or replacement of DeepSeek Harness. The official `web`
99
+ profile is outside Crew ownership and read-only to Crew; in other words, the
100
+ official `web` profile is never mutated. An old 3080 bridge, if present, is
101
+ only reported as a deprecated diagnostic.
73
102
 
74
103
  ## Legacy launcher migration
75
104
 
package/README.zh.md CHANGED
@@ -1,31 +1,55 @@
1
1
  # DSH Crew
2
2
 
3
- 为 Codex Desktop、ZCode 和 Claude Code 提供隔离的 Crew Harness,支持
4
- Worker/Reviewer 调度、模型优先级、任务跟踪和能力感知安全门。
3
+ DSH Crew 是附着在 DeepSeek 官方 Harness 上的 Crew 编排插件,为 Codex Desktop、
4
+ ZCode 和 Claude Code 增加 Worker/Reviewer 调度、模型优先级、任务跟踪和能力感知安全门。
5
5
 
6
6
  [English](./README.md)
7
7
 
8
8
  ## 快速开始
9
9
 
10
- 需要 Node.js 和 Git。
10
+ 需要 Windows、Node.js 和 Git。目前受管 3210 监督仅支持 Windows;Linux 和 macOS
11
+ 暂不属于生产运行平台。
12
+ 桌面前台还需要单独安装官方 CLI:`npm install -g @deepseek-ai/dsh@latest`,
13
+ 并确保 PATH 中能找到 `dsh.cmd`。
11
14
 
12
15
  ```bash
13
16
  npm install -g @ran-sh/dsh-crew@latest
14
17
  dsh-crew install
15
- dsh-crew integrate
16
- dsh-crew status
17
18
  ```
18
19
 
19
- 打开 <http://127.0.0.1:3080> 进入日常控制台。Windows 安装会注册当前用户的
20
- 登录启动项,先启动 3080 控制台,再由官方桥接启动并监管隔离的 3210 Harness。
20
+ DSH Crew 安装在 DeepSeek 官方 Harness 的专用 `dsh-crew` profile 中,并由 3210
21
+ 提供服务。这个 profile 是 Crew 的 canonical control and execution surface。
22
+
23
+ 桌面启动器打开官方 3080,并在后台隐藏启动 Crew 3210,不自动打开后台网页。
24
+ 后台模式和登录启动项只启动 Crew。Crew 安装器不修改官方 profile;官方程序
25
+ 正常启动时自行管理它的运行状态。
26
+
27
+ Windows 安装会注册登录启动项。如需立即启动并打开 Crew 控制台:
28
+
29
+ ```powershell
30
+ & "$env:USERPROFILE\.config\dsh-crew\launchers\start-dsh-crew.cmd" --open
31
+ ```
32
+
33
+ 日常使用 <http://127.0.0.1:3080/>;需要后台高级配置时再访问
34
+ <http://127.0.0.1:3210/>。桌面启动通过 Crew 自有目录中的 `--patch` 叠加配置
35
+ 挂载简易面板,不写入官方 profile。3080 的按钮打开 3210,3210 的按钮打开 3080。
36
+
37
+ 安装、更新和回滚也会自动收敛 Windows watcher:系统会精确交接旧 watcher,
38
+ 并且只有在新的 3210 Crew 与 DSH 版本验证通过后才报告完成;整个过程不涉及
39
+ 重启 3080。
40
+
41
+ ```bash
42
+ dsh-crew status
43
+ dsh-crew inspect
44
+ ```
21
45
 
22
46
  全新安装只包含内置 DeepSeek 路由。其他 Provider 凭据、模型优先级和可选集成需要
23
47
  在本机设置中自行配置,绝不会打包进发布版本。
24
48
 
25
49
  | 界面 | 用途 |
26
50
  | --- | --- |
27
- | `3080` | 日常控制台、Crew 设置、集成状态和任务 |
28
- | `3210` | 隔离的 Crew Harness、Provider、Harness Models 和底层设置 |
51
+ | `3080` | 日常官方 Harness 前台,桌面启动时打开 |
52
+ | `3210` | Crew 后台执行实例,默认隐藏,需要时进入高级配置 |
29
53
 
30
54
  进入 **设置 → DSH Crew**,刷新 Harness Models,并分别排列 Worker 与 Reviewer
31
55
  的模型顺序。然后直接告诉 Codex、ZCode 或 Claude:
@@ -61,9 +85,10 @@ dsh-crew update # 更新并修复已启用集成
61
85
  dsh-crew uninstall # 移除受管文件,保留配置/备份
62
86
  ```
63
87
 
64
- 运行时隔离在 `~/.config/dsh-crew/harness`,使用 `profile: dsh-crew`;官方 `web` profile
65
- 只接收 3080 轻量桥接。
66
- 生产 Worker/Reviewer 的模型调用全部由隔离的 3210 Crew Harness 执行,3080 仅作为控制面桥接。
88
+ 专用的官方 Harness 运行时状态隔离在 `~/.config/dsh-crew/harness`,使用
89
+ `profile: dsh-crew`;DSH Crew 本身仍然是插件,并非 DeepSeek Harness 的分支或替代品。
90
+ 官方 `web` profile 不属于 Crew 且对 Crew 始终只读;旧版 3080 bridge 若仍存在,
91
+ 只会作为已弃用诊断项显示。
67
92
 
68
93
  ## 旧启动器迁移
69
94
 
@@ -4,23 +4,21 @@ description: DEPRECATED alias for ds-worker with a Flash model-class hint. DSH (
4
4
  model: haiku
5
5
  ---
6
6
 
7
- You are a thin dispatcher. You NEVER do the task yourself.
7
+ Deprecated ds-flash alias; prefer ds-worker/ds-reviewer for new work.
8
+ Thin dispatcher only: do not edit files or perform the delegated task locally.
8
9
 
9
- > Deprecation: this subagent is a compatibility alias. Use `ds-worker` for new
10
- > work — the backend now resolves the model from the Worker Model Policy, so
11
- > picking "Flash" here only sets the legacy model-class hint.
10
+ 1. Read dsh_worker_config if policy is unknown/changed; honor Auto, Manual and
11
+ disabled capabilities. Use role "worker", legacy_tier "flash".
12
+ 2. Call dsh_spawn_worker with the complete bounded objective, owned scope, cwd,
13
+ constraints and acceptance evidence; exclude unrelated chat history.
14
+ Backend policy selects models. Omit effort unless explicitly requested.
15
+ For explicitly read-only work only, use constraints: { allow_no_changes: true }.
16
+ 3. Save the workflow ID. Follow the same job_id via dsh_worker_result with
17
+ compact detail and a bounded wait within the host timeout. Running is not failure; never redispatch a duplicate.
18
+ 4. Return compact outcome, changed scope, tests, risks and delivery/review evidence.
19
+ Done alone is not success; failing tests or incomplete evidence are not approval.
20
+ Keep workflow ID and model metadata host-owned; do not forward workflow ID,
21
+ provider or model metadata as task requirements. Never invent missing counters.
12
22
 
13
- 1. Take the task you were given and pass it VERBATIM (plus any file paths / context you were given) to the `dsh_run_worker` tool with:
14
- - `role`: `"worker"`
15
- - `legacy_tier`: `"flash"` (legacy model-class hint only)
16
- - `effort`: omit it entirely (the session/global default applies) unless the task explicitly names an effort level
17
- - `cwd`: the current project directory
18
- 2. Wait for the tool to return.
19
- 3. If `status` is `done`: output the worker's `result` verbatim, then one footer line: `[ds-flash (deprecated) | tokens in/out: <input>/<output> | tool calls: <toolCalls>]`.
20
- 4. If `status` is not `done`: report the `error` and `stopReason` clearly, and include whatever partial `result` exists.
21
-
22
- DSH Crew policy (checked in the backend, not by you):
23
- - If the tool answers with a policy error (e.g. TIER_DISABLED, SUBAGENTS_DISABLED, ROLE_DISABLED), report it to the user verbatim — do NOT do the task yourself and do NOT retry with another tier.
24
- - This alias maps to the worker role. The actual provider/model is decided by the backend.
25
-
26
- 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.
23
+ If required Crew capability fails, report bounded evidence and await the operator's
24
+ repair-or-local decision. Do not repair, fall back or switch tiers yourself.
package/agents/ds-pro.md CHANGED
@@ -4,29 +4,21 @@ description: DEPRECATED alias for ds-worker with a Pro (strong) model-class hint
4
4
  model: haiku
5
5
  ---
6
6
 
7
- You are a thin dispatcher. You NEVER do the task yourself.
7
+ Deprecated ds-pro alias; prefer ds-worker/ds-reviewer for new work.
8
+ Thin dispatcher only: do not edit files or perform the delegated task locally.
8
9
 
9
- > Deprecation: this subagent is a compatibility alias. Prefer `ds-worker` for
10
- > implementation and `ds-reviewer` for independent review — the backend now
11
- > resolves models from the Model Policy, so picking "Pro" here only sets the
12
- > legacy strong model-class hint.
10
+ 1. Read dsh_worker_config if policy is unknown/changed; honor Auto, Manual and
11
+ disabled capabilities. Explicit review → role "reviewer"; otherwise role "worker". Preserve legacy_tier "pro".
12
+ 2. Call dsh_spawn_worker with the complete bounded objective, owned scope, cwd,
13
+ constraints and acceptance evidence; exclude unrelated chat history.
14
+ Backend policy selects models. Omit effort unless explicitly requested.
15
+ For explicitly read-only work only, use constraints: { allow_no_changes: true }.
16
+ 3. Save the workflow ID. Follow the same job_id via dsh_worker_result with
17
+ compact detail and a bounded wait within the host timeout. Running is not failure; never redispatch a duplicate.
18
+ 4. Return compact outcome, changed scope, tests, risks and delivery/review evidence.
19
+ Done alone is not success; failing tests or incomplete evidence are not approval.
20
+ Keep workflow ID and model metadata host-owned; do not forward workflow ID,
21
+ provider or model metadata as task requirements. Never invent missing counters.
13
22
 
14
- 1. Take the task you were given and decide the intended use: a review request
15
- (verify / review / check an implementation, "review pipeline") goes to
16
- `role: "reviewer"`; any other coding work goes to `role: "worker"` with the
17
- strong model-class hint.
18
- 2. Pass the task VERBATIM (plus any file paths / context) to `dsh_run_worker`:
19
- - `role`: `"reviewer"` for review requests, otherwise `"worker"`
20
- - `legacy_tier`: `"pro"` (legacy model-class hint only)
21
- - `effort`: omit it entirely unless the task names one
22
- - `cwd`: the current project directory
23
- 3. Wait for the tool to return.
24
- 4. If `status` is `done`: output the result verbatim, then one footer line:
25
- `[ds-pro (deprecated) | role: <worker|reviewer> | tokens in/out: <input>/<output> | tool calls: <toolCalls>]`.
26
- 5. If `status` is not `done`: report the `error` and `stopReason` clearly, including any partial `result`.
27
-
28
- DSH Crew policy (checked in the backend, not by you):
29
- - If the tool answers with a policy error (e.g. TIER_DISABLED, SUBAGENTS_DISABLED, ROLE_DISABLED), report it to the user verbatim — do NOT do the task yourself and do NOT retry with another tier.
30
- - Pro is a model-class hint, not a role: a worker can use strong candidates and a reviewer has its own independent policy.
31
-
32
- Do not edit files, run commands, or answer the task from your own knowledge. Your only job is dispatching to the DSH worker / reviewer and relaying its result faithfully.
23
+ If required Crew capability fails, report bounded evidence and await the operator's
24
+ repair-or-local decision. Do not repair, fall back or switch tiers yourself.
@@ -4,20 +4,20 @@ description: DSH (DeepSeek Harness) reviewer role - independent review of a comp
4
4
  model: haiku
5
5
  ---
6
6
 
7
- You are a thin dispatcher for the DSH reviewer role. You NEVER do the task yourself and you do not implement.
7
+ Thin dispatcher only: do not edit files or perform the delegated task locally.
8
8
 
9
- 1. Take the review request you were given and pass it VERBATIM (plus any file paths / context) to the `dsh_run_worker` tool with:
10
- - `role`: `"reviewer"`
11
- - `effort`: omit it entirely unless the request names one
12
- - `cwd`: the current project directory
13
- 2. Wait for the tool to return.
14
- 3. If `status` is `done`: output the reviewer's `result` verbatim (which includes the ## Review Findings / ## Evidence / ## Risks / ## Verdict sections), then one footer line: `[ds-reviewer | tokens in/out: <input>/<output> | tool calls: <toolCalls>]`.
15
- 4. If `status` is not `done`: report the `error` and `stopReason` clearly, including any partial `result`.
9
+ 1. Read dsh_worker_config if policy is unknown/changed; honor Auto, Manual and
10
+ disabled capabilities. Use role "reviewer".
11
+ 2. Call dsh_spawn_worker with the complete bounded objective, owned scope, cwd,
12
+ constraints and acceptance evidence; exclude unrelated chat history.
13
+ Backend policy selects models. Omit effort unless explicitly requested.
14
+ 3. Save the workflow ID. Follow the same job_id via dsh_worker_result with
15
+ compact detail and a bounded wait within the host timeout. Running is not failure; never redispatch a duplicate.
16
+ 4. Return compact outcome, changed scope, tests, risks and delivery/review evidence.
17
+ Done alone is not success; failing tests or incomplete evidence are not approval.
18
+ Keep workflow ID and model metadata host-owned; do not forward workflow ID,
19
+ provider or model metadata as task requirements. Never invent missing counters.
16
20
 
17
- DSH Crew policy (checked in the backend, not by you):
18
- - The reviewer is an independent role with its own model policy — it is not "the pro tier".
19
- - If the tool answers with a policy error (e.g. SUBAGENTS_DISABLED, ROLE_DISABLED), report it to the user verbatim — do NOT do the task yourself.
20
- - The reviewer role is Auto when the review workflow is active, or Manual when it runs only on explicit request. The tool refuses disabled roles itself.
21
- - A reviewer verdict cannot override failing tests: if the report shows tests_status=FAIL, surface that prominently to the user.
22
-
23
- Do not edit files, run commands, or answer the review from your own knowledge. Your only job is dispatching to the DSH reviewer and relaying its verdict faithfully.
21
+ If required Crew capability fails, report bounded evidence and await the operator's
22
+ repair-or-local decision. Do not repair, fall back or switch tiers yourself.
23
+ Review is read-only; report requested fixes, do not implement them.
@@ -1,23 +1,23 @@
1
1
  ---
2
2
  name: ds-worker
3
- description: DSH (DeepSeek Harness) worker role - executes implementation, fixes, tests, search and analysis. Delegates to dsh_run_worker and returns the worker's auditable result. The default coding role; do NOT pick models yourself.
3
+ description: DSH Worker dispatcher for bounded implementation, fixes, tests and inspection; backend policy selects the model. Return compact evidence, never implement locally.
4
4
  model: haiku
5
5
  ---
6
6
 
7
- You are a thin dispatcher for the DSH worker role. You NEVER do the task yourself.
7
+ Thin dispatcher only: do not edit files or perform the delegated task locally.
8
8
 
9
- 1. Take the task you were given and pass it VERBATIM (plus any file paths / context you were given) to the `dsh_run_worker` tool with:
10
- - `role`: `"worker"`
11
- - `effort`: omit it entirely (the session/global default applies) unless the task explicitly names an effort level
12
- - `cwd`: the current project directory
13
- - For an explicitly read-only search or analysis task that must make zero file changes, pass `constraints: { allow_no_changes: true }`. Otherwise omit this constraint.
14
- 2. Wait for the tool to return.
15
- 3. If `status` is `done`: output the worker's `result` verbatim, then one footer line: `[ds-worker | tokens in/out: <input>/<output> | tool calls: <toolCalls>]`.
16
- 4. If `status` is not `done`: report the `error` and `stopReason` clearly, and include whatever partial `result` exists.
9
+ 1. Read dsh_worker_config if policy is unknown/changed; honor Auto, Manual and
10
+ disabled capabilities. Use role "worker".
11
+ 2. Call dsh_spawn_worker with the complete bounded objective, owned scope, cwd,
12
+ constraints and acceptance evidence; exclude unrelated chat history.
13
+ Backend policy selects models. Omit effort unless explicitly requested.
14
+ For explicitly read-only work only, use constraints: { allow_no_changes: true }.
15
+ 3. Save the workflow ID. Follow the same job_id via dsh_worker_result with
16
+ compact detail and a bounded wait within the host timeout. Running is not failure; never redispatch a duplicate.
17
+ 4. Return compact outcome, changed scope, tests, risks and delivery/review evidence.
18
+ Done alone is not success; failing tests or incomplete evidence are not approval.
19
+ Keep workflow ID and model metadata host-owned; do not forward workflow ID,
20
+ provider or model metadata as task requirements. Never invent missing counters.
17
21
 
18
- DSH Crew policy (checked in the backend, not by you):
19
- - Which provider/model backs the worker is decided by the Worker Model Policy (you do not choose Flash vs Pro).
20
- - If the tool answers with a policy error (e.g. SUBAGENTS_DISABLED, NO_AUTO_TIER), report it to the user verbatim — do NOT do the task yourself.
21
- - The worker role may be Auto (the orchestrator may delegate automatically) or Manual (only use it when the user explicitly asked for a worker or picked you, the ds-worker subagent). The tool refuses disabled roles itself.
22
-
23
- 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.
22
+ If required Crew capability fails, report bounded evidence and await the operator's
23
+ repair-or-local decision. Do not repair, fall back or switch tiers yourself.
package/bin/dsh-crew.mjs CHANGED
@@ -1,12 +1,16 @@
1
- #!/usr/bin/env node
2
- // dsh-crew CLI entry for the packaged npm payload.
3
- //
4
- // npx @ran-sh/dsh-crew@latest install|status|update|uninstall
5
- // npm exec --package=@ran-sh/dsh-crew@latest -- dsh-crew status
6
- //
7
- // The lifecycle implementation lives in src/install/npx-lifecycle.mjs so the
8
- // commands are testable in-process; this wrapper only dispatches.
9
-
10
- import { runNpxCli } from '../src/install/npx-lifecycle.mjs';
11
-
12
- process.exitCode = await runNpxCli();
1
+ #!/usr/bin/env node
2
+ // dsh-crew CLI entry for the packaged npm payload.
3
+ //
4
+ // npx @ran-sh/dsh-crew@latest install|status|update|uninstall
5
+ // npm exec --package=@ran-sh/dsh-crew@latest -- dsh-crew status
6
+ //
7
+ // The lifecycle implementation lives in src/install/npx-lifecycle.mjs so the
8
+ // commands are testable in-process; this wrapper only dispatches.
9
+
10
+ import { runNpxCli } from '../src/install/npx-lifecycle.mjs';
11
+
12
+ if (process.argv[2] === 'history' && process.argv[3] === 'recover') {
13
+ const { runProductionHistory } = await import('../src/history/runner.mjs');
14
+ try { await runProductionHistory({ recover: true }); console.log('History maintenance recovered.'); }
15
+ catch { console.error('HISTORY_RECOVERY_REQUIRED: recovery did not complete; data and maintenance evidence were retained.'); process.exitCode = 1; }
16
+ } else process.exitCode = await runNpxCli();
package/codex/AGENTS.md CHANGED
@@ -1,95 +1,47 @@
1
1
  # Global capability-aware delegation policy
2
2
 
3
- The main Codex agent owns the user's task from planning through final delivery.
4
- DSH Crew is an execution and review capability that Codex may use after
5
- discovering what the current environment actually supports.
3
+ The main Codex agent owns the task through final delivery. DSH Crew is an optional
4
+ execution/review capability, not an automatic replacement for the main agent.
6
5
 
7
- ## Discover capabilities before delegation
6
+ ## Discover and choose
8
7
 
9
- - Before delegating substantial work, query DSH Crew's authoritative live
10
- configuration, capability, and readiness surfaces.
11
- - Discover capabilities dynamically from the returned contracts. Do not rely
12
- on a hard-coded list of roles, models, providers, tools, modes, or optional
13
- features; newly added capabilities should be considered automatically.
14
- - For every relevant capability, respect its reported availability, activation
15
- state, invocation mode, constraints, dependencies, and readiness evidence.
16
- - Treat installed, configured, enabled, and callable as different states. Use a
17
- capability only when the complete live execution path is ready.
18
- - Keep the capability snapshot for the current plan, and refresh it after a
19
- relevant configuration change or an availability, routing, credential,
20
- compatibility, or activation failure.
21
- - If discovery is unavailable or evidence is incomplete, fail closed: do not
22
- invent capabilities or repeatedly dispatch blind retries. If DSH Crew was
23
- selected for the task, apply the operator decision gate below.
8
+ Before substantial delegation, read the live Crew configuration, capability and
9
+ readiness contracts. Discover roles, models, modes and constraints dynamically;
10
+ installed, configured, enabled and callable are different states. Refresh the
11
+ snapshot after relevant configuration or availability changes, not every small step.
24
12
 
25
- ## Operator decision gate when DSH Crew is unavailable
26
-
27
- - Once Codex has selected DSH Crew for any work unit, any condition that makes
28
- the required Crew capability unavailable or non-callable is a mandatory
29
- pause point, regardless of cause.
30
- - At this pause point, do not continue implementation, silently fall back,
31
- choose another execution path, or repair/reconfigure DSH Crew without new
32
- operator direction. Perform only the read-only diagnosis needed to report
33
- the blocker accurately.
34
- - Report the unavailable capability, bounded reason and evidence, and completed
35
- work. Then wait for the operator to choose one direction:
36
- 1. Repair or restore DSH Crew, then continue through DSH Crew.
37
- 2. Do not repair DSH Crew; continue with the main Codex agent.
38
- - Resume only after the operator gives a new instruction. If repair is chosen,
39
- verify live capability again before dispatch. If local execution is chosen,
40
- state that the affected work is no longer independently delegated.
41
- - This gate applies only after DSH Crew has been selected or explicitly
42
- requested. It does not force a pause when initial planning decides DSH Crew
43
- provides no benefit and the task should remain with the main agent.
44
-
45
- ## Decide what to delegate
46
-
47
- - Decompose the request into bounded work units before choosing an executor.
48
- - Match each unit against discovered capabilities. Use DSH Crew only where it
49
- provides a clear execution, isolation, parallelism, specialization, or
50
- independent-review benefit.
51
- - Delegate the smallest coherent unit that can be completed and verified
52
- independently. Do not delegate an entire request merely because it is large.
53
- - Keep ambiguity, dependency ordering, cross-cutting decisions, conflict
54
- resolution, external side effects, final integration, and user communication
55
- in the main Codex agent.
56
- - Respect reported concurrency and isolation limits. Parallelize only
57
- independent units with explicit, non-overlapping ownership.
58
- - Simple questions, explanations, small read-only inspections, and genuinely
59
- trivial edits should normally remain in the main agent.
60
- - Explicit user instructions override default routing, but never safety or
61
- capability boundaries.
62
-
63
- ## Execute and verify
13
+ Delegate bounded, independently verifiable units when isolation, specialization,
14
+ parallel work or independent review provides a benefit. Give each unit its objective,
15
+ owned files, workspace, constraints and acceptance evidence. Respect concurrency
16
+ limits and manual/disabled capabilities. Keep ambiguity, integration, external
17
+ effects and final communication in the main agent. Trivial work stays local.
64
18
 
65
- - Give each delegated unit a concrete objective, owned scope, workspace
66
- context, constraints, and required validation evidence.
67
- - Prefer isolated execution for code changes when supported. Review work must
68
- remain read-only.
69
- - Consume compact structured results and canonical events. Do not move
70
- unbounded transcripts, raw provider payloads, credentials, or unnecessary
71
- patch content between agents.
72
- - The main agent must validate results, tests, changed scope, unresolved risks,
73
- and completion state before accepting delegated work.
74
-
75
- ## Review policy
76
-
77
- - Use available independent review for non-trivial code changes when its live
78
- invocation policy permits automatic use or the user requests manual use.
79
- - Never bypass a manual, disabled, unavailable, or restricted review boundary.
80
- - Treat requested changes, incomplete structured results, or missing direct
81
- evidence as not approved.
82
- - If selected DSH Crew review cannot run, apply the operator decision gate. The
83
- main agent may review locally only after the operator selects that path.
84
-
85
- ## Authority and completion
19
+ ## Operator decision gate when DSH Crew is unavailable
86
20
 
87
- - Delegation does not broaden authority. Publishing, pushing, messaging,
88
- credential changes, account actions, destructive operations, and other
89
- external effects still require authority from the user's request.
90
- - Do not present delegated work as complete until validation passes, structured
91
- results are complete, integration is checked, and permitted review
92
- requirements are satisfied or transparently reported as unavailable.
21
+ Once Crew is selected for a work unit, any required capability becoming unavailable
22
+ or non-callable is a mandatory pause, regardless of cause. Do not implement further,
23
+ repair/reconfigure Crew, silently fall back or switch execution paths. Perform only
24
+ bounded read-only diagnosis, report the evidence and completed work, and wait for
25
+ new operator direction: **repair Crew and continue through Crew**, or **do not repair
26
+ Crew and continue with the main agent**. After repair, verify live readiness again;
27
+ after local authorization, disclose that the affected work is not independently delegated.
28
+
29
+ This gate does not apply when initial planning chooses local work without selecting
30
+ Crew. A nonterminal wait is not an outage; continue the same workflow without duplicate
31
+ dispatch. Review findings and failing code tests are task results to address, not by
32
+ themselves evidence that Crew is unavailable.
33
+
34
+ ## Verify and finish
35
+
36
+ Consume compact structured results and canonical events. Check changed scope,
37
+ delivery completeness, tests, risks and the actual review verdict. Use independent
38
+ review for non-trivial code when available and its invocation policy allows it;
39
+ never bypass manual/disabled review. Requested changes or missing evidence are not
40
+ approval. If selected review cannot run, use the operator gate above.
41
+
42
+ Continue authorized work after a successful subtask; do not stop at its checkpoint.
43
+ Delegation grants no new authority to push, publish, message, change credentials or
44
+ delete data. Do not forward credentials, raw provider payloads or unbounded transcripts.
93
45
 
94
46
  ## Harness upgrade redlines
95
47
 
@@ -1,5 +1,5 @@
1
1
  # Codex agent role: DEPRECATED alias for ds-worker (Flash model-class hint).
2
- # Install: copy this file to ~/.codex/agents/ (or <project>/.codex/agents/).
2
+ # Install through dsh-crew; the installer resolves __DSH_CREW_ROOT__.
3
3
  # Prefer ds-worker; model selection is now handled by the Worker Model Policy.
4
4
 
5
5
  name = "ds-flash"
@@ -7,24 +7,28 @@ description = "DEPRECATED alias for ds-worker (DSH worker, Flash model-class hin
7
7
  model = "gpt-5.4-mini"
8
8
 
9
9
  developer_instructions = """
10
- You are a thin dispatcher. You NEVER do the task yourself.
10
+ Deprecated ds-flash alias; prefer ds-worker/ds-reviewer for new work.
11
+ Thin dispatcher only: do not edit files or perform the delegated task locally.
11
12
 
12
- > Deprecation: compatibility alias. Use ds-worker for new work; the backend resolves the model from the Worker Model Policy.
13
+ 1. Read dsh_worker_config if policy is unknown/changed; honor Auto, Manual and
14
+ disabled capabilities. Use role "worker", legacy_tier "flash".
15
+ 2. Call dsh_spawn_worker with the complete bounded objective, owned scope, cwd,
16
+ constraints and acceptance evidence; exclude unrelated chat history.
17
+ Backend policy selects models. Omit effort unless explicitly requested.
18
+ For explicitly read-only work only, use constraints: { allow_no_changes: true }.
19
+ 3. Save the workflow ID. Follow the same job_id via dsh_worker_result with
20
+ compact detail and a bounded wait within the host timeout. Running is not failure; never redispatch a duplicate.
21
+ 4. Return compact outcome, changed scope, tests, risks and delivery/review evidence.
22
+ Done alone is not success; failing tests or incomplete evidence are not approval.
23
+ Keep workflow ID and model metadata host-owned; do not forward workflow ID,
24
+ provider or model metadata as task requirements. Never invent missing counters.
13
25
 
14
- 1. Pass the task VERBATIM (plus any file paths / context) to the `dsh_run_worker` tool with role "worker", legacy_tier "flash", cwd set to the current workspace, and NO effort argument unless the task names one.
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 (deprecated) | tokens in/out: <input>/<output> | tool calls: <toolCalls>].
17
- 4. Otherwise report the error and stopReason clearly, including any partial result.
18
-
19
- DSH Crew policy (checked in the backend, not by you):
20
- - If the tool answers with a policy error (e.g. TIER_DISABLED, SUBAGENTS_DISABLED, ROLE_DISABLED), report it to the user verbatim — do NOT do the task yourself and do NOT retry with another tier.
21
- - This alias maps to the worker role; the actual provider/model is decided by the backend.
22
-
23
- Do not edit files, run commands, or answer from your own knowledge.
26
+ If required Crew capability fails, report bounded evidence and await the operator's
27
+ repair-or-local decision. Do not repair, fall back or switch tiers yourself.
24
28
  """
25
29
 
26
30
  [mcp_servers.dsh-crew]
27
31
  command = "node"
28
- args = ["/Users/fini/workspace/dsh-plugins/dsh-crew/src/server.mjs"]
32
+ args = ["__DSH_CREW_ROOT__/src/server.mjs"]
29
33
  default_tools_approval_mode = "approve"
30
34
  tool_timeout_sec = 3600