dsh-automation
RPA-style scheduled web automation for DeepSeek Harness: record browser operations -> requirements doc -> LLM generates Python + Playwright -> schedule with run records and email notifications
- Stars
- 0
- Language
- JavaScript
- Created
- Sep 1, 2026
- Updated
- Sep 1, 2026
Introduction
dsh-automation
DeepSeek Harness 的 RPA 式定时网页自动化插件:录制操作 → 生成需求文档 → LLM 生成 Python+Playwright 代码 → 配置触发器定时执行 → 记录运行结果并邮件通知。
使用流程
- 打开 Harness Web UI(默认 http://127.0.0.1:3080)→ 设置 → 自动化任务。
- 点「新建自动化任务」:
- 方式 A:录制操作 — 输入起始网址点「开始录制」,会弹出一个可见的 Chrome 窗口,你在里面正常操作(点击/输入/翻页),每一步自动截图。按 F9 或点浮动「停止录制」按钮结束,然后点「生成需求文档」。
- 方式 B:手动写需求 — 跳过录制直接编写需求文档。
- 微调需求文档(可编辑)。
- 点「生成自动化代码」→ LLM 生成 Python + Playwright 脚本(可编辑)。
- 运行配置:下载/获取内容的保存目录、运行记录存储目录、通知邮箱。
- 触发器:
cron(如0 9 * * *每天 9 点)/ 间隔 / 一次性 / 仅手动。 - 保存。任务到点自动执行;每次运行生成一份
.md运行记录,可选 SMTP 邮件通知。
服务端 API(/dsh-automation/*)
| 接口 | 说明 |
|---|---|
GET /status | 插件状态 |
GET/POST /config | 读写配置(LLM provider/model、Python 路径、SMTP、目录) |
GET /models | 列出可用 LLM provider 与模型 |
GET/POST /tasks | 任务列表 / 新建任务 |
GET/PUT/DELETE /tasks/:id | 任务详情 / 更新 / 删除 |
POST /tasks/:id/run | 立即运行一次 |
POST /tasks/:id/enable | 启用 / 停用触发器 |
GET /tasks/:id/runs | 运行历史 |
POST /record/start POST /record/stop GET /record/status | 录制器控制 |
POST /generate/requirement | 录制数据 → 需求文档 |
POST /generate/code | 需求文档 → Python 代码 |
POST /notify/test | 发送测试邮件 |
配置
- LLM:复用 harness 的
ctx.llm(provider 如deepseek-official/ali),不单独消耗 API key;留空自动选择。 - Python:生成脚本用
python配置的执行(默认D:\Anaconda3\python.exe),需pip install playwright并playwright install chromium。 - 邮件:SMTP 配置(host/port/账号/授权码)+ 收件邮箱。agent-mail MCP 适配器可后续接入(代码中
notifier.notify是唯一出口)。
数据存储
$DSH_HOME/profiles/web/data/dsh-automation/:
tasks/*.json任务定义(需求、代码、触发器、配置)runs/<taskId>/*.json结构化运行记录recordings/*/录制数据(steps + 截图)settings.json插件配置
开发说明
- 服务端:
lib/index.js(cordis 插件,inject: ['webServer', 'llm']),HTTP 路由用ctx.webServer.register({ kind: 'prefix', path: '/dsh-automation', handler })。 - 客户端:
client/client.js通过window.__ModuleLoader__.load注入,ctx.slots.inject('settings.section', ...)挂载设置页。 - 录制器:
runner/recorder.py(headed Chromium + 注入录制脚本,F9 停止)。