@kevisual/cli 0.1.8 → 0.1.10
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 +1755 -20759
- package/dist/assistant-server.js +1995 -20993
- package/dist/assistant.js +241 -156
- package/dist/envision.js +104 -67
- package/package.json +3 -3
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.9")
|
|
22316
|
+
version2 = "0.1.9";
|
|
22317
22317
|
} catch (e) {}
|
|
22318
22318
|
return version2;
|
|
22319
22319
|
});
|
|
@@ -23430,14 +23430,14 @@ var getEnvToken = () => {
|
|
|
23430
23430
|
return envTokne;
|
|
23431
23431
|
};
|
|
23432
23432
|
|
|
23433
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
23433
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/key.js
|
|
23434
23434
|
var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
|
|
23435
23435
|
var isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
|
|
23436
23436
|
var isBackspaceKey = (key) => key.name === "backspace";
|
|
23437
23437
|
var isTabKey = (key) => key.name === "tab";
|
|
23438
23438
|
var isNumberKey = (key) => "1234567890".includes(key.name);
|
|
23439
23439
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
23440
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
23440
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/errors.js
|
|
23441
23441
|
class AbortPromptError extends Error {
|
|
23442
23442
|
name = "AbortPromptError";
|
|
23443
23443
|
message = "Prompt was aborted";
|
|
@@ -23463,10 +23463,10 @@ class HookError extends Error {
|
|
|
23463
23463
|
class ValidationError extends Error {
|
|
23464
23464
|
name = "ValidationError";
|
|
23465
23465
|
}
|
|
23466
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
23466
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
23467
23467
|
import { AsyncResource as AsyncResource2 } from "node:async_hooks";
|
|
23468
23468
|
|
|
23469
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
23469
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
23470
23470
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
23471
23471
|
var hookStorage = new AsyncLocalStorage;
|
|
23472
23472
|
function createStore(rl) {
|
|
@@ -23571,7 +23571,7 @@ var effectScheduler = {
|
|
|
23571
23571
|
}
|
|
23572
23572
|
};
|
|
23573
23573
|
|
|
23574
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
23574
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
23575
23575
|
function useState(defaultValue) {
|
|
23576
23576
|
return withPointer((pointer) => {
|
|
23577
23577
|
const setState = AsyncResource2.bind(function setState2(newValue) {
|
|
@@ -23589,7 +23589,7 @@ function useState(defaultValue) {
|
|
|
23589
23589
|
});
|
|
23590
23590
|
}
|
|
23591
23591
|
|
|
23592
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
23592
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
23593
23593
|
function useEffect(cb, depArray) {
|
|
23594
23594
|
withPointer((pointer) => {
|
|
23595
23595
|
const oldDeps = pointer.get();
|
|
@@ -23601,7 +23601,7 @@ function useEffect(cb, depArray) {
|
|
|
23601
23601
|
});
|
|
23602
23602
|
}
|
|
23603
23603
|
|
|
23604
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
23604
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/theme.js
|
|
23605
23605
|
import { styleText } from "node:util";
|
|
23606
23606
|
|
|
23607
23607
|
// node_modules/.pnpm/@inquirer+figures@2.0.3/node_modules/@inquirer/figures/dist/index.js
|
|
@@ -23893,7 +23893,7 @@ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
|
23893
23893
|
var dist_default = figures;
|
|
23894
23894
|
var replacements = Object.entries(specialMainSymbols);
|
|
23895
23895
|
|
|
23896
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
23896
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/theme.js
|
|
23897
23897
|
var defaultTheme = {
|
|
23898
23898
|
prefix: {
|
|
23899
23899
|
idle: styleText("blue", "?"),
|
|
@@ -23914,7 +23914,7 @@ var defaultTheme = {
|
|
|
23914
23914
|
}
|
|
23915
23915
|
};
|
|
23916
23916
|
|
|
23917
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
23917
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
23918
23918
|
function isPlainObject(value) {
|
|
23919
23919
|
if (typeof value !== "object" || value === null)
|
|
23920
23920
|
return false;
|
|
@@ -23942,7 +23942,7 @@ function makeTheme(...themes) {
|
|
|
23942
23942
|
return deepMerge(...themesToMerge);
|
|
23943
23943
|
}
|
|
23944
23944
|
|
|
23945
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
23945
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
23946
23946
|
function usePrefix({ status = "idle", theme }) {
|
|
23947
23947
|
const [showLoader, setShowLoader] = useState(false);
|
|
23948
23948
|
const [tick, setTick] = useState(0);
|
|
@@ -23972,7 +23972,7 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
23972
23972
|
const iconName = status === "loading" ? "idle" : status;
|
|
23973
23973
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
23974
23974
|
}
|
|
23975
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
23975
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
23976
23976
|
function useMemo(fn, dependencies) {
|
|
23977
23977
|
return withPointer((pointer) => {
|
|
23978
23978
|
const prev = pointer.get();
|
|
@@ -23984,11 +23984,11 @@ function useMemo(fn, dependencies) {
|
|
|
23984
23984
|
return prev.value;
|
|
23985
23985
|
});
|
|
23986
23986
|
}
|
|
23987
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
23987
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
23988
23988
|
function useRef(val) {
|
|
23989
23989
|
return useState({ current: val })[0];
|
|
23990
23990
|
}
|
|
23991
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
23991
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
23992
23992
|
function useKeypress(userHandler) {
|
|
23993
23993
|
const signal = useRef(userHandler);
|
|
23994
23994
|
signal.current = userHandler;
|
|
@@ -24006,7 +24006,7 @@ function useKeypress(userHandler) {
|
|
|
24006
24006
|
};
|
|
24007
24007
|
}, []);
|
|
24008
24008
|
}
|
|
24009
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
24009
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/utils.js
|
|
24010
24010
|
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
24011
24011
|
|
|
24012
24012
|
// node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
@@ -24350,7 +24350,7 @@ function wrapAnsi(string, columns, options) {
|
|
|
24350
24350
|
`);
|
|
24351
24351
|
}
|
|
24352
24352
|
|
|
24353
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
24353
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/utils.js
|
|
24354
24354
|
function breakLines(content, width) {
|
|
24355
24355
|
return content.split(`
|
|
24356
24356
|
`).flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split(`
|
|
@@ -24361,7 +24361,7 @@ function readlineWidth() {
|
|
|
24361
24361
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
|
24362
24362
|
}
|
|
24363
24363
|
|
|
24364
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
24364
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
24365
24365
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
24366
24366
|
const state = useRef({
|
|
24367
24367
|
lastPointer: active,
|
|
@@ -24427,7 +24427,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
24427
24427
|
return pageBuffer.filter((line) => typeof line === "string").join(`
|
|
24428
24428
|
`);
|
|
24429
24429
|
}
|
|
24430
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
24430
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
24431
24431
|
var import_mute_stream = __toESM(require_lib(), 1);
|
|
24432
24432
|
import * as readline2 from "node:readline";
|
|
24433
24433
|
import { AsyncResource as AsyncResource3 } from "node:async_hooks";
|
|
@@ -24640,7 +24640,7 @@ var {
|
|
|
24640
24640
|
unload
|
|
24641
24641
|
} = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback);
|
|
24642
24642
|
|
|
24643
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
24643
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
24644
24644
|
import { stripVTControlCharacters } from "node:util";
|
|
24645
24645
|
|
|
24646
24646
|
// node_modules/.pnpm/@inquirer+ansi@2.0.3/node_modules/@inquirer/ansi/dist/index.js
|
|
@@ -24659,7 +24659,7 @@ var cursorTo = (x, y) => {
|
|
|
24659
24659
|
var eraseLine = ESC2 + "2K";
|
|
24660
24660
|
var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
|
|
24661
24661
|
|
|
24662
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
24662
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
24663
24663
|
var height = (content) => content.split(`
|
|
24664
24664
|
`).length;
|
|
24665
24665
|
var lastLine = (content) => content.split(`
|
|
@@ -24724,7 +24724,7 @@ class ScreenManager {
|
|
|
24724
24724
|
}
|
|
24725
24725
|
}
|
|
24726
24726
|
|
|
24727
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
24727
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
24728
24728
|
class PromisePolyfill extends Promise {
|
|
24729
24729
|
static withResolver() {
|
|
24730
24730
|
let resolve;
|
|
@@ -24737,7 +24737,8 @@ class PromisePolyfill extends Promise {
|
|
|
24737
24737
|
}
|
|
24738
24738
|
}
|
|
24739
24739
|
|
|
24740
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
24740
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
24741
|
+
var nativeSetImmediate = globalThis.setImmediate;
|
|
24741
24742
|
function getCallSites() {
|
|
24742
24743
|
const _prepareStackTrace = Error.prepareStackTrace;
|
|
24743
24744
|
let result = [];
|
|
@@ -24761,6 +24762,7 @@ function createPrompt(view) {
|
|
|
24761
24762
|
const cleanups = new Set;
|
|
24762
24763
|
const output = new import_mute_stream.default;
|
|
24763
24764
|
output.pipe(context.output ?? process.stdout);
|
|
24765
|
+
output.mute();
|
|
24764
24766
|
const rl = readline2.createInterface({
|
|
24765
24767
|
terminal: true,
|
|
24766
24768
|
input,
|
|
@@ -24784,30 +24786,37 @@ function createPrompt(view) {
|
|
|
24784
24786
|
const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`));
|
|
24785
24787
|
rl.on("SIGINT", sigint);
|
|
24786
24788
|
cleanups.add(() => rl.removeListener("SIGINT", sigint));
|
|
24787
|
-
const checkCursorPos = () => screen.checkCursorPos();
|
|
24788
|
-
rl.input.on("keypress", checkCursorPos);
|
|
24789
|
-
cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
|
|
24790
24789
|
return withHooks(rl, (cycle) => {
|
|
24791
24790
|
const hooksCleanup = AsyncResource3.bind(() => effectScheduler.clearAll());
|
|
24792
24791
|
rl.on("close", hooksCleanup);
|
|
24793
24792
|
cleanups.add(() => rl.removeListener("close", hooksCleanup));
|
|
24794
|
-
|
|
24795
|
-
|
|
24796
|
-
|
|
24797
|
-
|
|
24798
|
-
|
|
24799
|
-
|
|
24800
|
-
const
|
|
24801
|
-
|
|
24793
|
+
const startCycle = () => {
|
|
24794
|
+
const checkCursorPos = () => screen.checkCursorPos();
|
|
24795
|
+
rl.input.on("keypress", checkCursorPos);
|
|
24796
|
+
cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
|
|
24797
|
+
cycle(() => {
|
|
24798
|
+
try {
|
|
24799
|
+
const nextView = view(config, (value) => {
|
|
24800
|
+
setImmediate(() => resolve(value));
|
|
24801
|
+
});
|
|
24802
|
+
if (nextView === undefined) {
|
|
24803
|
+
const callerFilename = callSites[1]?.getFileName();
|
|
24804
|
+
throw new Error(`Prompt functions must return a string.
|
|
24802
24805
|
at ${callerFilename}`);
|
|
24806
|
+
}
|
|
24807
|
+
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
|
24808
|
+
screen.render(content, bottomContent);
|
|
24809
|
+
effectScheduler.run();
|
|
24810
|
+
} catch (error) {
|
|
24811
|
+
reject(error);
|
|
24803
24812
|
}
|
|
24804
|
-
|
|
24805
|
-
|
|
24806
|
-
|
|
24807
|
-
|
|
24808
|
-
|
|
24809
|
-
|
|
24810
|
-
}
|
|
24813
|
+
});
|
|
24814
|
+
};
|
|
24815
|
+
if ("readableFlowing" in input) {
|
|
24816
|
+
nativeSetImmediate(startCycle);
|
|
24817
|
+
} else {
|
|
24818
|
+
startCycle();
|
|
24819
|
+
}
|
|
24811
24820
|
return Object.assign(promise.then((answer) => {
|
|
24812
24821
|
effectScheduler.clearAll();
|
|
24813
24822
|
return answer;
|
|
@@ -24823,7 +24832,7 @@ function createPrompt(view) {
|
|
|
24823
24832
|
};
|
|
24824
24833
|
return prompt;
|
|
24825
24834
|
}
|
|
24826
|
-
// node_modules/.pnpm/@inquirer+core@11.1.
|
|
24835
|
+
// node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@25.3.0/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
24827
24836
|
import { styleText as styleText2 } from "node:util";
|
|
24828
24837
|
class Separator {
|
|
24829
24838
|
separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
|
|
@@ -24837,7 +24846,7 @@ class Separator {
|
|
|
24837
24846
|
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
24838
24847
|
}
|
|
24839
24848
|
}
|
|
24840
|
-
// node_modules/.pnpm/@inquirer+confirm@6.0.
|
|
24849
|
+
// node_modules/.pnpm/@inquirer+confirm@6.0.8_@types+node@25.3.0/node_modules/@inquirer/confirm/dist/index.js
|
|
24841
24850
|
function getBooleanValue(value, defaultValue) {
|
|
24842
24851
|
let answer = defaultValue !== false;
|
|
24843
24852
|
if (/^(y|yes)/i.test(value))
|
|
@@ -24882,7 +24891,7 @@ var dist_default4 = createPrompt((config, done) => {
|
|
|
24882
24891
|
const message = theme.style.message(config.message, status);
|
|
24883
24892
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
|
24884
24893
|
});
|
|
24885
|
-
// node_modules/.pnpm/@inquirer+input@5.0.
|
|
24894
|
+
// node_modules/.pnpm/@inquirer+input@5.0.8_@types+node@25.3.0/node_modules/@inquirer/input/dist/index.js
|
|
24886
24895
|
var inputTheme = {
|
|
24887
24896
|
validationFailureMode: "keep"
|
|
24888
24897
|
};
|
|
@@ -24966,21 +24975,25 @@ var dist_default5 = createPrompt((config, done) => {
|
|
|
24966
24975
|
error
|
|
24967
24976
|
];
|
|
24968
24977
|
});
|
|
24969
|
-
// node_modules/.pnpm/@inquirer+select@5.
|
|
24978
|
+
// node_modules/.pnpm/@inquirer+select@5.1.0_@types+node@25.3.0/node_modules/@inquirer/select/dist/index.js
|
|
24970
24979
|
import { styleText as styleText3 } from "node:util";
|
|
24971
24980
|
var selectTheme = {
|
|
24972
24981
|
icon: { cursor: dist_default.pointer },
|
|
24973
24982
|
style: {
|
|
24974
|
-
disabled: (text) => styleText3("dim",
|
|
24983
|
+
disabled: (text) => styleText3("dim", text),
|
|
24975
24984
|
description: (text) => styleText3("cyan", text),
|
|
24976
24985
|
keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText3("bold", key)} ${styleText3("dim", action)}`).join(styleText3("dim", " • "))
|
|
24977
24986
|
},
|
|
24987
|
+
i18n: { disabledError: "This option is disabled and cannot be selected." },
|
|
24978
24988
|
indexMode: "hidden",
|
|
24979
24989
|
keybindings: []
|
|
24980
24990
|
};
|
|
24981
24991
|
function isSelectable(item) {
|
|
24982
24992
|
return !Separator.isSeparator(item) && !item.disabled;
|
|
24983
24993
|
}
|
|
24994
|
+
function isNavigable(item) {
|
|
24995
|
+
return !Separator.isSeparator(item);
|
|
24996
|
+
}
|
|
24984
24997
|
function normalizeChoices(choices) {
|
|
24985
24998
|
return choices.map((choice) => {
|
|
24986
24999
|
if (Separator.isSeparator(choice))
|
|
@@ -25017,8 +25030,8 @@ var dist_default6 = createPrompt((config, done) => {
|
|
|
25017
25030
|
const searchEnabled = !keybindings.includes("vim");
|
|
25018
25031
|
const items = useMemo(() => normalizeChoices(config.choices), [config.choices]);
|
|
25019
25032
|
const bounds = useMemo(() => {
|
|
25020
|
-
const first = items.findIndex(
|
|
25021
|
-
const last = items.findLastIndex(
|
|
25033
|
+
const first = items.findIndex(isNavigable);
|
|
25034
|
+
const last = items.findLastIndex(isNavigable);
|
|
25022
25035
|
if (first === -1) {
|
|
25023
25036
|
throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");
|
|
25024
25037
|
}
|
|
@@ -25031,11 +25044,19 @@ var dist_default6 = createPrompt((config, done) => {
|
|
|
25031
25044
|
}, [config.default, items]);
|
|
25032
25045
|
const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
|
|
25033
25046
|
const selectedChoice = items[active];
|
|
25047
|
+
const [errorMsg, setError] = useState();
|
|
25034
25048
|
useKeypress((key, rl) => {
|
|
25035
25049
|
clearTimeout(searchTimeoutRef.current);
|
|
25050
|
+
if (errorMsg) {
|
|
25051
|
+
setError(undefined);
|
|
25052
|
+
}
|
|
25036
25053
|
if (isEnterKey(key)) {
|
|
25037
|
-
|
|
25038
|
-
|
|
25054
|
+
if (selectedChoice.disabled) {
|
|
25055
|
+
setError(theme.i18n.disabledError);
|
|
25056
|
+
} else {
|
|
25057
|
+
setStatus("done");
|
|
25058
|
+
done(selectedChoice.value);
|
|
25059
|
+
}
|
|
25039
25060
|
} else if (isUpKey(key, keybindings) || isDownKey(key, keybindings)) {
|
|
25040
25061
|
rl.clearLine(0);
|
|
25041
25062
|
if (loop || isUpKey(key, keybindings) && active !== bounds.first || isDownKey(key, keybindings) && active !== bounds.last) {
|
|
@@ -25043,7 +25064,7 @@ var dist_default6 = createPrompt((config, done) => {
|
|
|
25043
25064
|
let next = active;
|
|
25044
25065
|
do {
|
|
25045
25066
|
next = (next + offset + items.length) % items.length;
|
|
25046
|
-
} while (!
|
|
25067
|
+
} while (!isNavigable(items[next]));
|
|
25047
25068
|
setActive(next);
|
|
25048
25069
|
}
|
|
25049
25070
|
} else if (isNumberKey(key) && !Number.isNaN(Number(rl.line))) {
|
|
@@ -25096,13 +25117,14 @@ var dist_default6 = createPrompt((config, done) => {
|
|
|
25096
25117
|
separatorCount++;
|
|
25097
25118
|
return ` ${item.separator}`;
|
|
25098
25119
|
}
|
|
25120
|
+
const cursor = isActive ? theme.icon.cursor : " ";
|
|
25099
25121
|
const indexLabel = theme.indexMode === "number" ? `${index + 1 - separatorCount}. ` : "";
|
|
25100
25122
|
if (item.disabled) {
|
|
25101
25123
|
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
|
|
25102
|
-
|
|
25124
|
+
const disabledCursor = isActive ? theme.icon.cursor : "-";
|
|
25125
|
+
return theme.style.disabled(`${disabledCursor} ${indexLabel}${item.name} ${disabledLabel}`);
|
|
25103
25126
|
}
|
|
25104
25127
|
const color = isActive ? theme.style.highlight : (x) => x;
|
|
25105
|
-
const cursor = isActive ? theme.icon.cursor : ` `;
|
|
25106
25128
|
return color(`${cursor} ${indexLabel}${item.name}`);
|
|
25107
25129
|
},
|
|
25108
25130
|
pageSize,
|
|
@@ -25117,6 +25139,7 @@ var dist_default6 = createPrompt((config, done) => {
|
|
|
25117
25139
|
page,
|
|
25118
25140
|
" ",
|
|
25119
25141
|
description ? theme.style.description(description) : "",
|
|
25142
|
+
errorMsg ? theme.style.error(errorMsg) : "",
|
|
25120
25143
|
helpLine
|
|
25121
25144
|
].filter(Boolean).join(`
|
|
25122
25145
|
`).trimEnd();
|
|
@@ -25727,7 +25750,7 @@ class BaseQuery {
|
|
|
25727
25750
|
}
|
|
25728
25751
|
}
|
|
25729
25752
|
|
|
25730
|
-
// node_modules/.pnpm/@kevisual+api@0.0.
|
|
25753
|
+
// node_modules/.pnpm/@kevisual+api@0.0.59_@types+react@19.2.10_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/login-cache.ts
|
|
25731
25754
|
class LoginCacheStore {
|
|
25732
25755
|
cache;
|
|
25733
25756
|
name;
|
|
@@ -26303,7 +26326,7 @@ class BaseLoad3 {
|
|
|
26303
26326
|
}
|
|
26304
26327
|
}
|
|
26305
26328
|
|
|
26306
|
-
// node_modules/.pnpm/@kevisual+api@0.0.
|
|
26329
|
+
// node_modules/.pnpm/@kevisual+api@0.0.59_@types+react@19.2.10_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/query-login.ts
|
|
26307
26330
|
class QueryLogin extends BaseQuery {
|
|
26308
26331
|
cacheStore;
|
|
26309
26332
|
isBrowser;
|
|
@@ -26427,18 +26450,26 @@ class QueryLogin extends BaseQuery {
|
|
|
26427
26450
|
message: "登录失败"
|
|
26428
26451
|
};
|
|
26429
26452
|
}
|
|
26430
|
-
async refreshLoginUser(
|
|
26431
|
-
const res = await this.queryRefreshToken(
|
|
26453
|
+
async refreshLoginUser(opts) {
|
|
26454
|
+
const res = await this.queryRefreshToken(opts);
|
|
26432
26455
|
if (res.code === 200) {
|
|
26433
|
-
const { accessToken, refreshToken
|
|
26456
|
+
const { accessToken, refreshToken, accessTokenExpiresIn } = res?.data || {};
|
|
26434
26457
|
this.storage.setItem("token", accessToken || "");
|
|
26435
|
-
await this.beforeSetLoginUser({ accessToken, refreshToken
|
|
26458
|
+
await this.beforeSetLoginUser({ accessToken, refreshToken, accessTokenExpiresIn, check401: false });
|
|
26436
26459
|
}
|
|
26437
26460
|
return res;
|
|
26438
26461
|
}
|
|
26439
|
-
async queryRefreshToken(
|
|
26462
|
+
async queryRefreshToken(opts) {
|
|
26463
|
+
const refreshToken = opts?.refreshToken;
|
|
26464
|
+
let accessToken = opts?.accessToken;
|
|
26440
26465
|
const _refreshToken = refreshToken || await this.cacheStore.getRefreshToken();
|
|
26441
|
-
let data = {
|
|
26466
|
+
let data = {};
|
|
26467
|
+
if (accessToken) {
|
|
26468
|
+
data.accessToken = accessToken;
|
|
26469
|
+
}
|
|
26470
|
+
if (_refreshToken) {
|
|
26471
|
+
data.refreshToken = _refreshToken;
|
|
26472
|
+
}
|
|
26442
26473
|
if (!_refreshToken) {
|
|
26443
26474
|
await this.cacheStore.clearCurrentUser();
|
|
26444
26475
|
return {
|
|
@@ -26458,7 +26489,7 @@ class QueryLogin extends BaseQuery {
|
|
|
26458
26489
|
if (response?.code === 401) {
|
|
26459
26490
|
const hasRefreshToken = await that.cacheStore.getRefreshToken();
|
|
26460
26491
|
if (hasRefreshToken) {
|
|
26461
|
-
const res = await that.queryRefreshToken(hasRefreshToken);
|
|
26492
|
+
const res = await that.queryRefreshToken({ refreshToken: hasRefreshToken });
|
|
26462
26493
|
if (res.code === 200) {
|
|
26463
26494
|
const { accessToken, refreshToken, accessTokenExpiresIn } = res?.data || {};
|
|
26464
26495
|
that.storage.setItem("token", accessToken || "");
|
|
@@ -26686,7 +26717,7 @@ class QueryLogin extends BaseQuery {
|
|
|
26686
26717
|
}
|
|
26687
26718
|
}
|
|
26688
26719
|
|
|
26689
|
-
// node_modules/.pnpm/@kevisual+api@0.0.
|
|
26720
|
+
// node_modules/.pnpm/@kevisual+api@0.0.59_@types+react@19.2.10_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/login-node-cache.ts
|
|
26690
26721
|
import { homedir } from "node:os";
|
|
26691
26722
|
import { join, dirname } from "node:path";
|
|
26692
26723
|
import fs4 from "node:fs";
|
|
@@ -26830,7 +26861,7 @@ class LoginNodeCache {
|
|
|
26830
26861
|
}
|
|
26831
26862
|
}
|
|
26832
26863
|
|
|
26833
|
-
// node_modules/.pnpm/@kevisual+api@0.0.
|
|
26864
|
+
// node_modules/.pnpm/@kevisual+api@0.0.59_@types+react@19.2.10_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/query-login-node.ts
|
|
26834
26865
|
var cache = new LoginNodeCache;
|
|
26835
26866
|
|
|
26836
26867
|
class QueryLoginNode extends QueryLogin {
|
|
@@ -29892,7 +29923,13 @@ var checkAuth = (value = "", baseURL3 = "") => {
|
|
|
29892
29923
|
}
|
|
29893
29924
|
return false;
|
|
29894
29925
|
};
|
|
29895
|
-
var DEFAULT_IGNORE = [
|
|
29926
|
+
var DEFAULT_IGNORE = [
|
|
29927
|
+
"node_modules/**",
|
|
29928
|
+
".git/**",
|
|
29929
|
+
".next/**",
|
|
29930
|
+
".astro/**",
|
|
29931
|
+
".pack-dist/**"
|
|
29932
|
+
];
|
|
29896
29933
|
|
|
29897
29934
|
class SyncBase {
|
|
29898
29935
|
config;
|
|
@@ -30537,7 +30574,7 @@ var download = new Command("download").option("-d --dir <dir>", "配置目录").
|
|
|
30537
30574
|
command8.addCommand(download);
|
|
30538
30575
|
program.addCommand(command8);
|
|
30539
30576
|
|
|
30540
|
-
// node_modules/.pnpm/@kevisual+api@0.0.
|
|
30577
|
+
// node_modules/.pnpm/@kevisual+api@0.0.59_@types+react@19.2.10_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/dist/query-config.js
|
|
30541
30578
|
var isTextForContentType3 = (contentType) => {
|
|
30542
30579
|
if (!contentType)
|
|
30543
30580
|
return false;
|
|
@@ -30973,7 +31010,7 @@ command9.addCommand(updateCommand);
|
|
|
30973
31010
|
command9.addCommand(deleteCommand);
|
|
30974
31011
|
program.addCommand(command9);
|
|
30975
31012
|
|
|
30976
|
-
// node_modules/.pnpm/@kevisual+api@0.0.
|
|
31013
|
+
// node_modules/.pnpm/@kevisual+api@0.0.59_@types+react@19.2.10_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/dist/query-secret.js
|
|
30977
31014
|
var isTextForContentType4 = (contentType) => {
|
|
30978
31015
|
if (!contentType)
|
|
30979
31016
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kevisual/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "envision 命令行工具",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"basename": "/root/cli",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
],
|
|
42
42
|
"author": "abearxiong",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@inquirer/prompts": "^8.
|
|
44
|
+
"@inquirer/prompts": "^8.3.0",
|
|
45
45
|
"@kevisual/app": "^0.0.2",
|
|
46
46
|
"@kevisual/auth": "^2.0.3",
|
|
47
47
|
"@kevisual/context": "^0.0.8",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"unstorage": "^1.17.4"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@kevisual/api": "^0.0.
|
|
62
|
+
"@kevisual/api": "^0.0.59",
|
|
63
63
|
"@kevisual/cnb": "^0.0.28",
|
|
64
64
|
"@kevisual/dts": "^0.0.4",
|
|
65
65
|
"@kevisual/load": "^0.0.6",
|