waterfish111/dsh-glance: Box on the screen, and the multimodal model understands.

Introduction

A common scenario in agent development: an error popup appears on the screen, requiring you to switch windows, copy, paste, and describe; or perhaps a chart, a formula, or a foreign language screenshot that you want to continue asking about. The traditional approach is to drop the screenshot into the chat window and type out a description again, leading to a mismatch between the question and the image.

dsh-glance (Glance), maintained by waterfish111, is a local plugin for DSH Desktop designed for this specific action. Clicking “Glance” in the session title bar brings a floating, pinned orb to the corner of the screen; clicking the orb and selecting any area sends the screenshot directly to a multimodal model, with streaming analysis displayed in the floating panel. Subsequent follow-up questions only send text, without retransmitting the image.

It solves a clear problem: compressing “screenshot + context description” into “box once, ask once”. However, it is not suitable for batch OCR, long document summarization, and only supports Windows.

Below, based on actual resources, we introduce what this plugin can do, how to install and use it, and where you might run into pitfalls.

Core Capabilities

dsh-glance is a local profile plugin for DSH Desktop. Its core process consists of just two steps: selecting a screen area and then asking a question based on that image. All capabilities revolve around this.

The floating orb supports: left-click to enter selection mode, drag to move without triggering selection accidentally, and a right-click menu to change appearance / restore default appearance / change orb size / exit. The orb size has 4 levels: Small 72, Standard 84, Large 96, Extra Large 108 (DIP). Selection takes effect immediately and is written to settings.json, used by the next startup.

The panel supports: the first round sends with the screenshot; subsequent input becomes a follow-up question with only text, reusing the same thread. “Stop” actually calls sessionController.cancel to interrupt the current round in Harness; generated parts are retained and labeled “Stopped”. “Reselect” changes the image and opens a new thread; the title bar can change appearance or collapse the panel.

On the command line side, there are three:

/glance or /glance status   Check if running
/glance on                  Start the floating orb (idempotent)
/glance off                 Stop the floating orb

Technically, there is no OCR and no local inference: screenshots enter the model context as base64, are sent to a dedicated session, and then sessionController.follow streams the answer back into the panel. Three processes communicate via three unidirectional pipes: index.js (Host) communicates with widget.ps1 (PowerShell + WinForms) via stdin/stdout; widget.ps1 embeds WebView2 to run panel.html; client.js polls the real status from /api/local/dsh-glance/status every 2 seconds and reflects the button status on the title bar.

Installation and Enablement

Confirm environment requirements first; otherwise, installation will stall during the runtime phase:

Item Requirement
System Windows 10 / 11
Host DSH Desktop (Local profile plugin mechanism)
Runtime Microsoft Edge WebView2 Runtime (Win11 usually pre-installed, Win10 may require manual install)
Script Windows PowerShell 5.1 (System built-in, widget.ps1 depends on it)
Model Default DeepSeek-V4.1-Flash natively supports images, no extra plugin needed; switching to a pure text model will fail

Put the repository in any local directory (do not place it in a location requiring admin privileges), then execute:

dsh plugin --profile desktop add 'link:D:/path/to/dsh-glance'

Open %USERPROFILE%\.dsh\profiles\desktop\package.json, confirm that the dsh.profile.bundles array contains "@local/dsh-glance", add a line if not:

"dsh": { "profile": { "bundles": [ "...", "@local/dsh-glance" ] } }

Note: Writing only to dependencies will not load it; dsh.profile.bundles is the layer list that determines which bundles to load. To repeat, without this step, the “Glance” button will not appear in the title bar after restarting.

Restart DSH Desktop; successful installation is confirmed when the “Glance” button appears in the session title bar.

Typical Usage

For first-time use, follow this sequence:

  1. Click “Glance” in the title bar → A floating orb appears on the screen, button changes to “Running”
  2. Click the orb → Screen freezes, drag to select the rectangle to analyze
  3. View the screenshot in the panel, optionally add a description (“What does this error mean” / “Help me fix this UI”)
  4. Click “Send” → Streaming answer appears in “Analysis Result”
  5. Continue typing → Button changes to “Follow-up” → Sends text only, no screenshot retransmission

One selection equals one thread. New screenshots automatically open a new session; follow-ups reuse the same thread. The session title includes a timestamp (Glance · 11-05 19:32), making it easy to find old threads later in the DSH session list. After the 6th follow-up on the same image, a soft hint is given to remind you to re-select when changing the topic.

Stop and Reselect are the two most common intervention actions: click “Stop” to interrupt the current analysis, click “Reselect” to change the image. Interrupted answers might be missing the end because messages already entered into the queue cannot be recalled.

Where Data is Stored

The plugin’s local state is under %LOCALAPPDATA%\dsh-glance\, and logs are in %TEMP%:

Location Content
%LOCALAPPDATA%\dsh-glance\state.json Current thread (v2: sessionId / title / startedAt / turns)
%LOCALAPPDATA%\dsh-glance\settings.json Floating orb size, e.g., {"ballSize":96}
%LOCALAPPDATA%\dsh-glance\ball.png Custom floating orb image
%LOCALAPPDATA%\dsh-glance\WebView2\ WebView2 user data directory
%TEMP%\glance-host.log Host-side log (commands, session creation, cancellation, failure reasons)
%TEMP%\glance-widget.log Widget-side log (DPI, selection, WebView2 init, menu actions)

The old state file format (v1, flat {sessionId,title}) will be automatically upgraded on first startup. Logs only record process flow and errors, not screenshot content.

Suitable Scenarios and Notes

Suitable for: Windows 10/11 + DSH Desktop environment, scenarios like error popups, formula derivation, charts, UI modification, foreign language screenshots where you can “glance and ask”. Not suitable for: OCR requiring batch text extraction, long document summarization, non-Windows environments.

A few usage limitations to note:

  • The panel only displays the current thread; previous Q&A bubbles are collapsible, older threads must be found in the DSH session list.
  • “Stop” interrupts the current round in Harness but does not recall messages already queued; send failures retry once automatically, the model side might see duplicate questions.
  • When the analysis session is deleted in DSH, the plugin automatically creates a new one and prompts at the top of the panel, old context is discarded.
  • Custom appearance is scaled proportionally: non-square images leave empty space, images smaller than 128×128 get enlarged and blurry; hover state is not distinguished.
  • The title bar button polls every 2 seconds; after exiting the orb menu, it takes up to 2 seconds to revert to “Glance”.
  • There is no protocol version handshake between host and widget: if versions are inconsistent (e.g., only one side updated), there is no explicit “version mismatch” error.

For troubleshooting, check logs first. No button in title bar -> check dsh.profile.bundles for @local/dsh-glance, then restart DSH. Orb not appearing -> check the last few lines of glance-host.log and glance-widget.log, most common is missing WebView2 Runtime or widget.ps1 blocked by security software. Orb present but unclickable -> first WebView2 init takes 1-2 seconds, check the webview init line in glance-widget.log if still unresponsive.

If analysis always fails, it is likely the current session’s model does not accept image input. The default DeepSeek-V4.1-Flash declares inputModalities: ["text", "image"] in DSH’s built-in model directory, ready to use out of the box; switching to a pure text model will reject images; switch back to a vision model. The panel shows specific errors to distinguish “model doesn’t accept images” from “network/auth failure”.

Privacy: Screenshots are only sent to the model provider configured in DSH; the plugin does not upload to other services. Screen capture only happens during active selection, not background continuous screenshots. The plugin itself does not save screenshots to disk (except in -SelfTest mode).

Uninstall in two steps:

dsh plugin --profile desktop remove @local/dsh-glance

Then remove "@local/dsh-glance" from dsh.profile.bundles and restart DSH. The local data %LOCALAPPDATA%\dsh-glance\ can be kept or deleted.

Version and Development

Current version 0.5.2 (beta), license MIT. Sampling version nodes to understand evolution: 0.5.0 introduced session lifecycle “one selection = one thread”, panel multi-round bubbles, stop preserving text; 0.4.2 made “Stop” actually interrupt Harness round; 0.4.0 implemented follow-up not retransmitting screenshots, DPI panel sizing; 0.3.0 renamed “Glance”, introduced WebView2 panel and streaming analysis.

Source code structure is as follows, worth reading before developing:

index.js              Host half: commands, sessions, subprocesses, image prompt, streaming back
client.js             Web half: title bar launch button + status polling
widget.ps1            Native widget: floating orb, frozen selection, WebView2 panel host
panel.html            Panel page (single file HTML/CSS/JS)
cordis.patch.yml      DSH bundle declaration
webview2/             vendored WebView2 SDK (Core / WinForms / Loader)
test/                 Regression tests

Test commands:

npm run check                               # One-click: JS syntax + host protocol/stop chain + panel script compile
npm test                                    # Run tests only (9 assertions + inline panel script)
powershell -STA -File .\widget.ps1 -SelfTest # Widget self-test: start panel, screenshot, exit, exit 0 is pass

Three hard constraints during development: widget.ps1 must remain UTF-8 with BOM (PowerShell 5.1 reads files without BOM as ANSI, causing Chinese garbled text and parsing failure); messages between host and widget are raw JSON lines, changing protocol requires changing index.js, widget.ps1, and panel.html in all three places; after changing widget.ps1, restart DSH because the host keeps the script as a subprocess and does not hot-reload.

Conclusion

The trade-offs of dsh-glance are clear: no OCR, no local inference, no extra dependencies, just minimizing the path of “screenshot + context”, at the cost of a persistent floating orb, Windows-only support, and the panel only retaining the current thread. For developers who need to check errors, charts, and UI daily, this cost is traded for saving one window switch and copy-paste.

Directory page: https://www.skillhub.cn/plugins/waterfish111/dsh-glance
Repository: https://github.com/waterfish111/dsh-glance

See docs/MANUAL.md in the repo for full instructions, and CHANGELOG.md for updates. Before installing, it is recommended to review the source code yourself to confirm it fits your model provider configuration.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye