@x-otto/cli 0.0.1-alpha.8 → 0.0.1-alpha.9
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/bundled-extensions/plugin-otto-wire-protocols/plugin-dist/meta.json +1 -1
- package/dist/bundled-extensions/plugin-otto-wire-protocols/plugin-dist/plugin.cjs +996 -1306
- package/dist/bundled-extensions/plugin-skill-inductor/plugin-dist/meta.json +1 -1
- package/dist/bundled-extensions/plugin-skill-inductor/plugin-dist/plugin.cjs +7 -7
- package/dist/{command-dispatcher-CR7RCzUl.js → command-dispatcher-Dnh3vtf4.js} +3 -3
- package/dist/{command-dispatcher-CR7RCzUl.js.map → command-dispatcher-Dnh3vtf4.js.map} +1 -1
- package/dist/{discover-with-bundled-CznLjkkw.js → discover-with-bundled-wSuXDvNc.js} +2 -2
- package/dist/{discover-with-bundled-CznLjkkw.js.map → discover-with-bundled-wSuXDvNc.js.map} +1 -1
- package/dist/extension-C3AP3KxC.js +2 -0
- package/dist/{extension-BKXIr86F.js → extension-DAex6RFK.js} +2 -2
- package/dist/{extension-BKXIr86F.js.map → extension-DAex6RFK.js.map} +1 -1
- package/dist/{extension-plugin-DH-4D0tt.js → extension-plugin-B10fpJA7.js} +4 -4
- package/dist/{extension-plugin-DH-4D0tt.js.map → extension-plugin-B10fpJA7.js.map} +1 -1
- package/dist/extension-plugin-Dt5_McoL.js +2 -0
- package/dist/{feishu-setup-D6vnuNLw.js → feishu-setup-DIcd3PMK.js} +2 -2
- package/dist/{feishu-setup-D6vnuNLw.js.map → feishu-setup-DIcd3PMK.js.map} +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/model-auth-C3gJ1cpD.js +2 -0
- package/dist/{model-auth-ylinoVLo.js → model-auth-DvoaqZ1G.js} +2 -2
- package/dist/{model-auth-ylinoVLo.js.map → model-auth-DvoaqZ1G.js.map} +1 -1
- package/dist/{parse-cli-2Cs-ZcSC.js → parse-cli-CO__I2GZ.js} +2 -2
- package/dist/{parse-cli-2Cs-ZcSC.js.map → parse-cli-CO__I2GZ.js.map} +1 -1
- package/package.json +3 -3
- package/dist/extension-CnON6Xum.js +0 -2
- package/dist/extension-plugin-B6WF8HzF.js +0 -2
- package/dist/model-auth-7WCx1j-B.js +0 -2
|
@@ -11346,7 +11346,7 @@ var require_util = __commonJS({
|
|
|
11346
11346
|
let val = obj[key];
|
|
11347
11347
|
if (val !== void 0) {
|
|
11348
11348
|
if (!Object.hasOwn(obj, key)) {
|
|
11349
|
-
const headersValue = typeof headers[i2 + 1] === "string" ? headers[i2 + 1] : Array.isArray(headers[i2 + 1]) ? headers[i2 + 1].map((
|
|
11349
|
+
const headersValue = typeof headers[i2 + 1] === "string" ? headers[i2 + 1] : Array.isArray(headers[i2 + 1]) ? headers[i2 + 1].map((x5) => x5.toString("latin1")) : headers[i2 + 1].toString("latin1");
|
|
11350
11350
|
if (key === "__proto__") {
|
|
11351
11351
|
Object.defineProperty(obj, key, {
|
|
11352
11352
|
value: headersValue,
|
|
@@ -11365,7 +11365,7 @@ var require_util = __commonJS({
|
|
|
11365
11365
|
val.push(headers[i2 + 1].toString("latin1"));
|
|
11366
11366
|
}
|
|
11367
11367
|
} else {
|
|
11368
|
-
const headersValue = typeof headers[i2 + 1] === "string" ? headers[i2 + 1] : Array.isArray(headers[i2 + 1]) ? headers[i2 + 1].map((
|
|
11368
|
+
const headersValue = typeof headers[i2 + 1] === "string" ? headers[i2 + 1] : Array.isArray(headers[i2 + 1]) ? headers[i2 + 1].map((x5) => x5.toString("latin1")) : headers[i2 + 1].toString("latin1");
|
|
11369
11369
|
obj[key] = headersValue;
|
|
11370
11370
|
}
|
|
11371
11371
|
}
|
|
@@ -11392,13 +11392,13 @@ var require_util = __commonJS({
|
|
|
11392
11392
|
const ret = new Array(headersLength);
|
|
11393
11393
|
let key;
|
|
11394
11394
|
let val;
|
|
11395
|
-
for (let
|
|
11396
|
-
key = headers[
|
|
11397
|
-
val = headers[
|
|
11395
|
+
for (let n3 = 0; n3 < headersLength; n3 += 2) {
|
|
11396
|
+
key = headers[n3];
|
|
11397
|
+
val = headers[n3 + 1];
|
|
11398
11398
|
typeof key !== "string" && (key = key.toString());
|
|
11399
11399
|
typeof val !== "string" && (val = val.toString("latin1"));
|
|
11400
|
-
ret[
|
|
11401
|
-
ret[
|
|
11400
|
+
ret[n3] = key;
|
|
11401
|
+
ret[n3 + 1] = val;
|
|
11402
11402
|
}
|
|
11403
11403
|
return ret;
|
|
11404
11404
|
}
|
|
@@ -11419,7 +11419,7 @@ var require_util = __commonJS({
|
|
|
11419
11419
|
if (!Array.isArray(headers)) {
|
|
11420
11420
|
throw new TypeError("expected headers to be an array");
|
|
11421
11421
|
}
|
|
11422
|
-
return headers.map((
|
|
11422
|
+
return headers.map((x5) => Buffer.from(x5));
|
|
11423
11423
|
}
|
|
11424
11424
|
function isBuffer(buffer) {
|
|
11425
11425
|
return buffer instanceof Uint8Array || Buffer.isBuffer(buffer);
|
|
@@ -12986,7 +12986,7 @@ var require_connect = __commonJS({
|
|
|
12986
12986
|
};
|
|
12987
12987
|
}
|
|
12988
12988
|
function maybeNormalizeConnectError(err, socket, opts) {
|
|
12989
|
-
if (err instanceof AggregateError && (err.code === "ETIMEDOUT" || err.errors.some((
|
|
12989
|
+
if (err instanceof AggregateError && (err.code === "ETIMEDOUT" || err.errors.some((e4) => e4 != null && e4.code === "ETIMEDOUT"))) {
|
|
12990
12990
|
let message = "Connect Timeout Error";
|
|
12991
12991
|
if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {
|
|
12992
12992
|
message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(", ")},`;
|
|
@@ -13370,7 +13370,7 @@ var require_constants2 = __commonJS({
|
|
|
13370
13370
|
exports2.METHODS.POST
|
|
13371
13371
|
];
|
|
13372
13372
|
exports2.METHOD_MAP = (0, utils_1.enumToMap)(exports2.METHODS);
|
|
13373
|
-
exports2.H_METHOD_MAP = Object.fromEntries(Object.entries(exports2.METHODS).filter(([
|
|
13373
|
+
exports2.H_METHOD_MAP = Object.fromEntries(Object.entries(exports2.METHODS).filter(([k5]) => k5.startsWith("H")));
|
|
13374
13374
|
exports2.STATUSES_HTTP = [
|
|
13375
13375
|
exports2.STATUSES.CONTINUE,
|
|
13376
13376
|
exports2.STATUSES.SWITCHING_PROTOCOLS,
|
|
@@ -14142,21 +14142,21 @@ var require_data_url = __commonJS({
|
|
|
14142
14142
|
function percentDecode(input) {
|
|
14143
14143
|
const length = input.length;
|
|
14144
14144
|
const output = new Uint8Array(length);
|
|
14145
|
-
let
|
|
14145
|
+
let j5 = 0;
|
|
14146
14146
|
let i2 = 0;
|
|
14147
14147
|
while (i2 < length) {
|
|
14148
14148
|
const byte = input[i2];
|
|
14149
14149
|
if (byte !== 37) {
|
|
14150
|
-
output[
|
|
14150
|
+
output[j5++] = byte;
|
|
14151
14151
|
} else if (byte === 37 && !(isHexCharByte(input[i2 + 1]) && isHexCharByte(input[i2 + 2]))) {
|
|
14152
|
-
output[
|
|
14152
|
+
output[j5++] = 37;
|
|
14153
14153
|
} else {
|
|
14154
|
-
output[
|
|
14154
|
+
output[j5++] = hexByteToNumber(input[i2 + 1]) << 4 | hexByteToNumber(input[i2 + 2]);
|
|
14155
14155
|
i2 += 2;
|
|
14156
14156
|
}
|
|
14157
14157
|
++i2;
|
|
14158
14158
|
}
|
|
14159
|
-
return length ===
|
|
14159
|
+
return length === j5 ? output : output.subarray(0, j5);
|
|
14160
14160
|
}
|
|
14161
14161
|
function parseMIMEType(input) {
|
|
14162
14162
|
input = removeHTTPWhitespace(input, true, true);
|
|
@@ -14385,8 +14385,8 @@ var require_webidl = __commonJS({
|
|
|
14385
14385
|
message: `"${context.value}" is an invalid ${context.type}.`
|
|
14386
14386
|
});
|
|
14387
14387
|
};
|
|
14388
|
-
webidl.brandCheck = function(V3,
|
|
14389
|
-
if (!FunctionPrototypeSymbolHasInstance(
|
|
14388
|
+
webidl.brandCheck = function(V3, I4) {
|
|
14389
|
+
if (!FunctionPrototypeSymbolHasInstance(I4, V3)) {
|
|
14390
14390
|
const err = new TypeError("Illegal invocation");
|
|
14391
14391
|
err.code = "ERR_INVALID_THIS";
|
|
14392
14392
|
throw err;
|
|
@@ -14416,8 +14416,8 @@ var require_webidl = __commonJS({
|
|
|
14416
14416
|
message: "Illegal constructor"
|
|
14417
14417
|
});
|
|
14418
14418
|
};
|
|
14419
|
-
webidl.util.MakeTypeAssertion = function(
|
|
14420
|
-
return (
|
|
14419
|
+
webidl.util.MakeTypeAssertion = function(I4) {
|
|
14420
|
+
return (O4) => FunctionPrototypeSymbolHasInstance(I4, O4);
|
|
14421
14421
|
};
|
|
14422
14422
|
webidl.util.Type = function(V3) {
|
|
14423
14423
|
switch (typeof V3) {
|
|
@@ -14452,8 +14452,8 @@ var require_webidl = __commonJS({
|
|
|
14452
14452
|
NULL,
|
|
14453
14453
|
OBJECT
|
|
14454
14454
|
};
|
|
14455
|
-
webidl.util.TypeValueToString = function(
|
|
14456
|
-
switch (webidl.util.Type(
|
|
14455
|
+
webidl.util.TypeValueToString = function(o3) {
|
|
14456
|
+
switch (webidl.util.Type(o3)) {
|
|
14457
14457
|
case UNDEFINED:
|
|
14458
14458
|
return "Undefined";
|
|
14459
14459
|
case BOOLEAN:
|
|
@@ -14490,51 +14490,51 @@ var require_webidl = __commonJS({
|
|
|
14490
14490
|
lowerBound = -Math.pow(2, bitLength - 1);
|
|
14491
14491
|
upperBound = Math.pow(2, bitLength - 1) - 1;
|
|
14492
14492
|
}
|
|
14493
|
-
let
|
|
14494
|
-
if (
|
|
14495
|
-
|
|
14493
|
+
let x5 = Number(V3);
|
|
14494
|
+
if (x5 === 0) {
|
|
14495
|
+
x5 = 0;
|
|
14496
14496
|
}
|
|
14497
14497
|
if (webidl.util.HasFlag(flags, webidl.attributes.EnforceRange)) {
|
|
14498
|
-
if (Number.isNaN(
|
|
14498
|
+
if (Number.isNaN(x5) || x5 === Number.POSITIVE_INFINITY || x5 === Number.NEGATIVE_INFINITY) {
|
|
14499
14499
|
throw webidl.errors.exception({
|
|
14500
14500
|
header: "Integer conversion",
|
|
14501
14501
|
message: `Could not convert ${webidl.util.Stringify(V3)} to an integer.`
|
|
14502
14502
|
});
|
|
14503
14503
|
}
|
|
14504
|
-
|
|
14505
|
-
if (
|
|
14504
|
+
x5 = webidl.util.IntegerPart(x5);
|
|
14505
|
+
if (x5 < lowerBound || x5 > upperBound) {
|
|
14506
14506
|
throw webidl.errors.exception({
|
|
14507
14507
|
header: "Integer conversion",
|
|
14508
|
-
message: `Value must be between ${lowerBound}-${upperBound}, got ${
|
|
14508
|
+
message: `Value must be between ${lowerBound}-${upperBound}, got ${x5}.`
|
|
14509
14509
|
});
|
|
14510
14510
|
}
|
|
14511
|
-
return
|
|
14511
|
+
return x5;
|
|
14512
14512
|
}
|
|
14513
|
-
if (!Number.isNaN(
|
|
14514
|
-
|
|
14515
|
-
if (Math.floor(
|
|
14516
|
-
|
|
14513
|
+
if (!Number.isNaN(x5) && webidl.util.HasFlag(flags, webidl.attributes.Clamp)) {
|
|
14514
|
+
x5 = Math.min(Math.max(x5, lowerBound), upperBound);
|
|
14515
|
+
if (Math.floor(x5) % 2 === 0) {
|
|
14516
|
+
x5 = Math.floor(x5);
|
|
14517
14517
|
} else {
|
|
14518
|
-
|
|
14518
|
+
x5 = Math.ceil(x5);
|
|
14519
14519
|
}
|
|
14520
|
-
return
|
|
14520
|
+
return x5;
|
|
14521
14521
|
}
|
|
14522
|
-
if (Number.isNaN(
|
|
14522
|
+
if (Number.isNaN(x5) || x5 === 0 && Object.is(0, x5) || x5 === Number.POSITIVE_INFINITY || x5 === Number.NEGATIVE_INFINITY) {
|
|
14523
14523
|
return 0;
|
|
14524
14524
|
}
|
|
14525
|
-
|
|
14526
|
-
|
|
14527
|
-
if (signedness === "signed" &&
|
|
14528
|
-
return
|
|
14525
|
+
x5 = webidl.util.IntegerPart(x5);
|
|
14526
|
+
x5 = x5 % Math.pow(2, bitLength);
|
|
14527
|
+
if (signedness === "signed" && x5 >= Math.pow(2, bitLength - 1)) {
|
|
14528
|
+
return x5 - Math.pow(2, bitLength);
|
|
14529
14529
|
}
|
|
14530
|
-
return
|
|
14530
|
+
return x5;
|
|
14531
14531
|
};
|
|
14532
|
-
webidl.util.IntegerPart = function(
|
|
14533
|
-
const
|
|
14534
|
-
if (
|
|
14535
|
-
return -1 *
|
|
14532
|
+
webidl.util.IntegerPart = function(n3) {
|
|
14533
|
+
const r3 = Math.floor(Math.abs(n3));
|
|
14534
|
+
if (n3 < 0) {
|
|
14535
|
+
return -1 * r3;
|
|
14536
14536
|
}
|
|
14537
|
-
return
|
|
14537
|
+
return r3;
|
|
14538
14538
|
};
|
|
14539
14539
|
webidl.util.Stringify = function(V3) {
|
|
14540
14540
|
const type = webidl.util.Type(V3);
|
|
@@ -14594,30 +14594,30 @@ var require_webidl = __commonJS({
|
|
|
14594
14594
|
};
|
|
14595
14595
|
};
|
|
14596
14596
|
webidl.recordConverter = function(keyConverter, valueConverter) {
|
|
14597
|
-
return (
|
|
14598
|
-
if (webidl.util.Type(
|
|
14597
|
+
return (O4, prefix, argument) => {
|
|
14598
|
+
if (webidl.util.Type(O4) !== OBJECT) {
|
|
14599
14599
|
throw webidl.errors.exception({
|
|
14600
14600
|
header: prefix,
|
|
14601
|
-
message: `${argument} ("${webidl.util.TypeValueToString(
|
|
14601
|
+
message: `${argument} ("${webidl.util.TypeValueToString(O4)}") is not an Object.`
|
|
14602
14602
|
});
|
|
14603
14603
|
}
|
|
14604
14604
|
const result = {};
|
|
14605
|
-
if (!types.isProxy(
|
|
14606
|
-
const keys2 = [...Object.getOwnPropertyNames(
|
|
14605
|
+
if (!types.isProxy(O4)) {
|
|
14606
|
+
const keys2 = [...Object.getOwnPropertyNames(O4), ...Object.getOwnPropertySymbols(O4)];
|
|
14607
14607
|
for (const key of keys2) {
|
|
14608
14608
|
const keyName = webidl.util.Stringify(key);
|
|
14609
14609
|
const typedKey = keyConverter(key, prefix, `Key ${keyName} in ${argument}`);
|
|
14610
|
-
const typedValue = valueConverter(
|
|
14610
|
+
const typedValue = valueConverter(O4[key], prefix, `${argument}[${keyName}]`);
|
|
14611
14611
|
result[typedKey] = typedValue;
|
|
14612
14612
|
}
|
|
14613
14613
|
return result;
|
|
14614
14614
|
}
|
|
14615
|
-
const keys = Reflect.ownKeys(
|
|
14615
|
+
const keys = Reflect.ownKeys(O4);
|
|
14616
14616
|
for (const key of keys) {
|
|
14617
|
-
const desc = Reflect.getOwnPropertyDescriptor(
|
|
14617
|
+
const desc = Reflect.getOwnPropertyDescriptor(O4, key);
|
|
14618
14618
|
if (desc?.enumerable) {
|
|
14619
14619
|
const typedKey = keyConverter(key, prefix, argument);
|
|
14620
|
-
const typedValue = valueConverter(
|
|
14620
|
+
const typedValue = valueConverter(O4[key], prefix, argument);
|
|
14621
14621
|
result[typedKey] = typedValue;
|
|
14622
14622
|
}
|
|
14623
14623
|
}
|
|
@@ -14636,7 +14636,7 @@ var require_webidl = __commonJS({
|
|
|
14636
14636
|
};
|
|
14637
14637
|
};
|
|
14638
14638
|
webidl.dictionaryConverter = function(converters) {
|
|
14639
|
-
converters.sort((
|
|
14639
|
+
converters.sort((a3, b5) => (a3.key > b5.key) - (a3.key < b5.key));
|
|
14640
14640
|
return (dictionary, prefix, argument) => {
|
|
14641
14641
|
const dict = {};
|
|
14642
14642
|
if (dictionary != null && webidl.util.Type(dictionary) !== OBJECT) {
|
|
@@ -14735,15 +14735,15 @@ var require_webidl = __commonJS({
|
|
|
14735
14735
|
message: `${argument} is a symbol, which cannot be converted to a ByteString.`
|
|
14736
14736
|
});
|
|
14737
14737
|
}
|
|
14738
|
-
const
|
|
14739
|
-
for (let index = 0; index <
|
|
14740
|
-
if (
|
|
14738
|
+
const x5 = String(V3);
|
|
14739
|
+
for (let index = 0; index < x5.length; index++) {
|
|
14740
|
+
if (x5.charCodeAt(index) > 255) {
|
|
14741
14741
|
throw new TypeError(
|
|
14742
|
-
`Cannot convert argument to a ByteString because the character at index ${index} has a value of ${
|
|
14742
|
+
`Cannot convert argument to a ByteString because the character at index ${index} has a value of ${x5.charCodeAt(index)} which is greater than 255.`
|
|
14743
14743
|
);
|
|
14744
14744
|
}
|
|
14745
14745
|
}
|
|
14746
|
-
return
|
|
14746
|
+
return x5;
|
|
14747
14747
|
};
|
|
14748
14748
|
webidl.converters.USVString = function(value) {
|
|
14749
14749
|
if (typeof value === "string") {
|
|
@@ -14752,27 +14752,27 @@ var require_webidl = __commonJS({
|
|
|
14752
14752
|
return `${value}`.toWellFormed();
|
|
14753
14753
|
};
|
|
14754
14754
|
webidl.converters.boolean = function(V3) {
|
|
14755
|
-
const
|
|
14756
|
-
return
|
|
14755
|
+
const x5 = Boolean(V3);
|
|
14756
|
+
return x5;
|
|
14757
14757
|
};
|
|
14758
14758
|
webidl.converters.any = function(V3) {
|
|
14759
14759
|
return V3;
|
|
14760
14760
|
};
|
|
14761
14761
|
webidl.converters["long long"] = function(V3, prefix, argument) {
|
|
14762
|
-
const
|
|
14763
|
-
return
|
|
14762
|
+
const x5 = webidl.util.ConvertToInt(V3, 64, "signed", 0, prefix, argument);
|
|
14763
|
+
return x5;
|
|
14764
14764
|
};
|
|
14765
14765
|
webidl.converters["unsigned long long"] = function(V3, prefix, argument) {
|
|
14766
|
-
const
|
|
14767
|
-
return
|
|
14766
|
+
const x5 = webidl.util.ConvertToInt(V3, 64, "unsigned", 0, prefix, argument);
|
|
14767
|
+
return x5;
|
|
14768
14768
|
};
|
|
14769
14769
|
webidl.converters["unsigned long"] = function(V3, prefix, argument) {
|
|
14770
|
-
const
|
|
14771
|
-
return
|
|
14770
|
+
const x5 = webidl.util.ConvertToInt(V3, 32, "unsigned", 0, prefix, argument);
|
|
14771
|
+
return x5;
|
|
14772
14772
|
};
|
|
14773
14773
|
webidl.converters["unsigned short"] = function(V3, prefix, argument, flags) {
|
|
14774
|
-
const
|
|
14775
|
-
return
|
|
14774
|
+
const x5 = webidl.util.ConvertToInt(V3, 16, "unsigned", flags, prefix, argument);
|
|
14775
|
+
return x5;
|
|
14776
14776
|
};
|
|
14777
14777
|
webidl.converters.ArrayBuffer = function(V3, prefix, argument, flags) {
|
|
14778
14778
|
if (webidl.util.Type(V3) !== OBJECT || !types.isArrayBuffer(V3)) {
|
|
@@ -14806,12 +14806,12 @@ var require_webidl = __commonJS({
|
|
|
14806
14806
|
}
|
|
14807
14807
|
return V3;
|
|
14808
14808
|
};
|
|
14809
|
-
webidl.converters.TypedArray = function(V3,
|
|
14810
|
-
if (webidl.util.Type(V3) !== OBJECT || !types.isTypedArray(V3) || V3.constructor.name !==
|
|
14809
|
+
webidl.converters.TypedArray = function(V3, T4, prefix, argument, flags) {
|
|
14810
|
+
if (webidl.util.Type(V3) !== OBJECT || !types.isTypedArray(V3) || V3.constructor.name !== T4.name) {
|
|
14811
14811
|
throw webidl.errors.conversionFailed({
|
|
14812
14812
|
prefix,
|
|
14813
14813
|
argument: `${argument} ("${webidl.util.Stringify(V3)}")`,
|
|
14814
|
-
types: [
|
|
14814
|
+
types: [T4.name]
|
|
14815
14815
|
});
|
|
14816
14816
|
}
|
|
14817
14817
|
if (!webidl.util.HasFlag(flags, webidl.attributes.AllowShared) && types.isSharedArrayBuffer(V3.buffer)) {
|
|
@@ -15263,11 +15263,11 @@ var require_util2 = __commonJS({
|
|
|
15263
15263
|
}
|
|
15264
15264
|
function tryUpgradeRequestToAPotentiallyTrustworthyURL(request) {
|
|
15265
15265
|
}
|
|
15266
|
-
function sameOrigin(
|
|
15267
|
-
if (
|
|
15266
|
+
function sameOrigin(A4, B3) {
|
|
15267
|
+
if (A4.origin === B3.origin && A4.origin === "null") {
|
|
15268
15268
|
return true;
|
|
15269
15269
|
}
|
|
15270
|
-
if (
|
|
15270
|
+
if (A4.protocol === B3.protocol && A4.hostname === B3.hostname && A4.port === B3.port) {
|
|
15271
15271
|
return true;
|
|
15272
15272
|
}
|
|
15273
15273
|
return false;
|
|
@@ -15414,8 +15414,8 @@ var require_util2 = __commonJS({
|
|
|
15414
15414
|
try {
|
|
15415
15415
|
const reader = body.stream.getReader();
|
|
15416
15416
|
readAllBytes(reader, successSteps, errorSteps);
|
|
15417
|
-
} catch (
|
|
15418
|
-
errorSteps(
|
|
15417
|
+
} catch (e4) {
|
|
15418
|
+
errorSteps(e4);
|
|
15419
15419
|
}
|
|
15420
15420
|
}
|
|
15421
15421
|
function readableStreamClose(controller) {
|
|
@@ -15445,8 +15445,8 @@ var require_util2 = __commonJS({
|
|
|
15445
15445
|
bytes.push(chunk);
|
|
15446
15446
|
byteLength += chunk.length;
|
|
15447
15447
|
} while (true);
|
|
15448
|
-
} catch (
|
|
15449
|
-
failureSteps(
|
|
15448
|
+
} catch (e4) {
|
|
15449
|
+
failureSteps(e4);
|
|
15450
15450
|
}
|
|
15451
15451
|
}
|
|
15452
15452
|
function urlIsLocal(url2) {
|
|
@@ -15886,17 +15886,17 @@ var require_formdata = __commonJS({
|
|
|
15886
15886
|
}
|
|
15887
15887
|
}
|
|
15888
15888
|
[nodeUtil.inspect.custom](depth, options) {
|
|
15889
|
-
const state = this.#state.reduce((
|
|
15890
|
-
if (
|
|
15891
|
-
if (Array.isArray(
|
|
15892
|
-
|
|
15889
|
+
const state = this.#state.reduce((a3, b5) => {
|
|
15890
|
+
if (a3[b5.name]) {
|
|
15891
|
+
if (Array.isArray(a3[b5.name])) {
|
|
15892
|
+
a3[b5.name].push(b5.value);
|
|
15893
15893
|
} else {
|
|
15894
|
-
|
|
15894
|
+
a3[b5.name] = [a3[b5.name], b5.value];
|
|
15895
15895
|
}
|
|
15896
15896
|
} else {
|
|
15897
|
-
|
|
15897
|
+
a3[b5.name] = b5.value;
|
|
15898
15898
|
}
|
|
15899
|
-
return
|
|
15899
|
+
return a3;
|
|
15900
15900
|
}, { __proto__: null });
|
|
15901
15901
|
options.depth ??= depth;
|
|
15902
15902
|
options.colors ??= true;
|
|
@@ -16551,8 +16551,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
16551
16551
|
function consumeBody(object2, convertBytesToJSValue, instance, getInternalState) {
|
|
16552
16552
|
try {
|
|
16553
16553
|
webidl.brandCheck(object2, instance);
|
|
16554
|
-
} catch (
|
|
16555
|
-
return Promise.reject(
|
|
16554
|
+
} catch (e4) {
|
|
16555
|
+
return Promise.reject(e4);
|
|
16556
16556
|
}
|
|
16557
16557
|
object2 = getInternalState(object2);
|
|
16558
16558
|
if (bodyUnusable(object2)) {
|
|
@@ -16563,8 +16563,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
16563
16563
|
const successSteps = (data) => {
|
|
16564
16564
|
try {
|
|
16565
16565
|
promise2.resolve(convertBytesToJSValue(data));
|
|
16566
|
-
} catch (
|
|
16567
|
-
errorSteps(
|
|
16566
|
+
} catch (e4) {
|
|
16567
|
+
errorSteps(e4);
|
|
16568
16568
|
}
|
|
16569
16569
|
};
|
|
16570
16570
|
if (object2.body == null) {
|
|
@@ -17550,9 +17550,9 @@ upgrade: ${upgrade}\r
|
|
|
17550
17550
|
header += "connection: close\r\n";
|
|
17551
17551
|
}
|
|
17552
17552
|
if (Array.isArray(headers)) {
|
|
17553
|
-
for (let
|
|
17554
|
-
const key = headers[
|
|
17555
|
-
const val = headers[
|
|
17553
|
+
for (let n3 = 0; n3 < headers.length; n3 += 2) {
|
|
17554
|
+
const key = headers[n3 + 0];
|
|
17555
|
+
const val = headers[n3 + 1];
|
|
17556
17556
|
if (Array.isArray(val)) {
|
|
17557
17557
|
for (let i2 = 0; i2 < val.length; i2++) {
|
|
17558
17558
|
header += `${key}: ${val[i2]}\r
|
|
@@ -18410,9 +18410,9 @@ var require_client_h2 = __commonJS({
|
|
|
18410
18410
|
}
|
|
18411
18411
|
function buildRequestHeaders(reqHeaders) {
|
|
18412
18412
|
const headers = {};
|
|
18413
|
-
for (let
|
|
18414
|
-
const key = reqHeaders[
|
|
18415
|
-
const val = reqHeaders[
|
|
18413
|
+
for (let n3 = 0; n3 < reqHeaders.length; n3 += 2) {
|
|
18414
|
+
const key = reqHeaders[n3 + 0];
|
|
18415
|
+
const val = reqHeaders[n3 + 1];
|
|
18416
18416
|
const current = headers[key];
|
|
18417
18417
|
if (key === "cookie") {
|
|
18418
18418
|
if (current != null) {
|
|
@@ -19984,14 +19984,14 @@ var require_balanced_pool = __commonJS({
|
|
|
19984
19984
|
var kWeight = /* @__PURE__ */ Symbol("kWeight");
|
|
19985
19985
|
var kMaxWeightPerServer = /* @__PURE__ */ Symbol("kMaxWeightPerServer");
|
|
19986
19986
|
var kErrorPenalty = /* @__PURE__ */ Symbol("kErrorPenalty");
|
|
19987
|
-
function getGreatestCommonDivisor(
|
|
19988
|
-
if (
|
|
19989
|
-
while (
|
|
19990
|
-
const
|
|
19991
|
-
|
|
19992
|
-
|
|
19987
|
+
function getGreatestCommonDivisor(a3, b5) {
|
|
19988
|
+
if (a3 === 0) return b5;
|
|
19989
|
+
while (b5 !== 0) {
|
|
19990
|
+
const t3 = b5;
|
|
19991
|
+
b5 = a3 % b5;
|
|
19992
|
+
a3 = t3;
|
|
19993
19993
|
}
|
|
19994
|
-
return
|
|
19994
|
+
return a3;
|
|
19995
19995
|
}
|
|
19996
19996
|
function defaultFactory(origin, opts) {
|
|
19997
19997
|
return new Pool(origin, opts);
|
|
@@ -22334,8 +22334,8 @@ var require_readable = __commonJS({
|
|
|
22334
22334
|
} else if (state.bufferIndex) {
|
|
22335
22335
|
const start = state.bufferIndex;
|
|
22336
22336
|
const end = state.buffer.length;
|
|
22337
|
-
for (let
|
|
22338
|
-
consumePush(consume2, state.buffer[
|
|
22337
|
+
for (let n3 = start; n3 < end; n3++) {
|
|
22338
|
+
consumePush(consume2, state.buffer[n3]);
|
|
22339
22339
|
}
|
|
22340
22340
|
} else {
|
|
22341
22341
|
for (const chunk of state.buffer) {
|
|
@@ -23580,8 +23580,8 @@ var require_mock_utils = __commonJS({
|
|
|
23580
23580
|
const value = data[key];
|
|
23581
23581
|
const name = Buffer.from(`${key}`);
|
|
23582
23582
|
if (Array.isArray(value)) {
|
|
23583
|
-
for (let
|
|
23584
|
-
result.push(name, Buffer.from(`${value[
|
|
23583
|
+
for (let j5 = 0; j5 < value.length; ++j5) {
|
|
23584
|
+
result.push(name, Buffer.from(`${value[j5]}`));
|
|
23585
23585
|
}
|
|
23586
23586
|
} else {
|
|
23587
23587
|
result.push(name, Buffer.from(`${value}`));
|
|
@@ -26196,11 +26196,11 @@ var require_cache = __commonJS({
|
|
|
26196
26196
|
} else if (typeof opts.headers === "object") {
|
|
26197
26197
|
headers = {};
|
|
26198
26198
|
if (hasSafeIterator(opts.headers)) {
|
|
26199
|
-
for (const
|
|
26200
|
-
if (!Array.isArray(
|
|
26199
|
+
for (const x5 of opts.headers) {
|
|
26200
|
+
if (!Array.isArray(x5)) {
|
|
26201
26201
|
throw new Error("opts.headers is not a valid header map");
|
|
26202
26202
|
}
|
|
26203
|
-
const [key, val] =
|
|
26203
|
+
const [key, val] = x5;
|
|
26204
26204
|
if (typeof key !== "string" || typeof val !== "string") {
|
|
26205
26205
|
throw new Error("opts.headers is not a valid header map");
|
|
26206
26206
|
}
|
|
@@ -26303,8 +26303,8 @@ var require_cache = __commonJS({
|
|
|
26303
26303
|
const headers = [value.substring(1)];
|
|
26304
26304
|
let foundEndingQuote = value[value.length - 1] === '"';
|
|
26305
26305
|
if (!foundEndingQuote) {
|
|
26306
|
-
for (let
|
|
26307
|
-
const nextPart = directives[
|
|
26306
|
+
for (let j5 = i2 + 1; j5 < directives.length; j5++) {
|
|
26307
|
+
const nextPart = directives[j5];
|
|
26308
26308
|
const nextPartLength = nextPart.length;
|
|
26309
26309
|
headers.push(nextPart.trim());
|
|
26310
26310
|
if (nextPartLength !== 0 && nextPart[nextPartLength - 1] === '"') {
|
|
@@ -26319,8 +26319,8 @@ var require_cache = __commonJS({
|
|
|
26319
26319
|
lastHeader = lastHeader.substring(0, lastHeader.length - 1);
|
|
26320
26320
|
headers[headers.length - 1] = lastHeader;
|
|
26321
26321
|
}
|
|
26322
|
-
for (let
|
|
26323
|
-
headers[
|
|
26322
|
+
for (let j5 = 0; j5 < headers.length; j5++) {
|
|
26323
|
+
headers[j5] = headers[j5].trim();
|
|
26324
26324
|
}
|
|
26325
26325
|
if (key in output) {
|
|
26326
26326
|
output[key] = output[key].concat(headers);
|
|
@@ -28958,7 +28958,7 @@ var require_sqlite_cache_store = __commonJS({
|
|
|
28958
28958
|
if (lhs.length !== rhs.length) {
|
|
28959
28959
|
return false;
|
|
28960
28960
|
}
|
|
28961
|
-
return lhs.every((
|
|
28961
|
+
return lhs.every((x5, i2) => x5 === rhs[i2]);
|
|
28962
28962
|
}
|
|
28963
28963
|
return lhs === rhs;
|
|
28964
28964
|
}
|
|
@@ -28984,10 +28984,10 @@ var require_headers = __commonJS({
|
|
|
28984
28984
|
}
|
|
28985
28985
|
function headerValueNormalize(potentialValue) {
|
|
28986
28986
|
let i2 = 0;
|
|
28987
|
-
let
|
|
28988
|
-
while (
|
|
28989
|
-
while (
|
|
28990
|
-
return i2 === 0 &&
|
|
28987
|
+
let j5 = potentialValue.length;
|
|
28988
|
+
while (j5 > i2 && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j5 - 1))) --j5;
|
|
28989
|
+
while (j5 > i2 && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i2))) ++i2;
|
|
28990
|
+
return i2 === 0 && j5 === potentialValue.length ? potentialValue : potentialValue.substring(i2, j5);
|
|
28991
28991
|
}
|
|
28992
28992
|
function fill(headers, object2) {
|
|
28993
28993
|
if (Array.isArray(object2)) {
|
|
@@ -29051,8 +29051,8 @@ var require_headers = __commonJS({
|
|
|
29051
29051
|
for (let i2 = 0; i2 < names.length; ++i2) {
|
|
29052
29052
|
const { 0: name, 1: value } = names[i2];
|
|
29053
29053
|
if (name === "set-cookie") {
|
|
29054
|
-
for (let
|
|
29055
|
-
headers.push([name, cookies[
|
|
29054
|
+
for (let j5 = 0; j5 < cookies.length; ++j5) {
|
|
29055
|
+
headers.push([name, cookies[j5]]);
|
|
29056
29056
|
}
|
|
29057
29057
|
} else {
|
|
29058
29058
|
headers.push([name, value]);
|
|
@@ -29060,8 +29060,8 @@ var require_headers = __commonJS({
|
|
|
29060
29060
|
}
|
|
29061
29061
|
return headersList.sortedMap = headers;
|
|
29062
29062
|
}
|
|
29063
|
-
function compareHeaderName(
|
|
29064
|
-
return
|
|
29063
|
+
function compareHeaderName(a3, b5) {
|
|
29064
|
+
return a3[0] < b5[0] ? -1 : 1;
|
|
29065
29065
|
}
|
|
29066
29066
|
var HeadersList = class _HeadersList {
|
|
29067
29067
|
/** @type {[string, string][]|null} */
|
|
@@ -29194,26 +29194,26 @@ var require_headers = __commonJS({
|
|
|
29194
29194
|
const firstValue = iterator.next().value;
|
|
29195
29195
|
array2[0] = [firstValue[0], firstValue[1].value];
|
|
29196
29196
|
assert2(firstValue[1].value !== null);
|
|
29197
|
-
for (let i2 = 1,
|
|
29197
|
+
for (let i2 = 1, j5 = 0, right = 0, left = 0, pivot = 0, x5, value; i2 < size; ++i2) {
|
|
29198
29198
|
value = iterator.next().value;
|
|
29199
|
-
|
|
29200
|
-
assert2(
|
|
29199
|
+
x5 = array2[i2] = [value[0], value[1].value];
|
|
29200
|
+
assert2(x5[1] !== null);
|
|
29201
29201
|
left = 0;
|
|
29202
29202
|
right = i2;
|
|
29203
29203
|
while (left < right) {
|
|
29204
29204
|
pivot = left + (right - left >> 1);
|
|
29205
|
-
if (array2[pivot][0] <=
|
|
29205
|
+
if (array2[pivot][0] <= x5[0]) {
|
|
29206
29206
|
left = pivot + 1;
|
|
29207
29207
|
} else {
|
|
29208
29208
|
right = pivot;
|
|
29209
29209
|
}
|
|
29210
29210
|
}
|
|
29211
29211
|
if (i2 !== pivot) {
|
|
29212
|
-
|
|
29213
|
-
while (
|
|
29214
|
-
array2[
|
|
29212
|
+
j5 = i2;
|
|
29213
|
+
while (j5 > left) {
|
|
29214
|
+
array2[j5] = array2[--j5];
|
|
29215
29215
|
}
|
|
29216
|
-
array2[left] =
|
|
29216
|
+
array2[left] = x5;
|
|
29217
29217
|
}
|
|
29218
29218
|
}
|
|
29219
29219
|
if (!iterator.next().done) {
|
|
@@ -29351,17 +29351,17 @@ var require_headers = __commonJS({
|
|
|
29351
29351
|
options.depth ??= depth;
|
|
29352
29352
|
return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`;
|
|
29353
29353
|
}
|
|
29354
|
-
static getHeadersGuard(
|
|
29355
|
-
return
|
|
29354
|
+
static getHeadersGuard(o3) {
|
|
29355
|
+
return o3.#guard;
|
|
29356
29356
|
}
|
|
29357
|
-
static setHeadersGuard(
|
|
29358
|
-
|
|
29357
|
+
static setHeadersGuard(o3, guard) {
|
|
29358
|
+
o3.#guard = guard;
|
|
29359
29359
|
}
|
|
29360
29360
|
/**
|
|
29361
29361
|
* @param {Headers} o
|
|
29362
29362
|
*/
|
|
29363
|
-
static getHeadersList(
|
|
29364
|
-
return
|
|
29363
|
+
static getHeadersList(o3) {
|
|
29364
|
+
return o3.#headersList;
|
|
29365
29365
|
}
|
|
29366
29366
|
/**
|
|
29367
29367
|
* @param {Headers} target
|
|
@@ -30899,8 +30899,8 @@ var require_fetch = __commonJS({
|
|
|
30899
30899
|
let requestObject;
|
|
30900
30900
|
try {
|
|
30901
30901
|
requestObject = new Request(input, init);
|
|
30902
|
-
} catch (
|
|
30903
|
-
p.reject(
|
|
30902
|
+
} catch (e4) {
|
|
30903
|
+
p.reject(e4);
|
|
30904
30904
|
return p.promise;
|
|
30905
30905
|
}
|
|
30906
30906
|
const request = getRequestState(requestObject);
|
|
@@ -31636,14 +31636,14 @@ var require_fetch = __commonJS({
|
|
|
31636
31636
|
fetchParams.processRequestEndOfBody();
|
|
31637
31637
|
}
|
|
31638
31638
|
};
|
|
31639
|
-
const processBodyError = (
|
|
31639
|
+
const processBodyError = (e4) => {
|
|
31640
31640
|
if (isCancelled(fetchParams)) {
|
|
31641
31641
|
return;
|
|
31642
31642
|
}
|
|
31643
|
-
if (
|
|
31643
|
+
if (e4.name === "AbortError") {
|
|
31644
31644
|
fetchParams.controller.abort();
|
|
31645
31645
|
} else {
|
|
31646
|
-
fetchParams.controller.terminate(
|
|
31646
|
+
fetchParams.controller.terminate(e4);
|
|
31647
31647
|
}
|
|
31648
31648
|
};
|
|
31649
31649
|
requestBody = (async function* () {
|
|
@@ -31920,8 +31920,8 @@ var require_util3 = __commonJS({
|
|
|
31920
31920
|
var assert2 = require("node:assert");
|
|
31921
31921
|
var { URLSerializer } = require_data_url();
|
|
31922
31922
|
var { isValidHeaderName } = require_util2();
|
|
31923
|
-
function urlEquals(
|
|
31924
|
-
const serializedA = URLSerializer(
|
|
31923
|
+
function urlEquals(A4, B3, excludeFragment = false) {
|
|
31924
|
+
const serializedA = URLSerializer(A4, excludeFragment);
|
|
31925
31925
|
const serializedB = URLSerializer(B3, excludeFragment);
|
|
31926
31926
|
return serializedA === serializedB;
|
|
31927
31927
|
}
|
|
@@ -32015,8 +32015,8 @@ var require_cache3 = __commonJS({
|
|
|
32015
32015
|
if (typeof request === "string") {
|
|
32016
32016
|
continue;
|
|
32017
32017
|
}
|
|
32018
|
-
const
|
|
32019
|
-
if (!urlIsHttpHttpsScheme(
|
|
32018
|
+
const r3 = getRequestState(request);
|
|
32019
|
+
if (!urlIsHttpHttpsScheme(r3.url) || r3.method !== "GET") {
|
|
32020
32020
|
throw webidl.errors.exception({
|
|
32021
32021
|
header: prefix,
|
|
32022
32022
|
message: "Expected http/s scheme when method is not GET."
|
|
@@ -32025,19 +32025,19 @@ var require_cache3 = __commonJS({
|
|
|
32025
32025
|
}
|
|
32026
32026
|
const fetchControllers = [];
|
|
32027
32027
|
for (const request of requests) {
|
|
32028
|
-
const
|
|
32029
|
-
if (!urlIsHttpHttpsScheme(
|
|
32028
|
+
const r3 = getRequestState(new Request(request));
|
|
32029
|
+
if (!urlIsHttpHttpsScheme(r3.url)) {
|
|
32030
32030
|
throw webidl.errors.exception({
|
|
32031
32031
|
header: prefix,
|
|
32032
32032
|
message: "Expected http/s scheme."
|
|
32033
32033
|
});
|
|
32034
32034
|
}
|
|
32035
|
-
|
|
32036
|
-
|
|
32037
|
-
requestList.push(
|
|
32035
|
+
r3.initiator = "fetch";
|
|
32036
|
+
r3.destination = "subresource";
|
|
32037
|
+
requestList.push(r3);
|
|
32038
32038
|
const responsePromise = Promise.withResolvers();
|
|
32039
32039
|
fetchControllers.push(fetching({
|
|
32040
|
-
request:
|
|
32040
|
+
request: r3,
|
|
32041
32041
|
processResponse(response) {
|
|
32042
32042
|
if (response.type === "error" || response.status === 206 || response.status < 200 || response.status > 299) {
|
|
32043
32043
|
responsePromise.reject(webidl.errors.exception({
|
|
@@ -32090,8 +32090,8 @@ var require_cache3 = __commonJS({
|
|
|
32090
32090
|
let errorData = null;
|
|
32091
32091
|
try {
|
|
32092
32092
|
this.#batchCacheOperations(operations);
|
|
32093
|
-
} catch (
|
|
32094
|
-
errorData =
|
|
32093
|
+
} catch (e4) {
|
|
32094
|
+
errorData = e4;
|
|
32095
32095
|
}
|
|
32096
32096
|
queueMicrotask(() => {
|
|
32097
32097
|
if (errorData === null) {
|
|
@@ -32171,8 +32171,8 @@ var require_cache3 = __commonJS({
|
|
|
32171
32171
|
let errorData = null;
|
|
32172
32172
|
try {
|
|
32173
32173
|
this.#batchCacheOperations(operations);
|
|
32174
|
-
} catch (
|
|
32175
|
-
errorData =
|
|
32174
|
+
} catch (e4) {
|
|
32175
|
+
errorData = e4;
|
|
32176
32176
|
}
|
|
32177
32177
|
queueMicrotask(() => {
|
|
32178
32178
|
if (errorData === null) {
|
|
@@ -32189,20 +32189,20 @@ var require_cache3 = __commonJS({
|
|
|
32189
32189
|
webidl.argumentLengthCheck(arguments, 1, prefix);
|
|
32190
32190
|
request = webidl.converters.RequestInfo(request);
|
|
32191
32191
|
options = webidl.converters.CacheQueryOptions(options, prefix, "options");
|
|
32192
|
-
let
|
|
32192
|
+
let r3 = null;
|
|
32193
32193
|
if (webidl.is.Request(request)) {
|
|
32194
|
-
|
|
32195
|
-
if (
|
|
32194
|
+
r3 = getRequestState(request);
|
|
32195
|
+
if (r3.method !== "GET" && !options.ignoreMethod) {
|
|
32196
32196
|
return false;
|
|
32197
32197
|
}
|
|
32198
32198
|
} else {
|
|
32199
32199
|
assert2(typeof request === "string");
|
|
32200
|
-
|
|
32200
|
+
r3 = getRequestState(new Request(request));
|
|
32201
32201
|
}
|
|
32202
32202
|
const operations = [];
|
|
32203
32203
|
const operation = {
|
|
32204
32204
|
type: "delete",
|
|
32205
|
-
request:
|
|
32205
|
+
request: r3,
|
|
32206
32206
|
options
|
|
32207
32207
|
};
|
|
32208
32208
|
operations.push(operation);
|
|
@@ -32211,8 +32211,8 @@ var require_cache3 = __commonJS({
|
|
|
32211
32211
|
let requestResponses;
|
|
32212
32212
|
try {
|
|
32213
32213
|
requestResponses = this.#batchCacheOperations(operations);
|
|
32214
|
-
} catch (
|
|
32215
|
-
errorData =
|
|
32214
|
+
} catch (e4) {
|
|
32215
|
+
errorData = e4;
|
|
32216
32216
|
}
|
|
32217
32217
|
queueMicrotask(() => {
|
|
32218
32218
|
if (errorData === null) {
|
|
@@ -32234,15 +32234,15 @@ var require_cache3 = __commonJS({
|
|
|
32234
32234
|
const prefix = "Cache.keys";
|
|
32235
32235
|
if (request !== void 0) request = webidl.converters.RequestInfo(request);
|
|
32236
32236
|
options = webidl.converters.CacheQueryOptions(options, prefix, "options");
|
|
32237
|
-
let
|
|
32237
|
+
let r3 = null;
|
|
32238
32238
|
if (request !== void 0) {
|
|
32239
32239
|
if (webidl.is.Request(request)) {
|
|
32240
|
-
|
|
32241
|
-
if (
|
|
32240
|
+
r3 = getRequestState(request);
|
|
32241
|
+
if (r3.method !== "GET" && !options.ignoreMethod) {
|
|
32242
32242
|
return [];
|
|
32243
32243
|
}
|
|
32244
32244
|
} else if (typeof request === "string") {
|
|
32245
|
-
|
|
32245
|
+
r3 = getRequestState(new Request(request));
|
|
32246
32246
|
}
|
|
32247
32247
|
}
|
|
32248
32248
|
const promise2 = Promise.withResolvers();
|
|
@@ -32252,7 +32252,7 @@ var require_cache3 = __commonJS({
|
|
|
32252
32252
|
requests.push(requestResponse[0]);
|
|
32253
32253
|
}
|
|
32254
32254
|
} else {
|
|
32255
|
-
const requestResponses = this.#queryCache(
|
|
32255
|
+
const requestResponses = this.#queryCache(r3, options);
|
|
32256
32256
|
for (const requestResponse of requestResponses) {
|
|
32257
32257
|
requests.push(requestResponse[0]);
|
|
32258
32258
|
}
|
|
@@ -32317,14 +32317,14 @@ var require_cache3 = __commonJS({
|
|
|
32317
32317
|
message: "put operation should have an associated response"
|
|
32318
32318
|
});
|
|
32319
32319
|
}
|
|
32320
|
-
const
|
|
32321
|
-
if (!urlIsHttpHttpsScheme(
|
|
32320
|
+
const r3 = operation.request;
|
|
32321
|
+
if (!urlIsHttpHttpsScheme(r3.url)) {
|
|
32322
32322
|
throw webidl.errors.exception({
|
|
32323
32323
|
header: "Cache.#batchCacheOperations",
|
|
32324
32324
|
message: "expected http or https scheme"
|
|
32325
32325
|
});
|
|
32326
32326
|
}
|
|
32327
|
-
if (
|
|
32327
|
+
if (r3.method !== "GET") {
|
|
32328
32328
|
throw webidl.errors.exception({
|
|
32329
32329
|
header: "Cache.#batchCacheOperations",
|
|
32330
32330
|
message: "not get method"
|
|
@@ -32348,10 +32348,10 @@ var require_cache3 = __commonJS({
|
|
|
32348
32348
|
resultList.push([operation.request, operation.response]);
|
|
32349
32349
|
}
|
|
32350
32350
|
return resultList;
|
|
32351
|
-
} catch (
|
|
32351
|
+
} catch (e4) {
|
|
32352
32352
|
this.#relevantRequestResponseList.length = 0;
|
|
32353
32353
|
this.#relevantRequestResponseList = backupCache;
|
|
32354
|
-
throw
|
|
32354
|
+
throw e4;
|
|
32355
32355
|
}
|
|
32356
32356
|
}
|
|
32357
32357
|
/**
|
|
@@ -32407,15 +32407,15 @@ var require_cache3 = __commonJS({
|
|
|
32407
32407
|
return true;
|
|
32408
32408
|
}
|
|
32409
32409
|
#internalMatchAll(request, options, maxResponses = Infinity) {
|
|
32410
|
-
let
|
|
32410
|
+
let r3 = null;
|
|
32411
32411
|
if (request !== void 0) {
|
|
32412
32412
|
if (webidl.is.Request(request)) {
|
|
32413
|
-
|
|
32414
|
-
if (
|
|
32413
|
+
r3 = getRequestState(request);
|
|
32414
|
+
if (r3.method !== "GET" && !options.ignoreMethod) {
|
|
32415
32415
|
return [];
|
|
32416
32416
|
}
|
|
32417
32417
|
} else if (typeof request === "string") {
|
|
32418
|
-
|
|
32418
|
+
r3 = getRequestState(new Request(request));
|
|
32419
32419
|
}
|
|
32420
32420
|
}
|
|
32421
32421
|
const responses = [];
|
|
@@ -32424,7 +32424,7 @@ var require_cache3 = __commonJS({
|
|
|
32424
32424
|
responses.push(requestResponse[1]);
|
|
32425
32425
|
}
|
|
32426
32426
|
} else {
|
|
32427
|
-
const requestResponses = this.#queryCache(
|
|
32427
|
+
const requestResponses = this.#queryCache(r3, options);
|
|
32428
32428
|
for (const requestResponse of requestResponses) {
|
|
32429
32429
|
responses.push(requestResponse[1]);
|
|
32430
32430
|
}
|
|
@@ -33401,8 +33401,8 @@ var require_util5 = __commonJS({
|
|
|
33401
33401
|
function isClosed(readyState) {
|
|
33402
33402
|
return readyState === states.CLOSED;
|
|
33403
33403
|
}
|
|
33404
|
-
function fireEvent(
|
|
33405
|
-
const event = eventFactory(
|
|
33404
|
+
function fireEvent(e4, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) {
|
|
33405
|
+
const event = eventFactory(e4, eventInitDict);
|
|
33406
33406
|
target.dispatchEvent(event);
|
|
33407
33407
|
}
|
|
33408
33408
|
function websocketMessageReceived(handler, type, data) {
|
|
@@ -33494,8 +33494,8 @@ var require_util5 = __commonJS({
|
|
|
33494
33494
|
let urlRecord;
|
|
33495
33495
|
try {
|
|
33496
33496
|
urlRecord = new URL(url2, baseURL);
|
|
33497
|
-
} catch (
|
|
33498
|
-
throw new DOMException(
|
|
33497
|
+
} catch (e4) {
|
|
33498
|
+
throw new DOMException(e4, "SyntaxError");
|
|
33499
33499
|
}
|
|
33500
33500
|
if (urlRecord.protocol === "http:") {
|
|
33501
33501
|
urlRecord.protocol = "ws:";
|
|
@@ -34123,31 +34123,31 @@ var require_receiver = __commonJS({
|
|
|
34123
34123
|
* @param {number} n
|
|
34124
34124
|
* @returns {Buffer}
|
|
34125
34125
|
*/
|
|
34126
|
-
consume(
|
|
34127
|
-
if (
|
|
34126
|
+
consume(n3) {
|
|
34127
|
+
if (n3 > this.#byteOffset) {
|
|
34128
34128
|
throw new Error("Called consume() before buffers satiated.");
|
|
34129
|
-
} else if (
|
|
34129
|
+
} else if (n3 === 0) {
|
|
34130
34130
|
return emptyBuffer;
|
|
34131
34131
|
}
|
|
34132
|
-
this.#byteOffset -=
|
|
34132
|
+
this.#byteOffset -= n3;
|
|
34133
34133
|
const first = this.#buffers[0];
|
|
34134
|
-
if (first.length >
|
|
34135
|
-
this.#buffers[0] = first.subarray(
|
|
34136
|
-
return first.subarray(0,
|
|
34137
|
-
} else if (first.length ===
|
|
34134
|
+
if (first.length > n3) {
|
|
34135
|
+
this.#buffers[0] = first.subarray(n3, first.length);
|
|
34136
|
+
return first.subarray(0, n3);
|
|
34137
|
+
} else if (first.length === n3) {
|
|
34138
34138
|
return this.#buffers.shift();
|
|
34139
34139
|
} else {
|
|
34140
34140
|
let offset = 0;
|
|
34141
|
-
const buffer = Buffer.allocUnsafeSlow(
|
|
34142
|
-
while (offset !==
|
|
34141
|
+
const buffer = Buffer.allocUnsafeSlow(n3);
|
|
34142
|
+
while (offset !== n3) {
|
|
34143
34143
|
const next = this.#buffers[0];
|
|
34144
34144
|
const length = next.length;
|
|
34145
|
-
if (length + offset ===
|
|
34145
|
+
if (length + offset === n3) {
|
|
34146
34146
|
buffer.set(this.#buffers.shift(), offset);
|
|
34147
34147
|
break;
|
|
34148
|
-
} else if (length + offset >
|
|
34149
|
-
buffer.set(next.subarray(0,
|
|
34150
|
-
this.#buffers[0] = next.subarray(
|
|
34148
|
+
} else if (length + offset > n3) {
|
|
34149
|
+
buffer.set(next.subarray(0, n3 - offset), offset);
|
|
34150
|
+
this.#buffers[0] = next.subarray(n3 - offset);
|
|
34151
34151
|
break;
|
|
34152
34152
|
} else {
|
|
34153
34153
|
buffer.set(this.#buffers.shift(), offset);
|
|
@@ -35062,8 +35062,8 @@ var require_websocketstream = __commonJS({
|
|
|
35062
35062
|
let string4;
|
|
35063
35063
|
try {
|
|
35064
35064
|
string4 = webidl.converters.DOMString(chunk);
|
|
35065
|
-
} catch (
|
|
35066
|
-
promise2.reject(
|
|
35065
|
+
} catch (e4) {
|
|
35066
|
+
promise2.reject(e4);
|
|
35067
35067
|
return promise2.promise;
|
|
35068
35068
|
}
|
|
35069
35069
|
data = new TextEncoder().encode(string4);
|
|
@@ -35671,8 +35671,8 @@ var require_eventsource = __commonJS({
|
|
|
35671
35671
|
try {
|
|
35672
35672
|
urlRecord = new URL(url2, settings.settingsObject.baseUrl);
|
|
35673
35673
|
this.#state.origin = urlRecord.origin;
|
|
35674
|
-
} catch (
|
|
35675
|
-
throw new DOMException(
|
|
35674
|
+
} catch (e4) {
|
|
35675
|
+
throw new DOMException(e4, "SyntaxError");
|
|
35676
35676
|
}
|
|
35677
35677
|
this.#url = urlRecord.href;
|
|
35678
35678
|
let corsAttributeState = ANONYMOUS;
|
|
@@ -36165,7 +36165,7 @@ var require_re = __commonJS({
|
|
|
36165
36165
|
var safeRe = exports2.safeRe = [];
|
|
36166
36166
|
var src = exports2.src = [];
|
|
36167
36167
|
var safeSrc = exports2.safeSrc = [];
|
|
36168
|
-
var
|
|
36168
|
+
var t3 = exports2.t = {};
|
|
36169
36169
|
var R3 = 0;
|
|
36170
36170
|
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
36171
36171
|
var safeRegexReplacements = [
|
|
@@ -36183,7 +36183,7 @@ var require_re = __commonJS({
|
|
|
36183
36183
|
const safe = makeSafeRegex(value);
|
|
36184
36184
|
const index = R3++;
|
|
36185
36185
|
debug(name, index, value);
|
|
36186
|
-
|
|
36186
|
+
t3[name] = index;
|
|
36187
36187
|
src[index] = value;
|
|
36188
36188
|
safeSrc[index] = safe;
|
|
36189
36189
|
re2[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
@@ -36192,46 +36192,46 @@ var require_re = __commonJS({
|
|
|
36192
36192
|
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
36193
36193
|
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
36194
36194
|
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
36195
|
-
createToken("MAINVERSION", `(${src[
|
|
36196
|
-
createToken("MAINVERSIONLOOSE", `(${src[
|
|
36197
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[
|
|
36198
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[
|
|
36199
|
-
createToken("PRERELEASE", `(?:-(${src[
|
|
36200
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[
|
|
36195
|
+
createToken("MAINVERSION", `(${src[t3.NUMERICIDENTIFIER]})\\.(${src[t3.NUMERICIDENTIFIER]})\\.(${src[t3.NUMERICIDENTIFIER]})`);
|
|
36196
|
+
createToken("MAINVERSIONLOOSE", `(${src[t3.NUMERICIDENTIFIERLOOSE]})\\.(${src[t3.NUMERICIDENTIFIERLOOSE]})\\.(${src[t3.NUMERICIDENTIFIERLOOSE]})`);
|
|
36197
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t3.NONNUMERICIDENTIFIER]}|${src[t3.NUMERICIDENTIFIER]})`);
|
|
36198
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t3.NONNUMERICIDENTIFIER]}|${src[t3.NUMERICIDENTIFIERLOOSE]})`);
|
|
36199
|
+
createToken("PRERELEASE", `(?:-(${src[t3.PRERELEASEIDENTIFIER]}(?:\\.${src[t3.PRERELEASEIDENTIFIER]})*))`);
|
|
36200
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t3.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t3.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
36201
36201
|
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
36202
|
-
createToken("BUILD", `(?:\\+(${src[
|
|
36203
|
-
createToken("FULLPLAIN", `v?${src[
|
|
36204
|
-
createToken("FULL", `^${src[
|
|
36205
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[
|
|
36206
|
-
createToken("LOOSE", `^${src[
|
|
36202
|
+
createToken("BUILD", `(?:\\+(${src[t3.BUILDIDENTIFIER]}(?:\\.${src[t3.BUILDIDENTIFIER]})*))`);
|
|
36203
|
+
createToken("FULLPLAIN", `v?${src[t3.MAINVERSION]}${src[t3.PRERELEASE]}?${src[t3.BUILD]}?`);
|
|
36204
|
+
createToken("FULL", `^${src[t3.FULLPLAIN]}$`);
|
|
36205
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t3.MAINVERSIONLOOSE]}${src[t3.PRERELEASELOOSE]}?${src[t3.BUILD]}?`);
|
|
36206
|
+
createToken("LOOSE", `^${src[t3.LOOSEPLAIN]}$`);
|
|
36207
36207
|
createToken("GTLT", "((?:<|>)?=?)");
|
|
36208
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[
|
|
36209
|
-
createToken("XRANGEIDENTIFIER", `${src[
|
|
36210
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[
|
|
36211
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[
|
|
36212
|
-
createToken("XRANGE", `^${src[
|
|
36213
|
-
createToken("XRANGELOOSE", `^${src[
|
|
36208
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t3.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
36209
|
+
createToken("XRANGEIDENTIFIER", `${src[t3.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
36210
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t3.XRANGEIDENTIFIER]})(?:\\.(${src[t3.XRANGEIDENTIFIER]})(?:\\.(${src[t3.XRANGEIDENTIFIER]})(?:${src[t3.PRERELEASE]})?${src[t3.BUILD]}?)?)?`);
|
|
36211
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t3.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t3.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t3.XRANGEIDENTIFIERLOOSE]})(?:${src[t3.PRERELEASELOOSE]})?${src[t3.BUILD]}?)?)?`);
|
|
36212
|
+
createToken("XRANGE", `^${src[t3.GTLT]}\\s*${src[t3.XRANGEPLAIN]}$`);
|
|
36213
|
+
createToken("XRANGELOOSE", `^${src[t3.GTLT]}\\s*${src[t3.XRANGEPLAINLOOSE]}$`);
|
|
36214
36214
|
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
36215
|
-
createToken("COERCE", `${src[
|
|
36216
|
-
createToken("COERCEFULL", src[
|
|
36217
|
-
createToken("COERCERTL", src[
|
|
36218
|
-
createToken("COERCERTLFULL", src[
|
|
36215
|
+
createToken("COERCE", `${src[t3.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
36216
|
+
createToken("COERCEFULL", src[t3.COERCEPLAIN] + `(?:${src[t3.PRERELEASE]})?(?:${src[t3.BUILD]})?(?:$|[^\\d])`);
|
|
36217
|
+
createToken("COERCERTL", src[t3.COERCE], true);
|
|
36218
|
+
createToken("COERCERTLFULL", src[t3.COERCEFULL], true);
|
|
36219
36219
|
createToken("LONETILDE", "(?:~>?)");
|
|
36220
|
-
createToken("TILDETRIM", `(\\s*)${src[
|
|
36220
|
+
createToken("TILDETRIM", `(\\s*)${src[t3.LONETILDE]}\\s+`, true);
|
|
36221
36221
|
exports2.tildeTrimReplace = "$1~";
|
|
36222
|
-
createToken("TILDE", `^${src[
|
|
36223
|
-
createToken("TILDELOOSE", `^${src[
|
|
36222
|
+
createToken("TILDE", `^${src[t3.LONETILDE]}${src[t3.XRANGEPLAIN]}$`);
|
|
36223
|
+
createToken("TILDELOOSE", `^${src[t3.LONETILDE]}${src[t3.XRANGEPLAINLOOSE]}$`);
|
|
36224
36224
|
createToken("LONECARET", "(?:\\^)");
|
|
36225
|
-
createToken("CARETTRIM", `(\\s*)${src[
|
|
36225
|
+
createToken("CARETTRIM", `(\\s*)${src[t3.LONECARET]}\\s+`, true);
|
|
36226
36226
|
exports2.caretTrimReplace = "$1^";
|
|
36227
|
-
createToken("CARET", `^${src[
|
|
36228
|
-
createToken("CARETLOOSE", `^${src[
|
|
36229
|
-
createToken("COMPARATORLOOSE", `^${src[
|
|
36230
|
-
createToken("COMPARATOR", `^${src[
|
|
36231
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[
|
|
36227
|
+
createToken("CARET", `^${src[t3.LONECARET]}${src[t3.XRANGEPLAIN]}$`);
|
|
36228
|
+
createToken("CARETLOOSE", `^${src[t3.LONECARET]}${src[t3.XRANGEPLAINLOOSE]}$`);
|
|
36229
|
+
createToken("COMPARATORLOOSE", `^${src[t3.GTLT]}\\s*(${src[t3.LOOSEPLAIN]})$|^$`);
|
|
36230
|
+
createToken("COMPARATOR", `^${src[t3.GTLT]}\\s*(${src[t3.FULLPLAIN]})$|^$`);
|
|
36231
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t3.GTLT]}\\s*(${src[t3.LOOSEPLAIN]}|${src[t3.XRANGEPLAIN]})`, true);
|
|
36232
36232
|
exports2.comparatorTrimReplace = "$1$2$3";
|
|
36233
|
-
createToken("HYPHENRANGE", `^\\s*(${src[
|
|
36234
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[
|
|
36233
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t3.XRANGEPLAIN]})\\s+-\\s+(${src[t3.XRANGEPLAIN]})\\s*$`);
|
|
36234
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t3.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t3.XRANGEPLAINLOOSE]})\\s*$`);
|
|
36235
36235
|
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
36236
36236
|
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
36237
36237
|
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
@@ -36262,19 +36262,19 @@ var require_identifiers = __commonJS({
|
|
|
36262
36262
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js"(exports2, module2) {
|
|
36263
36263
|
"use strict";
|
|
36264
36264
|
var numeric = /^[0-9]+$/;
|
|
36265
|
-
var compareIdentifiers = (
|
|
36266
|
-
if (typeof
|
|
36267
|
-
return
|
|
36265
|
+
var compareIdentifiers = (a3, b5) => {
|
|
36266
|
+
if (typeof a3 === "number" && typeof b5 === "number") {
|
|
36267
|
+
return a3 === b5 ? 0 : a3 < b5 ? -1 : 1;
|
|
36268
36268
|
}
|
|
36269
|
-
const anum = numeric.test(
|
|
36270
|
-
const bnum = numeric.test(
|
|
36269
|
+
const anum = numeric.test(a3);
|
|
36270
|
+
const bnum = numeric.test(b5);
|
|
36271
36271
|
if (anum && bnum) {
|
|
36272
|
-
|
|
36273
|
-
|
|
36272
|
+
a3 = +a3;
|
|
36273
|
+
b5 = +b5;
|
|
36274
36274
|
}
|
|
36275
|
-
return
|
|
36275
|
+
return a3 === b5 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a3 < b5 ? -1 : 1;
|
|
36276
36276
|
};
|
|
36277
|
-
var rcompareIdentifiers = (
|
|
36277
|
+
var rcompareIdentifiers = (a3, b5) => compareIdentifiers(b5, a3);
|
|
36278
36278
|
module2.exports = {
|
|
36279
36279
|
compareIdentifiers,
|
|
36280
36280
|
rcompareIdentifiers
|
|
@@ -36288,7 +36288,7 @@ var require_semver = __commonJS({
|
|
|
36288
36288
|
"use strict";
|
|
36289
36289
|
var debug = require_debug();
|
|
36290
36290
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants6();
|
|
36291
|
-
var { safeRe: re2, t:
|
|
36291
|
+
var { safeRe: re2, t: t3 } = require_re();
|
|
36292
36292
|
var parseOptions = require_parse_options();
|
|
36293
36293
|
var { compareIdentifiers } = require_identifiers();
|
|
36294
36294
|
var SemVer = class _SemVer {
|
|
@@ -36312,7 +36312,7 @@ var require_semver = __commonJS({
|
|
|
36312
36312
|
this.options = options;
|
|
36313
36313
|
this.loose = !!options.loose;
|
|
36314
36314
|
this.includePrerelease = !!options.includePrerelease;
|
|
36315
|
-
const m = version2.trim().match(options.loose ? re2[
|
|
36315
|
+
const m = version2.trim().match(options.loose ? re2[t3.LOOSE] : re2[t3.FULL]);
|
|
36316
36316
|
if (!m) {
|
|
36317
36317
|
throw new TypeError(`Invalid Version: ${version2}`);
|
|
36318
36318
|
}
|
|
@@ -36405,19 +36405,19 @@ var require_semver = __commonJS({
|
|
|
36405
36405
|
}
|
|
36406
36406
|
let i2 = 0;
|
|
36407
36407
|
do {
|
|
36408
|
-
const
|
|
36409
|
-
const
|
|
36410
|
-
debug("prerelease compare", i2,
|
|
36411
|
-
if (
|
|
36408
|
+
const a3 = this.prerelease[i2];
|
|
36409
|
+
const b5 = other.prerelease[i2];
|
|
36410
|
+
debug("prerelease compare", i2, a3, b5);
|
|
36411
|
+
if (a3 === void 0 && b5 === void 0) {
|
|
36412
36412
|
return 0;
|
|
36413
|
-
} else if (
|
|
36413
|
+
} else if (b5 === void 0) {
|
|
36414
36414
|
return 1;
|
|
36415
|
-
} else if (
|
|
36415
|
+
} else if (a3 === void 0) {
|
|
36416
36416
|
return -1;
|
|
36417
|
-
} else if (
|
|
36417
|
+
} else if (a3 === b5) {
|
|
36418
36418
|
continue;
|
|
36419
36419
|
} else {
|
|
36420
|
-
return compareIdentifiers(
|
|
36420
|
+
return compareIdentifiers(a3, b5);
|
|
36421
36421
|
}
|
|
36422
36422
|
} while (++i2);
|
|
36423
36423
|
}
|
|
@@ -36427,19 +36427,19 @@ var require_semver = __commonJS({
|
|
|
36427
36427
|
}
|
|
36428
36428
|
let i2 = 0;
|
|
36429
36429
|
do {
|
|
36430
|
-
const
|
|
36431
|
-
const
|
|
36432
|
-
debug("build compare", i2,
|
|
36433
|
-
if (
|
|
36430
|
+
const a3 = this.build[i2];
|
|
36431
|
+
const b5 = other.build[i2];
|
|
36432
|
+
debug("build compare", i2, a3, b5);
|
|
36433
|
+
if (a3 === void 0 && b5 === void 0) {
|
|
36434
36434
|
return 0;
|
|
36435
|
-
} else if (
|
|
36435
|
+
} else if (b5 === void 0) {
|
|
36436
36436
|
return 1;
|
|
36437
|
-
} else if (
|
|
36437
|
+
} else if (a3 === void 0) {
|
|
36438
36438
|
return -1;
|
|
36439
|
-
} else if (
|
|
36439
|
+
} else if (a3 === b5) {
|
|
36440
36440
|
continue;
|
|
36441
36441
|
} else {
|
|
36442
|
-
return compareIdentifiers(
|
|
36442
|
+
return compareIdentifiers(a3, b5);
|
|
36443
36443
|
}
|
|
36444
36444
|
} while (++i2);
|
|
36445
36445
|
}
|
|
@@ -36451,7 +36451,7 @@ var require_semver = __commonJS({
|
|
|
36451
36451
|
throw new Error("invalid increment argument: identifier is empty");
|
|
36452
36452
|
}
|
|
36453
36453
|
if (identifier) {
|
|
36454
|
-
const match = `-${identifier}`.match(this.options.loose ? re2[
|
|
36454
|
+
const match = `-${identifier}`.match(this.options.loose ? re2[t3.PRERELEASELOOSE] : re2[t3.PRERELEASE]);
|
|
36455
36455
|
if (!match || match[1] !== identifier) {
|
|
36456
36456
|
throw new Error(`invalid identifier: ${identifier}`);
|
|
36457
36457
|
}
|
|
@@ -36602,8 +36602,8 @@ var require_clean = __commonJS({
|
|
|
36602
36602
|
"use strict";
|
|
36603
36603
|
var parse3 = require_parse2();
|
|
36604
36604
|
var clean = (version2, options) => {
|
|
36605
|
-
const
|
|
36606
|
-
return
|
|
36605
|
+
const s3 = parse3(version2.trim().replace(/^[=v]+/, ""), options);
|
|
36606
|
+
return s3 ? s3.version : null;
|
|
36607
36607
|
};
|
|
36608
36608
|
module2.exports = clean;
|
|
36609
36609
|
}
|
|
@@ -36682,7 +36682,7 @@ var require_major = __commonJS({
|
|
|
36682
36682
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js"(exports2, module2) {
|
|
36683
36683
|
"use strict";
|
|
36684
36684
|
var SemVer = require_semver();
|
|
36685
|
-
var major = (
|
|
36685
|
+
var major = (a3, loose) => new SemVer(a3, loose).major;
|
|
36686
36686
|
module2.exports = major;
|
|
36687
36687
|
}
|
|
36688
36688
|
});
|
|
@@ -36692,7 +36692,7 @@ var require_minor = __commonJS({
|
|
|
36692
36692
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js"(exports2, module2) {
|
|
36693
36693
|
"use strict";
|
|
36694
36694
|
var SemVer = require_semver();
|
|
36695
|
-
var minor = (
|
|
36695
|
+
var minor = (a3, loose) => new SemVer(a3, loose).minor;
|
|
36696
36696
|
module2.exports = minor;
|
|
36697
36697
|
}
|
|
36698
36698
|
});
|
|
@@ -36702,7 +36702,7 @@ var require_patch = __commonJS({
|
|
|
36702
36702
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js"(exports2, module2) {
|
|
36703
36703
|
"use strict";
|
|
36704
36704
|
var SemVer = require_semver();
|
|
36705
|
-
var patch = (
|
|
36705
|
+
var patch = (a3, loose) => new SemVer(a3, loose).patch;
|
|
36706
36706
|
module2.exports = patch;
|
|
36707
36707
|
}
|
|
36708
36708
|
});
|
|
@@ -36725,7 +36725,7 @@ var require_compare = __commonJS({
|
|
|
36725
36725
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js"(exports2, module2) {
|
|
36726
36726
|
"use strict";
|
|
36727
36727
|
var SemVer = require_semver();
|
|
36728
|
-
var compare = (
|
|
36728
|
+
var compare = (a3, b5, loose) => new SemVer(a3, loose).compare(new SemVer(b5, loose));
|
|
36729
36729
|
module2.exports = compare;
|
|
36730
36730
|
}
|
|
36731
36731
|
});
|
|
@@ -36735,7 +36735,7 @@ var require_rcompare = __commonJS({
|
|
|
36735
36735
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js"(exports2, module2) {
|
|
36736
36736
|
"use strict";
|
|
36737
36737
|
var compare = require_compare();
|
|
36738
|
-
var rcompare = (
|
|
36738
|
+
var rcompare = (a3, b5, loose) => compare(b5, a3, loose);
|
|
36739
36739
|
module2.exports = rcompare;
|
|
36740
36740
|
}
|
|
36741
36741
|
});
|
|
@@ -36745,7 +36745,7 @@ var require_compare_loose = __commonJS({
|
|
|
36745
36745
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js"(exports2, module2) {
|
|
36746
36746
|
"use strict";
|
|
36747
36747
|
var compare = require_compare();
|
|
36748
|
-
var compareLoose = (
|
|
36748
|
+
var compareLoose = (a3, b5) => compare(a3, b5, true);
|
|
36749
36749
|
module2.exports = compareLoose;
|
|
36750
36750
|
}
|
|
36751
36751
|
});
|
|
@@ -36755,9 +36755,9 @@ var require_compare_build = __commonJS({
|
|
|
36755
36755
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js"(exports2, module2) {
|
|
36756
36756
|
"use strict";
|
|
36757
36757
|
var SemVer = require_semver();
|
|
36758
|
-
var compareBuild = (
|
|
36759
|
-
const versionA = new SemVer(
|
|
36760
|
-
const versionB = new SemVer(
|
|
36758
|
+
var compareBuild = (a3, b5, loose) => {
|
|
36759
|
+
const versionA = new SemVer(a3, loose);
|
|
36760
|
+
const versionB = new SemVer(b5, loose);
|
|
36761
36761
|
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
36762
36762
|
};
|
|
36763
36763
|
module2.exports = compareBuild;
|
|
@@ -36769,7 +36769,7 @@ var require_sort = __commonJS({
|
|
|
36769
36769
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js"(exports2, module2) {
|
|
36770
36770
|
"use strict";
|
|
36771
36771
|
var compareBuild = require_compare_build();
|
|
36772
|
-
var sort = (list, loose) => list.sort((
|
|
36772
|
+
var sort = (list, loose) => list.sort((a3, b5) => compareBuild(a3, b5, loose));
|
|
36773
36773
|
module2.exports = sort;
|
|
36774
36774
|
}
|
|
36775
36775
|
});
|
|
@@ -36779,7 +36779,7 @@ var require_rsort = __commonJS({
|
|
|
36779
36779
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js"(exports2, module2) {
|
|
36780
36780
|
"use strict";
|
|
36781
36781
|
var compareBuild = require_compare_build();
|
|
36782
|
-
var rsort = (list, loose) => list.sort((
|
|
36782
|
+
var rsort = (list, loose) => list.sort((a3, b5) => compareBuild(b5, a3, loose));
|
|
36783
36783
|
module2.exports = rsort;
|
|
36784
36784
|
}
|
|
36785
36785
|
});
|
|
@@ -36789,8 +36789,8 @@ var require_gt = __commonJS({
|
|
|
36789
36789
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js"(exports2, module2) {
|
|
36790
36790
|
"use strict";
|
|
36791
36791
|
var compare = require_compare();
|
|
36792
|
-
var
|
|
36793
|
-
module2.exports =
|
|
36792
|
+
var gt2 = (a3, b5, loose) => compare(a3, b5, loose) > 0;
|
|
36793
|
+
module2.exports = gt2;
|
|
36794
36794
|
}
|
|
36795
36795
|
});
|
|
36796
36796
|
|
|
@@ -36799,7 +36799,7 @@ var require_lt = __commonJS({
|
|
|
36799
36799
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js"(exports2, module2) {
|
|
36800
36800
|
"use strict";
|
|
36801
36801
|
var compare = require_compare();
|
|
36802
|
-
var lt2 = (
|
|
36802
|
+
var lt2 = (a3, b5, loose) => compare(a3, b5, loose) < 0;
|
|
36803
36803
|
module2.exports = lt2;
|
|
36804
36804
|
}
|
|
36805
36805
|
});
|
|
@@ -36809,7 +36809,7 @@ var require_eq = __commonJS({
|
|
|
36809
36809
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js"(exports2, module2) {
|
|
36810
36810
|
"use strict";
|
|
36811
36811
|
var compare = require_compare();
|
|
36812
|
-
var eq = (
|
|
36812
|
+
var eq = (a3, b5, loose) => compare(a3, b5, loose) === 0;
|
|
36813
36813
|
module2.exports = eq;
|
|
36814
36814
|
}
|
|
36815
36815
|
});
|
|
@@ -36819,7 +36819,7 @@ var require_neq = __commonJS({
|
|
|
36819
36819
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js"(exports2, module2) {
|
|
36820
36820
|
"use strict";
|
|
36821
36821
|
var compare = require_compare();
|
|
36822
|
-
var neq = (
|
|
36822
|
+
var neq = (a3, b5, loose) => compare(a3, b5, loose) !== 0;
|
|
36823
36823
|
module2.exports = neq;
|
|
36824
36824
|
}
|
|
36825
36825
|
});
|
|
@@ -36829,7 +36829,7 @@ var require_gte = __commonJS({
|
|
|
36829
36829
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js"(exports2, module2) {
|
|
36830
36830
|
"use strict";
|
|
36831
36831
|
var compare = require_compare();
|
|
36832
|
-
var gte = (
|
|
36832
|
+
var gte = (a3, b5, loose) => compare(a3, b5, loose) >= 0;
|
|
36833
36833
|
module2.exports = gte;
|
|
36834
36834
|
}
|
|
36835
36835
|
});
|
|
@@ -36839,7 +36839,7 @@ var require_lte = __commonJS({
|
|
|
36839
36839
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js"(exports2, module2) {
|
|
36840
36840
|
"use strict";
|
|
36841
36841
|
var compare = require_compare();
|
|
36842
|
-
var lte = (
|
|
36842
|
+
var lte = (a3, b5, loose) => compare(a3, b5, loose) <= 0;
|
|
36843
36843
|
module2.exports = lte;
|
|
36844
36844
|
}
|
|
36845
36845
|
});
|
|
@@ -36850,42 +36850,42 @@ var require_cmp = __commonJS({
|
|
|
36850
36850
|
"use strict";
|
|
36851
36851
|
var eq = require_eq();
|
|
36852
36852
|
var neq = require_neq();
|
|
36853
|
-
var
|
|
36853
|
+
var gt2 = require_gt();
|
|
36854
36854
|
var gte = require_gte();
|
|
36855
36855
|
var lt2 = require_lt();
|
|
36856
36856
|
var lte = require_lte();
|
|
36857
|
-
var cmp = (
|
|
36857
|
+
var cmp = (a3, op, b5, loose) => {
|
|
36858
36858
|
switch (op) {
|
|
36859
36859
|
case "===":
|
|
36860
|
-
if (typeof
|
|
36861
|
-
|
|
36860
|
+
if (typeof a3 === "object") {
|
|
36861
|
+
a3 = a3.version;
|
|
36862
36862
|
}
|
|
36863
|
-
if (typeof
|
|
36864
|
-
|
|
36863
|
+
if (typeof b5 === "object") {
|
|
36864
|
+
b5 = b5.version;
|
|
36865
36865
|
}
|
|
36866
|
-
return
|
|
36866
|
+
return a3 === b5;
|
|
36867
36867
|
case "!==":
|
|
36868
|
-
if (typeof
|
|
36869
|
-
|
|
36868
|
+
if (typeof a3 === "object") {
|
|
36869
|
+
a3 = a3.version;
|
|
36870
36870
|
}
|
|
36871
|
-
if (typeof
|
|
36872
|
-
|
|
36871
|
+
if (typeof b5 === "object") {
|
|
36872
|
+
b5 = b5.version;
|
|
36873
36873
|
}
|
|
36874
|
-
return
|
|
36874
|
+
return a3 !== b5;
|
|
36875
36875
|
case "":
|
|
36876
36876
|
case "=":
|
|
36877
36877
|
case "==":
|
|
36878
|
-
return eq(
|
|
36878
|
+
return eq(a3, b5, loose);
|
|
36879
36879
|
case "!=":
|
|
36880
|
-
return neq(
|
|
36880
|
+
return neq(a3, b5, loose);
|
|
36881
36881
|
case ">":
|
|
36882
|
-
return
|
|
36882
|
+
return gt2(a3, b5, loose);
|
|
36883
36883
|
case ">=":
|
|
36884
|
-
return gte(
|
|
36884
|
+
return gte(a3, b5, loose);
|
|
36885
36885
|
case "<":
|
|
36886
|
-
return lt2(
|
|
36886
|
+
return lt2(a3, b5, loose);
|
|
36887
36887
|
case "<=":
|
|
36888
|
-
return lte(
|
|
36888
|
+
return lte(a3, b5, loose);
|
|
36889
36889
|
default:
|
|
36890
36890
|
throw new TypeError(`Invalid operator: ${op}`);
|
|
36891
36891
|
}
|
|
@@ -36900,7 +36900,7 @@ var require_coerce = __commonJS({
|
|
|
36900
36900
|
"use strict";
|
|
36901
36901
|
var SemVer = require_semver();
|
|
36902
36902
|
var parse3 = require_parse2();
|
|
36903
|
-
var { safeRe: re2, t:
|
|
36903
|
+
var { safeRe: re2, t: t3 } = require_re();
|
|
36904
36904
|
var coerce = (version2, options) => {
|
|
36905
36905
|
if (version2 instanceof SemVer) {
|
|
36906
36906
|
return version2;
|
|
@@ -36914,9 +36914,9 @@ var require_coerce = __commonJS({
|
|
|
36914
36914
|
options = options || {};
|
|
36915
36915
|
let match = null;
|
|
36916
36916
|
if (!options.rtl) {
|
|
36917
|
-
match = version2.match(options.includePrerelease ? re2[
|
|
36917
|
+
match = version2.match(options.includePrerelease ? re2[t3.COERCEFULL] : re2[t3.COERCE]);
|
|
36918
36918
|
} else {
|
|
36919
|
-
const coerceRtlRegex = options.includePrerelease ? re2[
|
|
36919
|
+
const coerceRtlRegex = options.includePrerelease ? re2[t3.COERCERTLFULL] : re2[t3.COERCERTL];
|
|
36920
36920
|
let next;
|
|
36921
36921
|
while ((next = coerceRtlRegex.exec(version2)) && (!match || match.index + match[0].length !== version2.length)) {
|
|
36922
36922
|
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
@@ -37003,7 +37003,7 @@ var require_range = __commonJS({
|
|
|
37003
37003
|
this.loose = !!options.loose;
|
|
37004
37004
|
this.includePrerelease = !!options.includePrerelease;
|
|
37005
37005
|
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
37006
|
-
this.set = this.raw.split("||").map((
|
|
37006
|
+
this.set = this.raw.split("||").map((r3) => this.parseRange(r3.trim())).filter((c2) => c2.length);
|
|
37007
37007
|
if (!this.set.length) {
|
|
37008
37008
|
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
37009
37009
|
}
|
|
@@ -37031,11 +37031,11 @@ var require_range = __commonJS({
|
|
|
37031
37031
|
this.formatted += "||";
|
|
37032
37032
|
}
|
|
37033
37033
|
const comps = this.set[i2];
|
|
37034
|
-
for (let
|
|
37035
|
-
if (
|
|
37034
|
+
for (let k5 = 0; k5 < comps.length; k5++) {
|
|
37035
|
+
if (k5 > 0) {
|
|
37036
37036
|
this.formatted += " ";
|
|
37037
37037
|
}
|
|
37038
|
-
this.formatted += comps[
|
|
37038
|
+
this.formatted += comps[k5].toString().trim();
|
|
37039
37039
|
}
|
|
37040
37040
|
}
|
|
37041
37041
|
}
|
|
@@ -37055,20 +37055,20 @@ var require_range = __commonJS({
|
|
|
37055
37055
|
return cached2;
|
|
37056
37056
|
}
|
|
37057
37057
|
const loose = this.options.loose;
|
|
37058
|
-
const hr = loose ? re2[
|
|
37058
|
+
const hr = loose ? re2[t3.HYPHENRANGELOOSE] : re2[t3.HYPHENRANGE];
|
|
37059
37059
|
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
37060
37060
|
debug("hyphen replace", range);
|
|
37061
|
-
range = range.replace(re2[
|
|
37061
|
+
range = range.replace(re2[t3.COMPARATORTRIM], comparatorTrimReplace);
|
|
37062
37062
|
debug("comparator trim", range);
|
|
37063
|
-
range = range.replace(re2[
|
|
37063
|
+
range = range.replace(re2[t3.TILDETRIM], tildeTrimReplace);
|
|
37064
37064
|
debug("tilde trim", range);
|
|
37065
|
-
range = range.replace(re2[
|
|
37065
|
+
range = range.replace(re2[t3.CARETTRIM], caretTrimReplace);
|
|
37066
37066
|
debug("caret trim", range);
|
|
37067
37067
|
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
37068
37068
|
if (loose) {
|
|
37069
37069
|
rangeList = rangeList.filter((comp) => {
|
|
37070
37070
|
debug("loose invalid filter", comp, this.options);
|
|
37071
|
-
return !!comp.match(re2[
|
|
37071
|
+
return !!comp.match(re2[t3.COMPARATORLOOSE]);
|
|
37072
37072
|
});
|
|
37073
37073
|
}
|
|
37074
37074
|
debug("range list", rangeList);
|
|
@@ -37130,7 +37130,7 @@ var require_range = __commonJS({
|
|
|
37130
37130
|
var SemVer = require_semver();
|
|
37131
37131
|
var {
|
|
37132
37132
|
safeRe: re2,
|
|
37133
|
-
t:
|
|
37133
|
+
t: t3,
|
|
37134
37134
|
comparatorTrimReplace,
|
|
37135
37135
|
tildeTrimReplace,
|
|
37136
37136
|
caretTrimReplace
|
|
@@ -37151,7 +37151,7 @@ var require_range = __commonJS({
|
|
|
37151
37151
|
return result;
|
|
37152
37152
|
};
|
|
37153
37153
|
var parseComparator = (comp, options) => {
|
|
37154
|
-
comp = comp.replace(re2[
|
|
37154
|
+
comp = comp.replace(re2[t3.BUILD], "");
|
|
37155
37155
|
debug("comp", comp, options);
|
|
37156
37156
|
comp = replaceCarets(comp, options);
|
|
37157
37157
|
debug("caret", comp);
|
|
@@ -37168,8 +37168,8 @@ var require_range = __commonJS({
|
|
|
37168
37168
|
return comp.trim().split(/\s+/).map((c2) => replaceTilde(c2, options)).join(" ");
|
|
37169
37169
|
};
|
|
37170
37170
|
var replaceTilde = (comp, options) => {
|
|
37171
|
-
const
|
|
37172
|
-
return comp.replace(
|
|
37171
|
+
const r3 = options.loose ? re2[t3.TILDELOOSE] : re2[t3.TILDE];
|
|
37172
|
+
return comp.replace(r3, (_2, M4, m, p, pr) => {
|
|
37173
37173
|
debug("tilde", comp, _2, M4, m, p, pr);
|
|
37174
37174
|
let ret;
|
|
37175
37175
|
if (isX(M4)) {
|
|
@@ -37193,20 +37193,20 @@ var require_range = __commonJS({
|
|
|
37193
37193
|
};
|
|
37194
37194
|
var replaceCaret = (comp, options) => {
|
|
37195
37195
|
debug("caret", comp, options);
|
|
37196
|
-
const
|
|
37197
|
-
const
|
|
37198
|
-
return comp.replace(
|
|
37196
|
+
const r3 = options.loose ? re2[t3.CARETLOOSE] : re2[t3.CARET];
|
|
37197
|
+
const z6 = options.includePrerelease ? "-0" : "";
|
|
37198
|
+
return comp.replace(r3, (_2, M4, m, p, pr) => {
|
|
37199
37199
|
debug("caret", comp, _2, M4, m, p, pr);
|
|
37200
37200
|
let ret;
|
|
37201
37201
|
if (isX(M4)) {
|
|
37202
37202
|
ret = "";
|
|
37203
37203
|
} else if (isX(m)) {
|
|
37204
|
-
ret = `>=${M4}.0.0${
|
|
37204
|
+
ret = `>=${M4}.0.0${z6} <${+M4 + 1}.0.0-0`;
|
|
37205
37205
|
} else if (isX(p)) {
|
|
37206
37206
|
if (M4 === "0") {
|
|
37207
|
-
ret = `>=${M4}.${m}.0${
|
|
37207
|
+
ret = `>=${M4}.${m}.0${z6} <${M4}.${+m + 1}.0-0`;
|
|
37208
37208
|
} else {
|
|
37209
|
-
ret = `>=${M4}.${m}.0${
|
|
37209
|
+
ret = `>=${M4}.${m}.0${z6} <${+M4 + 1}.0.0-0`;
|
|
37210
37210
|
}
|
|
37211
37211
|
} else if (pr) {
|
|
37212
37212
|
debug("replaceCaret pr", pr);
|
|
@@ -37223,9 +37223,9 @@ var require_range = __commonJS({
|
|
|
37223
37223
|
debug("no pr");
|
|
37224
37224
|
if (M4 === "0") {
|
|
37225
37225
|
if (m === "0") {
|
|
37226
|
-
ret = `>=${M4}.${m}.${p}${
|
|
37226
|
+
ret = `>=${M4}.${m}.${p}${z6} <${M4}.${m}.${+p + 1}-0`;
|
|
37227
37227
|
} else {
|
|
37228
|
-
ret = `>=${M4}.${m}.${p}${
|
|
37228
|
+
ret = `>=${M4}.${m}.${p}${z6} <${M4}.${+m + 1}.0-0`;
|
|
37229
37229
|
}
|
|
37230
37230
|
} else {
|
|
37231
37231
|
ret = `>=${M4}.${m}.${p} <${+M4 + 1}.0.0-0`;
|
|
@@ -37241,8 +37241,8 @@ var require_range = __commonJS({
|
|
|
37241
37241
|
};
|
|
37242
37242
|
var replaceXRange = (comp, options) => {
|
|
37243
37243
|
comp = comp.trim();
|
|
37244
|
-
const
|
|
37245
|
-
return comp.replace(
|
|
37244
|
+
const r3 = options.loose ? re2[t3.XRANGELOOSE] : re2[t3.XRANGE];
|
|
37245
|
+
return comp.replace(r3, (ret, gtlt, M4, m, p, pr) => {
|
|
37246
37246
|
debug("xRange", comp, ret, gtlt, M4, m, p, pr);
|
|
37247
37247
|
const xM = isX(M4);
|
|
37248
37248
|
const xm = xM || isX(m);
|
|
@@ -37296,11 +37296,11 @@ var require_range = __commonJS({
|
|
|
37296
37296
|
};
|
|
37297
37297
|
var replaceStars = (comp, options) => {
|
|
37298
37298
|
debug("replaceStars", comp, options);
|
|
37299
|
-
return comp.trim().replace(re2[
|
|
37299
|
+
return comp.trim().replace(re2[t3.STAR], "");
|
|
37300
37300
|
};
|
|
37301
37301
|
var replaceGTE0 = (comp, options) => {
|
|
37302
37302
|
debug("replaceGTE0", comp, options);
|
|
37303
|
-
return comp.trim().replace(re2[options.includePrerelease ?
|
|
37303
|
+
return comp.trim().replace(re2[options.includePrerelease ? t3.GTE0PRE : t3.GTE0], "");
|
|
37304
37304
|
};
|
|
37305
37305
|
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
37306
37306
|
if (isX(fM)) {
|
|
@@ -37386,8 +37386,8 @@ var require_comparator = __commonJS({
|
|
|
37386
37386
|
debug("comp", this);
|
|
37387
37387
|
}
|
|
37388
37388
|
parse(comp) {
|
|
37389
|
-
const
|
|
37390
|
-
const m = comp.match(
|
|
37389
|
+
const r3 = this.options.loose ? re2[t3.COMPARATORLOOSE] : re2[t3.COMPARATOR];
|
|
37390
|
+
const m = comp.match(r3);
|
|
37391
37391
|
if (!m) {
|
|
37392
37392
|
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
37393
37393
|
}
|
|
@@ -37460,7 +37460,7 @@ var require_comparator = __commonJS({
|
|
|
37460
37460
|
};
|
|
37461
37461
|
module2.exports = Comparator;
|
|
37462
37462
|
var parseOptions = require_parse_options();
|
|
37463
|
-
var { safeRe: re2, t:
|
|
37463
|
+
var { safeRe: re2, t: t3 } = require_re();
|
|
37464
37464
|
var cmp = require_cmp();
|
|
37465
37465
|
var debug = require_debug();
|
|
37466
37466
|
var SemVer = require_semver();
|
|
@@ -37559,7 +37559,7 @@ var require_min_version = __commonJS({
|
|
|
37559
37559
|
"use strict";
|
|
37560
37560
|
var SemVer = require_semver();
|
|
37561
37561
|
var Range = require_range();
|
|
37562
|
-
var
|
|
37562
|
+
var gt2 = require_gt();
|
|
37563
37563
|
var minVersion = (range, loose) => {
|
|
37564
37564
|
range = new Range(range, loose);
|
|
37565
37565
|
let minver = new SemVer("0.0.0");
|
|
@@ -37587,7 +37587,7 @@ var require_min_version = __commonJS({
|
|
|
37587
37587
|
/* fallthrough */
|
|
37588
37588
|
case "":
|
|
37589
37589
|
case ">=":
|
|
37590
|
-
if (!setMin ||
|
|
37590
|
+
if (!setMin || gt2(compver, setMin)) {
|
|
37591
37591
|
setMin = compver;
|
|
37592
37592
|
}
|
|
37593
37593
|
break;
|
|
@@ -37599,7 +37599,7 @@ var require_min_version = __commonJS({
|
|
|
37599
37599
|
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
37600
37600
|
}
|
|
37601
37601
|
});
|
|
37602
|
-
if (setMin && (!minver ||
|
|
37602
|
+
if (setMin && (!minver || gt2(minver, setMin))) {
|
|
37603
37603
|
minver = setMin;
|
|
37604
37604
|
}
|
|
37605
37605
|
}
|
|
@@ -37637,7 +37637,7 @@ var require_outside = __commonJS({
|
|
|
37637
37637
|
var { ANY } = Comparator;
|
|
37638
37638
|
var Range = require_range();
|
|
37639
37639
|
var satisfies = require_satisfies();
|
|
37640
|
-
var
|
|
37640
|
+
var gt2 = require_gt();
|
|
37641
37641
|
var lt2 = require_lt();
|
|
37642
37642
|
var lte = require_lte();
|
|
37643
37643
|
var gte = require_gte();
|
|
@@ -37647,7 +37647,7 @@ var require_outside = __commonJS({
|
|
|
37647
37647
|
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
37648
37648
|
switch (hilo) {
|
|
37649
37649
|
case ">":
|
|
37650
|
-
gtfn =
|
|
37650
|
+
gtfn = gt2;
|
|
37651
37651
|
ltefn = lte;
|
|
37652
37652
|
ltfn = lt2;
|
|
37653
37653
|
comp = ">";
|
|
@@ -37656,7 +37656,7 @@ var require_outside = __commonJS({
|
|
|
37656
37656
|
case "<":
|
|
37657
37657
|
gtfn = lt2;
|
|
37658
37658
|
ltefn = gte;
|
|
37659
|
-
ltfn =
|
|
37659
|
+
ltfn = gt2;
|
|
37660
37660
|
comp = "<";
|
|
37661
37661
|
ecomp = "<=";
|
|
37662
37662
|
break;
|
|
@@ -37741,7 +37741,7 @@ var require_simplify = __commonJS({
|
|
|
37741
37741
|
const set2 = [];
|
|
37742
37742
|
let first = null;
|
|
37743
37743
|
let prev = null;
|
|
37744
|
-
const v2 = versions.sort((
|
|
37744
|
+
const v2 = versions.sort((a3, b5) => compare(a3, b5, options));
|
|
37745
37745
|
for (const version2 of v2) {
|
|
37746
37746
|
const included = satisfies(version2, range, options);
|
|
37747
37747
|
if (included) {
|
|
@@ -37834,10 +37834,10 @@ var require_subset = __commonJS({
|
|
|
37834
37834
|
}
|
|
37835
37835
|
}
|
|
37836
37836
|
const eqSet = /* @__PURE__ */ new Set();
|
|
37837
|
-
let
|
|
37837
|
+
let gt2, lt2;
|
|
37838
37838
|
for (const c2 of sub) {
|
|
37839
37839
|
if (c2.operator === ">" || c2.operator === ">=") {
|
|
37840
|
-
|
|
37840
|
+
gt2 = higherGT(gt2, c2, options);
|
|
37841
37841
|
} else if (c2.operator === "<" || c2.operator === "<=") {
|
|
37842
37842
|
lt2 = lowerLT(lt2, c2, options);
|
|
37843
37843
|
} else {
|
|
@@ -37848,16 +37848,16 @@ var require_subset = __commonJS({
|
|
|
37848
37848
|
return null;
|
|
37849
37849
|
}
|
|
37850
37850
|
let gtltComp;
|
|
37851
|
-
if (
|
|
37852
|
-
gtltComp = compare(
|
|
37851
|
+
if (gt2 && lt2) {
|
|
37852
|
+
gtltComp = compare(gt2.semver, lt2.semver, options);
|
|
37853
37853
|
if (gtltComp > 0) {
|
|
37854
37854
|
return null;
|
|
37855
|
-
} else if (gtltComp === 0 && (
|
|
37855
|
+
} else if (gtltComp === 0 && (gt2.operator !== ">=" || lt2.operator !== "<=")) {
|
|
37856
37856
|
return null;
|
|
37857
37857
|
}
|
|
37858
37858
|
}
|
|
37859
37859
|
for (const eq of eqSet) {
|
|
37860
|
-
if (
|
|
37860
|
+
if (gt2 && !satisfies(eq, String(gt2), options)) {
|
|
37861
37861
|
return null;
|
|
37862
37862
|
}
|
|
37863
37863
|
if (lt2 && !satisfies(eq, String(lt2), options)) {
|
|
@@ -37873,25 +37873,25 @@ var require_subset = __commonJS({
|
|
|
37873
37873
|
let higher, lower;
|
|
37874
37874
|
let hasDomLT, hasDomGT;
|
|
37875
37875
|
let needDomLTPre = lt2 && !options.includePrerelease && lt2.semver.prerelease.length ? lt2.semver : false;
|
|
37876
|
-
let needDomGTPre =
|
|
37876
|
+
let needDomGTPre = gt2 && !options.includePrerelease && gt2.semver.prerelease.length ? gt2.semver : false;
|
|
37877
37877
|
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt2.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
37878
37878
|
needDomLTPre = false;
|
|
37879
37879
|
}
|
|
37880
37880
|
for (const c2 of dom) {
|
|
37881
37881
|
hasDomGT = hasDomGT || c2.operator === ">" || c2.operator === ">=";
|
|
37882
37882
|
hasDomLT = hasDomLT || c2.operator === "<" || c2.operator === "<=";
|
|
37883
|
-
if (
|
|
37883
|
+
if (gt2) {
|
|
37884
37884
|
if (needDomGTPre) {
|
|
37885
37885
|
if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomGTPre.major && c2.semver.minor === needDomGTPre.minor && c2.semver.patch === needDomGTPre.patch) {
|
|
37886
37886
|
needDomGTPre = false;
|
|
37887
37887
|
}
|
|
37888
37888
|
}
|
|
37889
37889
|
if (c2.operator === ">" || c2.operator === ">=") {
|
|
37890
|
-
higher = higherGT(
|
|
37891
|
-
if (higher === c2 && higher !==
|
|
37890
|
+
higher = higherGT(gt2, c2, options);
|
|
37891
|
+
if (higher === c2 && higher !== gt2) {
|
|
37892
37892
|
return false;
|
|
37893
37893
|
}
|
|
37894
|
-
} else if (
|
|
37894
|
+
} else if (gt2.operator === ">=" && !satisfies(gt2.semver, String(c2), options)) {
|
|
37895
37895
|
return false;
|
|
37896
37896
|
}
|
|
37897
37897
|
}
|
|
@@ -37910,14 +37910,14 @@ var require_subset = __commonJS({
|
|
|
37910
37910
|
return false;
|
|
37911
37911
|
}
|
|
37912
37912
|
}
|
|
37913
|
-
if (!c2.operator && (lt2 ||
|
|
37913
|
+
if (!c2.operator && (lt2 || gt2) && gtltComp !== 0) {
|
|
37914
37914
|
return false;
|
|
37915
37915
|
}
|
|
37916
37916
|
}
|
|
37917
|
-
if (
|
|
37917
|
+
if (gt2 && hasDomLT && !lt2 && gtltComp !== 0) {
|
|
37918
37918
|
return false;
|
|
37919
37919
|
}
|
|
37920
|
-
if (lt2 && hasDomGT && !
|
|
37920
|
+
if (lt2 && hasDomGT && !gt2 && gtltComp !== 0) {
|
|
37921
37921
|
return false;
|
|
37922
37922
|
}
|
|
37923
37923
|
if (needDomGTPre || needDomLTPre) {
|
|
@@ -37925,19 +37925,19 @@ var require_subset = __commonJS({
|
|
|
37925
37925
|
}
|
|
37926
37926
|
return true;
|
|
37927
37927
|
};
|
|
37928
|
-
var higherGT = (
|
|
37929
|
-
if (!
|
|
37930
|
-
return
|
|
37928
|
+
var higherGT = (a3, b5, options) => {
|
|
37929
|
+
if (!a3) {
|
|
37930
|
+
return b5;
|
|
37931
37931
|
}
|
|
37932
|
-
const comp = compare(
|
|
37933
|
-
return comp > 0 ?
|
|
37932
|
+
const comp = compare(a3.semver, b5.semver, options);
|
|
37933
|
+
return comp > 0 ? a3 : comp < 0 ? b5 : b5.operator === ">" && a3.operator === ">=" ? b5 : a3;
|
|
37934
37934
|
};
|
|
37935
|
-
var lowerLT = (
|
|
37936
|
-
if (!
|
|
37937
|
-
return
|
|
37935
|
+
var lowerLT = (a3, b5, options) => {
|
|
37936
|
+
if (!a3) {
|
|
37937
|
+
return b5;
|
|
37938
37938
|
}
|
|
37939
|
-
const comp = compare(
|
|
37940
|
-
return comp < 0 ?
|
|
37939
|
+
const comp = compare(a3.semver, b5.semver, options);
|
|
37940
|
+
return comp < 0 ? a3 : comp > 0 ? b5 : b5.operator === "<" && a3.operator === "<=" ? b5 : a3;
|
|
37941
37941
|
};
|
|
37942
37942
|
module2.exports = subset;
|
|
37943
37943
|
}
|
|
@@ -37966,7 +37966,7 @@ var require_semver2 = __commonJS({
|
|
|
37966
37966
|
var compareBuild = require_compare_build();
|
|
37967
37967
|
var sort = require_sort();
|
|
37968
37968
|
var rsort = require_rsort();
|
|
37969
|
-
var
|
|
37969
|
+
var gt2 = require_gt();
|
|
37970
37970
|
var lt2 = require_lt();
|
|
37971
37971
|
var eq = require_eq();
|
|
37972
37972
|
var neq = require_neq();
|
|
@@ -38004,7 +38004,7 @@ var require_semver2 = __commonJS({
|
|
|
38004
38004
|
compareBuild,
|
|
38005
38005
|
sort,
|
|
38006
38006
|
rsort,
|
|
38007
|
-
gt:
|
|
38007
|
+
gt: gt2,
|
|
38008
38008
|
lt: lt2,
|
|
38009
38009
|
eq,
|
|
38010
38010
|
neq,
|
|
@@ -38589,9 +38589,9 @@ function $constructor(name, initializer3, params) {
|
|
|
38589
38589
|
const proto = _2.prototype;
|
|
38590
38590
|
const keys = Object.keys(proto);
|
|
38591
38591
|
for (let i2 = 0; i2 < keys.length; i2++) {
|
|
38592
|
-
const
|
|
38593
|
-
if (!(
|
|
38594
|
-
inst[
|
|
38592
|
+
const k5 = keys[i2];
|
|
38593
|
+
if (!(k5 in inst)) {
|
|
38594
|
+
inst[k5] = proto[k5].bind(inst);
|
|
38595
38595
|
}
|
|
38596
38596
|
}
|
|
38597
38597
|
}
|
|
@@ -38720,7 +38720,7 @@ function assert(_2) {
|
|
|
38720
38720
|
}
|
|
38721
38721
|
function getEnumValues(entries) {
|
|
38722
38722
|
const numericValues = Object.values(entries).filter((v2) => typeof v2 === "number");
|
|
38723
|
-
const values = Object.entries(entries).filter(([
|
|
38723
|
+
const values = Object.entries(entries).filter(([k5, _2]) => numericValues.indexOf(+k5) === -1).map(([_2, v2]) => v2);
|
|
38724
38724
|
return values;
|
|
38725
38725
|
}
|
|
38726
38726
|
function joinValues(array2, separator = "|") {
|
|
@@ -38859,10 +38859,10 @@ var allowsEval = cached(() => {
|
|
|
38859
38859
|
return false;
|
|
38860
38860
|
}
|
|
38861
38861
|
});
|
|
38862
|
-
function isPlainObject(
|
|
38863
|
-
if (isObject(
|
|
38862
|
+
function isPlainObject(o3) {
|
|
38863
|
+
if (isObject(o3) === false)
|
|
38864
38864
|
return false;
|
|
38865
|
-
const ctor =
|
|
38865
|
+
const ctor = o3.constructor;
|
|
38866
38866
|
if (ctor === void 0)
|
|
38867
38867
|
return true;
|
|
38868
38868
|
if (typeof ctor !== "function")
|
|
@@ -38875,12 +38875,12 @@ function isPlainObject(o4) {
|
|
|
38875
38875
|
}
|
|
38876
38876
|
return true;
|
|
38877
38877
|
}
|
|
38878
|
-
function shallowClone(
|
|
38879
|
-
if (isPlainObject(
|
|
38880
|
-
return { ...
|
|
38881
|
-
if (Array.isArray(
|
|
38882
|
-
return [...
|
|
38883
|
-
return
|
|
38878
|
+
function shallowClone(o3) {
|
|
38879
|
+
if (isPlainObject(o3))
|
|
38880
|
+
return { ...o3 };
|
|
38881
|
+
if (Array.isArray(o3))
|
|
38882
|
+
return [...o3];
|
|
38883
|
+
return o3;
|
|
38884
38884
|
}
|
|
38885
38885
|
function numKeys(data) {
|
|
38886
38886
|
let keyCount = 0;
|
|
@@ -38892,8 +38892,8 @@ function numKeys(data) {
|
|
|
38892
38892
|
return keyCount;
|
|
38893
38893
|
}
|
|
38894
38894
|
var getParsedType = (data) => {
|
|
38895
|
-
const
|
|
38896
|
-
switch (
|
|
38895
|
+
const t3 = typeof data;
|
|
38896
|
+
switch (t3) {
|
|
38897
38897
|
case "undefined":
|
|
38898
38898
|
return "undefined";
|
|
38899
38899
|
case "string":
|
|
@@ -38932,7 +38932,7 @@ var getParsedType = (data) => {
|
|
|
38932
38932
|
}
|
|
38933
38933
|
return "object";
|
|
38934
38934
|
default:
|
|
38935
|
-
throw new Error(`Unknown data type: ${
|
|
38935
|
+
throw new Error(`Unknown data type: ${t3}`);
|
|
38936
38936
|
}
|
|
38937
38937
|
};
|
|
38938
38938
|
var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
@@ -39003,8 +39003,8 @@ function stringifyPrimitive(value) {
|
|
|
39003
39003
|
return `${value}`;
|
|
39004
39004
|
}
|
|
39005
39005
|
function optionalKeys(shape) {
|
|
39006
|
-
return Object.keys(shape).filter((
|
|
39007
|
-
return shape[
|
|
39006
|
+
return Object.keys(shape).filter((k5) => {
|
|
39007
|
+
return shape[k5]._zod.optin === "optional" && shape[k5]._zod.optout === "optional";
|
|
39008
39008
|
});
|
|
39009
39009
|
}
|
|
39010
39010
|
var NUMBER_FORMAT_RANGES = {
|
|
@@ -39104,20 +39104,20 @@ function safeExtend(schema, shape) {
|
|
|
39104
39104
|
});
|
|
39105
39105
|
return clone(schema, def);
|
|
39106
39106
|
}
|
|
39107
|
-
function merge(
|
|
39108
|
-
const def = mergeDefs(
|
|
39107
|
+
function merge(a3, b5) {
|
|
39108
|
+
const def = mergeDefs(a3._zod.def, {
|
|
39109
39109
|
get shape() {
|
|
39110
|
-
const _shape = { ...
|
|
39110
|
+
const _shape = { ...a3._zod.def.shape, ...b5._zod.def.shape };
|
|
39111
39111
|
assignProp(this, "shape", _shape);
|
|
39112
39112
|
return _shape;
|
|
39113
39113
|
},
|
|
39114
39114
|
get catchall() {
|
|
39115
|
-
return
|
|
39115
|
+
return b5._zod.def.catchall;
|
|
39116
39116
|
},
|
|
39117
39117
|
checks: []
|
|
39118
39118
|
// delete existing checks
|
|
39119
39119
|
});
|
|
39120
|
-
return clone(
|
|
39120
|
+
return clone(a3, def);
|
|
39121
39121
|
}
|
|
39122
39122
|
function partial(Class2, schema, mask) {
|
|
39123
39123
|
const currDef = schema._zod.def;
|
|
@@ -39188,11 +39188,11 @@ function required(Class2, schema, mask) {
|
|
|
39188
39188
|
});
|
|
39189
39189
|
return clone(schema, def);
|
|
39190
39190
|
}
|
|
39191
|
-
function aborted(
|
|
39192
|
-
if (
|
|
39191
|
+
function aborted(x5, startIndex = 0) {
|
|
39192
|
+
if (x5.aborted === true)
|
|
39193
39193
|
return true;
|
|
39194
|
-
for (let i2 = startIndex; i2 <
|
|
39195
|
-
if (
|
|
39194
|
+
for (let i2 = startIndex; i2 < x5.issues.length; i2++) {
|
|
39195
|
+
if (x5.issues[i2]?.continue !== true) {
|
|
39196
39196
|
return true;
|
|
39197
39197
|
}
|
|
39198
39198
|
}
|
|
@@ -39239,8 +39239,8 @@ function getLengthableOrigin(input) {
|
|
|
39239
39239
|
return "unknown";
|
|
39240
39240
|
}
|
|
39241
39241
|
function parsedType(data) {
|
|
39242
|
-
const
|
|
39243
|
-
switch (
|
|
39242
|
+
const t3 = typeof data;
|
|
39243
|
+
switch (t3) {
|
|
39244
39244
|
case "number": {
|
|
39245
39245
|
return Number.isNaN(data) ? "nan" : "number";
|
|
39246
39246
|
}
|
|
@@ -39257,7 +39257,7 @@ function parsedType(data) {
|
|
|
39257
39257
|
}
|
|
39258
39258
|
}
|
|
39259
39259
|
}
|
|
39260
|
-
return
|
|
39260
|
+
return t3;
|
|
39261
39261
|
}
|
|
39262
39262
|
function issue(...args) {
|
|
39263
39263
|
const [iss, input, inst] = args;
|
|
@@ -39272,8 +39272,8 @@ function issue(...args) {
|
|
|
39272
39272
|
return { ...iss };
|
|
39273
39273
|
}
|
|
39274
39274
|
function cleanEnum(obj) {
|
|
39275
|
-
return Object.entries(obj).filter(([
|
|
39276
|
-
return Number.isNaN(Number.parseInt(
|
|
39275
|
+
return Object.entries(obj).filter(([k5, _2]) => {
|
|
39276
|
+
return Number.isNaN(Number.parseInt(k5, 10));
|
|
39277
39277
|
}).map((el) => el[1]);
|
|
39278
39278
|
}
|
|
39279
39279
|
function base64ToUint8Array(base643) {
|
|
@@ -39311,7 +39311,7 @@ function hexToUint8Array(hex3) {
|
|
|
39311
39311
|
return bytes;
|
|
39312
39312
|
}
|
|
39313
39313
|
function uint8ArrayToHex(bytes) {
|
|
39314
|
-
return Array.from(bytes).map((
|
|
39314
|
+
return Array.from(bytes).map((b5) => b5.toString(16).padStart(2, "0")).join("");
|
|
39315
39315
|
}
|
|
39316
39316
|
var Class = class {
|
|
39317
39317
|
constructor(..._args) {
|
|
@@ -39445,7 +39445,7 @@ function toDotPath(_path) {
|
|
|
39445
39445
|
}
|
|
39446
39446
|
function prettifyError(error48) {
|
|
39447
39447
|
const lines = [];
|
|
39448
|
-
const issues = [...error48.issues].sort((
|
|
39448
|
+
const issues = [...error48.issues].sort((a3, b5) => (a3.path ?? []).length - (b5.path ?? []).length);
|
|
39449
39449
|
for (const issue2 of issues) {
|
|
39450
39450
|
lines.push(`\u2716 ${issue2.message}`);
|
|
39451
39451
|
if (issue2.path?.length)
|
|
@@ -39462,9 +39462,9 @@ var _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
|
39462
39462
|
throw new $ZodAsyncError();
|
|
39463
39463
|
}
|
|
39464
39464
|
if (result.issues.length) {
|
|
39465
|
-
const
|
|
39466
|
-
captureStackTrace(
|
|
39467
|
-
throw
|
|
39465
|
+
const e4 = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
39466
|
+
captureStackTrace(e4, _params?.callee);
|
|
39467
|
+
throw e4;
|
|
39468
39468
|
}
|
|
39469
39469
|
return result.value;
|
|
39470
39470
|
};
|
|
@@ -39475,9 +39475,9 @@ var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
|
39475
39475
|
if (result instanceof Promise)
|
|
39476
39476
|
result = await result;
|
|
39477
39477
|
if (result.issues.length) {
|
|
39478
|
-
const
|
|
39479
|
-
captureStackTrace(
|
|
39480
|
-
throw
|
|
39478
|
+
const e4 = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
39479
|
+
captureStackTrace(e4, params?.callee);
|
|
39480
|
+
throw e4;
|
|
39481
39481
|
}
|
|
39482
39482
|
return result.value;
|
|
39483
39483
|
};
|
|
@@ -40267,9 +40267,9 @@ var Doc = class {
|
|
|
40267
40267
|
return;
|
|
40268
40268
|
}
|
|
40269
40269
|
const content = arg;
|
|
40270
|
-
const lines = content.split("\n").filter((
|
|
40271
|
-
const minIndent = Math.min(...lines.map((
|
|
40272
|
-
const dedented = lines.map((
|
|
40270
|
+
const lines = content.split("\n").filter((x5) => x5);
|
|
40271
|
+
const minIndent = Math.min(...lines.map((x5) => x5.length - x5.trimStart().length));
|
|
40272
|
+
const dedented = lines.map((x5) => x5.slice(minIndent)).map((x5) => " ".repeat(this.indent * 2) + x5);
|
|
40273
40273
|
for (const line of dedented) {
|
|
40274
40274
|
this.content.push(line);
|
|
40275
40275
|
}
|
|
@@ -40278,7 +40278,7 @@ var Doc = class {
|
|
|
40278
40278
|
const F3 = Function;
|
|
40279
40279
|
const args = this?.args;
|
|
40280
40280
|
const content = this?.content ?? [``];
|
|
40281
|
-
const lines = [...content.map((
|
|
40281
|
+
const lines = [...content.map((x5) => ` ${x5}`)];
|
|
40282
40282
|
return new F3(...args, lines.join("\n"));
|
|
40283
40283
|
}
|
|
40284
40284
|
};
|
|
@@ -40390,10 +40390,10 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
40390
40390
|
defineLazy(inst, "~standard", () => ({
|
|
40391
40391
|
validate: (value) => {
|
|
40392
40392
|
try {
|
|
40393
|
-
const
|
|
40394
|
-
return
|
|
40393
|
+
const r3 = safeParse(inst, value);
|
|
40394
|
+
return r3.success ? { value: r3.data } : { issues: r3.error?.issues };
|
|
40395
40395
|
} catch (_2) {
|
|
40396
|
-
return safeParseAsync(inst, value).then((
|
|
40396
|
+
return safeParseAsync(inst, value).then((r3) => r3.success ? { value: r3.data } : { issues: r3.error?.issues });
|
|
40397
40397
|
}
|
|
40398
40398
|
},
|
|
40399
40399
|
vendor: "zod",
|
|
@@ -40949,9 +40949,9 @@ function handlePropertyResult(result, final, key, input, isOptionalOut) {
|
|
|
40949
40949
|
}
|
|
40950
40950
|
function normalizeDef(def) {
|
|
40951
40951
|
const keys = Object.keys(def.shape);
|
|
40952
|
-
for (const
|
|
40953
|
-
if (!def.shape?.[
|
|
40954
|
-
throw new Error(`Invalid element at key "${
|
|
40952
|
+
for (const k5 of keys) {
|
|
40953
|
+
if (!def.shape?.[k5]?._zod?.traits?.has("$ZodType")) {
|
|
40954
|
+
throw new Error(`Invalid element at key "${k5}": expected a Zod schema`);
|
|
40955
40955
|
}
|
|
40956
40956
|
}
|
|
40957
40957
|
const okeys = optionalKeys(def.shape);
|
|
@@ -40967,20 +40967,20 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
40967
40967
|
const unrecognized = [];
|
|
40968
40968
|
const keySet = def.keySet;
|
|
40969
40969
|
const _catchall = def.catchall._zod;
|
|
40970
|
-
const
|
|
40970
|
+
const t3 = _catchall.def.type;
|
|
40971
40971
|
const isOptionalOut = _catchall.optout === "optional";
|
|
40972
40972
|
for (const key in input) {
|
|
40973
40973
|
if (keySet.has(key))
|
|
40974
40974
|
continue;
|
|
40975
|
-
if (
|
|
40975
|
+
if (t3 === "never") {
|
|
40976
40976
|
unrecognized.push(key);
|
|
40977
40977
|
continue;
|
|
40978
40978
|
}
|
|
40979
|
-
const
|
|
40980
|
-
if (
|
|
40981
|
-
proms.push(
|
|
40979
|
+
const r3 = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
40980
|
+
if (r3 instanceof Promise) {
|
|
40981
|
+
proms.push(r3.then((r4) => handlePropertyResult(r4, payload, key, input, isOptionalOut)));
|
|
40982
40982
|
} else {
|
|
40983
|
-
handlePropertyResult(
|
|
40983
|
+
handlePropertyResult(r3, payload, key, input, isOptionalOut);
|
|
40984
40984
|
}
|
|
40985
40985
|
}
|
|
40986
40986
|
if (unrecognized.length) {
|
|
@@ -41047,11 +41047,11 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
41047
41047
|
for (const key of value.keys) {
|
|
41048
41048
|
const el = shape[key];
|
|
41049
41049
|
const isOptionalOut = el._zod.optout === "optional";
|
|
41050
|
-
const
|
|
41051
|
-
if (
|
|
41052
|
-
proms.push(
|
|
41050
|
+
const r3 = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
41051
|
+
if (r3 instanceof Promise) {
|
|
41052
|
+
proms.push(r3.then((r4) => handlePropertyResult(r4, payload, key, input, isOptionalOut)));
|
|
41053
41053
|
} else {
|
|
41054
|
-
handlePropertyResult(
|
|
41054
|
+
handlePropertyResult(r3, payload, key, input, isOptionalOut);
|
|
41055
41055
|
}
|
|
41056
41056
|
}
|
|
41057
41057
|
if (!catchall) {
|
|
@@ -41068,8 +41068,8 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
41068
41068
|
const doc = new Doc(["shape", "payload", "ctx"]);
|
|
41069
41069
|
const normalized = _normalized.value;
|
|
41070
41070
|
const parseStr = (key) => {
|
|
41071
|
-
const
|
|
41072
|
-
return `shape[${
|
|
41071
|
+
const k5 = esc(key);
|
|
41072
|
+
return `shape[${k5}]._zod.run({ value: input[${k5}], issues: [] }, ctx)`;
|
|
41073
41073
|
};
|
|
41074
41074
|
doc.write(`const input = payload.value;`);
|
|
41075
41075
|
const ids = /* @__PURE__ */ Object.create(null);
|
|
@@ -41080,27 +41080,27 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
41080
41080
|
doc.write(`const newResult = {};`);
|
|
41081
41081
|
for (const key of normalized.keys) {
|
|
41082
41082
|
const id = ids[key];
|
|
41083
|
-
const
|
|
41083
|
+
const k5 = esc(key);
|
|
41084
41084
|
const schema = shape[key];
|
|
41085
41085
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
41086
41086
|
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
41087
41087
|
if (isOptionalOut) {
|
|
41088
41088
|
doc.write(`
|
|
41089
41089
|
if (${id}.issues.length) {
|
|
41090
|
-
if (${
|
|
41090
|
+
if (${k5} in input) {
|
|
41091
41091
|
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
41092
41092
|
...iss,
|
|
41093
|
-
path: iss.path ? [${
|
|
41093
|
+
path: iss.path ? [${k5}, ...iss.path] : [${k5}]
|
|
41094
41094
|
})));
|
|
41095
41095
|
}
|
|
41096
41096
|
}
|
|
41097
41097
|
|
|
41098
41098
|
if (${id}.value === undefined) {
|
|
41099
|
-
if (${
|
|
41100
|
-
newResult[${
|
|
41099
|
+
if (${k5} in input) {
|
|
41100
|
+
newResult[${k5}] = undefined;
|
|
41101
41101
|
}
|
|
41102
41102
|
} else {
|
|
41103
|
-
newResult[${
|
|
41103
|
+
newResult[${k5}] = ${id}.value;
|
|
41104
41104
|
}
|
|
41105
41105
|
|
|
41106
41106
|
`);
|
|
@@ -41109,16 +41109,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
41109
41109
|
if (${id}.issues.length) {
|
|
41110
41110
|
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
41111
41111
|
...iss,
|
|
41112
|
-
path: iss.path ? [${
|
|
41112
|
+
path: iss.path ? [${k5}, ...iss.path] : [${k5}]
|
|
41113
41113
|
})));
|
|
41114
41114
|
}
|
|
41115
41115
|
|
|
41116
41116
|
if (${id}.value === undefined) {
|
|
41117
|
-
if (${
|
|
41118
|
-
newResult[${
|
|
41117
|
+
if (${k5} in input) {
|
|
41118
|
+
newResult[${k5}] = undefined;
|
|
41119
41119
|
}
|
|
41120
41120
|
} else {
|
|
41121
|
-
newResult[${
|
|
41121
|
+
newResult[${k5}] = ${id}.value;
|
|
41122
41122
|
}
|
|
41123
41123
|
|
|
41124
41124
|
`);
|
|
@@ -41166,7 +41166,7 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
41166
41166
|
return final;
|
|
41167
41167
|
}
|
|
41168
41168
|
}
|
|
41169
|
-
const nonaborted = results.filter((
|
|
41169
|
+
const nonaborted = results.filter((r3) => !aborted(r3));
|
|
41170
41170
|
if (nonaborted.length === 1) {
|
|
41171
41171
|
final.value = nonaborted[0].value;
|
|
41172
41172
|
return nonaborted[0];
|
|
@@ -41181,17 +41181,17 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
41181
41181
|
}
|
|
41182
41182
|
var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
41183
41183
|
$ZodType.init(inst, def);
|
|
41184
|
-
defineLazy(inst._zod, "optin", () => def.options.some((
|
|
41185
|
-
defineLazy(inst._zod, "optout", () => def.options.some((
|
|
41184
|
+
defineLazy(inst._zod, "optin", () => def.options.some((o3) => o3._zod.optin === "optional") ? "optional" : void 0);
|
|
41185
|
+
defineLazy(inst._zod, "optout", () => def.options.some((o3) => o3._zod.optout === "optional") ? "optional" : void 0);
|
|
41186
41186
|
defineLazy(inst._zod, "values", () => {
|
|
41187
|
-
if (def.options.every((
|
|
41187
|
+
if (def.options.every((o3) => o3._zod.values)) {
|
|
41188
41188
|
return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
41189
41189
|
}
|
|
41190
41190
|
return void 0;
|
|
41191
41191
|
});
|
|
41192
41192
|
defineLazy(inst._zod, "pattern", () => {
|
|
41193
|
-
if (def.options.every((
|
|
41194
|
-
const patterns = def.options.map((
|
|
41193
|
+
if (def.options.every((o3) => o3._zod.pattern)) {
|
|
41194
|
+
const patterns = def.options.map((o3) => o3._zod.pattern);
|
|
41195
41195
|
return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
|
|
41196
41196
|
}
|
|
41197
41197
|
return void 0;
|
|
@@ -41226,7 +41226,7 @@ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
|
41226
41226
|
};
|
|
41227
41227
|
});
|
|
41228
41228
|
function handleExclusiveUnionResults(results, final, inst, ctx) {
|
|
41229
|
-
const successes = results.filter((
|
|
41229
|
+
const successes = results.filter((r3) => r3.issues.length === 0);
|
|
41230
41230
|
if (successes.length === 1) {
|
|
41231
41231
|
final.value = successes[0].value;
|
|
41232
41232
|
return final;
|
|
@@ -41289,11 +41289,11 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
41289
41289
|
const pv = option._zod.propValues;
|
|
41290
41290
|
if (!pv || Object.keys(pv).length === 0)
|
|
41291
41291
|
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
41292
|
-
for (const [
|
|
41293
|
-
if (!propValues[
|
|
41294
|
-
propValues[
|
|
41292
|
+
for (const [k5, v2] of Object.entries(pv)) {
|
|
41293
|
+
if (!propValues[k5])
|
|
41294
|
+
propValues[k5] = /* @__PURE__ */ new Set();
|
|
41295
41295
|
for (const val of v2) {
|
|
41296
|
-
propValues[
|
|
41296
|
+
propValues[k5].add(val);
|
|
41297
41297
|
}
|
|
41298
41298
|
}
|
|
41299
41299
|
}
|
|
@@ -41302,15 +41302,15 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
41302
41302
|
const disc = cached(() => {
|
|
41303
41303
|
const opts = def.options;
|
|
41304
41304
|
const map2 = /* @__PURE__ */ new Map();
|
|
41305
|
-
for (const
|
|
41306
|
-
const values =
|
|
41305
|
+
for (const o3 of opts) {
|
|
41306
|
+
const values = o3._zod.propValues?.[def.discriminator];
|
|
41307
41307
|
if (!values || values.size === 0)
|
|
41308
|
-
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(
|
|
41308
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o3)}"`);
|
|
41309
41309
|
for (const v2 of values) {
|
|
41310
41310
|
if (map2.has(v2)) {
|
|
41311
41311
|
throw new Error(`Duplicate discriminator value "${String(v2)}"`);
|
|
41312
41312
|
}
|
|
41313
|
-
map2.set(v2,
|
|
41313
|
+
map2.set(v2, o3);
|
|
41314
41314
|
}
|
|
41315
41315
|
}
|
|
41316
41316
|
return map2;
|
|
@@ -41360,19 +41360,19 @@ var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, d
|
|
|
41360
41360
|
return handleIntersectionResults(payload, left, right);
|
|
41361
41361
|
};
|
|
41362
41362
|
});
|
|
41363
|
-
function mergeValues(
|
|
41364
|
-
if (
|
|
41365
|
-
return { valid: true, data:
|
|
41363
|
+
function mergeValues(a3, b5) {
|
|
41364
|
+
if (a3 === b5) {
|
|
41365
|
+
return { valid: true, data: a3 };
|
|
41366
41366
|
}
|
|
41367
|
-
if (
|
|
41368
|
-
return { valid: true, data:
|
|
41367
|
+
if (a3 instanceof Date && b5 instanceof Date && +a3 === +b5) {
|
|
41368
|
+
return { valid: true, data: a3 };
|
|
41369
41369
|
}
|
|
41370
|
-
if (isPlainObject(
|
|
41371
|
-
const bKeys = Object.keys(
|
|
41372
|
-
const sharedKeys = Object.keys(
|
|
41373
|
-
const newObj = { ...
|
|
41370
|
+
if (isPlainObject(a3) && isPlainObject(b5)) {
|
|
41371
|
+
const bKeys = Object.keys(b5);
|
|
41372
|
+
const sharedKeys = Object.keys(a3).filter((key) => bKeys.indexOf(key) !== -1);
|
|
41373
|
+
const newObj = { ...a3, ...b5 };
|
|
41374
41374
|
for (const key of sharedKeys) {
|
|
41375
|
-
const sharedValue = mergeValues(
|
|
41375
|
+
const sharedValue = mergeValues(a3[key], b5[key]);
|
|
41376
41376
|
if (!sharedValue.valid) {
|
|
41377
41377
|
return {
|
|
41378
41378
|
valid: false,
|
|
@@ -41383,14 +41383,14 @@ function mergeValues(a4, b6) {
|
|
|
41383
41383
|
}
|
|
41384
41384
|
return { valid: true, data: newObj };
|
|
41385
41385
|
}
|
|
41386
|
-
if (Array.isArray(
|
|
41387
|
-
if (
|
|
41386
|
+
if (Array.isArray(a3) && Array.isArray(b5)) {
|
|
41387
|
+
if (a3.length !== b5.length) {
|
|
41388
41388
|
return { valid: false, mergeErrorPath: [] };
|
|
41389
41389
|
}
|
|
41390
41390
|
const newArray = [];
|
|
41391
|
-
for (let index = 0; index <
|
|
41392
|
-
const itemA =
|
|
41393
|
-
const itemB =
|
|
41391
|
+
for (let index = 0; index < a3.length; index++) {
|
|
41392
|
+
const itemA = a3[index];
|
|
41393
|
+
const itemB = b5[index];
|
|
41394
41394
|
const sharedValue = mergeValues(itemA, itemB);
|
|
41395
41395
|
if (!sharedValue.valid) {
|
|
41396
41396
|
return {
|
|
@@ -41410,10 +41410,10 @@ function handleIntersectionResults(result, left, right) {
|
|
|
41410
41410
|
for (const iss of left.issues) {
|
|
41411
41411
|
if (iss.code === "unrecognized_keys") {
|
|
41412
41412
|
unrecIssue ?? (unrecIssue = iss);
|
|
41413
|
-
for (const
|
|
41414
|
-
if (!unrecKeys.has(
|
|
41415
|
-
unrecKeys.set(
|
|
41416
|
-
unrecKeys.get(
|
|
41413
|
+
for (const k5 of iss.keys) {
|
|
41414
|
+
if (!unrecKeys.has(k5))
|
|
41415
|
+
unrecKeys.set(k5, {});
|
|
41416
|
+
unrecKeys.get(k5).l = true;
|
|
41417
41417
|
}
|
|
41418
41418
|
} else {
|
|
41419
41419
|
result.issues.push(iss);
|
|
@@ -41421,16 +41421,16 @@ function handleIntersectionResults(result, left, right) {
|
|
|
41421
41421
|
}
|
|
41422
41422
|
for (const iss of right.issues) {
|
|
41423
41423
|
if (iss.code === "unrecognized_keys") {
|
|
41424
|
-
for (const
|
|
41425
|
-
if (!unrecKeys.has(
|
|
41426
|
-
unrecKeys.set(
|
|
41427
|
-
unrecKeys.get(
|
|
41424
|
+
for (const k5 of iss.keys) {
|
|
41425
|
+
if (!unrecKeys.has(k5))
|
|
41426
|
+
unrecKeys.set(k5, {});
|
|
41427
|
+
unrecKeys.get(k5).r = true;
|
|
41428
41428
|
}
|
|
41429
41429
|
} else {
|
|
41430
41430
|
result.issues.push(iss);
|
|
41431
41431
|
}
|
|
41432
41432
|
}
|
|
41433
|
-
const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([
|
|
41433
|
+
const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k5]) => k5);
|
|
41434
41434
|
if (bothKeys.length && unrecIssue) {
|
|
41435
41435
|
result.issues.push({ ...unrecIssue, keys: bothKeys });
|
|
41436
41436
|
}
|
|
@@ -41724,7 +41724,7 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
41724
41724
|
const values = getEnumValues(def.entries);
|
|
41725
41725
|
const valuesSet = new Set(values);
|
|
41726
41726
|
inst._zod.values = valuesSet;
|
|
41727
|
-
inst._zod.pattern = new RegExp(`^(${values.filter((
|
|
41727
|
+
inst._zod.pattern = new RegExp(`^(${values.filter((k5) => propertyKeyTypes.has(typeof k5)).map((o3) => typeof o3 === "string" ? escapeRegex(o3) : o3.toString()).join("|")})$`);
|
|
41728
41728
|
inst._zod.parse = (payload, _ctx) => {
|
|
41729
41729
|
const input = payload.value;
|
|
41730
41730
|
if (valuesSet.has(input)) {
|
|
@@ -41746,7 +41746,7 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
41746
41746
|
}
|
|
41747
41747
|
const values = new Set(def.values);
|
|
41748
41748
|
inst._zod.values = values;
|
|
41749
|
-
inst._zod.pattern = new RegExp(`^(${def.values.map((
|
|
41749
|
+
inst._zod.pattern = new RegExp(`^(${def.values.map((o3) => typeof o3 === "string" ? escapeRegex(o3) : o3 ? escapeRegex(o3.toString()) : String(o3)).join("|")})$`);
|
|
41750
41750
|
inst._zod.parse = (payload, _ctx) => {
|
|
41751
41751
|
const input = payload.value;
|
|
41752
41752
|
if (values.has(input)) {
|
|
@@ -41818,7 +41818,7 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
|
41818
41818
|
if (def.innerType._zod.optin === "optional") {
|
|
41819
41819
|
const result = def.innerType._zod.run(payload, ctx);
|
|
41820
41820
|
if (result instanceof Promise)
|
|
41821
|
-
return result.then((
|
|
41821
|
+
return result.then((r3) => handleOptionalResult(r3, payload.value));
|
|
41822
41822
|
return handleOptionalResult(result, payload.value);
|
|
41823
41823
|
}
|
|
41824
41824
|
if (payload.value === void 0) {
|
|
@@ -41895,7 +41895,7 @@ var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def
|
|
|
41895
41895
|
$ZodType.init(inst, def);
|
|
41896
41896
|
defineLazy(inst._zod, "values", () => {
|
|
41897
41897
|
const v2 = def.innerType._zod.values;
|
|
41898
|
-
return v2 ? new Set([...v2].filter((
|
|
41898
|
+
return v2 ? new Set([...v2].filter((x5) => x5 !== void 0)) : void 0;
|
|
41899
41899
|
});
|
|
41900
41900
|
inst._zod.parse = (payload, ctx) => {
|
|
41901
41901
|
const result = def.innerType._zod.run(payload, ctx);
|
|
@@ -42235,11 +42235,11 @@ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
|
42235
42235
|
};
|
|
42236
42236
|
inst._zod.check = (payload) => {
|
|
42237
42237
|
const input = payload.value;
|
|
42238
|
-
const
|
|
42239
|
-
if (
|
|
42240
|
-
return
|
|
42238
|
+
const r3 = def.fn(input);
|
|
42239
|
+
if (r3 instanceof Promise) {
|
|
42240
|
+
return r3.then((r4) => handleRefineResult(r4, payload, input, inst));
|
|
42241
42241
|
}
|
|
42242
|
-
handleRefineResult(
|
|
42242
|
+
handleRefineResult(r3, payload, input, inst);
|
|
42243
42243
|
return;
|
|
42244
42244
|
};
|
|
42245
42245
|
});
|
|
@@ -44079,17 +44079,17 @@ var error16 = () => {
|
|
|
44079
44079
|
number: { unit: "", shortLabel: "\u05E7\u05D8\u05DF", longLabel: "\u05D2\u05D3\u05D5\u05DC" }
|
|
44080
44080
|
// no unit
|
|
44081
44081
|
};
|
|
44082
|
-
const typeEntry = (
|
|
44083
|
-
const typeLabel = (
|
|
44084
|
-
const
|
|
44085
|
-
if (
|
|
44086
|
-
return
|
|
44087
|
-
return
|
|
44088
|
-
};
|
|
44089
|
-
const withDefinite = (
|
|
44090
|
-
const verbFor = (
|
|
44091
|
-
const
|
|
44092
|
-
const gender =
|
|
44082
|
+
const typeEntry = (t3) => t3 ? TypeNames[t3] : void 0;
|
|
44083
|
+
const typeLabel = (t3) => {
|
|
44084
|
+
const e4 = typeEntry(t3);
|
|
44085
|
+
if (e4)
|
|
44086
|
+
return e4.label;
|
|
44087
|
+
return t3 ?? TypeNames.unknown.label;
|
|
44088
|
+
};
|
|
44089
|
+
const withDefinite = (t3) => `\u05D4${typeLabel(t3)}`;
|
|
44090
|
+
const verbFor = (t3) => {
|
|
44091
|
+
const e4 = typeEntry(t3);
|
|
44092
|
+
const gender = e4?.gender ?? "m";
|
|
44093
44093
|
return gender === "f" ? "\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA" : "\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA";
|
|
44094
44094
|
};
|
|
44095
44095
|
const getSizing = (origin) => {
|
|
@@ -49572,7 +49572,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
49572
49572
|
var unionProcessor = (schema, ctx, json2, params) => {
|
|
49573
49573
|
const def = schema._zod.def;
|
|
49574
49574
|
const isExclusive = def.inclusive === false;
|
|
49575
|
-
const options = def.options.map((
|
|
49575
|
+
const options = def.options.map((x5, i2) => process2(x5, ctx, {
|
|
49576
49576
|
...params,
|
|
49577
49577
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i2]
|
|
49578
49578
|
}));
|
|
@@ -49584,18 +49584,18 @@ var unionProcessor = (schema, ctx, json2, params) => {
|
|
|
49584
49584
|
};
|
|
49585
49585
|
var intersectionProcessor = (schema, ctx, json2, params) => {
|
|
49586
49586
|
const def = schema._zod.def;
|
|
49587
|
-
const
|
|
49587
|
+
const a3 = process2(def.left, ctx, {
|
|
49588
49588
|
...params,
|
|
49589
49589
|
path: [...params.path, "allOf", 0]
|
|
49590
49590
|
});
|
|
49591
|
-
const
|
|
49591
|
+
const b5 = process2(def.right, ctx, {
|
|
49592
49592
|
...params,
|
|
49593
49593
|
path: [...params.path, "allOf", 1]
|
|
49594
49594
|
});
|
|
49595
49595
|
const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
|
|
49596
49596
|
const allOf = [
|
|
49597
|
-
...isSimpleIntersection(
|
|
49598
|
-
...isSimpleIntersection(
|
|
49597
|
+
...isSimpleIntersection(a3) ? a3.allOf : [a3],
|
|
49598
|
+
...isSimpleIntersection(b5) ? b5.allOf : [b5]
|
|
49599
49599
|
];
|
|
49600
49600
|
json2.allOf = allOf;
|
|
49601
49601
|
};
|
|
@@ -49605,7 +49605,7 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
49605
49605
|
json2.type = "array";
|
|
49606
49606
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
49607
49607
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
49608
|
-
const prefixItems = def.items.map((
|
|
49608
|
+
const prefixItems = def.items.map((x5, i2) => process2(x5, ctx, {
|
|
49609
49609
|
...params,
|
|
49610
49610
|
path: [...params.path, prefixPath, i2]
|
|
49611
49611
|
}));
|
|
@@ -50843,11 +50843,11 @@ function record(keyType, valueType, params) {
|
|
|
50843
50843
|
});
|
|
50844
50844
|
}
|
|
50845
50845
|
function partialRecord(keyType, valueType, params) {
|
|
50846
|
-
const
|
|
50847
|
-
|
|
50846
|
+
const k5 = clone(keyType);
|
|
50847
|
+
k5._zod.values = void 0;
|
|
50848
50848
|
return new ZodRecord({
|
|
50849
50849
|
type: "record",
|
|
50850
|
-
keyType:
|
|
50850
|
+
keyType: k5,
|
|
50851
50851
|
valueType,
|
|
50852
50852
|
...util_exports.normalizeParams(params)
|
|
50853
50853
|
});
|
|
@@ -51483,8 +51483,8 @@ function convertBaseSchema(schema, ctx) {
|
|
|
51483
51483
|
}
|
|
51484
51484
|
const type = schema.type;
|
|
51485
51485
|
if (Array.isArray(type)) {
|
|
51486
|
-
const typeSchemas = type.map((
|
|
51487
|
-
const typeSchema = { ...schema, type:
|
|
51486
|
+
const typeSchemas = type.map((t3) => {
|
|
51487
|
+
const typeSchema = { ...schema, type: t3 };
|
|
51488
51488
|
return convertBaseSchema(typeSchema, ctx);
|
|
51489
51489
|
});
|
|
51490
51490
|
if (typeSchemas.length === 0) {
|
|
@@ -51718,12 +51718,12 @@ function convertSchema(schema, ctx) {
|
|
|
51718
51718
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
51719
51719
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
51720
51720
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
51721
|
-
const options = schema.anyOf.map((
|
|
51721
|
+
const options = schema.anyOf.map((s3) => convertSchema(s3, ctx));
|
|
51722
51722
|
const anyOfUnion = z.union(options);
|
|
51723
51723
|
baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
51724
51724
|
}
|
|
51725
51725
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
51726
|
-
const options = schema.oneOf.map((
|
|
51726
|
+
const options = schema.oneOf.map((s3) => convertSchema(s3, ctx));
|
|
51727
51727
|
const oneOfUnion = z.xor(options);
|
|
51728
51728
|
baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
51729
51729
|
}
|
|
@@ -51813,75 +51813,75 @@ function date4(params) {
|
|
|
51813
51813
|
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
51814
51814
|
config(en_default());
|
|
51815
51815
|
|
|
51816
|
-
//
|
|
51816
|
+
// ../shared/dist/event-bus-CABu09lC.js
|
|
51817
51817
|
var e = class {
|
|
51818
51818
|
listeners = {};
|
|
51819
|
-
on(
|
|
51820
|
-
let
|
|
51821
|
-
return
|
|
51819
|
+
on(e4, t3) {
|
|
51820
|
+
let n3 = this.listeners[e4];
|
|
51821
|
+
return n3 || (n3 = /* @__PURE__ */ new Set(), this.listeners[e4] = n3), n3.add(t3), () => this.off(e4, t3);
|
|
51822
51822
|
}
|
|
51823
|
-
off(
|
|
51824
|
-
this.listeners[
|
|
51823
|
+
off(e4, t3) {
|
|
51824
|
+
this.listeners[e4]?.delete(t3);
|
|
51825
51825
|
}
|
|
51826
|
-
emit(
|
|
51827
|
-
let
|
|
51828
|
-
if (
|
|
51826
|
+
emit(e4, ...t3) {
|
|
51827
|
+
let n3 = this.listeners[e4];
|
|
51828
|
+
if (n3) for (let e5 of [...n3]) e5(...t3);
|
|
51829
51829
|
}
|
|
51830
|
-
once(
|
|
51831
|
-
let
|
|
51832
|
-
this.off(
|
|
51830
|
+
once(e4, t3) {
|
|
51831
|
+
let n3 = ((...r3) => {
|
|
51832
|
+
this.off(e4, n3), t3(...r3);
|
|
51833
51833
|
});
|
|
51834
|
-
return this.on(
|
|
51834
|
+
return this.on(e4, n3);
|
|
51835
51835
|
}
|
|
51836
|
-
removeAllListeners(
|
|
51837
|
-
if (
|
|
51838
|
-
else for (let
|
|
51836
|
+
removeAllListeners(e4) {
|
|
51837
|
+
if (e4 !== void 0) delete this.listeners[e4];
|
|
51838
|
+
else for (let e5 of Object.keys(this.listeners)) delete this.listeners[e5];
|
|
51839
51839
|
}
|
|
51840
|
-
listenerCount(
|
|
51841
|
-
return this.listeners[
|
|
51840
|
+
listenerCount(e4) {
|
|
51841
|
+
return this.listeners[e4]?.size ?? 0;
|
|
51842
51842
|
}
|
|
51843
51843
|
};
|
|
51844
51844
|
var t = class extends e {
|
|
51845
|
-
publish(
|
|
51846
|
-
let
|
|
51847
|
-
for (let [
|
|
51848
|
-
let
|
|
51849
|
-
|
|
51845
|
+
publish(e4) {
|
|
51846
|
+
let t3 = (e5, ...t4) => this.emit(e5, ...t4);
|
|
51847
|
+
for (let [n3, r3] of Object.entries(e4)) {
|
|
51848
|
+
let e5 = r3 ?? [];
|
|
51849
|
+
t3(n3, ...e5), t3(`*`, n3, ...e5);
|
|
51850
51850
|
}
|
|
51851
51851
|
}
|
|
51852
|
-
subscribe(
|
|
51853
|
-
return
|
|
51852
|
+
subscribe(e4, t3, n3 = false) {
|
|
51853
|
+
return n3 ? this.once(e4, t3) : this.on(e4, t3);
|
|
51854
51854
|
}
|
|
51855
|
-
subscribeAll(
|
|
51856
|
-
return this.subscribe(`*`,
|
|
51855
|
+
subscribeAll(e4) {
|
|
51856
|
+
return this.subscribe(`*`, e4);
|
|
51857
51857
|
}
|
|
51858
51858
|
};
|
|
51859
51859
|
|
|
51860
|
-
//
|
|
51860
|
+
// ../shared/dist/index.js
|
|
51861
51861
|
var import_node_module = require("node:module");
|
|
51862
51862
|
var import_pino = __toESM(require("/Users/aniwei/Desktop/workspaces/x-coding-agent/node_modules/.pnpm/pino@10.3.1/node_modules/pino/pino.js"), 1);
|
|
51863
51863
|
|
|
51864
|
-
//
|
|
51864
|
+
// ../env/dist/index.js
|
|
51865
51865
|
var import_node_os = require("node:os");
|
|
51866
51866
|
var import_node_fs = require("node:fs");
|
|
51867
51867
|
var import_node_path = require("node:path");
|
|
51868
51868
|
var b = { stream: [`maxRetries`, `initialDelayMs`, `backoffFactor`, `maxDelayMs`], networkDisconnect: [`maxRetries`, `intervalMs`], mcp: [`maxReconnectAttempts`, `reconnectDelayMs`, `requestTimeoutMs`], schedule: [`retryBackoffMs`], errorRetry: [`maxAttempts`, `intervalMs`], oauth: [`refreshLockTimeoutMs`] };
|
|
51869
51869
|
var x = Object.keys(b);
|
|
51870
51870
|
var E = [];
|
|
51871
|
-
var k = (
|
|
51872
|
-
if (
|
|
51873
|
-
let
|
|
51874
|
-
return isNaN(
|
|
51871
|
+
var k = (e4, t3) => {
|
|
51872
|
+
if (e4 === void 0) return t3;
|
|
51873
|
+
let n3 = parseInt(e4, 10);
|
|
51874
|
+
return isNaN(n3) || n3 <= 0 ? (E.push(`Invalid environment variable value: ${e4}. Using default: ${t3}`), t3) : n3;
|
|
51875
51875
|
};
|
|
51876
|
-
function j(
|
|
51877
|
-
return (0, import_node_path.normalize)(
|
|
51876
|
+
function j(e4) {
|
|
51877
|
+
return (0, import_node_path.normalize)(e4).replaceAll(import_node_path.sep === `\\` ? `\\` : import_node_path.sep, `/`);
|
|
51878
51878
|
}
|
|
51879
51879
|
function N() {
|
|
51880
51880
|
try {
|
|
51881
|
-
let
|
|
51882
|
-
return JSON.parse((0, import_node_fs.readFileSync)(
|
|
51883
|
-
} catch
|
|
51884
|
-
return
|
|
51881
|
+
let e4 = j(`${j(new URL(`.`, __otto_plugin_import_meta_url).pathname)}/../package.json`);
|
|
51882
|
+
return JSON.parse((0, import_node_fs.readFileSync)(e4, `utf-8`)).version || `unknown`;
|
|
51883
|
+
} catch {
|
|
51884
|
+
return `unknown`;
|
|
51885
51885
|
}
|
|
51886
51886
|
}
|
|
51887
51887
|
var P = N();
|
|
@@ -51905,7 +51905,7 @@ var se = process.env.OTTO_OFFLINE === `1` || process.env.OTTO_OFFLINE?.toLowerCa
|
|
|
51905
51905
|
var ce = j(process.env.OTTO_AUTH_PATH || `${U}/auth.json`);
|
|
51906
51906
|
var $ = j(process.env.OTTO_IDENTITY_PATH || `${z2}/identity.json`);
|
|
51907
51907
|
|
|
51908
|
-
//
|
|
51908
|
+
// ../shared/dist/index.js
|
|
51909
51909
|
var import_node_stream = require("node:stream");
|
|
51910
51910
|
var import_mime_types = __toESM(require_mime_types(), 1);
|
|
51911
51911
|
var import_jsonc_parser = require("/Users/aniwei/Desktop/workspaces/x-coding-agent/node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/umd/main.js");
|
|
@@ -52017,7 +52017,7 @@ function splitLines(chunk) {
|
|
|
52017
52017
|
return [lines, incompleteLine];
|
|
52018
52018
|
}
|
|
52019
52019
|
|
|
52020
|
-
//
|
|
52020
|
+
// ../shared/dist/index.js
|
|
52021
52021
|
var import_undici = __toESM(require_undici(), 1);
|
|
52022
52022
|
var b2 = class extends Error {
|
|
52023
52023
|
code;
|
|
@@ -52026,31 +52026,31 @@ var b2 = class extends Error {
|
|
|
52026
52026
|
headers;
|
|
52027
52027
|
errorType;
|
|
52028
52028
|
pluginSource;
|
|
52029
|
-
constructor(
|
|
52030
|
-
super(
|
|
52029
|
+
constructor(e4, t3) {
|
|
52030
|
+
super(e4, { cause: t3.cause }), this.name = new.target.name, this.code = t3.code, this.cause = t3.cause, this.status = t3.status, this.headers = t3.headers, this.errorType = t3.errorType, this.pluginSource = t3.pluginSource;
|
|
52031
52031
|
}
|
|
52032
52032
|
};
|
|
52033
52033
|
var x2 = class extends b2 {
|
|
52034
52034
|
};
|
|
52035
52035
|
var Ce = class extends b2 {
|
|
52036
52036
|
};
|
|
52037
|
-
var { setPrototypeOf: Ee = function(
|
|
52038
|
-
return
|
|
52037
|
+
var { setPrototypeOf: Ee = function(e4, t3) {
|
|
52038
|
+
return e4.__proto__ = t3, e4;
|
|
52039
52039
|
} } = Object;
|
|
52040
52040
|
var C = class e3 extends Error {
|
|
52041
52041
|
framesToPop = 1;
|
|
52042
52042
|
name = `Invariant Violation`;
|
|
52043
|
-
constructor(
|
|
52044
|
-
super(typeof
|
|
52043
|
+
constructor(t3 = `Invariant Violation`) {
|
|
52044
|
+
super(typeof t3 == `number` ? `Invariant Violation: ${t3}` : t3), Ee(this, e3.prototype);
|
|
52045
52045
|
}
|
|
52046
52046
|
};
|
|
52047
|
-
function w(
|
|
52048
|
-
if (typeof
|
|
52049
|
-
else if (!
|
|
52047
|
+
function w(e4, t3) {
|
|
52048
|
+
if (typeof e4 == `function`) w(e4(), t3);
|
|
52049
|
+
else if (!e4) throw new C(t3);
|
|
52050
52050
|
}
|
|
52051
52051
|
var De = /* @__PURE__ */ new Set([`trace`, `debug`, `info`, `warn`, `error`, `fatal`]);
|
|
52052
|
-
function T(
|
|
52053
|
-
return De.has(
|
|
52052
|
+
function T(e4) {
|
|
52053
|
+
return De.has(e4) ? e4 : `info`;
|
|
52054
52054
|
}
|
|
52055
52055
|
var Oe = (() => {
|
|
52056
52056
|
try {
|
|
@@ -52067,8 +52067,8 @@ function ke() {
|
|
|
52067
52067
|
return false;
|
|
52068
52068
|
}
|
|
52069
52069
|
}
|
|
52070
|
-
function Ae(
|
|
52071
|
-
return
|
|
52070
|
+
function Ae(e4) {
|
|
52071
|
+
return e4 === `stdout` ? 1 : e4 === `stderr` ? 2 : e4;
|
|
52072
52072
|
}
|
|
52073
52073
|
function je() {
|
|
52074
52074
|
return process.env.OTTO_LOG_STDERR === `0`;
|
|
@@ -52076,91 +52076,100 @@ function je() {
|
|
|
52076
52076
|
function Me() {
|
|
52077
52077
|
return process.env.OTTO_LOG_FILE || `${process.env.HOME || process.env.USERPROFILE || `.`}/.otto/logs/otto.log`;
|
|
52078
52078
|
}
|
|
52079
|
-
function Ne(
|
|
52080
|
-
let
|
|
52081
|
-
if (!
|
|
52082
|
-
let
|
|
52083
|
-
return
|
|
52079
|
+
function Ne(e4, t3) {
|
|
52080
|
+
let n3 = ke(), r3 = je(), i2 = { target: n3 ? `pino-pretty` : `pino/file`, options: n3 ? { colorize: true, destination: 2 } : { destination: 2 }, level: t3 };
|
|
52081
|
+
if (!e4 || e4 === `stdout` || e4 === `stderr`) return r3 ? [{ target: `pino/file`, options: { destination: Me(), mkdir: true }, level: t3 }] : [i2];
|
|
52082
|
+
let a3 = { target: `pino/file`, options: { destination: Ae(e4), mkdir: true }, level: t3 };
|
|
52083
|
+
return r3 ? [a3] : [a3, i2];
|
|
52084
52084
|
}
|
|
52085
52085
|
var E2 = new import_node_stream.PassThrough();
|
|
52086
52086
|
var D = new t();
|
|
52087
|
-
E2.on(`data`, (
|
|
52087
|
+
E2.on(`data`, (e4) => {
|
|
52088
52088
|
try {
|
|
52089
|
-
D.publish({ log: [JSON.parse(
|
|
52090
|
-
} catch (
|
|
52091
|
-
console.warn(`Failed to parse log chunk for listener:`,
|
|
52089
|
+
D.publish({ log: [JSON.parse(e4.toString())] });
|
|
52090
|
+
} catch (t3) {
|
|
52091
|
+
console.warn(`Failed to parse log chunk for listener:`, e4.toString(), t3);
|
|
52092
52092
|
}
|
|
52093
52093
|
});
|
|
52094
52094
|
var O = null;
|
|
52095
52095
|
var k2 = T(oe);
|
|
52096
52096
|
var Fe = /* @__PURE__ */ new Set();
|
|
52097
52097
|
var A = null;
|
|
52098
|
-
function Re(
|
|
52099
|
-
return { write(
|
|
52100
|
-
A ??= import_pino.default.transport({ targets: Ne(
|
|
52098
|
+
function Re(e4, t3) {
|
|
52099
|
+
return { write(n3) {
|
|
52100
|
+
A ??= import_pino.default.transport({ targets: Ne(e4, t3) }), A.write(n3);
|
|
52101
52101
|
} };
|
|
52102
52102
|
}
|
|
52103
|
-
function ze(
|
|
52104
|
-
return O ??= (0, import_pino.default)({ level:
|
|
52103
|
+
function ze(e4, t3) {
|
|
52104
|
+
return O ??= (0, import_pino.default)({ level: e4 }, import_pino.default.multistream([{ level: e4, stream: E2 }, { level: e4, stream: Re(t3, e4) }])), k2 = T(O.level), O;
|
|
52105
52105
|
}
|
|
52106
|
-
function Be(
|
|
52107
|
-
ze(
|
|
52108
|
-
let
|
|
52109
|
-
return Fe.add(
|
|
52106
|
+
function Be(e4, t3) {
|
|
52107
|
+
ze(t3?.level ?? T(oe), t3?.destination ?? X), w(O, `Root logger is not initialized`);
|
|
52108
|
+
let n3 = O.child({ name: e4 }, { level: t3?.level ?? k2 });
|
|
52109
|
+
return Fe.add(n3), n3;
|
|
52110
52110
|
}
|
|
52111
52111
|
var j2 = 10 * 1024 * 1024;
|
|
52112
52112
|
var I2;
|
|
52113
|
-
function L2(
|
|
52114
|
-
let
|
|
52115
|
-
if (
|
|
52116
|
-
return new import_undici.ProxyAgent({ uri:
|
|
52113
|
+
function L2(e4) {
|
|
52114
|
+
let t3 = e4 || I2;
|
|
52115
|
+
if (t3) try {
|
|
52116
|
+
return new import_undici.ProxyAgent({ uri: t3 });
|
|
52117
52117
|
} catch {
|
|
52118
52118
|
return;
|
|
52119
52119
|
}
|
|
52120
52120
|
}
|
|
52121
|
-
async function* gt(
|
|
52122
|
-
let { url:
|
|
52123
|
-
d && clearTimeout(d), d = setTimeout(() => c2.abort(),
|
|
52121
|
+
async function* gt(e4) {
|
|
52122
|
+
let { url: t3, method: n3 = `POST`, headers: r3 = {}, body: i2, timeout: a3 = 3e5, idleTimeout: o3 = 12e4, signal: s3 } = e4, c2 = new AbortController(), l3 = s3 ? AbortSignal.any([s3, c2.signal]) : c2.signal, u3 = setTimeout(() => c2.abort(), a3), d, f = () => {
|
|
52123
|
+
d && clearTimeout(d), d = setTimeout(() => c2.abort(), o3);
|
|
52124
52124
|
}, p;
|
|
52125
52125
|
try {
|
|
52126
|
-
let
|
|
52127
|
-
if (!
|
|
52128
|
-
let
|
|
52129
|
-
|
|
52130
|
-
let
|
|
52126
|
+
let a4 = L2(e4.proxy), o4 = { method: n3, headers: { "content-type": `application/json`, accept: `text/event-stream`, ...r3 }, body: i2 ? typeof i2 == `string` ? i2 : JSON.stringify(i2) : void 0, signal: l3 }, s4 = await fetch(t3, a4 ? { ...o4, dispatcher: a4 } : o4);
|
|
52127
|
+
if (!s4.ok) {
|
|
52128
|
+
let e5 = await s4.text(), t4 = `BAD_RESPONSE`;
|
|
52129
|
+
s4.status === 429 ? t4 = `RATE_LIMIT` : s4.status === 529 ? t4 = `OVERLOADED` : s4.status >= 500 ? t4 = `SERVER_ERROR` : s4.status >= 400 && (t4 = `REQUEST_ERROR`);
|
|
52130
|
+
let n4;
|
|
52131
52131
|
try {
|
|
52132
|
-
let
|
|
52133
|
-
|
|
52132
|
+
let t5 = JSON.parse(e5)?.error;
|
|
52133
|
+
n4 = t5?.code ?? t5?.type;
|
|
52134
52134
|
} catch {
|
|
52135
52135
|
}
|
|
52136
|
-
throw new x2(`Http request failed ${
|
|
52136
|
+
throw new x2(`Http request failed ${s4.status}: ${e5}`, { code: t4, status: s4.status, headers: s4.headers, errorType: n4 });
|
|
52137
52137
|
}
|
|
52138
|
-
if (
|
|
52139
|
-
p =
|
|
52140
|
-
let c3 = new TextDecoder(), u4 = [], d2 = createParser({ onEvent(
|
|
52141
|
-
u4.push({ event:
|
|
52138
|
+
if (e4.onResponse?.(s4.headers), !s4.body) throw new x2(`Response body is empty`, { code: `BAD_RESPONSE` });
|
|
52139
|
+
p = s4.body.getReader();
|
|
52140
|
+
let c3 = new TextDecoder(), u4 = [], d2 = createParser({ onEvent(e5) {
|
|
52141
|
+
u4.push({ event: e5.event || void 0, data: e5.data, id: e5.id || void 0 });
|
|
52142
52142
|
} });
|
|
52143
52143
|
for (f(); ; ) {
|
|
52144
|
-
let { done:
|
|
52145
|
-
if (
|
|
52146
|
-
for (f(), d2.feed(c3.decode(
|
|
52147
|
-
let
|
|
52148
|
-
|
|
52144
|
+
let { done: e5, value: t4 } = await p.read();
|
|
52145
|
+
if (e5) break;
|
|
52146
|
+
for (f(), d2.feed(c3.decode(t4, { stream: true })); u4.length > 0; ) {
|
|
52147
|
+
let e6 = u4.shift();
|
|
52148
|
+
e6 && (yield e6);
|
|
52149
52149
|
}
|
|
52150
52150
|
}
|
|
52151
52151
|
for (d2.feed(c3.decode()); u4.length > 0; ) {
|
|
52152
|
-
let
|
|
52153
|
-
|
|
52152
|
+
let e5 = u4.shift();
|
|
52153
|
+
e5 && (yield e5);
|
|
52154
52154
|
}
|
|
52155
|
-
} catch (
|
|
52156
|
-
throw
|
|
52155
|
+
} catch (e5) {
|
|
52156
|
+
throw e5 instanceof x2 ? e5 : e5 instanceof DOMException && e5.name === `AbortError` ? new x2(`Stream aborted or timed out`, { code: `TIMEOUT`, cause: e5 }) : new x2(`Stream request failed`, { code: `NETWORK_ERROR`, cause: e5 instanceof Error ? e5 : Error(String(e5)) });
|
|
52157
52157
|
} finally {
|
|
52158
52158
|
clearTimeout(u3), d && clearTimeout(d), p && p.cancel().catch(() => {
|
|
52159
52159
|
});
|
|
52160
52160
|
}
|
|
52161
52161
|
}
|
|
52162
|
+
function _t(e4, t3) {
|
|
52163
|
+
if (e4 == null) return;
|
|
52164
|
+
if (typeof e4.get == `function`) return e4.get(t3) ?? void 0;
|
|
52165
|
+
let n3 = e4;
|
|
52166
|
+
for (let e5 of Object.keys(n3)) if (e5.toLowerCase() === t3) {
|
|
52167
|
+
let t4 = n3[e5];
|
|
52168
|
+
return typeof t4 == `string` ? t4 : void 0;
|
|
52169
|
+
}
|
|
52170
|
+
}
|
|
52162
52171
|
var z3 = { Bash: `bash`, Read: `read`, Write: `write`, Edit: `edit`, MultiEdit: `edit`, Grep: `grep`, Glob: `find`, WebFetch: `web_fetch`, WebSearch: `web_search`, Task: `task_delegate`, TodoWrite: `write_todos` };
|
|
52163
|
-
var St = Object.fromEntries(Object.entries(z3).reverse().map(([
|
|
52172
|
+
var St = Object.fromEntries(Object.entries(z3).reverse().map(([e4, t3]) => [t3, e4]));
|
|
52164
52173
|
function Ot() {
|
|
52165
52174
|
return `<span class="otto-wordmark">OTTO</span>`;
|
|
52166
52175
|
}
|
|
@@ -52176,17 +52185,17 @@ function At() {
|
|
|
52176
52185
|
<path d="M19 19l14 14M33 19l-14 14" stroke="var(--gray-9)" stroke-width="2.8" stroke-linecap="round"/>
|
|
52177
52186
|
</svg>`;
|
|
52178
52187
|
}
|
|
52179
|
-
function U2(
|
|
52180
|
-
return
|
|
52188
|
+
function U2(e4) {
|
|
52189
|
+
return e4.replace(/[&<>"']/g, (e5) => ({ "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'` })[e5] ?? e5);
|
|
52181
52190
|
}
|
|
52182
|
-
function jt(
|
|
52183
|
-
let i2 =
|
|
52191
|
+
function jt(e4, t3, n3, r3) {
|
|
52192
|
+
let i2 = e4 === `success` ? kt() : At();
|
|
52184
52193
|
return `<!doctype html>
|
|
52185
52194
|
<html lang="en">
|
|
52186
52195
|
<head>
|
|
52187
52196
|
<meta charset="utf-8">
|
|
52188
52197
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
52189
|
-
<title>${U2(
|
|
52198
|
+
<title>${U2(t3)}</title>
|
|
52190
52199
|
<style>
|
|
52191
52200
|
:root {
|
|
52192
52201
|
--gray-1:#FFFFFF;--gray-2:#F5F6FA;--gray-3:#EEF0F9;
|
|
@@ -52250,11 +52259,11 @@ function jt(e6, t4, n4, r4) {
|
|
|
52250
52259
|
${Ot()}
|
|
52251
52260
|
<section class="card">
|
|
52252
52261
|
<div class="status-icon">${i2}</div>
|
|
52253
|
-
<p class="kicker">${
|
|
52254
|
-
<h1 id="title">${U2(
|
|
52255
|
-
<p class="desc">${U2(
|
|
52262
|
+
<p class="kicker">${e4 === `success` ? `Authentication` : `Error`}</p>
|
|
52263
|
+
<h1 id="title">${U2(t3)}</h1>
|
|
52264
|
+
<p class="desc">${U2(n3)}</p>
|
|
52256
52265
|
<div class="separator"></div>
|
|
52257
|
-
<p class="footer">${U2(
|
|
52266
|
+
<p class="footer">${U2(r3)}</p>
|
|
52258
52267
|
</section>
|
|
52259
52268
|
</main>
|
|
52260
52269
|
</body>
|
|
@@ -52271,44 +52280,62 @@ var Y = Be(`@x-otto/shared:file-lock`);
|
|
|
52271
52280
|
// ../plugin/dist/index.js
|
|
52272
52281
|
var import_semver = __toESM(require_semver2(), 1);
|
|
52273
52282
|
|
|
52274
|
-
//
|
|
52283
|
+
// ../interchange/dist/index.js
|
|
52275
52284
|
var a2 = /^data:([^;,]*)(?:;[^,]*)?,(.*)$/s;
|
|
52276
|
-
function o2(
|
|
52277
|
-
let
|
|
52278
|
-
return { base64:
|
|
52285
|
+
function o2(e4, t3) {
|
|
52286
|
+
let n3 = a2.exec(e4), r3 = (n3 ? n3[2] ?? `` : e4).replace(/\s+/g, ``);
|
|
52287
|
+
return { base64: r3, mediaType: ((n3 ? n3[1] : ``) || t3 || ``).toLowerCase(), valid: s2(r3) };
|
|
52288
|
+
}
|
|
52289
|
+
function s2(e4) {
|
|
52290
|
+
return e4.length === 0 || e4 === `undefined` || e4.length % 4 == 1 ? false : /^[A-Za-z0-9+/]*={0,2}$/.test(e4);
|
|
52291
|
+
}
|
|
52292
|
+
function c(e4, t3) {
|
|
52293
|
+
switch (e4.toLowerCase()) {
|
|
52294
|
+
case `image/jpeg`:
|
|
52295
|
+
case `image/jpg`:
|
|
52296
|
+
return `image/jpeg`;
|
|
52297
|
+
case `image/png`:
|
|
52298
|
+
return `image/png`;
|
|
52299
|
+
case `image/gif`:
|
|
52300
|
+
return `image/gif`;
|
|
52301
|
+
case `image/webp`:
|
|
52302
|
+
return `image/webp`;
|
|
52303
|
+
default:
|
|
52304
|
+
return l2(t3);
|
|
52305
|
+
}
|
|
52279
52306
|
}
|
|
52280
|
-
function
|
|
52281
|
-
return
|
|
52307
|
+
function l2(e4) {
|
|
52308
|
+
return e4.startsWith(`/9j/`) ? `image/jpeg` : e4.startsWith(`iVBOR`) ? `image/png` : e4.startsWith(`R0lGOD`) ? `image/gif` : e4.startsWith(`UklGR`) ? `image/webp` : `image/png`;
|
|
52282
52309
|
}
|
|
52283
52310
|
|
|
52284
52311
|
// ../plugin/dist/index.js
|
|
52285
52312
|
var pe = [`provider`, `tools`, `hooks`, `tui.renderer`, `network`, `context`, `monitor`, `wire-protocol`, `a2ui.component`, `panel.backend`, `mcp.server`, `feedback`, `input.resolver`, `a2ui.renderer`, `theme`, `agent.dispatch`, `service`, `storage`, `session.read`, `llm.complete`, `user.notify`, `user.ask`];
|
|
52286
52313
|
var b3 = { provider: true, tools: true, hooks: false, "tui.renderer": true, network: true, context: false, monitor: false, "wire-protocol": true, "a2ui.component": true, "panel.backend": true, "mcp.server": true, feedback: false, "input.resolver": true, "a2ui.renderer": true, theme: false, "agent.dispatch": true, service: true, storage: false, "session.read": true, "llm.complete": true, "user.notify": false, "user.ask": true };
|
|
52287
|
-
var x3 = Object.freeze(Object.keys(b3).filter((
|
|
52314
|
+
var x3 = Object.freeze(Object.keys(b3).filter((e4) => b3[e4]));
|
|
52288
52315
|
var S = Be(`@x-otto/coding:plugin-manifest`);
|
|
52289
52316
|
var w2 = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
52290
|
-
var T2 = (
|
|
52291
|
-
var E3 = external_exports.string().refine((
|
|
52292
|
-
var me = external_exports.object({ id: E3, title: E3, entry: E3.refine((
|
|
52293
|
-
var he = external_exports.object({ role: T2(E3), toolName: T2(E3), contentType: T2(E3) }).refine((
|
|
52294
|
-
var ge = external_exports.object({ id: E3, matcher: he, entry: E3.refine((
|
|
52295
|
-
var _e = external_exports.object({ id: E3, matcher: he, entry: E3.refine((
|
|
52296
|
-
var ve = external_exports.object({ extensions: T2(external_exports.array(E3)), filenames: T2(external_exports.array(E3)), glob: T2(external_exports.array(E3)) }).refine((
|
|
52297
|
-
var ye = D2(external_exports.object({ id: E3, label: E3, matcher: ve, entry: E3.refine((
|
|
52298
|
-
var be = D2(external_exports.object({ type: E3, entry: E3.refine((
|
|
52299
|
-
var xe = D2(external_exports.object({ id: E3, entry: E3.refine((
|
|
52317
|
+
var T2 = (e4) => e4.optional().catch(void 0);
|
|
52318
|
+
var E3 = external_exports.string().refine((e4) => e4.trim().length > 0, `must be non-empty`);
|
|
52319
|
+
var me = external_exports.object({ id: E3, title: E3, entry: E3.refine((e4) => !e4.startsWith(`/`) && !e4.split(/[\\/]/).includes(`..`), `unsafe path (absolute or traversal)`), export: T2(E3) });
|
|
52320
|
+
var he = external_exports.object({ role: T2(E3), toolName: T2(E3), contentType: T2(E3) }).refine((e4) => e4.role != null || e4.toolName != null || e4.contentType != null, { message: `matcher must declare at least one of role/toolName/contentType` });
|
|
52321
|
+
var ge = external_exports.object({ id: E3, matcher: he, entry: E3.refine((e4) => !e4.startsWith(`/`) && !e4.split(/[\\/]/).includes(`..`), `unsafe path (absolute or traversal)`), export: T2(E3) });
|
|
52322
|
+
var _e = external_exports.object({ id: E3, matcher: he, entry: E3.refine((e4) => !e4.startsWith(`/`) && !e4.split(/[\\/]/).includes(`..`), `unsafe path (absolute or traversal)`), export: T2(E3) });
|
|
52323
|
+
var ve = external_exports.object({ extensions: T2(external_exports.array(E3)), filenames: T2(external_exports.array(E3)), glob: T2(external_exports.array(E3)) }).refine((e4) => (e4.extensions?.length ?? 0) + (e4.filenames?.length ?? 0) + (e4.glob?.length ?? 0) > 0, { message: `matcher must declare at least one of extensions/filenames/glob` });
|
|
52324
|
+
var ye = D2(external_exports.object({ id: E3, label: E3, matcher: ve, entry: E3.refine((e4) => !e4.startsWith(`/`) && !e4.split(/[\\/]/).includes(`..`), `unsafe path (absolute or traversal)`), export: T2(E3), order: T2(external_exports.number()) }), `fileViewers`);
|
|
52325
|
+
var be = D2(external_exports.object({ type: E3, entry: E3.refine((e4) => !e4.startsWith(`/`) && !e4.split(/[\\/]/).includes(`..`), `unsafe path (absolute or traversal)`), export: T2(E3) }), `a2uiComponents`);
|
|
52326
|
+
var xe = D2(external_exports.object({ id: E3, entry: E3.refine((e4) => !e4.startsWith(`/`) && !e4.split(/[\\/]/).includes(`..`), `unsafe path (absolute or traversal)`), export: T2(E3), order: T2(external_exports.number()), tickMs: T2(external_exports.number()) }), `statusWidgets`);
|
|
52300
52327
|
var Se = D2(ge, `renderers`);
|
|
52301
52328
|
var Ce2 = D2(me, `panels`);
|
|
52302
52329
|
var we = external_exports.discriminatedUnion(`type`, [external_exports.object({ type: external_exports.literal(`builtin`), id: E3 }), external_exports.object({ type: external_exports.literal(`mcp`), server: E3, tool: E3, params: T2(external_exports.record(external_exports.string(), external_exports.unknown())) }), external_exports.object({ type: external_exports.literal(`open`), target: E3 }), external_exports.object({ type: external_exports.literal(`command`), name: E3, args: T2(E3) }), external_exports.object({ type: external_exports.literal(`script`), name: E3 })]);
|
|
52303
52330
|
var Te = external_exports.object({ id: E3, title: E3, command: we, color: T2(external_exports.enum([`accent`, `amber`, `red`, `green`, `gray`])) });
|
|
52304
52331
|
var Ee2 = external_exports.object({ action: E3, point: E3, when: T2(E3), order: T2(external_exports.number()) });
|
|
52305
52332
|
var De2 = external_exports.object({ key: E3, groups: external_exports.array(external_exports.array(E3)), map: external_exports.object({ none: E3, partial: E3, all: E3 }) });
|
|
52306
|
-
function D2(
|
|
52307
|
-
return external_exports.array(external_exports.unknown()).transform((
|
|
52308
|
-
let
|
|
52309
|
-
if (
|
|
52310
|
-
let
|
|
52311
|
-
S.warn({ label:
|
|
52333
|
+
function D2(t3, n3) {
|
|
52334
|
+
return external_exports.array(external_exports.unknown()).transform((e4) => {
|
|
52335
|
+
let r3 = e4.map((e5) => t3.safeParse(e5)), i2 = r3.filter((e5) => e5.success).map((e5) => e5.data), a3 = r3.length - i2.length;
|
|
52336
|
+
if (a3 > 0 && n3) {
|
|
52337
|
+
let e5 = r3.filter((e6) => !e6.success).map((e6) => e6.success ? `` : e6.error.issues.map((e7) => e7.message).join(`; `));
|
|
52338
|
+
S.warn({ label: n3, dropped: a3, total: r3.length, issues: e5 }, `contributes.${n3}: ${a3}/${r3.length} \u6761 entry \u6821\u9A8C\u5931\u8D25\uFF0C\u5DF2\u9759\u9ED8\u4E22\u5F03\uFF08fail-soft\uFF09`);
|
|
52312
52339
|
}
|
|
52313
52340
|
return i2.length > 0 ? i2 : void 0;
|
|
52314
52341
|
});
|
|
@@ -52320,71 +52347,71 @@ var je2 = external_exports.enum([`low`, `medium`, `high`, `xhigh`, `max`]);
|
|
|
52320
52347
|
var Me2 = external_exports.enum([`enabled`, `adaptive`]);
|
|
52321
52348
|
var Ne2 = external_exports.object({ id: E3, contextWindow: external_exports.number().int().positive(), maxOutput: external_exports.number().int().positive(), cost: T2(Oe2), strengths: T2(external_exports.array(Ae2).min(1)), reasoning: T2(external_exports.boolean()), thinkingLevels: T2(external_exports.array(je2).min(1)), thinkingMode: T2(Me2) });
|
|
52322
52349
|
var Pe = external_exports.enum([`openai-completions`, `openai-responses`, `anthropic-messages`]);
|
|
52323
|
-
var Fe2 = external_exports.object({ label: E3, value: E3.refine((
|
|
52350
|
+
var Fe2 = external_exports.object({ label: E3, value: E3.refine((e4) => !e4.startsWith(`!`) && !e4.startsWith(`#`), `value must not start with '!' or '#' (mode-prefix collision)`), kind: external_exports.enum([`resource`, `hashtag`]), description: T2(E3), resolverId: T2(E3) });
|
|
52324
52351
|
var Ie = external_exports.object({ id: E3, dataSource: external_exports.object({ contextKey: E3 }), point: T2(E3), when: T2(E3), order: T2(external_exports.number()) });
|
|
52325
|
-
var Le = external_exports.union([E3, external_exports.object({ file: E3.refine((
|
|
52352
|
+
var Le = external_exports.union([E3, external_exports.object({ file: E3.refine((e4) => !e4.startsWith(`/`) && !e4.split(/[\\/]/).includes(`..`), `unsafe path (absolute or traversal)`) })]);
|
|
52326
52353
|
var Re2 = external_exports.object({ id: E3, priority: T2(external_exports.number()), content: Le });
|
|
52327
52354
|
var ze2 = external_exports.object({ id: E3, translations: external_exports.record(external_exports.string(), external_exports.string()) });
|
|
52328
52355
|
var Be2 = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/;
|
|
52329
|
-
var O2 = (
|
|
52356
|
+
var O2 = (e4) => !Be2.test(e4);
|
|
52330
52357
|
var Ve = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
|
|
52331
|
-
var k3 = (
|
|
52358
|
+
var k3 = (t3) => external_exports.string().max(16).refine((e4) => Ve.test(e4), `${t3} must be a #RRGGBB or #RGB hex color`);
|
|
52332
52359
|
var He = external_exports.object({ brand: k3(`brand`), brandShimmer: k3(`brandShimmer`), accent: k3(`accent`), accentDim: k3(`accentDim`), accentBright: k3(`accentBright`), text: T2(k3(`text`)), inactive: k3(`inactive`), secondary: k3(`secondary`), subtle: k3(`subtle`), replyPrefix: k3(`replyPrefix`), success: k3(`success`), error: k3(`error`), warning: k3(`warning`), special: k3(`special`), suggestion: k3(`suggestion`), permission: k3(`permission`), codeText: k3(`codeText`), diffAdd: k3(`diffAdd`), diffRemove: k3(`diffRemove`), diffAddBg: k3(`diffAddBg`), diffRemoveBg: k3(`diffRemoveBg`), panelBorder: k3(`panelBorder`), overlayBg: k3(`overlayBg`), tagBg: k3(`tagBg`), toolText: k3(`toolText`), focusBorder: k3(`focusBorder`), selection: k3(`selection`) });
|
|
52333
52360
|
var A2 = external_exports.enum(`brand.brandShimmer.accent.accentDim.accentBright.text.inactive.secondary.subtle.replyPrefix.success.error.warning.special.suggestion.permission.codeText.diffAdd.diffRemove.diffAddBg.diffRemoveBg.panelBorder.overlayBg.tagBg.toolText.focusBorder.selection`.split(`.`));
|
|
52334
52361
|
var Ue = external_exports.strictObject({ heading1: T2(A2), heading2: T2(A2), headingWeak: T2(A2), listMarker: T2(A2), listMarkerMuted: T2(A2), quoteBar: T2(A2), quoteText: T2(A2), link: T2(A2), inlineCode: T2(A2), codeFence: T2(A2), tableHeader: T2(A2), tableDivider: T2(A2), listIndent: T2(external_exports.union([external_exports.literal(2), external_exports.literal(3)])), listMarkers: T2(external_exports.tuple([external_exports.string().min(1).max(4), external_exports.string().min(1).max(4), external_exports.string().min(1).max(4), external_exports.string().min(1).max(4)])), codeBlockDivider: T2(external_exports.enum([`hr`, `none`])) });
|
|
52335
|
-
var We = external_exports.object({ localId: E3.max(64).refine((
|
|
52362
|
+
var We = external_exports.object({ localId: E3.max(64).refine((e4) => w2.test(e4), `localId must be kebab-case`), label: E3.max(64).refine(O2, `label must not contain control characters`), appearance: external_exports.enum([`dark`, `light`]), colors: He, markdown: T2(Ue), meta: T2(external_exports.object({ author: T2(E3.max(128).refine(O2, `author must not contain control characters`)), description: T2(E3.max(256).refine(O2, `description must not contain control characters`)), version: T2(E3.max(32).refine(O2, `version must not contain control characters`)) })) });
|
|
52336
52363
|
var qe = 2 * 1024;
|
|
52337
52364
|
var Ye = 64 * 1024;
|
|
52338
52365
|
var Xe = external_exports.object({ id: E3, label: E3, toolRef: E3 });
|
|
52339
|
-
var Ze = external_exports.object({ header: E3.refine((
|
|
52366
|
+
var Ze = external_exports.object({ header: E3.refine((e4) => /^[a-zA-Z0-9][a-zA-Z0-9\-_]*$/.test(e4), `header name must be alphanumeric with hyphens/underscores only`), source: external_exports.object({ kind: external_exports.literal(`jwt-claim`), claim: E3, namespace: T2(E3), tokenSources: T2(external_exports.array(external_exports.enum([`id_token`, `access_token`]))) }) });
|
|
52340
52367
|
var Qe = external_exports.object({ imageConstraints: T2(ke2), supportsTools: T2(external_exports.boolean()) });
|
|
52341
52368
|
var j3 = external_exports.object({ url: E3, responseFormat: external_exports.literal(`openai-list`), authScheme: T2(external_exports.enum([`bearer`, `x-api-key`, `auto`])), betaHeaderName: T2(E3), modelIdExclude: T2(D2(external_exports.string(), `modelIdExclude`)) });
|
|
52342
52369
|
var M2 = external_exports.object({ store: T2(external_exports.boolean()), sendMaxOutputTokens: T2(external_exports.boolean()) });
|
|
52343
|
-
var $e = external_exports.object({ id: E3, name: T2(E3), catalogOnly: T2(external_exports.boolean()), baseUrl: T2(E3), wireApi: T2(Pe), envKey: T2(E3), oauthRef: T2(E3), headers: T2(external_exports.record(external_exports.string(), external_exports.string())), models: T2(D2(Ne2, `models`)), tokenDerivedHeaders: T2(D2(Ze, `tokenDerivedHeaders`)), modelsEndpoint: T2(j3), responseBodyPolicy: T2(M2), allowAuthHeaderOverride: T2(external_exports.boolean()), preserveProviderId: T2(external_exports.boolean()) }).extend(Qe.shape).superRefine((
|
|
52344
|
-
if (
|
|
52345
|
-
|
|
52370
|
+
var $e = external_exports.object({ id: E3, name: T2(E3), catalogOnly: T2(external_exports.boolean()), baseUrl: T2(E3), wireApi: T2(Pe), envKey: T2(E3), oauthRef: T2(E3), headers: T2(external_exports.record(external_exports.string(), external_exports.string())), models: T2(D2(Ne2, `models`)), tokenDerivedHeaders: T2(D2(Ze, `tokenDerivedHeaders`)), modelsEndpoint: T2(j3), responseBodyPolicy: T2(M2), allowAuthHeaderOverride: T2(external_exports.boolean()), preserveProviderId: T2(external_exports.boolean()) }).extend(Qe.shape).superRefine((t3, n3) => {
|
|
52371
|
+
if (t3.catalogOnly === true) {
|
|
52372
|
+
t3.wireApi && n3.addIssue({ code: external_exports.ZodIssueCode.custom, message: `catalogOnly entries must not declare wireApi; use providerFactories for custom protocols`, path: [`wireApi`] }), t3.baseUrl && n3.addIssue({ code: external_exports.ZodIssueCode.custom, message: `catalogOnly entries must not declare baseUrl; use providerFactories for custom protocols`, path: [`baseUrl`] });
|
|
52346
52373
|
return;
|
|
52347
52374
|
}
|
|
52348
|
-
|
|
52375
|
+
t3.baseUrl || n3.addIssue({ code: external_exports.ZodIssueCode.custom, message: `baseUrl is required unless catalogOnly is true`, path: [`baseUrl`] }), t3.wireApi || n3.addIssue({ code: external_exports.ZodIssueCode.custom, message: `wireApi is required unless catalogOnly is true`, path: [`wireApi`] });
|
|
52349
52376
|
});
|
|
52350
|
-
var et = external_exports.object({ name: E3.refine((
|
|
52377
|
+
var et = external_exports.object({ name: E3.refine((e4) => /^[a-z][a-z0-9-]*$/.test(e4), `must be lowercase kebab-case`), bin: T2(E3) });
|
|
52351
52378
|
var tt = external_exports.discriminatedUnion(`kind`, [external_exports.object({ kind: external_exports.literal(`pkce`), id: E3, name: T2(E3), clientId: E3, authorizeUrl: E3, tokenUrl: E3, redirectUri: E3, scope: E3, loopbackPorts: T2(external_exports.array(external_exports.number().int().positive())), assumesLoopbackAlways: T2(external_exports.boolean()), extraAuthParams: T2(external_exports.record(external_exports.string(), external_exports.string())), tokenExchangeEncoding: T2(external_exports.enum([`json`, `form`])), subscriptionScoped: T2(external_exports.boolean()), oauthBeta: T2(E3) }), external_exports.object({ kind: external_exports.literal(`device-flow`), id: E3, name: T2(E3), clientId: E3, deviceCodeUrlTemplate: E3, tokenUrlTemplate: E3, refreshUrlTemplate: T2(E3), scope: E3, allowCustomDomain: T2(external_exports.boolean()), userAgent: T2(E3) })]);
|
|
52352
|
-
var nt = external_exports.object({ skills: T2(external_exports.boolean()), agents: T2(external_exports.boolean()), commands: T2(external_exports.boolean()), mcp: T2(external_exports.boolean()), cli: T2(et), panels: T2(Ce2), actions: T2(D2(Te, `actions`)), menus: T2(D2(Ee2, `menus`)), contextKeys: T2(D2(De2, `contextKeys`)), providers: T2(D2($e, `providers`)), oauth: T2(D2(tt, `oauth`)), statusItems: T2(D2(Ie, `statusItems`)), perfMetrics: T2(D2(Xe, `perfMetrics`)), renderers: T2(Se), fileViewers: T2(ye), statusWidgets: T2(xe), a2uiComponents: T2(be), contextSources: T2(D2(Re2, `contextSources`)), i18n: T2(D2(ze2, `i18n`)), themePresets: T2(D2(We, `themePresets`)), i18nDir: T2(E3.refine((
|
|
52379
|
+
var nt = external_exports.object({ skills: T2(external_exports.boolean()), agents: T2(external_exports.boolean()), commands: T2(external_exports.boolean()), mcp: T2(external_exports.boolean()), cli: T2(et), panels: T2(Ce2), actions: T2(D2(Te, `actions`)), menus: T2(D2(Ee2, `menus`)), contextKeys: T2(D2(De2, `contextKeys`)), providers: T2(D2($e, `providers`)), oauth: T2(D2(tt, `oauth`)), statusItems: T2(D2(Ie, `statusItems`)), perfMetrics: T2(D2(Xe, `perfMetrics`)), renderers: T2(Se), fileViewers: T2(ye), statusWidgets: T2(xe), a2uiComponents: T2(be), contextSources: T2(D2(Re2, `contextSources`)), i18n: T2(D2(ze2, `i18n`)), themePresets: T2(D2(We, `themePresets`)), i18nDir: T2(E3.refine((e4) => !e4.startsWith(`/`) && !e4.split(/[\\/]/).includes(`..`), `unsafe path (absolute or traversal)`)), inputEntries: T2(E3), sigilEntries: T2(D2(Fe2, `sigilEntries`)), a2uiRenderers: T2(D2(_e, `a2uiRenderers`)) });
|
|
52353
52380
|
var rt = external_exports.enum(pe);
|
|
52354
|
-
var it = external_exports.array(external_exports.unknown()).transform((
|
|
52355
|
-
let
|
|
52356
|
-
return
|
|
52381
|
+
var it = external_exports.array(external_exports.unknown()).transform((e4) => {
|
|
52382
|
+
let t3 = e4.map((e5) => rt.safeParse(e5)).filter((e5) => e5.success).map((e5) => e5.data);
|
|
52383
|
+
return t3.length > 0 ? [...new Set(t3)] : void 0;
|
|
52357
52384
|
});
|
|
52358
52385
|
var at = /^(onStartup|onCommand:[^\s]+|onView:[^\s]+|onProvider:[^\s]+)$/;
|
|
52359
|
-
var ot = external_exports.array(external_exports.unknown()).transform((
|
|
52360
|
-
let
|
|
52361
|
-
return
|
|
52386
|
+
var ot = external_exports.array(external_exports.unknown()).transform((e4) => {
|
|
52387
|
+
let t3 = e4.filter((e5) => typeof e5 == `string` && at.test(e5));
|
|
52388
|
+
return t3.length > 0 ? [...new Set(t3)] : void 0;
|
|
52362
52389
|
});
|
|
52363
|
-
var st = external_exports.array(external_exports.unknown()).transform((
|
|
52364
|
-
let
|
|
52365
|
-
return
|
|
52390
|
+
var st = external_exports.array(external_exports.unknown()).transform((e4) => {
|
|
52391
|
+
let t3 = e4.filter((e5) => typeof e5 == `string` && w2.test(e5));
|
|
52392
|
+
return t3.length > 0 ? [...new Set(t3)] : void 0;
|
|
52366
52393
|
});
|
|
52367
|
-
var ct = external_exports.array(external_exports.unknown()).transform((
|
|
52368
|
-
let
|
|
52369
|
-
return
|
|
52394
|
+
var ct = external_exports.array(external_exports.unknown()).transform((e4) => {
|
|
52395
|
+
let t3 = e4.filter((e5) => typeof e5 == `string` && e5.trim().length > 0);
|
|
52396
|
+
return t3.length > 0 ? [...new Set(t3)] : void 0;
|
|
52370
52397
|
});
|
|
52371
52398
|
var lt = j3.extend({ headers: T2(external_exports.record(external_exports.string(), external_exports.string())) });
|
|
52372
|
-
var ut = external_exports.record(external_exports.string(), external_exports.unknown()).transform((
|
|
52373
|
-
let
|
|
52374
|
-
for (let [
|
|
52375
|
-
let
|
|
52376
|
-
|
|
52399
|
+
var ut = external_exports.record(external_exports.string(), external_exports.unknown()).transform((e4) => {
|
|
52400
|
+
let t3 = {};
|
|
52401
|
+
for (let [n3, r3] of Object.entries(e4)) {
|
|
52402
|
+
let e5 = lt.safeParse(r3);
|
|
52403
|
+
e5.success && (t3[n3] = e5.data);
|
|
52377
52404
|
}
|
|
52378
|
-
return Object.keys(
|
|
52405
|
+
return Object.keys(t3).length > 0 ? t3 : void 0;
|
|
52379
52406
|
});
|
|
52380
52407
|
var dt = external_exports.object({ baseUrl: E3, models: D2(Ne2, `codeProviderModels`), responseBodyPolicy: T2(M2) }).extend(Qe.shape);
|
|
52381
|
-
var ft = external_exports.record(external_exports.string(), external_exports.unknown()).transform((
|
|
52382
|
-
let
|
|
52383
|
-
for (let [
|
|
52384
|
-
let
|
|
52385
|
-
|
|
52408
|
+
var ft = external_exports.record(external_exports.string(), external_exports.unknown()).transform((e4) => {
|
|
52409
|
+
let t3 = {};
|
|
52410
|
+
for (let [n3, r3] of Object.entries(e4)) {
|
|
52411
|
+
let e5 = dt.safeParse(r3);
|
|
52412
|
+
e5.success && e5.data.models && e5.data.models.length > 0 && (t3[n3] = e5.data);
|
|
52386
52413
|
}
|
|
52387
|
-
return Object.keys(
|
|
52414
|
+
return Object.keys(t3).length > 0 ? t3 : void 0;
|
|
52388
52415
|
});
|
|
52389
52416
|
var pt = external_exports.object({ postinstall: T2(E3), setup: T2(E3) }).catchall(E3);
|
|
52390
52417
|
var mt = external_exports.object({ otto: T2(E3) });
|
|
@@ -52393,8 +52420,8 @@ var P2 = Be(`@x-otto/coding:plugin-discovery`);
|
|
|
52393
52420
|
var z4 = { extensionDetailActions: `extension/detail/actions` };
|
|
52394
52421
|
var B2 = { statuslineItem: `shell/statusline/item`, menuItem: `shell/menu/item` };
|
|
52395
52422
|
var Et = { ...z4, ...B2 };
|
|
52396
|
-
function At2(
|
|
52397
|
-
return
|
|
52423
|
+
function At2(e4) {
|
|
52424
|
+
return e4;
|
|
52398
52425
|
}
|
|
52399
52426
|
var Ft = Be(`@x-otto/plugin:file-provider`);
|
|
52400
52427
|
var Vt = Be(`@x-otto/coding:trust-store`);
|
|
@@ -52563,11 +52590,11 @@ var isAbsoluteURL = (url2) => {
|
|
|
52563
52590
|
};
|
|
52564
52591
|
var isArray = (val) => (isArray = Array.isArray, isArray(val));
|
|
52565
52592
|
var isReadonlyArray = isArray;
|
|
52566
|
-
function maybeObj(
|
|
52567
|
-
if (typeof
|
|
52593
|
+
function maybeObj(x5) {
|
|
52594
|
+
if (typeof x5 !== "object") {
|
|
52568
52595
|
return {};
|
|
52569
52596
|
}
|
|
52570
|
-
return
|
|
52597
|
+
return x5 ?? {};
|
|
52571
52598
|
}
|
|
52572
52599
|
function isEmptyObj(obj) {
|
|
52573
52600
|
if (!obj)
|
|
@@ -52579,14 +52606,14 @@ function isEmptyObj(obj) {
|
|
|
52579
52606
|
function hasOwn(obj, key) {
|
|
52580
52607
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
52581
52608
|
}
|
|
52582
|
-
var validatePositiveInteger = (name,
|
|
52583
|
-
if (typeof
|
|
52609
|
+
var validatePositiveInteger = (name, n3) => {
|
|
52610
|
+
if (typeof n3 !== "number" || !Number.isInteger(n3)) {
|
|
52584
52611
|
throw new AnthropicError(`${name} must be an integer`);
|
|
52585
52612
|
}
|
|
52586
|
-
if (
|
|
52613
|
+
if (n3 < 0) {
|
|
52587
52614
|
throw new AnthropicError(`${name} must be a positive integer`);
|
|
52588
52615
|
}
|
|
52589
|
-
return
|
|
52616
|
+
return n3;
|
|
52590
52617
|
};
|
|
52591
52618
|
var safeJSON = (text) => {
|
|
52592
52619
|
try {
|
|
@@ -52779,9 +52806,9 @@ function ReadableStreamToAsyncIterable(stream) {
|
|
|
52779
52806
|
if (result?.done)
|
|
52780
52807
|
reader.releaseLock();
|
|
52781
52808
|
return result;
|
|
52782
|
-
} catch (
|
|
52809
|
+
} catch (e4) {
|
|
52783
52810
|
reader.releaseLock();
|
|
52784
|
-
throw
|
|
52811
|
+
throw e4;
|
|
52785
52812
|
}
|
|
52786
52813
|
},
|
|
52787
52814
|
async return() {
|
|
@@ -53029,19 +53056,19 @@ var Stream = class _Stream {
|
|
|
53029
53056
|
if (sse.event === "completion") {
|
|
53030
53057
|
try {
|
|
53031
53058
|
yield JSON.parse(sse.data);
|
|
53032
|
-
} catch (
|
|
53059
|
+
} catch (e4) {
|
|
53033
53060
|
logger.error(`Could not parse message into JSON:`, sse.data);
|
|
53034
53061
|
logger.error(`From chunk:`, sse.raw);
|
|
53035
|
-
throw
|
|
53062
|
+
throw e4;
|
|
53036
53063
|
}
|
|
53037
53064
|
}
|
|
53038
53065
|
if (sse.event === "message_start" || sse.event === "message_delta" || sse.event === "message_stop" || sse.event === "content_block_start" || sse.event === "content_block_delta" || sse.event === "content_block_stop" || sse.event === "message") {
|
|
53039
53066
|
try {
|
|
53040
53067
|
yield JSON.parse(sse.data);
|
|
53041
|
-
} catch (
|
|
53068
|
+
} catch (e4) {
|
|
53042
53069
|
logger.error(`Could not parse message into JSON:`, sse.data);
|
|
53043
53070
|
logger.error(`From chunk:`, sse.raw);
|
|
53044
|
-
throw
|
|
53071
|
+
throw e4;
|
|
53045
53072
|
}
|
|
53046
53073
|
}
|
|
53047
53074
|
if (sse.event === "ping") {
|
|
@@ -53054,10 +53081,10 @@ var Stream = class _Stream {
|
|
|
53054
53081
|
}
|
|
53055
53082
|
}
|
|
53056
53083
|
done = true;
|
|
53057
|
-
} catch (
|
|
53058
|
-
if (isAbortError(
|
|
53084
|
+
} catch (e4) {
|
|
53085
|
+
if (isAbortError(e4))
|
|
53059
53086
|
return;
|
|
53060
|
-
throw
|
|
53087
|
+
throw e4;
|
|
53061
53088
|
} finally {
|
|
53062
53089
|
if (!done)
|
|
53063
53090
|
controller.abort();
|
|
@@ -53097,10 +53124,10 @@ var Stream = class _Stream {
|
|
|
53097
53124
|
yield JSON.parse(line);
|
|
53098
53125
|
}
|
|
53099
53126
|
done = true;
|
|
53100
|
-
} catch (
|
|
53101
|
-
if (isAbortError(
|
|
53127
|
+
} catch (e4) {
|
|
53128
|
+
if (isAbortError(e4))
|
|
53102
53129
|
return;
|
|
53103
|
-
throw
|
|
53130
|
+
throw e4;
|
|
53104
53131
|
} finally {
|
|
53105
53132
|
if (!done)
|
|
53106
53133
|
controller.abort();
|
|
@@ -53736,7 +53763,7 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path2(stat
|
|
|
53736
53763
|
error: `Value "${match[0]}" can't be safely passed as a path parameter`
|
|
53737
53764
|
});
|
|
53738
53765
|
}
|
|
53739
|
-
invalidSegments.sort((
|
|
53766
|
+
invalidSegments.sort((a3, b5) => a3.start - b5.start);
|
|
53740
53767
|
if (invalidSegments.length > 0) {
|
|
53741
53768
|
let lastEnd = 0;
|
|
53742
53769
|
const underline = invalidSegments.reduce((acc, segment) => {
|
|
@@ -53746,7 +53773,7 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path2(stat
|
|
|
53746
53773
|
return acc + spaces + arrows;
|
|
53747
53774
|
}, "");
|
|
53748
53775
|
throw new AnthropicError(`Path parameters result in path with invalid segments:
|
|
53749
|
-
${invalidSegments.map((
|
|
53776
|
+
${invalidSegments.map((e4) => e4.error).join("\n")}
|
|
53750
53777
|
${path3}
|
|
53751
53778
|
${underline}`);
|
|
53752
53779
|
}
|
|
@@ -54772,7 +54799,7 @@ var BetaMessageStream = class _BetaMessageStream {
|
|
|
54772
54799
|
const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event];
|
|
54773
54800
|
if (!listeners)
|
|
54774
54801
|
return this;
|
|
54775
|
-
const index = listeners.findIndex((
|
|
54802
|
+
const index = listeners.findIndex((l3) => l3.listener === listener);
|
|
54776
54803
|
if (index >= 0)
|
|
54777
54804
|
listeners.splice(index, 1);
|
|
54778
54805
|
return this;
|
|
@@ -54840,7 +54867,7 @@ var BetaMessageStream = class _BetaMessageStream {
|
|
|
54840
54867
|
}
|
|
54841
54868
|
const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event];
|
|
54842
54869
|
if (listeners) {
|
|
54843
|
-
__classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event] = listeners.filter((
|
|
54870
|
+
__classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event] = listeners.filter((l3) => !l3.once);
|
|
54844
54871
|
listeners.forEach(({ listener }) => listener(...args));
|
|
54845
54872
|
}
|
|
54846
54873
|
if (event === "abort") {
|
|
@@ -55162,7 +55189,7 @@ var BetaMessageStream = class _BetaMessageStream {
|
|
|
55162
55189
|
return stream.toReadableStream();
|
|
55163
55190
|
}
|
|
55164
55191
|
};
|
|
55165
|
-
function checkNever(
|
|
55192
|
+
function checkNever(x5) {
|
|
55166
55193
|
}
|
|
55167
55194
|
|
|
55168
55195
|
// ../../node_modules/.pnpm/@anthropic-ai+sdk@0.88.0_zod@4.4.3/node_modules/@anthropic-ai/sdk/lib/tools/ToolError.mjs
|
|
@@ -55519,7 +55546,7 @@ async function generateToolResponse(params, lastMessage = params.messages.at(-1)
|
|
|
55519
55546
|
return null;
|
|
55520
55547
|
}
|
|
55521
55548
|
const toolResults = await Promise.all(toolUseBlocks.map(async (toolUse) => {
|
|
55522
|
-
const tool = params.tools.find((
|
|
55549
|
+
const tool = params.tools.find((t3) => ("name" in t3 ? t3.name : t3.mcp_server_name) === toolUse.name);
|
|
55523
55550
|
if (!tool || !("run" in tool)) {
|
|
55524
55551
|
return {
|
|
55525
55552
|
type: "tool_result",
|
|
@@ -57050,7 +57077,7 @@ var MessageStream = class _MessageStream {
|
|
|
57050
57077
|
const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event];
|
|
57051
57078
|
if (!listeners)
|
|
57052
57079
|
return this;
|
|
57053
|
-
const index = listeners.findIndex((
|
|
57080
|
+
const index = listeners.findIndex((l3) => l3.listener === listener);
|
|
57054
57081
|
if (index >= 0)
|
|
57055
57082
|
listeners.splice(index, 1);
|
|
57056
57083
|
return this;
|
|
@@ -57118,7 +57145,7 @@ var MessageStream = class _MessageStream {
|
|
|
57118
57145
|
}
|
|
57119
57146
|
const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event];
|
|
57120
57147
|
if (listeners) {
|
|
57121
|
-
__classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] = listeners.filter((
|
|
57148
|
+
__classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] = listeners.filter((l3) => !l3.once);
|
|
57122
57149
|
listeners.forEach(({ listener }) => listener(...args));
|
|
57123
57150
|
}
|
|
57124
57151
|
if (event === "abort") {
|
|
@@ -57415,7 +57442,7 @@ var MessageStream = class _MessageStream {
|
|
|
57415
57442
|
return stream.toReadableStream();
|
|
57416
57443
|
}
|
|
57417
57444
|
};
|
|
57418
|
-
function checkNever2(
|
|
57445
|
+
function checkNever2(x5) {
|
|
57419
57446
|
}
|
|
57420
57447
|
|
|
57421
57448
|
// ../../node_modules/.pnpm/@anthropic-ai+sdk@0.88.0_zod@4.4.3/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs
|
|
@@ -58191,431 +58218,94 @@ Anthropic.Messages = Messages2;
|
|
|
58191
58218
|
Anthropic.Models = Models2;
|
|
58192
58219
|
Anthropic.Beta = Beta;
|
|
58193
58220
|
|
|
58194
|
-
// ../shared/dist/event-bus-CABu09lC.js
|
|
58195
|
-
var e4 = class {
|
|
58196
|
-
listeners = {};
|
|
58197
|
-
on(e6, t4) {
|
|
58198
|
-
let n4 = this.listeners[e6];
|
|
58199
|
-
return n4 || (n4 = /* @__PURE__ */ new Set(), this.listeners[e6] = n4), n4.add(t4), () => this.off(e6, t4);
|
|
58200
|
-
}
|
|
58201
|
-
off(e6, t4) {
|
|
58202
|
-
this.listeners[e6]?.delete(t4);
|
|
58203
|
-
}
|
|
58204
|
-
emit(e6, ...t4) {
|
|
58205
|
-
let n4 = this.listeners[e6];
|
|
58206
|
-
if (n4) for (let e7 of [...n4]) e7(...t4);
|
|
58207
|
-
}
|
|
58208
|
-
once(e6, t4) {
|
|
58209
|
-
let n4 = ((...r4) => {
|
|
58210
|
-
this.off(e6, n4), t4(...r4);
|
|
58211
|
-
});
|
|
58212
|
-
return this.on(e6, n4);
|
|
58213
|
-
}
|
|
58214
|
-
removeAllListeners(e6) {
|
|
58215
|
-
if (e6 !== void 0) delete this.listeners[e6];
|
|
58216
|
-
else for (let e7 of Object.keys(this.listeners)) delete this.listeners[e7];
|
|
58217
|
-
}
|
|
58218
|
-
listenerCount(e6) {
|
|
58219
|
-
return this.listeners[e6]?.size ?? 0;
|
|
58220
|
-
}
|
|
58221
|
-
};
|
|
58222
|
-
var t3 = class extends e4 {
|
|
58223
|
-
publish(e6) {
|
|
58224
|
-
let t4 = (e7, ...t5) => this.emit(e7, ...t5);
|
|
58225
|
-
for (let [n4, r4] of Object.entries(e6)) {
|
|
58226
|
-
let e7 = r4 ?? [];
|
|
58227
|
-
t4(n4, ...e7), t4(`*`, n4, ...e7);
|
|
58228
|
-
}
|
|
58229
|
-
}
|
|
58230
|
-
subscribe(e6, t4, n4 = false) {
|
|
58231
|
-
return n4 ? this.once(e6, t4) : this.on(e6, t4);
|
|
58232
|
-
}
|
|
58233
|
-
subscribeAll(e6) {
|
|
58234
|
-
return this.subscribe(`*`, e6);
|
|
58235
|
-
}
|
|
58236
|
-
};
|
|
58237
|
-
|
|
58238
|
-
// ../shared/dist/index.js
|
|
58239
|
-
var import_node_module2 = require("node:module");
|
|
58240
|
-
var import_pino2 = __toESM(require("/Users/aniwei/Desktop/workspaces/x-coding-agent/node_modules/.pnpm/pino@10.3.1/node_modules/pino/pino.js"), 1);
|
|
58241
|
-
var import_node_stream2 = require("node:stream");
|
|
58242
|
-
var import_mime_types2 = __toESM(require_mime_types(), 1);
|
|
58243
|
-
var import_jsonc_parser2 = require("/Users/aniwei/Desktop/workspaces/x-coding-agent/node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/umd/main.js");
|
|
58244
|
-
var import_undici2 = __toESM(require_undici(), 1);
|
|
58245
|
-
var b4 = class extends Error {
|
|
58246
|
-
code;
|
|
58247
|
-
cause;
|
|
58248
|
-
status;
|
|
58249
|
-
headers;
|
|
58250
|
-
errorType;
|
|
58251
|
-
pluginSource;
|
|
58252
|
-
constructor(e6, t4) {
|
|
58253
|
-
super(e6, { cause: t4.cause }), this.name = new.target.name, this.code = t4.code, this.cause = t4.cause, this.status = t4.status, this.headers = t4.headers, this.errorType = t4.errorType, this.pluginSource = t4.pluginSource;
|
|
58254
|
-
}
|
|
58255
|
-
};
|
|
58256
|
-
var x4 = class extends b4 {
|
|
58257
|
-
};
|
|
58258
|
-
var Ce3 = class extends b4 {
|
|
58259
|
-
};
|
|
58260
|
-
var { setPrototypeOf: Ee3 = function(e6, t4) {
|
|
58261
|
-
return e6.__proto__ = t4, e6;
|
|
58262
|
-
} } = Object;
|
|
58263
|
-
var C2 = class e5 extends Error {
|
|
58264
|
-
framesToPop = 1;
|
|
58265
|
-
name = `Invariant Violation`;
|
|
58266
|
-
constructor(t4 = `Invariant Violation`) {
|
|
58267
|
-
super(typeof t4 == `number` ? `Invariant Violation: ${t4}` : t4), Ee3(this, e5.prototype);
|
|
58268
|
-
}
|
|
58269
|
-
};
|
|
58270
|
-
function w3(e6, t4) {
|
|
58271
|
-
if (typeof e6 == `function`) w3(e6(), t4);
|
|
58272
|
-
else if (!e6) throw new C2(t4);
|
|
58273
|
-
}
|
|
58274
|
-
var De3 = /* @__PURE__ */ new Set([`trace`, `debug`, `info`, `warn`, `error`, `fatal`]);
|
|
58275
|
-
function T3(e6) {
|
|
58276
|
-
return De3.has(e6) ? e6 : `info`;
|
|
58277
|
-
}
|
|
58278
|
-
var Oe3 = (() => {
|
|
58279
|
-
try {
|
|
58280
|
-
return (0, import_node_module2.createRequire)(__otto_plugin_import_meta_url);
|
|
58281
|
-
} catch {
|
|
58282
|
-
return;
|
|
58283
|
-
}
|
|
58284
|
-
})();
|
|
58285
|
-
function ke3() {
|
|
58286
|
-
if (!Oe3) return false;
|
|
58287
|
-
try {
|
|
58288
|
-
return Oe3.resolve(`pino-pretty`), true;
|
|
58289
|
-
} catch {
|
|
58290
|
-
return false;
|
|
58291
|
-
}
|
|
58292
|
-
}
|
|
58293
|
-
function Ae3(e6) {
|
|
58294
|
-
return e6 === `stdout` ? 1 : e6 === `stderr` ? 2 : e6;
|
|
58295
|
-
}
|
|
58296
|
-
function je3() {
|
|
58297
|
-
return process.env.OTTO_LOG_STDERR === `0`;
|
|
58298
|
-
}
|
|
58299
|
-
function Me3() {
|
|
58300
|
-
return process.env.OTTO_LOG_FILE || `${process.env.HOME || process.env.USERPROFILE || `.`}/.otto/logs/otto.log`;
|
|
58301
|
-
}
|
|
58302
|
-
function Ne3(e6, t4) {
|
|
58303
|
-
let n4 = ke3(), r4 = je3(), i2 = { target: n4 ? `pino-pretty` : `pino/file`, options: n4 ? { colorize: true, destination: 2 } : { destination: 2 }, level: t4 };
|
|
58304
|
-
if (!e6 || e6 === `stdout` || e6 === `stderr`) return r4 ? [{ target: `pino/file`, options: { destination: Me3(), mkdir: true }, level: t4 }] : [i2];
|
|
58305
|
-
let a4 = { target: `pino/file`, options: { destination: Ae3(e6), mkdir: true }, level: t4 };
|
|
58306
|
-
return r4 ? [a4] : [a4, i2];
|
|
58307
|
-
}
|
|
58308
|
-
var E4 = new import_node_stream2.PassThrough();
|
|
58309
|
-
var D3 = new t3();
|
|
58310
|
-
E4.on(`data`, (e6) => {
|
|
58311
|
-
try {
|
|
58312
|
-
D3.publish({ log: [JSON.parse(e6.toString())] });
|
|
58313
|
-
} catch (t4) {
|
|
58314
|
-
console.warn(`Failed to parse log chunk for listener:`, e6.toString(), t4);
|
|
58315
|
-
}
|
|
58316
|
-
});
|
|
58317
|
-
var O3 = null;
|
|
58318
|
-
var k4 = T3(oe);
|
|
58319
|
-
var Fe3 = /* @__PURE__ */ new Set();
|
|
58320
|
-
var A3 = null;
|
|
58321
|
-
function Re3(e6, t4) {
|
|
58322
|
-
return { write(n4) {
|
|
58323
|
-
A3 ??= import_pino2.default.transport({ targets: Ne3(e6, t4) }), A3.write(n4);
|
|
58324
|
-
} };
|
|
58325
|
-
}
|
|
58326
|
-
function ze3(e6, t4) {
|
|
58327
|
-
return O3 ??= (0, import_pino2.default)({ level: e6 }, import_pino2.default.multistream([{ level: e6, stream: E4 }, { level: e6, stream: Re3(t4, e6) }])), k4 = T3(O3.level), O3;
|
|
58328
|
-
}
|
|
58329
|
-
function Be3(e6, t4) {
|
|
58330
|
-
ze3(t4?.level ?? T3(oe), t4?.destination ?? X), w3(O3, `Root logger is not initialized`);
|
|
58331
|
-
let n4 = O3.child({ name: e6 }, { level: t4?.level ?? k4 });
|
|
58332
|
-
return Fe3.add(n4), n4;
|
|
58333
|
-
}
|
|
58334
|
-
var j4 = 10 * 1024 * 1024;
|
|
58335
|
-
var I3;
|
|
58336
|
-
function L3(e6) {
|
|
58337
|
-
let t4 = e6 || I3;
|
|
58338
|
-
if (t4) try {
|
|
58339
|
-
return new import_undici2.ProxyAgent({ uri: t4 });
|
|
58340
|
-
} catch {
|
|
58341
|
-
return;
|
|
58342
|
-
}
|
|
58343
|
-
}
|
|
58344
|
-
async function* gt2(e6) {
|
|
58345
|
-
let { url: t4, method: n4 = `POST`, headers: r4 = {}, body: i2, timeout: a4 = 3e5, idleTimeout: o4 = 12e4, signal: s4 } = e6, c2 = new AbortController(), l4 = s4 ? AbortSignal.any([s4, c2.signal]) : c2.signal, u3 = setTimeout(() => c2.abort(), a4), d, f = () => {
|
|
58346
|
-
d && clearTimeout(d), d = setTimeout(() => c2.abort(), o4);
|
|
58347
|
-
}, p;
|
|
58348
|
-
try {
|
|
58349
|
-
let a5 = L3(e6.proxy), o5 = { method: n4, headers: { "content-type": `application/json`, accept: `text/event-stream`, ...r4 }, body: i2 ? typeof i2 == `string` ? i2 : JSON.stringify(i2) : void 0, signal: l4 }, s5 = await fetch(t4, a5 ? { ...o5, dispatcher: a5 } : o5);
|
|
58350
|
-
if (!s5.ok) {
|
|
58351
|
-
let e7 = await s5.text(), t5 = `BAD_RESPONSE`;
|
|
58352
|
-
s5.status === 429 ? t5 = `RATE_LIMIT` : s5.status === 529 ? t5 = `OVERLOADED` : s5.status >= 500 ? t5 = `SERVER_ERROR` : s5.status >= 400 && (t5 = `REQUEST_ERROR`);
|
|
58353
|
-
let n5;
|
|
58354
|
-
try {
|
|
58355
|
-
let t6 = JSON.parse(e7)?.error;
|
|
58356
|
-
n5 = t6?.code ?? t6?.type;
|
|
58357
|
-
} catch {
|
|
58358
|
-
}
|
|
58359
|
-
throw new x4(`Http request failed ${s5.status}: ${e7}`, { code: t5, status: s5.status, headers: s5.headers, errorType: n5 });
|
|
58360
|
-
}
|
|
58361
|
-
if (e6.onResponse?.(s5.headers), !s5.body) throw new x4(`Response body is empty`, { code: `BAD_RESPONSE` });
|
|
58362
|
-
p = s5.body.getReader();
|
|
58363
|
-
let c3 = new TextDecoder(), u4 = [], d2 = createParser({ onEvent(e7) {
|
|
58364
|
-
u4.push({ event: e7.event || void 0, data: e7.data, id: e7.id || void 0 });
|
|
58365
|
-
} });
|
|
58366
|
-
for (f(); ; ) {
|
|
58367
|
-
let { done: e7, value: t5 } = await p.read();
|
|
58368
|
-
if (e7) break;
|
|
58369
|
-
for (f(), d2.feed(c3.decode(t5, { stream: true })); u4.length > 0; ) {
|
|
58370
|
-
let e8 = u4.shift();
|
|
58371
|
-
e8 && (yield e8);
|
|
58372
|
-
}
|
|
58373
|
-
}
|
|
58374
|
-
for (d2.feed(c3.decode()); u4.length > 0; ) {
|
|
58375
|
-
let e7 = u4.shift();
|
|
58376
|
-
e7 && (yield e7);
|
|
58377
|
-
}
|
|
58378
|
-
} catch (e7) {
|
|
58379
|
-
throw e7 instanceof x4 ? e7 : e7 instanceof DOMException && e7.name === `AbortError` ? new x4(`Stream aborted or timed out`, { code: `TIMEOUT`, cause: e7 }) : new x4(`Stream request failed`, { code: `NETWORK_ERROR`, cause: e7 instanceof Error ? e7 : Error(String(e7)) });
|
|
58380
|
-
} finally {
|
|
58381
|
-
clearTimeout(u3), d && clearTimeout(d), p && p.cancel().catch(() => {
|
|
58382
|
-
});
|
|
58383
|
-
}
|
|
58384
|
-
}
|
|
58385
|
-
function _t(e6, t4) {
|
|
58386
|
-
if (e6 == null) return;
|
|
58387
|
-
if (typeof e6.get == `function`) return e6.get(t4) ?? void 0;
|
|
58388
|
-
let n4 = e6;
|
|
58389
|
-
for (let e7 of Object.keys(n4)) if (e7.toLowerCase() === t4) {
|
|
58390
|
-
let t5 = n4[e7];
|
|
58391
|
-
return typeof t5 == `string` ? t5 : void 0;
|
|
58392
|
-
}
|
|
58393
|
-
}
|
|
58394
|
-
var z5 = { Bash: `bash`, Read: `read`, Write: `write`, Edit: `edit`, MultiEdit: `edit`, Grep: `grep`, Glob: `find`, WebFetch: `web_fetch`, WebSearch: `web_search`, Task: `task_delegate`, TodoWrite: `write_todos` };
|
|
58395
|
-
var St2 = Object.fromEntries(Object.entries(z5).reverse().map(([e6, t4]) => [t4, e6]));
|
|
58396
|
-
function Ot2() {
|
|
58397
|
-
return `<span class="otto-wordmark">OTTO</span>`;
|
|
58398
|
-
}
|
|
58399
|
-
function kt2() {
|
|
58400
|
-
return `<svg viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
58401
|
-
<circle cx="26" cy="26" r="24" fill="var(--gray-3)" stroke="var(--gray-5)" stroke-width="2"/>
|
|
58402
|
-
<path d="M15.5 27l7 6.5 14-15" stroke="var(--gray-12)" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round"/>
|
|
58403
|
-
</svg>`;
|
|
58404
|
-
}
|
|
58405
|
-
function At3() {
|
|
58406
|
-
return `<svg viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
58407
|
-
<circle cx="26" cy="26" r="24" fill="var(--gray-3)" stroke="var(--gray-5)" stroke-width="2"/>
|
|
58408
|
-
<path d="M19 19l14 14M33 19l-14 14" stroke="var(--gray-9)" stroke-width="2.8" stroke-linecap="round"/>
|
|
58409
|
-
</svg>`;
|
|
58410
|
-
}
|
|
58411
|
-
function U3(e6) {
|
|
58412
|
-
return e6.replace(/[&<>"']/g, (e7) => ({ "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'` })[e7] ?? e7);
|
|
58413
|
-
}
|
|
58414
|
-
function jt2(e6, t4, n4, r4) {
|
|
58415
|
-
let i2 = e6 === `success` ? kt2() : At3();
|
|
58416
|
-
return `<!doctype html>
|
|
58417
|
-
<html lang="en">
|
|
58418
|
-
<head>
|
|
58419
|
-
<meta charset="utf-8">
|
|
58420
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
58421
|
-
<title>${U3(t4)}</title>
|
|
58422
|
-
<style>
|
|
58423
|
-
:root {
|
|
58424
|
-
--gray-1:#FFFFFF;--gray-2:#F5F6FA;--gray-3:#EEF0F9;
|
|
58425
|
-
--gray-5:#DBDDEB;--gray-7:#AEB2C8;--gray-9:#7A7EA0;
|
|
58426
|
-
--gray-11:#565A78;--gray-12:#12152B;
|
|
58427
|
-
--radius-xl:24px;
|
|
58428
|
-
--shadow-card:0 1px 2px rgba(18,21,43,.04),0 8px 24px rgba(18,21,43,.06);
|
|
58429
|
-
--hairline:.75px;
|
|
58430
|
-
--pixel:"Silkscreen","Press Start 2P","Pixelify Sans","SF Mono",monospace;
|
|
58431
|
-
}
|
|
58432
|
-
|
|
58433
|
-
@media (prefers-color-scheme:dark) {
|
|
58434
|
-
:root:not([data-theme=light]) {
|
|
58435
|
-
--gray-1:#191F39;--gray-2:#111529;--gray-3:rgba(255,255,255,.08);
|
|
58436
|
-
--gray-5:rgba(255,255,255,.11);--gray-7:rgba(255,255,255,.18);
|
|
58437
|
-
--gray-9:rgba(255,255,255,.34);--gray-11:#AAB2CC;--gray-12:#F4F6FF;
|
|
58438
|
-
--shadow-card:0 1px 2px rgba(0,0,0,.14),0 8px 24px rgba(0,0,0,.22);
|
|
58439
|
-
}
|
|
58440
|
-
}
|
|
58441
|
-
|
|
58442
|
-
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
|
|
58443
|
-
body{
|
|
58444
|
-
min-height:100dvh;display:grid;place-items:center;padding:32px;
|
|
58445
|
-
background:var(--gray-2);-webkit-font-smoothing:antialiased;
|
|
58446
|
-
}
|
|
58447
|
-
|
|
58448
|
-
.page{width:min(440px,100%);text-align:center}
|
|
58449
|
-
|
|
58450
|
-
.otto-wordmark{font-family:var(--pixel);font-size:28px;font-weight:700;letter-spacing:.04em;color:var(--gray-12);margin-bottom:28px}
|
|
58451
|
-
|
|
58452
|
-
.card{
|
|
58453
|
-
padding:36px 40px;border-radius:var(--radius-xl);
|
|
58454
|
-
border:var(--hairline) solid var(--gray-3);background:var(--gray-1);
|
|
58455
|
-
box-shadow:var(--shadow-card);
|
|
58456
|
-
}
|
|
58457
|
-
|
|
58458
|
-
.status-icon{display:inline-block;margin-bottom:22px}
|
|
58459
|
-
.status-icon svg{width:52px;height:52px}
|
|
58460
|
-
|
|
58461
|
-
.card *{font-family:var(--pixel)}
|
|
58462
|
-
.kicker{
|
|
58463
|
-
font-size:11px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;
|
|
58464
|
-
color:var(--gray-7);margin-bottom:10px;
|
|
58465
|
-
}
|
|
58466
|
-
h1{font-size:22px;font-weight:700;line-height:1.3;letter-spacing:.02em;color:var(--gray-12)}
|
|
58467
|
-
.desc{
|
|
58468
|
-
margin-top:14px;font-size:13px;line-height:1.7;color:var(--gray-11);
|
|
58469
|
-
max-width:300px;margin-left:auto;margin-right:auto;
|
|
58470
|
-
}
|
|
58471
|
-
.separator{
|
|
58472
|
-
width:60px;height:2px;margin:24px auto 20px;background:var(--gray-3)
|
|
58473
|
-
}
|
|
58474
|
-
.footer{
|
|
58475
|
-
font-size:11px;color:var(--gray-7);font-weight:600;letter-spacing:.06em;
|
|
58476
|
-
text-transform:uppercase;
|
|
58477
|
-
}
|
|
58478
|
-
</style>
|
|
58479
|
-
</head>
|
|
58480
|
-
<body>
|
|
58481
|
-
<main class="page" aria-labelledby="title">
|
|
58482
|
-
${Ot2()}
|
|
58483
|
-
<section class="card">
|
|
58484
|
-
<div class="status-icon">${i2}</div>
|
|
58485
|
-
<p class="kicker">${e6 === `success` ? `Authentication` : `Error`}</p>
|
|
58486
|
-
<h1 id="title">${U3(t4)}</h1>
|
|
58487
|
-
<p class="desc">${U3(n4)}</p>
|
|
58488
|
-
<div class="separator"></div>
|
|
58489
|
-
<p class="footer">${U3(r4)}</p>
|
|
58490
|
-
</section>
|
|
58491
|
-
</main>
|
|
58492
|
-
</body>
|
|
58493
|
-
</html>`;
|
|
58494
|
-
}
|
|
58495
|
-
var Mt2 = jt2(`success`, `Login complete`, `You can close this window and return to the terminal.`, `Otto Auth`);
|
|
58496
|
-
var Ht2 = 5 * 1024 * 1024;
|
|
58497
|
-
var Ut2 = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]);
|
|
58498
|
-
var Wt2 = Buffer.from(`GIF8`, `ascii`);
|
|
58499
|
-
var K3 = process.env.OTTO_STARTUP_TRACE === `1`;
|
|
58500
|
-
var en2 = K3 ? performance.now() : 0;
|
|
58501
|
-
var Y2 = Be3(`@x-otto/shared:file-lock`);
|
|
58502
|
-
|
|
58503
|
-
// ../interchange/dist/index.js
|
|
58504
|
-
var a3 = /^data:([^;,]*)(?:;[^,]*)?,(.*)$/s;
|
|
58505
|
-
function o3(e6, t4) {
|
|
58506
|
-
let n4 = a3.exec(e6), r4 = (n4 ? n4[2] ?? `` : e6).replace(/\s+/g, ``);
|
|
58507
|
-
return { base64: r4, mediaType: ((n4 ? n4[1] : ``) || t4 || ``).toLowerCase(), valid: s3(r4) };
|
|
58508
|
-
}
|
|
58509
|
-
function s3(e6) {
|
|
58510
|
-
return e6.length === 0 || e6 === `undefined` || e6.length % 4 == 1 ? false : /^[A-Za-z0-9+/]*={0,2}$/.test(e6);
|
|
58511
|
-
}
|
|
58512
|
-
function c(e6, t4) {
|
|
58513
|
-
switch (e6.toLowerCase()) {
|
|
58514
|
-
case `image/jpeg`:
|
|
58515
|
-
case `image/jpg`:
|
|
58516
|
-
return `image/jpeg`;
|
|
58517
|
-
case `image/png`:
|
|
58518
|
-
return `image/png`;
|
|
58519
|
-
case `image/gif`:
|
|
58520
|
-
return `image/gif`;
|
|
58521
|
-
case `image/webp`:
|
|
58522
|
-
return `image/webp`;
|
|
58523
|
-
default:
|
|
58524
|
-
return l3(t4);
|
|
58525
|
-
}
|
|
58526
|
-
}
|
|
58527
|
-
function l3(e6) {
|
|
58528
|
-
return e6.startsWith(`/9j/`) ? `image/jpeg` : e6.startsWith(`iVBOR`) ? `image/png` : e6.startsWith(`R0lGOD`) ? `image/gif` : e6.startsWith(`UklGR`) ? `image/webp` : `image/png`;
|
|
58529
|
-
}
|
|
58530
|
-
|
|
58531
58221
|
// ../provider/dist/index.js
|
|
58532
58222
|
var h = Be(`@x-otto/provider:tool-roundtrip`);
|
|
58533
|
-
function g(
|
|
58534
|
-
let
|
|
58535
|
-
for (let
|
|
58536
|
-
|
|
58223
|
+
function g(e4) {
|
|
58224
|
+
let t3 = [], n3 = [], r3 = () => {
|
|
58225
|
+
for (let e5 of n3) h.warn({ toolCallId: e5.id, toolName: e5.name }, `Synthesizing placeholder for unanswered tool_call`), t3.push(_(e5));
|
|
58226
|
+
n3 = [];
|
|
58537
58227
|
};
|
|
58538
|
-
for (let i2 of
|
|
58228
|
+
for (let i2 of e4) {
|
|
58539
58229
|
if (i2.role === `tool_result`) {
|
|
58540
|
-
let
|
|
58541
|
-
if (
|
|
58230
|
+
let e5 = n3.findIndex((e6) => e6.id === i2.toolCallId);
|
|
58231
|
+
if (e5 === -1) {
|
|
58542
58232
|
h.warn({ toolCallId: i2.toolCallId, toolName: i2.toolName }, `Dropping orphan tool_result with no preceding tool_call`);
|
|
58543
58233
|
continue;
|
|
58544
58234
|
}
|
|
58545
|
-
|
|
58235
|
+
n3.splice(e5, 1), t3.push(i2);
|
|
58546
58236
|
continue;
|
|
58547
58237
|
}
|
|
58548
|
-
|
|
58238
|
+
r3(), t3.push(i2), i2.role === `assistant` && (n3 = i2.content.filter((e5) => e5.type === `tool_call`));
|
|
58549
58239
|
}
|
|
58550
|
-
return
|
|
58240
|
+
return r3(), t3;
|
|
58551
58241
|
}
|
|
58552
|
-
function _(
|
|
58553
|
-
return { role: `tool_result`, toolCallId:
|
|
58242
|
+
function _(e4) {
|
|
58243
|
+
return { role: `tool_result`, toolCallId: e4.id, toolName: e4.name, content: [{ type: `text`, text: `[tool result unavailable]` }], details: void 0, isError: true, timestamp: 0 };
|
|
58554
58244
|
}
|
|
58555
|
-
function v(
|
|
58556
|
-
return `[System notification] ${
|
|
58245
|
+
function v(e4) {
|
|
58246
|
+
return `[System notification] ${e4}`;
|
|
58557
58247
|
}
|
|
58558
|
-
function y(
|
|
58559
|
-
let
|
|
58560
|
-
for (let
|
|
58561
|
-
let
|
|
58562
|
-
if (
|
|
58563
|
-
|
|
58564
|
-
${
|
|
58248
|
+
function y(e4) {
|
|
58249
|
+
let t3 = [];
|
|
58250
|
+
for (let n3 of e4) {
|
|
58251
|
+
let e5 = t3.at(-1);
|
|
58252
|
+
if (n3.role === `system_notification` && e5?.role === `system_notification`) {
|
|
58253
|
+
t3[t3.length - 1] = { ...e5, content: `${e5.content}
|
|
58254
|
+
${n3.content}`, isError: e5.isError || n3.isError };
|
|
58565
58255
|
continue;
|
|
58566
58256
|
}
|
|
58567
|
-
|
|
58257
|
+
t3.push(n3);
|
|
58568
58258
|
}
|
|
58569
|
-
return
|
|
58259
|
+
return t3;
|
|
58570
58260
|
}
|
|
58571
|
-
function
|
|
58572
|
-
for (let
|
|
58573
|
-
let
|
|
58574
|
-
if (
|
|
58575
|
-
let
|
|
58576
|
-
|
|
58577
|
-
let i2 =
|
|
58578
|
-
i2 === void 0 || i2.role === `assistant` || h.warn({ index:
|
|
58261
|
+
function b4(e4) {
|
|
58262
|
+
for (let t3 = 0; t3 < e4.length; t3++) {
|
|
58263
|
+
let n3 = e4[t3];
|
|
58264
|
+
if (n3.role !== `system_notification`) continue;
|
|
58265
|
+
let r3 = t3 > 0 ? e4[t3 - 1] : void 0;
|
|
58266
|
+
r3 !== void 0 && (r3.role === `tool_result` || r3.role === `assistant`) || h.warn({ index: t3, relatedToolCallId: n3.relatedToolCallId, precedingRole: r3?.role ?? `(start of array)` }, `system_notification message does not immediately follow a tool_result/assistant turn (Anthropic placement rule violation risk) \u2014 sending anyway, provider may reject`);
|
|
58267
|
+
let i2 = t3 + 1 < e4.length ? e4[t3 + 1] : void 0;
|
|
58268
|
+
i2 === void 0 || i2.role === `assistant` || h.warn({ index: t3, relatedToolCallId: n3.relatedToolCallId, followingRole: i2?.role }, `system_notification message is not the last entry and is not immediately followed by an assistant turn (Anthropic placement rule violation risk) \u2014 sending anyway, provider may reject`);
|
|
58579
58269
|
}
|
|
58580
58270
|
}
|
|
58581
|
-
function
|
|
58582
|
-
return
|
|
58271
|
+
function x4(e4) {
|
|
58272
|
+
return e4.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, `\uFFFD`);
|
|
58583
58273
|
}
|
|
58584
|
-
function ee(
|
|
58585
|
-
return
|
|
58274
|
+
function ee(e4) {
|
|
58275
|
+
return e4.toJSONSchema?.() ?? {};
|
|
58586
58276
|
}
|
|
58587
58277
|
var S3 = [`low`, `medium`, `high`, `xhigh`, `max`];
|
|
58588
|
-
function
|
|
58589
|
-
if (!
|
|
58590
|
-
let
|
|
58591
|
-
for (let
|
|
58278
|
+
function C2(e4, t3) {
|
|
58279
|
+
if (!t3 || t3.length === 0 || t3.includes(e4)) return e4;
|
|
58280
|
+
let n3 = S3.indexOf(e4), r3 = [...t3].sort((e5, t4) => S3.indexOf(e5) - S3.indexOf(t4)), i2;
|
|
58281
|
+
for (let e5 of r3) if (S3.indexOf(e5) <= n3) i2 = e5;
|
|
58592
58282
|
else break;
|
|
58593
|
-
return i2 ??
|
|
58283
|
+
return i2 ?? r3[0];
|
|
58594
58284
|
}
|
|
58595
|
-
function
|
|
58596
|
-
for (let
|
|
58285
|
+
function te2(e4) {
|
|
58286
|
+
for (let t3 of e4) if (t3.role === `tool_result` || t3.role === `assistant` && t3.content.some((e5) => e5.type === `tool_call`)) return true;
|
|
58597
58287
|
return false;
|
|
58598
58288
|
}
|
|
58599
|
-
function
|
|
58600
|
-
let
|
|
58601
|
-
|
|
58602
|
-
for (let
|
|
58603
|
-
if (
|
|
58604
|
-
if (
|
|
58605
|
-
let { base64:
|
|
58606
|
-
return i2 ? { type: `image_url`, image_url: { url: `data:${
|
|
58289
|
+
function w3(t3) {
|
|
58290
|
+
let n3 = [];
|
|
58291
|
+
t3.systemPrompt && n3.push({ role: `system`, content: x4(t3.systemPrompt) });
|
|
58292
|
+
for (let r3 of g(t3.messages)) if (r3.role === `user`) typeof r3.content == `string` ? n3.push({ role: `user`, content: x4(r3.content) }) : n3.push({ role: `user`, content: r3.content.map((t4) => {
|
|
58293
|
+
if (t4.type === `text`) return { type: `text`, text: x4(t4.text) };
|
|
58294
|
+
if (t4.type === `image`) {
|
|
58295
|
+
let { base64: n4, mediaType: r4, valid: i2 } = o2(t4.source, t4.mime);
|
|
58296
|
+
return i2 ? { type: `image_url`, image_url: { url: `data:${r4 || `image/png`};base64,${n4}` } } : { type: `text`, text: `[image omitted: corrupted or empty data]` };
|
|
58607
58297
|
}
|
|
58608
58298
|
return { type: `text`, text: `[unsupported]` };
|
|
58609
58299
|
}) });
|
|
58610
|
-
else if (
|
|
58611
|
-
let
|
|
58612
|
-
if (!
|
|
58613
|
-
|
|
58614
|
-
} else
|
|
58615
|
-
return
|
|
58616
|
-
}
|
|
58617
|
-
function ne(
|
|
58618
|
-
switch (
|
|
58300
|
+
else if (r3.role === `assistant`) {
|
|
58301
|
+
let e4 = r3.content.filter((e5) => e5.type === `tool_call`).map((e5) => ({ id: e5.id, type: `function`, function: { name: e5.name, arguments: JSON.stringify(e5.arguments) } })), t4 = r3.content.filter((e5) => e5.type === `text`).filter((e5) => e5.text.trim().length > 0).map((e5) => x4(e5.text)).join(``);
|
|
58302
|
+
if (!t4 && e4.length === 0) continue;
|
|
58303
|
+
n3.push({ role: `assistant`, content: t4 || null, ...e4.length > 0 ? { tool_calls: e4 } : {} });
|
|
58304
|
+
} else r3.role === `tool_result` ? n3.push({ role: `tool`, tool_call_id: r3.toolCallId, content: x4(r3.content.map((e4) => e4.type === `text` ? e4.text : ``).join(``)) }) : r3.role === `system_notification` && n3.push({ role: `user`, content: x4(v(r3.content)) });
|
|
58305
|
+
return n3;
|
|
58306
|
+
}
|
|
58307
|
+
function ne(e4) {
|
|
58308
|
+
switch (e4) {
|
|
58619
58309
|
case `low`:
|
|
58620
58310
|
case `medium`:
|
|
58621
58311
|
case `high`:
|
|
@@ -58627,100 +58317,100 @@ function ne(e6) {
|
|
|
58627
58317
|
return `high`;
|
|
58628
58318
|
}
|
|
58629
58319
|
}
|
|
58630
|
-
function re(
|
|
58631
|
-
let
|
|
58632
|
-
return
|
|
58633
|
-
}
|
|
58634
|
-
var
|
|
58635
|
-
function ie2(
|
|
58636
|
-
let
|
|
58637
|
-
let
|
|
58638
|
-
if (
|
|
58639
|
-
let
|
|
58640
|
-
return Number.isFinite(
|
|
58641
|
-
},
|
|
58642
|
-
let
|
|
58643
|
-
if (!
|
|
58644
|
-
let
|
|
58645
|
-
if (!
|
|
58646
|
-
let i2 = Number(
|
|
58647
|
-
if (
|
|
58648
|
-
if (
|
|
58649
|
-
if (
|
|
58650
|
-
},
|
|
58651
|
-
if (!Object.values(
|
|
58652
|
-
}
|
|
58653
|
-
function
|
|
58654
|
-
if (!
|
|
58655
|
-
let
|
|
58656
|
-
if (
|
|
58657
|
-
let
|
|
58658
|
-
|
|
58659
|
-
let
|
|
58660
|
-
|
|
58661
|
-
}),
|
|
58662
|
-
%s`,
|
|
58320
|
+
function re(e4, t3, n3 = {}) {
|
|
58321
|
+
let r3 = { model: n3.modelName ?? e4.name, messages: w3(t3), max_tokens: t3.maxTokens ?? e4.maxOutputTokens, stream: true, stream_options: { include_usage: true } };
|
|
58322
|
+
return t3.temperature !== void 0 && !e4.reasoning && (r3.temperature = t3.temperature), e4.reasoning && t3.thinkingLevel && (r3.reasoning_effort = ne(C2(t3.thinkingLevel, e4.thinkingLevels))), t3.tools && t3.tools.length > 0 ? r3.tools = t3.tools.map((e5) => ({ type: `function`, function: { name: e5.name, description: e5.description, parameters: ee(e5.parameters) } })) : te2(t3.messages) && (r3.tools = []), r3;
|
|
58323
|
+
}
|
|
58324
|
+
var T3 = Be(`@x-otto/provider:openai-usage`);
|
|
58325
|
+
function ie2(e4) {
|
|
58326
|
+
let t3 = (t4) => {
|
|
58327
|
+
let n4 = e4.get(t4);
|
|
58328
|
+
if (n4 === null) return;
|
|
58329
|
+
let r4 = Number(n4);
|
|
58330
|
+
return Number.isFinite(r4) ? r4 : void 0;
|
|
58331
|
+
}, n3 = (t4) => {
|
|
58332
|
+
let n4 = e4.get(t4);
|
|
58333
|
+
if (!n4) return;
|
|
58334
|
+
let r4 = n4.match(/^(\d+(?:\.\d+)?)(m|s|ms)$/);
|
|
58335
|
+
if (!r4) return;
|
|
58336
|
+
let i2 = Number(r4[1]), a3 = r4[2];
|
|
58337
|
+
if (a3 === `ms`) return i2;
|
|
58338
|
+
if (a3 === `s`) return i2 * 1e3;
|
|
58339
|
+
if (a3 === `m`) return i2 * 60 * 1e3;
|
|
58340
|
+
}, r3 = { remainingRequests: t3(`x-ratelimit-remaining-requests`), remainingTokens: t3(`x-ratelimit-remaining-tokens`), limitRequests: t3(`x-ratelimit-limit-requests`), limitTokens: t3(`x-ratelimit-limit-tokens`), resetRequestsMs: n3(`x-ratelimit-reset-requests`), resetTokensMs: n3(`x-ratelimit-reset-tokens`) };
|
|
58341
|
+
if (!Object.values(r3).every((e5) => e5 === void 0)) return r3;
|
|
58342
|
+
}
|
|
58343
|
+
function E4(e4) {
|
|
58344
|
+
if (!e4) return null;
|
|
58345
|
+
let t3 = ie2(e4);
|
|
58346
|
+
if (T3.isLevelEnabled(`trace`)) {
|
|
58347
|
+
let t4 = [];
|
|
58348
|
+
e4.forEach((e5, n3) => {
|
|
58349
|
+
let r3 = n3.startsWith(`x-ratelimit-`) || e5.length < 40 ? e5 : e5.slice(0, 20) + `\u2026`;
|
|
58350
|
+
t4.push(` ${n3}: ${r3}`);
|
|
58351
|
+
}), T3.trace(`OpenAI Codex response headers (%d):
|
|
58352
|
+
%s`, t4.length, t4.sort().join(`
|
|
58663
58353
|
`));
|
|
58664
58354
|
}
|
|
58665
|
-
return
|
|
58355
|
+
return t3 ? { status: `unknown`, standardLimits: t3 } : null;
|
|
58666
58356
|
}
|
|
58667
|
-
var
|
|
58668
|
-
function
|
|
58357
|
+
var oe3 = Be(`@x-otto/provider:stream-state`);
|
|
58358
|
+
function D3() {
|
|
58669
58359
|
return { inputTokens: 0, outputTokens: 0, cacheReadTokens: 0, cacheWriteTokens: 0 };
|
|
58670
58360
|
}
|
|
58671
|
-
function
|
|
58361
|
+
function O3(e4, t3) {
|
|
58672
58362
|
try {
|
|
58673
|
-
return { args: JSON.parse(
|
|
58363
|
+
return { args: JSON.parse(e4), parseFailed: false };
|
|
58674
58364
|
} catch {
|
|
58675
|
-
return
|
|
58676
|
-
}
|
|
58677
|
-
}
|
|
58678
|
-
function ce2(
|
|
58679
|
-
return new Set(
|
|
58680
|
-
}
|
|
58681
|
-
function
|
|
58682
|
-
let { args:
|
|
58683
|
-
return { type: `tool_call`, id:
|
|
58684
|
-
}
|
|
58685
|
-
function
|
|
58686
|
-
if (
|
|
58687
|
-
let
|
|
58688
|
-
if (
|
|
58689
|
-
let
|
|
58690
|
-
if (!i2) return
|
|
58691
|
-
let
|
|
58692
|
-
return
|
|
58693
|
-
}
|
|
58694
|
-
var
|
|
58695
|
-
var
|
|
58696
|
-
function M3(
|
|
58697
|
-
let
|
|
58698
|
-
if (!
|
|
58699
|
-
let i2 =
|
|
58700
|
-
if (!
|
|
58701
|
-
let
|
|
58702
|
-
for (
|
|
58703
|
-
return { name: i2, argumentsJson: JSON.stringify(
|
|
58365
|
+
return oe3.debug({ toolName: t3 }, `Failed to parse tool arguments JSON`), { args: {}, parseFailed: true };
|
|
58366
|
+
}
|
|
58367
|
+
}
|
|
58368
|
+
function ce2(e4) {
|
|
58369
|
+
return new Set(e4?.map((e5) => e5.name) ?? []);
|
|
58370
|
+
}
|
|
58371
|
+
function k4(e4, t3, n3) {
|
|
58372
|
+
let { args: r3, parseFailed: i2 } = O3(n3, t3);
|
|
58373
|
+
return { type: `tool_call`, id: e4, name: t3, arguments: r3, ...i2 ? { argumentsParseFailed: true } : {} };
|
|
58374
|
+
}
|
|
58375
|
+
function A3(e4, t3) {
|
|
58376
|
+
if (e4.content.some((e5) => e5.type === `tool_call`)) return e4;
|
|
58377
|
+
let n3 = e4.content.findLastIndex((e5) => e5.type === `text`);
|
|
58378
|
+
if (n3 < 0) return e4;
|
|
58379
|
+
let r3 = e4.content[n3], i2 = M3(r3.text, t3);
|
|
58380
|
+
if (!i2) return e4;
|
|
58381
|
+
let a3 = [...e4.content], o3 = r3.text.slice(0, i2.matchStart).trimEnd();
|
|
58382
|
+
return o3.length > 0 ? a3[n3] = { ...r3, text: o3 } : a3.splice(n3, 1), a3.push(k4(`recovered_${n3}`, i2.name, i2.argumentsJson)), { ...e4, content: a3 };
|
|
58383
|
+
}
|
|
58384
|
+
var le3 = /<invoke name="([^"]+)">((?:(?!<invoke name=")[\s\S])*?)<\/invoke>\s*$/;
|
|
58385
|
+
var j4 = /<parameter name="([^"]+)">([\s\S]*?)<\/parameter>/g;
|
|
58386
|
+
function M3(e4, t3) {
|
|
58387
|
+
let n3 = e4.trimEnd(), r3 = le3.exec(n3);
|
|
58388
|
+
if (!r3) return null;
|
|
58389
|
+
let i2 = r3[1];
|
|
58390
|
+
if (!t3.has(i2)) return null;
|
|
58391
|
+
let a3 = {}, o3 = r3[2], s3;
|
|
58392
|
+
for (j4.lastIndex = 0; (s3 = j4.exec(o3)) !== null; ) a3[s3[1]] = s3[2];
|
|
58393
|
+
return { name: i2, argumentsJson: JSON.stringify(a3), matchStart: r3.index };
|
|
58704
58394
|
}
|
|
58705
58395
|
function N2() {
|
|
58706
|
-
return { ...
|
|
58396
|
+
return { ...D3(), textContent: ``, thinkingText: ``, toolCalls: /* @__PURE__ */ new Map(), stopReason: `end_turn` };
|
|
58707
58397
|
}
|
|
58708
|
-
function P3(
|
|
58709
|
-
let
|
|
58710
|
-
if (
|
|
58711
|
-
return
|
|
58398
|
+
function P3(e4, t3 = true) {
|
|
58399
|
+
let n3 = [];
|
|
58400
|
+
if (e4.thinkingText && n3.push({ type: `thinking`, text: e4.thinkingText }), e4.textContent && n3.push({ type: `text`, text: e4.textContent }), t3) for (let [, t4] of e4.toolCalls) n3.push(k4(t4.id, t4.name, t4.argumentsJson));
|
|
58401
|
+
return n3;
|
|
58712
58402
|
}
|
|
58713
|
-
function
|
|
58714
|
-
let
|
|
58715
|
-
for (let [,
|
|
58716
|
-
return
|
|
58403
|
+
function de2(e4, t3 = true) {
|
|
58404
|
+
let n3 = [], r3 = [...e4.entries()].sort(([e5], [t4]) => e5 - t4);
|
|
58405
|
+
for (let [, e5] of r3) e5.kind === `thinking` ? e5.text && n3.push({ type: `thinking`, text: e5.text, ...e5.signature === void 0 ? {} : { signature: e5.signature } }) : e5.kind === `text` ? e5.text && n3.push({ type: `text`, text: e5.text }) : t3 && n3.push(k4(e5.id, e5.name, e5.argumentsJson));
|
|
58406
|
+
return n3;
|
|
58717
58407
|
}
|
|
58718
|
-
function F2(
|
|
58719
|
-
return { role: `assistant`, content:
|
|
58408
|
+
function F2(e4, t3, n3, r3) {
|
|
58409
|
+
return { role: `assistant`, content: t3, api: e4.api, provider: e4.provider, model: e4.model, usage: { inputTokens: n3.inputTokens, outputTokens: n3.outputTokens, cacheReadTokens: n3.cacheReadTokens, cacheWriteTokens: n3.cacheWriteTokens }, stopReason: r3 };
|
|
58720
58410
|
}
|
|
58721
|
-
var
|
|
58722
|
-
function
|
|
58723
|
-
switch (
|
|
58411
|
+
var fe2 = Be(`@x-otto/provider:chat-completions-stream`);
|
|
58412
|
+
function I3(e4) {
|
|
58413
|
+
switch (e4) {
|
|
58724
58414
|
case `stop`:
|
|
58725
58415
|
return `end_turn`;
|
|
58726
58416
|
case `length`:
|
|
@@ -58730,68 +58420,68 @@ function I4(e6) {
|
|
|
58730
58420
|
case `content_filter`:
|
|
58731
58421
|
return `refusal`;
|
|
58732
58422
|
default:
|
|
58733
|
-
return
|
|
58423
|
+
return fe2.warn(`Unknown chat-completions finish_reason: ${e4}`), `end_turn`;
|
|
58734
58424
|
}
|
|
58735
58425
|
}
|
|
58736
|
-
async function* pe2(
|
|
58737
|
-
let { url:
|
|
58738
|
-
_2 =
|
|
58426
|
+
async function* pe2(e4) {
|
|
58427
|
+
let { url: t3, headers: r3, body: i2, identity: a3, signal: o3, timeout: s3, idleTimeout: c2, onResponse: l3, registeredToolNames: d } = e4, f = N2(), p = (e5 = false) => F2(a3, P3(f, e5), f, f.stopReason), m = false, h2 = false, g2 = false, _2, v2 = gt({ url: t3, body: i2, headers: r3, signal: o3, timeout: s3 ?? 3e5, idleTimeout: c2, onResponse: (e5) => {
|
|
58428
|
+
_2 = e5, l3?.(e5);
|
|
58739
58429
|
} });
|
|
58740
58430
|
try {
|
|
58741
|
-
for await (let
|
|
58742
|
-
if (
|
|
58743
|
-
let
|
|
58431
|
+
for await (let e5 of v2) {
|
|
58432
|
+
if (e5.data === `[DONE]`) break;
|
|
58433
|
+
let t4;
|
|
58744
58434
|
try {
|
|
58745
|
-
|
|
58435
|
+
t4 = JSON.parse(e5.data);
|
|
58746
58436
|
} catch {
|
|
58747
58437
|
continue;
|
|
58748
58438
|
}
|
|
58749
|
-
if (
|
|
58750
|
-
let
|
|
58751
|
-
throw new Ce(`Chat Completions stream error: ${
|
|
58439
|
+
if (t4.error) {
|
|
58440
|
+
let e6 = t4.error, r5 = typeof e6.message == `string` ? e6.message : JSON.stringify(e6), i4 = e6.code, a5 = typeof i4 == `number` ? i4 : typeof i4 == `string` && /^\d+/.test(i4) ? Number(i4.match(/^\d+/)?.[0]) : void 0;
|
|
58441
|
+
throw new Ce(`Chat Completions stream error: ${r5}`, { code: `PROVIDER_API_ERROR`, status: a5 });
|
|
58752
58442
|
}
|
|
58753
|
-
if (
|
|
58754
|
-
let
|
|
58755
|
-
f.inputTokens =
|
|
58443
|
+
if (t4.usage) {
|
|
58444
|
+
let e6 = t4.usage, n3 = e6.prompt_tokens ?? 0, r5 = e6.completion_tokens ?? 0, i4 = e6.prompt_tokens_details?.cached_tokens ?? e6.prompt_cache_hit_tokens ?? 0;
|
|
58445
|
+
f.inputTokens = n3 - i4, f.cacheReadTokens = i4, f.outputTokens = r5;
|
|
58756
58446
|
}
|
|
58757
|
-
let
|
|
58758
|
-
if (!
|
|
58759
|
-
let i3 =
|
|
58760
|
-
if (m || (m = true, yield { type: `start`, partial: p() }),
|
|
58447
|
+
let r4 = t4.choices?.[0];
|
|
58448
|
+
if (!r4) continue;
|
|
58449
|
+
let i3 = r4.delta;
|
|
58450
|
+
if (m || (m = true, yield { type: `start`, partial: p() }), r4.finish_reason && (f.stopReason = I3(r4.finish_reason)), !i3) continue;
|
|
58761
58451
|
if (i3.content) {
|
|
58762
|
-
let
|
|
58763
|
-
h2 || (h2 = true, yield { type: `text_start`, index: 0, partial: p() }), f.textContent +=
|
|
58452
|
+
let e6 = i3.content;
|
|
58453
|
+
h2 || (h2 = true, yield { type: `text_start`, index: 0, partial: p() }), f.textContent += e6, yield { type: `text_delta`, index: 0, delta: e6, partial: p() };
|
|
58764
58454
|
}
|
|
58765
|
-
let
|
|
58766
|
-
if (
|
|
58767
|
-
let
|
|
58768
|
-
f.toolCalls.has(
|
|
58769
|
-
let
|
|
58770
|
-
if (
|
|
58771
|
-
let
|
|
58772
|
-
|
|
58455
|
+
let a4 = i3.reasoning_content ?? i3.reasoning ?? i3.reasoning_text ?? null;
|
|
58456
|
+
if (a4 && (g2 || (g2 = true, yield { type: `thinking_start`, index: 0, partial: p() }), f.thinkingText += a4, yield { type: `thinking_delta`, index: 0, delta: a4, partial: p() }), i3.tool_calls) for (let e6 of i3.tool_calls) {
|
|
58457
|
+
let t5 = e6.index, n3 = e6.function;
|
|
58458
|
+
f.toolCalls.has(t5) || (f.toolCalls.set(t5, { id: e6.id ?? `call_${t5}`, name: n3?.name ?? ``, argumentsJson: `` }), yield { type: `tool_call_start`, index: t5, partial: p() });
|
|
58459
|
+
let r5 = f.toolCalls.get(t5);
|
|
58460
|
+
if (n3?.arguments) {
|
|
58461
|
+
let e7 = n3.arguments;
|
|
58462
|
+
r5.argumentsJson += e7, yield { type: `tool_call_delta`, index: t5, delta: e7, partial: p() };
|
|
58773
58463
|
}
|
|
58774
58464
|
}
|
|
58775
58465
|
}
|
|
58776
58466
|
g2 && (yield { type: `thinking_end`, index: 0, content: f.thinkingText, partial: p() }), h2 && (yield { type: `text_end`, index: 0, content: f.textContent, partial: p() });
|
|
58777
|
-
for (let [
|
|
58778
|
-
yield { type: `done`, reason: f.stopReason, message:
|
|
58779
|
-
} catch (
|
|
58780
|
-
yield { type: `error`, error:
|
|
58781
|
-
}
|
|
58782
|
-
}
|
|
58783
|
-
function
|
|
58784
|
-
for (let
|
|
58785
|
-
if (!
|
|
58786
|
-
let
|
|
58787
|
-
if (
|
|
58788
|
-
let
|
|
58789
|
-
if (
|
|
58790
|
-
let
|
|
58791
|
-
if (typeof
|
|
58467
|
+
for (let [e5, t4] of f.toolCalls) yield { type: `tool_call_end`, index: e5, toolCall: k4(t4.id, t4.name, t4.argumentsJson), partial: p() };
|
|
58468
|
+
yield { type: `done`, reason: f.stopReason, message: A3(p(true), d ?? /* @__PURE__ */ new Set()), providerUsage: E4(_2) };
|
|
58469
|
+
} catch (e5) {
|
|
58470
|
+
yield { type: `error`, error: e5 instanceof Error ? e5 : new Ce(`Unknown Chat Completions stream error`, { code: `PROVIDER_STREAM_ERROR` }) };
|
|
58471
|
+
}
|
|
58472
|
+
}
|
|
58473
|
+
function L3(e4, t3, n3) {
|
|
58474
|
+
for (let r3 of e4) {
|
|
58475
|
+
if (!r3) continue;
|
|
58476
|
+
let e5 = r3.split(`.`)[1];
|
|
58477
|
+
if (e5) try {
|
|
58478
|
+
let r4 = JSON.parse(Buffer.from(e5, `base64url`).toString(`utf-8`));
|
|
58479
|
+
if (n3) {
|
|
58480
|
+
let e6 = r4[n3]?.[t3] ?? r4[t3];
|
|
58481
|
+
if (typeof e6 == `string`) return e6;
|
|
58792
58482
|
} else {
|
|
58793
|
-
let
|
|
58794
|
-
if (typeof
|
|
58483
|
+
let e6 = r4[t3];
|
|
58484
|
+
if (typeof e6 == `string`) return e6;
|
|
58795
58485
|
}
|
|
58796
58486
|
} catch {
|
|
58797
58487
|
}
|
|
@@ -58800,53 +58490,53 @@ function L4(e6, t4, n4) {
|
|
|
58800
58490
|
var me2 = /* @__PURE__ */ new Set([`authorization`, `x-api-key`]);
|
|
58801
58491
|
var he2 = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
58802
58492
|
var ge2 = /[\u0000-\u001f\u007f]/g;
|
|
58803
|
-
function R2(
|
|
58493
|
+
function R2(e4, t3, n3, r3) {
|
|
58804
58494
|
let i2 = /* @__PURE__ */ new Map();
|
|
58805
|
-
if (!
|
|
58806
|
-
for (let [
|
|
58807
|
-
let
|
|
58808
|
-
if (!he2.test(
|
|
58809
|
-
|
|
58495
|
+
if (!e4) return i2;
|
|
58496
|
+
for (let [a3, o3] of Object.entries(e4)) {
|
|
58497
|
+
let e5 = a3.trim();
|
|
58498
|
+
if (!he2.test(e5)) {
|
|
58499
|
+
n3?.warn({ provider: r3, source: t3, header: a3 }, `dropped request header with invalid name (RFC 7230 token expected)`);
|
|
58810
58500
|
continue;
|
|
58811
58501
|
}
|
|
58812
|
-
if (typeof
|
|
58813
|
-
let
|
|
58814
|
-
|
|
58502
|
+
if (typeof o3 != `string`) continue;
|
|
58503
|
+
let s3 = o3.replace(ge2, ``).trim();
|
|
58504
|
+
s3 && i2.set(e5.toLowerCase(), { name: e5, value: s3 });
|
|
58815
58505
|
}
|
|
58816
58506
|
return i2;
|
|
58817
58507
|
}
|
|
58818
|
-
function _e2(
|
|
58819
|
-
if (!
|
|
58820
|
-
let
|
|
58821
|
-
for (let
|
|
58822
|
-
if (
|
|
58823
|
-
let
|
|
58824
|
-
|
|
58825
|
-
}
|
|
58826
|
-
return Object.keys(
|
|
58827
|
-
}
|
|
58828
|
-
function ve2(
|
|
58829
|
-
let { logger:
|
|
58830
|
-
for (let { label:
|
|
58831
|
-
if (!
|
|
58832
|
-
|
|
58508
|
+
function _e2(e4) {
|
|
58509
|
+
if (!e4?.headers.length) return;
|
|
58510
|
+
let t3 = {};
|
|
58511
|
+
for (let n3 of e4.headers) {
|
|
58512
|
+
if (n3.source.kind !== `jwt-claim`) continue;
|
|
58513
|
+
let r3 = L3(n3.source.tokenSources?.length ? n3.source.tokenSources.map((t4) => t4 === `access_token` ? e4.token : void 0) : [e4.token], n3.source.claim, n3.source.namespace);
|
|
58514
|
+
r3 && (t3[n3.header] = r3);
|
|
58515
|
+
}
|
|
58516
|
+
return Object.keys(t3).length > 0 ? t3 : void 0;
|
|
58517
|
+
}
|
|
58518
|
+
function ve2(e4) {
|
|
58519
|
+
let { logger: t3, diagnosticLabel: n3, allowAuthHeaderOverride: r3 } = e4, i2 = [{ label: `protocolDefaults`, entries: R2(e4.protocolDefaults, `protocolDefaults`, t3, n3) }, { label: `staticHeaders`, entries: R2(e4.staticHeaders, `staticHeaders`, t3, n3) }, { label: `tokenDerived`, entries: R2(_e2(e4.tokenDerived), `tokenDerived`, t3, n3) }, { label: `customized`, entries: R2(e4.customized, `customized`, t3, n3) }], a3 = /* @__PURE__ */ new Set([`staticHeaders`, `tokenDerived`, `customized`]), o3 = /* @__PURE__ */ new Map();
|
|
58520
|
+
for (let { label: e5, entries: s4 } of i2) for (let [i3, c2] of s4) {
|
|
58521
|
+
if (!r3 && a3.has(e5) && me2.has(i3)) {
|
|
58522
|
+
t3?.warn({ provider: n3, source: e5, header: c2.name }, `dropped attempt to override auth header (declare allowAuthHeaderOverride to permit)`);
|
|
58833
58523
|
continue;
|
|
58834
58524
|
}
|
|
58835
|
-
let
|
|
58836
|
-
|
|
58525
|
+
let s5 = o3.get(i3);
|
|
58526
|
+
s5 && e5 === `customized` && s5.value !== c2.value && t3?.debug({ provider: n3, header: c2.name }, `customizeRequest overrode a previously declared request header`), o3.set(i3, c2);
|
|
58837
58527
|
}
|
|
58838
|
-
for (let [i3,
|
|
58839
|
-
if (
|
|
58840
|
-
|
|
58528
|
+
for (let [i3, a4] of R2(e4.auth, `auth`, t3, n3)) {
|
|
58529
|
+
if (r3 && o3.has(i3)) {
|
|
58530
|
+
t3?.debug({ provider: n3, header: a4.name }, `provider-declared auth header kept (allowAuthHeaderOverride); otto-resolved credential not applied`);
|
|
58841
58531
|
continue;
|
|
58842
58532
|
}
|
|
58843
|
-
|
|
58533
|
+
o3.set(i3, a4);
|
|
58844
58534
|
}
|
|
58845
|
-
let
|
|
58846
|
-
for (let { name:
|
|
58847
|
-
return
|
|
58535
|
+
let s3 = {};
|
|
58536
|
+
for (let { name: e5, value: t4 } of o3.values()) s3[e5] = t4;
|
|
58537
|
+
return s3;
|
|
58848
58538
|
}
|
|
58849
|
-
var
|
|
58539
|
+
var z5 = Be(`@x-otto/provider:oauth:templates`);
|
|
58850
58540
|
|
|
58851
58541
|
// ../../extensions/plugin-otto-wire-protocols/src/anthropic-usage.ts
|
|
58852
58542
|
var LIMIT_TYPE_ABBREVIATION = {
|
|
@@ -58862,9 +58552,9 @@ function readBucketUtilization(headers, limitType) {
|
|
|
58862
58552
|
if (!abbr) return void 0;
|
|
58863
58553
|
const raw = _t(headers, `anthropic-ratelimit-unified-${abbr}-utilization`);
|
|
58864
58554
|
if (raw === void 0) return void 0;
|
|
58865
|
-
const
|
|
58866
|
-
if (!Number.isFinite(
|
|
58867
|
-
return Math.round(
|
|
58555
|
+
const n3 = Number(raw);
|
|
58556
|
+
if (!Number.isFinite(n3)) return void 0;
|
|
58557
|
+
return Math.round(n3 * 100);
|
|
58868
58558
|
}
|
|
58869
58559
|
function extractProviderUsageFromHeaders(headers) {
|
|
58870
58560
|
if (!headers) return null;
|
|
@@ -58984,7 +58674,7 @@ function withMessageCacheBreakpoint(messages, cacheControl = CACHE_CONTROL) {
|
|
|
58984
58674
|
}
|
|
58985
58675
|
function buildSystemBlocks(systemPrompt, segments, cacheControl = CACHE_CONTROL) {
|
|
58986
58676
|
const source = segments && segments.length > 0 ? segments : systemPrompt ? [{ text: systemPrompt }] : [];
|
|
58987
|
-
const blocks = source.filter((
|
|
58677
|
+
const blocks = source.filter((s3) => s3.text.length > 0);
|
|
58988
58678
|
if (blocks.length === 0) {
|
|
58989
58679
|
return void 0;
|
|
58990
58680
|
}
|
|
@@ -59016,7 +58706,7 @@ function buildAnthropicMessages(messages, model) {
|
|
|
59016
58706
|
const result = [];
|
|
59017
58707
|
const nativeSystemMessageSupported = model ? supportsMidConversationSystemMessage(model) : false;
|
|
59018
58708
|
const normalized = nativeSystemMessageSupported ? y(messages) : messages;
|
|
59019
|
-
|
|
58709
|
+
b4(normalized);
|
|
59020
58710
|
for (const msg of g(normalized)) {
|
|
59021
58711
|
if (msg.role === "user") {
|
|
59022
58712
|
if (typeof msg.content === "string") {
|
|
@@ -59029,7 +58719,7 @@ function buildAnthropicMessages(messages, model) {
|
|
|
59029
58719
|
content.push({ type: "text", text: part.text });
|
|
59030
58720
|
}
|
|
59031
58721
|
} else if (part.type === "image") {
|
|
59032
|
-
const { base64: base643, mediaType, valid } =
|
|
58722
|
+
const { base64: base643, mediaType, valid } = o2(part.source, part.mime);
|
|
59033
58723
|
if (valid) {
|
|
59034
58724
|
content.push({
|
|
59035
58725
|
type: "image",
|
|
@@ -59081,7 +58771,7 @@ function buildAnthropicMessages(messages, model) {
|
|
|
59081
58771
|
toolContent.push({ type: "text", text: c2.text });
|
|
59082
58772
|
}
|
|
59083
58773
|
} else if (c2.type === "image") {
|
|
59084
|
-
const { base64: base643, mediaType, valid } =
|
|
58774
|
+
const { base64: base643, mediaType, valid } = o2(c2.source, c2.mime);
|
|
59085
58775
|
if (valid) {
|
|
59086
58776
|
toolContent.push({
|
|
59087
58777
|
type: "image",
|
|
@@ -59146,7 +58836,7 @@ function mapStopReason(reason) {
|
|
|
59146
58836
|
}
|
|
59147
58837
|
function initStreamState(modelId) {
|
|
59148
58838
|
return {
|
|
59149
|
-
...
|
|
58839
|
+
...D3(),
|
|
59150
58840
|
model: modelId,
|
|
59151
58841
|
blocks: /* @__PURE__ */ new Map(),
|
|
59152
58842
|
stopReason: "end_turn"
|
|
@@ -59155,7 +58845,7 @@ function initStreamState(modelId) {
|
|
|
59155
58845
|
function buildAssistantMessage(state, final = false) {
|
|
59156
58846
|
return F2(
|
|
59157
58847
|
{ api: "anthropic-messages", provider: "anthropic", model: state.model },
|
|
59158
|
-
|
|
58848
|
+
de2(state.blocks, final),
|
|
59159
58849
|
state,
|
|
59160
58850
|
state.stopReason
|
|
59161
58851
|
);
|
|
@@ -59249,7 +58939,7 @@ function dispatchStreamEvent(event, state) {
|
|
|
59249
58939
|
return [{
|
|
59250
58940
|
type: "tool_call_end",
|
|
59251
58941
|
index,
|
|
59252
|
-
toolCall:
|
|
58942
|
+
toolCall: k4(block.id, block.name, block.argumentsJson),
|
|
59253
58943
|
partial: buildAssistantMessage(state)
|
|
59254
58944
|
}];
|
|
59255
58945
|
}
|
|
@@ -59320,7 +59010,7 @@ var AnthropicStream = class {
|
|
|
59320
59010
|
if (envKey) {
|
|
59321
59011
|
return { token: envKey, mode: "api_key" };
|
|
59322
59012
|
}
|
|
59323
|
-
throw new
|
|
59013
|
+
throw new Ce(
|
|
59324
59014
|
"Missing Anthropic API key. Set ANTHROPIC_API_KEY or configure via auth file.",
|
|
59325
59015
|
{ code: "PROVIDER_AUTH_MISSING" }
|
|
59326
59016
|
);
|
|
@@ -59350,10 +59040,10 @@ var AnthropicStream = class {
|
|
|
59350
59040
|
...headerOptions
|
|
59351
59041
|
});
|
|
59352
59042
|
const cacheControl = cacheControlFor(context.cacheRetention);
|
|
59353
|
-
const tools = context.tools ? context.tools.map((
|
|
59354
|
-
name:
|
|
59355
|
-
description:
|
|
59356
|
-
input_schema:
|
|
59043
|
+
const tools = context.tools ? context.tools.map((t3) => ({
|
|
59044
|
+
name: t3.name,
|
|
59045
|
+
description: t3.description,
|
|
59046
|
+
input_schema: t3.parameters.toJSONSchema?.() ?? {}
|
|
59357
59047
|
})) : [];
|
|
59358
59048
|
const lastTool = tools[tools.length - 1];
|
|
59359
59049
|
if (lastTool && cacheControl) {
|
|
@@ -59362,7 +59052,7 @@ var AnthropicStream = class {
|
|
|
59362
59052
|
const effectiveMaxTokens = context.maxTokens ?? model.maxOutputTokens;
|
|
59363
59053
|
const thinkingConfig = buildThinkingConfig(
|
|
59364
59054
|
// RFC-235:按模型声明的 thinkingLevels 降级后再算预算(clamp 单一真源)。
|
|
59365
|
-
context.thinkingLevel ?
|
|
59055
|
+
context.thinkingLevel ? C2(context.thinkingLevel, model.thinkingLevels) : void 0,
|
|
59366
59056
|
model.reasoning,
|
|
59367
59057
|
effectiveMaxTokens,
|
|
59368
59058
|
model.thinkingMode
|
|
@@ -59384,7 +59074,7 @@ var AnthropicStream = class {
|
|
|
59384
59074
|
...context.temperature !== void 0 && !model.reasoning ? { temperature: context.temperature } : {},
|
|
59385
59075
|
...thinkingConfig ? { thinking: thinkingConfig } : {},
|
|
59386
59076
|
// adaptive 模式:网关要求顶层 output_config.effort 控制推理投入(与 thinking.type.adaptive 配对)。
|
|
59387
|
-
...thinkingConfig?.type === "adaptive" && context.thinkingLevel ? { output_config: { effort: toAdaptiveEffort(
|
|
59077
|
+
...thinkingConfig?.type === "adaptive" && context.thinkingLevel ? { output_config: { effort: toAdaptiveEffort(C2(context.thinkingLevel, model.thinkingLevels)) } } : {},
|
|
59388
59078
|
...customization?.metadata ? { metadata: customization.metadata } : {}
|
|
59389
59079
|
};
|
|
59390
59080
|
return { client, requestParams, baseURL };
|
|
@@ -59415,14 +59105,14 @@ var AnthropicStream = class {
|
|
|
59415
59105
|
// RFC-232(终局修正):跨 wire 协议救回"模型把工具调用写成字面文本 XML"违约响应
|
|
59416
59106
|
// (见 stream-state.ts recoverLiteralInvokeToolCalls 头注释)。判据内部短路,
|
|
59417
59107
|
// 无违约态时零开销(引用相等,不构造新对象)。
|
|
59418
|
-
message:
|
|
59108
|
+
message: A3(doneMessage, ce2(context.tools)),
|
|
59419
59109
|
providerUsage
|
|
59420
59110
|
};
|
|
59421
59111
|
} catch (error48) {
|
|
59422
59112
|
if (error48 instanceof Anthropic.APIError) {
|
|
59423
59113
|
yield {
|
|
59424
59114
|
type: "error",
|
|
59425
|
-
error: new
|
|
59115
|
+
error: new Ce(`Anthropic API error ${error48.status}: ${error48.message}`, {
|
|
59426
59116
|
code: "PROVIDER_API_ERROR",
|
|
59427
59117
|
cause: error48,
|
|
59428
59118
|
// 把 SDK 的 HTTP status/headers 转成 ProviderError 的 typed 字段
|
|
@@ -59440,7 +59130,7 @@ var AnthropicStream = class {
|
|
|
59440
59130
|
} else {
|
|
59441
59131
|
yield {
|
|
59442
59132
|
type: "error",
|
|
59443
|
-
error: new
|
|
59133
|
+
error: new Ce("Unknown Anthropic stream error", {
|
|
59444
59134
|
code: "PROVIDER_STREAM_ERROR"
|
|
59445
59135
|
})
|
|
59446
59136
|
};
|
|
@@ -59489,17 +59179,17 @@ function buildResponsesInput(context) {
|
|
|
59489
59179
|
if (typeof msg.content === "string") {
|
|
59490
59180
|
input.push({
|
|
59491
59181
|
role: "user",
|
|
59492
|
-
content: [{ type: "input_text", text:
|
|
59182
|
+
content: [{ type: "input_text", text: x4(msg.content) }]
|
|
59493
59183
|
});
|
|
59494
59184
|
} else {
|
|
59495
59185
|
input.push({
|
|
59496
59186
|
role: "user",
|
|
59497
59187
|
content: msg.content.map((part) => {
|
|
59498
59188
|
if (part.type === "text") {
|
|
59499
|
-
return { type: "input_text", text:
|
|
59189
|
+
return { type: "input_text", text: x4(part.text) };
|
|
59500
59190
|
}
|
|
59501
59191
|
if (part.type === "image") {
|
|
59502
|
-
const { base64: base643, mediaType, valid } =
|
|
59192
|
+
const { base64: base643, mediaType, valid } = o2(part.source, part.mime);
|
|
59503
59193
|
if (!valid) {
|
|
59504
59194
|
return { type: "input_text", text: "[image omitted: corrupted or empty data]" };
|
|
59505
59195
|
}
|
|
@@ -59513,7 +59203,7 @@ function buildResponsesInput(context) {
|
|
|
59513
59203
|
});
|
|
59514
59204
|
}
|
|
59515
59205
|
} else if (msg.role === "assistant") {
|
|
59516
|
-
const textParts = msg.content.filter((c2) => c2.type === "text").filter((c2) => c2.text.trim().length > 0).map((c2) =>
|
|
59206
|
+
const textParts = msg.content.filter((c2) => c2.type === "text").filter((c2) => c2.text.trim().length > 0).map((c2) => x4(c2.text)).join("");
|
|
59517
59207
|
if (textParts) {
|
|
59518
59208
|
input.push({
|
|
59519
59209
|
role: "assistant",
|
|
@@ -59534,7 +59224,7 @@ function buildResponsesInput(context) {
|
|
|
59534
59224
|
input.push({
|
|
59535
59225
|
type: "function_call_output",
|
|
59536
59226
|
call_id: msg.toolCallId,
|
|
59537
|
-
output:
|
|
59227
|
+
output: x4(
|
|
59538
59228
|
msg.content.map((c2) => c2.type === "text" ? c2.text : "").join("")
|
|
59539
59229
|
)
|
|
59540
59230
|
});
|
|
@@ -59542,7 +59232,7 @@ function buildResponsesInput(context) {
|
|
|
59542
59232
|
input.push({
|
|
59543
59233
|
role: "user",
|
|
59544
59234
|
content: [
|
|
59545
|
-
{ type: "input_text", text:
|
|
59235
|
+
{ type: "input_text", text: x4(v(msg.content)) }
|
|
59546
59236
|
]
|
|
59547
59237
|
});
|
|
59548
59238
|
}
|
|
@@ -59564,13 +59254,13 @@ function buildResponsesBody(model, context) {
|
|
|
59564
59254
|
body.max_output_tokens = context.maxTokens ?? model.maxOutputTokens;
|
|
59565
59255
|
}
|
|
59566
59256
|
if (context.systemPrompt) {
|
|
59567
|
-
body.instructions =
|
|
59257
|
+
body.instructions = x4(context.systemPrompt);
|
|
59568
59258
|
}
|
|
59569
59259
|
if (context.temperature !== void 0 && !model.reasoning) {
|
|
59570
59260
|
body.temperature = context.temperature;
|
|
59571
59261
|
}
|
|
59572
59262
|
if (model.reasoning && context.thinkingLevel) {
|
|
59573
|
-
body.reasoning = { effort: toReasoningEffort(
|
|
59263
|
+
body.reasoning = { effort: toReasoningEffort(C2(context.thinkingLevel, model.thinkingLevels)) };
|
|
59574
59264
|
}
|
|
59575
59265
|
if (context.tools && context.tools.length > 0) {
|
|
59576
59266
|
body.tools = context.tools.map((tool) => ({
|
|
@@ -59592,7 +59282,7 @@ function ensureBlock(blocks, index, kind) {
|
|
|
59592
59282
|
}
|
|
59593
59283
|
function initStreamState2(model) {
|
|
59594
59284
|
return {
|
|
59595
|
-
...
|
|
59285
|
+
...D3(),
|
|
59596
59286
|
model,
|
|
59597
59287
|
blocks: /* @__PURE__ */ new Map(),
|
|
59598
59288
|
stopReason: "end_turn"
|
|
@@ -59601,7 +59291,7 @@ function initStreamState2(model) {
|
|
|
59601
59291
|
function buildAssistantMessage2(state, final = false) {
|
|
59602
59292
|
return F2(
|
|
59603
59293
|
{ api: state.model.api, provider: state.model.provider, model: state.model.id },
|
|
59604
|
-
|
|
59294
|
+
de2(state.blocks, final),
|
|
59605
59295
|
state,
|
|
59606
59296
|
state.stopReason
|
|
59607
59297
|
);
|
|
@@ -59671,7 +59361,7 @@ function dispatchResponsesSSEEvent(type, data, state) {
|
|
|
59671
59361
|
state.outputTokens = outputTokens;
|
|
59672
59362
|
state.cacheReadTokens = cached2;
|
|
59673
59363
|
}
|
|
59674
|
-
const hasTool = [...state.blocks.values()].some((
|
|
59364
|
+
const hasTool = [...state.blocks.values()].some((b5) => b5.kind === "tool_call");
|
|
59675
59365
|
if (type === "response.incomplete") {
|
|
59676
59366
|
state.stopReason = "max_tokens";
|
|
59677
59367
|
} else {
|
|
@@ -59688,7 +59378,7 @@ function dispatchResponsesSSEEvent(type, data, state) {
|
|
|
59688
59378
|
return {
|
|
59689
59379
|
events: [{
|
|
59690
59380
|
type: "error",
|
|
59691
|
-
error: new
|
|
59381
|
+
error: new Ce(`OpenAI Responses API error: ${message}`, {
|
|
59692
59382
|
code: "PROVIDER_API_ERROR",
|
|
59693
59383
|
errorType
|
|
59694
59384
|
})
|
|
@@ -59736,7 +59426,7 @@ var OpenAIResponsesStream = class {
|
|
|
59736
59426
|
if (envKey) {
|
|
59737
59427
|
return { token: envKey, mode: "api_key" };
|
|
59738
59428
|
}
|
|
59739
|
-
throw new
|
|
59429
|
+
throw new Ce("Missing OpenAI credential. Set OPENAI_API_KEY or login via OAuth.", {
|
|
59740
59430
|
code: "PROVIDER_AUTH_MISSING"
|
|
59741
59431
|
});
|
|
59742
59432
|
}
|
|
@@ -59783,7 +59473,7 @@ var OpenAIResponsesStream = class {
|
|
|
59783
59473
|
let started = false;
|
|
59784
59474
|
try {
|
|
59785
59475
|
let responseHeaders;
|
|
59786
|
-
const sse =
|
|
59476
|
+
const sse = gt({
|
|
59787
59477
|
url: url2,
|
|
59788
59478
|
body,
|
|
59789
59479
|
headers: this.buildHeaders(auth, model.provider),
|
|
@@ -59813,13 +59503,13 @@ var OpenAIResponsesStream = class {
|
|
|
59813
59503
|
yield* result.events;
|
|
59814
59504
|
if (result.fatal) return;
|
|
59815
59505
|
}
|
|
59816
|
-
const orderedTools = [...state.blocks.entries()].sort(([
|
|
59506
|
+
const orderedTools = [...state.blocks.entries()].sort(([a3], [b5]) => a3 - b5);
|
|
59817
59507
|
for (const [index, block] of orderedTools) {
|
|
59818
59508
|
if (block.kind === "tool_call") {
|
|
59819
59509
|
yield {
|
|
59820
59510
|
type: "tool_call_end",
|
|
59821
59511
|
index,
|
|
59822
|
-
toolCall:
|
|
59512
|
+
toolCall: k4(block.id, block.name, block.argumentsJson),
|
|
59823
59513
|
partial: buildAssistantMessage2(state)
|
|
59824
59514
|
};
|
|
59825
59515
|
} else if (block.kind === "text") {
|
|
@@ -59837,8 +59527,8 @@ var OpenAIResponsesStream = class {
|
|
|
59837
59527
|
type: "done",
|
|
59838
59528
|
reason: state.stopReason,
|
|
59839
59529
|
// RFC-232(终局修正):跨 wire 协议救回违约响应,见 @x-otto/provider stream-state.ts。
|
|
59840
|
-
message:
|
|
59841
|
-
providerUsage:
|
|
59530
|
+
message: A3(buildAssistantMessage2(state, true), ce2(context.tools)),
|
|
59531
|
+
providerUsage: E4(responseHeaders)
|
|
59842
59532
|
};
|
|
59843
59533
|
} catch (error48) {
|
|
59844
59534
|
if (error48 instanceof Error) {
|
|
@@ -59846,7 +59536,7 @@ var OpenAIResponsesStream = class {
|
|
|
59846
59536
|
} else {
|
|
59847
59537
|
yield {
|
|
59848
59538
|
type: "error",
|
|
59849
|
-
error: new
|
|
59539
|
+
error: new Ce("Unknown OpenAI Responses stream error", {
|
|
59850
59540
|
code: "PROVIDER_STREAM_ERROR"
|
|
59851
59541
|
})
|
|
59852
59542
|
};
|
|
@@ -59903,7 +59593,7 @@ var OpenAICompletionsStream = class {
|
|
|
59903
59593
|
return { token: key, mode: "api_key" };
|
|
59904
59594
|
}
|
|
59905
59595
|
}
|
|
59906
|
-
throw new
|
|
59596
|
+
throw new Ce(
|
|
59907
59597
|
`Missing credential for provider '${model.provider}' (openai-completions).`,
|
|
59908
59598
|
{ code: "PROVIDER_AUTH_MISSING" }
|
|
59909
59599
|
);
|
|
@@ -59956,7 +59646,7 @@ function createOpenAICompletionsProvider(options = {}) {
|
|
|
59956
59646
|
// ../../extensions/plugin-otto-wire-protocols/plugin.ts
|
|
59957
59647
|
function adaptToOpenAICompletions(input) {
|
|
59958
59648
|
return createOpenAICompletionsProvider({
|
|
59959
|
-
resolveKey: () => input.resolveAuth().then((
|
|
59649
|
+
resolveKey: () => input.resolveAuth().then((a3) => a3?.token),
|
|
59960
59650
|
headers: input.headers,
|
|
59961
59651
|
tokenDerivedHeaders: input.tokenDerivedHeaders,
|
|
59962
59652
|
logger: input.logger,
|
|
@@ -59967,7 +59657,7 @@ function adaptToOpenAICompletions(input) {
|
|
|
59967
59657
|
}
|
|
59968
59658
|
function adaptToOpenAIResponses(input) {
|
|
59969
59659
|
return createOpenAIResponsesProvider({
|
|
59970
|
-
resolveKey: () => input.resolveAuth().then((
|
|
59660
|
+
resolveKey: () => input.resolveAuth().then((a3) => a3?.token),
|
|
59971
59661
|
resolveBaseUrl: input.resolveBaseUrl,
|
|
59972
59662
|
tokenDerivedHeaders: input.tokenDerivedHeaders,
|
|
59973
59663
|
headers: input.headers,
|