dsh-mcviseron-plugin 0.6.6 → 0.6.8
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 +15 -0
- package/README.en.md +2 -1
- package/README.md +2 -1
- package/docs/dsh-cookie-launcher.md +55 -0
- package/docs/release.md +2 -2
- package/lib/index.js +13 -9
- package/package.json +21 -16
- 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/session-end/index.ts +13 -9
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,21 @@
|
|
|
7
7
|
- Restart 组件支持 macOS/Linux(当前仅 Windows 桌面版)。
|
|
8
8
|
- 把定时巡检任务 prompt 更新为当前单条目架构。
|
|
9
9
|
|
|
10
|
+
## [0.6.8] - 2026-10-25
|
|
11
|
+
|
|
12
|
+
### Compatibility
|
|
13
|
+
|
|
14
|
+
- **预适配 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 待升级后做真实运行时验证。
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **`set_session_end_action` 导致自动化会话运行失败**:该工具通过原始 `tools.register` 注册,`parameters` 仍是内部字段表,没有顶层 `type: "object"`;严格模型 Provider 收到 `type: null` 后拒绝整个请求。改为标准 object JSON Schema,并补测试固定 `type/required/properties`。
|
|
19
|
+
- **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`。
|
|
20
|
+
|
|
21
|
+
### Tests
|
|
22
|
+
|
|
23
|
+
- 合计 **112 项测试**。
|
|
24
|
+
|
|
10
25
|
## [0.6.6] - 2026-10-23
|
|
11
26
|
|
|
12
27
|
### Added
|
package/README.en.md
CHANGED
|
@@ -146,7 +146,8 @@ Defaults: appearance off / `08:00–23:00`; auto-review both guards on, 6 s, 400
|
|
|
146
146
|
|
|
147
147
|
| DSH version | Status |
|
|
148
148
|
| --- | --- |
|
|
149
|
-
| `0.2.1-rc.
|
|
149
|
+
| `0.2.1-rc.3` | ✅ pre-adapted (rc.3 types/deps + 112 tests; desktop nightly runtime pending) |
|
|
150
|
+
| `0.2.1-rc.2` | ✅ current desktop runtime (112 tests + real Cordis contexts) |
|
|
150
151
|
| `0.2.0-rc.x` | ✅ covered by the peer range |
|
|
151
152
|
| `0.1.x` | ❌ unsupported (different settings-namespace model) |
|
|
152
153
|
|
package/README.md
CHANGED
|
@@ -240,7 +240,8 @@ DSH 0.2 的官方设置 apiproxy 不向浏览器暴露第三方命名空间,
|
|
|
240
240
|
|
|
241
241
|
| DSH 版本 | 状态 |
|
|
242
242
|
| --- | --- |
|
|
243
|
-
| `0.2.1-rc.
|
|
243
|
+
| `0.2.1-rc.3` | ✅ 预适配(rc.3 类型/依赖 + 112 项测试;桌面 nightly 待升级运行时验证) |
|
|
244
|
+
| `0.2.1-rc.2` | ✅ 当前桌面运行版本(112 项测试 + 真实 Cordis 上下文) |
|
|
244
245
|
| `0.2.0-rc.x` | ✅ peer 范围覆盖(同一套设置、审批与 hook 接缝) |
|
|
245
246
|
| `0.1.x` | ❌ 不支持:0.1 的插件自行注册设置命名空间,与本插件的条目 id 命名空间模型不同 |
|
|
246
247
|
|
|
@@ -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.6.
|
|
5
|
+
- 包名 **`dsh-mcviseron-plugin` 当前发布 0.6.8**;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.6.
|
|
52
|
+
curl.exe -sI https://registry.npmjs.org/dsh-mcviseron-plugin/-/dsh-mcviseron-plugin-0.6.8.tgz | Select-Object -First 1
|
|
53
53
|
curl.exe -X PUT "https://registry.npmmirror.com/-/package/dsh-mcviseron-plugin/syncs"
|
|
54
54
|
```
|
|
55
55
|
|
package/lib/index.js
CHANGED
|
@@ -13083,15 +13083,19 @@ function installAgentTool(ctx, controller, options, log) {
|
|
|
13083
13083
|
"Use close only when the user explicitly asks to close DSH. Shutdown is user-only. If unsure whether a restart is required, ask the user instead of arming."
|
|
13084
13084
|
].join(" "),
|
|
13085
13085
|
parameters: {
|
|
13086
|
-
|
|
13087
|
-
|
|
13088
|
-
|
|
13089
|
-
|
|
13090
|
-
|
|
13091
|
-
|
|
13092
|
-
|
|
13093
|
-
|
|
13094
|
-
|
|
13086
|
+
type: "object",
|
|
13087
|
+
additionalProperties: false,
|
|
13088
|
+
required: ["action"],
|
|
13089
|
+
properties: {
|
|
13090
|
+
action: {
|
|
13091
|
+
type: "string",
|
|
13092
|
+
enum: ["restart", "close", "off"],
|
|
13093
|
+
description: "restart DSH after this turn, close DSH, or clear the pending action"
|
|
13094
|
+
},
|
|
13095
|
+
reason: {
|
|
13096
|
+
type: "string",
|
|
13097
|
+
description: "Optional short reason shown in the tool result; the user sees the same action in the composer"
|
|
13098
|
+
}
|
|
13095
13099
|
}
|
|
13096
13100
|
},
|
|
13097
13101
|
output: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mcviseron-plugin",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.8",
|
|
4
4
|
"description": "DeepSeek Harness (DSH) master plugin — one package hosting MCviseron's DSH components as separate bundle entries: a time-based light/dark Appearance schedule, an Auto-review fix (shutdown preset guard + Chinese approval-reason translation), and a todo plan guard that keeps multi-stage work advancing, one-shot after-session restart/close actions with task-aware waiting, and automatic auth-cookie hygiene for repeated desktop restarts.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
92
|
-
"@deepseek-ai/dsh-client-connection": "^0.2.0-rc.2 || ^0.2.1-rc.2",
|
|
93
|
-
"@deepseek-ai/dsh-client-locale": "^0.2.0-rc.2 || ^0.2.1-rc.2",
|
|
94
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.2.0-rc.2 || ^0.2.1-rc.2",
|
|
95
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.2.0-rc.2 || ^0.2.1-rc.2",
|
|
96
|
-
"@deepseek-ai/dsh-host-webserver": "^0.2.0-rc.2 || ^0.2.1-rc.2",
|
|
97
|
-
"@deepseek-ai/dsh-settings": "^0.2.0-rc.2 || ^0.2.1-rc.2",
|
|
92
|
+
"@deepseek-ai/dsh-client-connection": "^0.2.0-rc.2 || ^0.2.1-rc.2 || ^0.2.1-rc.3",
|
|
93
|
+
"@deepseek-ai/dsh-client-locale": "^0.2.0-rc.2 || ^0.2.1-rc.2 || ^0.2.1-rc.3",
|
|
94
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.2.0-rc.2 || ^0.2.1-rc.2 || ^0.2.1-rc.3",
|
|
95
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.2.0-rc.2 || ^0.2.1-rc.2 || ^0.2.1-rc.3",
|
|
96
|
+
"@deepseek-ai/dsh-host-webserver": "^0.2.0-rc.2 || ^0.2.1-rc.2 || ^0.2.1-rc.3",
|
|
97
|
+
"@deepseek-ai/dsh-settings": "^0.2.0-rc.2 || ^0.2.1-rc.2 || ^0.2.1-rc.3",
|
|
98
98
|
"react": "^18.2.0",
|
|
99
99
|
"react-dom": "^18.2.0"
|
|
100
100
|
},
|
|
@@ -129,14 +129,14 @@
|
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
131
|
"@deepseek-ai/cordis": "^4.0.5",
|
|
132
|
-
"@deepseek-ai/dsh-client-connection": "^0.2.1-rc.
|
|
133
|
-
"@deepseek-ai/dsh-client-locale": "^0.2.1-rc.
|
|
134
|
-
"@deepseek-ai/dsh-client-store": "^0.2.1-rc.
|
|
135
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.1-rc.
|
|
136
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.2.1-rc.
|
|
137
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.2.1-rc.
|
|
138
|
-
"@deepseek-ai/dsh-host-webserver": "^0.2.1-rc.
|
|
139
|
-
"@deepseek-ai/dsh-settings": "^0.2.1-rc.
|
|
132
|
+
"@deepseek-ai/dsh-client-connection": "^0.2.1-rc.3",
|
|
133
|
+
"@deepseek-ai/dsh-client-locale": "^0.2.1-rc.3",
|
|
134
|
+
"@deepseek-ai/dsh-client-store": "^0.2.1-rc.3",
|
|
135
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.1-rc.3",
|
|
136
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.2.1-rc.3",
|
|
137
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.2.1-rc.3",
|
|
138
|
+
"@deepseek-ai/dsh-host-webserver": "^0.2.1-rc.3",
|
|
139
|
+
"@deepseek-ai/dsh-settings": "^0.2.1-rc.3",
|
|
140
140
|
"@types/node": "^22.20.0",
|
|
141
141
|
"@types/nodemailer": "^6.4.15",
|
|
142
142
|
"@types/react": "~18.3.1",
|
|
@@ -147,6 +147,11 @@
|
|
|
147
147
|
"react": "^18.3.1",
|
|
148
148
|
"react-dom": "^18.3.1",
|
|
149
149
|
"typescript": "~5.7.2",
|
|
150
|
-
"zustand": "4.4.7"
|
|
150
|
+
"zustand": "4.4.7",
|
|
151
|
+
"@deepseek-ai/dsh-scope": "^0.2.1-rc.3",
|
|
152
|
+
"@deepseek-ai/dsh-brand": "^0.2.1-rc.3",
|
|
153
|
+
"@deepseek-ai/dsh-session": "^0.2.1-rc.3",
|
|
154
|
+
"@deepseek-ai/dsh-app-boot": "^0.2.1-rc.3",
|
|
155
|
+
"@deepseek-ai/dsh-config-editor": "^0.2.1-rc.3"
|
|
151
156
|
}
|
|
152
157
|
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Delete old DSH desktop authentication cookies before launching DSH.
|
|
3
|
+
|
|
4
|
+
Chromium stores cookies by host, not port. DSH uses a new loopback port on every
|
|
5
|
+
launch, so its 30-day dsh-auth-* cookies accumulate until the Cookie request
|
|
6
|
+
header exceeds the Host's 16 KiB limit. This runs before the app starts, while
|
|
7
|
+
the cookie DB is unlocked.
|
|
8
|
+
|
|
9
|
+
Only rows for 127.0.0.1 whose name starts with dsh-auth- are removed. The DB is
|
|
10
|
+
backed up first. DSH_COOKIE_DB / DSH_COOKIE_LAUNCHER_DIR are test overrides.
|
|
11
|
+
"""
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import os
|
|
15
|
+
import shutil
|
|
16
|
+
import sqlite3
|
|
17
|
+
import sys
|
|
18
|
+
from datetime import datetime
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
|
|
21
|
+
HOST = "127.0.0.1"
|
|
22
|
+
PREFIX = "dsh-auth-"
|
|
23
|
+
WHERE = "host_key = ? and name like ?"
|
|
24
|
+
ARGS = (HOST, PREFIX + "%")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def main() -> int:
|
|
28
|
+
appdata = Path(os.environ.get("APPDATA", Path.home() / "AppData" / "Roaming"))
|
|
29
|
+
db = Path(os.environ.get("DSH_COOKIE_DB", appdata / "@deepseek-ai" / "dsh-desktop" / "Network" / "Cookies"))
|
|
30
|
+
base = Path(os.environ.get("DSH_COOKIE_LAUNCHER_DIR", Path(os.environ.get("LOCALAPPDATA", Path.home() / "AppData" / "Local")) / "dsh-mcviseron"))
|
|
31
|
+
backups = base / "backups"
|
|
32
|
+
log_path = base / "launcher.log"
|
|
33
|
+
base.mkdir(parents=True, exist_ok=True)
|
|
34
|
+
|
|
35
|
+
def log(message: str) -> None:
|
|
36
|
+
try:
|
|
37
|
+
with log_path.open("a", encoding="utf-8") as handle:
|
|
38
|
+
handle.write(datetime.now().astimezone().isoformat() + " " + message + "\n")
|
|
39
|
+
except OSError:
|
|
40
|
+
pass
|
|
41
|
+
|
|
42
|
+
if not db.is_file():
|
|
43
|
+
log("cookie database missing: " + str(db))
|
|
44
|
+
return 0
|
|
45
|
+
|
|
46
|
+
try:
|
|
47
|
+
con = sqlite3.connect(str(db), timeout=2)
|
|
48
|
+
try:
|
|
49
|
+
before = con.execute("select count(*) from cookies where " + WHERE, ARGS).fetchone()[0]
|
|
50
|
+
finally:
|
|
51
|
+
con.close()
|
|
52
|
+
except Exception as error:
|
|
53
|
+
log("cookie database unavailable (DSH may still be running): " + repr(error))
|
|
54
|
+
return 0
|
|
55
|
+
|
|
56
|
+
if before == 0:
|
|
57
|
+
log("no stale dsh-auth cookies")
|
|
58
|
+
return 0
|
|
59
|
+
|
|
60
|
+
stamp = datetime.now().strftime("%Y%m%d-%H%M%S")
|
|
61
|
+
backups.mkdir(parents=True, exist_ok=True)
|
|
62
|
+
backup = backups / ("Cookies-" + stamp)
|
|
63
|
+
try:
|
|
64
|
+
shutil.copy2(db, backup)
|
|
65
|
+
for suffix in ("-wal", "-shm"):
|
|
66
|
+
side = Path(str(db) + suffix)
|
|
67
|
+
if side.is_file():
|
|
68
|
+
shutil.copy2(side, Path(str(backup) + suffix))
|
|
69
|
+
log("backup " + str(backup))
|
|
70
|
+
except OSError as error:
|
|
71
|
+
log("backup failed: " + repr(error))
|
|
72
|
+
|
|
73
|
+
try:
|
|
74
|
+
con = sqlite3.connect(str(db), timeout=2)
|
|
75
|
+
try:
|
|
76
|
+
deleted = con.execute("delete from cookies where " + WHERE, ARGS).rowcount
|
|
77
|
+
con.commit()
|
|
78
|
+
after = con.execute("select count(*) from cookies where " + WHERE, ARGS).fetchone()[0]
|
|
79
|
+
finally:
|
|
80
|
+
con.close()
|
|
81
|
+
log("deleted=" + str(deleted) + " remaining=" + str(after))
|
|
82
|
+
except Exception as error:
|
|
83
|
+
log("delete failed: " + repr(error))
|
|
84
|
+
|
|
85
|
+
try:
|
|
86
|
+
old = sorted(backups.glob("Cookies-*"), key=lambda item: item.stat().st_mtime, reverse=True)
|
|
87
|
+
for extra in old[10:]:
|
|
88
|
+
extra.unlink(missing_ok=True)
|
|
89
|
+
for suffix in ("-wal", "-shm"):
|
|
90
|
+
Path(str(extra) + suffix).unlink(missing_ok=True)
|
|
91
|
+
except OSError:
|
|
92
|
+
pass
|
|
93
|
+
return 0
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
if __name__ == "__main__":
|
|
97
|
+
sys.exit(main())
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Option Explicit
|
|
2
|
+
Dim sh, fso, base, python, cleanup, exe
|
|
3
|
+
Set sh = CreateObject("WScript.Shell")
|
|
4
|
+
Set fso = CreateObject("Scripting.FileSystemObject")
|
|
5
|
+
base = sh.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\dsh-mcviseron"
|
|
6
|
+
python = "D:\Python\Python312\python.exe"
|
|
7
|
+
If Not fso.FileExists(python) Then python = "python.exe"
|
|
8
|
+
cleanup = base & "\clean-dsh-auth-cookies.py"
|
|
9
|
+
If fso.FileExists(cleanup) Then
|
|
10
|
+
On Error Resume Next
|
|
11
|
+
sh.Run """" & python & """ """ & cleanup & """", 0, True
|
|
12
|
+
On Error GoTo 0
|
|
13
|
+
End If
|
|
14
|
+
exe = "D:\DeepSeek Harness\DeepSeek Harness.exe"
|
|
15
|
+
sh.CurrentDirectory = "D:\DeepSeek Harness"
|
|
16
|
+
sh.Run """" & exe & """", 1, False
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[string]$ExePath = 'D:\DeepSeek Harness\DeepSeek Harness.exe',
|
|
3
|
+
[string]$LauncherDir = (Join-Path $env:LOCALAPPDATA 'dsh-mcviseron')
|
|
4
|
+
)
|
|
5
|
+
$ErrorActionPreference = 'Stop'
|
|
6
|
+
$source = Join-Path $PSScriptRoot 'dsh-cookie-launcher'
|
|
7
|
+
if (-not (Test-Path -LiteralPath $ExePath)) { throw "DSH executable not found: $ExePath" }
|
|
8
|
+
if (-not (Test-Path -LiteralPath $source)) { throw "launcher sources not found: $source" }
|
|
9
|
+
|
|
10
|
+
New-Item -ItemType Directory -Force -Path $LauncherDir | Out-Null
|
|
11
|
+
Copy-Item -LiteralPath (Join-Path $source 'clean-dsh-auth-cookies.py') -Destination $LauncherDir -Force
|
|
12
|
+
Copy-Item -LiteralPath (Join-Path $source 'launch-dsh.vbs') -Destination $LauncherDir -Force
|
|
13
|
+
|
|
14
|
+
$ws = New-Object -ComObject WScript.Shell
|
|
15
|
+
$roots = @(
|
|
16
|
+
(Join-Path $env:USERPROFILE 'Desktop'),
|
|
17
|
+
(Join-Path $env:APPDATA 'Microsoft\Windows\Start Menu'),
|
|
18
|
+
(Join-Path $env:ProgramData 'Microsoft\Windows\Start Menu'),
|
|
19
|
+
(Join-Path $env:APPDATA 'Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar'),
|
|
20
|
+
'C:\Users\Public\Desktop'
|
|
21
|
+
) | Where-Object { Test-Path -LiteralPath $_ } | Select-Object -Unique
|
|
22
|
+
|
|
23
|
+
$changed = 0
|
|
24
|
+
foreach ($root in $roots) {
|
|
25
|
+
Get-ChildItem -LiteralPath $root -Recurse -Filter '*.lnk' -ErrorAction SilentlyContinue | ForEach-Object {
|
|
26
|
+
$lnk = $_.FullName
|
|
27
|
+
$shortcut = $ws.CreateShortcut($lnk)
|
|
28
|
+
if ($shortcut.TargetPath -ne $ExePath) { return }
|
|
29
|
+
$backup = "$lnk.bak-dsh-cookie"
|
|
30
|
+
if (-not (Test-Path -LiteralPath $backup)) {
|
|
31
|
+
Copy-Item -LiteralPath $lnk -Destination $backup -Force
|
|
32
|
+
}
|
|
33
|
+
$shortcut.TargetPath = Join-Path $env:SystemRoot 'System32\wscript.exe'
|
|
34
|
+
$shortcut.Arguments = '//nologo "' + (Join-Path $LauncherDir 'launch-dsh.vbs') + '"'
|
|
35
|
+
$shortcut.WorkingDirectory = Split-Path -Parent $ExePath
|
|
36
|
+
$shortcut.IconLocation = "$ExePath,0"
|
|
37
|
+
$shortcut.Description = 'DeepSeek Harness (clears stale DSH auth cookies before launch)'
|
|
38
|
+
$shortcut.Save()
|
|
39
|
+
$changed += 1
|
|
40
|
+
Write-Output "updated: $lnk"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if ($changed -eq 0) {
|
|
45
|
+
Write-Output 'no DSH shortcut was changed; check the Start Menu shortcut target'
|
|
46
|
+
} else {
|
|
47
|
+
Write-Output "changed $changed shortcut(s); launcher: $LauncherDir"
|
|
48
|
+
}
|
package/src/session-end/index.ts
CHANGED
|
@@ -538,15 +538,19 @@ function installAgentTool(ctx: Context, controller: SessionEndController, option
|
|
|
538
538
|
'Use close only when the user explicitly asks to close DSH. Shutdown is user-only. If unsure whether a restart is required, ask the user instead of arming.',
|
|
539
539
|
].join(' '),
|
|
540
540
|
parameters: {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
541
|
+
type: 'object',
|
|
542
|
+
additionalProperties: false,
|
|
543
|
+
required: ['action'],
|
|
544
|
+
properties: {
|
|
545
|
+
action: {
|
|
546
|
+
type: 'string',
|
|
547
|
+
enum: ['restart', 'close', 'off'],
|
|
548
|
+
description: 'restart DSH after this turn, close DSH, or clear the pending action',
|
|
549
|
+
},
|
|
550
|
+
reason: {
|
|
551
|
+
type: 'string',
|
|
552
|
+
description: 'Optional short reason shown in the tool result; the user sees the same action in the composer',
|
|
553
|
+
},
|
|
550
554
|
},
|
|
551
555
|
},
|
|
552
556
|
output: {
|