@kevisual/cnb 0.0.64 → 0.0.65
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/agent/cli.ts +1 -1
- package/agent/live.ts +46 -0
- package/bin/live.js +2 -0
- package/dist/cli-live.d.ts +2 -0
- package/dist/cli-live.js +5227 -0
- package/dist/cli.js +168 -168
- package/dist/keep.js +14 -14
- package/dist/npc.js +168 -168
- package/dist/opencode.js +158 -158
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +157 -157
- package/package.json +2 -1
- package/src/workspace/keep-file-live.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kevisual/cnb",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.65",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"basename": "/root/cnb",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"bin": {
|
|
21
21
|
"cnb": "bin/index.js",
|
|
22
22
|
"cloud": "bin/index.js",
|
|
23
|
+
"cloud-live": "bin/live.js",
|
|
23
24
|
"cloud-npc": "bin/npc.js"
|
|
24
25
|
},
|
|
25
26
|
"files": [
|
|
@@ -21,7 +21,7 @@ const keepAliveFilePath = path.join(baseDir, 'keepAliveCache.json');
|
|
|
21
21
|
|
|
22
22
|
export const runLive = (filePath: string, pm2Name: string) => {
|
|
23
23
|
// 使用 npx 运行命令
|
|
24
|
-
const cmdArgs = `
|
|
24
|
+
const cmdArgs = `live -c ${filePath}`;
|
|
25
25
|
|
|
26
26
|
// 先停止已存在的同名 pm2 进程
|
|
27
27
|
const stopCmd = `pm2 delete ${pm2Name} 2>/dev/null || true`;
|
|
@@ -33,14 +33,14 @@ export const runLive = (filePath: string, pm2Name: string) => {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
// 使用pm2启动
|
|
36
|
-
const pm2Cmd = `pm2 start
|
|
36
|
+
const pm2Cmd = `pm2 start cloud-live --name ${pm2Name} --no-autorestart -- ${cmdArgs}`;
|
|
37
37
|
console.log('执行命令:', pm2Cmd);
|
|
38
38
|
try {
|
|
39
39
|
const result = execSync(pm2Cmd, { stdio: 'pipe', encoding: 'utf8' });
|
|
40
40
|
console.log(result);
|
|
41
41
|
} catch (error) {
|
|
42
42
|
console.error("状态码:", error.status);
|
|
43
|
-
console.error("错误详情:", error.stderr.toString()); // 这里会显示
|
|
43
|
+
console.error("错误详情:", error.stderr.toString()); // 这里会显示 cloud-live 命令报的具体错误
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|