steve-magne/dsh-plugins--packages-command-deck0

@dsh-plugins/command-deck

DeepSeek Harness plugin: a right-docked Command Deck sidebar for the web surface — save shell commands, run them on the host, stream their output, stop them with one click

包名
@dsh-plugins/command-deck
版本
0.1.0
最近更新
2026年8月24日

安装

此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗

@dsh-plugins/command-deck

A DeepSeek Harness plugin: a Command Deck for the web surface (http://127.0.0.1:3080) — a right-docked sidebar where you save shell commands, run them on the harness host, watch their output stream in, and stop them with one click.

⚡ Command Deck   ← floating chip, bottom-right of the shell
┌──────────────────────────────┐
│ ⚡ Command Deck            ✕ │  Esc closes
│ Name (optional)              │
│ Shell command…        + Add  │
│ COMMANDS                     │
│ ▶ pnpm dev            🗑     │  saved locally (localStorage)
│ ▶ pnpm --filter web test 🗑  │
│ RUNS                         │
│ ● pnpm dev          running  │
│ │ [streaming stdout/stderr]  │
│ │               ■ Stop       │
└──────────────────────────────┘

How it fits DSH

Dual-face cordis plugin, the same shape as the built-ins:

HalfFileRole
Hostlib/index.jsRegisters a prefix route /command-deck/api on ctx.webServer; runs commands through ctx.subprocess (collect-mode stdio, tree-scoped terminate()); keeps an in-memory run registry
Browserlib/client.jsLazy-CJS factory bundle; injects a component into the runtime-owned shell.overlay slot; zero deps beyond shell-seeded React

The browser discovers the client bundle automatically: the node half of dsh-client-modules scans Loader entries for packages declaring dsh.client: { platform: "web" }, hashes exports["./client"] into window.__DSH_BOOT__, and serves it at /plugins/@dsh-plugins/command-deck/client.js.

Install

# 1. Link the package into the web-surface profile's plugin tree
mkdir -p ~/.dsh/profiles/web/node_modules/@dsh-plugins
ln -s /Users/stevemagne/workspace/dsh-plugins/packages/command-deck \
      ~/.dsh/profiles/web/node_modules/@dsh-plugins/command-deck

# 2. Mount it as a Loader entry (~/.dsh/profiles/web/cordis.patch.yml)
#    - insert:
#        - id: command-deck
#          name: '@dsh-plugins/command-deck'
#          config:
#            cwd: /path/to/your/default/working/directory

# 3. Restart the harness (quit dsh and relaunch) — the web surface has no
#    config hot-reload; new entries mount at boot.

A future pnpm install inside the profile may prune foreign symlinks — recreate step 1 if the deck stops loading after a profile reinstall.

Config (row config)

KeyDefaultMeaning
cwdharness process cwdDefault working directory; each run may override
shell/bin/bashExecutable launched as argv[0]
shellArgs["-c"]Arguments inserted before your command string
maxFinishedRuns100FIFO cap on retained settled runs

HTTP API (loopback only)

All endpoints answer JSON under the prefix route:

  • POST /command-deck/api/runs {command, label?, cwd?}201 run record
  • GET /command-deck/api/runs → registry snapshot, newest first
  • POST /command-deck/api/runs/:id/stop → tree-scoped SIGTERM→SIGKILL
  • DELETE /command-deck/api/runs/:id → discard (stops first when still running)
  • GET /command-deck/api/runs/:id/output?out=&err= → incremental deltas ({text, nextOffset, lossy} per stream; offsets are caller-owned)

Trust posture matches the harness web server itself: loopback bind, no auth, plus a Host allowlist (localhost/127.0.0.1/[::1]) against DNS rebinding. Commands execute with the full privileges of the harness process — treat the deck like a terminal into your machine.

Run records are in-memory: they survive page reloads while the harness lives (still-running ones are re-adopted by the panel) and end with the harness.

Tests

node test/run.mjs           # host half vs stub subprocess over real processes
node test/client-check.mjs  # client-bundle contract (factory form, slot entry)