dsh-monitor
Persistent background watchers that wake the agent on new messages — the harness analog of Claude Code's Monitor tool
Install
dsh plugin --profile web add dsh-monitor dsh-monitor
Stop waiting for messages by hand: arm a watcher on a file inbox or command output, and new content wakes the agent automatically.
What problem it solves
A DSH agent only acts when it receives a message — it cannot sit and wait for new input from an outside source. That is exactly the gap Claude Code’s Monitor tool fills, and dsh-monitor brings the same capability into DeepSeek Harness. The model calls the monitor tool to arm a persistent background watcher, and when new content lands the plugin wakes the owning agent — the harness analog of Claude Code’s <task-notification> mechanism.
Two source types are supported: source: file watches an append-only NDJSON inbox and delivers new lines as they land; source: command re-runs a shell command on an interval and delivers the output delta since the last run. When idle, the agent opens a new follow-up turn (agent.followup()); when busy, the message is queued into the next step (agent.inject()). Watchers are durable within the session, listed with monitor_list, disarmed with monitor_stop, and torn down automatically on unload.
Key features
- File inbox watcher:
source: filewatches an append-only NDJSON file and wakes the agent on each new line - Command output polling:
source: commandre-runs a shell command onpoll_interval_msand delivers the output delta - Automatic agent wake-up: new follow-up turn when idle, queued injection when busy — matching Claude Code’s
<task-notification>semantics - In-session management:
monitor_listlists armed watchers,monitor_stopdisarms by id - Natural message format: one JSON object per NDJSON line; the
contentfield is delivered when present, otherwise the raw line - Clean lifecycle: all watchers are torn down automatically when the plugin unloads
Quick start
Restart dsh web after installing, then ask the agent in plain language — for example, “arm a watcher on /absolute/path/to/inbox.ndjson and wake me on new lines”. The agent calls the monitor tool:
monitor(source=“file”, path=“/absolute/path/to/inbox.ndjson”, name=“my-inbox”, poll_interval_ms=1000)
path must be an absolute path (or start with ~, which the plugin expands); poll_interval_ms defaults to 2000, and 1000 is a good balance for chat-like inboxes. From then on, every new line appended to the file wakes the agent. Manage watchers at any time:
monitor_list
monitor_stop(id=“monitor-1”)
To watch a command’s changing output instead, use source="command" with a command such as command="tail -n 5 /var/log/app.log".
Who it is for
- Users who rely on Claude Code’s
Monitorand want the same idle responsiveness inside DSH - Automation setups that feed the agent through file inboxes or notification buses
- Teams that want the agent to react to logs, queues, and other incremental inputs without manual prompting
Compiled from the project README · All rights belong to the original author
Report issue / Request removal