插件目录 / Developer / dsh-composer-enter-invert
dsh-composer-enter-invert
已验证 · 实测可装 XiaoYuOvO
功能简介
Portable DSH Web Composer Enter/Shift+Enter keybinding switcher
可用 — 实测通过,早期项目
Portable DSH Web Composer Enter/Shift+Enter keybinding switcher 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-composer-enter-invert
A DSH Web bundle plugin that changes Composer keyboard semantics only while the focused element is the conversation textarea.
Behavior
default(the durable default): Enter sends; Shift+Enter inserts a newline.inverted: Enter inserts a newline; Shift+Enter sends.- IME composition (
isComposingor key code 229) is never intercepted. - Other inputs, command controls, approval controls, and global shortcuts are not intercepted.
Open Settings -> General -> Composer send keys and choose the desired mode. Changes take effect immediately in the current Web page.
Design
The plugin does not replace the Composer or call the conversation transport itself.
In inverted mode, it installs one native capture-phase keydown listener and limits it to an enabled, writable textarea inside [data-composer-card] that is the active element.
- Plain Enter is prevented and inserts text with
document.execCommand("insertText", false, "\n"). AsetRangeTextplus bubblinginputfallback is used only when the browser rejectsexecCommand, so React's existingonChangecontinues to update the official draft machine and undo stack. - Shift+Enter is prevented, then replayed to the textarea as an Enter event with only
shiftKeyremoved. The replay is guarded with aWeakSet, letting the shipped ComposeronKeyDownexecute unchanged. That path still calls itskeyboard.arbitrate("enter", composing)andkeyboard.submit(resolveSubmitMode(...))logic.
Consequently, command-menu Enter arbitration, empty-draft protection, attachment-only sends, draft commit/restore, busy queue/steer policy, accelerated Ctrl/Cmd behavior, and image attachment handling stay in the shipped state machine. ui-conversation.busyEnter remains the authority for Queue versus Steer whenever a send is accepted during a running conversation.
If the setting is default, or this Client half is stopped/uninstalled, no event is intercepted and the shipped key behavior is untouched.
Persistence and portability
The selected mode is stored in browser localStorage under dsh-composer-enter-invert.v1. This keeps the setting self-contained, so a GitHub install does not require a matching Host settings namespace or a patch to dsh-host-apiproxy. The setting is browser-local rather than shared through settings.yaml; each browser profile can choose its own mode.
Build
The browser loader artifact is intentionally committed in lib/client.js; Git/local installs do not need a bundler during installation.
pnpm run build
pnpm run check
pnpm run test
Install into the web profile
The package includes the generated lib/ artifacts and can be installed directly from a public Git repository. Replace <owner>/<repo> with the repository containing this directory:
node "G:\Deepseek Harness Desktop\dependencies\dsh\node_modules\@deepseek-ai\dsh\lib\bin.js" plugin --profile web add "https://github.com/<owner>/<repo>.git"
node "G:\Deepseek Harness Desktop\dependencies\dsh\node_modules\@deepseek-ai\dsh\lib\bin.js" --profile web --dump-config
A tagged or commit-pinned source is preferable for repeatable installs, for example https://github.com/<owner>/<repo>.git#v0.2.0. The install command writes only to the selected web profile. Restart the existing DSH Web process after installation, then refresh http://127.0.0.1:3080. No global npm install, Host whitelist edit, or extra dependency installation is required.
Manual verification
- Select
Invertedunder Settings -> General -> Composer send keys. - In the focused Composer, press Enter and verify a newline appears.
- Type non-empty text and press Shift+Enter; verify the existing Composer sends it.
- With an empty Composer and no attachments, press Shift+Enter; verify no empty message is sent.
- While a primary agent is running, verify Shift+Enter follows the existing
busyEnterQueue/Steer choice. - Switch back to
Defaultand verify shipped Enter/Shift+Enter behavior resumes immediately.
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-composer-enter-invert」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:XiaoYuOvO/dsh-composer-enter-invert Headless(CLI)profile:
dsh plugin --profile headless add github:XiaoYuOvO/dsh-composer-enter-invert 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。