@kevisual/cli 0.0.98 → 0.1.0
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 +1990 -724
- package/dist/assistant-server.js +1962 -2232
- package/dist/assistant.js +1844 -578
- package/dist/envision.js +127 -120
- package/package.json +8 -7
package/dist/envision.js
CHANGED
|
@@ -18,7 +18,7 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
18
18
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
19
19
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
20
20
|
|
|
21
|
-
// node_modules/.pnpm/commander@14.0.
|
|
21
|
+
// node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js
|
|
22
22
|
var require_error = __commonJS((exports) => {
|
|
23
23
|
class CommanderError extends Error {
|
|
24
24
|
constructor(exitCode, code, message) {
|
|
@@ -42,7 +42,7 @@ var require_error = __commonJS((exports) => {
|
|
|
42
42
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
// node_modules/.pnpm/commander@14.0.
|
|
45
|
+
// node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/argument.js
|
|
46
46
|
var require_argument = __commonJS((exports) => {
|
|
47
47
|
var { InvalidArgumentError } = require_error();
|
|
48
48
|
|
|
@@ -122,7 +122,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
122
122
|
exports.humanReadableArgName = humanReadableArgName;
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
-
// node_modules/.pnpm/commander@14.0.
|
|
125
|
+
// node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/help.js
|
|
126
126
|
var require_help = __commonJS((exports) => {
|
|
127
127
|
var { humanReadableArgName } = require_argument();
|
|
128
128
|
|
|
@@ -479,7 +479,7 @@ ${itemIndentStr}`);
|
|
|
479
479
|
exports.stripColor = stripColor;
|
|
480
480
|
});
|
|
481
481
|
|
|
482
|
-
// node_modules/.pnpm/commander@14.0.
|
|
482
|
+
// node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/option.js
|
|
483
483
|
var require_option = __commonJS((exports) => {
|
|
484
484
|
var { InvalidArgumentError } = require_error();
|
|
485
485
|
|
|
@@ -663,7 +663,7 @@ var require_option = __commonJS((exports) => {
|
|
|
663
663
|
exports.DualOptions = DualOptions;
|
|
664
664
|
});
|
|
665
665
|
|
|
666
|
-
// node_modules/.pnpm/commander@14.0.
|
|
666
|
+
// node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js
|
|
667
667
|
var require_suggestSimilar = __commonJS((exports) => {
|
|
668
668
|
var maxDistance = 3;
|
|
669
669
|
function editDistance(a, b) {
|
|
@@ -736,7 +736,7 @@ var require_suggestSimilar = __commonJS((exports) => {
|
|
|
736
736
|
exports.suggestSimilar = suggestSimilar;
|
|
737
737
|
});
|
|
738
738
|
|
|
739
|
-
// node_modules/.pnpm/commander@14.0.
|
|
739
|
+
// node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/command.js
|
|
740
740
|
var require_command = __commonJS((exports) => {
|
|
741
741
|
var EventEmitter = __require("node:events").EventEmitter;
|
|
742
742
|
var childProcess = __require("node:child_process");
|
|
@@ -2091,7 +2091,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2091
2091
|
exports.useColor = useColor;
|
|
2092
2092
|
});
|
|
2093
2093
|
|
|
2094
|
-
// node_modules/.pnpm/commander@14.0.
|
|
2094
|
+
// node_modules/.pnpm/commander@14.0.3/node_modules/commander/index.js
|
|
2095
2095
|
var require_commander = __commonJS((exports) => {
|
|
2096
2096
|
var { Argument } = require_argument();
|
|
2097
2097
|
var { Command } = require_command();
|
|
@@ -21742,7 +21742,7 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
21742
21742
|
module.exports = FormData;
|
|
21743
21743
|
});
|
|
21744
21744
|
|
|
21745
|
-
// node_modules/.pnpm/commander@14.0.
|
|
21745
|
+
// node_modules/.pnpm/commander@14.0.3/node_modules/commander/esm.mjs
|
|
21746
21746
|
var import__ = __toESM(require_commander(), 1);
|
|
21747
21747
|
var {
|
|
21748
21748
|
program,
|
|
@@ -22316,8 +22316,8 @@ InitEnv.init();
|
|
|
22316
22316
|
var version = useContextKey("version", () => {
|
|
22317
22317
|
let version2 = "0.0.64";
|
|
22318
22318
|
try {
|
|
22319
|
-
if ("0.0
|
|
22320
|
-
version2 = "0.0
|
|
22319
|
+
if ("0.1.0")
|
|
22320
|
+
version2 = "0.1.0";
|
|
22321
22321
|
} catch (e) {}
|
|
22322
22322
|
return version2;
|
|
22323
22323
|
});
|
|
@@ -22333,7 +22333,7 @@ import os from "os";
|
|
|
22333
22333
|
import path2 from "path";
|
|
22334
22334
|
import fs3 from "fs";
|
|
22335
22335
|
|
|
22336
|
-
// node_modules/.pnpm/@kevisual+use-config@1.0.
|
|
22336
|
+
// node_modules/.pnpm/@kevisual+use-config@1.0.30_dotenv@17.2.3/node_modules/@kevisual/use-config/dist/app.js
|
|
22337
22337
|
import { createRequire as createRequire2 } from "node:module";
|
|
22338
22338
|
import fs2 from "node:fs";
|
|
22339
22339
|
import path from "node:path";
|
|
@@ -22836,7 +22836,7 @@ var useKey = (key, opts) => {
|
|
|
22836
22836
|
v = process.env[key];
|
|
22837
22837
|
}
|
|
22838
22838
|
if (!v) {
|
|
22839
|
-
return opts?.defaultValue ||
|
|
22839
|
+
return opts?.defaultValue || "";
|
|
22840
22840
|
}
|
|
22841
22841
|
if (opts?.isNumber && typeof v === "string") {
|
|
22842
22842
|
return Number(v);
|
|
@@ -23434,14 +23434,14 @@ var getEnvToken = () => {
|
|
|
23434
23434
|
return envTokne;
|
|
23435
23435
|
};
|
|
23436
23436
|
|
|
23437
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23437
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/key.js
|
|
23438
23438
|
var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
|
|
23439
23439
|
var isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
|
|
23440
23440
|
var isBackspaceKey = (key) => key.name === "backspace";
|
|
23441
23441
|
var isTabKey = (key) => key.name === "tab";
|
|
23442
23442
|
var isNumberKey = (key) => "1234567890".includes(key.name);
|
|
23443
23443
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
23444
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23444
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/errors.js
|
|
23445
23445
|
class AbortPromptError extends Error {
|
|
23446
23446
|
name = "AbortPromptError";
|
|
23447
23447
|
message = "Prompt was aborted";
|
|
@@ -23467,10 +23467,10 @@ class HookError extends Error {
|
|
|
23467
23467
|
class ValidationError extends Error {
|
|
23468
23468
|
name = "ValidationError";
|
|
23469
23469
|
}
|
|
23470
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23470
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
23471
23471
|
import { AsyncResource as AsyncResource2 } from "node:async_hooks";
|
|
23472
23472
|
|
|
23473
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23473
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
23474
23474
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
23475
23475
|
var hookStorage = new AsyncLocalStorage;
|
|
23476
23476
|
function createStore(rl) {
|
|
@@ -23575,7 +23575,7 @@ var effectScheduler = {
|
|
|
23575
23575
|
}
|
|
23576
23576
|
};
|
|
23577
23577
|
|
|
23578
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23578
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
23579
23579
|
function useState(defaultValue) {
|
|
23580
23580
|
return withPointer((pointer) => {
|
|
23581
23581
|
const setState = AsyncResource2.bind(function setState2(newValue) {
|
|
@@ -23593,7 +23593,7 @@ function useState(defaultValue) {
|
|
|
23593
23593
|
});
|
|
23594
23594
|
}
|
|
23595
23595
|
|
|
23596
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23596
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
23597
23597
|
function useEffect(cb, depArray) {
|
|
23598
23598
|
withPointer((pointer) => {
|
|
23599
23599
|
const oldDeps = pointer.get();
|
|
@@ -23605,7 +23605,7 @@ function useEffect(cb, depArray) {
|
|
|
23605
23605
|
});
|
|
23606
23606
|
}
|
|
23607
23607
|
|
|
23608
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23608
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/theme.js
|
|
23609
23609
|
import { styleText } from "node:util";
|
|
23610
23610
|
|
|
23611
23611
|
// node_modules/.pnpm/@inquirer+figures@2.0.3/node_modules/@inquirer/figures/dist/index.js
|
|
@@ -23897,7 +23897,7 @@ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
|
23897
23897
|
var dist_default = figures;
|
|
23898
23898
|
var replacements = Object.entries(specialMainSymbols);
|
|
23899
23899
|
|
|
23900
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23900
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/theme.js
|
|
23901
23901
|
var defaultTheme = {
|
|
23902
23902
|
prefix: {
|
|
23903
23903
|
idle: styleText("blue", "?"),
|
|
@@ -23918,7 +23918,7 @@ var defaultTheme = {
|
|
|
23918
23918
|
}
|
|
23919
23919
|
};
|
|
23920
23920
|
|
|
23921
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23921
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
23922
23922
|
function isPlainObject(value) {
|
|
23923
23923
|
if (typeof value !== "object" || value === null)
|
|
23924
23924
|
return false;
|
|
@@ -23946,7 +23946,7 @@ function makeTheme(...themes) {
|
|
|
23946
23946
|
return deepMerge(...themesToMerge);
|
|
23947
23947
|
}
|
|
23948
23948
|
|
|
23949
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23949
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
23950
23950
|
function usePrefix({ status = "idle", theme }) {
|
|
23951
23951
|
const [showLoader, setShowLoader] = useState(false);
|
|
23952
23952
|
const [tick, setTick] = useState(0);
|
|
@@ -23976,7 +23976,7 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
23976
23976
|
const iconName = status === "loading" ? "idle" : status;
|
|
23977
23977
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
23978
23978
|
}
|
|
23979
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23979
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
23980
23980
|
function useMemo(fn, dependencies) {
|
|
23981
23981
|
return withPointer((pointer) => {
|
|
23982
23982
|
const prev = pointer.get();
|
|
@@ -23988,11 +23988,11 @@ function useMemo(fn, dependencies) {
|
|
|
23988
23988
|
return prev.value;
|
|
23989
23989
|
});
|
|
23990
23990
|
}
|
|
23991
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23991
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
23992
23992
|
function useRef(val) {
|
|
23993
23993
|
return useState({ current: val })[0];
|
|
23994
23994
|
}
|
|
23995
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23995
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
23996
23996
|
function useKeypress(userHandler) {
|
|
23997
23997
|
const signal = useRef(userHandler);
|
|
23998
23998
|
signal.current = userHandler;
|
|
@@ -24010,7 +24010,7 @@ function useKeypress(userHandler) {
|
|
|
24010
24010
|
};
|
|
24011
24011
|
}, []);
|
|
24012
24012
|
}
|
|
24013
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24013
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/utils.js
|
|
24014
24014
|
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
24015
24015
|
|
|
24016
24016
|
// node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
|
|
@@ -24444,7 +24444,7 @@ function wrapAnsi(string, columns, options) {
|
|
|
24444
24444
|
`);
|
|
24445
24445
|
}
|
|
24446
24446
|
|
|
24447
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24447
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/utils.js
|
|
24448
24448
|
function breakLines(content, width) {
|
|
24449
24449
|
return content.split(`
|
|
24450
24450
|
`).flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split(`
|
|
@@ -24455,7 +24455,7 @@ function readlineWidth() {
|
|
|
24455
24455
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
|
24456
24456
|
}
|
|
24457
24457
|
|
|
24458
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24458
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
24459
24459
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
24460
24460
|
const state = useRef({
|
|
24461
24461
|
lastPointer: active,
|
|
@@ -24521,7 +24521,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
24521
24521
|
return pageBuffer.filter((line) => typeof line === "string").join(`
|
|
24522
24522
|
`);
|
|
24523
24523
|
}
|
|
24524
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24524
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
24525
24525
|
var import_mute_stream = __toESM(require_lib(), 1);
|
|
24526
24526
|
import * as readline2 from "node:readline";
|
|
24527
24527
|
import { AsyncResource as AsyncResource3 } from "node:async_hooks";
|
|
@@ -24734,7 +24734,7 @@ var {
|
|
|
24734
24734
|
unload
|
|
24735
24735
|
} = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback);
|
|
24736
24736
|
|
|
24737
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24737
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
24738
24738
|
import { stripVTControlCharacters } from "node:util";
|
|
24739
24739
|
|
|
24740
24740
|
// node_modules/.pnpm/@inquirer+ansi@2.0.3/node_modules/@inquirer/ansi/dist/index.js
|
|
@@ -24753,7 +24753,7 @@ var cursorTo = (x, y) => {
|
|
|
24753
24753
|
var eraseLine = ESC + "2K";
|
|
24754
24754
|
var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
|
|
24755
24755
|
|
|
24756
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24756
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
24757
24757
|
var height = (content) => content.split(`
|
|
24758
24758
|
`).length;
|
|
24759
24759
|
var lastLine = (content) => content.split(`
|
|
@@ -24818,7 +24818,7 @@ class ScreenManager {
|
|
|
24818
24818
|
}
|
|
24819
24819
|
}
|
|
24820
24820
|
|
|
24821
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24821
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
24822
24822
|
class PromisePolyfill extends Promise {
|
|
24823
24823
|
static withResolver() {
|
|
24824
24824
|
let resolve;
|
|
@@ -24831,7 +24831,7 @@ class PromisePolyfill extends Promise {
|
|
|
24831
24831
|
}
|
|
24832
24832
|
}
|
|
24833
24833
|
|
|
24834
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24834
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
24835
24835
|
function getCallSites() {
|
|
24836
24836
|
const _prepareStackTrace = Error.prepareStackTrace;
|
|
24837
24837
|
let result = [];
|
|
@@ -24917,7 +24917,7 @@ function createPrompt(view) {
|
|
|
24917
24917
|
};
|
|
24918
24918
|
return prompt;
|
|
24919
24919
|
}
|
|
24920
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24920
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
24921
24921
|
import { styleText as styleText2 } from "node:util";
|
|
24922
24922
|
class Separator {
|
|
24923
24923
|
separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
|
|
@@ -24931,7 +24931,7 @@ class Separator {
|
|
|
24931
24931
|
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
24932
24932
|
}
|
|
24933
24933
|
}
|
|
24934
|
-
// node_modules/.pnpm/@inquirer+confirm@6.0.4_@types+node@25.
|
|
24934
|
+
// node_modules/.pnpm/@inquirer+confirm@6.0.4_@types+node@25.2.0/node_modules/@inquirer/confirm/dist/index.js
|
|
24935
24935
|
function getBooleanValue(value, defaultValue) {
|
|
24936
24936
|
let answer = defaultValue !== false;
|
|
24937
24937
|
if (/^(y|yes)/i.test(value))
|
|
@@ -24976,7 +24976,7 @@ var dist_default2 = createPrompt((config, done) => {
|
|
|
24976
24976
|
const message = theme.style.message(config.message, status);
|
|
24977
24977
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
|
24978
24978
|
});
|
|
24979
|
-
// node_modules/.pnpm/@inquirer+input@5.0.4_@types+node@25.
|
|
24979
|
+
// node_modules/.pnpm/@inquirer+input@5.0.4_@types+node@25.2.0/node_modules/@inquirer/input/dist/index.js
|
|
24980
24980
|
var inputTheme = {
|
|
24981
24981
|
validationFailureMode: "keep"
|
|
24982
24982
|
};
|
|
@@ -25060,7 +25060,7 @@ var dist_default3 = createPrompt((config, done) => {
|
|
|
25060
25060
|
error
|
|
25061
25061
|
];
|
|
25062
25062
|
});
|
|
25063
|
-
// node_modules/.pnpm/@inquirer+select@5.0.4_@types+node@25.
|
|
25063
|
+
// node_modules/.pnpm/@inquirer+select@5.0.4_@types+node@25.2.0/node_modules/@inquirer/select/dist/index.js
|
|
25064
25064
|
import { styleText as styleText3 } from "node:util";
|
|
25065
25065
|
var selectTheme = {
|
|
25066
25066
|
icon: { cursor: dist_default.pointer },
|
|
@@ -25220,7 +25220,7 @@ var dist_default4 = createPrompt((config, done) => {
|
|
|
25220
25220
|
var import_md5 = __toESM(require_md5(), 1);
|
|
25221
25221
|
var import_jsonwebtoken = __toESM(require_jsonwebtoken(), 1);
|
|
25222
25222
|
|
|
25223
|
-
// node_modules/.pnpm/@kevisual+query@0.0.
|
|
25223
|
+
// node_modules/.pnpm/@kevisual+query@0.0.39/node_modules/@kevisual/query/dist/query.js
|
|
25224
25224
|
var isTextForContentType = (contentType) => {
|
|
25225
25225
|
if (!contentType)
|
|
25226
25226
|
return false;
|
|
@@ -25252,11 +25252,15 @@ var adapter = async (opts = {}, overloadOpts) => {
|
|
|
25252
25252
|
url = new URL(opts.url, origin);
|
|
25253
25253
|
}
|
|
25254
25254
|
const isGet = method === "GET";
|
|
25255
|
+
const oldSearchParams = url.searchParams;
|
|
25255
25256
|
if (isGet) {
|
|
25256
|
-
let searchParams = new URLSearchParams(opts.body);
|
|
25257
|
+
let searchParams = new URLSearchParams({ ...Object.fromEntries(oldSearchParams), ...opts.body });
|
|
25257
25258
|
url.search = searchParams.toString();
|
|
25258
25259
|
} else {
|
|
25259
|
-
const params =
|
|
25260
|
+
const params = {
|
|
25261
|
+
...Object.fromEntries(oldSearchParams),
|
|
25262
|
+
...opts.params
|
|
25263
|
+
};
|
|
25260
25264
|
const searchParams = new URLSearchParams(params);
|
|
25261
25265
|
if (typeof opts.body === "object" && opts.body !== null) {
|
|
25262
25266
|
let body2 = opts.body || {};
|
|
@@ -25482,7 +25486,7 @@ class Query {
|
|
|
25482
25486
|
}
|
|
25483
25487
|
}
|
|
25484
25488
|
|
|
25485
|
-
// node_modules/.pnpm/@kevisual+query@0.0.
|
|
25489
|
+
// node_modules/.pnpm/@kevisual+query@0.0.39/node_modules/@kevisual/query/dist/query-browser.js
|
|
25486
25490
|
var isTextForContentType2 = (contentType) => {
|
|
25487
25491
|
if (!contentType)
|
|
25488
25492
|
return false;
|
|
@@ -25514,11 +25518,15 @@ var adapter2 = async (opts = {}, overloadOpts) => {
|
|
|
25514
25518
|
url = new URL(opts.url, origin);
|
|
25515
25519
|
}
|
|
25516
25520
|
const isGet = method === "GET";
|
|
25521
|
+
const oldSearchParams = url.searchParams;
|
|
25517
25522
|
if (isGet) {
|
|
25518
|
-
let searchParams = new URLSearchParams(opts.body);
|
|
25523
|
+
let searchParams = new URLSearchParams({ ...Object.fromEntries(oldSearchParams), ...opts.body });
|
|
25519
25524
|
url.search = searchParams.toString();
|
|
25520
25525
|
} else {
|
|
25521
|
-
const params =
|
|
25526
|
+
const params = {
|
|
25527
|
+
...Object.fromEntries(oldSearchParams),
|
|
25528
|
+
...opts.params
|
|
25529
|
+
};
|
|
25522
25530
|
const searchParams = new URLSearchParams(params);
|
|
25523
25531
|
if (typeof opts.body === "object" && opts.body !== null) {
|
|
25524
25532
|
let body2 = opts.body || {};
|
|
@@ -25760,7 +25768,7 @@ class BaseQuery {
|
|
|
25760
25768
|
}
|
|
25761
25769
|
}
|
|
25762
25770
|
|
|
25763
|
-
// node_modules/.pnpm/@kevisual+query-login@0.0.7_@kevisual+query@0.0.
|
|
25771
|
+
// node_modules/.pnpm/@kevisual+query-login@0.0.7_@kevisual+query@0.0.39/node_modules/@kevisual/query-login/dist/query-login-node.js
|
|
25764
25772
|
import { homedir } from "os";
|
|
25765
25773
|
import { join, dirname } from "path";
|
|
25766
25774
|
import fs4 from "fs";
|
|
@@ -27364,6 +27372,22 @@ var loginCommand = new Command("login").description("Login to the application").
|
|
|
27364
27372
|
}
|
|
27365
27373
|
});
|
|
27366
27374
|
program.addCommand(loginCommand);
|
|
27375
|
+
var getUsername = async () => {
|
|
27376
|
+
const token = getEnvToken();
|
|
27377
|
+
const localToken = storage.getItem("token");
|
|
27378
|
+
if (!token && !localToken) {
|
|
27379
|
+
console.log("请先登录");
|
|
27380
|
+
return null;
|
|
27381
|
+
}
|
|
27382
|
+
let me = await queryLogin.getMe(localToken || token);
|
|
27383
|
+
if (me?.code === 401) {
|
|
27384
|
+
me = await queryLogin.getMe();
|
|
27385
|
+
}
|
|
27386
|
+
if (me?.code === 200) {
|
|
27387
|
+
return me.data?.username;
|
|
27388
|
+
}
|
|
27389
|
+
return null;
|
|
27390
|
+
};
|
|
27367
27391
|
var showMe = async (show = true) => {
|
|
27368
27392
|
const token = getEnvToken();
|
|
27369
27393
|
const localToken = storage.getItem("token");
|
|
@@ -28373,10 +28397,9 @@ var getPackageJson = (opts) => {
|
|
|
28373
28397
|
return null;
|
|
28374
28398
|
}
|
|
28375
28399
|
};
|
|
28376
|
-
var command2 = new Command("deploy").description("把前端文件传到服务器").argument("<filePath>", "Path to the file to be uploaded, filepath or directory").option("-v, --version <version>", "verbose").option("-k, --key <key>", "key").option("-y, --yes <yes>", "yes").option("-o, --org <org>", "org").option("-u, --update", "load current app. set current version in product。 redis 缓存更新").option("-s, --showBackend", "show backend url, 部署的后端应用,显示执行的cli命令").option("-
|
|
28400
|
+
var command2 = new Command("deploy").description("把前端文件传到服务器").argument("<filePath>", "Path to the file to be uploaded, filepath or directory").option("-v, --version <version>", "verbose").option("-k, --key <key>", "key").option("-y, --yes <yes>", "yes").option("-o, --org <org>", "org").option("-u, --update", "load current app. set current version in product。 redis 缓存更新").option("-s, --showBackend", "show backend url, 部署的后端应用,显示执行的cli命令").option("-d, --dot", "是否上传隐藏文件").option("--dir, --directory <directory>", "上传的默认路径").action(async (filePath, options) => {
|
|
28377
28401
|
try {
|
|
28378
28402
|
let { version: version2, key, yes, update, org, showBackend } = options;
|
|
28379
|
-
const noCheck = !options.noCheck;
|
|
28380
28403
|
const dot = !!options.dot;
|
|
28381
28404
|
const pkgInfo = getPackageJson({ version: version2, appKey: key });
|
|
28382
28405
|
if (!version2 && pkgInfo?.version) {
|
|
@@ -28431,18 +28454,30 @@ var command2 = new Command("deploy").description("把前端文件传到服务器
|
|
|
28431
28454
|
return;
|
|
28432
28455
|
}
|
|
28433
28456
|
}
|
|
28457
|
+
let username = "";
|
|
28458
|
+
if (pkgInfo?.user) {
|
|
28459
|
+
username = pkgInfo.user;
|
|
28460
|
+
} else if (org) {
|
|
28461
|
+
username = org;
|
|
28462
|
+
} else {
|
|
28463
|
+
const me = await getUsername();
|
|
28464
|
+
if (me) {
|
|
28465
|
+
username = me;
|
|
28466
|
+
} else {
|
|
28467
|
+
logger.error("无法获取用户名,请使用先登录");
|
|
28468
|
+
return;
|
|
28469
|
+
}
|
|
28470
|
+
}
|
|
28434
28471
|
const uploadDirectory = isDirectory ? directory : path3.dirname(directory);
|
|
28435
|
-
const res = await
|
|
28472
|
+
const res = await uploadFilesV2(_relativeFiles, uploadDirectory, { key, version: version2, username, directory: options.directory });
|
|
28436
28473
|
logger.debug("upload res", res);
|
|
28437
28474
|
if (res?.code === 200) {
|
|
28438
|
-
res.data?.upload?.map?.((d) => {
|
|
28439
|
-
console.log(source_default.green("uploaded file", d?.name, d?.path));
|
|
28440
|
-
});
|
|
28441
28475
|
const res2 = await queryAppVersion({
|
|
28442
28476
|
key,
|
|
28443
|
-
version: version2
|
|
28477
|
+
version: version2,
|
|
28478
|
+
create: true
|
|
28444
28479
|
});
|
|
28445
|
-
logger.debug("queryAppVersion res", res2);
|
|
28480
|
+
logger.debug("queryAppVersion res", res2, key, version2);
|
|
28446
28481
|
if (res2.code !== 200) {
|
|
28447
28482
|
console.error(source_default.red("查询应用版本失败"), res2.message, key);
|
|
28448
28483
|
return;
|
|
@@ -28465,87 +28500,59 @@ var command2 = new Command("deploy").description("把前端文件传到服务器
|
|
|
28465
28500
|
} else {
|
|
28466
28501
|
console.error("File upload failed", res?.message);
|
|
28467
28502
|
}
|
|
28468
|
-
return res;
|
|
28469
28503
|
} catch (error) {
|
|
28470
28504
|
console.error("error", error);
|
|
28471
28505
|
}
|
|
28472
28506
|
});
|
|
28473
|
-
var
|
|
28507
|
+
var uploadFilesV2 = async (files, directory, opts) => {
|
|
28474
28508
|
const { key, version: version2, username } = opts || {};
|
|
28475
|
-
|
|
28476
|
-
|
|
28477
|
-
let description = "";
|
|
28478
|
-
for (const file of files) {
|
|
28479
|
-
const filePath = path3.join(directory, file);
|
|
28480
|
-
const hash = getHash(filePath);
|
|
28481
|
-
if (!hash) {
|
|
28482
|
-
logger.error("文件", filePath, "不存在");
|
|
28483
|
-
logger.error("请检查文件是否存在");
|
|
28484
|
-
}
|
|
28485
|
-
data.files.push({ path: file, hash });
|
|
28486
|
-
if (filePath.includes("readme.md")) {
|
|
28487
|
-
description = fs6.readFileSync(filePath, "utf-8");
|
|
28488
|
-
}
|
|
28489
|
-
}
|
|
28490
|
-
data.appKey = key;
|
|
28491
|
-
data.version = version2;
|
|
28492
|
-
form.append("appKey", key);
|
|
28493
|
-
form.append("version", version2);
|
|
28494
|
-
if (username) {
|
|
28495
|
-
form.append("username", username);
|
|
28496
|
-
data.username = username;
|
|
28497
|
-
}
|
|
28498
|
-
if (opts?.directory) {
|
|
28499
|
-
form.append("directory", opts.directory);
|
|
28500
|
-
data.directory = opts.directory;
|
|
28501
|
-
}
|
|
28502
|
-
const token2 = await storage.getItem("token");
|
|
28503
|
-
const checkUrl = new URL("/api/s1/resources/upload/check", getBaseURL());
|
|
28504
|
-
const res = await query.adapter({ url: checkUrl.toString(), method: "POST", body: data, headers: { Authorization: "Bearer " + token2 } }).then((res2) => {
|
|
28505
|
-
try {
|
|
28506
|
-
if (typeof res2 === "string") {
|
|
28507
|
-
return JSON.parse(res2);
|
|
28508
|
-
} else {
|
|
28509
|
-
return res2;
|
|
28510
|
-
}
|
|
28511
|
-
} catch (error) {
|
|
28512
|
-
return typeof res2 === "string" ? {} : res2;
|
|
28513
|
-
}
|
|
28514
|
-
});
|
|
28515
|
-
const checkData = res.data;
|
|
28516
|
-
if (res.code !== 200) {
|
|
28517
|
-
console.error("check failed", res);
|
|
28518
|
-
return res;
|
|
28519
|
-
}
|
|
28520
|
-
let needUpload = false;
|
|
28521
|
-
for (const file of files) {
|
|
28509
|
+
for (let i = 0;i < files.length; i++) {
|
|
28510
|
+
const file = files[i];
|
|
28522
28511
|
const filePath = path3.join(directory, file);
|
|
28523
|
-
|
|
28524
|
-
|
|
28525
|
-
logger.debug("文件已经上传过了", file);
|
|
28526
|
-
continue;
|
|
28527
|
-
}
|
|
28512
|
+
logger.info("[上传进度]", `${i + 1}/${files.length}`, file);
|
|
28513
|
+
const form = new import_form_data2.default;
|
|
28528
28514
|
const filename = path3.basename(filePath);
|
|
28529
|
-
logger.debug("upload file", file, filename);
|
|
28530
28515
|
const encodedFilename = Buffer.from(filename, "utf-8").toString("binary");
|
|
28531
28516
|
form.append("file", fs6.createReadStream(filePath), {
|
|
28532
28517
|
filename: encodedFilename,
|
|
28533
28518
|
filepath: file
|
|
28534
28519
|
});
|
|
28535
|
-
|
|
28536
|
-
|
|
28537
|
-
|
|
28538
|
-
|
|
28539
|
-
|
|
28540
|
-
|
|
28520
|
+
const _baseURL = getBaseURL();
|
|
28521
|
+
const url = new URL(`/${username}/resources/${key}/${version2}/${file}`, _baseURL);
|
|
28522
|
+
const token2 = await storage.getItem("token");
|
|
28523
|
+
const check = () => {
|
|
28524
|
+
const checkUrl = new URL(url.toString());
|
|
28525
|
+
checkUrl.searchParams.set("stat", "1");
|
|
28526
|
+
const res = query.adapter({ url: checkUrl.toString(), method: "GET", headers: { Authorization: "Bearer " + token2 } });
|
|
28527
|
+
return res;
|
|
28541
28528
|
};
|
|
28529
|
+
const checkRes = await check();
|
|
28530
|
+
let needUpload = false;
|
|
28531
|
+
let hash = "";
|
|
28532
|
+
if (checkRes?.code === 404) {
|
|
28533
|
+
needUpload = true;
|
|
28534
|
+
hash = getHash(filePath);
|
|
28535
|
+
} else if (checkRes?.code === 200) {
|
|
28536
|
+
const etag = checkRes?.data?.etag;
|
|
28537
|
+
hash = getHash(filePath);
|
|
28538
|
+
if (etag !== hash) {
|
|
28539
|
+
needUpload = true;
|
|
28540
|
+
}
|
|
28541
|
+
}
|
|
28542
|
+
if (needUpload) {
|
|
28543
|
+
url.searchParams.append("hash", hash);
|
|
28544
|
+
const res = await upload({ url, form, token: token2 });
|
|
28545
|
+
logger.debug("upload file", file, res);
|
|
28546
|
+
if (res.code !== 200) {
|
|
28547
|
+
logger.error("文件上传失败", file, res);
|
|
28548
|
+
return { code: 500, message: "文件上传失败", file, fileRes: res };
|
|
28549
|
+
}
|
|
28550
|
+
} else {
|
|
28551
|
+
console.log(source_default.green("\t 文件已经上传过了", url.toString()));
|
|
28552
|
+
}
|
|
28553
|
+
continue;
|
|
28542
28554
|
}
|
|
28543
|
-
|
|
28544
|
-
const url = new URL("/api/s1/resources/upload", _baseURL);
|
|
28545
|
-
if (opts.noCheckAppFiles) {
|
|
28546
|
-
url.searchParams.append("noCheckAppFiles", "true");
|
|
28547
|
-
}
|
|
28548
|
-
return upload({ url, form, token: token2 });
|
|
28555
|
+
return { code: 200 };
|
|
28549
28556
|
};
|
|
28550
28557
|
program.addCommand(command2);
|
|
28551
28558
|
var deployLoadFn = async (id, org) => {
|
|
@@ -34697,7 +34704,7 @@ var extractAvailableModels = (config2) => {
|
|
|
34697
34704
|
}
|
|
34698
34705
|
return models;
|
|
34699
34706
|
};
|
|
34700
|
-
var command12 = new Command("
|
|
34707
|
+
var command12 = new Command("ccc").description("切换 opencode 模型,从配置的 provider 中选择").option("-m, --model <model:string>", "选择模型 (格式: provider/model)").action(async (options) => {
|
|
34701
34708
|
const configPath2 = path15.join(os5.homedir(), ".config", "opencode", "opencode.json");
|
|
34702
34709
|
const config2 = readOpencodeConfig(configPath2);
|
|
34703
34710
|
const availableModels = extractAvailableModels(config2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kevisual/cli",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "envision 命令行工具",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"basename": "/root/cli",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@kevisual/app": "^0.0.2",
|
|
49
49
|
"@kevisual/auth": "^2.0.3",
|
|
50
50
|
"@kevisual/context": "^0.0.4",
|
|
51
|
-
"@kevisual/use-config": "^1.0.
|
|
52
|
-
"@opencode-ai/sdk": "^1.1.
|
|
51
|
+
"@kevisual/use-config": "^1.0.30",
|
|
52
|
+
"@opencode-ai/sdk": "^1.1.48",
|
|
53
53
|
"@types/busboy": "^1.5.4",
|
|
54
54
|
"busboy": "^1.6.0",
|
|
55
55
|
"eventemitter3": "^5.0.4",
|
|
@@ -62,19 +62,20 @@
|
|
|
62
62
|
"unstorage": "^1.17.4"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
+
"@kevisual/api": "^0.0.42",
|
|
65
66
|
"@kevisual/dts": "^0.0.3",
|
|
66
67
|
"@kevisual/load": "^0.0.6",
|
|
67
68
|
"@kevisual/logger": "^0.0.4",
|
|
68
|
-
"@kevisual/query": "0.0.
|
|
69
|
+
"@kevisual/query": "0.0.39",
|
|
69
70
|
"@kevisual/query-login": "0.0.7",
|
|
70
71
|
"@types/bun": "^1.3.8",
|
|
71
72
|
"@types/crypto-js": "^4.2.2",
|
|
72
73
|
"@types/jsonwebtoken": "^9.0.10",
|
|
73
74
|
"@types/micromatch": "^4.0.10",
|
|
74
|
-
"@types/node": "^25.
|
|
75
|
+
"@types/node": "^25.2.0",
|
|
75
76
|
"@types/semver": "^7.7.1",
|
|
76
77
|
"chalk": "^5.6.2",
|
|
77
|
-
"commander": "^14.0.
|
|
78
|
+
"commander": "^14.0.3",
|
|
78
79
|
"crypto-js": "^4.2.0",
|
|
79
80
|
"fast-glob": "^3.3.3",
|
|
80
81
|
"filesize": "^11.0.13",
|
|
@@ -83,7 +84,7 @@
|
|
|
83
84
|
"jsonwebtoken": "^9.0.3",
|
|
84
85
|
"pm2": "^6.0.14",
|
|
85
86
|
"tar": "^7.5.7",
|
|
86
|
-
"zustand": "^5.0.
|
|
87
|
+
"zustand": "^5.0.11"
|
|
87
88
|
},
|
|
88
89
|
"engines": {
|
|
89
90
|
"node": ">=22.0.0"
|