dsh-serial-debugger: Serial debugging in the DSH right sidebar

Introduction

When performing embedded systems or hardware integration, a serial port assistant is almost a standard tool: select a COM port, set the baud rate, view real-time data, and send commands to the device. Since DeepSeek Harness (DSH) consolidates the development environment into a single interface, switching separately to XCOM or the LubanCube (Zhengdian Atom) assistant causes window clutter and disrupts context.

The following introduces the community plugin dsh-serial-debugger (Maintainer: floydc-sz): It provides serial parameter configuration, real-time reception display, and data transmission as native tabs within the right sidebar of the DSH main interface. Its layout references common serial assistants, and colors and fonts follow the DSH theme. The plugin is categorized as a client, with a current GitHub star count of 1.

What is this

dsh-serial-debugger is a serial debugging plugin designed for DeepSeek Harness. The host side uses Node to register HTTP routes and manage the serial bridge subprocess; the browser side is a pre-built client bundle that renders a complete debugging panel within the DSH UI. Serial capabilities on Windows are implemented via a persistent PowerShell subprocess calling .NET’s System.IO.Ports. It does not rely on npm native extensions and requires no build steps.

The interface entry point is singular: the “Serial Debug” tab in the right sidebar of the Harness main interface. There is no left sidebar or independent settings page.

Core Features

The panel is divided into three sections from top to bottom: Parameters, Receiver, and Transmitter. It is adaptive for both narrow sidebars and wide panels.

Parameters and Connection

  • Serial Port Selection: The dropdown displays device descriptions in the format COM3:USB-SERIAL CH340; “Refresh” can be used to re-enumerate. It degrades to manual input when no serial ports are available.
  • Serial Parameters: Baud rate, Stop bits, Data bits, Parity (arranged in a 2x2 grid); parameters are locked once the serial port is opened.
  • Operations: Open/Close serial port, “Save Window” (exports receiver content to .txt), “Clear Receive”.
  • Toggles: Hexadecimal display, DTR, RTS, Auto-scroll, Timestamps.

Receive and Send

  • Receiver: Fills the remaining height, appending data in real-time; supports text or hexadecimal format and timestamps; pauses auto-scroll when manually scrolling up; sent content is displayed with a faded → prefix; the bottom status line displays connection status, current parameters, and byte/packet counts for both transmission and reception.
  • Transmitter: Input box supports sending via Ctrl+Enter; optional Hex sending (e.g., AA 55 01 or 0xAA,0x55), Send Newline (appends CRLF), Scheduled Send (period in milliseconds), and Send from File (chunked in 1 KB blocks with progress display).

Architectural Highlights (for Troubleshooting)

The browser polls for incremental state from the same-origin HTTP every approx. 250ms; the host maintains a bounded send/receive log and communicates with lib/serial-helper.ps1 via NDJSON over stdin/stdout. The route prefix is /dsh-serial-debugger, owned by the plugin and not subject to DSH’s /api token policy.

Installation and Activation

The plugin is a standard DSH package requiring Node >= 20, DSH ^0.2.0-rc.1, and supports Windows only (os: ["win32"] in package.json).

Execute the following after obtaining the package directory path (replace the path with the actual location):

dsh plugin --profile desktop add <package-path>

Method 2: Manual Placement

  1. Copy the entire directory to the profile’s node_modules:
Copy-Item -Recurse -Force "<package-path>" "$env:USERPROFILE\.dsh\profiles\desktop\node_modules\dsh-serial-debugger"
  1. Append the following to the end of ~/.dsh/profiles/desktop/cordis.patch.yml:
- insert:
    - id: serial-debugger
      name: dsh-serial-debugger
  1. Reload DSH (or wait for HMR). A “Serial Debug” row will appear in the sidebar guide page.

Optional Environment Variables

  • DSH_SERIAL_POWERSHELL: Points to pwsh.exe etc., overriding the default Windows PowerShell 5.1 path.
  • DSH_SERIAL_HELPER: Points to an alternative serial bridge script (following the same NDJSON protocol), used for implementation replacement or test doubles.

Typical Usage

After completing the installation steps above, follow these steps to perform an integration debug session within the interface:

  1. Click “Open Sidebar” on the title bar and click “Serial Debug” on the right sidebar guide page.
  2. Select the serial port and set baud rate etc. (commonly 115200, 8N1) in the parameter area, and click “Open Serial Port”. The PowerShell serial bridge starts lazily on first access (approx. 2 seconds); the panel will prompt if not ready.
  3. Observe real-time data in the middle receiver area; check Hexadecimal display, Timestamps, and Auto-scroll as needed.
  4. Enter content in the transmitter area below and click Send or press Ctrl+Enter; for periodic commands, check Scheduled Send and set the period (ms).
  5. Close the serial port when debugging is finished; use “Save Window” to export the receiver area if documentation is needed.

If there is no physical serial port on the local machine, the README suggests using a TX/RX short circuit for a loopback confirmation before connecting to a real device; the project provides a hardware-independent test suite (tools\run-tests.ps1, containing 131 items).

Use Cases and Notes

Who is it for: Developers using DSH on Windows for agent or application development who need UART/COM port monitoring and sending; those who want to reduce the number of separate serial assistant windows and keep debugging within the Harness context.

Platform and Dependencies: The serial bridge relies on Windows’ built-in System.IO.Ports and PowerShell. Serial functionality of this plugin cannot be used on Linux/macOS.

Security and Permissions: The plugin HTTP routes are not authenticated on loopback; the DSH webserver has no global authentication layer, so other local processes can theoretically call these interfaces to read/write serial ports. The plugin runs with the current DSH process privileges; before installation, you should review the GitHub Source Code and the MIT license (Version 1.0.0 see package.json) yourself.

Behavioral Limitations (Stated in README): The sending side performs no escaping (text is UTF-8, hexadecimal is sent directly as bytes); received data is displayed in chunks based on arrival, with no guarantee of aggregation by line; data is retained in a bounded log while the panel is closed, and the last 500 entries are restored upon reopening.

The DSH ecosystem emphasizes “Everything is a Plugin”; the SkillHub Directory Page is a community collection site and has no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-serial-debugger incorporates classic serial assistant capabilities into the DSH right sidebar: parameters, sending/receiving, hexadecimal, and file sending are all completed in one place, with zero npm serial native dependencies. If your development stack is already on Windows + DSH, you can integrate it according to the installation method in the README and start using it by opening “Serial Debug” from the guide page.

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

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

Xiaoye