@kevisual/cnb 0.0.30 → 0.0.32

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.
@@ -40,7 +40,7 @@ app.route({
40
40
 
41
41
  console.log(`启动保持工作空间 ${wsUrl} 存活的任务`);
42
42
 
43
- const config: KeepAliveData = createLiveData({ wsUrl, cookie, repo, pipelineId });
43
+ const config: KeepAliveData = createLiveData({ cookie, repo, pipelineId });
44
44
  addKeepAliveData(config);
45
45
 
46
46
  ctx.body = { content: `已启动保持工作空间 ${wsUrl} 存活的任务`, data: config };
package/dist/opencode.js CHANGED
@@ -33902,9 +33902,10 @@ function removeKeepAliveData(repo2, pipelineId) {
33902
33902
  }
33903
33903
  }
33904
33904
  var createLiveData = (data) => {
33905
- const { wsUrl, cookie, repo: repo2, pipelineId } = data;
33905
+ const { cookie, repo: repo2, pipelineId } = data;
33906
33906
  const createdTime = Date.now();
33907
- const pm2Name = `${repo2}__${pipelineId}`.replace(/\//g, "__");
33907
+ const wsUrl = `wss://${pipelineId}.cnb.space:443?skipWebSocketFrames=false`;
33908
+ const pm2Name = `keep_${repo2}__${pipelineId}`.replace(/\//g, "__");
33908
33909
  const filePath = path2.join(os.homedir(), ".cnb", `${pm2Name}.json`);
33909
33910
  const _newData = { wss: wsUrl, wsUrl, cookie, repo: repo2, pipelineId, createdTime, filePath, pm2Name };
33910
33911
  if (!fs2.existsSync(path2.dirname(filePath))) {
@@ -33949,7 +33950,7 @@ app.route({
33949
33950
  ctx.throw(500, `获取工作空间访问cookie失败: ${res.message}`);
33950
33951
  }
33951
33952
  console.log(`启动保持工作空间 ${wsUrl} 存活的任务`);
33952
- const config4 = createLiveData({ wsUrl, cookie, repo: repo2, pipelineId });
33953
+ const config4 = createLiveData({ cookie, repo: repo2, pipelineId });
33953
33954
  addKeepAliveData(config4);
33954
33955
  ctx.body = { content: `已启动保持工作空间 ${wsUrl} 存活的任务`, data: config4 };
33955
33956
  }).addTo(app);
package/dist/routes.js CHANGED
@@ -33902,9 +33902,10 @@ function removeKeepAliveData(repo2, pipelineId) {
33902
33902
  }
33903
33903
  }
33904
33904
  var createLiveData = (data) => {
33905
- const { wsUrl, cookie, repo: repo2, pipelineId } = data;
33905
+ const { cookie, repo: repo2, pipelineId } = data;
33906
33906
  const createdTime = Date.now();
33907
- const pm2Name = `${repo2}__${pipelineId}`.replace(/\//g, "__");
33907
+ const wsUrl = `wss://${pipelineId}.cnb.space:443?skipWebSocketFrames=false`;
33908
+ const pm2Name = `keep_${repo2}__${pipelineId}`.replace(/\//g, "__");
33908
33909
  const filePath = path2.join(os.homedir(), ".cnb", `${pm2Name}.json`);
33909
33910
  const _newData = { wss: wsUrl, wsUrl, cookie, repo: repo2, pipelineId, createdTime, filePath, pm2Name };
33910
33911
  if (!fs2.existsSync(path2.dirname(filePath))) {
@@ -33949,7 +33950,7 @@ app.route({
33949
33950
  ctx.throw(500, `获取工作空间访问cookie失败: ${res.message}`);
33950
33951
  }
33951
33952
  console.log(`启动保持工作空间 ${wsUrl} 存活的任务`);
33952
- const config4 = createLiveData({ wsUrl, cookie, repo: repo2, pipelineId });
33953
+ const config4 = createLiveData({ cookie, repo: repo2, pipelineId });
33953
33954
  addKeepAliveData(config4);
33954
33955
  ctx.body = { content: `已启动保持工作空间 ${wsUrl} 存活的任务`, data: config4 };
33955
33956
  }).addTo(app);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/cnb",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -104,10 +104,11 @@ export function removeKeepAliveData(repo: string, pipelineId: string): KeepAlive
104
104
  }
105
105
  }
106
106
 
107
- export const createLiveData = (data: { wsUrl: string, cookie: string, repo: string, pipelineId: string }): KeepAliveData => {
108
- const { wsUrl, cookie, repo, pipelineId } = data;
107
+ export const createLiveData = (data: { cookie: string, repo: string, pipelineId: string }): KeepAliveData => {
108
+ const { cookie, repo, pipelineId } = data;
109
109
  const createdTime = Date.now();
110
- const pm2Name = `${repo}__${pipelineId}`.replace(/\//g, '__');
110
+ const wsUrl = `wss://${pipelineId}.cnb.space:443?skipWebSocketFrames=false`;
111
+ const pm2Name = `keep_${repo}__${pipelineId}`.replace(/\//g, '__');
111
112
  const filePath = path.join(os.homedir(), '.cnb', `${pm2Name}.json`);
112
113
  const _newData = { wss: wsUrl, wsUrl, cookie, repo, pipelineId, createdTime, filePath, pm2Name };
113
114
  if (!fs.existsSync(path.dirname(filePath))) {
@@ -125,8 +126,8 @@ export class KeepAliveManager {
125
126
  static add(data: KeepAliveData) {
126
127
  return addKeepAliveData(data);
127
128
  }
128
-
129
- static createLiveData(data: { wsUrl: string, cookie: string, repo: string, pipelineId: string }): KeepAliveData {
129
+
130
+ static createLiveData(data: { cookie: string, repo: string, pipelineId: string }): KeepAliveData {
130
131
  return createLiveData(data);
131
132
  }
132
133