dsh-mcviseron-plugin 0.6.6 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -1
- package/README.en.md +10 -3
- package/README.md +12 -4
- package/docs/automation-task.md +1 -1
- package/docs/automation-tasks.md +48 -0
- package/docs/dsh-cookie-launcher.md +55 -0
- package/docs/release.md +2 -2
- package/lib/index.js +464 -175
- package/package.json +25 -18
- package/scripts/dsh-cookie-launcher/clean-dsh-auth-cookies.py +97 -0
- package/scripts/dsh-cookie-launcher/launch-dsh.vbs +16 -0
- package/scripts/install-dsh-cookie-launcher.ps1 +48 -0
- package/src/automation-tasks/index.ts +337 -0
- package/src/index.ts +2 -0
- package/src/session-end/index.ts +13 -9
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,35 @@
|
|
|
5
5
|
- 将「按时间切换」扩展为多时段表(例如白天的多个浅色窗口)。
|
|
6
6
|
- 设置行支持「立即测试」预览按钮。
|
|
7
7
|
- Restart 组件支持 macOS/Linux(当前仅 Windows 桌面版)。
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
## [0.7.1] - 2026-11-01
|
|
10
|
+
|
|
11
|
+
### Compatibility
|
|
12
|
+
|
|
13
|
+
- **预适配 DSH `0.2.1-rc.5`(nightly next)**:开发依赖与类型升级到 rc.5(含 `dsh-home-paths` / `dsh-launch-environment`),peer 范围保留 `0.2.0-rc.2` / `0.2.1-rc.2` / `0.2.1-rc.3` / `0.2.1-rc.5`。当前桌面仍为 rc.2,rc.5 待升级后做真实运行时验证。
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **会话内编辑官方自动化任务**:官方 `schedule_*` 工具依赖 preset,当前会话经常没有。新增 `automation_task_list/create/update/delete`,直接调用 Host `ctx.schedule`,按当前会话 id 列/建/改/删任务并自动存盘;配套 system prompt 指引,不再手改 `schedule.json`。
|
|
18
|
+
|
|
19
|
+
### Tests
|
|
20
|
+
|
|
21
|
+
- 合计 **119 项测试**。
|
|
22
|
+
|
|
23
|
+
## [0.6.8] - 2026-10-25
|
|
24
|
+
|
|
25
|
+
### Compatibility
|
|
26
|
+
|
|
27
|
+
- **预适配 DSH `0.2.1-rc.3`(nightly next)**:开发依赖与类型升级到 rc.3,peer 范围同时保留 `0.2.0-rc.2` / `0.2.1-rc.2` / `0.2.1-rc.3`;补充 `dsh-scope` / `dsh-brand` / `dsh-session` / `dsh-app-boot` / `dsh-config-editor` rc.3 依赖。当前桌面仍为 rc.2,rc.3 待升级后做真实运行时验证。
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- **`set_session_end_action` 导致自动化会话运行失败**:该工具通过原始 `tools.register` 注册,`parameters` 仍是内部字段表,没有顶层 `type: "object"`;严格模型 Provider 收到 `type: null` 后拒绝整个请求。改为标准 object JSON Schema,并补测试固定 `type/required/properties`。
|
|
32
|
+
- **DSH 启动认证 cookie 累积(431)**:插件运行时 prune 无法访问 Electron defaultSession 的认证 cookie(日志恒为 `pruned=0`)。新增启动清理器:Start Menu 快捷方式指向 `wscript.exe`,启动前只删除 `127.0.0.1` 的旧 `dsh-auth-*` 并备份,再启动 DSH;不改 `app.asar`,更新不丢。安装脚本与说明见 `scripts/install-dsh-cookie-launcher.ps1` / `docs/dsh-cookie-launcher.md`。
|
|
33
|
+
|
|
34
|
+
### Tests
|
|
35
|
+
|
|
36
|
+
- 合计 **112 项测试**。
|
|
9
37
|
|
|
10
38
|
## [0.6.6] - 2026-10-23
|
|
11
39
|
|
package/README.en.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](README.md)
|
|
4
4
|
|
|
5
|
-
MCviseron's **master plugin for DeepSeek Harness (DSH)**: one npm package and one `mcviseron` profile entry hosting
|
|
5
|
+
MCviseron's **master plugin for DeepSeek Harness (DSH)**: one npm package and one `mcviseron` profile entry hosting seven components. DSH `client-modules` only composes a browser half for a Loader row whose name exactly equals the package name, so the master entry must be `dsh-mcviseron-plugin`; components run as sub-plugins and own settings sub-pages. The former `dsh-auto-review-restart-fix` and `dsh-task-guard` are merged here and will be deprecated.
|
|
6
6
|
|
|
7
7
|
## Components
|
|
8
8
|
|
|
@@ -14,6 +14,7 @@ MCviseron's **master plugin for DeepSeek Harness (DSH)**: one npm package and on
|
|
|
14
14
|
| **Restart DeepSeek Harness** | `mcviseron.restart` | Button in Settings → MCviseron plugin that closes and relaunches the desktop application |
|
|
15
15
|
| **After-session action** | `mcviseron.sessionEnd` | “Restart after session” dropdown in the composer; the AI tool can arm it; restart waits for running tasks |
|
|
16
16
|
| **Auth-cookie cleanup** | built in | Expires old `dsh-auth-*` cookies on every page load, keeping only the current one so restarts cannot push the request header to 16 KB |
|
|
17
|
+
| **Automation task editing** | built-in tools | `automation_task_list/create/update/delete` call the Host schedule service and persist automatically |
|
|
17
18
|
|
|
18
19
|
> 0.6.1 returns to a **single** `mcviseron` entry: DSH `client-modules` only composes a browser half for an exact package-name Loader row, and subpath rows silently dropped the whole client plugin. Components still run as sub-plugins and expose settings sub-pages.
|
|
19
20
|
|
|
@@ -61,7 +62,12 @@ MCviseron's **master plugin for DeepSeek Harness (DSH)**: one npm package and on
|
|
|
61
62
|
- **Global AI notice**: besides the composer reminder, a fixed top-right notice shows "session X enabled AI session auto-restart/close"; multiple sessions render multiple dismissible cards, which disappear when the action runs or is cleared. User-set actions do not show this AI notice.
|
|
62
63
|
- **Email link**: if `dsh-email-notify` is installed and configured sendable, arming the action reuses its SMTP settings to send one reminder; the email plugin is not modified. Configure or disable it under Settings → MCviseron plugin → After-session action. See [docs/session-end.md](docs/session-end.md).
|
|
63
64
|
|
|
64
|
-
### 6.
|
|
65
|
+
### 6. Automation task editing
|
|
66
|
+
|
|
67
|
+
- The official `schedule_*` tools depend on a preset; this session often does not expose them. `automation_task_*` lists/creates/updates/deletes tasks bound to the current session through `ctx.schedule`.
|
|
68
|
+
- Mutations are persisted by the Host Schedule service immediately; no `schedule.json` editing and no restart.
|
|
69
|
+
|
|
70
|
+
### 7. DSH auth-cookie cleanup
|
|
65
71
|
|
|
66
72
|
- DSH listens on a new loopback port on every launch, but Chromium stores cookies per host, not per port. Old `dsh-auth-<hash(host:port)>` cookies are never overwritten and eventually push the Cookie header past Node's 16 KB limit (HTTP 431).
|
|
67
73
|
- A Host route `POST /api/dsh-mcviseron/auth-cookies/prune` recomputes the current cookie for the request Host, expires every other `dsh-auth-*`, and keeps the current login cookie.
|
|
@@ -146,7 +152,8 @@ Defaults: appearance off / `08:00–23:00`; auto-review both guards on, 6 s, 400
|
|
|
146
152
|
|
|
147
153
|
| DSH version | Status |
|
|
148
154
|
| --- | --- |
|
|
149
|
-
| `0.2.1-rc.
|
|
155
|
+
| `0.2.1-rc.3` | ✅ pre-adapted (rc.3 types/deps + 119 tests; desktop nightly runtime pending) |
|
|
156
|
+
| `0.2.1-rc.2` | ✅ current desktop runtime (119 tests + real Cordis contexts) |
|
|
150
157
|
| `0.2.0-rc.x` | ✅ covered by the peer range |
|
|
151
158
|
| `0.1.x` | ❌ unsupported (different settings-namespace model) |
|
|
152
159
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.en.md) | 中文
|
|
4
4
|
|
|
5
|
-
MCviseron 的 **DeepSeek Harness(DSH)总插件**:一个 npm 包、一个 `mcviseron` profile
|
|
5
|
+
MCviseron 的 **DeepSeek Harness(DSH)总插件**:一个 npm 包、一个 `mcviseron` profile 条目挂载七个组件。DSH 的 `client-modules` 只给 Loader 行名称精确等于包名的条目组合浏览器半区,因此 master 条目名必须是 `dsh-mcviseron-plugin`;组件作为子插件运行,设置页提供各自子页。原 `dsh-auto-review-restart-fix` 与 `dsh-task-guard` 已并入本插件并逐步废弃。
|
|
6
6
|
|
|
7
7
|
## 组件
|
|
8
8
|
|
|
@@ -14,6 +14,7 @@ MCviseron 的 **DeepSeek Harness(DSH)总插件**:一个 npm 包、一个 `
|
|
|
14
14
|
| **重启 DeepSeek Harness** | `mcviseron.restart` | 「设置 → MCviseron 插件」里的重启按钮:关闭并重新启动桌面应用 |
|
|
15
15
|
| **会话后动作** | `mcviseron.sessionEnd` | 输入框左侧「会话后重启」下拉;AI 工具可设置;重启等待任务结束 |
|
|
16
16
|
| **认证 cookie 清理** | 内置 | 每次页面加载过期旧 `dsh-auth-*`,只保留当前,避免重启把请求头推到 16KB |
|
|
17
|
+
| **自动化任务编辑** | 内置工具 | `automation_task_list/create/update/delete` 直接调用 Host schedule 并自动存盘 |
|
|
17
18
|
|
|
18
19
|
> 0.6.1 起回到**单一** `mcviseron` 条目:DSH `client-modules` 只给精确包名条目组合浏览器半区,子路径条目会让整个客户端插件(外观行、设置分区、重启回退)消失。组件仍在内部作为子插件运行,设置页有 Auto review / Todo 子页。
|
|
19
20
|
|
|
@@ -65,7 +66,13 @@ MCviseron 的 **DeepSeek Harness(DSH)总插件**:一个 npm 包、一个 `
|
|
|
65
66
|
- **AI 全局提示**:除当前输入框的强提示外,右上角固定显示「xx 会话已启用 AI 会话自动重启/关闭」;多会话多张卡片,可关闭,动作执行/取消后消失。用户手动设置不显示此全局 AI 提示。
|
|
66
67
|
- **邮件联动**:如果已安装并配置了可发送的 `dsh-email-notify`,AI 开启动作时会复用它的 SMTP 配置发送提醒邮件;不修改邮件插件。可在「设置 → MCviseron 插件 → 会话后动作」关闭或改模板。详见 [docs/session-end.md](docs/session-end.md)。
|
|
67
68
|
|
|
68
|
-
### 6.
|
|
69
|
+
### 6. 自动化任务编辑
|
|
70
|
+
|
|
71
|
+
- 官方 `schedule_*` 工具依赖 preset 注册,当前会话经常没有;新增 `automation_task_*`,通过 `ctx.schedule` 直接列/建/改/删当前会话任务。
|
|
72
|
+
- 修改直接由 Host Schedule 服务自动存盘,不需要编辑 `schedule.json`,不需要重启。
|
|
73
|
+
- 模型在会话里直接改 prompt/title/频率;详见 [docs/automation-tasks.md](docs/automation-tasks.md)。
|
|
74
|
+
|
|
75
|
+
### 7. DSH 认证 cookie 清理
|
|
69
76
|
|
|
70
77
|
- DSH 每次启动换随机端口,但 Chromium 的 cookie 只按 host 保存;旧的 `dsh-auth-<hash(host:port)>` 不会覆盖,30 天后会累积到 16 KB 请求头上限并触发 431。
|
|
71
78
|
- 插件新增 Host 路由 `POST /api/dsh-mcviseron/auth-cookies/prune`:按当前 Host 复算当前 cookie,只过期其他 `dsh-auth-*`,保留当前登录态。
|
|
@@ -240,7 +247,8 @@ DSH 0.2 的官方设置 apiproxy 不向浏览器暴露第三方命名空间,
|
|
|
240
247
|
|
|
241
248
|
| DSH 版本 | 状态 |
|
|
242
249
|
| --- | --- |
|
|
243
|
-
| `0.2.1-rc.
|
|
250
|
+
| `0.2.1-rc.3` | ✅ 预适配(rc.3 类型/依赖 + 119 项测试;桌面 nightly 待升级运行时验证) |
|
|
251
|
+
| `0.2.1-rc.2` | ✅ 当前桌面运行版本(119 项测试 + 真实 Cordis 上下文) |
|
|
244
252
|
| `0.2.0-rc.x` | ✅ peer 范围覆盖(同一套设置、审批与 hook 接缝) |
|
|
245
253
|
| `0.1.x` | ❌ 不支持:0.1 的插件自行注册设置命名空间,与本插件的条目 id 命名空间模型不同 |
|
|
246
254
|
|
|
@@ -306,7 +314,7 @@ test/
|
|
|
306
314
|
|
|
307
315
|
```bash
|
|
308
316
|
pnpm install
|
|
309
|
-
pnpm check # typecheck +
|
|
317
|
+
pnpm check # typecheck + 119 项测试 + 构建
|
|
310
318
|
```
|
|
311
319
|
|
|
312
320
|
构建产物:`lib/index.js`(master ESM)、`lib/appearance.js`、`lib/auto-review-fix.js`、`lib/task-guard.js`、`lib/restart.js` 与 `lib/client.js`(浏览器模块)。`lib/` 不入库。
|
package/docs/automation-task.md
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
3. 若发布了新版本:
|
|
39
39
|
a. 执行 pnpm install,把 @deepseek-ai/dsh-client-connection、dsh-client-locale、dsh-client-ui-settings、dsh-client-ui-slots、dsh-client-ui-renderer、dsh-host-webserver、dsh-settings、@deepseek-ai/cordis 的开发依赖升级到与最新 DSH 相同版本,并更新 peerDependencies 范围。
|
|
40
40
|
b. 对照最新包的类型声明与 lib 实现,按组件逐层修复不兼容处(先 Host 设置桥,再 autoReview、taskGuard,最后浏览器外观行)。
|
|
41
|
-
c. 执行 pnpm check(tsc --noEmit +
|
|
41
|
+
c. 执行 pnpm check(tsc --noEmit + 119 项 node 测试 + esbuild 构建),补齐或修正测试;必要时更新 test/plugin.test.ts 的装配断言。
|
|
42
42
|
d. 更新 CHANGELOG.md(新版本段落记录兼容版本与修复)、README.md / README.en.md 的兼容性表;提交并推送到 main。
|
|
43
43
|
4. 不要执行 npm publish;不要重启或关闭正在运行的 DSH;不要修改 D:\Program\DSH-Plugin-Class 下的其他插件仓库。
|
|
44
44
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 会话内编辑官方自动化任务
|
|
2
|
+
|
|
3
|
+
## 问题
|
|
4
|
+
|
|
5
|
+
DSH 官方的 `schedule_create/list/update/delete` 只在声明了
|
|
6
|
+
`@deepseek-ai/dsh-tool-schedule` 的 preset 中注册。当前会话的工具面里没有它们,
|
|
7
|
+
所以模型只能直接改 `%USERPROFILE%\.dsh\storages\schedule.json`;运行中的 Schedule
|
|
8
|
+
服务还持有内存副本,改了文件也不立即生效,必须重启。
|
|
9
|
+
|
|
10
|
+
## 补丁
|
|
11
|
+
|
|
12
|
+
新增 `automation-tasks` 组件,通过 Host 的 `ctx.schedule` 服务注册四个工具:
|
|
13
|
+
|
|
14
|
+
| 工具 | 作用 |
|
|
15
|
+
|---|---|
|
|
16
|
+
| `automation_task_list` | 列出当前会话绑定的任务,返回 id、title、prompt、时间信息 |
|
|
17
|
+
| `automation_task_create` | 创建任务,必须给 title、prompt 和恰好一个时间选择器 |
|
|
18
|
+
| `automation_task_update` | 按 id 原地修改 title / prompt / 时间选择器 |
|
|
19
|
+
| `automation_task_delete` | 按 id 删除任务 |
|
|
20
|
+
|
|
21
|
+
时间选择器:
|
|
22
|
+
|
|
23
|
+
- `after_seconds`:创建时的相对延迟;
|
|
24
|
+
- `at`:RFC 3339 绝对时间;
|
|
25
|
+
- `every_seconds`:固定间隔,至少 60 秒;
|
|
26
|
+
- `daily`:`{ time, time_zone }`;
|
|
27
|
+
- `weekly`:`{ time, time_zone, weekdays }`;
|
|
28
|
+
- `cron`:`{ expression, time_zone }`。
|
|
29
|
+
|
|
30
|
+
## 自动存盘
|
|
31
|
+
|
|
32
|
+
工具直接调用 `ctx.schedule`;该方法负责持久化,和官方自动化任务 UI 使用同一个
|
|
33
|
+
存储。模型不需要、也不应该再编辑 `schedule.json`,不需要重启 DSH 让任务内容生效。
|
|
34
|
+
|
|
35
|
+
## 使用
|
|
36
|
+
|
|
37
|
+
在会话中直接说:
|
|
38
|
+
|
|
39
|
+
> 把当前自动化任务的 prompt 改成……,每周六 09:00 执行
|
|
40
|
+
|
|
41
|
+
模型会先 `automation_task_list` 找 id,再 `automation_task_update`;结果直接落盘。
|
|
42
|
+
|
|
43
|
+
## 限制
|
|
44
|
+
|
|
45
|
+
- 只操作**当前会话绑定**的任务;
|
|
46
|
+
- 子 agent 调用会被 Schedule 服务按官方规则拒绝;
|
|
47
|
+
- 任务时间规则最终由 Host Schedule 校验;
|
|
48
|
+
- 工具注册依赖 Host 的 `schedule` 服务,缺失时组件不注册并写诊断日志。
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# DSH 启动 cookie 清理器
|
|
2
|
+
|
|
3
|
+
## 背景
|
|
4
|
+
|
|
5
|
+
DSH Desktop 的认证 cookie 在 **Electron main / defaultSession** 中,认证发生在任何插件加载之前。插件运行时的 prune 路由拿不到这些 cookie(诊断日志会一直是 `pruned=0`),所以不能靠运行时插件修复启动 431。
|
|
6
|
+
|
|
7
|
+
## 方案
|
|
8
|
+
|
|
9
|
+
Start Menu 快捷方式指向一个启动器:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Start Menu -> wscript.exe //nologo launch-dsh.vbs
|
|
13
|
+
|
|
|
14
|
+
+-- clean-dsh-auth-cookies.py
|
|
15
|
+
| 只删除 host_key=127.0.0.1 且 name LIKE 'dsh-auth-%'
|
|
16
|
+
| 删除前备份,最多保留 10 份
|
|
17
|
+
|
|
|
18
|
+
+-- D:\DeepSeek Harness\DeepSeek Harness.exe
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- 不改 `app.asar`,DSH 更新不会丢;
|
|
22
|
+
- 只动 DSH 的认证 cookie,不碰其他 host/其他 cookie;
|
|
23
|
+
- DSH 正在运行时数据库会锁住,清理脚本会记录并直接启动应用(单实例);
|
|
24
|
+
- 日志:`%LOCALAPPDATA%\dsh-mcviseron\launcher.log`
|
|
25
|
+
- 备份:`%LOCALAPPDATA%\dsh-mcviseron\backups\`
|
|
26
|
+
|
|
27
|
+
## 安装 / 修复快捷方式
|
|
28
|
+
|
|
29
|
+
```powershell
|
|
30
|
+
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ^
|
|
31
|
+
"D:\Program\DSH-Plugin-Class\dsh-mcviseron-plugin\scripts\install-dsh-cookie-launcher.ps1"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
脚本会:
|
|
35
|
+
|
|
36
|
+
1. 把两个启动文件复制到 `%LOCALAPPDATA%\dsh-mcviseron`;
|
|
37
|
+
2. 查找 Desktop / Start Menu / 任务栏中目标为 DSH exe 的快捷方式;
|
|
38
|
+
3. 首次修改前备份为 `.lnk.bak-dsh-cookie`;
|
|
39
|
+
4. 把快捷方式改为启动清理器。
|
|
40
|
+
|
|
41
|
+
## 注意
|
|
42
|
+
|
|
43
|
+
- **必须从快捷方式启动**;直接双击 `DeepSeek Harness.exe` 会绕过清理。
|
|
44
|
+
- DSH 更新器如果重建快捷方式,重新执行安装脚本即可。
|
|
45
|
+
- 原快捷方式备份:同目录 `.lnk.bak-dsh-cookie`。
|
|
46
|
+
- 清理脚本的数据库路径可用 `DSH_COOKIE_DB` 覆盖,便于测试。
|
|
47
|
+
|
|
48
|
+
## 验证
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
TARGET|C:\Windows\System32\wscript.exe
|
|
52
|
+
ARGS|//nologo "C:\Users\...\AppData\Local\dsh-mcviseron\launch-dsh.vbs"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
用合成数据库测试:只删除 `127.0.0.1` 的 `dsh-auth-*`,保留 `unrelated` 和 `localhost` 的 cookie,并在 `backups/` 生成备份。
|
package/docs/release.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## 当前状态(2026-10-23)
|
|
4
4
|
|
|
5
|
-
- 包名 **`dsh-mcviseron-plugin` 当前发布 0.
|
|
5
|
+
- 包名 **`dsh-mcviseron-plugin` 当前发布 0.7.1**;v0.6.3 的 host bundle 导入缺陷由 v0.6.4 修复,v0.6.5 修复会话后动作工具注册与 turn/end 监听。
|
|
6
6
|
- npm 账号 `mcviseron` 已恢复正常,可执行首次手动发布。
|
|
7
7
|
- 本机全局 registry 指向 npmmirror,发布时必须显式指定 `--registry=https://registry.npmjs.org/`。
|
|
8
8
|
- 首次发布 **v0.6.1 已手动完成**;从 **v0.6.2** 起由 `.github/workflows/publish.yml` 通过 OIDC Trusted Publishing 发布,tag 推送即发布。
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
|
|
50
50
|
```powershell
|
|
51
51
|
npm view dsh-mcviseron-plugin version dist-tags.latest --registry=https://registry.npmjs.org/
|
|
52
|
-
curl.exe -sI https://registry.npmjs.org/dsh-mcviseron-plugin/-/dsh-mcviseron-plugin-0.
|
|
52
|
+
curl.exe -sI https://registry.npmjs.org/dsh-mcviseron-plugin/-/dsh-mcviseron-plugin-0.7.1.tgz | Select-Object -First 1
|
|
53
53
|
curl.exe -X PUT "https://registry.npmmirror.com/-/package/dsh-mcviseron-plugin/syncs"
|
|
54
54
|
```
|
|
55
55
|
|