@kevisual/cli 0.1.31 → 0.1.33

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/envision.js CHANGED
@@ -22530,8 +22530,8 @@ InitEnv.init();
22530
22530
  var version = useContextKey("version", () => {
22531
22531
  let version2 = "0.0.64";
22532
22532
  try {
22533
- if ("0.1.30")
22534
- version2 = "0.1.30";
22533
+ if (ENVISION_VERSION)
22534
+ version2 = ENVISION_VERSION;
22535
22535
  } catch (e) {}
22536
22536
  return version2;
22537
22537
  });
@@ -25967,7 +25967,7 @@ class BaseQuery {
25967
25967
  }
25968
25968
  }
25969
25969
 
25970
- // node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/login-cache.ts
25970
+ // node_modules/.pnpm/@kevisual+api@0.0.65_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/login-cache.ts
25971
25971
  var defaultCacheData = {
25972
25972
  loginUsers: [],
25973
25973
  user: undefined,
@@ -26538,7 +26538,7 @@ class BaseLoad3 {
26538
26538
  // node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index.mjs
26539
26539
  var import__2 = __toESM(require_eventemitter3(), 1);
26540
26540
 
26541
- // node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/query-login.ts
26541
+ // node_modules/.pnpm/@kevisual+api@0.0.65_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/query-login.ts
26542
26542
  class QueryLogin extends BaseQuery {
26543
26543
  cacheStore;
26544
26544
  isBrowser;
@@ -26806,6 +26806,9 @@ class QueryLogin extends BaseQuery {
26806
26806
  const res = await this.refreshLoginUser();
26807
26807
  if (res.code === 200) {
26808
26808
  return res.data?.accessToken || null;
26809
+ } else {
26810
+ this.storage.removeItem("token");
26811
+ await this.cacheStore.clearCurrentUser();
26809
26812
  }
26810
26813
  return null;
26811
26814
  }
@@ -26947,7 +26950,7 @@ class QueryLogin extends BaseQuery {
26947
26950
  }
26948
26951
  }
26949
26952
 
26950
- // node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/login-node-cache.ts
26953
+ // node_modules/.pnpm/@kevisual+api@0.0.65_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/login-node-cache.ts
26951
26954
  import { homedir } from "node:os";
26952
26955
  import { join, dirname } from "node:path";
26953
26956
  import fs4 from "node:fs";
@@ -27091,7 +27094,7 @@ class LoginNodeCache {
27091
27094
  }
27092
27095
  }
27093
27096
 
27094
- // node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/query-login-node.ts
27097
+ // node_modules/.pnpm/@kevisual+api@0.0.65_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/query-login-node.ts
27095
27098
  var cache = new LoginNodeCache;
27096
27099
 
27097
27100
  class QueryLoginNode extends QueryLogin {
@@ -27700,7 +27703,7 @@ var pick = (obj, keys) => {
27700
27703
  }, {});
27701
27704
  };
27702
27705
  var loginCommand = new Command("login").description("Login to the application").option("-u, --username <username>", "Specify username").option("-p, --password <password>", "Specify password").option("-f, --force", "Force login").option("-w, --web", "Login on the web").option("-e, --env", "Login from KEVISUAL_TOKEN environment variable").action(async (options) => {
27703
- let { username, password: password2 } = options;
27706
+ let { username, password } = options;
27704
27707
  if (options.web) {
27705
27708
  await loginInCommand();
27706
27709
  return;
@@ -27724,8 +27727,8 @@ var loginCommand = new Command("login").description("Login to the application").
27724
27727
  message: "Enter your username:"
27725
27728
  });
27726
27729
  }
27727
- if (!password2) {
27728
- password2 = await password2({
27730
+ if (!password) {
27731
+ password = await password({
27729
27732
  message: "Enter your password:"
27730
27733
  });
27731
27734
  }
@@ -27742,7 +27745,7 @@ var loginCommand = new Command("login").description("Login to the application").
27742
27745
  }
27743
27746
  const res = await queryLogin.login({
27744
27747
  username,
27745
- password: password2
27748
+ password
27746
27749
  }).catch((err) => {
27747
27750
  return { code: 500, message: err.message || "" };
27748
27751
  });
@@ -30905,7 +30908,7 @@ var download = new Command("download").option("-d --dir <dir>", "配置目录").
30905
30908
  command8.addCommand(download);
30906
30909
  program.addCommand(command8);
30907
30910
 
30908
- // node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/dist/query-config.js
30911
+ // node_modules/.pnpm/@kevisual+api@0.0.65_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/dist/query-config.js
30909
30912
  var isTextForContentType3 = (contentType) => {
30910
30913
  if (!contentType)
30911
30914
  return false;
@@ -31108,10 +31111,6 @@ class Query3 {
31108
31111
  });
31109
31112
  }
31110
31113
  }
31111
- const headers2 = req.headers || {};
31112
- if (options?.token && !headers2["Authorization"]) {
31113
- headers2["Authorization"] = `Bearer ${options.token}`;
31114
- }
31115
31114
  } catch (e) {
31116
31115
  console.error("request beforeFn error", e, req);
31117
31116
  return wrapperError3({
@@ -31172,20 +31171,20 @@ class Query3 {
31172
31171
  this.afterResponse = fn;
31173
31172
  }
31174
31173
  async fetchText(urlOrOptions, options) {
31175
- let _options = { method: "GET", ...options };
31174
+ let _options = { ...options };
31176
31175
  if (typeof urlOrOptions === "string" && !_options.url) {
31177
31176
  _options.url = urlOrOptions;
31178
31177
  }
31179
31178
  if (typeof urlOrOptions === "object") {
31180
31179
  _options = { ...urlOrOptions, ..._options };
31181
31180
  }
31182
- const headers = { ...this.headers, ..._options.headers };
31183
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
31184
- headers["Authorization"] = `Bearer ${options.token}`;
31185
- }
31186
31181
  const res = await adapter3({
31182
+ method: "GET",
31187
31183
  ..._options,
31188
- headers
31184
+ headers: {
31185
+ ...this.headers,
31186
+ ..._options?.headers || {}
31187
+ }
31189
31188
  });
31190
31189
  if (res && !res.code) {
31191
31190
  return {
@@ -31339,7 +31338,7 @@ command9.addCommand(updateCommand);
31339
31338
  command9.addCommand(deleteCommand);
31340
31339
  program.addCommand(command9);
31341
31340
 
31342
- // node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/dist/query-secret.js
31341
+ // node_modules/.pnpm/@kevisual+api@0.0.65_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/dist/query-secret.js
31343
31342
  var isTextForContentType4 = (contentType) => {
31344
31343
  if (!contentType)
31345
31344
  return false;
@@ -31542,10 +31541,6 @@ class Query4 {
31542
31541
  });
31543
31542
  }
31544
31543
  }
31545
- const headers2 = req.headers || {};
31546
- if (options?.token && !headers2["Authorization"]) {
31547
- headers2["Authorization"] = `Bearer ${options.token}`;
31548
- }
31549
31544
  } catch (e) {
31550
31545
  console.error("request beforeFn error", e, req);
31551
31546
  return wrapperError4({
@@ -31606,20 +31601,20 @@ class Query4 {
31606
31601
  this.afterResponse = fn;
31607
31602
  }
31608
31603
  async fetchText(urlOrOptions, options) {
31609
- let _options = { method: "GET", ...options };
31604
+ let _options = { ...options };
31610
31605
  if (typeof urlOrOptions === "string" && !_options.url) {
31611
31606
  _options.url = urlOrOptions;
31612
31607
  }
31613
31608
  if (typeof urlOrOptions === "object") {
31614
31609
  _options = { ...urlOrOptions, ..._options };
31615
31610
  }
31616
- const headers = { ...this.headers, ..._options.headers };
31617
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
31618
- headers["Authorization"] = `Bearer ${options.token}`;
31619
- }
31620
31611
  const res = await adapter4({
31612
+ method: "GET",
31621
31613
  ..._options,
31622
- headers
31614
+ headers: {
31615
+ ...this.headers,
31616
+ ..._options?.headers || {}
31617
+ }
31623
31618
  });
31624
31619
  if (res && !res.code) {
31625
31620
  return {
@@ -34661,7 +34656,7 @@ var getJWKS = new Command("get").description("获取 JWKS 内容").option("-d ,
34661
34656
  jwksCmd.addCommand(getJWKS);
34662
34657
  program.addCommand(jwksCmd);
34663
34658
 
34664
- // node_modules/.pnpm/@kevisual+cnb@0.0.54_dotenv@17.3.1/node_modules/@kevisual/cnb/dist/keep.js
34659
+ // node_modules/.pnpm/@kevisual+cnb@0.0.60_dotenv@17.3.1_idb-keyval@6.2.2/node_modules/@kevisual/cnb/dist/keep.js
34665
34660
  import { createRequire as createRequire3 } from "node:module";
34666
34661
  var __create3 = Object.create;
34667
34662
  var __getProtoOf3 = Object.getPrototypeOf;
@@ -37850,7 +37845,7 @@ var downloadFiles = async (files, opts) => {
37850
37845
  };
37851
37846
  };
37852
37847
 
37853
- // src/index.ts
37848
+ // src/oldindex.ts
37854
37849
  var runParser = async (argv) => {
37855
37850
  program.parse(argv);
37856
37851
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/cli",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "description": "envision 命令行工具",
5
5
  "type": "module",
6
6
  "basename": "/root/cli",
@@ -15,6 +15,7 @@
15
15
  "bin": {
16
16
  "envision": "bin/envision.js",
17
17
  "ev": "bin/envision.js",
18
+ "ev-next": "bin/cli.js",
18
19
  "assistant": "bin/assistant.js",
19
20
  "assistant-server": "bin/assistant-server.js",
20
21
  "asst": "bin/assistant.js",
@@ -26,12 +27,12 @@
26
27
  "files": [
27
28
  "dist",
28
29
  "bin",
29
- "bun.config.mjs"
30
+ "bun.config.ts"
30
31
  ],
31
32
  "scripts": {
32
- "dev": "bun src/run.ts ",
33
+ "dev": "bun src/cli.ts ",
33
34
  "dev:server": "cd assistant && bun --watch src/run-server.ts ",
34
- "build": "rimraf dist && bun run bun.config.mjs",
35
+ "build": "rimraf dist && bun run bun.config.ts",
35
36
  "deploy": "ev pack -u -p -m no",
36
37
  "postbuild": "cd assistant && pnpm build "
37
38
  },
@@ -45,24 +46,26 @@
45
46
  "@kevisual/app": "^0.0.2",
46
47
  "@kevisual/auth": "^2.0.3",
47
48
  "@kevisual/context": "^0.0.8",
48
- "@kevisual/router": "^0.1.6",
49
+ "@kevisual/router": "^0.2.2",
49
50
  "@kevisual/use-config": "^1.0.30",
50
- "@opencode-ai/sdk": "^1.2.27",
51
+ "@opencode-ai/sdk": "^1.3.0",
51
52
  "@types/busboy": "^1.5.4",
52
53
  "busboy": "^1.6.0",
53
54
  "eventemitter3": "^5.0.4",
54
- "jose": "^6.2.1",
55
+ "jose": "^6.2.2",
55
56
  "lowdb": "^7.0.1",
56
57
  "lru-cache": "^11.2.7",
57
58
  "micromatch": "^4.0.8",
58
59
  "nanoid": "^5.1.7",
59
60
  "pm2": "latest",
60
61
  "semver": "^7.7.4",
61
- "unstorage": "^1.17.4"
62
+ "unstorage": "^1.17.4",
63
+ "zod": "^4.3.6"
62
64
  },
63
65
  "devDependencies": {
64
- "@kevisual/api": "^0.0.64",
65
- "@kevisual/cnb": "^0.0.54",
66
+ "@kevisual/api": "^0.0.65",
67
+ "@kevisual/cnb": "^0.0.60",
68
+ "@kevisual/code-builder": "^0.0.6",
66
69
  "@kevisual/dts": "^0.0.4",
67
70
  "@kevisual/load": "^0.0.6",
68
71
  "@kevisual/logger": "^0.0.4",
@@ -76,13 +79,14 @@
76
79
  "chalk": "^5.6.2",
77
80
  "commander": "^14.0.3",
78
81
  "crypto-js": "^4.2.0",
82
+ "es-toolkit": "^1.45.1",
79
83
  "fast-glob": "^3.3.3",
80
84
  "filesize": "^11.0.13",
81
85
  "form-data": "^4.0.5",
82
86
  "ignore": "^7.0.5",
83
87
  "jsonwebtoken": "^9.0.3",
84
88
  "pm2": "^6.0.14",
85
- "tar": "^7.5.11",
89
+ "tar": "^7.5.13",
86
90
  "zustand": "^5.0.12"
87
91
  },
88
92
  "engines": {
package/bun.config.mjs DELETED
@@ -1,19 +0,0 @@
1
- // @ts-check
2
- // https://bun.sh/docs/bundler
3
- // @ts-ignore
4
- import pkg from './package.json';
5
- // bun run src/index.ts --
6
- const external = ['bun'];
7
- await Bun.build({
8
- target: 'node',
9
- format: 'esm',
10
- entrypoints: ['./src/index.ts'],
11
- outdir: './dist',
12
- naming: {
13
- entry: 'envision.js',
14
- },
15
- external: external,
16
- define: {
17
- ENVISION_VERSION: JSON.stringify(pkg.version),
18
- },
19
- });