@aiyiran/myclaw 1.0.257 → 1.0.258
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/assets/myclaw-artifacts.js +35 -21
- package/index.js +60 -3
- package/package.json +1 -1
- package/patches/patch-manifest.json +1 -1
|
@@ -375,6 +375,7 @@
|
|
|
375
375
|
'flex-shrink: 0',
|
|
376
376
|
].join(';');
|
|
377
377
|
tableHeader.innerHTML = [
|
|
378
|
+
'<span style="flex-shrink:0;width:44px;"></span>',
|
|
378
379
|
'<span style="flex-shrink:0;width:70px;">更新时间</span>',
|
|
379
380
|
'<span style="flex:1;">文件名</span>',
|
|
380
381
|
].join('');
|
|
@@ -439,6 +440,39 @@
|
|
|
439
440
|
}
|
|
440
441
|
}
|
|
441
442
|
|
|
443
|
+
// 复制相对路径按钮(最左侧)
|
|
444
|
+
var copyPathBtn = document.createElement('button');
|
|
445
|
+
copyPathBtn.textContent = '复制';
|
|
446
|
+
copyPathBtn.style.cssText = [
|
|
447
|
+
'flex-shrink: 0',
|
|
448
|
+
'width: 44px',
|
|
449
|
+
'height: 28px',
|
|
450
|
+
'background: #2d2d4a',
|
|
451
|
+
'color: #a78bfa',
|
|
452
|
+
'border: 1px solid #4a4a7a',
|
|
453
|
+
'border-radius: 4px',
|
|
454
|
+
'font-size: 11px',
|
|
455
|
+
'font-family: monospace',
|
|
456
|
+
'cursor: pointer',
|
|
457
|
+
'transition: background 0.15s, color 0.15s',
|
|
458
|
+
].join(';');
|
|
459
|
+
copyPathBtn.onmouseenter = function () { copyPathBtn.style.background = '#3d3d6a'; };
|
|
460
|
+
copyPathBtn.onmouseleave = function () { copyPathBtn.style.background = '#2d2d4a'; };
|
|
461
|
+
copyPathBtn.onclick = function (e) {
|
|
462
|
+
e.stopPropagation();
|
|
463
|
+
var relativePath = getWorkspaceId() + '/' + (asset.path || '');
|
|
464
|
+
navigator.clipboard.writeText(relativePath).then(function () {
|
|
465
|
+
copyPathBtn.textContent = '✓';
|
|
466
|
+
copyPathBtn.style.color = '#10b981';
|
|
467
|
+
copyPathBtn.style.borderColor = '#10b981';
|
|
468
|
+
setTimeout(function () {
|
|
469
|
+
copyPathBtn.textContent = '复制';
|
|
470
|
+
copyPathBtn.style.color = '#a78bfa';
|
|
471
|
+
copyPathBtn.style.borderColor = '#4a4a7a';
|
|
472
|
+
}, 1500);
|
|
473
|
+
});
|
|
474
|
+
};
|
|
475
|
+
|
|
442
476
|
// 文件名(从 path 提取)+ 标记
|
|
443
477
|
var fname = document.createElement('span');
|
|
444
478
|
fname.style.cssText = 'flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;align-items:center;gap:6px;';
|
|
@@ -457,29 +491,9 @@
|
|
|
457
491
|
badge.textContent = '[有更新]';
|
|
458
492
|
fname.appendChild(badge);
|
|
459
493
|
}
|
|
460
|
-
|
|
461
|
-
// 复制相对路径按钮
|
|
462
|
-
var copyPathBtn = document.createElement('span');
|
|
463
|
-
copyPathBtn.textContent = '[复制]';
|
|
464
|
-
copyPathBtn.style.cssText = 'color:#6c6caa;font-size:10px;font-weight:bold;flex-shrink:0;cursor:pointer;transition:color 0.15s;';
|
|
465
|
-
copyPathBtn.onmouseenter = function () { copyPathBtn.style.color = '#a78bfa'; };
|
|
466
|
-
copyPathBtn.onmouseleave = function () { copyPathBtn.style.color = '#6c6caa'; };
|
|
467
|
-
copyPathBtn.onclick = function (e) {
|
|
468
|
-
e.stopPropagation();
|
|
469
|
-
var relativePath = getWorkspaceId() + '/' + (asset.path || '');
|
|
470
|
-
navigator.clipboard.writeText(relativePath).then(function () {
|
|
471
|
-
copyPathBtn.textContent = '[已复制]';
|
|
472
|
-
copyPathBtn.style.color = '#10b981';
|
|
473
|
-
setTimeout(function () {
|
|
474
|
-
copyPathBtn.textContent = '[复制]';
|
|
475
|
-
copyPathBtn.style.color = '#6c6caa';
|
|
476
|
-
}, 1500);
|
|
477
|
-
});
|
|
478
|
-
};
|
|
479
|
-
fname.appendChild(copyPathBtn);
|
|
480
|
-
|
|
481
494
|
fname.appendChild(nameSpan);
|
|
482
495
|
|
|
496
|
+
row.appendChild(copyPathBtn);
|
|
483
497
|
row.appendChild(time);
|
|
484
498
|
row.appendChild(fname);
|
|
485
499
|
container.appendChild(row);
|
package/index.js
CHANGED
|
@@ -206,6 +206,54 @@ function runReinstall() {
|
|
|
206
206
|
console.log('');
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
+
// ============================================================================
|
|
210
|
+
// Lock 4.2 — 卸载 openclaw 并锁定安装 2026.4.2
|
|
211
|
+
// ============================================================================
|
|
212
|
+
|
|
213
|
+
function runLock42() {
|
|
214
|
+
const bar = '────────────────────────────────────────';
|
|
215
|
+
const TARGET = '2026.4.2';
|
|
216
|
+
|
|
217
|
+
console.log('');
|
|
218
|
+
console.log(bar);
|
|
219
|
+
console.log(' 🔒 OpenClaw 版本锁定工具 (目标版本: ' + colors.green + TARGET + colors.nc + ')');
|
|
220
|
+
console.log(bar);
|
|
221
|
+
console.log('');
|
|
222
|
+
|
|
223
|
+
// 1. 卸载
|
|
224
|
+
console.log('[1/2] 🗑️ 卸载当前 openclaw...');
|
|
225
|
+
try {
|
|
226
|
+
execSync('npm uninstall -g openclaw', { stdio: 'inherit' });
|
|
227
|
+
console.log(' ' + colors.green + '✓ 卸载完成' + colors.nc);
|
|
228
|
+
} catch (err) {
|
|
229
|
+
console.log(' ' + colors.yellow + '⚠ 卸载跳过(可能未安装)' + colors.nc);
|
|
230
|
+
}
|
|
231
|
+
console.log('');
|
|
232
|
+
|
|
233
|
+
// 2. 安装指定版本
|
|
234
|
+
console.log('[2/2] 📦 安装 openclaw@' + TARGET + '...');
|
|
235
|
+
try {
|
|
236
|
+
execSync('npm install -g openclaw@' + TARGET, { stdio: 'inherit' });
|
|
237
|
+
console.log(' ' + colors.green + '✓ 安装完成' + colors.nc);
|
|
238
|
+
} catch (err) {
|
|
239
|
+
console.error(' ' + colors.red + '✗ 安装失败: ' + err.message + colors.nc);
|
|
240
|
+
process.exit(1);
|
|
241
|
+
}
|
|
242
|
+
console.log('');
|
|
243
|
+
|
|
244
|
+
// 验证
|
|
245
|
+
try {
|
|
246
|
+
const ver = execSync('openclaw --version', { encoding: 'utf8' }).trim();
|
|
247
|
+
console.log('[验证] ' + colors.green + ver + colors.nc);
|
|
248
|
+
} catch {}
|
|
249
|
+
|
|
250
|
+
console.log('');
|
|
251
|
+
console.log(bar);
|
|
252
|
+
console.log(colors.green + ' ✅ 已锁定到 openclaw@' + TARGET + colors.nc);
|
|
253
|
+
console.log(bar);
|
|
254
|
+
console.log('');
|
|
255
|
+
}
|
|
256
|
+
|
|
209
257
|
// ============================================================================
|
|
210
258
|
// 状态命令
|
|
211
259
|
// ============================================================================
|
|
@@ -1261,10 +1309,17 @@ function showMachineMenu() {
|
|
|
1261
1309
|
const selected = MACHINE_CONFIG[choice - 1];
|
|
1262
1310
|
console.log('');
|
|
1263
1311
|
console.log(colors.green + ' → 已选择: ' + selected.name + ' (' + selected.claw + ')' + colors.nc);
|
|
1264
|
-
console.log(' ' + colors.dim + '→
|
|
1265
|
-
const {
|
|
1312
|
+
console.log(' ' + colors.dim + '→ 正在打开浏览器...' + colors.nc);
|
|
1313
|
+
const { exec } = require('child_process');
|
|
1266
1314
|
const machineUrl = 'https://' + selected.claw + '.kekouen.cn?token=aiyiran';
|
|
1267
|
-
|
|
1315
|
+
const platform = os.platform();
|
|
1316
|
+
if (platform === 'darwin') {
|
|
1317
|
+
exec('open -a "Google Chrome" "' + machineUrl + '"');
|
|
1318
|
+
} else if (platform === 'win32') {
|
|
1319
|
+
exec('start "" "' + machineUrl + '"', { shell: true });
|
|
1320
|
+
} else {
|
|
1321
|
+
exec('xdg-open "' + machineUrl + '"');
|
|
1322
|
+
}
|
|
1268
1323
|
createDesktopShortcut(machineUrl);
|
|
1269
1324
|
} else {
|
|
1270
1325
|
console.log('[' + colors.red + '错误' + colors.nc + '] 无效选择');
|
|
@@ -1858,6 +1913,8 @@ if (!command) {
|
|
|
1858
1913
|
console.log('🔄 正在重启 Gateway 使配置生效...');
|
|
1859
1914
|
console.log('');
|
|
1860
1915
|
runRestart();
|
|
1916
|
+
} else if (command === 'lock4.2') {
|
|
1917
|
+
runLock42();
|
|
1861
1918
|
} else if (command === 'server') {
|
|
1862
1919
|
runServer(args[1]); // args[1] 是可选的 name
|
|
1863
1920
|
} else if (command === 'sync') {
|
package/package.json
CHANGED