From 50433929393881ed20455add2619cf95d0b9276e Mon Sep 17 00:00:00 2001 From: abearxiong Date: Sat, 28 Feb 2026 04:15:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E5=92=8C=E4=BE=9D=E8=B5=96=E9=A1=B9=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E6=9E=84keepAliveFilePath=E8=B7=AF=E5=BE=84=E4=BB=A5=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=96=B0=E7=9A=84=E7=9B=AE=E5=BD=95=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 8 ++++---- pnpm-lock.yaml | 32 ++++++++++++++++---------------- src/workspace/keep-file-live.ts | 6 +++--- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index f0882bb..f7f7720 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/cnb", - "version": "0.0.32", + "version": "0.0.33", "description": "", "main": "index.js", "scripts": { @@ -16,7 +16,7 @@ ], "author": "abearxiong (https://www.xiongxiao.me)", "license": "MIT", - "packageManager": "pnpm@10.30.2", + "packageManager": "pnpm@10.30.3", "type": "module", "devDependencies": { "@kevisual/ai": "^0.0.24", @@ -24,9 +24,9 @@ "@kevisual/dts": "^0.0.4", "@kevisual/context": "^0.0.8", "@kevisual/types": "^0.0.12", - "@opencode-ai/plugin": "^1.2.12", + "@opencode-ai/plugin": "^1.2.15", "@types/bun": "^1.3.9", - "@types/node": "^25.3.0", + "@types/node": "^25.3.2", "@types/ws": "^8.18.1", "dayjs": "^1.11.19", "dotenv": "^17.3.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 494873d..ca032d6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -52,14 +52,14 @@ importers: specifier: ^0.0.12 version: 0.0.12 '@opencode-ai/plugin': - specifier: ^1.2.12 - version: 1.2.12 + specifier: ^1.2.15 + version: 1.2.15 '@types/bun': specifier: ^1.3.9 version: 1.3.9 '@types/node': - specifier: ^25.3.0 - version: 25.3.0 + specifier: ^25.3.2 + version: 25.3.2 '@types/ws': specifier: ^8.18.1 version: 8.18.1 @@ -127,11 +127,11 @@ packages: resolution: {integrity: sha512-jLsL80wBBKkrJZrfk3SQpJ9JA/zREdlUROj7eCkmzqduAWKSI0wVcXuCKf+mLFCHB0Q0Tkh2rgzjSlurt3JQgw==} engines: {node: '>=10.0.0'} - '@opencode-ai/plugin@1.2.12': - resolution: {integrity: sha512-7JI/Non1P87P73GKEGBaC6VjStTW8eCevXN0MyG+quxyA8VgnJhutgSmkRKj+3hFI8ASC52TVYJUBOsurA9Utg==} + '@opencode-ai/plugin@1.2.15': + resolution: {integrity: sha512-mh9S05W+CZZmo6q3uIEBubS66QVgiev7fRafX7vemrCfz+3pEIkSwipLjU/sxIewC9yLiDWLqS73DH/iEQzVDw==} - '@opencode-ai/sdk@1.2.12': - resolution: {integrity: sha512-j5yVFoGvT3FVWJrZPWHgUcoDl38bB8gZF5NJ30PeqDPoS6kEfFIS4LzJmibNxD/rRM79C5KKgnQAQNet8JB8CQ==} + '@opencode-ai/sdk@1.2.15': + resolution: {integrity: sha512-NUJNlyBCdZ4R0EBLjJziEQOp2XbRPJosaMcTcWSWO5XJPKGUpz0u8ql+5cR8K+v2RJ+hp2NobtNwpjEYfe6BRQ==} '@rollup/plugin-commonjs@29.0.0': resolution: {integrity: sha512-U2YHaxR2cU/yAiwKJtJRhnyLk7cifnQw0zUpISsocBDoHDJn+HTV74ABqnwr5bEgWUwFZC9oFL6wLe21lHu5eQ==} @@ -317,8 +317,8 @@ packages: '@types/estree@1.0.8': resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} - '@types/node@25.3.0': - resolution: {integrity: sha512-4K3bqJpXpqfg2XKGK9bpDTc6xO/xoUP/RBWS7AtRMug6zZFaRekiLzjVtAoZMquxoAbzBvy5nxQ7veS5eYzf8A==} + '@types/node@25.3.2': + resolution: {integrity: sha512-RpV6r/ij22zRRdyBPcxDeKAzH43phWVKEjL2iksqo1Vz3CuBUrgmPpPhALKiRfU7OMCmeeO9vECBMsV0hMTG8Q==} '@types/resolve@1.20.2': resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} @@ -623,12 +623,12 @@ snapshots: '@kevisual/ws@8.19.0': {} - '@opencode-ai/plugin@1.2.12': + '@opencode-ai/plugin@1.2.15': dependencies: - '@opencode-ai/sdk': 1.2.12 + '@opencode-ai/sdk': 1.2.15 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)': dependencies: @@ -750,7 +750,7 @@ snapshots: '@types/estree@1.0.8': {} - '@types/node@25.3.0': + '@types/node@25.3.2': dependencies: undici-types: 7.18.2 @@ -758,7 +758,7 @@ snapshots: '@types/ws@8.18.1': dependencies: - '@types/node': 25.3.0 + '@types/node': 25.3.2 anymatch@3.1.3: dependencies: @@ -767,7 +767,7 @@ snapshots: bun-types@1.3.9: dependencies: - '@types/node': 25.3.0 + '@types/node': 25.3.2 chokidar@5.0.0: dependencies: diff --git a/src/workspace/keep-file-live.ts b/src/workspace/keep-file-live.ts index d0e4cca..a6cc57c 100644 --- a/src/workspace/keep-file-live.ts +++ b/src/workspace/keep-file-live.ts @@ -16,8 +16,8 @@ export type KeepAliveData = { type KeepAliveCache = { data: KeepAliveData[]; } - -const keepAliveFilePath = path.join(os.homedir(), '.cnb/keepAliveCache.json'); +const baseDir = path.join(os.homedir(), '.cnb', 'live'); +const keepAliveFilePath = path.join(baseDir, 'keepAliveCache.json'); export const runLive = (filePath: string, pm2Name: string) => { // 使用 npx 运行命令 @@ -109,7 +109,7 @@ export const createLiveData = (data: { cookie: string, repo: string, pipelineId: const createdTime = Date.now(); const wsUrl = `wss://${pipelineId}.cnb.space:443?skipWebSocketFrames=false`; 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 }; if (!fs.existsSync(path.dirname(filePath))) { fs.mkdirSync(path.dirname(filePath), { recursive: true });