@sshirkit/dsh-orchestrator 1.0.1 → 1.0.3
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/README.md +65 -30
- package/README.zh.md +62 -29
- package/lib/client.js +809 -311
- package/lib/delegate-status.js +42 -67
- package/lib/delegate.js +98 -140
- package/lib/gate.js +11 -5
- package/lib/index.js +533 -442
- package/lib/orchestrate.js +143 -129
- package/lib/read-index.js +186 -0
- package/lib/reconcile.js +2 -3
- package/lib/rules.js +22 -10
- package/lib/session-tools.js +516 -0
- package/lib/state-store.js +14 -9
- package/lib/supervise.js +69 -85
- package/lib/switch-notice.js +2 -2
- package/lib/timeline.js +23 -181
- package/lib/tool-surface.js +57 -9
- package/lib/worker.js +18 -7
- package/lib/worktree-manage.js +3 -10
- package/lib/worktree.js +3 -12
- package/lib/write-lease.js +57 -12
- package/package.json +1 -1
- package/lib/git-audit.js +0 -383
- package/lib/write-audit.js +0 -333
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|

|
|
14
14
|
|
|
15
|
-
[](https://github.com/SShiRkiT/dsh-orchestrator/releases/latest)
|
|
16
16
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
17
17
|
[](https://github.com/SShiRkiT/dsh-orchestrator)
|
|
18
18
|
[](https://nodejs.org)
|
|
@@ -27,6 +27,12 @@
|
|
|
27
27
|
|
|
28
28
|
**dsh-orchestrator** is a main/subagent orchestration plugin for local DeepSeek Harness (DSH) engineering sessions: hard guardrails keep the **main agent** focused on understanding requirements, breaking down tasks, overseeing progress, and final review, while **subagents** handle concrete implementation in parallel and in isolation.
|
|
29
29
|
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
https://github.com/user-attachments/assets/f540b545-c697-4bbc-abb2-d55f74041172
|
|
33
|
+
|
|
34
|
+
> [▶ Watch Bilibili Version. Really appreciate if hit a like button, if possible ヽ(・∀・)](https://www.bilibili.com/video/BV1b7yBznEM9/)
|
|
35
|
+
|
|
30
36
|
---
|
|
31
37
|
|
|
32
38
|
<div align="center">
|
|
@@ -44,9 +50,9 @@ It works smoothly alongside DSH's built-in collaboration tools and fills four pr
|
|
|
44
50
|
**Isolated workspaces for every write task — merge only after review**
|
|
45
51
|
> Write tasks run in parallel inside separate temporary Git working directories by default, leaving your active checkout untouched and never merging into your main branch without approval.
|
|
46
52
|
|
|
47
|
-
**Background check-ins during work,
|
|
48
|
-
> Periodically watches running subagents in the background so stuck or drifting work can be nudged back on track via `send_message
|
|
49
|
-
>
|
|
53
|
+
**Background check-ins during work, explicit review at handoff**
|
|
54
|
+
> Periodically watches running subagents in the background so stuck or drifting work can be nudged back on track via `send_message`.
|
|
55
|
+
> At handoff, use `worktree_manage` to review changes before deciding whether to merge or discard an isolated Worktree.
|
|
50
56
|
|
|
51
57
|
**One-shot parallel batches and multi-step pipelines**
|
|
52
58
|
> Run repetitive batches or multi-step pipelines without writing custom scripts — list the items and stages to advance automatically up to your concurrency cap, with single-item failures isolated.
|
|
@@ -83,13 +89,11 @@ Finished work is never merged into your main branch behind your back — you or
|
|
|
83
89
|
|
|
84
90
|
---
|
|
85
91
|
|
|
86
|
-
### 3.
|
|
92
|
+
### 3. Coordinate Write Scopes Before Work Starts
|
|
87
93
|
|
|
88
|
-
|
|
89
|
-
At handoff, the plugin also checks whether a subagent touched files outside its scope or missed required deliverables, and flags read-only tasks that attempted to write. You can see every subagent's progress and audit status at a glance.
|
|
94
|
+
In non-Git workspaces and shared mode, the plugin coordinates declared write scopes before a task starts. Each writable subagent declares its `writeScope`. The plugin rejects overlapping claims on the same physical paths. A write lease coordinates declared scopes only. Review deliverables separately after the task ends.
|
|
90
95
|
|
|
91
|
-
>
|
|
92
|
-
> Call `delegate_status` anytime to inspect running, audited, and pending-review status across all subagents.
|
|
96
|
+
> Use `delegate_status` to see direct delegates' execution and lease states and any Worktrees awaiting review.
|
|
93
97
|
|
|
94
98
|
---
|
|
95
99
|
|
|
@@ -98,8 +102,18 @@ At handoff, the plugin also checks whether a subagent touched files outside its
|
|
|
98
102
|
In the **Dispatch** panel next to the composer, main-agent and subagent models are configured completely separately:
|
|
99
103
|
- Both the default main model and default subagent model can be set explicitly.
|
|
100
104
|
|
|
101
|
-
>
|
|
102
|
-
> The workspace
|
|
105
|
+
> Specify a subagent model for a turn or workspace in your prompt or `AGENTS.md`. The main agent passes `provider` and `model` together and adds `reasoning_effort` only when requested.
|
|
106
|
+
> The workspace’s main-agent model can still be switched independently in DSH’s native model selector.
|
|
107
|
+
|
|
108
|
+
**Set up a tiered model routing table in `AGENTS.md` or your prompt**
|
|
109
|
+
|
|
110
|
+
Copy the table below into your workspace’s `AGENTS.md` or your prompt. The main agent reads and applies these rules; the plugin does not parse the table. An explicit route in the current message takes precedence over workspace rules. Replace the placeholders with actual provider and model IDs available in DSH. If no rule matches, omit all three route parameters.
|
|
111
|
+
|
|
112
|
+
| Task type | `provider` | `model` | `reasoning_effort` |
|
|
113
|
+
| --- | --- | --- | --- |
|
|
114
|
+
| Lightweight tasks (e.g. extraction or classification) | `<light-provider-id>` | `<light-model-id>` | Omit |
|
|
115
|
+
| Heavyweight tasks (e.g. architecture analysis or complex review) | `<heavy-provider-id>` | `<heavy-model-id>` | `high` (if supported by the model) |
|
|
116
|
+
| Other tasks | Omit | Omit | Omit |
|
|
103
117
|
|
|
104
118
|

|
|
105
119
|
|
|
@@ -119,10 +133,10 @@ The plugin checks running subagents' activity logs in the background at your con
|
|
|
119
133
|
|
|
120
134
|
### 6. Seamless Hot Reloads, Honest Cold-Restart Reconciliation
|
|
121
135
|
|
|
122
|
-
When the plugin hot-reloads, running subagents stay connected and background check-ins continue
|
|
136
|
+
When the plugin hot-reloads, running subagents stay connected and background check-ins continue. If you fully quit and reopen DSH, the plugin reconciles recorded Worktree, dispatch, and write lease states against the host. It releases leases for workers confirmed to have stopped and keeps protection when their status is uncertain.
|
|
123
137
|
|
|
124
|
-
>
|
|
125
|
-
> After a full restart,
|
|
138
|
+
> Uses the host's built-in storage for recovery, falling back to in-memory mode when storage is unavailable.
|
|
139
|
+
> After a full restart, the plugin does not automatically resume interrupted tasks.
|
|
126
140
|
|
|
127
141
|
---
|
|
128
142
|
|
|
@@ -132,6 +146,8 @@ For repetitive or multi-step jobs like "inspect → edit → verify across 20 fi
|
|
|
132
146
|
|
|
133
147
|
> Powered by `orchestrate`, supporting 1–64 items × 1–8 stages and 1–16 concurrent workers (default 4), with optional per-stage JSON format checks; in isolated mode each item gets its own working directory reused across stages, excluded from background check-ins.
|
|
134
148
|
|
|
149
|
+
To explicitly select a model for a stage, pass `provider` and `model` together in that `stages` entry, with optional `reasoning_effort`. Each stage chooses one whole route: **stage override > top-level batch override > panel default worker route**. Routes are never combined, and reasoning effort is not inherited from a fallback route. The panel default is required only when a stage needs it; if it is missing, the batch starts no workers.
|
|
150
|
+
|
|
135
151
|
---
|
|
136
152
|
|
|
137
153
|
<div align="center">
|
|
@@ -144,10 +160,16 @@ The plugin exposes 4 orchestration and review tools exclusively to the main agen
|
|
|
144
160
|
|
|
145
161
|
| Tool | What It Does | Common Parameters | Good to Know |
|
|
146
162
|
| --- | --- | --- | --- |
|
|
147
|
-
| `delegate` | Async task dispatch
|
|
148
|
-
| `orchestrate` | Parallel batch & multi-stage pipelines | `items` (1–64), `stages` (1–8, optional `schema`), `maxConcurrency` (1–16, default 4), `writeScope`, `readOnly`, `isolation`, `cwd`, `provider` + `model` |
|
|
149
|
-
| `delegate_status` |
|
|
150
|
-
| `worktree_manage` | List, inspect, merge, discard, or prune isolated directories | `action` (`list`/`inspect`/`merge`/`discard`/`prune`), `worktreeId` / `childId`, `strategy` (`merge`/`squash`/`ff-only`), `autoStageDirty`, `deleteAfterMerge`, `force`, `dryRun` |
|
|
163
|
+
| `delegate` | Async task dispatch with reuse first | `prompt`, `description`, `writeScope` (required for writes), `readOnly`, `isolation`, `allowNewReason`, `cwd`, `provider` + `model`, optional `team_task_id` | A reusable inactive child under the same parent blocks new dispatch with `delegate-reuse-required` and `details.candidates`. If a new child is necessary, supply a nonblank `allowNewReason`. Running delegates receive background check-ins. |
|
|
164
|
+
| `orchestrate` | Parallel batch & multi-stage pipelines | `items` (1–64), `stages` (1–8, optional `schema`), `maxConcurrency` (1–16, default 4), `writeScope`, `readOnly`, `isolation`, `cwd`, optional top-level `team_task_id`; `provider` + `model` with optional `reasoning_effort` at the top level or per stage | Route priority: stage override > batch override > panel default. Items advance independently, reuse their own isolated directory, and run synchronously without background check-ins |
|
|
165
|
+
| `delegate_status` | Query direct delegates or edit the next turn for an inactive direct delegate | `action` (`query` by default or `edit`), `childId` (required for `edit`), `writeScope` / `readOnly` (at least one for `edit`), `includeCompleted` (query default `true`), `limit` (1–64, default 20) | `query` shows execution, lease, and Worktree states. `edit` saves `pendingNextTurn`. Use `send_message` to apply it and wake the same child. |
|
|
166
|
+
| `worktree_manage` | List, inspect, merge, discard, or prune isolated directories | `action` (`list`/`inspect`/`merge`/`discard`/`prune`), `worktreeId` / `childId`, `strategy` (`merge`/`squash`/`ff-only`), `autoStageDirty`, `deleteAfterMerge`, `force`, `dryRun` | `inspect` shows the live diff, commits, and dirty state, including untracked paths. Merge conflicts preserve the Worktree for review. Cleaning up or discarding locks retired workers. |
|
|
167
|
+
|
|
168
|
+
To reuse an inactive child with a different write scope or read-only setting, first call `delegate_status` with `action: "edit"`, then use `send_message`. Before delivery, the plugin calls `replaceOwnerLease` to atomically replace the lease. A conflict prevents delivery, and a confirmed rejection rolls back the swap and restores the pending settings. If delivery is uncertain, the plugin keeps the new lease protection and blocks duplicate wakeups.
|
|
169
|
+
|
|
170
|
+
`readOnly` is available when **Enable the read-only parameter** is on for the current session. The same setting applies when editing the next turn to be read-only. With the option off, pass `isolation: "shared"` for read-only research, include the required `writeScope`, and explicitly tell the subagent to leave files untouched.
|
|
171
|
+
|
|
172
|
+
When native Agent Teams is on for the host's root session and dispatch mode permits `team_task_create` in that session, the main agent can create a shared goal before dispatching complex work. Pass the returned `id` as `team_task_id`; subagents (every stage in `orchestrate`) can read the goal with `team_task_get` when available. Keep the task prompt self-contained: the shared goal is a reference, not a substitute for dispatch or write leases.
|
|
151
173
|
|
|
152
174
|
---
|
|
153
175
|
|
|
@@ -213,26 +235,39 @@ dsh plugin --profile desktop add @sshirkit/dsh-orchestrator
|
|
|
213
235
|
|
|
214
236
|
## Right-Side Composer "Dispatch" Panel
|
|
215
237
|
|
|
216
|
-
The bilingual panel
|
|
238
|
+
The bilingual panel follows DSH's locale and provides live controls without a restart:
|
|
239
|
+
|
|
240
|
+
- **Enable dispatch mode** toggles the main-agent whitelist gate for open conversations.
|
|
241
|
+
- **Main agent / Subagent default model & reasoning effort** offers a searchable model picker for each route. In global mode, the main-agent default is saved to the host's `agent-default-model`. The worker route applies from the next dispatch unless a task or stage overrides it.
|
|
242
|
+
- **Subagent check interval / check count / Unlimited checks** can be adjusted while workers run.
|
|
243
|
+
- The **right-hand `Allowed Tools` checklist** lets you search, select tools for the main agent, and reset the list.
|
|
244
|
+
|
|
245
|
+
Starting with `v1.0.3`, **Only for this session** and **More** sit above a divider at the top of the right column. The switch applies to the entire panel. Turning it on saves a snapshot of the current settings, and subsequent edits stay in this session. The snapshot covers all ten settings: `enabled`, `worktreeIsolationEnabled`, `readOnlyEnabled`, `peerReadOnlyConsultEnabled`, `mainRoute`, `workerRoute`, `superviseIntervalSeconds`, `superviseMaxNoticesPerChild`, `superviseUnlimited`, and `allowedTools`.
|
|
246
|
+
|
|
247
|
+
Session mode leaves global settings and the host's `agent-default-model` intact. A session-specific main model takes effect on the next model step that has yet to be prepared. Turning **Only for this session** off clears the override and automatically restores the current global default model and settings. If session storage is unavailable, the switch is disabled and explicit global editing is still available.
|
|
248
|
+
|
|
249
|
+
**More** opens a separate dialog centered in the conversation. Dismiss it with the close button, `Esc`, or a click on the backdrop.
|
|
250
|
+
|
|
251
|
+
- **Enable Git Worktree isolation by default** (`worktreeIsolationEnabled`, defaults to `true`) controls isolation for Git write tasks using `isolation: "auto"`.
|
|
252
|
+
- **Enable the read-only parameter** (`readOnlyEnabled`, defaults to `false`) controls whether `delegate` and `orchestrate` expose and accept `readOnly`. With it off, the model is directed to use `isolation: "shared"` for read-only research that needs no isolation. If you enable it, we recommend also enabling **Allow peer consultation**.
|
|
253
|
+
- **Allow peer consultation** (`peerReadOnlyConsultEnabled`, defaults to `false`) lets subagents with the same parent in one session share an index of the files they have read and ask each other about that context via `send_message`. The index contains only paths and locations. The main agent silently filters recognized peer consultation relays.
|
|
217
254
|
|
|
218
|
-
|
|
219
|
-
- **Enable Git Worktree isolation by default**: controls `isolation: "auto"` behavior for Git write tasks;
|
|
220
|
-
- **Main agent / Subagent default model & reasoning effort**: searchable model picker; main writes host `agent-default-model` (new sessions only), subagent applies from the next dispatch;
|
|
221
|
-
- **Subagent check interval / check count / Unlimited checks**: adjusts sidecar supervision live while workers run;
|
|
222
|
-
- **Right-hand `Allowed Tools` checklist**: live search, toggle individual tools on/off, or one-click reset to defaults.
|
|
255
|
+
When the composer is centered on the new-session screen (the Hero layout), the Dispatch panel respects the viewport's safe edges and can open above or below the button to avoid being clipped by the top navigation bar.
|
|
223
256
|
|
|
224
257
|
## Configuration Reference
|
|
225
258
|
|
|
226
|
-
All
|
|
259
|
+
All 15 user-configurable fields below are `volatile` (dynamic hot config, no restart required: execution gates reread per call, tool surfaces update on the next request, and worker routes apply on the next dispatch):
|
|
227
260
|
|
|
228
261
|
| Field | Default | Description |
|
|
229
262
|
| --- | --- | --- |
|
|
230
263
|
| `enabled` | `true` | Master switch for dispatch mode. Turning it off restores the native host tool surface; `delegate` / `orchestrate` stay disabled and bound supervision-turn hard locks still take priority. |
|
|
231
|
-
| `worktreeIsolationEnabled` | `true` | Controls whether `isolation: "auto"` creates isolated
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
264
|
+
| `worktreeIsolationEnabled` | `true` | Controls whether `isolation: "auto"` creates isolated Worktrees for Git write tasks. Non-Git workspaces use shared mode with write leases. |
|
|
265
|
+
| `readOnlyEnabled` | `false` | Enables `readOnly` for `delegate` and `orchestrate`. When off, both tools hide and reject the argument, and the model is prompted to use the shared workspace for read-only research. |
|
|
266
|
+
| `peerReadOnlyConsultEnabled` | `false` | Lets sibling subagents in one session share a read-file index and consult each other via `send_message`. |
|
|
267
|
+
| `allowedTools` | Unset (9 base tools; plus 4 registered native Team tools when `allowAgentTeam: true`) | Explicit main-agent tool whitelist. An explicit array (including `[]`) **replaces** the defaults rather than appending. The panel's `Allowed Tools` checklist updates this field when **Only for this session** is off. |
|
|
268
|
+
| `allowAgentTeam` | `true` | Controls only the main agent's access to native task-board tools (`team_task_*`) in dispatch mode; it does not switch host Agent Teams on or off. `false` overrides the session and global whitelists. When the root session has native Agent Teams on and its whitelist permits `team_task_create`, the main agent can create a shared goal and pass its ID as optional `team_task_id` for subagents to read. |
|
|
269
|
+
| `workerProvider` | `""` | Default worker route provider. When no explicit override applies, both this and `workerModel` are required; there is no fallback to the main model. |
|
|
270
|
+
| `workerModel` | `""` | Default worker route model; same requirement as above. |
|
|
236
271
|
| `workerReasoningEffort` | `""` | Default worker reasoning effort; leave empty to let the chosen worker model use its own default. |
|
|
237
272
|
| `superviseEnabled` | `true` | Master switch for background sidecar supervision (in the host plugin settings card). |
|
|
238
273
|
| `superviseIntervalSeconds` | `600` | Sidecar supervision interval in seconds (`10–86400`); changes apply immediately to running workers. |
|
package/README.zh.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|

|
|
14
14
|
|
|
15
|
-
[](https://github.com/SShiRkiT/dsh-orchestrator/releases/latest)
|
|
16
16
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
17
17
|
[](https://github.com/SShiRkiT/dsh-orchestrator)
|
|
18
18
|
[](https://nodejs.org)
|
|
@@ -29,6 +29,11 @@
|
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
+
https://github.com/user-attachments/assets/f540b545-c697-4bbc-abb2-d55f74041172
|
|
33
|
+
|
|
34
|
+
> [▶ 查看B站版本 (可以的话帮忙点个赞, 谢谢了ヽ(・∀・)](https://www.bilibili.com/video/BV1b7yBznEM9/)
|
|
35
|
+
|
|
36
|
+
---
|
|
32
37
|
<div align="center">
|
|
33
38
|
|
|
34
39
|
# 插件特点与能力补齐
|
|
@@ -44,9 +49,9 @@
|
|
|
44
49
|
**独立工位隔离施工,验收后再合回**:
|
|
45
50
|
>写任务默认在各自的 Git 临时目录中并行干活,不碰你当前工作区,不擅自合并到主分支。
|
|
46
51
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
**过程自动巡检,交工显式评审**:
|
|
53
|
+
> 后台定时查看运行中的子代理。卡壳或跑偏时,主代理可用 `send_message` 纠偏。\
|
|
54
|
+
> 交工后用 `worktree_manage` 查看隔离工作树的改动,再决定合回或丢弃。
|
|
50
55
|
|
|
51
56
|
**批量活与多步流水线一键并行跑**:
|
|
52
57
|
>同类批量或串联多步骤任务无需手写脚本,填好清单和步骤即可按并发上限自动推进,单条报错互不拖累
|
|
@@ -84,13 +89,11 @@
|
|
|
84
89
|
|
|
85
90
|
---
|
|
86
91
|
|
|
87
|
-
### 3.
|
|
92
|
+
### 3. 开工前协调写入范围
|
|
88
93
|
|
|
89
|
-
|
|
90
|
-
交工时,插件还会自动核对子代理有没有偷改范围外的文件、约定交付的文件齐不齐,只读任务偷写也会告警;所有子代理干到哪一步、验收过没过,随时一目了然。
|
|
94
|
+
在非 Git 工作区或共享模式下,每个写任务通过 `writeScope` 声明修改范围。若实际路径重叠,插件会在启动前拒绝冲突的申请。写租约只协调声明范围,交工后由主代理另行验收。
|
|
91
95
|
|
|
92
|
-
>
|
|
93
|
-
>随时调用 `delegate_status` 查看全部子代理的运行、审计与待评审状态。
|
|
96
|
+
> 随时调用 `delegate_status` 查看直属委派的运行状态、写租约状态及待评审的工作树。
|
|
94
97
|
|
|
95
98
|
---
|
|
96
99
|
|
|
@@ -99,8 +102,17 @@
|
|
|
99
102
|
在输入栏右侧的「调度模式」面板里,主模型和子代理模型彻底分开配置:
|
|
100
103
|
- 默认主模型与子模型都可以指定设置。
|
|
101
104
|
|
|
102
|
-
>
|
|
103
|
-
|
|
105
|
+
> 可在提示词或 `AGENTS.md` 中指定本轮或本工作区的子代理模型,由主代理派发时成对传入 `provider` 和 `model`,并按需添加 `reasoning_effort`。工作区的主代理模型仍可在 DSH 原生模型选择器中独立切换。
|
|
106
|
+
|
|
107
|
+
**在 `AGENTS.md` 或提示词中配置分级模型路由表**
|
|
108
|
+
|
|
109
|
+
可把下面的表写进工作区的 `AGENTS.md` 或直接放入提示词。这是供主代理阅读和应用的规则,插件不会解析表格。当前消息显式点名的路由优先于工作区规则。请把占位符替换成 DSH 中真实可用的 Provider ID 和 Model ID;任务未匹配时,省略三个路由参数。
|
|
110
|
+
|
|
111
|
+
| 任务类别 | `provider` | `model` | `reasoning_effort` |
|
|
112
|
+
| --- | --- | --- | --- |
|
|
113
|
+
| 轻量任务(如提取、分类) | `<轻量-provider-id>` | `<轻量-model-id>` | 省略 |
|
|
114
|
+
| 重量任务(如架构推演、复杂复核) | `<重量-provider-id>` | `<重量-model-id>` | `high`(模型支持时) |
|
|
115
|
+
| 其他任务 | 省略 | 省略 | 省略 |
|
|
104
116
|
|
|
105
117
|

|
|
106
118
|
|
|
@@ -121,10 +133,10 @@
|
|
|
121
133
|
|
|
122
134
|
### 6. 热重载不断联,冷重启可对账
|
|
123
135
|
|
|
124
|
-
|
|
136
|
+
遇到插件热更新时,正在跑的子代理保持连接,后台巡检继续运行。彻底退出 DSH 再打开时,插件根据宿主状态核对工作树、委派和写租约。确认子代理已停止后释放租约,状态不明时保留保护。
|
|
125
137
|
|
|
126
|
-
>
|
|
127
|
-
>
|
|
138
|
+
> 插件使用宿主存储恢复记录,存储不可用时退回内存模式。\
|
|
139
|
+
> 彻底重启后不会自动续跑已中断的任务。
|
|
128
140
|
|
|
129
141
|
---
|
|
130
142
|
|
|
@@ -134,6 +146,8 @@
|
|
|
134
146
|
|
|
135
147
|
> 由 `orchestrate` 驱动,支持 1–64 个条目 × 1–8 个阶段、1–16 路并发(默认 4),每阶段可选 JSON 格式校验;隔离模式下按条目自动分配并跨阶段复用独立目录,不进入后台巡检。
|
|
136
148
|
|
|
149
|
+
显式指定某个阶段的模型时,在对应的 `stages` 条目中成对传入 `provider` 和 `model`,可同时传入 `reasoning_effort`。每个阶段按 **阶段覆盖 > 顶层批次覆盖 > 面板默认子代理路由** 的顺序选择整组路由,不跨层拼接,也不从后备路由继承推理强度。仅当某个阶段需要回退到面板默认路由时,才要求面板已配置子代理模型;缺失时整批不会启动。
|
|
150
|
+
|
|
137
151
|
---
|
|
138
152
|
|
|
139
153
|
<div align="center">
|
|
@@ -146,10 +160,16 @@
|
|
|
146
160
|
|
|
147
161
|
| 工具 | 做什么用 | 常用参数 | 注意事项 |
|
|
148
162
|
| --- | --- | --- | --- |
|
|
149
|
-
| `delegate` |
|
|
150
|
-
| `orchestrate` | 批量 / 多步骤流水线自动并行跑 | `items`(1–64)、`stages`(1–8,可配 `schema`)、`maxConcurrency`(1–16,默认 4)、`writeScope`、`readOnly`、`isolation`、`cwd
|
|
151
|
-
| `delegate_status` |
|
|
152
|
-
| `worktree_manage` | 查看、审阅、合并、丢弃或清理隔离目录 | `action`(`list`/`inspect`/`merge`/`discard`/`prune`)、`worktreeId` / `childId`、`strategy`(`merge`/`squash`/`ff-only`)、`autoStageDirty`、`deleteAfterMerge`、`force`、`dryRun` |
|
|
163
|
+
| `delegate` | 异步派活,优先复用 | `prompt`、`description`、`writeScope`(写任务必填)、`readOnly`、`isolation`、`allowNewReason`、`cwd`、`provider` + `model`、可选 `team_task_id` | 同一父会话存在可续跑的 `inactive` 子代理时拦截新建,返回 `delegate-reuse-required` 和 `details.candidates`。确需新建时传非空 `allowNewReason`。运行中受后台巡检覆盖。 |
|
|
164
|
+
| `orchestrate` | 批量 / 多步骤流水线自动并行跑 | `items`(1–64)、`stages`(1–8,可配 `schema`)、`maxConcurrency`(1–16,默认 4)、`writeScope`、`readOnly`、`isolation`、`cwd`、可选顶层 `team_task_id`;顶层或单个阶段均可指定 `provider` + `model`,可选 `reasoning_effort` | 路由优先级:阶段覆盖 > 顶层批次覆盖 > 面板默认;各条目独立推进,隔离模式按条目复用目录,同步等待,不进后台巡检 |
|
|
165
|
+
| `delegate_status` | 查询直属委派,或编辑闲置直属子代理的下一轮配置 | `action`(默认 `query`,或 `edit`)、`childId`(`edit` 必填)、`writeScope` / `readOnly`(`edit` 至少传一项)、`includeCompleted`(查询默认 `true`)、`limit`(1–64,默认 20) | `query` 查看运行、租约和工作树状态。`edit` 保存 `pendingNextTurn`,随后用 `send_message` 应用配置并唤醒同一个子代理。 |
|
|
166
|
+
| `worktree_manage` | 查看、审阅、合并、丢弃或清理隔离目录 | `action`(`list`/`inspect`/`merge`/`discard`/`prune`)、`worktreeId` / `childId`、`strategy`(`merge`/`squash`/`ff-only`)、`autoStageDirty`、`deleteAfterMerge`、`force`、`dryRun` | `inspect` 实时查看差异、提交和脏状态,含未跟踪路径。合并冲突时保留工作树供评审。清理或丢弃后锁定旧子代理。 |
|
|
167
|
+
|
|
168
|
+
复用闲置子代理时,如需调整写范围或只读设置,先调用 `delegate_status` 并指定 `action: "edit"`,再用 `send_message` 唤醒同一个子代理。插件在投递前用 `replaceOwnerLease` 原子替换写租约。租约冲突会阻止投递,明确拒投时回滚租约替换并恢复待应用配置。投递结果不明时保留新租约保护,并阻止重复唤醒。
|
|
169
|
+
|
|
170
|
+
`readOnly` 仅在当前会话开启「启用只读参数」时可用。将下一轮配置编辑为只读也受此开关控制。关闭时,做只读调研请传 `isolation: "shared"`,保留必填的 `writeScope` 声明,并在任务说明里明确禁止修改文件。
|
|
171
|
+
|
|
172
|
+
宿主根会话已开启原生「智能体团队协作」,且调度模式放行当前会话的 `team_task_create` 时,主代理可在派发复杂任务前建立共享目标,将工具返回的 `id` 作为 `team_task_id` 传给子代理(编排时传给每个阶段)。子代理可在 `team_task_get` 可用时读取目标作为参考;任务说明仍须自包含,共享目标不替代派发或写租约。
|
|
153
173
|
|
|
154
174
|
---
|
|
155
175
|
|
|
@@ -215,24 +235,37 @@ dsh plugin --profile desktop add @sshirkit/dsh-orchestrator
|
|
|
215
235
|
|
|
216
236
|
面板自动跟随 DSH 语言切换中 / 英文,提供免重启的实时控制项:
|
|
217
237
|
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
|
|
238
|
+
- **启用调度模式**可切换主代理工具白名单闸门,已打开的会话立即跟随生效。
|
|
239
|
+
- **主代理 / 子代理默认模型与推理强度**均可通过关键词搜索选择。全局模式下,主代理默认路由写入宿主 `agent-default-model`。子代理路由在下一次派发时使用,任务或阶段仍可显式覆盖。
|
|
240
|
+
- **子代理巡检间隔 / 巡检次数 / 无限巡检**可在运行中动态调整。
|
|
241
|
+
- **右侧 `Allowed Tools` 列表**支持按关键字搜索、勾选主代理可用工具和重置白名单。
|
|
242
|
+
|
|
243
|
+
自 `v1.0.3` 起,右栏顶部的「**仅当前会话**」开关和「**更多**」按钮位于分隔线上方,作用范围覆盖整个面板。开启后会保存当前设置的会话快照,之后的修改也只保存到当前会话。快照涵盖以下 10 项:`enabled`、`worktreeIsolationEnabled`、`readOnlyEnabled`、`peerReadOnlyConsultEnabled`、`mainRoute`、`workerRoute`、`superviseIntervalSeconds`、`superviseMaxNoticesPerChild`、`superviseUnlimited`、`allowedTools`。
|
|
244
|
+
|
|
245
|
+
会话模式会保留全局配置与宿主 `agent-default-model`。会话级主代理模型从下一个尚未准备的模型调用步骤(step)起生效。关闭「仅当前会话」会清除覆盖,自动恢复当前的全局默认模型及全局设置。若会话存储不可用,开关会禁用,仍可明确选择编辑全局设置。
|
|
246
|
+
|
|
247
|
+
点击「**更多**」会在会话中央打开独立浮窗,可用关闭按钮、`Esc` 或点击遮罩关闭:
|
|
248
|
+
|
|
249
|
+
- **默认启用 Git Worktree 隔离**(`worktreeIsolationEnabled`,默认 `true`)控制 `isolation: "auto"` 下 Git 写任务的隔离行为。
|
|
250
|
+
- **启用只读参数**(`readOnlyEnabled`,默认 `false`)控制 `delegate` 和 `orchestrate` 是否显示、接受 `readOnly`。关闭时,模型会被引导使用 `isolation: "shared"` 做无需隔离的只读调研。开启时建议同时打开「允许平级询问」。
|
|
251
|
+
- **允许平级询问**(`peerReadOnlyConsultEnabled`,默认 `false`)让同一会话中同属一个父代理的子代理共享已读文件索引,并用 `send_message` 互相咨询已读上下文。索引仅包含路径和位置信息。主代理会静默过滤已识别的平级咨询转发。
|
|
252
|
+
|
|
253
|
+
在新会话输入栏居中(Hero 布局)时,调度面板会避开顶部导航栏,按视口内可用空间自动向上或向下展开,减少截断。
|
|
223
254
|
|
|
224
255
|
## 配置项速查表
|
|
225
256
|
|
|
226
|
-
以下
|
|
257
|
+
以下 15 项用户可配参数均为 `volatile` 动态热配置,修改后无需重启 DSH(执行门禁每次调用重读、工具面下一次请求生效、子代理路由下一次派发生效):
|
|
227
258
|
|
|
228
259
|
| 配置项 | 默认值 | 说明 |
|
|
229
260
|
| --- | --- | --- |
|
|
230
261
|
| `enabled` | `true` | 调度模式总开关。关闭后一键恢复宿主原生工具面;`delegate` / `orchestrate` 仍禁用,已绑定巡检回合的硬禁仍优先。 |
|
|
231
|
-
| `worktreeIsolationEnabled` | `true` | 控制 `isolation: "auto"` 下是否为 Git
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
262
|
+
| `worktreeIsolationEnabled` | `true` | 控制 `isolation: "auto"` 下是否为 Git 写任务创建独立 Worktree。非 Git 工作区使用共享模式,由写租约协调声明范围。 |
|
|
263
|
+
| `readOnlyEnabled` | `false` | 开启后 `delegate` / `orchestrate` 可使用 `readOnly`。关闭时隐藏并拒绝该参数,模型会获得使用共享工作区做只读调研的提示。 |
|
|
264
|
+
| `peerReadOnlyConsultEnabled` | `false` | 开启后同一会话的平级子代理可共享已读文件索引,并通过 `send_message` 咨询。 |
|
|
265
|
+
| `allowedTools` | 未配置(默认 9 项基础工具;`allowAgentTeam: true` 时自动追加已注册的 4 项原生 Team 工具) | 主代理显式工具白名单。显式数组(包括 `[]`)会**替换**默认名单。关闭「仅当前会话」开关时,右侧 `Allowed Tools` 列表的改动实时写入此项。 |
|
|
266
|
+
| `allowAgentTeam` | `true` | 只控制调度模式下主代理能否调用原生 Team 任务板工具(`team_task_*`),不切换宿主「智能体团队协作」模式。设为 `false` 时优先于会话和全局白名单。宿主根会话已开启原生 Team 且会话放行 `team_task_create` 时,主代理可建立共享目标并用可选 `team_task_id` 传给子代理读取。 |
|
|
267
|
+
| `workerProvider` | `""` | 子代理默认路由 Provider。未命中任何显式路由覆盖时,必须同时配置此项和 `workerModel`;不会回退到主模型。 |
|
|
268
|
+
| `workerModel` | `""` | 子代理默认路由 Model;约束同上。 |
|
|
236
269
|
| `workerReasoningEffort` | `""` | 子代理默认推理强度;留空则由所选子代理模型自行决定默认值。 |
|
|
237
270
|
| `superviseEnabled` | `true` | 子代理后台旁路巡检总开关(位于宿主插件设置卡片)。 |
|
|
238
271
|
| `superviseIntervalSeconds` | `600` | 旁路巡检间隔(秒),范围 `10–86400`,运行中修改立即生效。 |
|