@aiyiran/myclaw 1.0.260 → 1.0.262

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/index.js CHANGED
@@ -1348,12 +1348,24 @@ function showMachineMenu() {
1348
1348
  console.log(colors.green + ' → 已选择: ' + selected.name + ' (' + selected.claw + ')' + colors.nc);
1349
1349
  console.log(' ' + colors.dim + '→ 正在打开浏览器...' + colors.nc);
1350
1350
  const { exec } = require('child_process');
1351
+ const fs = require('fs');
1351
1352
  const machineUrl = 'https://' + selected.claw + '.kekouen.cn?token=aiyiran';
1352
1353
  const platform = os.platform();
1353
1354
  if (platform === 'darwin') {
1354
1355
  exec('open -a "Google Chrome" "' + machineUrl + '"');
1355
1356
  } else if (platform === 'win32') {
1356
- exec('start "" "' + machineUrl + '"', { shell: true });
1357
+ // 优先找 Chrome,找不到才用默认浏览器
1358
+ const chromeCandidates = [
1359
+ path.join(process.env.PROGRAMFILES || 'C:\\Program Files', 'Google', 'Chrome', 'Application', 'chrome.exe'),
1360
+ path.join(process.env['PROGRAMFILES(X86)'] || 'C:\\Program Files (x86)', 'Google', 'Chrome', 'Application', 'chrome.exe'),
1361
+ path.join(process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local'), 'Google', 'Chrome', 'Application', 'chrome.exe'),
1362
+ ];
1363
+ const chromePath = chromeCandidates.find(function (p) { try { return fs.existsSync(p); } catch { return false; } });
1364
+ if (chromePath) {
1365
+ exec('"' + chromePath + '" "' + machineUrl + '"');
1366
+ } else {
1367
+ exec('start "" "' + machineUrl + '"', { shell: true });
1368
+ }
1357
1369
  } else {
1358
1370
  exec('xdg-open "' + machineUrl + '"');
1359
1371
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.0.260",
3
+ "version": "1.0.262",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -36,7 +36,7 @@
36
36
  {
37
37
  "id": "fashe1",
38
38
  "workspace": "workspace-fashe1",
39
- "strategy": "auto",
39
+ "strategy": "off",
40
40
  "description": "fashe1"
41
41
  }
42
42
  ],
@@ -47,6 +47,8 @@ class JimengVideoAdapter:
47
47
  try:
48
48
  err_json = json.loads(e.args[0].decode('utf-8'))
49
49
  raise RuntimeError(f"即梦 API 错误: {err_json}")
50
+ except RuntimeError:
51
+ raise
50
52
  except Exception:
51
53
  pass
52
54
  raise RuntimeError(f"即梦提交失败: {str(e)}")
@@ -78,6 +80,8 @@ class JimengVideoAdapter:
78
80
  if err_json.get("code") in (50500, 50501):
79
81
  continue # Server error, can retry
80
82
  raise RuntimeError(f"即梦查询失败: {err_json}")
83
+ except RuntimeError:
84
+ raise
81
85
  except Exception:
82
86
  pass
83
87
  raise RuntimeError(f"即梦查询异常: {str(e)}")