@kevisual/cli 0.0.99 → 0.1.1
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 +27076 -6679
- package/dist/assistant-server.js +25660 -4512
- package/dist/assistant.js +16455 -6205
- package/dist/envision.js +171 -133
- package/package.json +9 -8
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();
|
|
@@ -3140,12 +3140,12 @@ var require_jwa = __commonJS((exports, module) => {
|
|
|
3140
3140
|
};
|
|
3141
3141
|
}
|
|
3142
3142
|
var bufferEqual;
|
|
3143
|
-
var timingSafeEqual = "timingSafeEqual" in crypto2 ? function
|
|
3143
|
+
var timingSafeEqual = "timingSafeEqual" in crypto2 ? function timingSafeEqual(a, b) {
|
|
3144
3144
|
if (a.byteLength !== b.byteLength) {
|
|
3145
3145
|
return false;
|
|
3146
3146
|
}
|
|
3147
3147
|
return crypto2.timingSafeEqual(a, b);
|
|
3148
|
-
} : function
|
|
3148
|
+
} : function timingSafeEqual(a, b) {
|
|
3149
3149
|
if (!bufferEqual) {
|
|
3150
3150
|
bufferEqual = require_buffer_equal_constant_time();
|
|
3151
3151
|
}
|
|
@@ -20416,6 +20416,17 @@ var require_db = __commonJS((exports, module) => {
|
|
|
20416
20416
|
};
|
|
20417
20417
|
});
|
|
20418
20418
|
|
|
20419
|
+
// node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js
|
|
20420
|
+
var require_mime_db = __commonJS((exports, module) => {
|
|
20421
|
+
/*!
|
|
20422
|
+
* mime-db
|
|
20423
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
20424
|
+
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|
20425
|
+
* MIT Licensed
|
|
20426
|
+
*/
|
|
20427
|
+
module.exports = require_db();
|
|
20428
|
+
});
|
|
20429
|
+
|
|
20419
20430
|
// node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js
|
|
20420
20431
|
var require_mime_types = __commonJS((exports) => {
|
|
20421
20432
|
/*!
|
|
@@ -20424,7 +20435,7 @@ var require_mime_types = __commonJS((exports) => {
|
|
|
20424
20435
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
20425
20436
|
* MIT Licensed
|
|
20426
20437
|
*/
|
|
20427
|
-
var db =
|
|
20438
|
+
var db = require_mime_db();
|
|
20428
20439
|
var extname = __require("path").extname;
|
|
20429
20440
|
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
20430
20441
|
var TEXT_TYPE_REGEXP = /^text\//i;
|
|
@@ -20771,7 +20782,7 @@ var require_round = __commonJS((exports, module) => {
|
|
|
20771
20782
|
|
|
20772
20783
|
// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js
|
|
20773
20784
|
var require_isNaN = __commonJS((exports, module) => {
|
|
20774
|
-
module.exports = Number.isNaN || function
|
|
20785
|
+
module.exports = Number.isNaN || function isNaN(a) {
|
|
20775
20786
|
return a !== a;
|
|
20776
20787
|
};
|
|
20777
20788
|
});
|
|
@@ -20905,7 +20916,7 @@ var require_implementation = __commonJS((exports, module) => {
|
|
|
20905
20916
|
var toStr = Object.prototype.toString;
|
|
20906
20917
|
var max = Math.max;
|
|
20907
20918
|
var funcType = "[object Function]";
|
|
20908
|
-
var concatty = function
|
|
20919
|
+
var concatty = function concatty(a, b) {
|
|
20909
20920
|
var arr = [];
|
|
20910
20921
|
for (var i = 0;i < a.length; i += 1) {
|
|
20911
20922
|
arr[i] = a[i];
|
|
@@ -20915,7 +20926,7 @@ var require_implementation = __commonJS((exports, module) => {
|
|
|
20915
20926
|
}
|
|
20916
20927
|
return arr;
|
|
20917
20928
|
};
|
|
20918
|
-
var slicy = function
|
|
20929
|
+
var slicy = function slicy(arrLike, offset) {
|
|
20919
20930
|
var arr = [];
|
|
20920
20931
|
for (var i = offset || 0, j = 0;i < arrLike.length; i += 1, j += 1) {
|
|
20921
20932
|
arr[j] = arrLike[i];
|
|
@@ -20956,7 +20967,7 @@ var require_implementation = __commonJS((exports, module) => {
|
|
|
20956
20967
|
}
|
|
20957
20968
|
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
20958
20969
|
if (target.prototype) {
|
|
20959
|
-
var Empty = function
|
|
20970
|
+
var Empty = function Empty() {};
|
|
20960
20971
|
Empty.prototype = target.prototype;
|
|
20961
20972
|
bound.prototype = new Empty;
|
|
20962
20973
|
Empty.prototype = null;
|
|
@@ -21195,7 +21206,7 @@ var require_get_intrinsic = __commonJS((exports, module) => {
|
|
|
21195
21206
|
}
|
|
21196
21207
|
}
|
|
21197
21208
|
var errorProto;
|
|
21198
|
-
var doEval = function
|
|
21209
|
+
var doEval = function doEval(name) {
|
|
21199
21210
|
var value;
|
|
21200
21211
|
if (name === "%AsyncFunction%") {
|
|
21201
21212
|
value = getEvalledConstructor("async function () {}");
|
|
@@ -21204,12 +21215,12 @@ var require_get_intrinsic = __commonJS((exports, module) => {
|
|
|
21204
21215
|
} else if (name === "%AsyncGeneratorFunction%") {
|
|
21205
21216
|
value = getEvalledConstructor("async function* () {}");
|
|
21206
21217
|
} else if (name === "%AsyncGenerator%") {
|
|
21207
|
-
var fn =
|
|
21218
|
+
var fn = doEval("%AsyncGeneratorFunction%");
|
|
21208
21219
|
if (fn) {
|
|
21209
21220
|
value = fn.prototype;
|
|
21210
21221
|
}
|
|
21211
21222
|
} else if (name === "%AsyncIteratorPrototype%") {
|
|
21212
|
-
var gen =
|
|
21223
|
+
var gen = doEval("%AsyncGenerator%");
|
|
21213
21224
|
if (gen && getProto) {
|
|
21214
21225
|
value = getProto(gen.prototype);
|
|
21215
21226
|
}
|
|
@@ -21280,7 +21291,7 @@ var require_get_intrinsic = __commonJS((exports, module) => {
|
|
|
21280
21291
|
var $exec = bind.call($call, RegExp.prototype.exec);
|
|
21281
21292
|
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
21282
21293
|
var reEscapeChar = /\\(\\)?/g;
|
|
21283
|
-
var stringToPath = function
|
|
21294
|
+
var stringToPath = function stringToPath(string) {
|
|
21284
21295
|
var first = $strSlice(string, 0, 1);
|
|
21285
21296
|
var last = $strSlice(string, -1);
|
|
21286
21297
|
if (first === "%" && last !== "%") {
|
|
@@ -21294,7 +21305,7 @@ var require_get_intrinsic = __commonJS((exports, module) => {
|
|
|
21294
21305
|
});
|
|
21295
21306
|
return result;
|
|
21296
21307
|
};
|
|
21297
|
-
var getBaseIntrinsic = function
|
|
21308
|
+
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
21298
21309
|
var intrinsicName = name;
|
|
21299
21310
|
var alias;
|
|
21300
21311
|
if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
|
|
@@ -21742,7 +21753,7 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
21742
21753
|
module.exports = FormData;
|
|
21743
21754
|
});
|
|
21744
21755
|
|
|
21745
|
-
// node_modules/.pnpm/commander@14.0.
|
|
21756
|
+
// node_modules/.pnpm/commander@14.0.3/node_modules/commander/esm.mjs
|
|
21746
21757
|
var import__ = __toESM(require_commander(), 1);
|
|
21747
21758
|
var {
|
|
21748
21759
|
program,
|
|
@@ -22316,8 +22327,8 @@ InitEnv.init();
|
|
|
22316
22327
|
var version = useContextKey("version", () => {
|
|
22317
22328
|
let version2 = "0.0.64";
|
|
22318
22329
|
try {
|
|
22319
|
-
if ("0.
|
|
22320
|
-
version2 = "0.
|
|
22330
|
+
if ("0.1.1")
|
|
22331
|
+
version2 = "0.1.1";
|
|
22321
22332
|
} catch (e) {}
|
|
22322
22333
|
return version2;
|
|
22323
22334
|
});
|
|
@@ -22333,7 +22344,7 @@ import os from "os";
|
|
|
22333
22344
|
import path2 from "path";
|
|
22334
22345
|
import fs3 from "fs";
|
|
22335
22346
|
|
|
22336
|
-
// node_modules/.pnpm/@kevisual+use-config@1.0.
|
|
22347
|
+
// node_modules/.pnpm/@kevisual+use-config@1.0.30_dotenv@17.2.3/node_modules/@kevisual/use-config/dist/app.js
|
|
22337
22348
|
import { createRequire as createRequire2 } from "node:module";
|
|
22338
22349
|
import fs2 from "node:fs";
|
|
22339
22350
|
import path from "node:path";
|
|
@@ -22836,7 +22847,7 @@ var useKey = (key, opts) => {
|
|
|
22836
22847
|
v = process.env[key];
|
|
22837
22848
|
}
|
|
22838
22849
|
if (!v) {
|
|
22839
|
-
return opts?.defaultValue ||
|
|
22850
|
+
return opts?.defaultValue || "";
|
|
22840
22851
|
}
|
|
22841
22852
|
if (opts?.isNumber && typeof v === "string") {
|
|
22842
22853
|
return Number(v);
|
|
@@ -23434,14 +23445,14 @@ var getEnvToken = () => {
|
|
|
23434
23445
|
return envTokne;
|
|
23435
23446
|
};
|
|
23436
23447
|
|
|
23437
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23448
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/key.js
|
|
23438
23449
|
var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
|
|
23439
23450
|
var isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
|
|
23440
23451
|
var isBackspaceKey = (key) => key.name === "backspace";
|
|
23441
23452
|
var isTabKey = (key) => key.name === "tab";
|
|
23442
23453
|
var isNumberKey = (key) => "1234567890".includes(key.name);
|
|
23443
23454
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
23444
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23455
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/errors.js
|
|
23445
23456
|
class AbortPromptError extends Error {
|
|
23446
23457
|
name = "AbortPromptError";
|
|
23447
23458
|
message = "Prompt was aborted";
|
|
@@ -23467,10 +23478,10 @@ class HookError extends Error {
|
|
|
23467
23478
|
class ValidationError extends Error {
|
|
23468
23479
|
name = "ValidationError";
|
|
23469
23480
|
}
|
|
23470
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23481
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
23471
23482
|
import { AsyncResource as AsyncResource2 } from "node:async_hooks";
|
|
23472
23483
|
|
|
23473
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23484
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
23474
23485
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
23475
23486
|
var hookStorage = new AsyncLocalStorage;
|
|
23476
23487
|
function createStore(rl) {
|
|
@@ -23575,10 +23586,10 @@ var effectScheduler = {
|
|
|
23575
23586
|
}
|
|
23576
23587
|
};
|
|
23577
23588
|
|
|
23578
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23589
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
23579
23590
|
function useState(defaultValue) {
|
|
23580
23591
|
return withPointer((pointer) => {
|
|
23581
|
-
const setState = AsyncResource2.bind(function
|
|
23592
|
+
const setState = AsyncResource2.bind(function setState(newValue) {
|
|
23582
23593
|
if (pointer.get() !== newValue) {
|
|
23583
23594
|
pointer.set(newValue);
|
|
23584
23595
|
handleChange();
|
|
@@ -23593,7 +23604,7 @@ function useState(defaultValue) {
|
|
|
23593
23604
|
});
|
|
23594
23605
|
}
|
|
23595
23606
|
|
|
23596
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23607
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
23597
23608
|
function useEffect(cb, depArray) {
|
|
23598
23609
|
withPointer((pointer) => {
|
|
23599
23610
|
const oldDeps = pointer.get();
|
|
@@ -23605,7 +23616,7 @@ function useEffect(cb, depArray) {
|
|
|
23605
23616
|
});
|
|
23606
23617
|
}
|
|
23607
23618
|
|
|
23608
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23619
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/theme.js
|
|
23609
23620
|
import { styleText } from "node:util";
|
|
23610
23621
|
|
|
23611
23622
|
// node_modules/.pnpm/@inquirer+figures@2.0.3/node_modules/@inquirer/figures/dist/index.js
|
|
@@ -23897,7 +23908,7 @@ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
|
23897
23908
|
var dist_default = figures;
|
|
23898
23909
|
var replacements = Object.entries(specialMainSymbols);
|
|
23899
23910
|
|
|
23900
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23911
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/theme.js
|
|
23901
23912
|
var defaultTheme = {
|
|
23902
23913
|
prefix: {
|
|
23903
23914
|
idle: styleText("blue", "?"),
|
|
@@ -23918,7 +23929,7 @@ var defaultTheme = {
|
|
|
23918
23929
|
}
|
|
23919
23930
|
};
|
|
23920
23931
|
|
|
23921
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23932
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
23922
23933
|
function isPlainObject(value) {
|
|
23923
23934
|
if (typeof value !== "object" || value === null)
|
|
23924
23935
|
return false;
|
|
@@ -23946,7 +23957,7 @@ function makeTheme(...themes) {
|
|
|
23946
23957
|
return deepMerge(...themesToMerge);
|
|
23947
23958
|
}
|
|
23948
23959
|
|
|
23949
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23960
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
23950
23961
|
function usePrefix({ status = "idle", theme }) {
|
|
23951
23962
|
const [showLoader, setShowLoader] = useState(false);
|
|
23952
23963
|
const [tick, setTick] = useState(0);
|
|
@@ -23976,7 +23987,7 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
23976
23987
|
const iconName = status === "loading" ? "idle" : status;
|
|
23977
23988
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
23978
23989
|
}
|
|
23979
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
23990
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
23980
23991
|
function useMemo(fn, dependencies) {
|
|
23981
23992
|
return withPointer((pointer) => {
|
|
23982
23993
|
const prev = pointer.get();
|
|
@@ -23988,11 +23999,11 @@ function useMemo(fn, dependencies) {
|
|
|
23988
23999
|
return prev.value;
|
|
23989
24000
|
});
|
|
23990
24001
|
}
|
|
23991
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24002
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
23992
24003
|
function useRef(val) {
|
|
23993
24004
|
return useState({ current: val })[0];
|
|
23994
24005
|
}
|
|
23995
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24006
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
23996
24007
|
function useKeypress(userHandler) {
|
|
23997
24008
|
const signal = useRef(userHandler);
|
|
23998
24009
|
signal.current = userHandler;
|
|
@@ -24010,7 +24021,7 @@ function useKeypress(userHandler) {
|
|
|
24010
24021
|
};
|
|
24011
24022
|
}, []);
|
|
24012
24023
|
}
|
|
24013
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24024
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/utils.js
|
|
24014
24025
|
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
24015
24026
|
|
|
24016
24027
|
// node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
|
|
@@ -24444,7 +24455,7 @@ function wrapAnsi(string, columns, options) {
|
|
|
24444
24455
|
`);
|
|
24445
24456
|
}
|
|
24446
24457
|
|
|
24447
|
-
// 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/utils.js
|
|
24448
24459
|
function breakLines(content, width) {
|
|
24449
24460
|
return content.split(`
|
|
24450
24461
|
`).flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split(`
|
|
@@ -24455,7 +24466,7 @@ function readlineWidth() {
|
|
|
24455
24466
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
|
24456
24467
|
}
|
|
24457
24468
|
|
|
24458
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24469
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
24459
24470
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
24460
24471
|
const state = useRef({
|
|
24461
24472
|
lastPointer: active,
|
|
@@ -24521,7 +24532,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
24521
24532
|
return pageBuffer.filter((line) => typeof line === "string").join(`
|
|
24522
24533
|
`);
|
|
24523
24534
|
}
|
|
24524
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24535
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
24525
24536
|
var import_mute_stream = __toESM(require_lib(), 1);
|
|
24526
24537
|
import * as readline2 from "node:readline";
|
|
24527
24538
|
import { AsyncResource as AsyncResource3 } from "node:async_hooks";
|
|
@@ -24734,7 +24745,7 @@ var {
|
|
|
24734
24745
|
unload
|
|
24735
24746
|
} = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback);
|
|
24736
24747
|
|
|
24737
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24748
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
24738
24749
|
import { stripVTControlCharacters } from "node:util";
|
|
24739
24750
|
|
|
24740
24751
|
// node_modules/.pnpm/@inquirer+ansi@2.0.3/node_modules/@inquirer/ansi/dist/index.js
|
|
@@ -24753,7 +24764,7 @@ var cursorTo = (x, y) => {
|
|
|
24753
24764
|
var eraseLine = ESC + "2K";
|
|
24754
24765
|
var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
|
|
24755
24766
|
|
|
24756
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24767
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
24757
24768
|
var height = (content) => content.split(`
|
|
24758
24769
|
`).length;
|
|
24759
24770
|
var lastLine = (content) => content.split(`
|
|
@@ -24818,7 +24829,7 @@ class ScreenManager {
|
|
|
24818
24829
|
}
|
|
24819
24830
|
}
|
|
24820
24831
|
|
|
24821
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24832
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
24822
24833
|
class PromisePolyfill extends Promise {
|
|
24823
24834
|
static withResolver() {
|
|
24824
24835
|
let resolve;
|
|
@@ -24831,7 +24842,7 @@ class PromisePolyfill extends Promise {
|
|
|
24831
24842
|
}
|
|
24832
24843
|
}
|
|
24833
24844
|
|
|
24834
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24845
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
24835
24846
|
function getCallSites() {
|
|
24836
24847
|
const _prepareStackTrace = Error.prepareStackTrace;
|
|
24837
24848
|
let result = [];
|
|
@@ -24917,7 +24928,7 @@ function createPrompt(view) {
|
|
|
24917
24928
|
};
|
|
24918
24929
|
return prompt;
|
|
24919
24930
|
}
|
|
24920
|
-
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.
|
|
24931
|
+
// node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.2.0/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
24921
24932
|
import { styleText as styleText2 } from "node:util";
|
|
24922
24933
|
class Separator {
|
|
24923
24934
|
separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
|
|
@@ -24931,7 +24942,7 @@ class Separator {
|
|
|
24931
24942
|
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
24932
24943
|
}
|
|
24933
24944
|
}
|
|
24934
|
-
// node_modules/.pnpm/@inquirer+confirm@6.0.4_@types+node@25.
|
|
24945
|
+
// node_modules/.pnpm/@inquirer+confirm@6.0.4_@types+node@25.2.0/node_modules/@inquirer/confirm/dist/index.js
|
|
24935
24946
|
function getBooleanValue(value, defaultValue) {
|
|
24936
24947
|
let answer = defaultValue !== false;
|
|
24937
24948
|
if (/^(y|yes)/i.test(value))
|
|
@@ -24976,7 +24987,7 @@ var dist_default2 = createPrompt((config, done) => {
|
|
|
24976
24987
|
const message = theme.style.message(config.message, status);
|
|
24977
24988
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
|
24978
24989
|
});
|
|
24979
|
-
// node_modules/.pnpm/@inquirer+input@5.0.4_@types+node@25.
|
|
24990
|
+
// node_modules/.pnpm/@inquirer+input@5.0.4_@types+node@25.2.0/node_modules/@inquirer/input/dist/index.js
|
|
24980
24991
|
var inputTheme = {
|
|
24981
24992
|
validationFailureMode: "keep"
|
|
24982
24993
|
};
|
|
@@ -25060,7 +25071,7 @@ var dist_default3 = createPrompt((config, done) => {
|
|
|
25060
25071
|
error
|
|
25061
25072
|
];
|
|
25062
25073
|
});
|
|
25063
|
-
// node_modules/.pnpm/@inquirer+select@5.0.4_@types+node@25.
|
|
25074
|
+
// node_modules/.pnpm/@inquirer+select@5.0.4_@types+node@25.2.0/node_modules/@inquirer/select/dist/index.js
|
|
25064
25075
|
import { styleText as styleText3 } from "node:util";
|
|
25065
25076
|
var selectTheme = {
|
|
25066
25077
|
icon: { cursor: dist_default.pointer },
|
|
@@ -25220,7 +25231,7 @@ var dist_default4 = createPrompt((config, done) => {
|
|
|
25220
25231
|
var import_md5 = __toESM(require_md5(), 1);
|
|
25221
25232
|
var import_jsonwebtoken = __toESM(require_jsonwebtoken(), 1);
|
|
25222
25233
|
|
|
25223
|
-
// node_modules/.pnpm/@kevisual+query@0.0.
|
|
25234
|
+
// node_modules/.pnpm/@kevisual+query@0.0.39/node_modules/@kevisual/query/dist/query.js
|
|
25224
25235
|
var isTextForContentType = (contentType) => {
|
|
25225
25236
|
if (!contentType)
|
|
25226
25237
|
return false;
|
|
@@ -25252,11 +25263,15 @@ var adapter = async (opts = {}, overloadOpts) => {
|
|
|
25252
25263
|
url = new URL(opts.url, origin);
|
|
25253
25264
|
}
|
|
25254
25265
|
const isGet = method === "GET";
|
|
25266
|
+
const oldSearchParams = url.searchParams;
|
|
25255
25267
|
if (isGet) {
|
|
25256
|
-
let searchParams = new URLSearchParams(opts.body);
|
|
25268
|
+
let searchParams = new URLSearchParams({ ...Object.fromEntries(oldSearchParams), ...opts.body });
|
|
25257
25269
|
url.search = searchParams.toString();
|
|
25258
25270
|
} else {
|
|
25259
|
-
const params =
|
|
25271
|
+
const params = {
|
|
25272
|
+
...Object.fromEntries(oldSearchParams),
|
|
25273
|
+
...opts.params
|
|
25274
|
+
};
|
|
25260
25275
|
const searchParams = new URLSearchParams(params);
|
|
25261
25276
|
if (typeof opts.body === "object" && opts.body !== null) {
|
|
25262
25277
|
let body2 = opts.body || {};
|
|
@@ -25482,7 +25497,7 @@ class Query {
|
|
|
25482
25497
|
}
|
|
25483
25498
|
}
|
|
25484
25499
|
|
|
25485
|
-
// node_modules/.pnpm/@kevisual+query@0.0.
|
|
25500
|
+
// node_modules/.pnpm/@kevisual+query@0.0.39/node_modules/@kevisual/query/dist/query-browser.js
|
|
25486
25501
|
var isTextForContentType2 = (contentType) => {
|
|
25487
25502
|
if (!contentType)
|
|
25488
25503
|
return false;
|
|
@@ -25514,11 +25529,15 @@ var adapter2 = async (opts = {}, overloadOpts) => {
|
|
|
25514
25529
|
url = new URL(opts.url, origin);
|
|
25515
25530
|
}
|
|
25516
25531
|
const isGet = method === "GET";
|
|
25532
|
+
const oldSearchParams = url.searchParams;
|
|
25517
25533
|
if (isGet) {
|
|
25518
|
-
let searchParams = new URLSearchParams(opts.body);
|
|
25534
|
+
let searchParams = new URLSearchParams({ ...Object.fromEntries(oldSearchParams), ...opts.body });
|
|
25519
25535
|
url.search = searchParams.toString();
|
|
25520
25536
|
} else {
|
|
25521
|
-
const params =
|
|
25537
|
+
const params = {
|
|
25538
|
+
...Object.fromEntries(oldSearchParams),
|
|
25539
|
+
...opts.params
|
|
25540
|
+
};
|
|
25522
25541
|
const searchParams = new URLSearchParams(params);
|
|
25523
25542
|
if (typeof opts.body === "object" && opts.body !== null) {
|
|
25524
25543
|
let body2 = opts.body || {};
|
|
@@ -25760,7 +25779,7 @@ class BaseQuery {
|
|
|
25760
25779
|
}
|
|
25761
25780
|
}
|
|
25762
25781
|
|
|
25763
|
-
// node_modules/.pnpm/@kevisual+query-login@0.0.7_@kevisual+query@0.0.
|
|
25782
|
+
// 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
25783
|
import { homedir } from "os";
|
|
25765
25784
|
import { join, dirname } from "path";
|
|
25766
25785
|
import fs4 from "fs";
|
|
@@ -27364,6 +27383,22 @@ var loginCommand = new Command("login").description("Login to the application").
|
|
|
27364
27383
|
}
|
|
27365
27384
|
});
|
|
27366
27385
|
program.addCommand(loginCommand);
|
|
27386
|
+
var getUsername = async () => {
|
|
27387
|
+
const token = getEnvToken();
|
|
27388
|
+
const localToken = storage.getItem("token");
|
|
27389
|
+
if (!token && !localToken) {
|
|
27390
|
+
console.log("请先登录");
|
|
27391
|
+
return null;
|
|
27392
|
+
}
|
|
27393
|
+
let me = await queryLogin.getMe(localToken || token);
|
|
27394
|
+
if (me?.code === 401) {
|
|
27395
|
+
me = await queryLogin.getMe();
|
|
27396
|
+
}
|
|
27397
|
+
if (me?.code === 200) {
|
|
27398
|
+
return me.data?.username;
|
|
27399
|
+
}
|
|
27400
|
+
return null;
|
|
27401
|
+
};
|
|
27367
27402
|
var showMe = async (show = true) => {
|
|
27368
27403
|
const token = getEnvToken();
|
|
27369
27404
|
const localToken = storage.getItem("token");
|
|
@@ -28373,10 +28408,9 @@ var getPackageJson = (opts) => {
|
|
|
28373
28408
|
return null;
|
|
28374
28409
|
}
|
|
28375
28410
|
};
|
|
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("-
|
|
28411
|
+
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
28412
|
try {
|
|
28378
28413
|
let { version: version2, key, yes, update, org, showBackend } = options;
|
|
28379
|
-
const noCheck = !options.noCheck;
|
|
28380
28414
|
const dot = !!options.dot;
|
|
28381
28415
|
const pkgInfo = getPackageJson({ version: version2, appKey: key });
|
|
28382
28416
|
if (!version2 && pkgInfo?.version) {
|
|
@@ -28431,18 +28465,30 @@ var command2 = new Command("deploy").description("把前端文件传到服务器
|
|
|
28431
28465
|
return;
|
|
28432
28466
|
}
|
|
28433
28467
|
}
|
|
28468
|
+
let username = "";
|
|
28469
|
+
if (pkgInfo?.user) {
|
|
28470
|
+
username = pkgInfo.user;
|
|
28471
|
+
} else if (org) {
|
|
28472
|
+
username = org;
|
|
28473
|
+
} else {
|
|
28474
|
+
const me = await getUsername();
|
|
28475
|
+
if (me) {
|
|
28476
|
+
username = me;
|
|
28477
|
+
} else {
|
|
28478
|
+
logger.error("无法获取用户名,请使用先登录");
|
|
28479
|
+
return;
|
|
28480
|
+
}
|
|
28481
|
+
}
|
|
28434
28482
|
const uploadDirectory = isDirectory ? directory : path3.dirname(directory);
|
|
28435
|
-
const res = await
|
|
28483
|
+
const res = await uploadFilesV2(_relativeFiles, uploadDirectory, { key, version: version2, username, directory: options.directory });
|
|
28436
28484
|
logger.debug("upload res", res);
|
|
28437
28485
|
if (res?.code === 200) {
|
|
28438
|
-
res.data?.upload?.map?.((d) => {
|
|
28439
|
-
console.log(source_default.green("uploaded file", d?.name, d?.path));
|
|
28440
|
-
});
|
|
28441
28486
|
const res2 = await queryAppVersion({
|
|
28442
28487
|
key,
|
|
28443
|
-
version: version2
|
|
28488
|
+
version: version2,
|
|
28489
|
+
create: true
|
|
28444
28490
|
});
|
|
28445
|
-
logger.debug("queryAppVersion res", res2);
|
|
28491
|
+
logger.debug("queryAppVersion res", res2, key, version2);
|
|
28446
28492
|
if (res2.code !== 200) {
|
|
28447
28493
|
console.error(source_default.red("查询应用版本失败"), res2.message, key);
|
|
28448
28494
|
return;
|
|
@@ -28465,87 +28511,59 @@ var command2 = new Command("deploy").description("把前端文件传到服务器
|
|
|
28465
28511
|
} else {
|
|
28466
28512
|
console.error("File upload failed", res?.message);
|
|
28467
28513
|
}
|
|
28468
|
-
return res;
|
|
28469
28514
|
} catch (error) {
|
|
28470
28515
|
console.error("error", error);
|
|
28471
28516
|
}
|
|
28472
28517
|
});
|
|
28473
|
-
var
|
|
28518
|
+
var uploadFilesV2 = async (files, directory, opts) => {
|
|
28474
28519
|
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) {
|
|
28520
|
+
for (let i = 0;i < files.length; i++) {
|
|
28521
|
+
const file = files[i];
|
|
28522
28522
|
const filePath = path3.join(directory, file);
|
|
28523
|
-
|
|
28524
|
-
|
|
28525
|
-
logger.debug("文件已经上传过了", file);
|
|
28526
|
-
continue;
|
|
28527
|
-
}
|
|
28523
|
+
logger.info("[上传进度]", `${i + 1}/${files.length}`, file);
|
|
28524
|
+
const form = new import_form_data2.default;
|
|
28528
28525
|
const filename = path3.basename(filePath);
|
|
28529
|
-
logger.debug("upload file", file, filename);
|
|
28530
28526
|
const encodedFilename = Buffer.from(filename, "utf-8").toString("binary");
|
|
28531
28527
|
form.append("file", fs6.createReadStream(filePath), {
|
|
28532
28528
|
filename: encodedFilename,
|
|
28533
28529
|
filepath: file
|
|
28534
28530
|
});
|
|
28535
|
-
|
|
28536
|
-
|
|
28537
|
-
|
|
28538
|
-
|
|
28539
|
-
|
|
28540
|
-
|
|
28531
|
+
const _baseURL = getBaseURL();
|
|
28532
|
+
const url = new URL(`/${username}/resources/${key}/${version2}/${file}`, _baseURL);
|
|
28533
|
+
const token2 = await storage.getItem("token");
|
|
28534
|
+
const check = () => {
|
|
28535
|
+
const checkUrl = new URL(url.toString());
|
|
28536
|
+
checkUrl.searchParams.set("stat", "1");
|
|
28537
|
+
const res = query.adapter({ url: checkUrl.toString(), method: "GET", headers: { Authorization: "Bearer " + token2 } });
|
|
28538
|
+
return res;
|
|
28541
28539
|
};
|
|
28540
|
+
const checkRes = await check();
|
|
28541
|
+
let needUpload = false;
|
|
28542
|
+
let hash = "";
|
|
28543
|
+
if (checkRes?.code === 404) {
|
|
28544
|
+
needUpload = true;
|
|
28545
|
+
hash = getHash(filePath);
|
|
28546
|
+
} else if (checkRes?.code === 200) {
|
|
28547
|
+
const etag = checkRes?.data?.etag;
|
|
28548
|
+
hash = getHash(filePath);
|
|
28549
|
+
if (etag !== hash) {
|
|
28550
|
+
needUpload = true;
|
|
28551
|
+
}
|
|
28552
|
+
}
|
|
28553
|
+
if (needUpload) {
|
|
28554
|
+
url.searchParams.append("hash", hash);
|
|
28555
|
+
const res = await upload({ url, form, token: token2 });
|
|
28556
|
+
logger.debug("upload file", file, res);
|
|
28557
|
+
if (res.code !== 200) {
|
|
28558
|
+
logger.error("文件上传失败", file, res);
|
|
28559
|
+
return { code: 500, message: "文件上传失败", file, fileRes: res };
|
|
28560
|
+
}
|
|
28561
|
+
} else {
|
|
28562
|
+
console.log(source_default.green("\t 文件已经上传过了", url.toString()));
|
|
28563
|
+
}
|
|
28564
|
+
continue;
|
|
28542
28565
|
}
|
|
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 });
|
|
28566
|
+
return { code: 200 };
|
|
28549
28567
|
};
|
|
28550
28568
|
program.addCommand(command2);
|
|
28551
28569
|
var deployLoadFn = async (id, org) => {
|
|
@@ -29004,6 +29022,26 @@ var install = new Command("install").option("-n, --noproxy", "no proxy").descrip
|
|
|
29004
29022
|
}
|
|
29005
29023
|
});
|
|
29006
29024
|
command5.addCommand(install);
|
|
29025
|
+
var patch = new Command("patch").description("npm patch 发布补丁版本").action(async () => {
|
|
29026
|
+
const cwd = process.cwd();
|
|
29027
|
+
const packageJson = path5.resolve(cwd, "package.json");
|
|
29028
|
+
if (fileIsExist2(packageJson)) {
|
|
29029
|
+
const pkg = fs9.readFileSync(packageJson, "utf-8");
|
|
29030
|
+
const pkgJson = parseIfJson(pkg);
|
|
29031
|
+
const version2 = pkgJson?.version;
|
|
29032
|
+
if (version2) {
|
|
29033
|
+
const versionArr = String(version2).split(".");
|
|
29034
|
+
if (versionArr.length === 3) {
|
|
29035
|
+
const patchVersion = Number(versionArr[2]) + 1;
|
|
29036
|
+
const newVersion = `${versionArr[0]}.${versionArr[1]}.${patchVersion}`;
|
|
29037
|
+
pkgJson.version = newVersion;
|
|
29038
|
+
fs9.writeFileSync(packageJson, JSON.stringify(pkgJson, null, 2));
|
|
29039
|
+
console.log(chalk2.green(`${pkgJson?.name} 更新到版本: ${newVersion}`));
|
|
29040
|
+
}
|
|
29041
|
+
}
|
|
29042
|
+
}
|
|
29043
|
+
});
|
|
29044
|
+
command5.addCommand(patch);
|
|
29007
29045
|
program.addCommand(command5);
|
|
29008
29046
|
|
|
29009
29047
|
// src/command/publish.ts
|
|
@@ -34697,7 +34735,7 @@ var extractAvailableModels = (config2) => {
|
|
|
34697
34735
|
}
|
|
34698
34736
|
return models;
|
|
34699
34737
|
};
|
|
34700
|
-
var command12 = new Command("
|
|
34738
|
+
var command12 = new Command("ccc").description("切换 opencode 模型,从配置的 provider 中选择").option("-m, --model <model:string>", "选择模型 (格式: provider/model)").action(async (options) => {
|
|
34701
34739
|
const configPath2 = path15.join(os5.homedir(), ".config", "opencode", "opencode.json");
|
|
34702
34740
|
const config2 = readOpencodeConfig(configPath2);
|
|
34703
34741
|
const availableModels = extractAvailableModels(config2);
|