deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:chupeter854-lang/dsh-approval-autofocus
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Make Enter approve a pending DSH approval, without clicking the card first.
A tiny, dependency-free client plugin for DeepSeek Harness (DSH) Web / Desktop profiles. Once an approval card appears, focus is already inside it, so:
Enter → Allow onceEsc → RejectDSH's approval card (@deepseek-ai/dsh-client-ui-approval) does bind Enter/Escape — but only when the card already contains document.activeElement:
if (event.defaultPrevented || !event.currentTarget.contains(document.activeElement) || ...) return;
The card is rendered as a composer takeover: the composer it replaces is hidden with display:none, so the browser drops focus back to <body>, and the card never focuses itself. A plain Enter therefore lands nowhere — you have to click the card's text once before the documented "Enter approves / Esc rejects" actually works.
Without this plugin: click anywhere on the card's text, then press Enter.
It watches the DOM and, as soon as an approval card appears, moves focus into the card's detail area — but only when nothing else owns the focus:
| Current focus | Behavior |
|---|---|
<body>, or lost to the composer takeover |
focus moves into the card |
| terminal, dialog, any input / contenteditable | left alone — focus is never stolen |
The card's own behavior is untouched: the Reject button, Esc, IME composition handling and the pending-request lock all still work exactly as shipped.
Approval is a security decision, and this plugin deliberately makes it a one-keystroke action — worth knowing what that means:
Enter still has to come from you.<body> or the hidden composer). While you are typing in a terminal, a dialog or any input, it does nothing.Enter (prompt injection), the card being pre-focused means a stray Enter approves it. If that concerns you, click away — the plugin will not fight you for focus — or disable the plugin.Enter at worst edits nothing and at most is a no-op inside the card's detail area.~/plugins/dsh-approval-autofocus;⚠️ DSH links to that directory: moving or deleting it breaks the plugin.
Paste the repository URL into the same dialog. There is no hosted repository yet — the archive above is the shipped form.
Add the package to dsh.profile.bundles in ~/.dsh/profiles/<profile>/package.json, or insert one row in that profile's cordis.patch.yml:
- insert:
- id: approval-autofocus
name: dsh-approval-autofocus
Disable or uninstall the bundle on the Plugins page. Nothing outside the plugin's own directory is modified.
node test/focus.test.mjs
Fourteen checks against a hand-written DOM stub (no test framework, no dependencies): focuses on appearance, never focuses twice, reclaims focus lost to the composer takeover, never steals focus from a terminal/dialog/editor, re-focuses a replacement card, stops observing when disposed — with or without a lifecycle hook.
A DSH plugin bundle is a package that declares a Node half (main) and a browser half (dsh.client + exports["./client"]). The Node half here is empty — it exists so the profile has a loader row that makes the browser half get served and mounted. The browser half is a plain window.__ModuleLoader__.load({ id, factory }) bundle with no imports.
data-approval-scroll attribute, with [data-approval-key] [tabindex="0"] (excluding buttons and other action controls) as a fallback. If DSH restructures the card, the plugin silently stops working and you are back to "click the card, then press Enter".0.2.0-rc.2. It is an unofficial community plugin, not part of DSH.MIT — see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。