@aiyiran/myclaw 1.1.199 → 1.1.201
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 +7 -4
- package/index.js +12 -4
- package/package.json +1 -1
|
@@ -248,8 +248,7 @@
|
|
|
248
248
|
|
|
249
249
|
// 展示间跳转(发布按钮左边)
|
|
250
250
|
var showcaseLink = document.createElement('a');
|
|
251
|
-
|
|
252
|
-
showcaseLink.href = 'https://www.yiranlaoshi.com/studio?claw=' + _scClaw + '&my=' + _scClaw;
|
|
251
|
+
showcaseLink.href = getMyProjectsUrl();
|
|
253
252
|
showcaseLink.target = '_blank';
|
|
254
253
|
showcaseLink.textContent = '我的项目';
|
|
255
254
|
showcaseLink.style.cssText = 'cursor:pointer;padding:2px 10px;border-radius:3px;font-size:12px;background:rgba(255,255,255,0.08);transition:background 0.15s;color:#cdd6f4;text-decoration:none;';
|
|
@@ -337,6 +336,11 @@
|
|
|
337
336
|
return agent === 'main' ? 'workspace' : 'workspace-' + agent;
|
|
338
337
|
}
|
|
339
338
|
|
|
339
|
+
function getMyProjectsUrl() {
|
|
340
|
+
var claw = lastKnownClawName || '';
|
|
341
|
+
return 'https://www.yiranlaoshi.com/studio?claw=' + claw + '&my=' + claw;
|
|
342
|
+
}
|
|
343
|
+
|
|
340
344
|
function fetchArtifactsFromLocalAPI(wsPrefix) {
|
|
341
345
|
var url = MYCLAW_API_BASE + '/api/artifacts?workspace=' + encodeURIComponent(wsPrefix);
|
|
342
346
|
console.log('[myclaw-artifacts] [1/3] 尝试 LocalAPI:', url);
|
|
@@ -2293,8 +2297,7 @@
|
|
|
2293
2297
|
|
|
2294
2298
|
var showcaseBtn = document.createElement('a');
|
|
2295
2299
|
var cfgAgent = getAgentName() || 'main';
|
|
2296
|
-
|
|
2297
|
-
showcaseBtn.href = 'https://www.yiranlaoshi.com/showcase?workspace=' + cfgWs;
|
|
2300
|
+
showcaseBtn.href = getMyProjectsUrl();
|
|
2298
2301
|
showcaseBtn.target = '_blank';
|
|
2299
2302
|
showcaseBtn.textContent = '\uD83D\uDC41 \u67E5\u770B' + cfgAgent + '\u9879\u76EE\u96C6';
|
|
2300
2303
|
showcaseBtn.style.cssText = [
|
package/index.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* ============================================================================
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
const { execSync } = require('child_process');
|
|
26
|
+
const { execSync, execFileSync } = require('child_process');
|
|
27
27
|
const os = require('os');
|
|
28
28
|
const path = require('path');
|
|
29
29
|
const readline = require('readline');
|
|
@@ -1442,6 +1442,14 @@ function runUpdate() {
|
|
|
1442
1442
|
console.log('');
|
|
1443
1443
|
}
|
|
1444
1444
|
|
|
1445
|
+
// 自升级会替换当前正在运行的全局包文件,但本进程已缓存旧 package.json/version。
|
|
1446
|
+
// 用全新的 Node 进程执行 patch,确保复制新资源并写入新版本号。
|
|
1447
|
+
function runPatchFresh() {
|
|
1448
|
+
execFileSync(process.execPath, [path.join(__dirname, 'index.js'), 'patch'], {
|
|
1449
|
+
stdio: 'inherit'
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1445
1453
|
// ============================================================================
|
|
1446
1454
|
// mc main — 确保 agents.list 中存在 id=main 且排在第一位
|
|
1447
1455
|
// ============================================================================
|
|
@@ -2672,7 +2680,7 @@ if (!command) {
|
|
|
2672
2680
|
// 更新后自动 patch,恢复 UI 注入和自定义配置
|
|
2673
2681
|
console.log('');
|
|
2674
2682
|
console.log('🔧 自动执行 patch 以恢复自定义配置...');
|
|
2675
|
-
|
|
2683
|
+
runPatchFresh();
|
|
2676
2684
|
if (detectPlatform() === 'windows') {
|
|
2677
2685
|
runBat();
|
|
2678
2686
|
}
|
|
@@ -2693,7 +2701,7 @@ if (!command) {
|
|
|
2693
2701
|
console.log('');
|
|
2694
2702
|
console.log('[1/4] mc up — 升级包 + patch');
|
|
2695
2703
|
runUpdate();
|
|
2696
|
-
|
|
2704
|
+
runPatchFresh();
|
|
2697
2705
|
if (detectPlatform() === 'windows') {
|
|
2698
2706
|
runBat();
|
|
2699
2707
|
}
|
|
@@ -2816,7 +2824,7 @@ if (!command) {
|
|
|
2816
2824
|
runUpdate();
|
|
2817
2825
|
console.log('');
|
|
2818
2826
|
console.log('[2/4] mc patch — 注入 UI + 技能');
|
|
2819
|
-
|
|
2827
|
+
runPatchFresh();
|
|
2820
2828
|
console.log('');
|
|
2821
2829
|
console.log('[2.5/4] inject-minimax --default — 注入 MiniMax 模型并设为默认');
|
|
2822
2830
|
try {
|