engine7 7.1.46 → 7.1.47

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 +15 -1
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -2344,7 +2344,21 @@ async function main() {
2344
2344
  if (args[i] === "--state-dir" && args[i + 1]) stateDir = args[++i].trim();
2345
2345
  else if (args[i] === "--config" && args[i + 1]) configName = args[++i].trim();
2346
2346
  }
2347
- if (!stateDir) stateDir = path3.resolve(process.cwd());
2347
+ if (!stateDir) {
2348
+ const cwd = path3.resolve(process.cwd());
2349
+ if (fs3.existsSync(path3.join(cwd, "configs"))) {
2350
+ stateDir = cwd;
2351
+ } else {
2352
+ const pointer = path3.join(process.env.HOME || process.env.USERPROFILE || ".", ".engine7.json");
2353
+ if (fs3.existsSync(pointer)) {
2354
+ try {
2355
+ stateDir = JSON.parse(fs3.readFileSync(pointer, "utf8")).stateDir || "";
2356
+ } catch {
2357
+ }
2358
+ }
2359
+ if (!stateDir) stateDir = path3.join(process.env.HOME || process.env.USERPROFILE || ".", ".engine7");
2360
+ }
2361
+ }
2348
2362
  if (!target && !isLegacyAddchannel) {
2349
2363
  console.log("\u{1F527} engine7 reconfig \u2014 \u91CD\u65B0\u914D\u7F6E\u5DF2\u88C5\u7684 agent");
2350
2364
  console.log(" \u7528\u6CD5: engine7 reconfig <\u76EE\u6807>");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "engine7",
3
- "version": "7.1.46",
3
+ "version": "7.1.47",
4
4
  "type": "module",
5
5
  "description": "Engine 7 — 给助手一个家 / A home for your AI assistant",
6
6
  "main": "dist/main.mjs",