dsh-sysmon: View local CPU / Memory below the DSH input box

Preface

When running long sessions with DeepSeek Harness (DSH), the model runs remotely while your local machine is busy compiling, launching browsers, or running multiple tool processes. Checking the Task Manager requires switching windows, and top in the terminal feels disjointed from the conversation interface. If you simply want a quick glance next to your prompt input to see “is the machine maxed out,” you need a lightweight indicator bound to the composer, rather than a large floating window or a full status bar.

Below is an introduction to the community plugin hehf21/dsh-sysmon (Maintainer: hehf21, Category: Client). It displays circular gauges for local CPU and memory usage directly below the DSH input composer; clicking allows you to expand a view of the trend over the last minute and detailed statistics. The repository currently has 0 stars; License: MIT; Node requirement: ≥20.

What is this

dsh-sysmon is a client-side plugin for DSH: The browser side mounts two 14px circular gauges and percentages into the conversation.composer.dock slot, while the host side samples data in-process and provides JSON via GET /sysmon/stats. There are no configuration options, and it depends only on node:os and node:fs, installing no third-party packages or spawning subprocesses.

Comparison with similar open-source implementations: hnmrxz/dsh-plugin-sysmon is a status capsule in the same slot; AKS1st/dsh-sysmon uses a floating window in the bottom right corner; Small-Miao/dsh-statusbar occupies the entire bottom bar via shell.overlay. This plugin sticks the gauges below the composer, allowing you to click to view trends and extended info like disk usage.

Inline Display and Alerts

When a session already exists, an inline display appears near the cost row (schematic from README):

… Cost Details This Session ¥0.5181 · Cache Hit 98.8% │ CPU ◔ 26% │ Memory ◕ 56% │ ◯ 28%
                                       └── This Plugin ──┘

The gauge geometry matches the host’s built-in ContextMeter: 14px viewport, radius 5.5, 2px stroke, drawn clockwise from -90°. Usage is displayed in a neutral color when normal; at ≥75%, the ring and number turn yellow (--dsw-alias-state-warn-primary), and at ≥90%, they turn red (--dsw-alias-state-error-primary).

Text follows the DSH interface language (Chinese/English); it defaults to Chinese if the language service is unavailable.

Expanded Panel: One-Minute Trends and Details

Clicking the inline area expands a panel containing:

  1. One-minute trends for both CPU and Memory (with a 50% dashed reference line).
  2. CPU core count and model.
  3. Memory used / total.
  4. Disk usage of the drive containing the user’s home directory (C:\ on Windows; hidden if reading fails).
  5. DSH process Resident Set Size (RSS).
  6. System uptime.

Clicking outside the panel or pressing Esc collapses it. The trend window is maintained by the host side with 60 slots (approx. 1 minute); the client side only reads and does not compute.

Sampling and Polling

The host samples once every 1s; disk is sampled every 15s. The browser requests /sysmon/stats every 2s when in the foreground, reducing to 15s when the tab is hidden; it backs off to 10s on consecutive failures.

Value calculation methods (consistent with README):

  • CPU: The difference in cumulative time slices between two os.cpus() calls, 1 - idleΔ/totalΔ, weighted across all cores; if no new time slices occur within the interval, the last reading is retained to avoid false dips in the curve.
  • Memory: (totalmem - freemem) / totalmem; On Windows, freemem aligns with the Task Manager’s “In use” metric.
  • Disk: fs.promises.statfs targeting the drive where the user’s home directory resides.

Intervals are controlled by source code constants: SAMPLE_MS on the host and POLL_MS on the client. They cannot be changed via configuration after installation.

Installation and Activation

Install via Web profile from GitHub (replace web with your profile name):

dsh plugin --profile web add github:hehf21/dsh-sysmon

Refresh the page after installation. To uninstall:

dsh plugin --profile web remove dsh-sysmon

Desktop (Electron) profiles are exclusive to the application and cannot be installed via CLI—please install, enable, or disable via the Plugins page in the sidebar.

Development notes: For the browser side (client.js), closing and reopening the plugin reloads the changes; for the host side (index.js), which is an in-process ESM module, you must restart dsh for changes to take effect.

Architecture Overview

Browser client.js                        Host Process index.js
┌─────────────────────┐    GET      ┌──────────────────────────────┐
│ conversation        │ ──────────► │ /sysmon/stats (exact route)   │
│ .composer.dock      │ ◄────────── │  ├ node:os  cpus() time slice │
│ Two gauges + Panel  │    JSON     │                                │
│ on click            │             │  ├ node:os  totalmem/freemem  │
└─────────────────────┘             │  ├ node:fs  statfs disk       │
                                    │  └ 1s sampling → 60 slot trend │
                                    └──────────────────────────────┘

cordis.patch.yml registers the plugin line sysmon to the host, and the browser loads it from /plugins/sysmon/client.js.

Use Cases and Notes

Suitable for: People writing prompts and adjusting tools within the DSH session view who need a resident, low-distraction local CPU/memory indicator and occasionally want to click for a one-minute trend, disk status, and process memory details.

Boundaries and Permissions:

  1. Session View Only: The welcome page (new session empty state) does not render it; the conversation.composer.dock slot requires an existing session.
  2. Locally Readable: /sysmon/stats is not under the /api prefix and does not go through the browser trust fence connected to the plugin; any local process that can open the local DSH page can read CPU/memory/disk usage (README states there is no sensitive information). The desktop version is usually bound only to 127.0.0.1; to tighten this, you must add a Host / Origin whitelist in the handle() function of index.js yourself.
  3. Plugin Permissions: Host code runs with the permissions of the current dsh process. Please read the repository source code and MIT license before installation to confirm you accept its sampling and exposure methods.

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.

Links

  • Directory Page: https://www.skillhub.cn/plugins/hehf21/dsh-sysmon
  • GitHub: https://github.com/hehf21/dsh-sysmon

If you are already using similar capsules below the composer or a full status bar, you can choose between this plugin and similar repositories listed in the README based on slot position and interaction habits; the core value of this plugin is sticking the gauges below the input area and providing a one-minute trend and machine details with a single click.

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

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

Xiaoye