@kevisual/cli 0.1.23 → 0.1.25
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 +473 -381
- package/dist/assistant-server.js +1657 -1465
- package/dist/assistant.js +242 -218
- package/dist/envision.js +130 -110
- package/package.json +4 -4
|
@@ -1954,26 +1954,26 @@ var require_escape_html = __commonJS((exports, module) => {
|
|
|
1954
1954
|
if (!match) {
|
|
1955
1955
|
return str;
|
|
1956
1956
|
}
|
|
1957
|
-
var
|
|
1957
|
+
var escape2;
|
|
1958
1958
|
var html = "";
|
|
1959
1959
|
var index = 0;
|
|
1960
1960
|
var lastIndex = 0;
|
|
1961
1961
|
for (index = match.index;index < str.length; index++) {
|
|
1962
1962
|
switch (str.charCodeAt(index)) {
|
|
1963
1963
|
case 34:
|
|
1964
|
-
|
|
1964
|
+
escape2 = """;
|
|
1965
1965
|
break;
|
|
1966
1966
|
case 38:
|
|
1967
|
-
|
|
1967
|
+
escape2 = "&";
|
|
1968
1968
|
break;
|
|
1969
1969
|
case 39:
|
|
1970
|
-
|
|
1970
|
+
escape2 = "'";
|
|
1971
1971
|
break;
|
|
1972
1972
|
case 60:
|
|
1973
|
-
|
|
1973
|
+
escape2 = "<";
|
|
1974
1974
|
break;
|
|
1975
1975
|
case 62:
|
|
1976
|
-
|
|
1976
|
+
escape2 = ">";
|
|
1977
1977
|
break;
|
|
1978
1978
|
default:
|
|
1979
1979
|
continue;
|
|
@@ -1982,7 +1982,7 @@ var require_escape_html = __commonJS((exports, module) => {
|
|
|
1982
1982
|
html += str.substring(lastIndex, index);
|
|
1983
1983
|
}
|
|
1984
1984
|
lastIndex = index + 1;
|
|
1985
|
-
html +=
|
|
1985
|
+
html += escape2;
|
|
1986
1986
|
}
|
|
1987
1987
|
return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
|
|
1988
1988
|
}
|
|
@@ -11786,9 +11786,9 @@ var require_range_parser = __commonJS((exports, module) => {
|
|
|
11786
11786
|
var ranges = [];
|
|
11787
11787
|
ranges.type = str.slice(0, index);
|
|
11788
11788
|
for (var i = 0;i < arr.length; i++) {
|
|
11789
|
-
var
|
|
11790
|
-
var start = parseInt(
|
|
11791
|
-
var end = parseInt(
|
|
11789
|
+
var range2 = arr[i].split("-");
|
|
11790
|
+
var start = parseInt(range2[0], 10);
|
|
11791
|
+
var end = parseInt(range2[1], 10);
|
|
11792
11792
|
if (isNaN(start)) {
|
|
11793
11793
|
start = size - end;
|
|
11794
11794
|
end = size - 1;
|
|
@@ -11814,13 +11814,13 @@ var require_range_parser = __commonJS((exports, module) => {
|
|
|
11814
11814
|
function combineRanges(ranges) {
|
|
11815
11815
|
var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart);
|
|
11816
11816
|
for (var j = 0, i = 1;i < ordered.length; i++) {
|
|
11817
|
-
var
|
|
11817
|
+
var range2 = ordered[i];
|
|
11818
11818
|
var current = ordered[j];
|
|
11819
|
-
if (
|
|
11820
|
-
ordered[++j] =
|
|
11821
|
-
} else if (
|
|
11822
|
-
current.end =
|
|
11823
|
-
current.index = Math.min(current.index,
|
|
11819
|
+
if (range2.start > current.end + 1) {
|
|
11820
|
+
ordered[++j] = range2;
|
|
11821
|
+
} else if (range2.end > current.end) {
|
|
11822
|
+
current.end = range2.end;
|
|
11823
|
+
current.index = Math.min(current.index, range2.index);
|
|
11824
11824
|
}
|
|
11825
11825
|
}
|
|
11826
11826
|
ordered.length = j + 1;
|
|
@@ -11828,17 +11828,17 @@ var require_range_parser = __commonJS((exports, module) => {
|
|
|
11828
11828
|
combined.type = ranges.type;
|
|
11829
11829
|
return combined;
|
|
11830
11830
|
}
|
|
11831
|
-
function mapWithIndex(
|
|
11831
|
+
function mapWithIndex(range2, index) {
|
|
11832
11832
|
return {
|
|
11833
|
-
start:
|
|
11834
|
-
end:
|
|
11833
|
+
start: range2.start,
|
|
11834
|
+
end: range2.end,
|
|
11835
11835
|
index
|
|
11836
11836
|
};
|
|
11837
11837
|
}
|
|
11838
|
-
function mapWithoutIndex(
|
|
11838
|
+
function mapWithoutIndex(range2) {
|
|
11839
11839
|
return {
|
|
11840
|
-
start:
|
|
11841
|
-
end:
|
|
11840
|
+
start: range2.start,
|
|
11841
|
+
end: range2.end
|
|
11842
11842
|
};
|
|
11843
11843
|
}
|
|
11844
11844
|
function sortByRangeIndex(a, b) {
|
|
@@ -12273,8 +12273,8 @@ var require_send = __commonJS((exports, module) => {
|
|
|
12273
12273
|
}
|
|
12274
12274
|
return false;
|
|
12275
12275
|
}
|
|
12276
|
-
function contentRange(type, size,
|
|
12277
|
-
return type + " " + (
|
|
12276
|
+
function contentRange(type, size, range2) {
|
|
12277
|
+
return type + " " + (range2 ? range2.start + "-" + range2.end : "*") + "/" + size;
|
|
12278
12278
|
}
|
|
12279
12279
|
function createHtmlDocument(title, body) {
|
|
12280
12280
|
return `<!DOCTYPE html>
|
|
@@ -15133,7 +15133,7 @@ var require_micromatch = __commonJS((exports, module) => {
|
|
|
15133
15133
|
var micromatch = (list3, patterns, options) => {
|
|
15134
15134
|
patterns = [].concat(patterns);
|
|
15135
15135
|
list3 = [].concat(list3);
|
|
15136
|
-
let
|
|
15136
|
+
let omit2 = new Set;
|
|
15137
15137
|
let keep = new Set;
|
|
15138
15138
|
let items = new Set;
|
|
15139
15139
|
let negatives = 0;
|
|
@@ -15154,15 +15154,15 @@ var require_micromatch = __commonJS((exports, module) => {
|
|
|
15154
15154
|
if (!match)
|
|
15155
15155
|
continue;
|
|
15156
15156
|
if (negated) {
|
|
15157
|
-
|
|
15157
|
+
omit2.add(matched.output);
|
|
15158
15158
|
} else {
|
|
15159
|
-
|
|
15159
|
+
omit2.delete(matched.output);
|
|
15160
15160
|
keep.add(matched.output);
|
|
15161
15161
|
}
|
|
15162
15162
|
}
|
|
15163
15163
|
}
|
|
15164
15164
|
let result = negatives === patterns.length ? [...items] : [...keep];
|
|
15165
|
-
let matches = result.filter((item) => !
|
|
15165
|
+
let matches = result.filter((item) => !omit2.has(item));
|
|
15166
15166
|
if (options && matches.length === 0) {
|
|
15167
15167
|
if (options.failglob === true) {
|
|
15168
15168
|
throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
|
@@ -16195,7 +16195,7 @@ var require_out2 = __commonJS((exports) => {
|
|
|
16195
16195
|
}
|
|
16196
16196
|
});
|
|
16197
16197
|
|
|
16198
|
-
// ../node_modules/.pnpm/reusify@1.0
|
|
16198
|
+
// ../node_modules/.pnpm/reusify@1.1.0/node_modules/reusify/reusify.js
|
|
16199
16199
|
var require_reusify = __commonJS((exports, module) => {
|
|
16200
16200
|
function reusify(Constructor) {
|
|
16201
16201
|
var head2 = new Constructor;
|
|
@@ -16223,7 +16223,7 @@ var require_reusify = __commonJS((exports, module) => {
|
|
|
16223
16223
|
module.exports = reusify;
|
|
16224
16224
|
});
|
|
16225
16225
|
|
|
16226
|
-
// ../node_modules/.pnpm/fastq@1.
|
|
16226
|
+
// ../node_modules/.pnpm/fastq@1.20.1/node_modules/fastq/queue.js
|
|
16227
16227
|
var require_queue = __commonJS((exports, module) => {
|
|
16228
16228
|
var reusify = require_reusify();
|
|
16229
16229
|
function fastqueue(context, worker, _concurrency) {
|
|
@@ -16270,7 +16270,8 @@ var require_queue = __commonJS((exports, module) => {
|
|
|
16270
16270
|
empty: noop2,
|
|
16271
16271
|
kill,
|
|
16272
16272
|
killAndDrain,
|
|
16273
|
-
error: error49
|
|
16273
|
+
error: error49,
|
|
16274
|
+
abort
|
|
16274
16275
|
};
|
|
16275
16276
|
return self2;
|
|
16276
16277
|
function running() {
|
|
@@ -16390,6 +16391,28 @@ var require_queue = __commonJS((exports, module) => {
|
|
|
16390
16391
|
self2.drain();
|
|
16391
16392
|
self2.drain = noop2;
|
|
16392
16393
|
}
|
|
16394
|
+
function abort() {
|
|
16395
|
+
var current = queueHead;
|
|
16396
|
+
queueHead = null;
|
|
16397
|
+
queueTail = null;
|
|
16398
|
+
while (current) {
|
|
16399
|
+
var next = current.next;
|
|
16400
|
+
var callback = current.callback;
|
|
16401
|
+
var errorHandler2 = current.errorHandler;
|
|
16402
|
+
var val = current.value;
|
|
16403
|
+
var context2 = current.context;
|
|
16404
|
+
current.value = null;
|
|
16405
|
+
current.callback = noop2;
|
|
16406
|
+
current.errorHandler = null;
|
|
16407
|
+
if (errorHandler2) {
|
|
16408
|
+
errorHandler2(new Error("abort"), val);
|
|
16409
|
+
}
|
|
16410
|
+
callback.call(context2, new Error("abort"));
|
|
16411
|
+
current.release(current);
|
|
16412
|
+
current = next;
|
|
16413
|
+
}
|
|
16414
|
+
self2.drain = noop2;
|
|
16415
|
+
}
|
|
16393
16416
|
function error49(handler) {
|
|
16394
16417
|
errorHandler = handler;
|
|
16395
16418
|
}
|
|
@@ -16461,17 +16484,20 @@ var require_queue = __commonJS((exports, module) => {
|
|
|
16461
16484
|
return p;
|
|
16462
16485
|
}
|
|
16463
16486
|
function drained() {
|
|
16464
|
-
if (queue2.idle()) {
|
|
16465
|
-
return new Promise(function(resolve) {
|
|
16466
|
-
resolve();
|
|
16467
|
-
});
|
|
16468
|
-
}
|
|
16469
|
-
var previousDrain = queue2.drain;
|
|
16470
16487
|
var p = new Promise(function(resolve) {
|
|
16471
|
-
|
|
16472
|
-
|
|
16473
|
-
|
|
16474
|
-
|
|
16488
|
+
process.nextTick(function() {
|
|
16489
|
+
if (queue2.idle()) {
|
|
16490
|
+
resolve();
|
|
16491
|
+
} else {
|
|
16492
|
+
var previousDrain = queue2.drain;
|
|
16493
|
+
queue2.drain = function() {
|
|
16494
|
+
if (typeof previousDrain === "function")
|
|
16495
|
+
previousDrain();
|
|
16496
|
+
resolve();
|
|
16497
|
+
queue2.drain = previousDrain;
|
|
16498
|
+
};
|
|
16499
|
+
}
|
|
16500
|
+
});
|
|
16475
16501
|
});
|
|
16476
16502
|
return p;
|
|
16477
16503
|
}
|
|
@@ -44107,7 +44133,53 @@ var pipeBusboy = async (req, res, busboy) => {
|
|
|
44107
44133
|
req.pipe(busboy);
|
|
44108
44134
|
}
|
|
44109
44135
|
};
|
|
44136
|
+
// ../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
|
|
44137
|
+
function isUnsafeProperty2(key) {
|
|
44138
|
+
return key === "__proto__";
|
|
44139
|
+
}
|
|
44110
44140
|
|
|
44141
|
+
// ../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
|
|
44142
|
+
function isPlainObject3(value) {
|
|
44143
|
+
if (!value || typeof value !== "object") {
|
|
44144
|
+
return false;
|
|
44145
|
+
}
|
|
44146
|
+
const proto = Object.getPrototypeOf(value);
|
|
44147
|
+
const hasObjectPrototype = proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;
|
|
44148
|
+
if (!hasObjectPrototype) {
|
|
44149
|
+
return false;
|
|
44150
|
+
}
|
|
44151
|
+
return Object.prototype.toString.call(value) === "[object Object]";
|
|
44152
|
+
}
|
|
44153
|
+
|
|
44154
|
+
// ../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/object/merge.mjs
|
|
44155
|
+
function merge3(target, source) {
|
|
44156
|
+
const sourceKeys = Object.keys(source);
|
|
44157
|
+
for (let i = 0;i < sourceKeys.length; i++) {
|
|
44158
|
+
const key = sourceKeys[i];
|
|
44159
|
+
if (isUnsafeProperty2(key)) {
|
|
44160
|
+
continue;
|
|
44161
|
+
}
|
|
44162
|
+
const sourceValue = source[key];
|
|
44163
|
+
const targetValue = target[key];
|
|
44164
|
+
if (isMergeableValue2(sourceValue) && isMergeableValue2(targetValue)) {
|
|
44165
|
+
target[key] = merge3(targetValue, sourceValue);
|
|
44166
|
+
} else if (Array.isArray(sourceValue)) {
|
|
44167
|
+
target[key] = merge3([], sourceValue);
|
|
44168
|
+
} else if (isPlainObject3(sourceValue)) {
|
|
44169
|
+
target[key] = merge3({}, sourceValue);
|
|
44170
|
+
} else if (targetValue === undefined || sourceValue !== undefined) {
|
|
44171
|
+
target[key] = sourceValue;
|
|
44172
|
+
}
|
|
44173
|
+
}
|
|
44174
|
+
return target;
|
|
44175
|
+
}
|
|
44176
|
+
function isMergeableValue2(value) {
|
|
44177
|
+
return isPlainObject3(value) || Array.isArray(value);
|
|
44178
|
+
}
|
|
44179
|
+
// ../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isBrowser.mjs
|
|
44180
|
+
function isBrowser4() {
|
|
44181
|
+
return typeof window !== "undefined" && window?.document != null;
|
|
44182
|
+
}
|
|
44111
44183
|
// src/module/assistant/proxy/s3.ts
|
|
44112
44184
|
var mapS3 = new Map;
|
|
44113
44185
|
|
|
@@ -44239,14 +44311,14 @@ function isObject2(value) {
|
|
|
44239
44311
|
var type = typeof value;
|
|
44240
44312
|
return value != null && (type == "object" || type == "function");
|
|
44241
44313
|
}
|
|
44242
|
-
function
|
|
44314
|
+
function identity2(value) {
|
|
44243
44315
|
return value;
|
|
44244
44316
|
}
|
|
44245
44317
|
var asyncTag = "[object AsyncFunction]";
|
|
44246
44318
|
var funcTag$1 = "[object Function]";
|
|
44247
44319
|
var genTag = "[object GeneratorFunction]";
|
|
44248
44320
|
var proxyTag = "[object Proxy]";
|
|
44249
|
-
function
|
|
44321
|
+
function isFunction2(value) {
|
|
44250
44322
|
if (!isObject2(value)) {
|
|
44251
44323
|
return false;
|
|
44252
44324
|
}
|
|
@@ -44285,7 +44357,7 @@ function baseIsNative(value) {
|
|
|
44285
44357
|
if (!isObject2(value) || isMasked(value)) {
|
|
44286
44358
|
return false;
|
|
44287
44359
|
}
|
|
44288
|
-
var pattern =
|
|
44360
|
+
var pattern = isFunction2(value) ? reIsNative : reIsHostCtor;
|
|
44289
44361
|
return pattern.test(toSource(value));
|
|
44290
44362
|
}
|
|
44291
44363
|
function getValue(object2, key) {
|
|
@@ -44362,7 +44434,7 @@ var defineProperty = function() {
|
|
|
44362
44434
|
return func;
|
|
44363
44435
|
} catch (e) {}
|
|
44364
44436
|
}();
|
|
44365
|
-
var baseSetToString = !defineProperty ?
|
|
44437
|
+
var baseSetToString = !defineProperty ? identity2 : function(func, string4) {
|
|
44366
44438
|
return defineProperty(func, "toString", {
|
|
44367
44439
|
configurable: true,
|
|
44368
44440
|
enumerable: false,
|
|
@@ -44437,14 +44509,14 @@ function overRest(func, start, transform2) {
|
|
|
44437
44509
|
};
|
|
44438
44510
|
}
|
|
44439
44511
|
function baseRest(func, start) {
|
|
44440
|
-
return setToString(overRest(func, start,
|
|
44512
|
+
return setToString(overRest(func, start, identity2), func + "");
|
|
44441
44513
|
}
|
|
44442
44514
|
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
44443
|
-
function
|
|
44515
|
+
function isLength2(value) {
|
|
44444
44516
|
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
44445
44517
|
}
|
|
44446
44518
|
function isArrayLike(value) {
|
|
44447
|
-
return value != null &&
|
|
44519
|
+
return value != null && isLength2(value.length) && !isFunction2(value);
|
|
44448
44520
|
}
|
|
44449
44521
|
function isIterateeCall(value, index, object2) {
|
|
44450
44522
|
if (!isObject2(object2)) {
|
|
@@ -44506,7 +44578,7 @@ var freeModule$2 = freeExports$2 && typeof module_manager == "object" && module_
|
|
|
44506
44578
|
var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
|
|
44507
44579
|
var Buffer$1 = moduleExports$2 ? root.Buffer : undefined;
|
|
44508
44580
|
var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : undefined;
|
|
44509
|
-
var
|
|
44581
|
+
var isBuffer2 = nativeIsBuffer || stubFalse;
|
|
44510
44582
|
var argsTag = "[object Arguments]";
|
|
44511
44583
|
var arrayTag = "[object Array]";
|
|
44512
44584
|
var boolTag = "[object Boolean]";
|
|
@@ -44535,7 +44607,7 @@ var typedArrayTags = {};
|
|
|
44535
44607
|
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
44536
44608
|
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag$1] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
44537
44609
|
function baseIsTypedArray(value) {
|
|
44538
|
-
return isObjectLike(value) &&
|
|
44610
|
+
return isObjectLike(value) && isLength2(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
44539
44611
|
}
|
|
44540
44612
|
function baseUnary(func) {
|
|
44541
44613
|
return function(value) {
|
|
@@ -44556,9 +44628,9 @@ var nodeUtil = function() {
|
|
|
44556
44628
|
} catch (e) {}
|
|
44557
44629
|
}();
|
|
44558
44630
|
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
44559
|
-
var
|
|
44631
|
+
var isTypedArray2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
44560
44632
|
function arrayLikeKeys(value, inherited) {
|
|
44561
|
-
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg &&
|
|
44633
|
+
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer2(value), isType = !isArr && !isArg && !isBuff && isTypedArray2(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
44562
44634
|
for (var key in value) {
|
|
44563
44635
|
if (!(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
|
|
44564
44636
|
result.push(key);
|
|
@@ -44757,7 +44829,7 @@ var objectProto = Object.prototype;
|
|
|
44757
44829
|
var funcToString = funcProto.toString;
|
|
44758
44830
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
44759
44831
|
var objectCtorString = funcToString.call(Object);
|
|
44760
|
-
function
|
|
44832
|
+
function isPlainObject6(value) {
|
|
44761
44833
|
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
44762
44834
|
return false;
|
|
44763
44835
|
}
|
|
@@ -44873,7 +44945,7 @@ function baseMergeDeep(object2, source, key, srcIndex, mergeFunc, customizer, st
|
|
|
44873
44945
|
var newValue = customizer ? customizer(objValue, srcValue, key + "", object2, source, stack) : undefined;
|
|
44874
44946
|
var isCommon = newValue === undefined;
|
|
44875
44947
|
if (isCommon) {
|
|
44876
|
-
var isArr = isArray(srcValue), isBuff = !isArr &&
|
|
44948
|
+
var isArr = isArray(srcValue), isBuff = !isArr && isBuffer2(srcValue), isTyped = !isArr && !isBuff && isTypedArray2(srcValue);
|
|
44877
44949
|
newValue = srcValue;
|
|
44878
44950
|
if (isArr || isBuff || isTyped) {
|
|
44879
44951
|
if (isArray(objValue)) {
|
|
@@ -44889,11 +44961,11 @@ function baseMergeDeep(object2, source, key, srcIndex, mergeFunc, customizer, st
|
|
|
44889
44961
|
} else {
|
|
44890
44962
|
newValue = [];
|
|
44891
44963
|
}
|
|
44892
|
-
} else if (
|
|
44964
|
+
} else if (isPlainObject6(srcValue) || isArguments(srcValue)) {
|
|
44893
44965
|
newValue = objValue;
|
|
44894
44966
|
if (isArguments(objValue)) {
|
|
44895
44967
|
newValue = toPlainObject(objValue);
|
|
44896
|
-
} else if (!isObject2(objValue) ||
|
|
44968
|
+
} else if (!isObject2(objValue) || isFunction2(objValue)) {
|
|
44897
44969
|
newValue = initCloneObject(srcValue);
|
|
44898
44970
|
}
|
|
44899
44971
|
} else {
|
|
@@ -44924,7 +44996,7 @@ function baseMerge(object2, source, srcIndex, customizer, stack) {
|
|
|
44924
44996
|
}
|
|
44925
44997
|
}, keysIn);
|
|
44926
44998
|
}
|
|
44927
|
-
var
|
|
44999
|
+
var merge5 = createAssigner(function(object2, source, srcIndex) {
|
|
44928
45000
|
baseMerge(object2, source, srcIndex);
|
|
44929
45001
|
});
|
|
44930
45002
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
@@ -44941,10 +45013,10 @@ function requireArray() {
|
|
|
44941
45013
|
hasRequiredArray = 1;
|
|
44942
45014
|
Object.defineProperty(array2, "__esModule", { value: true });
|
|
44943
45015
|
array2.splitWhen = array2.flatten = undefined;
|
|
44944
|
-
function
|
|
45016
|
+
function flatten2(items) {
|
|
44945
45017
|
return items.reduce((collection, item) => [].concat(collection, item), []);
|
|
44946
45018
|
}
|
|
44947
|
-
array2.flatten =
|
|
45019
|
+
array2.flatten = flatten2;
|
|
44948
45020
|
function splitWhen(items, predicate) {
|
|
44949
45021
|
const result = [[]];
|
|
44950
45022
|
let groupIndex = 0;
|
|
@@ -45383,13 +45455,13 @@ function requireStringify() {
|
|
|
45383
45455
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
45384
45456
|
* Released under the MIT License.
|
|
45385
45457
|
*/
|
|
45386
|
-
var
|
|
45458
|
+
var isNumber2;
|
|
45387
45459
|
var hasRequiredIsNumber;
|
|
45388
45460
|
function requireIsNumber() {
|
|
45389
45461
|
if (hasRequiredIsNumber)
|
|
45390
|
-
return
|
|
45462
|
+
return isNumber2;
|
|
45391
45463
|
hasRequiredIsNumber = 1;
|
|
45392
|
-
|
|
45464
|
+
isNumber2 = function(num) {
|
|
45393
45465
|
if (typeof num === "number") {
|
|
45394
45466
|
return num - num === 0;
|
|
45395
45467
|
}
|
|
@@ -45398,7 +45470,7 @@ function requireIsNumber() {
|
|
|
45398
45470
|
}
|
|
45399
45471
|
return false;
|
|
45400
45472
|
};
|
|
45401
|
-
return
|
|
45473
|
+
return isNumber2;
|
|
45402
45474
|
}
|
|
45403
45475
|
/*!
|
|
45404
45476
|
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
@@ -45412,15 +45484,15 @@ function requireToRegexRange() {
|
|
|
45412
45484
|
if (hasRequiredToRegexRange)
|
|
45413
45485
|
return toRegexRange_1;
|
|
45414
45486
|
hasRequiredToRegexRange = 1;
|
|
45415
|
-
const
|
|
45487
|
+
const isNumber3 = requireIsNumber();
|
|
45416
45488
|
const toRegexRange = (min, max, options) => {
|
|
45417
|
-
if (
|
|
45489
|
+
if (isNumber3(min) === false) {
|
|
45418
45490
|
throw new TypeError("toRegexRange: expected the first argument to be a number");
|
|
45419
45491
|
}
|
|
45420
45492
|
if (max === undefined || min === max) {
|
|
45421
45493
|
return String(min);
|
|
45422
45494
|
}
|
|
45423
|
-
if (
|
|
45495
|
+
if (isNumber3(max) === false) {
|
|
45424
45496
|
throw new TypeError("toRegexRange: expected the second argument to be a number.");
|
|
45425
45497
|
}
|
|
45426
45498
|
let opts = { relaxZeros: true, ...options };
|
|
@@ -45505,7 +45577,7 @@ function requireToRegexRange() {
|
|
|
45505
45577
|
if (start === stop) {
|
|
45506
45578
|
return { pattern: start, count: [], digits: 0 };
|
|
45507
45579
|
}
|
|
45508
|
-
let zipped =
|
|
45580
|
+
let zipped = zip2(start, stop);
|
|
45509
45581
|
let digits = zipped.length;
|
|
45510
45582
|
let pattern2 = "";
|
|
45511
45583
|
let count = 0;
|
|
@@ -45552,20 +45624,20 @@ function requireToRegexRange() {
|
|
|
45552
45624
|
}
|
|
45553
45625
|
return tokens;
|
|
45554
45626
|
}
|
|
45555
|
-
function filterPatterns(arr, comparison, prefix,
|
|
45627
|
+
function filterPatterns(arr, comparison, prefix, intersection3, options) {
|
|
45556
45628
|
let result = [];
|
|
45557
45629
|
for (let ele of arr) {
|
|
45558
45630
|
let { string: string4 } = ele;
|
|
45559
|
-
if (!
|
|
45631
|
+
if (!intersection3 && !contains(comparison, "string", string4)) {
|
|
45560
45632
|
result.push(prefix + string4);
|
|
45561
45633
|
}
|
|
45562
|
-
if (
|
|
45634
|
+
if (intersection3 && contains(comparison, "string", string4)) {
|
|
45563
45635
|
result.push(prefix + string4);
|
|
45564
45636
|
}
|
|
45565
45637
|
}
|
|
45566
45638
|
return result;
|
|
45567
45639
|
}
|
|
45568
|
-
function
|
|
45640
|
+
function zip2(a, b) {
|
|
45569
45641
|
let arr = [];
|
|
45570
45642
|
for (let i = 0;i < a.length; i++)
|
|
45571
45643
|
arr.push([a[i], b[i]]);
|
|
@@ -45640,7 +45712,7 @@ function requireFillRange() {
|
|
|
45640
45712
|
const isValidValue = (value) => {
|
|
45641
45713
|
return typeof value === "number" || typeof value === "string" && value !== "";
|
|
45642
45714
|
};
|
|
45643
|
-
const
|
|
45715
|
+
const isNumber3 = (num) => Number.isInteger(+num);
|
|
45644
45716
|
const zeros = (input) => {
|
|
45645
45717
|
let value = `${input}`;
|
|
45646
45718
|
let index = -1;
|
|
@@ -45658,7 +45730,7 @@ function requireFillRange() {
|
|
|
45658
45730
|
}
|
|
45659
45731
|
return options.stringify === true;
|
|
45660
45732
|
};
|
|
45661
|
-
const
|
|
45733
|
+
const pad2 = (input, maxLength, toNumber) => {
|
|
45662
45734
|
if (maxLength > 0) {
|
|
45663
45735
|
let dash = input[0] === "-" ? "-" : "";
|
|
45664
45736
|
if (dash)
|
|
@@ -45761,24 +45833,24 @@ function requireFillRange() {
|
|
|
45761
45833
|
}
|
|
45762
45834
|
let parts = { negatives: [], positives: [] };
|
|
45763
45835
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
45764
|
-
let
|
|
45836
|
+
let range2 = [];
|
|
45765
45837
|
let index = 0;
|
|
45766
45838
|
while (descending ? a >= b : a <= b) {
|
|
45767
45839
|
if (options.toRegex === true && step > 1) {
|
|
45768
45840
|
push(a);
|
|
45769
45841
|
} else {
|
|
45770
|
-
|
|
45842
|
+
range2.push(pad2(format(a, index), maxLen, toNumber));
|
|
45771
45843
|
}
|
|
45772
45844
|
a = descending ? a - step : a + step;
|
|
45773
45845
|
index++;
|
|
45774
45846
|
}
|
|
45775
45847
|
if (options.toRegex === true) {
|
|
45776
|
-
return step > 1 ? toSequence(parts, options, maxLen) : toRegex(
|
|
45848
|
+
return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range2, null, { wrap: false, ...options });
|
|
45777
45849
|
}
|
|
45778
|
-
return
|
|
45850
|
+
return range2;
|
|
45779
45851
|
};
|
|
45780
45852
|
const fillLetters = (start, end, step = 1, options = {}) => {
|
|
45781
|
-
if (!
|
|
45853
|
+
if (!isNumber3(start) && start.length > 1 || !isNumber3(end) && end.length > 1) {
|
|
45782
45854
|
return invalidRange(start, end, options);
|
|
45783
45855
|
}
|
|
45784
45856
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
@@ -45790,19 +45862,19 @@ function requireFillRange() {
|
|
|
45790
45862
|
if (options.toRegex && step === 1) {
|
|
45791
45863
|
return toRange(min, max, false, options);
|
|
45792
45864
|
}
|
|
45793
|
-
let
|
|
45865
|
+
let range2 = [];
|
|
45794
45866
|
let index = 0;
|
|
45795
45867
|
while (descending ? a >= b : a <= b) {
|
|
45796
|
-
|
|
45868
|
+
range2.push(format(a, index));
|
|
45797
45869
|
a = descending ? a - step : a + step;
|
|
45798
45870
|
index++;
|
|
45799
45871
|
}
|
|
45800
45872
|
if (options.toRegex === true) {
|
|
45801
|
-
return toRegex(
|
|
45873
|
+
return toRegex(range2, null, { wrap: false, options });
|
|
45802
45874
|
}
|
|
45803
|
-
return
|
|
45875
|
+
return range2;
|
|
45804
45876
|
};
|
|
45805
|
-
const
|
|
45877
|
+
const fill2 = (start, end, step, options = {}) => {
|
|
45806
45878
|
if (end == null && isValidValue(start)) {
|
|
45807
45879
|
return [start];
|
|
45808
45880
|
}
|
|
@@ -45810,26 +45882,26 @@ function requireFillRange() {
|
|
|
45810
45882
|
return invalidRange(start, end, options);
|
|
45811
45883
|
}
|
|
45812
45884
|
if (typeof step === "function") {
|
|
45813
|
-
return
|
|
45885
|
+
return fill2(start, end, 1, { transform: step });
|
|
45814
45886
|
}
|
|
45815
45887
|
if (isObject3(step)) {
|
|
45816
|
-
return
|
|
45888
|
+
return fill2(start, end, 0, step);
|
|
45817
45889
|
}
|
|
45818
45890
|
let opts = { ...options };
|
|
45819
45891
|
if (opts.capture === true)
|
|
45820
45892
|
opts.wrap = true;
|
|
45821
45893
|
step = step || opts.step || 1;
|
|
45822
|
-
if (!
|
|
45894
|
+
if (!isNumber3(step)) {
|
|
45823
45895
|
if (step != null && !isObject3(step))
|
|
45824
45896
|
return invalidStep(step, opts);
|
|
45825
|
-
return
|
|
45897
|
+
return fill2(start, end, 1, step);
|
|
45826
45898
|
}
|
|
45827
|
-
if (
|
|
45899
|
+
if (isNumber3(start) && isNumber3(end)) {
|
|
45828
45900
|
return fillNumbers(start, end, step, opts);
|
|
45829
45901
|
}
|
|
45830
45902
|
return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
|
|
45831
45903
|
};
|
|
45832
|
-
fillRange =
|
|
45904
|
+
fillRange = fill2;
|
|
45833
45905
|
return fillRange;
|
|
45834
45906
|
}
|
|
45835
45907
|
var compile_1;
|
|
@@ -45838,7 +45910,7 @@ function requireCompile() {
|
|
|
45838
45910
|
if (hasRequiredCompile)
|
|
45839
45911
|
return compile_1;
|
|
45840
45912
|
hasRequiredCompile = 1;
|
|
45841
|
-
const
|
|
45913
|
+
const fill2 = requireFillRange();
|
|
45842
45914
|
const utils = requireUtils$3();
|
|
45843
45915
|
const compile = (ast, options = {}) => {
|
|
45844
45916
|
const walk = (node, parent = {}) => {
|
|
@@ -45868,9 +45940,9 @@ function requireCompile() {
|
|
|
45868
45940
|
}
|
|
45869
45941
|
if (node.nodes && node.ranges > 0) {
|
|
45870
45942
|
const args2 = utils.reduce(node.nodes);
|
|
45871
|
-
const
|
|
45872
|
-
if (
|
|
45873
|
-
return args2.length > 1 &&
|
|
45943
|
+
const range2 = fill2(...args2, { ...options, wrap: false, toRegex: true, strictZeros: true });
|
|
45944
|
+
if (range2.length !== 0) {
|
|
45945
|
+
return args2.length > 1 && range2.length > 1 ? `(${range2})` : range2;
|
|
45874
45946
|
}
|
|
45875
45947
|
}
|
|
45876
45948
|
if (node.nodes) {
|
|
@@ -45891,7 +45963,7 @@ function requireExpand() {
|
|
|
45891
45963
|
if (hasRequiredExpand)
|
|
45892
45964
|
return expand_1;
|
|
45893
45965
|
hasRequiredExpand = 1;
|
|
45894
|
-
const
|
|
45966
|
+
const fill2 = requireFillRange();
|
|
45895
45967
|
const stringify2 = requireStringify();
|
|
45896
45968
|
const utils = requireUtils$3();
|
|
45897
45969
|
const append = (queue = "", stash = "", enclose = false) => {
|
|
@@ -45941,11 +46013,11 @@ function requireExpand() {
|
|
|
45941
46013
|
if (utils.exceedsLimit(...args2, options.step, rangeLimit)) {
|
|
45942
46014
|
throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
|
45943
46015
|
}
|
|
45944
|
-
let
|
|
45945
|
-
if (
|
|
45946
|
-
|
|
46016
|
+
let range2 = fill2(...args2, options);
|
|
46017
|
+
if (range2.length === 0) {
|
|
46018
|
+
range2 = stringify2(node, options);
|
|
45947
46019
|
}
|
|
45948
|
-
q.push(append(q.pop(),
|
|
46020
|
+
q.push(append(q.pop(), range2));
|
|
45949
46021
|
node.nodes = [];
|
|
45950
46022
|
return;
|
|
45951
46023
|
}
|
|
@@ -46234,9 +46306,9 @@ function requireParse$1() {
|
|
|
46234
46306
|
}
|
|
46235
46307
|
if (prev.type === "range") {
|
|
46236
46308
|
siblings.pop();
|
|
46237
|
-
const
|
|
46238
|
-
|
|
46239
|
-
prev =
|
|
46309
|
+
const before2 = siblings[siblings.length - 1];
|
|
46310
|
+
before2.value += prev.value + value;
|
|
46311
|
+
prev = before2;
|
|
46240
46312
|
block.ranges--;
|
|
46241
46313
|
continue;
|
|
46242
46314
|
}
|
|
@@ -46973,7 +47045,7 @@ function requireParse() {
|
|
|
46973
47045
|
state.output += token.output != null ? token.output : token.value;
|
|
46974
47046
|
consume(token.value);
|
|
46975
47047
|
};
|
|
46976
|
-
const
|
|
47048
|
+
const negate2 = () => {
|
|
46977
47049
|
let count = 1;
|
|
46978
47050
|
while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
|
|
46979
47051
|
advance();
|
|
@@ -47034,7 +47106,7 @@ function requireParse() {
|
|
|
47034
47106
|
};
|
|
47035
47107
|
const extglobClose = (token) => {
|
|
47036
47108
|
let output = token.close + (opts.capture ? ")" : "");
|
|
47037
|
-
let
|
|
47109
|
+
let rest2;
|
|
47038
47110
|
if (token.type === "negate") {
|
|
47039
47111
|
let extglobStar = star;
|
|
47040
47112
|
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
|
|
@@ -47043,8 +47115,8 @@ function requireParse() {
|
|
|
47043
47115
|
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
|
|
47044
47116
|
output = token.close = `)$))${extglobStar}`;
|
|
47045
47117
|
}
|
|
47046
|
-
if (token.inner.includes("*") && (
|
|
47047
|
-
const expression = parse2(
|
|
47118
|
+
if (token.inner.includes("*") && (rest2 = remaining()) && /^\.[^\\/.]+$/.test(rest2)) {
|
|
47119
|
+
const expression = parse2(rest2, { ...options, fastpaths: false }).output;
|
|
47048
47120
|
output = token.close = `)${expression})${extglobStar})`;
|
|
47049
47121
|
}
|
|
47050
47122
|
if (token.prev.type === "bos") {
|
|
@@ -47056,17 +47128,17 @@ function requireParse() {
|
|
|
47056
47128
|
};
|
|
47057
47129
|
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
47058
47130
|
let backslashes = false;
|
|
47059
|
-
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc2, chars, first,
|
|
47131
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc2, chars, first, rest2, index) => {
|
|
47060
47132
|
if (first === "\\") {
|
|
47061
47133
|
backslashes = true;
|
|
47062
47134
|
return m;
|
|
47063
47135
|
}
|
|
47064
47136
|
if (first === "?") {
|
|
47065
47137
|
if (esc2) {
|
|
47066
|
-
return esc2 + first + (
|
|
47138
|
+
return esc2 + first + (rest2 ? QMARK.repeat(rest2.length) : "");
|
|
47067
47139
|
}
|
|
47068
47140
|
if (index === 0) {
|
|
47069
|
-
return qmarkNoDot + (
|
|
47141
|
+
return qmarkNoDot + (rest2 ? QMARK.repeat(rest2.length) : "");
|
|
47070
47142
|
}
|
|
47071
47143
|
return QMARK.repeat(chars.length);
|
|
47072
47144
|
}
|
|
@@ -47075,7 +47147,7 @@ function requireParse() {
|
|
|
47075
47147
|
}
|
|
47076
47148
|
if (first === "*") {
|
|
47077
47149
|
if (esc2) {
|
|
47078
|
-
return esc2 + first + (
|
|
47150
|
+
return esc2 + first + (rest2 ? star : "");
|
|
47079
47151
|
}
|
|
47080
47152
|
return star;
|
|
47081
47153
|
}
|
|
@@ -47142,8 +47214,8 @@ function requireParse() {
|
|
|
47142
47214
|
if (inner.includes(":")) {
|
|
47143
47215
|
const idx = prev.value.lastIndexOf("[");
|
|
47144
47216
|
const pre = prev.value.slice(0, idx);
|
|
47145
|
-
const
|
|
47146
|
-
const posix = POSIX_REGEX_SOURCE[
|
|
47217
|
+
const rest3 = prev.value.slice(idx + 2);
|
|
47218
|
+
const posix = POSIX_REGEX_SOURCE[rest3];
|
|
47147
47219
|
if (posix) {
|
|
47148
47220
|
prev.value = pre + posix;
|
|
47149
47221
|
state.backtrack = true;
|
|
@@ -47267,17 +47339,17 @@ function requireParse() {
|
|
|
47267
47339
|
let output = ")";
|
|
47268
47340
|
if (brace.dots === true) {
|
|
47269
47341
|
const arr = tokens.slice();
|
|
47270
|
-
const
|
|
47342
|
+
const range2 = [];
|
|
47271
47343
|
for (let i = arr.length - 1;i >= 0; i--) {
|
|
47272
47344
|
tokens.pop();
|
|
47273
47345
|
if (arr[i].type === "brace") {
|
|
47274
47346
|
break;
|
|
47275
47347
|
}
|
|
47276
47348
|
if (arr[i].type !== "dots") {
|
|
47277
|
-
|
|
47349
|
+
range2.unshift(arr[i].value);
|
|
47278
47350
|
}
|
|
47279
47351
|
}
|
|
47280
|
-
output = expandRange(
|
|
47352
|
+
output = expandRange(range2, opts);
|
|
47281
47353
|
state.backtrack = true;
|
|
47282
47354
|
}
|
|
47283
47355
|
if (brace.comma !== true && brace.dots !== true) {
|
|
@@ -47375,7 +47447,7 @@ function requireParse() {
|
|
|
47375
47447
|
}
|
|
47376
47448
|
}
|
|
47377
47449
|
if (opts.nonegate !== true && state.index === 0) {
|
|
47378
|
-
|
|
47450
|
+
negate2();
|
|
47379
47451
|
continue;
|
|
47380
47452
|
}
|
|
47381
47453
|
}
|
|
@@ -47425,8 +47497,8 @@ function requireParse() {
|
|
|
47425
47497
|
consume(value);
|
|
47426
47498
|
continue;
|
|
47427
47499
|
}
|
|
47428
|
-
let
|
|
47429
|
-
if (opts.noextglob !== true && /^\([^?]/.test(
|
|
47500
|
+
let rest2 = remaining();
|
|
47501
|
+
if (opts.noextglob !== true && /^\([^?]/.test(rest2)) {
|
|
47430
47502
|
extglobOpen("star", value);
|
|
47431
47503
|
continue;
|
|
47432
47504
|
}
|
|
@@ -47436,10 +47508,10 @@ function requireParse() {
|
|
|
47436
47508
|
continue;
|
|
47437
47509
|
}
|
|
47438
47510
|
const prior = prev.prev;
|
|
47439
|
-
const
|
|
47511
|
+
const before2 = prior.prev;
|
|
47440
47512
|
const isStart = prior.type === "slash" || prior.type === "bos";
|
|
47441
|
-
const afterStar =
|
|
47442
|
-
if (opts.bash === true && (!isStart ||
|
|
47513
|
+
const afterStar = before2 && (before2.type === "star" || before2.type === "globstar");
|
|
47514
|
+
if (opts.bash === true && (!isStart || rest2[0] && rest2[0] !== "/")) {
|
|
47443
47515
|
push({ type: "star", value, output: "" });
|
|
47444
47516
|
continue;
|
|
47445
47517
|
}
|
|
@@ -47449,12 +47521,12 @@ function requireParse() {
|
|
|
47449
47521
|
push({ type: "star", value, output: "" });
|
|
47450
47522
|
continue;
|
|
47451
47523
|
}
|
|
47452
|
-
while (
|
|
47453
|
-
const
|
|
47454
|
-
if (
|
|
47524
|
+
while (rest2.slice(0, 3) === "/**") {
|
|
47525
|
+
const after2 = input[state.index + 4];
|
|
47526
|
+
if (after2 && after2 !== "/") {
|
|
47455
47527
|
break;
|
|
47456
47528
|
}
|
|
47457
|
-
|
|
47529
|
+
rest2 = rest2.slice(3);
|
|
47458
47530
|
consume("/**", 3);
|
|
47459
47531
|
}
|
|
47460
47532
|
if (prior.type === "bos" && eos()) {
|
|
@@ -47477,8 +47549,8 @@ function requireParse() {
|
|
|
47477
47549
|
consume(value);
|
|
47478
47550
|
continue;
|
|
47479
47551
|
}
|
|
47480
|
-
if (prior.type === "slash" && prior.prev.type !== "bos" &&
|
|
47481
|
-
const end =
|
|
47552
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && rest2[0] === "/") {
|
|
47553
|
+
const end = rest2[1] !== undefined ? "|$" : "";
|
|
47482
47554
|
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
47483
47555
|
prior.output = `(?:${prior.output}`;
|
|
47484
47556
|
prev.type = "globstar";
|
|
@@ -47490,7 +47562,7 @@ function requireParse() {
|
|
|
47490
47562
|
push({ type: "slash", value: "/", output: "" });
|
|
47491
47563
|
continue;
|
|
47492
47564
|
}
|
|
47493
|
-
if (prior.type === "bos" &&
|
|
47565
|
+
if (prior.type === "bos" && rest2[0] === "/") {
|
|
47494
47566
|
prev.type = "globstar";
|
|
47495
47567
|
prev.value += value;
|
|
47496
47568
|
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
@@ -48284,10 +48356,10 @@ function requireString() {
|
|
|
48284
48356
|
hasRequiredString = 1;
|
|
48285
48357
|
Object.defineProperty(string4, "__esModule", { value: true });
|
|
48286
48358
|
string4.isEmpty = string4.isString = undefined;
|
|
48287
|
-
function
|
|
48359
|
+
function isString2(input) {
|
|
48288
48360
|
return typeof input === "string";
|
|
48289
48361
|
}
|
|
48290
|
-
string4.isString =
|
|
48362
|
+
string4.isString = isString2;
|
|
48291
48363
|
function isEmpty(input) {
|
|
48292
48364
|
return input === "";
|
|
48293
48365
|
}
|
|
@@ -48981,22 +49053,22 @@ function requireReusify() {
|
|
|
48981
49053
|
return reusify_1;
|
|
48982
49054
|
hasRequiredReusify = 1;
|
|
48983
49055
|
function reusify(Constructor) {
|
|
48984
|
-
var
|
|
48985
|
-
var
|
|
49056
|
+
var head2 = new Constructor;
|
|
49057
|
+
var tail2 = head2;
|
|
48986
49058
|
function get() {
|
|
48987
|
-
var current =
|
|
49059
|
+
var current = head2;
|
|
48988
49060
|
if (current.next) {
|
|
48989
|
-
|
|
49061
|
+
head2 = current.next;
|
|
48990
49062
|
} else {
|
|
48991
|
-
|
|
48992
|
-
|
|
49063
|
+
head2 = new Constructor;
|
|
49064
|
+
tail2 = head2;
|
|
48993
49065
|
}
|
|
48994
49066
|
current.next = null;
|
|
48995
49067
|
return current;
|
|
48996
49068
|
}
|
|
48997
49069
|
function release(obj) {
|
|
48998
|
-
|
|
48999
|
-
|
|
49070
|
+
tail2.next = obj;
|
|
49071
|
+
tail2 = obj;
|
|
49000
49072
|
}
|
|
49001
49073
|
return {
|
|
49002
49074
|
get,
|
|
@@ -49028,8 +49100,8 @@ function requireQueue() {
|
|
|
49028
49100
|
var errorHandler = null;
|
|
49029
49101
|
var self2 = {
|
|
49030
49102
|
push,
|
|
49031
|
-
drain:
|
|
49032
|
-
saturated:
|
|
49103
|
+
drain: noop2,
|
|
49104
|
+
saturated: noop2,
|
|
49033
49105
|
pause,
|
|
49034
49106
|
paused: false,
|
|
49035
49107
|
get concurrency() {
|
|
@@ -49053,7 +49125,7 @@ function requireQueue() {
|
|
|
49053
49125
|
length,
|
|
49054
49126
|
getQueue,
|
|
49055
49127
|
unshift,
|
|
49056
|
-
empty:
|
|
49128
|
+
empty: noop2,
|
|
49057
49129
|
kill,
|
|
49058
49130
|
killAndDrain,
|
|
49059
49131
|
error: error48
|
|
@@ -49105,7 +49177,7 @@ function requireQueue() {
|
|
|
49105
49177
|
current.context = context;
|
|
49106
49178
|
current.release = release;
|
|
49107
49179
|
current.value = value;
|
|
49108
|
-
current.callback = done ||
|
|
49180
|
+
current.callback = done || noop2;
|
|
49109
49181
|
current.errorHandler = errorHandler;
|
|
49110
49182
|
if (_running >= _concurrency || self2.paused) {
|
|
49111
49183
|
if (queueTail) {
|
|
@@ -49126,7 +49198,7 @@ function requireQueue() {
|
|
|
49126
49198
|
current.context = context;
|
|
49127
49199
|
current.release = release;
|
|
49128
49200
|
current.value = value;
|
|
49129
|
-
current.callback = done ||
|
|
49201
|
+
current.callback = done || noop2;
|
|
49130
49202
|
current.errorHandler = errorHandler;
|
|
49131
49203
|
if (_running >= _concurrency || self2.paused) {
|
|
49132
49204
|
if (queueHead) {
|
|
@@ -49168,24 +49240,24 @@ function requireQueue() {
|
|
|
49168
49240
|
function kill() {
|
|
49169
49241
|
queueHead = null;
|
|
49170
49242
|
queueTail = null;
|
|
49171
|
-
self2.drain =
|
|
49243
|
+
self2.drain = noop2;
|
|
49172
49244
|
}
|
|
49173
49245
|
function killAndDrain() {
|
|
49174
49246
|
queueHead = null;
|
|
49175
49247
|
queueTail = null;
|
|
49176
49248
|
self2.drain();
|
|
49177
|
-
self2.drain =
|
|
49249
|
+
self2.drain = noop2;
|
|
49178
49250
|
}
|
|
49179
49251
|
function error48(handler) {
|
|
49180
49252
|
errorHandler = handler;
|
|
49181
49253
|
}
|
|
49182
49254
|
}
|
|
49183
|
-
function
|
|
49255
|
+
function noop2() {}
|
|
49184
49256
|
function Task() {
|
|
49185
49257
|
this.value = null;
|
|
49186
|
-
this.callback =
|
|
49258
|
+
this.callback = noop2;
|
|
49187
49259
|
this.next = null;
|
|
49188
|
-
this.release =
|
|
49260
|
+
this.release = noop2;
|
|
49189
49261
|
this.context = null;
|
|
49190
49262
|
this.errorHandler = null;
|
|
49191
49263
|
var self2 = this;
|
|
@@ -49194,7 +49266,7 @@ function requireQueue() {
|
|
|
49194
49266
|
var errorHandler = self2.errorHandler;
|
|
49195
49267
|
var val = self2.value;
|
|
49196
49268
|
self2.value = null;
|
|
49197
|
-
self2.callback =
|
|
49269
|
+
self2.callback = noop2;
|
|
49198
49270
|
if (self2.errorHandler) {
|
|
49199
49271
|
errorHandler(err, val);
|
|
49200
49272
|
}
|
|
@@ -49230,7 +49302,7 @@ function requireQueue() {
|
|
|
49230
49302
|
resolve(result);
|
|
49231
49303
|
});
|
|
49232
49304
|
});
|
|
49233
|
-
p.catch(
|
|
49305
|
+
p.catch(noop2);
|
|
49234
49306
|
return p;
|
|
49235
49307
|
}
|
|
49236
49308
|
function unshift(value) {
|
|
@@ -49243,7 +49315,7 @@ function requireQueue() {
|
|
|
49243
49315
|
resolve(result);
|
|
49244
49316
|
});
|
|
49245
49317
|
});
|
|
49246
|
-
p.catch(
|
|
49318
|
+
p.catch(noop2);
|
|
49247
49319
|
return p;
|
|
49248
49320
|
}
|
|
49249
49321
|
function drained() {
|
|
@@ -49807,7 +49879,7 @@ function requireAsync$1() {
|
|
|
49807
49879
|
}
|
|
49808
49880
|
var provider = {};
|
|
49809
49881
|
var deep = {};
|
|
49810
|
-
var
|
|
49882
|
+
var partial3 = {};
|
|
49811
49883
|
var matcher = {};
|
|
49812
49884
|
var hasRequiredMatcher;
|
|
49813
49885
|
function requireMatcher() {
|
|
@@ -49864,9 +49936,9 @@ function requireMatcher() {
|
|
|
49864
49936
|
var hasRequiredPartial;
|
|
49865
49937
|
function requirePartial() {
|
|
49866
49938
|
if (hasRequiredPartial)
|
|
49867
|
-
return
|
|
49939
|
+
return partial3;
|
|
49868
49940
|
hasRequiredPartial = 1;
|
|
49869
|
-
Object.defineProperty(
|
|
49941
|
+
Object.defineProperty(partial3, "__esModule", { value: true });
|
|
49870
49942
|
const matcher_1 = requireMatcher();
|
|
49871
49943
|
|
|
49872
49944
|
class PartialMatcher extends matcher_1.default {
|
|
@@ -49896,8 +49968,8 @@ function requirePartial() {
|
|
|
49896
49968
|
return false;
|
|
49897
49969
|
}
|
|
49898
49970
|
}
|
|
49899
|
-
|
|
49900
|
-
return
|
|
49971
|
+
partial3.default = PartialMatcher;
|
|
49972
|
+
return partial3;
|
|
49901
49973
|
}
|
|
49902
49974
|
var hasRequiredDeep;
|
|
49903
49975
|
function requireDeep() {
|
|
@@ -50932,7 +51004,7 @@ class Manager {
|
|
|
50932
51004
|
if (!app) {
|
|
50933
51005
|
return;
|
|
50934
51006
|
}
|
|
50935
|
-
|
|
51007
|
+
merge5(app, info);
|
|
50936
51008
|
this.loadApp(app);
|
|
50937
51009
|
await this.saveAppInfo(app);
|
|
50938
51010
|
return onAppShowInfo(app);
|
|
@@ -51164,54 +51236,6 @@ var deleteFileAppInfo2 = async (key, appsPath) => {
|
|
|
51164
51236
|
|
|
51165
51237
|
// src/module/local-apps/src/modules/manager.ts
|
|
51166
51238
|
import { fork as fork2 } from "node:child_process";
|
|
51167
|
-
// ../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
|
|
51168
|
-
function isUnsafeProperty2(key) {
|
|
51169
|
-
return key === "__proto__";
|
|
51170
|
-
}
|
|
51171
|
-
|
|
51172
|
-
// ../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
|
|
51173
|
-
function isPlainObject5(value) {
|
|
51174
|
-
if (!value || typeof value !== "object") {
|
|
51175
|
-
return false;
|
|
51176
|
-
}
|
|
51177
|
-
const proto = Object.getPrototypeOf(value);
|
|
51178
|
-
const hasObjectPrototype = proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;
|
|
51179
|
-
if (!hasObjectPrototype) {
|
|
51180
|
-
return false;
|
|
51181
|
-
}
|
|
51182
|
-
return Object.prototype.toString.call(value) === "[object Object]";
|
|
51183
|
-
}
|
|
51184
|
-
|
|
51185
|
-
// ../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/object/merge.mjs
|
|
51186
|
-
function merge5(target, source) {
|
|
51187
|
-
const sourceKeys = Object.keys(source);
|
|
51188
|
-
for (let i = 0;i < sourceKeys.length; i++) {
|
|
51189
|
-
const key = sourceKeys[i];
|
|
51190
|
-
if (isUnsafeProperty2(key)) {
|
|
51191
|
-
continue;
|
|
51192
|
-
}
|
|
51193
|
-
const sourceValue = source[key];
|
|
51194
|
-
const targetValue = target[key];
|
|
51195
|
-
if (isMergeableValue2(sourceValue) && isMergeableValue2(targetValue)) {
|
|
51196
|
-
target[key] = merge5(targetValue, sourceValue);
|
|
51197
|
-
} else if (Array.isArray(sourceValue)) {
|
|
51198
|
-
target[key] = merge5([], sourceValue);
|
|
51199
|
-
} else if (isPlainObject5(sourceValue)) {
|
|
51200
|
-
target[key] = merge5({}, sourceValue);
|
|
51201
|
-
} else if (targetValue === undefined || sourceValue !== undefined) {
|
|
51202
|
-
target[key] = sourceValue;
|
|
51203
|
-
}
|
|
51204
|
-
}
|
|
51205
|
-
return target;
|
|
51206
|
-
}
|
|
51207
|
-
function isMergeableValue2(value) {
|
|
51208
|
-
return isPlainObject5(value) || Array.isArray(value);
|
|
51209
|
-
}
|
|
51210
|
-
// ../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isBrowser.mjs
|
|
51211
|
-
function isBrowser4() {
|
|
51212
|
-
return typeof window !== "undefined" && window?.document != null;
|
|
51213
|
-
}
|
|
51214
|
-
// src/module/local-apps/src/modules/manager.ts
|
|
51215
51239
|
import path6 from "node:path";
|
|
51216
51240
|
var import_fast_glob = __toESM(require_out4(), 1);
|
|
51217
51241
|
import fs7 from "node:fs";
|
|
@@ -51595,7 +51619,7 @@ class Manager2 {
|
|
|
51595
51619
|
if (!app) {
|
|
51596
51620
|
return;
|
|
51597
51621
|
}
|
|
51598
|
-
|
|
51622
|
+
merge3(app, info);
|
|
51599
51623
|
this.loadApp(app);
|
|
51600
51624
|
await this.saveAppInfo(app);
|
|
51601
51625
|
return onAppShowInfo2(app);
|
|
@@ -53245,7 +53269,7 @@ __export3(exports_util2, {
|
|
|
53245
53269
|
partial: () => partial4,
|
|
53246
53270
|
parsedType: () => parsedType2,
|
|
53247
53271
|
optionalKeys: () => optionalKeys2,
|
|
53248
|
-
omit: () =>
|
|
53272
|
+
omit: () => omit2,
|
|
53249
53273
|
objectClone: () => objectClone2,
|
|
53250
53274
|
numKeys: () => numKeys2,
|
|
53251
53275
|
nullish: () => nullish3,
|
|
@@ -53624,7 +53648,7 @@ function pick22(schema, mask) {
|
|
|
53624
53648
|
});
|
|
53625
53649
|
return clone3(schema, def);
|
|
53626
53650
|
}
|
|
53627
|
-
function
|
|
53651
|
+
function omit2(schema, mask) {
|
|
53628
53652
|
const currDef = schema._zod.def;
|
|
53629
53653
|
const checks = currDef.checks;
|
|
53630
53654
|
const hasChecks = checks && checks.length > 0;
|
|
@@ -66438,7 +66462,7 @@ function filter(data, query) {
|
|
|
66438
66462
|
return executor.execute(ast, data);
|
|
66439
66463
|
}
|
|
66440
66464
|
|
|
66441
|
-
// ../node_modules/.pnpm/@kevisual+api@0.0.
|
|
66465
|
+
// ../node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-proxy/router-api-proxy.ts
|
|
66442
66466
|
var initApi = async (opts) => {
|
|
66443
66467
|
const router = opts?.router;
|
|
66444
66468
|
const item = opts?.item;
|
|
@@ -67464,7 +67488,7 @@ __export(exports_util3, {
|
|
|
67464
67488
|
partial: () => partial5,
|
|
67465
67489
|
parsedType: () => parsedType3,
|
|
67466
67490
|
optionalKeys: () => optionalKeys3,
|
|
67467
|
-
omit: () =>
|
|
67491
|
+
omit: () => omit3,
|
|
67468
67492
|
objectClone: () => objectClone3,
|
|
67469
67493
|
numKeys: () => numKeys3,
|
|
67470
67494
|
nullish: () => nullish5,
|
|
@@ -67843,7 +67867,7 @@ function pick5(schema, mask) {
|
|
|
67843
67867
|
});
|
|
67844
67868
|
return clone4(schema, def);
|
|
67845
67869
|
}
|
|
67846
|
-
function
|
|
67870
|
+
function omit3(schema, mask) {
|
|
67847
67871
|
const currDef = schema._zod.def;
|
|
67848
67872
|
const checks = currDef.checks;
|
|
67849
67873
|
const hasChecks = checks && checks.length > 0;
|
|
@@ -81560,7 +81584,7 @@ class Query2 {
|
|
|
81560
81584
|
}
|
|
81561
81585
|
}
|
|
81562
81586
|
|
|
81563
|
-
// ../node_modules/.pnpm/@kevisual+api@0.0.
|
|
81587
|
+
// ../node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/dist/query-login-node.js
|
|
81564
81588
|
import { homedir as homedir2 } from "node:os";
|
|
81565
81589
|
import { join, dirname } from "node:path";
|
|
81566
81590
|
import fs13 from "node:fs";
|
|
@@ -85463,7 +85487,7 @@ __export4(exports_util4, {
|
|
|
85463
85487
|
partial: () => partial6,
|
|
85464
85488
|
parsedType: () => parsedType4,
|
|
85465
85489
|
optionalKeys: () => optionalKeys4,
|
|
85466
|
-
omit: () =>
|
|
85490
|
+
omit: () => omit4,
|
|
85467
85491
|
objectClone: () => objectClone4,
|
|
85468
85492
|
numKeys: () => numKeys4,
|
|
85469
85493
|
nullish: () => nullish7,
|
|
@@ -85842,7 +85866,7 @@ function pick6(schema, mask) {
|
|
|
85842
85866
|
});
|
|
85843
85867
|
return clone5(schema, def);
|
|
85844
85868
|
}
|
|
85845
|
-
function
|
|
85869
|
+
function omit4(schema, mask) {
|
|
85846
85870
|
const currDef = schema._zod.def;
|
|
85847
85871
|
const checks3 = currDef.checks;
|
|
85848
85872
|
const hasChecks = checks3 && checks3.length > 0;
|
|
@@ -100639,7 +100663,7 @@ app.route({
|
|
|
100639
100663
|
}).addTo(app, {
|
|
100640
100664
|
overwrite: false
|
|
100641
100665
|
});
|
|
100642
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.
|
|
100666
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.26/node_modules/@opencode-ai/sdk/dist/gen/core/serverSentEvents.gen.js
|
|
100643
100667
|
var createSseClient = ({ onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url: url4, ...options }) => {
|
|
100644
100668
|
let lastEventId;
|
|
100645
100669
|
const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
@@ -100748,7 +100772,7 @@ var createSseClient = ({ onSseError, onSseEvent, responseTransformer, responseVa
|
|
|
100748
100772
|
return { stream: stream2 };
|
|
100749
100773
|
};
|
|
100750
100774
|
|
|
100751
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.
|
|
100775
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.26/node_modules/@opencode-ai/sdk/dist/gen/core/auth.gen.js
|
|
100752
100776
|
var getAuthToken = async (auth, callback) => {
|
|
100753
100777
|
const token = typeof callback === "function" ? await callback(auth) : callback;
|
|
100754
100778
|
if (!token) {
|
|
@@ -100763,12 +100787,12 @@ var getAuthToken = async (auth, callback) => {
|
|
|
100763
100787
|
return token;
|
|
100764
100788
|
};
|
|
100765
100789
|
|
|
100766
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.
|
|
100790
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.26/node_modules/@opencode-ai/sdk/dist/gen/core/bodySerializer.gen.js
|
|
100767
100791
|
var jsonBodySerializer = {
|
|
100768
100792
|
bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
|
|
100769
100793
|
};
|
|
100770
100794
|
|
|
100771
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.
|
|
100795
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.26/node_modules/@opencode-ai/sdk/dist/gen/core/pathSerializer.gen.js
|
|
100772
100796
|
var separatorArrayExplode = (style) => {
|
|
100773
100797
|
switch (style) {
|
|
100774
100798
|
case "label":
|
|
@@ -100871,7 +100895,7 @@ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueO
|
|
|
100871
100895
|
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
100872
100896
|
};
|
|
100873
100897
|
|
|
100874
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.
|
|
100898
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.26/node_modules/@opencode-ai/sdk/dist/gen/core/utils.gen.js
|
|
100875
100899
|
var PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
100876
100900
|
var defaultPathSerializer = ({ path: path14, url: _url5 }) => {
|
|
100877
100901
|
let url4 = _url5;
|
|
@@ -100939,7 +100963,7 @@ var getUrl = ({ baseUrl, path: path14, query: query2, querySerializer, url: _url
|
|
|
100939
100963
|
return url4;
|
|
100940
100964
|
};
|
|
100941
100965
|
|
|
100942
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.
|
|
100966
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.26/node_modules/@opencode-ai/sdk/dist/gen/client/utils.gen.js
|
|
100943
100967
|
var createQuerySerializer = ({ allowReserved, array: array6, object: object5 } = {}) => {
|
|
100944
100968
|
const querySerializer = (queryParams) => {
|
|
100945
100969
|
const search = [];
|
|
@@ -101147,7 +101171,7 @@ var createConfig = (override = {}) => ({
|
|
|
101147
101171
|
...override
|
|
101148
101172
|
});
|
|
101149
101173
|
|
|
101150
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.
|
|
101174
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.26/node_modules/@opencode-ai/sdk/dist/gen/client/client.gen.js
|
|
101151
101175
|
var createClient = (config7 = {}) => {
|
|
101152
101176
|
let _config = mergeConfigs(createConfig(), config7);
|
|
101153
101177
|
const getConfig2 = () => ({ ..._config });
|
|
@@ -101294,7 +101318,7 @@ var createClient = (config7 = {}) => {
|
|
|
101294
101318
|
trace: makeMethod("TRACE")
|
|
101295
101319
|
};
|
|
101296
101320
|
};
|
|
101297
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.
|
|
101321
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.26/node_modules/@opencode-ai/sdk/dist/gen/core/params.gen.js
|
|
101298
101322
|
var extraPrefixesMap = {
|
|
101299
101323
|
$body_: "body",
|
|
101300
101324
|
$headers_: "headers",
|
|
@@ -101302,12 +101326,12 @@ var extraPrefixesMap = {
|
|
|
101302
101326
|
$query_: "query"
|
|
101303
101327
|
};
|
|
101304
101328
|
var extraPrefixes = Object.entries(extraPrefixesMap);
|
|
101305
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.
|
|
101329
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.26/node_modules/@opencode-ai/sdk/dist/gen/client.gen.js
|
|
101306
101330
|
var client = createClient(createConfig({
|
|
101307
101331
|
baseUrl: "http://localhost:4096"
|
|
101308
101332
|
}));
|
|
101309
101333
|
|
|
101310
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.
|
|
101334
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.26/node_modules/@opencode-ai/sdk/dist/gen/sdk.gen.js
|
|
101311
101335
|
class _HeyApiClient {
|
|
101312
101336
|
_client = client;
|
|
101313
101337
|
constructor(args2) {
|
|
@@ -101977,7 +102001,7 @@ class OpencodeClient extends _HeyApiClient {
|
|
|
101977
102001
|
event = new Event({ client: this._client });
|
|
101978
102002
|
}
|
|
101979
102003
|
|
|
101980
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.
|
|
102004
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.26/node_modules/@opencode-ai/sdk/dist/client.js
|
|
101981
102005
|
function createOpencodeClient(config7) {
|
|
101982
102006
|
if (!config7?.fetch) {
|
|
101983
102007
|
const customFetch = (req) => {
|
|
@@ -101998,7 +102022,7 @@ function createOpencodeClient(config7) {
|
|
|
101998
102022
|
const client2 = createClient(config7);
|
|
101999
102023
|
return new OpencodeClient({ client: client2 });
|
|
102000
102024
|
}
|
|
102001
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.
|
|
102025
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.26/node_modules/@opencode-ai/sdk/dist/server.js
|
|
102002
102026
|
import { spawn as spawn3 } from "node:child_process";
|
|
102003
102027
|
async function createOpencodeServer(options) {
|
|
102004
102028
|
options = Object.assign({
|
|
@@ -102067,7 +102091,7 @@ Server output: ${output}`;
|
|
|
102067
102091
|
}
|
|
102068
102092
|
};
|
|
102069
102093
|
}
|
|
102070
|
-
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.
|
|
102094
|
+
// ../node_modules/.pnpm/@opencode-ai+sdk@1.2.26/node_modules/@opencode-ai/sdk/dist/index.js
|
|
102071
102095
|
async function createOpencode(options) {
|
|
102072
102096
|
const server2 = await createOpencodeServer({
|
|
102073
102097
|
...options
|
|
@@ -102445,6 +102469,70 @@ app.route({
|
|
|
102445
102469
|
}
|
|
102446
102470
|
}).addTo(app);
|
|
102447
102471
|
|
|
102472
|
+
// src/routes/opencode/module/client.ts
|
|
102473
|
+
var getClient = async (opts) => {
|
|
102474
|
+
const client3 = await createOpencodeClient({
|
|
102475
|
+
baseUrl: opts?.baseUrl ?? "http://localhost:4096"
|
|
102476
|
+
});
|
|
102477
|
+
return client3;
|
|
102478
|
+
};
|
|
102479
|
+
|
|
102480
|
+
// src/routes/opencode/cnb.ts
|
|
102481
|
+
app.route({
|
|
102482
|
+
path: "opencode-cnb",
|
|
102483
|
+
key: "question",
|
|
102484
|
+
middleware: ["auth-admin"],
|
|
102485
|
+
description: "创建 OpenCode 客户端",
|
|
102486
|
+
metadata: {
|
|
102487
|
+
args: {
|
|
102488
|
+
question: exports_external3.string().describe("问题"),
|
|
102489
|
+
baseUrl: exports_external3.string().optional().describe("OpenCode 服务地址,默认为 http://localhost:4096"),
|
|
102490
|
+
directory: exports_external3.string().optional().describe("运行目录,默认为根目录"),
|
|
102491
|
+
messageID: exports_external3.string().optional().describe("消息 ID,选填"),
|
|
102492
|
+
sessionId: exports_external3.string().optional().describe("会话 ID,选填"),
|
|
102493
|
+
parts: exports_external3.array(exports_external3.any()).optional().describe("消息内容的分块,优先于 question 参数")
|
|
102494
|
+
}
|
|
102495
|
+
}
|
|
102496
|
+
}).define(async (ctx) => {
|
|
102497
|
+
const { question, baseUrl, directory = "/workspace", messageID, sessionId, parts } = ctx.query;
|
|
102498
|
+
const client3 = await getClient({ baseUrl });
|
|
102499
|
+
if (!client3) {
|
|
102500
|
+
ctx.body = { content: `OpenCode 客户端获取失败` };
|
|
102501
|
+
return;
|
|
102502
|
+
}
|
|
102503
|
+
if (!question) {
|
|
102504
|
+
ctx.body = { content: `问题不能为空` };
|
|
102505
|
+
return;
|
|
102506
|
+
}
|
|
102507
|
+
let session = null;
|
|
102508
|
+
if (sessionId) {
|
|
102509
|
+
try {
|
|
102510
|
+
const getSession = await client3.session.get({ path: { id: sessionId } });
|
|
102511
|
+
session = getSession.data;
|
|
102512
|
+
} catch (error111) {}
|
|
102513
|
+
}
|
|
102514
|
+
if (!session) {
|
|
102515
|
+
const createSession = await client3.session.create({
|
|
102516
|
+
query: {
|
|
102517
|
+
directory
|
|
102518
|
+
}
|
|
102519
|
+
});
|
|
102520
|
+
session = createSession.data;
|
|
102521
|
+
}
|
|
102522
|
+
let _parts = parts ?? [{ type: "text", text: question }];
|
|
102523
|
+
const message = await client3.session.prompt({
|
|
102524
|
+
body: {
|
|
102525
|
+
messageID,
|
|
102526
|
+
parts: _parts
|
|
102527
|
+
},
|
|
102528
|
+
path: {
|
|
102529
|
+
id: sessionId || session.id
|
|
102530
|
+
}
|
|
102531
|
+
});
|
|
102532
|
+
const data = message.data;
|
|
102533
|
+
ctx.body = { content: `已经启动`, data };
|
|
102534
|
+
}).addTo(app);
|
|
102535
|
+
|
|
102448
102536
|
// src/routes/remote/index.ts
|
|
102449
102537
|
app.route({
|
|
102450
102538
|
path: "remote",
|
|
@@ -103229,12 +103317,12 @@ app.route({
|
|
|
103229
103317
|
execCommand(cmd);
|
|
103230
103318
|
}).addTo(app, { overwrite: false });
|
|
103231
103319
|
|
|
103232
|
-
// ../node_modules/.pnpm/lru-cache@11.2.
|
|
103233
|
-
var
|
|
103320
|
+
// ../node_modules/.pnpm/lru-cache@11.2.7/node_modules/lru-cache/dist/esm/index.min.js
|
|
103321
|
+
var x = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
103234
103322
|
var I = new Set;
|
|
103235
103323
|
var R = typeof process == "object" && process ? process : {};
|
|
103236
|
-
var
|
|
103237
|
-
typeof R.emitWarning == "function" ? R.emitWarning(
|
|
103324
|
+
var U = (c, t, e, i) => {
|
|
103325
|
+
typeof R.emitWarning == "function" ? R.emitWarning(c, t, e, i) : console.error(`[${e}] ${t}: ${c}`);
|
|
103238
103326
|
};
|
|
103239
103327
|
var C = globalThis.AbortController;
|
|
103240
103328
|
var D = globalThis.AbortSignal;
|
|
@@ -103261,33 +103349,33 @@ if (typeof C > "u") {
|
|
|
103261
103349
|
}
|
|
103262
103350
|
}
|
|
103263
103351
|
};
|
|
103264
|
-
let
|
|
103265
|
-
|
|
103352
|
+
let c = R.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
|
|
103353
|
+
c && (c = false, U("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));
|
|
103266
103354
|
};
|
|
103267
103355
|
}
|
|
103268
|
-
var G = (
|
|
103356
|
+
var G = (c) => !I.has(c);
|
|
103269
103357
|
var H = Symbol("type");
|
|
103270
|
-
var y = (
|
|
103271
|
-
var
|
|
103358
|
+
var y = (c) => c && c === Math.floor(c) && c > 0 && isFinite(c);
|
|
103359
|
+
var M = (c) => y(c) ? c <= Math.pow(2, 8) ? Uint8Array : c <= Math.pow(2, 16) ? Uint16Array : c <= Math.pow(2, 32) ? Uint32Array : c <= Number.MAX_SAFE_INTEGER ? z5 : null : null;
|
|
103272
103360
|
var z5 = class extends Array {
|
|
103273
103361
|
constructor(t) {
|
|
103274
103362
|
super(t), this.fill(0);
|
|
103275
103363
|
}
|
|
103276
103364
|
};
|
|
103277
|
-
var W = class
|
|
103365
|
+
var W = class c {
|
|
103278
103366
|
heap;
|
|
103279
103367
|
length;
|
|
103280
103368
|
static #o = false;
|
|
103281
103369
|
static create(t) {
|
|
103282
|
-
let e =
|
|
103370
|
+
let e = M(t);
|
|
103283
103371
|
if (!e)
|
|
103284
103372
|
return [];
|
|
103285
|
-
|
|
103286
|
-
let i = new
|
|
103287
|
-
return
|
|
103373
|
+
c.#o = true;
|
|
103374
|
+
let i = new c(t, e);
|
|
103375
|
+
return c.#o = false, i;
|
|
103288
103376
|
}
|
|
103289
103377
|
constructor(t, e) {
|
|
103290
|
-
if (!
|
|
103378
|
+
if (!c.#o)
|
|
103291
103379
|
throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
103292
103380
|
this.heap = new e(t), this.length = 0;
|
|
103293
103381
|
}
|
|
@@ -103298,7 +103386,7 @@ var W = class a {
|
|
|
103298
103386
|
return this.heap[--this.length];
|
|
103299
103387
|
}
|
|
103300
103388
|
};
|
|
103301
|
-
var L = class
|
|
103389
|
+
var L = class c2 {
|
|
103302
103390
|
#o;
|
|
103303
103391
|
#c;
|
|
103304
103392
|
#w;
|
|
@@ -103343,13 +103431,13 @@ var L = class a2 {
|
|
|
103343
103431
|
#T;
|
|
103344
103432
|
#v;
|
|
103345
103433
|
#f;
|
|
103346
|
-
#
|
|
103434
|
+
#U;
|
|
103347
103435
|
static unsafeExposeInternals(t) {
|
|
103348
103436
|
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() {
|
|
103349
103437
|
return t.#l;
|
|
103350
103438
|
}, get tail() {
|
|
103351
103439
|
return t.#h;
|
|
103352
|
-
}, free: t.#b, isBackgroundFetch: (e) => t.#e(e), backgroundFetch: (e, i, s,
|
|
103440
|
+
}, free: t.#b, isBackgroundFetch: (e) => t.#e(e), backgroundFetch: (e, i, s, n) => t.#G(e, i, s, n), moveToTail: (e) => t.#D(e), indexes: (e) => t.#F(e), rindexes: (e) => t.#O(e), isStale: (e) => t.#p(e) };
|
|
103353
103441
|
}
|
|
103354
103442
|
get max() {
|
|
103355
103443
|
return this.#o;
|
|
@@ -103379,12 +103467,12 @@ var L = class a2 {
|
|
|
103379
103467
|
return this.#S;
|
|
103380
103468
|
}
|
|
103381
103469
|
constructor(t) {
|
|
103382
|
-
let { max: e = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge:
|
|
103470
|
+
let { max: e = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: o, updateAgeOnHas: h, allowStale: r, dispose: a, onInsert: w, disposeAfter: f, noDisposeOnSet: d, noUpdateTTL: g, maxSize: A = 0, maxEntrySize: p = 0, sizeCalculation: _, fetchMethod: l, memoMethod: S, noDeleteOnFetchRejection: b, noDeleteOnStaleGet: m, allowStaleOnFetchRejection: u, allowStaleOnFetchAbort: T, ignoreFetchAbort: F, perf: v } = t;
|
|
103383
103471
|
if (v !== undefined && typeof v?.now != "function")
|
|
103384
103472
|
throw new TypeError("perf option must have a now() method if specified");
|
|
103385
|
-
if (this.#m = v ??
|
|
103473
|
+
if (this.#m = v ?? x, e !== 0 && !y(e))
|
|
103386
103474
|
throw new TypeError("max option must be a nonnegative integer");
|
|
103387
|
-
let O = e ?
|
|
103475
|
+
let O = e ? M(e) : Array;
|
|
103388
103476
|
if (!O)
|
|
103389
103477
|
throw new Error("invalid max value: " + e);
|
|
103390
103478
|
if (this.#o = e, this.#c = A, this.maxEntrySize = p || this.#c, this.sizeCalculation = _, this.sizeCalculation) {
|
|
@@ -103393,18 +103481,18 @@ var L = class a2 {
|
|
|
103393
103481
|
if (typeof this.sizeCalculation != "function")
|
|
103394
103482
|
throw new TypeError("sizeCalculation set to non-function");
|
|
103395
103483
|
}
|
|
103396
|
-
if (
|
|
103484
|
+
if (S !== undefined && typeof S != "function")
|
|
103397
103485
|
throw new TypeError("memoMethod must be a function if defined");
|
|
103398
|
-
if (this.#I =
|
|
103486
|
+
if (this.#I = S, l !== undefined && typeof l != "function")
|
|
103399
103487
|
throw new TypeError("fetchMethod must be a function if specified");
|
|
103400
|
-
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
|
|
103488
|
+
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 a == "function" && (this.#w = a), typeof w == "function" && (this.#C = w), typeof f == "function" ? (this.#S = f, this.#r = []) : (this.#S = undefined, this.#r = undefined), this.#T = !!this.#w, this.#U = !!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) {
|
|
103401
103489
|
if (this.#c !== 0 && !y(this.#c))
|
|
103402
103490
|
throw new TypeError("maxSize must be a positive integer if specified");
|
|
103403
103491
|
if (!y(this.maxEntrySize))
|
|
103404
103492
|
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
103405
103493
|
this.#B();
|
|
103406
103494
|
}
|
|
103407
|
-
if (this.allowStale = !!r, this.noDeleteOnStaleGet = !!
|
|
103495
|
+
if (this.allowStale = !!r, this.noDeleteOnStaleGet = !!m, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!h, this.ttlResolution = y(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
|
|
103408
103496
|
if (!y(this.ttl))
|
|
103409
103497
|
throw new TypeError("ttl must be a positive integer if specified");
|
|
103410
103498
|
this.#j();
|
|
@@ -103413,7 +103501,7 @@ var L = class a2 {
|
|
|
103413
103501
|
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
103414
103502
|
if (!this.ttlAutopurge && !this.#o && !this.#c) {
|
|
103415
103503
|
let E = "LRU_CACHE_UNBOUNDED";
|
|
103416
|
-
G(E) && (I.add(E),
|
|
103504
|
+
G(E) && (I.add(E), U("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, c2));
|
|
103417
103505
|
}
|
|
103418
103506
|
}
|
|
103419
103507
|
getRemainingTTL(t) {
|
|
@@ -103423,46 +103511,50 @@ var L = class a2 {
|
|
|
103423
103511
|
let t = new z5(this.#o), e = new z5(this.#o);
|
|
103424
103512
|
this.#d = t, this.#A = e;
|
|
103425
103513
|
let i = this.ttlAutopurge ? new Array(this.#o) : undefined;
|
|
103426
|
-
this.#g = i, this.#N = (
|
|
103427
|
-
|
|
103428
|
-
|
|
103429
|
-
|
|
103430
|
-
|
|
103431
|
-
|
|
103432
|
-
|
|
103433
|
-
|
|
103434
|
-
|
|
103435
|
-
|
|
103436
|
-
|
|
103437
|
-
|
|
103438
|
-
|
|
103514
|
+
this.#g = i, this.#N = (h, r, a = this.#m.now()) => {
|
|
103515
|
+
e[h] = r !== 0 ? a : 0, t[h] = r, s(h, r);
|
|
103516
|
+
}, this.#R = (h) => {
|
|
103517
|
+
e[h] = t[h] !== 0 ? this.#m.now() : 0, s(h, t[h]);
|
|
103518
|
+
};
|
|
103519
|
+
let s = this.ttlAutopurge ? (h, r) => {
|
|
103520
|
+
if (i?.[h] && (clearTimeout(i[h]), i[h] = undefined), r && r !== 0 && i) {
|
|
103521
|
+
let a = setTimeout(() => {
|
|
103522
|
+
this.#p(h) && this.#E(this.#i[h], "expire");
|
|
103523
|
+
}, r + 1);
|
|
103524
|
+
a.unref && a.unref(), i[h] = a;
|
|
103525
|
+
}
|
|
103526
|
+
} : () => {};
|
|
103527
|
+
this.#z = (h, r) => {
|
|
103528
|
+
if (t[r]) {
|
|
103529
|
+
let a = t[r], w = e[r];
|
|
103530
|
+
if (!a || !w)
|
|
103439
103531
|
return;
|
|
103440
|
-
|
|
103441
|
-
let
|
|
103442
|
-
|
|
103532
|
+
h.ttl = a, h.start = w, h.now = n || o();
|
|
103533
|
+
let f = h.now - w;
|
|
103534
|
+
h.remainingTTL = a - f;
|
|
103443
103535
|
}
|
|
103444
103536
|
};
|
|
103445
|
-
let
|
|
103446
|
-
let
|
|
103537
|
+
let n = 0, o = () => {
|
|
103538
|
+
let h = this.#m.now();
|
|
103447
103539
|
if (this.ttlResolution > 0) {
|
|
103448
|
-
|
|
103449
|
-
let
|
|
103450
|
-
|
|
103540
|
+
n = h;
|
|
103541
|
+
let r = setTimeout(() => n = 0, this.ttlResolution);
|
|
103542
|
+
r.unref && r.unref();
|
|
103451
103543
|
}
|
|
103452
|
-
return
|
|
103544
|
+
return h;
|
|
103453
103545
|
};
|
|
103454
|
-
this.getRemainingTTL = (
|
|
103455
|
-
let
|
|
103456
|
-
if (
|
|
103546
|
+
this.getRemainingTTL = (h) => {
|
|
103547
|
+
let r = this.#s.get(h);
|
|
103548
|
+
if (r === undefined)
|
|
103457
103549
|
return 0;
|
|
103458
|
-
let
|
|
103459
|
-
if (!
|
|
103550
|
+
let a = t[r], w = e[r];
|
|
103551
|
+
if (!a || !w)
|
|
103460
103552
|
return 1 / 0;
|
|
103461
|
-
let
|
|
103462
|
-
return
|
|
103463
|
-
}, this.#p = (
|
|
103464
|
-
let
|
|
103465
|
-
return !!
|
|
103553
|
+
let f = (n || o()) - w;
|
|
103554
|
+
return a - f;
|
|
103555
|
+
}, this.#p = (h) => {
|
|
103556
|
+
let r = e[h], a = t[h];
|
|
103557
|
+
return !!a && !!r && (n || o()) - r > a;
|
|
103466
103558
|
};
|
|
103467
103559
|
}
|
|
103468
103560
|
#R = () => {};
|
|
@@ -103473,29 +103565,29 @@ var L = class a2 {
|
|
|
103473
103565
|
let t = new z5(this.#o);
|
|
103474
103566
|
this.#_ = 0, this.#y = t, this.#W = (e) => {
|
|
103475
103567
|
this.#_ -= t[e], t[e] = 0;
|
|
103476
|
-
}, this.#P = (e, i, s,
|
|
103568
|
+
}, this.#P = (e, i, s, n) => {
|
|
103477
103569
|
if (this.#e(i))
|
|
103478
103570
|
return 0;
|
|
103479
103571
|
if (!y(s))
|
|
103480
|
-
if (
|
|
103481
|
-
if (typeof
|
|
103572
|
+
if (n) {
|
|
103573
|
+
if (typeof n != "function")
|
|
103482
103574
|
throw new TypeError("sizeCalculation must be a function");
|
|
103483
|
-
if (s =
|
|
103575
|
+
if (s = n(i, e), !y(s))
|
|
103484
103576
|
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
103485
103577
|
} else
|
|
103486
103578
|
throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
103487
103579
|
return s;
|
|
103488
|
-
}, this.#
|
|
103580
|
+
}, this.#M = (e, i, s) => {
|
|
103489
103581
|
if (t[e] = i, this.#c) {
|
|
103490
|
-
let
|
|
103491
|
-
for (;this.#_ >
|
|
103492
|
-
this.#
|
|
103582
|
+
let n = this.#c - t[e];
|
|
103583
|
+
for (;this.#_ > n; )
|
|
103584
|
+
this.#x(true);
|
|
103493
103585
|
}
|
|
103494
103586
|
this.#_ += t[e], s && (s.entrySize = i, s.totalCalculatedSize = this.#_);
|
|
103495
103587
|
};
|
|
103496
103588
|
}
|
|
103497
103589
|
#W = (t) => {};
|
|
103498
|
-
#
|
|
103590
|
+
#M = (t, e, i) => {};
|
|
103499
103591
|
#P = (t, e, i, s) => {
|
|
103500
103592
|
if (i || s)
|
|
103501
103593
|
throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
@@ -103548,21 +103640,21 @@ var L = class a2 {
|
|
|
103548
103640
|
[Symbol.toStringTag] = "LRUCache";
|
|
103549
103641
|
find(t, e = {}) {
|
|
103550
103642
|
for (let i of this.#F()) {
|
|
103551
|
-
let s = this.#t[i],
|
|
103552
|
-
if (
|
|
103643
|
+
let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
103644
|
+
if (n !== undefined && t(n, this.#i[i], this))
|
|
103553
103645
|
return this.get(this.#i[i], e);
|
|
103554
103646
|
}
|
|
103555
103647
|
}
|
|
103556
103648
|
forEach(t, e = this) {
|
|
103557
103649
|
for (let i of this.#F()) {
|
|
103558
|
-
let s = this.#t[i],
|
|
103559
|
-
|
|
103650
|
+
let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
103651
|
+
n !== undefined && t.call(e, n, this.#i[i], this);
|
|
103560
103652
|
}
|
|
103561
103653
|
}
|
|
103562
103654
|
rforEach(t, e = this) {
|
|
103563
103655
|
for (let i of this.#O()) {
|
|
103564
|
-
let s = this.#t[i],
|
|
103565
|
-
|
|
103656
|
+
let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
103657
|
+
n !== undefined && t.call(e, n, this.#i[i], this);
|
|
103566
103658
|
}
|
|
103567
103659
|
}
|
|
103568
103660
|
purgeStale() {
|
|
@@ -103578,29 +103670,29 @@ var L = class a2 {
|
|
|
103578
103670
|
let i = this.#t[e], s = this.#e(i) ? i.__staleWhileFetching : i;
|
|
103579
103671
|
if (s === undefined)
|
|
103580
103672
|
return;
|
|
103581
|
-
let
|
|
103673
|
+
let n = { value: s };
|
|
103582
103674
|
if (this.#d && this.#A) {
|
|
103583
|
-
let
|
|
103584
|
-
if (
|
|
103585
|
-
let r =
|
|
103586
|
-
|
|
103675
|
+
let o = this.#d[e], h = this.#A[e];
|
|
103676
|
+
if (o && h) {
|
|
103677
|
+
let r = o - (this.#m.now() - h);
|
|
103678
|
+
n.ttl = r, n.start = Date.now();
|
|
103587
103679
|
}
|
|
103588
103680
|
}
|
|
103589
|
-
return this.#y && (
|
|
103681
|
+
return this.#y && (n.size = this.#y[e]), n;
|
|
103590
103682
|
}
|
|
103591
103683
|
dump() {
|
|
103592
103684
|
let t = [];
|
|
103593
103685
|
for (let e of this.#F({ allowStale: true })) {
|
|
103594
|
-
let i = this.#i[e], s = this.#t[e],
|
|
103595
|
-
if (
|
|
103686
|
+
let i = this.#i[e], s = this.#t[e], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
103687
|
+
if (n === undefined || i === undefined)
|
|
103596
103688
|
continue;
|
|
103597
|
-
let
|
|
103689
|
+
let o = { value: n };
|
|
103598
103690
|
if (this.#d && this.#A) {
|
|
103599
|
-
|
|
103600
|
-
let
|
|
103601
|
-
|
|
103691
|
+
o.ttl = this.#d[e];
|
|
103692
|
+
let h = this.#m.now() - this.#A[e];
|
|
103693
|
+
o.start = Math.floor(Date.now() - h);
|
|
103602
103694
|
}
|
|
103603
|
-
this.#y && (
|
|
103695
|
+
this.#y && (o.size = this.#y[e]), t.unshift([i, o]);
|
|
103604
103696
|
}
|
|
103605
103697
|
return t;
|
|
103606
103698
|
}
|
|
@@ -103617,32 +103709,32 @@ var L = class a2 {
|
|
|
103617
103709
|
set(t, e, i = {}) {
|
|
103618
103710
|
if (e === undefined)
|
|
103619
103711
|
return this.delete(t), this;
|
|
103620
|
-
let { ttl: s = this.ttl, start:
|
|
103621
|
-
if (this.maxEntrySize &&
|
|
103712
|
+
let { ttl: s = this.ttl, start: n, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: r } = i, { noUpdateTTL: a = this.noUpdateTTL } = i, w = this.#P(t, e, i.size || 0, h);
|
|
103713
|
+
if (this.maxEntrySize && w > this.maxEntrySize)
|
|
103622
103714
|
return r && (r.set = "miss", r.maxEntrySizeExceeded = true), this.#E(t, "set"), this;
|
|
103623
|
-
let
|
|
103624
|
-
if (
|
|
103625
|
-
|
|
103715
|
+
let f = this.#n === 0 ? undefined : this.#s.get(t);
|
|
103716
|
+
if (f === undefined)
|
|
103717
|
+
f = this.#n === 0 ? this.#h : this.#b.length !== 0 ? this.#b.pop() : this.#n === this.#o ? this.#x(false) : this.#n, this.#i[f] = t, this.#t[f] = e, this.#s.set(t, f), this.#a[this.#h] = f, this.#u[f] = this.#h, this.#h = f, this.#n++, this.#M(f, w, r), r && (r.set = "add"), a = false, this.#U && this.#C?.(e, t, "add");
|
|
103626
103718
|
else {
|
|
103627
|
-
this.#D(
|
|
103628
|
-
let d = this.#t[
|
|
103719
|
+
this.#D(f);
|
|
103720
|
+
let d = this.#t[f];
|
|
103629
103721
|
if (e !== d) {
|
|
103630
103722
|
if (this.#v && this.#e(d)) {
|
|
103631
103723
|
d.__abortController.abort(new Error("replaced"));
|
|
103632
103724
|
let { __staleWhileFetching: g } = d;
|
|
103633
|
-
g !== undefined && !
|
|
103725
|
+
g !== undefined && !o && (this.#T && this.#w?.(g, t, "set"), this.#f && this.#r?.push([g, t, "set"]));
|
|
103634
103726
|
} else
|
|
103635
|
-
|
|
103636
|
-
if (this.#W(
|
|
103727
|
+
o || (this.#T && this.#w?.(d, t, "set"), this.#f && this.#r?.push([d, t, "set"]));
|
|
103728
|
+
if (this.#W(f), this.#M(f, w, r), this.#t[f] = e, r) {
|
|
103637
103729
|
r.set = "replace";
|
|
103638
103730
|
let g = d && this.#e(d) ? d.__staleWhileFetching : d;
|
|
103639
103731
|
g !== undefined && (r.oldValue = g);
|
|
103640
103732
|
}
|
|
103641
103733
|
} else
|
|
103642
103734
|
r && (r.set = "update");
|
|
103643
|
-
this.#
|
|
103735
|
+
this.#U && this.onInsert?.(e, t, e === d ? "update" : "replace");
|
|
103644
103736
|
}
|
|
103645
|
-
if (s !== 0 && !this.#d && this.#j(), this.#d && (
|
|
103737
|
+
if (s !== 0 && !this.#d && this.#j(), this.#d && (a || this.#N(f, s, n), r && this.#z(r, f)), !o && this.#f && this.#r) {
|
|
103646
103738
|
let d = this.#r, g;
|
|
103647
103739
|
for (;g = d?.shift(); )
|
|
103648
103740
|
this.#S?.(...g);
|
|
@@ -103653,7 +103745,7 @@ var L = class a2 {
|
|
|
103653
103745
|
try {
|
|
103654
103746
|
for (;this.#n; ) {
|
|
103655
103747
|
let t = this.#t[this.#l];
|
|
103656
|
-
if (this.#
|
|
103748
|
+
if (this.#x(true), this.#e(t)) {
|
|
103657
103749
|
if (t.__staleWhileFetching)
|
|
103658
103750
|
return t.__staleWhileFetching;
|
|
103659
103751
|
} else if (t !== undefined)
|
|
@@ -103667,20 +103759,20 @@ var L = class a2 {
|
|
|
103667
103759
|
}
|
|
103668
103760
|
}
|
|
103669
103761
|
}
|
|
103670
|
-
#
|
|
103762
|
+
#x(t) {
|
|
103671
103763
|
let e = this.#l, i = this.#i[e], s = this.#t[e];
|
|
103672
103764
|
return this.#v && this.#e(s) ? s.__abortController.abort(new Error("evicted")) : (this.#T || this.#f) && (this.#T && this.#w?.(s, i, "evict"), this.#f && this.#r?.push([s, i, "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(i), this.#n--, e;
|
|
103673
103765
|
}
|
|
103674
103766
|
has(t, e = {}) {
|
|
103675
|
-
let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = e,
|
|
103676
|
-
if (
|
|
103677
|
-
let
|
|
103678
|
-
if (this.#e(
|
|
103767
|
+
let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = e, n = this.#s.get(t);
|
|
103768
|
+
if (n !== undefined) {
|
|
103769
|
+
let o = this.#t[n];
|
|
103770
|
+
if (this.#e(o) && o.__staleWhileFetching === undefined)
|
|
103679
103771
|
return false;
|
|
103680
|
-
if (this.#p(
|
|
103681
|
-
s && (s.has = "stale", this.#z(s,
|
|
103772
|
+
if (this.#p(n))
|
|
103773
|
+
s && (s.has = "stale", this.#z(s, n));
|
|
103682
103774
|
else
|
|
103683
|
-
return i && this.#R(
|
|
103775
|
+
return i && this.#R(n), s && (s.has = "hit", this.#z(s, n)), true;
|
|
103684
103776
|
} else
|
|
103685
103777
|
s && (s.has = "miss");
|
|
103686
103778
|
return false;
|
|
@@ -103689,35 +103781,35 @@ var L = class a2 {
|
|
|
103689
103781
|
let { allowStale: i = this.allowStale } = e, s = this.#s.get(t);
|
|
103690
103782
|
if (s === undefined || !i && this.#p(s))
|
|
103691
103783
|
return;
|
|
103692
|
-
let
|
|
103693
|
-
return this.#e(
|
|
103784
|
+
let n = this.#t[s];
|
|
103785
|
+
return this.#e(n) ? n.__staleWhileFetching : n;
|
|
103694
103786
|
}
|
|
103695
103787
|
#G(t, e, i, s) {
|
|
103696
|
-
let
|
|
103697
|
-
if (this.#e(
|
|
103698
|
-
return
|
|
103699
|
-
let
|
|
103700
|
-
|
|
103701
|
-
let r = { signal:
|
|
103702
|
-
let { aborted: l } =
|
|
103703
|
-
if (i.status && (l && !_ ? (i.status.fetchAborted = true, i.status.fetchError =
|
|
103704
|
-
return
|
|
103705
|
-
let
|
|
103706
|
-
return (u === g ||
|
|
103707
|
-
},
|
|
103708
|
-
let { aborted: l } =
|
|
103709
|
-
if (this.#t[e] === g && (!
|
|
103788
|
+
let n = e === undefined ? undefined : this.#t[e];
|
|
103789
|
+
if (this.#e(n))
|
|
103790
|
+
return n;
|
|
103791
|
+
let o = new C, { signal: h } = i;
|
|
103792
|
+
h?.addEventListener("abort", () => o.abort(h.reason), { signal: o.signal });
|
|
103793
|
+
let r = { signal: o.signal, options: i, context: s }, a = (p, _ = false) => {
|
|
103794
|
+
let { aborted: l } = o.signal, S = i.ignoreFetchAbort && p !== undefined, b = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && p !== undefined);
|
|
103795
|
+
if (i.status && (l && !_ ? (i.status.fetchAborted = true, i.status.fetchError = o.signal.reason, S && (i.status.fetchAbortIgnored = true)) : i.status.fetchResolved = true), l && !S && !_)
|
|
103796
|
+
return f(o.signal.reason, b);
|
|
103797
|
+
let m = g, u = this.#t[e];
|
|
103798
|
+
return (u === g || S && _ && u === undefined) && (p === undefined ? m.__staleWhileFetching !== undefined ? this.#t[e] = m.__staleWhileFetching : this.#E(t, "fetch") : (i.status && (i.status.fetchUpdated = true), this.set(t, p, r.options))), p;
|
|
103799
|
+
}, w = (p) => (i.status && (i.status.fetchRejected = true, i.status.fetchError = p), f(p, false)), f = (p, _) => {
|
|
103800
|
+
let { aborted: l } = o.signal, S = l && i.allowStaleOnFetchAbort, b = S || i.allowStaleOnFetchRejection, m = b || i.noDeleteOnFetchRejection, u = g;
|
|
103801
|
+
if (this.#t[e] === g && (!m || !_ && u.__staleWhileFetching === undefined ? this.#E(t, "fetch") : S || (this.#t[e] = u.__staleWhileFetching)), b)
|
|
103710
103802
|
return i.status && u.__staleWhileFetching !== undefined && (i.status.returnedStale = true), u.__staleWhileFetching;
|
|
103711
103803
|
if (u.__returned === u)
|
|
103712
103804
|
throw p;
|
|
103713
103805
|
}, d = (p, _) => {
|
|
103714
|
-
let l = this.#L?.(t,
|
|
103715
|
-
l && l instanceof Promise && l.then((
|
|
103716
|
-
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (p(undefined), i.allowStaleOnFetchAbort && (p = (
|
|
103806
|
+
let l = this.#L?.(t, n, r);
|
|
103807
|
+
l && l instanceof Promise && l.then((S) => p(S === undefined ? undefined : S), _), o.signal.addEventListener("abort", () => {
|
|
103808
|
+
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (p(undefined), i.allowStaleOnFetchAbort && (p = (S) => a(S, true)));
|
|
103717
103809
|
});
|
|
103718
103810
|
};
|
|
103719
103811
|
i.status && (i.status.fetchDispatched = true);
|
|
103720
|
-
let g = new Promise(d).then(
|
|
103812
|
+
let g = new Promise(d).then(a, w), A = Object.assign(g, { __abortController: o, __staleWhileFetching: n, __returned: undefined });
|
|
103721
103813
|
return e === undefined ? (this.set(t, A, { ...r.options, status: undefined }), e = this.#s.get(t)) : this.#t[e] = A, A;
|
|
103722
103814
|
}
|
|
103723
103815
|
#e(t) {
|
|
@@ -103727,24 +103819,24 @@ var L = class a2 {
|
|
|
103727
103819
|
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof C;
|
|
103728
103820
|
}
|
|
103729
103821
|
async fetch(t, e = {}) {
|
|
103730
|
-
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet:
|
|
103822
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: r = 0, sizeCalculation: a = this.sizeCalculation, noUpdateTTL: w = this.noUpdateTTL, noDeleteOnFetchRejection: f = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: g = this.ignoreFetchAbort, allowStaleOnFetchAbort: A = this.allowStaleOnFetchAbort, context: p, forceRefresh: _ = false, status: l, signal: S } = e;
|
|
103731
103823
|
if (!this.#v)
|
|
103732
|
-
return l && (l.fetch = "get"), this.get(t, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet:
|
|
103733
|
-
let b = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet:
|
|
103734
|
-
if (
|
|
103824
|
+
return l && (l.fetch = "get"), this.get(t, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, status: l });
|
|
103825
|
+
let b = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, ttl: o, noDisposeOnSet: h, size: r, sizeCalculation: a, noUpdateTTL: w, noDeleteOnFetchRejection: f, allowStaleOnFetchRejection: d, allowStaleOnFetchAbort: A, ignoreFetchAbort: g, status: l, signal: S }, m = this.#s.get(t);
|
|
103826
|
+
if (m === undefined) {
|
|
103735
103827
|
l && (l.fetch = "miss");
|
|
103736
|
-
let u = this.#G(t,
|
|
103828
|
+
let u = this.#G(t, m, b, p);
|
|
103737
103829
|
return u.__returned = u;
|
|
103738
103830
|
} else {
|
|
103739
|
-
let u = this.#t[
|
|
103831
|
+
let u = this.#t[m];
|
|
103740
103832
|
if (this.#e(u)) {
|
|
103741
103833
|
let E = i && u.__staleWhileFetching !== undefined;
|
|
103742
103834
|
return l && (l.fetch = "inflight", E && (l.returnedStale = true)), E ? u.__staleWhileFetching : u.__returned = u;
|
|
103743
103835
|
}
|
|
103744
|
-
let T = this.#p(
|
|
103836
|
+
let T = this.#p(m);
|
|
103745
103837
|
if (!_ && !T)
|
|
103746
|
-
return l && (l.fetch = "hit"), this.#D(
|
|
103747
|
-
let F = this.#G(t,
|
|
103838
|
+
return l && (l.fetch = "hit"), this.#D(m), s && this.#R(m), l && this.#z(l, m), u;
|
|
103839
|
+
let F = this.#G(t, m, b, p), O = F.__staleWhileFetching !== undefined && i;
|
|
103748
103840
|
return l && (l.fetch = T ? "stale" : "refresh", O && T && (l.returnedStale = true)), O ? F.__staleWhileFetching : F.__returned = F;
|
|
103749
103841
|
}
|
|
103750
103842
|
}
|
|
@@ -103758,19 +103850,19 @@ var L = class a2 {
|
|
|
103758
103850
|
let i = this.#I;
|
|
103759
103851
|
if (!i)
|
|
103760
103852
|
throw new Error("no memoMethod provided to constructor");
|
|
103761
|
-
let { context: s, forceRefresh:
|
|
103762
|
-
if (!
|
|
103763
|
-
return
|
|
103764
|
-
let r = i(t,
|
|
103765
|
-
return this.set(t, r,
|
|
103853
|
+
let { context: s, forceRefresh: n, ...o } = e, h = this.get(t, o);
|
|
103854
|
+
if (!n && h !== undefined)
|
|
103855
|
+
return h;
|
|
103856
|
+
let r = i(t, h, { options: o, context: s });
|
|
103857
|
+
return this.set(t, r, o), r;
|
|
103766
103858
|
}
|
|
103767
103859
|
get(t, e = {}) {
|
|
103768
|
-
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet:
|
|
103769
|
-
if (
|
|
103770
|
-
let r = this.#t[
|
|
103771
|
-
return
|
|
103860
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = e, h = this.#s.get(t);
|
|
103861
|
+
if (h !== undefined) {
|
|
103862
|
+
let r = this.#t[h], a = this.#e(r);
|
|
103863
|
+
return o && this.#z(o, h), this.#p(h) ? (o && (o.get = "stale"), a ? (o && i && r.__staleWhileFetching !== undefined && (o.returnedStale = true), i ? r.__staleWhileFetching : undefined) : (n || this.#E(t, "expire"), o && i && (o.returnedStale = true), i ? r : undefined)) : (o && (o.get = "hit"), a ? r.__staleWhileFetching : (this.#D(h), s && this.#R(h), r));
|
|
103772
103864
|
} else
|
|
103773
|
-
|
|
103865
|
+
o && (o.get = "miss");
|
|
103774
103866
|
}
|
|
103775
103867
|
#k(t, e) {
|
|
103776
103868
|
this.#u[e] = t, this.#a[t] = e;
|
|
@@ -103790,24 +103882,24 @@ var L = class a2 {
|
|
|
103790
103882
|
this.#V(e);
|
|
103791
103883
|
else {
|
|
103792
103884
|
this.#W(s);
|
|
103793
|
-
let
|
|
103794
|
-
if (this.#e(
|
|
103885
|
+
let n = this.#t[s];
|
|
103886
|
+
if (this.#e(n) ? n.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#w?.(n, t, e), this.#f && this.#r?.push([n, t, e])), this.#s.delete(t), this.#i[s] = undefined, this.#t[s] = undefined, s === this.#h)
|
|
103795
103887
|
this.#h = this.#u[s];
|
|
103796
103888
|
else if (s === this.#l)
|
|
103797
103889
|
this.#l = this.#a[s];
|
|
103798
103890
|
else {
|
|
103799
|
-
let
|
|
103800
|
-
this.#a[
|
|
103801
|
-
let
|
|
103802
|
-
this.#u[
|
|
103891
|
+
let o = this.#u[s];
|
|
103892
|
+
this.#a[o] = this.#a[s];
|
|
103893
|
+
let h = this.#a[s];
|
|
103894
|
+
this.#u[h] = this.#u[s];
|
|
103803
103895
|
}
|
|
103804
103896
|
this.#n--, this.#b.push(s);
|
|
103805
103897
|
}
|
|
103806
103898
|
}
|
|
103807
103899
|
if (this.#f && this.#r?.length) {
|
|
103808
|
-
let s = this.#r,
|
|
103809
|
-
for (;
|
|
103810
|
-
this.#S?.(...
|
|
103900
|
+
let s = this.#r, n;
|
|
103901
|
+
for (;n = s?.shift(); )
|
|
103902
|
+
this.#S?.(...n);
|
|
103811
103903
|
}
|
|
103812
103904
|
return i;
|
|
103813
103905
|
}
|