dsh-oc-desktop 0.3.11 → 0.3.13

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.
Files changed (2) hide show
  1. package/launcher/main.js +20 -3
  2. package/package.json +9 -1
package/launcher/main.js CHANGED
@@ -409,8 +409,16 @@ function createMainWindow(url) {
409
409
  win.on('resize', saveStateDebounced);
410
410
  win.on('move', saveStateDebounced);
411
411
  attachShellGuards(win);
412
- win.webContents.on('did-fail-load', (e, code, desc) => {
413
- if (code !== -3) showError(`页面加载失败 (${code} ${desc})`);
412
+ win.webContents.on('did-fail-load', (e, code, desc, url, isMainFrame) => {
413
+ // -3 (ERR_ABORTED) 是正常的中止(导航被替换/用户取消),不算失败
414
+ if (code === -3) return;
415
+ // 子框架(iframe)加载失败(如某个预览面板尝试连本地 5173)不应整页报错,
416
+ // 否则会把已正常加载的 harness 页面覆盖成错误页。仅记日志。
417
+ if (!isMainFrame) {
418
+ log('warn', `subframe load failed (${code} ${desc}) url=${url}`);
419
+ return;
420
+ }
421
+ showError(`页面加载失败 (${code} ${desc})`);
414
422
  });
415
423
  return win;
416
424
  }
@@ -854,7 +862,16 @@ ipcMain.on('set-window-bg', (_e, color) => {
854
862
  // 无单独更新:引擎有新版时兼容插件随引擎一起更新,不兼容插件保留;更新前备份旧引擎,可回滚。
855
863
  function runCommand(cmd, args) {
856
864
  return new Promise((resolve, reject) => {
857
- const p = spawn(cmd, args, { windowsHide: true, stdio: ['ignore', 'pipe', 'pipe'] });
865
+ // npx / npm 等是 .cmd shim,Node spawn Windows 无法直接执行(报 ENOENT),
866
+ // 须经 cmd /c 运行(与 spawnEngine / autoBootstrapSource 同款:仅含空白参数加引号)。
867
+ let command = cmd;
868
+ let spawnArgs = args;
869
+ if (process.platform === 'win32') {
870
+ const line = [cmd, ...args].map((a) => (/\s/.test(String(a)) ? `"${String(a).replace(/"/g, '""')}"` : String(a))).join(' ');
871
+ command = process.env.ComSpec || 'cmd.exe';
872
+ spawnArgs = ['/d', '/s', '/c', line];
873
+ }
874
+ const p = spawn(command, spawnArgs, { windowsHide: true, stdio: ['ignore', 'pipe', 'pipe'] });
858
875
  let out = '';
859
876
  p.stdout.on('data', (d) => { out += d; });
860
877
  p.stderr.on('data', (d) => { out += d; });
package/package.json CHANGED
@@ -1,12 +1,20 @@
1
1
  {
2
2
  "name": "dsh-oc-desktop",
3
3
  "productName": "DeepSeek Harness Desktop",
4
- "version": "0.3.11",
4
+ "version": "0.3.13",
5
5
  "description": "DeepSeek Harness 桌面端插件(Electron 启动器):自绘标题栏/托盘/通知/快捷键/崩溃自愈",
6
6
  "main": "launcher/main.js",
7
7
  "bin": {
8
8
  "dsh-desktop": "bin/dsh-desktop.cjs"
9
9
  },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/FeiJi-9527/dsh"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "author": "feiji9527",
10
18
  "scripts": {
11
19
  "start": "electron .",
12
20
  "postinstall": "node scripts/postinstall.js",