dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
提供 HTTP webhook 入口 POST /webhook/<hookId>,把外部请求转成消息投递到 dsh 的固定会话,由 agent 处理。随 dsh web 启停,零 dsh 框架改动。
要求 dsh ≥ 0.1.7-rc.1(已在 0.1.7-rc.1 实测通过)。
ctx.settings.register() 已移除(2026-09-24):原 webhook settings namespace 并入插件 Config,可热改字段标 .volatile();inject 去掉 settings。create() 工厂(0.1.7 客户端校验):config / payload / result 三处 codec 均已补 create()。POST /webhook/<hookId>,Bearer token 认证(常数时间比较,防时序攻击)sync: true 时,等待 agent 完成并随 HTTP 响应返回回复文本(200 {ok, reply})——适合小爱音箱等"发一句等一句"的交互场景dsh-webhook/
├── index.js # host 插件:webServer 路由 + Bearer 认证 + 配置 remote
├── client.js # 浏览器 bundle:Settings → Webhook 配置页(hooks 表)
├── lib/webhook-core.mjs # 队列 + 投递核心(固定会话 + preset mount + workspace 归属)
├── cordis.patch.yml # bundle patch(插入 host 插件行)
└── package.json
挂载:web profile(~/.dsh/profiles/web/)package.json → dependencies["dsh-webhook"] = "link:<project>/dsh-webhook",bundles 列表含 dsh-webhook。
$DSH_HOME/settings.yaml 的 webhook: 段(可在配置页编辑):
webhook:
hooks:
sms-forward:
token: "<bearer-token>" # 必填;请求头 Authorization: Bearer <token>
workspace: "/Users/<you>/dsh/default" # 投递目标工作区
session: "" # 可选;默认用 hookId 派生固定会话
template: "请处理这条短信并记账:\n{{text}}" # 消息模板,{{text}} 为请求体
xiaoai:
token: "<token>"
workspace: "/Users/<you>/dsh/default"
sessionMode: "persistent" # "persistent" 固定会话 / "new" 一次性
sync: true # 同步模式:等待回复并随 HTTP 返回
template: "你是智能管家,简洁口语化回答:\n{{text}}"
调用方式:
curl -X POST https://<dsh-host>/webhook/sms-forward \
-H "Authorization: Bearer <token>" \
-d '您的账户入账 100.00 元'
@deepseek-ai/* 报 ERR_MODULE_NOT_FOUND):
mkdir -p node_modules && ln -sfn /usr/local/lib/node_modules/@deepseek-ai/dsh/node_modules/@deepseek-ai node_modules/@deepseek-ai