Introduction

The extensibility of DeepSeek Harness (DSH) is typically integrated via plugins. dsh-monitor addresses a specific class of needs: enabling agents to be woken up promptly when external messages, notifications, or logs arrive during the agent’s idle period.

If you wish to implement capabilities similar to Claude Code Monitor within DSH, dsh-monitor provides a plugin-based path: establishing persistent background watchers for message sources to wake the owning agent when new content arrives.

What is this

dsh-monitor is a DeepSeek Harness plugin maintained by AbnerAI, licensed under MIT.

It turns “monitoring message sources and waking up agents” into a DSH plugin capability. The plugin provides three tools, monitor, monitor_list, and monitor_stop, for creating, viewing, and stopping watchers.

It supports two types of message sources:

  • source: file: Monitors an append-only NDJSON inbox;
  • source: command: Re-runs a shell command at intervals and posts the output diff.

Core Features

Continuous Monitoring of Message Sources

The plugin can establish persistent, background watchers on message sources.

Watchers remain active within the session; they can be manually stopped when needed and will be automatically cleaned up when the plugin is uninstalled.

Waking Up the Agent When New Content Arrives

When new content arrives, the plugin wakes the owning agent.

The method of waking up depends on the agent’s current state:

  • idle agents use agent.followup();
  • busy agents use agent.inject().

This means that new messages are not just recorded but enter the current session and trigger subsequent agent processing.

Supporting NDJSON Inbox

When using source: file, the plugin monitors an append-only NDJSON inbox.

After writing a new line, the plugin passes the new content to the agent to trigger subsequent processing.

Supporting Command Output Diffs

When using source: command, the plugin re-runs the shell command at an interval defined by poll_interval_ms and posts the output diff since the last run.

Installation and Activation

First, ensure the runtime environment meets the requirements: DeepSeek Harness (dsh) is needed, along with a Cordis-based plugin loader that supports bundles / cordis.patch.yml.

The plugin’s peer dependencies include:

dsh-agent
dsh-llm
dsh-tools
cordis

These dependencies are satisfied by the harness runtime.

When installing from npm, you can run:

npx @deepseek-ai/dsh@latest plugin --profile web add dsh-monitor

If installing from a git URL, you can run:

npx @deepseek-ai/dsh@latest plugin --profile web add https://github.com/AbnerAI/dsh-monitor

If installing from a local directory, first run:

pnpm install

Then run:

npx @deepseek-ai/dsh@latest plugin --profile web add /path/to/dsh-monitor

The local directory installation method is suitable when the dsh-monitor package has already been prepared on the local machine. The preceding pnpm install is used to resolve the package’s own dependencies first.

Typical Usage

Monitoring an NDJSON Inbox

Instruct the agent to set up a watcher on an inbox file:

monitor(source="file",
        path="/absolute/path/to/inbox.ndjson",
        name="my-inbox",
        poll_interval_ms=1000)

Here, source is specified as file. path must be an absolute path or start with ~. poll_interval_ms defaults to 2000.

The tool returns a watcher ID, for example monitor-1. After that, whenever a new line is written to the file, the plugin will wake the agent.

NDJSON example line:

{"content":"hello","ts":1712345678}

Viewing and Stopping Watchers

View currently established watchers:

monitor_list

Stop a watcher by ID:

monitor_stop(id="monitor-1")

Monitoring Command Output

If the target is not a file but the changing output of a command after each rerun, you can use:

monitor(source="command", command="tail -n 5 /var/log/app.log", poll_interval_ms=5000)

Here, source is specified as command; the plugin re-runs the command at a 5000ms interval and posts the output diff.

Use Cases and Notes

dsh-monitor is suitable for scenarios where DSH agents need to remain responsive to external inbound messages, such as:

  • Message or notification brokers writing records to an append-only NDJSON file;
  • Log files that are continuously growing and require checking for output changes at intervals;
  • Agents waiting for external input, where new messages can directly wake them up.

Before use, it is important to note: the plugin runs with the permissions of the current dsh process; you should review the source code, dependencies, and license before installing.

The license verified in the information is MIT. The path parameter must be resolvable to an absolute path; poll_interval_ms determines the polling frequency, with a default value of 2000.

Conclusion

The value of dsh-monitor lies in transforming “continuous monitoring of message sources” into an ability that can be established, viewed, and stopped within a DSH session, and waking up the agent when new messages arrive.

Plugin Directory Page: https://www.skillhub.cn/plugins/AbnerAI/dsh-monitor

GitHub: https://github.com/AbnerAI/dsh-monitor