@kevisual/cnb 0.0.65 → 0.0.66

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.
@@ -0,0 +1,8 @@
1
+ import { app } from '../app.ts';
2
+ import { parse } from '@kevisual/router/commander';
3
+ import '../routes/auth/index.ts';
4
+
5
+ await parse({
6
+ app: app,
7
+ exitOnEnd: false
8
+ })
@@ -1,4 +1,4 @@
1
- import { createKeepAlive } from '../src/workspace/keep-live.ts';
1
+ import { createKeepAlive } from '../../src/workspace/keep-live.ts';
2
2
  import { readFileSync } from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { Command, program } from 'commander';
@@ -48,7 +48,8 @@ export class CNBManager {
48
48
  constructor() {
49
49
  setInterval(() => {
50
50
  this.clearExpiredCNB()
51
- }, 1000 * 60 * 30) // 每30分钟清理一次过期的 CNB 实例
51
+ // unref 定时器,避免阻止进程退出
52
+ }, 1000 * 60 * 30).unref() // 每30分钟清理一次过期的 CNB 实例
52
53
  }
53
54
  getDefaultCNB() {
54
55
  const cnbItem = this.cnbMap.get('default')
@@ -0,0 +1,45 @@
1
+ import { app } from '../../app.ts';
2
+ /**
3
+ * 验证上下文中的 App ID 是否与指定的 App ID 匹配
4
+ * @param {any} ctx - 上下文对象,可能包含 appId 属性
5
+ * @param {string} appId - 需要验证的目标 App ID
6
+ * @returns {boolean} 如果 ctx 中包含 appId 且匹配则返回 true,否则返回 false
7
+ * @throws {Error} 如果 ctx 中包含 appId 但不匹配,则抛出 403 错误
8
+ */
9
+ const checkAppId = (ctx: any, appId: string) => {
10
+ const _appId = ctx?.app?.appId;
11
+ if (_appId) {
12
+ if (_appId !== appId) {
13
+ ctx.throw(403, 'Invalid App ID');
14
+ }
15
+ return true;
16
+ }
17
+ return false;
18
+ }
19
+
20
+ app.route({
21
+ rid: 'auth',
22
+ path: 'auth',
23
+ }).define(async (ctx) => {
24
+ // ctx.body = 'Auth Route';
25
+ if (checkAppId(ctx, app.appId)) {
26
+ ctx.state.tokenUser = {
27
+ username: 'default',
28
+ }
29
+ return;
30
+ }
31
+ }).addTo(app, { overwrite: false });
32
+
33
+ app.route({
34
+ rid: 'auth-admin',
35
+ path: 'auth-admin',
36
+ middleware: ['auth'],
37
+ }).define(async (ctx) => {
38
+ // ctx.body = 'Admin Auth Route';
39
+ if (checkAppId(ctx, app.appId)) {
40
+ ctx.state.tokenUser = {
41
+ username: 'default',
42
+ }
43
+ return;
44
+ }
45
+ }).addTo(app, { overwrite: false });
@@ -0,0 +1,43 @@
1
+ import { app, cnbManager } from '../../app.ts';
2
+ import { z } from 'zod';
3
+ import fs from 'node:fs';
4
+
5
+ app.route({
6
+ path: 'cnb-deploy',
7
+ key: 'file-list',
8
+ description: '部署页面, 程序需要在自己的客户端中执行。',
9
+ middleware: ['auth'],
10
+ metadata: {
11
+ args: {
12
+ repo: z.string().describe('仓库名称,格式为 owner/repo'),
13
+ version: z.string().optional().describe('版本号,例如1.0.0,默认为1.0.0'),
14
+ // dir: z.string().optional().describe('相对执行路径的文件夹名称,默认为 dist'),
15
+ }
16
+ }
17
+ }).define(async (ctx) => {
18
+ const cnb = await cnbManager.getContext(ctx);
19
+ const version = ctx.args.version || '1.0.0';
20
+ const dir = ctx.args.dir || 'dist';
21
+ const pwd = process.cwd();
22
+ const repo = ctx.args.repo;
23
+ const dirPath = `${pwd}/${dir}`;
24
+ const dot = ctx.args.dot || false;
25
+ if (!repo) {
26
+ ctx.throw(400, 'repo 参数必填');
27
+ }
28
+ if (!fileIsExist(dirPath)) {
29
+ ctx.throw(400, `目录 ${dir} 不存在`);
30
+ }
31
+ const res = await cnb.release.list(repo, { page: 1, page_size: 50, query: version });
32
+ ctx.body = res;
33
+
34
+ }).addTo(app);
35
+
36
+ const fileIsExist = (filepath: string) => {
37
+ try {
38
+ fs.accessSync(filepath, fs.constants.F_OK);
39
+ } catch (e) {
40
+ return false;
41
+ }
42
+ return true;
43
+ }
@@ -0,0 +1,2 @@
1
+ import './upload.ts'
2
+ import './file-list.ts';
@@ -0,0 +1,88 @@
1
+ import { app, cnbManager } from '../../app.ts';
2
+ import { z } from 'zod';
3
+ import glob from 'fast-glob';
4
+ import fs from 'node:fs';
5
+
6
+ import { uploadReleaseFiles } from '../../../src/release/upload-release.ts'
7
+ import { DefaultIgnore } from '../../../src/upload/upload-base.ts';
8
+ app.route({
9
+ path: 'cnb-deploy',
10
+ key: 'page',
11
+ description: '部署页面,上传对应的文件的内容到指定的仓库,程序需要在自己的客户端中执行。',
12
+ middleware: ['auth-admin'],
13
+ metadata: {
14
+ args: {
15
+ repo: z.string().describe('仓库名称,格式为 owner/repo'),
16
+ version: z.string().optional().describe('版本号,例如1.0.0,默认为1.0.0'),
17
+ dir: z.string().optional().describe('相对执行路径的文件夹名称,默认为 dist'),
18
+ // filename: z.string().optional().describe('部署文件名称,默认为空,如果存在,dir 不具备作用'),
19
+ dot: z.boolean().optional().describe('是否包含点文件,默认为 false'),
20
+ cwd: z.string().optional().describe('执行命令的当前工作目录,默认为 process.cwd()')
21
+ }
22
+ }
23
+ }).define(async (ctx) => {
24
+ const cnb = await cnbManager.getContext(ctx);
25
+ const version = ctx.args.version || '1.0.0';
26
+ const dir = ctx.args.dir || 'dist';
27
+ const pwd = ctx.args.cwd || process.cwd();
28
+ const repo = ctx.args.repo;
29
+ let dirPath = `${pwd}/${dir}`;
30
+ const dot = ctx.args.dot || false;
31
+ if (!repo) {
32
+ ctx.throw(400, 'repo 参数必填');
33
+ }
34
+ let dirReg = '';
35
+ if (dirPath.includes('*') || dirPath.includes('?')) {
36
+ dirReg = dirPath;
37
+ } else {
38
+ dirReg = `${dirPath}/**/*`
39
+ }
40
+ const files = await glob(dirReg, {
41
+ cwd: pwd,
42
+ onlyFiles: true,
43
+ ignore: DefaultIgnore,
44
+ dot,
45
+ });
46
+ const res = await uploadReleaseFiles({
47
+ files: files.map(file => ({
48
+ type: 'file',
49
+ filepath: file,
50
+ name: file.replace(`${dirPath}/`, '')
51
+ })),
52
+ cnb,
53
+ repo: repo,
54
+ version
55
+ });
56
+ ctx.body = res;
57
+
58
+ }).addTo(app);
59
+
60
+ app.route({
61
+ path: 'cnb-deploy',
62
+ key: 'app',
63
+ description: '部署当前文件夹下的文件列表,根据 packages.json 进行部署,程序需要在自己的客户端中执行。basename 类似 /kevision/cnb, version类似 1.0.0,deploy.dir 类似 dist',
64
+ middleware: ['auth-admin'],
65
+ }).define(async (ctx) => {
66
+ try {
67
+ const pkgs = JSON.parse(fs.readFileSync(`${process.cwd()}/packages.json`, 'utf-8'));
68
+ let repo: string = pkgs.basename || '';
69
+ const version = pkgs.version || '1.0.0';
70
+ if (repo.startsWith('/')) {
71
+ repo = repo.slice(1);
72
+ }
73
+ const dir = pkgs.deploy?.dir || 'dist';
74
+ const res = await app.run({ path: 'cnb-deploy', key: 'page', payload: { repo, version, dir } });
75
+ ctx.forward(res);
76
+ } catch (e) {
77
+ ctx.throw(500, '部署失败,无法读取 packages.json 文件');
78
+ }
79
+ }).addTo(app);
80
+
81
+ const fileIsExist = (filepath: string) => {
82
+ try {
83
+ fs.accessSync(filepath, fs.constants.F_OK);
84
+ } catch (e) {
85
+ return false;
86
+ }
87
+ return true;
88
+ }
@@ -15,47 +15,5 @@ import './missions/index.ts';
15
15
  import './labels/index.ts';
16
16
  import './package/index.ts';
17
17
 
18
- /**
19
- * 验证上下文中的 App ID 是否与指定的 App ID 匹配
20
- * @param {any} ctx - 上下文对象,可能包含 appId 属性
21
- * @param {string} appId - 需要验证的目标 App ID
22
- * @returns {boolean} 如果 ctx 中包含 appId 且匹配则返回 true,否则返回 false
23
- * @throws {Error} 如果 ctx 中包含 appId 但不匹配,则抛出 403 错误
24
- */
25
- const checkAppId = (ctx: any, appId: string) => {
26
- const _appId = ctx?.app?.appId;
27
- if (_appId) {
28
- if (_appId !== appId) {
29
- ctx.throw(403, 'Invalid App ID');
30
- }
31
- return true;
32
- }
33
- return false;
34
- }
35
-
36
- app.route({
37
- rid: 'auth',
38
- path: 'auth',
39
- }).define(async (ctx) => {
40
- // ctx.body = 'Auth Route';
41
- if (checkAppId(ctx, app.appId)) {
42
- ctx.state.tokenUser = {
43
- username: 'default',
44
- }
45
- return;
46
- }
47
- }).addTo(app, { overwrite: false });
48
-
49
- app.route({
50
- rid: 'auth-admin',
51
- path: 'auth-admin',
52
- middleware: ['auth'],
53
- }).define(async (ctx) => {
54
- // ctx.body = 'Admin Auth Route';
55
- if (checkAppId(ctx, app.appId)) {
56
- ctx.state.tokenUser = {
57
- username: 'default',
58
- }
59
- return;
60
- }
61
- }).addTo(app, { overwrite: false });
18
+ import './deploy/index.ts';
19
+ import './auth/index.ts';
package/dist/cli-live.js CHANGED
@@ -4,49 +4,31 @@ var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
7
  var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
8
  target = mod != null ? __create(__getProtoOf(mod)) : {};
21
9
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
10
  for (let key of __getOwnPropNames(mod))
23
11
  if (!__hasOwnProp.call(to, key))
24
12
  __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
13
+ get: () => mod[key],
26
14
  enumerable: true
27
15
  });
28
- if (canCache)
29
- cache.set(mod, to);
30
16
  return to;
31
17
  };
32
18
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
- var __returnValue = (v) => v;
34
- function __exportSetter(name, newValue) {
35
- this[name] = __returnValue.bind(null, newValue);
36
- }
37
19
  var __export = (target, all) => {
38
20
  for (var name in all)
39
21
  __defProp(target, name, {
40
22
  get: all[name],
41
23
  enumerable: true,
42
24
  configurable: true,
43
- set: __exportSetter.bind(all, name)
25
+ set: (newValue) => all[name] = () => newValue
44
26
  });
45
27
  };
46
28
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
47
29
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
48
30
 
49
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/constants.js
31
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/constants.js
50
32
  var require_constants = __commonJS((exports, module) => {
51
33
  var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
52
34
  var hasBlob = typeof Blob !== "undefined";
@@ -66,7 +48,7 @@ var require_constants = __commonJS((exports, module) => {
66
48
  };
67
49
  });
68
50
 
69
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/buffer-util.js
51
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/buffer-util.js
70
52
  var require_buffer_util = __commonJS((exports, module) => {
71
53
  var { EMPTY_BUFFER } = require_constants();
72
54
  var FastBuffer = Buffer[Symbol.species];
@@ -127,7 +109,7 @@ var require_buffer_util = __commonJS((exports, module) => {
127
109
  };
128
110
  });
129
111
 
130
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/limiter.js
112
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/limiter.js
131
113
  var require_limiter = __commonJS((exports, module) => {
132
114
  var kDone = Symbol("kDone");
133
115
  var kRun = Symbol("kRun");
@@ -159,7 +141,7 @@ var require_limiter = __commonJS((exports, module) => {
159
141
  module.exports = Limiter;
160
142
  });
161
143
 
162
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/permessage-deflate.js
144
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/permessage-deflate.js
163
145
  var require_permessage_deflate = __commonJS((exports, module) => {
164
146
  var zlib = __require("zlib");
165
147
  var bufferUtil = require_buffer_util();
@@ -423,7 +405,7 @@ var require_permessage_deflate = __commonJS((exports, module) => {
423
405
  }
424
406
  });
425
407
 
426
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/validation.js
408
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/validation.js
427
409
  var require_validation = __commonJS((exports, module) => {
428
410
  var { isUtf8 } = __require("buffer");
429
411
  var { hasBlob } = require_constants();
@@ -603,7 +585,7 @@ var require_validation = __commonJS((exports, module) => {
603
585
  }
604
586
  });
605
587
 
606
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/receiver.js
588
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/receiver.js
607
589
  var require_receiver = __commonJS((exports, module) => {
608
590
  var { Writable } = __require("stream");
609
591
  var PerMessageDeflate = require_permessage_deflate();
@@ -984,7 +966,7 @@ var require_receiver = __commonJS((exports, module) => {
984
966
  module.exports = Receiver;
985
967
  });
986
968
 
987
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/sender.js
969
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/sender.js
988
970
  var require_sender = __commonJS((exports, module) => {
989
971
  var { Duplex } = __require("stream");
990
972
  var { randomFillSync } = __require("crypto");
@@ -1338,7 +1320,7 @@ var require_sender = __commonJS((exports, module) => {
1338
1320
  }
1339
1321
  });
1340
1322
 
1341
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/event-target.js
1323
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/event-target.js
1342
1324
  var require_event_target = __commonJS((exports, module) => {
1343
1325
  var { kForOnEventAttribute, kListener } = require_constants();
1344
1326
  var kCode = Symbol("kCode");
@@ -1489,7 +1471,7 @@ var require_event_target = __commonJS((exports, module) => {
1489
1471
  }
1490
1472
  });
1491
1473
 
1492
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/extension.js
1474
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/extension.js
1493
1475
  var require_extension = __commonJS((exports, module) => {
1494
1476
  var { tokenChars } = require_validation();
1495
1477
  function push(dest, name, elem) {
@@ -1654,7 +1636,7 @@ var require_extension = __commonJS((exports, module) => {
1654
1636
  module.exports = { format, parse };
1655
1637
  });
1656
1638
 
1657
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/websocket.js
1639
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/websocket.js
1658
1640
  var require_websocket = __commonJS((exports, module) => {
1659
1641
  var EventEmitter = __require("events");
1660
1642
  var https = __require("https");
@@ -2416,7 +2398,7 @@ var require_websocket = __commonJS((exports, module) => {
2416
2398
  }
2417
2399
  });
2418
2400
 
2419
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/stream.js
2401
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/stream.js
2420
2402
  var require_stream = __commonJS((exports, module) => {
2421
2403
  var WebSocket = require_websocket();
2422
2404
  var { Duplex } = __require("stream");
@@ -2519,7 +2501,7 @@ var require_stream = __commonJS((exports, module) => {
2519
2501
  module.exports = createWebSocketStream;
2520
2502
  });
2521
2503
 
2522
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/subprotocol.js
2504
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/subprotocol.js
2523
2505
  var require_subprotocol = __commonJS((exports, module) => {
2524
2506
  var { tokenChars } = require_validation();
2525
2507
  function parse(header) {
@@ -2564,7 +2546,7 @@ var require_subprotocol = __commonJS((exports, module) => {
2564
2546
  module.exports = { parse };
2565
2547
  });
2566
2548
 
2567
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/websocket-server.js
2549
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/lib/websocket-server.js
2568
2550
  var require_websocket_server = __commonJS((exports, module) => {
2569
2551
  var EventEmitter = __require("events");
2570
2552
  var http = __require("http");
@@ -2866,7 +2848,7 @@ var require_websocket_server = __commonJS((exports, module) => {
2866
2848
  }
2867
2849
  });
2868
2850
 
2869
- // ../../node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/wrapper.mjs
2851
+ // node_modules/.pnpm/@kevisual+ws@8.19.0/node_modules/@kevisual/ws/wrapper.mjs
2870
2852
  var exports_wrapper = {};
2871
2853
  __export(exports_wrapper, {
2872
2854
  default: () => wrapper_default,
@@ -2886,7 +2868,7 @@ var init_wrapper = __esm(() => {
2886
2868
  wrapper_default = import_websocket.default;
2887
2869
  });
2888
2870
 
2889
- // ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js
2871
+ // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js
2890
2872
  var require_error = __commonJS((exports) => {
2891
2873
  class CommanderError extends Error {
2892
2874
  constructor(exitCode, code, message) {
@@ -2910,7 +2892,7 @@ var require_error = __commonJS((exports) => {
2910
2892
  exports.InvalidArgumentError = InvalidArgumentError;
2911
2893
  });
2912
2894
 
2913
- // ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/argument.js
2895
+ // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/argument.js
2914
2896
  var require_argument = __commonJS((exports) => {
2915
2897
  var { InvalidArgumentError } = require_error();
2916
2898
 
@@ -2990,7 +2972,7 @@ var require_argument = __commonJS((exports) => {
2990
2972
  exports.humanReadableArgName = humanReadableArgName;
2991
2973
  });
2992
2974
 
2993
- // ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/help.js
2975
+ // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/help.js
2994
2976
  var require_help = __commonJS((exports) => {
2995
2977
  var { humanReadableArgName } = require_argument();
2996
2978
 
@@ -3347,7 +3329,7 @@ ${itemIndentStr}`);
3347
3329
  exports.stripColor = stripColor;
3348
3330
  });
3349
3331
 
3350
- // ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/option.js
3332
+ // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/option.js
3351
3333
  var require_option = __commonJS((exports) => {
3352
3334
  var { InvalidArgumentError } = require_error();
3353
3335
 
@@ -3531,7 +3513,7 @@ var require_option = __commonJS((exports) => {
3531
3513
  exports.DualOptions = DualOptions;
3532
3514
  });
3533
3515
 
3534
- // ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js
3516
+ // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js
3535
3517
  var require_suggestSimilar = __commonJS((exports) => {
3536
3518
  var maxDistance = 3;
3537
3519
  function editDistance(a, b) {
@@ -3604,7 +3586,7 @@ var require_suggestSimilar = __commonJS((exports) => {
3604
3586
  exports.suggestSimilar = suggestSimilar;
3605
3587
  });
3606
3588
 
3607
- // ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/command.js
3589
+ // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/command.js
3608
3590
  var require_command = __commonJS((exports) => {
3609
3591
  var EventEmitter = __require("node:events").EventEmitter;
3610
3592
  var childProcess = __require("node:child_process");
@@ -4959,7 +4941,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
4959
4941
  exports.useColor = useColor;
4960
4942
  });
4961
4943
 
4962
- // ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/index.js
4944
+ // node_modules/.pnpm/commander@14.0.3/node_modules/commander/index.js
4963
4945
  var require_commander = __commonJS((exports) => {
4964
4946
  var { Argument } = require_argument();
4965
4947
  var { Command } = require_command();
@@ -5172,11 +5154,11 @@ function createKeepAlive(config) {
5172
5154
  return client;
5173
5155
  }
5174
5156
 
5175
- // agent/live.ts
5157
+ // agent/clis/live.ts
5176
5158
  import { readFileSync } from "node:fs";
5177
5159
  import path from "node:path";
5178
5160
 
5179
- // ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/esm.mjs
5161
+ // node_modules/.pnpm/commander@14.0.3/node_modules/commander/esm.mjs
5180
5162
  var import__ = __toESM(require_commander(), 1);
5181
5163
  var {
5182
5164
  program,
@@ -5192,7 +5174,7 @@ var {
5192
5174
  Help
5193
5175
  } = import__.default;
5194
5176
 
5195
- // agent/live.ts
5177
+ // agent/clis/live.ts
5196
5178
  program.addCommand(new Command("live").description("启动 CNB Keep Alive 服务").option("-j, --json <string>", "JSON数据").option("-c, --config <string>", "配置文件路径 (优先级高于 JSON 参数), 默认keep.json").action(async (opts) => {
5197
5179
  let config;
5198
5180
  let configPath = opts.config || "keep.json";