dsh-input-light
Manifest validInput Light — Tab cycles the DSH permission preset (Read Only ⇄ Workspace Write), ⌘S resumes interrupted work with two-step confirm, and the permission chip is color-coded by preset. Client-only DSH p
dsh-input-light
Composer-side conveniences for DeepSeek Harness (dsh):
cycle the permission preset with Tab, resume interrupted work with two taps of ⌘S,
color-code the permission chip by preset, and show the workspace path in the composer placeholder.
Client-only plugin, zero config, bilingual (en / zh).
What it does
| Feature | Trigger | Behaviour |
|---|---|---|
| Cycle permission presets | Tab | Read Only ⇄ Workspace Write — never auto-enters Full access / Auto |
| Resume interrupted work | ⌘S ×2, or the ↻ button next to the chip ×2 | Sends 你的工作中断了,请你继续。 |
| Preset colors | automatic | Read Only = amber, Workspace Write = blue, Full access = red |
| Workspace path in the placeholder | automatic | The composer placeholder shows the workspace's full path — or the host's own text when no path is available |
1. Tab cycles the permission preset
Read Only ⇄ Workspace Write
Why only two presets? As a command, /permission <preset> executes immediately, without
confirmation (only picking through the visible control asks you to acknowledge risk).
So the cycle deliberately stays inside the two safe presets — use the UI to reach Full access.
Pressing Tab while in a dangerous preset (Full access / Auto) falls back to Read Only.
2. ⌘S resumes interrupted work
Sends a fixed phrase: 你的工作中断了,请你继续。 ("Your work was interrupted, please continue.")
It submits through the host's own input surface, so it behaves exactly like pressing Enter:
ctx.sessions.binding(sessionId) // → session binding
→ ctx.uiSession.sourceFor(binding) // → that session's provide channel
→ .props.inputActions // → { setDraft, submit, … }
→ setDraft(RECOVERY_TEXT); submit();
The result is a real user/message in the session log (source.kind === "user"), not a call that
resolves while nothing happens.
⚠️ Counter-example, for the record:
ctx.remote.session.prompt(...)is an ACP protocol method. It resolves, but it does not produce a user message (0 entries in the session log, measured). Do not switch back to it.
Two-step confirmation (anti mis-tap) — shared by ⌘S and the button:
| Step | ⌘S | Button | Effect |
|---|---|---|---|
| First | tap once | click once | Enters confirm state: the button turns amber ✓, the tooltip becomes "press again to confirm" — nothing is sent |
| Second (within 3 s) | tap again | click again | Sends |
- Both paths share one state machine, so "
⌘Sonce, then click the button" also confirms. - The confirm window is 3 s; after that it reverts to the grey
↻. - The button carries a native tooltip showing the action and its shortcut (
⌘Skeycaps).
3. The permission chip is color-coded
| Preset | Color | Host theme variable |
|---|---|---|
| Read Only | amber | --dsw-alias-state-warn-primary |
| Workspace Write | blue | --dsw-alias-state-business-primary |
| Full access | red | --dsw-alias-state-error-primary |
Theme variables (not hard-coded colors) ⇒ follows light/dark automatically. The chip's original inline styles are saved and fully restored on unload — no residue.
4. The composer placeholder shows the workspace path
The placeholder is replaced by the current workspace's full path:
/Users/you/Develop/my-project
- The path comes from the host's own session list
(
sessions.list.getSnapshot().byId[sessionId].cwd— the same fieldui-conversationuses forrelativizeToCwd). The sidebar DOM carries no full path (the workspace row'stitleis only a display name), so there is deliberately no DOM fallback. - If no path is available (no session selected, session missing from the list, empty
cwd), the plugin puts the host's own text back. That text is read from the DOM and never hard-coded, so it still follows the language and the session state (parentOffline/unavailable/ …). - No styling is touched at all. The host already renders the placeholder as
white-space: nowrap; text-overflow: ellipsis, so an over-long path is ellipsised by the host's own rule and the composer keeps its native height. - That node belongs to React: the plugin rewrites the existing text node in place. Assigning
textContentwould swap the node out, stranding React's fiber — the placeholder would then freeze the next time the host changed its text. A fake-DOM test pins this.
Rebinding
Both shortcuts are registered with the host shortcut service, so they appear in the shortcut panel
(⌘/):
| Command id | Default | Action |
|---|---|---|
input-light.cycleMode | Tab | Cycle permission mode |
input-light.recover | ⌘S | Resume interrupted work (press twice) |
Change the keys in that panel — no code changes needed.
Install
plugin_manager action=install_bundle
target=<path-to>/dsh-input-light
See INSTALL.md. In short: register the bundle in your DSH profile, then restart DSH (a newly added bundle is only picked up at startup; later code edits only need a page refresh).
Implementation constraints
Read index.md for the full engineering log. The four constraints that caused every rewrite along the way:
-
External client plugins can only render into
root-scoped slots. Seats likeconversation.input.*arescope: "session": a plugin registration succeeds but never renders (5/5 seats measuredmounted: false). This plugin usesshell.overlay(kind: "list", scope: "root"). -
Shortcuts must go through
ctx.shortcuts. Raw DOMkeydownnever seesTabor⌘S— the host's keyboard layer consumes them before the DOM (plain characters arrive; those two never do). Registration also requiresregions: ['page', 'editable'], otherwise commands do not fire while the composer is focused. -
Cordis services and their sub-namespaces must be
injected. Accessing an undeclared one throws (cannot get property "remote.commands" without inject). -
Registration must be idempotent.
applyruns more than once; re-registering a command id throwsDuplicate shortcut command, and when that happens before the second command is registered, neither is registered — silently breaking a shortcut that used to work.
Self-check
node test/logic.test.mjs # 96 pure-logic cases, no DSH needed
In the browser console:
__dshInputLight.probe() // { chipFound, preset, sessionId, tooltip }
__dshInputLight.state() // result of the last cycle / recover
__dshInputLight.confirmStage() // 'idle' | 'confirm'
__dshInputLight.cycle() // cycle once, manually
__dshInputLight.confirm() // run the two-step confirm (same path as ⌘S)
__dshInputLight.send() // send without confirming (self-check only)
__dshInputLight.placeholderProbe() // { found, path, base, composed } — the two-line placeholder
__dshInputLight.restoreChip() // restore the chip's original styling
License
MIT © 2026 luzonghao
Comments
Loading…
Similar plugins
by NEVSTOP-LAB
DSH 审批模式插件,在 DSH 窗口的权限下拉框(Read Only / Workspace Write / Full Access)旁边加一个「审批模式」按钮,在 Workspace Write 模式下工具调用自动放行
★ 10
MIT
JavaScript
Nov 13, 2026
dsh plugin --profile web add dsh-approval-modeby vollegrewar
Layered syntax highlighting for bash/pwsh command and read code output in the DSH web GUI (VS Code Dark+ palette: keywords/strings/numbers/functions/comments each get a color); colors only what it rec
★ 0
↓ 112/wk
MIT
JavaScript
Sep 1, 2026
dsh plugin --profile web add dsh-tool-highlightby anticbv
DSH(DeepSeek Harness)字体颜色插件:正文/代码/终端/工作步骤四作用域独立调色,仅染对话区子树,宿主文件持久化跨重启保留,官方设置页原生集成
★ 0
MIT
JavaScript
Oct 24, 2026
dsh plugin --profile web add dsh-plugin-font-colorby SanYe-SanJiu
Windows-only process control for the harness: a sidebar button that shuts DSH down through the host's own graceful exit path, an app-window / normal-tab switch on the Plugins card that rewrites the de
★ 0
MIT
JavaScript
Oct 21, 2026
dsh plugin --profile web add dsh-power-switchby tianyaojiudi-prog
DSH(DeepSeek Harness) 插件:把一段可在设置页随时改写的文字,作为全局系统提示词段注入到所有会话,含子代理与工作流内部子代理;文本与开关即时生效,无需重启。
★ 9
MIT
JavaScript
Oct 4, 2026
dsh plugin --profile web add dsh-djy-xttscby gorban
DeepSeek Harness (dsh) plugin: stop a running background job from the session-header job list, behind a confirmation dialog.
★ 1
↓ 276/wk
MIT
TypeScript
Sep 20, 2026
dsh plugin --profile web add @gorban/dsh-job-stop