PeterBon/dsh-hooks
DeepSeek Harness 的配置驱动生命周期钩子插件
Project Overview项目介绍
dsh-hooks is a native config-driven lifecycle hook plugin built specifically for DeepSeek Harness (DSH). It follows official DSH plugin conventions, and lets users set up custom event-to-command hooks without writing any custom plugin code. To install, users can run dsh plugin --profile <profile-name> add dsh-hooks from npm, or install directly from the GitHub repository with dsh plugin --profile <profile-name> add github:PeterBon/dsh-hooks. After installation completes, you just need to restart the dsh web process, and a new dedicated Hooks configuration section will appear in the DSH web settings panel.
Users add all hook configurations directly in their DSH profile's cordis.patch.yml file. Each hook supports a wide range of configuration options, including triggering events, context filtering rules, custom execution commands or built-in notifications. Additional supported options include timeout limits, retry logic for failed runs, debouncing for high-frequency events, and caps on concurrent hook runs. Supported triggering events cover all key DSH lifecycle points, including turn end, tool call, approval request, and step end. Filtering supports both regex matching on string fields and numeric comparisons for numeric values, letting users tailor triggers to their needs.
This plugin is released under the permissive MIT open source license. It includes pre-built support for Feishu notification integration, with three separate setup options: QR code scan via the web GUI, setup via the CLI command, or manual configuration for advanced users. Since hooks run arbitrary commands with the same privileges as the host DSH process, users are strongly advised to only add hooks from trusted sources. Sensitive credentials like API keys should be stored in environment variables instead of plaintext configuration files to avoid accidental exposure.
这是一个专门为DeepSeek Harness(DSH)开发的配置驱动生命周期钩子原生插件。用户无需编写自定义插件代码,只需要直接在个人配置文件的cordis.patch.yml中声明「事件-命令」映射关系即可使用。用户可以通过DSH的CLI插件命令从npm或项目GitHub仓库直接安装,安装后重启dsh web即可启用,插件会在DSH的网页设置面板中新增一个「Hooks」配置分区。
插件支持丰富的钩子配置项,可配置触发事件、过滤规则、自定义执行命令或内置通知功能,还支持超时、重试、去抖动、并发限制等高级参数。触发事件支持回合结束、工具调用、审批请求、步骤结束等多种DSH生命周期事件,过滤规则支持正则匹配和数值比较,满足各类自定义触发需求。
该项目基于MIT许可证开源,支持飞书通知的便捷配置流程,可通过网页端扫码、CLI命令或手动配置三种方式完成飞书通知机器人的接入。钩子以当前DSH进程权限执行任意命令,因此用户仅可配置自己信任的命令,密钥等敏感信息需保存在环境变量或凭证存储中,不要写入配置文件。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-hooks(PeterBon/dsh-hooks)
仓库:https://github.com/PeterBon/dsh-hooks
本站详情页:https://www.yhbd.top/plugins/peterbon-dsh-hooks/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 6 · 最近提交 2026-09-26 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 6 stars - very few users, little community feedback星标只有 6,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add dsh-hooks
把 PeterBon/dsh-hooks 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-hooks
Config-driven lifecycle hooks plugin for DeepSeek Harness (dsh).
Declare event -> command hooks directly in your profile's cordis.patch.yml — like Codex CLI / OpenCode hooks, but for dsh. No plugin code required.
中文文档 | Design | Feishu example | Web GUI
Install
One package ships everything (hook engine + Web GUI settings page):
dsh plugin --profile web add dsh-hooks # from npm
# or straight from git:
dsh plugin --profile web add github:PeterBon/dsh-hooks
Restart dsh web. The settings panel gains a "Hooks" section (see Web GUI).
Configure
Add a config block to your profile's cordis.patch.yml:
- id: dsh-hooks
name: dsh-hooks
config:
hooks:
- on: 'turn/end'
when: 'completed' # optional: only completed turns
run: 'node examples/notify-feishu.mjs'
timeoutMs: 10000 # optional, default 10000
- on: 'approval/asked'
run: 'powershell -Command "Write-Output approval-requested >> hooks.log"'
- on: 'tool/call'
match: # optional: field → regex, all must match
tool: '^(rm|git|ssh)'
run: 'node examples/notify-webhook.mjs --slack'
- on: 'turn/end'
when: 'completed'
run: 'node examples/notify-feishu.mjs'
retries: 2 # optional: retry non-zero exits (default 0)
retryDelayMs: 1000 # optional: base retry delay, doubles (default 500)
- on: 'turn/end'
input: 'stdin' # optional: write the full context JSON to stdin
run: 'node my-hook.mjs'
- on: 'approval/asked'
notify: # built-in notification: instead of run, no script needed
channel: 'desktop' # platform balloon/toast
- on: 'turn/end'
when: 'completed'
notify:
channel: 'webhook' # POST JSON to any HTTP endpoint
url: 'https://hooks.slack.com/services/…'
slack: true # optional: { text } one-line summary (Slack style)
- on: 'step/end'
run: 'node examples/log-step.mjs'
debounceMs: 500 # optional: debounce high-frequency events
maxConcurrent: 2 # optional: cap concurrent processes
- on: 'tool/result'
match:
toolDurationMs: '>10000' # numeric comparison ({ gt: 10000 } object form too)
run: 'node examples/notify-slow-tool.mjs'
- on: 'turn/end'
enabled: false # optional: disable without deleting
cwd: 'session' # optional: run in the session working directory
run: 'node examples/log-turn.mjs'
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
chenw2759-wq/dsh-IDE
ZhangFengshun/dsh-remote-ssh
caoyiwei850/dsh-ssh-ops
jingyi0605/Codingns4DSH
Jesse-njx/dsh-chatnode-wechat
LAN-TINA-WS/dsh-windows-shell-policy