px2cc 2.0.4 → 2.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/bin.js +7 -15
  2. package/package.json +1 -1
package/bin.js CHANGED
@@ -1,25 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * Px2CC 启动器 - Windows兼容版本
5
- * 直接导入cli.js,避免spawn的兼容性问题
4
+ * Px2CC 启动器 - 通用版本
5
+ * 直接导入cli.js,跨平台兼容
6
6
  */
7
7
 
8
8
  // 设置环境变量来抑制PromptX内部日志
9
9
  process.env.PROMPTX_QUIET = 'true';
10
10
 
11
- // 直接导入并执行cli.js
11
+ // 修改process.argv让cli.js以为自己是主模块
12
12
  import { fileURLToPath } from 'url';
13
- import { dirname } from 'path';
14
- import { pathToFileURL } from 'url';
13
+ const cliJsPath = fileURLToPath(new URL('cli.js', import.meta.url));
14
+ process.argv[1] = cliJsPath;
15
15
 
16
- const __filename = fileURLToPath(import.meta.url);
17
- const __dirname = dirname(__filename);
18
-
19
- // 构建cli.js的文件URL(兼容Windows)
20
- const cliPath = new URL('cli.js', import.meta.url).href;
21
-
22
- import(cliPath).catch(error => {
23
- console.error('启动失败:', error.message);
24
- process.exit(1);
25
- });
16
+ // 导入并执行cli.js
17
+ import('./cli.js');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "px2cc",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "CLI tool that implements complete PromptX Action flow in Claude Code - role activation, dependency loading, cognition networks & memory systems",
5
5
  "main": "cli.js",
6
6
  "type": "module",