@kevisual/cli 0.1.2 → 0.1.4
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 +900 -1502
- package/dist/assistant-server.js +13807 -14898
- package/dist/assistant.js +479 -531
- package/dist/envision.js +7468 -4470
- package/package.json +12 -14
|
@@ -43,11 +43,11 @@ var __export = (target, all) => {
|
|
|
43
43
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
44
44
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
45
45
|
|
|
46
|
-
// ../node_modules/.pnpm/dotenv@17.
|
|
46
|
+
// ../node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.json
|
|
47
47
|
var require_package = __commonJS((exports, module) => {
|
|
48
48
|
module.exports = {
|
|
49
49
|
name: "dotenv",
|
|
50
|
-
version: "17.
|
|
50
|
+
version: "17.3.1",
|
|
51
51
|
description: "Loads environment variables from .env file",
|
|
52
52
|
main: "lib/main.js",
|
|
53
53
|
types: "lib/main.d.ts",
|
|
@@ -109,7 +109,7 @@ var require_package = __commonJS((exports, module) => {
|
|
|
109
109
|
};
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
-
// ../node_modules/.pnpm/dotenv@17.
|
|
112
|
+
// ../node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.js
|
|
113
113
|
var require_main = __commonJS((exports, module) => {
|
|
114
114
|
var fs2 = __require("fs");
|
|
115
115
|
var path = __require("path");
|
|
@@ -121,12 +121,9 @@ var require_main = __commonJS((exports, module) => {
|
|
|
121
121
|
"\uD83D\uDD10 encrypt with Dotenvx: https://dotenvx.com",
|
|
122
122
|
"\uD83D\uDD10 prevent committing .env to code: https://dotenvx.com/precommit",
|
|
123
123
|
"\uD83D\uDD10 prevent building .env in docker: https://dotenvx.com/prebuild",
|
|
124
|
-
"\
|
|
125
|
-
"
|
|
126
|
-
"\uD83D\
|
|
127
|
-
"✅ audit secrets and track compliance: https://dotenvx.com/ops",
|
|
128
|
-
"\uD83D\uDD04 add secrets lifecycle management: https://dotenvx.com/ops",
|
|
129
|
-
"\uD83D\uDD11 add access controls to secrets: https://dotenvx.com/ops",
|
|
124
|
+
"\uD83E\uDD16 agentic secret storage: https://dotenvx.com/as2",
|
|
125
|
+
"⚡️ secrets for agents: https://dotenvx.com/as2",
|
|
126
|
+
"\uD83D\uDEE1️ auth for agents: https://vestauth.com",
|
|
130
127
|
"\uD83D\uDEE0️ run anywhere with `dotenvx run -- yourcommand`",
|
|
131
128
|
"⚙️ specify custom .env file path with { path: '/custom/path/.env' }",
|
|
132
129
|
"⚙️ enable debug logging with { debug: true }",
|
|
@@ -11435,17 +11432,6 @@ var require_db = __commonJS((exports, module) => {
|
|
|
11435
11432
|
};
|
|
11436
11433
|
});
|
|
11437
11434
|
|
|
11438
|
-
// ../node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/index.js
|
|
11439
|
-
var require_mime_db = __commonJS((exports, module) => {
|
|
11440
|
-
/*!
|
|
11441
|
-
* mime-db
|
|
11442
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
11443
|
-
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|
11444
|
-
* MIT Licensed
|
|
11445
|
-
*/
|
|
11446
|
-
module.exports = require_db();
|
|
11447
|
-
});
|
|
11448
|
-
|
|
11449
11435
|
// ../node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/mimeScore.js
|
|
11450
11436
|
var require_mimeScore = __commonJS((exports, module) => {
|
|
11451
11437
|
var FACET_SCORES = {
|
|
@@ -11490,7 +11476,7 @@ var require_mime_types = __commonJS((exports) => {
|
|
|
11490
11476
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
11491
11477
|
* MIT Licensed
|
|
11492
11478
|
*/
|
|
11493
|
-
var db =
|
|
11479
|
+
var db = require_db();
|
|
11494
11480
|
var extname = __require("path").extname;
|
|
11495
11481
|
var mimeScore = require_mimeScore();
|
|
11496
11482
|
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
@@ -11900,7 +11886,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
11900
11886
|
this._root = opts.root ? resolve(opts.root) : null;
|
|
11901
11887
|
}
|
|
11902
11888
|
util.inherits(SendStream, Stream);
|
|
11903
|
-
SendStream.prototype.error = function
|
|
11889
|
+
SendStream.prototype.error = function error2(status, err) {
|
|
11904
11890
|
if (hasListeners(this, "error")) {
|
|
11905
11891
|
return this.emit("error", createHttpError(status, err));
|
|
11906
11892
|
}
|
|
@@ -12015,7 +12001,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
12015
12001
|
res.setHeader("Location", loc);
|
|
12016
12002
|
res.end(doc);
|
|
12017
12003
|
};
|
|
12018
|
-
SendStream.prototype.pipe = function
|
|
12004
|
+
SendStream.prototype.pipe = function pipe2(res) {
|
|
12019
12005
|
var root = this._root;
|
|
12020
12006
|
this.res = res;
|
|
12021
12007
|
var path5 = decode2(this.path);
|
|
@@ -12069,7 +12055,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
12069
12055
|
this.sendFile(path5);
|
|
12070
12056
|
return res;
|
|
12071
12057
|
};
|
|
12072
|
-
SendStream.prototype.send = function
|
|
12058
|
+
SendStream.prototype.send = function send2(path5, stat) {
|
|
12073
12059
|
var len = stat.size;
|
|
12074
12060
|
var options = this.options;
|
|
12075
12061
|
var opts = {};
|
|
@@ -12191,21 +12177,21 @@ var require_send = __commonJS((exports, module) => {
|
|
|
12191
12177
|
}
|
|
12192
12178
|
next();
|
|
12193
12179
|
};
|
|
12194
|
-
SendStream.prototype.stream = function
|
|
12180
|
+
SendStream.prototype.stream = function stream2(path5, options) {
|
|
12195
12181
|
var self2 = this;
|
|
12196
12182
|
var res = this.res;
|
|
12197
|
-
var
|
|
12198
|
-
this.emit("stream",
|
|
12199
|
-
|
|
12183
|
+
var stream3 = fs5.createReadStream(path5, options);
|
|
12184
|
+
this.emit("stream", stream3);
|
|
12185
|
+
stream3.pipe(res);
|
|
12200
12186
|
function cleanup() {
|
|
12201
|
-
|
|
12187
|
+
stream3.destroy();
|
|
12202
12188
|
}
|
|
12203
12189
|
onFinished(res, cleanup);
|
|
12204
|
-
|
|
12190
|
+
stream3.on("error", function onerror(err) {
|
|
12205
12191
|
cleanup();
|
|
12206
12192
|
self2.onStatError(err);
|
|
12207
12193
|
});
|
|
12208
|
-
|
|
12194
|
+
stream3.on("end", function onend() {
|
|
12209
12195
|
self2.emit("end");
|
|
12210
12196
|
});
|
|
12211
12197
|
};
|
|
@@ -12214,9 +12200,9 @@ var require_send = __commonJS((exports, module) => {
|
|
|
12214
12200
|
if (res.getHeader("Content-Type"))
|
|
12215
12201
|
return;
|
|
12216
12202
|
var ext = extname(path5);
|
|
12217
|
-
var
|
|
12218
|
-
debug("content-type %s",
|
|
12219
|
-
res.setHeader("Content-Type",
|
|
12203
|
+
var type2 = mime.contentType(ext) || "application/octet-stream";
|
|
12204
|
+
debug("content-type %s", type2);
|
|
12205
|
+
res.setHeader("Content-Type", type2);
|
|
12220
12206
|
};
|
|
12221
12207
|
SendStream.prototype.setHeader = function setHeader(path5, stat) {
|
|
12222
12208
|
var res = this.res;
|
|
@@ -12463,7 +12449,7 @@ var require_is_extglob = __commonJS((exports, module) => {
|
|
|
12463
12449
|
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
12464
12450
|
* Licensed under the MIT License.
|
|
12465
12451
|
*/
|
|
12466
|
-
module.exports = function
|
|
12452
|
+
module.exports = function isExtglob2(str) {
|
|
12467
12453
|
if (typeof str !== "string" || str === "") {
|
|
12468
12454
|
return false;
|
|
12469
12455
|
}
|
|
@@ -12597,7 +12583,7 @@ var require_is_glob = __commonJS((exports, module) => {
|
|
|
12597
12583
|
}
|
|
12598
12584
|
return false;
|
|
12599
12585
|
};
|
|
12600
|
-
module.exports = function
|
|
12586
|
+
module.exports = function isGlob2(str, options) {
|
|
12601
12587
|
if (typeof str !== "string" || str === "") {
|
|
12602
12588
|
return false;
|
|
12603
12589
|
}
|
|
@@ -12622,7 +12608,7 @@ var require_glob_parent = __commonJS((exports, module) => {
|
|
|
12622
12608
|
var enclosure = /[\{\[].*[\}\]]$/;
|
|
12623
12609
|
var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
|
|
12624
12610
|
var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
|
|
12625
|
-
module.exports = function
|
|
12611
|
+
module.exports = function globParent2(str, opts) {
|
|
12626
12612
|
var options = Object.assign({ flipBackslashes: true }, opts);
|
|
12627
12613
|
if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
|
|
12628
12614
|
str = str.replace(backslash, slash);
|
|
@@ -17807,13 +17793,6 @@ var require_cli_width = __commonJS((exports, module) => {
|
|
|
17807
17793
|
}
|
|
17808
17794
|
});
|
|
17809
17795
|
|
|
17810
|
-
// ../node_modules/.pnpm/emoji-regex@10.6.0/node_modules/emoji-regex/index.js
|
|
17811
|
-
var require_emoji_regex = __commonJS((exports, module) => {
|
|
17812
|
-
module.exports = () => {
|
|
17813
|
-
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
17814
|
-
};
|
|
17815
|
-
});
|
|
17816
|
-
|
|
17817
17796
|
// ../node_modules/.pnpm/mute-stream@3.0.0/node_modules/mute-stream/lib/index.js
|
|
17818
17797
|
var require_lib = __commonJS((exports, module) => {
|
|
17819
17798
|
var Stream = __require("stream");
|
|
@@ -38888,7 +38867,7 @@ function requireStream() {
|
|
|
38888
38867
|
if (!duplex.push(data))
|
|
38889
38868
|
ws.pause();
|
|
38890
38869
|
});
|
|
38891
|
-
ws.once("error", function
|
|
38870
|
+
ws.once("error", function error2(err) {
|
|
38892
38871
|
if (duplex.destroyed)
|
|
38893
38872
|
return;
|
|
38894
38873
|
terminateOnDestroy = false;
|
|
@@ -38906,7 +38885,7 @@ function requireStream() {
|
|
|
38906
38885
|
return;
|
|
38907
38886
|
}
|
|
38908
38887
|
let called = false;
|
|
38909
|
-
ws.once("error", function
|
|
38888
|
+
ws.once("error", function error2(err2) {
|
|
38910
38889
|
called = true;
|
|
38911
38890
|
callback(err2);
|
|
38912
38891
|
});
|
|
@@ -39915,12 +39894,12 @@ function requireDist() {
|
|
|
39915
39894
|
const { encode: encode2 = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
|
|
39916
39895
|
const data = typeof path === "object" ? path : parse2(path, options);
|
|
39917
39896
|
const fn = tokensToFunction(data.tokens, delimiter, encode2);
|
|
39918
|
-
return function
|
|
39919
|
-
const [
|
|
39897
|
+
return function path2(params = {}) {
|
|
39898
|
+
const [path3, ...missing] = fn(params);
|
|
39920
39899
|
if (missing.length) {
|
|
39921
39900
|
throw new TypeError(`Missing parameters: ${missing.join(", ")}`);
|
|
39922
39901
|
}
|
|
39923
|
-
return
|
|
39902
|
+
return path3;
|
|
39924
39903
|
};
|
|
39925
39904
|
}
|
|
39926
39905
|
function tokensToFunction(tokens, delimiter, encode2) {
|
|
@@ -39986,7 +39965,7 @@ function requireDist() {
|
|
|
39986
39965
|
return decode2;
|
|
39987
39966
|
return (value) => value.split(delimiter).map(decode2);
|
|
39988
39967
|
});
|
|
39989
|
-
return function
|
|
39968
|
+
return function match2(input) {
|
|
39990
39969
|
const m = regexp.exec(input);
|
|
39991
39970
|
if (!m)
|
|
39992
39971
|
return false;
|
|
@@ -40607,14 +40586,15 @@ var parseHomeArg = (homedir2) => {
|
|
|
40607
40586
|
const isOpencode = checkUrl.some((item) => execPath.includes(item));
|
|
40608
40587
|
let isServer = false;
|
|
40609
40588
|
const checkArgs = process.argv.slice(1);
|
|
40610
|
-
const isArgsServer = checkArgs.some((item) => item === "server" || item.includes("asst-server") || item.includes("run-server.ts"));
|
|
40611
40589
|
const isDev = checkArgs.some((item) => item.includes("run-server.ts"));
|
|
40590
|
+
const isPm2 = checkArgs.some((item) => item.includes("pm2"));
|
|
40591
|
+
const isArgsServer = checkArgs.some((item) => item === "server" || item.includes("asst-server") || item.includes("assistant-server") || item.includes("run-server.ts"));
|
|
40612
40592
|
let isDaemon = false;
|
|
40613
|
-
if (isArgsServer) {
|
|
40593
|
+
if (isArgsServer || isPm2) {
|
|
40614
40594
|
if (checkArgs.includes("--daemon") || checkArgs.includes("-d")) {
|
|
40615
40595
|
isDaemon = true;
|
|
40616
40596
|
}
|
|
40617
|
-
if (checkArgs.includes("-s") || checkArgs.includes("--start")) {
|
|
40597
|
+
if (checkArgs.includes("-s") || checkArgs.includes("--start") || isPm2) {
|
|
40618
40598
|
isServer = true;
|
|
40619
40599
|
}
|
|
40620
40600
|
}
|
|
@@ -40634,7 +40614,7 @@ var getFileConfig = (filePath) => {
|
|
|
40634
40614
|
return JSON.parse(fs2.readFileSync(filePath, "utf8"));
|
|
40635
40615
|
};
|
|
40636
40616
|
|
|
40637
|
-
// ../node_modules/.pnpm/@kevisual+use-config@1.0.30_dotenv@17.
|
|
40617
|
+
// ../node_modules/.pnpm/@kevisual+use-config@1.0.30_dotenv@17.3.1/node_modules/@kevisual/use-config/dist/app.js
|
|
40638
40618
|
import { createRequire as createRequire2 } from "node:module";
|
|
40639
40619
|
import fs3 from "node:fs";
|
|
40640
40620
|
import path2 from "node:path";
|
|
@@ -42936,7 +42916,7 @@ function requireIsExtglob() {
|
|
|
42936
42916
|
if (hasRequiredIsExtglob)
|
|
42937
42917
|
return isExtglob;
|
|
42938
42918
|
hasRequiredIsExtglob = 1;
|
|
42939
|
-
isExtglob = function
|
|
42919
|
+
isExtglob = function isExtglob2(str) {
|
|
42940
42920
|
if (typeof str !== "string" || str === "") {
|
|
42941
42921
|
return false;
|
|
42942
42922
|
}
|
|
@@ -43074,7 +43054,7 @@ function requireIsGlob() {
|
|
|
43074
43054
|
}
|
|
43075
43055
|
return false;
|
|
43076
43056
|
};
|
|
43077
|
-
isGlob = function
|
|
43057
|
+
isGlob = function isGlob2(str, options) {
|
|
43078
43058
|
if (typeof str !== "string" || str === "") {
|
|
43079
43059
|
return false;
|
|
43080
43060
|
}
|
|
@@ -43103,7 +43083,7 @@ function requireGlobParent() {
|
|
|
43103
43083
|
var enclosure = /[\{\[].*[\}\]]$/;
|
|
43104
43084
|
var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
|
|
43105
43085
|
var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
|
|
43106
|
-
globParent = function
|
|
43086
|
+
globParent = function globParent2(str, opts) {
|
|
43107
43087
|
var options = Object.assign({ flipBackslashes: true }, opts);
|
|
43108
43088
|
if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
|
|
43109
43089
|
str = str.replace(backslash, slash);
|
|
@@ -49680,6 +49660,14 @@ class RemoteApp {
|
|
|
49680
49660
|
ws;
|
|
49681
49661
|
remoteIsConnected;
|
|
49682
49662
|
isError = false;
|
|
49663
|
+
autoReconnect;
|
|
49664
|
+
maxReconnectAttempts;
|
|
49665
|
+
reconnectDelay;
|
|
49666
|
+
maxReconnectDelay;
|
|
49667
|
+
enableBackoff;
|
|
49668
|
+
reconnectAttempts = 0;
|
|
49669
|
+
reconnectTimer = null;
|
|
49670
|
+
isManuallyClosed = false;
|
|
49683
49671
|
constructor(opts) {
|
|
49684
49672
|
this.mainApp = opts?.app;
|
|
49685
49673
|
const token = opts.token;
|
|
@@ -49693,6 +49681,11 @@ class RemoteApp {
|
|
|
49693
49681
|
_url2.searchParams.set("id", id2);
|
|
49694
49682
|
this.url = _url2.toString();
|
|
49695
49683
|
this.id = id2;
|
|
49684
|
+
this.autoReconnect = opts?.autoReconnect ?? true;
|
|
49685
|
+
this.maxReconnectAttempts = opts?.maxReconnectAttempts ?? Infinity;
|
|
49686
|
+
this.reconnectDelay = opts?.reconnectDelay ?? 1000;
|
|
49687
|
+
this.maxReconnectDelay = opts?.maxReconnectDelay ?? 30000;
|
|
49688
|
+
this.enableBackoff = opts?.enableBackoff ?? true;
|
|
49696
49689
|
this.init();
|
|
49697
49690
|
}
|
|
49698
49691
|
async isConnect() {
|
|
@@ -49700,6 +49693,9 @@ class RemoteApp {
|
|
|
49700
49693
|
if (this.isConnected) {
|
|
49701
49694
|
return true;
|
|
49702
49695
|
}
|
|
49696
|
+
if (this.reconnectTimer !== null) {
|
|
49697
|
+
console.log(`远程应用 ${this.id} 正在重连中...`);
|
|
49698
|
+
}
|
|
49703
49699
|
return new Promise((resolve) => {
|
|
49704
49700
|
const timeout = setTimeout(() => {
|
|
49705
49701
|
resolve(false);
|
|
@@ -49716,6 +49712,9 @@ class RemoteApp {
|
|
|
49716
49712
|
}
|
|
49717
49713
|
getWsURL(url3) {
|
|
49718
49714
|
const { protocol } = new URL(url3);
|
|
49715
|
+
if (protocol.startsWith("ws")) {
|
|
49716
|
+
return url3.toString();
|
|
49717
|
+
}
|
|
49719
49718
|
const wsProtocol = protocol === "https:" ? "wss:" : "ws:";
|
|
49720
49719
|
const wsURL = url3.toString().replace(protocol, wsProtocol);
|
|
49721
49720
|
return wsURL;
|
|
@@ -49736,6 +49735,7 @@ class RemoteApp {
|
|
|
49736
49735
|
ws.onopen = function() {
|
|
49737
49736
|
that.isConnected = true;
|
|
49738
49737
|
that.onOpen();
|
|
49738
|
+
console.log("[remote-app] WebSocket connection opened");
|
|
49739
49739
|
};
|
|
49740
49740
|
ws.onclose = function() {
|
|
49741
49741
|
that.isConnected = false;
|
|
@@ -49750,12 +49750,71 @@ class RemoteApp {
|
|
|
49750
49750
|
this.ws = ws;
|
|
49751
49751
|
}
|
|
49752
49752
|
onOpen() {
|
|
49753
|
+
this.isError = false;
|
|
49754
|
+
this.reconnectAttempts = 0;
|
|
49755
|
+
if (this.reconnectTimer) {
|
|
49756
|
+
clearTimeout(this.reconnectTimer);
|
|
49757
|
+
this.reconnectTimer = null;
|
|
49758
|
+
}
|
|
49753
49759
|
this.emitter.emit("open", this.id);
|
|
49754
49760
|
}
|
|
49755
49761
|
onClose() {
|
|
49756
49762
|
console.log("远程应用关闭:", this.id);
|
|
49757
|
-
this.emitter.emit("close", this.id);
|
|
49758
49763
|
this.isConnected = false;
|
|
49764
|
+
this.emitter.emit("close", this.id);
|
|
49765
|
+
if (this.autoReconnect && !this.isManuallyClosed) {
|
|
49766
|
+
this.scheduleReconnect();
|
|
49767
|
+
}
|
|
49768
|
+
}
|
|
49769
|
+
calculateReconnectDelay() {
|
|
49770
|
+
if (!this.enableBackoff) {
|
|
49771
|
+
return this.reconnectDelay;
|
|
49772
|
+
}
|
|
49773
|
+
const delay = this.reconnectDelay * Math.pow(2, this.reconnectAttempts);
|
|
49774
|
+
return Math.min(delay, this.maxReconnectDelay);
|
|
49775
|
+
}
|
|
49776
|
+
scheduleReconnect() {
|
|
49777
|
+
if (this.reconnectAttempts >= this.maxReconnectAttempts) {
|
|
49778
|
+
console.error(`远程应用 ${this.id} 已达到最大重连次数 ${this.maxReconnectAttempts},停止重连`);
|
|
49779
|
+
this.emitter.emit("maxReconnectAttemptsReached", this.id);
|
|
49780
|
+
return;
|
|
49781
|
+
}
|
|
49782
|
+
if (this.reconnectTimer) {
|
|
49783
|
+
clearTimeout(this.reconnectTimer);
|
|
49784
|
+
}
|
|
49785
|
+
const delay = this.calculateReconnectDelay();
|
|
49786
|
+
this.reconnectAttempts++;
|
|
49787
|
+
console.log(`远程应用 ${this.id} 将在 ${delay}ms 后尝试第 ${this.reconnectAttempts} 次重连`);
|
|
49788
|
+
this.reconnectTimer = setTimeout(() => {
|
|
49789
|
+
this.reconnectTimer = null;
|
|
49790
|
+
try {
|
|
49791
|
+
this.init();
|
|
49792
|
+
} catch (error3) {
|
|
49793
|
+
console.error(`远程应用 ${this.id} 重连失败:`, error3);
|
|
49794
|
+
this.emitter.emit("reconnectFailed", { id: this.id, attempt: this.reconnectAttempts, error: error3 });
|
|
49795
|
+
this.scheduleReconnect();
|
|
49796
|
+
}
|
|
49797
|
+
}, delay);
|
|
49798
|
+
}
|
|
49799
|
+
disconnect() {
|
|
49800
|
+
this.isManuallyClosed = true;
|
|
49801
|
+
this.autoReconnect = false;
|
|
49802
|
+
if (this.reconnectTimer) {
|
|
49803
|
+
clearTimeout(this.reconnectTimer);
|
|
49804
|
+
this.reconnectTimer = null;
|
|
49805
|
+
}
|
|
49806
|
+
if (this.ws) {
|
|
49807
|
+
this.ws.close();
|
|
49808
|
+
}
|
|
49809
|
+
}
|
|
49810
|
+
reconnect() {
|
|
49811
|
+
this.isManuallyClosed = false;
|
|
49812
|
+
this.reconnectAttempts = 0;
|
|
49813
|
+
if (this.reconnectTimer) {
|
|
49814
|
+
clearTimeout(this.reconnectTimer);
|
|
49815
|
+
this.reconnectTimer = null;
|
|
49816
|
+
}
|
|
49817
|
+
this.init();
|
|
49759
49818
|
}
|
|
49760
49819
|
onMessage(data) {
|
|
49761
49820
|
this.emitter.emit("message", data);
|
|
@@ -49837,7 +49896,7 @@ var getEnvToken = () => {
|
|
|
49837
49896
|
return envTokne;
|
|
49838
49897
|
};
|
|
49839
49898
|
|
|
49840
|
-
// ../node_modules/.pnpm/@kevisual+query@0.0.
|
|
49899
|
+
// ../node_modules/.pnpm/@kevisual+query@0.0.40/node_modules/@kevisual/query/dist/query-browser.js
|
|
49841
49900
|
var isTextForContentType = (contentType) => {
|
|
49842
49901
|
if (!contentType)
|
|
49843
49902
|
return false;
|
|
@@ -49866,12 +49925,12 @@ var adapter = async (opts = {}, overloadOpts) => {
|
|
|
49866
49925
|
url3 = new URL(opts.url);
|
|
49867
49926
|
} else {
|
|
49868
49927
|
origin = window?.location?.origin || "http://localhost:51515";
|
|
49869
|
-
url3 = new URL(opts
|
|
49928
|
+
url3 = new URL(opts?.url || "", origin);
|
|
49870
49929
|
}
|
|
49871
49930
|
const isGet = method === "GET";
|
|
49872
49931
|
const oldSearchParams = url3.searchParams;
|
|
49873
49932
|
if (isGet) {
|
|
49874
|
-
let searchParams = new URLSearchParams({ ...Object.fromEntries(oldSearchParams), ...opts
|
|
49933
|
+
let searchParams = new URLSearchParams({ ...Object.fromEntries(oldSearchParams), ...opts?.params, ...opts?.body });
|
|
49875
49934
|
url3.search = searchParams.toString();
|
|
49876
49935
|
} else {
|
|
49877
49936
|
const params = {
|
|
@@ -49896,11 +49955,13 @@ var adapter = async (opts = {}, overloadOpts) => {
|
|
|
49896
49955
|
} else if (isPostFile) {
|
|
49897
49956
|
body = opts.body;
|
|
49898
49957
|
} else {
|
|
49899
|
-
|
|
49900
|
-
|
|
49901
|
-
|
|
49902
|
-
|
|
49903
|
-
|
|
49958
|
+
if (opts.body && typeof opts.body === "object" && !(opts.body instanceof FormData)) {
|
|
49959
|
+
headers = {
|
|
49960
|
+
"Content-Type": "application/json",
|
|
49961
|
+
...headers
|
|
49962
|
+
};
|
|
49963
|
+
body = JSON.stringify(opts.body);
|
|
49964
|
+
}
|
|
49904
49965
|
}
|
|
49905
49966
|
return fetch(url3, {
|
|
49906
49967
|
method: method.toUpperCase(),
|
|
@@ -49970,7 +50031,7 @@ class Query {
|
|
|
49970
50031
|
"Content-Type": "application/json"
|
|
49971
50032
|
};
|
|
49972
50033
|
this.timeout = opts?.timeout || 60000 * 3;
|
|
49973
|
-
if (opts
|
|
50034
|
+
if (opts?.beforeRequest) {
|
|
49974
50035
|
this.beforeRequest = opts.beforeRequest;
|
|
49975
50036
|
} else {
|
|
49976
50037
|
this.beforeRequest = async (opts2) => {
|
|
@@ -57085,7 +57146,7 @@ function filter(data, query) {
|
|
|
57085
57146
|
return executor.execute(ast, data);
|
|
57086
57147
|
}
|
|
57087
57148
|
|
|
57088
|
-
// ../node_modules/.pnpm/@kevisual+api@0.0.
|
|
57149
|
+
// ../node_modules/.pnpm/@kevisual+api@0.0.50_@types+react@19.2.10_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-proxy/router-api-proxy.ts
|
|
57089
57150
|
var initApi = async (opts) => {
|
|
57090
57151
|
const router = opts?.router;
|
|
57091
57152
|
const item = opts?.item;
|
|
@@ -57113,6 +57174,7 @@ var initApi = async (opts) => {
|
|
|
57113
57174
|
let metadata = r.metadata || {};
|
|
57114
57175
|
metadata.viewItem = item;
|
|
57115
57176
|
metadata.url = query.url;
|
|
57177
|
+
metadata.source = "query-proxy-api";
|
|
57116
57178
|
router.route({
|
|
57117
57179
|
path: r.path,
|
|
57118
57180
|
key: r.key || "",
|
|
@@ -71027,7 +71089,6 @@ class AssistantApp extends Manager2 {
|
|
|
71027
71089
|
config;
|
|
71028
71090
|
pagesPath;
|
|
71029
71091
|
remoteIsConnected = false;
|
|
71030
|
-
attemptedConnectTimes = 0;
|
|
71031
71092
|
remoteApp = null;
|
|
71032
71093
|
remoteUrl = null;
|
|
71033
71094
|
resolver;
|
|
@@ -71095,7 +71156,7 @@ class AssistantApp extends Manager2 {
|
|
|
71095
71156
|
const enabled = opts?.enabled ?? share?.enabled ?? false;
|
|
71096
71157
|
if (share && enabled !== false) {
|
|
71097
71158
|
if (this.remoteApp) {
|
|
71098
|
-
this.remoteApp.
|
|
71159
|
+
this.remoteApp.disconnect();
|
|
71099
71160
|
this.remoteApp = null;
|
|
71100
71161
|
this.remoteIsConnected = false;
|
|
71101
71162
|
}
|
|
@@ -71107,31 +71168,31 @@ class AssistantApp extends Manager2 {
|
|
|
71107
71168
|
url: url5.toString(),
|
|
71108
71169
|
token,
|
|
71109
71170
|
id: id2,
|
|
71110
|
-
app: this.mainApp
|
|
71171
|
+
app: this.mainApp,
|
|
71172
|
+
autoReconnect: true,
|
|
71173
|
+
reconnectDelay: 5000,
|
|
71174
|
+
maxReconnectAttempts: Infinity,
|
|
71175
|
+
enableBackoff: true
|
|
71111
71176
|
});
|
|
71112
|
-
|
|
71113
|
-
|
|
71114
|
-
|
|
71177
|
+
remoteApp.isConnect();
|
|
71178
|
+
this.remoteIsConnected = true;
|
|
71179
|
+
remoteApp.on("open", () => {
|
|
71115
71180
|
this.remoteIsConnected = true;
|
|
71116
|
-
remoteApp.emitter.removeAllListeners("close");
|
|
71117
|
-
remoteApp.emitter.on("close", () => {
|
|
71118
|
-
setTimeout(() => {
|
|
71119
|
-
if (remoteApp.isError) {
|
|
71120
|
-
console.error("远程应用发生错误,不重连");
|
|
71121
|
-
} else {
|
|
71122
|
-
this.reconnectRemoteApp();
|
|
71123
|
-
}
|
|
71124
|
-
}, 5 * 1000);
|
|
71125
|
-
});
|
|
71126
|
-
logger.debug("链接到了远程应用服务器");
|
|
71127
71181
|
const appId = id2;
|
|
71128
71182
|
const username = config4?.auth.username || "unknown";
|
|
71129
71183
|
const url6 = new URL(`/${username}/v1/${appId}`, config4?.registry || "https://kevisual.cn/");
|
|
71130
71184
|
this.remoteUrl = url6.toString();
|
|
71131
|
-
|
|
71132
|
-
|
|
71133
|
-
|
|
71134
|
-
}
|
|
71185
|
+
logger.info("[remote-app] 远程地址", this.remoteUrl);
|
|
71186
|
+
logger.debug("链接到了远程应用服务器");
|
|
71187
|
+
remoteApp.listenProxy();
|
|
71188
|
+
});
|
|
71189
|
+
remoteApp.on("close", () => {
|
|
71190
|
+
this.remoteIsConnected = false;
|
|
71191
|
+
logger.info("[remote-app] 远程连接已关闭,自动重连机制正在处理...");
|
|
71192
|
+
});
|
|
71193
|
+
remoteApp.on("maxReconnectAttemptsReached", () => {
|
|
71194
|
+
logger.error("远程应用重连达到最大次数,停止重连");
|
|
71195
|
+
});
|
|
71135
71196
|
this.remoteApp = remoteApp;
|
|
71136
71197
|
} else {
|
|
71137
71198
|
if (!token) {
|
|
@@ -71214,28 +71275,6 @@ class AssistantApp extends Manager2 {
|
|
|
71214
71275
|
}
|
|
71215
71276
|
}
|
|
71216
71277
|
}
|
|
71217
|
-
async reconnectRemoteApp() {
|
|
71218
|
-
console.log("重新连接到远程应用服务器...", this.attemptedConnectTimes);
|
|
71219
|
-
const remoteApp = this.remoteApp;
|
|
71220
|
-
if (remoteApp) {
|
|
71221
|
-
if (remoteApp.ws) {
|
|
71222
|
-
remoteApp.ws.close();
|
|
71223
|
-
}
|
|
71224
|
-
remoteApp.init();
|
|
71225
|
-
this.attemptedConnectTimes += 1;
|
|
71226
|
-
const isConnect = await remoteApp.isConnect();
|
|
71227
|
-
if (isConnect) {
|
|
71228
|
-
remoteApp.listenProxy();
|
|
71229
|
-
this.attemptedConnectTimes = 0;
|
|
71230
|
-
console.log("重新连接到了远程应用服务器");
|
|
71231
|
-
} else {
|
|
71232
|
-
this.reconnectRemoteApp();
|
|
71233
|
-
setTimeout(() => {
|
|
71234
|
-
this.initRouterApp();
|
|
71235
|
-
}, 30 * 1000 + this.attemptedConnectTimes * 10 * 1000);
|
|
71236
|
-
}
|
|
71237
|
-
}
|
|
71238
|
-
}
|
|
71239
71278
|
async initRoutes() {
|
|
71240
71279
|
const routes = this.config.getConfig().routes || [];
|
|
71241
71280
|
for (const route of routes) {
|
|
@@ -71250,7 +71289,7 @@ class AssistantApp extends Manager2 {
|
|
|
71250
71289
|
}
|
|
71251
71290
|
}
|
|
71252
71291
|
}
|
|
71253
|
-
// ../node_modules/.pnpm/@kevisual+query@0.0.
|
|
71292
|
+
// ../node_modules/.pnpm/@kevisual+query@0.0.40/node_modules/@kevisual/query/dist/query.js
|
|
71254
71293
|
var isTextForContentType2 = (contentType) => {
|
|
71255
71294
|
if (!contentType)
|
|
71256
71295
|
return false;
|
|
@@ -71279,12 +71318,12 @@ var adapter2 = async (opts = {}, overloadOpts) => {
|
|
|
71279
71318
|
url5 = new URL(opts.url);
|
|
71280
71319
|
} else {
|
|
71281
71320
|
origin = window?.location?.origin || "http://localhost:51515";
|
|
71282
|
-
url5 = new URL(opts
|
|
71321
|
+
url5 = new URL(opts?.url || "", origin);
|
|
71283
71322
|
}
|
|
71284
71323
|
const isGet = method === "GET";
|
|
71285
71324
|
const oldSearchParams = url5.searchParams;
|
|
71286
71325
|
if (isGet) {
|
|
71287
|
-
let searchParams = new URLSearchParams({ ...Object.fromEntries(oldSearchParams), ...opts
|
|
71326
|
+
let searchParams = new URLSearchParams({ ...Object.fromEntries(oldSearchParams), ...opts?.params, ...opts?.body });
|
|
71288
71327
|
url5.search = searchParams.toString();
|
|
71289
71328
|
} else {
|
|
71290
71329
|
const params = {
|
|
@@ -71309,11 +71348,13 @@ var adapter2 = async (opts = {}, overloadOpts) => {
|
|
|
71309
71348
|
} else if (isPostFile) {
|
|
71310
71349
|
body = opts.body;
|
|
71311
71350
|
} else {
|
|
71312
|
-
|
|
71313
|
-
|
|
71314
|
-
|
|
71315
|
-
|
|
71316
|
-
|
|
71351
|
+
if (opts.body && typeof opts.body === "object" && !(opts.body instanceof FormData)) {
|
|
71352
|
+
headers = {
|
|
71353
|
+
"Content-Type": "application/json",
|
|
71354
|
+
...headers
|
|
71355
|
+
};
|
|
71356
|
+
body = JSON.stringify(opts.body);
|
|
71357
|
+
}
|
|
71317
71358
|
}
|
|
71318
71359
|
return fetch(url5, {
|
|
71319
71360
|
method: method.toUpperCase(),
|
|
@@ -71383,7 +71424,7 @@ class Query2 {
|
|
|
71383
71424
|
"Content-Type": "application/json"
|
|
71384
71425
|
};
|
|
71385
71426
|
this.timeout = opts?.timeout || 60000 * 3;
|
|
71386
|
-
if (opts
|
|
71427
|
+
if (opts?.beforeRequest) {
|
|
71387
71428
|
this.beforeRequest = opts.beforeRequest;
|
|
71388
71429
|
} else {
|
|
71389
71430
|
this.beforeRequest = async (opts2) => {
|
|
@@ -72156,42 +72197,39 @@ class AssistantInit extends AssistantConfig {
|
|
|
72156
72197
|
create = true;
|
|
72157
72198
|
fs13.writeFileSync(packagePath, `{
|
|
72158
72199
|
"name": "assistant-app",
|
|
72159
|
-
"version": "1.0.
|
|
72200
|
+
"version": "1.0.1",
|
|
72160
72201
|
"description": "assistant-app package pnpm, node pkgs projects",
|
|
72161
72202
|
"type": "module",
|
|
72162
72203
|
"scripts": {
|
|
72163
72204
|
"start": "pm2 start apps/code-center/dist/app.mjs --name code-center",
|
|
72164
72205
|
"proxy": "pm2 start apps/page-proxy/dist/app.mjs --name page-proxy",
|
|
72165
|
-
"preview": "pnpm i && ASSISTANT_CONFIG_DIR=/workspace asst server -s
|
|
72206
|
+
"preview": "pnpm i && ASSISTANT_CONFIG_DIR=/workspace/kevisual asst server -s"
|
|
72166
72207
|
},
|
|
72167
72208
|
"keywords": [],
|
|
72168
72209
|
"author": "",
|
|
72169
72210
|
"license": "ISC",
|
|
72170
72211
|
"dependencies": {
|
|
72171
|
-
"@aws-sdk/client-s3": "^3.
|
|
72172
|
-
"@kevisual/oss": "^0.0.
|
|
72173
|
-
"@kevisual/query": "^0.0.
|
|
72212
|
+
"@aws-sdk/client-s3": "^3.990.0",
|
|
72213
|
+
"@kevisual/oss": "^0.0.19",
|
|
72214
|
+
"@kevisual/query": "^0.0.40",
|
|
72174
72215
|
"eventemitter3": "^5.0.4",
|
|
72175
|
-
"@kevisual/router": "^0.0.
|
|
72176
|
-
"@kevisual/use-config": "^1.0.
|
|
72177
|
-
"ioredis": "^5.9.
|
|
72178
|
-
"
|
|
72179
|
-
"pg": "^8.17.2",
|
|
72216
|
+
"@kevisual/router": "^0.0.70",
|
|
72217
|
+
"@kevisual/use-config": "^1.0.30",
|
|
72218
|
+
"ioredis": "^5.9.3",
|
|
72219
|
+
"pg": "^8.18.0",
|
|
72180
72220
|
"pm2": "^6.0.14",
|
|
72181
|
-
"sequelize": "^6.37.7",
|
|
72182
72221
|
"crypto-js": "^4.2.0",
|
|
72183
|
-
"better-sqlite3": "^12.6.2",
|
|
72184
72222
|
"unstorage": "^1.17.4",
|
|
72185
72223
|
"dayjs": "^1.11.19",
|
|
72186
72224
|
"es-toolkit": "^1.44.0",
|
|
72187
72225
|
"node-cron": "^4.2.1",
|
|
72188
|
-
"dotenv": "^17.
|
|
72226
|
+
"dotenv": "^17.3.1"
|
|
72189
72227
|
},
|
|
72190
72228
|
"devDependencies": {
|
|
72191
72229
|
"@kevisual/types": "^0.0.12",
|
|
72192
|
-
"@types/bun": "^1.3.
|
|
72230
|
+
"@types/bun": "^1.3.9",
|
|
72193
72231
|
"@types/crypto-js": "^4.2.2",
|
|
72194
|
-
"@types/node": "^25.
|
|
72232
|
+
"@types/node": "^25.2.3"
|
|
72195
72233
|
}
|
|
72196
72234
|
}
|
|
72197
72235
|
`);
|
|
@@ -72284,7 +72322,7 @@ var assistantQuery = useContextKey("assistantQuery", () => {
|
|
|
72284
72322
|
return new AssistantQuery(assistantConfig2);
|
|
72285
72323
|
});
|
|
72286
72324
|
var runtime = useContextKey("runtime", () => {
|
|
72287
|
-
console.log("Runtime detected:", manualParse.isDev);
|
|
72325
|
+
console.log("Runtime detected:", "isDev:", manualParse.isDev, "isServer:", manualParse.isServer);
|
|
72288
72326
|
return {
|
|
72289
72327
|
type: "client",
|
|
72290
72328
|
isServer: manualParse.isServer
|
|
@@ -87071,10 +87109,10 @@ import os4 from "node:os";
|
|
|
87071
87109
|
import path12 from "path";
|
|
87072
87110
|
import fs14 from "fs";
|
|
87073
87111
|
|
|
87074
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
87112
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/key.js
|
|
87075
87113
|
var isTabKey = (key) => key.name === "tab";
|
|
87076
87114
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
87077
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
87115
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/errors.js
|
|
87078
87116
|
class AbortPromptError extends Error {
|
|
87079
87117
|
name = "AbortPromptError";
|
|
87080
87118
|
message = "Prompt was aborted";
|
|
@@ -87100,10 +87138,10 @@ class HookError extends Error {
|
|
|
87100
87138
|
class ValidationError extends Error {
|
|
87101
87139
|
name = "ValidationError";
|
|
87102
87140
|
}
|
|
87103
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
87141
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
87104
87142
|
import { AsyncResource as AsyncResource2 } from "node:async_hooks";
|
|
87105
87143
|
|
|
87106
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
87144
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
87107
87145
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
87108
87146
|
var hookStorage = new AsyncLocalStorage;
|
|
87109
87147
|
function createStore(rl) {
|
|
@@ -87208,10 +87246,10 @@ var effectScheduler = {
|
|
|
87208
87246
|
}
|
|
87209
87247
|
};
|
|
87210
87248
|
|
|
87211
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
87249
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
87212
87250
|
function useState(defaultValue) {
|
|
87213
87251
|
return withPointer((pointer) => {
|
|
87214
|
-
const setState = AsyncResource2.bind(function
|
|
87252
|
+
const setState = AsyncResource2.bind(function setState2(newValue) {
|
|
87215
87253
|
if (pointer.get() !== newValue) {
|
|
87216
87254
|
pointer.set(newValue);
|
|
87217
87255
|
handleChange();
|
|
@@ -87226,7 +87264,7 @@ function useState(defaultValue) {
|
|
|
87226
87264
|
});
|
|
87227
87265
|
}
|
|
87228
87266
|
|
|
87229
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
87267
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
87230
87268
|
function useEffect(cb, depArray) {
|
|
87231
87269
|
withPointer((pointer) => {
|
|
87232
87270
|
const oldDeps = pointer.get();
|
|
@@ -87238,7 +87276,7 @@ function useEffect(cb, depArray) {
|
|
|
87238
87276
|
});
|
|
87239
87277
|
}
|
|
87240
87278
|
|
|
87241
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
87279
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/theme.js
|
|
87242
87280
|
import { styleText } from "node:util";
|
|
87243
87281
|
|
|
87244
87282
|
// ../node_modules/.pnpm/@inquirer+figures@2.0.3/node_modules/@inquirer/figures/dist/index.js
|
|
@@ -87530,7 +87568,7 @@ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
|
87530
87568
|
var dist_default = figures;
|
|
87531
87569
|
var replacements = Object.entries(specialMainSymbols);
|
|
87532
87570
|
|
|
87533
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
87571
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/theme.js
|
|
87534
87572
|
var defaultTheme = {
|
|
87535
87573
|
prefix: {
|
|
87536
87574
|
idle: styleText("blue", "?"),
|
|
@@ -87551,7 +87589,7 @@ var defaultTheme = {
|
|
|
87551
87589
|
}
|
|
87552
87590
|
};
|
|
87553
87591
|
|
|
87554
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
87592
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
87555
87593
|
function isPlainObject7(value) {
|
|
87556
87594
|
if (typeof value !== "object" || value === null)
|
|
87557
87595
|
return false;
|
|
@@ -87579,7 +87617,7 @@ function makeTheme(...themes) {
|
|
|
87579
87617
|
return deepMerge(...themesToMerge);
|
|
87580
87618
|
}
|
|
87581
87619
|
|
|
87582
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
87620
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
87583
87621
|
function usePrefix({ status = "idle", theme }) {
|
|
87584
87622
|
const [showLoader, setShowLoader] = useState(false);
|
|
87585
87623
|
const [tick, setTick] = useState(0);
|
|
@@ -87609,12 +87647,12 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
87609
87647
|
const iconName = status === "loading" ? "idle" : status;
|
|
87610
87648
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
87611
87649
|
}
|
|
87612
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
87650
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
87613
87651
|
function useRef(val) {
|
|
87614
87652
|
return useState({ current: val })[0];
|
|
87615
87653
|
}
|
|
87616
87654
|
|
|
87617
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
87655
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
87618
87656
|
function useKeypress(userHandler) {
|
|
87619
87657
|
const signal = useRef(userHandler);
|
|
87620
87658
|
signal.current = userHandler;
|
|
@@ -87632,309 +87670,196 @@ function useKeypress(userHandler) {
|
|
|
87632
87670
|
};
|
|
87633
87671
|
}, []);
|
|
87634
87672
|
}
|
|
87635
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
87673
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/utils.js
|
|
87636
87674
|
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
87637
87675
|
|
|
87638
|
-
// ../node_modules/.pnpm/
|
|
87639
|
-
|
|
87640
|
-
const
|
|
87641
|
-
|
|
87642
|
-
|
|
87643
|
-
|
|
87644
|
-
|
|
87645
|
-
|
|
87646
|
-
|
|
87647
|
-
|
|
87648
|
-
|
|
87649
|
-
|
|
87650
|
-
|
|
87651
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof string7}\``);
|
|
87652
|
-
}
|
|
87653
|
-
return string7.replace(regex, "");
|
|
87654
|
-
}
|
|
87655
|
-
|
|
87656
|
-
// ../node_modules/.pnpm/get-east-asian-width@1.4.0/node_modules/get-east-asian-width/lookup.js
|
|
87657
|
-
function isAmbiguous(x) {
|
|
87658
|
-
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
87659
|
-
}
|
|
87660
|
-
function isFullWidth(x) {
|
|
87676
|
+
// ../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
87677
|
+
var getCodePointsLength = (() => {
|
|
87678
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
87679
|
+
return (input) => {
|
|
87680
|
+
let surrogatePairsNr = 0;
|
|
87681
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
87682
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
87683
|
+
surrogatePairsNr += 1;
|
|
87684
|
+
}
|
|
87685
|
+
return input.length - surrogatePairsNr;
|
|
87686
|
+
};
|
|
87687
|
+
})();
|
|
87688
|
+
var isFullWidth = (x) => {
|
|
87661
87689
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
87662
|
-
}
|
|
87663
|
-
|
|
87664
|
-
return x
|
|
87665
|
-
}
|
|
87666
|
-
|
|
87667
|
-
// ../node_modules/.pnpm/get-east-asian-width@1.4.0/node_modules/get-east-asian-width/index.js
|
|
87668
|
-
function validate(codePoint) {
|
|
87669
|
-
if (!Number.isSafeInteger(codePoint)) {
|
|
87670
|
-
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
87671
|
-
}
|
|
87672
|
-
}
|
|
87673
|
-
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
87674
|
-
validate(codePoint);
|
|
87675
|
-
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
|
|
87676
|
-
return 2;
|
|
87677
|
-
}
|
|
87678
|
-
return 1;
|
|
87679
|
-
}
|
|
87690
|
+
};
|
|
87691
|
+
var isWideNotCJKTNotEmoji = (x) => {
|
|
87692
|
+
return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
87693
|
+
};
|
|
87680
87694
|
|
|
87681
|
-
// ../node_modules/.pnpm/string-width@
|
|
87682
|
-
var
|
|
87683
|
-
var
|
|
87684
|
-
var
|
|
87685
|
-
|
|
87686
|
-
|
|
87687
|
-
|
|
87688
|
-
|
|
87689
|
-
|
|
87690
|
-
|
|
87691
|
-
|
|
87692
|
-
|
|
87693
|
-
|
|
87694
|
-
|
|
87695
|
-
|
|
87696
|
-
|
|
87697
|
-
|
|
87698
|
-
|
|
87695
|
+
// ../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
87696
|
+
var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
87697
|
+
var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
87698
|
+
var CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
|
|
87699
|
+
var TAB_RE = /\t{1,1000}/y;
|
|
87700
|
+
var EMOJI_RE = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu;
|
|
87701
|
+
var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
87702
|
+
var MODIFIER_RE = /\p{M}+/gu;
|
|
87703
|
+
var NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
|
|
87704
|
+
var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
87705
|
+
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
87706
|
+
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
87707
|
+
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
87708
|
+
const ANSI_WIDTH = 0;
|
|
87709
|
+
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
87710
|
+
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
87711
|
+
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
87712
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
87713
|
+
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
87714
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
87715
|
+
const PARSE_BLOCKS = [
|
|
87716
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
87717
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
87718
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
87719
|
+
[TAB_RE, TAB_WIDTH],
|
|
87720
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
87721
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
87722
|
+
];
|
|
87723
|
+
let indexPrev = 0;
|
|
87724
|
+
let index3 = 0;
|
|
87725
|
+
let length = input.length;
|
|
87726
|
+
let lengthExtra = 0;
|
|
87727
|
+
let truncationEnabled = false;
|
|
87728
|
+
let truncationIndex = length;
|
|
87729
|
+
let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
|
|
87730
|
+
let unmatchedStart = 0;
|
|
87731
|
+
let unmatchedEnd = 0;
|
|
87699
87732
|
let width = 0;
|
|
87700
|
-
|
|
87701
|
-
|
|
87702
|
-
|
|
87703
|
-
|
|
87704
|
-
|
|
87705
|
-
|
|
87706
|
-
|
|
87707
|
-
|
|
87708
|
-
|
|
87709
|
-
|
|
87710
|
-
|
|
87711
|
-
|
|
87712
|
-
|
|
87713
|
-
|
|
87714
|
-
}
|
|
87715
|
-
if (codePoint >= 65024 && codePoint <= 65039) {
|
|
87716
|
-
continue;
|
|
87717
|
-
}
|
|
87718
|
-
if (defaultIgnorableCodePointRegex.test(character)) {
|
|
87719
|
-
continue;
|
|
87720
|
-
}
|
|
87721
|
-
if (import_emoji_regex.default().test(character)) {
|
|
87722
|
-
width += 2;
|
|
87723
|
-
continue;
|
|
87724
|
-
}
|
|
87725
|
-
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
87726
|
-
}
|
|
87727
|
-
return width;
|
|
87728
|
-
}
|
|
87729
|
-
|
|
87730
|
-
// ../node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js
|
|
87731
|
-
var ANSI_BACKGROUND_OFFSET2 = 10;
|
|
87732
|
-
var wrapAnsi162 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
87733
|
-
var wrapAnsi2562 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
87734
|
-
var wrapAnsi16m2 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
87735
|
-
var styles3 = {
|
|
87736
|
-
modifier: {
|
|
87737
|
-
reset: [0, 0],
|
|
87738
|
-
bold: [1, 22],
|
|
87739
|
-
dim: [2, 22],
|
|
87740
|
-
italic: [3, 23],
|
|
87741
|
-
underline: [4, 24],
|
|
87742
|
-
overline: [53, 55],
|
|
87743
|
-
inverse: [7, 27],
|
|
87744
|
-
hidden: [8, 28],
|
|
87745
|
-
strikethrough: [9, 29]
|
|
87746
|
-
},
|
|
87747
|
-
color: {
|
|
87748
|
-
black: [30, 39],
|
|
87749
|
-
red: [31, 39],
|
|
87750
|
-
green: [32, 39],
|
|
87751
|
-
yellow: [33, 39],
|
|
87752
|
-
blue: [34, 39],
|
|
87753
|
-
magenta: [35, 39],
|
|
87754
|
-
cyan: [36, 39],
|
|
87755
|
-
white: [37, 39],
|
|
87756
|
-
blackBright: [90, 39],
|
|
87757
|
-
gray: [90, 39],
|
|
87758
|
-
grey: [90, 39],
|
|
87759
|
-
redBright: [91, 39],
|
|
87760
|
-
greenBright: [92, 39],
|
|
87761
|
-
yellowBright: [93, 39],
|
|
87762
|
-
blueBright: [94, 39],
|
|
87763
|
-
magentaBright: [95, 39],
|
|
87764
|
-
cyanBright: [96, 39],
|
|
87765
|
-
whiteBright: [97, 39]
|
|
87766
|
-
},
|
|
87767
|
-
bgColor: {
|
|
87768
|
-
bgBlack: [40, 49],
|
|
87769
|
-
bgRed: [41, 49],
|
|
87770
|
-
bgGreen: [42, 49],
|
|
87771
|
-
bgYellow: [43, 49],
|
|
87772
|
-
bgBlue: [44, 49],
|
|
87773
|
-
bgMagenta: [45, 49],
|
|
87774
|
-
bgCyan: [46, 49],
|
|
87775
|
-
bgWhite: [47, 49],
|
|
87776
|
-
bgBlackBright: [100, 49],
|
|
87777
|
-
bgGray: [100, 49],
|
|
87778
|
-
bgGrey: [100, 49],
|
|
87779
|
-
bgRedBright: [101, 49],
|
|
87780
|
-
bgGreenBright: [102, 49],
|
|
87781
|
-
bgYellowBright: [103, 49],
|
|
87782
|
-
bgBlueBright: [104, 49],
|
|
87783
|
-
bgMagentaBright: [105, 49],
|
|
87784
|
-
bgCyanBright: [106, 49],
|
|
87785
|
-
bgWhiteBright: [107, 49]
|
|
87786
|
-
}
|
|
87787
|
-
};
|
|
87788
|
-
var modifierNames2 = Object.keys(styles3.modifier);
|
|
87789
|
-
var foregroundColorNames2 = Object.keys(styles3.color);
|
|
87790
|
-
var backgroundColorNames2 = Object.keys(styles3.bgColor);
|
|
87791
|
-
var colorNames2 = [...foregroundColorNames2, ...backgroundColorNames2];
|
|
87792
|
-
function assembleStyles2() {
|
|
87793
|
-
const codes = new Map;
|
|
87794
|
-
for (const [groupName, group] of Object.entries(styles3)) {
|
|
87795
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
87796
|
-
styles3[styleName] = {
|
|
87797
|
-
open: `\x1B[${style[0]}m`,
|
|
87798
|
-
close: `\x1B[${style[1]}m`
|
|
87799
|
-
};
|
|
87800
|
-
group[styleName] = styles3[styleName];
|
|
87801
|
-
codes.set(style[0], style[1]);
|
|
87802
|
-
}
|
|
87803
|
-
Object.defineProperty(styles3, groupName, {
|
|
87804
|
-
value: group,
|
|
87805
|
-
enumerable: false
|
|
87806
|
-
});
|
|
87807
|
-
}
|
|
87808
|
-
Object.defineProperty(styles3, "codes", {
|
|
87809
|
-
value: codes,
|
|
87810
|
-
enumerable: false
|
|
87811
|
-
});
|
|
87812
|
-
styles3.color.close = "\x1B[39m";
|
|
87813
|
-
styles3.bgColor.close = "\x1B[49m";
|
|
87814
|
-
styles3.color.ansi = wrapAnsi162();
|
|
87815
|
-
styles3.color.ansi256 = wrapAnsi2562();
|
|
87816
|
-
styles3.color.ansi16m = wrapAnsi16m2();
|
|
87817
|
-
styles3.bgColor.ansi = wrapAnsi162(ANSI_BACKGROUND_OFFSET2);
|
|
87818
|
-
styles3.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET2);
|
|
87819
|
-
styles3.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET2);
|
|
87820
|
-
Object.defineProperties(styles3, {
|
|
87821
|
-
rgbToAnsi256: {
|
|
87822
|
-
value(red, green, blue) {
|
|
87823
|
-
if (red === green && green === blue) {
|
|
87824
|
-
if (red < 8) {
|
|
87825
|
-
return 16;
|
|
87733
|
+
let widthExtra = 0;
|
|
87734
|
+
outer:
|
|
87735
|
+
while (true) {
|
|
87736
|
+
if (unmatchedEnd > unmatchedStart || index3 >= length && index3 > indexPrev) {
|
|
87737
|
+
const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index3);
|
|
87738
|
+
lengthExtra = 0;
|
|
87739
|
+
for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
87740
|
+
const codePoint = char.codePointAt(0) || 0;
|
|
87741
|
+
if (isFullWidth(codePoint)) {
|
|
87742
|
+
widthExtra = FULL_WIDTH_WIDTH;
|
|
87743
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
87744
|
+
widthExtra = WIDE_WIDTH;
|
|
87745
|
+
} else {
|
|
87746
|
+
widthExtra = REGULAR_WIDTH;
|
|
87826
87747
|
}
|
|
87827
|
-
if (
|
|
87828
|
-
|
|
87748
|
+
if (width + widthExtra > truncationLimit) {
|
|
87749
|
+
truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
87829
87750
|
}
|
|
87830
|
-
|
|
87831
|
-
|
|
87832
|
-
|
|
87833
|
-
|
|
87834
|
-
|
|
87835
|
-
|
|
87836
|
-
|
|
87837
|
-
|
|
87838
|
-
|
|
87839
|
-
|
|
87840
|
-
|
|
87841
|
-
|
|
87842
|
-
|
|
87843
|
-
|
|
87844
|
-
|
|
87845
|
-
|
|
87846
|
-
|
|
87847
|
-
|
|
87848
|
-
|
|
87849
|
-
|
|
87850
|
-
|
|
87851
|
-
|
|
87852
|
-
|
|
87853
|
-
|
|
87854
|
-
|
|
87855
|
-
|
|
87856
|
-
|
|
87857
|
-
|
|
87858
|
-
|
|
87859
|
-
|
|
87860
|
-
value(code) {
|
|
87861
|
-
if (code < 8) {
|
|
87862
|
-
return 30 + code;
|
|
87863
|
-
}
|
|
87864
|
-
if (code < 16) {
|
|
87865
|
-
return 90 + (code - 8);
|
|
87866
|
-
}
|
|
87867
|
-
let red;
|
|
87868
|
-
let green;
|
|
87869
|
-
let blue;
|
|
87870
|
-
if (code >= 232) {
|
|
87871
|
-
red = ((code - 232) * 10 + 8) / 255;
|
|
87872
|
-
green = red;
|
|
87873
|
-
blue = red;
|
|
87874
|
-
} else {
|
|
87875
|
-
code -= 16;
|
|
87876
|
-
const remainder = code % 36;
|
|
87877
|
-
red = Math.floor(code / 36) / 5;
|
|
87878
|
-
green = Math.floor(remainder / 6) / 5;
|
|
87879
|
-
blue = remainder % 6 / 5;
|
|
87880
|
-
}
|
|
87881
|
-
const value = Math.max(red, green, blue) * 2;
|
|
87882
|
-
if (value === 0) {
|
|
87883
|
-
return 30;
|
|
87884
|
-
}
|
|
87885
|
-
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
87886
|
-
if (value === 2) {
|
|
87887
|
-
result += 60;
|
|
87751
|
+
if (width + widthExtra > LIMIT) {
|
|
87752
|
+
truncationEnabled = true;
|
|
87753
|
+
break outer;
|
|
87754
|
+
}
|
|
87755
|
+
lengthExtra += char.length;
|
|
87756
|
+
width += widthExtra;
|
|
87757
|
+
}
|
|
87758
|
+
unmatchedStart = unmatchedEnd = 0;
|
|
87759
|
+
}
|
|
87760
|
+
if (index3 >= length) {
|
|
87761
|
+
break outer;
|
|
87762
|
+
}
|
|
87763
|
+
for (let i = 0, l = PARSE_BLOCKS.length;i < l; i++) {
|
|
87764
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
|
|
87765
|
+
BLOCK_RE.lastIndex = index3;
|
|
87766
|
+
if (BLOCK_RE.test(input)) {
|
|
87767
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index3, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index3;
|
|
87768
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
87769
|
+
if (width + widthExtra > truncationLimit) {
|
|
87770
|
+
truncationIndex = Math.min(truncationIndex, index3 + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
87771
|
+
}
|
|
87772
|
+
if (width + widthExtra > LIMIT) {
|
|
87773
|
+
truncationEnabled = true;
|
|
87774
|
+
break outer;
|
|
87775
|
+
}
|
|
87776
|
+
width += widthExtra;
|
|
87777
|
+
unmatchedStart = indexPrev;
|
|
87778
|
+
unmatchedEnd = index3;
|
|
87779
|
+
index3 = indexPrev = BLOCK_RE.lastIndex;
|
|
87780
|
+
continue outer;
|
|
87888
87781
|
}
|
|
87889
|
-
|
|
87890
|
-
|
|
87891
|
-
enumerable: false
|
|
87892
|
-
},
|
|
87893
|
-
rgbToAnsi: {
|
|
87894
|
-
value: (red, green, blue) => styles3.ansi256ToAnsi(styles3.rgbToAnsi256(red, green, blue)),
|
|
87895
|
-
enumerable: false
|
|
87896
|
-
},
|
|
87897
|
-
hexToAnsi: {
|
|
87898
|
-
value: (hex6) => styles3.ansi256ToAnsi(styles3.hexToAnsi256(hex6)),
|
|
87899
|
-
enumerable: false
|
|
87782
|
+
}
|
|
87783
|
+
index3 += 1;
|
|
87900
87784
|
}
|
|
87901
|
-
|
|
87902
|
-
|
|
87903
|
-
|
|
87904
|
-
|
|
87905
|
-
|
|
87785
|
+
return {
|
|
87786
|
+
width: truncationEnabled ? truncationLimit : width,
|
|
87787
|
+
index: truncationEnabled ? truncationIndex : length,
|
|
87788
|
+
truncated: truncationEnabled,
|
|
87789
|
+
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
87790
|
+
};
|
|
87791
|
+
};
|
|
87792
|
+
var dist_default2 = getStringTruncatedWidth;
|
|
87906
87793
|
|
|
87907
|
-
// ../node_modules/.pnpm/
|
|
87908
|
-
var
|
|
87909
|
-
|
|
87910
|
-
"
|
|
87911
|
-
|
|
87794
|
+
// ../node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
87795
|
+
var NO_TRUNCATION2 = {
|
|
87796
|
+
limit: Infinity,
|
|
87797
|
+
ellipsis: "",
|
|
87798
|
+
ellipsisWidth: 0
|
|
87799
|
+
};
|
|
87800
|
+
var fastStringWidth = (input, options = {}) => {
|
|
87801
|
+
return dist_default2(input, NO_TRUNCATION2, options).width;
|
|
87802
|
+
};
|
|
87803
|
+
var dist_default3 = fastStringWidth;
|
|
87804
|
+
|
|
87805
|
+
// ../node_modules/.pnpm/fast-wrap-ansi@0.2.0/node_modules/fast-wrap-ansi/lib/main.js
|
|
87806
|
+
var ESC = "\x1B";
|
|
87807
|
+
var CSI = "";
|
|
87912
87808
|
var END_CODE = 39;
|
|
87913
87809
|
var ANSI_ESCAPE_BELL = "\x07";
|
|
87914
87810
|
var ANSI_CSI = "[";
|
|
87915
87811
|
var ANSI_OSC = "]";
|
|
87916
87812
|
var ANSI_SGR_TERMINATOR = "m";
|
|
87917
87813
|
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
87918
|
-
var
|
|
87919
|
-
var
|
|
87920
|
-
|
|
87814
|
+
var GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
|
|
87815
|
+
var getClosingCode = (openingCode) => {
|
|
87816
|
+
if (openingCode >= 30 && openingCode <= 37)
|
|
87817
|
+
return 39;
|
|
87818
|
+
if (openingCode >= 90 && openingCode <= 97)
|
|
87819
|
+
return 39;
|
|
87820
|
+
if (openingCode >= 40 && openingCode <= 47)
|
|
87821
|
+
return 49;
|
|
87822
|
+
if (openingCode >= 100 && openingCode <= 107)
|
|
87823
|
+
return 49;
|
|
87824
|
+
if (openingCode === 1 || openingCode === 2)
|
|
87825
|
+
return 22;
|
|
87826
|
+
if (openingCode === 3)
|
|
87827
|
+
return 23;
|
|
87828
|
+
if (openingCode === 4)
|
|
87829
|
+
return 24;
|
|
87830
|
+
if (openingCode === 7)
|
|
87831
|
+
return 27;
|
|
87832
|
+
if (openingCode === 8)
|
|
87833
|
+
return 28;
|
|
87834
|
+
if (openingCode === 9)
|
|
87835
|
+
return 29;
|
|
87836
|
+
if (openingCode === 0)
|
|
87837
|
+
return 0;
|
|
87838
|
+
return;
|
|
87839
|
+
};
|
|
87840
|
+
var wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
87841
|
+
var wrapAnsiHyperlink = (url6) => `${ESC}${ANSI_ESCAPE_LINK}${url6}${ANSI_ESCAPE_BELL}`;
|
|
87921
87842
|
var wrapWord = (rows, word, columns) => {
|
|
87922
|
-
const characters = [
|
|
87843
|
+
const characters = word[Symbol.iterator]();
|
|
87923
87844
|
let isInsideEscape = false;
|
|
87924
87845
|
let isInsideLinkEscape = false;
|
|
87925
|
-
let
|
|
87926
|
-
|
|
87927
|
-
|
|
87846
|
+
let lastRow = rows.at(-1);
|
|
87847
|
+
let visible = lastRow === undefined ? 0 : dist_default3(lastRow);
|
|
87848
|
+
let currentCharacter = characters.next();
|
|
87849
|
+
let nextCharacter = characters.next();
|
|
87850
|
+
let rawCharacterIndex = 0;
|
|
87851
|
+
while (!currentCharacter.done) {
|
|
87852
|
+
const character = currentCharacter.value;
|
|
87853
|
+
const characterLength = dist_default3(character);
|
|
87928
87854
|
if (visible + characterLength <= columns) {
|
|
87929
87855
|
rows[rows.length - 1] += character;
|
|
87930
87856
|
} else {
|
|
87931
87857
|
rows.push(character);
|
|
87932
87858
|
visible = 0;
|
|
87933
87859
|
}
|
|
87934
|
-
if (
|
|
87860
|
+
if (character === ESC || character === CSI) {
|
|
87935
87861
|
isInsideEscape = true;
|
|
87936
|
-
|
|
87937
|
-
isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
|
|
87862
|
+
isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
|
|
87938
87863
|
}
|
|
87939
87864
|
if (isInsideEscape) {
|
|
87940
87865
|
if (isInsideLinkEscape) {
|
|
@@ -87945,23 +87870,27 @@ var wrapWord = (rows, word, columns) => {
|
|
|
87945
87870
|
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
87946
87871
|
isInsideEscape = false;
|
|
87947
87872
|
}
|
|
87948
|
-
|
|
87949
|
-
|
|
87950
|
-
|
|
87951
|
-
|
|
87952
|
-
|
|
87953
|
-
|
|
87873
|
+
} else {
|
|
87874
|
+
visible += characterLength;
|
|
87875
|
+
if (visible === columns && !nextCharacter.done) {
|
|
87876
|
+
rows.push("");
|
|
87877
|
+
visible = 0;
|
|
87878
|
+
}
|
|
87954
87879
|
}
|
|
87880
|
+
currentCharacter = nextCharacter;
|
|
87881
|
+
nextCharacter = characters.next();
|
|
87882
|
+
rawCharacterIndex += character.length;
|
|
87955
87883
|
}
|
|
87956
|
-
|
|
87884
|
+
lastRow = rows.at(-1);
|
|
87885
|
+
if (!visible && lastRow !== undefined && lastRow.length && rows.length > 1) {
|
|
87957
87886
|
rows[rows.length - 2] += rows.pop();
|
|
87958
87887
|
}
|
|
87959
87888
|
};
|
|
87960
87889
|
var stringVisibleTrimSpacesRight = (string7) => {
|
|
87961
87890
|
const words = string7.split(" ");
|
|
87962
87891
|
let last = words.length;
|
|
87963
|
-
while (last
|
|
87964
|
-
if (
|
|
87892
|
+
while (last) {
|
|
87893
|
+
if (dist_default3(words[last - 1])) {
|
|
87965
87894
|
break;
|
|
87966
87895
|
}
|
|
87967
87896
|
last--;
|
|
@@ -87978,95 +87907,114 @@ var exec = (string7, columns, options = {}) => {
|
|
|
87978
87907
|
let returnValue = "";
|
|
87979
87908
|
let escapeCode;
|
|
87980
87909
|
let escapeUrl;
|
|
87981
|
-
const
|
|
87910
|
+
const words = string7.split(" ");
|
|
87982
87911
|
let rows = [""];
|
|
87983
|
-
|
|
87912
|
+
let rowLength = 0;
|
|
87913
|
+
for (let index3 = 0;index3 < words.length; index3++) {
|
|
87914
|
+
const word = words[index3];
|
|
87984
87915
|
if (options.trim !== false) {
|
|
87985
|
-
|
|
87916
|
+
const row = rows.at(-1) ?? "";
|
|
87917
|
+
const trimmed = row.trimStart();
|
|
87918
|
+
if (row.length !== trimmed.length) {
|
|
87919
|
+
rows[rows.length - 1] = trimmed;
|
|
87920
|
+
rowLength = dist_default3(trimmed);
|
|
87921
|
+
}
|
|
87986
87922
|
}
|
|
87987
|
-
let rowLength = stringWidth(rows.at(-1));
|
|
87988
87923
|
if (index3 !== 0) {
|
|
87989
87924
|
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
87990
87925
|
rows.push("");
|
|
87991
87926
|
rowLength = 0;
|
|
87992
87927
|
}
|
|
87993
|
-
if (rowLength
|
|
87928
|
+
if (rowLength || options.trim === false) {
|
|
87994
87929
|
rows[rows.length - 1] += " ";
|
|
87995
87930
|
rowLength++;
|
|
87996
87931
|
}
|
|
87997
87932
|
}
|
|
87998
|
-
|
|
87933
|
+
const wordLength = dist_default3(word);
|
|
87934
|
+
if (options.hard && wordLength > columns) {
|
|
87999
87935
|
const remainingColumns = columns - rowLength;
|
|
88000
|
-
const breaksStartingThisLine = 1 + Math.floor((
|
|
88001
|
-
const breaksStartingNextLine = Math.floor((
|
|
87936
|
+
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
87937
|
+
const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
|
|
88002
87938
|
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
88003
87939
|
rows.push("");
|
|
88004
87940
|
}
|
|
88005
87941
|
wrapWord(rows, word, columns);
|
|
87942
|
+
rowLength = dist_default3(rows.at(-1) ?? "");
|
|
88006
87943
|
continue;
|
|
88007
87944
|
}
|
|
88008
|
-
if (rowLength +
|
|
87945
|
+
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
88009
87946
|
if (options.wordWrap === false && rowLength < columns) {
|
|
88010
87947
|
wrapWord(rows, word, columns);
|
|
87948
|
+
rowLength = dist_default3(rows.at(-1) ?? "");
|
|
88011
87949
|
continue;
|
|
88012
87950
|
}
|
|
88013
87951
|
rows.push("");
|
|
87952
|
+
rowLength = 0;
|
|
88014
87953
|
}
|
|
88015
|
-
if (rowLength +
|
|
87954
|
+
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
88016
87955
|
wrapWord(rows, word, columns);
|
|
87956
|
+
rowLength = dist_default3(rows.at(-1) ?? "");
|
|
88017
87957
|
continue;
|
|
88018
87958
|
}
|
|
88019
87959
|
rows[rows.length - 1] += word;
|
|
87960
|
+
rowLength += wordLength;
|
|
88020
87961
|
}
|
|
88021
87962
|
if (options.trim !== false) {
|
|
88022
87963
|
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
88023
87964
|
}
|
|
88024
87965
|
const preString = rows.join(`
|
|
88025
87966
|
`);
|
|
88026
|
-
|
|
88027
|
-
let
|
|
88028
|
-
|
|
87967
|
+
let inSurrogate = false;
|
|
87968
|
+
for (let i = 0;i < preString.length; i++) {
|
|
87969
|
+
const character = preString[i];
|
|
88029
87970
|
returnValue += character;
|
|
88030
|
-
if (
|
|
88031
|
-
|
|
88032
|
-
if (
|
|
88033
|
-
|
|
88034
|
-
|
|
88035
|
-
|
|
87971
|
+
if (!inSurrogate) {
|
|
87972
|
+
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
87973
|
+
if (inSurrogate) {
|
|
87974
|
+
continue;
|
|
87975
|
+
}
|
|
87976
|
+
} else {
|
|
87977
|
+
inSurrogate = false;
|
|
87978
|
+
}
|
|
87979
|
+
if (character === ESC || character === CSI) {
|
|
87980
|
+
GROUP_REGEX.lastIndex = i + 1;
|
|
87981
|
+
const groupsResult = GROUP_REGEX.exec(preString);
|
|
87982
|
+
const groups = groupsResult?.groups;
|
|
87983
|
+
if (groups?.code !== undefined) {
|
|
87984
|
+
const code = Number.parseFloat(groups.code);
|
|
87985
|
+
escapeCode = code === END_CODE ? undefined : code;
|
|
87986
|
+
} else if (groups?.uri !== undefined) {
|
|
88036
87987
|
escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
|
|
88037
87988
|
}
|
|
88038
87989
|
}
|
|
88039
|
-
|
|
88040
|
-
if (pre[index3 + 1] === `
|
|
87990
|
+
if (preString[i + 1] === `
|
|
88041
87991
|
`) {
|
|
88042
87992
|
if (escapeUrl) {
|
|
88043
87993
|
returnValue += wrapAnsiHyperlink("");
|
|
88044
87994
|
}
|
|
88045
|
-
|
|
88046
|
-
|
|
87995
|
+
const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;
|
|
87996
|
+
if (escapeCode && closingCode) {
|
|
87997
|
+
returnValue += wrapAnsiCode(closingCode);
|
|
88047
87998
|
}
|
|
88048
87999
|
} else if (character === `
|
|
88049
88000
|
`) {
|
|
88050
|
-
if (escapeCode &&
|
|
88001
|
+
if (escapeCode && getClosingCode(escapeCode)) {
|
|
88051
88002
|
returnValue += wrapAnsiCode(escapeCode);
|
|
88052
88003
|
}
|
|
88053
88004
|
if (escapeUrl) {
|
|
88054
88005
|
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
88055
88006
|
}
|
|
88056
88007
|
}
|
|
88057
|
-
preStringIndex += character.length;
|
|
88058
88008
|
}
|
|
88059
88009
|
return returnValue;
|
|
88060
88010
|
};
|
|
88011
|
+
var CRLF_OR_LF = /\r?\n/;
|
|
88061
88012
|
function wrapAnsi(string7, columns, options) {
|
|
88062
|
-
return String(string7).normalize().
|
|
88063
|
-
`, `
|
|
88064
|
-
`).split(`
|
|
88065
|
-
`).map((line) => exec(line, columns, options)).join(`
|
|
88013
|
+
return String(string7).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join(`
|
|
88066
88014
|
`);
|
|
88067
88015
|
}
|
|
88068
88016
|
|
|
88069
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
88017
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/utils.js
|
|
88070
88018
|
function breakLines(content, width) {
|
|
88071
88019
|
return content.split(`
|
|
88072
88020
|
`).flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split(`
|
|
@@ -88077,7 +88025,7 @@ function readlineWidth() {
|
|
|
88077
88025
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
|
88078
88026
|
}
|
|
88079
88027
|
|
|
88080
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
88028
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
88081
88029
|
var import_mute_stream = __toESM(require_lib(), 1);
|
|
88082
88030
|
import * as readline2 from "node:readline";
|
|
88083
88031
|
import { AsyncResource as AsyncResource3 } from "node:async_hooks";
|
|
@@ -88290,26 +88238,26 @@ var {
|
|
|
88290
88238
|
unload
|
|
88291
88239
|
} = signalExitWrap(processOk(process9) ? new SignalExit(process9) : new SignalExitFallback);
|
|
88292
88240
|
|
|
88293
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
88241
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
88294
88242
|
import { stripVTControlCharacters } from "node:util";
|
|
88295
88243
|
|
|
88296
88244
|
// ../node_modules/.pnpm/@inquirer+ansi@2.0.3/node_modules/@inquirer/ansi/dist/index.js
|
|
88297
|
-
var
|
|
88298
|
-
var cursorLeft =
|
|
88299
|
-
var cursorHide =
|
|
88300
|
-
var cursorShow =
|
|
88301
|
-
var cursorUp = (rows = 1) => rows > 0 ? `${
|
|
88302
|
-
var cursorDown = (rows = 1) => rows > 0 ? `${
|
|
88245
|
+
var ESC2 = "\x1B[";
|
|
88246
|
+
var cursorLeft = ESC2 + "G";
|
|
88247
|
+
var cursorHide = ESC2 + "?25l";
|
|
88248
|
+
var cursorShow = ESC2 + "?25h";
|
|
88249
|
+
var cursorUp = (rows = 1) => rows > 0 ? `${ESC2}${rows}A` : "";
|
|
88250
|
+
var cursorDown = (rows = 1) => rows > 0 ? `${ESC2}${rows}B` : "";
|
|
88303
88251
|
var cursorTo = (x, y) => {
|
|
88304
88252
|
if (typeof y === "number" && !Number.isNaN(y)) {
|
|
88305
|
-
return `${
|
|
88253
|
+
return `${ESC2}${y + 1};${x + 1}H`;
|
|
88306
88254
|
}
|
|
88307
|
-
return `${
|
|
88255
|
+
return `${ESC2}${x + 1}G`;
|
|
88308
88256
|
};
|
|
88309
|
-
var eraseLine =
|
|
88257
|
+
var eraseLine = ESC2 + "2K";
|
|
88310
88258
|
var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
|
|
88311
88259
|
|
|
88312
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
88260
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
88313
88261
|
var height = (content) => content.split(`
|
|
88314
88262
|
`).length;
|
|
88315
88263
|
var lastLine = (content) => content.split(`
|
|
@@ -88374,7 +88322,7 @@ class ScreenManager {
|
|
|
88374
88322
|
}
|
|
88375
88323
|
}
|
|
88376
88324
|
|
|
88377
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
88325
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
88378
88326
|
class PromisePolyfill extends Promise {
|
|
88379
88327
|
static withResolver() {
|
|
88380
88328
|
let resolve;
|
|
@@ -88387,7 +88335,7 @@ class PromisePolyfill extends Promise {
|
|
|
88387
88335
|
}
|
|
88388
88336
|
}
|
|
88389
88337
|
|
|
88390
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
88338
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.3_@types+node@25.2.3/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
88391
88339
|
function getCallSites() {
|
|
88392
88340
|
const _prepareStackTrace = Error.prepareStackTrace;
|
|
88393
88341
|
let result = [];
|
|
@@ -88473,7 +88421,7 @@ function createPrompt(view) {
|
|
|
88473
88421
|
};
|
|
88474
88422
|
return prompt;
|
|
88475
88423
|
}
|
|
88476
|
-
// ../node_modules/.pnpm/@inquirer+confirm@6.0.
|
|
88424
|
+
// ../node_modules/.pnpm/@inquirer+confirm@6.0.6_@types+node@25.2.3/node_modules/@inquirer/confirm/dist/index.js
|
|
88477
88425
|
function getBooleanValue(value, defaultValue) {
|
|
88478
88426
|
let answer = defaultValue !== false;
|
|
88479
88427
|
if (/^(y|yes)/i.test(value))
|
|
@@ -88485,7 +88433,7 @@ function getBooleanValue(value, defaultValue) {
|
|
|
88485
88433
|
function boolToString(value) {
|
|
88486
88434
|
return value ? "Yes" : "No";
|
|
88487
88435
|
}
|
|
88488
|
-
var
|
|
88436
|
+
var dist_default4 = createPrompt((config7, done) => {
|
|
88489
88437
|
const { transformer = boolToString } = config7;
|
|
88490
88438
|
const [status, setStatus] = useState("idle");
|
|
88491
88439
|
const [value, setValue] = useState("");
|
|
@@ -88575,7 +88523,7 @@ class AppDownload {
|
|
|
88575
88523
|
return runCommand(command, args2);
|
|
88576
88524
|
}
|
|
88577
88525
|
async confirm(message) {
|
|
88578
|
-
return await
|
|
88526
|
+
return await dist_default4({
|
|
88579
88527
|
message: message || "是否继续删除应用?",
|
|
88580
88528
|
default: false
|
|
88581
88529
|
});
|
|
@@ -95469,7 +95417,7 @@ var init_crypto = __esm2(() => {
|
|
|
95469
95417
|
} catch (e) {
|
|
95470
95418
|
errorProto = getProto(getProto(e)), INTRINSICS["%Error.prototype%"] = errorProto;
|
|
95471
95419
|
}
|
|
95472
|
-
var errorProto, doEval = function
|
|
95420
|
+
var errorProto, doEval = function doEval2(name) {
|
|
95473
95421
|
var value;
|
|
95474
95422
|
if (name === "%AsyncFunction%")
|
|
95475
95423
|
value = getEvalledConstructor("async function () {}");
|
|
@@ -95478,11 +95426,11 @@ var init_crypto = __esm2(() => {
|
|
|
95478
95426
|
else if (name === "%AsyncGeneratorFunction%")
|
|
95479
95427
|
value = getEvalledConstructor("async function* () {}");
|
|
95480
95428
|
else if (name === "%AsyncGenerator%") {
|
|
95481
|
-
var fn =
|
|
95429
|
+
var fn = doEval2("%AsyncGeneratorFunction%");
|
|
95482
95430
|
if (fn)
|
|
95483
95431
|
value = fn.prototype;
|
|
95484
95432
|
} else if (name === "%AsyncIteratorPrototype%") {
|
|
95485
|
-
var gen =
|
|
95433
|
+
var gen = doEval2("%AsyncGenerator%");
|
|
95486
95434
|
if (gen && getProto)
|
|
95487
95435
|
value = getProto(gen.prototype);
|
|
95488
95436
|
}
|
|
@@ -108319,14 +108267,14 @@ class AIUtils {
|
|
|
108319
108267
|
}
|
|
108320
108268
|
extractCodeFromMarkdown(str, language) {
|
|
108321
108269
|
if (language) {
|
|
108322
|
-
const
|
|
108323
|
-
const matches2 = str.match(
|
|
108270
|
+
const regex2 = new RegExp(`\`\`\`${language}\\s*([\\s\\S]*?)\\s*\`\`\``, "g");
|
|
108271
|
+
const matches2 = str.match(regex2);
|
|
108324
108272
|
if (!matches2)
|
|
108325
108273
|
return null;
|
|
108326
108274
|
return matches2.map((m) => m.replace(new RegExp(`\`\`\`${language}\\s*|\\s*\`\`\``, "g"), "").trim());
|
|
108327
108275
|
}
|
|
108328
|
-
const
|
|
108329
|
-
const matches = [...str.matchAll(
|
|
108276
|
+
const regex = /```[\w]*\s*([\s\S]*?)\s*```/g;
|
|
108277
|
+
const matches = [...str.matchAll(regex)];
|
|
108330
108278
|
if (matches.length === 0)
|
|
108331
108279
|
return null;
|
|
108332
108280
|
return matches.map((m) => m[1].trim());
|
|
@@ -108872,7 +108820,7 @@ app.route({
|
|
|
108872
108820
|
}).addTo(app, {
|
|
108873
108821
|
overwrite: false
|
|
108874
108822
|
});
|
|
108875
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.
|
|
108823
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.4/node_modules/@opencode-ai/sdk/dist/gen/core/serverSentEvents.gen.js
|
|
108876
108824
|
var createSseClient = ({ onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url: url6, ...options }) => {
|
|
108877
108825
|
let lastEventId;
|
|
108878
108826
|
const sleep = sseSleepFn ?? ((ms3) => new Promise((resolve) => setTimeout(resolve, ms3)));
|
|
@@ -108981,7 +108929,7 @@ var createSseClient = ({ onSseError, onSseEvent, responseTransformer, responseVa
|
|
|
108981
108929
|
return { stream: stream3 };
|
|
108982
108930
|
};
|
|
108983
108931
|
|
|
108984
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.
|
|
108932
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.4/node_modules/@opencode-ai/sdk/dist/gen/core/auth.gen.js
|
|
108985
108933
|
var getAuthToken = async (auth, callback) => {
|
|
108986
108934
|
const token = typeof callback === "function" ? await callback(auth) : callback;
|
|
108987
108935
|
if (!token) {
|
|
@@ -108996,12 +108944,12 @@ var getAuthToken = async (auth, callback) => {
|
|
|
108996
108944
|
return token;
|
|
108997
108945
|
};
|
|
108998
108946
|
|
|
108999
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.
|
|
108947
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.4/node_modules/@opencode-ai/sdk/dist/gen/core/bodySerializer.gen.js
|
|
109000
108948
|
var jsonBodySerializer = {
|
|
109001
108949
|
bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
|
|
109002
108950
|
};
|
|
109003
108951
|
|
|
109004
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.
|
|
108952
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.4/node_modules/@opencode-ai/sdk/dist/gen/core/pathSerializer.gen.js
|
|
109005
108953
|
var separatorArrayExplode = (style) => {
|
|
109006
108954
|
switch (style) {
|
|
109007
108955
|
case "label":
|
|
@@ -109104,7 +109052,7 @@ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueO
|
|
|
109104
109052
|
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
109105
109053
|
};
|
|
109106
109054
|
|
|
109107
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.
|
|
109055
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.4/node_modules/@opencode-ai/sdk/dist/gen/core/utils.gen.js
|
|
109108
109056
|
var PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
109109
109057
|
var defaultPathSerializer = ({ path: path13, url: _url5 }) => {
|
|
109110
109058
|
let url6 = _url5;
|
|
@@ -109172,7 +109120,7 @@ var getUrl = ({ baseUrl, path: path13, query: query3, querySerializer, url: _url
|
|
|
109172
109120
|
return url6;
|
|
109173
109121
|
};
|
|
109174
109122
|
|
|
109175
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.
|
|
109123
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.4/node_modules/@opencode-ai/sdk/dist/gen/client/utils.gen.js
|
|
109176
109124
|
var createQuerySerializer = ({ allowReserved, array: array6, object: object5 } = {}) => {
|
|
109177
109125
|
const querySerializer = (queryParams) => {
|
|
109178
109126
|
const search = [];
|
|
@@ -109380,7 +109328,7 @@ var createConfig = (override = {}) => ({
|
|
|
109380
109328
|
...override
|
|
109381
109329
|
});
|
|
109382
109330
|
|
|
109383
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.
|
|
109331
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.4/node_modules/@opencode-ai/sdk/dist/gen/client/client.gen.js
|
|
109384
109332
|
var createClient = (config7 = {}) => {
|
|
109385
109333
|
let _config = mergeConfigs(createConfig(), config7);
|
|
109386
109334
|
const getConfig2 = () => ({ ..._config });
|
|
@@ -109527,7 +109475,7 @@ var createClient = (config7 = {}) => {
|
|
|
109527
109475
|
trace: makeMethod("TRACE")
|
|
109528
109476
|
};
|
|
109529
109477
|
};
|
|
109530
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.
|
|
109478
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.4/node_modules/@opencode-ai/sdk/dist/gen/core/params.gen.js
|
|
109531
109479
|
var extraPrefixesMap = {
|
|
109532
109480
|
$body_: "body",
|
|
109533
109481
|
$headers_: "headers",
|
|
@@ -109535,12 +109483,12 @@ var extraPrefixesMap = {
|
|
|
109535
109483
|
$query_: "query"
|
|
109536
109484
|
};
|
|
109537
109485
|
var extraPrefixes = Object.entries(extraPrefixesMap);
|
|
109538
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.
|
|
109486
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.4/node_modules/@opencode-ai/sdk/dist/gen/client.gen.js
|
|
109539
109487
|
var client = createClient(createConfig({
|
|
109540
109488
|
baseUrl: "http://localhost:4096"
|
|
109541
109489
|
}));
|
|
109542
109490
|
|
|
109543
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.
|
|
109491
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.4/node_modules/@opencode-ai/sdk/dist/gen/sdk.gen.js
|
|
109544
109492
|
class _HeyApiClient {
|
|
109545
109493
|
_client = client;
|
|
109546
109494
|
constructor(args2) {
|
|
@@ -110210,7 +110158,7 @@ class OpencodeClient extends _HeyApiClient {
|
|
|
110210
110158
|
event = new Event({ client: this._client });
|
|
110211
110159
|
}
|
|
110212
110160
|
|
|
110213
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.
|
|
110161
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.4/node_modules/@opencode-ai/sdk/dist/client.js
|
|
110214
110162
|
function createOpencodeClient(config7) {
|
|
110215
110163
|
if (!config7?.fetch) {
|
|
110216
110164
|
const customFetch = (req) => {
|
|
@@ -110225,13 +110173,13 @@ function createOpencodeClient(config7) {
|
|
|
110225
110173
|
if (config7?.directory) {
|
|
110226
110174
|
config7.headers = {
|
|
110227
110175
|
...config7.headers,
|
|
110228
|
-
"x-opencode-directory": config7.directory
|
|
110176
|
+
"x-opencode-directory": encodeURIComponent(config7.directory)
|
|
110229
110177
|
};
|
|
110230
110178
|
}
|
|
110231
110179
|
const client2 = createClient(config7);
|
|
110232
110180
|
return new OpencodeClient({ client: client2 });
|
|
110233
110181
|
}
|
|
110234
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.
|
|
110182
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.4/node_modules/@opencode-ai/sdk/dist/server.js
|
|
110235
110183
|
import { spawn as spawn3 } from "node:child_process";
|
|
110236
110184
|
async function createOpencodeServer(options) {
|
|
110237
110185
|
options = Object.assign({
|
|
@@ -110300,7 +110248,7 @@ Server output: ${output}`;
|
|
|
110300
110248
|
}
|
|
110301
110249
|
};
|
|
110302
110250
|
}
|
|
110303
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.
|
|
110251
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.4/node_modules/@opencode-ai/sdk/dist/index.js
|
|
110304
110252
|
async function createOpencode(options) {
|
|
110305
110253
|
const server2 = await createOpencodeServer({
|
|
110306
110254
|
...options
|
|
@@ -110678,8 +110626,7 @@ app.route({
|
|
|
110678
110626
|
}
|
|
110679
110627
|
}).addTo(app);
|
|
110680
110628
|
|
|
110681
|
-
// ../node_modules/.pnpm/@kevisual+context@0.0.
|
|
110682
|
-
var isBrowser3 = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
110629
|
+
// ../node_modules/.pnpm/@kevisual+context@0.0.6/node_modules/@kevisual/context/dist/app.js
|
|
110683
110630
|
function getDefaultExportFromCjs5(x) {
|
|
110684
110631
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
110685
110632
|
}
|
|
@@ -111212,6 +111159,7 @@ var useConfigKey3 = (key, init, isNew) => {
|
|
|
111212
111159
|
}
|
|
111213
111160
|
return useEnvKey3(key, init, "config");
|
|
111214
111161
|
};
|
|
111162
|
+
|
|
111215
111163
|
class InitEnv3 {
|
|
111216
111164
|
static isInit = false;
|
|
111217
111165
|
static init(opts) {
|
|
@@ -111279,100 +111227,86 @@ app.route({
|
|
|
111279
111227
|
});
|
|
111280
111228
|
}).addTo(app);
|
|
111281
111229
|
|
|
111282
|
-
// ../node_modules/.pnpm/lru-cache@11.2.
|
|
111283
|
-
var
|
|
111284
|
-
var
|
|
111285
|
-
var
|
|
111286
|
-
var
|
|
111287
|
-
typeof
|
|
111288
|
-
};
|
|
111289
|
-
var
|
|
111290
|
-
var
|
|
111291
|
-
if (typeof
|
|
111292
|
-
|
|
111230
|
+
// ../node_modules/.pnpm/lru-cache@11.2.6/node_modules/lru-cache/dist/esm/index.min.js
|
|
111231
|
+
var M = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
111232
|
+
var I = new Set;
|
|
111233
|
+
var R = typeof process == "object" && process ? process : {};
|
|
111234
|
+
var x = (a, t, e, i2) => {
|
|
111235
|
+
typeof R.emitWarning == "function" ? R.emitWarning(a, t, e, i2) : console.error(`[${e}] ${t}: ${a}`);
|
|
111236
|
+
};
|
|
111237
|
+
var C = globalThis.AbortController;
|
|
111238
|
+
var D = globalThis.AbortSignal;
|
|
111239
|
+
if (typeof C > "u") {
|
|
111240
|
+
D = class {
|
|
111293
111241
|
onabort;
|
|
111294
111242
|
_onabort = [];
|
|
111295
111243
|
reason;
|
|
111296
111244
|
aborted = false;
|
|
111297
|
-
addEventListener(
|
|
111298
|
-
this._onabort.push(
|
|
111245
|
+
addEventListener(i2, s) {
|
|
111246
|
+
this._onabort.push(s);
|
|
111299
111247
|
}
|
|
111300
|
-
}
|
|
111301
|
-
AC = class AbortController2 {
|
|
111248
|
+
}, C = class {
|
|
111302
111249
|
constructor() {
|
|
111303
|
-
|
|
111250
|
+
t();
|
|
111304
111251
|
}
|
|
111305
|
-
signal = new
|
|
111306
|
-
abort(
|
|
111307
|
-
if (this.signal.aborted)
|
|
111308
|
-
|
|
111309
|
-
|
|
111310
|
-
|
|
111311
|
-
|
|
111312
|
-
fn(reason);
|
|
111252
|
+
signal = new D;
|
|
111253
|
+
abort(i2) {
|
|
111254
|
+
if (!this.signal.aborted) {
|
|
111255
|
+
this.signal.reason = i2, this.signal.aborted = true;
|
|
111256
|
+
for (let s of this.signal._onabort)
|
|
111257
|
+
s(i2);
|
|
111258
|
+
this.signal.onabort?.(i2);
|
|
111313
111259
|
}
|
|
111314
|
-
this.signal.onabort?.(reason);
|
|
111315
111260
|
}
|
|
111316
111261
|
};
|
|
111317
|
-
let
|
|
111318
|
-
|
|
111319
|
-
if (!printACPolyfillWarning)
|
|
111320
|
-
return;
|
|
111321
|
-
printACPolyfillWarning = false;
|
|
111322
|
-
emitWarning("AbortController is not defined. If using lru-cache in " + "node 14, load an AbortController polyfill from the " + "`node-abort-controller` package. A minimal polyfill is " + "provided for use by LRUCache.fetch(), but it should not be " + "relied upon in other contexts (eg, passing it to other APIs that " + "use AbortController/AbortSignal might have undesirable effects). " + "You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", warnACPolyfill);
|
|
111262
|
+
let a = R.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
|
|
111263
|
+
a && (a = false, x("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t));
|
|
111323
111264
|
};
|
|
111324
111265
|
}
|
|
111325
|
-
var
|
|
111326
|
-
var
|
|
111327
|
-
var
|
|
111328
|
-
var
|
|
111329
|
-
|
|
111330
|
-
|
|
111331
|
-
|
|
111332
|
-
super(size);
|
|
111333
|
-
this.fill(0);
|
|
111266
|
+
var G = (a) => !I.has(a);
|
|
111267
|
+
var H = Symbol("type");
|
|
111268
|
+
var y = (a) => a && a === Math.floor(a) && a > 0 && isFinite(a);
|
|
111269
|
+
var U = (a) => y(a) ? a <= Math.pow(2, 8) ? Uint8Array : a <= Math.pow(2, 16) ? Uint16Array : a <= Math.pow(2, 32) ? Uint32Array : a <= Number.MAX_SAFE_INTEGER ? z4 : null : null;
|
|
111270
|
+
var z4 = class extends Array {
|
|
111271
|
+
constructor(t) {
|
|
111272
|
+
super(t), this.fill(0);
|
|
111334
111273
|
}
|
|
111335
|
-
}
|
|
111336
|
-
|
|
111337
|
-
class Stack2 {
|
|
111274
|
+
};
|
|
111275
|
+
var W = class a {
|
|
111338
111276
|
heap;
|
|
111339
111277
|
length;
|
|
111340
|
-
static #
|
|
111341
|
-
static create(
|
|
111342
|
-
|
|
111343
|
-
if (!
|
|
111278
|
+
static #o = false;
|
|
111279
|
+
static create(t) {
|
|
111280
|
+
let e = U(t);
|
|
111281
|
+
if (!e)
|
|
111344
111282
|
return [];
|
|
111345
|
-
|
|
111346
|
-
|
|
111347
|
-
|
|
111348
|
-
return s;
|
|
111283
|
+
a.#o = true;
|
|
111284
|
+
let i2 = new a(t, e);
|
|
111285
|
+
return a.#o = false, i2;
|
|
111349
111286
|
}
|
|
111350
|
-
constructor(
|
|
111351
|
-
if (!
|
|
111287
|
+
constructor(t, e) {
|
|
111288
|
+
if (!a.#o)
|
|
111352
111289
|
throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
111353
|
-
|
|
111354
|
-
this.heap = new HeapCls(max);
|
|
111355
|
-
this.length = 0;
|
|
111290
|
+
this.heap = new e(t), this.length = 0;
|
|
111356
111291
|
}
|
|
111357
|
-
push(
|
|
111358
|
-
this.heap[this.length++] =
|
|
111292
|
+
push(t) {
|
|
111293
|
+
this.heap[this.length++] = t;
|
|
111359
111294
|
}
|
|
111360
111295
|
pop() {
|
|
111361
111296
|
return this.heap[--this.length];
|
|
111362
111297
|
}
|
|
111363
|
-
}
|
|
111364
|
-
|
|
111365
|
-
|
|
111366
|
-
#
|
|
111367
|
-
#
|
|
111368
|
-
#
|
|
111369
|
-
#
|
|
111370
|
-
#
|
|
111371
|
-
#
|
|
111372
|
-
#
|
|
111373
|
-
#perf;
|
|
111298
|
+
};
|
|
111299
|
+
var L = class a2 {
|
|
111300
|
+
#o;
|
|
111301
|
+
#c;
|
|
111302
|
+
#w;
|
|
111303
|
+
#C;
|
|
111304
|
+
#S;
|
|
111305
|
+
#L;
|
|
111306
|
+
#I;
|
|
111307
|
+
#m;
|
|
111374
111308
|
get perf() {
|
|
111375
|
-
return this.#
|
|
111309
|
+
return this.#m;
|
|
111376
111310
|
}
|
|
111377
111311
|
ttl;
|
|
111378
111312
|
ttlResolution;
|
|
@@ -111389,1057 +111323,521 @@ class LRUCache {
|
|
|
111389
111323
|
allowStaleOnFetchAbort;
|
|
111390
111324
|
allowStaleOnFetchRejection;
|
|
111391
111325
|
ignoreFetchAbort;
|
|
111392
|
-
#
|
|
111393
|
-
#
|
|
111394
|
-
#
|
|
111395
|
-
#
|
|
111396
|
-
#
|
|
111397
|
-
#
|
|
111398
|
-
#
|
|
111399
|
-
#
|
|
111400
|
-
#
|
|
111401
|
-
#
|
|
111402
|
-
#
|
|
111403
|
-
#
|
|
111404
|
-
#
|
|
111405
|
-
#
|
|
111406
|
-
#
|
|
111407
|
-
#
|
|
111408
|
-
#
|
|
111409
|
-
#
|
|
111410
|
-
#
|
|
111411
|
-
static unsafeExposeInternals(
|
|
111412
|
-
return {
|
|
111413
|
-
|
|
111414
|
-
|
|
111415
|
-
|
|
111416
|
-
|
|
111417
|
-
keyMap: c.#keyMap,
|
|
111418
|
-
keyList: c.#keyList,
|
|
111419
|
-
valList: c.#valList,
|
|
111420
|
-
next: c.#next,
|
|
111421
|
-
prev: c.#prev,
|
|
111422
|
-
get head() {
|
|
111423
|
-
return c.#head;
|
|
111424
|
-
},
|
|
111425
|
-
get tail() {
|
|
111426
|
-
return c.#tail;
|
|
111427
|
-
},
|
|
111428
|
-
free: c.#free,
|
|
111429
|
-
isBackgroundFetch: (p) => c.#isBackgroundFetch(p),
|
|
111430
|
-
backgroundFetch: (k, index3, options, context) => c.#backgroundFetch(k, index3, options, context),
|
|
111431
|
-
moveToTail: (index3) => c.#moveToTail(index3),
|
|
111432
|
-
indexes: (options) => c.#indexes(options),
|
|
111433
|
-
rindexes: (options) => c.#rindexes(options),
|
|
111434
|
-
isStale: (index3) => c.#isStale(index3)
|
|
111435
|
-
};
|
|
111326
|
+
#n;
|
|
111327
|
+
#_;
|
|
111328
|
+
#s;
|
|
111329
|
+
#i;
|
|
111330
|
+
#t;
|
|
111331
|
+
#a;
|
|
111332
|
+
#u;
|
|
111333
|
+
#l;
|
|
111334
|
+
#h;
|
|
111335
|
+
#b;
|
|
111336
|
+
#r;
|
|
111337
|
+
#y;
|
|
111338
|
+
#A;
|
|
111339
|
+
#d;
|
|
111340
|
+
#g;
|
|
111341
|
+
#T;
|
|
111342
|
+
#v;
|
|
111343
|
+
#f;
|
|
111344
|
+
#x;
|
|
111345
|
+
static unsafeExposeInternals(t) {
|
|
111346
|
+
return { starts: t.#A, ttls: t.#d, autopurgeTimers: t.#g, sizes: t.#y, keyMap: t.#s, keyList: t.#i, valList: t.#t, next: t.#a, prev: t.#u, get head() {
|
|
111347
|
+
return t.#l;
|
|
111348
|
+
}, get tail() {
|
|
111349
|
+
return t.#h;
|
|
111350
|
+
}, free: t.#b, isBackgroundFetch: (e) => t.#e(e), backgroundFetch: (e, i2, s, h) => t.#G(e, i2, s, h), moveToTail: (e) => t.#D(e), indexes: (e) => t.#F(e), rindexes: (e) => t.#O(e), isStale: (e) => t.#p(e) };
|
|
111436
111351
|
}
|
|
111437
111352
|
get max() {
|
|
111438
|
-
return this.#
|
|
111353
|
+
return this.#o;
|
|
111439
111354
|
}
|
|
111440
111355
|
get maxSize() {
|
|
111441
|
-
return this.#
|
|
111356
|
+
return this.#c;
|
|
111442
111357
|
}
|
|
111443
111358
|
get calculatedSize() {
|
|
111444
|
-
return this.#
|
|
111359
|
+
return this.#_;
|
|
111445
111360
|
}
|
|
111446
111361
|
get size() {
|
|
111447
|
-
return this.#
|
|
111362
|
+
return this.#n;
|
|
111448
111363
|
}
|
|
111449
111364
|
get fetchMethod() {
|
|
111450
|
-
return this.#
|
|
111365
|
+
return this.#L;
|
|
111451
111366
|
}
|
|
111452
111367
|
get memoMethod() {
|
|
111453
|
-
return this.#
|
|
111368
|
+
return this.#I;
|
|
111454
111369
|
}
|
|
111455
111370
|
get dispose() {
|
|
111456
|
-
return this.#
|
|
111371
|
+
return this.#w;
|
|
111457
111372
|
}
|
|
111458
111373
|
get onInsert() {
|
|
111459
|
-
return this.#
|
|
111374
|
+
return this.#C;
|
|
111460
111375
|
}
|
|
111461
111376
|
get disposeAfter() {
|
|
111462
|
-
return this.#
|
|
111377
|
+
return this.#S;
|
|
111463
111378
|
}
|
|
111464
|
-
constructor(
|
|
111465
|
-
|
|
111466
|
-
if (
|
|
111467
|
-
|
|
111468
|
-
|
|
111469
|
-
}
|
|
111470
|
-
}
|
|
111471
|
-
this.#perf = perf ?? defaultPerf;
|
|
111472
|
-
if (max !== 0 && !isPosInt(max)) {
|
|
111379
|
+
constructor(t) {
|
|
111380
|
+
let { max: e = 0, ttl: i2, ttlResolution: s = 1, ttlAutopurge: h, updateAgeOnGet: n, updateAgeOnHas: o, allowStale: r, dispose: f, onInsert: m, disposeAfter: c, noDisposeOnSet: d, noUpdateTTL: g, maxSize: A = 0, maxEntrySize: p = 0, sizeCalculation: _, fetchMethod: l, memoMethod: w, noDeleteOnFetchRejection: b, noDeleteOnStaleGet: S, allowStaleOnFetchRejection: u, allowStaleOnFetchAbort: T, ignoreFetchAbort: F, perf: v } = t;
|
|
111381
|
+
if (v !== undefined && typeof v?.now != "function")
|
|
111382
|
+
throw new TypeError("perf option must have a now() method if specified");
|
|
111383
|
+
if (this.#m = v ?? M, e !== 0 && !y(e))
|
|
111473
111384
|
throw new TypeError("max option must be a nonnegative integer");
|
|
111474
|
-
|
|
111475
|
-
|
|
111476
|
-
|
|
111477
|
-
|
|
111478
|
-
|
|
111479
|
-
this.#max = max;
|
|
111480
|
-
this.#maxSize = maxSize;
|
|
111481
|
-
this.maxEntrySize = maxEntrySize || this.#maxSize;
|
|
111482
|
-
this.sizeCalculation = sizeCalculation;
|
|
111483
|
-
if (this.sizeCalculation) {
|
|
111484
|
-
if (!this.#maxSize && !this.maxEntrySize) {
|
|
111385
|
+
let O = e ? U(e) : Array;
|
|
111386
|
+
if (!O)
|
|
111387
|
+
throw new Error("invalid max value: " + e);
|
|
111388
|
+
if (this.#o = e, this.#c = A, this.maxEntrySize = p || this.#c, this.sizeCalculation = _, this.sizeCalculation) {
|
|
111389
|
+
if (!this.#c && !this.maxEntrySize)
|
|
111485
111390
|
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
111486
|
-
|
|
111487
|
-
if (typeof this.sizeCalculation !== "function") {
|
|
111391
|
+
if (typeof this.sizeCalculation != "function")
|
|
111488
111392
|
throw new TypeError("sizeCalculation set to non-function");
|
|
111489
|
-
}
|
|
111490
111393
|
}
|
|
111491
|
-
if (
|
|
111394
|
+
if (w !== undefined && typeof w != "function")
|
|
111492
111395
|
throw new TypeError("memoMethod must be a function if defined");
|
|
111493
|
-
|
|
111494
|
-
this.#memoMethod = memoMethod;
|
|
111495
|
-
if (fetchMethod !== undefined && typeof fetchMethod !== "function") {
|
|
111396
|
+
if (this.#I = w, l !== undefined && typeof l != "function")
|
|
111496
111397
|
throw new TypeError("fetchMethod must be a function if specified");
|
|
111497
|
-
|
|
111498
|
-
|
|
111499
|
-
|
|
111500
|
-
|
|
111501
|
-
this.#keyList = new Array(max).fill(undefined);
|
|
111502
|
-
this.#valList = new Array(max).fill(undefined);
|
|
111503
|
-
this.#next = new UintArray(max);
|
|
111504
|
-
this.#prev = new UintArray(max);
|
|
111505
|
-
this.#head = 0;
|
|
111506
|
-
this.#tail = 0;
|
|
111507
|
-
this.#free = Stack2.create(max);
|
|
111508
|
-
this.#size = 0;
|
|
111509
|
-
this.#calculatedSize = 0;
|
|
111510
|
-
if (typeof dispose === "function") {
|
|
111511
|
-
this.#dispose = dispose;
|
|
111512
|
-
}
|
|
111513
|
-
if (typeof onInsert === "function") {
|
|
111514
|
-
this.#onInsert = onInsert;
|
|
111515
|
-
}
|
|
111516
|
-
if (typeof disposeAfter === "function") {
|
|
111517
|
-
this.#disposeAfter = disposeAfter;
|
|
111518
|
-
this.#disposed = [];
|
|
111519
|
-
} else {
|
|
111520
|
-
this.#disposeAfter = undefined;
|
|
111521
|
-
this.#disposed = undefined;
|
|
111522
|
-
}
|
|
111523
|
-
this.#hasDispose = !!this.#dispose;
|
|
111524
|
-
this.#hasOnInsert = !!this.#onInsert;
|
|
111525
|
-
this.#hasDisposeAfter = !!this.#disposeAfter;
|
|
111526
|
-
this.noDisposeOnSet = !!noDisposeOnSet;
|
|
111527
|
-
this.noUpdateTTL = !!noUpdateTTL;
|
|
111528
|
-
this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
|
|
111529
|
-
this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
|
|
111530
|
-
this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
|
|
111531
|
-
this.ignoreFetchAbort = !!ignoreFetchAbort;
|
|
111532
|
-
if (this.maxEntrySize !== 0) {
|
|
111533
|
-
if (this.#maxSize !== 0) {
|
|
111534
|
-
if (!isPosInt(this.#maxSize)) {
|
|
111535
|
-
throw new TypeError("maxSize must be a positive integer if specified");
|
|
111536
|
-
}
|
|
111537
|
-
}
|
|
111538
|
-
if (!isPosInt(this.maxEntrySize)) {
|
|
111398
|
+
if (this.#L = l, this.#v = !!l, this.#s = new Map, this.#i = new Array(e).fill(undefined), this.#t = new Array(e).fill(undefined), this.#a = new O(e), this.#u = new O(e), this.#l = 0, this.#h = 0, this.#b = W.create(e), this.#n = 0, this.#_ = 0, typeof f == "function" && (this.#w = f), typeof m == "function" && (this.#C = m), typeof c == "function" ? (this.#S = c, this.#r = []) : (this.#S = undefined, this.#r = undefined), this.#T = !!this.#w, this.#x = !!this.#C, this.#f = !!this.#S, this.noDisposeOnSet = !!d, this.noUpdateTTL = !!g, this.noDeleteOnFetchRejection = !!b, this.allowStaleOnFetchRejection = !!u, this.allowStaleOnFetchAbort = !!T, this.ignoreFetchAbort = !!F, this.maxEntrySize !== 0) {
|
|
111399
|
+
if (this.#c !== 0 && !y(this.#c))
|
|
111400
|
+
throw new TypeError("maxSize must be a positive integer if specified");
|
|
111401
|
+
if (!y(this.maxEntrySize))
|
|
111539
111402
|
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
111540
|
-
|
|
111541
|
-
|
|
111542
|
-
|
|
111543
|
-
|
|
111544
|
-
this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
|
|
111545
|
-
this.updateAgeOnGet = !!updateAgeOnGet;
|
|
111546
|
-
this.updateAgeOnHas = !!updateAgeOnHas;
|
|
111547
|
-
this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;
|
|
111548
|
-
this.ttlAutopurge = !!ttlAutopurge;
|
|
111549
|
-
this.ttl = ttl || 0;
|
|
111550
|
-
if (this.ttl) {
|
|
111551
|
-
if (!isPosInt(this.ttl)) {
|
|
111403
|
+
this.#B();
|
|
111404
|
+
}
|
|
111405
|
+
if (this.allowStale = !!r, this.noDeleteOnStaleGet = !!S, this.updateAgeOnGet = !!n, this.updateAgeOnHas = !!o, this.ttlResolution = y(s) || s === 0 ? s : 1, this.ttlAutopurge = !!h, this.ttl = i2 || 0, this.ttl) {
|
|
111406
|
+
if (!y(this.ttl))
|
|
111552
111407
|
throw new TypeError("ttl must be a positive integer if specified");
|
|
111553
|
-
|
|
111554
|
-
this.#initializeTTLTracking();
|
|
111408
|
+
this.#j();
|
|
111555
111409
|
}
|
|
111556
|
-
if (this.#
|
|
111410
|
+
if (this.#o === 0 && this.ttl === 0 && this.#c === 0)
|
|
111557
111411
|
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
111558
|
-
|
|
111559
|
-
|
|
111560
|
-
|
|
111561
|
-
|
|
111562
|
-
|
|
111563
|
-
|
|
111564
|
-
|
|
111565
|
-
|
|
111566
|
-
|
|
111567
|
-
|
|
111568
|
-
|
|
111569
|
-
|
|
111570
|
-
|
|
111571
|
-
|
|
111572
|
-
|
|
111573
|
-
|
|
111574
|
-
|
|
111575
|
-
|
|
111576
|
-
|
|
111577
|
-
this.#
|
|
111578
|
-
|
|
111579
|
-
|
|
111580
|
-
|
|
111581
|
-
|
|
111582
|
-
|
|
111583
|
-
purgeTimers[index3] = undefined;
|
|
111584
|
-
}
|
|
111585
|
-
if (ttl !== 0 && purgeTimers) {
|
|
111586
|
-
const t = setTimeout(() => {
|
|
111587
|
-
if (this.#isStale(index3)) {
|
|
111588
|
-
this.#delete(this.#keyList[index3], "expire");
|
|
111589
|
-
}
|
|
111590
|
-
}, ttl + 1);
|
|
111591
|
-
if (t.unref) {
|
|
111592
|
-
t.unref();
|
|
111593
|
-
}
|
|
111594
|
-
purgeTimers[index3] = t;
|
|
111595
|
-
}
|
|
111596
|
-
};
|
|
111597
|
-
this.#updateItemAge = (index3) => {
|
|
111598
|
-
starts[index3] = ttls[index3] !== 0 ? this.#perf.now() : 0;
|
|
111599
|
-
};
|
|
111600
|
-
this.#statusTTL = (status, index3) => {
|
|
111601
|
-
if (ttls[index3]) {
|
|
111602
|
-
const ttl = ttls[index3];
|
|
111603
|
-
const start4 = starts[index3];
|
|
111604
|
-
if (!ttl || !start4)
|
|
111412
|
+
if (!this.ttlAutopurge && !this.#o && !this.#c) {
|
|
111413
|
+
let E2 = "LRU_CACHE_UNBOUNDED";
|
|
111414
|
+
G(E2) && (I.add(E2), x("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E2, a2));
|
|
111415
|
+
}
|
|
111416
|
+
}
|
|
111417
|
+
getRemainingTTL(t) {
|
|
111418
|
+
return this.#s.has(t) ? 1 / 0 : 0;
|
|
111419
|
+
}
|
|
111420
|
+
#j() {
|
|
111421
|
+
let t = new z4(this.#o), e = new z4(this.#o);
|
|
111422
|
+
this.#d = t, this.#A = e;
|
|
111423
|
+
let i2 = this.ttlAutopurge ? new Array(this.#o) : undefined;
|
|
111424
|
+
this.#g = i2, this.#N = (n, o, r = this.#m.now()) => {
|
|
111425
|
+
if (e[n] = o !== 0 ? r : 0, t[n] = o, i2?.[n] && (clearTimeout(i2[n]), i2[n] = undefined), o !== 0 && i2) {
|
|
111426
|
+
let f = setTimeout(() => {
|
|
111427
|
+
this.#p(n) && this.#E(this.#i[n], "expire");
|
|
111428
|
+
}, o + 1);
|
|
111429
|
+
f.unref && f.unref(), i2[n] = f;
|
|
111430
|
+
}
|
|
111431
|
+
}, this.#R = (n) => {
|
|
111432
|
+
e[n] = t[n] !== 0 ? this.#m.now() : 0;
|
|
111433
|
+
}, this.#z = (n, o) => {
|
|
111434
|
+
if (t[o]) {
|
|
111435
|
+
let r = t[o], f = e[o];
|
|
111436
|
+
if (!r || !f)
|
|
111605
111437
|
return;
|
|
111606
|
-
|
|
111607
|
-
|
|
111608
|
-
|
|
111609
|
-
const age = status.now - start4;
|
|
111610
|
-
status.remainingTTL = ttl - age;
|
|
111438
|
+
n.ttl = r, n.start = f, n.now = s || h();
|
|
111439
|
+
let m = n.now - f;
|
|
111440
|
+
n.remainingTTL = r - m;
|
|
111611
111441
|
}
|
|
111612
111442
|
};
|
|
111613
|
-
let
|
|
111614
|
-
|
|
111615
|
-
const n = this.#perf.now();
|
|
111443
|
+
let s = 0, h = () => {
|
|
111444
|
+
let n = this.#m.now();
|
|
111616
111445
|
if (this.ttlResolution > 0) {
|
|
111617
|
-
|
|
111618
|
-
|
|
111619
|
-
|
|
111620
|
-
t.unref();
|
|
111621
|
-
}
|
|
111446
|
+
s = n;
|
|
111447
|
+
let o = setTimeout(() => s = 0, this.ttlResolution);
|
|
111448
|
+
o.unref && o.unref();
|
|
111622
111449
|
}
|
|
111623
111450
|
return n;
|
|
111624
111451
|
};
|
|
111625
|
-
this.getRemainingTTL = (
|
|
111626
|
-
|
|
111627
|
-
if (
|
|
111452
|
+
this.getRemainingTTL = (n) => {
|
|
111453
|
+
let o = this.#s.get(n);
|
|
111454
|
+
if (o === undefined)
|
|
111628
111455
|
return 0;
|
|
111629
|
-
|
|
111630
|
-
|
|
111631
|
-
|
|
111632
|
-
|
|
111633
|
-
|
|
111634
|
-
|
|
111635
|
-
|
|
111636
|
-
return
|
|
111637
|
-
};
|
|
111638
|
-
|
|
111639
|
-
|
|
111640
|
-
|
|
111641
|
-
|
|
111642
|
-
|
|
111643
|
-
|
|
111644
|
-
|
|
111645
|
-
|
|
111646
|
-
|
|
111647
|
-
|
|
111648
|
-
|
|
111649
|
-
const sizes = new ZeroArray(this.#max);
|
|
111650
|
-
this.#calculatedSize = 0;
|
|
111651
|
-
this.#sizes = sizes;
|
|
111652
|
-
this.#removeItemSize = (index3) => {
|
|
111653
|
-
this.#calculatedSize -= sizes[index3];
|
|
111654
|
-
sizes[index3] = 0;
|
|
111655
|
-
};
|
|
111656
|
-
this.#requireSize = (k, v, size, sizeCalculation) => {
|
|
111657
|
-
if (this.#isBackgroundFetch(v)) {
|
|
111456
|
+
let r = t[o], f = e[o];
|
|
111457
|
+
if (!r || !f)
|
|
111458
|
+
return 1 / 0;
|
|
111459
|
+
let m = (s || h()) - f;
|
|
111460
|
+
return r - m;
|
|
111461
|
+
}, this.#p = (n) => {
|
|
111462
|
+
let o = e[n], r = t[n];
|
|
111463
|
+
return !!r && !!o && (s || h()) - o > r;
|
|
111464
|
+
};
|
|
111465
|
+
}
|
|
111466
|
+
#R = () => {};
|
|
111467
|
+
#z = () => {};
|
|
111468
|
+
#N = () => {};
|
|
111469
|
+
#p = () => false;
|
|
111470
|
+
#B() {
|
|
111471
|
+
let t = new z4(this.#o);
|
|
111472
|
+
this.#_ = 0, this.#y = t, this.#W = (e) => {
|
|
111473
|
+
this.#_ -= t[e], t[e] = 0;
|
|
111474
|
+
}, this.#P = (e, i2, s, h) => {
|
|
111475
|
+
if (this.#e(i2))
|
|
111658
111476
|
return 0;
|
|
111659
|
-
|
|
111660
|
-
|
|
111661
|
-
|
|
111662
|
-
if (typeof sizeCalculation !== "function") {
|
|
111477
|
+
if (!y(s))
|
|
111478
|
+
if (h) {
|
|
111479
|
+
if (typeof h != "function")
|
|
111663
111480
|
throw new TypeError("sizeCalculation must be a function");
|
|
111664
|
-
|
|
111665
|
-
size = sizeCalculation(v, k);
|
|
111666
|
-
if (!isPosInt(size)) {
|
|
111481
|
+
if (s = h(i2, e), !y(s))
|
|
111667
111482
|
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
111668
|
-
|
|
111669
|
-
|
|
111670
|
-
|
|
111671
|
-
|
|
111672
|
-
|
|
111673
|
-
|
|
111674
|
-
|
|
111675
|
-
|
|
111676
|
-
sizes[index3] = size;
|
|
111677
|
-
if (this.#maxSize) {
|
|
111678
|
-
const maxSize = this.#maxSize - sizes[index3];
|
|
111679
|
-
while (this.#calculatedSize > maxSize) {
|
|
111680
|
-
this.#evict(true);
|
|
111681
|
-
}
|
|
111682
|
-
}
|
|
111683
|
-
this.#calculatedSize += sizes[index3];
|
|
111684
|
-
if (status) {
|
|
111685
|
-
status.entrySize = size;
|
|
111686
|
-
status.totalCalculatedSize = this.#calculatedSize;
|
|
111483
|
+
} else
|
|
111484
|
+
throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
111485
|
+
return s;
|
|
111486
|
+
}, this.#U = (e, i2, s) => {
|
|
111487
|
+
if (t[e] = i2, this.#c) {
|
|
111488
|
+
let h = this.#c - t[e];
|
|
111489
|
+
for (;this.#_ > h; )
|
|
111490
|
+
this.#M(true);
|
|
111687
111491
|
}
|
|
111492
|
+
this.#_ += t[e], s && (s.entrySize = i2, s.totalCalculatedSize = this.#_);
|
|
111688
111493
|
};
|
|
111689
111494
|
}
|
|
111690
|
-
#
|
|
111691
|
-
#
|
|
111692
|
-
#
|
|
111693
|
-
if (
|
|
111495
|
+
#W = (t) => {};
|
|
111496
|
+
#U = (t, e, i2) => {};
|
|
111497
|
+
#P = (t, e, i2, s) => {
|
|
111498
|
+
if (i2 || s)
|
|
111694
111499
|
throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
111695
|
-
}
|
|
111696
111500
|
return 0;
|
|
111697
111501
|
};
|
|
111698
|
-
*#
|
|
111699
|
-
if (this.#
|
|
111700
|
-
for (let
|
|
111701
|
-
|
|
111702
|
-
break;
|
|
111703
|
-
}
|
|
111704
|
-
if (allowStale || !this.#isStale(i2)) {
|
|
111705
|
-
yield i2;
|
|
111706
|
-
}
|
|
111707
|
-
if (i2 === this.#head) {
|
|
111708
|
-
break;
|
|
111709
|
-
} else {
|
|
111710
|
-
i2 = this.#prev[i2];
|
|
111711
|
-
}
|
|
111712
|
-
}
|
|
111713
|
-
}
|
|
111502
|
+
*#F({ allowStale: t = this.allowStale } = {}) {
|
|
111503
|
+
if (this.#n)
|
|
111504
|
+
for (let e = this.#h;!(!this.#H(e) || ((t || !this.#p(e)) && (yield e), e === this.#l)); )
|
|
111505
|
+
e = this.#u[e];
|
|
111714
111506
|
}
|
|
111715
|
-
*#
|
|
111716
|
-
if (this.#
|
|
111717
|
-
for (let
|
|
111718
|
-
|
|
111719
|
-
break;
|
|
111720
|
-
}
|
|
111721
|
-
if (allowStale || !this.#isStale(i2)) {
|
|
111722
|
-
yield i2;
|
|
111723
|
-
}
|
|
111724
|
-
if (i2 === this.#tail) {
|
|
111725
|
-
break;
|
|
111726
|
-
} else {
|
|
111727
|
-
i2 = this.#next[i2];
|
|
111728
|
-
}
|
|
111729
|
-
}
|
|
111730
|
-
}
|
|
111507
|
+
*#O({ allowStale: t = this.allowStale } = {}) {
|
|
111508
|
+
if (this.#n)
|
|
111509
|
+
for (let e = this.#l;!(!this.#H(e) || ((t || !this.#p(e)) && (yield e), e === this.#h)); )
|
|
111510
|
+
e = this.#a[e];
|
|
111731
111511
|
}
|
|
111732
|
-
#
|
|
111733
|
-
return
|
|
111512
|
+
#H(t) {
|
|
111513
|
+
return t !== undefined && this.#s.get(this.#i[t]) === t;
|
|
111734
111514
|
}
|
|
111735
111515
|
*entries() {
|
|
111736
|
-
for (
|
|
111737
|
-
|
|
111738
|
-
yield [this.#keyList[i2], this.#valList[i2]];
|
|
111739
|
-
}
|
|
111740
|
-
}
|
|
111516
|
+
for (let t of this.#F())
|
|
111517
|
+
this.#t[t] !== undefined && this.#i[t] !== undefined && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
|
|
111741
111518
|
}
|
|
111742
111519
|
*rentries() {
|
|
111743
|
-
for (
|
|
111744
|
-
|
|
111745
|
-
yield [this.#keyList[i2], this.#valList[i2]];
|
|
111746
|
-
}
|
|
111747
|
-
}
|
|
111520
|
+
for (let t of this.#O())
|
|
111521
|
+
this.#t[t] !== undefined && this.#i[t] !== undefined && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
|
|
111748
111522
|
}
|
|
111749
111523
|
*keys() {
|
|
111750
|
-
for (
|
|
111751
|
-
|
|
111752
|
-
|
|
111753
|
-
yield k;
|
|
111754
|
-
}
|
|
111524
|
+
for (let t of this.#F()) {
|
|
111525
|
+
let e = this.#i[t];
|
|
111526
|
+
e !== undefined && !this.#e(this.#t[t]) && (yield e);
|
|
111755
111527
|
}
|
|
111756
111528
|
}
|
|
111757
111529
|
*rkeys() {
|
|
111758
|
-
for (
|
|
111759
|
-
|
|
111760
|
-
|
|
111761
|
-
yield k;
|
|
111762
|
-
}
|
|
111530
|
+
for (let t of this.#O()) {
|
|
111531
|
+
let e = this.#i[t];
|
|
111532
|
+
e !== undefined && !this.#e(this.#t[t]) && (yield e);
|
|
111763
111533
|
}
|
|
111764
111534
|
}
|
|
111765
111535
|
*values() {
|
|
111766
|
-
for (
|
|
111767
|
-
|
|
111768
|
-
if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
|
111769
|
-
yield this.#valList[i2];
|
|
111770
|
-
}
|
|
111771
|
-
}
|
|
111536
|
+
for (let t of this.#F())
|
|
111537
|
+
this.#t[t] !== undefined && !this.#e(this.#t[t]) && (yield this.#t[t]);
|
|
111772
111538
|
}
|
|
111773
111539
|
*rvalues() {
|
|
111774
|
-
for (
|
|
111775
|
-
|
|
111776
|
-
if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
|
111777
|
-
yield this.#valList[i2];
|
|
111778
|
-
}
|
|
111779
|
-
}
|
|
111540
|
+
for (let t of this.#O())
|
|
111541
|
+
this.#t[t] !== undefined && !this.#e(this.#t[t]) && (yield this.#t[t]);
|
|
111780
111542
|
}
|
|
111781
111543
|
[Symbol.iterator]() {
|
|
111782
111544
|
return this.entries();
|
|
111783
111545
|
}
|
|
111784
111546
|
[Symbol.toStringTag] = "LRUCache";
|
|
111785
|
-
find(
|
|
111786
|
-
for (
|
|
111787
|
-
|
|
111788
|
-
|
|
111789
|
-
|
|
111790
|
-
continue;
|
|
111791
|
-
if (fn(value, this.#keyList[i2], this)) {
|
|
111792
|
-
return this.get(this.#keyList[i2], getOptions);
|
|
111793
|
-
}
|
|
111547
|
+
find(t, e = {}) {
|
|
111548
|
+
for (let i2 of this.#F()) {
|
|
111549
|
+
let s = this.#t[i2], h = this.#e(s) ? s.__staleWhileFetching : s;
|
|
111550
|
+
if (h !== undefined && t(h, this.#i[i2], this))
|
|
111551
|
+
return this.get(this.#i[i2], e);
|
|
111794
111552
|
}
|
|
111795
111553
|
}
|
|
111796
|
-
forEach(
|
|
111797
|
-
for (
|
|
111798
|
-
|
|
111799
|
-
|
|
111800
|
-
if (value === undefined)
|
|
111801
|
-
continue;
|
|
111802
|
-
fn.call(thisp, value, this.#keyList[i2], this);
|
|
111554
|
+
forEach(t, e = this) {
|
|
111555
|
+
for (let i2 of this.#F()) {
|
|
111556
|
+
let s = this.#t[i2], h = this.#e(s) ? s.__staleWhileFetching : s;
|
|
111557
|
+
h !== undefined && t.call(e, h, this.#i[i2], this);
|
|
111803
111558
|
}
|
|
111804
111559
|
}
|
|
111805
|
-
rforEach(
|
|
111806
|
-
for (
|
|
111807
|
-
|
|
111808
|
-
|
|
111809
|
-
if (value === undefined)
|
|
111810
|
-
continue;
|
|
111811
|
-
fn.call(thisp, value, this.#keyList[i2], this);
|
|
111560
|
+
rforEach(t, e = this) {
|
|
111561
|
+
for (let i2 of this.#O()) {
|
|
111562
|
+
let s = this.#t[i2], h = this.#e(s) ? s.__staleWhileFetching : s;
|
|
111563
|
+
h !== undefined && t.call(e, h, this.#i[i2], this);
|
|
111812
111564
|
}
|
|
111813
111565
|
}
|
|
111814
111566
|
purgeStale() {
|
|
111815
|
-
let
|
|
111816
|
-
for (
|
|
111817
|
-
|
|
111818
|
-
|
|
111819
|
-
|
|
111820
|
-
|
|
111821
|
-
|
|
111822
|
-
|
|
111823
|
-
}
|
|
111824
|
-
info(key) {
|
|
111825
|
-
const i2 = this.#keyMap.get(key);
|
|
111826
|
-
if (i2 === undefined)
|
|
111567
|
+
let t = false;
|
|
111568
|
+
for (let e of this.#O({ allowStale: true }))
|
|
111569
|
+
this.#p(e) && (this.#E(this.#i[e], "expire"), t = true);
|
|
111570
|
+
return t;
|
|
111571
|
+
}
|
|
111572
|
+
info(t) {
|
|
111573
|
+
let e = this.#s.get(t);
|
|
111574
|
+
if (e === undefined)
|
|
111827
111575
|
return;
|
|
111828
|
-
|
|
111829
|
-
|
|
111830
|
-
if (value === undefined)
|
|
111576
|
+
let i2 = this.#t[e], s = this.#e(i2) ? i2.__staleWhileFetching : i2;
|
|
111577
|
+
if (s === undefined)
|
|
111831
111578
|
return;
|
|
111832
|
-
|
|
111833
|
-
if (this.#
|
|
111834
|
-
|
|
111835
|
-
|
|
111836
|
-
|
|
111837
|
-
|
|
111838
|
-
entry2.ttl = remain;
|
|
111839
|
-
entry2.start = Date.now();
|
|
111579
|
+
let h = { value: s };
|
|
111580
|
+
if (this.#d && this.#A) {
|
|
111581
|
+
let n = this.#d[e], o = this.#A[e];
|
|
111582
|
+
if (n && o) {
|
|
111583
|
+
let r = n - (this.#m.now() - o);
|
|
111584
|
+
h.ttl = r, h.start = Date.now();
|
|
111840
111585
|
}
|
|
111841
111586
|
}
|
|
111842
|
-
|
|
111843
|
-
entry2.size = this.#sizes[i2];
|
|
111844
|
-
}
|
|
111845
|
-
return entry2;
|
|
111587
|
+
return this.#y && (h.size = this.#y[e]), h;
|
|
111846
111588
|
}
|
|
111847
111589
|
dump() {
|
|
111848
|
-
|
|
111849
|
-
for (
|
|
111850
|
-
|
|
111851
|
-
|
|
111852
|
-
const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
111853
|
-
if (value === undefined || key === undefined)
|
|
111590
|
+
let t = [];
|
|
111591
|
+
for (let e of this.#F({ allowStale: true })) {
|
|
111592
|
+
let i2 = this.#i[e], s = this.#t[e], h = this.#e(s) ? s.__staleWhileFetching : s;
|
|
111593
|
+
if (h === undefined || i2 === undefined)
|
|
111854
111594
|
continue;
|
|
111855
|
-
|
|
111856
|
-
if (this.#
|
|
111857
|
-
|
|
111858
|
-
|
|
111859
|
-
|
|
111595
|
+
let n = { value: h };
|
|
111596
|
+
if (this.#d && this.#A) {
|
|
111597
|
+
n.ttl = this.#d[e];
|
|
111598
|
+
let o = this.#m.now() - this.#A[e];
|
|
111599
|
+
n.start = Math.floor(Date.now() - o);
|
|
111860
111600
|
}
|
|
111861
|
-
|
|
111862
|
-
entry2.size = this.#sizes[i2];
|
|
111863
|
-
}
|
|
111864
|
-
arr.unshift([key, entry2]);
|
|
111601
|
+
this.#y && (n.size = this.#y[e]), t.unshift([i2, n]);
|
|
111865
111602
|
}
|
|
111866
|
-
return
|
|
111603
|
+
return t;
|
|
111867
111604
|
}
|
|
111868
|
-
load(
|
|
111605
|
+
load(t) {
|
|
111869
111606
|
this.clear();
|
|
111870
|
-
for (
|
|
111871
|
-
if (
|
|
111872
|
-
|
|
111873
|
-
|
|
111874
|
-
}
|
|
111875
|
-
this.set(
|
|
111876
|
-
}
|
|
111877
|
-
}
|
|
111878
|
-
set(
|
|
111879
|
-
if (
|
|
111880
|
-
this.delete(
|
|
111881
|
-
|
|
111882
|
-
|
|
111883
|
-
|
|
111884
|
-
let
|
|
111885
|
-
|
|
111886
|
-
|
|
111887
|
-
|
|
111888
|
-
|
|
111889
|
-
|
|
111890
|
-
|
|
111891
|
-
|
|
111892
|
-
|
|
111893
|
-
|
|
111894
|
-
|
|
111895
|
-
|
|
111896
|
-
|
|
111897
|
-
|
|
111898
|
-
|
|
111899
|
-
|
|
111900
|
-
|
|
111901
|
-
this.#prev[index3] = this.#tail;
|
|
111902
|
-
this.#tail = index3;
|
|
111903
|
-
this.#size++;
|
|
111904
|
-
this.#addItemSize(index3, size, status);
|
|
111905
|
-
if (status)
|
|
111906
|
-
status.set = "add";
|
|
111907
|
-
noUpdateTTL = false;
|
|
111908
|
-
if (this.#hasOnInsert) {
|
|
111909
|
-
this.#onInsert?.(v, k, "add");
|
|
111910
|
-
}
|
|
111911
|
-
} else {
|
|
111912
|
-
this.#moveToTail(index3);
|
|
111913
|
-
const oldVal = this.#valList[index3];
|
|
111914
|
-
if (v !== oldVal) {
|
|
111915
|
-
if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
|
|
111916
|
-
oldVal.__abortController.abort(new Error("replaced"));
|
|
111917
|
-
const { __staleWhileFetching: s } = oldVal;
|
|
111918
|
-
if (s !== undefined && !noDisposeOnSet) {
|
|
111919
|
-
if (this.#hasDispose) {
|
|
111920
|
-
this.#dispose?.(s, k, "set");
|
|
111921
|
-
}
|
|
111922
|
-
if (this.#hasDisposeAfter) {
|
|
111923
|
-
this.#disposed?.push([s, k, "set"]);
|
|
111924
|
-
}
|
|
111925
|
-
}
|
|
111926
|
-
} else if (!noDisposeOnSet) {
|
|
111927
|
-
if (this.#hasDispose) {
|
|
111928
|
-
this.#dispose?.(oldVal, k, "set");
|
|
111929
|
-
}
|
|
111930
|
-
if (this.#hasDisposeAfter) {
|
|
111931
|
-
this.#disposed?.push([oldVal, k, "set"]);
|
|
111932
|
-
}
|
|
111933
|
-
}
|
|
111934
|
-
this.#removeItemSize(index3);
|
|
111935
|
-
this.#addItemSize(index3, size, status);
|
|
111936
|
-
this.#valList[index3] = v;
|
|
111937
|
-
if (status) {
|
|
111938
|
-
status.set = "replace";
|
|
111939
|
-
const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? oldVal.__staleWhileFetching : oldVal;
|
|
111940
|
-
if (oldValue !== undefined)
|
|
111941
|
-
status.oldValue = oldValue;
|
|
111607
|
+
for (let [e, i2] of t) {
|
|
111608
|
+
if (i2.start) {
|
|
111609
|
+
let s = Date.now() - i2.start;
|
|
111610
|
+
i2.start = this.#m.now() - s;
|
|
111611
|
+
}
|
|
111612
|
+
this.set(e, i2.value, i2);
|
|
111613
|
+
}
|
|
111614
|
+
}
|
|
111615
|
+
set(t, e, i2 = {}) {
|
|
111616
|
+
if (e === undefined)
|
|
111617
|
+
return this.delete(t), this;
|
|
111618
|
+
let { ttl: s = this.ttl, start: h, noDisposeOnSet: n = this.noDisposeOnSet, sizeCalculation: o = this.sizeCalculation, status: r } = i2, { noUpdateTTL: f = this.noUpdateTTL } = i2, m = this.#P(t, e, i2.size || 0, o);
|
|
111619
|
+
if (this.maxEntrySize && m > this.maxEntrySize)
|
|
111620
|
+
return r && (r.set = "miss", r.maxEntrySizeExceeded = true), this.#E(t, "set"), this;
|
|
111621
|
+
let c = this.#n === 0 ? undefined : this.#s.get(t);
|
|
111622
|
+
if (c === undefined)
|
|
111623
|
+
c = this.#n === 0 ? this.#h : this.#b.length !== 0 ? this.#b.pop() : this.#n === this.#o ? this.#M(false) : this.#n, this.#i[c] = t, this.#t[c] = e, this.#s.set(t, c), this.#a[this.#h] = c, this.#u[c] = this.#h, this.#h = c, this.#n++, this.#U(c, m, r), r && (r.set = "add"), f = false, this.#x && this.#C?.(e, t, "add");
|
|
111624
|
+
else {
|
|
111625
|
+
this.#D(c);
|
|
111626
|
+
let d = this.#t[c];
|
|
111627
|
+
if (e !== d) {
|
|
111628
|
+
if (this.#v && this.#e(d)) {
|
|
111629
|
+
d.__abortController.abort(new Error("replaced"));
|
|
111630
|
+
let { __staleWhileFetching: g } = d;
|
|
111631
|
+
g !== undefined && !n && (this.#T && this.#w?.(g, t, "set"), this.#f && this.#r?.push([g, t, "set"]));
|
|
111632
|
+
} else
|
|
111633
|
+
n || (this.#T && this.#w?.(d, t, "set"), this.#f && this.#r?.push([d, t, "set"]));
|
|
111634
|
+
if (this.#W(c), this.#U(c, m, r), this.#t[c] = e, r) {
|
|
111635
|
+
r.set = "replace";
|
|
111636
|
+
let g = d && this.#e(d) ? d.__staleWhileFetching : d;
|
|
111637
|
+
g !== undefined && (r.oldValue = g);
|
|
111942
111638
|
}
|
|
111943
|
-
} else
|
|
111944
|
-
|
|
111945
|
-
|
|
111946
|
-
if (this.#hasOnInsert) {
|
|
111947
|
-
this.onInsert?.(v, k, v === oldVal ? "update" : "replace");
|
|
111948
|
-
}
|
|
111949
|
-
}
|
|
111950
|
-
if (ttl !== 0 && !this.#ttls) {
|
|
111951
|
-
this.#initializeTTLTracking();
|
|
111952
|
-
}
|
|
111953
|
-
if (this.#ttls) {
|
|
111954
|
-
if (!noUpdateTTL) {
|
|
111955
|
-
this.#setItemTTL(index3, ttl, start4);
|
|
111956
|
-
}
|
|
111957
|
-
if (status)
|
|
111958
|
-
this.#statusTTL(status, index3);
|
|
111639
|
+
} else
|
|
111640
|
+
r && (r.set = "update");
|
|
111641
|
+
this.#x && this.onInsert?.(e, t, e === d ? "update" : "replace");
|
|
111959
111642
|
}
|
|
111960
|
-
if (!
|
|
111961
|
-
|
|
111962
|
-
|
|
111963
|
-
|
|
111964
|
-
this.#disposeAfter?.(...task);
|
|
111965
|
-
}
|
|
111643
|
+
if (s !== 0 && !this.#d && this.#j(), this.#d && (f || this.#N(c, s, h), r && this.#z(r, c)), !n && this.#f && this.#r) {
|
|
111644
|
+
let d = this.#r, g;
|
|
111645
|
+
for (;g = d?.shift(); )
|
|
111646
|
+
this.#S?.(...g);
|
|
111966
111647
|
}
|
|
111967
111648
|
return this;
|
|
111968
111649
|
}
|
|
111969
111650
|
pop() {
|
|
111970
111651
|
try {
|
|
111971
|
-
|
|
111972
|
-
|
|
111973
|
-
this.#
|
|
111974
|
-
|
|
111975
|
-
|
|
111976
|
-
|
|
111977
|
-
|
|
111978
|
-
} else if (val !== undefined) {
|
|
111979
|
-
return val;
|
|
111980
|
-
}
|
|
111652
|
+
for (;this.#n; ) {
|
|
111653
|
+
let t = this.#t[this.#l];
|
|
111654
|
+
if (this.#M(true), this.#e(t)) {
|
|
111655
|
+
if (t.__staleWhileFetching)
|
|
111656
|
+
return t.__staleWhileFetching;
|
|
111657
|
+
} else if (t !== undefined)
|
|
111658
|
+
return t;
|
|
111981
111659
|
}
|
|
111982
111660
|
} finally {
|
|
111983
|
-
if (this.#
|
|
111984
|
-
|
|
111985
|
-
|
|
111986
|
-
|
|
111987
|
-
this.#disposeAfter?.(...task);
|
|
111988
|
-
}
|
|
111661
|
+
if (this.#f && this.#r) {
|
|
111662
|
+
let t = this.#r, e;
|
|
111663
|
+
for (;e = t?.shift(); )
|
|
111664
|
+
this.#S?.(...e);
|
|
111989
111665
|
}
|
|
111990
111666
|
}
|
|
111991
111667
|
}
|
|
111992
|
-
#
|
|
111993
|
-
|
|
111994
|
-
|
|
111995
|
-
|
|
111996
|
-
|
|
111997
|
-
|
|
111998
|
-
|
|
111999
|
-
|
|
112000
|
-
|
|
112001
|
-
}
|
|
112002
|
-
if (this.#hasDisposeAfter) {
|
|
112003
|
-
this.#disposed?.push([v, k, "evict"]);
|
|
112004
|
-
}
|
|
112005
|
-
}
|
|
112006
|
-
this.#removeItemSize(head);
|
|
112007
|
-
if (this.#autopurgeTimers?.[head]) {
|
|
112008
|
-
clearTimeout(this.#autopurgeTimers[head]);
|
|
112009
|
-
this.#autopurgeTimers[head] = undefined;
|
|
112010
|
-
}
|
|
112011
|
-
if (free) {
|
|
112012
|
-
this.#keyList[head] = undefined;
|
|
112013
|
-
this.#valList[head] = undefined;
|
|
112014
|
-
this.#free.push(head);
|
|
112015
|
-
}
|
|
112016
|
-
if (this.#size === 1) {
|
|
112017
|
-
this.#head = this.#tail = 0;
|
|
112018
|
-
this.#free.length = 0;
|
|
112019
|
-
} else {
|
|
112020
|
-
this.#head = this.#next[head];
|
|
112021
|
-
}
|
|
112022
|
-
this.#keyMap.delete(k);
|
|
112023
|
-
this.#size--;
|
|
112024
|
-
return head;
|
|
112025
|
-
}
|
|
112026
|
-
has(k, hasOptions = {}) {
|
|
112027
|
-
const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
|
|
112028
|
-
const index3 = this.#keyMap.get(k);
|
|
112029
|
-
if (index3 !== undefined) {
|
|
112030
|
-
const v = this.#valList[index3];
|
|
112031
|
-
if (this.#isBackgroundFetch(v) && v.__staleWhileFetching === undefined) {
|
|
111668
|
+
#M(t) {
|
|
111669
|
+
let e = this.#l, i2 = this.#i[e], s = this.#t[e];
|
|
111670
|
+
return this.#v && this.#e(s) ? s.__abortController.abort(new Error("evicted")) : (this.#T || this.#f) && (this.#T && this.#w?.(s, i2, "evict"), this.#f && this.#r?.push([s, i2, "evict"])), this.#W(e), this.#g?.[e] && (clearTimeout(this.#g[e]), this.#g[e] = undefined), t && (this.#i[e] = undefined, this.#t[e] = undefined, this.#b.push(e)), this.#n === 1 ? (this.#l = this.#h = 0, this.#b.length = 0) : this.#l = this.#a[e], this.#s.delete(i2), this.#n--, e;
|
|
111671
|
+
}
|
|
111672
|
+
has(t, e = {}) {
|
|
111673
|
+
let { updateAgeOnHas: i2 = this.updateAgeOnHas, status: s } = e, h = this.#s.get(t);
|
|
111674
|
+
if (h !== undefined) {
|
|
111675
|
+
let n = this.#t[h];
|
|
111676
|
+
if (this.#e(n) && n.__staleWhileFetching === undefined)
|
|
112032
111677
|
return false;
|
|
112033
|
-
|
|
112034
|
-
|
|
112035
|
-
|
|
112036
|
-
|
|
112037
|
-
|
|
112038
|
-
|
|
112039
|
-
status.has = "hit";
|
|
112040
|
-
this.#statusTTL(status, index3);
|
|
112041
|
-
}
|
|
112042
|
-
return true;
|
|
112043
|
-
} else if (status) {
|
|
112044
|
-
status.has = "stale";
|
|
112045
|
-
this.#statusTTL(status, index3);
|
|
112046
|
-
}
|
|
112047
|
-
} else if (status) {
|
|
112048
|
-
status.has = "miss";
|
|
112049
|
-
}
|
|
111678
|
+
if (this.#p(h))
|
|
111679
|
+
s && (s.has = "stale", this.#z(s, h));
|
|
111680
|
+
else
|
|
111681
|
+
return i2 && this.#R(h), s && (s.has = "hit", this.#z(s, h)), true;
|
|
111682
|
+
} else
|
|
111683
|
+
s && (s.has = "miss");
|
|
112050
111684
|
return false;
|
|
112051
111685
|
}
|
|
112052
|
-
peek(
|
|
112053
|
-
|
|
112054
|
-
|
|
112055
|
-
if (index3 === undefined || !allowStale && this.#isStale(index3)) {
|
|
111686
|
+
peek(t, e = {}) {
|
|
111687
|
+
let { allowStale: i2 = this.allowStale } = e, s = this.#s.get(t);
|
|
111688
|
+
if (s === undefined || !i2 && this.#p(s))
|
|
112056
111689
|
return;
|
|
112057
|
-
|
|
112058
|
-
|
|
112059
|
-
|
|
112060
|
-
|
|
112061
|
-
|
|
112062
|
-
|
|
112063
|
-
|
|
112064
|
-
|
|
112065
|
-
}
|
|
112066
|
-
|
|
112067
|
-
|
|
112068
|
-
|
|
112069
|
-
|
|
112070
|
-
|
|
112071
|
-
|
|
112072
|
-
|
|
112073
|
-
|
|
112074
|
-
|
|
112075
|
-
|
|
112076
|
-
|
|
112077
|
-
|
|
112078
|
-
|
|
112079
|
-
|
|
112080
|
-
|
|
112081
|
-
|
|
112082
|
-
options.status.fetchAborted = true;
|
|
112083
|
-
options.status.fetchError = ac.signal.reason;
|
|
112084
|
-
if (ignoreAbort)
|
|
112085
|
-
options.status.fetchAbortIgnored = true;
|
|
112086
|
-
} else {
|
|
112087
|
-
options.status.fetchResolved = true;
|
|
112088
|
-
}
|
|
112089
|
-
}
|
|
112090
|
-
if (aborted5 && !ignoreAbort && !updateCache) {
|
|
112091
|
-
return fetchFail(ac.signal.reason, proceed);
|
|
112092
|
-
}
|
|
112093
|
-
const bf2 = p;
|
|
112094
|
-
const vl = this.#valList[index3];
|
|
112095
|
-
if (vl === p || ignoreAbort && updateCache && vl === undefined) {
|
|
112096
|
-
if (v2 === undefined) {
|
|
112097
|
-
if (bf2.__staleWhileFetching !== undefined) {
|
|
112098
|
-
this.#valList[index3] = bf2.__staleWhileFetching;
|
|
112099
|
-
} else {
|
|
112100
|
-
this.#delete(k, "fetch");
|
|
112101
|
-
}
|
|
112102
|
-
} else {
|
|
112103
|
-
if (options.status)
|
|
112104
|
-
options.status.fetchUpdated = true;
|
|
112105
|
-
this.set(k, v2, fetchOpts.options);
|
|
112106
|
-
}
|
|
112107
|
-
}
|
|
112108
|
-
return v2;
|
|
112109
|
-
};
|
|
112110
|
-
const eb = (er) => {
|
|
112111
|
-
if (options.status) {
|
|
112112
|
-
options.status.fetchRejected = true;
|
|
112113
|
-
options.status.fetchError = er;
|
|
112114
|
-
}
|
|
112115
|
-
return fetchFail(er, false);
|
|
112116
|
-
};
|
|
112117
|
-
const fetchFail = (er, proceed) => {
|
|
112118
|
-
const { aborted: aborted5 } = ac.signal;
|
|
112119
|
-
const allowStaleAborted = aborted5 && options.allowStaleOnFetchAbort;
|
|
112120
|
-
const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
|
|
112121
|
-
const noDelete = allowStale || options.noDeleteOnFetchRejection;
|
|
112122
|
-
const bf2 = p;
|
|
112123
|
-
if (this.#valList[index3] === p) {
|
|
112124
|
-
const del = !noDelete || !proceed && bf2.__staleWhileFetching === undefined;
|
|
112125
|
-
if (del) {
|
|
112126
|
-
this.#delete(k, "fetch");
|
|
112127
|
-
} else if (!allowStaleAborted) {
|
|
112128
|
-
this.#valList[index3] = bf2.__staleWhileFetching;
|
|
112129
|
-
}
|
|
112130
|
-
}
|
|
112131
|
-
if (allowStale) {
|
|
112132
|
-
if (options.status && bf2.__staleWhileFetching !== undefined) {
|
|
112133
|
-
options.status.returnedStale = true;
|
|
112134
|
-
}
|
|
112135
|
-
return bf2.__staleWhileFetching;
|
|
112136
|
-
} else if (bf2.__returned === bf2) {
|
|
112137
|
-
throw er;
|
|
112138
|
-
}
|
|
112139
|
-
};
|
|
112140
|
-
const pcall = (res, rej) => {
|
|
112141
|
-
const fmp = this.#fetchMethod?.(k, v, fetchOpts);
|
|
112142
|
-
if (fmp && fmp instanceof Promise) {
|
|
112143
|
-
fmp.then((v2) => res(v2 === undefined ? undefined : v2), rej);
|
|
112144
|
-
}
|
|
112145
|
-
ac.signal.addEventListener("abort", () => {
|
|
112146
|
-
if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {
|
|
112147
|
-
res(undefined);
|
|
112148
|
-
if (options.allowStaleOnFetchAbort) {
|
|
112149
|
-
res = (v2) => cb(v2, true);
|
|
112150
|
-
}
|
|
112151
|
-
}
|
|
111690
|
+
let h = this.#t[s];
|
|
111691
|
+
return this.#e(h) ? h.__staleWhileFetching : h;
|
|
111692
|
+
}
|
|
111693
|
+
#G(t, e, i2, s) {
|
|
111694
|
+
let h = e === undefined ? undefined : this.#t[e];
|
|
111695
|
+
if (this.#e(h))
|
|
111696
|
+
return h;
|
|
111697
|
+
let n = new C, { signal: o } = i2;
|
|
111698
|
+
o?.addEventListener("abort", () => n.abort(o.reason), { signal: n.signal });
|
|
111699
|
+
let r = { signal: n.signal, options: i2, context: s }, f = (p, _ = false) => {
|
|
111700
|
+
let { aborted: l } = n.signal, w = i2.ignoreFetchAbort && p !== undefined, b = i2.ignoreFetchAbort || !!(i2.allowStaleOnFetchAbort && p !== undefined);
|
|
111701
|
+
if (i2.status && (l && !_ ? (i2.status.fetchAborted = true, i2.status.fetchError = n.signal.reason, w && (i2.status.fetchAbortIgnored = true)) : i2.status.fetchResolved = true), l && !w && !_)
|
|
111702
|
+
return c(n.signal.reason, b);
|
|
111703
|
+
let S = g, u = this.#t[e];
|
|
111704
|
+
return (u === g || w && _ && u === undefined) && (p === undefined ? S.__staleWhileFetching !== undefined ? this.#t[e] = S.__staleWhileFetching : this.#E(t, "fetch") : (i2.status && (i2.status.fetchUpdated = true), this.set(t, p, r.options))), p;
|
|
111705
|
+
}, m = (p) => (i2.status && (i2.status.fetchRejected = true, i2.status.fetchError = p), c(p, false)), c = (p, _) => {
|
|
111706
|
+
let { aborted: l } = n.signal, w = l && i2.allowStaleOnFetchAbort, b = w || i2.allowStaleOnFetchRejection, S = b || i2.noDeleteOnFetchRejection, u = g;
|
|
111707
|
+
if (this.#t[e] === g && (!S || !_ && u.__staleWhileFetching === undefined ? this.#E(t, "fetch") : w || (this.#t[e] = u.__staleWhileFetching)), b)
|
|
111708
|
+
return i2.status && u.__staleWhileFetching !== undefined && (i2.status.returnedStale = true), u.__staleWhileFetching;
|
|
111709
|
+
if (u.__returned === u)
|
|
111710
|
+
throw p;
|
|
111711
|
+
}, d = (p, _) => {
|
|
111712
|
+
let l = this.#L?.(t, h, r);
|
|
111713
|
+
l && l instanceof Promise && l.then((w) => p(w === undefined ? undefined : w), _), n.signal.addEventListener("abort", () => {
|
|
111714
|
+
(!i2.ignoreFetchAbort || i2.allowStaleOnFetchAbort) && (p(undefined), i2.allowStaleOnFetchAbort && (p = (w) => f(w, true)));
|
|
112152
111715
|
});
|
|
112153
111716
|
};
|
|
112154
|
-
|
|
112155
|
-
|
|
112156
|
-
|
|
112157
|
-
const bf = Object.assign(p, {
|
|
112158
|
-
__abortController: ac,
|
|
112159
|
-
__staleWhileFetching: v,
|
|
112160
|
-
__returned: undefined
|
|
112161
|
-
});
|
|
112162
|
-
if (index3 === undefined) {
|
|
112163
|
-
this.set(k, bf, { ...fetchOpts.options, status: undefined });
|
|
112164
|
-
index3 = this.#keyMap.get(k);
|
|
112165
|
-
} else {
|
|
112166
|
-
this.#valList[index3] = bf;
|
|
112167
|
-
}
|
|
112168
|
-
return bf;
|
|
111717
|
+
i2.status && (i2.status.fetchDispatched = true);
|
|
111718
|
+
let g = new Promise(d).then(f, m), A = Object.assign(g, { __abortController: n, __staleWhileFetching: h, __returned: undefined });
|
|
111719
|
+
return e === undefined ? (this.set(t, A, { ...r.options, status: undefined }), e = this.#s.get(t)) : this.#t[e] = A, A;
|
|
112169
111720
|
}
|
|
112170
|
-
#
|
|
112171
|
-
if (!this.#
|
|
111721
|
+
#e(t) {
|
|
111722
|
+
if (!this.#v)
|
|
112172
111723
|
return false;
|
|
112173
|
-
|
|
112174
|
-
return !!
|
|
112175
|
-
}
|
|
112176
|
-
async fetch(
|
|
112177
|
-
|
|
112178
|
-
|
|
112179
|
-
|
|
112180
|
-
|
|
112181
|
-
|
|
112182
|
-
|
|
112183
|
-
|
|
112184
|
-
|
|
112185
|
-
noUpdateTTL = this.noUpdateTTL,
|
|
112186
|
-
noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,
|
|
112187
|
-
allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
|
|
112188
|
-
ignoreFetchAbort = this.ignoreFetchAbort,
|
|
112189
|
-
allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
|
|
112190
|
-
context,
|
|
112191
|
-
forceRefresh = false,
|
|
112192
|
-
status,
|
|
112193
|
-
signal
|
|
112194
|
-
} = fetchOptions;
|
|
112195
|
-
if (!this.#hasFetchMethod) {
|
|
112196
|
-
if (status)
|
|
112197
|
-
status.fetch = "get";
|
|
112198
|
-
return this.get(k, {
|
|
112199
|
-
allowStale,
|
|
112200
|
-
updateAgeOnGet,
|
|
112201
|
-
noDeleteOnStaleGet,
|
|
112202
|
-
status
|
|
112203
|
-
});
|
|
112204
|
-
}
|
|
112205
|
-
const options = {
|
|
112206
|
-
allowStale,
|
|
112207
|
-
updateAgeOnGet,
|
|
112208
|
-
noDeleteOnStaleGet,
|
|
112209
|
-
ttl,
|
|
112210
|
-
noDisposeOnSet,
|
|
112211
|
-
size,
|
|
112212
|
-
sizeCalculation,
|
|
112213
|
-
noUpdateTTL,
|
|
112214
|
-
noDeleteOnFetchRejection,
|
|
112215
|
-
allowStaleOnFetchRejection,
|
|
112216
|
-
allowStaleOnFetchAbort,
|
|
112217
|
-
ignoreFetchAbort,
|
|
112218
|
-
status,
|
|
112219
|
-
signal
|
|
112220
|
-
};
|
|
112221
|
-
let index3 = this.#keyMap.get(k);
|
|
112222
|
-
if (index3 === undefined) {
|
|
112223
|
-
if (status)
|
|
112224
|
-
status.fetch = "miss";
|
|
112225
|
-
const p = this.#backgroundFetch(k, index3, options, context);
|
|
112226
|
-
return p.__returned = p;
|
|
111724
|
+
let e = t;
|
|
111725
|
+
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof C;
|
|
111726
|
+
}
|
|
111727
|
+
async fetch(t, e = {}) {
|
|
111728
|
+
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: h = this.noDeleteOnStaleGet, ttl: n = this.ttl, noDisposeOnSet: o = this.noDisposeOnSet, size: r = 0, sizeCalculation: f = this.sizeCalculation, noUpdateTTL: m = this.noUpdateTTL, noDeleteOnFetchRejection: c = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: g = this.ignoreFetchAbort, allowStaleOnFetchAbort: A = this.allowStaleOnFetchAbort, context: p, forceRefresh: _ = false, status: l, signal: w } = e;
|
|
111729
|
+
if (!this.#v)
|
|
111730
|
+
return l && (l.fetch = "get"), this.get(t, { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: h, status: l });
|
|
111731
|
+
let b = { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: h, ttl: n, noDisposeOnSet: o, size: r, sizeCalculation: f, noUpdateTTL: m, noDeleteOnFetchRejection: c, allowStaleOnFetchRejection: d, allowStaleOnFetchAbort: A, ignoreFetchAbort: g, status: l, signal: w }, S = this.#s.get(t);
|
|
111732
|
+
if (S === undefined) {
|
|
111733
|
+
l && (l.fetch = "miss");
|
|
111734
|
+
let u = this.#G(t, S, b, p);
|
|
111735
|
+
return u.__returned = u;
|
|
112227
111736
|
} else {
|
|
112228
|
-
|
|
112229
|
-
if (this.#
|
|
112230
|
-
|
|
112231
|
-
|
|
112232
|
-
|
|
112233
|
-
|
|
112234
|
-
|
|
112235
|
-
|
|
112236
|
-
|
|
112237
|
-
|
|
112238
|
-
|
|
112239
|
-
|
|
112240
|
-
|
|
112241
|
-
|
|
112242
|
-
|
|
112243
|
-
if (updateAgeOnGet) {
|
|
112244
|
-
this.#updateItemAge(index3);
|
|
112245
|
-
}
|
|
112246
|
-
if (status)
|
|
112247
|
-
this.#statusTTL(status, index3);
|
|
112248
|
-
return v;
|
|
112249
|
-
}
|
|
112250
|
-
const p = this.#backgroundFetch(k, index3, options, context);
|
|
112251
|
-
const hasStale = p.__staleWhileFetching !== undefined;
|
|
112252
|
-
const staleVal = hasStale && allowStale;
|
|
112253
|
-
if (status) {
|
|
112254
|
-
status.fetch = isStale ? "stale" : "refresh";
|
|
112255
|
-
if (staleVal && isStale)
|
|
112256
|
-
status.returnedStale = true;
|
|
112257
|
-
}
|
|
112258
|
-
return staleVal ? p.__staleWhileFetching : p.__returned = p;
|
|
112259
|
-
}
|
|
112260
|
-
}
|
|
112261
|
-
async forceFetch(k, fetchOptions = {}) {
|
|
112262
|
-
const v = await this.fetch(k, fetchOptions);
|
|
112263
|
-
if (v === undefined)
|
|
111737
|
+
let u = this.#t[S];
|
|
111738
|
+
if (this.#e(u)) {
|
|
111739
|
+
let E2 = i2 && u.__staleWhileFetching !== undefined;
|
|
111740
|
+
return l && (l.fetch = "inflight", E2 && (l.returnedStale = true)), E2 ? u.__staleWhileFetching : u.__returned = u;
|
|
111741
|
+
}
|
|
111742
|
+
let T = this.#p(S);
|
|
111743
|
+
if (!_ && !T)
|
|
111744
|
+
return l && (l.fetch = "hit"), this.#D(S), s && this.#R(S), l && this.#z(l, S), u;
|
|
111745
|
+
let F = this.#G(t, S, b, p), O = F.__staleWhileFetching !== undefined && i2;
|
|
111746
|
+
return l && (l.fetch = T ? "stale" : "refresh", O && T && (l.returnedStale = true)), O ? F.__staleWhileFetching : F.__returned = F;
|
|
111747
|
+
}
|
|
111748
|
+
}
|
|
111749
|
+
async forceFetch(t, e = {}) {
|
|
111750
|
+
let i2 = await this.fetch(t, e);
|
|
111751
|
+
if (i2 === undefined)
|
|
112264
111752
|
throw new Error("fetch() returned undefined");
|
|
112265
|
-
return
|
|
111753
|
+
return i2;
|
|
112266
111754
|
}
|
|
112267
|
-
memo(
|
|
112268
|
-
|
|
112269
|
-
if (!
|
|
111755
|
+
memo(t, e = {}) {
|
|
111756
|
+
let i2 = this.#I;
|
|
111757
|
+
if (!i2)
|
|
112270
111758
|
throw new Error("no memoMethod provided to constructor");
|
|
112271
|
-
}
|
|
112272
|
-
|
|
112273
|
-
|
|
112274
|
-
|
|
112275
|
-
|
|
112276
|
-
|
|
112277
|
-
|
|
112278
|
-
|
|
112279
|
-
|
|
112280
|
-
|
|
112281
|
-
|
|
112282
|
-
|
|
112283
|
-
|
|
112284
|
-
const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions;
|
|
112285
|
-
const index3 = this.#keyMap.get(k);
|
|
112286
|
-
if (index3 !== undefined) {
|
|
112287
|
-
const value = this.#valList[index3];
|
|
112288
|
-
const fetching = this.#isBackgroundFetch(value);
|
|
112289
|
-
if (status)
|
|
112290
|
-
this.#statusTTL(status, index3);
|
|
112291
|
-
if (this.#isStale(index3)) {
|
|
112292
|
-
if (status)
|
|
112293
|
-
status.get = "stale";
|
|
112294
|
-
if (!fetching) {
|
|
112295
|
-
if (!noDeleteOnStaleGet) {
|
|
112296
|
-
this.#delete(k, "expire");
|
|
112297
|
-
}
|
|
112298
|
-
if (status && allowStale)
|
|
112299
|
-
status.returnedStale = true;
|
|
112300
|
-
return allowStale ? value : undefined;
|
|
112301
|
-
} else {
|
|
112302
|
-
if (status && allowStale && value.__staleWhileFetching !== undefined) {
|
|
112303
|
-
status.returnedStale = true;
|
|
112304
|
-
}
|
|
112305
|
-
return allowStale ? value.__staleWhileFetching : undefined;
|
|
112306
|
-
}
|
|
112307
|
-
} else {
|
|
112308
|
-
if (status)
|
|
112309
|
-
status.get = "hit";
|
|
112310
|
-
if (fetching) {
|
|
112311
|
-
return value.__staleWhileFetching;
|
|
112312
|
-
}
|
|
112313
|
-
this.#moveToTail(index3);
|
|
112314
|
-
if (updateAgeOnGet) {
|
|
112315
|
-
this.#updateItemAge(index3);
|
|
112316
|
-
}
|
|
112317
|
-
return value;
|
|
112318
|
-
}
|
|
112319
|
-
} else if (status) {
|
|
112320
|
-
status.get = "miss";
|
|
112321
|
-
}
|
|
111759
|
+
let { context: s, forceRefresh: h, ...n } = e, o = this.get(t, n);
|
|
111760
|
+
if (!h && o !== undefined)
|
|
111761
|
+
return o;
|
|
111762
|
+
let r = i2(t, o, { options: n, context: s });
|
|
111763
|
+
return this.set(t, r, n), r;
|
|
111764
|
+
}
|
|
111765
|
+
get(t, e = {}) {
|
|
111766
|
+
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: h = this.noDeleteOnStaleGet, status: n } = e, o = this.#s.get(t);
|
|
111767
|
+
if (o !== undefined) {
|
|
111768
|
+
let r = this.#t[o], f = this.#e(r);
|
|
111769
|
+
return n && this.#z(n, o), this.#p(o) ? (n && (n.get = "stale"), f ? (n && i2 && r.__staleWhileFetching !== undefined && (n.returnedStale = true), i2 ? r.__staleWhileFetching : undefined) : (h || this.#E(t, "expire"), n && i2 && (n.returnedStale = true), i2 ? r : undefined)) : (n && (n.get = "hit"), f ? r.__staleWhileFetching : (this.#D(o), s && this.#R(o), r));
|
|
111770
|
+
} else
|
|
111771
|
+
n && (n.get = "miss");
|
|
112322
111772
|
}
|
|
112323
|
-
#
|
|
112324
|
-
this.#
|
|
112325
|
-
this.#next[p] = n;
|
|
111773
|
+
#k(t, e) {
|
|
111774
|
+
this.#u[e] = t, this.#a[t] = e;
|
|
112326
111775
|
}
|
|
112327
|
-
#
|
|
112328
|
-
|
|
112329
|
-
if (index3 === this.#head) {
|
|
112330
|
-
this.#head = this.#next[index3];
|
|
112331
|
-
} else {
|
|
112332
|
-
this.#connect(this.#prev[index3], this.#next[index3]);
|
|
112333
|
-
}
|
|
112334
|
-
this.#connect(this.#tail, index3);
|
|
112335
|
-
this.#tail = index3;
|
|
112336
|
-
}
|
|
111776
|
+
#D(t) {
|
|
111777
|
+
t !== this.#h && (t === this.#l ? this.#l = this.#a[t] : this.#k(this.#u[t], this.#a[t]), this.#k(this.#h, t), this.#h = t);
|
|
112337
111778
|
}
|
|
112338
|
-
delete(
|
|
112339
|
-
return this.#
|
|
111779
|
+
delete(t) {
|
|
111780
|
+
return this.#E(t, "delete");
|
|
112340
111781
|
}
|
|
112341
|
-
#
|
|
112342
|
-
let
|
|
112343
|
-
if (this.#
|
|
112344
|
-
|
|
112345
|
-
if (
|
|
112346
|
-
if (this.#
|
|
112347
|
-
|
|
112348
|
-
|
|
112349
|
-
|
|
112350
|
-
|
|
112351
|
-
|
|
112352
|
-
|
|
112353
|
-
|
|
112354
|
-
|
|
112355
|
-
|
|
112356
|
-
|
|
112357
|
-
|
|
112358
|
-
|
|
112359
|
-
|
|
112360
|
-
this.#dispose?.(v, k, reason);
|
|
112361
|
-
}
|
|
112362
|
-
if (this.#hasDisposeAfter) {
|
|
112363
|
-
this.#disposed?.push([v, k, reason]);
|
|
112364
|
-
}
|
|
112365
|
-
}
|
|
112366
|
-
this.#keyMap.delete(k);
|
|
112367
|
-
this.#keyList[index3] = undefined;
|
|
112368
|
-
this.#valList[index3] = undefined;
|
|
112369
|
-
if (index3 === this.#tail) {
|
|
112370
|
-
this.#tail = this.#prev[index3];
|
|
112371
|
-
} else if (index3 === this.#head) {
|
|
112372
|
-
this.#head = this.#next[index3];
|
|
112373
|
-
} else {
|
|
112374
|
-
const pi = this.#prev[index3];
|
|
112375
|
-
this.#next[pi] = this.#next[index3];
|
|
112376
|
-
const ni = this.#next[index3];
|
|
112377
|
-
this.#prev[ni] = this.#prev[index3];
|
|
111782
|
+
#E(t, e) {
|
|
111783
|
+
let i2 = false;
|
|
111784
|
+
if (this.#n !== 0) {
|
|
111785
|
+
let s = this.#s.get(t);
|
|
111786
|
+
if (s !== undefined)
|
|
111787
|
+
if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = undefined), i2 = true, this.#n === 1)
|
|
111788
|
+
this.#V(e);
|
|
111789
|
+
else {
|
|
111790
|
+
this.#W(s);
|
|
111791
|
+
let h = this.#t[s];
|
|
111792
|
+
if (this.#e(h) ? h.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#w?.(h, t, e), this.#f && this.#r?.push([h, t, e])), this.#s.delete(t), this.#i[s] = undefined, this.#t[s] = undefined, s === this.#h)
|
|
111793
|
+
this.#h = this.#u[s];
|
|
111794
|
+
else if (s === this.#l)
|
|
111795
|
+
this.#l = this.#a[s];
|
|
111796
|
+
else {
|
|
111797
|
+
let n = this.#u[s];
|
|
111798
|
+
this.#a[n] = this.#a[s];
|
|
111799
|
+
let o = this.#a[s];
|
|
111800
|
+
this.#u[o] = this.#u[s];
|
|
112378
111801
|
}
|
|
112379
|
-
this.#
|
|
112380
|
-
this.#free.push(index3);
|
|
111802
|
+
this.#n--, this.#b.push(s);
|
|
112381
111803
|
}
|
|
112382
|
-
}
|
|
112383
111804
|
}
|
|
112384
|
-
if (this.#
|
|
112385
|
-
|
|
112386
|
-
|
|
112387
|
-
|
|
112388
|
-
this.#disposeAfter?.(...task);
|
|
112389
|
-
}
|
|
111805
|
+
if (this.#f && this.#r?.length) {
|
|
111806
|
+
let s = this.#r, h;
|
|
111807
|
+
for (;h = s?.shift(); )
|
|
111808
|
+
this.#S?.(...h);
|
|
112390
111809
|
}
|
|
112391
|
-
return
|
|
111810
|
+
return i2;
|
|
112392
111811
|
}
|
|
112393
111812
|
clear() {
|
|
112394
|
-
return this.#
|
|
111813
|
+
return this.#V("delete");
|
|
112395
111814
|
}
|
|
112396
|
-
#
|
|
112397
|
-
for (
|
|
112398
|
-
|
|
112399
|
-
if (this.#
|
|
112400
|
-
|
|
112401
|
-
|
|
112402
|
-
|
|
112403
|
-
|
|
112404
|
-
this.#dispose?.(v, k, reason);
|
|
112405
|
-
}
|
|
112406
|
-
if (this.#hasDisposeAfter) {
|
|
112407
|
-
this.#disposed?.push([v, k, reason]);
|
|
112408
|
-
}
|
|
112409
|
-
}
|
|
112410
|
-
}
|
|
112411
|
-
this.#keyMap.clear();
|
|
112412
|
-
this.#valList.fill(undefined);
|
|
112413
|
-
this.#keyList.fill(undefined);
|
|
112414
|
-
if (this.#ttls && this.#starts) {
|
|
112415
|
-
this.#ttls.fill(0);
|
|
112416
|
-
this.#starts.fill(0);
|
|
112417
|
-
for (const t of this.#autopurgeTimers ?? []) {
|
|
112418
|
-
if (t !== undefined)
|
|
112419
|
-
clearTimeout(t);
|
|
111815
|
+
#V(t) {
|
|
111816
|
+
for (let e of this.#O({ allowStale: true })) {
|
|
111817
|
+
let i2 = this.#t[e];
|
|
111818
|
+
if (this.#e(i2))
|
|
111819
|
+
i2.__abortController.abort(new Error("deleted"));
|
|
111820
|
+
else {
|
|
111821
|
+
let s = this.#i[e];
|
|
111822
|
+
this.#T && this.#w?.(i2, s, t), this.#f && this.#r?.push([i2, s, t]);
|
|
112420
111823
|
}
|
|
112421
|
-
this.#autopurgeTimers?.fill(undefined);
|
|
112422
111824
|
}
|
|
112423
|
-
if (this.#
|
|
112424
|
-
this.#
|
|
111825
|
+
if (this.#s.clear(), this.#t.fill(undefined), this.#i.fill(undefined), this.#d && this.#A) {
|
|
111826
|
+
this.#d.fill(0), this.#A.fill(0);
|
|
111827
|
+
for (let e of this.#g ?? [])
|
|
111828
|
+
e !== undefined && clearTimeout(e);
|
|
111829
|
+
this.#g?.fill(undefined);
|
|
112425
111830
|
}
|
|
112426
|
-
this.#
|
|
112427
|
-
|
|
112428
|
-
|
|
112429
|
-
|
|
112430
|
-
this.#size = 0;
|
|
112431
|
-
if (this.#hasDisposeAfter && this.#disposed) {
|
|
112432
|
-
const dt = this.#disposed;
|
|
112433
|
-
let task;
|
|
112434
|
-
while (task = dt?.shift()) {
|
|
112435
|
-
this.#disposeAfter?.(...task);
|
|
112436
|
-
}
|
|
111831
|
+
if (this.#y && this.#y.fill(0), this.#l = 0, this.#h = 0, this.#b.length = 0, this.#_ = 0, this.#n = 0, this.#f && this.#r) {
|
|
111832
|
+
let e = this.#r, i2;
|
|
111833
|
+
for (;i2 = e?.shift(); )
|
|
111834
|
+
this.#S?.(...i2);
|
|
112437
111835
|
}
|
|
112438
111836
|
}
|
|
112439
|
-
}
|
|
111837
|
+
};
|
|
112440
111838
|
|
|
112441
111839
|
// src/module/cache/auth.ts
|
|
112442
|
-
var authCache = new
|
|
111840
|
+
var authCache = new L({
|
|
112443
111841
|
max: 1e4,
|
|
112444
111842
|
ttl: 1000 * 60 * 60 * 24 * 7
|
|
112445
111843
|
});
|
|
@@ -112550,9 +111948,9 @@ import fs17 from "fs";
|
|
|
112550
111948
|
|
|
112551
111949
|
// ../node_modules/.pnpm/@kevisual+router@0.0.70/node_modules/@kevisual/router/src/server/cookie.ts
|
|
112552
111950
|
var NullObject2 = /* @__PURE__ */ (() => {
|
|
112553
|
-
const
|
|
112554
|
-
|
|
112555
|
-
return
|
|
111951
|
+
const C2 = function() {};
|
|
111952
|
+
C2.prototype = Object.create(null);
|
|
111953
|
+
return C2;
|
|
112556
111954
|
})();
|
|
112557
111955
|
function parseCookie2(str, options) {
|
|
112558
111956
|
const obj = new NullObject2;
|