px2cc 2.0.2 → 2.0.4
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.
- package/bin.js +11 -64
- package/package.json +1 -1
package/bin.js
CHANGED
|
@@ -1,78 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Px2CC 启动器 -
|
|
4
|
+
* Px2CC 启动器 - Windows兼容版本
|
|
5
|
+
* 直接导入cli.js,避免spawn的兼容性问题
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
// 设置环境变量来抑制PromptX内部日志
|
|
9
|
+
process.env.PROMPTX_QUIET = 'true';
|
|
10
|
+
|
|
11
|
+
// 直接导入并执行cli.js
|
|
8
12
|
import { fileURLToPath } from 'url';
|
|
9
|
-
import { dirname
|
|
13
|
+
import { dirname } from 'path';
|
|
14
|
+
import { pathToFileURL } from 'url';
|
|
10
15
|
|
|
11
|
-
// 获取当前文件所在目录
|
|
12
16
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
17
|
const __dirname = dirname(__filename);
|
|
14
18
|
|
|
15
|
-
//
|
|
16
|
-
const cliPath =
|
|
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
|
-
});
|
|
19
|
+
// 构建cli.js的文件URL(兼容Windows)
|
|
20
|
+
const cliPath = new URL('cli.js', import.meta.url).href;
|
|
74
21
|
|
|
75
|
-
|
|
22
|
+
import(cliPath).catch(error => {
|
|
76
23
|
console.error('启动失败:', error.message);
|
|
77
24
|
process.exit(1);
|
|
78
25
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "px2cc",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
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",
|