dsh-plan-workspace
A DSH agent-preset mode: read-only planning → reviewed exit → handoff.
「计划交接模式」:只读规划 → 评审后退出 → 写交接文档、按计划创建/登记工作区,再由本会话继续实施。
It is an agent preset, not a tool pack: installing the bundle adds a
plan-workspace preset to the preset picker, plus one global row that can
resume a handoff after a restart.
What happens in a planning session
- The session is forced into a read-only planning phase. Mutating tools
(write,edit,apply_patch, theops_*writers) are blocked by a tool
guard; the policy prompt makes "plan it, don't do it" explicit. - The agent explores, then presents a complete plan through
exit_plan_mode.
Rejecting the plan keeps the session planning and lets the agent revise. - On approval the plugin writes the handoff documents under
.dsh-plan-handoff//of the owning workspace, creates exactly
the workspaces declared in the plan's## 工作区section (every path must
stay inside the owning workspace), grants the approved permission and returns
control to the same session for implementation. - Optionally (
executionSession: "new") it starts a separate standard-mode
session in the owning workspace and hands the plan over with an automatic
first message.
Requirements
- DSH desktop with an agent-preset (
@deepseek-ai/dsh-agent-preset) capable
build; the bundled patch is a snapshot of the standard preset from DSH
0.2.2-rc.1. - Node.js 22+ inside the DSH runtime.
- No third-party runtime dependencies.
Install
- Open DSH desktop → Plugins → Add plugin and enter
dsh-plan-workspace(or a Git URL / local path to this package). - Quit the app from the tray and relaunch.
- Pick 计划交接模式 / Plan → Workspace in the preset picker of a new session.
The bundle patch inserts the preset row and the global
dsh-plan-workspace-relauncher row. It does not replace the official standard
preset.
Configuration (optional, on the preset row)
| Field | Default | Meaning |
|---|---|---|
section |
built-in policy | Planning system prompt; empty or non-string fails activation. |
executionSession |
same |
same = keep implementing in this session; new = start a standard-mode session. |
executorPreset |
standard |
Preset for the new executor session; plan-workspace is rejected (no recursion). |
createSubWorkspace |
false |
new only: true creates a child workspace for the plan instead of in-place docs. |
autoStart |
true |
new only: send the first implementation message automatically. |
enforceReadOnly |
true |
Guard mutating file tools while planning; the approved session is released automatically. |
slugMaxLength / maxDirLength |
48 / 240 |
Handoff directory name / full path limits. |
softStepLimit / hardStepLimit |
8 / 12 |
Step budgets; 0 disables one, hard must be ≥ soft. |
softTimeMinutes / hardTimeMinutes |
5 / 8 |
Time budgets in minutes; same rule. |
planLineTarget |
120 |
Advisory plan length written into the policy (40–400). |
executorPermissionPreset |
inherit |
inherit, danger-full-access or workspace-write. |
The ## 工作区 section
If the user asks for a specific number of workspaces, the plan must contain a
level-2 heading 工作区 and one bullet per workspace:
## 工作区
- plugins/alpha — Alpha 插件
- plugins/beta — Beta 插件
The handoff creates exactly those entries; without the section no workspace is
created. Paths are resolved against the owning workspace and must stay inside
it.
Known limitations
- The preset's plugin list is a snapshot of the standard preset; after a
DSH upgrade re-synccordis.patch.ymlif the standard preset gained tools. - Same-session execution keeps the lean planning toolset (no delegation, jobs,
schedule, goals, plugin manager, todo or present tools). Use
executionSession: "new"when a plan needs the full toolset. - Shell cannot be forced read-only: the guard blocks the common file
writers, butbash/pwsh/ops_bashcan still write. The policy prompt is
the first line of defence. - Budgets only nudge during planning; they never cancel steps by themselves.
- Permission widening requires an explicit authorization section in the plan;
otherwise the executor inherits the planning session's permissions. - Workspace count equals the number of declared bullets — directories created
ad hoc during execution are not registered automatically. - Plans sharing one workspace share one sandbox; use
executionSession: "new"
withcreateSubWorkspace: truewhen isolation matters. - The automatic post-restart continuation needs a
resume.pendingmarker
written before the restart; otherwise send "continue" yourself. - The plan card and review panel depend on the current client UI packages; re-check
after a DSH upgrade.
License
MIT. See LICENSE.