px2cc 2.1.0 → 2.1.1
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 +16 -8
- package/cli.js +3 -3
- package/package.json +2 -2
package/bin.js
CHANGED
|
@@ -2,16 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Px2CC 启动器 - 通用版本
|
|
5
|
-
*
|
|
5
|
+
* 直接调用主函数,确保跨平台兼容
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
// 设置环境变量来抑制PromptX内部日志
|
|
9
9
|
process.env.LOG_LEVEL = 'silent';
|
|
10
10
|
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
// 动态导入并直接调用main函数
|
|
12
|
+
(async () => {
|
|
13
|
+
try {
|
|
14
|
+
const { main } = await import('./cli.js');
|
|
15
|
+
if (typeof main === 'function') {
|
|
16
|
+
await main();
|
|
17
|
+
} else {
|
|
18
|
+
// 如果没有导出main函数,直接导入模块(会自动执行)
|
|
19
|
+
await import('./cli.js');
|
|
20
|
+
}
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.error('启动失败:', error.message);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
})();
|
package/cli.js
CHANGED
|
@@ -299,7 +299,7 @@ async function installRole(selectedRole, installType, claudeDir, manager, select
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
// 主程序入口
|
|
302
|
-
async function main() {
|
|
302
|
+
export async function main() {
|
|
303
303
|
try {
|
|
304
304
|
showWelcome();
|
|
305
305
|
|
|
@@ -373,8 +373,8 @@ async function main() {
|
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
-
// 运行主程序
|
|
377
|
-
if (import.meta.url === new URL(process.argv[1], 'file:').href) {
|
|
376
|
+
// 运行主程序 - 简化条件判断以提高兼容性
|
|
377
|
+
if (import.meta.url === new URL(process.argv[1], 'file:').href || process.argv[1].endsWith('cli.js')) {
|
|
378
378
|
main().catch(error => {
|
|
379
379
|
console.error(chalk.red('❌ 程序异常:'), error.message);
|
|
380
380
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "px2cc",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
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",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"author": "PromptX Bridge Team",
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"engines": {
|
|
41
|
-
"node": ">=
|
|
41
|
+
"node": ">=18.0.0"
|
|
42
42
|
},
|
|
43
43
|
"repository": {
|
|
44
44
|
"type": "git",
|