Browser & automation
dsh-delegate-runtime
Internal contract for calling the dsh bridge from commands and the dsh-delegate agent — subcommands, flags, environment, and failure handling. Read before composing any dsh-bridge.mjs invocation.
cpj-dev · AI review on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add cpj-dev/dsh-plugin-cc --skill dsh-delegate-runtimeAbout this skill
name: dsh-delegate-runtime description: Internal contract for calling the dsh bridge from commands and the dsh-delegate agent — subcommands, flags, environment, and failure handling. Read before composing any dsh-bridge.mjs invocation.
dsh bridge runtime contract
Every DeepSeek Harness interaction goes through one script:
node "${CLAUDE_PLUGIN_ROOT}/scripts/dsh-bridge.mjs" <subcommand> [flags] [text]
stdout is the user-facing result; render it verbatim. A nonzero exit means the run failed and stderr carries the reason.
Subcommands
| Subcommand | Purpose | Key flags |
|---|---|---|
check | readiness probe | --json |
setup | install the pinned npm CLI (or --harness <built-checkout>) and create/verify the multi-turn cc profile | --harness <path>, --mode, --json |
review | read-only code review | --base <ref>, --scope, --model, --effort, --mode, --background |
critique | structured adversarial critique | same as review |
run | task execution | --write, --session, --resume, --fresh, --model, --effort, --mode, --background, --prompt-file |
run-resume-candidate | is a resumable dsh session available? | --json |
import | weak-import this conversation into a resumable session | --source <jsonl> |
runs | list runs / one run's status | [run-id], --all |
show | stored result of a finished run | [run-id] |
stop | kill a run's process tree / the broker | [run-id], --broker |
Facts that shape correct usage
- Sandbox: default runs are read-only;
--writegrants workspace-write. There is no mid-run approval — permissions are decided before launch. - Fresh runs are one-shot headless dsh sessions and are NOT resumable. Only
--session,--resume, andimport(broker paths) record resumable session ids. --model/--effortwork on one-shot runs; a--resumekeeps the broker's startup model. Plugin defaults when omitted: modeldeepseek-v4-pro, effortmax(one-shot and broker alike).- Agent mode defaults to
standard(full toolset from request #1, no overlay).--mode minimallocks bash + str_replace_editor for the whole run;--mode anchored-standardshows that pair until this session records a tool call or assistant reply, then restores the full catalog.DSH_CC_MODEand the persisted/dsh:setup --modedefault sit between flag and built-in. A live broker keeps its startup mode — a--sessionrun resolving a different mode errors and names/dsh:stop --broker. --backgroundreturns immediately with a run id; the actual work continues in a detached worker. Pollruns <id>, fetchshow <id>.stopkills processes; a mid-turn broker stop discards all in-memory dsh sessions for the workspace.- Environment:
DSH_BINARYoverrides the dsh executable;DSH_CC_SESSION_ID/DSH_CC_TRANSCRIPT_PATHare exported by the SessionStart hook — never set them manually.
Failure handling
- "dsh CLI is not installed" → point the user at
/dsh:setup(or/dsh:checkfor the readiness report). - "cc profile" errors on
--session/--resume/import→ point at/dsh:setup. - "broker is busy" → one run at a time per workspace; wait or
stop --broker. - Structured critique that reports "unstructured output" still contains the raw review text; show it.