dsh-tui-command-ext
v0.1.0
Published
DSH web plugin: the TUI-inspired slash-command set for the web harness — /clear /rewind /fork /resume /archive /status /rename /unarchive /compact-fast /theme /lang.
Readme
dsh-tui-command-ext
A DeepSeek Harness web plugin that adds the minimal slash-command set a
normal harness needs, modeled after the command set of
dsh-tui. It merges the former
dsh-clear-command (/clear) and dsh-command-kit (the TUI command set)
into one package, built on the shared pattern (host registers in the
commands registry; client registers commandUi popupSelect
contributions).
Every command is a visual interaction — pickers, an info panel, and a navigation action — nothing echoes text into the conversation.
Part of the dsh-plugins collection.
Commands
Client popup commands (picker/panel opens on /name + Enter or a menu pick)
| Command | Description |
| --- | --- |
| /rewind | Pick one of your recent messages — the session forks at that turn and the child session opens (Claude Code style rewind, backed by sessions.fork). |
| /fork | Pick a name for the fork of the current session — the default is <title> fork, numbered when taken (<title> fork 2, fork 3, …). The child is created, renamed and opened. |
| /resume | Pick a session of the current workspace (most recent first) and open it. Archived sessions are marked 🗄 and listed last; picking one first restores it through the host /unarchive command channel, then opens it — the same session comes back with its title and history. |
| /archive | Archive the current session (hidden from the workspace; its log stays in storage) and jump to a fresh session entry of the current workspace — a single picker, no second confirmation dialog (the pick itself confirms; restorable via /resume). |
| /status | Read-only info panel: session id, title, workspace, agent preset, running state, and live context pressure (from the client-side token projections). Picking any row closes it. |
| /theme | Switch the color theme (built-in or custom), applied immediately. |
| /lang | Switch the UI language (en / zh), applied immediately. |
Host commands (free-text input / direct execution)
| Command | Description |
| --- | --- |
| /clear | Start a new session — the client half listens for the local command/executed acknowledgment and runs workspaces.startSession(), the same action as the sidebar "New session" button. |
| /rename <title> | Pin a new title for the current session — the composer shows a ghost-text hint after /rename , and the sidebar/header title updates live (the session/title domain event owns the payload). |
| /unarchive [sessionId] | Restore an archived session to the workspace list (no argument = current session). This is the command channel the /resume picker drives (session.command('/unarchive <id>')) — the only client→host RPC available to plugins, and the user-verified restore path. The dsh-workspace registry has no public unarchive API, so the handler runs its internal enqueueOperation → setState transaction (the shape archiveSession itself uses) to drop the id from archivedSessionIds; the browser's archived-sessions mirror refreshes automatically. |
| /compact-fast | Fast, rule-based context compression without any LLM call (mirrors Qwen Code's /compress-fast): tool results older than the 5 most recent become short placeholders (tool-call pairing intact), and reasoning/thinking blocks are stripped from assistant messages. Replacement events drop the provider usage sample so the context-pressure meter (which re-samples on assistant/message usage) keeps seeing the compressed surface — the UI context percentage drops immediately. No compression needed → "No compression needed."; agent running → busy error. Uses the official model-free prune protocol (compaction/prune + surface replace), so shadow pricing and replay stay correct. Complements the LLM-summary /compact (which stays untouched). |
Why
/unarchiveis a visible command. dsh's command catalog has no hidden-command support, andsession.command(...)is the only client→host RPC a plugin can use — so the/resumerestore path needs a registered host command. It doubles as a manual restore (/unarchivewith no argument restores the current session), but the primary entry point is the/resumepicker.
What is deliberately NOT included
Already provided by the harness or other plugins: /goal, /feedback,
/export, /model, /plan and /compact (the latter two mount per-agent
from the standard agent preset).
How it works
- Host half (
lib/index.js) registers/clear(its navigation runs on the client),/rename(free-text input needs the host command claim machinery),/unarchive(the restore command channel the/resumepicker drives) and/compact-fast(the non-LLM compaction pass needs the live session and the host-plane token meter). - Client half (
lib/client.js) registers therewind/fork/resume/archive/status/theme/langpopupSelect contributions throughctx.commandUi— the same mechanism the product's/modelcommand uses — and listens forcommand/executedto perform the/clearnavigation.options()failures andonSelect()failures surface as in-popup error text./statusreads the session list snapshot and thecontextPressureprojection entirely on the client;/archiveis a single picker (no second dialog);/forkforks viasessions.forkand renames the child through its session face.
Install
# from the collection root
./scripts/install.sh web plugins/dsh-tui-command-extManual equivalent: pnpm --dir ~/.dsh/profiles/web add <path>/plugins/dsh-tui-command-ext
and append {id: tui-command-ext, name: 'dsh-tui-command-ext'} to
~/.dsh/profiles/web/cordis.patch.yml (the running server hot-applies it).
Replacing the old plugins: remove the clear-command and command-kit
inserts from ~/.dsh/profiles/web/cordis.patch.yml and run
pnpm --dir ~/.dsh/profiles/web remove dsh-clear-command dsh-command-kit.
Then refresh the browser page once so the client bundle loads. The commands survive server restarts because the patch file is part of the profile's boot composition.
Uninstall
Remove the tui-command-ext insert from ~/.dsh/profiles/web/cordis.patch.yml
and run pnpm --dir ~/.dsh/profiles/web remove dsh-tui-command-ext.
