engine7 7.0.4 → 7.0.5

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/dist/cli.mjs +19 -5
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -26,9 +26,8 @@ function parseArgs() {
26
26
  }
27
27
  }
28
28
  if (!stateDir) {
29
- console.error("\u274C \u7F3A\u5C11 --state-dir \u53C2\u6570");
30
- console.error(" \u7528\u6CD5: engine7 init --state-dir <path>");
31
- process.exit(1);
29
+ stateDir = path.join(process.env.HOME || process.env.USERPROFILE || ".", ".engine7");
30
+ console.log(` \u4F7F\u7528\u9ED8\u8BA4\u76EE\u5F55: ${stateDir}`);
32
31
  }
33
32
  stateDir = path.resolve(stateDir);
34
33
  return { stateDir, quick, dryRun: dryRun2 };
@@ -468,12 +467,16 @@ engine7 start \u2014 \u542F\u52A8 Engine
468
467
  }
469
468
  if (!configPath2) {
470
469
  const defaultCfg = path.join("configs", "main7.json");
470
+ const homeCfg = path.join(process.env.HOME || process.env.USERPROFILE || ".", ".engine7", "configs", "main7.json");
471
471
  if (fs.existsSync(defaultCfg)) {
472
472
  configPath2 = defaultCfg;
473
+ } else if (fs.existsSync(homeCfg)) {
474
+ configPath2 = homeCfg;
475
+ console.log(` \u4F7F\u7528\u9ED8\u8BA4 config: ${homeCfg}`);
473
476
  } else {
474
477
  console.error("\u274C \u627E\u4E0D\u5230 config \u6587\u4EF6");
475
478
  console.error(" \u7528\u6CD5: engine7 start --config <path>");
476
- console.error(" \u6216\u5728\u5F53\u524D\u76EE\u5F55\u521B\u5EFA configs/main7.json");
479
+ console.error(" \u6216\u5148\u8FD0\u884C: engine7 init\uFF08\u9ED8\u8BA4\u521B\u5EFA ~/.engine7\uFF09");
477
480
  process.exit(1);
478
481
  }
479
482
  }
@@ -540,7 +543,18 @@ engine7 service \u2014 \u5F00\u673A\u81EA\u542F\u52A8\u7BA1\u7406
540
543
  }
541
544
  if (!configPath2) {
542
545
  const defaultCfg = path.join(cwd, "configs", "main7.json");
543
- configPath2 = fs.existsSync(defaultCfg) ? defaultCfg : path.join(cwd, "configs", "main7.json");
546
+ const homeCfg = path.join(process.env.HOME || process.env.USERPROFILE || ".", ".engine7", "configs", "main7.json");
547
+ if (fs.existsSync(defaultCfg)) {
548
+ configPath2 = defaultCfg;
549
+ } else if (fs.existsSync(homeCfg)) {
550
+ configPath2 = homeCfg;
551
+ cwd = path.join(process.env.HOME || process.env.USERPROFILE || ".", ".engine7");
552
+ } else {
553
+ console.error("\u274C \u627E\u4E0D\u5230 config \u6587\u4EF6");
554
+ console.error(" \u7528\u6CD5: engine7 service install --config <path>");
555
+ console.error(" \u6216\u5148\u8FD0\u884C: engine7 init\uFF08\u9ED8\u8BA4\u521B\u5EFA ~/.engine7\uFF09");
556
+ process.exit(1);
557
+ }
544
558
  }
545
559
  const { execSync } = await import("node:child_process");
546
560
  const engine7Bin = process.argv[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "engine7",
3
- "version": "7.0.4",
3
+ "version": "7.0.5",
4
4
  "type": "module",
5
5
  "description": "Engine 7 — Self-hosted AI agent engine",
6
6
  "main": "dist/main.mjs",