@chosengeneration/light-code 0.169.0 → 0.171.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +993 -843
- package/dist/server.cjs +990 -840
- package/package.json +1 -1
package/dist/server.cjs
CHANGED
|
@@ -14,9 +14,9 @@ var __export = (target, all) => {
|
|
|
14
14
|
};
|
|
15
15
|
var __copyProps = (to, from, except, desc) => {
|
|
16
16
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
-
for (let
|
|
18
|
-
if (!__hasOwnProp.call(to,
|
|
19
|
-
__defProp(to,
|
|
17
|
+
for (let key3 of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key3) && key3 !== except)
|
|
19
|
+
__defProp(to, key3, { get: () => from[key3], enumerable: !(desc = __getOwnPropDesc(from, key3)) || desc.enumerable });
|
|
20
20
|
}
|
|
21
21
|
return to;
|
|
22
22
|
};
|
|
@@ -417,9 +417,9 @@ var require_constants = __commonJS({
|
|
|
417
417
|
"X-XSS-Protection"
|
|
418
418
|
];
|
|
419
419
|
for (let i = 0; i < wellknownHeaderNames.length; ++i) {
|
|
420
|
-
const
|
|
421
|
-
const lowerCasedKey =
|
|
422
|
-
headerNameLowerCasedRecord[
|
|
420
|
+
const key3 = wellknownHeaderNames[i];
|
|
421
|
+
const lowerCasedKey = key3.toLowerCase();
|
|
422
|
+
headerNameLowerCasedRecord[key3] = headerNameLowerCasedRecord[lowerCasedKey] = lowerCasedKey;
|
|
423
423
|
}
|
|
424
424
|
Object.setPrototypeOf(headerNameLowerCasedRecord, null);
|
|
425
425
|
module2.exports = {
|
|
@@ -591,18 +591,18 @@ var require_util = __commonJS({
|
|
|
591
591
|
function parseHeaders(headers, obj = {}) {
|
|
592
592
|
if (!Array.isArray(headers)) return headers;
|
|
593
593
|
for (let i = 0; i < headers.length; i += 2) {
|
|
594
|
-
const
|
|
595
|
-
let val = obj[
|
|
594
|
+
const key3 = headers[i].toString().toLowerCase();
|
|
595
|
+
let val = obj[key3];
|
|
596
596
|
if (!val) {
|
|
597
597
|
if (Array.isArray(headers[i + 1])) {
|
|
598
|
-
obj[
|
|
598
|
+
obj[key3] = headers[i + 1].map((x) => x.toString("utf8"));
|
|
599
599
|
} else {
|
|
600
|
-
obj[
|
|
600
|
+
obj[key3] = headers[i + 1].toString("utf8");
|
|
601
601
|
}
|
|
602
602
|
} else {
|
|
603
603
|
if (!Array.isArray(val)) {
|
|
604
604
|
val = [val];
|
|
605
|
-
obj[
|
|
605
|
+
obj[key3] = val;
|
|
606
606
|
}
|
|
607
607
|
val.push(headers[i + 1].toString("utf8"));
|
|
608
608
|
}
|
|
@@ -617,15 +617,15 @@ var require_util = __commonJS({
|
|
|
617
617
|
let hasContentLength = false;
|
|
618
618
|
let contentDispositionIdx = -1;
|
|
619
619
|
for (let n = 0; n < headers.length; n += 2) {
|
|
620
|
-
const
|
|
620
|
+
const key3 = headers[n + 0].toString();
|
|
621
621
|
const val = headers[n + 1].toString("utf8");
|
|
622
|
-
if (
|
|
623
|
-
ret.push(
|
|
622
|
+
if (key3.length === 14 && (key3 === "content-length" || key3.toLowerCase() === "content-length")) {
|
|
623
|
+
ret.push(key3, val);
|
|
624
624
|
hasContentLength = true;
|
|
625
|
-
} else if (
|
|
626
|
-
contentDispositionIdx = ret.push(
|
|
625
|
+
} else if (key3.length === 19 && (key3 === "content-disposition" || key3.toLowerCase() === "content-disposition")) {
|
|
626
|
+
contentDispositionIdx = ret.push(key3, val) - 1;
|
|
627
627
|
} else {
|
|
628
|
-
ret.push(
|
|
628
|
+
ret.push(key3, val);
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
631
|
if (hasContentLength && contentDispositionIdx !== -1) {
|
|
@@ -2679,12 +2679,12 @@ var require_urlencoded = __commonJS({
|
|
|
2679
2679
|
p = idxeq + 1;
|
|
2680
2680
|
} else if (idxamp !== void 0) {
|
|
2681
2681
|
++this._fields;
|
|
2682
|
-
let
|
|
2682
|
+
let key3;
|
|
2683
2683
|
const keyTrunc = this._keyTrunc;
|
|
2684
2684
|
if (idxamp > p) {
|
|
2685
|
-
|
|
2685
|
+
key3 = this._key += this.decoder.write(data.toString("binary", p, idxamp));
|
|
2686
2686
|
} else {
|
|
2687
|
-
|
|
2687
|
+
key3 = this._key;
|
|
2688
2688
|
}
|
|
2689
2689
|
this._hitLimit = false;
|
|
2690
2690
|
this._checkingBytes = true;
|
|
@@ -2692,10 +2692,10 @@ var require_urlencoded = __commonJS({
|
|
|
2692
2692
|
this._bytesKey = 0;
|
|
2693
2693
|
this._keyTrunc = false;
|
|
2694
2694
|
this.decoder.reset();
|
|
2695
|
-
if (
|
|
2695
|
+
if (key3.length) {
|
|
2696
2696
|
this.boy.emit(
|
|
2697
2697
|
"field",
|
|
2698
|
-
decodeText(
|
|
2698
|
+
decodeText(key3, "binary", this.charset),
|
|
2699
2699
|
"",
|
|
2700
2700
|
keyTrunc,
|
|
2701
2701
|
false
|
|
@@ -3685,7 +3685,7 @@ var require_util2 = __commonJS({
|
|
|
3685
3685
|
const protocol = url2.protocol;
|
|
3686
3686
|
return protocol === "http:" || protocol === "https:";
|
|
3687
3687
|
}
|
|
3688
|
-
var hasOwn = Object.hasOwn || ((dict,
|
|
3688
|
+
var hasOwn = Object.hasOwn || ((dict, key3) => Object.prototype.hasOwnProperty.call(dict, key3));
|
|
3689
3689
|
module2.exports = {
|
|
3690
3690
|
isAborted,
|
|
3691
3691
|
isCancelled,
|
|
@@ -3922,19 +3922,19 @@ var require_webidl = __commonJS({
|
|
|
3922
3922
|
const result = {};
|
|
3923
3923
|
if (!types.isProxy(O)) {
|
|
3924
3924
|
const keys2 = Object.keys(O);
|
|
3925
|
-
for (const
|
|
3926
|
-
const typedKey = keyConverter(
|
|
3927
|
-
const typedValue = valueConverter(O[
|
|
3925
|
+
for (const key3 of keys2) {
|
|
3926
|
+
const typedKey = keyConverter(key3);
|
|
3927
|
+
const typedValue = valueConverter(O[key3]);
|
|
3928
3928
|
result[typedKey] = typedValue;
|
|
3929
3929
|
}
|
|
3930
3930
|
return result;
|
|
3931
3931
|
}
|
|
3932
3932
|
const keys = Reflect.ownKeys(O);
|
|
3933
|
-
for (const
|
|
3934
|
-
const desc = Reflect.getOwnPropertyDescriptor(O,
|
|
3933
|
+
for (const key3 of keys) {
|
|
3934
|
+
const desc = Reflect.getOwnPropertyDescriptor(O, key3);
|
|
3935
3935
|
if (desc?.enumerable) {
|
|
3936
|
-
const typedKey = keyConverter(
|
|
3937
|
-
const typedValue = valueConverter(O[
|
|
3936
|
+
const typedKey = keyConverter(key3);
|
|
3937
|
+
const typedValue = valueConverter(O[key3]);
|
|
3938
3938
|
result[typedKey] = typedValue;
|
|
3939
3939
|
}
|
|
3940
3940
|
}
|
|
@@ -3965,16 +3965,16 @@ var require_webidl = __commonJS({
|
|
|
3965
3965
|
});
|
|
3966
3966
|
}
|
|
3967
3967
|
for (const options of converters) {
|
|
3968
|
-
const { key:
|
|
3968
|
+
const { key: key3, defaultValue, required: required2, converter } = options;
|
|
3969
3969
|
if (required2 === true) {
|
|
3970
|
-
if (!hasOwn(dictionary,
|
|
3970
|
+
if (!hasOwn(dictionary, key3)) {
|
|
3971
3971
|
throw webidl.errors.exception({
|
|
3972
3972
|
header: "Dictionary",
|
|
3973
|
-
message: `Missing required key "${
|
|
3973
|
+
message: `Missing required key "${key3}".`
|
|
3974
3974
|
});
|
|
3975
3975
|
}
|
|
3976
3976
|
}
|
|
3977
|
-
let value = dictionary[
|
|
3977
|
+
let value = dictionary[key3];
|
|
3978
3978
|
const hasDefault = hasOwn(options, "defaultValue");
|
|
3979
3979
|
if (hasDefault && value !== null) {
|
|
3980
3980
|
value = value ?? defaultValue;
|
|
@@ -3987,7 +3987,7 @@ var require_webidl = __commonJS({
|
|
|
3987
3987
|
message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(", ")}.`
|
|
3988
3988
|
});
|
|
3989
3989
|
}
|
|
3990
|
-
dict[
|
|
3990
|
+
dict[key3] = value;
|
|
3991
3991
|
}
|
|
3992
3992
|
}
|
|
3993
3993
|
return dict;
|
|
@@ -4713,8 +4713,8 @@ var require_formdata = __commonJS({
|
|
|
4713
4713
|
"Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
|
|
4714
4714
|
);
|
|
4715
4715
|
}
|
|
4716
|
-
for (const [
|
|
4717
|
-
callbackFn.apply(thisArg, [value,
|
|
4716
|
+
for (const [key3, value] of this) {
|
|
4717
|
+
callbackFn.apply(thisArg, [value, key3, this]);
|
|
4718
4718
|
}
|
|
4719
4719
|
}
|
|
4720
4720
|
};
|
|
@@ -4989,7 +4989,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
4989
4989
|
const contentType2 = this.headers.get("Content-Type");
|
|
4990
4990
|
if (/multipart\/form-data/.test(contentType2)) {
|
|
4991
4991
|
const headers = {};
|
|
4992
|
-
for (const [
|
|
4992
|
+
for (const [key3, value] of this.headers) headers[key3.toLowerCase()] = value;
|
|
4993
4993
|
const responseFormData = new FormData();
|
|
4994
4994
|
let busboy;
|
|
4995
4995
|
try {
|
|
@@ -5259,8 +5259,8 @@ var require_request = __commonJS({
|
|
|
5259
5259
|
} else if (headers && typeof headers === "object") {
|
|
5260
5260
|
const keys = Object.keys(headers);
|
|
5261
5261
|
for (let i = 0; i < keys.length; i++) {
|
|
5262
|
-
const
|
|
5263
|
-
processHeader(this,
|
|
5262
|
+
const key3 = keys[i];
|
|
5263
|
+
processHeader(this, key3, headers[key3]);
|
|
5264
5264
|
}
|
|
5265
5265
|
} else if (headers != null) {
|
|
5266
5266
|
throw new InvalidArgumentError("headers must be an object or an array");
|
|
@@ -5385,8 +5385,8 @@ var require_request = __commonJS({
|
|
|
5385
5385
|
}
|
|
5386
5386
|
}
|
|
5387
5387
|
// TODO: adjust to support H2
|
|
5388
|
-
addHeader(
|
|
5389
|
-
processHeader(this,
|
|
5388
|
+
addHeader(key3, value) {
|
|
5389
|
+
processHeader(this, key3, value);
|
|
5390
5390
|
return this;
|
|
5391
5391
|
}
|
|
5392
5392
|
static [kHTTP1BuildRequest](origin, opts, handler) {
|
|
@@ -5407,8 +5407,8 @@ var require_request = __commonJS({
|
|
|
5407
5407
|
} else if (headers && typeof headers === "object") {
|
|
5408
5408
|
const keys = Object.keys(headers);
|
|
5409
5409
|
for (let i = 0; i < keys.length; i++) {
|
|
5410
|
-
const
|
|
5411
|
-
processHeader(request,
|
|
5410
|
+
const key3 = keys[i];
|
|
5411
|
+
processHeader(request, key3, headers[key3], true);
|
|
5412
5412
|
}
|
|
5413
5413
|
} else if (headers != null) {
|
|
5414
5414
|
throw new InvalidArgumentError("headers must be an object or an array");
|
|
@@ -5419,75 +5419,75 @@ var require_request = __commonJS({
|
|
|
5419
5419
|
const rawHeaders = raw.split("\r\n");
|
|
5420
5420
|
const headers = {};
|
|
5421
5421
|
for (const header2 of rawHeaders) {
|
|
5422
|
-
const [
|
|
5422
|
+
const [key3, value] = header2.split(": ");
|
|
5423
5423
|
if (value == null || value.length === 0) continue;
|
|
5424
|
-
if (headers[
|
|
5425
|
-
else headers[
|
|
5424
|
+
if (headers[key3]) headers[key3] += `,${value}`;
|
|
5425
|
+
else headers[key3] = value;
|
|
5426
5426
|
}
|
|
5427
5427
|
return headers;
|
|
5428
5428
|
}
|
|
5429
5429
|
};
|
|
5430
|
-
function processHeaderValue(
|
|
5430
|
+
function processHeaderValue(key3, val, skipAppend) {
|
|
5431
5431
|
if (val && typeof val === "object") {
|
|
5432
|
-
throw new InvalidArgumentError(`invalid ${
|
|
5432
|
+
throw new InvalidArgumentError(`invalid ${key3} header`);
|
|
5433
5433
|
}
|
|
5434
5434
|
val = val != null ? `${val}` : "";
|
|
5435
5435
|
if (headerCharRegex.exec(val) !== null) {
|
|
5436
|
-
throw new InvalidArgumentError(`invalid ${
|
|
5436
|
+
throw new InvalidArgumentError(`invalid ${key3} header`);
|
|
5437
5437
|
}
|
|
5438
|
-
return skipAppend ? val : `${
|
|
5438
|
+
return skipAppend ? val : `${key3}: ${val}\r
|
|
5439
5439
|
`;
|
|
5440
5440
|
}
|
|
5441
|
-
function processHeader(request,
|
|
5441
|
+
function processHeader(request, key3, val, skipAppend = false) {
|
|
5442
5442
|
if (val && (typeof val === "object" && !Array.isArray(val))) {
|
|
5443
|
-
throw new InvalidArgumentError(`invalid ${
|
|
5443
|
+
throw new InvalidArgumentError(`invalid ${key3} header`);
|
|
5444
5444
|
} else if (val === void 0) {
|
|
5445
5445
|
return;
|
|
5446
5446
|
}
|
|
5447
|
-
if (request.host === null &&
|
|
5447
|
+
if (request.host === null && key3.length === 4 && key3.toLowerCase() === "host") {
|
|
5448
5448
|
if (headerCharRegex.exec(val) !== null) {
|
|
5449
|
-
throw new InvalidArgumentError(`invalid ${
|
|
5449
|
+
throw new InvalidArgumentError(`invalid ${key3} header`);
|
|
5450
5450
|
}
|
|
5451
5451
|
request.host = val;
|
|
5452
|
-
} else if (request.contentLength === null &&
|
|
5452
|
+
} else if (request.contentLength === null && key3.length === 14 && key3.toLowerCase() === "content-length") {
|
|
5453
5453
|
request.contentLength = parseInt(val, 10);
|
|
5454
5454
|
if (!Number.isFinite(request.contentLength)) {
|
|
5455
5455
|
throw new InvalidArgumentError("invalid content-length header");
|
|
5456
5456
|
}
|
|
5457
|
-
} else if (request.contentType === null &&
|
|
5457
|
+
} else if (request.contentType === null && key3.length === 12 && key3.toLowerCase() === "content-type") {
|
|
5458
5458
|
request.contentType = val;
|
|
5459
|
-
if (skipAppend) request.headers[
|
|
5460
|
-
else request.headers += processHeaderValue(
|
|
5461
|
-
} else if (
|
|
5459
|
+
if (skipAppend) request.headers[key3] = processHeaderValue(key3, val, skipAppend);
|
|
5460
|
+
else request.headers += processHeaderValue(key3, val);
|
|
5461
|
+
} else if (key3.length === 17 && key3.toLowerCase() === "transfer-encoding") {
|
|
5462
5462
|
throw new InvalidArgumentError("invalid transfer-encoding header");
|
|
5463
|
-
} else if (
|
|
5463
|
+
} else if (key3.length === 10 && key3.toLowerCase() === "connection") {
|
|
5464
5464
|
const value = typeof val === "string" ? val.toLowerCase() : null;
|
|
5465
5465
|
if (value !== "close" && value !== "keep-alive") {
|
|
5466
5466
|
throw new InvalidArgumentError("invalid connection header");
|
|
5467
5467
|
} else if (value === "close") {
|
|
5468
5468
|
request.reset = true;
|
|
5469
5469
|
}
|
|
5470
|
-
} else if (
|
|
5470
|
+
} else if (key3.length === 10 && key3.toLowerCase() === "keep-alive") {
|
|
5471
5471
|
throw new InvalidArgumentError("invalid keep-alive header");
|
|
5472
|
-
} else if (
|
|
5472
|
+
} else if (key3.length === 7 && key3.toLowerCase() === "upgrade") {
|
|
5473
5473
|
throw new InvalidArgumentError("invalid upgrade header");
|
|
5474
|
-
} else if (
|
|
5474
|
+
} else if (key3.length === 6 && key3.toLowerCase() === "expect") {
|
|
5475
5475
|
throw new NotSupportedError("expect header not supported");
|
|
5476
|
-
} else if (tokenRegExp.exec(
|
|
5476
|
+
} else if (tokenRegExp.exec(key3) === null) {
|
|
5477
5477
|
throw new InvalidArgumentError("invalid header key");
|
|
5478
5478
|
} else {
|
|
5479
5479
|
if (Array.isArray(val)) {
|
|
5480
5480
|
for (let i = 0; i < val.length; i++) {
|
|
5481
5481
|
if (skipAppend) {
|
|
5482
|
-
if (request.headers[
|
|
5483
|
-
else request.headers[
|
|
5482
|
+
if (request.headers[key3]) request.headers[key3] += `,${processHeaderValue(key3, val[i], skipAppend)}`;
|
|
5483
|
+
else request.headers[key3] = processHeaderValue(key3, val[i], skipAppend);
|
|
5484
5484
|
} else {
|
|
5485
|
-
request.headers += processHeaderValue(
|
|
5485
|
+
request.headers += processHeaderValue(key3, val[i]);
|
|
5486
5486
|
}
|
|
5487
5487
|
}
|
|
5488
5488
|
} else {
|
|
5489
|
-
if (skipAppend) request.headers[
|
|
5490
|
-
else request.headers += processHeaderValue(
|
|
5489
|
+
if (skipAppend) request.headers[key3] = processHeaderValue(key3, val, skipAppend);
|
|
5490
|
+
else request.headers += processHeaderValue(key3, val);
|
|
5491
5491
|
}
|
|
5492
5492
|
}
|
|
5493
5493
|
}
|
|
@@ -5693,13 +5693,13 @@ var require_connect = __commonJS({
|
|
|
5693
5693
|
constructor(maxCachedSessions) {
|
|
5694
5694
|
this._maxCachedSessions = maxCachedSessions;
|
|
5695
5695
|
this._sessionCache = /* @__PURE__ */ new Map();
|
|
5696
|
-
this._sessionRegistry = new global.FinalizationRegistry((
|
|
5696
|
+
this._sessionRegistry = new global.FinalizationRegistry((key3) => {
|
|
5697
5697
|
if (this._sessionCache.size < this._maxCachedSessions) {
|
|
5698
5698
|
return;
|
|
5699
5699
|
}
|
|
5700
|
-
const ref = this._sessionCache.get(
|
|
5700
|
+
const ref = this._sessionCache.get(key3);
|
|
5701
5701
|
if (ref !== void 0 && ref.deref() === void 0) {
|
|
5702
|
-
this._sessionCache.delete(
|
|
5702
|
+
this._sessionCache.delete(key3);
|
|
5703
5703
|
}
|
|
5704
5704
|
});
|
|
5705
5705
|
}
|
|
@@ -5842,10 +5842,10 @@ var require_utils = __commonJS({
|
|
|
5842
5842
|
exports2.enumToMap = void 0;
|
|
5843
5843
|
function enumToMap(obj) {
|
|
5844
5844
|
const res = {};
|
|
5845
|
-
Object.keys(obj).forEach((
|
|
5846
|
-
const value = obj[
|
|
5845
|
+
Object.keys(obj).forEach((key3) => {
|
|
5846
|
+
const value = obj[key3];
|
|
5847
5847
|
if (typeof value === "number") {
|
|
5848
|
-
res[
|
|
5848
|
+
res[key3] = value;
|
|
5849
5849
|
}
|
|
5850
5850
|
});
|
|
5851
5851
|
return res;
|
|
@@ -6022,9 +6022,9 @@ var require_constants3 = __commonJS({
|
|
|
6022
6022
|
];
|
|
6023
6023
|
exports2.METHOD_MAP = utils_1.enumToMap(METHODS);
|
|
6024
6024
|
exports2.H_METHOD_MAP = {};
|
|
6025
|
-
Object.keys(exports2.METHOD_MAP).forEach((
|
|
6026
|
-
if (/^H/.test(
|
|
6027
|
-
exports2.H_METHOD_MAP[
|
|
6025
|
+
Object.keys(exports2.METHOD_MAP).forEach((key3) => {
|
|
6026
|
+
if (/^H/.test(key3)) {
|
|
6027
|
+
exports2.H_METHOD_MAP[key3] = exports2.METHOD_MAP[key3];
|
|
6028
6028
|
}
|
|
6029
6029
|
});
|
|
6030
6030
|
var FINISH;
|
|
@@ -6311,9 +6311,9 @@ var require_RedirectHandler = __commonJS({
|
|
|
6311
6311
|
}
|
|
6312
6312
|
}
|
|
6313
6313
|
} else if (headers && typeof headers === "object") {
|
|
6314
|
-
for (const
|
|
6315
|
-
if (!shouldRemoveHeader(
|
|
6316
|
-
ret.push(
|
|
6314
|
+
for (const key3 of Object.keys(headers)) {
|
|
6315
|
+
if (!shouldRemoveHeader(key3, removeContent, unknownOrigin)) {
|
|
6316
|
+
ret.push(key3, headers[key3]);
|
|
6317
6317
|
}
|
|
6318
6318
|
}
|
|
6319
6319
|
} else {
|
|
@@ -6963,12 +6963,12 @@ var require_client = __commonJS({
|
|
|
6963
6963
|
} else {
|
|
6964
6964
|
this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]);
|
|
6965
6965
|
}
|
|
6966
|
-
const
|
|
6967
|
-
if (
|
|
6966
|
+
const key3 = this.headers[len - 2];
|
|
6967
|
+
if (key3.length === 10 && key3.toString().toLowerCase() === "keep-alive") {
|
|
6968
6968
|
this.keepAlive += buf.toString();
|
|
6969
|
-
} else if (
|
|
6969
|
+
} else if (key3.length === 10 && key3.toString().toLowerCase() === "connection") {
|
|
6970
6970
|
this.connection += buf.toString();
|
|
6971
|
-
} else if (
|
|
6971
|
+
} else if (key3.length === 14 && key3.toString().toLowerCase() === "content-length") {
|
|
6972
6972
|
this.contentLength += buf.toString();
|
|
6973
6973
|
}
|
|
6974
6974
|
this.trackHeader(buf.length);
|
|
@@ -8554,11 +8554,11 @@ var require_dispatcher_weakref = __commonJS({
|
|
|
8554
8554
|
constructor(finalizer) {
|
|
8555
8555
|
this.finalizer = finalizer;
|
|
8556
8556
|
}
|
|
8557
|
-
register(dispatcher,
|
|
8557
|
+
register(dispatcher, key3) {
|
|
8558
8558
|
if (dispatcher.on) {
|
|
8559
8559
|
dispatcher.on("disconnect", () => {
|
|
8560
8560
|
if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
|
|
8561
|
-
this.finalizer(
|
|
8561
|
+
this.finalizer(key3);
|
|
8562
8562
|
}
|
|
8563
8563
|
});
|
|
8564
8564
|
}
|
|
@@ -8625,10 +8625,10 @@ var require_agent = __commonJS({
|
|
|
8625
8625
|
this[kClients] = /* @__PURE__ */ new Map();
|
|
8626
8626
|
this[kFinalizer] = new FinalizationRegistry(
|
|
8627
8627
|
/* istanbul ignore next: gc is undeterministic */
|
|
8628
|
-
(
|
|
8629
|
-
const ref = this[kClients].get(
|
|
8628
|
+
(key3) => {
|
|
8629
|
+
const ref = this[kClients].get(key3);
|
|
8630
8630
|
if (ref !== void 0 && ref.deref() === void 0) {
|
|
8631
|
-
this[kClients].delete(
|
|
8631
|
+
this[kClients].delete(key3);
|
|
8632
8632
|
}
|
|
8633
8633
|
}
|
|
8634
8634
|
);
|
|
@@ -8657,18 +8657,18 @@ var require_agent = __commonJS({
|
|
|
8657
8657
|
return ret;
|
|
8658
8658
|
}
|
|
8659
8659
|
[kDispatch](opts, handler) {
|
|
8660
|
-
let
|
|
8660
|
+
let key3;
|
|
8661
8661
|
if (opts.origin && (typeof opts.origin === "string" || opts.origin instanceof URL)) {
|
|
8662
|
-
|
|
8662
|
+
key3 = String(opts.origin);
|
|
8663
8663
|
} else {
|
|
8664
8664
|
throw new InvalidArgumentError("opts.origin must be a non-empty string or URL.");
|
|
8665
8665
|
}
|
|
8666
|
-
const ref = this[kClients].get(
|
|
8666
|
+
const ref = this[kClients].get(key3);
|
|
8667
8667
|
let dispatcher = ref ? ref.deref() : null;
|
|
8668
8668
|
if (!dispatcher) {
|
|
8669
8669
|
dispatcher = this[kFactory](opts.origin, this[kOptions]).on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]);
|
|
8670
|
-
this[kClients].set(
|
|
8671
|
-
this[kFinalizer].register(dispatcher,
|
|
8670
|
+
this[kClients].set(key3, new WeakRef2(dispatcher));
|
|
8671
|
+
this[kFinalizer].register(dispatcher, key3);
|
|
8672
8672
|
}
|
|
8673
8673
|
return dispatcher.dispatch(opts, handler);
|
|
8674
8674
|
}
|
|
@@ -9842,18 +9842,18 @@ var require_mock_utils = __commonJS({
|
|
|
9842
9842
|
})
|
|
9843
9843
|
);
|
|
9844
9844
|
}
|
|
9845
|
-
function getHeaderByName(headers,
|
|
9845
|
+
function getHeaderByName(headers, key3) {
|
|
9846
9846
|
if (Array.isArray(headers)) {
|
|
9847
9847
|
for (let i = 0; i < headers.length; i += 2) {
|
|
9848
|
-
if (headers[i].toLocaleLowerCase() ===
|
|
9848
|
+
if (headers[i].toLocaleLowerCase() === key3.toLocaleLowerCase()) {
|
|
9849
9849
|
return headers[i + 1];
|
|
9850
9850
|
}
|
|
9851
9851
|
}
|
|
9852
9852
|
return void 0;
|
|
9853
9853
|
} else if (typeof headers.get === "function") {
|
|
9854
|
-
return headers.get(
|
|
9854
|
+
return headers.get(key3);
|
|
9855
9855
|
} else {
|
|
9856
|
-
return lowerCaseEntries(headers)[
|
|
9856
|
+
return lowerCaseEntries(headers)[key3.toLocaleLowerCase()];
|
|
9857
9857
|
}
|
|
9858
9858
|
}
|
|
9859
9859
|
function buildHeadersFromArray(headers) {
|
|
@@ -9913,40 +9913,40 @@ var require_mock_utils = __commonJS({
|
|
|
9913
9913
|
return data.toString();
|
|
9914
9914
|
}
|
|
9915
9915
|
}
|
|
9916
|
-
function getMockDispatch(mockDispatches,
|
|
9917
|
-
const basePath =
|
|
9916
|
+
function getMockDispatch(mockDispatches, key3) {
|
|
9917
|
+
const basePath = key3.query ? buildURL(key3.path, key3.query) : key3.path;
|
|
9918
9918
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
9919
9919
|
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path63 }) => matchValue(safeUrl(path63), resolvedPath));
|
|
9920
9920
|
if (matchedMockDispatches.length === 0) {
|
|
9921
9921
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
9922
9922
|
}
|
|
9923
|
-
matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method,
|
|
9923
|
+
matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key3.method));
|
|
9924
9924
|
if (matchedMockDispatches.length === 0) {
|
|
9925
|
-
throw new MockNotMatchedError(`Mock dispatch not matched for method '${
|
|
9925
|
+
throw new MockNotMatchedError(`Mock dispatch not matched for method '${key3.method}'`);
|
|
9926
9926
|
}
|
|
9927
|
-
matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== "undefined" ? matchValue(body,
|
|
9927
|
+
matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== "undefined" ? matchValue(body, key3.body) : true);
|
|
9928
9928
|
if (matchedMockDispatches.length === 0) {
|
|
9929
|
-
throw new MockNotMatchedError(`Mock dispatch not matched for body '${
|
|
9929
|
+
throw new MockNotMatchedError(`Mock dispatch not matched for body '${key3.body}'`);
|
|
9930
9930
|
}
|
|
9931
|
-
matchedMockDispatches = matchedMockDispatches.filter((mockDispatch2) => matchHeaders(mockDispatch2,
|
|
9931
|
+
matchedMockDispatches = matchedMockDispatches.filter((mockDispatch2) => matchHeaders(mockDispatch2, key3.headers));
|
|
9932
9932
|
if (matchedMockDispatches.length === 0) {
|
|
9933
|
-
throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof
|
|
9933
|
+
throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key3.headers === "object" ? JSON.stringify(key3.headers) : key3.headers}'`);
|
|
9934
9934
|
}
|
|
9935
9935
|
return matchedMockDispatches[0];
|
|
9936
9936
|
}
|
|
9937
|
-
function addMockDispatch(mockDispatches,
|
|
9937
|
+
function addMockDispatch(mockDispatches, key3, data) {
|
|
9938
9938
|
const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false };
|
|
9939
9939
|
const replyData = typeof data === "function" ? { callback: data } : { ...data };
|
|
9940
|
-
const newMockDispatch = { ...baseData, ...
|
|
9940
|
+
const newMockDispatch = { ...baseData, ...key3, pending: true, data: { error: null, ...replyData } };
|
|
9941
9941
|
mockDispatches.push(newMockDispatch);
|
|
9942
9942
|
return newMockDispatch;
|
|
9943
9943
|
}
|
|
9944
|
-
function deleteMockDispatch(mockDispatches,
|
|
9944
|
+
function deleteMockDispatch(mockDispatches, key3) {
|
|
9945
9945
|
const index = mockDispatches.findIndex((dispatch) => {
|
|
9946
9946
|
if (!dispatch.consumed) {
|
|
9947
9947
|
return false;
|
|
9948
9948
|
}
|
|
9949
|
-
return matchKey(dispatch,
|
|
9949
|
+
return matchKey(dispatch, key3);
|
|
9950
9950
|
});
|
|
9951
9951
|
if (index !== -1) {
|
|
9952
9952
|
mockDispatches.splice(index, 1);
|
|
@@ -9963,9 +9963,9 @@ var require_mock_utils = __commonJS({
|
|
|
9963
9963
|
};
|
|
9964
9964
|
}
|
|
9965
9965
|
function generateKeyValues(data) {
|
|
9966
|
-
return Object.entries(data).reduce((keyValuePairs, [
|
|
9966
|
+
return Object.entries(data).reduce((keyValuePairs, [key3, value]) => [
|
|
9967
9967
|
...keyValuePairs,
|
|
9968
|
-
Buffer.from(`${
|
|
9968
|
+
Buffer.from(`${key3}`),
|
|
9969
9969
|
Array.isArray(value) ? value.map((x) => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
|
|
9970
9970
|
], []);
|
|
9971
9971
|
}
|
|
@@ -9980,8 +9980,8 @@ var require_mock_utils = __commonJS({
|
|
|
9980
9980
|
return Buffer.concat(buffers).toString("utf8");
|
|
9981
9981
|
}
|
|
9982
9982
|
function mockDispatch(opts, handler) {
|
|
9983
|
-
const
|
|
9984
|
-
const mockDispatch2 = getMockDispatch(this[kDispatches],
|
|
9983
|
+
const key3 = buildKey(opts);
|
|
9984
|
+
const mockDispatch2 = getMockDispatch(this[kDispatches], key3);
|
|
9985
9985
|
mockDispatch2.timesInvoked++;
|
|
9986
9986
|
if (mockDispatch2.data.callback) {
|
|
9987
9987
|
mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) };
|
|
@@ -9991,7 +9991,7 @@ var require_mock_utils = __commonJS({
|
|
|
9991
9991
|
mockDispatch2.consumed = !persist && timesInvoked >= times;
|
|
9992
9992
|
mockDispatch2.pending = timesInvoked < times;
|
|
9993
9993
|
if (error51 !== null) {
|
|
9994
|
-
deleteMockDispatch(this[kDispatches],
|
|
9994
|
+
deleteMockDispatch(this[kDispatches], key3);
|
|
9995
9995
|
handler.onError(error51);
|
|
9996
9996
|
return true;
|
|
9997
9997
|
}
|
|
@@ -10016,7 +10016,7 @@ var require_mock_utils = __commonJS({
|
|
|
10016
10016
|
handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode));
|
|
10017
10017
|
handler.onData(Buffer.from(responseData));
|
|
10018
10018
|
handler.onComplete(responseTrailers);
|
|
10019
|
-
deleteMockDispatch(mockDispatches,
|
|
10019
|
+
deleteMockDispatch(mockDispatches, key3);
|
|
10020
10020
|
}
|
|
10021
10021
|
function resume() {
|
|
10022
10022
|
}
|
|
@@ -10703,7 +10703,7 @@ var require_proxy_agent = __commonJS({
|
|
|
10703
10703
|
return headers;
|
|
10704
10704
|
}
|
|
10705
10705
|
function throwIfProxyAuthIsSent(headers) {
|
|
10706
|
-
const existProxyAuth = headers && Object.keys(headers).find((
|
|
10706
|
+
const existProxyAuth = headers && Object.keys(headers).find((key3) => key3.toLowerCase() === "proxy-authorization");
|
|
10707
10707
|
if (existProxyAuth) {
|
|
10708
10708
|
throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor");
|
|
10709
10709
|
}
|
|
@@ -11382,8 +11382,8 @@ var require_headers = __commonJS({
|
|
|
11382
11382
|
"Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
|
|
11383
11383
|
);
|
|
11384
11384
|
}
|
|
11385
|
-
for (const [
|
|
11386
|
-
callbackFn.apply(thisArg, [value,
|
|
11385
|
+
for (const [key3, value] of this) {
|
|
11386
|
+
callbackFn.apply(thisArg, [value, key3, this]);
|
|
11387
11387
|
}
|
|
11388
11388
|
}
|
|
11389
11389
|
[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
|
|
@@ -12078,8 +12078,8 @@ var require_request2 = __commonJS({
|
|
|
12078
12078
|
const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList);
|
|
12079
12079
|
headersList.clear();
|
|
12080
12080
|
if (headers instanceof HeadersList) {
|
|
12081
|
-
for (const [
|
|
12082
|
-
headersList.append(
|
|
12081
|
+
for (const [key3, val] of headers) {
|
|
12082
|
+
headersList.append(key3, val);
|
|
12083
12083
|
}
|
|
12084
12084
|
headersList.cookies = headers.cookies;
|
|
12085
12085
|
} else {
|
|
@@ -13378,25 +13378,25 @@ var require_fetch = __commonJS({
|
|
|
13378
13378
|
const headers = new Headers2();
|
|
13379
13379
|
if (Array.isArray(headersList)) {
|
|
13380
13380
|
for (let n = 0; n < headersList.length; n += 2) {
|
|
13381
|
-
const
|
|
13381
|
+
const key3 = headersList[n + 0].toString("latin1");
|
|
13382
13382
|
const val = headersList[n + 1].toString("latin1");
|
|
13383
|
-
if (
|
|
13383
|
+
if (key3.toLowerCase() === "content-encoding") {
|
|
13384
13384
|
codings = val.toLowerCase().split(",").map((x) => x.trim());
|
|
13385
|
-
} else if (
|
|
13385
|
+
} else if (key3.toLowerCase() === "location") {
|
|
13386
13386
|
location = val;
|
|
13387
13387
|
}
|
|
13388
|
-
headers[kHeadersList].append(
|
|
13388
|
+
headers[kHeadersList].append(key3, val);
|
|
13389
13389
|
}
|
|
13390
13390
|
} else {
|
|
13391
13391
|
const keys = Object.keys(headersList);
|
|
13392
|
-
for (const
|
|
13393
|
-
const val = headersList[
|
|
13394
|
-
if (
|
|
13392
|
+
for (const key3 of keys) {
|
|
13393
|
+
const val = headersList[key3];
|
|
13394
|
+
if (key3.toLowerCase() === "content-encoding") {
|
|
13395
13395
|
codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse();
|
|
13396
|
-
} else if (
|
|
13396
|
+
} else if (key3.toLowerCase() === "location") {
|
|
13397
13397
|
location = val;
|
|
13398
13398
|
}
|
|
13399
|
-
headers[kHeadersList].append(
|
|
13399
|
+
headers[kHeadersList].append(key3, val);
|
|
13400
13400
|
}
|
|
13401
13401
|
}
|
|
13402
13402
|
this.body = new Readable({ read: resume });
|
|
@@ -13462,9 +13462,9 @@ var require_fetch = __commonJS({
|
|
|
13462
13462
|
}
|
|
13463
13463
|
const headers = new Headers2();
|
|
13464
13464
|
for (let n = 0; n < headersList.length; n += 2) {
|
|
13465
|
-
const
|
|
13465
|
+
const key3 = headersList[n + 0].toString("latin1");
|
|
13466
13466
|
const val = headersList[n + 1].toString("latin1");
|
|
13467
|
-
headers[kHeadersList].append(
|
|
13467
|
+
headers[kHeadersList].append(key3, val);
|
|
13468
13468
|
}
|
|
13469
13469
|
resolve({
|
|
13470
13470
|
status: status2,
|
|
@@ -15124,8 +15124,8 @@ var require_util6 = __commonJS({
|
|
|
15124
15124
|
if (!part.includes("=")) {
|
|
15125
15125
|
throw new Error("Invalid unparsed");
|
|
15126
15126
|
}
|
|
15127
|
-
const [
|
|
15128
|
-
out.push(`${
|
|
15127
|
+
const [key3, ...value] = part.split("=");
|
|
15128
|
+
out.push(`${key3.trim()}=${value.join("=")}`);
|
|
15129
15129
|
}
|
|
15130
15130
|
return out.join("; ");
|
|
15131
15131
|
}
|
|
@@ -16923,15 +16923,15 @@ var require_code = __commonJS({
|
|
|
16923
16923
|
return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
16924
16924
|
}
|
|
16925
16925
|
exports2.safeStringify = safeStringify;
|
|
16926
|
-
function getProperty(
|
|
16927
|
-
return typeof
|
|
16926
|
+
function getProperty(key3) {
|
|
16927
|
+
return typeof key3 == "string" && exports2.IDENTIFIER.test(key3) ? new _Code(`.${key3}`) : _`[${key3}]`;
|
|
16928
16928
|
}
|
|
16929
16929
|
exports2.getProperty = getProperty;
|
|
16930
|
-
function getEsmExportName(
|
|
16931
|
-
if (typeof
|
|
16932
|
-
return new _Code(`${
|
|
16930
|
+
function getEsmExportName(key3) {
|
|
16931
|
+
if (typeof key3 == "string" && exports2.IDENTIFIER.test(key3)) {
|
|
16932
|
+
return new _Code(`${key3}`);
|
|
16933
16933
|
}
|
|
16934
|
-
throw new Error(`CodeGen: invalid export name: ${
|
|
16934
|
+
throw new Error(`CodeGen: invalid export name: ${key3}, use explicit $id name mapping`);
|
|
16935
16935
|
}
|
|
16936
16936
|
exports2.getEsmExportName = getEsmExportName;
|
|
16937
16937
|
function regexpCode(rx) {
|
|
@@ -17558,11 +17558,11 @@ var require_codegen = __commonJS({
|
|
|
17558
17558
|
// returns code for object literal for the passed argument list of key-value pairs
|
|
17559
17559
|
object(...keyValues) {
|
|
17560
17560
|
const code = ["{"];
|
|
17561
|
-
for (const [
|
|
17561
|
+
for (const [key3, value] of keyValues) {
|
|
17562
17562
|
if (code.length > 1)
|
|
17563
17563
|
code.push(",");
|
|
17564
|
-
code.push(
|
|
17565
|
-
if (
|
|
17564
|
+
code.push(key3);
|
|
17565
|
+
if (key3 !== value || this.opts.es5) {
|
|
17566
17566
|
code.push(":");
|
|
17567
17567
|
(0, code_1.addCodeArg)(code, value);
|
|
17568
17568
|
}
|
|
@@ -17837,17 +17837,17 @@ var require_util8 = __commonJS({
|
|
|
17837
17837
|
if (typeof schema8 === "boolean")
|
|
17838
17838
|
return;
|
|
17839
17839
|
const rules = self.RULES.keywords;
|
|
17840
|
-
for (const
|
|
17841
|
-
if (!rules[
|
|
17842
|
-
checkStrictMode(it, `unknown keyword: "${
|
|
17840
|
+
for (const key3 in schema8) {
|
|
17841
|
+
if (!rules[key3])
|
|
17842
|
+
checkStrictMode(it, `unknown keyword: "${key3}"`);
|
|
17843
17843
|
}
|
|
17844
17844
|
}
|
|
17845
17845
|
exports2.checkUnknownRules = checkUnknownRules;
|
|
17846
17846
|
function schemaHasRules(schema8, rules) {
|
|
17847
17847
|
if (typeof schema8 == "boolean")
|
|
17848
17848
|
return !schema8;
|
|
17849
|
-
for (const
|
|
17850
|
-
if (rules[
|
|
17849
|
+
for (const key3 in schema8)
|
|
17850
|
+
if (rules[key3])
|
|
17851
17851
|
return true;
|
|
17852
17852
|
return false;
|
|
17853
17853
|
}
|
|
@@ -17855,8 +17855,8 @@ var require_util8 = __commonJS({
|
|
|
17855
17855
|
function schemaHasRulesButRef(schema8, RULES) {
|
|
17856
17856
|
if (typeof schema8 == "boolean")
|
|
17857
17857
|
return !schema8;
|
|
17858
|
-
for (const
|
|
17859
|
-
if (
|
|
17858
|
+
for (const key3 in schema8)
|
|
17859
|
+
if (key3 !== "$ref" && RULES.all[key3])
|
|
17860
17860
|
return true;
|
|
17861
17861
|
return false;
|
|
17862
17862
|
}
|
|
@@ -18434,8 +18434,8 @@ var require_defaults = __commonJS({
|
|
|
18434
18434
|
function assignDefaults(it, ty) {
|
|
18435
18435
|
const { properties, items } = it.schema;
|
|
18436
18436
|
if (ty === "object" && properties) {
|
|
18437
|
-
for (const
|
|
18438
|
-
assignDefault(it,
|
|
18437
|
+
for (const key3 in properties) {
|
|
18438
|
+
assignDefault(it, key3, properties[key3].default);
|
|
18439
18439
|
}
|
|
18440
18440
|
} else if (ty === "array" && Array.isArray(items)) {
|
|
18441
18441
|
items.forEach((sch, i) => assignDefault(it, i, sch.default));
|
|
@@ -18819,8 +18819,8 @@ var require_fast_deep_equal = __commonJS({
|
|
|
18819
18819
|
for (i = length; i-- !== 0; )
|
|
18820
18820
|
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
18821
18821
|
for (i = length; i-- !== 0; ) {
|
|
18822
|
-
var
|
|
18823
|
-
if (!equal(a[
|
|
18822
|
+
var key3 = keys[i];
|
|
18823
|
+
if (!equal(a[key3], b[key3])) return false;
|
|
18824
18824
|
}
|
|
18825
18825
|
return true;
|
|
18826
18826
|
}
|
|
@@ -18892,20 +18892,20 @@ var require_json_schema_traverse = __commonJS({
|
|
|
18892
18892
|
function _traverse(opts, pre, post, schema8, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
|
|
18893
18893
|
if (schema8 && typeof schema8 == "object" && !Array.isArray(schema8)) {
|
|
18894
18894
|
pre(schema8, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
18895
|
-
for (var
|
|
18896
|
-
var sch = schema8[
|
|
18895
|
+
for (var key3 in schema8) {
|
|
18896
|
+
var sch = schema8[key3];
|
|
18897
18897
|
if (Array.isArray(sch)) {
|
|
18898
|
-
if (
|
|
18898
|
+
if (key3 in traverse.arrayKeywords) {
|
|
18899
18899
|
for (var i = 0; i < sch.length; i++)
|
|
18900
|
-
_traverse(opts, pre, post, sch[i], jsonPtr + "/" +
|
|
18900
|
+
_traverse(opts, pre, post, sch[i], jsonPtr + "/" + key3 + "/" + i, rootSchema, jsonPtr, key3, schema8, i);
|
|
18901
18901
|
}
|
|
18902
|
-
} else if (
|
|
18902
|
+
} else if (key3 in traverse.propsKeywords) {
|
|
18903
18903
|
if (sch && typeof sch == "object") {
|
|
18904
18904
|
for (var prop in sch)
|
|
18905
|
-
_traverse(opts, pre, post, sch[prop], jsonPtr + "/" +
|
|
18905
|
+
_traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key3 + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key3, schema8, prop);
|
|
18906
18906
|
}
|
|
18907
|
-
} else if (
|
|
18908
|
-
_traverse(opts, pre, post, sch, jsonPtr + "/" +
|
|
18907
|
+
} else if (key3 in traverse.keywords || opts.allKeys && !(key3 in traverse.skipKeywords)) {
|
|
18908
|
+
_traverse(opts, pre, post, sch, jsonPtr + "/" + key3, rootSchema, jsonPtr, key3, schema8);
|
|
18909
18909
|
}
|
|
18910
18910
|
}
|
|
18911
18911
|
post(schema8, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
@@ -18962,10 +18962,10 @@ var require_resolve = __commonJS({
|
|
|
18962
18962
|
"$dynamicAnchor"
|
|
18963
18963
|
]);
|
|
18964
18964
|
function hasRef(schema8) {
|
|
18965
|
-
for (const
|
|
18966
|
-
if (REF_KEYWORDS.has(
|
|
18965
|
+
for (const key3 in schema8) {
|
|
18966
|
+
if (REF_KEYWORDS.has(key3))
|
|
18967
18967
|
return true;
|
|
18968
|
-
const sch = schema8[
|
|
18968
|
+
const sch = schema8[key3];
|
|
18969
18969
|
if (Array.isArray(sch) && sch.some(hasRef))
|
|
18970
18970
|
return true;
|
|
18971
18971
|
if (typeof sch == "object" && hasRef(sch))
|
|
@@ -18975,14 +18975,14 @@ var require_resolve = __commonJS({
|
|
|
18975
18975
|
}
|
|
18976
18976
|
function countKeys(schema8) {
|
|
18977
18977
|
let count3 = 0;
|
|
18978
|
-
for (const
|
|
18979
|
-
if (
|
|
18978
|
+
for (const key3 in schema8) {
|
|
18979
|
+
if (key3 === "$ref")
|
|
18980
18980
|
return Infinity;
|
|
18981
18981
|
count3++;
|
|
18982
|
-
if (SIMPLE_INLINED.has(
|
|
18982
|
+
if (SIMPLE_INLINED.has(key3))
|
|
18983
18983
|
continue;
|
|
18984
|
-
if (typeof schema8[
|
|
18985
|
-
(0, util_1.eachItem)(schema8[
|
|
18984
|
+
if (typeof schema8[key3] == "object") {
|
|
18985
|
+
(0, util_1.eachItem)(schema8[key3], (sch) => count3 += countKeys(sch));
|
|
18986
18986
|
}
|
|
18987
18987
|
if (count3 === Infinity)
|
|
18988
18988
|
return Infinity;
|
|
@@ -19171,8 +19171,8 @@ var require_validate = __commonJS({
|
|
|
19171
19171
|
function schemaCxtHasRules({ schema: schema8, self }) {
|
|
19172
19172
|
if (typeof schema8 == "boolean")
|
|
19173
19173
|
return !schema8;
|
|
19174
|
-
for (const
|
|
19175
|
-
if (self.RULES.all[
|
|
19174
|
+
for (const key3 in schema8)
|
|
19175
|
+
if (self.RULES.all[key3])
|
|
19176
19176
|
return true;
|
|
19177
19177
|
return false;
|
|
19178
19178
|
}
|
|
@@ -20907,7 +20907,7 @@ var require_core = __commonJS({
|
|
|
20907
20907
|
}
|
|
20908
20908
|
}
|
|
20909
20909
|
// Adds schema to the instance
|
|
20910
|
-
addSchema(schema8,
|
|
20910
|
+
addSchema(schema8, key3, _meta, _validateSchema = this.opts.validateSchema) {
|
|
20911
20911
|
if (Array.isArray(schema8)) {
|
|
20912
20912
|
for (const sch of schema8)
|
|
20913
20913
|
this.addSchema(sch, void 0, _meta, _validateSchema);
|
|
@@ -20921,15 +20921,15 @@ var require_core = __commonJS({
|
|
|
20921
20921
|
throw new Error(`schema ${schemaId} must be string`);
|
|
20922
20922
|
}
|
|
20923
20923
|
}
|
|
20924
|
-
|
|
20925
|
-
this._checkUnique(
|
|
20926
|
-
this.schemas[
|
|
20924
|
+
key3 = (0, resolve_1.normalizeId)(key3 || id);
|
|
20925
|
+
this._checkUnique(key3);
|
|
20926
|
+
this.schemas[key3] = this._addSchema(schema8, _meta, key3, _validateSchema, true);
|
|
20927
20927
|
return this;
|
|
20928
20928
|
}
|
|
20929
20929
|
// Add schema that will be used to validate other schemas
|
|
20930
20930
|
// options in META_IGNORE_OPTIONS are alway set to false
|
|
20931
|
-
addMetaSchema(schema8,
|
|
20932
|
-
this.addSchema(schema8,
|
|
20931
|
+
addMetaSchema(schema8, key3, _validateSchema = this.opts.validateSchema) {
|
|
20932
|
+
this.addSchema(schema8, key3, true, _validateSchema);
|
|
20933
20933
|
return this;
|
|
20934
20934
|
}
|
|
20935
20935
|
// Validate schema against its meta-schema
|
|
@@ -21085,14 +21085,14 @@ var require_core = __commonJS({
|
|
|
21085
21085
|
let keywords = metaSchema;
|
|
21086
21086
|
for (const seg of segments)
|
|
21087
21087
|
keywords = keywords[seg];
|
|
21088
|
-
for (const
|
|
21089
|
-
const rule = rules[
|
|
21088
|
+
for (const key3 in rules) {
|
|
21089
|
+
const rule = rules[key3];
|
|
21090
21090
|
if (typeof rule != "object")
|
|
21091
21091
|
continue;
|
|
21092
21092
|
const { $data } = rule.definition;
|
|
21093
|
-
const schema8 = keywords[
|
|
21093
|
+
const schema8 = keywords[key3];
|
|
21094
21094
|
if ($data && schema8)
|
|
21095
|
-
keywords[
|
|
21095
|
+
keywords[key3] = schemaOrData(schema8);
|
|
21096
21096
|
}
|
|
21097
21097
|
}
|
|
21098
21098
|
return metaSchema;
|
|
@@ -21165,10 +21165,10 @@ var require_core = __commonJS({
|
|
|
21165
21165
|
Ajv2.MissingRefError = ref_error_1.default;
|
|
21166
21166
|
exports2.default = Ajv2;
|
|
21167
21167
|
function checkOptions(checkOpts, options, msg, log = "error") {
|
|
21168
|
-
for (const
|
|
21169
|
-
const opt =
|
|
21168
|
+
for (const key3 in checkOpts) {
|
|
21169
|
+
const opt = key3;
|
|
21170
21170
|
if (opt in options)
|
|
21171
|
-
this.logger[log](`${msg}: option ${
|
|
21171
|
+
this.logger[log](`${msg}: option ${key3}. ${checkOpts[opt]}`);
|
|
21172
21172
|
}
|
|
21173
21173
|
}
|
|
21174
21174
|
function getSchEnv(keyRef) {
|
|
@@ -21182,8 +21182,8 @@ var require_core = __commonJS({
|
|
|
21182
21182
|
if (Array.isArray(optsSchemas))
|
|
21183
21183
|
this.addSchema(optsSchemas);
|
|
21184
21184
|
else
|
|
21185
|
-
for (const
|
|
21186
|
-
this.addSchema(optsSchemas[
|
|
21185
|
+
for (const key3 in optsSchemas)
|
|
21186
|
+
this.addSchema(optsSchemas[key3], key3);
|
|
21187
21187
|
}
|
|
21188
21188
|
function addInitialFormats() {
|
|
21189
21189
|
for (const name in this.opts.formats) {
|
|
@@ -22231,11 +22231,11 @@ var require_dependencies = __commonJS({
|
|
|
22231
22231
|
function splitDependencies({ schema: schema8 }) {
|
|
22232
22232
|
const propertyDeps = {};
|
|
22233
22233
|
const schemaDeps = {};
|
|
22234
|
-
for (const
|
|
22235
|
-
if (
|
|
22234
|
+
for (const key3 in schema8) {
|
|
22235
|
+
if (key3 === "__proto__")
|
|
22236
22236
|
continue;
|
|
22237
|
-
const deps = Array.isArray(schema8[
|
|
22238
|
-
deps[
|
|
22237
|
+
const deps = Array.isArray(schema8[key3]) ? propertyDeps : schemaDeps;
|
|
22238
|
+
deps[key3] = schema8[key3];
|
|
22239
22239
|
}
|
|
22240
22240
|
return [propertyDeps, schemaDeps];
|
|
22241
22241
|
}
|
|
@@ -22312,13 +22312,13 @@ var require_propertyNames = __commonJS({
|
|
|
22312
22312
|
if ((0, util_1.alwaysValidSchema)(it, schema8))
|
|
22313
22313
|
return;
|
|
22314
22314
|
const valid = gen.name("valid");
|
|
22315
|
-
gen.forIn("key", data, (
|
|
22316
|
-
cxt.setParams({ propertyName:
|
|
22315
|
+
gen.forIn("key", data, (key3) => {
|
|
22316
|
+
cxt.setParams({ propertyName: key3 });
|
|
22317
22317
|
cxt.subschema({
|
|
22318
22318
|
keyword: "propertyNames",
|
|
22319
|
-
data:
|
|
22319
|
+
data: key3,
|
|
22320
22320
|
dataTypes: ["string"],
|
|
22321
|
-
propertyName:
|
|
22321
|
+
propertyName: key3,
|
|
22322
22322
|
compositeRule: true
|
|
22323
22323
|
}, valid);
|
|
22324
22324
|
gen.if((0, codegen_1.not)(valid), () => {
|
|
@@ -22367,38 +22367,38 @@ var require_additionalProperties = __commonJS({
|
|
|
22367
22367
|
checkAdditionalProperties();
|
|
22368
22368
|
cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
|
|
22369
22369
|
function checkAdditionalProperties() {
|
|
22370
|
-
gen.forIn("key", data, (
|
|
22370
|
+
gen.forIn("key", data, (key3) => {
|
|
22371
22371
|
if (!props.length && !patProps.length)
|
|
22372
|
-
additionalPropertyCode(
|
|
22372
|
+
additionalPropertyCode(key3);
|
|
22373
22373
|
else
|
|
22374
|
-
gen.if(isAdditional(
|
|
22374
|
+
gen.if(isAdditional(key3), () => additionalPropertyCode(key3));
|
|
22375
22375
|
});
|
|
22376
22376
|
}
|
|
22377
|
-
function isAdditional(
|
|
22377
|
+
function isAdditional(key3) {
|
|
22378
22378
|
let definedProp;
|
|
22379
22379
|
if (props.length > 8) {
|
|
22380
22380
|
const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
|
|
22381
|
-
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema,
|
|
22381
|
+
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key3);
|
|
22382
22382
|
} else if (props.length) {
|
|
22383
|
-
definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${
|
|
22383
|
+
definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key3} === ${p}`));
|
|
22384
22384
|
} else {
|
|
22385
22385
|
definedProp = codegen_1.nil;
|
|
22386
22386
|
}
|
|
22387
22387
|
if (patProps.length) {
|
|
22388
|
-
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${
|
|
22388
|
+
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key3})`));
|
|
22389
22389
|
}
|
|
22390
22390
|
return (0, codegen_1.not)(definedProp);
|
|
22391
22391
|
}
|
|
22392
|
-
function deleteAdditional(
|
|
22393
|
-
gen.code((0, codegen_1._)`delete ${data}[${
|
|
22392
|
+
function deleteAdditional(key3) {
|
|
22393
|
+
gen.code((0, codegen_1._)`delete ${data}[${key3}]`);
|
|
22394
22394
|
}
|
|
22395
|
-
function additionalPropertyCode(
|
|
22395
|
+
function additionalPropertyCode(key3) {
|
|
22396
22396
|
if (opts.removeAdditional === "all" || opts.removeAdditional && schema8 === false) {
|
|
22397
|
-
deleteAdditional(
|
|
22397
|
+
deleteAdditional(key3);
|
|
22398
22398
|
return;
|
|
22399
22399
|
}
|
|
22400
22400
|
if (schema8 === false) {
|
|
22401
|
-
cxt.setParams({ additionalProperty:
|
|
22401
|
+
cxt.setParams({ additionalProperty: key3 });
|
|
22402
22402
|
cxt.error();
|
|
22403
22403
|
if (!allErrors)
|
|
22404
22404
|
gen.break();
|
|
@@ -22407,22 +22407,22 @@ var require_additionalProperties = __commonJS({
|
|
|
22407
22407
|
if (typeof schema8 == "object" && !(0, util_1.alwaysValidSchema)(it, schema8)) {
|
|
22408
22408
|
const valid = gen.name("valid");
|
|
22409
22409
|
if (opts.removeAdditional === "failing") {
|
|
22410
|
-
applyAdditionalSchema(
|
|
22410
|
+
applyAdditionalSchema(key3, valid, false);
|
|
22411
22411
|
gen.if((0, codegen_1.not)(valid), () => {
|
|
22412
22412
|
cxt.reset();
|
|
22413
|
-
deleteAdditional(
|
|
22413
|
+
deleteAdditional(key3);
|
|
22414
22414
|
});
|
|
22415
22415
|
} else {
|
|
22416
|
-
applyAdditionalSchema(
|
|
22416
|
+
applyAdditionalSchema(key3, valid);
|
|
22417
22417
|
if (!allErrors)
|
|
22418
22418
|
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
22419
22419
|
}
|
|
22420
22420
|
}
|
|
22421
22421
|
}
|
|
22422
|
-
function applyAdditionalSchema(
|
|
22422
|
+
function applyAdditionalSchema(key3, valid, errors) {
|
|
22423
22423
|
const subschema = {
|
|
22424
22424
|
keyword: "additionalProperties",
|
|
22425
|
-
dataProp:
|
|
22425
|
+
dataProp: key3,
|
|
22426
22426
|
dataPropType: util_1.Type.Str
|
|
22427
22427
|
};
|
|
22428
22428
|
if (errors === false) {
|
|
@@ -22547,19 +22547,19 @@ var require_patternProperties = __commonJS({
|
|
|
22547
22547
|
}
|
|
22548
22548
|
}
|
|
22549
22549
|
function validateProperties(pat) {
|
|
22550
|
-
gen.forIn("key", data, (
|
|
22551
|
-
gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${
|
|
22550
|
+
gen.forIn("key", data, (key3) => {
|
|
22551
|
+
gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key3})`, () => {
|
|
22552
22552
|
const alwaysValid = alwaysValidPatterns.includes(pat);
|
|
22553
22553
|
if (!alwaysValid) {
|
|
22554
22554
|
cxt.subschema({
|
|
22555
22555
|
keyword: "patternProperties",
|
|
22556
22556
|
schemaProp: pat,
|
|
22557
|
-
dataProp:
|
|
22557
|
+
dataProp: key3,
|
|
22558
22558
|
dataPropType: util_2.Type.Str
|
|
22559
22559
|
}, valid);
|
|
22560
22560
|
}
|
|
22561
22561
|
if (it.opts.unevaluated && props !== true) {
|
|
22562
|
-
gen.assign((0, codegen_1._)`${props}[${
|
|
22562
|
+
gen.assign((0, codegen_1._)`${props}[${key3}]`, true);
|
|
22563
22563
|
} else if (!alwaysValid && !it.allErrors) {
|
|
22564
22564
|
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
22565
22565
|
}
|
|
@@ -23883,7 +23883,7 @@ var require_path_key = __commonJS({
|
|
|
23883
23883
|
if (platform !== "win32") {
|
|
23884
23884
|
return "PATH";
|
|
23885
23885
|
}
|
|
23886
|
-
return Object.keys(environment).reverse().find((
|
|
23886
|
+
return Object.keys(environment).reverse().find((key3) => key3.toUpperCase() === "PATH") || "Path";
|
|
23887
23887
|
};
|
|
23888
23888
|
module2.exports = pathKey;
|
|
23889
23889
|
module2.exports.default = pathKey;
|
|
@@ -24196,7 +24196,7 @@ var require_content_type = __commonJS({
|
|
|
24196
24196
|
}
|
|
24197
24197
|
var obj = new ContentType(type.toLowerCase());
|
|
24198
24198
|
if (index !== -1) {
|
|
24199
|
-
var
|
|
24199
|
+
var key3;
|
|
24200
24200
|
var match;
|
|
24201
24201
|
var value;
|
|
24202
24202
|
PARAM_REGEXP.lastIndex = index;
|
|
@@ -24205,7 +24205,7 @@ var require_content_type = __commonJS({
|
|
|
24205
24205
|
throw new TypeError("invalid parameter format");
|
|
24206
24206
|
}
|
|
24207
24207
|
index += match[0].length;
|
|
24208
|
-
|
|
24208
|
+
key3 = match[1].toLowerCase();
|
|
24209
24209
|
value = match[2];
|
|
24210
24210
|
if (value.charCodeAt(0) === 34) {
|
|
24211
24211
|
value = value.slice(1, -1);
|
|
@@ -24213,7 +24213,7 @@ var require_content_type = __commonJS({
|
|
|
24213
24213
|
value = value.replace(QESC_REGEXP, "$1");
|
|
24214
24214
|
}
|
|
24215
24215
|
}
|
|
24216
|
-
obj.parameters[
|
|
24216
|
+
obj.parameters[key3] = value;
|
|
24217
24217
|
}
|
|
24218
24218
|
if (index !== header2.length) {
|
|
24219
24219
|
throw new TypeError("invalid parameter format");
|
|
@@ -24457,8 +24457,8 @@ var FetchHttpClient = class {
|
|
|
24457
24457
|
const choice = proxyForUrl(target, env2);
|
|
24458
24458
|
if (choice === void 0)
|
|
24459
24459
|
return void 0;
|
|
24460
|
-
const
|
|
24461
|
-
const existing = this.proxyAgents.get(
|
|
24460
|
+
const key3 = `${choice.uri}|${choice.token === void 0 ? "" : (0, import_node_crypto.createHash)("sha256").update(choice.token).digest("hex")}|${tls2 === void 0 ? "none" : tlsKey(tls2)}`;
|
|
24461
|
+
const existing = this.proxyAgents.get(key3);
|
|
24462
24462
|
if (existing !== void 0)
|
|
24463
24463
|
return existing;
|
|
24464
24464
|
const agent = new import_undici.ProxyAgent({
|
|
@@ -24471,12 +24471,12 @@ var FetchHttpClient = class {
|
|
|
24471
24471
|
autoSelectFamily: true
|
|
24472
24472
|
}
|
|
24473
24473
|
});
|
|
24474
|
-
this.proxyAgents.set(
|
|
24474
|
+
this.proxyAgents.set(key3, agent);
|
|
24475
24475
|
return agent;
|
|
24476
24476
|
}
|
|
24477
24477
|
agentFor(tls2) {
|
|
24478
|
-
const
|
|
24479
|
-
const existing = this.agents.get(
|
|
24478
|
+
const key3 = tlsKey(tls2);
|
|
24479
|
+
const existing = this.agents.get(key3);
|
|
24480
24480
|
if (existing !== void 0)
|
|
24481
24481
|
return existing;
|
|
24482
24482
|
const agent = new import_undici.Agent({
|
|
@@ -24487,7 +24487,7 @@ var FetchHttpClient = class {
|
|
|
24487
24487
|
autoSelectFamily: true
|
|
24488
24488
|
}
|
|
24489
24489
|
});
|
|
24490
|
-
this.agents.set(
|
|
24490
|
+
this.agents.set(key3, agent);
|
|
24491
24491
|
return agent;
|
|
24492
24492
|
}
|
|
24493
24493
|
/** Drops pooled agents so the next request rebuilds TLS — call when certs change on disk. */
|
|
@@ -25377,9 +25377,9 @@ function floatSafeRemainder(val, step) {
|
|
|
25377
25377
|
return ratio - roundedRatio;
|
|
25378
25378
|
}
|
|
25379
25379
|
var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
|
|
25380
|
-
function defineLazy(object3,
|
|
25380
|
+
function defineLazy(object3, key3, getter) {
|
|
25381
25381
|
let value = void 0;
|
|
25382
|
-
Object.defineProperty(object3,
|
|
25382
|
+
Object.defineProperty(object3, key3, {
|
|
25383
25383
|
get() {
|
|
25384
25384
|
if (value === EVALUATING) {
|
|
25385
25385
|
return void 0;
|
|
@@ -25391,7 +25391,7 @@ function defineLazy(object3, key2, getter) {
|
|
|
25391
25391
|
return value;
|
|
25392
25392
|
},
|
|
25393
25393
|
set(v) {
|
|
25394
|
-
Object.defineProperty(object3,
|
|
25394
|
+
Object.defineProperty(object3, key3, {
|
|
25395
25395
|
value: v
|
|
25396
25396
|
// configurable: true,
|
|
25397
25397
|
});
|
|
@@ -25424,11 +25424,11 @@ function cloneDef(schema8) {
|
|
|
25424
25424
|
function getElementAtPath(obj, path63) {
|
|
25425
25425
|
if (!path63)
|
|
25426
25426
|
return obj;
|
|
25427
|
-
return path63.reduce((acc,
|
|
25427
|
+
return path63.reduce((acc, key3) => acc?.[key3], obj);
|
|
25428
25428
|
}
|
|
25429
25429
|
function promiseAllObject(promisesObj) {
|
|
25430
25430
|
const keys = Object.keys(promisesObj);
|
|
25431
|
-
const promises = keys.map((
|
|
25431
|
+
const promises = keys.map((key3) => promisesObj[key3]);
|
|
25432
25432
|
return Promise.all(promises).then((results) => {
|
|
25433
25433
|
const resolvedObj = {};
|
|
25434
25434
|
for (let i = 0; i < keys.length; i++) {
|
|
@@ -25500,8 +25500,8 @@ function shallowClone(o) {
|
|
|
25500
25500
|
}
|
|
25501
25501
|
function numKeys(data) {
|
|
25502
25502
|
let keyCount = 0;
|
|
25503
|
-
for (const
|
|
25504
|
-
if (Object.prototype.hasOwnProperty.call(data,
|
|
25503
|
+
for (const key3 in data) {
|
|
25504
|
+
if (Object.prototype.hasOwnProperty.call(data, key3)) {
|
|
25505
25505
|
keyCount++;
|
|
25506
25506
|
}
|
|
25507
25507
|
}
|
|
@@ -25651,13 +25651,13 @@ function pick(schema8, mask) {
|
|
|
25651
25651
|
const def = mergeDefs(schema8._zod.def, {
|
|
25652
25652
|
get shape() {
|
|
25653
25653
|
const newShape = {};
|
|
25654
|
-
for (const
|
|
25655
|
-
if (!(
|
|
25656
|
-
throw new Error(`Unrecognized key: "${
|
|
25654
|
+
for (const key3 in mask) {
|
|
25655
|
+
if (!(key3 in currDef.shape)) {
|
|
25656
|
+
throw new Error(`Unrecognized key: "${key3}"`);
|
|
25657
25657
|
}
|
|
25658
|
-
if (!mask[
|
|
25658
|
+
if (!mask[key3])
|
|
25659
25659
|
continue;
|
|
25660
|
-
newShape[
|
|
25660
|
+
newShape[key3] = currDef.shape[key3];
|
|
25661
25661
|
}
|
|
25662
25662
|
assignProp(this, "shape", newShape);
|
|
25663
25663
|
return newShape;
|
|
@@ -25676,13 +25676,13 @@ function omit(schema8, mask) {
|
|
|
25676
25676
|
const def = mergeDefs(schema8._zod.def, {
|
|
25677
25677
|
get shape() {
|
|
25678
25678
|
const newShape = { ...schema8._zod.def.shape };
|
|
25679
|
-
for (const
|
|
25680
|
-
if (!(
|
|
25681
|
-
throw new Error(`Unrecognized key: "${
|
|
25679
|
+
for (const key3 in mask) {
|
|
25680
|
+
if (!(key3 in currDef.shape)) {
|
|
25681
|
+
throw new Error(`Unrecognized key: "${key3}"`);
|
|
25682
25682
|
}
|
|
25683
|
-
if (!mask[
|
|
25683
|
+
if (!mask[key3])
|
|
25684
25684
|
continue;
|
|
25685
|
-
delete newShape[
|
|
25685
|
+
delete newShape[key3];
|
|
25686
25686
|
}
|
|
25687
25687
|
assignProp(this, "shape", newShape);
|
|
25688
25688
|
return newShape;
|
|
@@ -25699,8 +25699,8 @@ function extend(schema8, shape) {
|
|
|
25699
25699
|
const hasChecks = checks && checks.length > 0;
|
|
25700
25700
|
if (hasChecks) {
|
|
25701
25701
|
const existingShape = schema8._zod.def.shape;
|
|
25702
|
-
for (const
|
|
25703
|
-
if (Object.getOwnPropertyDescriptor(existingShape,
|
|
25702
|
+
for (const key3 in shape) {
|
|
25703
|
+
if (Object.getOwnPropertyDescriptor(existingShape, key3) !== void 0) {
|
|
25704
25704
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
25705
25705
|
}
|
|
25706
25706
|
}
|
|
@@ -25756,23 +25756,23 @@ function partial(Class2, schema8, mask) {
|
|
|
25756
25756
|
const oldShape = schema8._zod.def.shape;
|
|
25757
25757
|
const shape = { ...oldShape };
|
|
25758
25758
|
if (mask) {
|
|
25759
|
-
for (const
|
|
25760
|
-
if (!(
|
|
25761
|
-
throw new Error(`Unrecognized key: "${
|
|
25759
|
+
for (const key3 in mask) {
|
|
25760
|
+
if (!(key3 in oldShape)) {
|
|
25761
|
+
throw new Error(`Unrecognized key: "${key3}"`);
|
|
25762
25762
|
}
|
|
25763
|
-
if (!mask[
|
|
25763
|
+
if (!mask[key3])
|
|
25764
25764
|
continue;
|
|
25765
|
-
shape[
|
|
25765
|
+
shape[key3] = Class2 ? new Class2({
|
|
25766
25766
|
type: "optional",
|
|
25767
|
-
innerType: oldShape[
|
|
25768
|
-
}) : oldShape[
|
|
25767
|
+
innerType: oldShape[key3]
|
|
25768
|
+
}) : oldShape[key3];
|
|
25769
25769
|
}
|
|
25770
25770
|
} else {
|
|
25771
|
-
for (const
|
|
25772
|
-
shape[
|
|
25771
|
+
for (const key3 in oldShape) {
|
|
25772
|
+
shape[key3] = Class2 ? new Class2({
|
|
25773
25773
|
type: "optional",
|
|
25774
|
-
innerType: oldShape[
|
|
25775
|
-
}) : oldShape[
|
|
25774
|
+
innerType: oldShape[key3]
|
|
25775
|
+
}) : oldShape[key3];
|
|
25776
25776
|
}
|
|
25777
25777
|
}
|
|
25778
25778
|
assignProp(this, "shape", shape);
|
|
@@ -25788,22 +25788,22 @@ function required(Class2, schema8, mask) {
|
|
|
25788
25788
|
const oldShape = schema8._zod.def.shape;
|
|
25789
25789
|
const shape = { ...oldShape };
|
|
25790
25790
|
if (mask) {
|
|
25791
|
-
for (const
|
|
25792
|
-
if (!(
|
|
25793
|
-
throw new Error(`Unrecognized key: "${
|
|
25791
|
+
for (const key3 in mask) {
|
|
25792
|
+
if (!(key3 in shape)) {
|
|
25793
|
+
throw new Error(`Unrecognized key: "${key3}"`);
|
|
25794
25794
|
}
|
|
25795
|
-
if (!mask[
|
|
25795
|
+
if (!mask[key3])
|
|
25796
25796
|
continue;
|
|
25797
|
-
shape[
|
|
25797
|
+
shape[key3] = new Class2({
|
|
25798
25798
|
type: "nonoptional",
|
|
25799
|
-
innerType: oldShape[
|
|
25799
|
+
innerType: oldShape[key3]
|
|
25800
25800
|
});
|
|
25801
25801
|
}
|
|
25802
25802
|
} else {
|
|
25803
|
-
for (const
|
|
25804
|
-
shape[
|
|
25803
|
+
for (const key3 in oldShape) {
|
|
25804
|
+
shape[key3] = new Class2({
|
|
25805
25805
|
type: "nonoptional",
|
|
25806
|
-
innerType: oldShape[
|
|
25806
|
+
innerType: oldShape[key3]
|
|
25807
25807
|
});
|
|
25808
25808
|
}
|
|
25809
25809
|
}
|
|
@@ -27584,13 +27584,13 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
27584
27584
|
return payload;
|
|
27585
27585
|
};
|
|
27586
27586
|
});
|
|
27587
|
-
function handlePropertyResult(result, final,
|
|
27588
|
-
const isPresent =
|
|
27587
|
+
function handlePropertyResult(result, final, key3, input, isOptionalIn, isOptionalOut) {
|
|
27588
|
+
const isPresent = key3 in input;
|
|
27589
27589
|
if (result.issues.length) {
|
|
27590
27590
|
if (isOptionalIn && isOptionalOut && !isPresent) {
|
|
27591
27591
|
return;
|
|
27592
27592
|
}
|
|
27593
|
-
final.issues.push(...prefixIssues(
|
|
27593
|
+
final.issues.push(...prefixIssues(key3, result.issues));
|
|
27594
27594
|
}
|
|
27595
27595
|
if (!isPresent && !isOptionalIn) {
|
|
27596
27596
|
if (!result.issues.length) {
|
|
@@ -27598,17 +27598,17 @@ function handlePropertyResult(result, final, key2, input, isOptionalIn, isOption
|
|
|
27598
27598
|
code: "invalid_type",
|
|
27599
27599
|
expected: "nonoptional",
|
|
27600
27600
|
input: void 0,
|
|
27601
|
-
path: [
|
|
27601
|
+
path: [key3]
|
|
27602
27602
|
});
|
|
27603
27603
|
}
|
|
27604
27604
|
return;
|
|
27605
27605
|
}
|
|
27606
27606
|
if (result.value === void 0) {
|
|
27607
27607
|
if (isPresent) {
|
|
27608
|
-
final.value[
|
|
27608
|
+
final.value[key3] = void 0;
|
|
27609
27609
|
}
|
|
27610
27610
|
} else {
|
|
27611
|
-
final.value[
|
|
27611
|
+
final.value[key3] = result.value;
|
|
27612
27612
|
}
|
|
27613
27613
|
}
|
|
27614
27614
|
function normalizeDef(def) {
|
|
@@ -27634,20 +27634,20 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
27634
27634
|
const t = _catchall.def.type;
|
|
27635
27635
|
const isOptionalIn = _catchall.optin === "optional";
|
|
27636
27636
|
const isOptionalOut = _catchall.optout === "optional";
|
|
27637
|
-
for (const
|
|
27638
|
-
if (
|
|
27637
|
+
for (const key3 in input) {
|
|
27638
|
+
if (key3 === "__proto__")
|
|
27639
27639
|
continue;
|
|
27640
|
-
if (keySet.has(
|
|
27640
|
+
if (keySet.has(key3))
|
|
27641
27641
|
continue;
|
|
27642
27642
|
if (t === "never") {
|
|
27643
|
-
unrecognized.push(
|
|
27643
|
+
unrecognized.push(key3);
|
|
27644
27644
|
continue;
|
|
27645
27645
|
}
|
|
27646
|
-
const r = _catchall.run({ value: input[
|
|
27646
|
+
const r = _catchall.run({ value: input[key3], issues: [] }, ctx);
|
|
27647
27647
|
if (r instanceof Promise) {
|
|
27648
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload,
|
|
27648
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key3, input, isOptionalIn, isOptionalOut)));
|
|
27649
27649
|
} else {
|
|
27650
|
-
handlePropertyResult(r, payload,
|
|
27650
|
+
handlePropertyResult(r, payload, key3, input, isOptionalIn, isOptionalOut);
|
|
27651
27651
|
}
|
|
27652
27652
|
}
|
|
27653
27653
|
if (unrecognized.length) {
|
|
@@ -27683,12 +27683,12 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
27683
27683
|
defineLazy(inst._zod, "propValues", () => {
|
|
27684
27684
|
const shape = def.shape;
|
|
27685
27685
|
const propValues = {};
|
|
27686
|
-
for (const
|
|
27687
|
-
const field2 = shape[
|
|
27686
|
+
for (const key3 in shape) {
|
|
27687
|
+
const field2 = shape[key3]._zod;
|
|
27688
27688
|
if (field2.values) {
|
|
27689
|
-
propValues[
|
|
27689
|
+
propValues[key3] ?? (propValues[key3] = /* @__PURE__ */ new Set());
|
|
27690
27690
|
for (const v of field2.values)
|
|
27691
|
-
propValues[
|
|
27691
|
+
propValues[key3].add(v);
|
|
27692
27692
|
}
|
|
27693
27693
|
}
|
|
27694
27694
|
return propValues;
|
|
@@ -27711,15 +27711,15 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
27711
27711
|
payload.value = {};
|
|
27712
27712
|
const proms = [];
|
|
27713
27713
|
const shape = value.shape;
|
|
27714
|
-
for (const
|
|
27715
|
-
const el = shape[
|
|
27714
|
+
for (const key3 of value.keys) {
|
|
27715
|
+
const el = shape[key3];
|
|
27716
27716
|
const isOptionalIn = el._zod.optin === "optional";
|
|
27717
27717
|
const isOptionalOut = el._zod.optout === "optional";
|
|
27718
|
-
const r = el._zod.run({ value: input[
|
|
27718
|
+
const r = el._zod.run({ value: input[key3], issues: [] }, ctx);
|
|
27719
27719
|
if (r instanceof Promise) {
|
|
27720
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload,
|
|
27720
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key3, input, isOptionalIn, isOptionalOut)));
|
|
27721
27721
|
} else {
|
|
27722
|
-
handlePropertyResult(r, payload,
|
|
27722
|
+
handlePropertyResult(r, payload, key3, input, isOptionalIn, isOptionalOut);
|
|
27723
27723
|
}
|
|
27724
27724
|
}
|
|
27725
27725
|
if (!catchall) {
|
|
@@ -27735,24 +27735,24 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
27735
27735
|
const generateFastpass = (shape) => {
|
|
27736
27736
|
const doc = new Doc(["shape", "payload", "ctx"]);
|
|
27737
27737
|
const normalized = _normalized.value;
|
|
27738
|
-
const parseStr = (
|
|
27739
|
-
const k = esc(
|
|
27738
|
+
const parseStr = (key3) => {
|
|
27739
|
+
const k = esc(key3);
|
|
27740
27740
|
return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
27741
27741
|
};
|
|
27742
27742
|
doc.write(`const input = payload.value;`);
|
|
27743
27743
|
const ids = /* @__PURE__ */ Object.create(null);
|
|
27744
27744
|
let counter = 0;
|
|
27745
|
-
for (const
|
|
27746
|
-
ids[
|
|
27745
|
+
for (const key3 of normalized.keys) {
|
|
27746
|
+
ids[key3] = `key_${counter++}`;
|
|
27747
27747
|
}
|
|
27748
27748
|
doc.write(`const newResult = {};`);
|
|
27749
|
-
for (const
|
|
27750
|
-
const id = ids[
|
|
27751
|
-
const k = esc(
|
|
27752
|
-
const schema8 = shape[
|
|
27749
|
+
for (const key3 of normalized.keys) {
|
|
27750
|
+
const id = ids[key3];
|
|
27751
|
+
const k = esc(key3);
|
|
27752
|
+
const schema8 = shape[key3];
|
|
27753
27753
|
const isOptionalIn = schema8?._zod?.optin === "optional";
|
|
27754
27754
|
const isOptionalOut = schema8?._zod?.optout === "optional";
|
|
27755
|
-
doc.write(`const ${id} = ${parseStr(
|
|
27755
|
+
doc.write(`const ${id} = ${parseStr(key3)};`);
|
|
27756
27756
|
if (isOptionalIn && isOptionalOut) {
|
|
27757
27757
|
doc.write(`
|
|
27758
27758
|
if (${id}.issues.length) {
|
|
@@ -28064,17 +28064,17 @@ function mergeValues(a, b) {
|
|
|
28064
28064
|
}
|
|
28065
28065
|
if (isPlainObject(a) && isPlainObject(b)) {
|
|
28066
28066
|
const bKeys = Object.keys(b);
|
|
28067
|
-
const sharedKeys = Object.keys(a).filter((
|
|
28067
|
+
const sharedKeys = Object.keys(a).filter((key3) => bKeys.indexOf(key3) !== -1);
|
|
28068
28068
|
const newObj = { ...a, ...b };
|
|
28069
|
-
for (const
|
|
28070
|
-
const sharedValue = mergeValues(a[
|
|
28069
|
+
for (const key3 of sharedKeys) {
|
|
28070
|
+
const sharedValue = mergeValues(a[key3], b[key3]);
|
|
28071
28071
|
if (!sharedValue.valid) {
|
|
28072
28072
|
return {
|
|
28073
28073
|
valid: false,
|
|
28074
|
-
mergeErrorPath: [
|
|
28074
|
+
mergeErrorPath: [key3, ...sharedValue.mergeErrorPath]
|
|
28075
28075
|
};
|
|
28076
28076
|
}
|
|
28077
|
-
newObj[
|
|
28077
|
+
newObj[key3] = sharedValue.data;
|
|
28078
28078
|
}
|
|
28079
28079
|
return { valid: true, data: newObj };
|
|
28080
28080
|
}
|
|
@@ -28209,9 +28209,9 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
28209
28209
|
return handleTupleResults(itemResults, payload, items, input, optoutStart);
|
|
28210
28210
|
};
|
|
28211
28211
|
});
|
|
28212
|
-
function getTupleOptStart(items,
|
|
28212
|
+
function getTupleOptStart(items, key3) {
|
|
28213
28213
|
for (let i = items.length - 1; i >= 0; i--) {
|
|
28214
|
-
if (items[i]._zod[
|
|
28214
|
+
if (items[i]._zod[key3] !== "optional")
|
|
28215
28215
|
return i + 1;
|
|
28216
28216
|
}
|
|
28217
28217
|
return 0;
|
|
@@ -28262,10 +28262,10 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
28262
28262
|
if (values) {
|
|
28263
28263
|
payload.value = {};
|
|
28264
28264
|
const recordKeys = /* @__PURE__ */ new Set();
|
|
28265
|
-
for (const
|
|
28266
|
-
if (typeof
|
|
28267
|
-
recordKeys.add(typeof
|
|
28268
|
-
const keyResult = def.keyType._zod.run({ value:
|
|
28265
|
+
for (const key3 of values) {
|
|
28266
|
+
if (typeof key3 === "string" || typeof key3 === "number" || typeof key3 === "symbol") {
|
|
28267
|
+
recordKeys.add(typeof key3 === "number" ? key3.toString() : key3);
|
|
28268
|
+
const keyResult = def.keyType._zod.run({ value: key3, issues: [] }, ctx);
|
|
28269
28269
|
if (keyResult instanceof Promise) {
|
|
28270
28270
|
throw new Error("Async schemas not supported in object keys currently");
|
|
28271
28271
|
}
|
|
@@ -28274,34 +28274,34 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
28274
28274
|
code: "invalid_key",
|
|
28275
28275
|
origin: "record",
|
|
28276
28276
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
28277
|
-
input:
|
|
28278
|
-
path: [
|
|
28277
|
+
input: key3,
|
|
28278
|
+
path: [key3],
|
|
28279
28279
|
inst
|
|
28280
28280
|
});
|
|
28281
28281
|
continue;
|
|
28282
28282
|
}
|
|
28283
28283
|
const outKey = keyResult.value;
|
|
28284
|
-
const result = def.valueType._zod.run({ value: input[
|
|
28284
|
+
const result = def.valueType._zod.run({ value: input[key3], issues: [] }, ctx);
|
|
28285
28285
|
if (result instanceof Promise) {
|
|
28286
28286
|
proms.push(result.then((result2) => {
|
|
28287
28287
|
if (result2.issues.length) {
|
|
28288
|
-
payload.issues.push(...prefixIssues(
|
|
28288
|
+
payload.issues.push(...prefixIssues(key3, result2.issues));
|
|
28289
28289
|
}
|
|
28290
28290
|
payload.value[outKey] = result2.value;
|
|
28291
28291
|
}));
|
|
28292
28292
|
} else {
|
|
28293
28293
|
if (result.issues.length) {
|
|
28294
|
-
payload.issues.push(...prefixIssues(
|
|
28294
|
+
payload.issues.push(...prefixIssues(key3, result.issues));
|
|
28295
28295
|
}
|
|
28296
28296
|
payload.value[outKey] = result.value;
|
|
28297
28297
|
}
|
|
28298
28298
|
}
|
|
28299
28299
|
}
|
|
28300
28300
|
let unrecognized;
|
|
28301
|
-
for (const
|
|
28302
|
-
if (!recordKeys.has(
|
|
28301
|
+
for (const key3 in input) {
|
|
28302
|
+
if (!recordKeys.has(key3)) {
|
|
28303
28303
|
unrecognized = unrecognized ?? [];
|
|
28304
|
-
unrecognized.push(
|
|
28304
|
+
unrecognized.push(key3);
|
|
28305
28305
|
}
|
|
28306
28306
|
}
|
|
28307
28307
|
if (unrecognized && unrecognized.length > 0) {
|
|
@@ -28314,18 +28314,18 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
28314
28314
|
}
|
|
28315
28315
|
} else {
|
|
28316
28316
|
payload.value = {};
|
|
28317
|
-
for (const
|
|
28318
|
-
if (
|
|
28317
|
+
for (const key3 of Reflect.ownKeys(input)) {
|
|
28318
|
+
if (key3 === "__proto__")
|
|
28319
28319
|
continue;
|
|
28320
|
-
if (!Object.prototype.propertyIsEnumerable.call(input,
|
|
28320
|
+
if (!Object.prototype.propertyIsEnumerable.call(input, key3))
|
|
28321
28321
|
continue;
|
|
28322
|
-
let keyResult = def.keyType._zod.run({ value:
|
|
28322
|
+
let keyResult = def.keyType._zod.run({ value: key3, issues: [] }, ctx);
|
|
28323
28323
|
if (keyResult instanceof Promise) {
|
|
28324
28324
|
throw new Error("Async schemas not supported in object keys currently");
|
|
28325
28325
|
}
|
|
28326
|
-
const checkNumericKey = typeof
|
|
28326
|
+
const checkNumericKey = typeof key3 === "string" && number.test(key3) && keyResult.issues.length;
|
|
28327
28327
|
if (checkNumericKey) {
|
|
28328
|
-
const retryResult = def.keyType._zod.run({ value: Number(
|
|
28328
|
+
const retryResult = def.keyType._zod.run({ value: Number(key3), issues: [] }, ctx);
|
|
28329
28329
|
if (retryResult instanceof Promise) {
|
|
28330
28330
|
throw new Error("Async schemas not supported in object keys currently");
|
|
28331
28331
|
}
|
|
@@ -28335,30 +28335,30 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
28335
28335
|
}
|
|
28336
28336
|
if (keyResult.issues.length) {
|
|
28337
28337
|
if (def.mode === "loose") {
|
|
28338
|
-
payload.value[
|
|
28338
|
+
payload.value[key3] = input[key3];
|
|
28339
28339
|
} else {
|
|
28340
28340
|
payload.issues.push({
|
|
28341
28341
|
code: "invalid_key",
|
|
28342
28342
|
origin: "record",
|
|
28343
28343
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
28344
|
-
input:
|
|
28345
|
-
path: [
|
|
28344
|
+
input: key3,
|
|
28345
|
+
path: [key3],
|
|
28346
28346
|
inst
|
|
28347
28347
|
});
|
|
28348
28348
|
}
|
|
28349
28349
|
continue;
|
|
28350
28350
|
}
|
|
28351
|
-
const result = def.valueType._zod.run({ value: input[
|
|
28351
|
+
const result = def.valueType._zod.run({ value: input[key3], issues: [] }, ctx);
|
|
28352
28352
|
if (result instanceof Promise) {
|
|
28353
28353
|
proms.push(result.then((result2) => {
|
|
28354
28354
|
if (result2.issues.length) {
|
|
28355
|
-
payload.issues.push(...prefixIssues(
|
|
28355
|
+
payload.issues.push(...prefixIssues(key3, result2.issues));
|
|
28356
28356
|
}
|
|
28357
28357
|
payload.value[keyResult.value] = result2.value;
|
|
28358
28358
|
}));
|
|
28359
28359
|
} else {
|
|
28360
28360
|
if (result.issues.length) {
|
|
28361
|
-
payload.issues.push(...prefixIssues(
|
|
28361
|
+
payload.issues.push(...prefixIssues(key3, result.issues));
|
|
28362
28362
|
}
|
|
28363
28363
|
payload.value[keyResult.value] = result.value;
|
|
28364
28364
|
}
|
|
@@ -28385,15 +28385,15 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
28385
28385
|
}
|
|
28386
28386
|
const proms = [];
|
|
28387
28387
|
payload.value = /* @__PURE__ */ new Map();
|
|
28388
|
-
for (const [
|
|
28389
|
-
const keyResult = def.keyType._zod.run({ value:
|
|
28388
|
+
for (const [key3, value] of input) {
|
|
28389
|
+
const keyResult = def.keyType._zod.run({ value: key3, issues: [] }, ctx);
|
|
28390
28390
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
28391
28391
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
28392
28392
|
proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
|
|
28393
|
-
handleMapResult(keyResult2, valueResult2, payload,
|
|
28393
|
+
handleMapResult(keyResult2, valueResult2, payload, key3, input, inst, ctx);
|
|
28394
28394
|
}));
|
|
28395
28395
|
} else {
|
|
28396
|
-
handleMapResult(keyResult, valueResult, payload,
|
|
28396
|
+
handleMapResult(keyResult, valueResult, payload, key3, input, inst, ctx);
|
|
28397
28397
|
}
|
|
28398
28398
|
}
|
|
28399
28399
|
if (proms.length)
|
|
@@ -28401,10 +28401,10 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
28401
28401
|
return payload;
|
|
28402
28402
|
};
|
|
28403
28403
|
});
|
|
28404
|
-
function handleMapResult(keyResult, valueResult, final,
|
|
28404
|
+
function handleMapResult(keyResult, valueResult, final, key3, input, inst, ctx) {
|
|
28405
28405
|
if (keyResult.issues.length) {
|
|
28406
|
-
if (propertyKeyTypes.has(typeof
|
|
28407
|
-
final.issues.push(...prefixIssues(
|
|
28406
|
+
if (propertyKeyTypes.has(typeof key3)) {
|
|
28407
|
+
final.issues.push(...prefixIssues(key3, keyResult.issues));
|
|
28408
28408
|
} else {
|
|
28409
28409
|
final.issues.push({
|
|
28410
28410
|
code: "invalid_key",
|
|
@@ -28416,15 +28416,15 @@ function handleMapResult(keyResult, valueResult, final, key2, input, inst, ctx)
|
|
|
28416
28416
|
}
|
|
28417
28417
|
}
|
|
28418
28418
|
if (valueResult.issues.length) {
|
|
28419
|
-
if (propertyKeyTypes.has(typeof
|
|
28420
|
-
final.issues.push(...prefixIssues(
|
|
28419
|
+
if (propertyKeyTypes.has(typeof key3)) {
|
|
28420
|
+
final.issues.push(...prefixIssues(key3, valueResult.issues));
|
|
28421
28421
|
} else {
|
|
28422
28422
|
final.issues.push({
|
|
28423
28423
|
origin: "map",
|
|
28424
28424
|
code: "invalid_element",
|
|
28425
28425
|
input,
|
|
28426
28426
|
inst,
|
|
28427
|
-
key:
|
|
28427
|
+
key: key3,
|
|
28428
28428
|
issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
28429
28429
|
});
|
|
28430
28430
|
}
|
|
@@ -36185,8 +36185,8 @@ function extractDefs(ctx, schema8) {
|
|
|
36185
36185
|
if (defId)
|
|
36186
36186
|
seen.defId = defId;
|
|
36187
36187
|
const schema9 = seen.schema;
|
|
36188
|
-
for (const
|
|
36189
|
-
delete schema9[
|
|
36188
|
+
for (const key3 in schema9) {
|
|
36189
|
+
delete schema9[key3];
|
|
36190
36190
|
}
|
|
36191
36191
|
schema9.$ref = ref;
|
|
36192
36192
|
};
|
|
@@ -36255,20 +36255,20 @@ function finalize(ctx, schema8) {
|
|
|
36255
36255
|
Object.assign(schema9, _cached);
|
|
36256
36256
|
const isParentRef = zodSchema._zod.parent === ref;
|
|
36257
36257
|
if (isParentRef) {
|
|
36258
|
-
for (const
|
|
36259
|
-
if (
|
|
36258
|
+
for (const key3 in schema9) {
|
|
36259
|
+
if (key3 === "$ref" || key3 === "allOf")
|
|
36260
36260
|
continue;
|
|
36261
|
-
if (!(
|
|
36262
|
-
delete schema9[
|
|
36261
|
+
if (!(key3 in _cached)) {
|
|
36262
|
+
delete schema9[key3];
|
|
36263
36263
|
}
|
|
36264
36264
|
}
|
|
36265
36265
|
}
|
|
36266
36266
|
if (refSchema.$ref && refSeen.def) {
|
|
36267
|
-
for (const
|
|
36268
|
-
if (
|
|
36267
|
+
for (const key3 in schema9) {
|
|
36268
|
+
if (key3 === "$ref" || key3 === "allOf")
|
|
36269
36269
|
continue;
|
|
36270
|
-
if (
|
|
36271
|
-
delete schema9[
|
|
36270
|
+
if (key3 in refSeen.def && JSON.stringify(schema9[key3]) === JSON.stringify(refSeen.def[key3])) {
|
|
36271
|
+
delete schema9[key3];
|
|
36272
36272
|
}
|
|
36273
36273
|
}
|
|
36274
36274
|
}
|
|
@@ -36280,11 +36280,11 @@ function finalize(ctx, schema8) {
|
|
|
36280
36280
|
if (parentSeen?.schema.$ref) {
|
|
36281
36281
|
schema9.$ref = parentSeen.schema.$ref;
|
|
36282
36282
|
if (parentSeen.def) {
|
|
36283
|
-
for (const
|
|
36284
|
-
if (
|
|
36283
|
+
for (const key3 in schema9) {
|
|
36284
|
+
if (key3 === "$ref" || key3 === "allOf")
|
|
36285
36285
|
continue;
|
|
36286
|
-
if (
|
|
36287
|
-
delete schema9[
|
|
36286
|
+
if (key3 in parentSeen.def && JSON.stringify(schema9[key3]) === JSON.stringify(parentSeen.def[key3])) {
|
|
36287
|
+
delete schema9[key3];
|
|
36288
36288
|
}
|
|
36289
36289
|
}
|
|
36290
36290
|
}
|
|
@@ -36385,8 +36385,8 @@ function isTransforming(_schema, _ctx) {
|
|
|
36385
36385
|
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
|
|
36386
36386
|
}
|
|
36387
36387
|
if (def.type === "object") {
|
|
36388
|
-
for (const
|
|
36389
|
-
if (isTransforming(def.shape[
|
|
36388
|
+
for (const key3 in def.shape) {
|
|
36389
|
+
if (isTransforming(def.shape[key3], ctx))
|
|
36390
36390
|
return true;
|
|
36391
36391
|
}
|
|
36392
36392
|
return false;
|
|
@@ -36675,15 +36675,15 @@ var objectProcessor = (schema8, ctx, _json, params3) => {
|
|
|
36675
36675
|
json2.type = "object";
|
|
36676
36676
|
json2.properties = {};
|
|
36677
36677
|
const shape = def.shape;
|
|
36678
|
-
for (const
|
|
36679
|
-
json2.properties[
|
|
36678
|
+
for (const key3 in shape) {
|
|
36679
|
+
json2.properties[key3] = process2(shape[key3], ctx, {
|
|
36680
36680
|
...params3,
|
|
36681
|
-
path: [...params3.path, "properties",
|
|
36681
|
+
path: [...params3.path, "properties", key3]
|
|
36682
36682
|
});
|
|
36683
36683
|
}
|
|
36684
36684
|
const allKeys = new Set(Object.keys(shape));
|
|
36685
|
-
const requiredKeys = new Set([...allKeys].filter((
|
|
36686
|
-
const v = def.shape[
|
|
36685
|
+
const requiredKeys = new Set([...allKeys].filter((key3) => {
|
|
36686
|
+
const v = def.shape[key3]._zod;
|
|
36687
36687
|
if (ctx.io === "input") {
|
|
36688
36688
|
return v.optin === void 0;
|
|
36689
36689
|
} else {
|
|
@@ -36949,9 +36949,9 @@ function toJSONSchema(input, params3) {
|
|
|
36949
36949
|
};
|
|
36950
36950
|
ctx2.external = external;
|
|
36951
36951
|
for (const entry of registry2._idmap.entries()) {
|
|
36952
|
-
const [
|
|
36952
|
+
const [key3, schema8] = entry;
|
|
36953
36953
|
extractDefs(ctx2, schema8);
|
|
36954
|
-
schemas[
|
|
36954
|
+
schemas[key3] = finalize(ctx2, schema8);
|
|
36955
36955
|
}
|
|
36956
36956
|
if (Object.keys(defs).length > 0) {
|
|
36957
36957
|
const defsSegment = ctx2.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
@@ -37357,14 +37357,14 @@ function _installLazyMethods(inst, group, methods) {
|
|
|
37357
37357
|
if (installed.has(group))
|
|
37358
37358
|
return;
|
|
37359
37359
|
installed.add(group);
|
|
37360
|
-
for (const
|
|
37361
|
-
const fn = methods[
|
|
37362
|
-
Object.defineProperty(proto,
|
|
37360
|
+
for (const key3 in methods) {
|
|
37361
|
+
const fn = methods[key3];
|
|
37362
|
+
Object.defineProperty(proto, key3, {
|
|
37363
37363
|
configurable: true,
|
|
37364
37364
|
enumerable: false,
|
|
37365
37365
|
get() {
|
|
37366
37366
|
const bound = fn.bind(this);
|
|
37367
|
-
Object.defineProperty(this,
|
|
37367
|
+
Object.defineProperty(this, key3, {
|
|
37368
37368
|
configurable: true,
|
|
37369
37369
|
writable: true,
|
|
37370
37370
|
enumerable: true,
|
|
@@ -37373,7 +37373,7 @@ function _installLazyMethods(inst, group, methods) {
|
|
|
37373
37373
|
return bound;
|
|
37374
37374
|
},
|
|
37375
37375
|
set(v) {
|
|
37376
|
-
Object.defineProperty(this,
|
|
37376
|
+
Object.defineProperty(this, key3, {
|
|
37377
37377
|
configurable: true,
|
|
37378
37378
|
writable: true,
|
|
37379
37379
|
enumerable: true,
|
|
@@ -38761,11 +38761,11 @@ function resolveRef(ref, ctx) {
|
|
|
38761
38761
|
}
|
|
38762
38762
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
38763
38763
|
if (path63[0] === defsKey) {
|
|
38764
|
-
const
|
|
38765
|
-
if (!
|
|
38764
|
+
const key3 = path63[1];
|
|
38765
|
+
if (!key3 || !ctx.defs[key3]) {
|
|
38766
38766
|
throw new Error(`Reference not found: ${ref}`);
|
|
38767
38767
|
}
|
|
38768
|
-
return ctx.defs[
|
|
38768
|
+
return ctx.defs[key3];
|
|
38769
38769
|
}
|
|
38770
38770
|
throw new Error(`Reference not found: ${ref}`);
|
|
38771
38771
|
}
|
|
@@ -38951,9 +38951,9 @@ function convertBaseSchema(schema8, ctx) {
|
|
|
38951
38951
|
const shape = {};
|
|
38952
38952
|
const properties = schema8.properties || {};
|
|
38953
38953
|
const requiredSet = new Set(schema8.required || []);
|
|
38954
|
-
for (const [
|
|
38954
|
+
for (const [key3, propSchema] of Object.entries(properties)) {
|
|
38955
38955
|
const propZodSchema = convertSchema(propSchema, ctx);
|
|
38956
|
-
shape[
|
|
38956
|
+
shape[key3] = requiredSet.has(key3) ? propZodSchema : propZodSchema.optional();
|
|
38957
38957
|
}
|
|
38958
38958
|
if (schema8.propertyNames) {
|
|
38959
38959
|
const keySchema2 = convertSchema(schema8.propertyNames, ctx);
|
|
@@ -39094,20 +39094,20 @@ function convertSchema(schema8, ctx) {
|
|
|
39094
39094
|
}
|
|
39095
39095
|
const extraMeta = {};
|
|
39096
39096
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
39097
|
-
for (const
|
|
39098
|
-
if (
|
|
39099
|
-
extraMeta[
|
|
39097
|
+
for (const key3 of coreMetadataKeys) {
|
|
39098
|
+
if (key3 in schema8) {
|
|
39099
|
+
extraMeta[key3] = schema8[key3];
|
|
39100
39100
|
}
|
|
39101
39101
|
}
|
|
39102
39102
|
const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
|
|
39103
|
-
for (const
|
|
39104
|
-
if (
|
|
39105
|
-
extraMeta[
|
|
39103
|
+
for (const key3 of contentMetadataKeys) {
|
|
39104
|
+
if (key3 in schema8) {
|
|
39105
|
+
extraMeta[key3] = schema8[key3];
|
|
39106
39106
|
}
|
|
39107
39107
|
}
|
|
39108
|
-
for (const
|
|
39109
|
-
if (!RECOGNIZED_KEYS.has(
|
|
39110
|
-
extraMeta[
|
|
39108
|
+
for (const key3 of Object.keys(schema8)) {
|
|
39109
|
+
if (!RECOGNIZED_KEYS.has(key3)) {
|
|
39110
|
+
extraMeta[key3] = schema8[key3];
|
|
39111
39111
|
}
|
|
39112
39112
|
}
|
|
39113
39113
|
if (Object.keys(extraMeta).length > 0) {
|
|
@@ -39214,7 +39214,7 @@ function normaliseRecord(value) {
|
|
|
39214
39214
|
return void 0;
|
|
39215
39215
|
const row = value;
|
|
39216
39216
|
const id = row["id"] ?? row["key"] ?? row["_id"];
|
|
39217
|
-
const textKey = TEXT_KEYS.find((
|
|
39217
|
+
const textKey = TEXT_KEYS.find((key3) => typeof row[key3] === "string" && row[key3].length > 0);
|
|
39218
39218
|
const record2 = {
|
|
39219
39219
|
...typeof id === "string" || typeof id === "number" ? { id: String(id) } : {},
|
|
39220
39220
|
...textKey !== void 0 ? { text: row[textKey] } : {},
|
|
@@ -39226,12 +39226,12 @@ function normaliseRecord(value) {
|
|
|
39226
39226
|
record2["timestamp"] = at;
|
|
39227
39227
|
if (row["tags"] !== null && typeof row["tags"] === "object" && !Array.isArray(row["tags"])) {
|
|
39228
39228
|
const tags = {};
|
|
39229
|
-
for (const [
|
|
39229
|
+
for (const [key3, tagValue] of Object.entries(row["tags"])) {
|
|
39230
39230
|
if (tagValue === null || tagValue === void 0)
|
|
39231
39231
|
continue;
|
|
39232
39232
|
if (typeof tagValue === "object")
|
|
39233
39233
|
continue;
|
|
39234
|
-
tags[
|
|
39234
|
+
tags[key3] = String(tagValue);
|
|
39235
39235
|
}
|
|
39236
39236
|
if (Object.keys(tags).length > 0)
|
|
39237
39237
|
record2["tags"] = tags;
|
|
@@ -39250,7 +39250,7 @@ function parseDatasetPayload(value) {
|
|
|
39250
39250
|
}
|
|
39251
39251
|
}
|
|
39252
39252
|
if (candidate !== null && typeof candidate === "object" && !Array.isArray(candidate)) {
|
|
39253
|
-
const wrapper = WRAPPER_KEYS.find((
|
|
39253
|
+
const wrapper = WRAPPER_KEYS.find((key3) => Array.isArray(candidate[key3]));
|
|
39254
39254
|
candidate = wrapper === void 0 ? [candidate] : candidate[wrapper];
|
|
39255
39255
|
}
|
|
39256
39256
|
if (!Array.isArray(candidate)) {
|
|
@@ -41526,20 +41526,20 @@ function isPlainObject2(value) {
|
|
|
41526
41526
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
41527
41527
|
}
|
|
41528
41528
|
function deepMerge(target, source) {
|
|
41529
|
-
for (const [
|
|
41530
|
-
if (isPlainObject2(value) && isPlainObject2(target[
|
|
41531
|
-
deepMerge(target[
|
|
41529
|
+
for (const [key3, value] of Object.entries(source)) {
|
|
41530
|
+
if (isPlainObject2(value) && isPlainObject2(target[key3])) {
|
|
41531
|
+
deepMerge(target[key3], value);
|
|
41532
41532
|
} else {
|
|
41533
|
-
target[
|
|
41533
|
+
target[key3] = value;
|
|
41534
41534
|
}
|
|
41535
41535
|
}
|
|
41536
41536
|
}
|
|
41537
41537
|
function mergeScopes(userConfig, workspaceConfig) {
|
|
41538
41538
|
const workspaceRecord = workspaceConfig;
|
|
41539
|
-
const ignoredWorkspaceKeys = USER_SCOPE_ONLY_KEYS.filter((
|
|
41539
|
+
const ignoredWorkspaceKeys = USER_SCOPE_ONLY_KEYS.filter((key3) => getPath(workspaceRecord, key3) !== void 0);
|
|
41540
41540
|
const sanitizedWorkspace = structuredClone(workspaceRecord);
|
|
41541
|
-
for (const
|
|
41542
|
-
deletePath(sanitizedWorkspace,
|
|
41541
|
+
for (const key3 of ignoredWorkspaceKeys) {
|
|
41542
|
+
deletePath(sanitizedWorkspace, key3);
|
|
41543
41543
|
}
|
|
41544
41544
|
const merged = structuredClone(userConfig);
|
|
41545
41545
|
deepMerge(merged, sanitizedWorkspace);
|
|
@@ -41585,8 +41585,8 @@ function overridesFor(stored, workspaceRoot) {
|
|
|
41585
41585
|
if (stored === void 0 || workspaceRoot === void 0)
|
|
41586
41586
|
return void 0;
|
|
41587
41587
|
const wanted = workspaceOverrideKey(workspaceRoot);
|
|
41588
|
-
for (const [
|
|
41589
|
-
if (workspaceOverrideKey(
|
|
41588
|
+
for (const [key3, value] of Object.entries(stored)) {
|
|
41589
|
+
if (workspaceOverrideKey(key3) === wanted)
|
|
41590
41590
|
return value;
|
|
41591
41591
|
}
|
|
41592
41592
|
return void 0;
|
|
@@ -41595,20 +41595,20 @@ function applyWorkspaceOverrides(config2, overrides) {
|
|
|
41595
41595
|
if (overrides === void 0)
|
|
41596
41596
|
return config2;
|
|
41597
41597
|
const result = { ...config2 };
|
|
41598
|
-
for (const
|
|
41599
|
-
const value = overrides[
|
|
41598
|
+
for (const key3 of OVERRIDABLE_KEYS) {
|
|
41599
|
+
const value = overrides[key3];
|
|
41600
41600
|
if (value === void 0)
|
|
41601
41601
|
continue;
|
|
41602
|
-
const base = config2[
|
|
41602
|
+
const base = config2[key3];
|
|
41603
41603
|
const bothObjects = typeof value === "object" && value !== null && !Array.isArray(value) && typeof base === "object" && base !== null && !Array.isArray(base);
|
|
41604
|
-
result[
|
|
41604
|
+
result[key3] = bothObjects ? { ...base, ...value } : value;
|
|
41605
41605
|
}
|
|
41606
41606
|
return result;
|
|
41607
41607
|
}
|
|
41608
41608
|
function describeOverrides(overrides) {
|
|
41609
41609
|
if (overrides === void 0)
|
|
41610
41610
|
return [];
|
|
41611
|
-
return OVERRIDABLE_KEYS.filter((
|
|
41611
|
+
return OVERRIDABLE_KEYS.filter((key3) => overrides[key3] !== void 0);
|
|
41612
41612
|
}
|
|
41613
41613
|
|
|
41614
41614
|
// ../../node_modules/.pnpm/env-paths@3.0.0/node_modules/env-paths/index.js
|
|
@@ -41730,16 +41730,16 @@ var ConfigManager = class {
|
|
|
41730
41730
|
if (this.workspaceRoot === void 0) {
|
|
41731
41731
|
throw new Error("No folder is open, so there is no project to save this for.");
|
|
41732
41732
|
}
|
|
41733
|
-
const
|
|
41733
|
+
const key3 = workspaceOverrideKey(this.workspaceRoot);
|
|
41734
41734
|
await this.save("user", {
|
|
41735
|
-
workspaces: await this.mergedOverrides(
|
|
41735
|
+
workspaces: await this.mergedOverrides(key3, overrides)
|
|
41736
41736
|
});
|
|
41737
41737
|
}
|
|
41738
41738
|
/** Read inside the queued save, so two per-project writes cannot lose each other. */
|
|
41739
|
-
async mergedOverrides(
|
|
41739
|
+
async mergedOverrides(key3, overrides) {
|
|
41740
41740
|
const existing = (await this.readScope("user")).workspaces;
|
|
41741
41741
|
const all = { ...existing };
|
|
41742
|
-
const matching = Object.keys(all).find((candidate) => workspaceOverrideKey(candidate) ===
|
|
41742
|
+
const matching = Object.keys(all).find((candidate) => workspaceOverrideKey(candidate) === key3) ?? key3;
|
|
41743
41743
|
const next = { ...all[matching] ?? {} };
|
|
41744
41744
|
for (const [name, value] of Object.entries(overrides)) {
|
|
41745
41745
|
if (value === void 0)
|
|
@@ -41780,7 +41780,7 @@ var ConfigManager = class {
|
|
|
41780
41780
|
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
41781
41781
|
return {};
|
|
41782
41782
|
const known = new Set(Object.keys(configSchema.shape));
|
|
41783
|
-
return Object.fromEntries(Object.entries(raw).filter(([
|
|
41783
|
+
return Object.fromEntries(Object.entries(raw).filter(([key3]) => !known.has(key3)));
|
|
41784
41784
|
}
|
|
41785
41785
|
/** Fires with the freshly reloaded, merged config whenever either scope changes on disk. */
|
|
41786
41786
|
watch(onChange) {
|
|
@@ -42086,11 +42086,11 @@ var ApiKeyAuthStrategy = class {
|
|
|
42086
42086
|
this.header = header2;
|
|
42087
42087
|
}
|
|
42088
42088
|
async resolveHeaders() {
|
|
42089
|
-
const
|
|
42090
|
-
if (
|
|
42089
|
+
const key3 = await resolveSecretRef(this.apiKeyRef, { secrets: this.secrets });
|
|
42090
|
+
if (key3 === void 0) {
|
|
42091
42091
|
throw new Error(describeMissingSecret(this.apiKeyRef));
|
|
42092
42092
|
}
|
|
42093
|
-
return { [this.header.name]: `${this.header.prefix}${
|
|
42093
|
+
return { [this.header.name]: `${this.header.prefix}${key3}` };
|
|
42094
42094
|
}
|
|
42095
42095
|
};
|
|
42096
42096
|
var NoAuthStrategy = class {
|
|
@@ -42480,7 +42480,7 @@ async function readFileOrThrow(filePath, label) {
|
|
|
42480
42480
|
throw new CertError(`Could not read ${label} at "${filePath}": ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
42481
42481
|
}
|
|
42482
42482
|
}
|
|
42483
|
-
function assertKeyMatchesCert(cert,
|
|
42483
|
+
function assertKeyMatchesCert(cert, key3, passphrase) {
|
|
42484
42484
|
let publicKey;
|
|
42485
42485
|
let privateKey;
|
|
42486
42486
|
try {
|
|
@@ -42489,7 +42489,7 @@ function assertKeyMatchesCert(cert, key2, passphrase) {
|
|
|
42489
42489
|
throw new CertError(`The certificate could not be parsed: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
42490
42490
|
}
|
|
42491
42491
|
try {
|
|
42492
|
-
privateKey = import_node_crypto2.default.createPrivateKey(passphrase !== void 0 ? { key:
|
|
42492
|
+
privateKey = import_node_crypto2.default.createPrivateKey(passphrase !== void 0 ? { key: key3, passphrase } : { key: key3 });
|
|
42493
42493
|
} catch (error51) {
|
|
42494
42494
|
const message5 = error51 instanceof Error ? error51.message : String(error51);
|
|
42495
42495
|
if (/bad decrypt|bad password|passphrase/i.test(message5)) {
|
|
@@ -42532,11 +42532,11 @@ async function loadCerts(config2) {
|
|
|
42532
42532
|
const certPath = resolveAgainst(config2.certDir, config2.certFile ?? "client.crt");
|
|
42533
42533
|
const keyPath = resolveAgainst(config2.certDir, config2.keyFile ?? "client.key");
|
|
42534
42534
|
const cert = await readFileOrThrow(certPath, "Client certificate");
|
|
42535
|
-
const
|
|
42535
|
+
const key3 = await readFileOrThrow(keyPath, "Private key");
|
|
42536
42536
|
paths.push(certPath, keyPath);
|
|
42537
|
-
assertKeyMatchesCert(cert,
|
|
42537
|
+
assertKeyMatchesCert(cert, key3, config2.passphrase);
|
|
42538
42538
|
loaded.cert = cert;
|
|
42539
|
-
loaded.key =
|
|
42539
|
+
loaded.key = key3;
|
|
42540
42540
|
try {
|
|
42541
42541
|
loaded.notAfter = new Date(new import_node_crypto2.default.X509Certificate(cert).validTo);
|
|
42542
42542
|
} catch {
|
|
@@ -42764,9 +42764,9 @@ var CONSERVATIVE_DEFAULT = {
|
|
|
42764
42764
|
var TABLE_KEYS_BY_SPECIFICITY = Object.keys(MODEL_TABLE).sort((a, b) => b.length - a.length);
|
|
42765
42765
|
function lookupModelCapabilities(modelId) {
|
|
42766
42766
|
const normalized = modelId.toLowerCase();
|
|
42767
|
-
for (const
|
|
42768
|
-
if (normalized.includes(
|
|
42769
|
-
return { ...MODEL_TABLE[
|
|
42767
|
+
for (const key3 of TABLE_KEYS_BY_SPECIFICITY) {
|
|
42768
|
+
if (normalized.includes(key3)) {
|
|
42769
|
+
return { ...MODEL_TABLE[key3], known: true, contextWindowKnown: true };
|
|
42770
42770
|
}
|
|
42771
42771
|
}
|
|
42772
42772
|
return { ...CONSERVATIVE_DEFAULT, known: false, contextWindowKnown: false };
|
|
@@ -43003,18 +43003,18 @@ function pruneSchema(schema8, keep) {
|
|
|
43003
43003
|
if (!isRecord(schema8))
|
|
43004
43004
|
return schema8;
|
|
43005
43005
|
const result = {};
|
|
43006
|
-
for (const [
|
|
43007
|
-
if (!keep(
|
|
43006
|
+
for (const [key3, value] of Object.entries(schema8)) {
|
|
43007
|
+
if (!keep(key3))
|
|
43008
43008
|
continue;
|
|
43009
|
-
if (
|
|
43009
|
+
if (key3 === "properties" && isRecord(value)) {
|
|
43010
43010
|
const properties = {};
|
|
43011
43011
|
for (const [name, propertySchema] of Object.entries(value)) {
|
|
43012
43012
|
properties[name] = pruneSchema(propertySchema, keep);
|
|
43013
43013
|
}
|
|
43014
|
-
result[
|
|
43014
|
+
result[key3] = properties;
|
|
43015
43015
|
continue;
|
|
43016
43016
|
}
|
|
43017
|
-
result[
|
|
43017
|
+
result[key3] = pruneSchema(value, keep);
|
|
43018
43018
|
}
|
|
43019
43019
|
return result;
|
|
43020
43020
|
}
|
|
@@ -43041,7 +43041,7 @@ function toGeminiTools(tools) {
|
|
|
43041
43041
|
functionDeclarations: tools.map((tool) => ({
|
|
43042
43042
|
name: tool.name,
|
|
43043
43043
|
description: tool.description,
|
|
43044
|
-
parameters: pruneSchema(normalizeObjectSchema(tool.parameters), (
|
|
43044
|
+
parameters: pruneSchema(normalizeObjectSchema(tool.parameters), (key3) => !GEMINI_UNSUPPORTED.has(key3))
|
|
43045
43045
|
}))
|
|
43046
43046
|
}
|
|
43047
43047
|
];
|
|
@@ -44124,9 +44124,9 @@ function dropSupersededReads(messages) {
|
|
|
44124
44124
|
for (const message5 of messages) {
|
|
44125
44125
|
if (message5.role !== "tool")
|
|
44126
44126
|
continue;
|
|
44127
|
-
const
|
|
44128
|
-
if (
|
|
44129
|
-
lastCallIdForKey.set(
|
|
44127
|
+
const key3 = keyByCallId.get(message5.toolCallId);
|
|
44128
|
+
if (key3 !== void 0)
|
|
44129
|
+
lastCallIdForKey.set(key3, message5.toolCallId);
|
|
44130
44130
|
}
|
|
44131
44131
|
const survivors = new Set(lastCallIdForKey.values());
|
|
44132
44132
|
let supersededCount = 0;
|
|
@@ -44134,8 +44134,8 @@ function dropSupersededReads(messages) {
|
|
|
44134
44134
|
const result = messages.map((message5) => {
|
|
44135
44135
|
if (message5.role !== "tool")
|
|
44136
44136
|
return message5;
|
|
44137
|
-
const
|
|
44138
|
-
if (
|
|
44137
|
+
const key3 = keyByCallId.get(message5.toolCallId);
|
|
44138
|
+
if (key3 === void 0 || survivors.has(message5.toolCallId))
|
|
44139
44139
|
return message5;
|
|
44140
44140
|
if (message5.content.length <= SUPERSEDED_MARKER.length)
|
|
44141
44141
|
return message5;
|
|
@@ -44893,12 +44893,12 @@ function parseCheckpoints(plan3) {
|
|
|
44893
44893
|
const chosen = texts.slice(0, MAX_CHECKPOINTS);
|
|
44894
44894
|
const seen = /* @__PURE__ */ new Map();
|
|
44895
44895
|
return chosen.map((item, position) => {
|
|
44896
|
-
const
|
|
44897
|
-
const occurrence = (seen.get(
|
|
44898
|
-
seen.set(
|
|
44896
|
+
const key3 = normalise(item.text);
|
|
44897
|
+
const occurrence = (seen.get(key3) ?? 0) + 1;
|
|
44898
|
+
seen.set(key3, occurrence);
|
|
44899
44899
|
const until = chosen[position + 1]?.line ?? lines2.length;
|
|
44900
44900
|
return {
|
|
44901
|
-
id: occurrence === 1 ? idFor(
|
|
44901
|
+
id: occurrence === 1 ? idFor(key3) : `${idFor(key3)}-${String(occurrence)}`,
|
|
44902
44902
|
index: position + 1,
|
|
44903
44903
|
text: item.text,
|
|
44904
44904
|
/*
|
|
@@ -45334,8 +45334,8 @@ async function consultExpert(cli, consultation, logger) {
|
|
|
45334
45334
|
|
|
45335
45335
|
// ../../packages/core/dist/expert/estimate.js
|
|
45336
45336
|
var ESTIMATE_PATTERN = /^[ \t]*\[LIGHT-CODE-ESTIMATE\b([^\]]*)\][ \t]*$/gim;
|
|
45337
|
-
function readNumber(source,
|
|
45338
|
-
const match = new RegExp(`${
|
|
45337
|
+
function readNumber(source, key3) {
|
|
45338
|
+
const match = new RegExp(`${key3}\\s*=\\s*\\$?([0-9]+(?:\\.[0-9]+)?)`, "i").exec(source);
|
|
45339
45339
|
if (match === null)
|
|
45340
45340
|
return void 0;
|
|
45341
45341
|
const value = Number(match[1]);
|
|
@@ -47205,9 +47205,9 @@ var DEFAULT_QUERY_LIMITS = {
|
|
|
47205
47205
|
};
|
|
47206
47206
|
function resolveQueryLimits(limits) {
|
|
47207
47207
|
const resolved = { ...DEFAULT_QUERY_LIMITS };
|
|
47208
|
-
for (const [
|
|
47208
|
+
for (const [key3, value] of Object.entries(limits ?? {})) {
|
|
47209
47209
|
if (typeof value === "number")
|
|
47210
|
-
resolved[
|
|
47210
|
+
resolved[key3] = value;
|
|
47211
47211
|
}
|
|
47212
47212
|
return resolved;
|
|
47213
47213
|
}
|
|
@@ -48979,8 +48979,8 @@ function parseToUnicode(cmap) {
|
|
|
48979
48979
|
}
|
|
48980
48980
|
return mapping;
|
|
48981
48981
|
}
|
|
48982
|
-
function referencedObject(dict,
|
|
48983
|
-
const match = new RegExp(`/${
|
|
48982
|
+
function referencedObject(dict, key3) {
|
|
48983
|
+
const match = new RegExp(`/${key3}\\s+(\\d+)\\s+\\d+\\s+R`).exec(dict);
|
|
48984
48984
|
return match === null ? void 0 : Number(match[1]);
|
|
48985
48985
|
}
|
|
48986
48986
|
function loadFont(objects, number5) {
|
|
@@ -51257,16 +51257,16 @@ function countBy(records, by, options = {}) {
|
|
|
51257
51257
|
const to = new Date(Math.max(...times));
|
|
51258
51258
|
from.setHours(0, 0, 0, 0);
|
|
51259
51259
|
for (let day = from; day <= to; day = new Date(day.getTime() + 864e5)) {
|
|
51260
|
-
const
|
|
51261
|
-
if (!buckets.has(
|
|
51262
|
-
buckets.set(
|
|
51260
|
+
const key3 = dayKey(day.getTime());
|
|
51261
|
+
if (!buckets.has(key3))
|
|
51262
|
+
buckets.set(key3, { label: key3, count: 0, detail: [] });
|
|
51263
51263
|
}
|
|
51264
51264
|
}
|
|
51265
51265
|
if (by === "hour") {
|
|
51266
51266
|
for (let hour = 0; hour < 24; hour++) {
|
|
51267
|
-
const
|
|
51268
|
-
if (!buckets.has(
|
|
51269
|
-
buckets.set(
|
|
51267
|
+
const key3 = String(hour).padStart(2, "0");
|
|
51268
|
+
if (!buckets.has(key3))
|
|
51269
|
+
buckets.set(key3, { label: key3, count: 0, detail: [] });
|
|
51270
51270
|
}
|
|
51271
51271
|
}
|
|
51272
51272
|
const rows = [...buckets.values()];
|
|
@@ -51277,8 +51277,8 @@ function crossTab(records, by, splitBy) {
|
|
|
51277
51277
|
const splits = [...new Set(records.map((record2) => groupKey(record2, splitBy)))].sort();
|
|
51278
51278
|
const index = /* @__PURE__ */ new Map();
|
|
51279
51279
|
for (const record2 of records) {
|
|
51280
|
-
const
|
|
51281
|
-
push(index,
|
|
51280
|
+
const key3 = `${groupKey(record2, by)}\0${groupKey(record2, splitBy)}`;
|
|
51281
|
+
push(index, key3, record2);
|
|
51282
51282
|
}
|
|
51283
51283
|
return {
|
|
51284
51284
|
categories,
|
|
@@ -51308,13 +51308,13 @@ function numberOverTime(records, label, how = "last") {
|
|
|
51308
51308
|
if (value === void 0)
|
|
51309
51309
|
continue;
|
|
51310
51310
|
matched += 1;
|
|
51311
|
-
const
|
|
51312
|
-
const entry = byDay.get(
|
|
51311
|
+
const key3 = dayKey(record2.receivedAt);
|
|
51312
|
+
const entry = byDay.get(key3) ?? { values: [], detail: [] };
|
|
51313
51313
|
entry.values.push(value);
|
|
51314
51314
|
if (entry.detail.length < DETAIL_CAP) {
|
|
51315
51315
|
entry.detail.push(`${new Date(record2.receivedAt).toLocaleTimeString()} \u2014 ${String(value)} \u2014 ${record2.subject}`);
|
|
51316
51316
|
}
|
|
51317
|
-
byDay.set(
|
|
51317
|
+
byDay.set(key3, entry);
|
|
51318
51318
|
}
|
|
51319
51319
|
const points = [...byDay.entries()].sort((a, b) => a[0].localeCompare(b[0])).map(([day, entry]) => ({
|
|
51320
51320
|
label: day,
|
|
@@ -55875,8 +55875,8 @@ function isPlainObject3(value) {
|
|
|
55875
55875
|
}
|
|
55876
55876
|
function mergeCapabilities(base, additional) {
|
|
55877
55877
|
const result = { ...base };
|
|
55878
|
-
for (const
|
|
55879
|
-
const k =
|
|
55878
|
+
for (const key3 in additional) {
|
|
55879
|
+
const k = key3;
|
|
55880
55880
|
const addValue = additional[k];
|
|
55881
55881
|
if (addValue === void 0)
|
|
55882
55882
|
continue;
|
|
@@ -56154,13 +56154,13 @@ function applyElicitationDefaults(schema8, data) {
|
|
|
56154
56154
|
if (schema8.type === "object" && schema8.properties && typeof schema8.properties === "object") {
|
|
56155
56155
|
const obj = data;
|
|
56156
56156
|
const props = schema8.properties;
|
|
56157
|
-
for (const
|
|
56158
|
-
const propSchema = props[
|
|
56159
|
-
if (obj[
|
|
56160
|
-
obj[
|
|
56157
|
+
for (const key3 of Object.keys(props)) {
|
|
56158
|
+
const propSchema = props[key3];
|
|
56159
|
+
if (obj[key3] === void 0 && Object.prototype.hasOwnProperty.call(propSchema, "default")) {
|
|
56160
|
+
obj[key3] = propSchema.default;
|
|
56161
56161
|
}
|
|
56162
|
-
if (obj[
|
|
56163
|
-
applyElicitationDefaults(propSchema, obj[
|
|
56162
|
+
if (obj[key3] !== void 0) {
|
|
56163
|
+
applyElicitationDefaults(propSchema, obj[key3]);
|
|
56164
56164
|
}
|
|
56165
56165
|
}
|
|
56166
56166
|
}
|
|
@@ -56720,15 +56720,15 @@ var DEFAULT_INHERITED_ENV_VARS = import_node_process2.default.platform === "win3
|
|
|
56720
56720
|
);
|
|
56721
56721
|
function getDefaultEnvironment() {
|
|
56722
56722
|
const env2 = {};
|
|
56723
|
-
for (const
|
|
56724
|
-
const value = import_node_process2.default.env[
|
|
56723
|
+
for (const key3 of DEFAULT_INHERITED_ENV_VARS) {
|
|
56724
|
+
const value = import_node_process2.default.env[key3];
|
|
56725
56725
|
if (value === void 0) {
|
|
56726
56726
|
continue;
|
|
56727
56727
|
}
|
|
56728
56728
|
if (value.startsWith("()")) {
|
|
56729
56729
|
continue;
|
|
56730
56730
|
}
|
|
56731
|
-
env2[
|
|
56731
|
+
env2[key3] = value;
|
|
56732
56732
|
}
|
|
56733
56733
|
return env2;
|
|
56734
56734
|
}
|
|
@@ -58852,17 +58852,17 @@ async function interpolateSecrets(values, secrets, options = {}) {
|
|
|
58852
58852
|
return {};
|
|
58853
58853
|
const env2 = options.env ?? process.env;
|
|
58854
58854
|
const out = {};
|
|
58855
|
-
for (const [
|
|
58855
|
+
for (const [key3, raw] of Object.entries(values)) {
|
|
58856
58856
|
let resolved = raw;
|
|
58857
58857
|
for (const match of raw.matchAll(REFERENCE)) {
|
|
58858
58858
|
const written = match[1];
|
|
58859
58859
|
const kind = written.toLowerCase();
|
|
58860
58860
|
const name = match[2].trim();
|
|
58861
58861
|
if (kind !== "secret" && kind !== "env") {
|
|
58862
|
-
throw new Error(`"${
|
|
58862
|
+
throw new Error(`"${key3}" uses \${${written}:${name}}, which Light Code does not resolve \u2014 only \${secret:NAME} (secret storage) and \${env:NAME} (an environment variable) are understood.`);
|
|
58863
58863
|
}
|
|
58864
58864
|
if (options.repositoryDefined === true) {
|
|
58865
|
-
throw new Error(`"${
|
|
58865
|
+
throw new Error(`"${key3}" references \${${kind}:${name}}, but this server is defined in the project's .lightcode/config.json. A repository may not read your secrets or environment, because a server connects as soon as the panel opens. Add the server in Settings \u2192 MCP instead.`);
|
|
58866
58866
|
}
|
|
58867
58867
|
const value = kind === "secret" ? await secrets.get(name) : env2[name];
|
|
58868
58868
|
if (value === void 0) {
|
|
@@ -58870,7 +58870,7 @@ async function interpolateSecrets(values, secrets, options = {}) {
|
|
|
58870
58870
|
}
|
|
58871
58871
|
resolved = resolved.replace(match[0], value);
|
|
58872
58872
|
}
|
|
58873
|
-
out[
|
|
58873
|
+
out[key3] = resolved;
|
|
58874
58874
|
}
|
|
58875
58875
|
return out;
|
|
58876
58876
|
}
|
|
@@ -59470,10 +59470,10 @@ function minimalPythonEnv(extra = {}) {
|
|
|
59470
59470
|
"PROCESSOR_ARCHITECTURE"
|
|
59471
59471
|
];
|
|
59472
59472
|
const env2 = {};
|
|
59473
|
-
for (const
|
|
59474
|
-
const value = process.env[
|
|
59473
|
+
for (const key3 of allowed) {
|
|
59474
|
+
const value = process.env[key3];
|
|
59475
59475
|
if (value !== void 0)
|
|
59476
|
-
env2[
|
|
59476
|
+
env2[key3] = value;
|
|
59477
59477
|
}
|
|
59478
59478
|
env2.PYTHONUNBUFFERED = "1";
|
|
59479
59479
|
env2.PYTHONDONTWRITEBYTECODE = "1";
|
|
@@ -59751,7 +59751,9 @@ var PythonWorker = class {
|
|
|
59751
59751
|
};
|
|
59752
59752
|
|
|
59753
59753
|
// ../../packages/core/dist/sharing/attribution.js
|
|
59754
|
-
var FIELDS = ["author", "project", "version", "updated"];
|
|
59754
|
+
var FIELDS = ["author", "project", "version", "updated", "updatedBy"];
|
|
59755
|
+
var LABEL_FIELDS = ["author", "project", "version", "updated"];
|
|
59756
|
+
var key = (field2) => field2 === "updatedBy" ? "updated_by" : field2;
|
|
59755
59757
|
function cleanAttributionValue(value) {
|
|
59756
59758
|
if (value === void 0)
|
|
59757
59759
|
return void 0;
|
|
@@ -59767,7 +59769,8 @@ function toAttribution(read) {
|
|
|
59767
59769
|
author: read("author"),
|
|
59768
59770
|
project: read("project"),
|
|
59769
59771
|
version: Number.isFinite(version2) && version2 > 0 ? version2 : void 0,
|
|
59770
|
-
updated: read("updated")
|
|
59772
|
+
updated: read("updated"),
|
|
59773
|
+
updatedBy: read("updatedBy")
|
|
59771
59774
|
};
|
|
59772
59775
|
}
|
|
59773
59776
|
var FRONTMATTER = /^---\r?\n([\s\S]*?)\r?\n---(\r?\n|$)/;
|
|
@@ -59775,8 +59778,8 @@ function readSkillAttribution(source) {
|
|
|
59775
59778
|
const block2 = FRONTMATTER.exec(source)?.[1];
|
|
59776
59779
|
if (block2 === void 0)
|
|
59777
59780
|
return {};
|
|
59778
|
-
return toAttribution((
|
|
59779
|
-
const match = new RegExp(`^${
|
|
59781
|
+
return toAttribution((field2) => {
|
|
59782
|
+
const match = new RegExp(`^${key(field2)}\\s*:\\s*(.*)$`, "m").exec(block2);
|
|
59780
59783
|
const value = match?.[1]?.trim().replace(/^["']|["']$/g, "");
|
|
59781
59784
|
return value !== void 0 && value.length > 0 ? value : void 0;
|
|
59782
59785
|
});
|
|
@@ -59794,12 +59797,12 @@ function writeSkillFields(source, values, replace) {
|
|
|
59794
59797
|
const value = cleanAttributionValue(values[field2]);
|
|
59795
59798
|
if (value === void 0)
|
|
59796
59799
|
continue;
|
|
59797
|
-
const line = new RegExp(`^${field2}\\s*:.*$`, "m");
|
|
59800
|
+
const line = new RegExp(`^${key(field2)}\\s*:.*$`, "m");
|
|
59798
59801
|
if (line.test(block2)) {
|
|
59799
59802
|
if (replace.has(field2))
|
|
59800
|
-
block2 = block2.replace(line, `${field2}: ${value}`);
|
|
59803
|
+
block2 = block2.replace(line, `${key(field2)}: ${value}`);
|
|
59801
59804
|
} else if (existing[field2] === void 0) {
|
|
59802
|
-
block2 = `${block2}${eol}${field2}: ${value}`;
|
|
59805
|
+
block2 = `${block2}${eol}${key(field2)}: ${value}`;
|
|
59803
59806
|
}
|
|
59804
59807
|
}
|
|
59805
59808
|
return `${source.slice(0, blockStart)}${block2}${source.slice(blockEnd)}`;
|
|
@@ -59810,7 +59813,7 @@ function dunderValue(source, name) {
|
|
|
59810
59813
|
return value !== void 0 && value.length > 0 ? value : void 0;
|
|
59811
59814
|
}
|
|
59812
59815
|
function readToolAttribution(source) {
|
|
59813
|
-
return toAttribution((field2) => dunderValue(source, field2));
|
|
59816
|
+
return toAttribution((field2) => dunderValue(source, key(field2)));
|
|
59814
59817
|
}
|
|
59815
59818
|
function insertionLine(lines2) {
|
|
59816
59819
|
let index = 0;
|
|
@@ -59847,12 +59850,12 @@ function writeToolFields(source, values, replace) {
|
|
|
59847
59850
|
const value = cleanAttributionValue(values[field2]);
|
|
59848
59851
|
if (value === void 0)
|
|
59849
59852
|
continue;
|
|
59850
|
-
const assignment = `__${field2}__ = "${value}"`;
|
|
59851
|
-
const plain = new RegExp(`^__${field2}__\\s*=\\s*["'][^"'\\\\\\r\\n]*["']\\s*$`, "m");
|
|
59853
|
+
const assignment = `__${key(field2)}__ = "${value}"`;
|
|
59854
|
+
const plain = new RegExp(`^__${key(field2)}__\\s*=\\s*["'][^"'\\\\\\r\\n]*["']\\s*$`, "m");
|
|
59852
59855
|
if (plain.test(text2)) {
|
|
59853
59856
|
if (replace.has(field2))
|
|
59854
59857
|
text2 = text2.replace(plain, assignment);
|
|
59855
|
-
} else if (!new RegExp(`^__${field2}__\\s*=`, "m").test(text2)) {
|
|
59858
|
+
} else if (!new RegExp(`^__${key(field2)}__\\s*=`, "m").test(text2)) {
|
|
59856
59859
|
additions.push(assignment);
|
|
59857
59860
|
}
|
|
59858
59861
|
}
|
|
@@ -59862,7 +59865,7 @@ function writeToolFields(source, values, replace) {
|
|
|
59862
59865
|
const at = insertionLine(lines2);
|
|
59863
59866
|
const before = lines2.slice(0, at);
|
|
59864
59867
|
const after = lines2.slice(at);
|
|
59865
|
-
const existingBlock = /^__(author|project|version|updated)__\s*=/.test(after[0] ?? "");
|
|
59868
|
+
const existingBlock = /^__(author|project|version|updated|updated_by)__\s*=/.test(after[0] ?? "");
|
|
59866
59869
|
const block2 = [
|
|
59867
59870
|
...before.length > 0 && (before[before.length - 1] ?? "").trim() !== "" ? [""] : [],
|
|
59868
59871
|
...additions,
|
|
@@ -59887,14 +59890,16 @@ function stampRevision(kind, source, previous, defaults, now) {
|
|
|
59887
59890
|
author: incoming.author ?? before.author ?? (isNew ? defaults.author : void 0),
|
|
59888
59891
|
project: incoming.project ?? before.project ?? (isNew ? defaults.project : void 0),
|
|
59889
59892
|
version: version2,
|
|
59890
|
-
updated: attributionTimestamp(now)
|
|
59893
|
+
updated: attributionTimestamp(now),
|
|
59894
|
+
// Who saved it: unlike the author, this is about this save, so it is the person making it.
|
|
59895
|
+
updatedBy: defaults.author
|
|
59891
59896
|
};
|
|
59892
|
-
const replace = /* @__PURE__ */ new Set(["version", "updated"]);
|
|
59897
|
+
const replace = /* @__PURE__ */ new Set(["version", "updated", "updatedBy"]);
|
|
59893
59898
|
return kind === "skill" ? writeSkillFields(source, values, replace) : writeToolFields(source, values, replace);
|
|
59894
59899
|
}
|
|
59895
59900
|
function missingAttribution(kind, source) {
|
|
59896
59901
|
const present2 = readAttribution(kind, source);
|
|
59897
|
-
return
|
|
59902
|
+
return LABEL_FIELDS.filter((field2) => present2[field2] === void 0);
|
|
59898
59903
|
}
|
|
59899
59904
|
|
|
59900
59905
|
// ../../packages/core/dist/skills/index.js
|
|
@@ -60319,13 +60324,13 @@ function createWriteSkillTool(context) {
|
|
|
60319
60324
|
const label = (name, rendered, before) => {
|
|
60320
60325
|
if (context.attribution === void 0)
|
|
60321
60326
|
return rendered;
|
|
60322
|
-
const
|
|
60323
|
-
const cached2 = stampedByInput.get(
|
|
60327
|
+
const key3 = `${name}\0${rendered}\0${before}`;
|
|
60328
|
+
const cached2 = stampedByInput.get(key3);
|
|
60324
60329
|
if (cached2 !== void 0)
|
|
60325
60330
|
return cached2;
|
|
60326
60331
|
const stamped = stampRevision("skill", rendered, before.length > 0 ? before : void 0, context.attribution(), /* @__PURE__ */ new Date());
|
|
60327
60332
|
stampedByInput.clear();
|
|
60328
|
-
stampedByInput.set(
|
|
60333
|
+
stampedByInput.set(key3, stamped);
|
|
60329
60334
|
return stamped;
|
|
60330
60335
|
};
|
|
60331
60336
|
return {
|
|
@@ -60680,8 +60685,8 @@ var SHARE_SECTIONS = [
|
|
|
60680
60685
|
keys: ["ui"]
|
|
60681
60686
|
}
|
|
60682
60687
|
];
|
|
60683
|
-
function has(config2,
|
|
60684
|
-
const value = config2[
|
|
60688
|
+
function has(config2, key3) {
|
|
60689
|
+
const value = config2[key3];
|
|
60685
60690
|
if (value === void 0 || value === null)
|
|
60686
60691
|
return false;
|
|
60687
60692
|
if (Array.isArray(value))
|
|
@@ -60725,7 +60730,7 @@ function detailFor(section, config2) {
|
|
|
60725
60730
|
case "skills":
|
|
60726
60731
|
return count((config2.skills?.dir === void 0 ? 0 : 1) + (config2.skills?.paths ?? []).length, "folder");
|
|
60727
60732
|
default:
|
|
60728
|
-
return section.keys.filter((
|
|
60733
|
+
return section.keys.filter((key3) => has(config2, key3)).length > 0 ? "set" : "not set";
|
|
60729
60734
|
}
|
|
60730
60735
|
}
|
|
60731
60736
|
function secretRefsFor(section, config2) {
|
|
@@ -60834,7 +60839,7 @@ function describeSections(config2) {
|
|
|
60834
60839
|
id: section.id,
|
|
60835
60840
|
label: section.label,
|
|
60836
60841
|
description: section.description,
|
|
60837
|
-
present: section.keys.some((
|
|
60842
|
+
present: section.keys.some((key3) => has(owned, key3)) || (section.nested ?? []).some((path63) => hasValue(getPath2(config2, path63))),
|
|
60838
60843
|
detail: detailFor(section, config2),
|
|
60839
60844
|
secretRefs: secretRefsFor(section, config2),
|
|
60840
60845
|
...section.machineSpecific === true ? { machineSpecific: true } : {},
|
|
@@ -60851,9 +60856,9 @@ function buildExport(config2, selected) {
|
|
|
60851
60856
|
for (const section of SHARE_SECTIONS) {
|
|
60852
60857
|
if (!chosen.has(section.id))
|
|
60853
60858
|
continue;
|
|
60854
|
-
for (const
|
|
60855
|
-
if (has(config2,
|
|
60856
|
-
exported[
|
|
60859
|
+
for (const key3 of section.keys) {
|
|
60860
|
+
if (has(config2, key3))
|
|
60861
|
+
exported[key3] = config2[key3];
|
|
60857
60862
|
}
|
|
60858
60863
|
for (const path63 of section.nested ?? []) {
|
|
60859
60864
|
const value = getPath2(config2, path63);
|
|
@@ -60888,11 +60893,11 @@ function applyImport(existing, imported, selected) {
|
|
|
60888
60893
|
for (const section of SHARE_SECTIONS) {
|
|
60889
60894
|
if (!chosen.has(section.id))
|
|
60890
60895
|
continue;
|
|
60891
|
-
for (const
|
|
60892
|
-
if (has(imported,
|
|
60893
|
-
merged[
|
|
60896
|
+
for (const key3 of section.keys) {
|
|
60897
|
+
if (has(imported, key3))
|
|
60898
|
+
merged[key3] = imported[key3];
|
|
60894
60899
|
else
|
|
60895
|
-
delete merged[
|
|
60900
|
+
delete merged[key3];
|
|
60896
60901
|
}
|
|
60897
60902
|
for (const path63 of section.strip ?? []) {
|
|
60898
60903
|
carryPath(existing, merged, path63);
|
|
@@ -61151,10 +61156,10 @@ async function loadRegistries(dirs, worker, logger, declined, trusted) {
|
|
|
61151
61156
|
const ordered = dirs.map((dir) => import_node_path25.default.resolve(dir));
|
|
61152
61157
|
const seen = /* @__PURE__ */ new Set();
|
|
61153
61158
|
const unique = ordered.filter((dir) => {
|
|
61154
|
-
const
|
|
61155
|
-
if (seen.has(
|
|
61159
|
+
const key3 = normalizeForComparison(dir);
|
|
61160
|
+
if (seen.has(key3))
|
|
61156
61161
|
return false;
|
|
61157
|
-
seen.add(
|
|
61162
|
+
seen.add(key3);
|
|
61158
61163
|
return true;
|
|
61159
61164
|
});
|
|
61160
61165
|
const tools = [];
|
|
@@ -61454,8 +61459,8 @@ function makeWriteTool(context, options) {
|
|
|
61454
61459
|
if (generator === void 0 || params3.specification === void 0) {
|
|
61455
61460
|
return { source: params3.source };
|
|
61456
61461
|
}
|
|
61457
|
-
const
|
|
61458
|
-
let inFlight = pending.get(
|
|
61462
|
+
const key3 = `${params3.name}::${params3.specification}`;
|
|
61463
|
+
let inFlight = pending.get(key3);
|
|
61459
61464
|
if (inFlight === void 0) {
|
|
61460
61465
|
const toolPath = resolveToolPath2(toolFolder(context, params3.name, params3.audience).dir, params3.name);
|
|
61461
61466
|
inFlight = (async () => {
|
|
@@ -61467,7 +61472,7 @@ function makeWriteTool(context, options) {
|
|
|
61467
61472
|
});
|
|
61468
61473
|
return { source: unwrapFencedSource(generated.source), producedBy: generated.producedBy };
|
|
61469
61474
|
})();
|
|
61470
|
-
pending.set(
|
|
61475
|
+
pending.set(key3, inFlight);
|
|
61471
61476
|
}
|
|
61472
61477
|
return inFlight;
|
|
61473
61478
|
};
|
|
@@ -61475,13 +61480,13 @@ function makeWriteTool(context, options) {
|
|
|
61475
61480
|
const label = (name, source, before) => {
|
|
61476
61481
|
if (context.attribution === void 0)
|
|
61477
61482
|
return source;
|
|
61478
|
-
const
|
|
61479
|
-
const cached2 = labelled.get(
|
|
61483
|
+
const key3 = `${name}\0${source}\0${before}`;
|
|
61484
|
+
const cached2 = labelled.get(key3);
|
|
61480
61485
|
if (cached2 !== void 0)
|
|
61481
61486
|
return cached2;
|
|
61482
61487
|
const stamped = stampRevision("tool", source, before.length > 0 ? before : void 0, context.attribution(), /* @__PURE__ */ new Date());
|
|
61483
61488
|
labelled.clear();
|
|
61484
|
-
labelled.set(
|
|
61489
|
+
labelled.set(key3, stamped);
|
|
61485
61490
|
return stamped;
|
|
61486
61491
|
};
|
|
61487
61492
|
return {
|
|
@@ -62841,8 +62846,8 @@ function jsonRecords(content) {
|
|
|
62841
62846
|
if (isRecordList(v))
|
|
62842
62847
|
return v;
|
|
62843
62848
|
if (v !== null && typeof v === "object" && !Array.isArray(v)) {
|
|
62844
|
-
for (const
|
|
62845
|
-
const inner = v[
|
|
62849
|
+
for (const key3 of ["data", "items", "results", "value", "rows", "records"]) {
|
|
62850
|
+
const inner = v[key3];
|
|
62846
62851
|
if (isRecordList(inner))
|
|
62847
62852
|
return inner;
|
|
62848
62853
|
}
|
|
@@ -63331,7 +63336,7 @@ var AUTOSYS_CLIENT_SECRET_REF = "autosys:clientSecret";
|
|
|
63331
63336
|
var AUTOSYS_PASSPHRASE_REF = "autosys:certPassphrase";
|
|
63332
63337
|
var AUTOSYS_BASIC_VALUE_REF = "autosys:basicHeaderValue";
|
|
63333
63338
|
function linesFrom(map2, separator) {
|
|
63334
|
-
return Object.entries(map2 ?? {}).map(([
|
|
63339
|
+
return Object.entries(map2 ?? {}).map(([key3, value]) => `${key3}${separator}${value}`).join("\n");
|
|
63335
63340
|
}
|
|
63336
63341
|
function gatewayView(auth2, hasClientSecret, hasPassphrase, hasBasicValue = false) {
|
|
63337
63342
|
return {
|
|
@@ -63404,7 +63409,7 @@ function gatewayFromSettings(input, stored) {
|
|
|
63404
63409
|
if (text2(input.certFile) !== void 0 && text2(input.keyFile) === void 0) {
|
|
63405
63410
|
return { error: "A client certificate needs its private key file too (or use a PFX bundle)." };
|
|
63406
63411
|
}
|
|
63407
|
-
const optional2 = (
|
|
63412
|
+
const optional2 = (key3, value) => value === void 0 ? {} : { [key3]: value };
|
|
63408
63413
|
return {
|
|
63409
63414
|
auth: {
|
|
63410
63415
|
type: input.enabled ? "apigee" : "basic",
|
|
@@ -64234,17 +64239,17 @@ var HubMirror = class {
|
|
|
64234
64239
|
files = await this.walk(folder, signal);
|
|
64235
64240
|
} catch (error51) {
|
|
64236
64241
|
result.failed.push({ path: folder.remote || "(top folder)", problem: error51 instanceof Error ? error51.message : String(error51) });
|
|
64237
|
-
for (const
|
|
64238
|
-
if (
|
|
64239
|
-
seen.add(
|
|
64242
|
+
for (const key3 of Object.keys(manifest))
|
|
64243
|
+
if (key3.split("/")[0] === folder.local)
|
|
64244
|
+
seen.add(key3);
|
|
64240
64245
|
continue;
|
|
64241
64246
|
}
|
|
64242
64247
|
await inBatches(files, CONCURRENCY, async (entry) => {
|
|
64243
64248
|
const inside = folder.remote.length > 0 ? entry.path.slice(folder.remote.length + 1) : entry.path;
|
|
64244
|
-
const
|
|
64245
|
-
seen.add(
|
|
64246
|
-
const local = import_node_path30.default.join(this.root, ...
|
|
64247
|
-
const known = manifest[
|
|
64249
|
+
const key3 = `${folder.local}/${inside}`;
|
|
64250
|
+
seen.add(key3);
|
|
64251
|
+
const local = import_node_path30.default.join(this.root, ...key3.split("/"));
|
|
64252
|
+
const known = manifest[key3];
|
|
64248
64253
|
const localHash = await hashFile(local);
|
|
64249
64254
|
const changedHere = localHash !== void 0 && (known === void 0 || known.hash !== localHash);
|
|
64250
64255
|
const changedThere = known === void 0 || known.lastModified !== entry.lastModified;
|
|
@@ -64254,42 +64259,42 @@ var HubMirror = class {
|
|
|
64254
64259
|
}
|
|
64255
64260
|
if (changedHere) {
|
|
64256
64261
|
if (changedThere && known !== void 0)
|
|
64257
|
-
result.conflicts.push(
|
|
64262
|
+
result.conflicts.push(key3);
|
|
64258
64263
|
else if (known === void 0 && localHash !== void 0)
|
|
64259
|
-
result.conflicts.push(
|
|
64264
|
+
result.conflicts.push(key3);
|
|
64260
64265
|
return;
|
|
64261
64266
|
}
|
|
64262
64267
|
if (entry.size !== void 0 && entry.size > maxBytes) {
|
|
64263
|
-
result.skipped.push(
|
|
64268
|
+
result.skipped.push(key3);
|
|
64264
64269
|
return;
|
|
64265
64270
|
}
|
|
64266
64271
|
try {
|
|
64267
64272
|
const file2 = await this.client.read(entry.path, signal);
|
|
64268
64273
|
await writeWhole(local, file2.bytes);
|
|
64269
|
-
manifest[
|
|
64270
|
-
result.fetched.push(
|
|
64274
|
+
manifest[key3] = { remote: entry.path, lastModified: file2.lastModified || entry.lastModified, hash: sha(file2.bytes) };
|
|
64275
|
+
result.fetched.push(key3);
|
|
64271
64276
|
} catch (error51) {
|
|
64272
|
-
result.failed.push({ path:
|
|
64277
|
+
result.failed.push({ path: key3, problem: error51 instanceof Error ? error51.message : String(error51) });
|
|
64273
64278
|
}
|
|
64274
64279
|
});
|
|
64275
64280
|
}
|
|
64276
|
-
for (const [
|
|
64277
|
-
if (seen.has(
|
|
64281
|
+
for (const [key3, known] of Object.entries(manifest)) {
|
|
64282
|
+
if (seen.has(key3))
|
|
64278
64283
|
continue;
|
|
64279
|
-
if (await this.ignoredHere(
|
|
64280
|
-
delete manifest[
|
|
64281
|
-
result.ignored.push(
|
|
64284
|
+
if (await this.ignoredHere(key3)) {
|
|
64285
|
+
delete manifest[key3];
|
|
64286
|
+
result.ignored.push(key3);
|
|
64282
64287
|
continue;
|
|
64283
64288
|
}
|
|
64284
|
-
const local = import_node_path30.default.join(this.root, ...
|
|
64289
|
+
const local = import_node_path30.default.join(this.root, ...key3.split("/"));
|
|
64285
64290
|
const localHash = await hashFile(local);
|
|
64286
64291
|
if (localHash !== void 0 && localHash !== known.hash) {
|
|
64287
|
-
result.conflicts.push(
|
|
64292
|
+
result.conflicts.push(key3);
|
|
64288
64293
|
continue;
|
|
64289
64294
|
}
|
|
64290
64295
|
await import_promises16.default.rm(local, { force: true });
|
|
64291
|
-
delete manifest[
|
|
64292
|
-
result.removed.push(
|
|
64296
|
+
delete manifest[key3];
|
|
64297
|
+
result.removed.push(key3);
|
|
64293
64298
|
}
|
|
64294
64299
|
await this.saveManifest();
|
|
64295
64300
|
return result;
|
|
@@ -64335,8 +64340,8 @@ var HubMirror = class {
|
|
|
64335
64340
|
* Whether a local key (`<folder>/<path>`) is left out by `.hubignore` - the rules in this machine's
|
|
64336
64341
|
* copy, from the synced folder down to the file, and any folder on the way that is itself left out.
|
|
64337
64342
|
*/
|
|
64338
|
-
async ignoredHere(
|
|
64339
|
-
const [folderName, ...parts] =
|
|
64343
|
+
async ignoredHere(key3) {
|
|
64344
|
+
const [folderName, ...parts] = key3.split("/");
|
|
64340
64345
|
const folder = this.folders.find((f) => f.local.toLowerCase() === (folderName ?? "").toLowerCase());
|
|
64341
64346
|
if (folder === void 0 || parts.length === 0)
|
|
64342
64347
|
return false;
|
|
@@ -64364,8 +64369,8 @@ var HubMirror = class {
|
|
|
64364
64369
|
if (remote === void 0)
|
|
64365
64370
|
return { saved: false, message: "not inside one of the JupyterHub folders, so it stays local" };
|
|
64366
64371
|
const manifest = await this.loadManifest();
|
|
64367
|
-
const
|
|
64368
|
-
if (await this.ignoredHere(
|
|
64372
|
+
const key3 = import_node_path30.default.relative(this.root, localAbsolute).split(import_node_path30.default.sep).join("/");
|
|
64373
|
+
if (await this.ignoredHere(key3))
|
|
64369
64374
|
return { saved: false, ignored: true, message: `listed in ${HUBIGNORE} (or skipped by default), so it stays local` };
|
|
64370
64375
|
let bytes;
|
|
64371
64376
|
try {
|
|
@@ -64374,7 +64379,7 @@ var HubMirror = class {
|
|
|
64374
64379
|
return { saved: false, message: "it no longer exists here; delete it on the hub yourself if that was meant" };
|
|
64375
64380
|
}
|
|
64376
64381
|
const hash3 = sha(bytes);
|
|
64377
|
-
const known = manifest[
|
|
64382
|
+
const known = manifest[key3];
|
|
64378
64383
|
if (known !== void 0 && known.hash === hash3)
|
|
64379
64384
|
return { saved: true, message: "already the same on the hub" };
|
|
64380
64385
|
const there = await this.client.stat(remote, signal);
|
|
@@ -64391,7 +64396,7 @@ var HubMirror = class {
|
|
|
64391
64396
|
if (parent.length > 0)
|
|
64392
64397
|
await this.client.ensureFolder(parent, signal);
|
|
64393
64398
|
const lastModified = await this.client.write(remote, bytes, signal);
|
|
64394
|
-
manifest[
|
|
64399
|
+
manifest[key3] = { remote, lastModified, hash: hash3 };
|
|
64395
64400
|
await this.saveManifest();
|
|
64396
64401
|
return { saved: true, message: `saved to the hub as ${remote}` };
|
|
64397
64402
|
}
|
|
@@ -64424,19 +64429,19 @@ var HubMirror = class {
|
|
|
64424
64429
|
const seen = /* @__PURE__ */ new Set();
|
|
64425
64430
|
for (const folder of this.folders) {
|
|
64426
64431
|
for (const local of await listLocal(import_node_path30.default.join(this.root, folder.local), "", new HubIgnore())) {
|
|
64427
|
-
const
|
|
64428
|
-
seen.add(
|
|
64429
|
-
const known = manifest[
|
|
64430
|
-
const remote = this.remoteOf(local) ??
|
|
64432
|
+
const key3 = import_node_path30.default.relative(this.root, local).split(import_node_path30.default.sep).join("/");
|
|
64433
|
+
seen.add(key3);
|
|
64434
|
+
const known = manifest[key3];
|
|
64435
|
+
const remote = this.remoteOf(local) ?? key3;
|
|
64431
64436
|
if (known === void 0)
|
|
64432
|
-
changes.push({ local:
|
|
64437
|
+
changes.push({ local: key3, remote, kind: "new" });
|
|
64433
64438
|
else if (await hashFile(local) !== known.hash)
|
|
64434
|
-
changes.push({ local:
|
|
64439
|
+
changes.push({ local: key3, remote, kind: "changed" });
|
|
64435
64440
|
}
|
|
64436
64441
|
}
|
|
64437
|
-
for (const [
|
|
64438
|
-
if (!seen.has(
|
|
64439
|
-
changes.push({ local:
|
|
64442
|
+
for (const [key3, known] of Object.entries(manifest)) {
|
|
64443
|
+
if (!seen.has(key3) && !await this.ignoredHere(key3))
|
|
64444
|
+
changes.push({ local: key3, remote: known.remote, kind: "deleted" });
|
|
64440
64445
|
}
|
|
64441
64446
|
return changes;
|
|
64442
64447
|
}
|
|
@@ -64896,9 +64901,9 @@ async function discoverAddons(folders) {
|
|
|
64896
64901
|
function addonServerEntry(addon, previous) {
|
|
64897
64902
|
const kept = {};
|
|
64898
64903
|
if (previous !== void 0 && "command" in previous) {
|
|
64899
|
-
for (const
|
|
64900
|
-
if (previous[
|
|
64901
|
-
kept[
|
|
64904
|
+
for (const key3 of ["env", "disabledTools", "deny", "timeout", "toolTimeouts"]) {
|
|
64905
|
+
if (previous[key3] !== void 0)
|
|
64906
|
+
kept[key3] = previous[key3];
|
|
64902
64907
|
}
|
|
64903
64908
|
}
|
|
64904
64909
|
return {
|
|
@@ -65200,8 +65205,8 @@ function codebaseInstructionsPath(options) {
|
|
|
65200
65205
|
if (options.workspaceRoot === void 0)
|
|
65201
65206
|
return void 0;
|
|
65202
65207
|
const resolved = import_node_path35.default.resolve(options.workspaceRoot);
|
|
65203
|
-
const
|
|
65204
|
-
const digest = (0, import_node_crypto13.createHash)("sha256").update(
|
|
65208
|
+
const key3 = process.platform === "win32" ? resolved.toLowerCase() : resolved;
|
|
65209
|
+
const digest = (0, import_node_crypto13.createHash)("sha256").update(key3).digest("hex").slice(0, 12);
|
|
65205
65210
|
const slug = import_node_path35.default.basename(resolved).toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "workspace";
|
|
65206
65211
|
return import_node_path35.default.join(options.storageDir, "codebases", `${slug}-${digest}`, CODEBASE_INSTRUCTIONS_FILE);
|
|
65207
65212
|
}
|
|
@@ -65248,17 +65253,17 @@ var CredentialPointerStore = class {
|
|
|
65248
65253
|
constructor(inner) {
|
|
65249
65254
|
this.inner = inner;
|
|
65250
65255
|
}
|
|
65251
|
-
async get(
|
|
65252
|
-
if (isCredentialPointer(
|
|
65253
|
-
return this.inner.get(
|
|
65254
|
-
const stored = await this.inner.get(
|
|
65256
|
+
async get(key3) {
|
|
65257
|
+
if (isCredentialPointer(key3))
|
|
65258
|
+
return this.inner.get(key3);
|
|
65259
|
+
const stored = await this.inner.get(key3);
|
|
65255
65260
|
return isCredentialPointer(stored) ? this.inner.get(stored) : stored;
|
|
65256
65261
|
}
|
|
65257
|
-
set(
|
|
65258
|
-
return this.inner.set(
|
|
65262
|
+
set(key3, value) {
|
|
65263
|
+
return this.inner.set(key3, value);
|
|
65259
65264
|
}
|
|
65260
|
-
delete(
|
|
65261
|
-
return this.inner.delete(
|
|
65265
|
+
delete(key3) {
|
|
65266
|
+
return this.inner.delete(key3);
|
|
65262
65267
|
}
|
|
65263
65268
|
clear() {
|
|
65264
65269
|
return this.inner.clear();
|
|
@@ -65317,8 +65322,8 @@ function findPlaceholders(text2) {
|
|
|
65317
65322
|
}
|
|
65318
65323
|
function cleanSkillDefaults(input) {
|
|
65319
65324
|
const out = {};
|
|
65320
|
-
for (const [
|
|
65321
|
-
const name =
|
|
65325
|
+
for (const [key3, value] of Object.entries(input)) {
|
|
65326
|
+
const name = key3.trim();
|
|
65322
65327
|
if (name.length === 0 || value.trim().length === 0)
|
|
65323
65328
|
continue;
|
|
65324
65329
|
out[name] = value.trim();
|
|
@@ -66364,11 +66369,11 @@ async function stamp(context, realPath) {
|
|
|
66364
66369
|
}
|
|
66365
66370
|
}
|
|
66366
66371
|
async function recordRead(context, realPath) {
|
|
66367
|
-
const
|
|
66368
|
-
context.readFiles.add(
|
|
66372
|
+
const key3 = normalizeForComparison(realPath);
|
|
66373
|
+
context.readFiles.add(key3);
|
|
66369
66374
|
const now = await stamp(context, realPath);
|
|
66370
66375
|
if (context.readStamps !== void 0 && now !== void 0)
|
|
66371
|
-
context.readStamps.set(
|
|
66376
|
+
context.readStamps.set(key3, now);
|
|
66372
66377
|
}
|
|
66373
66378
|
async function changedSinceRead(context, realPath, shown2) {
|
|
66374
66379
|
const known = context.readStamps?.get(normalizeForComparison(realPath));
|
|
@@ -66398,13 +66403,13 @@ async function staleFilesNamedIn(context, command) {
|
|
|
66398
66403
|
return false;
|
|
66399
66404
|
};
|
|
66400
66405
|
const stale = [];
|
|
66401
|
-
for (const [
|
|
66402
|
-
const relative = import_node_path40.default.relative(root,
|
|
66403
|
-
const names = [
|
|
66406
|
+
for (const [key3, known] of context.readStamps) {
|
|
66407
|
+
const relative = import_node_path40.default.relative(root, key3);
|
|
66408
|
+
const names = [key3, relative, relative.split(import_node_path40.default.sep).join("/"), import_node_path40.default.basename(key3)].map((n) => n.toLowerCase());
|
|
66404
66409
|
if (!names.some(stands))
|
|
66405
66410
|
continue;
|
|
66406
66411
|
try {
|
|
66407
|
-
const s = await context.fs.stat(
|
|
66412
|
+
const s = await context.fs.stat(key3);
|
|
66408
66413
|
if (`${String(s.mtimeMs)}:${String(s.size)}` !== known)
|
|
66409
66414
|
stale.push(relative.split(import_node_path40.default.sep).join("/"));
|
|
66410
66415
|
} catch {
|
|
@@ -66802,8 +66807,8 @@ ${scanned}${answer.limitReached === true ? " The limit was reached; more match."
|
|
|
66802
66807
|
}
|
|
66803
66808
|
if (params3.action === "summary") {
|
|
66804
66809
|
const ext = answer.byExtension ?? [];
|
|
66805
|
-
const list2 = (
|
|
66806
|
-
const items = answer[
|
|
66810
|
+
const list2 = (key3) => {
|
|
66811
|
+
const items = answer[key3] ?? [];
|
|
66807
66812
|
return items.filter((i) => !isSecretPath(i.path)).map((i) => ` ${formatBytes(i.size)} ${when(i.modified)} ${i.path}`).join("\n");
|
|
66808
66813
|
};
|
|
66809
66814
|
return {
|
|
@@ -67455,8 +67460,8 @@ function buildUrl(params3) {
|
|
|
67455
67460
|
const url2 = new URL(params3.url);
|
|
67456
67461
|
if (url2.protocol !== "http:" && url2.protocol !== "https:")
|
|
67457
67462
|
throw new Error(`Only http and https URLs are supported, not ${url2.protocol}`);
|
|
67458
|
-
for (const [
|
|
67459
|
-
url2.searchParams.append(
|
|
67463
|
+
for (const [key3, value] of Object.entries(params3.query ?? {}))
|
|
67464
|
+
url2.searchParams.append(key3, String(value));
|
|
67460
67465
|
return url2;
|
|
67461
67466
|
}
|
|
67462
67467
|
function shownHeaders(headers) {
|
|
@@ -67479,10 +67484,10 @@ async function resolveSecrets(headers, secret) {
|
|
|
67479
67484
|
for (const [name, raw] of Object.entries(headers)) {
|
|
67480
67485
|
let value = raw;
|
|
67481
67486
|
for (const match of raw.matchAll(SECRET_REFERENCE)) {
|
|
67482
|
-
const
|
|
67483
|
-
const found2 = await secret(
|
|
67487
|
+
const key3 = (match[1] ?? "").trim();
|
|
67488
|
+
const found2 = await secret(key3);
|
|
67484
67489
|
if (found2 === void 0 || found2.length === 0) {
|
|
67485
|
-
throw new Error(`Header "${name}" uses \${secret:${
|
|
67490
|
+
throw new Error(`Header "${name}" uses \${secret:${key3}}, but no secret by that name is stored. Ask the user to save it (Settings, or Fire Code's credentials).`);
|
|
67486
67491
|
}
|
|
67487
67492
|
value = value.replace(match[0], found2);
|
|
67488
67493
|
}
|
|
@@ -67525,8 +67530,8 @@ var sleep = (ms, signal) => new Promise((resolve) => {
|
|
|
67525
67530
|
}, { once: true });
|
|
67526
67531
|
});
|
|
67527
67532
|
function header(headers, name) {
|
|
67528
|
-
const
|
|
67529
|
-
return
|
|
67533
|
+
const key3 = Object.keys(headers).find((k) => k.toLowerCase() === name.toLowerCase());
|
|
67534
|
+
return key3 === void 0 ? void 0 : headers[key3];
|
|
67530
67535
|
}
|
|
67531
67536
|
function describeResponse(response, url2, trail) {
|
|
67532
67537
|
const type = header(response.headers, "content-type") ?? "";
|
|
@@ -73931,8 +73936,8 @@ function parseAutosysTime(value) {
|
|
|
73931
73936
|
var WEEKDAYS = ["su", "mo", "tu", "we", "th", "fr", "sa"];
|
|
73932
73937
|
function attribute(definition, snake) {
|
|
73933
73938
|
const camel = snake.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
73934
|
-
for (const
|
|
73935
|
-
const value = definition[
|
|
73939
|
+
for (const key3 of [snake, camel]) {
|
|
73940
|
+
const value = definition[key3];
|
|
73936
73941
|
if (value === void 0 || value === null || value === "")
|
|
73937
73942
|
continue;
|
|
73938
73943
|
return Array.isArray(value) ? value.map(String).join(",") : String(value);
|
|
@@ -74114,11 +74119,11 @@ function isAutosysName(name, pattern = false) {
|
|
|
74114
74119
|
return (pattern ? /^[A-Za-z0-9._#*-]{1,64}$/ : /^[A-Za-z0-9._#-]{1,64}$/).test(name);
|
|
74115
74120
|
}
|
|
74116
74121
|
function fill(template, values) {
|
|
74117
|
-
return template.replace(/\{(filter:)?(\w+)\}/g, (_, filter,
|
|
74122
|
+
return template.replace(/\{(filter:)?(\w+)\}/g, (_, filter, key3) => {
|
|
74118
74123
|
if (filter !== void 0) {
|
|
74119
|
-
return encodeURIComponent(`${
|
|
74124
|
+
return encodeURIComponent(`${key3}==${values["pattern"] ?? values[key3] ?? values["job"] ?? ""}`);
|
|
74120
74125
|
}
|
|
74121
|
-
return encodeURIComponent(values[
|
|
74126
|
+
return encodeURIComponent(values[key3] ?? "");
|
|
74122
74127
|
});
|
|
74123
74128
|
}
|
|
74124
74129
|
var AUTOSYS_PATH_KEYS = Object.keys(DEFAULT_AUTOSYS_PATHS);
|
|
@@ -74139,9 +74144,9 @@ var SUBJECT = {
|
|
|
74139
74144
|
calendar: ["calendar"],
|
|
74140
74145
|
extendedCalendar: ["calendar"]
|
|
74141
74146
|
};
|
|
74142
|
-
function autosysPathProblem(
|
|
74143
|
-
if (!AUTOSYS_PATH_KEYS.includes(
|
|
74144
|
-
return `"${String(
|
|
74147
|
+
function autosysPathProblem(key3, template) {
|
|
74148
|
+
if (!AUTOSYS_PATH_KEYS.includes(key3))
|
|
74149
|
+
return `"${String(key3)}" is not an AutoSys address name.`;
|
|
74145
74150
|
if (template.length === 0 || template.length > 500)
|
|
74146
74151
|
return "An address must be 1 to 500 characters.";
|
|
74147
74152
|
if (!template.startsWith("/") || template.startsWith("//"))
|
|
@@ -74165,9 +74170,9 @@ function autosysPathProblem(key2, template) {
|
|
|
74165
74170
|
if (filter === void 0 && !PLACEHOLDERS.has(name ?? ""))
|
|
74166
74171
|
return `{${name ?? ""}} is not a placeholder - use one of ${[...PLACEHOLDERS].map((p) => `{${p}}`).join(", ")}, or {filter:<field>}.`;
|
|
74167
74172
|
}
|
|
74168
|
-
const subject = SUBJECT[
|
|
74173
|
+
const subject = SUBJECT[key3];
|
|
74169
74174
|
if (subject !== void 0 && !named2.some(([, filter, name]) => filter !== void 0 || subject.includes(name ?? ""))) {
|
|
74170
|
-
return `The ${
|
|
74175
|
+
return `The ${key3} address must say which one it is about: include ${subject.map((p) => `{${p}}`).join(" or ")} (or a {filter:<field>}).`;
|
|
74171
74176
|
}
|
|
74172
74177
|
return void 0;
|
|
74173
74178
|
}
|
|
@@ -74207,13 +74212,13 @@ function field(record2, ...names) {
|
|
|
74207
74212
|
}
|
|
74208
74213
|
function renderDefinition(record2, indent2 = "") {
|
|
74209
74214
|
const lines2 = [];
|
|
74210
|
-
for (const [
|
|
74215
|
+
for (const [key3, value] of Object.entries(record2)) {
|
|
74211
74216
|
if (value === null || value === void 0 || value === "")
|
|
74212
74217
|
continue;
|
|
74213
74218
|
if (typeof value === "object" && !Array.isArray(value)) {
|
|
74214
|
-
lines2.push(`${indent2}${
|
|
74219
|
+
lines2.push(`${indent2}${key3}:`, ...renderDefinition(value, `${indent2} `));
|
|
74215
74220
|
} else {
|
|
74216
|
-
lines2.push(`${indent2}${
|
|
74221
|
+
lines2.push(`${indent2}${key3}: ${Array.isArray(value) ? value.map(String).join(", ") : String(value)}`);
|
|
74217
74222
|
}
|
|
74218
74223
|
}
|
|
74219
74224
|
return lines2;
|
|
@@ -74264,10 +74269,10 @@ var AutosysClient = class _AutosysClient {
|
|
|
74264
74269
|
this.connection = connection;
|
|
74265
74270
|
this.rest = new AtlassianRest(http, "autosys", connection);
|
|
74266
74271
|
this.overrides = { ...paths ?? {} };
|
|
74267
|
-
for (const [
|
|
74268
|
-
const problem = autosysPathProblem(
|
|
74272
|
+
for (const [key3, template] of Object.entries(this.overrides)) {
|
|
74273
|
+
const problem = autosysPathProblem(key3, template);
|
|
74269
74274
|
if (problem !== void 0)
|
|
74270
|
-
throw new AtlassianError(`The AutoSys address config:autosys (paths.${
|
|
74275
|
+
throw new AtlassianError(`The AutoSys address config:autosys (paths.${key3}) "${template}" cannot be used: ${problem}`);
|
|
74271
74276
|
}
|
|
74272
74277
|
this.paths = { ...DEFAULT_AUTOSYS_PATHS, ...this.overrides };
|
|
74273
74278
|
}
|
|
@@ -74291,24 +74296,24 @@ var AutosysClient = class _AutosysClient {
|
|
|
74291
74296
|
* Tries one read address once and says what came back. Never for an address that is sent to
|
|
74292
74297
|
* (`AUTOSYS_SENDING_KEYS`): a test POST of an event would be a real event.
|
|
74293
74298
|
*/
|
|
74294
|
-
async check(
|
|
74295
|
-
const template = this.paths[
|
|
74299
|
+
async check(key3, values, signal) {
|
|
74300
|
+
const template = this.paths[key3];
|
|
74296
74301
|
const requested2 = fill(template, values);
|
|
74297
|
-
if (AUTOSYS_SENDING_KEYS.includes(
|
|
74298
|
-
return { key:
|
|
74302
|
+
if (AUTOSYS_SENDING_KEYS.includes(key3)) {
|
|
74303
|
+
return { key: key3, template, requested: requested2, ok: false, message: "not tried - this address is sent to, and trying it would change production" };
|
|
74299
74304
|
}
|
|
74300
74305
|
try {
|
|
74301
|
-
if (
|
|
74302
|
-
const text2 = await this.rest.text(`trying the ${
|
|
74303
|
-
return { key:
|
|
74306
|
+
if (key3 === "log") {
|
|
74307
|
+
const text2 = await this.rest.text(`trying the ${key3} address`, requested2, signal);
|
|
74308
|
+
return { key: key3, template, requested: requested2, ok: true, status: 200, records: text2.length > 0 ? 1 : 0 };
|
|
74304
74309
|
}
|
|
74305
|
-
const list2 = asList(await this.rest.json(`trying the ${
|
|
74310
|
+
const list2 = asList(await this.rest.json(`trying the ${key3} address`, requested2, { method: "GET" }, signal));
|
|
74306
74311
|
const first = list2[0];
|
|
74307
|
-
return { key:
|
|
74312
|
+
return { key: key3, template, requested: requested2, ok: true, status: 200, records: list2.length, fields: first === void 0 ? [] : Object.keys(first).slice(0, 15) };
|
|
74308
74313
|
} catch (error51) {
|
|
74309
74314
|
const status2 = error51 instanceof AtlassianError ? error51.status : void 0;
|
|
74310
74315
|
return {
|
|
74311
|
-
key:
|
|
74316
|
+
key: key3,
|
|
74312
74317
|
template,
|
|
74313
74318
|
requested: requested2,
|
|
74314
74319
|
ok: false,
|
|
@@ -74609,10 +74614,10 @@ function statusSummary(runs) {
|
|
|
74609
74614
|
counts.set(run3.status, (counts.get(run3.status) ?? 0) + 1);
|
|
74610
74615
|
return [...counts.entries()].sort((a, b) => b[1] - a[1]).map(([status2, count3]) => `${String(count3)} ${status2}`).join(" \xB7 ");
|
|
74611
74616
|
}
|
|
74612
|
-
function attributeMatches(
|
|
74613
|
-
const snake =
|
|
74614
|
-
const flat =
|
|
74615
|
-
return wanted.some((name) => name ===
|
|
74617
|
+
function attributeMatches(key3, wanted) {
|
|
74618
|
+
const snake = key3.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`).toLowerCase();
|
|
74619
|
+
const flat = key3.toLowerCase().replace(/_/g, "");
|
|
74620
|
+
return wanted.some((name) => name === key3.toLowerCase() || name === snake || name.replace(/_/g, "") === flat);
|
|
74616
74621
|
}
|
|
74617
74622
|
var jobSchema = external_exports.object({
|
|
74618
74623
|
job: external_exports.string().min(1).optional().describe("One exact job name."),
|
|
@@ -74662,7 +74667,7 @@ function createAutosysJobTool(options) {
|
|
|
74662
74667
|
statuses.set(name, runs[0]);
|
|
74663
74668
|
});
|
|
74664
74669
|
const fields = params3.fields?.map((name) => name.trim().toLowerCase());
|
|
74665
|
-
const pick4 = (definition) => fields === void 0 ? definition : Object.fromEntries(Object.entries(definition).filter(([
|
|
74670
|
+
const pick4 = (definition) => fields === void 0 ? definition : Object.fromEntries(Object.entries(definition).filter(([key3]) => attributeMatches(key3, fields)));
|
|
74666
74671
|
const full = fields === void 0 && shownNames.length <= MAX_FULL_DEFINITIONS;
|
|
74667
74672
|
const sections = [];
|
|
74668
74673
|
if (shownNames.length > 1) {
|
|
@@ -75431,10 +75436,10 @@ function describeCheck(check2) {
|
|
|
75431
75436
|
}
|
|
75432
75437
|
return `${check2.status !== void 0 ? String(check2.status) : "failed"}: ${(check2.message ?? "").slice(0, 300)}`;
|
|
75433
75438
|
}
|
|
75434
|
-
function candidatesFor(
|
|
75439
|
+
function candidatesFor(key3, current, given, common) {
|
|
75435
75440
|
const list2 = [...given !== void 0 ? [given] : [], current];
|
|
75436
75441
|
if (common) {
|
|
75437
|
-
const shapes = [DEFAULT_AUTOSYS_PATHS[
|
|
75442
|
+
const shapes = [DEFAULT_AUTOSYS_PATHS[key3], ...PATTERN_QUERIES[key3] ?? []];
|
|
75438
75443
|
for (const prefix of COMMON_PREFIXES)
|
|
75439
75444
|
for (const shape of shapes)
|
|
75440
75445
|
list2.push(`${prefix}${shape}`);
|
|
@@ -75463,12 +75468,12 @@ function createAutosysCheckAddressesTool(options) {
|
|
|
75463
75468
|
}
|
|
75464
75469
|
const given = {};
|
|
75465
75470
|
const refused = [];
|
|
75466
|
-
for (const [
|
|
75467
|
-
const problem = autosysPathProblem(
|
|
75471
|
+
for (const [key3, template] of Object.entries(params3.addresses ?? {})) {
|
|
75472
|
+
const problem = autosysPathProblem(key3, template);
|
|
75468
75473
|
if (problem !== void 0)
|
|
75469
|
-
refused.push(`- ${
|
|
75474
|
+
refused.push(`- ${key3} "${template}": ${problem}`);
|
|
75470
75475
|
else
|
|
75471
|
-
given[
|
|
75476
|
+
given[key3] = template;
|
|
75472
75477
|
}
|
|
75473
75478
|
const keys = [
|
|
75474
75479
|
.../* @__PURE__ */ new Set([
|
|
@@ -75477,7 +75482,7 @@ function createAutosysCheckAddressesTool(options) {
|
|
|
75477
75482
|
...params3.machine !== void 0 ? ["machines", "machine"] : [],
|
|
75478
75483
|
...params3.calendar !== void 0 ? ["calendar"] : []
|
|
75479
75484
|
])
|
|
75480
|
-
].filter((
|
|
75485
|
+
].filter((key3) => !AUTOSYS_SENDING_KEYS.includes(key3));
|
|
75481
75486
|
const values = {
|
|
75482
75487
|
job,
|
|
75483
75488
|
jobName: job,
|
|
@@ -75491,15 +75496,15 @@ function createAutosysCheckAddressesTool(options) {
|
|
|
75491
75496
|
const client = await options.client();
|
|
75492
75497
|
const current = client.addresses;
|
|
75493
75498
|
const halt = {};
|
|
75494
|
-
const run3 = async (common, only) => Promise.all(only.map(async (
|
|
75495
|
-
const outcome = { key:
|
|
75499
|
+
const run3 = async (common, only) => Promise.all(only.map(async (key3) => {
|
|
75500
|
+
const outcome = { key: key3, tried: [] };
|
|
75496
75501
|
let fallback;
|
|
75497
|
-
for (const template of candidatesFor(
|
|
75502
|
+
for (const template of candidatesFor(key3, current[key3], given[key3], common)) {
|
|
75498
75503
|
if (halt.by !== void 0)
|
|
75499
75504
|
break;
|
|
75500
75505
|
if (outcome.tried.some((check3) => check3.template === template))
|
|
75501
75506
|
continue;
|
|
75502
|
-
const check2 = await client.withPaths({ [
|
|
75507
|
+
const check2 = await client.withPaths({ [key3]: template }).check(key3, values);
|
|
75503
75508
|
outcome.tried.push(check2);
|
|
75504
75509
|
if (check2.signIn === true) {
|
|
75505
75510
|
halt.by = check2;
|
|
@@ -75563,7 +75568,7 @@ var setSchema = external_exports.object({
|
|
|
75563
75568
|
pattern: external_exports.string().optional().describe("A pattern for trying the pattern addresses. Default the job followed by *.")
|
|
75564
75569
|
});
|
|
75565
75570
|
function render(paths) {
|
|
75566
|
-
const ordered = Object.fromEntries(AUTOSYS_PATH_KEYS.filter((
|
|
75571
|
+
const ordered = Object.fromEntries(AUTOSYS_PATH_KEYS.filter((key3) => paths[key3] !== void 0).map((key3) => [key3, paths[key3]]));
|
|
75567
75572
|
return `${JSON.stringify(ordered, null, 2)}
|
|
75568
75573
|
`;
|
|
75569
75574
|
}
|
|
@@ -75572,26 +75577,26 @@ function plan2(current, addresses2) {
|
|
|
75572
75577
|
const changed = [];
|
|
75573
75578
|
const problems = [];
|
|
75574
75579
|
for (const [raw, template] of Object.entries(addresses2)) {
|
|
75575
|
-
const
|
|
75576
|
-
if (!AUTOSYS_PATH_KEYS.includes(
|
|
75580
|
+
const key3 = raw;
|
|
75581
|
+
if (!AUTOSYS_PATH_KEYS.includes(key3)) {
|
|
75577
75582
|
problems.push(`"${raw}" is not an AutoSys address name - one of ${AUTOSYS_PATH_KEYS.join(", ")}.`);
|
|
75578
75583
|
continue;
|
|
75579
75584
|
}
|
|
75580
|
-
if (template === null || template.trim() === DEFAULT_AUTOSYS_PATHS[
|
|
75581
|
-
if (next[
|
|
75582
|
-
delete next[
|
|
75583
|
-
changed.push(
|
|
75585
|
+
if (template === null || template.trim() === DEFAULT_AUTOSYS_PATHS[key3]) {
|
|
75586
|
+
if (next[key3] !== void 0) {
|
|
75587
|
+
delete next[key3];
|
|
75588
|
+
changed.push(key3);
|
|
75584
75589
|
}
|
|
75585
75590
|
continue;
|
|
75586
75591
|
}
|
|
75587
|
-
const problem = autosysPathProblem(
|
|
75592
|
+
const problem = autosysPathProblem(key3, template.trim());
|
|
75588
75593
|
if (problem !== void 0) {
|
|
75589
|
-
problems.push(`${
|
|
75594
|
+
problems.push(`${key3} "${template}": ${problem}`);
|
|
75590
75595
|
continue;
|
|
75591
75596
|
}
|
|
75592
|
-
if (next[
|
|
75593
|
-
next[
|
|
75594
|
-
changed.push(
|
|
75597
|
+
if (next[key3] !== template.trim()) {
|
|
75598
|
+
next[key3] = template.trim();
|
|
75599
|
+
changed.push(key3);
|
|
75595
75600
|
}
|
|
75596
75601
|
}
|
|
75597
75602
|
return { next, changed, problems };
|
|
@@ -75612,7 +75617,7 @@ function createAutosysSetAddressesTool(options) {
|
|
|
75612
75617
|
if (problems.length > 0)
|
|
75613
75618
|
notes.push(`Will be refused: ${problems.join(" ")}`);
|
|
75614
75619
|
const job = (params3.job ?? options.testJob)?.trim();
|
|
75615
|
-
const tryable = changed.filter((
|
|
75620
|
+
const tryable = changed.filter((key3) => next[key3] !== void 0 && !AUTOSYS_SENDING_KEYS.includes(key3));
|
|
75616
75621
|
if (problems.length === 0 && tryable.length > 0) {
|
|
75617
75622
|
if (job === void 0 || !isAutosysName(job)) {
|
|
75618
75623
|
notes.push("Not tried live: no job to try them with.");
|
|
@@ -75621,14 +75626,14 @@ function createAutosysSetAddressesTool(options) {
|
|
|
75621
75626
|
try {
|
|
75622
75627
|
const client = (await options.client()).withPaths(next);
|
|
75623
75628
|
const values = { job, jobName: job, pattern, boxName: pattern, runNum: "", type: "stderr" };
|
|
75624
|
-
const checks = await Promise.all(tryable.map((
|
|
75629
|
+
const checks = await Promise.all(tryable.map((key3) => client.check(key3, values)));
|
|
75625
75630
|
notes.push(`Tried now with ${job}: ${checks.map((check2) => `${check2.ok ? "\u2713" : "\u2717"} ${check2.key} ${describeCheck(check2)}`).join("; ")}`);
|
|
75626
75631
|
} catch (error51) {
|
|
75627
75632
|
notes.push(`Could not try them: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
75628
75633
|
}
|
|
75629
75634
|
}
|
|
75630
75635
|
}
|
|
75631
|
-
const sent = changed.filter((
|
|
75636
|
+
const sent = changed.filter((key3) => AUTOSYS_SENDING_KEYS.includes(key3) && next[key3] !== void 0);
|
|
75632
75637
|
if (sent.length > 0)
|
|
75633
75638
|
notes.push(`Not tried: ${sent.join(", ")} - those are sent to, and trying would change production.`);
|
|
75634
75639
|
return {
|
|
@@ -75650,7 +75655,7 @@ function createAutosysSetAddressesTool(options) {
|
|
|
75650
75655
|
return {
|
|
75651
75656
|
content: [
|
|
75652
75657
|
`Saved ${changed.join(", ")}. Every AutoSys tool uses them from the next call.`,
|
|
75653
|
-
...changed.map((
|
|
75658
|
+
...changed.map((key3) => `- ${key3}: ${next[key3] ?? `default (${DEFAULT_AUTOSYS_PATHS[key3]})`}`),
|
|
75654
75659
|
"",
|
|
75655
75660
|
SHARE_HINT
|
|
75656
75661
|
].join("\n")
|
|
@@ -75810,12 +75815,18 @@ var MonitorHistoryStore = class {
|
|
|
75810
75815
|
const hits = json2["hits"]?.hits ?? [];
|
|
75811
75816
|
return hits[0]?._source.payload.evaluation;
|
|
75812
75817
|
}
|
|
75813
|
-
|
|
75818
|
+
/**
|
|
75819
|
+
* `attempt` 2 is the one takeover of a window whose winner's check never arrived: a claim of its own, so of the
|
|
75820
|
+
* members taking it over, one does.
|
|
75821
|
+
*/
|
|
75822
|
+
async claim(monitor, slot, attempt = 1) {
|
|
75814
75823
|
await this.ensureIndex();
|
|
75815
|
-
const
|
|
75824
|
+
const id = attempt > 1 ? docId("claim", monitor, `${slot}-r${attempt}`) : docId("claim", monitor, slot);
|
|
75825
|
+
const { status: status2, json: json2 } = await this.send("PUT", `/_create/${encodeURIComponent(id)}`, {
|
|
75816
75826
|
kind: "claim",
|
|
75817
75827
|
monitor,
|
|
75818
75828
|
slot,
|
|
75829
|
+
...attempt > 1 ? { attempt } : {},
|
|
75819
75830
|
by: this.by,
|
|
75820
75831
|
at: Math.floor(Date.now() / 1e3)
|
|
75821
75832
|
});
|
|
@@ -75888,13 +75899,49 @@ var MonitorHistoryStore = class {
|
|
|
75888
75899
|
this.fail("deleting a check", status2, json2);
|
|
75889
75900
|
return Number(json2["deleted"] ?? 0);
|
|
75890
75901
|
}
|
|
75891
|
-
/**
|
|
75892
|
-
|
|
75902
|
+
/**
|
|
75903
|
+
* One change to a monitor - who saved which version, when, with its block - created once per version and block:
|
|
75904
|
+
* every member who sees it arrive offers it, and the first one stands. The audit the grid window's Changes shows.
|
|
75905
|
+
*/
|
|
75906
|
+
async writeRevision(monitor, revision) {
|
|
75907
|
+
await this.ensureIndex();
|
|
75908
|
+
const id = docId("rev", monitor, revision.version ?? 0, revision.hash.slice(0, 16));
|
|
75909
|
+
const { status: status2, json: json2 } = await this.send("PUT", `/_create/${encodeURIComponent(id)}`, {
|
|
75910
|
+
kind: "revision",
|
|
75911
|
+
monitor,
|
|
75912
|
+
// `by` is who offered it, so prune and delete stay to each person's own; the saver is in the payload.
|
|
75913
|
+
by: this.by,
|
|
75914
|
+
at: revision.at,
|
|
75915
|
+
hash: revision.hash,
|
|
75916
|
+
payload: { revision }
|
|
75917
|
+
});
|
|
75918
|
+
if (status2 === 409)
|
|
75919
|
+
return;
|
|
75920
|
+
if (status2 >= 300)
|
|
75921
|
+
this.fail(`recording a change to ${monitor}`, status2, json2);
|
|
75922
|
+
}
|
|
75923
|
+
/** A monitor's changes, newest first, by anyone. */
|
|
75924
|
+
async revisions(monitor, limit = 200) {
|
|
75925
|
+
const json2 = await this.search({
|
|
75926
|
+
size: Math.min(Math.max(limit, 1), 1e3),
|
|
75927
|
+
sort: [{ at: "desc" }],
|
|
75928
|
+
_source: ["payload"],
|
|
75929
|
+
query: { bool: { filter: [{ term: { kind: "revision" } }, { term: { monitor } }] } }
|
|
75930
|
+
});
|
|
75931
|
+
const hits = json2["hits"]?.hits ?? [];
|
|
75932
|
+
return hits.map((h) => h._source.payload.revision);
|
|
75933
|
+
}
|
|
75934
|
+
/**
|
|
75935
|
+
* Removes this person's checks and claims older than `before` - only theirs. How many went. A monitor's change
|
|
75936
|
+
* record is its audit, not its history, so it stays - unless `revisions` (the monitor itself is being deleted).
|
|
75937
|
+
*/
|
|
75938
|
+
async prune(before, monitor, revisions = false) {
|
|
75893
75939
|
await this.ensureIndex();
|
|
75894
75940
|
const filter = [{ term: { by: this.by } }, { range: { at: { lt: before } } }];
|
|
75895
75941
|
if (monitor !== void 0)
|
|
75896
75942
|
filter.push({ term: { monitor } });
|
|
75897
|
-
const {
|
|
75943
|
+
const query = { bool: { filter, ...revisions ? {} : { must_not: [{ term: { kind: "revision" } }] } } };
|
|
75944
|
+
const { status: status2, json: json2 } = await this.send("POST", "/_delete_by_query?conflicts=proceed", { query });
|
|
75898
75945
|
if (status2 >= 300)
|
|
75899
75946
|
this.fail("cleaning up monitoring history", status2, json2);
|
|
75900
75947
|
return Number(json2["deleted"] ?? 0);
|
|
@@ -76001,13 +76048,13 @@ function checkMonitorRows(text2) {
|
|
|
76001
76048
|
for (const k of Object.keys(r))
|
|
76002
76049
|
if (!keys.includes(k))
|
|
76003
76050
|
keys.push(k);
|
|
76004
|
-
const columns = keys.map((
|
|
76005
|
-
const values = records.map((r) => r[
|
|
76051
|
+
const columns = keys.map((key3) => {
|
|
76052
|
+
const values = records.map((r) => r[key3]);
|
|
76006
76053
|
const types = new Set(values.map(typeOf).filter((t) => t !== "empty"));
|
|
76007
76054
|
const type = types.size === 0 ? "empty" : types.size === 1 ? [...types][0] ?? "empty" : "mixed";
|
|
76008
76055
|
const sample = values.find((v) => typeOf(v) !== "empty");
|
|
76009
76056
|
return {
|
|
76010
|
-
key:
|
|
76057
|
+
key: key3,
|
|
76011
76058
|
type,
|
|
76012
76059
|
...sample !== void 0 ? { example: typeof sample === "object" ? JSON.stringify(sample).slice(0, 60) : String(sample).slice(0, 60) } : {},
|
|
76013
76060
|
present: values.filter((v) => typeOf(v) !== "empty").length
|
|
@@ -76136,9 +76183,9 @@ var createSchema2 = external_exports.object({
|
|
|
76136
76183
|
});
|
|
76137
76184
|
function monitorBlock(params3) {
|
|
76138
76185
|
const spec = { title: params3.title, summary: params3.summary, ...params3.every !== void 0 ? { every: params3.every } : {} };
|
|
76139
|
-
for (const
|
|
76140
|
-
if (params3[
|
|
76141
|
-
spec[
|
|
76186
|
+
for (const key3 of ["at", "activeHours", "days", "source", "rows", "columns", "key", "rules", "whenEmpty", "whenClear", "notify", "details", "timeoutSeconds", "runbook"]) {
|
|
76187
|
+
if (params3[key3] !== void 0)
|
|
76188
|
+
spec[key3] = params3[key3];
|
|
76142
76189
|
}
|
|
76143
76190
|
return JSON.stringify(spec, null, 2);
|
|
76144
76191
|
}
|
|
@@ -77062,9 +77109,9 @@ function maskUrl(url2) {
|
|
|
77062
77109
|
if (parsed.username !== "" || parsed.password !== "") {
|
|
77063
77110
|
parsed.password = parsed.password === "" ? "" : MASK;
|
|
77064
77111
|
}
|
|
77065
|
-
for (const
|
|
77066
|
-
if (SECRET_NAME.test(
|
|
77067
|
-
parsed.searchParams.set(
|
|
77112
|
+
for (const key3 of [...parsed.searchParams.keys()])
|
|
77113
|
+
if (SECRET_NAME.test(key3))
|
|
77114
|
+
parsed.searchParams.set(key3, MASK);
|
|
77068
77115
|
return decodeURI(parsed.toString());
|
|
77069
77116
|
} catch {
|
|
77070
77117
|
return url2;
|
|
@@ -77084,7 +77131,7 @@ function maskBody(body, knownSecrets = []) {
|
|
|
77084
77131
|
if (Array.isArray(value))
|
|
77085
77132
|
return value.map(walk);
|
|
77086
77133
|
if (value !== null && typeof value === "object") {
|
|
77087
|
-
return Object.fromEntries(Object.entries(value).map(([
|
|
77134
|
+
return Object.fromEntries(Object.entries(value).map(([key3, inner]) => [key3, SECRET_NAME.test(key3) && typeof inner !== "object" ? MASK : walk(inner)]));
|
|
77088
77135
|
}
|
|
77089
77136
|
return value;
|
|
77090
77137
|
};
|
|
@@ -77266,11 +77313,11 @@ var SHOWN_FIELDS = /* @__PURE__ */ new Set([
|
|
|
77266
77313
|
"timeoriginalestimate",
|
|
77267
77314
|
"thumbnail"
|
|
77268
77315
|
]);
|
|
77269
|
-
function isIssueKey(
|
|
77270
|
-
return /^[A-Za-z][A-Za-z0-9_]*-\d+$/.test(
|
|
77316
|
+
function isIssueKey(key3) {
|
|
77317
|
+
return /^[A-Za-z][A-Za-z0-9_]*-\d+$/.test(key3);
|
|
77271
77318
|
}
|
|
77272
|
-
function isProjectKey(
|
|
77273
|
-
return /^[A-Za-z][A-Za-z0-9_]*$/.test(
|
|
77319
|
+
function isProjectKey(key3) {
|
|
77320
|
+
return /^[A-Za-z][A-Za-z0-9_]*$/.test(key3);
|
|
77274
77321
|
}
|
|
77275
77322
|
function renderValue2(value) {
|
|
77276
77323
|
if (value === null || value === void 0 || value === "")
|
|
@@ -77310,10 +77357,10 @@ var JiraClient = class {
|
|
|
77310
77357
|
const result = await this.rest.json("searching", `/rest/api/2/search?${query.toString()}`, { method: "GET" }, signal);
|
|
77311
77358
|
return (result.issues ?? []).map((raw) => this.summary(raw));
|
|
77312
77359
|
}
|
|
77313
|
-
async getIssue(
|
|
77314
|
-
if (!isIssueKey(
|
|
77315
|
-
throw new AtlassianError(`"${
|
|
77316
|
-
const raw = await this.rest.json(`reading ${
|
|
77360
|
+
async getIssue(key3, signal) {
|
|
77361
|
+
if (!isIssueKey(key3))
|
|
77362
|
+
throw new AtlassianError(`"${key3}" is not an issue key \u2014 those look like ABC-123.`);
|
|
77363
|
+
const raw = await this.rest.json(`reading ${key3}`, `/rest/api/2/issue/${key3}?fields=*all&expand=names`, { method: "GET" }, signal);
|
|
77317
77364
|
const fields = raw.fields ?? {};
|
|
77318
77365
|
const names = raw.names ?? {};
|
|
77319
77366
|
const otherFields = [];
|
|
@@ -77355,19 +77402,19 @@ var JiraClient = class {
|
|
|
77355
77402
|
}
|
|
77356
77403
|
async createIssue(fields, update, signal) {
|
|
77357
77404
|
const created = await this.rest.json(`creating "${String(fields["summary"] ?? "an issue")}"`, "/rest/api/2/issue", { method: "POST", body: JSON.stringify({ fields, ...update !== void 0 ? { update } : {} }) }, signal);
|
|
77358
|
-
const
|
|
77359
|
-
return { key:
|
|
77405
|
+
const key3 = created.key ?? "";
|
|
77406
|
+
return { key: key3, url: this.rest.url(`/browse/${key3}`) };
|
|
77360
77407
|
}
|
|
77361
|
-
async updateIssue(
|
|
77362
|
-
await this.rest.json(`updating ${
|
|
77408
|
+
async updateIssue(key3, fields, update, signal) {
|
|
77409
|
+
await this.rest.json(`updating ${key3}`, `/rest/api/2/issue/${key3}`, { method: "PUT", body: JSON.stringify({ fields, ...update !== void 0 ? { update } : {} }) }, signal);
|
|
77363
77410
|
}
|
|
77364
77411
|
/** Jira keeps every upload, so attaching a name twice gives two attachments rather than a replacement. */
|
|
77365
|
-
async attach(
|
|
77412
|
+
async attach(key3, file2, signal) {
|
|
77366
77413
|
if (!isSafeAttachmentName(file2.name)) {
|
|
77367
77414
|
throw new AtlassianError(`"${file2.name}" cannot be used as an attachment name: letters, digits, spaces, ".", "_", "-" and brackets only.`);
|
|
77368
77415
|
}
|
|
77369
77416
|
const body = multipartBody(file2);
|
|
77370
|
-
await this.rest.send(`attaching ${file2.name} to ${
|
|
77417
|
+
await this.rest.send(`attaching ${file2.name} to ${key3}`, `/rest/api/2/issue/${key3}/attachments`, {
|
|
77371
77418
|
method: "POST",
|
|
77372
77419
|
// Required for any multipart write, or Jira refuses it as a possible CSRF.
|
|
77373
77420
|
headers: { "Content-Type": body.contentType, "X-Atlassian-Token": "no-check" },
|
|
@@ -77385,19 +77432,19 @@ var JiraClient = class {
|
|
|
77385
77432
|
}
|
|
77386
77433
|
return this.rest.bytes(`downloading ${attachment.name}`, attachment.content.slice(this.rest.base.length), signal);
|
|
77387
77434
|
}
|
|
77388
|
-
async addComment(
|
|
77389
|
-
await this.rest.json(`commenting on ${
|
|
77435
|
+
async addComment(key3, body, signal) {
|
|
77436
|
+
await this.rest.json(`commenting on ${key3}`, `/rest/api/2/issue/${key3}/comment`, { method: "POST", body: JSON.stringify({ body }) }, signal);
|
|
77390
77437
|
}
|
|
77391
|
-
async transitions(
|
|
77392
|
-
const result = await this.rest.json(`reading the transitions of ${
|
|
77438
|
+
async transitions(key3, signal) {
|
|
77439
|
+
const result = await this.rest.json(`reading the transitions of ${key3}`, `/rest/api/2/issue/${key3}/transitions`, { method: "GET" }, signal);
|
|
77393
77440
|
return (result.transitions ?? []).map((transition) => ({
|
|
77394
77441
|
id: transition.id ?? "",
|
|
77395
77442
|
name: transition.name ?? "",
|
|
77396
77443
|
to: transition.to?.name ?? transition.name ?? ""
|
|
77397
77444
|
}));
|
|
77398
77445
|
}
|
|
77399
|
-
async transition(
|
|
77400
|
-
await this.rest.json(`moving ${
|
|
77446
|
+
async transition(key3, id, signal) {
|
|
77447
|
+
await this.rest.json(`moving ${key3}`, `/rest/api/2/issue/${key3}/transitions`, { method: "POST", body: JSON.stringify({ transition: { id } }) }, signal);
|
|
77401
77448
|
}
|
|
77402
77449
|
/**
|
|
77403
77450
|
* A person, as Jira's `name` (the username Data Center assigns by).
|
|
@@ -77423,15 +77470,15 @@ var JiraClient = class {
|
|
|
77423
77470
|
throw new AtlassianError(`No Jira user matches "${wanted}".`);
|
|
77424
77471
|
throw new AtlassianError(`"${wanted}" matches several Jira users: ${people.slice(0, 8).map((person) => `${person.displayName ?? "?"} (${person.name ?? "?"})`).join(", ")}. Give the username.`);
|
|
77425
77472
|
}
|
|
77426
|
-
async project(
|
|
77427
|
-
if (!isProjectKey(
|
|
77428
|
-
throw new AtlassianError(`"${
|
|
77429
|
-
const project = await this.rest.json(`reading project ${
|
|
77430
|
-
const components = await this.rest.json(`reading the components of ${
|
|
77431
|
-
const versions = await this.rest.json(`reading the versions of ${
|
|
77473
|
+
async project(key3, signal) {
|
|
77474
|
+
if (!isProjectKey(key3))
|
|
77475
|
+
throw new AtlassianError(`"${key3}" is not a project key.`);
|
|
77476
|
+
const project = await this.rest.json(`reading project ${key3}`, `/rest/api/2/project/${key3}`, { method: "GET" }, signal);
|
|
77477
|
+
const components = await this.rest.json(`reading the components of ${key3}`, `/rest/api/2/project/${key3}/components`, { method: "GET" }, signal).catch(() => []);
|
|
77478
|
+
const versions = await this.rest.json(`reading the versions of ${key3}`, `/rest/api/2/project/${key3}/versions`, { method: "GET" }, signal).catch(() => []);
|
|
77432
77479
|
return {
|
|
77433
|
-
key: project.key ??
|
|
77434
|
-
name: project.name ??
|
|
77480
|
+
key: project.key ?? key3,
|
|
77481
|
+
name: project.name ?? key3,
|
|
77435
77482
|
issueTypes: (project.issueTypes ?? []).map((type) => ({ id: type.id ?? "", name: type.name ?? "", subtask: type.subtask === true })),
|
|
77436
77483
|
components: components.map((component) => component.name ?? "").filter((name) => name.length > 0),
|
|
77437
77484
|
versions: versions.filter((version2) => version2.archived !== true).map((version2) => ({ name: version2.name ?? "", released: version2.released === true }))
|
|
@@ -77455,22 +77502,22 @@ var JiraClient = class {
|
|
|
77455
77502
|
return Object.entries(fields).map(([id, field2]) => fieldInfo(id, field2));
|
|
77456
77503
|
}
|
|
77457
77504
|
/** The fields an existing issue can be edited in, with allowed values. */
|
|
77458
|
-
async editFields(
|
|
77459
|
-
const result = await this.rest.json(`reading what can be edited on ${
|
|
77505
|
+
async editFields(key3, signal) {
|
|
77506
|
+
const result = await this.rest.json(`reading what can be edited on ${key3}`, `/rest/api/2/issue/${key3}/editmeta`, { method: "GET" }, signal);
|
|
77460
77507
|
return Object.entries(result.fields ?? {}).map(([id, field2]) => fieldInfo(id, field2));
|
|
77461
77508
|
}
|
|
77462
77509
|
summary(raw) {
|
|
77463
|
-
const
|
|
77510
|
+
const key3 = raw.key ?? "";
|
|
77464
77511
|
const fields = raw.fields ?? {};
|
|
77465
77512
|
return {
|
|
77466
|
-
key:
|
|
77513
|
+
key: key3,
|
|
77467
77514
|
summary: fields.summary ?? "",
|
|
77468
77515
|
status: fields.status?.name ?? "?",
|
|
77469
77516
|
type: fields.issuetype?.name ?? "?",
|
|
77470
77517
|
assignee: fields.assignee?.displayName ?? void 0,
|
|
77471
77518
|
priority: fields.priority?.name ?? void 0,
|
|
77472
77519
|
updated: fields.updated,
|
|
77473
|
-
url: this.rest.url(`/browse/${
|
|
77520
|
+
url: this.rest.url(`/browse/${key3}`)
|
|
77474
77521
|
};
|
|
77475
77522
|
}
|
|
77476
77523
|
};
|
|
@@ -77658,10 +77705,10 @@ function createJiraProjectTool(options) {
|
|
|
77658
77705
|
try {
|
|
77659
77706
|
const client = await options.client();
|
|
77660
77707
|
if (params3.issueKey !== void 0) {
|
|
77661
|
-
const
|
|
77662
|
-
if (!isIssueKey(
|
|
77663
|
-
return { content: `"${
|
|
77664
|
-
return { content: [`Fields ${
|
|
77708
|
+
const key3 = params3.issueKey.trim();
|
|
77709
|
+
if (!isIssueKey(key3))
|
|
77710
|
+
return { content: `"${key3}" is not an issue key.`, isError: true };
|
|
77711
|
+
return { content: [`Fields ${key3} can be edited in:`, ...describeFields(await client.editFields(key3))].join("\n") };
|
|
77665
77712
|
}
|
|
77666
77713
|
const projectKey = (params3.project ?? options.defaultProject)?.trim();
|
|
77667
77714
|
if (projectKey === void 0 || projectKey.length === 0) {
|
|
@@ -77769,8 +77816,8 @@ async function unknownNames(client, projectKey, params3) {
|
|
|
77769
77816
|
check2("Version", [...params3.fixVersions ?? [], ...params3.affectsVersions ?? []], project.versions.map((version2) => version2.name));
|
|
77770
77817
|
return problems;
|
|
77771
77818
|
}
|
|
77772
|
-
function describeLinks(
|
|
77773
|
-
return (params3.links ?? []).map((link) => link.direction === "inward" ? `Link: ${link.issueKey} \u2014[${link.type}]\u2192 ${
|
|
77819
|
+
function describeLinks(key3, params3) {
|
|
77820
|
+
return (params3.links ?? []).map((link) => link.direction === "inward" ? `Link: ${link.issueKey} \u2014[${link.type}]\u2192 ${key3}` : `Link: ${key3} \u2014[${link.type}]\u2192 ${link.issueKey}`);
|
|
77774
77821
|
}
|
|
77775
77822
|
function describeExtraFields(params3) {
|
|
77776
77823
|
return Object.entries(params3.fields ?? {}).map(([id, value]) => `${id}: ${JSON.stringify(value)}`);
|
|
@@ -77859,7 +77906,7 @@ ${params3.comment}`);
|
|
|
77859
77906
|
return { content: prepared.message, isError: true };
|
|
77860
77907
|
const client = await options.client();
|
|
77861
77908
|
const { fields, update } = await buildChange(client, params3);
|
|
77862
|
-
let
|
|
77909
|
+
let key3;
|
|
77863
77910
|
let url2;
|
|
77864
77911
|
const done = [];
|
|
77865
77912
|
if (params3.issueKey === void 0) {
|
|
@@ -77869,15 +77916,15 @@ ${params3.comment}`);
|
|
|
77869
77916
|
if (params3.summary === void 0)
|
|
77870
77917
|
return { content: "A new issue needs a summary.", isError: true };
|
|
77871
77918
|
const created = await client.createIssue({ project: { key: project }, issuetype: { name: params3.issueType ?? "Task" }, ...fields }, update);
|
|
77872
|
-
|
|
77919
|
+
key3 = created.key;
|
|
77873
77920
|
url2 = created.url;
|
|
77874
|
-
done.push(`Created ${
|
|
77921
|
+
done.push(`Created ${key3}.`);
|
|
77875
77922
|
} else {
|
|
77876
77923
|
const current = await client.getIssue(params3.issueKey.trim());
|
|
77877
|
-
|
|
77924
|
+
key3 = current.key;
|
|
77878
77925
|
url2 = current.url;
|
|
77879
77926
|
if (Object.keys(fields).length > 0 || update !== void 0) {
|
|
77880
|
-
await client.updateIssue(
|
|
77927
|
+
await client.updateIssue(key3, fields, update);
|
|
77881
77928
|
const changed = [...Object.keys(fields), ...update !== void 0 ? ["links"] : []];
|
|
77882
77929
|
done.push(`Updated ${changed.join(", ")}.`);
|
|
77883
77930
|
}
|
|
@@ -77886,7 +77933,7 @@ ${params3.comment}`);
|
|
|
77886
77933
|
const attached = [];
|
|
77887
77934
|
for (const file2 of prepared.files) {
|
|
77888
77935
|
try {
|
|
77889
|
-
await client.attach(
|
|
77936
|
+
await client.attach(key3, file2);
|
|
77890
77937
|
attached.push(file2);
|
|
77891
77938
|
} catch (error51) {
|
|
77892
77939
|
failed2.push(`${file2.name}: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
@@ -77896,20 +77943,20 @@ ${params3.comment}`);
|
|
|
77896
77943
|
done.push(`Attached ${attached.map((file2) => file2.name).join(", ")}.`);
|
|
77897
77944
|
if (params3.comment !== void 0) {
|
|
77898
77945
|
try {
|
|
77899
|
-
await client.addComment(
|
|
77946
|
+
await client.addComment(key3, params3.comment);
|
|
77900
77947
|
done.push("Comment added.");
|
|
77901
77948
|
} catch (error51) {
|
|
77902
77949
|
failed2.push(`Comment: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
77903
77950
|
}
|
|
77904
77951
|
}
|
|
77905
77952
|
if (params3.transition !== void 0) {
|
|
77906
|
-
const available = await client.transitions(
|
|
77953
|
+
const available = await client.transitions(key3).catch(() => []);
|
|
77907
77954
|
const move = findTransition(available, params3.transition);
|
|
77908
77955
|
if (move === void 0) {
|
|
77909
77956
|
failed2.push(`No move to "${params3.transition}" from here. Available: ${available.map((entry) => entry.to).join(", ") || "none"}.`);
|
|
77910
77957
|
} else {
|
|
77911
77958
|
try {
|
|
77912
|
-
await client.transition(
|
|
77959
|
+
await client.transition(key3, move.id);
|
|
77913
77960
|
done.push(`Moved to ${move.to}.`);
|
|
77914
77961
|
} catch (error51) {
|
|
77915
77962
|
failed2.push(`Move: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
@@ -77917,7 +77964,7 @@ ${params3.comment}`);
|
|
|
77917
77964
|
}
|
|
77918
77965
|
}
|
|
77919
77966
|
return {
|
|
77920
|
-
content: [`${
|
|
77967
|
+
content: [`${key3}: ${done.join(" ") || "Nothing changed."}`, `Link: ${url2}`, ...failed2.length > 0 ? ["Not done:", ...failed2.map((line) => `- ${line}`)] : []].join("\n"),
|
|
77921
77968
|
...failed2.length > 0 ? { isError: true } : {}
|
|
77922
77969
|
};
|
|
77923
77970
|
} catch (error51) {
|
|
@@ -78232,13 +78279,28 @@ var INLINE = new RegExp([
|
|
|
78232
78279
|
String.raw`(~~)(` + EMPHASIS + String.raw`)\7`,
|
|
78233
78280
|
String.raw`(\*|_)(` + EMPHASIS + String.raw`)\9`
|
|
78234
78281
|
].join("|"));
|
|
78282
|
+
var WORD = /[\p{L}\p{N}]/u;
|
|
78235
78283
|
function parseInline(source) {
|
|
78236
78284
|
const out = [];
|
|
78237
78285
|
let rest = source;
|
|
78286
|
+
let before = "";
|
|
78238
78287
|
while (rest.length > 0) {
|
|
78239
78288
|
const match = INLINE.exec(rest);
|
|
78240
78289
|
if (match === null || match.index === void 0)
|
|
78241
78290
|
break;
|
|
78291
|
+
const delimiter = match[5] ?? match[9];
|
|
78292
|
+
if (delimiter !== void 0 && delimiter.startsWith("_")) {
|
|
78293
|
+
const prev = match.index > 0 ? rest[match.index - 1] ?? "" : before;
|
|
78294
|
+
const next = rest[match.index + match[0].length] ?? "";
|
|
78295
|
+
const dunder = delimiter === "__" && /^[A-Za-z0-9_]+$/.test(match[6] ?? "");
|
|
78296
|
+
if (WORD.test(prev) || WORD.test(next) || dunder) {
|
|
78297
|
+
const upto = match.index + delimiter.length;
|
|
78298
|
+
out.push({ kind: "text", text: rest.slice(0, upto) });
|
|
78299
|
+
before = rest[upto - 1] ?? "";
|
|
78300
|
+
rest = rest.slice(upto);
|
|
78301
|
+
continue;
|
|
78302
|
+
}
|
|
78303
|
+
}
|
|
78242
78304
|
if (match.index > 0)
|
|
78243
78305
|
out.push({ kind: "text", text: rest.slice(0, match.index) });
|
|
78244
78306
|
if (match[1] !== void 0) {
|
|
@@ -78254,10 +78316,22 @@ function parseInline(source) {
|
|
|
78254
78316
|
} else if (match[9] !== void 0) {
|
|
78255
78317
|
out.push({ kind: "em", children: parseInline(match[10] ?? "") });
|
|
78256
78318
|
}
|
|
78319
|
+
before = rest[match.index + match[0].length - 1] ?? "";
|
|
78257
78320
|
rest = rest.slice(match.index + match[0].length);
|
|
78258
78321
|
}
|
|
78259
78322
|
if (rest.length > 0)
|
|
78260
78323
|
out.push({ kind: "text", text: rest });
|
|
78324
|
+
return mergeText(out);
|
|
78325
|
+
}
|
|
78326
|
+
function mergeText(parts) {
|
|
78327
|
+
const out = [];
|
|
78328
|
+
for (const part of parts) {
|
|
78329
|
+
const last = out[out.length - 1];
|
|
78330
|
+
if (part.kind === "text" && last !== void 0 && last.kind === "text")
|
|
78331
|
+
out[out.length - 1] = { kind: "text", text: last.text + part.text };
|
|
78332
|
+
else
|
|
78333
|
+
out.push(part);
|
|
78334
|
+
}
|
|
78261
78335
|
return out;
|
|
78262
78336
|
}
|
|
78263
78337
|
|
|
@@ -79727,15 +79801,15 @@ function confineKey(requested2, prefix) {
|
|
|
79727
79801
|
const base = normalisePrefix(prefix);
|
|
79728
79802
|
if (base === "")
|
|
79729
79803
|
return { ok: true, key: clean };
|
|
79730
|
-
const
|
|
79731
|
-
if (!
|
|
79804
|
+
const key3 = clean.startsWith(base) ? clean : `${base}${clean}`;
|
|
79805
|
+
if (!key3.startsWith(base)) {
|
|
79732
79806
|
return { ok: false, message: `"${requested2}" is outside "${base}", which this connection is limited to.` };
|
|
79733
79807
|
}
|
|
79734
|
-
return { ok: true, key:
|
|
79808
|
+
return { ok: true, key: key3 };
|
|
79735
79809
|
}
|
|
79736
|
-
function displayKey(
|
|
79810
|
+
function displayKey(key3, prefix) {
|
|
79737
79811
|
const base = normalisePrefix(prefix);
|
|
79738
|
-
return base !== "" &&
|
|
79812
|
+
return base !== "" && key3.startsWith(base) ? key3.slice(base.length) : key3;
|
|
79739
79813
|
}
|
|
79740
79814
|
|
|
79741
79815
|
// ../../packages/core/dist/usage/store.js
|
|
@@ -79946,8 +80020,8 @@ var S3ShardStore = class {
|
|
|
79946
80020
|
this.label = `s3://${bucket}/${this.base}`;
|
|
79947
80021
|
}
|
|
79948
80022
|
async put(shard, events) {
|
|
79949
|
-
const
|
|
79950
|
-
await this.client.put(
|
|
80023
|
+
const key3 = `${this.base}${shardSegment(shard.user)}/${shard.day}__${shard.instance}.jsonl`;
|
|
80024
|
+
await this.client.put(key3, Buffer.from(shardText(events), "utf8"), "application/x-ndjson");
|
|
79951
80025
|
}
|
|
79952
80026
|
/** Every shard object, as `{ user, name, key }`. */
|
|
79953
80027
|
async listFiles() {
|
|
@@ -80166,13 +80240,13 @@ async function rollUpMonths(options) {
|
|
|
80166
80240
|
const month = shard.month ?? shard.day?.slice(0, 7);
|
|
80167
80241
|
if (month === void 0)
|
|
80168
80242
|
continue;
|
|
80169
|
-
const
|
|
80170
|
-
const group = groups.get(
|
|
80243
|
+
const key3 = `${shard.user}|${month}`;
|
|
80244
|
+
const group = groups.get(key3) ?? { user: shard.user, month, days: [] };
|
|
80171
80245
|
if (shard.month !== void 0)
|
|
80172
80246
|
group.monthShard = shard;
|
|
80173
80247
|
else
|
|
80174
80248
|
group.days.push(shard);
|
|
80175
|
-
groups.set(
|
|
80249
|
+
groups.set(key3, group);
|
|
80176
80250
|
}
|
|
80177
80251
|
let months = 0;
|
|
80178
80252
|
let removed = 0;
|
|
@@ -80264,11 +80338,11 @@ function bucketIndex(starts, t) {
|
|
|
80264
80338
|
function normalisedName(name) {
|
|
80265
80339
|
return name.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
80266
80340
|
}
|
|
80267
|
-
function
|
|
80341
|
+
function key2(kind, name) {
|
|
80268
80342
|
return `${kind}:${name}`;
|
|
80269
80343
|
}
|
|
80270
80344
|
function inventoryKey(event) {
|
|
80271
|
-
return event.k === "tool" && event.n.startsWith("py__") ?
|
|
80345
|
+
return event.k === "tool" && event.n.startsWith("py__") ? key2("tool", event.n.slice(4)) : key2(event.k, event.n);
|
|
80272
80346
|
}
|
|
80273
80347
|
function count2(events) {
|
|
80274
80348
|
const people = /* @__PURE__ */ new Set();
|
|
@@ -80330,11 +80404,11 @@ function computeDashboard(input) {
|
|
|
80330
80404
|
}
|
|
80331
80405
|
const installed = /* @__PURE__ */ new Map();
|
|
80332
80406
|
for (const item of input.inventory)
|
|
80333
|
-
if (!installed.has(
|
|
80334
|
-
installed.set(
|
|
80407
|
+
if (!installed.has(key2(item.kind, item.name)))
|
|
80408
|
+
installed.set(key2(item.kind, item.name), item);
|
|
80335
80409
|
const ranked = /* @__PURE__ */ new Map();
|
|
80336
80410
|
for (const event of current) {
|
|
80337
|
-
const id =
|
|
80411
|
+
const id = key2(event.k, event.n);
|
|
80338
80412
|
let entry = ranked.get(id);
|
|
80339
80413
|
if (entry === void 0) {
|
|
80340
80414
|
const item = installed.get(inventoryKey(event));
|
|
@@ -80367,7 +80441,7 @@ function computeDashboard(input) {
|
|
|
80367
80441
|
entry.spark[bucketIndex(starts, event.t)]++;
|
|
80368
80442
|
}
|
|
80369
80443
|
for (const event of previous) {
|
|
80370
|
-
const entry = ranked.get(
|
|
80444
|
+
const entry = ranked.get(key2(event.k, event.n));
|
|
80371
80445
|
if (entry !== void 0)
|
|
80372
80446
|
entry.previous++;
|
|
80373
80447
|
}
|
|
@@ -80468,7 +80542,7 @@ function computeDashboard(input) {
|
|
|
80468
80542
|
};
|
|
80469
80543
|
const usedKeys = new Set(allInRange.map(inventoryKey));
|
|
80470
80544
|
const yearAgo = to - 365 * DAY;
|
|
80471
|
-
const unused = input.inventory.filter((item) => !usedKeys.has(
|
|
80545
|
+
const unused = input.inventory.filter((item) => !usedKeys.has(key2(item.kind, item.name))).map((item) => ({
|
|
80472
80546
|
kind: item.kind,
|
|
80473
80547
|
name: item.name,
|
|
80474
80548
|
filePath: item.filePath,
|
|
@@ -80634,7 +80708,7 @@ function findProblems(inventory, ranked, events, installed) {
|
|
|
80634
80708
|
}))
|
|
80635
80709
|
});
|
|
80636
80710
|
}
|
|
80637
|
-
const missing = [...new Set(events.filter((event) => event.k === "skill" && !installed.has(
|
|
80711
|
+
const missing = [...new Set(events.filter((event) => event.k === "skill" && !installed.has(key2("skill", event.n))).map((event) => event.n))];
|
|
80638
80712
|
if (missing.length > 0) {
|
|
80639
80713
|
problems.push({
|
|
80640
80714
|
severity: "info",
|
|
@@ -81164,12 +81238,12 @@ async function toSummary(profile, secrets) {
|
|
|
81164
81238
|
}
|
|
81165
81239
|
function stripEmpty(source) {
|
|
81166
81240
|
const result = {};
|
|
81167
|
-
for (const [
|
|
81241
|
+
for (const [key3, value] of Object.entries(source)) {
|
|
81168
81242
|
if (typeof value === "string" && value.trim().length === 0)
|
|
81169
81243
|
continue;
|
|
81170
81244
|
if (value === void 0)
|
|
81171
81245
|
continue;
|
|
81172
|
-
result[
|
|
81246
|
+
result[key3] = typeof value === "string" ? value.trim() : value;
|
|
81173
81247
|
}
|
|
81174
81248
|
return result;
|
|
81175
81249
|
}
|
|
@@ -82202,8 +82276,8 @@ ${preview.text}` } : {}
|
|
|
82202
82276
|
const MENTION_RESULT_LIMIT = 30;
|
|
82203
82277
|
let scheduleToolAccess;
|
|
82204
82278
|
const approvalsKey = projectRoot ?? "__no_workspace__";
|
|
82205
|
-
function comparableApprovalsKey(
|
|
82206
|
-
return
|
|
82279
|
+
function comparableApprovalsKey(key3) {
|
|
82280
|
+
return key3 === "__no_workspace__" ? key3 : normalizeForComparison(import_node_path52.default.resolve(key3));
|
|
82207
82281
|
}
|
|
82208
82282
|
function approvalsFrom(stored) {
|
|
82209
82283
|
if (stored === void 0)
|
|
@@ -82212,8 +82286,8 @@ ${preview.text}` } : {}
|
|
|
82212
82286
|
if (exact !== void 0)
|
|
82213
82287
|
return exact;
|
|
82214
82288
|
const wanted = comparableApprovalsKey(approvalsKey);
|
|
82215
|
-
for (const [
|
|
82216
|
-
if (comparableApprovalsKey(
|
|
82289
|
+
for (const [key3, value] of Object.entries(stored)) {
|
|
82290
|
+
if (comparableApprovalsKey(key3) === wanted)
|
|
82217
82291
|
return value;
|
|
82218
82292
|
}
|
|
82219
82293
|
return {};
|
|
@@ -82315,8 +82389,8 @@ ${preview.text}` } : {}
|
|
|
82315
82389
|
}
|
|
82316
82390
|
const sessionPathGrants = /* @__PURE__ */ new Set();
|
|
82317
82391
|
async function requestPathAccess(realPath) {
|
|
82318
|
-
const
|
|
82319
|
-
if (sessionPathGrants.has(
|
|
82392
|
+
const key3 = normalizeForComparison(realPath);
|
|
82393
|
+
if (sessionPathGrants.has(key3))
|
|
82320
82394
|
return true;
|
|
82321
82395
|
const id = `path-${String(Date.now())}-${String(Math.random()).slice(2, 8)}`;
|
|
82322
82396
|
pendingPathApprovals.set(id, realPath);
|
|
@@ -82341,7 +82415,7 @@ ${preview.text}` } : {}
|
|
|
82341
82415
|
});
|
|
82342
82416
|
if (decision !== "approve")
|
|
82343
82417
|
return false;
|
|
82344
|
-
sessionPathGrants.add(
|
|
82418
|
+
sessionPathGrants.add(key3);
|
|
82345
82419
|
return true;
|
|
82346
82420
|
} finally {
|
|
82347
82421
|
pendingPathApprovals.delete(id);
|
|
@@ -83583,12 +83657,12 @@ ${error51.stack.split("\n").slice(1, 6).join("\n")}`;
|
|
|
83583
83657
|
}
|
|
83584
83658
|
let cachedAuth;
|
|
83585
83659
|
function authStrategyFor(config2, profile) {
|
|
83586
|
-
const
|
|
83660
|
+
const key3 = `${profile.id}|${profile.baseUrl}|${JSON.stringify(profile.auth)}|${config2.certDir ?? ""}|${JSON.stringify(config2.tls ?? {})}`;
|
|
83587
83661
|
const cached2 = cachedAuth;
|
|
83588
|
-
if (cached2 !== void 0 && cached2.key ===
|
|
83662
|
+
if (cached2 !== void 0 && cached2.key === key3)
|
|
83589
83663
|
return cached2.strategy;
|
|
83590
83664
|
const strategy = createAuthStrategy(profile.auth, buildAuthContext(config2, profile));
|
|
83591
|
-
cachedAuth = { key:
|
|
83665
|
+
cachedAuth = { key: key3, strategy };
|
|
83592
83666
|
return strategy;
|
|
83593
83667
|
}
|
|
83594
83668
|
function buildAuthContext(config2, profile) {
|
|
@@ -85951,9 +86025,9 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
85951
86025
|
if (auth2.clientId === void 0 || auth2.clientSecretRef === void 0) {
|
|
85952
86026
|
throw new AtlassianError("AutoSys uses the API gateway but the client id or secret is missing. Settings \u2192 DevOps \u2192 AutoSys \u2192 API gateway: enter both and save.");
|
|
85953
86027
|
}
|
|
85954
|
-
const
|
|
86028
|
+
const key3 = JSON.stringify({ auth: auth2, baseUrl: config2.autosys?.baseUrl, tls: tls2 === void 0 ? 0 : (0, import_node_crypto17.createHash)("sha256").update(JSON.stringify(tls2)).digest("hex") });
|
|
85955
86029
|
const testing = http !== httpClient;
|
|
85956
|
-
if (!testing && autosysGateway?.key ===
|
|
86030
|
+
if (!testing && autosysGateway?.key === key3)
|
|
85957
86031
|
return autosysGateway.strategy;
|
|
85958
86032
|
const secretRef = auth2.clientSecretRef;
|
|
85959
86033
|
const strategy = new ApigeeMtlsAuthStrategy(
|
|
@@ -85980,7 +86054,7 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
85980
86054
|
async () => tls2
|
|
85981
86055
|
);
|
|
85982
86056
|
if (!testing)
|
|
85983
|
-
autosysGateway = { key:
|
|
86057
|
+
autosysGateway = { key: key3, strategy };
|
|
85984
86058
|
return strategy;
|
|
85985
86059
|
}
|
|
85986
86060
|
async function atlassianConnection(product, http = httpClient) {
|
|
@@ -86152,8 +86226,8 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
86152
86226
|
}
|
|
86153
86227
|
const monitorStores = /* @__PURE__ */ new Map();
|
|
86154
86228
|
async function monitorStore(storeId, index) {
|
|
86155
|
-
const
|
|
86156
|
-
const cached2 = monitorStores.get(
|
|
86229
|
+
const key3 = `${storeId}\0${index}`;
|
|
86230
|
+
const cached2 = monitorStores.get(key3);
|
|
86157
86231
|
if (cached2 !== void 0)
|
|
86158
86232
|
return cached2;
|
|
86159
86233
|
const { config: config2 } = await configManager.load();
|
|
@@ -86168,14 +86242,14 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
86168
86242
|
}
|
|
86169
86243
|
const by = cachedAttribution.author ?? import_node_os6.default.userInfo().username;
|
|
86170
86244
|
const made = new MonitorHistoryStore(httpClient, await vectorStoreConnectionFor(store, storeId), index, by);
|
|
86171
|
-
monitorStores.set(
|
|
86245
|
+
monitorStores.set(key3, made);
|
|
86172
86246
|
return made;
|
|
86173
86247
|
}
|
|
86174
86248
|
async function answerMonitorStore(op, store, args) {
|
|
86175
86249
|
const monitor = typeof args["monitor"] === "string" ? args["monitor"] : "";
|
|
86176
86250
|
switch (op) {
|
|
86177
86251
|
case "claim":
|
|
86178
|
-
return store.claim(monitor, Number(args["slot"] ?? 0));
|
|
86252
|
+
return store.claim(monitor, Number(args["slot"] ?? 0), Number(args["attempt"] ?? 1));
|
|
86179
86253
|
case "write":
|
|
86180
86254
|
await store.write(args["record"]);
|
|
86181
86255
|
return { by: store.by };
|
|
@@ -86189,7 +86263,12 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
86189
86263
|
case "history":
|
|
86190
86264
|
return store.history(monitor, Number(args["since"] ?? 0), Number(args["limit"] ?? 500), typeof args["until"] === "number" ? args["until"] : void 0);
|
|
86191
86265
|
case "prune":
|
|
86192
|
-
return { deleted: await store.prune(Number(args["before"] ?? 0), monitor.length > 0 ? monitor : void 0) };
|
|
86266
|
+
return { deleted: await store.prune(Number(args["before"] ?? 0), monitor.length > 0 ? monitor : void 0, args["revisions"] === true) };
|
|
86267
|
+
case "writeRevision":
|
|
86268
|
+
await store.writeRevision(monitor, args["revision"]);
|
|
86269
|
+
return { by: store.by };
|
|
86270
|
+
case "revisions":
|
|
86271
|
+
return store.revisions(monitor, Number(args["limit"] ?? 200));
|
|
86193
86272
|
case "deleteCheck":
|
|
86194
86273
|
return { deleted: await store.deleteCheck(monitor, Number(args["at"] ?? 0)) };
|
|
86195
86274
|
case "test":
|
|
@@ -86229,6 +86308,22 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
86229
86308
|
const here = await monitorToolHere(request.tool);
|
|
86230
86309
|
return { ok: true, data: "refusal" in here ? { ready: false, reason: here.refusal } : { ready: true } };
|
|
86231
86310
|
}
|
|
86311
|
+
case "sync": {
|
|
86312
|
+
const config2 = await loadSettings();
|
|
86313
|
+
const synced = [];
|
|
86314
|
+
for (const kind of ["skills", "tools"]) {
|
|
86315
|
+
if (!(config2.s3?.[kind] ?? []).some((mirror) => mirror.enabled === true))
|
|
86316
|
+
continue;
|
|
86317
|
+
await handleSyncS3(kind);
|
|
86318
|
+
if (!synced.includes("the bucket"))
|
|
86319
|
+
synced.push("the bucket");
|
|
86320
|
+
}
|
|
86321
|
+
if (config2.teamRepo?.enabled === true) {
|
|
86322
|
+
await handleTeamRepoSync("monitoring refresh");
|
|
86323
|
+
synced.push("the team repository");
|
|
86324
|
+
}
|
|
86325
|
+
return { ok: true, data: { synced } };
|
|
86326
|
+
}
|
|
86232
86327
|
case "skill": {
|
|
86233
86328
|
const done = request.op === "write" ? await writeTeamMonitorSkill(request.file, request.content ?? "") : await deleteEverywhere(await planDeleteEverywhere("skill", request.name));
|
|
86234
86329
|
return done.ok ? { ok: true, data: done.message } : { ok: false, error: done.message };
|
|
@@ -87994,13 +88089,13 @@ ${last}` : ""}`);
|
|
|
87994
88089
|
}
|
|
87995
88090
|
if (input.indexPrefix !== void 0 || input.indexName !== void 0 || input.indexAliases !== void 0) {
|
|
87996
88091
|
const embedder = { ...current.embedder ?? {} };
|
|
87997
|
-
const put = (
|
|
88092
|
+
const put = (key3, value) => {
|
|
87998
88093
|
if (value === void 0)
|
|
87999
88094
|
return;
|
|
88000
88095
|
if (value.trim().length > 0)
|
|
88001
|
-
embedder[
|
|
88096
|
+
embedder[key3] = value.trim();
|
|
88002
88097
|
else
|
|
88003
|
-
delete embedder[
|
|
88098
|
+
delete embedder[key3];
|
|
88004
88099
|
};
|
|
88005
88100
|
if (input.indexPrefix !== void 0 && input.indexPrefix.trim().length > 0) {
|
|
88006
88101
|
const problem = aliasProblem(input.indexPrefix.trim());
|
|
@@ -89077,8 +89172,8 @@ ${last}` : ""}`);
|
|
|
89077
89172
|
if (local !== void 0 && profiles[shardSegment(me)] === void 0)
|
|
89078
89173
|
profiles[shardSegment(me)] = local;
|
|
89079
89174
|
await Promise.race([enrichFromDirectory(namesToEnrich(events)), new Promise((resolve) => setTimeout(resolve, 8e3))]);
|
|
89080
|
-
for (const [
|
|
89081
|
-
profiles[
|
|
89175
|
+
for (const [key3, fromDirectory] of Object.entries(directoryProfiles(await readDirectoryCache()))) {
|
|
89176
|
+
profiles[key3] = { ...profiles[key3], ...fromDirectory };
|
|
89082
89177
|
}
|
|
89083
89178
|
return { events, profiles, storeLabel: resolved.store.label, ...storeProblem !== void 0 ? { storeProblem } : {} };
|
|
89084
89179
|
}
|
|
@@ -89308,13 +89403,13 @@ ${last}` : ""}`);
|
|
|
89308
89403
|
model,
|
|
89309
89404
|
dimensions
|
|
89310
89405
|
};
|
|
89311
|
-
const put = (
|
|
89406
|
+
const put = (key3, value) => {
|
|
89312
89407
|
if (value === void 0)
|
|
89313
89408
|
return;
|
|
89314
89409
|
if (value.trim().length > 0)
|
|
89315
|
-
embedder[
|
|
89410
|
+
embedder[key3] = value.trim();
|
|
89316
89411
|
else
|
|
89317
|
-
delete embedder[
|
|
89412
|
+
delete embedder[key3];
|
|
89318
89413
|
};
|
|
89319
89414
|
put("indexName", indexName);
|
|
89320
89415
|
put("indexPrefix", indexPrefix);
|
|
@@ -89603,9 +89698,9 @@ ${last}` : ""}`);
|
|
|
89603
89698
|
async function reportedWindowFor(config2, profile) {
|
|
89604
89699
|
if (profile.modelCapabilities?.contextWindow !== void 0)
|
|
89605
89700
|
return void 0;
|
|
89606
|
-
const
|
|
89607
|
-
if (!reportedWindows.has(
|
|
89608
|
-
windowProbes.set(
|
|
89701
|
+
const key3 = `${profile.baseUrl}|${profile.model}`;
|
|
89702
|
+
if (!reportedWindows.has(key3) && !windowProbes.has(key3)) {
|
|
89703
|
+
windowProbes.set(key3, (async () => {
|
|
89609
89704
|
const controller = new AbortController();
|
|
89610
89705
|
const timer = setTimeout(() => controller.abort(), 1e4);
|
|
89611
89706
|
try {
|
|
@@ -89616,8 +89711,8 @@ ${last}` : ""}`);
|
|
|
89616
89711
|
}
|
|
89617
89712
|
})());
|
|
89618
89713
|
}
|
|
89619
|
-
await windowProbes.get(
|
|
89620
|
-
return reportedWindows.get(
|
|
89714
|
+
await windowProbes.get(key3);
|
|
89715
|
+
return reportedWindows.get(key3);
|
|
89621
89716
|
}
|
|
89622
89717
|
async function postCapabilities() {
|
|
89623
89718
|
try {
|
|
@@ -89812,8 +89907,8 @@ ${last}` : ""}`);
|
|
|
89812
89907
|
for (const section of SHARE_SECTIONS) {
|
|
89813
89908
|
if (!chosen.includes(section.id) || section.id === "project")
|
|
89814
89909
|
continue;
|
|
89815
|
-
for (const
|
|
89816
|
-
patch[
|
|
89910
|
+
for (const key3 of section.keys)
|
|
89911
|
+
patch[key3] = key3 === "profiles" && merged.profiles !== void 0 ? reconciled : merged[key3];
|
|
89817
89912
|
for (const path63 of section.nested ?? []) {
|
|
89818
89913
|
const head = path63.split(".")[0];
|
|
89819
89914
|
patch[head] = merged[head];
|
|
@@ -90030,7 +90125,7 @@ ${last}` : ""}`);
|
|
|
90030
90125
|
}
|
|
90031
90126
|
async function handleClearProjectSettings() {
|
|
90032
90127
|
try {
|
|
90033
|
-
const cleared = Object.fromEntries(OVERRIDABLE_KEYS.map((
|
|
90128
|
+
const cleared = Object.fromEntries(OVERRIDABLE_KEYS.map((key3) => [key3, void 0]));
|
|
90034
90129
|
await configManager.saveForWorkspace(cleared);
|
|
90035
90130
|
await postProjectSettings();
|
|
90036
90131
|
await postSearch();
|
|
@@ -90179,9 +90274,9 @@ ${last}` : ""}`);
|
|
|
90179
90274
|
const keptEntry = kept[server];
|
|
90180
90275
|
if (typeof keptEntry !== "object" || keptEntry === null)
|
|
90181
90276
|
continue;
|
|
90182
|
-
for (const
|
|
90183
|
-
if (!(
|
|
90184
|
-
missing.push(`${server}.${
|
|
90277
|
+
for (const key3 of Object.keys(rawEntry)) {
|
|
90278
|
+
if (!(key3 in keptEntry))
|
|
90279
|
+
missing.push(`${server}.${key3}`);
|
|
90185
90280
|
}
|
|
90186
90281
|
}
|
|
90187
90282
|
return missing;
|
|
@@ -91476,9 +91571,9 @@ ${contents}
|
|
|
91476
91571
|
async function handleClearScheduleRuns(id) {
|
|
91477
91572
|
const schedules = await loadSchedules();
|
|
91478
91573
|
const next = {};
|
|
91479
|
-
for (const [
|
|
91480
|
-
if (id !== void 0 &&
|
|
91481
|
-
next[
|
|
91574
|
+
for (const [key3, schedule] of Object.entries(schedules)) {
|
|
91575
|
+
if (id !== void 0 && key3 !== id) {
|
|
91576
|
+
next[key3] = schedule;
|
|
91482
91577
|
continue;
|
|
91483
91578
|
}
|
|
91484
91579
|
const cleared = { ...schedule };
|
|
@@ -91486,7 +91581,7 @@ ${contents}
|
|
|
91486
91581
|
delete cleared.lastResult;
|
|
91487
91582
|
delete cleared.lastSummary;
|
|
91488
91583
|
delete cleared.lastTaskId;
|
|
91489
|
-
next[
|
|
91584
|
+
next[key3] = cleared;
|
|
91490
91585
|
}
|
|
91491
91586
|
await saveSchedules(next);
|
|
91492
91587
|
}
|
|
@@ -92236,8 +92331,8 @@ var LspClient = class {
|
|
|
92236
92331
|
}
|
|
92237
92332
|
if (method === "textDocument/publishDiagnostics") {
|
|
92238
92333
|
const params3 = message5.params;
|
|
92239
|
-
const
|
|
92240
|
-
this.diagnostics.set(
|
|
92334
|
+
const key3 = keyFor(params3.uri);
|
|
92335
|
+
this.diagnostics.set(key3, params3.diagnostics.map((d) => ({
|
|
92241
92336
|
line: d.range.start.line + 1,
|
|
92242
92337
|
column: d.range.start.character + 1,
|
|
92243
92338
|
severity: SEVERITY[d.severity ?? 1] ?? "error",
|
|
@@ -92245,9 +92340,9 @@ var LspClient = class {
|
|
|
92245
92340
|
...d.source !== void 0 ? { source: d.source } : {},
|
|
92246
92341
|
...d.code !== void 0 ? { code: String(d.code) } : {}
|
|
92247
92342
|
})));
|
|
92248
|
-
for (const wake of this.waiters.get(
|
|
92343
|
+
for (const wake of this.waiters.get(key3) ?? [])
|
|
92249
92344
|
wake();
|
|
92250
|
-
this.waiters.delete(
|
|
92345
|
+
this.waiters.delete(key3);
|
|
92251
92346
|
}
|
|
92252
92347
|
}
|
|
92253
92348
|
/**
|
|
@@ -92257,13 +92352,13 @@ var LspClient = class {
|
|
|
92257
92352
|
async diagnose(file2, text2, languageId, timeoutMs) {
|
|
92258
92353
|
await Promise.race([this.ready, new Promise((_, reject2) => setTimeout(() => reject2(new Error("The language server did not start in time.")), timeoutMs))]);
|
|
92259
92354
|
const uri = (0, import_node_url.pathToFileURL)(file2).href;
|
|
92260
|
-
const
|
|
92355
|
+
const key3 = keyFor(uri);
|
|
92261
92356
|
const version2 = (this.versions.get(uri) ?? 0) + 1;
|
|
92262
92357
|
this.versions.set(uri, version2);
|
|
92263
92358
|
const arrived = new Promise((resolve) => {
|
|
92264
|
-
const list2 = this.waiters.get(
|
|
92359
|
+
const list2 = this.waiters.get(key3) ?? [];
|
|
92265
92360
|
list2.push(() => resolve(true));
|
|
92266
|
-
this.waiters.set(
|
|
92361
|
+
this.waiters.set(key3, list2);
|
|
92267
92362
|
setTimeout(() => resolve(false), timeoutMs);
|
|
92268
92363
|
});
|
|
92269
92364
|
if (version2 === 1) {
|
|
@@ -92274,9 +92369,9 @@ var LspClient = class {
|
|
|
92274
92369
|
this.notify("textDocument/didSave", { textDocument: { uri }, text: text2 });
|
|
92275
92370
|
const got = await arrived;
|
|
92276
92371
|
if (!got)
|
|
92277
|
-
return this.diagnostics.get(
|
|
92372
|
+
return this.diagnostics.get(key3);
|
|
92278
92373
|
await new Promise((resolve) => setTimeout(resolve, 400));
|
|
92279
|
-
return this.diagnostics.get(
|
|
92374
|
+
return this.diagnostics.get(key3);
|
|
92280
92375
|
}
|
|
92281
92376
|
dispose() {
|
|
92282
92377
|
try {
|
|
@@ -94837,7 +94932,33 @@ edits made outside the agent (in VS Code, say) are saved with \`hub_sync\` "push
|
|
|
94837
94932
|
"only alerted rows",
|
|
94838
94933
|
"all rows",
|
|
94839
94934
|
"lazy load",
|
|
94840
|
-
"many rows"
|
|
94935
|
+
"many rows",
|
|
94936
|
+
"older than",
|
|
94937
|
+
"delete old history",
|
|
94938
|
+
"delete history older than",
|
|
94939
|
+
"clean up history",
|
|
94940
|
+
"not on time",
|
|
94941
|
+
"not triggered",
|
|
94942
|
+
"late check",
|
|
94943
|
+
"check is late",
|
|
94944
|
+
"waiting",
|
|
94945
|
+
"scheduler",
|
|
94946
|
+
"scheduler stopped",
|
|
94947
|
+
"start the scheduler",
|
|
94948
|
+
"stop the scheduler",
|
|
94949
|
+
"is the scheduler running",
|
|
94950
|
+
"refresh monitors",
|
|
94951
|
+
"new checks",
|
|
94952
|
+
"deleted checks",
|
|
94953
|
+
"who wrote the monitor",
|
|
94954
|
+
"author of the monitor",
|
|
94955
|
+
"last updated by",
|
|
94956
|
+
"who changed the monitor",
|
|
94957
|
+
"monitor changes",
|
|
94958
|
+
"changes to the monitor",
|
|
94959
|
+
"audit of changes",
|
|
94960
|
+
"updated_by",
|
|
94961
|
+
"takeover"
|
|
94841
94962
|
],
|
|
94842
94963
|
body: `
|
|
94843
94964
|
**Fire Code only.** Settings \u2192 Monitoring switches it on; a Monitoring button then appears at the top of the
|
|
@@ -94931,6 +95052,32 @@ elsewhere** with the reason on hover. A check that **failed** here (a credential
|
|
|
94931
95052
|
step back for three windows (at least 30 minutes) while a colleague's runs succeed - unless nobody has checked it for
|
|
94932
95053
|
a window, when it tries again rather than leave it unrun.
|
|
94933
95054
|
|
|
95055
|
+
**When a check has not run on time**, its tile says so: **waiting\u2026** with the reason on hover (making sure it can run
|
|
95056
|
+
here first, its turn behind 4 checks already running, a colleague's Fire Code has this window, the monitoring
|
|
95057
|
+
executor still starting), or **due N min ago** when it is past its time. The executor is started as soon as a monitor
|
|
95058
|
+
uses a tool, not when the check falls due, and a tool's timeout counts from when the executor is up. A file or
|
|
95059
|
+
database path on a share is checked in the background, so a share that does not answer never holds the dashboard up.
|
|
95060
|
+
**If the colleague who won a window never reports** (their Fire Code closed or failed mid-check), one other member
|
|
95061
|
+
takes the window over once its timeout and three more minutes have passed - by a second claim, so still only one.
|
|
95062
|
+
|
|
95063
|
+
**Is the scheduler working?** A line at the top of the dashboard says **Scheduler running** and when it last looked
|
|
95064
|
+
(every 3 seconds), with **Stop**; stopped, it says so, with **Start**; not heard from for 90 seconds it says **not
|
|
95065
|
+
responding**, with **Start again**, which lets go of anything stuck and restarts its timer. Stopped means no check
|
|
95066
|
+
starts by itself - Run now still works and colleagues' checks still show - and it stays stopped after a restart until
|
|
95067
|
+
started. Only you stop or start it, never an agent.
|
|
95068
|
+
|
|
95069
|
+
**Refresh** (the circular arrow at the top of the dashboard) brings the team's skills down now - its bucket folders and
|
|
95070
|
+
the team repository - instead of at the next timed sync, reads the folders again, and says which monitors are new
|
|
95071
|
+
and which are gone.
|
|
95072
|
+
|
|
95073
|
+
**Who wrote it, and who changed it**: every save Light Code or Fire Code makes labels a skill with \`version\`,
|
|
95074
|
+
\`updated\` and \`updated_by\` (who saved it), and a new one with its \`author\`. The tile's tooltip and the grid
|
|
95075
|
+
window's header show them; **Changes** (the grid window's arrow button, or "Updated \u2026 by \u2026" in its header) lists every
|
|
95076
|
+
version - when, by whom, what changed (the schedule, which fields, or only the text around the monitor) and the
|
|
95077
|
+
monitor as it was. Each Fire Code records a version as it arrives; a team monitor's changes are also kept in the team
|
|
95078
|
+
index, so every member sees the same list however long their Fire Code was closed. Cleaning up history keeps them;
|
|
95079
|
+
deleting the monitor removes your own record of it. The grid window's buttons are icons - hover one to see what it does.
|
|
95080
|
+
|
|
94934
95081
|
**Offline**: when the team history cannot be reached, a team monitor still runs on this computer - its tile, colours
|
|
94935
95082
|
and notifications stay current - and the tile says **Offline \xB7 N not shared**. Once the history answers again, each
|
|
94936
95083
|
offline check claims its window: written if nobody had it, dropped if a colleague already checked that window. At
|
|
@@ -94949,7 +95096,10 @@ the newest check, saying who ran it. Writes never overwrite each other, and clea
|
|
|
94949
95096
|
alert's pattern - **new** today, **ongoing** since when, **recurring** on several days ("usually starting around
|
|
94950
95097
|
02:00"), comes and goes, or cleared; and any past check's alerted rows. A check keeps its colour, headline and the
|
|
94951
95098
|
rows that had an alert. **Kept 90 days** by default (30 days to a year), cleaned every few hours; **Clean up now** in
|
|
94952
|
-
Settings \u2192 Monitoring, and **Delete its history** on a tile's right-click menu
|
|
95099
|
+
Settings \u2192 Monitoring, and **Delete its history** on a tile's right-click menu - **everything, or only checks older
|
|
95100
|
+
than 7, 30, 90 or any number of days**; **Clean up\u2026** takes the same choice for every monitor. Both remove checks on
|
|
95101
|
+
this computer (with the grids they kept) and **your own** records in the team index; a colleague's records are theirs
|
|
95102
|
+
and stay until their Fire Code cleans them up. A snoozed or paused monitor keeps its
|
|
94953
95103
|
colour on its tile but no longer colours the Monitoring button.
|
|
94954
95104
|
|
|
94955
95105
|
**An alert explained**: double-click a coloured row. The author's advice for that rule comes first (asked for when
|
|
@@ -97220,12 +97370,12 @@ var S3Client = class {
|
|
|
97220
97370
|
url(call) {
|
|
97221
97371
|
const { bucket, region, endpoint, pathStyle } = this.connection;
|
|
97222
97372
|
const origin = new URL(endpoint ?? `https://s3.${region}.amazonaws.com`);
|
|
97223
|
-
const
|
|
97373
|
+
const key3 = call.key ?? "";
|
|
97224
97374
|
const inPath = usesPathStyle(pathStyle, origin.host);
|
|
97225
97375
|
const host = inPath ? origin.host : `${bucket}.${origin.host}`;
|
|
97226
97376
|
const mount = origin.pathname === "/" ? "" : origin.pathname.replace(/\/+$/, "");
|
|
97227
97377
|
const prefix = inPath ? `${mount}/${bucket}` : mount;
|
|
97228
|
-
const path63 =
|
|
97378
|
+
const path63 = key3 === "" ? "" : `/${key3.split("/").map((part) => encodeURIComponent(part)).join("/")}`;
|
|
97229
97379
|
const url2 = new URL(`${origin.protocol}//${host}${prefix}${path63}`);
|
|
97230
97380
|
for (const [name, value] of Object.entries(call.query ?? {}))
|
|
97231
97381
|
url2.searchParams.set(name, value);
|
|
@@ -97290,14 +97440,14 @@ var S3Client = class {
|
|
|
97290
97440
|
}
|
|
97291
97441
|
return found2.slice(0, limit);
|
|
97292
97442
|
}
|
|
97293
|
-
async get(
|
|
97443
|
+
async get(key3, signal) {
|
|
97294
97444
|
const result = await this.send({
|
|
97295
97445
|
method: "GET",
|
|
97296
|
-
key:
|
|
97446
|
+
key: key3,
|
|
97297
97447
|
...signal !== void 0 ? { signal } : {}
|
|
97298
97448
|
});
|
|
97299
97449
|
if (result.status !== 200)
|
|
97300
|
-
throw new Error(describeFailure(result.status, result.text,
|
|
97450
|
+
throw new Error(describeFailure(result.status, result.text, key3));
|
|
97301
97451
|
return result.bytes;
|
|
97302
97452
|
}
|
|
97303
97453
|
/**
|
|
@@ -97314,33 +97464,33 @@ var S3Client = class {
|
|
|
97314
97464
|
* object is gone, which is what was asked for. Treating 404 as a failure would make removing a
|
|
97315
97465
|
* skill somebody had already removed look like a broken connection.
|
|
97316
97466
|
*/
|
|
97317
|
-
async remove(
|
|
97467
|
+
async remove(key3, signal) {
|
|
97318
97468
|
const result = await this.send({
|
|
97319
97469
|
method: "DELETE",
|
|
97320
|
-
key:
|
|
97470
|
+
key: key3,
|
|
97321
97471
|
...signal !== void 0 ? { signal } : {}
|
|
97322
97472
|
});
|
|
97323
97473
|
if (result.status !== 204 && result.status !== 200 && result.status !== 404) {
|
|
97324
|
-
throw new Error(describeFailure(result.status, result.text,
|
|
97474
|
+
throw new Error(describeFailure(result.status, result.text, key3));
|
|
97325
97475
|
}
|
|
97326
97476
|
}
|
|
97327
|
-
async put(
|
|
97477
|
+
async put(key3, bytes, contentType2, signal) {
|
|
97328
97478
|
const result = await this.send({
|
|
97329
97479
|
method: "PUT",
|
|
97330
|
-
key:
|
|
97480
|
+
key: key3,
|
|
97331
97481
|
bodyBytes: bytes,
|
|
97332
97482
|
...contentType2 !== void 0 ? { headers: { "content-type": contentType2 } } : {},
|
|
97333
97483
|
...signal !== void 0 ? { signal } : {}
|
|
97334
97484
|
});
|
|
97335
97485
|
if (result.status !== 200 && result.status !== 204) {
|
|
97336
|
-
throw new Error(describeFailure(result.status, result.text,
|
|
97486
|
+
throw new Error(describeFailure(result.status, result.text, key3));
|
|
97337
97487
|
}
|
|
97338
97488
|
}
|
|
97339
97489
|
};
|
|
97340
|
-
function describeFailure(status2, body,
|
|
97490
|
+
function describeFailure(status2, body, key3) {
|
|
97341
97491
|
const code = matchTag(body, "Code");
|
|
97342
97492
|
const message5 = matchTag(body, "Message");
|
|
97343
|
-
const what =
|
|
97493
|
+
const what = key3 === void 0 ? "" : ` for "${key3}"`;
|
|
97344
97494
|
if (code === void 0)
|
|
97345
97495
|
return `S3 request failed${what} with status ${String(status2)}.`;
|
|
97346
97496
|
return `S3 ${code}${what}: ${message5 ?? `status ${String(status2)}`}`;
|
|
@@ -97352,11 +97502,11 @@ function matchTag(xml, tag) {
|
|
|
97352
97502
|
function parseListing(xml) {
|
|
97353
97503
|
const objects = [];
|
|
97354
97504
|
for (const block2 of xml.split("<Contents>").slice(1)) {
|
|
97355
|
-
const
|
|
97356
|
-
if (
|
|
97505
|
+
const key3 = matchTag(block2, "Key");
|
|
97506
|
+
if (key3 === void 0)
|
|
97357
97507
|
continue;
|
|
97358
97508
|
objects.push({
|
|
97359
|
-
key: decodeEntities3(
|
|
97509
|
+
key: decodeEntities3(key3),
|
|
97360
97510
|
size: Number(matchTag(block2, "Size") ?? "0"),
|
|
97361
97511
|
lastModified: matchTag(block2, "LastModified") ?? ""
|
|
97362
97512
|
});
|
|
@@ -97736,12 +97886,12 @@ async function skillKeysInBucket(options) {
|
|
|
97736
97886
|
const base = normalisePrefix(options.target.prefix);
|
|
97737
97887
|
const where = normalisePrefix(`${base}${options.prefix ?? ""}`);
|
|
97738
97888
|
const objects = await options.target.client.list(where, 1e3, options.signal);
|
|
97739
|
-
return objects.map((object3) => object3.key).filter((
|
|
97889
|
+
return objects.map((object3) => object3.key).filter((key3) => belongsToSkill(key3, where, options.name)).sort();
|
|
97740
97890
|
}
|
|
97741
|
-
function belongsToSkill(
|
|
97742
|
-
if (!
|
|
97891
|
+
function belongsToSkill(key3, where, name) {
|
|
97892
|
+
if (!key3.startsWith(where))
|
|
97743
97893
|
return false;
|
|
97744
|
-
const relative =
|
|
97894
|
+
const relative = key3.slice(where.length);
|
|
97745
97895
|
if (relative === "")
|
|
97746
97896
|
return false;
|
|
97747
97897
|
if (relative.toLowerCase() === `${name.toLowerCase()}.md`)
|
|
@@ -97755,28 +97905,28 @@ async function removeSkillFromBucket(options) {
|
|
|
97755
97905
|
const base = normalisePrefix(options.target.prefix);
|
|
97756
97906
|
const where = normalisePrefix(`${base}${options.prefix ?? ""}`);
|
|
97757
97907
|
const result = { removed: [], failed: [], rejected: [] };
|
|
97758
|
-
for (const
|
|
97759
|
-
if (!belongsToSkill(
|
|
97760
|
-
result.rejected.push(
|
|
97908
|
+
for (const key3 of options.keys) {
|
|
97909
|
+
if (!belongsToSkill(key3, where, options.name)) {
|
|
97910
|
+
result.rejected.push(key3);
|
|
97761
97911
|
continue;
|
|
97762
97912
|
}
|
|
97763
97913
|
try {
|
|
97764
|
-
await options.target.client.remove(
|
|
97765
|
-
result.removed.push(
|
|
97914
|
+
await options.target.client.remove(key3, options.signal);
|
|
97915
|
+
result.removed.push(key3);
|
|
97766
97916
|
} catch (error51) {
|
|
97767
|
-
result.failed.push({ key:
|
|
97917
|
+
result.failed.push({ key: key3, problem: error51 instanceof Error ? error51.message : String(error51) });
|
|
97768
97918
|
}
|
|
97769
97919
|
}
|
|
97770
97920
|
return result;
|
|
97771
97921
|
}
|
|
97772
|
-
function belongsToTool(
|
|
97773
|
-
return
|
|
97922
|
+
function belongsToTool(key3, where, name) {
|
|
97923
|
+
return key3.startsWith(where) && key3.slice(where.length) === `${name}.py`;
|
|
97774
97924
|
}
|
|
97775
97925
|
async function toolKeysInBucket(options) {
|
|
97776
97926
|
const base = normalisePrefix(options.target.prefix);
|
|
97777
97927
|
const where = normalisePrefix(`${base}${options.prefix ?? ""}`);
|
|
97778
97928
|
const objects = await options.target.client.list(where, 1e3, options.signal);
|
|
97779
|
-
return objects.map((object3) => object3.key).filter((
|
|
97929
|
+
return objects.map((object3) => object3.key).filter((key3) => belongsToTool(key3, where, options.name)).sort();
|
|
97780
97930
|
}
|
|
97781
97931
|
async function removeToolFromBucket(options) {
|
|
97782
97932
|
if (options.target.readOnly === true) {
|
|
@@ -97785,16 +97935,16 @@ async function removeToolFromBucket(options) {
|
|
|
97785
97935
|
const base = normalisePrefix(options.target.prefix);
|
|
97786
97936
|
const where = normalisePrefix(`${base}${options.prefix ?? ""}`);
|
|
97787
97937
|
const result = { removed: [], failed: [], rejected: [] };
|
|
97788
|
-
for (const
|
|
97789
|
-
if (!belongsToTool(
|
|
97790
|
-
result.rejected.push(
|
|
97938
|
+
for (const key3 of options.keys) {
|
|
97939
|
+
if (!belongsToTool(key3, where, options.name)) {
|
|
97940
|
+
result.rejected.push(key3);
|
|
97791
97941
|
continue;
|
|
97792
97942
|
}
|
|
97793
97943
|
try {
|
|
97794
|
-
await options.target.client.remove(
|
|
97795
|
-
result.removed.push(
|
|
97944
|
+
await options.target.client.remove(key3, options.signal);
|
|
97945
|
+
result.removed.push(key3);
|
|
97796
97946
|
} catch (error51) {
|
|
97797
|
-
result.failed.push({ key:
|
|
97947
|
+
result.failed.push({ key: key3, problem: error51 instanceof Error ? error51.message : String(error51) });
|
|
97798
97948
|
}
|
|
97799
97949
|
}
|
|
97800
97950
|
return result;
|
|
@@ -98212,14 +98362,14 @@ function isVaultEnvelope(value) {
|
|
|
98212
98362
|
const v = value;
|
|
98213
98363
|
return typeof v === "object" && v !== null && v.sunVault === 1 && typeof v.iv === "string" && typeof v.tag === "string" && typeof v.data === "string";
|
|
98214
98364
|
}
|
|
98215
|
-
function sealSecrets(secrets,
|
|
98365
|
+
function sealSecrets(secrets, key3) {
|
|
98216
98366
|
const iv = (0, import_node_crypto21.randomBytes)(12);
|
|
98217
|
-
const cipher = (0, import_node_crypto21.createCipheriv)("aes-256-gcm",
|
|
98367
|
+
const cipher = (0, import_node_crypto21.createCipheriv)("aes-256-gcm", key3, iv);
|
|
98218
98368
|
const data = Buffer.concat([cipher.update(JSON.stringify(secrets), "utf8"), cipher.final()]);
|
|
98219
98369
|
return { sunVault: 1, iv: iv.toString("base64"), tag: cipher.getAuthTag().toString("base64"), data: data.toString("base64") };
|
|
98220
98370
|
}
|
|
98221
|
-
function openSecrets(envelope,
|
|
98222
|
-
const decipher = (0, import_node_crypto21.createDecipheriv)("aes-256-gcm",
|
|
98371
|
+
function openSecrets(envelope, key3) {
|
|
98372
|
+
const decipher = (0, import_node_crypto21.createDecipheriv)("aes-256-gcm", key3, Buffer.from(envelope.iv, "base64"));
|
|
98223
98373
|
decipher.setAuthTag(Buffer.from(envelope.tag, "base64"));
|
|
98224
98374
|
const plain = Buffer.concat([decipher.update(Buffer.from(envelope.data, "base64")), decipher.final()]);
|
|
98225
98375
|
const parsed = JSON.parse(plain.toString("utf8"));
|
|
@@ -98233,9 +98383,9 @@ var FileSecretStore = class {
|
|
|
98233
98383
|
* as it always was. A plain file read with a key is taken as it is and encrypted on the next save,
|
|
98234
98384
|
* which is how existing secrets move into the vault.
|
|
98235
98385
|
*/
|
|
98236
|
-
constructor(filePath,
|
|
98386
|
+
constructor(filePath, key3) {
|
|
98237
98387
|
this.filePath = filePath;
|
|
98238
|
-
this.key =
|
|
98388
|
+
this.key = key3;
|
|
98239
98389
|
}
|
|
98240
98390
|
filePath;
|
|
98241
98391
|
key;
|
|
@@ -98311,23 +98461,23 @@ var FileSecretStore = class {
|
|
|
98311
98461
|
});
|
|
98312
98462
|
return this.queue;
|
|
98313
98463
|
}
|
|
98314
|
-
async get(
|
|
98315
|
-
return (await this.load())[
|
|
98464
|
+
async get(key3) {
|
|
98465
|
+
return (await this.load())[key3];
|
|
98316
98466
|
}
|
|
98317
|
-
async set(
|
|
98467
|
+
async set(key3, value) {
|
|
98318
98468
|
await this.write((secrets) => {
|
|
98319
|
-
secrets[
|
|
98469
|
+
secrets[key3] = value;
|
|
98320
98470
|
});
|
|
98321
98471
|
}
|
|
98322
|
-
async delete(
|
|
98472
|
+
async delete(key3) {
|
|
98323
98473
|
await this.write((secrets) => {
|
|
98324
|
-
delete secrets[
|
|
98474
|
+
delete secrets[key3];
|
|
98325
98475
|
});
|
|
98326
98476
|
}
|
|
98327
98477
|
/** Real deletion, per §15: the file is removed, not emptied key by key. */
|
|
98328
98478
|
async clear() {
|
|
98329
98479
|
await this.write((secrets) => {
|
|
98330
|
-
for (const
|
|
98480
|
+
for (const key3 of Object.keys(secrets)) delete secrets[key3];
|
|
98331
98481
|
});
|
|
98332
98482
|
}
|
|
98333
98483
|
/** Surfaced in the UI so it never implies keychain-grade protection (§15). */
|
|
@@ -98413,11 +98563,11 @@ var ReviewQueue = class {
|
|
|
98413
98563
|
|
|
98414
98564
|
// src/sharedEntries.ts
|
|
98415
98565
|
var SHARED_PREFIX = "shared:";
|
|
98416
|
-
function isSharedKey(
|
|
98417
|
-
return
|
|
98566
|
+
function isSharedKey(key3) {
|
|
98567
|
+
return key3.startsWith(SHARED_PREFIX);
|
|
98418
98568
|
}
|
|
98419
|
-
function toSharedKey(
|
|
98420
|
-
return isSharedKey(
|
|
98569
|
+
function toSharedKey(key3) {
|
|
98570
|
+
return isSharedKey(key3) ? key3 : `${SHARED_PREFIX}${key3}`;
|
|
98421
98571
|
}
|
|
98422
98572
|
function isSharedSecretReference(ref) {
|
|
98423
98573
|
const parts = ref.split(":");
|
|
@@ -98570,17 +98720,17 @@ var RoutedSecretStore = class {
|
|
|
98570
98720
|
}
|
|
98571
98721
|
own;
|
|
98572
98722
|
shared;
|
|
98573
|
-
storeFor(
|
|
98574
|
-
return isSharedSecretRef(
|
|
98723
|
+
storeFor(key3) {
|
|
98724
|
+
return isSharedSecretRef(key3) ? this.shared : this.own;
|
|
98575
98725
|
}
|
|
98576
|
-
async get(
|
|
98577
|
-
return this.storeFor(
|
|
98726
|
+
async get(key3) {
|
|
98727
|
+
return this.storeFor(key3).get(key3);
|
|
98578
98728
|
}
|
|
98579
|
-
async set(
|
|
98580
|
-
return this.storeFor(
|
|
98729
|
+
async set(key3, value) {
|
|
98730
|
+
return this.storeFor(key3).set(key3, value);
|
|
98581
98731
|
}
|
|
98582
|
-
async delete(
|
|
98583
|
-
return this.storeFor(
|
|
98732
|
+
async delete(key3) {
|
|
98733
|
+
return this.storeFor(key3).delete(key3);
|
|
98584
98734
|
}
|
|
98585
98735
|
/**
|
|
98586
98736
|
* Clears the user's own only.
|
|
@@ -98776,8 +98926,8 @@ var ToolBackedSecretStore = class _ToolBackedSecretStore {
|
|
|
98776
98926
|
*/
|
|
98777
98927
|
cache = /* @__PURE__ */ new Map();
|
|
98778
98928
|
static TTL_MS = 5e3;
|
|
98779
|
-
async get(
|
|
98780
|
-
const stored = await this.inner.get(
|
|
98929
|
+
async get(key3) {
|
|
98930
|
+
const stored = await this.inner.get(key3);
|
|
98781
98931
|
if (stored === void 0 || !stored.startsWith(CREDENTIAL_PREFIX2)) return stored;
|
|
98782
98932
|
const cached2 = this.cache.get(stored);
|
|
98783
98933
|
if (cached2 !== void 0 && cached2.until > Date.now()) return cached2.value;
|
|
@@ -98792,12 +98942,12 @@ var ToolBackedSecretStore = class _ToolBackedSecretStore {
|
|
|
98792
98942
|
});
|
|
98793
98943
|
return result.value;
|
|
98794
98944
|
}
|
|
98795
|
-
async set(
|
|
98945
|
+
async set(key3, value) {
|
|
98796
98946
|
this.cache.delete(value);
|
|
98797
|
-
return this.inner.set(
|
|
98947
|
+
return this.inner.set(key3, value);
|
|
98798
98948
|
}
|
|
98799
|
-
async delete(
|
|
98800
|
-
return this.inner.delete(
|
|
98949
|
+
async delete(key3) {
|
|
98950
|
+
return this.inner.delete(key3);
|
|
98801
98951
|
}
|
|
98802
98952
|
async clear() {
|
|
98803
98953
|
this.cache.clear();
|
|
@@ -98939,12 +99089,12 @@ var FileWorkspaceState = class {
|
|
|
98939
99089
|
this.values = {};
|
|
98940
99090
|
}
|
|
98941
99091
|
}
|
|
98942
|
-
get(
|
|
98943
|
-
return this.values[
|
|
99092
|
+
get(key3) {
|
|
99093
|
+
return this.values[key3];
|
|
98944
99094
|
}
|
|
98945
|
-
async set(
|
|
98946
|
-
if (value === void 0) delete this.values[
|
|
98947
|
-
else this.values[
|
|
99095
|
+
async set(key3, value) {
|
|
99096
|
+
if (value === void 0) delete this.values[key3];
|
|
99097
|
+
else this.values[key3] = value;
|
|
98948
99098
|
await import_promises35.default.mkdir(import_node_path62.default.dirname(this.filePath), { recursive: true });
|
|
98949
99099
|
await import_promises35.default.writeFile(this.filePath, JSON.stringify(this.values, null, 2), {
|
|
98950
99100
|
encoding: "utf8",
|