@kevisual/cli 0.1.9 → 0.1.11
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.js +204 -105
- package/dist/assistant-server.js +223 -111
- package/dist/assistant.js +61 -44
- package/dist/envision.js +2 -2
- package/package.json +1 -1
package/dist/assistant.js
CHANGED
|
@@ -37099,7 +37099,7 @@ class Query {
|
|
|
37099
37099
|
}
|
|
37100
37100
|
}
|
|
37101
37101
|
|
|
37102
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
37102
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.84/node_modules/@kevisual/router/dist/router-browser.js
|
|
37103
37103
|
var __create3 = Object.create;
|
|
37104
37104
|
var __getProtoOf3 = Object.getPrototypeOf;
|
|
37105
37105
|
var __defProp3 = Object.defineProperty;
|
|
@@ -51291,7 +51291,7 @@ var getStringHash = (str) => {
|
|
|
51291
51291
|
return crypto2.createHash("md5").update(str).digest("hex");
|
|
51292
51292
|
};
|
|
51293
51293
|
|
|
51294
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
51294
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.84/node_modules/@kevisual/router/dist/router.js
|
|
51295
51295
|
import { createRequire as createRequire3 } from "node:module";
|
|
51296
51296
|
import { webcrypto as crypto3 } from "node:crypto";
|
|
51297
51297
|
import http from "node:http";
|
|
@@ -68195,6 +68195,7 @@ class QueryRouter {
|
|
|
68195
68195
|
const maxNextRoute = this.maxNextRoute;
|
|
68196
68196
|
ctx = ctx || {};
|
|
68197
68197
|
ctx.currentPath = path7;
|
|
68198
|
+
ctx.currentId = route?.id;
|
|
68198
68199
|
ctx.currentKey = key;
|
|
68199
68200
|
ctx.currentRoute = route;
|
|
68200
68201
|
ctx.index = (ctx.index || 0) + 1;
|
|
@@ -68208,7 +68209,7 @@ class QueryRouter {
|
|
|
68208
68209
|
ctx.code = 500;
|
|
68209
68210
|
ctx.message = "Too many nextRoute";
|
|
68210
68211
|
ctx.body = null;
|
|
68211
|
-
return;
|
|
68212
|
+
return ctx;
|
|
68212
68213
|
}
|
|
68213
68214
|
if (route && route.middleware && route.middleware.length > 0) {
|
|
68214
68215
|
const errorMiddleware = [];
|
|
@@ -68283,7 +68284,9 @@ class QueryRouter {
|
|
|
68283
68284
|
}
|
|
68284
68285
|
return ctx;
|
|
68285
68286
|
}
|
|
68286
|
-
if (ctx.end) {
|
|
68287
|
+
if (ctx.end) {
|
|
68288
|
+
return ctx;
|
|
68289
|
+
}
|
|
68287
68290
|
}
|
|
68288
68291
|
}
|
|
68289
68292
|
}
|
|
@@ -68477,7 +68480,7 @@ class QueryRouter {
|
|
|
68477
68480
|
description: "列出当前应用下的所有的路由信息",
|
|
68478
68481
|
middleware: opts?.middleware || [],
|
|
68479
68482
|
run: async (ctx) => {
|
|
68480
|
-
const tokenUser = ctx.state
|
|
68483
|
+
const tokenUser = ctx.state;
|
|
68481
68484
|
let isUser = !!tokenUser;
|
|
68482
68485
|
const list4 = this.getList(opts?.filter).filter((item) => {
|
|
68483
68486
|
if (item.id === "auth" || item.id === "auth-can" || item.id === "check-auth-admin" || item.id === "auth-admin") {
|
|
@@ -68507,6 +68510,56 @@ class QueryRouter {
|
|
|
68507
68510
|
toJSONSchema = toJSONSchema32;
|
|
68508
68511
|
fromJSONSchema = fromJSONSchema32;
|
|
68509
68512
|
}
|
|
68513
|
+
|
|
68514
|
+
class QueryRouterServer2 extends QueryRouter {
|
|
68515
|
+
handle;
|
|
68516
|
+
constructor(opts) {
|
|
68517
|
+
super();
|
|
68518
|
+
const initHandle = opts?.initHandle ?? true;
|
|
68519
|
+
if (initHandle || opts?.handleFn) {
|
|
68520
|
+
this.handle = this.getHandle(this, opts?.handleFn, opts?.context);
|
|
68521
|
+
}
|
|
68522
|
+
this.setContext({ needSerialize: false, ...opts?.context });
|
|
68523
|
+
if (opts?.appId) {
|
|
68524
|
+
this.appId = opts.appId;
|
|
68525
|
+
} else {
|
|
68526
|
+
this.appId = randomId2(16);
|
|
68527
|
+
}
|
|
68528
|
+
}
|
|
68529
|
+
setHandle(wrapperFn, ctx) {
|
|
68530
|
+
this.handle = this.getHandle(this, wrapperFn, ctx);
|
|
68531
|
+
}
|
|
68532
|
+
addRoute(route, opts) {
|
|
68533
|
+
this.add(route, opts);
|
|
68534
|
+
}
|
|
68535
|
+
Route = Route;
|
|
68536
|
+
route(...args2) {
|
|
68537
|
+
const [path7, key, opts] = args2;
|
|
68538
|
+
if (typeof path7 === "object") {
|
|
68539
|
+
return new Route(path7.path, path7.key, path7);
|
|
68540
|
+
}
|
|
68541
|
+
if (typeof path7 === "string") {
|
|
68542
|
+
if (opts) {
|
|
68543
|
+
return new Route(path7, key, opts);
|
|
68544
|
+
}
|
|
68545
|
+
if (key && typeof key === "object") {
|
|
68546
|
+
return new Route(path7, key?.key || "", key);
|
|
68547
|
+
}
|
|
68548
|
+
return new Route(path7, key);
|
|
68549
|
+
}
|
|
68550
|
+
return new Route(path7, key, opts);
|
|
68551
|
+
}
|
|
68552
|
+
prompt(description) {
|
|
68553
|
+
return new Route(undefined, undefined, { description });
|
|
68554
|
+
}
|
|
68555
|
+
async run(msg, ctx) {
|
|
68556
|
+
const handle = this.handle;
|
|
68557
|
+
if (handle) {
|
|
68558
|
+
return handle(msg, ctx);
|
|
68559
|
+
}
|
|
68560
|
+
return super.run(msg, ctx);
|
|
68561
|
+
}
|
|
68562
|
+
}
|
|
68510
68563
|
var isNode2 = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
|
|
68511
68564
|
var isBrowser3 = typeof window !== "undefined" && typeof document !== "undefined" && typeof document.createElement === "function";
|
|
68512
68565
|
var isDeno2 = typeof Deno !== "undefined" && typeof Deno.version === "object" && typeof Deno.version.deno === "string";
|
|
@@ -69374,11 +69427,11 @@ class BunServer extends ServerBase {
|
|
|
69374
69427
|
}
|
|
69375
69428
|
}
|
|
69376
69429
|
|
|
69377
|
-
class App extends
|
|
69430
|
+
class App extends QueryRouterServer2 {
|
|
69378
69431
|
router;
|
|
69379
69432
|
server;
|
|
69380
69433
|
constructor(opts) {
|
|
69381
|
-
super();
|
|
69434
|
+
super({ initHandle: false, context: { needSerialize: true, ...opts?.routerContext } });
|
|
69382
69435
|
const router = this;
|
|
69383
69436
|
let server = opts?.server;
|
|
69384
69437
|
if (!server) {
|
|
@@ -69390,7 +69443,6 @@ class App extends QueryRouter {
|
|
|
69390
69443
|
}
|
|
69391
69444
|
}
|
|
69392
69445
|
server.setHandle(router.getHandle(router, opts?.routerHandle, opts?.routerContext));
|
|
69393
|
-
router.setContext({ needSerialize: true, ...opts?.routerContext });
|
|
69394
69446
|
this.router = router;
|
|
69395
69447
|
this.server = server;
|
|
69396
69448
|
if (opts?.appId) {
|
|
@@ -69403,42 +69455,7 @@ class App extends QueryRouter {
|
|
|
69403
69455
|
listen(...args2) {
|
|
69404
69456
|
this.server.listen(...args2);
|
|
69405
69457
|
}
|
|
69406
|
-
addRoute(route, opts) {
|
|
69407
|
-
super.add(route, opts);
|
|
69408
|
-
}
|
|
69409
69458
|
Route = Route;
|
|
69410
|
-
route(...args2) {
|
|
69411
|
-
const [path7, key, opts] = args2;
|
|
69412
|
-
if (typeof path7 === "object") {
|
|
69413
|
-
return new Route(path7.path, path7.key, path7);
|
|
69414
|
-
}
|
|
69415
|
-
if (typeof path7 === "string") {
|
|
69416
|
-
if (opts) {
|
|
69417
|
-
return new Route(path7, key, opts);
|
|
69418
|
-
}
|
|
69419
|
-
if (key && typeof key === "object") {
|
|
69420
|
-
return new Route(path7, key?.key || "", key);
|
|
69421
|
-
}
|
|
69422
|
-
return new Route(path7, key);
|
|
69423
|
-
}
|
|
69424
|
-
return new Route(path7, key, opts);
|
|
69425
|
-
}
|
|
69426
|
-
prompt(...args2) {
|
|
69427
|
-
const [desc] = args2;
|
|
69428
|
-
let description = "";
|
|
69429
|
-
if (typeof desc === "string") {
|
|
69430
|
-
description = desc;
|
|
69431
|
-
} else if (typeof desc === "function") {
|
|
69432
|
-
description = desc() || "";
|
|
69433
|
-
}
|
|
69434
|
-
return new Route("", "", { description });
|
|
69435
|
-
}
|
|
69436
|
-
async call(message, ctx) {
|
|
69437
|
-
return await super.call(message, ctx);
|
|
69438
|
-
}
|
|
69439
|
-
async run(msg, ctx) {
|
|
69440
|
-
return await super.run(msg, ctx);
|
|
69441
|
-
}
|
|
69442
69459
|
static handleRequest(req, res) {
|
|
69443
69460
|
return handleServer(req, res);
|
|
69444
69461
|
}
|
|
@@ -69453,7 +69470,7 @@ class App extends QueryRouter {
|
|
|
69453
69470
|
}
|
|
69454
69471
|
}
|
|
69455
69472
|
|
|
69456
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
69473
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.84/node_modules/@kevisual/router/dist/router-simple.js
|
|
69457
69474
|
import url5 from "node:url";
|
|
69458
69475
|
var __create5 = Object.create;
|
|
69459
69476
|
var __getProtoOf5 = Object.getPrototypeOf;
|
package/dist/envision.js
CHANGED
|
@@ -22312,8 +22312,8 @@ InitEnv.init();
|
|
|
22312
22312
|
var version = useContextKey("version", () => {
|
|
22313
22313
|
let version2 = "0.0.64";
|
|
22314
22314
|
try {
|
|
22315
|
-
if ("0.1.
|
|
22316
|
-
version2 = "0.1.
|
|
22315
|
+
if ("0.1.11")
|
|
22316
|
+
version2 = "0.1.11";
|
|
22317
22317
|
} catch (e) {}
|
|
22318
22318
|
return version2;
|
|
22319
22319
|
});
|