Preface¶
Integrating external hardware into DSH (DeepSeek Harness) generally requires writing a bridge layer yourself: handling connection and pairing, synchronizing device status, and considering security confirmation when AI issues commands. This is especially true for devices like DG-LAB—connecting the phone APP, the local control agent, and the device requires breaking down the barriers, and the AI side needs a set of clearly defined tools.
dsh-dglab, written by lindog114514, turns this entire set into a Web platform plugin: the AI side gets the dglab-kit toolkit, and the Web UI provides a QR code pairing panel. Below is an introduction to its features, installation steps, and typical usage.
What is this¶
One-sentence positioning: DG-LAB control plugin, providing the dglab-kit toolkit to AI, plus a Web UI for scanning and pairing the phone APP.
- Repository:
lindog114514/dsh-dglab, version 1.0.0 - License: MIT (dependencies dglab-kit / qrcode-generator are also MIT)
- Runtime requirements:
enginesrequires dsh >=0.0.1, node >=22;platformis web
The supported devices are DG-LAB’s Coyote / Opossum / Mongoose series. The method of integration involves scanning the panel QR code with the DG-LAB 4 APP on the phone, connecting the phone to the plugin’s local control agent, and then AI issuing commands through the toolkit.
Core Features¶
10 AI Tools¶
The plugin registers 10 dglab_* tools, covering: connection, status query, device refresh, intensity (absolute / relative / temporary), waveform, cleanup, and disconnection. Parameters like intensity steps are validated within the tools, clear error messages are provided on failure, and device types (Opossum / Coyote / Mongoose) are displayed in Chinese names.
QR Pairing Panel¶
The pairing QR code is generated locally as SVG. The panel defaults to the bottom left of the Web UI, is draggable, and its position is remembered.
Electro-stimulation Command Confirmation¶
When AI sends an electro-stimulation command, a popup appears by default with three options: Execute once / Allow permanently / Reject. Preferences are remembered per session.
Cross-session Shared Connection¶
Any session shares a single DG-LAB connection; newly opened sessions can directly see the paired devices.
Auto-refresh Status¶
The device status cache is silently refreshed with every conversation, without injecting prompts. When AI uses tools to query, it always gets the latest status.
Installation and Enablement¶
This is a Web platform plugin, client.platform in package.json is web, injecting @deepseek-ai/dsh-client-runtime and @deepseek-ai/dsh-client-ui-conversation client packages. Therefore, after installation, dsh web must be restarted to take effect. Enable it in three steps below.
- One-click install:
dsh plugin --profile web add "github:lindog114514/dsh-dglab#main"
- Restart dsh web. First end the current dsh web process, then run it again:
dsh web
- Verify installation:
dsh --profile web --dump-config | findstr dglab
The output should include a line with dglab. After restarting, a QR code button will appear on the left side of the chat input box.
Typical Usage Flow¶
- Click the QR code button on the left of the input box to open the panel, then click “Connect”.
- Open the DG-LAB 4 APP on the phone and scan the panel QR code (the APP must be logged in and support V4 scanning).
- After the APP connects, the panel and
dglab_statuswill display device information: slotId, Chinese type name, and current intensity. - At this point, you can let AI control it (a confirmation box will pop up), or manually operate on the panel: ± intensity, play waveform, clear.
Applicable Scenarios and Notes¶
Suitable for people already using dsh web, who have DG-LAB devices (Coyote / Opossum / Mongoose), and want AI to safely operate hardware via tools.
A few notes:
- The plugin runs on the Web platform (platform: web), and
dsh webmust be restarted after installation for it to take effect. - Electro-stimulation commands require a popup confirmation by default; preferences are remembered per session. If you do not want AI to pop up frequently, choose “Allow permanently” during the confirmation.
- The plugin runs with the permissions of the current dsh process. It is recommended to read the source code and confirm the license before installing. This project, as well as dglab-kit / qrcode-generator, are all MIT.
- For usage issues, feedback can be provided at the author’s QQ group: 870333220.
Summary¶
dsh-dglab packages hardware bridging, pairing panel, command confirmation, and cross-session state sharing into a single plugin. After installing and restarting, it is ready to use, aligning with DSH’s philosophy of “everything is a plugin”.
- Plugin Directory Page (Community-maintained directory site, no official affiliation with DeepSeek / HF): https://www.skillhub.cn/plugins/lindog114514/dsh-dglab
- GitHub Repository: https://github.com/lindog114514/dsh-dglab