engine7 7.0.9 → 7.1.1

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 +14 -6
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -496,11 +496,19 @@ engine7 start \u2014 \u542F\u52A8 Engine
496
496
  if (fs.existsSync(localPath)) {
497
497
  enginePath = localPath;
498
498
  } else {
499
- const globalRoot = execSync("npm root -g", { encoding: "utf-8" }).trim();
500
- enginePath = path.join(globalRoot, "engine7", "dist", "main.mjs");
501
- if (!fs.existsSync(enginePath)) {
502
- console.error("\u274C \u627E\u4E0D\u5230 engine7 \u5B89\u88C5");
503
- process.exit(1);
499
+ const cliPath = path.resolve(process.argv[1]);
500
+ const distDir = path.dirname(cliPath);
501
+ const candidate = path.join(distDir, "main.mjs");
502
+ if (fs.existsSync(candidate)) {
503
+ enginePath = candidate;
504
+ } else {
505
+ try {
506
+ const globalRoot = execSync("npm root -g", { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
507
+ enginePath = path.join(globalRoot, "engine7", "dist", "main.mjs");
508
+ } catch {
509
+ console.error("\u274C \u627E\u4E0D\u5230 engine7 main.mjs");
510
+ process.exit(1);
511
+ }
504
512
  }
505
513
  }
506
514
  console.log(`\u{1F680} engine7 start`);
@@ -521,7 +529,7 @@ engine7 start \u2014 \u542F\u52A8 Engine
521
529
  } catch {
522
530
  }
523
531
  console.log("");
524
- const child = spawn("node", [enginePath, "--engine-config", configPath2], {
532
+ const child = spawn(process.execPath, [enginePath, "--engine-config", configPath2], {
525
533
  stdio: "inherit",
526
534
  shell: false
527
535
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "engine7",
3
- "version": "7.0.9",
3
+ "version": "7.1.1",
4
4
  "type": "module",
5
5
  "description": "Engine 7 — Self-hosted AI agent engine",
6
6
  "main": "dist/main.mjs",