foliko 1.1.41 → 1.1.42

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.
@@ -7,11 +7,11 @@ const fs = require('fs');
7
7
  const path = require('path');
8
8
  const { spawn } = require('child_process');
9
9
 
10
- // 使用 project root 的绝对路径
11
- const PROJECT_ROOT = path.join(__dirname, '../../../');
12
- const DAEMON_SCRIPT = path.join(PROJECT_ROOT, 'examples', 'daemon.js');
13
- const PID_FILE = path.join(PROJECT_ROOT, '.foliko.pid');
14
- const LOG_FILE = path.join(PROJECT_ROOT, '.foliko.log');
10
+ // 使用当前工作目录
11
+ const CWD = process.cwd();
12
+ const DAEMON_SCRIPT = path.join(__dirname, '../../../examples/daemon.js');
13
+ const PID_FILE = path.join(CWD, '.foliko.pid');
14
+ const LOG_FILE = path.join(CWD, '.foliko.log');
15
15
 
16
16
  /**
17
17
  * 获取 PID 文件中的进程 ID
@@ -51,7 +51,7 @@ async function startDaemon() {
51
51
  const child = spawn(process.execPath, [DAEMON_SCRIPT], {
52
52
  detached: true,
53
53
  stdio: 'ignore',
54
- cwd: PROJECT_ROOT,
54
+ cwd: CWD,
55
55
  });
56
56
 
57
57
  // 重定向输出到日志文件
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foliko",
3
- "version": "1.1.41",
3
+ "version": "1.1.42",
4
4
  "description": "简约的插件化 Agent 框架",
5
5
  "main": "src/index.js",
6
6
  "type": "commonjs",