@kevisual/cli 0.1.29 → 0.1.31

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.js CHANGED
@@ -28859,7 +28859,7 @@ class AssistantConfig {
28859
28859
  const routes = ["@kevisual/cnb/routes"];
28860
28860
  if (isCNB) {
28861
28861
  routes.push("@kevisual/project-search/routes");
28862
- id = "cnb-dev";
28862
+ id = "dev-cnb";
28863
28863
  }
28864
28864
  return {
28865
28865
  app: {
@@ -36931,7 +36931,7 @@ class RemoteApp {
36931
36931
  }
36932
36932
  }
36933
36933
 
36934
- // ../node_modules/.pnpm/@kevisual+query@0.0.53/node_modules/@kevisual/query/dist/query-browser.js
36934
+ // ../node_modules/.pnpm/@kevisual+query@0.0.55/node_modules/@kevisual/query/dist/query-browser.js
36935
36935
  var isTextForContentType = (contentType) => {
36936
36936
  if (!contentType)
36937
36937
  return false;
@@ -37134,10 +37134,6 @@ class Query {
37134
37134
  });
37135
37135
  }
37136
37136
  }
37137
- const headers2 = req.headers || {};
37138
- if (options?.token && !headers2["Authorization"]) {
37139
- headers2["Authorization"] = `Bearer ${options.token}`;
37140
- }
37141
37137
  } catch (e) {
37142
37138
  console.error("request beforeFn error", e, req);
37143
37139
  return wrapperError({
@@ -37198,20 +37194,20 @@ class Query {
37198
37194
  this.afterResponse = fn;
37199
37195
  }
37200
37196
  async fetchText(urlOrOptions, options) {
37201
- let _options = { method: "GET", ...options };
37197
+ let _options = { ...options };
37202
37198
  if (typeof urlOrOptions === "string" && !_options.url) {
37203
37199
  _options.url = urlOrOptions;
37204
37200
  }
37205
37201
  if (typeof urlOrOptions === "object") {
37206
37202
  _options = { ...urlOrOptions, ..._options };
37207
37203
  }
37208
- const headers = { ...this.headers, ..._options.headers };
37209
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
37210
- headers["Authorization"] = `Bearer ${options.token}`;
37211
- }
37212
37204
  const res = await adapter({
37205
+ method: "GET",
37213
37206
  ..._options,
37214
- headers
37207
+ headers: {
37208
+ ...this.headers,
37209
+ ..._options?.headers || {}
37210
+ }
37215
37211
  });
37216
37212
  if (res && !res.code) {
37217
37213
  return {
@@ -37223,7 +37219,7 @@ class Query {
37223
37219
  }
37224
37220
  }
37225
37221
 
37226
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/dist/router-browser.js
37222
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router-browser.js
37227
37223
  var __create3 = Object.create;
37228
37224
  var __getProtoOf3 = Object.getPrototypeOf;
37229
37225
  var __defProp3 = Object.defineProperty;
@@ -70228,7 +70224,7 @@ var getStringHash = (str) => {
70228
70224
  return crypto2.createHash("md5").update(str).digest("hex");
70229
70225
  };
70230
70226
 
70231
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/dist/router.js
70227
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router.js
70232
70228
  import { createRequire as createRequire3 } from "node:module";
70233
70229
  import { webcrypto as crypto3 } from "node:crypto";
70234
70230
  import http from "node:http";
@@ -87730,7 +87726,7 @@ class QueryRouter {
87730
87726
  console.error("=====debug====:", e);
87731
87727
  console.error("=====debug====:[path:key]:", `${route.path}-${route.key}`);
87732
87728
  }
87733
- if (e instanceof CustomError) {
87729
+ if (e instanceof CustomError || e?.code) {
87734
87730
  ctx.code = e.code;
87735
87731
  ctx.message = e.message;
87736
87732
  } else {
@@ -87993,6 +87989,39 @@ class QueryRouterServer2 extends QueryRouter {
87993
87989
  const { path: path7, key, id } = api2;
87994
87990
  return this.run({ path: path7, key, id, payload }, ctx);
87995
87991
  }
87992
+ async createAuth(fun) {
87993
+ this.route({
87994
+ path: "auth",
87995
+ key: "auth",
87996
+ id: "auth",
87997
+ description: "token验证"
87998
+ }).define(async (ctx) => {
87999
+ if (fun) {
88000
+ await fun(ctx, "auth");
88001
+ }
88002
+ }).addTo(this, { overwrite: false });
88003
+ this.route({
88004
+ path: "auth-admin",
88005
+ key: "auth-admin",
88006
+ id: "auth-admin",
88007
+ description: "admin token验证",
88008
+ middleware: ["auth"]
88009
+ }).define(async (ctx) => {
88010
+ if (fun) {
88011
+ await fun(ctx, "auth-admin");
88012
+ }
88013
+ }).addTo(this, { overwrite: false });
88014
+ this.route({
88015
+ path: "auth-can",
88016
+ key: "auth-can",
88017
+ id: "auth-can",
88018
+ description: "权限验证"
88019
+ }).define(async (ctx) => {
88020
+ if (fun) {
88021
+ await fun(ctx, "auth-can");
88022
+ }
88023
+ }).addTo(this, { overwrite: false });
88024
+ }
87996
88025
  }
87997
88026
  var isNode22 = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
87998
88027
  var isBrowser22 = typeof window !== "undefined" && typeof document !== "undefined" && typeof document.createElement === "function";
@@ -88917,7 +88946,7 @@ class App extends QueryRouterServer2 {
88917
88946
  }
88918
88947
  }
88919
88948
 
88920
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/dist/router-simple.js
88949
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router-simple.js
88921
88950
  import url5 from "node:url";
88922
88951
  var __create5 = Object.create;
88923
88952
  var __getProtoOf5 = Object.getPrototypeOf;
@@ -90114,7 +90143,7 @@ var source_default = chalk;
90114
90143
  // src/module/chalk.ts
90115
90144
  var chalk2 = new Chalk({ level: 3 });
90116
90145
 
90117
- // ../node_modules/.pnpm/@kevisual+query@0.0.53/node_modules/@kevisual/query/dist/query.js
90146
+ // ../node_modules/.pnpm/@kevisual+query@0.0.55/node_modules/@kevisual/query/dist/query.js
90118
90147
  var isTextForContentType2 = (contentType) => {
90119
90148
  if (!contentType)
90120
90149
  return false;
@@ -90317,10 +90346,6 @@ class Query2 {
90317
90346
  });
90318
90347
  }
90319
90348
  }
90320
- const headers2 = req.headers || {};
90321
- if (options?.token && !headers2["Authorization"]) {
90322
- headers2["Authorization"] = `Bearer ${options.token}`;
90323
- }
90324
90349
  } catch (e) {
90325
90350
  console.error("request beforeFn error", e, req);
90326
90351
  return wrapperError2({
@@ -90381,20 +90406,20 @@ class Query2 {
90381
90406
  this.afterResponse = fn;
90382
90407
  }
90383
90408
  async fetchText(urlOrOptions, options) {
90384
- let _options = { method: "GET", ...options };
90409
+ let _options = { ...options };
90385
90410
  if (typeof urlOrOptions === "string" && !_options.url) {
90386
90411
  _options.url = urlOrOptions;
90387
90412
  }
90388
90413
  if (typeof urlOrOptions === "object") {
90389
90414
  _options = { ...urlOrOptions, ..._options };
90390
90415
  }
90391
- const headers = { ...this.headers, ..._options.headers };
90392
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
90393
- headers["Authorization"] = `Bearer ${options.token}`;
90394
- }
90395
90416
  const res = await adapter2({
90417
+ method: "GET",
90396
90418
  ..._options,
90397
- headers
90419
+ headers: {
90420
+ ...this.headers,
90421
+ ..._options?.headers || {}
90422
+ }
90398
90423
  });
90399
90424
  if (res && !res.code) {
90400
90425
  return {
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.28")
22534
- version2 = "0.1.28";
22533
+ if ("0.1.30")
22534
+ version2 = "0.1.30";
22535
22535
  } catch (e) {}
22536
22536
  return version2;
22537
22537
  });
@@ -25366,7 +25366,7 @@ var dist_default6 = createPrompt((config, done) => {
25366
25366
  var import_md5 = __toESM(require_md5(), 1);
25367
25367
  var import_jsonwebtoken = __toESM(require_jsonwebtoken(), 1);
25368
25368
 
25369
- // node_modules/.pnpm/@kevisual+query@0.0.53/node_modules/@kevisual/query/dist/query.js
25369
+ // node_modules/.pnpm/@kevisual+query@0.0.55/node_modules/@kevisual/query/dist/query.js
25370
25370
  var isTextForContentType = (contentType) => {
25371
25371
  if (!contentType)
25372
25372
  return false;
@@ -25569,10 +25569,6 @@ class Query {
25569
25569
  });
25570
25570
  }
25571
25571
  }
25572
- const headers2 = req.headers || {};
25573
- if (options?.token && !headers2["Authorization"]) {
25574
- headers2["Authorization"] = `Bearer ${options.token}`;
25575
- }
25576
25572
  } catch (e) {
25577
25573
  console.error("request beforeFn error", e, req);
25578
25574
  return wrapperError({
@@ -25633,20 +25629,20 @@ class Query {
25633
25629
  this.afterResponse = fn;
25634
25630
  }
25635
25631
  async fetchText(urlOrOptions, options) {
25636
- let _options = { method: "GET", ...options };
25632
+ let _options = { ...options };
25637
25633
  if (typeof urlOrOptions === "string" && !_options.url) {
25638
25634
  _options.url = urlOrOptions;
25639
25635
  }
25640
25636
  if (typeof urlOrOptions === "object") {
25641
25637
  _options = { ...urlOrOptions, ..._options };
25642
25638
  }
25643
- const headers = { ...this.headers, ..._options.headers };
25644
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
25645
- headers["Authorization"] = `Bearer ${options.token}`;
25646
- }
25647
25639
  const res = await adapter({
25640
+ method: "GET",
25648
25641
  ..._options,
25649
- headers
25642
+ headers: {
25643
+ ...this.headers,
25644
+ ..._options?.headers || {}
25645
+ }
25650
25646
  });
25651
25647
  if (res && !res.code) {
25652
25648
  return {
@@ -25658,7 +25654,7 @@ class Query {
25658
25654
  }
25659
25655
  }
25660
25656
 
25661
- // node_modules/.pnpm/@kevisual+query@0.0.53/node_modules/@kevisual/query/dist/query-browser.js
25657
+ // node_modules/.pnpm/@kevisual+query@0.0.55/node_modules/@kevisual/query/dist/query-browser.js
25662
25658
  var isTextForContentType2 = (contentType) => {
25663
25659
  if (!contentType)
25664
25660
  return false;
@@ -25861,10 +25857,6 @@ class Query2 {
25861
25857
  });
25862
25858
  }
25863
25859
  }
25864
- const headers2 = req.headers || {};
25865
- if (options?.token && !headers2["Authorization"]) {
25866
- headers2["Authorization"] = `Bearer ${options.token}`;
25867
- }
25868
25860
  } catch (e) {
25869
25861
  console.error("request beforeFn error", e, req);
25870
25862
  return wrapperError2({
@@ -25925,20 +25917,20 @@ class Query2 {
25925
25917
  this.afterResponse = fn;
25926
25918
  }
25927
25919
  async fetchText(urlOrOptions, options) {
25928
- let _options = { method: "GET", ...options };
25920
+ let _options = { ...options };
25929
25921
  if (typeof urlOrOptions === "string" && !_options.url) {
25930
25922
  _options.url = urlOrOptions;
25931
25923
  }
25932
25924
  if (typeof urlOrOptions === "object") {
25933
25925
  _options = { ...urlOrOptions, ..._options };
25934
25926
  }
25935
- const headers = { ...this.headers, ..._options.headers };
25936
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
25937
- headers["Authorization"] = `Bearer ${options.token}`;
25938
- }
25939
25927
  const res = await adapter2({
25928
+ method: "GET",
25940
25929
  ..._options,
25941
- headers
25930
+ headers: {
25931
+ ...this.headers,
25932
+ ..._options?.headers || {}
25933
+ }
25942
25934
  });
25943
25935
  if (res && !res.code) {
25944
25936
  return {
@@ -31738,14 +31730,15 @@ import fs18 from "node:fs";
31738
31730
  var MODELS = ["minimax", "glm", "volcengine", "bailian"];
31739
31731
  var changeMinimax = (token2) => {
31740
31732
  const auth_token = token2 || useKey("MINIMAX_API_KEY");
31733
+ const MINIMAX_MODEL = useKey("MINIMAX_MODEL") || "MiniMax-M2.5";
31741
31734
  return {
31742
31735
  env: {
31743
31736
  ANTHROPIC_AUTH_TOKEN: auth_token,
31744
31737
  ANTHROPIC_BASE_URL: "https://api.minimaxi.com/anthropic",
31745
- ANTHROPIC_DEFAULT_HAIKU_MODEL: "MiniMax-M2.5",
31746
- ANTHROPIC_DEFAULT_OPUS_MODEL: "MiniMax-M2.5",
31747
- ANTHROPIC_DEFAULT_SONNET_MODEL: "MiniMax-M2.5",
31748
- ANTHROPIC_MODEL: "MiniMax-M2.5",
31738
+ ANTHROPIC_DEFAULT_HAIKU_MODEL: MINIMAX_MODEL,
31739
+ ANTHROPIC_DEFAULT_OPUS_MODEL: MINIMAX_MODEL,
31740
+ ANTHROPIC_DEFAULT_SONNET_MODEL: MINIMAX_MODEL,
31741
+ ANTHROPIC_MODEL: MINIMAX_MODEL,
31749
31742
  API_TIMEOUT_MS: "3000000",
31750
31743
  CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: 1
31751
31744
  }
@@ -34668,7 +34661,7 @@ var getJWKS = new Command("get").description("获取 JWKS 内容").option("-d ,
34668
34661
  jwksCmd.addCommand(getJWKS);
34669
34662
  program.addCommand(jwksCmd);
34670
34663
 
34671
- // node_modules/.pnpm/@kevisual+cnb@0.0.53_dotenv@17.3.1/node_modules/@kevisual/cnb/dist/keep.js
34664
+ // node_modules/.pnpm/@kevisual+cnb@0.0.54_dotenv@17.3.1/node_modules/@kevisual/cnb/dist/keep.js
34672
34665
  import { createRequire as createRequire3 } from "node:module";
34673
34666
  var __create3 = Object.create;
34674
34667
  var __getProtoOf3 = Object.getPrototypeOf;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/cli",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "description": "envision 命令行工具",
5
5
  "type": "module",
6
6
  "basename": "/root/cli",
@@ -45,7 +45,7 @@
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.1.5",
48
+ "@kevisual/router": "^0.1.6",
49
49
  "@kevisual/use-config": "^1.0.30",
50
50
  "@opencode-ai/sdk": "^1.2.27",
51
51
  "@types/busboy": "^1.5.4",
@@ -62,12 +62,12 @@
62
62
  },
63
63
  "devDependencies": {
64
64
  "@kevisual/api": "^0.0.64",
65
- "@kevisual/cnb": "^0.0.53",
65
+ "@kevisual/cnb": "^0.0.54",
66
66
  "@kevisual/dts": "^0.0.4",
67
67
  "@kevisual/load": "^0.0.6",
68
68
  "@kevisual/logger": "^0.0.4",
69
- "@kevisual/query": "0.0.53",
70
- "@types/bun": "^1.3.10",
69
+ "@kevisual/query": "0.0.55",
70
+ "@types/bun": "^1.3.11",
71
71
  "@types/crypto-js": "^4.2.2",
72
72
  "@types/jsonwebtoken": "^9.0.10",
73
73
  "@types/micromatch": "^4.0.10",