@kevisual/cli 0.1.18 → 0.1.20
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/dist/assistant-opencode.d.ts +4 -1
- package/dist/assistant-opencode.js +10 -10
- package/dist/assistant-server.js +11 -10
- package/dist/assistant.js +3 -4
- package/dist/envision.js +72 -2
- package/package.json +5 -4
|
@@ -23667,7 +23667,7 @@ var require_lib2 = __commonJS((exports, module) => {
|
|
|
23667
23667
|
};
|
|
23668
23668
|
});
|
|
23669
23669
|
|
|
23670
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
23670
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.89/node_modules/@kevisual/router/dist/router.js
|
|
23671
23671
|
import { createRequire as createRequire2 } from "node:module";
|
|
23672
23672
|
import { webcrypto as crypto2 } from "node:crypto";
|
|
23673
23673
|
import http from "node:http";
|
|
@@ -41879,7 +41879,7 @@ class App extends QueryRouterServer {
|
|
|
41879
41879
|
}
|
|
41880
41880
|
}
|
|
41881
41881
|
|
|
41882
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
41882
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.89/node_modules/@kevisual/router/dist/router-simple.js
|
|
41883
41883
|
import url3 from "node:url";
|
|
41884
41884
|
var __create3 = Object.create;
|
|
41885
41885
|
var __getProtoOf3 = Object.getPrototypeOf;
|
|
@@ -51855,7 +51855,7 @@ class RemoteApp {
|
|
|
51855
51855
|
constructor(opts) {
|
|
51856
51856
|
this.mainApp = opts?.app;
|
|
51857
51857
|
const token = opts.token;
|
|
51858
|
-
const url4 = opts.url;
|
|
51858
|
+
const url4 = opts.url || "https://kevisual.cn/ws/proxy";
|
|
51859
51859
|
const id = opts.id;
|
|
51860
51860
|
const username = opts.username;
|
|
51861
51861
|
this.username = username;
|
|
@@ -80957,7 +80957,6 @@ class AssistantApp extends Manager2 {
|
|
|
80957
80957
|
if (token) {
|
|
80958
80958
|
console.log("用户已登录,正在初始化远程应用连接...");
|
|
80959
80959
|
await manager.initRemoteApp({ token });
|
|
80960
|
-
await manager.initRemoteApp();
|
|
80961
80960
|
await manager.initRouterProxyLightApp();
|
|
80962
80961
|
}
|
|
80963
80962
|
await manager.initRouterProxyApp();
|
|
@@ -84054,7 +84053,7 @@ var simpleRouter = useContextKey("simpleRouter", () => {
|
|
|
84054
84053
|
});
|
|
84055
84054
|
app.createRouteList();
|
|
84056
84055
|
|
|
84057
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
84056
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.89/node_modules/@kevisual/router/dist/opencode.js
|
|
84058
84057
|
import { webcrypto as crypto4 } from "node:crypto";
|
|
84059
84058
|
var __create7 = Object.create;
|
|
84060
84059
|
var __getProtoOf7 = Object.getPrototypeOf;
|
|
@@ -103168,7 +103167,7 @@ app.route({
|
|
|
103168
103167
|
|
|
103169
103168
|
// src/routes/cnb-board/index.ts
|
|
103170
103169
|
app.route({
|
|
103171
|
-
path: "
|
|
103170
|
+
path: "cnb_board",
|
|
103172
103171
|
key: "is-cnb-board",
|
|
103173
103172
|
description: "检查是否是 cnb-board 环境",
|
|
103174
103173
|
middleware: ["auth-admin"]
|
|
@@ -103177,16 +103176,16 @@ app.route({
|
|
|
103177
103176
|
ctx.body = {
|
|
103178
103177
|
isCNB: !!isCNB
|
|
103179
103178
|
};
|
|
103180
|
-
}).addTo(app);
|
|
103179
|
+
}).addTo(app, { overwrite: false });
|
|
103181
103180
|
app.route({
|
|
103182
|
-
path: "
|
|
103181
|
+
path: "cnb_board",
|
|
103183
103182
|
key: "exit",
|
|
103184
103183
|
description: "cnb的工作环境退出程序",
|
|
103185
103184
|
middleware: ["auth-admin"]
|
|
103186
103185
|
}).define(async (ctx) => {
|
|
103187
103186
|
const cmd = "kill 1";
|
|
103188
103187
|
execCommand(cmd);
|
|
103189
|
-
}).addTo(app);
|
|
103188
|
+
}).addTo(app, { overwrite: false });
|
|
103190
103189
|
|
|
103191
103190
|
// ../node_modules/.pnpm/lru-cache@11.2.6/node_modules/lru-cache/dist/esm/index.min.js
|
|
103192
103191
|
var M = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
@@ -103902,7 +103901,7 @@ var import_busboy = __toESM(require_lib2(), 1);
|
|
|
103902
103901
|
import path16 from "path";
|
|
103903
103902
|
import fs19 from "fs";
|
|
103904
103903
|
|
|
103905
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
103904
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.89/node_modules/@kevisual/router/src/server/cookie.ts
|
|
103906
103905
|
var NullObject2 = /* @__PURE__ */ (() => {
|
|
103907
103906
|
const C2 = function() {};
|
|
103908
103907
|
C2.prototype = Object.create(null);
|
|
@@ -104233,5 +104232,6 @@ var AgentPlugin = createRouterAgentPluginFn({
|
|
|
104233
104232
|
router: app
|
|
104234
104233
|
});
|
|
104235
104234
|
export {
|
|
104235
|
+
app,
|
|
104236
104236
|
AgentPlugin
|
|
104237
104237
|
};
|
package/dist/assistant-server.js
CHANGED
|
@@ -62615,7 +62615,7 @@ var useKey = (envKey, initKey = "context") => {
|
|
|
62615
62615
|
return null;
|
|
62616
62616
|
};
|
|
62617
62617
|
|
|
62618
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
62618
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.89/node_modules/@kevisual/router/dist/router.js
|
|
62619
62619
|
import { createRequire as createRequire2 } from "node:module";
|
|
62620
62620
|
import { webcrypto as crypto2 } from "node:crypto";
|
|
62621
62621
|
import http from "node:http";
|
|
@@ -80827,7 +80827,7 @@ class App extends QueryRouterServer {
|
|
|
80827
80827
|
}
|
|
80828
80828
|
}
|
|
80829
80829
|
|
|
80830
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
80830
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.89/node_modules/@kevisual/router/dist/router-simple.js
|
|
80831
80831
|
import url3 from "node:url";
|
|
80832
80832
|
var __create3 = Object.create;
|
|
80833
80833
|
var __getProtoOf3 = Object.getPrototypeOf;
|
|
@@ -91559,7 +91559,7 @@ class RemoteApp {
|
|
|
91559
91559
|
constructor(opts) {
|
|
91560
91560
|
this.mainApp = opts?.app;
|
|
91561
91561
|
const token = opts.token;
|
|
91562
|
-
const url4 = opts.url;
|
|
91562
|
+
const url4 = opts.url || "https://kevisual.cn/ws/proxy";
|
|
91563
91563
|
const id = opts.id;
|
|
91564
91564
|
const username = opts.username;
|
|
91565
91565
|
this.username = username;
|
|
@@ -120079,7 +120079,6 @@ class AssistantApp extends Manager2 {
|
|
|
120079
120079
|
if (token) {
|
|
120080
120080
|
console.log("用户已登录,正在初始化远程应用连接...");
|
|
120081
120081
|
await manager.initRemoteApp({ token });
|
|
120082
|
-
await manager.initRemoteApp();
|
|
120083
120082
|
await manager.initRouterProxyLightApp();
|
|
120084
120083
|
}
|
|
120085
120084
|
await manager.initRouterProxyApp();
|
|
@@ -127765,7 +127764,7 @@ app.route({
|
|
|
127765
127764
|
|
|
127766
127765
|
// src/routes/cnb-board/index.ts
|
|
127767
127766
|
app.route({
|
|
127768
|
-
path: "
|
|
127767
|
+
path: "cnb_board",
|
|
127769
127768
|
key: "is-cnb-board",
|
|
127770
127769
|
description: "检查是否是 cnb-board 环境",
|
|
127771
127770
|
middleware: ["auth-admin"]
|
|
@@ -127774,16 +127773,16 @@ app.route({
|
|
|
127774
127773
|
ctx.body = {
|
|
127775
127774
|
isCNB: !!isCNB
|
|
127776
127775
|
};
|
|
127777
|
-
}).addTo(app);
|
|
127776
|
+
}).addTo(app, { overwrite: false });
|
|
127778
127777
|
app.route({
|
|
127779
|
-
path: "
|
|
127778
|
+
path: "cnb_board",
|
|
127780
127779
|
key: "exit",
|
|
127781
127780
|
description: "cnb的工作环境退出程序",
|
|
127782
127781
|
middleware: ["auth-admin"]
|
|
127783
127782
|
}).define(async (ctx) => {
|
|
127784
127783
|
const cmd = "kill 1";
|
|
127785
127784
|
execCommand(cmd);
|
|
127786
|
-
}).addTo(app);
|
|
127785
|
+
}).addTo(app, { overwrite: false });
|
|
127787
127786
|
|
|
127788
127787
|
// ../node_modules/.pnpm/lru-cache@11.2.6/node_modules/lru-cache/dist/esm/index.min.js
|
|
127789
127788
|
var M = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
@@ -129176,7 +129175,7 @@ var import_busboy = __toESM(require_lib2(), 1);
|
|
|
129176
129175
|
import path20 from "path";
|
|
129177
129176
|
import fs23 from "fs";
|
|
129178
129177
|
|
|
129179
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
129178
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.89/node_modules/@kevisual/router/src/server/cookie.ts
|
|
129180
129179
|
var NullObject2 = /* @__PURE__ */ (() => {
|
|
129181
129180
|
const C2 = function() {};
|
|
129182
129181
|
C2.prototype = Object.create(null);
|
|
@@ -130142,5 +130141,7 @@ var runParser = async (argv) => {
|
|
|
130142
130141
|
};
|
|
130143
130142
|
export {
|
|
130144
130143
|
runServer,
|
|
130145
|
-
runParser
|
|
130144
|
+
runParser,
|
|
130145
|
+
program,
|
|
130146
|
+
app
|
|
130146
130147
|
};
|
package/dist/assistant.js
CHANGED
|
@@ -36623,7 +36623,7 @@ class RemoteApp {
|
|
|
36623
36623
|
constructor(opts) {
|
|
36624
36624
|
this.mainApp = opts?.app;
|
|
36625
36625
|
const token = opts.token;
|
|
36626
|
-
const url = opts.url;
|
|
36626
|
+
const url = opts.url || "https://kevisual.cn/ws/proxy";
|
|
36627
36627
|
const id = opts.id;
|
|
36628
36628
|
const username = opts.username;
|
|
36629
36629
|
this.username = username;
|
|
@@ -51354,7 +51354,7 @@ var getStringHash = (str) => {
|
|
|
51354
51354
|
return crypto2.createHash("md5").update(str).digest("hex");
|
|
51355
51355
|
};
|
|
51356
51356
|
|
|
51357
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
51357
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.89/node_modules/@kevisual/router/dist/router.js
|
|
51358
51358
|
import { createRequire as createRequire3 } from "node:module";
|
|
51359
51359
|
import { webcrypto as crypto3 } from "node:crypto";
|
|
51360
51360
|
import http from "node:http";
|
|
@@ -69550,7 +69550,7 @@ class App extends QueryRouterServer2 {
|
|
|
69550
69550
|
}
|
|
69551
69551
|
}
|
|
69552
69552
|
|
|
69553
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
69553
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.89/node_modules/@kevisual/router/dist/router-simple.js
|
|
69554
69554
|
import url5 from "node:url";
|
|
69555
69555
|
var __create5 = Object.create;
|
|
69556
69556
|
var __getProtoOf5 = Object.getPrototypeOf;
|
|
@@ -87433,7 +87433,6 @@ class AssistantApp extends Manager2 {
|
|
|
87433
87433
|
if (token) {
|
|
87434
87434
|
console.log("用户已登录,正在初始化远程应用连接...");
|
|
87435
87435
|
await manager.initRemoteApp({ token });
|
|
87436
|
-
await manager.initRemoteApp();
|
|
87437
87436
|
await manager.initRouterProxyLightApp();
|
|
87438
87437
|
}
|
|
87439
87438
|
await manager.initRouterProxyApp();
|
package/dist/envision.js
CHANGED
|
@@ -22490,8 +22490,8 @@ InitEnv.init();
|
|
|
22490
22490
|
var version = useContextKey("version", () => {
|
|
22491
22491
|
let version2 = "0.0.64";
|
|
22492
22492
|
try {
|
|
22493
|
-
if ("0.1.
|
|
22494
|
-
version2 = "0.1.
|
|
22493
|
+
if ("0.1.20")
|
|
22494
|
+
version2 = "0.1.20";
|
|
22495
22495
|
} catch (e) {}
|
|
22496
22496
|
return version2;
|
|
22497
22497
|
});
|
|
@@ -37699,6 +37699,76 @@ var workspaceCmd = new Command("workspace").alias("w").description("工作区liv
|
|
|
37699
37699
|
program.addCommand(workspaceCmd);
|
|
37700
37700
|
program.addCommand(cnbCmd);
|
|
37701
37701
|
|
|
37702
|
+
// src/command/download.ts
|
|
37703
|
+
import path18 from "path";
|
|
37704
|
+
import fs21 from "fs";
|
|
37705
|
+
var downloadCmd = new Command("download").description("下载项目").option("-l, --link <link>", "下载链接").option("-d, --directory <directory>", "下载目录", process.cwd()).action(async (opts) => {
|
|
37706
|
+
let link2 = opts.link || "";
|
|
37707
|
+
if (!link2) {
|
|
37708
|
+
console.log("请提供下载链接");
|
|
37709
|
+
return;
|
|
37710
|
+
}
|
|
37711
|
+
let url = new URL(link2);
|
|
37712
|
+
if (!url.pathname.endsWith("/")) {
|
|
37713
|
+
url.pathname += "/";
|
|
37714
|
+
}
|
|
37715
|
+
url.searchParams.set("recursive", "true");
|
|
37716
|
+
const directory = opts.directory || process.cwd();
|
|
37717
|
+
const token2 = await queryLogin.getToken();
|
|
37718
|
+
const res = await queryLogin.query.fetchText({
|
|
37719
|
+
url: url.toString(),
|
|
37720
|
+
method: "GET",
|
|
37721
|
+
headers: {
|
|
37722
|
+
Authorization: `Bearer ${token2}`
|
|
37723
|
+
}
|
|
37724
|
+
});
|
|
37725
|
+
if (res.code === 200 && res.data) {
|
|
37726
|
+
const files = res.data;
|
|
37727
|
+
console.log(`获取到 ${files.length} 个文件`);
|
|
37728
|
+
await downloadFiles(files, { directory });
|
|
37729
|
+
} else {
|
|
37730
|
+
console.log(chalk2.red("获取文件列表失败:"), res.message || "未知错误");
|
|
37731
|
+
}
|
|
37732
|
+
});
|
|
37733
|
+
program.addCommand(downloadCmd);
|
|
37734
|
+
var downloadFiles = async (files, opts) => {
|
|
37735
|
+
const directory = opts?.directory || process.cwd();
|
|
37736
|
+
let successCount = 0;
|
|
37737
|
+
let failCount = 0;
|
|
37738
|
+
for (const file of files) {
|
|
37739
|
+
try {
|
|
37740
|
+
const downloadPath = path18.join(directory, file.path);
|
|
37741
|
+
const dir = path18.dirname(downloadPath);
|
|
37742
|
+
if (!fs21.existsSync(dir)) {
|
|
37743
|
+
fs21.mkdirSync(dir, { recursive: true });
|
|
37744
|
+
}
|
|
37745
|
+
console.log(`下载中: ${file.name}`);
|
|
37746
|
+
const { blob, type } = await fetchLink(file.url);
|
|
37747
|
+
if (type.includes("text/html")) {
|
|
37748
|
+
const text = await blob.text();
|
|
37749
|
+
if (text === "fetchRes is error") {
|
|
37750
|
+
console.log(chalk2.red("下载失败:"), file.name);
|
|
37751
|
+
failCount++;
|
|
37752
|
+
continue;
|
|
37753
|
+
}
|
|
37754
|
+
}
|
|
37755
|
+
fs21.writeFileSync(downloadPath, Buffer.from(await blob.arrayBuffer()));
|
|
37756
|
+
successCount++;
|
|
37757
|
+
console.log(chalk2.green("下载成功:"), file.name);
|
|
37758
|
+
} catch (error) {
|
|
37759
|
+
failCount++;
|
|
37760
|
+
console.log(chalk2.red("下载失败:"), file.name, error);
|
|
37761
|
+
}
|
|
37762
|
+
}
|
|
37763
|
+
console.log(chalk2.blue("下载完成"));
|
|
37764
|
+
console.log(chalk2.green(`成功: ${successCount}`));
|
|
37765
|
+
console.log(chalk2.red(`失败: ${failCount}`));
|
|
37766
|
+
return {
|
|
37767
|
+
successCount,
|
|
37768
|
+
failCount
|
|
37769
|
+
};
|
|
37770
|
+
};
|
|
37771
|
+
|
|
37702
37772
|
// src/index.ts
|
|
37703
37773
|
var runParser = async (argv) => {
|
|
37704
37774
|
program.parse(argv);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kevisual/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "envision 命令行工具",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"basename": "/root/cli",
|
|
@@ -45,12 +45,13 @@
|
|
|
45
45
|
"@kevisual/app": "^0.0.2",
|
|
46
46
|
"@kevisual/auth": "^2.0.3",
|
|
47
47
|
"@kevisual/context": "^0.0.8",
|
|
48
|
+
"@kevisual/router": "^0.0.90",
|
|
48
49
|
"@kevisual/use-config": "^1.0.30",
|
|
49
|
-
"@opencode-ai/sdk": "^1.2.
|
|
50
|
+
"@opencode-ai/sdk": "^1.2.22",
|
|
50
51
|
"@types/busboy": "^1.5.4",
|
|
51
52
|
"busboy": "^1.6.0",
|
|
52
53
|
"eventemitter3": "^5.0.4",
|
|
53
|
-
"jose": "^6.2.
|
|
54
|
+
"jose": "^6.2.1",
|
|
54
55
|
"lowdb": "^7.0.1",
|
|
55
56
|
"lru-cache": "^11.2.6",
|
|
56
57
|
"micromatch": "^4.0.8",
|
|
@@ -81,7 +82,7 @@
|
|
|
81
82
|
"ignore": "^7.0.5",
|
|
82
83
|
"jsonwebtoken": "^9.0.3",
|
|
83
84
|
"pm2": "^6.0.14",
|
|
84
|
-
"tar": "^7.5.
|
|
85
|
+
"tar": "^7.5.11",
|
|
85
86
|
"zustand": "^5.0.11"
|
|
86
87
|
},
|
|
87
88
|
"engines": {
|