Memory
dsh-plugins-an0range
An0range/dsh-plugins/packages/dsh-anno · ★ 0
选段批示与追问(静态组合面):选中文本→右键「选段批示」→批示卡片( 追问派发独立子会话并回贴报告 / +加入队列批量注入输入框)。host 服务 + 浏览器 UI。
Manifest details
安装
dsh plugin --profile web add 'github:An0range/dsh-plugins#884c726d329b42e04bef55be3792009daf58d1be&path:/packages/dsh-anno'GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
For install and environment setup, plus plugin development tutorials, see DSH community docs ↗
README
Table of contents
🌐 English | 中文
A personally maintained collection of dynamic Cordis plugins for DSH (DeepSeek Harness) —
one subdirectory per plugin, each with its own README; cross-plugin development pitfalls are
collected in PITFALLS.md (in Chinese). Currently included:
| Directory | Plugin | Latest | What it does |
|---|---|---|---|
anno/ |
Select & Annotate (选段批示与追问) | v2.5.0 | Select text → right-click 「选段批示」(Annotate) → annotation card (⚡ Ask in a child session with a configurable model and get the reply posted back / queue annotations for batch injection into the composer) |
linsp/ |
Layout Inspector (布局命名检查器) | v2.6.0 | Global shortcut enters naming mode: hover to highlight, click to copy 「region · element + XPath/getByRole」 — precise UI-element references for AI |
shot-helper/ |
Screenshot Helper (截图助手) | v1.8.0 | Release-assist tooling: drives page UI states and reports element rects (generic scroll/hover/hover-hold/click plus magenta frame/red guide ring and per-plugin flows), then crops element-level screenshots via Win32 scripts (all screenshots in this repo were shot by it) |
table-zoom/ |
Table Zoom (表格放大预览) | v1.0.0 | Wide tables scroll inside the message instead of overflowing it (GitHub-style CSS); hovering a table shows a mouse-following ⛶ button that opens a full-screen preview of the whole table |
Why these plugins
anno (Select & Annotate): AI replies can run dozens of screens. While reading you often want to
"jot something down here" or "ask about this sentence right now" — but breaking away to type in the
main conversation loses your place, and posting the follow-up into the main session pollutes its
context. anno offers two non-disruptive channels: right-click to stash the selection plus your note
in a queue (A1 A2 …), or dispatch it to an independent child session with a chosen model
(a /btw replacement); the reply is posted back into the conversation only when it is done.
Core value: reading flow stays unbroken, main-session context stays unpolluted.
linsp (Layout Inspector): when you tweak the DSH frontend or report a UI issue to an AI, the hardest part is "which element do I mean". Screenshots go stale and verbal descriptions are ambiguous. linsp lets you hover any element and copy an exact reference like 「region · element + XPath/getByRole」 with one click — pasting it to an AI makes you unambiguous. Core value: a shared naming language for UI elements between humans and AI.
shot-helper (Screenshot Helper): taking "element-level screenshots with context" of plugins by hand is slow and error-prone — arranging states and measuring coordinates manually drifts with every window change. shot-helper drives the page itself as a programmable object: it opens menus/cards/queues/dialogs automatically, reports exact rects, and crops pixel-precise shots with companion scripts after a one-time calibration. Core value: reproducible, automatable release screenshots; it also demonstrates an unusual use of dynamic plugins (the client half driving the page UI). End users don't need it — install it only when preparing a release.
table-zoom (Table Zoom): Markdown tables in AI replies are often wider than the message column — they either break the layout or force you to scroll sideways and read half-guessing. table-zoom keeps wide tables scrolling inside the table itself (GitHub-README-style: content-width layout, no column squashing); hovering a table shows a ⛶ button on its right edge that follows the mouse, and one click opens a full-screen preview of the whole table (with borders, header tint and zebra striping, light and dark theme aware). Core value: wide tables never break the reading layout, and the full view is one click away.
Screenshots
The red boxes in shots 02/05 are documentation overlays (drawn onto the screenshot), not part of the plugin UI. All screenshots above were driven by the bundled
shot-helper.
| Screenshot | Description |
|---|---|
| The DSH UI at a glance: the plugins add no permanent panel — just two small composer buttons (see 02) and a context menu | |
| Composer entry points: the red box marks the 「布局」(Layout, linsp) and 「划词」(Select-trigger, anno) buttons | |
| Select text → context menu: Copy / Annotate | |
| Annotation card: ⚡ Ask (dispatch an independent child session, model-selectable) / + Add to queue | |
Annotation queue strip (red box): one 【A1】… per line, inject all into the composer with one click |
|
| Settings → Plugins → Select & Annotate: select-trigger toggle, follow-up model choice | |
| Settings → Plugins → Layout Inspector: copied-content checkboxes, global shortcut | |
| Naming mode: hover highlight + 「region · element」 label, click to copy | |
| Hovering a wide table (table-zoom): the table scrolls inside itself instead of breaking the layout, and a mouse-following ⛶ zoom button appears on its right edge (marked with a red guide ring) | |
| Clicking ⛶ opens the full-screen preview: the whole table with borders, header tint and zebra striping; Esc or clicking the backdrop closes it |
Philosophy of restraint (design principles)
- One plugin, one job: anno handles "select → annotate / ask", linsp handles "inspect layout", shot-helper handles "take screenshots"; hover-naming once lived inside anno and was split out into its own plugin — restraint is a feature, not a bug.
- Never disturb the main session: follow-ups go to a child session, never into the composer; dispatch failures only show a toast, never a silent inline submit.
- Restrained triggers: the primary trigger is an explicit right-click menu; the select-to-trigger mode defaults to off and is opt-in.
- No overreach, no hidden writes, zero patch: plugins write only where they declare; debug facilities are stripped from release builds; no DSH source or deployment file is modified — plugins attach only through official extension surfaces (Slots / package-private RPC / host services / localStorage), so DSH upgrades do not break them.
- Always reversible: every version is an immutable package, older versions can always be rolled back (see version history below).
Installation (inside DSH)
Dynamic plugins have no npm distribution channel; installing means pasting the contents of the
plugin directory's host.js / client.js function bodies into code.host / code.client of
cordis_define, then cordis_run (anno shown as the example):
cordis_define({ plugin: {kind:'new', idPrefix:'annos'}, name:'Select & Annotate v2.5.0',
purpose:'…', code: { host: <contents of anno/host.js>, client: <contents of anno/client.js> } })
→ cordis_run(pluginId, packageId, 'run')
Notes:
- Each
*.jsfile is a function body (it ends withreturn { apply(ctx) { … } }); do not wrap it in another function. - Plugins live with the Harness process; after a restart you must define/run again (or mount them via an agent preset).
- To update, append a new package with
cordis_define(kind:'existing'), then switch withcordis_run(mode:'update').
Known limitations (pitfall log)
Developers and porters: see PITFALLS.md (in Chinese) — sandbox limits,
subagent provider, reportFrom constraints, the two-layer sandbox, z-index stacking, listener
stacking: 10 pitfalls in total, each tagged with a version status and the design causality.
Two more ecosystem-facing notes (in Chinese):
- Feature gap vs official DSH — these plugins complement the latest official DSH rather than duplicating it;
- Official extension-surface coverage — which official APIs are battle-tested by this repo and which remain community blanks.
Settings persistence
anno and linsp both use localStorage as the source of truth (settings survive plugin updates):
anno.settings.v1→{ quickTrigger: boolean }linsp.settings.v1→{ parts:{region,kind,snippet,xpath,role}, shortcut, hoverThrough }
Version history
anno: v1.0.0 → v1.5.0 → v1.6.0 → v1.6.4 → v1.7.2 → v1.8.0 (one-shot child-session attempt) → v1.9.0 (design dead end, do not use) → v2.0.0 → v2.1.0 → v2.2.0 (continuable child session) → v2.3.0 (configurable follow-up model) → v2.4.0 (fixed reply extraction) → v2.4.1 → v2.5.0 (release)
linsp: v1.0.0 → v2.0.0 → v2.1.1 → v2.2.0 → v2.3.0 → v2.4.0 → v2.5.0 → v2.6.0 (release)
shot-helper: v1.0.0 → v1.1.2 → v1.2.5 → v1.3.3 → v1.4.0 → v1.8.0 (release)
table-zoom: v1.0.0 (release)
Immutable packages are numbered per Harness process (pkg-N), so those numbers are not portable across deployments and are omitted here.
License
MIT © An0range