px2cc 2.0.2 → 2.0.3

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 +6 -69
  2. package/package.json +1 -1
package/bin.js CHANGED
@@ -1,78 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * Px2CC 启动器 - 过滤PromptX内部日志
4
+ * Px2CC 启动器 - Windows兼容版本
5
+ * 直接导入cli.js,避免spawn的兼容性问题
5
6
  */
6
7
 
7
- import { spawn } from 'child_process';
8
- import { fileURLToPath } from 'url';
9
- import { dirname, join } from 'path';
8
+ // 设置环境变量来抑制PromptX内部日志
9
+ process.env.PROMPTX_QUIET = 'true';
10
10
 
11
- // 获取当前文件所在目录
12
- const __filename = fileURLToPath(import.meta.url);
13
- const __dirname = dirname(__filename);
14
-
15
- // CLI脚本路径
16
- const cliPath = join(__dirname, 'cli.js');
17
-
18
- // 启动CLI并过滤日志
19
- const child = spawn('node', [cliPath], {
20
- stdio: ['inherit', 'pipe', 'pipe']
21
- });
22
-
23
- // 过滤stdout
24
- child.stdout.on('data', (data) => {
25
- const output = data.toString();
26
- const lines = output.split('\n');
27
-
28
- const filteredLines = lines.filter(line => {
29
- return !(
30
- line.includes('@promptx/core') ||
31
- line.includes('ResourceManager') ||
32
- line.includes('PackageDiscovery') ||
33
- line.includes('UserDiscovery') ||
34
- line.includes('ProjectDiscovery') ||
35
- line.includes('项目未初始化') ||
36
- line.includes('Registry loaded') ||
37
- line.includes('Discovery managers') ||
38
- line.includes('Initialization complete')
39
- );
40
- });
41
-
42
- if (filteredLines.length > 0) {
43
- process.stdout.write(filteredLines.join('\n'));
44
- }
45
- });
46
-
47
- // 过滤stderr
48
- child.stderr.on('data', (data) => {
49
- const output = data.toString();
50
- const lines = output.split('\n');
51
-
52
- const filteredLines = lines.filter(line => {
53
- return !(
54
- line.includes('@promptx/core') ||
55
- line.includes('ResourceManager') ||
56
- line.includes('PackageDiscovery') ||
57
- line.includes('UserDiscovery') ||
58
- line.includes('ProjectDiscovery') ||
59
- line.includes('项目未初始化') ||
60
- line.includes('Registry loaded') ||
61
- line.includes('Discovery managers') ||
62
- line.includes('Initialization complete')
63
- );
64
- });
65
-
66
- if (filteredLines.length > 0) {
67
- process.stderr.write(filteredLines.join('\n'));
68
- }
69
- });
70
-
71
- child.on('close', (code) => {
72
- process.exit(code);
73
- });
74
-
75
- child.on('error', (error) => {
11
+ // 直接导入并执行cli.js
12
+ import('./cli.js').catch(error => {
76
13
  console.error('启动失败:', error.message);
77
14
  process.exit(1);
78
15
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "px2cc",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
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",