常驻后台监视器:文件收件箱(NDJSON)或命令输出增量一到就唤醒 agent,相当于 Claude Code Monitor 工具的 Harness 实现。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-monitor
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:AbnerAI/dsh-monitor
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A drop-in replacement for Claude Code's Monitor tool, built for DeepSeek Harness.
dsh-monitor is a harness plugin that arms persistent, background watchers on message sources. When new content arrives, the plugin wakes the owning agent — delivering a plugin-sourced user message into the session, exactly like Claude Code's <task-notification> mechanism.
If you rely on Claude Code's Monitor to stay responsive to inbound messages while a shell is idle, this plugin gives you the same capability inside DeepSeek Harness.
How it works
The model calls the monitor tool to arm a watcher on a source:
source: file— an append-only NDJSON inbox. New lines are delivered as they land.source: command— a shell command re-run on an interval. Its output delta since the last run is delivered.
On each new message the plugin wakes the agent:
| Agent state | Behavior |
|---|---|
| idle | agent.followup() — opens a new turn (harness analog of Claude Code's <task-notification>) |
| busy | agent.inject() — queues the message into the next step |
Watchers are durable within the session, disarmable on demand, and torn down automatically when the plugin is unloaded.
Installation
dsh plugin --profile <name> <args...>is a thin pnpm forwarder: it runspnpm <args...>in the profile directory, then adds any installed package that declaresdsh.bundleto the profile's layer stack automatically.
From npm
npx @deepseek-ai/dsh@latest plugin --profile web add dsh-monitor
From git
npx @deepseek-ai/dsh@latest plugin --profile web add https://github.com/AbnerAI/dsh-monitor
From a local directory
npx @deepseek-ai/dsh@latest plugin --profile web add /path/to/dsh-monitor
When installing a local directory, run
pnpm installinside the package first —link:installs do not resolve the package's own dependencies automatically.
Manual alternative: add dsh-monitor to the profile's dsh.profile.bundles
and include this package's cordis.patch.yml via its dsh.bundle.patch
declaration.
Quick start
Tell the agent to arm a watcher on an inbox file:
monitor(source="file",
path="/absolute/path/to/inbox.ndjson",
name="my-inbox",
poll_interval_ms=1000)
pathmust be an absolute path (or start with~— the plugin expands it). Node'sfsdoes not expand~itself.poll_interval_msdefaults to 2000; 1000 is a good balance for chat-like inboxes.
The tool returns a watcher id, e.g. monitor-1. From then on, every new line written to the file wakes the agent automatically.
Manage watchers at any time:
monitor_list # list armed watchers (id, source, delivered count)
monitor_stop(id="monitor-1") # disarm one
To watch a command's changing output instead of a file:
monitor(source="command", command="tail -n 5 /var/log/app.log", poll_interval_ms=5000)
Tools
monitor
Arm a persistent watcher.
| Parameter | Type | Required | Description |
|---|---|---|---|
source |
"file" | "command" |
yes | file = watch an append-only NDJSON inbox; command = poll a shell command's output |
path |
string | for file |
path of the NDJSON inbox (absolute, or ~-prefixed) |
command |
string | for command |
shell command to poll |
cwd |
string | no | working directory for the command (defaults to the process cwd) |
poll_interval_ms |
number | no | poll interval in ms (default 2000) |
name |
string | no | short label used in wake-up messages and monitor_list |
Returns a watcher id. Each new NDJSON line (or command-output delta) is delivered as a plugin-sourced notice that wakes the agent.
Implementation note. Polling uses plain global
setIntervalwith cleanup registered viactx.effect— the same timer convention asdsh-schedule. The Cordis timer-service mixin (ctx.setInterval) is intentionally not used: it is only resolvable from the host context, not from tool-execution contexts, and calling it throwscannot get property "timer" without inject.
monitor_list
List armed watchers with their ids, sources, and delivery counts. Empty output means nothing is armed.
monitor_stop
Disarm a watcher by id. Returns whether it was still armed.
NDJSON inbox format
Each line is a JSON object; the content field is delivered if present, otherwise the raw line:
{"content":"hello","ts":1712345678}
Any append-only NDJSON file works. The format pairs naturally with messaging and notification brokers: a broker appends one record per inbound message, and a watcher on the file wakes the agent as new records land. This mirrors the contract Claude Code Monitor exposes for its own inbox watchers.
Requirements
- DeepSeek Harness (dsh) with a Cordis-based plugin loader (bundles /
cordis.patch.yml). - Peer dependencies:
dsh-agent,dsh-llm,dsh-tools,cordis(satisfied by the harness runtime).
License
MIT
链接
同类插件
Tencent/WeKnora#dsh-weknora★ 31002
把 WeKnora 知识库接入 dsh 的四个只读工具:列出知识库、混合检索原文片段、按顺序还原单篇文档,以及直接取用 WeKnora 自己带引用的 RAG 或 ReAct agent 回答(含可续聊的 session id)。
superdesigndev/treg★ 3752
给 Agent 的工具目录:按「要做的事」检索约 2,600 个外部接口(SEO 与 SERP、外链、社交、人物与公司信息补全、广告库、抓取),查看参数与单次调用价格后直接调用,凭据由服务端注入。附带技能,MCP 行在未设置 TREG_TOKEN 前保持禁用。
TencentCloudBase/CloudBase-AI-Toolkit#dsh-plugin★ 1127
把腾讯云 CloudBase 后端接入 DeepSeek Harness——在对话里搭好并部署全栈应用,查询结果渲染为表格卡片(分页、排序、导出 CSV),部署后可预览真实域名,并提供 CloudBase MCP 工具集(`mcp__cloudbase__*`),登录走 device-code 流程。
gitroomhq/postiz-agent#dsh-postiz★ 498
通过 MCP 将 DeepSeek Harness 连接到 Postiz:列出已连接的社交媒体渠道、获取各平台发帖规则,并向 X、LinkedIn、Instagram、Facebook、Threads、TikTok、YouTube、Reddit、Bluesky、Mastodon、Discord、Slack、Telegram 等平台排期、存草稿或发布帖子;附带 postiz 工作流技能。
EthanYoQ/Invoice-Downloader#dsh-invoice-downloader★ 465
面向 DeepSeek Harness 的本地 IMAP 发票下载、OCR 识别、归档与 Excel 报销汇总。
anysearch-team/anysearch-dsh★ 432
基于 AnySearch 的实时网页与垂直搜索插件,为 DeepSeek Harness 提供搜索工具。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。