@aiyiran/myclaw 1.0.259 → 1.0.260

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.
@@ -163,7 +163,7 @@
163
163
  'top: 75px',
164
164
  'right: 0',
165
165
  'width: 380px',
166
- 'max-height: calc(100vh - 550px)',
166
+ 'height: 500px',
167
167
  'background: #1e1e2e',
168
168
  'border-radius: 8px 0 0 8px',
169
169
  'overflow: hidden',
package/index.js CHANGED
@@ -883,9 +883,25 @@ function runOpen() {
883
883
  function createDesktopShortcut(url) {
884
884
  const fs = require('fs');
885
885
  const platform = os.platform();
886
- const desktopPath = path.join(os.homedir(), 'Desktop');
887
886
 
888
- if (!fs.existsSync(desktopPath)) {
887
+ // 查找桌面路径(Windows 兼容 OneDrive 同步桌面)
888
+ function findDesktop() {
889
+ const candidates = [path.join(os.homedir(), 'Desktop')];
890
+ if (platform === 'win32') {
891
+ candidates.push(
892
+ path.join(os.homedir(), 'OneDrive', 'Desktop'),
893
+ path.join(os.homedir(), 'OneDrive - Personal', 'Desktop'),
894
+ path.join(os.homedir(), 'OneDrive - 个人', 'Desktop'),
895
+ );
896
+ }
897
+ for (const d of candidates) {
898
+ try { if (fs.existsSync(d)) return d; } catch {}
899
+ }
900
+ return null;
901
+ }
902
+
903
+ const desktopPath = findDesktop();
904
+ if (!desktopPath) {
889
905
  console.log('[shortcut] ⚠ 未找到桌面目录,跳过');
890
906
  return;
891
907
  }
@@ -915,8 +931,18 @@ Icon=text-html
915
931
  fs.writeFileSync(desktop, content, 'utf8');
916
932
  try { execSync('chmod +x "' + desktop + '"', { stdio: 'pipe' }); } catch {}
917
933
  console.log('[shortcut] ✅ 桌面快捷方式已更新: OpenClaw.desktop');
918
- } else {
919
- console.log('[shortcut] Windows 请使用 mc bat 创建桌面快捷方式');
934
+ } else if (platform === 'win32') {
935
+ // Windows: .url 文件(Internet Shortcut),Windows 原生支持,双击在默认浏览器打开
936
+ // 无需 PowerShell,直接写文件,100% 可靠
937
+ const urlFile = path.join(desktopPath, '打开网页小龙虾.url');
938
+ const content = '[InternetShortcut]\r\nURL=' + url + '\r\n';
939
+ try {
940
+ fs.writeFileSync(urlFile, content, 'utf8');
941
+ console.log('[shortcut] ✅ 桌面快捷方式已创建: 打开网页小龙虾.url');
942
+ console.log('[shortcut] 路径: ' + urlFile);
943
+ } catch (err) {
944
+ console.log('[shortcut] ⚠ 创建失败: ' + err.message);
945
+ }
920
946
  }
921
947
  }
922
948
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.0.259",
3
+ "version": "1.0.260",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {