@aiyiran/myclaw 1.1.199 → 1.1.200
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 +12 -4
- package/package.json +1 -1
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 {
|