@aiyiran/myclaw 1.1.90 → 1.1.91

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.
Files changed (2) hide show
  1. package/index.js +15 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2081,11 +2081,13 @@ async function runServer(name) {
2081
2081
  if (fs.existsSync(targetConfigPath)) {
2082
2082
  config = JSON.parse(fs.readFileSync(targetConfigPath, 'utf-8'));
2083
2083
  console.log('[Server] 已有配置: ' + targetConfigPath);
2084
- } else {
2085
- const clawName = name || generateRandomName();
2086
- config = { claw: clawName };
2084
+ } else if (name) {
2085
+ config = { claw: name };
2087
2086
  fs.writeFileSync(targetConfigPath, JSON.stringify(config, null, 2), 'utf-8');
2088
2087
  console.log('[Server] 创建配置: ' + targetConfigPath);
2088
+ } else {
2089
+ console.error('[' + colors.red + '错误' + colors.nc + '] 未找到配置文件,请先指定名称: mc server <name>');
2090
+ process.exit(1);
2089
2091
  }
2090
2092
 
2091
2093
  console.log('[Server] CLAW_NAME: ' + config.claw);
@@ -2680,7 +2682,16 @@ if (!command) {
2680
2682
  } else if (command === 'muban') {
2681
2683
  runSyncTemplates();
2682
2684
  } else if (command === 'init') {
2683
- console.log('init 还没实现,后续添加钩子');
2685
+ console.log('[mc init] 开始初始化流程...');
2686
+ console.log('');
2687
+ console.log('[1/3] mc up — 升级');
2688
+ runUpdate();
2689
+ console.log('');
2690
+ console.log('[2/3] mc patch — 注入 UI + 技能');
2691
+ runPatch();
2692
+ console.log('');
2693
+ console.log('[3/3] mc server — 启动同步服务');
2694
+ runServer(args[1]);
2684
2695
  } else if (command === 'main') {
2685
2696
  runMain();
2686
2697
  } else if (command === 'test') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.1.90",
3
+ "version": "1.1.91",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {