feat: 更新版本号和依赖项,重构keepAliveFilePath路径以支持新的目录结构
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kevisual/cnb",
|
"name": "@kevisual/cnb",
|
||||||
"version": "0.0.32",
|
"version": "0.0.33",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
],
|
],
|
||||||
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
|
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"packageManager": "pnpm@10.30.2",
|
"packageManager": "pnpm@10.30.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@kevisual/ai": "^0.0.24",
|
"@kevisual/ai": "^0.0.24",
|
||||||
@@ -24,9 +24,9 @@
|
|||||||
"@kevisual/dts": "^0.0.4",
|
"@kevisual/dts": "^0.0.4",
|
||||||
"@kevisual/context": "^0.0.8",
|
"@kevisual/context": "^0.0.8",
|
||||||
"@kevisual/types": "^0.0.12",
|
"@kevisual/types": "^0.0.12",
|
||||||
"@opencode-ai/plugin": "^1.2.12",
|
"@opencode-ai/plugin": "^1.2.15",
|
||||||
"@types/bun": "^1.3.9",
|
"@types/bun": "^1.3.9",
|
||||||
"@types/node": "^25.3.0",
|
"@types/node": "^25.3.2",
|
||||||
"@types/ws": "^8.18.1",
|
"@types/ws": "^8.18.1",
|
||||||
"dayjs": "^1.11.19",
|
"dayjs": "^1.11.19",
|
||||||
"dotenv": "^17.3.1"
|
"dotenv": "^17.3.1"
|
||||||
|
|||||||
32
pnpm-lock.yaml
generated
32
pnpm-lock.yaml
generated
@@ -52,14 +52,14 @@ importers:
|
|||||||
specifier: ^0.0.12
|
specifier: ^0.0.12
|
||||||
version: 0.0.12
|
version: 0.0.12
|
||||||
'@opencode-ai/plugin':
|
'@opencode-ai/plugin':
|
||||||
specifier: ^1.2.12
|
specifier: ^1.2.15
|
||||||
version: 1.2.12
|
version: 1.2.15
|
||||||
'@types/bun':
|
'@types/bun':
|
||||||
specifier: ^1.3.9
|
specifier: ^1.3.9
|
||||||
version: 1.3.9
|
version: 1.3.9
|
||||||
'@types/node':
|
'@types/node':
|
||||||
specifier: ^25.3.0
|
specifier: ^25.3.2
|
||||||
version: 25.3.0
|
version: 25.3.2
|
||||||
'@types/ws':
|
'@types/ws':
|
||||||
specifier: ^8.18.1
|
specifier: ^8.18.1
|
||||||
version: 8.18.1
|
version: 8.18.1
|
||||||
@@ -127,11 +127,11 @@ packages:
|
|||||||
resolution: {integrity: sha512-jLsL80wBBKkrJZrfk3SQpJ9JA/zREdlUROj7eCkmzqduAWKSI0wVcXuCKf+mLFCHB0Q0Tkh2rgzjSlurt3JQgw==}
|
resolution: {integrity: sha512-jLsL80wBBKkrJZrfk3SQpJ9JA/zREdlUROj7eCkmzqduAWKSI0wVcXuCKf+mLFCHB0Q0Tkh2rgzjSlurt3JQgw==}
|
||||||
engines: {node: '>=10.0.0'}
|
engines: {node: '>=10.0.0'}
|
||||||
|
|
||||||
'@opencode-ai/plugin@1.2.12':
|
'@opencode-ai/plugin@1.2.15':
|
||||||
resolution: {integrity: sha512-7JI/Non1P87P73GKEGBaC6VjStTW8eCevXN0MyG+quxyA8VgnJhutgSmkRKj+3hFI8ASC52TVYJUBOsurA9Utg==}
|
resolution: {integrity: sha512-mh9S05W+CZZmo6q3uIEBubS66QVgiev7fRafX7vemrCfz+3pEIkSwipLjU/sxIewC9yLiDWLqS73DH/iEQzVDw==}
|
||||||
|
|
||||||
'@opencode-ai/sdk@1.2.12':
|
'@opencode-ai/sdk@1.2.15':
|
||||||
resolution: {integrity: sha512-j5yVFoGvT3FVWJrZPWHgUcoDl38bB8gZF5NJ30PeqDPoS6kEfFIS4LzJmibNxD/rRM79C5KKgnQAQNet8JB8CQ==}
|
resolution: {integrity: sha512-NUJNlyBCdZ4R0EBLjJziEQOp2XbRPJosaMcTcWSWO5XJPKGUpz0u8ql+5cR8K+v2RJ+hp2NobtNwpjEYfe6BRQ==}
|
||||||
|
|
||||||
'@rollup/plugin-commonjs@29.0.0':
|
'@rollup/plugin-commonjs@29.0.0':
|
||||||
resolution: {integrity: sha512-U2YHaxR2cU/yAiwKJtJRhnyLk7cifnQw0zUpISsocBDoHDJn+HTV74ABqnwr5bEgWUwFZC9oFL6wLe21lHu5eQ==}
|
resolution: {integrity: sha512-U2YHaxR2cU/yAiwKJtJRhnyLk7cifnQw0zUpISsocBDoHDJn+HTV74ABqnwr5bEgWUwFZC9oFL6wLe21lHu5eQ==}
|
||||||
@@ -317,8 +317,8 @@ packages:
|
|||||||
'@types/estree@1.0.8':
|
'@types/estree@1.0.8':
|
||||||
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
|
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
|
||||||
|
|
||||||
'@types/node@25.3.0':
|
'@types/node@25.3.2':
|
||||||
resolution: {integrity: sha512-4K3bqJpXpqfg2XKGK9bpDTc6xO/xoUP/RBWS7AtRMug6zZFaRekiLzjVtAoZMquxoAbzBvy5nxQ7veS5eYzf8A==}
|
resolution: {integrity: sha512-RpV6r/ij22zRRdyBPcxDeKAzH43phWVKEjL2iksqo1Vz3CuBUrgmPpPhALKiRfU7OMCmeeO9vECBMsV0hMTG8Q==}
|
||||||
|
|
||||||
'@types/resolve@1.20.2':
|
'@types/resolve@1.20.2':
|
||||||
resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==}
|
resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==}
|
||||||
@@ -623,12 +623,12 @@ snapshots:
|
|||||||
|
|
||||||
'@kevisual/ws@8.19.0': {}
|
'@kevisual/ws@8.19.0': {}
|
||||||
|
|
||||||
'@opencode-ai/plugin@1.2.12':
|
'@opencode-ai/plugin@1.2.15':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@opencode-ai/sdk': 1.2.12
|
'@opencode-ai/sdk': 1.2.15
|
||||||
zod: 4.3.6
|
zod: 4.3.6
|
||||||
|
|
||||||
'@opencode-ai/sdk@1.2.12': {}
|
'@opencode-ai/sdk@1.2.15': {}
|
||||||
|
|
||||||
'@rollup/plugin-commonjs@29.0.0(rollup@4.57.1)':
|
'@rollup/plugin-commonjs@29.0.0(rollup@4.57.1)':
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -750,7 +750,7 @@ snapshots:
|
|||||||
|
|
||||||
'@types/estree@1.0.8': {}
|
'@types/estree@1.0.8': {}
|
||||||
|
|
||||||
'@types/node@25.3.0':
|
'@types/node@25.3.2':
|
||||||
dependencies:
|
dependencies:
|
||||||
undici-types: 7.18.2
|
undici-types: 7.18.2
|
||||||
|
|
||||||
@@ -758,7 +758,7 @@ snapshots:
|
|||||||
|
|
||||||
'@types/ws@8.18.1':
|
'@types/ws@8.18.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 25.3.0
|
'@types/node': 25.3.2
|
||||||
|
|
||||||
anymatch@3.1.3:
|
anymatch@3.1.3:
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -767,7 +767,7 @@ snapshots:
|
|||||||
|
|
||||||
bun-types@1.3.9:
|
bun-types@1.3.9:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 25.3.0
|
'@types/node': 25.3.2
|
||||||
|
|
||||||
chokidar@5.0.0:
|
chokidar@5.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ export type KeepAliveData = {
|
|||||||
type KeepAliveCache = {
|
type KeepAliveCache = {
|
||||||
data: KeepAliveData[];
|
data: KeepAliveData[];
|
||||||
}
|
}
|
||||||
|
const baseDir = path.join(os.homedir(), '.cnb', 'live');
|
||||||
const keepAliveFilePath = path.join(os.homedir(), '.cnb/keepAliveCache.json');
|
const keepAliveFilePath = path.join(baseDir, 'keepAliveCache.json');
|
||||||
|
|
||||||
export const runLive = (filePath: string, pm2Name: string) => {
|
export const runLive = (filePath: string, pm2Name: string) => {
|
||||||
// 使用 npx 运行命令
|
// 使用 npx 运行命令
|
||||||
@@ -109,7 +109,7 @@ export const createLiveData = (data: { cookie: string, repo: string, pipelineId:
|
|||||||
const createdTime = Date.now();
|
const createdTime = Date.now();
|
||||||
const wsUrl = `wss://${pipelineId}.cnb.space:443?skipWebSocketFrames=false`;
|
const wsUrl = `wss://${pipelineId}.cnb.space:443?skipWebSocketFrames=false`;
|
||||||
const pm2Name = `keep_${repo}__${pipelineId}`.replace(/\//g, '__');
|
const pm2Name = `keep_${repo}__${pipelineId}`.replace(/\//g, '__');
|
||||||
const filePath = path.join(os.homedir(), '.cnb', `${pm2Name}.json`);
|
const filePath = path.join(baseDir, `${pm2Name}.json`);
|
||||||
const _newData = { wss: wsUrl, wsUrl, cookie, repo, pipelineId, createdTime, filePath, pm2Name };
|
const _newData = { wss: wsUrl, wsUrl, cookie, repo, pipelineId, createdTime, filePath, pm2Name };
|
||||||
if (!fs.existsSync(path.dirname(filePath))) {
|
if (!fs.existsSync(path.dirname(filePath))) {
|
||||||
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user