Skip to content

dsh-monitor

Verified

@tom2012/dsh-monitor Β· v1.0.1 Β· MIT Β· Web UI

DeepSeek Harness plugin: local and remote server CPU/memory/disk readout under the composer, with a Monitor tab in Settings

Install

dsh plugin add @tom2012/dsh-monitor

Confirm the layer applied with dsh --profile default --dump-config β€” see the install guide.

Source

Tags

Creators

Readme

dsh-monitor

A DeepSeek Harness (DSH) plugin that shows CPU / memory / disk usage of this machine and any number of remote Linux servers, live, right below the chat composer.

platform

What it does

Renders a single compact entry under the composer (input box) showing the currently selected host:

Local β–Ύ   CPU 12.3%  Mem 45.6%  Disk 70.5%

Clicking the entry opens a popover that lists every host β€” the machine running DSH ("local") plus all configured servers β€” with their live readings. Pick one to make it the displayed host; the choice is remembered across reloads.

  • The local host is the machine running DSH.
  • Values refresh every 2 seconds; remote readings are cached for 5 seconds.
  • Follows the built-in composer statistics styling (same color as the token / cache-hit pills).
  • Bilingual labels (Local / 本机, Mem / ε†…ε­˜, Disk / η£η›˜), localized through the DSH locale service.

Install

Install the bundle into a profile:

dsh plugin --profile <profile-name> add @tom2012/dsh-monitor

Or, during local development, link the source directory directly:

dsh plugin --profile <profile-name> add /path/to/dsh-monitor

The plugin registers a conversation.composer.dock entry (order: 2, after the built-in activity and usage pills), so the local host appears with no further configuration.

Configure remote servers

Remote servers are managed from the settings window β€” no file editing needed:

  1. Open Settings (βš™οΈ).
  2. Pick the Monitor tab in the left-hand nav.
  3. Add, edit, or remove servers, then Save.

Each server has these fields:

Field Required Default Notes
id βœ… β€” Short unique name, e.g. node01
label β€” falls back to id Display name
host βœ… β€” IP or hostname, e.g. 192.168.1.10
port β€” 22 SSH port
user β€” root SSH login user
keyPath β€” "" Explicit private key path; empty uses the default ssh key

Changes take effect immediately (no restart). The same servers array can also be set declaratively in the profile's cordis.patch.yml (that patch layer survives bundle upgrades):

- id: dsh-monitor
  name: "@tom2012/dsh-monitor"
  config:
    servers:
      - id: node01
        label: node01        # optional; falls back to id
        host: 192.168.51.110
        port: 22             # optional; default 22
        user: root           # optional; default root
        keyPath: ""          # optional; use an explicit private key, else the default ssh key
  • Remote collection uses SSH with key authentication (BatchMode=yes); password prompts are intentionally unsupported.
  • The remote host must be Linux (reads /proc/stat, /proc/meminfo, and df).
  • A server that fails to connect shows a dash for its row without affecting the others.

How it works

@tom2012/dsh-monitor is a dual-face bundle plugin:

  • Host half (index.js, Node.js) β€” samples local os.cpus(), os.totalmem()/freemem(), and statfs('/'), and, for each configured server, runs a short SSH command that reports CPU / memory / disk. It serves everything as JSON through the Harness connection layer:

    ctx.connection.fetch.register({
      path: '/api/dsh-monitor/metrics',
      methods: ['GET'],
      requestBody: 'buffered',
      fetch: async () => Response.json({ local, servers }),
    });
    
  • Client half (client.js, browser) β€” polls /api/dsh-monitor/metrics with a same-origin fetch every 2 seconds and renders the selected host's reading into conversation.composer.dock, with a popover to switch hosts. It also registers a settings.section entry (id dsh-monitor, order 16) that renders the server editor as its own tab in the Settings window, reading and writing the dsh-monitor namespace through the configForms service (form.getSnapshot / form.subscribe / form.mutate).

No persistent data is collected; all metrics are read on demand.

Project layout

.
β”œβ”€β”€ index.js            # Host half: local + SSH sampling, /api fetch route
β”œβ”€β”€ client.js           # Client half: composer.dock UI + server settings page
β”œβ”€β”€ cordis.patch.yml    # Loader insert for the bundle
β”œβ”€β”€ package.json        # Bundle manifest (dsh.bundle.patch + dsh.client)
β”œβ”€β”€ locale/
β”‚   β”œβ”€β”€ en.json         # English meta
β”‚   └── zh.json         # Chinese meta
└── icon.svg            # Plugin icon

Requirements

  • DeepSeek Harness (DSH) with the @deepseek-ai/dsh-client-connection bundle (ships with the standard Desktop / Web profile).
  • An ssh client on PATH for remote-server monitoring.

License

MIT