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, and
color-code the permission chip by preset. 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 |
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.
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 # 60 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.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 模式下工具调用自动放行
★ 7
MIT
JavaScript
Sep 29, 2026
dsh plugin --profile web add dsh-approval-modeby tianyaojiudi-prog
DSH(DeepSeek Harness) 插件:把一段可在设置页随时改写的文字,作为全局系统提示词段注入到所有会话,含子代理与工作流内部子代理;文本与开关即时生效,无需重启。
★ 8
MIT
JavaScript
Oct 4, 2026
dsh plugin --profile web add dsh-djy-xttscby 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 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
Sep 24, 2026
dsh plugin --profile web add dsh-power-switchby shuind
Compact Codex coding mode for DSH: light prompt guardrails against GPT over-explaining, with an editable prompt and native Codex-style tools.
★ 6
↓ 884/wk
MIT
TypeScript
Sep 21, 2026
dsh plugin --profile web add @shuind/dsh-codex-harnessby SiriLee
Per-edit approval gate for DeepSeek Harness — red/green line diff review before write/edit/stream operations · DSH 插件:逐操作审批门,write/edit/stream 执行前进行红绿行级 diff 审查
★ 3
↓ 197/wk
MIT
TypeScript
Sep 28, 2026
dsh plugin --profile web add dsh-edit-approval