@aiyiran/myclaw 1.0.80 → 1.0.82

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.
Binary file
package/index.js CHANGED
@@ -368,6 +368,8 @@ call myclaw up
368
368
  echo.
369
369
  wsl -d OpenClaw -- myclaw launch
370
370
  echo.
371
+ REM 在退出前安全地在后台刷新桌面图标和本脚本内容
372
+ call myclaw bat >nul 2>&1
371
373
  pause
372
374
  exit /b
373
375
 
@@ -385,6 +387,8 @@ echo Type exit to close this window.
385
387
  echo ============================================
386
388
  echo.
387
389
  wsl -d OpenClaw --cd /root/.openclaw
390
+ REM 在退出前安全地在后台刷新桌面图标和本脚本内容
391
+ call myclaw bat >nul 2>&1
388
392
  pause
389
393
  `;
390
394
 
@@ -393,13 +397,14 @@ pause
393
397
  fs.writeFileSync(batPath, batContent.replace(/\n/g, '\r\n'), 'utf8');
394
398
 
395
399
  // 用 PowerShell 创建带图标的桌面快捷方式 + 刷新桌面
400
+ const iconPath = path.join(__dirname, 'assets', 'openclaw.ico');
396
401
  const psScript = `
397
402
  $ws = New-Object -ComObject WScript.Shell
398
403
  $sc = $ws.CreateShortcut('${lnkPath.replace(/\\/g, '\\\\')}')
399
404
  $sc.TargetPath = '${batPath.replace(/\\/g, '\\\\')}'
400
405
  $sc.WorkingDirectory = '${myClawDir.replace(/\\/g, '\\\\')}'
401
406
  $sc.WindowStyle = 1
402
- $sc.IconLocation = '%SystemRoot%\\System32\\shell32.dll,176'
407
+ $sc.IconLocation = '${iconPath.replace(/\\/g, '\\\\')}'
403
408
  $sc.Description = 'OpenClaw'
404
409
  $sc.Save()
405
410
  Add-Type -TypeDefinition 'using System; using System.Runtime.InteropServices; public class Shell { [DllImport("shell32.dll")] public static extern void SHChangeNotify(int e, int f, IntPtr i1, IntPtr i2); }' -ErrorAction SilentlyContinue
@@ -0,0 +1,233 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>OpenClaw - 科技龙虾图标生成器</title>
6
+ <style>
7
+ body {
8
+ background-color: #0f172a;
9
+ color: #e2e8f0;
10
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
11
+ display: flex;
12
+ flex-direction: column;
13
+ align-items: center;
14
+ justify-content: center;
15
+ height: 100vh;
16
+ margin: 0;
17
+ }
18
+ .container {
19
+ text-align: center;
20
+ background: #1e293b;
21
+ padding: 2rem;
22
+ border-radius: 12px;
23
+ box-shadow: 0 10px 25px rgba(0,0,0,0.5);
24
+ border: 1px solid #334155;
25
+ position: relative;
26
+ overflow: hidden;
27
+ }
28
+ .container::before {
29
+ content: "";
30
+ position: absolute;
31
+ top: -50%; left: -50%;
32
+ width: 200%; height: 200%;
33
+ background: conic-gradient(transparent, transparent, transparent, #ef4444);
34
+ animation: rotate 4s linear infinite;
35
+ z-index: 0;
36
+ opacity: 0.15;
37
+ }
38
+ @keyframes rotate {
39
+ 100% { transform: rotate(360deg); }
40
+ }
41
+ .content {
42
+ position: relative;
43
+ z-index: 1;
44
+ }
45
+ h1 {
46
+ color: #ef4444;
47
+ text-transform: uppercase;
48
+ letter-spacing: 2px;
49
+ font-size: 1.5rem;
50
+ margin-bottom: 20px;
51
+ text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
52
+ }
53
+ canvas {
54
+ image-rendering: pixelated; /* 保持像素边缘锐利 */
55
+ border: 2px solid #450a0a;
56
+ background-color: transparent;
57
+ margin-bottom: 20px;
58
+ border-radius: 8px;
59
+ box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
60
+ width: 256px; /* 放大展示,但实际画布是 32x32 */
61
+ height: 256px;
62
+ }
63
+ button {
64
+ background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
65
+ color: #ffffff;
66
+ border: none;
67
+ padding: 10px 24px;
68
+ font-size: 16px;
69
+ font-weight: bold;
70
+ border-radius: 6px;
71
+ cursor: pointer;
72
+ transition: all 0.3s ease;
73
+ box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
74
+ }
75
+ button:hover {
76
+ transform: translateY(-2px);
77
+ box-shadow: 0 0 25px rgba(239, 68, 68, 0.7);
78
+ }
79
+ .desc {
80
+ margin-top: 15px;
81
+ font-size: 0.85rem;
82
+ color: #94a3b8;
83
+ }
84
+ </style>
85
+ </head>
86
+ <body>
87
+
88
+ <div class="container">
89
+ <div class="content">
90
+ <h1>Hero Lobster / 英雄赤虾</h1>
91
+ <!-- 画布分辨率提升,渲染战斗姿态和旋转 -->
92
+ <canvas id="iconCanvas" width="256" height="256"></canvas>
93
+ <br>
94
+ <button onclick="downloadIcon()">⬇️ 下载为 PNG 格式</button>
95
+ <div class="desc">
96
+ 右键保存或点击下载。<br>
97
+ 你可以用第三方工具把下载的 PNG 转换为 .ico 文件。
98
+ </div>
99
+ </div>
100
+ </div>
101
+
102
+ <script>
103
+ // 调色板
104
+ const colors = {
105
+ '0': null, // 透明背景
106
+ 'C': '#fbbf24', // 科技金 (外骨骼描边)
107
+ 'B': '#b91c1c', // 暗装甲红 (战甲主体)
108
+ 'R': '#ef4444', // 亮装甲红 (巨钳/关键装甲)
109
+ 'W': '#00f0ff', // 赛博青 (能量眼/核心高光)
110
+ 'D': '#450a0a' // 深红阴影
111
+ };
112
+
113
+ // 16x16 像素阵列 (手工打造的机甲龙虾)
114
+ const pixels16 = [
115
+ "00R00000000R00",
116
+ "0RBR00C00RBR0",
117
+ "0RRRC0D0CRR00",
118
+ "00C00BDB00C00",
119
+ "00C00RDR00C00",
120
+ "000CBBBBBC000",
121
+ "0CBC0BBB0CBC0",
122
+ "CBBB0CBC0BBBC",
123
+ "0CCBBBBBBBCC0",
124
+ "00C0BBBBB0C00",
125
+ "000C0BBB0C000",
126
+ "0000CBBB0C000",
127
+ "000CBBBBBC000",
128
+ "00CBB0C0BB0C0",
129
+ "0CBB0C0C0BBC0",
130
+ "CC00CC0CC00CC"
131
+ ];
132
+
133
+ // 修正对称性和细节,使其完美 16x16
134
+ const refined16 = [
135
+ "00RR000000RR00",
136
+ "00RBR0000RBR00",
137
+ "00RRRC00CRRR00",
138
+ "0000CBBBBC0000",
139
+ "0000CRWBRC0000",
140
+ "000CBBBBBBC000",
141
+ "00CBCDBBDCBC00",
142
+ "0CBBBCBBCBBBC0",
143
+ "00CCBBBBBBCC00",
144
+ "000CBBBBBBC000",
145
+ "0000CBBBBC0000",
146
+ "0000CBBBBC0000",
147
+ "000CBBBBBBC000",
148
+ "00CBBCCBBCCBB0",
149
+ "0CBB0C00C0BBC0",
150
+ "0CC00000000CC0"
151
+ ];
152
+
153
+ // 我们重新设计了 32x32 的矩阵,赋予其具备极其强烈的科技感和对称双能量钳,配合旋转依然是霸气的战斗突进姿态
154
+ const design32 = [
155
+ "00000000000000000000000000000000",
156
+ "000RRRR000000000000000000RRRR000",
157
+ "00RRRRRR0000000000000000RRRRRR00",
158
+ "0RRRWWWRR00000000000000RRWWWRRR0",
159
+ "0RRWWWWWR00000000000000RWWWWWRR0",
160
+ "0RRWWRWWR00000000000000RWWRWWRR0",
161
+ "0RRRWWWRR00000000000000RRWWWRRR0",
162
+ "00RRRBRRR000000CC000000RRRBRRR00",
163
+ "000RBBBR000000C00C000000RBBBR000",
164
+ "000RRRRC00000C0DD0C00000CRRRR000",
165
+ "00000000CC00C0DDDD0C00CC00000000",
166
+ "000000000CCC0WWDDWW0CCC000000000",
167
+ "000000000C0BBCCDDCCBB0C000000000",
168
+ "00000000CBBBBBBBBBBBBBBC00000000",
169
+ "0000000CBBBBBBBBBBBBBBBBC0000000",
170
+ "000000CBBBBBBBBBBBBBBBBBBC000000",
171
+ "00000CBBBC0CBBBBBBBBC0CBBBC00000",
172
+ "0000CBBBBBC0CBBBBBBC0CBBBBBC0000",
173
+ "0000CBBBBBBC0CBBBBC0CBBBBBBC0000",
174
+ "000CBBBBCCCBCCCBBCCCBCCCBBBBC000",
175
+ "00CBBBBC00CCC0CBBBC0CCC0CBBBBC00",
176
+ "00CCCCC00000CBBBBBBC00000CCCCC00",
177
+ "000000000000CBBBBBBC000000000000",
178
+ "00000000000CCBBBBBBCC00000000000",
179
+ "0000000000CBBBBBBBBBBC0000000000",
180
+ "000000000CBBBBBBBBBBBBC000000000",
181
+ "00000000CBBBBCBBBBCBBBBC00000000",
182
+ "0000000CBBBBC0BBBB0CBBBBC0000000",
183
+ "000000CBBBBC00CBBBC00CBBBBC00000",
184
+ "00000CBBBBC0000CBBC0000CBBBBC000",
185
+ "0000CBBBBC000000CC000000CBBBBC00",
186
+ "000CCCCC00000000000000000CCCCC00"
187
+ ];
188
+
189
+ const canvas = document.getElementById('iconCanvas');
190
+ const ctx = canvas.getContext('2d');
191
+
192
+ // 绘制函数
193
+ function drawLobster() {
194
+ // 画布已由 HTML 升级到了 256x256
195
+ ctx.clearRect(0, 0, 256, 256);
196
+
197
+ ctx.save();
198
+ // 平移到画布中心
199
+ ctx.translate(128, 128);
200
+ // 旋转135度,使得原本朝上(-Y)的头部,指向左下角(-X,+Y方向)
201
+ ctx.rotate(-135 * Math.PI / 180);
202
+
203
+ // 设定每个“虚拟像素块”的缩放尺寸
204
+ const size = 5.5;
205
+ const offset = -(32 * size) / 2;
206
+
207
+ for (let y = 0; y < 32; y++) {
208
+ for (let x = 0; x < 32; x++) {
209
+ const char = design32[y][x];
210
+ if (char && colors[char]) {
211
+ ctx.fillStyle = colors[char];
212
+ // 宽高加上0.5像素防止抗锯齿在不同浏览器上产生像素缝隙
213
+ ctx.fillRect(offset + x * size, offset + y * size, size + 0.5, size + 0.5);
214
+ }
215
+ }
216
+ }
217
+ ctx.restore();
218
+ }
219
+
220
+ // 初始化绘制
221
+ drawLobster();
222
+
223
+ // 导出 PNG
224
+ function downloadIcon() {
225
+ const dataURL = canvas.toDataURL('image/png');
226
+ const link = document.createElement('a');
227
+ link.download = 'openclaw-tech-lobster.png';
228
+ link.href = dataURL;
229
+ link.click();
230
+ }
231
+ </script>
232
+ </body>
233
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.0.80",
3
+ "version": "1.0.82",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {