dsh-desktop-windows 0.3.0 → 0.3.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/README.en.md +1 -1
- package/README.md +1 -1
- package/package.json +2 -1
- package/src/main.js +62 -1
package/README.en.md
CHANGED
|
@@ -19,7 +19,7 @@ Pure shell — it **does not modify dsh itself**. The server reuses your globall
|
|
|
19
19
|
- 🗂️ **Session manager**: `Alt → File → Session Manager…` lists every session, delete with one click (permanently removes chat history)
|
|
20
20
|
- 🪟 **Standalone window**: native desktop window loading the Harness Web UI
|
|
21
21
|
- 🍱 **System tray**: closing the window minimizes to the tray; right-click to show or quit
|
|
22
|
-
- 🔄 **Easy reload**: `F5` / `Ctrl+R` / floating button —
|
|
22
|
+
- 🔄 **Easy reload**: `F5` / `Ctrl+R` / floating button — reloads the Web UI; frontend plugins (skins, layout, enhancements) take effect on reload without restarting the app
|
|
23
23
|
- 🧭 **Auto environment setup**: on first launch it detects Node.js / dsh and guides a one-click install — friendly to non-technical users
|
|
24
24
|
- 🔧 **Configurable port**: `npm start -- --port 3081` when 3080 is taken
|
|
25
25
|
- 🧠 **Smart reuse**: reuses an already-running dsh service instead of starting a duplicate
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ DeepSeek Harness 的 **Electron 桌面壳**:双击图标,一个独立窗口
|
|
|
21
21
|
- 🗂️ **会话管理**:`Alt → 文件 → 会话管理…` 列出所有会话,一键删除(永久清理聊天记录)
|
|
22
22
|
- 🪟 **独立窗口**:原生桌面窗口加载 Harness Web UI,可最小化到任务栏
|
|
23
23
|
- 🍱 **系统托盘**:关窗口最小化到托盘常驻,右键菜单可随时显示/退出
|
|
24
|
-
- 🔄 **便捷刷新**:`F5` / `Ctrl+R` /
|
|
24
|
+
- 🔄 **便捷刷新**:`F5` / `Ctrl+R` / 右下角悬浮按钮,重新加载 Web UI——前端类插件(皮肤、布局、增强)装完刷新即生效,无需重启应用
|
|
25
25
|
- 🧭 **环境自动引导**:首次启动自动检测 Node.js / dsh,缺失时引导一键安装,小白也能搞定
|
|
26
26
|
- 🔧 **可换端口**:`npm start -- --port 3081` 解决端口占用
|
|
27
27
|
- 🧠 **智能复用**:检测到已有的 dsh 服务就直接复用,不重复启动
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-desktop-windows",
|
|
3
3
|
"productName": "DeepSeek Harness Desktop",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"description": "DeepSeek Harness 桌面版(Windows)· Electron desktop shell for DeepSeek Harness — 双击即用 / double-click to run · 支持选区截图提问、系统托盘、会话管理 / region screenshot, system tray, session manager",
|
|
6
6
|
"main": "src/main.js",
|
|
7
7
|
"license": "MIT",
|
|
@@ -65,3 +65,4 @@
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
|
package/src/main.js
CHANGED
|
@@ -214,7 +214,8 @@ function startDsh(port) {
|
|
|
214
214
|
const logFile = path.join(app.getPath('userData'), 'dsh.log')
|
|
215
215
|
const out = fs.openSync(logFile, 'a')
|
|
216
216
|
// shell:true 时把参数拼进命令字符串(参数均为常量),避免 DEP0190 警告
|
|
217
|
-
|
|
217
|
+
// --no-open 关闭 dsh 默认的自动打开浏览器行为(桌面壳自己用 BrowserWindow 加载,不弹浏览器)
|
|
218
|
+
const cmd = `"${bin}" web --port ${port} --no-open`
|
|
218
219
|
const child = spawn(cmd, {
|
|
219
220
|
shell: true,
|
|
220
221
|
windowsHide: true,
|
|
@@ -307,6 +308,58 @@ async function shutdownOwnedDsh() {
|
|
|
307
308
|
}
|
|
308
309
|
}
|
|
309
310
|
|
|
311
|
+
/**
|
|
312
|
+
* 重启 dsh 服务:杀掉当前由本壳启动的 dsh → 重新拉起 → 等就绪 → 刷新页面。
|
|
313
|
+
* 供「重启 dsh 服务」菜单/托盘项使用(后端插件/服务改动后需要)。
|
|
314
|
+
*/
|
|
315
|
+
async function restartDshService() {
|
|
316
|
+
if (!ownedDsh) {
|
|
317
|
+
log('restart: no owned dsh to restart')
|
|
318
|
+
// 没有自管的 dsh(可能复用了外部服务)→ 无法安全重启,提示用户
|
|
319
|
+
dialog.showMessageBox(mainWindow || undefined, {
|
|
320
|
+
type: 'info',
|
|
321
|
+
title: '无法重启',
|
|
322
|
+
message: '当前使用的是外部已有的 dsh 服务,不是本应用启动的,无法从这里重启。',
|
|
323
|
+
detail: '请在外部终端手动重启该服务,然后刷新页面(F5)。',
|
|
324
|
+
buttons: ['好'],
|
|
325
|
+
noLink: true,
|
|
326
|
+
})
|
|
327
|
+
return
|
|
328
|
+
}
|
|
329
|
+
const port = resolvePort()
|
|
330
|
+
log(`restart: restarting dsh service on port ${port}…`)
|
|
331
|
+
// 先停(标记主动关停,避免触发崩溃自愈逻辑)
|
|
332
|
+
await shutdownOwnedDsh()
|
|
333
|
+
isShuttingDownDsh = false // 重置,让后续退出能触发自愈
|
|
334
|
+
// 重新启动
|
|
335
|
+
ownedDsh = startDsh(port)
|
|
336
|
+
const ready = await waitForServer(port, START_TIMEOUT_MS)
|
|
337
|
+
if (!ready) {
|
|
338
|
+
log('restart: dsh failed to come back')
|
|
339
|
+
dialog.showMessageBox(mainWindow || undefined, {
|
|
340
|
+
type: 'error',
|
|
341
|
+
title: '重启失败',
|
|
342
|
+
message: 'dsh 服务重启后未在预期时间内就绪。',
|
|
343
|
+
detail: `日志文件:${path.join(app.getPath('userData'), 'dsh.log')}`,
|
|
344
|
+
buttons: ['好'],
|
|
345
|
+
noLink: true,
|
|
346
|
+
})
|
|
347
|
+
return
|
|
348
|
+
}
|
|
349
|
+
log('restart: dsh back up; reloading window')
|
|
350
|
+
// 等页面也能加载后刷新
|
|
351
|
+
if (mainWindow && !mainWindow.isDestroyed()) {
|
|
352
|
+
mainWindow.loadURL(`http://127.0.0.1:${port}`)
|
|
353
|
+
}
|
|
354
|
+
dialog.showMessageBox(mainWindow || undefined, {
|
|
355
|
+
type: 'info',
|
|
356
|
+
title: 'dsh 服务已重启',
|
|
357
|
+
message: 'dsh 服务已重启完成,页面已刷新。',
|
|
358
|
+
buttons: ['好'],
|
|
359
|
+
noLink: true,
|
|
360
|
+
}).catch(() => {})
|
|
361
|
+
}
|
|
362
|
+
|
|
310
363
|
/* ------------------------------------------------------------------ *
|
|
311
364
|
* 会话管理(读取/删除 ~/.dsh/sessions 下的会话)
|
|
312
365
|
* ------------------------------------------------------------------ */
|
|
@@ -705,6 +758,10 @@ function createTray() {
|
|
|
705
758
|
shell.openPath(dir)
|
|
706
759
|
},
|
|
707
760
|
},
|
|
761
|
+
{
|
|
762
|
+
label: '重启 dsh 服务',
|
|
763
|
+
click: () => { restartDshService() },
|
|
764
|
+
},
|
|
708
765
|
{ type: 'separator' },
|
|
709
766
|
{
|
|
710
767
|
label: '退出',
|
|
@@ -737,6 +794,10 @@ function createApplicationMenu() {
|
|
|
737
794
|
label: '会话管理…',
|
|
738
795
|
click: () => openSessionsWindow(),
|
|
739
796
|
},
|
|
797
|
+
{
|
|
798
|
+
label: '重启 dsh 服务…',
|
|
799
|
+
click: () => restartDshService(),
|
|
800
|
+
},
|
|
740
801
|
{ type: 'separator' },
|
|
741
802
|
{
|
|
742
803
|
label: '退出',
|