pullfrog 0.1.64 → 0.1.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +1329 -719
- package/dist/index.js +1074 -652
- package/dist/internal.js +137 -11
- package/dist/models.d.ts +2 -1
- package/dist/toolState.d.ts +1 -1
- package/dist/utils/apiKeys.d.ts +30 -0
- package/dist/utils/globals.d.ts +0 -1
- package/dist/utils/learnings.d.ts +1 -5
- package/dist/utils/learningsTruncate.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -73378,11 +73378,11 @@ var require_dataType = __commonJS({
|
|
|
73378
73378
|
gen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr));
|
|
73379
73379
|
}
|
|
73380
73380
|
function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
|
|
73381
|
-
const
|
|
73381
|
+
const EQ2 = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
|
|
73382
73382
|
let cond;
|
|
73383
73383
|
switch (dataType) {
|
|
73384
73384
|
case "null":
|
|
73385
|
-
return (0, codegen_1._)`${data} ${
|
|
73385
|
+
return (0, codegen_1._)`${data} ${EQ2} null`;
|
|
73386
73386
|
case "array":
|
|
73387
73387
|
cond = (0, codegen_1._)`Array.isArray(${data})`;
|
|
73388
73388
|
break;
|
|
@@ -73396,7 +73396,7 @@ var require_dataType = __commonJS({
|
|
|
73396
73396
|
cond = numCond();
|
|
73397
73397
|
break;
|
|
73398
73398
|
default:
|
|
73399
|
-
return (0, codegen_1._)`typeof ${data} ${
|
|
73399
|
+
return (0, codegen_1._)`typeof ${data} ${EQ2} ${dataType}`;
|
|
73400
73400
|
}
|
|
73401
73401
|
return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);
|
|
73402
73402
|
function numCond(_cond = codegen_1.nil) {
|
|
@@ -74852,15 +74852,33 @@ var require_data = __commonJS({
|
|
|
74852
74852
|
}
|
|
74853
74853
|
});
|
|
74854
74854
|
|
|
74855
|
-
// node_modules/.pnpm/fast-uri@3.1.
|
|
74855
|
+
// node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/lib/utils.js
|
|
74856
74856
|
var require_utils5 = __commonJS({
|
|
74857
|
-
"node_modules/.pnpm/fast-uri@3.1.
|
|
74857
|
+
"node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/lib/utils.js"(exports, module) {
|
|
74858
74858
|
"use strict";
|
|
74859
74859
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
74860
74860
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
74861
74861
|
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
74862
74862
|
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
74863
|
-
var isPathCharacter = RegExp.prototype.test.bind(/^[
|
|
74863
|
+
var isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u);
|
|
74864
|
+
var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u);
|
|
74865
|
+
var isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);
|
|
74866
|
+
var BYTE_HEX = new Array(256);
|
|
74867
|
+
{
|
|
74868
|
+
const HEX_DIGITS = "0123456789ABCDEF";
|
|
74869
|
+
for (let i = 0; i < 256; i++) {
|
|
74870
|
+
BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15];
|
|
74871
|
+
}
|
|
74872
|
+
}
|
|
74873
|
+
function percentEncodeNonAscii(cp) {
|
|
74874
|
+
if (cp < 2048) {
|
|
74875
|
+
return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63];
|
|
74876
|
+
}
|
|
74877
|
+
if (cp < 65536) {
|
|
74878
|
+
return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
74879
|
+
}
|
|
74880
|
+
return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
74881
|
+
}
|
|
74864
74882
|
function stringArrayToHexStripped(input) {
|
|
74865
74883
|
let acc = "";
|
|
74866
74884
|
let code = 0;
|
|
@@ -74885,91 +74903,105 @@ var require_utils5 = __commonJS({
|
|
|
74885
74903
|
}
|
|
74886
74904
|
return acc;
|
|
74887
74905
|
}
|
|
74906
|
+
var isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/);
|
|
74907
|
+
var isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/);
|
|
74908
|
+
var isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/);
|
|
74888
74909
|
var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
|
|
74889
|
-
function
|
|
74890
|
-
|
|
74891
|
-
|
|
74892
|
-
|
|
74893
|
-
|
|
74894
|
-
|
|
74895
|
-
|
|
74896
|
-
if (hex4 !== "") {
|
|
74897
|
-
address.push(hex4);
|
|
74898
|
-
} else {
|
|
74899
|
-
output.error = true;
|
|
74900
|
-
return false;
|
|
74910
|
+
function isZoneIdentifier(zone) {
|
|
74911
|
+
if (zone.length === 0) return false;
|
|
74912
|
+
for (let i = 0; i < zone.length; i++) {
|
|
74913
|
+
if (isZoneCharacter(zone[i])) continue;
|
|
74914
|
+
if (zone[i] === "%" && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) {
|
|
74915
|
+
i += 2;
|
|
74916
|
+
continue;
|
|
74901
74917
|
}
|
|
74902
|
-
|
|
74918
|
+
return false;
|
|
74903
74919
|
}
|
|
74904
74920
|
return true;
|
|
74905
74921
|
}
|
|
74906
|
-
function
|
|
74907
|
-
let
|
|
74908
|
-
|
|
74909
|
-
|
|
74910
|
-
|
|
74911
|
-
let
|
|
74912
|
-
|
|
74913
|
-
|
|
74914
|
-
|
|
74915
|
-
|
|
74916
|
-
|
|
74917
|
-
|
|
74918
|
-
}
|
|
74919
|
-
if (cursor === ":") {
|
|
74920
|
-
if (endipv6Encountered === true) {
|
|
74921
|
-
endIpv6 = true;
|
|
74922
|
-
}
|
|
74923
|
-
if (!consume(buffer, address, output)) {
|
|
74924
|
-
break;
|
|
74925
|
-
}
|
|
74926
|
-
if (++tokenCount > 7) {
|
|
74927
|
-
output.error = true;
|
|
74928
|
-
break;
|
|
74929
|
-
}
|
|
74930
|
-
if (i > 0 && input[i - 1] === ":") {
|
|
74931
|
-
endipv6Encountered = true;
|
|
74932
|
-
}
|
|
74933
|
-
address.push(":");
|
|
74934
|
-
continue;
|
|
74935
|
-
} else if (cursor === "%") {
|
|
74936
|
-
if (!consume(buffer, address, output)) {
|
|
74937
|
-
break;
|
|
74922
|
+
function compressIPv6ZeroRun(hextets) {
|
|
74923
|
+
let bestStart = -1;
|
|
74924
|
+
let bestLength = 0;
|
|
74925
|
+
let runStart = -1;
|
|
74926
|
+
let runLength = 0;
|
|
74927
|
+
for (let i = 0; i < hextets.length; i++) {
|
|
74928
|
+
if (hextets[i] === "0") {
|
|
74929
|
+
if (runStart === -1) runStart = i;
|
|
74930
|
+
runLength++;
|
|
74931
|
+
if (runLength > bestLength) {
|
|
74932
|
+
bestLength = runLength;
|
|
74933
|
+
bestStart = runStart;
|
|
74938
74934
|
}
|
|
74939
|
-
consume = consumeIsZone;
|
|
74940
74935
|
} else {
|
|
74941
|
-
|
|
74936
|
+
runStart = -1;
|
|
74937
|
+
runLength = 0;
|
|
74938
|
+
}
|
|
74939
|
+
}
|
|
74940
|
+
if (bestLength < 2) return hextets.join(":");
|
|
74941
|
+
const head = hextets.slice(0, bestStart).join(":");
|
|
74942
|
+
const tail = hextets.slice(bestStart + bestLength).join(":");
|
|
74943
|
+
return head + "::" + tail;
|
|
74944
|
+
}
|
|
74945
|
+
function normalizeIPv6Address(input) {
|
|
74946
|
+
const compression = input.indexOf("::");
|
|
74947
|
+
if (compression !== -1 && input.indexOf("::", compression + 1) !== -1) return void 0;
|
|
74948
|
+
const left = compression === -1 ? input.split(":") : input.slice(0, compression).split(":");
|
|
74949
|
+
const right = compression === -1 ? [] : input.slice(compression + 2).split(":");
|
|
74950
|
+
if (compression !== -1) {
|
|
74951
|
+
if (left.length === 1 && left[0] === "") left.length = 0;
|
|
74952
|
+
if (right.length === 1 && right[0] === "") right.length = 0;
|
|
74953
|
+
}
|
|
74954
|
+
const parts = left.concat(right);
|
|
74955
|
+
let hextetCount = 0;
|
|
74956
|
+
for (let i = 0; i < parts.length; i++) {
|
|
74957
|
+
const part = parts[i];
|
|
74958
|
+
if (part === "") return void 0;
|
|
74959
|
+
if (part.indexOf(".") !== -1) {
|
|
74960
|
+
if (i !== parts.length - 1 || compression !== -1 && right.length === 0 || !isIPv4(part)) return void 0;
|
|
74961
|
+
hextetCount += 2;
|
|
74942
74962
|
continue;
|
|
74943
74963
|
}
|
|
74964
|
+
if (!isHextet(part)) return void 0;
|
|
74965
|
+
parts[i] = parseInt(part, 16).toString(16);
|
|
74966
|
+
hextetCount++;
|
|
74944
74967
|
}
|
|
74945
|
-
if (
|
|
74946
|
-
if (
|
|
74947
|
-
|
|
74948
|
-
} else if (endIpv6) {
|
|
74949
|
-
address.push(buffer.join(""));
|
|
74950
|
-
} else {
|
|
74951
|
-
address.push(stringArrayToHexStripped(buffer));
|
|
74952
|
-
}
|
|
74968
|
+
if (compression === -1) {
|
|
74969
|
+
if (hextetCount !== 8) return void 0;
|
|
74970
|
+
return compressIPv6ZeroRun(parts);
|
|
74953
74971
|
}
|
|
74954
|
-
|
|
74955
|
-
|
|
74972
|
+
if (hextetCount >= 8) return void 0;
|
|
74973
|
+
const expanded = parts.slice(0, left.length);
|
|
74974
|
+
for (let i = hextetCount; i < 8; i++) expanded.push("0");
|
|
74975
|
+
for (let i = left.length; i < parts.length; i++) expanded.push(parts[i]);
|
|
74976
|
+
return compressIPv6ZeroRun(expanded);
|
|
74956
74977
|
}
|
|
74957
74978
|
function normalizeIPv6(host) {
|
|
74958
|
-
|
|
74959
|
-
|
|
74960
|
-
}
|
|
74961
|
-
|
|
74962
|
-
if (
|
|
74963
|
-
|
|
74964
|
-
|
|
74965
|
-
|
|
74966
|
-
|
|
74967
|
-
|
|
74968
|
-
|
|
74969
|
-
|
|
74970
|
-
|
|
74971
|
-
|
|
74972
|
-
|
|
74979
|
+
const bracketed = host[0] === "[" && host[host.length - 1] === "]";
|
|
74980
|
+
const hasBracket = host[0] === "[" || host[host.length - 1] === "]";
|
|
74981
|
+
if (hasBracket && !bracketed) return { host, isIPV6: false, error: true };
|
|
74982
|
+
let input = bracketed ? host.slice(1, -1) : host;
|
|
74983
|
+
if (bracketed && isIPvFuture(input)) {
|
|
74984
|
+
input = input.toLowerCase();
|
|
74985
|
+
return { host: `[${input}]`, escapedHost: input, isIPV6: false, isIPVFuture: true };
|
|
74986
|
+
}
|
|
74987
|
+
if (findToken(input, ":") < 2) {
|
|
74988
|
+
return { host, isIPV6: false, error: bracketed };
|
|
74989
|
+
}
|
|
74990
|
+
let zoneIdentifier = "";
|
|
74991
|
+
const zoneSeparator = input.indexOf("%");
|
|
74992
|
+
if (zoneSeparator !== -1) {
|
|
74993
|
+
const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === "%25" ? 3 : 1;
|
|
74994
|
+
zoneIdentifier = input.slice(zoneSeparator + separatorLength);
|
|
74995
|
+
if (!isZoneIdentifier(zoneIdentifier)) return { host, isIPV6: false, error: true };
|
|
74996
|
+
input = input.slice(0, zoneSeparator);
|
|
74997
|
+
}
|
|
74998
|
+
const address = normalizeIPv6Address(input);
|
|
74999
|
+
if (address === void 0) return { host, isIPV6: false, error: true };
|
|
75000
|
+
return {
|
|
75001
|
+
host: address + (zoneIdentifier ? "%" + zoneIdentifier : ""),
|
|
75002
|
+
escapedHost: address + (zoneIdentifier ? "%25" + zoneIdentifier : ""),
|
|
75003
|
+
isIPV6: true
|
|
75004
|
+
};
|
|
74973
75005
|
}
|
|
74974
75006
|
function findToken(str, token) {
|
|
74975
75007
|
let ind = 0;
|
|
@@ -75088,7 +75120,8 @@ var require_utils5 = __commonJS({
|
|
|
75088
75120
|
function normalizePathEncoding(input) {
|
|
75089
75121
|
let output = "";
|
|
75090
75122
|
for (let i = 0; i < input.length; i++) {
|
|
75091
|
-
|
|
75123
|
+
const ch = input[i];
|
|
75124
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
75092
75125
|
const hex4 = input.slice(i + 1, i + 3);
|
|
75093
75126
|
if (isHexPair(hex4)) {
|
|
75094
75127
|
const normalizedHex = hex4.toUpperCase();
|
|
@@ -75102,10 +75135,152 @@ var require_utils5 = __commonJS({
|
|
|
75102
75135
|
continue;
|
|
75103
75136
|
}
|
|
75104
75137
|
}
|
|
75105
|
-
if (isPathCharacter(
|
|
75106
|
-
output +=
|
|
75138
|
+
if (isPathCharacter(ch)) {
|
|
75139
|
+
output += ch;
|
|
75140
|
+
} else {
|
|
75141
|
+
const code = input.charCodeAt(i);
|
|
75142
|
+
if (code < 128) {
|
|
75143
|
+
output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
|
|
75144
|
+
} else if (code < 55296 || code > 57343) {
|
|
75145
|
+
output += percentEncodeNonAscii(code);
|
|
75146
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
75147
|
+
const low = input.charCodeAt(i + 1);
|
|
75148
|
+
if (low >= 56320 && low <= 57343) {
|
|
75149
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
75150
|
+
i++;
|
|
75151
|
+
} else {
|
|
75152
|
+
output += percentEncodeNonAscii(65533);
|
|
75153
|
+
}
|
|
75154
|
+
} else {
|
|
75155
|
+
output += percentEncodeNonAscii(65533);
|
|
75156
|
+
}
|
|
75157
|
+
}
|
|
75158
|
+
}
|
|
75159
|
+
return output;
|
|
75160
|
+
}
|
|
75161
|
+
function serializePathEncoding(input, pathNoScheme = false) {
|
|
75162
|
+
let output = "";
|
|
75163
|
+
let firstSegment = pathNoScheme && input[0] !== "/";
|
|
75164
|
+
for (let i = 0; i < input.length; i++) {
|
|
75165
|
+
const ch = input[i];
|
|
75166
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
75167
|
+
const hex4 = input.slice(i + 1, i + 3);
|
|
75168
|
+
if (isHexPair(hex4)) {
|
|
75169
|
+
output += "%" + hex4.toUpperCase();
|
|
75170
|
+
i += 2;
|
|
75171
|
+
continue;
|
|
75172
|
+
}
|
|
75173
|
+
}
|
|
75174
|
+
if (ch === "/") {
|
|
75175
|
+
firstSegment = false;
|
|
75176
|
+
}
|
|
75177
|
+
if (isPathCharacter(ch) && (ch !== ":" || !firstSegment)) {
|
|
75178
|
+
output += ch;
|
|
75179
|
+
} else {
|
|
75180
|
+
const code = input.charCodeAt(i);
|
|
75181
|
+
if (code < 128) {
|
|
75182
|
+
output += BYTE_HEX[code];
|
|
75183
|
+
} else if (code < 55296 || code > 57343) {
|
|
75184
|
+
output += percentEncodeNonAscii(code);
|
|
75185
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
75186
|
+
const low = input.charCodeAt(i + 1);
|
|
75187
|
+
if (low >= 56320 && low <= 57343) {
|
|
75188
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
75189
|
+
i++;
|
|
75190
|
+
} else {
|
|
75191
|
+
output += percentEncodeNonAscii(65533);
|
|
75192
|
+
}
|
|
75193
|
+
} else {
|
|
75194
|
+
output += percentEncodeNonAscii(65533);
|
|
75195
|
+
}
|
|
75196
|
+
}
|
|
75197
|
+
}
|
|
75198
|
+
return output;
|
|
75199
|
+
}
|
|
75200
|
+
function encodeComponent(input, isAllowed) {
|
|
75201
|
+
let output = "";
|
|
75202
|
+
for (let i = 0; i < input.length; i++) {
|
|
75203
|
+
const ch = input[i];
|
|
75204
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
75205
|
+
const hex4 = input.slice(i + 1, i + 3);
|
|
75206
|
+
if (isHexPair(hex4)) {
|
|
75207
|
+
output += "%" + hex4.toUpperCase();
|
|
75208
|
+
i += 2;
|
|
75209
|
+
continue;
|
|
75210
|
+
}
|
|
75211
|
+
}
|
|
75212
|
+
if (isAllowed(ch)) {
|
|
75213
|
+
output += ch;
|
|
75214
|
+
} else {
|
|
75215
|
+
const code = input.charCodeAt(i);
|
|
75216
|
+
if (code < 128) {
|
|
75217
|
+
output += BYTE_HEX[code];
|
|
75218
|
+
} else if (code < 55296 || code > 57343) {
|
|
75219
|
+
output += percentEncodeNonAscii(code);
|
|
75220
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
75221
|
+
const low = input.charCodeAt(i + 1);
|
|
75222
|
+
if (low >= 56320 && low <= 57343) {
|
|
75223
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
75224
|
+
i++;
|
|
75225
|
+
} else {
|
|
75226
|
+
output += percentEncodeNonAscii(65533);
|
|
75227
|
+
}
|
|
75228
|
+
} else {
|
|
75229
|
+
output += percentEncodeNonAscii(65533);
|
|
75230
|
+
}
|
|
75231
|
+
}
|
|
75232
|
+
}
|
|
75233
|
+
return output;
|
|
75234
|
+
}
|
|
75235
|
+
function encodeUserinfo(input) {
|
|
75236
|
+
return encodeComponent(input, isUserinfoCharacter);
|
|
75237
|
+
}
|
|
75238
|
+
function encodeQuery(input) {
|
|
75239
|
+
return encodeComponent(input, isQueryFragmentCharacter);
|
|
75240
|
+
}
|
|
75241
|
+
function encodeFragment(input) {
|
|
75242
|
+
return encodeComponent(input, isQueryFragmentCharacter);
|
|
75243
|
+
}
|
|
75244
|
+
function isEscapeSafe(cp) {
|
|
75245
|
+
return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 42 || cp === 43 || cp === 45 || cp === 46 || cp === 47 || cp === 64 || cp === 95;
|
|
75246
|
+
}
|
|
75247
|
+
function normalizeQueryFragmentEncoding(input) {
|
|
75248
|
+
let output = "";
|
|
75249
|
+
for (let i = 0; i < input.length; i++) {
|
|
75250
|
+
const ch = input[i];
|
|
75251
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
75252
|
+
const hex4 = input.slice(i + 1, i + 3);
|
|
75253
|
+
if (isHexPair(hex4)) {
|
|
75254
|
+
const normalizedHex = hex4.toUpperCase();
|
|
75255
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
75256
|
+
if (isUnreserved(decoded)) {
|
|
75257
|
+
output += decoded;
|
|
75258
|
+
} else {
|
|
75259
|
+
output += "%" + normalizedHex;
|
|
75260
|
+
}
|
|
75261
|
+
i += 2;
|
|
75262
|
+
continue;
|
|
75263
|
+
}
|
|
75264
|
+
}
|
|
75265
|
+
if (isQueryFragmentCharacter(ch)) {
|
|
75266
|
+
output += ch;
|
|
75107
75267
|
} else {
|
|
75108
|
-
|
|
75268
|
+
const code = input.charCodeAt(i);
|
|
75269
|
+
if (code < 128) {
|
|
75270
|
+
output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
|
|
75271
|
+
} else if (code < 55296 || code > 57343) {
|
|
75272
|
+
output += percentEncodeNonAscii(code);
|
|
75273
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
75274
|
+
const low = input.charCodeAt(i + 1);
|
|
75275
|
+
if (low >= 56320 && low <= 57343) {
|
|
75276
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
75277
|
+
i++;
|
|
75278
|
+
} else {
|
|
75279
|
+
output += percentEncodeNonAscii(65533);
|
|
75280
|
+
}
|
|
75281
|
+
} else {
|
|
75282
|
+
output += percentEncodeNonAscii(65533);
|
|
75283
|
+
}
|
|
75109
75284
|
}
|
|
75110
75285
|
}
|
|
75111
75286
|
return output;
|
|
@@ -75128,14 +75303,18 @@ var require_utils5 = __commonJS({
|
|
|
75128
75303
|
function recomposeAuthority(component) {
|
|
75129
75304
|
const uriTokens = [];
|
|
75130
75305
|
if (component.userinfo !== void 0) {
|
|
75131
|
-
uriTokens.push(component.userinfo);
|
|
75306
|
+
uriTokens.push(encodeUserinfo(component.userinfo));
|
|
75132
75307
|
uriTokens.push("@");
|
|
75133
75308
|
}
|
|
75134
75309
|
if (component.host !== void 0) {
|
|
75135
|
-
let host =
|
|
75310
|
+
let host = component.host;
|
|
75136
75311
|
if (!isIPv4(host)) {
|
|
75137
|
-
|
|
75138
|
-
if (ipV6res.isIPV6
|
|
75312
|
+
let ipV6res = normalizeIPv6(host);
|
|
75313
|
+
if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
|
|
75314
|
+
host = normalizePercentEncoding(host, true);
|
|
75315
|
+
ipV6res = normalizeIPv6(host);
|
|
75316
|
+
}
|
|
75317
|
+
if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
|
|
75139
75318
|
host = `[${ipV6res.escapedHost}]`;
|
|
75140
75319
|
} else {
|
|
75141
75320
|
host = reescapeHostDelimiters(host, false);
|
|
@@ -75155,6 +75334,11 @@ var require_utils5 = __commonJS({
|
|
|
75155
75334
|
reescapeHostDelimiters,
|
|
75156
75335
|
normalizePercentEncoding,
|
|
75157
75336
|
normalizePathEncoding,
|
|
75337
|
+
serializePathEncoding,
|
|
75338
|
+
normalizeQueryFragmentEncoding,
|
|
75339
|
+
encodeUserinfo,
|
|
75340
|
+
encodeQuery,
|
|
75341
|
+
encodeFragment,
|
|
75158
75342
|
escapePreservingEscapes,
|
|
75159
75343
|
removeDotSegments,
|
|
75160
75344
|
isIPv4,
|
|
@@ -75165,12 +75349,12 @@ var require_utils5 = __commonJS({
|
|
|
75165
75349
|
}
|
|
75166
75350
|
});
|
|
75167
75351
|
|
|
75168
|
-
// node_modules/.pnpm/fast-uri@3.1.
|
|
75352
|
+
// node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/lib/schemes.js
|
|
75169
75353
|
var require_schemes = __commonJS({
|
|
75170
|
-
"node_modules/.pnpm/fast-uri@3.1.
|
|
75354
|
+
"node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/lib/schemes.js"(exports, module) {
|
|
75171
75355
|
"use strict";
|
|
75172
75356
|
var { isUUID } = require_utils5();
|
|
75173
|
-
var URN_REG =
|
|
75357
|
+
var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
|
|
75174
75358
|
var supportedSchemeNames = (
|
|
75175
75359
|
/** @type {const} */
|
|
75176
75360
|
[
|
|
@@ -75231,9 +75415,10 @@ var require_schemes = __commonJS({
|
|
|
75231
75415
|
wsComponent.secure = void 0;
|
|
75232
75416
|
}
|
|
75233
75417
|
if (wsComponent.resourceName) {
|
|
75234
|
-
const
|
|
75418
|
+
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
75419
|
+
const path4 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
75235
75420
|
wsComponent.path = path4 && path4 !== "/" ? path4 : void 0;
|
|
75236
|
-
wsComponent.query =
|
|
75421
|
+
wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
|
|
75237
75422
|
wsComponent.resourceName = void 0;
|
|
75238
75423
|
}
|
|
75239
75424
|
wsComponent.fragment = void 0;
|
|
@@ -75245,7 +75430,7 @@ var require_schemes = __commonJS({
|
|
|
75245
75430
|
return urnComponent;
|
|
75246
75431
|
}
|
|
75247
75432
|
const matches = urnComponent.path.match(URN_REG);
|
|
75248
|
-
if (matches) {
|
|
75433
|
+
if (matches && matches[0] === urnComponent.path) {
|
|
75249
75434
|
const scheme = options.scheme || urnComponent.scheme || "urn";
|
|
75250
75435
|
urnComponent.nid = matches[1].toLowerCase();
|
|
75251
75436
|
urnComponent.nss = matches[2];
|
|
@@ -75375,12 +75560,21 @@ var require_schemes = __commonJS({
|
|
|
75375
75560
|
}
|
|
75376
75561
|
});
|
|
75377
75562
|
|
|
75378
|
-
// node_modules/.pnpm/fast-uri@3.1.
|
|
75563
|
+
// node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/index.js
|
|
75379
75564
|
var require_fast_uri = __commonJS({
|
|
75380
|
-
"node_modules/.pnpm/fast-uri@3.1.
|
|
75565
|
+
"node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/index.js"(exports, module) {
|
|
75381
75566
|
"use strict";
|
|
75382
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding,
|
|
75567
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils5();
|
|
75383
75568
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
75569
|
+
var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
|
|
75570
|
+
var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
|
|
75571
|
+
function decodeValidScheme(scheme) {
|
|
75572
|
+
const decodedScheme = unescape(String(scheme));
|
|
75573
|
+
if (!VALID_SCHEME.test(decodedScheme)) {
|
|
75574
|
+
throw new TypeError(MALFORMED_SCHEME_ERROR);
|
|
75575
|
+
}
|
|
75576
|
+
return decodedScheme;
|
|
75577
|
+
}
|
|
75384
75578
|
function normalize3(uri, options) {
|
|
75385
75579
|
if (typeof uri === "string") {
|
|
75386
75580
|
uri = /** @type {T} */
|
|
@@ -75393,12 +75587,34 @@ var require_fast_uri = __commonJS({
|
|
|
75393
75587
|
}
|
|
75394
75588
|
function resolve3(baseURI, relativeURI, options) {
|
|
75395
75589
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
75396
|
-
const {
|
|
75397
|
-
|
|
75398
|
-
|
|
75590
|
+
const {
|
|
75591
|
+
parsed: baseParsed,
|
|
75592
|
+
malformedAuthorityOrPort: baseMalformed,
|
|
75593
|
+
malformedPercentEncoding: baseMalformedPercentEncoding,
|
|
75594
|
+
malformedSchemeSpecific: baseMalformedSchemeSpecific,
|
|
75595
|
+
malformedHost: baseMalformedHost,
|
|
75596
|
+
malformedScheme: baseMalformedScheme
|
|
75597
|
+
} = parseWithStatus(baseURI, schemelessOptions);
|
|
75598
|
+
const {
|
|
75599
|
+
parsed: relativeParsed,
|
|
75600
|
+
malformedAuthorityOrPort: relativeMalformed,
|
|
75601
|
+
malformedPercentEncoding: relativeMalformedPercentEncoding,
|
|
75602
|
+
malformedSchemeSpecific: relativeMalformedSchemeSpecific,
|
|
75603
|
+
malformedHost: relativeMalformedHost,
|
|
75604
|
+
malformedScheme: relativeMalformedScheme
|
|
75605
|
+
} = parseWithStatus(relativeURI, schemelessOptions);
|
|
75606
|
+
if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) {
|
|
75399
75607
|
throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
|
|
75400
75608
|
}
|
|
75401
75609
|
const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
|
|
75610
|
+
const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
|
|
75611
|
+
const resolvedHost = resolved.host;
|
|
75612
|
+
const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
|
|
75613
|
+
canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
|
|
75614
|
+
const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !new RegExp("\\P{ASCII}", "u").test(resolvedHost);
|
|
75615
|
+
if (resolved.error && !encodedASCIIHost) {
|
|
75616
|
+
throw new Error(resolved.error);
|
|
75617
|
+
}
|
|
75402
75618
|
schemelessOptions.skipEscape = true;
|
|
75403
75619
|
return serialize(resolved, schemelessOptions);
|
|
75404
75620
|
}
|
|
@@ -75458,7 +75674,7 @@ var require_fast_uri = __commonJS({
|
|
|
75458
75674
|
function equal(uriA, uriB, options) {
|
|
75459
75675
|
const normalizedA = normalizeComparableURI(uriA, options);
|
|
75460
75676
|
const normalizedB = normalizeComparableURI(uriB, options);
|
|
75461
|
-
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA
|
|
75677
|
+
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA === normalizedB;
|
|
75462
75678
|
}
|
|
75463
75679
|
function serialize(cmpts, opts) {
|
|
75464
75680
|
const component = {
|
|
@@ -75479,19 +75695,22 @@ var require_fast_uri = __commonJS({
|
|
|
75479
75695
|
};
|
|
75480
75696
|
const options = Object.assign({}, opts);
|
|
75481
75697
|
const uriTokens = [];
|
|
75698
|
+
if (component.scheme) {
|
|
75699
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
75700
|
+
}
|
|
75482
75701
|
const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
|
|
75483
75702
|
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
75703
|
+
const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0;
|
|
75704
|
+
const pathNoScheme = !options.skipEscape && component.scheme === void 0 && !hasAuthority;
|
|
75484
75705
|
if (component.path !== void 0) {
|
|
75485
75706
|
if (!options.skipEscape) {
|
|
75486
|
-
component.path =
|
|
75487
|
-
if (component.scheme !== void 0) {
|
|
75488
|
-
component.path = component.path.split("%3A").join(":");
|
|
75489
|
-
}
|
|
75707
|
+
component.path = serializePathEncoding(component.path, pathNoScheme);
|
|
75490
75708
|
} else {
|
|
75491
75709
|
component.path = normalizePercentEncoding(component.path);
|
|
75492
75710
|
}
|
|
75493
75711
|
}
|
|
75494
75712
|
if (options.reference !== "suffix" && component.scheme) {
|
|
75713
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
75495
75714
|
uriTokens.push(component.scheme, ":");
|
|
75496
75715
|
}
|
|
75497
75716
|
const authority = recomposeAuthority(component);
|
|
@@ -75509,16 +75728,19 @@ var require_fast_uri = __commonJS({
|
|
|
75509
75728
|
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
75510
75729
|
s = removeDotSegments(s);
|
|
75511
75730
|
}
|
|
75731
|
+
if (pathNoScheme) {
|
|
75732
|
+
s = serializePathEncoding(s, true);
|
|
75733
|
+
}
|
|
75512
75734
|
if (authority === void 0 && s[0] === "/" && s[1] === "/") {
|
|
75513
75735
|
s = "/%2F" + s.slice(2);
|
|
75514
75736
|
}
|
|
75515
75737
|
uriTokens.push(s);
|
|
75516
75738
|
}
|
|
75517
75739
|
if (component.query !== void 0) {
|
|
75518
|
-
uriTokens.push("?", component.query);
|
|
75740
|
+
uriTokens.push("?", encodeQuery(component.query));
|
|
75519
75741
|
}
|
|
75520
75742
|
if (component.fragment !== void 0) {
|
|
75521
|
-
uriTokens.push("#", component.fragment);
|
|
75743
|
+
uriTokens.push("#", encodeFragment(component.fragment));
|
|
75522
75744
|
}
|
|
75523
75745
|
return uriTokens.join("");
|
|
75524
75746
|
}
|
|
@@ -75534,6 +75756,32 @@ var require_fast_uri = __commonJS({
|
|
|
75534
75756
|
}
|
|
75535
75757
|
return void 0;
|
|
75536
75758
|
}
|
|
75759
|
+
function hasMalformedPercentEncoding(component) {
|
|
75760
|
+
if (component === void 0) return false;
|
|
75761
|
+
let percent = component.indexOf("%");
|
|
75762
|
+
while (percent !== -1) {
|
|
75763
|
+
if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) {
|
|
75764
|
+
return true;
|
|
75765
|
+
}
|
|
75766
|
+
percent = component.indexOf("%", percent + 3);
|
|
75767
|
+
}
|
|
75768
|
+
return false;
|
|
75769
|
+
}
|
|
75770
|
+
function hasMalformedComponentPercentEncoding(matches) {
|
|
75771
|
+
const host = matches[4];
|
|
75772
|
+
return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !(host[0] === "[" && host[host.length - 1] === "]") && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
|
|
75773
|
+
}
|
|
75774
|
+
function canonicalizeHost(parsed2, options, schemeHandler, isIP) {
|
|
75775
|
+
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed2.host && parsed2.host[0] !== "[" && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed2.host)) {
|
|
75776
|
+
try {
|
|
75777
|
+
parsed2.host = new URL("http://" + parsed2.host).hostname;
|
|
75778
|
+
} catch (e) {
|
|
75779
|
+
parsed2.error = parsed2.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
75780
|
+
return true;
|
|
75781
|
+
}
|
|
75782
|
+
}
|
|
75783
|
+
return false;
|
|
75784
|
+
}
|
|
75537
75785
|
function parseWithStatus(uri, opts) {
|
|
75538
75786
|
const options = Object.assign({}, opts);
|
|
75539
75787
|
const parsed2 = {
|
|
@@ -75546,6 +75794,11 @@ var require_fast_uri = __commonJS({
|
|
|
75546
75794
|
fragment: void 0
|
|
75547
75795
|
};
|
|
75548
75796
|
let malformedAuthorityOrPort = false;
|
|
75797
|
+
let malformedPercentEncoding = false;
|
|
75798
|
+
let malformedSchemeSpecific = false;
|
|
75799
|
+
let malformedHost = false;
|
|
75800
|
+
let malformedIPLiteral = false;
|
|
75801
|
+
let malformedScheme = false;
|
|
75549
75802
|
let isIP = false;
|
|
75550
75803
|
if (options.reference === "suffix") {
|
|
75551
75804
|
if (options.scheme) {
|
|
@@ -75582,6 +75835,19 @@ var require_fast_uri = __commonJS({
|
|
|
75582
75835
|
parsed2.path = matches[6] || "";
|
|
75583
75836
|
parsed2.query = matches[7];
|
|
75584
75837
|
parsed2.fragment = matches[8];
|
|
75838
|
+
if (parsed2.scheme !== void 0) {
|
|
75839
|
+
const decodedScheme = unescape(parsed2.scheme);
|
|
75840
|
+
if (VALID_SCHEME.test(decodedScheme)) {
|
|
75841
|
+
parsed2.scheme = decodedScheme.toLowerCase();
|
|
75842
|
+
} else {
|
|
75843
|
+
parsed2.error = parsed2.error || MALFORMED_SCHEME_ERROR;
|
|
75844
|
+
malformedScheme = true;
|
|
75845
|
+
}
|
|
75846
|
+
}
|
|
75847
|
+
malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches);
|
|
75848
|
+
if (malformedPercentEncoding) {
|
|
75849
|
+
parsed2.error = parsed2.error || "URI contains malformed percent-encoding.";
|
|
75850
|
+
}
|
|
75585
75851
|
if (isNaN(parsed2.port)) {
|
|
75586
75852
|
parsed2.port = matches[5];
|
|
75587
75853
|
}
|
|
@@ -75593,9 +75859,15 @@ var require_fast_uri = __commonJS({
|
|
|
75593
75859
|
if (parsed2.host) {
|
|
75594
75860
|
const ipv4result = isIPv4(parsed2.host);
|
|
75595
75861
|
if (ipv4result === false) {
|
|
75862
|
+
const bracketedIPLiteral = parsed2.host[0] === "[" && parsed2.host[parsed2.host.length - 1] === "]";
|
|
75596
75863
|
const ipv6result = normalizeIPv6(parsed2.host);
|
|
75597
|
-
|
|
75598
|
-
|
|
75864
|
+
isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
|
|
75865
|
+
malformedIPLiteral = bracketedIPLiteral && ipv6result.error === true;
|
|
75866
|
+
parsed2.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
|
|
75867
|
+
if (malformedIPLiteral) {
|
|
75868
|
+
parsed2.error = parsed2.error || "URI host is malformed.";
|
|
75869
|
+
malformedAuthorityOrPort = true;
|
|
75870
|
+
}
|
|
75599
75871
|
} else {
|
|
75600
75872
|
isIP = true;
|
|
75601
75873
|
}
|
|
@@ -75613,42 +75885,34 @@ var require_fast_uri = __commonJS({
|
|
|
75613
75885
|
parsed2.error = parsed2.error || "URI is not a " + options.reference + " reference.";
|
|
75614
75886
|
}
|
|
75615
75887
|
const schemeHandler = getSchemeHandler(options.scheme || parsed2.scheme);
|
|
75616
|
-
|
|
75617
|
-
if (parsed2.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed2.host)) {
|
|
75618
|
-
try {
|
|
75619
|
-
parsed2.host = new URL("http://" + parsed2.host).hostname;
|
|
75620
|
-
} catch (e) {
|
|
75621
|
-
parsed2.error = parsed2.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
75622
|
-
}
|
|
75623
|
-
}
|
|
75624
|
-
}
|
|
75888
|
+
malformedHost = canonicalizeHost(parsed2, options, schemeHandler, isIP);
|
|
75625
75889
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
75626
75890
|
if (uri.indexOf("%") !== -1) {
|
|
75627
|
-
if (parsed2.
|
|
75628
|
-
parsed2.
|
|
75629
|
-
|
|
75630
|
-
if (parsed2.host !== void 0) {
|
|
75631
|
-
parsed2.host = reescapeHostDelimiters(unescape(parsed2.host), isIP);
|
|
75891
|
+
if (parsed2.host !== void 0 && !malformedIPLiteral) {
|
|
75892
|
+
const host = isIP ? parsed2.host : normalizePercentEncoding(parsed2.host, true);
|
|
75893
|
+
parsed2.host = reescapeHostDelimiters(host, isIP);
|
|
75632
75894
|
}
|
|
75633
75895
|
}
|
|
75634
75896
|
if (parsed2.path) {
|
|
75635
75897
|
parsed2.path = normalizePathEncoding(parsed2.path);
|
|
75636
75898
|
}
|
|
75899
|
+
if (parsed2.query) {
|
|
75900
|
+
parsed2.query = normalizeQueryFragmentEncoding(parsed2.query);
|
|
75901
|
+
}
|
|
75637
75902
|
if (parsed2.fragment) {
|
|
75638
|
-
|
|
75639
|
-
parsed2.fragment = encodeURI(decodeURIComponent(parsed2.fragment));
|
|
75640
|
-
} catch {
|
|
75641
|
-
parsed2.error = parsed2.error || "URI malformed";
|
|
75642
|
-
}
|
|
75903
|
+
parsed2.fragment = normalizeQueryFragmentEncoding(parsed2.fragment);
|
|
75643
75904
|
}
|
|
75644
75905
|
}
|
|
75645
75906
|
if (schemeHandler && schemeHandler.parse) {
|
|
75646
75907
|
schemeHandler.parse(parsed2, options);
|
|
75908
|
+
if (schemeHandler === SCHEMES.urn && parsed2.nid === void 0) {
|
|
75909
|
+
malformedSchemeSpecific = true;
|
|
75910
|
+
}
|
|
75647
75911
|
}
|
|
75648
75912
|
} else {
|
|
75649
75913
|
parsed2.error = parsed2.error || "URI can not be parsed.";
|
|
75650
75914
|
}
|
|
75651
|
-
return { parsed: parsed2, malformedAuthorityOrPort };
|
|
75915
|
+
return { parsed: parsed2, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
|
|
75652
75916
|
}
|
|
75653
75917
|
function parse6(uri, opts) {
|
|
75654
75918
|
return parseWithStatus(uri, opts).parsed;
|
|
@@ -75657,20 +75921,28 @@ var require_fast_uri = __commonJS({
|
|
|
75657
75921
|
return normalizeStringWithStatus(uri, opts).normalized;
|
|
75658
75922
|
}
|
|
75659
75923
|
function normalizeStringWithStatus(uri, opts) {
|
|
75660
|
-
const { parsed: parsed2, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
75924
|
+
const { parsed: parsed2, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
|
|
75661
75925
|
return {
|
|
75662
|
-
normalized: malformedAuthorityOrPort ? uri : serialize(parsed2, opts),
|
|
75663
|
-
malformedAuthorityOrPort
|
|
75926
|
+
normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed2, opts),
|
|
75927
|
+
malformedAuthorityOrPort,
|
|
75928
|
+
malformedPercentEncoding,
|
|
75929
|
+
malformedSchemeSpecific,
|
|
75930
|
+
malformedHost,
|
|
75931
|
+
malformedScheme
|
|
75664
75932
|
};
|
|
75665
75933
|
}
|
|
75666
75934
|
function normalizeComparableURI(uri, opts) {
|
|
75667
|
-
if (typeof uri
|
|
75668
|
-
|
|
75669
|
-
return malformedAuthorityOrPort ? void 0 : normalized;
|
|
75935
|
+
if (typeof uri !== "string" && typeof uri !== "object") {
|
|
75936
|
+
return void 0;
|
|
75670
75937
|
}
|
|
75671
|
-
|
|
75672
|
-
|
|
75938
|
+
let value2;
|
|
75939
|
+
try {
|
|
75940
|
+
value2 = typeof uri === "string" ? uri : serialize(uri, opts);
|
|
75941
|
+
} catch {
|
|
75942
|
+
return void 0;
|
|
75673
75943
|
}
|
|
75944
|
+
const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value2, opts);
|
|
75945
|
+
return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? void 0 : normalized;
|
|
75674
75946
|
}
|
|
75675
75947
|
var fastUri = {
|
|
75676
75948
|
SCHEMES,
|
|
@@ -80932,137 +81204,6 @@ var require_light = __commonJS({
|
|
|
80932
81204
|
}
|
|
80933
81205
|
});
|
|
80934
81206
|
|
|
80935
|
-
// node_modules/.pnpm/content-type@2.0.0/node_modules/content-type/dist/index.js
|
|
80936
|
-
var require_dist4 = __commonJS({
|
|
80937
|
-
"node_modules/.pnpm/content-type@2.0.0/node_modules/content-type/dist/index.js"(exports) {
|
|
80938
|
-
"use strict";
|
|
80939
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
80940
|
-
exports.format = format2;
|
|
80941
|
-
exports.parse = parse6;
|
|
80942
|
-
var TEXT_REGEXP = /^[\u0009\u0020-\u007e\u0080-\u00ff]*$/;
|
|
80943
|
-
var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
80944
|
-
var QUOTE_REGEXP = /[\\"]/g;
|
|
80945
|
-
var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
80946
|
-
var NullObject = /* @__PURE__ */ (() => {
|
|
80947
|
-
const C = function() {
|
|
80948
|
-
};
|
|
80949
|
-
C.prototype = /* @__PURE__ */ Object.create(null);
|
|
80950
|
-
return C;
|
|
80951
|
-
})();
|
|
80952
|
-
function format2(obj) {
|
|
80953
|
-
const { type: type2, parameters } = obj;
|
|
80954
|
-
if (!type2 || !TYPE_REGEXP.test(type2)) {
|
|
80955
|
-
throw new TypeError(`Invalid type: ${type2}`);
|
|
80956
|
-
}
|
|
80957
|
-
let result = type2;
|
|
80958
|
-
if (parameters) {
|
|
80959
|
-
for (const param of Object.keys(parameters)) {
|
|
80960
|
-
if (!TOKEN_REGEXP.test(param)) {
|
|
80961
|
-
throw new TypeError(`Invalid parameter name: ${param}`);
|
|
80962
|
-
}
|
|
80963
|
-
result += `; ${param}=${qstring(parameters[param])}`;
|
|
80964
|
-
}
|
|
80965
|
-
}
|
|
80966
|
-
return result;
|
|
80967
|
-
}
|
|
80968
|
-
function parse6(header, options) {
|
|
80969
|
-
const len = header.length;
|
|
80970
|
-
let index = skipOWS(header, 0, len);
|
|
80971
|
-
const valueStart = index;
|
|
80972
|
-
index = skipValue(header, index, len);
|
|
80973
|
-
const valueEnd = trailingOWS(header, valueStart, index);
|
|
80974
|
-
const type2 = header.slice(valueStart, valueEnd).toLowerCase();
|
|
80975
|
-
const parameters = options?.parameters === false ? new NullObject() : parseParameters(header, index, len);
|
|
80976
|
-
return { type: type2, parameters };
|
|
80977
|
-
}
|
|
80978
|
-
var SP = 32;
|
|
80979
|
-
var HTAB = 9;
|
|
80980
|
-
var SEMI = 59;
|
|
80981
|
-
var EQ = 61;
|
|
80982
|
-
var DQUOTE = 34;
|
|
80983
|
-
var BSLASH = 92;
|
|
80984
|
-
function parseParameters(header, index, len) {
|
|
80985
|
-
const parameters = new NullObject();
|
|
80986
|
-
parameter: while (index < len) {
|
|
80987
|
-
index = skipOWS(header, index + 1, len);
|
|
80988
|
-
const keyStart = index;
|
|
80989
|
-
while (index < len) {
|
|
80990
|
-
const code = header.charCodeAt(index);
|
|
80991
|
-
if (code === SEMI)
|
|
80992
|
-
continue parameter;
|
|
80993
|
-
if (code === EQ) {
|
|
80994
|
-
const keyEnd = trailingOWS(header, keyStart, index);
|
|
80995
|
-
const key = header.slice(keyStart, keyEnd).toLowerCase();
|
|
80996
|
-
index = skipOWS(header, index + 1, len);
|
|
80997
|
-
if (index < len && header.charCodeAt(index) === DQUOTE) {
|
|
80998
|
-
index++;
|
|
80999
|
-
let value2 = "";
|
|
81000
|
-
while (index < len) {
|
|
81001
|
-
const code2 = header.charCodeAt(index++);
|
|
81002
|
-
if (code2 === DQUOTE) {
|
|
81003
|
-
index = skipValue(header, index, len);
|
|
81004
|
-
if (parameters[key] === void 0)
|
|
81005
|
-
parameters[key] = value2;
|
|
81006
|
-
break;
|
|
81007
|
-
}
|
|
81008
|
-
if (code2 === BSLASH && index < len) {
|
|
81009
|
-
value2 += header[index++];
|
|
81010
|
-
continue;
|
|
81011
|
-
}
|
|
81012
|
-
value2 += String.fromCharCode(code2);
|
|
81013
|
-
}
|
|
81014
|
-
continue parameter;
|
|
81015
|
-
}
|
|
81016
|
-
const valueStart = index;
|
|
81017
|
-
index = skipValue(header, index, len);
|
|
81018
|
-
if (parameters[key] === void 0) {
|
|
81019
|
-
const valueEnd = trailingOWS(header, valueStart, index);
|
|
81020
|
-
parameters[key] = header.slice(valueStart, valueEnd);
|
|
81021
|
-
}
|
|
81022
|
-
continue parameter;
|
|
81023
|
-
}
|
|
81024
|
-
index++;
|
|
81025
|
-
}
|
|
81026
|
-
}
|
|
81027
|
-
return parameters;
|
|
81028
|
-
}
|
|
81029
|
-
function skipValue(str, index, len) {
|
|
81030
|
-
while (index < len) {
|
|
81031
|
-
const char = str.charCodeAt(index);
|
|
81032
|
-
if (char === SEMI)
|
|
81033
|
-
break;
|
|
81034
|
-
index++;
|
|
81035
|
-
}
|
|
81036
|
-
return index;
|
|
81037
|
-
}
|
|
81038
|
-
function skipOWS(header, index, len) {
|
|
81039
|
-
while (index < len) {
|
|
81040
|
-
const char = header.charCodeAt(index);
|
|
81041
|
-
if (char !== SP && char !== HTAB)
|
|
81042
|
-
break;
|
|
81043
|
-
index++;
|
|
81044
|
-
}
|
|
81045
|
-
return index;
|
|
81046
|
-
}
|
|
81047
|
-
function trailingOWS(header, start, end) {
|
|
81048
|
-
while (end > start) {
|
|
81049
|
-
const char = header.charCodeAt(end - 1);
|
|
81050
|
-
if (char !== SP && char !== HTAB)
|
|
81051
|
-
break;
|
|
81052
|
-
end--;
|
|
81053
|
-
}
|
|
81054
|
-
return end;
|
|
81055
|
-
}
|
|
81056
|
-
function qstring(str) {
|
|
81057
|
-
if (TOKEN_REGEXP.test(str))
|
|
81058
|
-
return str;
|
|
81059
|
-
if (TEXT_REGEXP.test(str))
|
|
81060
|
-
return `"${str.replace(QUOTE_REGEXP, "\\$&")}"`;
|
|
81061
|
-
throw new TypeError(`Invalid parameter value: ${str}`);
|
|
81062
|
-
}
|
|
81063
|
-
}
|
|
81064
|
-
});
|
|
81065
|
-
|
|
81066
81207
|
// node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/Event.js
|
|
81067
81208
|
var require_Event = __commonJS({
|
|
81068
81209
|
"node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/Event.js"(exports, module) {
|
|
@@ -83105,7 +83246,7 @@ var require_select = __commonJS({
|
|
|
83105
83246
|
var compareDocumentPosition = function(a, b) {
|
|
83106
83247
|
return a.compareDocumentPosition(b);
|
|
83107
83248
|
};
|
|
83108
|
-
var
|
|
83249
|
+
var order2 = function(a, b) {
|
|
83109
83250
|
return compareDocumentPosition(a, b) & 2 ? 1 : -1;
|
|
83110
83251
|
};
|
|
83111
83252
|
var next2 = function(el) {
|
|
@@ -83786,7 +83927,7 @@ var require_select = __commonJS({
|
|
|
83786
83927
|
}
|
|
83787
83928
|
}
|
|
83788
83929
|
}
|
|
83789
|
-
results.sort(
|
|
83930
|
+
results.sort(order2);
|
|
83790
83931
|
}
|
|
83791
83932
|
return results;
|
|
83792
83933
|
};
|
|
@@ -103673,7 +103814,12 @@ var providers = {
|
|
|
103673
103814
|
displayName: "O3",
|
|
103674
103815
|
resolve: "openai/o3",
|
|
103675
103816
|
effort: ["low", "medium", "high"],
|
|
103676
|
-
openRouterResolve: "openrouter/openai/o3"
|
|
103817
|
+
openRouterResolve: "openrouter/openai/o3",
|
|
103818
|
+
// OpenRouter publishes a reasoning TOGGLE for o3 where direct OpenAI
|
|
103819
|
+
// publishes a ladder, so the route genuinely has no rungs. `[]` rather
|
|
103820
|
+
// than omitting the field: an absent openRouterEffort falls through to
|
|
103821
|
+
// `effort` and would send a rung this route rejects.
|
|
103822
|
+
openRouterEffort: []
|
|
103677
103823
|
}
|
|
103678
103824
|
}
|
|
103679
103825
|
}),
|
|
@@ -103838,14 +103984,19 @@ var providers = {
|
|
|
103838
103984
|
effort: ["low", "medium", "high", "xhigh", "max"],
|
|
103839
103985
|
openRouterResolve: "openrouter/anthropic/claude-opus-5",
|
|
103840
103986
|
subagentModel: "claude-sonnet",
|
|
103841
|
-
// TEMPORARY — clear this when
|
|
103842
|
-
//
|
|
103843
|
-
//
|
|
103844
|
-
//
|
|
103845
|
-
// claude-
|
|
103846
|
-
//
|
|
103847
|
-
// just produces nothing until it is
|
|
103848
|
-
// zero-output failures from 2026-08-23.
|
|
103987
|
+
// TEMPORARY — clear this ONLY when opus completes a run through opencode,
|
|
103988
|
+
// never when the endpoint merely answers. Zen LISTS claude-opus-5 in
|
|
103989
|
+
// /zen/v1/models, so the catalog test passes; on 2026-08-25 the endpoint
|
|
103990
|
+
// itself answered 503 `Upstream request failed: Endpoint is unavailable.`
|
|
103991
|
+
// (measured 5/5; claude-sonnet-5, claude-opus-4-8, claude-haiku-4-5 and
|
|
103992
|
+
// claude-fable-5 all 200 on the same key). opencode retries above the AI
|
|
103993
|
+
// SDK emitting no part.updated, so a run just produces nothing until it is
|
|
103994
|
+
// killed — metaideas/init logged six zero-output failures from 2026-08-23.
|
|
103995
|
+
// The 503 has since cleared and the model is STILL unusable: re-measured
|
|
103996
|
+
// 2026-08-26, direct POST /zen/v1/messages is 10/10 200 at 1.3-4.1s while
|
|
103997
|
+
// `opencode run --model opencode/claude-opus-5` on the same trivial prompt
|
|
103998
|
+
// emitted nothing for 240s in CI. A raw-endpoint 200 is not runtime
|
|
103999
|
+
// availability. see wiki/opencode-silent-stall.md
|
|
103849
104000
|
fallback: "opencode/claude-sonnet"
|
|
103850
104001
|
},
|
|
103851
104002
|
"claude-sonnet": {
|
|
@@ -103976,22 +104127,139 @@ var providers = {
|
|
|
103976
104127
|
}
|
|
103977
104128
|
}
|
|
103978
104129
|
}),
|
|
104130
|
+
// OpenCode Go is a separate $10/mo subscription from Zen, served on its own
|
|
104131
|
+
// base URL (`https://opencode.ai/zen/go/v1`) but authenticated with the SAME
|
|
104132
|
+
// `OPENCODE_API_KEY`. it carries the open-weight coding models plus a couple
|
|
104133
|
+
// of frontier ones, and 14 of the ids below are served ONLY here — Zen's
|
|
104134
|
+
// `/v1/models` does not list glm-5.3*, qwen3.7/3.8-*, mimo-*, longcat-2.0,
|
|
104135
|
+
// hy3 or muse-spark. so for a Go subscriber this provider is not a duplicate
|
|
104136
|
+
// route to Zen, it is the only route to most of what they pay for.
|
|
104137
|
+
// like `opencode` and `openrouter` this is a ROUTER, not a vendor: slugs and
|
|
104138
|
+
// display names mirror the upstream brand tier, and the picker groups them
|
|
104139
|
+
// under the upstream vendor.
|
|
103979
104140
|
"opencode-go": provider({
|
|
103980
104141
|
displayName: "OpenCode Go",
|
|
103981
104142
|
envVars: ["OPENCODE_API_KEY"],
|
|
103982
104143
|
models: {
|
|
104144
|
+
// Z.ai — the plan's flagship coding family, and the only route the
|
|
104145
|
+
// catalog offers to GLM at all.
|
|
104146
|
+
glm: {
|
|
104147
|
+
displayName: "GLM",
|
|
104148
|
+
resolve: "opencode-go/glm-5.3",
|
|
104149
|
+
effort: ["low", "high", "max"],
|
|
104150
|
+
openRouterResolve: "openrouter/z-ai/glm-5.3",
|
|
104151
|
+
preferred: true,
|
|
104152
|
+
subagentModel: "glm-flash"
|
|
104153
|
+
},
|
|
104154
|
+
"glm-flash": {
|
|
104155
|
+
displayName: "GLM Flash",
|
|
104156
|
+
resolve: "opencode-go/glm-5.3-flash",
|
|
104157
|
+
effort: ["low", "high", "max"],
|
|
104158
|
+
openRouterResolve: "openrouter/z-ai/glm-5.3-flash"
|
|
104159
|
+
},
|
|
104160
|
+
// legacy alias — the slug pinned a version instead of a brand tier and
|
|
104161
|
+
// was already resolving to 5.2 under a "GLM 5.2" label. folds forward to
|
|
104162
|
+
// the tier slug; 16 repos and 9 accounts still hold it.
|
|
103983
104163
|
"glm-5.1": {
|
|
103984
104164
|
displayName: "GLM 5.2",
|
|
103985
104165
|
resolve: "opencode-go/glm-5.2",
|
|
103986
104166
|
effort: ["high", "max"],
|
|
103987
104167
|
openRouterEffort: ["high", "xhigh"],
|
|
103988
104168
|
openRouterResolve: "openrouter/z-ai/glm-5.2",
|
|
103989
|
-
|
|
104169
|
+
fallback: "opencode-go/glm"
|
|
104170
|
+
},
|
|
104171
|
+
// Moonshot — parity with moonshotai/* and openrouter/*.
|
|
104172
|
+
"kimi-k3": {
|
|
104173
|
+
displayName: "Kimi K3",
|
|
104174
|
+
resolve: "opencode-go/kimi-k3",
|
|
104175
|
+
// Go publishes a single rung for K3 where the OpenRouter route
|
|
104176
|
+
// publishes three, so every position lands on `max` here.
|
|
104177
|
+
effort: ["max"],
|
|
104178
|
+
openRouterEffort: ["low", "high", "max"],
|
|
104179
|
+
openRouterResolve: "openrouter/moonshotai/kimi-k3",
|
|
104180
|
+
subagentModel: "kimi-k2"
|
|
103990
104181
|
},
|
|
103991
104182
|
"kimi-k2": {
|
|
103992
104183
|
displayName: "Kimi K2",
|
|
103993
104184
|
resolve: "opencode-go/kimi-k2.7-code",
|
|
103994
104185
|
openRouterResolve: "openrouter/moonshotai/kimi-k2.7-code"
|
|
104186
|
+
},
|
|
104187
|
+
// DeepSeek and Muse Spark are deliberately ABSENT even though Go serves
|
|
104188
|
+
// them and prices DeepSeek Pro below Zen. each sits behind a per-workspace
|
|
104189
|
+
// opt-in that is off by default — measured, the run dies with
|
|
104190
|
+
// `RegionError` ("only available hosted in China") and `DataPolicyError`
|
|
104191
|
+
// ("collects data used to improve its quality"). that toggle lives on the
|
|
104192
|
+
// CUSTOMER's OpenCode workspace, so no change here can satisfy it, and a
|
|
104193
|
+
// picker row that fails for almost everyone is worse than none. DeepSeek
|
|
104194
|
+
// stays reachable ungated via `deepseek/*`, `opencode/*` and
|
|
104195
|
+
// `openrouter/*`; both remain runnable by full specifier once opted in.
|
|
104196
|
+
// Alibaba — new vendor family for the catalog; Zen serves neither tier.
|
|
104197
|
+
"qwen-max": {
|
|
104198
|
+
displayName: "Qwen Max",
|
|
104199
|
+
resolve: "opencode-go/qwen3.8-max",
|
|
104200
|
+
// both routes publish rungs, and they are different sets rather than
|
|
104201
|
+
// different spellings of one — OpenRouter carries a `minimal` and a
|
|
104202
|
+
// `high` the Go route does not.
|
|
104203
|
+
effort: ["low", "medium", "xhigh"],
|
|
104204
|
+
openRouterEffort: ["minimal", "low", "medium", "high", "xhigh"],
|
|
104205
|
+
openRouterResolve: "openrouter/qwen/qwen3.8-max"
|
|
104206
|
+
},
|
|
104207
|
+
"qwen-plus": {
|
|
104208
|
+
displayName: "Qwen Plus",
|
|
104209
|
+
resolve: "opencode-go/qwen3.7-plus",
|
|
104210
|
+
openRouterResolve: "openrouter/qwen/qwen3.7-plus"
|
|
104211
|
+
},
|
|
104212
|
+
// MiniMax — parity with opencode/* and openrouter/*; the m2 slug pins the
|
|
104213
|
+
// line for DB stability while the resolve tracks the current m2.7.
|
|
104214
|
+
"minimax-m3": {
|
|
104215
|
+
displayName: "MiniMax M3",
|
|
104216
|
+
resolve: "opencode-go/minimax-m3",
|
|
104217
|
+
openRouterResolve: "openrouter/minimax/minimax-m3"
|
|
104218
|
+
},
|
|
104219
|
+
"minimax-m2.5": {
|
|
104220
|
+
displayName: "MiniMax M2",
|
|
104221
|
+
resolve: "opencode-go/minimax-m2.7",
|
|
104222
|
+
openRouterResolve: "openrouter/minimax/minimax-m2.7"
|
|
104223
|
+
},
|
|
104224
|
+
// Xiaomi — Go-only; Zen serves the free `mimo-v2-pro-free` promo instead.
|
|
104225
|
+
"mimo-pro": {
|
|
104226
|
+
displayName: "MiMo Pro",
|
|
104227
|
+
resolve: "opencode-go/mimo-v2.5-pro",
|
|
104228
|
+
openRouterResolve: "openrouter/xiaomi/mimo-v2.5-pro"
|
|
104229
|
+
},
|
|
104230
|
+
// Meituan — Go-only.
|
|
104231
|
+
longcat: {
|
|
104232
|
+
displayName: "LongCat",
|
|
104233
|
+
resolve: "opencode-go/longcat-2.0",
|
|
104234
|
+
openRouterResolve: "openrouter/meituan/longcat-2.0"
|
|
104235
|
+
},
|
|
104236
|
+
// Tencent — Go-only, and the cheapest model on the plan by an order of
|
|
104237
|
+
// magnitude (0.0175/0.0725). Hy3 succeeds the Hunyuan 2.0 line, so the
|
|
104238
|
+
// generation is part of the product name the way Kimi K2/K3 is.
|
|
104239
|
+
hy3: {
|
|
104240
|
+
displayName: "Hy3",
|
|
104241
|
+
resolve: "opencode-go/hy3",
|
|
104242
|
+
effort: ["none", "low", "high"],
|
|
104243
|
+
openRouterResolve: "openrouter/tencent/hy3"
|
|
104244
|
+
},
|
|
104245
|
+
// xAI and OpenAI — the two non-open models on the plan. same list price as
|
|
104246
|
+
// Zen, but a Go subscription covers them where Zen meters them.
|
|
104247
|
+
// Go is the only route that has retired grok-4.5 (models.dev marks
|
|
104248
|
+
// `opencode-go/grok-4.5` deprecated while every other provider still
|
|
104249
|
+
// serves it), so this alias LEADS `xai/grok` by a generation. a mirror
|
|
104250
|
+
// that leads is safe; it is the trailing case that rots — see
|
|
104251
|
+
// wiki/models-catalog.md on `opencode/kimi-k2`.
|
|
104252
|
+
grok: {
|
|
104253
|
+
displayName: "Grok",
|
|
104254
|
+
resolve: "opencode-go/grok-4.6",
|
|
104255
|
+
effort: ["low", "medium", "high", "xhigh"],
|
|
104256
|
+
openRouterResolve: "openrouter/x-ai/grok-4.6"
|
|
104257
|
+
},
|
|
104258
|
+
"gpt-luna": {
|
|
104259
|
+
displayName: "GPT Luna",
|
|
104260
|
+
resolve: "opencode-go/gpt-5.6-luna",
|
|
104261
|
+
effort: ["none", "low", "medium", "high", "xhigh", "max"],
|
|
104262
|
+
openRouterResolve: "openrouter/openai/gpt-5.6-luna"
|
|
103995
104263
|
}
|
|
103996
104264
|
}
|
|
103997
104265
|
}),
|
|
@@ -104168,7 +104436,6 @@ var providers = {
|
|
|
104168
104436
|
"o4-mini": {
|
|
104169
104437
|
displayName: "O4 Mini",
|
|
104170
104438
|
resolve: "openrouter/openai/o4-mini",
|
|
104171
|
-
effort: ["low", "medium", "high"],
|
|
104172
104439
|
openRouterResolve: "openrouter/openai/o4-mini"
|
|
104173
104440
|
},
|
|
104174
104441
|
"gemini-pro": {
|
|
@@ -104669,7 +104936,6 @@ function logTokenTable(t) {
|
|
|
104669
104936
|
|
|
104670
104937
|
// utils/globals.ts
|
|
104671
104938
|
import { existsSync } from "node:fs";
|
|
104672
|
-
var isCloudflareSandbox = !!process.env.CLOUDFLARE_APPLICATION_ID && !!process.env.SANDBOX_VERSION;
|
|
104673
104939
|
var isGitHubActions = !!process.env.GITHUB_ACTIONS;
|
|
104674
104940
|
var isInsideDocker = existsSync("/.dockerenv");
|
|
104675
104941
|
|
|
@@ -105200,7 +105466,7 @@ var import_semver = __toESM(require_semver2(), 1);
|
|
|
105200
105466
|
// package.json
|
|
105201
105467
|
var package_default = {
|
|
105202
105468
|
name: "pullfrog",
|
|
105203
|
-
version: "0.1.
|
|
105469
|
+
version: "0.1.65",
|
|
105204
105470
|
type: "module",
|
|
105205
105471
|
bin: {
|
|
105206
105472
|
pullfrog: "dist/cli.mjs",
|
|
@@ -123200,7 +123466,7 @@ Fuse.use = function(...plugins) {
|
|
|
123200
123466
|
};
|
|
123201
123467
|
var entry_default = Fuse;
|
|
123202
123468
|
|
|
123203
|
-
// node_modules/.pnpm/hono@4.13.
|
|
123469
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/compose.js
|
|
123204
123470
|
var compose = (middleware, onError, onNotFound) => {
|
|
123205
123471
|
return (context, next2) => {
|
|
123206
123472
|
let index = -1;
|
|
@@ -123244,10 +123510,10 @@ var compose = (middleware, onError, onNotFound) => {
|
|
|
123244
123510
|
};
|
|
123245
123511
|
};
|
|
123246
123512
|
|
|
123247
|
-
// node_modules/.pnpm/hono@4.13.
|
|
123513
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/request/constants.js
|
|
123248
123514
|
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
|
|
123249
123515
|
|
|
123250
|
-
// node_modules/.pnpm/hono@4.13.
|
|
123516
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/utils/buffer.js
|
|
123251
123517
|
var bufferToFormData = (arrayBuffer, contentType) => {
|
|
123252
123518
|
const response = new Response(arrayBuffer, {
|
|
123253
123519
|
headers: {
|
|
@@ -123258,7 +123524,9 @@ var bufferToFormData = (arrayBuffer, contentType) => {
|
|
|
123258
123524
|
return response.formData();
|
|
123259
123525
|
};
|
|
123260
123526
|
|
|
123261
|
-
// node_modules/.pnpm/hono@4.13.
|
|
123527
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/utils/body.js
|
|
123528
|
+
var MAX_NESTING_DEPTH = 32;
|
|
123529
|
+
var MAX_NESTED_OBJECTS = 1e4;
|
|
123262
123530
|
var isRawRequest = (request2) => "headers" in request2;
|
|
123263
123531
|
var parseBody = async (request2, options = /* @__PURE__ */ Object.create(null)) => {
|
|
123264
123532
|
const { all = false, dot = false } = options;
|
|
@@ -123291,6 +123559,7 @@ async function parseFormData(request2, options) {
|
|
|
123291
123559
|
}
|
|
123292
123560
|
function convertFormDataToBodyData(formData, options) {
|
|
123293
123561
|
const form = /* @__PURE__ */ Object.create(null);
|
|
123562
|
+
const nestingState = { count: 0 };
|
|
123294
123563
|
formData.forEach((value2, key) => {
|
|
123295
123564
|
const shouldParseAllValues = options.all || key.endsWith("[]");
|
|
123296
123565
|
if (!shouldParseAllValues) {
|
|
@@ -123303,7 +123572,7 @@ function convertFormDataToBodyData(formData, options) {
|
|
|
123303
123572
|
Object.entries(form).forEach(([key, value2]) => {
|
|
123304
123573
|
const shouldParseDotValues = key.includes(".");
|
|
123305
123574
|
if (shouldParseDotValues) {
|
|
123306
|
-
handleParsingNestedValues(form, key, value2);
|
|
123575
|
+
handleParsingNestedValues(form, key, value2, nestingState);
|
|
123307
123576
|
delete form[key];
|
|
123308
123577
|
}
|
|
123309
123578
|
});
|
|
@@ -123326,25 +123595,34 @@ var handleParsingAllValues = (form, key, value2) => {
|
|
|
123326
123595
|
}
|
|
123327
123596
|
}
|
|
123328
123597
|
};
|
|
123329
|
-
var handleParsingNestedValues = (form, key, value2) => {
|
|
123598
|
+
var handleParsingNestedValues = (form, key, value2, state) => {
|
|
123330
123599
|
if (/(?:^|\.)__proto__\./.test(key)) {
|
|
123331
123600
|
return;
|
|
123332
123601
|
}
|
|
123333
123602
|
let nestedForm = form;
|
|
123334
|
-
const keys = key.split(".");
|
|
123603
|
+
const keys = key.split(".", MAX_NESTING_DEPTH + 2);
|
|
123604
|
+
if (keys.length > MAX_NESTING_DEPTH + 1) {
|
|
123605
|
+
throwNestingLimitExceeded();
|
|
123606
|
+
}
|
|
123335
123607
|
keys.forEach((key2, index) => {
|
|
123336
123608
|
if (index === keys.length - 1) {
|
|
123337
123609
|
nestedForm[key2] = value2;
|
|
123338
123610
|
} else {
|
|
123339
123611
|
if (!nestedForm[key2] || typeof nestedForm[key2] !== "object" || Array.isArray(nestedForm[key2]) || nestedForm[key2] instanceof File) {
|
|
123612
|
+
if (state.count++ >= MAX_NESTED_OBJECTS) {
|
|
123613
|
+
throwNestingLimitExceeded();
|
|
123614
|
+
}
|
|
123340
123615
|
nestedForm[key2] = /* @__PURE__ */ Object.create(null);
|
|
123341
123616
|
}
|
|
123342
123617
|
nestedForm = nestedForm[key2];
|
|
123343
123618
|
}
|
|
123344
123619
|
});
|
|
123345
123620
|
};
|
|
123621
|
+
var throwNestingLimitExceeded = () => {
|
|
123622
|
+
throw new Error("Nesting limit exceeded");
|
|
123623
|
+
};
|
|
123346
123624
|
|
|
123347
|
-
// node_modules/.pnpm/hono@4.13.
|
|
123625
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/utils/url.js
|
|
123348
123626
|
var splitPath = (path4) => {
|
|
123349
123627
|
const paths = path4.split("/");
|
|
123350
123628
|
if (paths[0] === "") {
|
|
@@ -123450,13 +123728,13 @@ var checkOptionalParameter = (path4) => {
|
|
|
123450
123728
|
if (segment !== "" && !/\:/.test(segment)) {
|
|
123451
123729
|
basePath += "/" + segment;
|
|
123452
123730
|
} else if (/\:/.test(segment)) {
|
|
123453
|
-
if (
|
|
123731
|
+
if (segment.charCodeAt(segment.length - 1) === 63) {
|
|
123454
123732
|
if (results.length === 0 && basePath === "") {
|
|
123455
123733
|
results.push("/");
|
|
123456
123734
|
} else {
|
|
123457
123735
|
results.push(basePath);
|
|
123458
123736
|
}
|
|
123459
|
-
const optionalSegment = segment.
|
|
123737
|
+
const optionalSegment = segment.slice(0, -1);
|
|
123460
123738
|
basePath += "/" + optionalSegment;
|
|
123461
123739
|
results.push(basePath);
|
|
123462
123740
|
} else {
|
|
@@ -123474,6 +123752,10 @@ var _decodeURI = (value2) => {
|
|
|
123474
123752
|
return tryDecodeURIComponent(value2);
|
|
123475
123753
|
};
|
|
123476
123754
|
var _getQueryParam = (url4, key, multiple) => {
|
|
123755
|
+
const hashIndex = url4.indexOf("#", 8);
|
|
123756
|
+
if (hashIndex !== -1) {
|
|
123757
|
+
url4 = url4.slice(0, hashIndex);
|
|
123758
|
+
}
|
|
123477
123759
|
let encoded;
|
|
123478
123760
|
if (!multiple && key && key.indexOf("%") === -1 && key.indexOf("+") === -1) {
|
|
123479
123761
|
let keyIndex2 = url4.indexOf("?", 8);
|
|
@@ -123546,7 +123828,7 @@ var getQueryParams = (url4, key) => {
|
|
|
123546
123828
|
};
|
|
123547
123829
|
var decodeURIComponent_ = decodeURIComponent;
|
|
123548
123830
|
|
|
123549
|
-
// node_modules/.pnpm/hono@4.13.
|
|
123831
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/request.js
|
|
123550
123832
|
var HonoRequest = class {
|
|
123551
123833
|
/**
|
|
123552
123834
|
* `.raw` can get the raw Request object.
|
|
@@ -123590,13 +123872,13 @@ var HonoRequest = class {
|
|
|
123590
123872
|
return key ? this.#getDecodedParam(key) : this.#getAllDecodedParams();
|
|
123591
123873
|
}
|
|
123592
123874
|
#getDecodedParam(key) {
|
|
123593
|
-
const paramKey = this.#matchResult[0][this.routeIndex][1][key];
|
|
123875
|
+
const paramKey = this.#matchResult[0][this.routeIndex]?.[1][key];
|
|
123594
123876
|
const param = this.#getParamValue(paramKey);
|
|
123595
123877
|
return param && tryDecodeURIComponent(param);
|
|
123596
123878
|
}
|
|
123597
123879
|
#getAllDecodedParams() {
|
|
123598
123880
|
const decoded = {};
|
|
123599
|
-
const keys = Object.keys(this.#matchResult[0][this.routeIndex][1]);
|
|
123881
|
+
const keys = Object.keys(this.#matchResult[0][this.routeIndex]?.[1] ?? {});
|
|
123600
123882
|
for (const key of keys) {
|
|
123601
123883
|
const value2 = this.#getParamValue(this.#matchResult[0][this.routeIndex][1][key]);
|
|
123602
123884
|
if (value2 !== void 0) {
|
|
@@ -123827,7 +124109,7 @@ var HonoRequest = class {
|
|
|
123827
124109
|
}
|
|
123828
124110
|
};
|
|
123829
124111
|
|
|
123830
|
-
// node_modules/.pnpm/hono@4.13.
|
|
124112
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/utils/html.js
|
|
123831
124113
|
var HtmlEscapedCallbackPhase = {
|
|
123832
124114
|
Stringify: 1,
|
|
123833
124115
|
BeforeStream: 2,
|
|
@@ -123869,7 +124151,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
|
|
|
123869
124151
|
}
|
|
123870
124152
|
};
|
|
123871
124153
|
|
|
123872
|
-
// node_modules/.pnpm/hono@4.13.
|
|
124154
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/context.js
|
|
123873
124155
|
var TEXT_PLAIN = "text/plain; charset=UTF-8";
|
|
123874
124156
|
var setDefaultContentType = (contentType, headers) => {
|
|
123875
124157
|
return {
|
|
@@ -124071,6 +124353,10 @@ var Context = class {
|
|
|
124071
124353
|
* c.header('X-Message', 'Hello!')
|
|
124072
124354
|
* c.header('Content-Type', 'text/plain')
|
|
124073
124355
|
*
|
|
124356
|
+
* // Append multiple headers using the append option (e.g. Vary)
|
|
124357
|
+
* c.header('Vary', 'Accept-Encoding', { append: true })
|
|
124358
|
+
* c.header('Vary', 'User-Agent', { append: true })
|
|
124359
|
+
*
|
|
124074
124360
|
* return c.body('Thank you for coming')
|
|
124075
124361
|
* })
|
|
124076
124362
|
* ```
|
|
@@ -124291,7 +124577,7 @@ var Context = class {
|
|
|
124291
124577
|
};
|
|
124292
124578
|
};
|
|
124293
124579
|
|
|
124294
|
-
// node_modules/.pnpm/hono@4.13.
|
|
124580
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/router.js
|
|
124295
124581
|
var METHOD_NAME_ALL = "ALL";
|
|
124296
124582
|
var METHOD_NAME_ALL_LOWERCASE = "all";
|
|
124297
124583
|
var METHODS = ["get", "post", "put", "delete", "options", "patch", "query"];
|
|
@@ -124299,10 +124585,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is
|
|
|
124299
124585
|
var UnsupportedPathError = class extends Error {
|
|
124300
124586
|
};
|
|
124301
124587
|
|
|
124302
|
-
// node_modules/.pnpm/hono@4.13.
|
|
124588
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/utils/constants.js
|
|
124303
124589
|
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
124304
124590
|
|
|
124305
|
-
// node_modules/.pnpm/hono@4.13.
|
|
124591
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/hono-base.js
|
|
124306
124592
|
var notFoundHandler = (c) => {
|
|
124307
124593
|
return c.text("404 Not Found", 404);
|
|
124308
124594
|
};
|
|
@@ -124679,7 +124965,10 @@ var Hono = class _Hono {
|
|
|
124679
124965
|
};
|
|
124680
124966
|
};
|
|
124681
124967
|
|
|
124682
|
-
// node_modules/.pnpm/hono@4.13.
|
|
124968
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/router/utils.js
|
|
124969
|
+
var createNullObject = () => /* @__PURE__ */ Object.create(null);
|
|
124970
|
+
|
|
124971
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/router/reg-exp-router/matcher.js
|
|
124683
124972
|
var emptyParam = [];
|
|
124684
124973
|
function match(method, path4) {
|
|
124685
124974
|
const matchers2 = this.buildAllMatchers();
|
|
@@ -124700,7 +124989,7 @@ function match(method, path4) {
|
|
|
124700
124989
|
return match22(method, path4);
|
|
124701
124990
|
}
|
|
124702
124991
|
|
|
124703
|
-
// node_modules/.pnpm/hono@4.13.
|
|
124992
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/router/reg-exp-router/node.js
|
|
124704
124993
|
var LABEL_REG_EXP_STR = "[^/]+";
|
|
124705
124994
|
var ONLY_WILDCARD_REG_EXP_STR = ".*";
|
|
124706
124995
|
var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
|
|
@@ -124729,7 +125018,7 @@ var Node = class _Node {
|
|
|
124729
125018
|
// handler index of a dynamic path, or -1 for a static path terminal
|
|
124730
125019
|
#index;
|
|
124731
125020
|
#varIndex;
|
|
124732
|
-
#children =
|
|
125021
|
+
#children = createNullObject();
|
|
124733
125022
|
insert(tokens, index, paramMap, context, isStatic) {
|
|
124734
125023
|
let node2 = this;
|
|
124735
125024
|
for (let i = 0, len = tokens.length; i < len; i++) {
|
|
@@ -124807,13 +125096,13 @@ var Node = class _Node {
|
|
|
124807
125096
|
}
|
|
124808
125097
|
};
|
|
124809
125098
|
|
|
124810
|
-
// node_modules/.pnpm/hono@4.13.
|
|
125099
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/router/reg-exp-router/trie.js
|
|
124811
125100
|
var Trie = class {
|
|
124812
125101
|
#context = { varIndex: 0 };
|
|
124813
125102
|
#root = new Node();
|
|
124814
125103
|
#index = 0;
|
|
124815
125104
|
// dynamic path -> [handler index, param assoc]; static paths are not registered
|
|
124816
|
-
paths =
|
|
125105
|
+
paths = createNullObject();
|
|
124817
125106
|
insert(path4, isStatic) {
|
|
124818
125107
|
if (isStatic) {
|
|
124819
125108
|
this.#root.insert(path4.split(""), 0, [], this.#context, true);
|
|
@@ -124871,23 +125160,17 @@ var Trie = class {
|
|
|
124871
125160
|
}
|
|
124872
125161
|
};
|
|
124873
125162
|
|
|
124874
|
-
// node_modules/.pnpm/hono@4.13.
|
|
124875
|
-
var wildcardRegExpCache =
|
|
125163
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/router/reg-exp-router/router.js
|
|
125164
|
+
var wildcardRegExpCache = createNullObject();
|
|
124876
125165
|
function buildWildcardRegExp(path4) {
|
|
124877
125166
|
return wildcardRegExpCache[path4] ??= new RegExp(
|
|
124878
|
-
|
|
124879
|
-
|
|
124880
|
-
(
|
|
125167
|
+
`^${path4.replace(
|
|
125168
|
+
/\/:[^/{}]+(?:\{\[\^\/]\+})?(?=[/{]|$)|\/?\*$|([.\\+*[^\]$()?{}|])/g,
|
|
125169
|
+
(match22, metaChar) => metaChar ? `\\${metaChar}` : match22 === "/*" ? TAIL_WILDCARD_REG_EXP_STR : match22 === "*" ? ONLY_WILDCARD_REG_EXP_STR : `/:${LABEL_REG_EXP_STR}`
|
|
124881
125170
|
)}$`
|
|
124882
125171
|
);
|
|
124883
125172
|
}
|
|
124884
|
-
function clearWildcardRegExpCache() {
|
|
124885
|
-
wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
124886
|
-
}
|
|
124887
125173
|
function findMiddleware(middleware, path4) {
|
|
124888
|
-
if (!middleware) {
|
|
124889
|
-
return void 0;
|
|
124890
|
-
}
|
|
124891
125174
|
for (const k2 of Object.keys(middleware).sort((a, b) => b.length - a.length)) {
|
|
124892
125175
|
if (buildWildcardRegExp(k2).test(path4)) {
|
|
124893
125176
|
return [...middleware[k2]];
|
|
@@ -124901,8 +125184,8 @@ var RegExpRouter = class {
|
|
|
124901
125184
|
#routes;
|
|
124902
125185
|
#tries;
|
|
124903
125186
|
constructor() {
|
|
124904
|
-
this.#middleware = { [METHOD_NAME_ALL]:
|
|
124905
|
-
this.#routes = { [METHOD_NAME_ALL]:
|
|
125187
|
+
this.#middleware = { [METHOD_NAME_ALL]: createNullObject() };
|
|
125188
|
+
this.#routes = { [METHOD_NAME_ALL]: createNullObject() };
|
|
124906
125189
|
this.#tries = { [METHOD_NAME_ALL]: new Trie() };
|
|
124907
125190
|
}
|
|
124908
125191
|
#insertPath(method, path4) {
|
|
@@ -124915,121 +125198,90 @@ var RegExpRouter = class {
|
|
|
124915
125198
|
add(method, path4, handler2) {
|
|
124916
125199
|
const middleware = this.#middleware;
|
|
124917
125200
|
const routes = this.#routes;
|
|
124918
|
-
if (!middleware
|
|
125201
|
+
if (!middleware) {
|
|
124919
125202
|
throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
|
|
124920
125203
|
}
|
|
124921
125204
|
if (!middleware[method]) {
|
|
124922
125205
|
this.#tries[method] = new Trie();
|
|
124923
|
-
[middleware, routes]
|
|
124924
|
-
handlerMap[method] =
|
|
124925
|
-
|
|
125206
|
+
for (const handlerMap of [middleware, routes]) {
|
|
125207
|
+
handlerMap[method] = createNullObject();
|
|
125208
|
+
for (const p in handlerMap[METHOD_NAME_ALL]) {
|
|
124926
125209
|
handlerMap[method][p] = [...handlerMap[METHOD_NAME_ALL][p]];
|
|
124927
125210
|
this.#insertPath(method, p);
|
|
124928
|
-
}
|
|
124929
|
-
}
|
|
125211
|
+
}
|
|
125212
|
+
}
|
|
124930
125213
|
}
|
|
124931
125214
|
if (path4 === "/*") {
|
|
124932
125215
|
path4 = "*";
|
|
124933
125216
|
}
|
|
124934
|
-
const
|
|
125217
|
+
const methods = method === METHOD_NAME_ALL ? Object.keys(middleware) : [method];
|
|
124935
125218
|
if (/\*$/.test(path4)) {
|
|
124936
125219
|
const re = buildWildcardRegExp(path4);
|
|
124937
|
-
|
|
124938
|
-
if (
|
|
125220
|
+
for (const m of methods) {
|
|
125221
|
+
if (!middleware[m][path4]) {
|
|
124939
125222
|
this.#insertPath(m, path4);
|
|
124940
125223
|
middleware[m][path4] = findMiddleware(middleware[m], path4) || findMiddleware(middleware[METHOD_NAME_ALL], path4) || [];
|
|
124941
125224
|
}
|
|
124942
|
-
}
|
|
124943
|
-
|
|
124944
|
-
|
|
124945
|
-
|
|
124946
|
-
re.test(p) &&
|
|
124947
|
-
}
|
|
124948
|
-
}
|
|
124949
|
-
});
|
|
124950
|
-
Object.keys(routes).forEach((m) => {
|
|
124951
|
-
if (method === METHOD_NAME_ALL || method === m) {
|
|
124952
|
-
Object.keys(routes[m]).forEach(
|
|
124953
|
-
(p) => re.test(p) && routes[m][p].push([handler2, paramCount])
|
|
124954
|
-
);
|
|
125225
|
+
}
|
|
125226
|
+
for (const handlerMap of [middleware, routes]) {
|
|
125227
|
+
for (const m of methods) {
|
|
125228
|
+
for (const p in handlerMap[m]) {
|
|
125229
|
+
re.test(p) && handlerMap[m][p].push([handler2, path4]);
|
|
125230
|
+
}
|
|
124955
125231
|
}
|
|
124956
|
-
}
|
|
125232
|
+
}
|
|
124957
125233
|
return;
|
|
124958
125234
|
}
|
|
124959
125235
|
const paths = checkOptionalParameter(path4) || [path4];
|
|
124960
|
-
for (
|
|
124961
|
-
const
|
|
124962
|
-
|
|
124963
|
-
|
|
124964
|
-
|
|
124965
|
-
this.#insertPath(m, path22);
|
|
124966
|
-
routes[m][path22] = [
|
|
124967
|
-
...findMiddleware(middleware[m], path22) || findMiddleware(middleware[METHOD_NAME_ALL], path22) || []
|
|
124968
|
-
];
|
|
124969
|
-
}
|
|
124970
|
-
routes[m][path22].push([handler2, paramCount - len + i + 1]);
|
|
125236
|
+
for (const path22 of paths) {
|
|
125237
|
+
for (const m of methods) {
|
|
125238
|
+
if (!routes[m][path22]) {
|
|
125239
|
+
this.#insertPath(m, path22);
|
|
125240
|
+
routes[m][path22] = findMiddleware(middleware[m], path22) || findMiddleware(middleware[METHOD_NAME_ALL], path22) || [];
|
|
124971
125241
|
}
|
|
124972
|
-
|
|
125242
|
+
routes[m][path22].push([handler2, path22]);
|
|
125243
|
+
}
|
|
124973
125244
|
}
|
|
124974
125245
|
}
|
|
124975
125246
|
match = match;
|
|
124976
125247
|
buildAllMatchers() {
|
|
124977
|
-
const matchers2 =
|
|
124978
|
-
Object.keys(this.#routes)
|
|
124979
|
-
matchers2[method]
|
|
124980
|
-
}
|
|
125248
|
+
const matchers2 = createNullObject();
|
|
125249
|
+
for (const method of Object.keys(this.#routes)) {
|
|
125250
|
+
matchers2[method] = this.#buildMatcher(method);
|
|
125251
|
+
}
|
|
124981
125252
|
this.#middleware = this.#routes = this.#tries = void 0;
|
|
124982
|
-
|
|
125253
|
+
wildcardRegExpCache = createNullObject();
|
|
124983
125254
|
return matchers2;
|
|
124984
125255
|
}
|
|
124985
125256
|
#buildMatcher(method) {
|
|
124986
125257
|
const middleware = this.#middleware[method];
|
|
124987
125258
|
const routes = this.#routes[method];
|
|
124988
125259
|
const trie = this.#tries[method];
|
|
124989
|
-
const staticMap =
|
|
125260
|
+
const staticMap = createNullObject();
|
|
124990
125261
|
const handlerData = [];
|
|
124991
|
-
[
|
|
125262
|
+
const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
|
|
125263
|
+
for (const r of [middleware, routes]) {
|
|
124992
125264
|
for (const path4 in r) {
|
|
124993
125265
|
const handlers2 = r[path4];
|
|
124994
125266
|
const pathData = trie.paths[path4];
|
|
124995
125267
|
if (!pathData) {
|
|
124996
|
-
staticMap[path4] = [handlers2.map(([h]) => [h,
|
|
124997
|
-
continue;
|
|
124998
|
-
}
|
|
124999
|
-
const paramAssoc = pathData[1];
|
|
125000
|
-
handlerData[pathData[0]] = handlers2.map(([h, paramCount]) => {
|
|
125001
|
-
const paramIndexMap = /* @__PURE__ */ Object.create(null);
|
|
125002
|
-
paramCount -= 1;
|
|
125003
|
-
for (; paramCount >= 0; paramCount--) {
|
|
125004
|
-
const [key, value2] = paramAssoc[paramCount];
|
|
125005
|
-
paramIndexMap[key] = value2;
|
|
125006
|
-
}
|
|
125007
|
-
return [h, paramIndexMap];
|
|
125008
|
-
});
|
|
125009
|
-
}
|
|
125010
|
-
});
|
|
125011
|
-
const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
|
|
125012
|
-
for (let i = 0, len = handlerData.length; i < len; i++) {
|
|
125013
|
-
for (let j2 = 0, len2 = handlerData[i].length; j2 < len2; j2++) {
|
|
125014
|
-
const map2 = handlerData[i][j2]?.[1];
|
|
125015
|
-
if (!map2) {
|
|
125268
|
+
staticMap[path4] = [handlers2.map(([h]) => [h, createNullObject()]), emptyParam];
|
|
125016
125269
|
continue;
|
|
125017
125270
|
}
|
|
125018
|
-
|
|
125019
|
-
|
|
125020
|
-
|
|
125021
|
-
|
|
125271
|
+
handlerData[pathData[0]] = handlers2.map(([h, handlerPath]) => [
|
|
125272
|
+
h,
|
|
125273
|
+
trie.paths[handlerPath][1].reduceRight((map2, [key], i) => {
|
|
125274
|
+
map2[key] = paramReplacementMap[pathData[1][i][1]];
|
|
125275
|
+
return map2;
|
|
125276
|
+
}, createNullObject())
|
|
125277
|
+
]);
|
|
125022
125278
|
}
|
|
125023
125279
|
}
|
|
125024
|
-
|
|
125025
|
-
for (const i in indexReplacementMap) {
|
|
125026
|
-
handlerMap[i] = handlerData[indexReplacementMap[i]];
|
|
125027
|
-
}
|
|
125028
|
-
return [regexp, handlerMap, staticMap];
|
|
125280
|
+
return [regexp, indexReplacementMap.map((i) => handlerData[i]), staticMap];
|
|
125029
125281
|
}
|
|
125030
125282
|
};
|
|
125031
125283
|
|
|
125032
|
-
// node_modules/.pnpm/hono@4.13.
|
|
125284
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/router/smart-router/router.js
|
|
125033
125285
|
var SmartRouter = class {
|
|
125034
125286
|
name = "SmartRouter";
|
|
125035
125287
|
#routers = [];
|
|
@@ -125084,78 +125336,53 @@ var SmartRouter = class {
|
|
|
125084
125336
|
}
|
|
125085
125337
|
};
|
|
125086
125338
|
|
|
125087
|
-
// node_modules/.pnpm/hono@4.13.
|
|
125088
|
-
var emptyParams =
|
|
125089
|
-
var
|
|
125090
|
-
for (const _ in children) {
|
|
125091
|
-
return true;
|
|
125092
|
-
}
|
|
125093
|
-
return false;
|
|
125094
|
-
};
|
|
125339
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/router/trie-router/node.js
|
|
125340
|
+
var emptyParams = createNullObject();
|
|
125341
|
+
var order = 0;
|
|
125095
125342
|
var Node2 = class _Node2 {
|
|
125096
|
-
#methods;
|
|
125097
|
-
#children;
|
|
125098
|
-
#patterns;
|
|
125099
|
-
#
|
|
125343
|
+
#methods = [];
|
|
125344
|
+
#children = createNullObject();
|
|
125345
|
+
#patterns = [];
|
|
125346
|
+
#pattern;
|
|
125100
125347
|
#params = emptyParams;
|
|
125101
|
-
constructor(method, handler2, children) {
|
|
125102
|
-
this.#children = children || /* @__PURE__ */ Object.create(null);
|
|
125103
|
-
this.#methods = [];
|
|
125104
|
-
if (method && handler2) {
|
|
125105
|
-
const m = /* @__PURE__ */ Object.create(null);
|
|
125106
|
-
m[method] = { handler: handler2, possibleKeys: [], score: 0 };
|
|
125107
|
-
this.#methods = [m];
|
|
125108
|
-
}
|
|
125109
|
-
this.#patterns = [];
|
|
125110
|
-
}
|
|
125111
125348
|
insert(method, path4, handler2) {
|
|
125112
|
-
this.#order = ++this.#order;
|
|
125113
125349
|
let curNode = this;
|
|
125114
125350
|
const parts = splitRoutingPath(path4);
|
|
125115
|
-
const possibleKeys =
|
|
125116
|
-
|
|
125117
|
-
|
|
125118
|
-
const nextP = parts[i
|
|
125119
|
-
const pattern = getPattern(p, nextP);
|
|
125120
|
-
const
|
|
125121
|
-
|
|
125122
|
-
|
|
125123
|
-
|
|
125124
|
-
|
|
125125
|
-
|
|
125126
|
-
continue;
|
|
125351
|
+
const possibleKeys = /* @__PURE__ */ new Set();
|
|
125352
|
+
let i = 0;
|
|
125353
|
+
for (const p of parts) {
|
|
125354
|
+
const nextP = parts[++i];
|
|
125355
|
+
const pattern = getPattern(p, nextP) || (nextP === void 0 && p && p.indexOf("*") === p.length - 1 ? p : null);
|
|
125356
|
+
const isParam = Array.isArray(pattern);
|
|
125357
|
+
const key = isParam ? pattern[0] : pattern || p;
|
|
125358
|
+
const child = curNode.#children[key] ||= new _Node2();
|
|
125359
|
+
if (pattern && !child.#pattern) {
|
|
125360
|
+
child.#pattern = pattern;
|
|
125361
|
+
curNode.#patterns.push(child);
|
|
125127
125362
|
}
|
|
125128
|
-
curNode
|
|
125129
|
-
if (
|
|
125130
|
-
|
|
125131
|
-
possibleKeys.push(pattern[1]);
|
|
125363
|
+
curNode = child;
|
|
125364
|
+
if (isParam) {
|
|
125365
|
+
possibleKeys.add(pattern[1]);
|
|
125132
125366
|
}
|
|
125133
|
-
curNode = curNode.#children[key];
|
|
125134
125367
|
}
|
|
125135
125368
|
curNode.#methods.push({
|
|
125136
125369
|
[method]: {
|
|
125137
125370
|
handler: handler2,
|
|
125138
|
-
possibleKeys: possibleKeys
|
|
125139
|
-
score:
|
|
125371
|
+
possibleKeys: [...possibleKeys],
|
|
125372
|
+
score: ++order
|
|
125140
125373
|
}
|
|
125141
125374
|
});
|
|
125142
|
-
return curNode;
|
|
125143
125375
|
}
|
|
125144
125376
|
#pushHandlerSets(handlerSets, node2, method, nodeParams, params) {
|
|
125145
125377
|
for (let i = 0, len = node2.#methods.length; i < len; i++) {
|
|
125146
125378
|
const m = node2.#methods[i];
|
|
125147
125379
|
const handlerSet = m[method] || m[METHOD_NAME_ALL];
|
|
125148
|
-
|
|
125149
|
-
|
|
125150
|
-
handlerSet.params = /* @__PURE__ */ Object.create(null);
|
|
125380
|
+
if (handlerSet) {
|
|
125381
|
+
handlerSet.params = createNullObject();
|
|
125151
125382
|
handlerSets.push(handlerSet);
|
|
125152
|
-
|
|
125153
|
-
|
|
125154
|
-
|
|
125155
|
-
const processed = processedSet[handlerSet.score];
|
|
125156
|
-
handlerSet.params[key] = params?.[key] && !processed ? params[key] : nodeParams[key] ?? params?.[key];
|
|
125157
|
-
processedSet[handlerSet.score] = true;
|
|
125158
|
-
}
|
|
125383
|
+
for (let i2 = 0, len2 = handlerSet.possibleKeys.length; i2 < len2; i2++) {
|
|
125384
|
+
const key = handlerSet.possibleKeys[i2];
|
|
125385
|
+
handlerSet.params[key] = params?.[key] && !i2 ? params[key] : nodeParams[key] ?? params?.[key];
|
|
125159
125386
|
}
|
|
125160
125387
|
}
|
|
125161
125388
|
}
|
|
@@ -125187,33 +125414,33 @@ var Node2 = class _Node2 {
|
|
|
125187
125414
|
tempNodes.push(nextNode);
|
|
125188
125415
|
}
|
|
125189
125416
|
}
|
|
125190
|
-
for (
|
|
125191
|
-
const pattern =
|
|
125417
|
+
for (const child of node2.#patterns) {
|
|
125418
|
+
const pattern = child.#pattern;
|
|
125192
125419
|
const params = node2.#params === emptyParams ? {} : { ...node2.#params };
|
|
125193
|
-
if (pattern === "
|
|
125194
|
-
|
|
125195
|
-
|
|
125196
|
-
|
|
125197
|
-
|
|
125198
|
-
|
|
125420
|
+
if (typeof pattern === "string") {
|
|
125421
|
+
if (pattern === "*" || part.startsWith(pattern.slice(0, -1))) {
|
|
125422
|
+
this.#pushHandlerSets(handlerSets, child, method, node2.#params);
|
|
125423
|
+
if (pattern === "*") {
|
|
125424
|
+
child.#params = params;
|
|
125425
|
+
tempNodes.push(child);
|
|
125426
|
+
}
|
|
125199
125427
|
}
|
|
125200
125428
|
continue;
|
|
125201
125429
|
}
|
|
125202
|
-
const [
|
|
125203
|
-
if (!part &&
|
|
125430
|
+
const [, name, matcher] = pattern;
|
|
125431
|
+
if (!part && matcher === true) {
|
|
125204
125432
|
continue;
|
|
125205
125433
|
}
|
|
125206
|
-
|
|
125207
|
-
|
|
125208
|
-
|
|
125209
|
-
partOffsets = new Array(len);
|
|
125434
|
+
if (matcher !== true) {
|
|
125435
|
+
if (!partOffsets) {
|
|
125436
|
+
partOffsets = [];
|
|
125210
125437
|
let offset = path4[0] === "/" ? 1 : 0;
|
|
125211
125438
|
for (let p = 0; p < len; p++) {
|
|
125212
125439
|
partOffsets[p] = offset;
|
|
125213
125440
|
offset += parts[p].length + 1;
|
|
125214
125441
|
}
|
|
125215
125442
|
}
|
|
125216
|
-
const restPathString = path4.
|
|
125443
|
+
const restPathString = path4.slice(partOffsets[i]);
|
|
125217
125444
|
const m = matcher.exec(restPathString);
|
|
125218
125445
|
if (m) {
|
|
125219
125446
|
params[name] = m[0];
|
|
@@ -125227,11 +125454,12 @@ var Node2 = class _Node2 {
|
|
|
125227
125454
|
params
|
|
125228
125455
|
);
|
|
125229
125456
|
}
|
|
125230
|
-
|
|
125457
|
+
for (const _ in child.#children) {
|
|
125231
125458
|
child.#params = params;
|
|
125232
125459
|
const componentCount = m[0].match(/\//g)?.length ?? 0;
|
|
125233
125460
|
const targetCurNodes = curNodesQueue[componentCount] ||= [];
|
|
125234
125461
|
targetCurNodes.push(child);
|
|
125462
|
+
break;
|
|
125235
125463
|
}
|
|
125236
125464
|
continue;
|
|
125237
125465
|
}
|
|
@@ -125259,7 +125487,7 @@ var Node2 = class _Node2 {
|
|
|
125259
125487
|
const shifted = curNodesQueue.shift();
|
|
125260
125488
|
curNodes = shifted ? tempNodes.concat(shifted) : tempNodes;
|
|
125261
125489
|
}
|
|
125262
|
-
if (handlerSets
|
|
125490
|
+
if (handlerSets[1]) {
|
|
125263
125491
|
handlerSets.sort((a, b) => {
|
|
125264
125492
|
return a.score - b.score;
|
|
125265
125493
|
});
|
|
@@ -125268,29 +125496,21 @@ var Node2 = class _Node2 {
|
|
|
125268
125496
|
}
|
|
125269
125497
|
};
|
|
125270
125498
|
|
|
125271
|
-
// node_modules/.pnpm/hono@4.13.
|
|
125499
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/router/trie-router/router.js
|
|
125272
125500
|
var TrieRouter = class {
|
|
125273
125501
|
name = "TrieRouter";
|
|
125274
|
-
#node;
|
|
125275
|
-
constructor() {
|
|
125276
|
-
this.#node = new Node2();
|
|
125277
|
-
}
|
|
125502
|
+
#node = new Node2();
|
|
125278
125503
|
add(method, path4, handler2) {
|
|
125279
|
-
const
|
|
125280
|
-
|
|
125281
|
-
for (let i = 0, len = results.length; i < len; i++) {
|
|
125282
|
-
this.#node.insert(method, results[i], handler2);
|
|
125283
|
-
}
|
|
125284
|
-
return;
|
|
125504
|
+
for (const result of checkOptionalParameter(path4) || [path4]) {
|
|
125505
|
+
this.#node.insert(method, result, handler2);
|
|
125285
125506
|
}
|
|
125286
|
-
this.#node.insert(method, path4, handler2);
|
|
125287
125507
|
}
|
|
125288
125508
|
match(method, path4) {
|
|
125289
125509
|
return this.#node.search(method, path4);
|
|
125290
125510
|
}
|
|
125291
125511
|
};
|
|
125292
125512
|
|
|
125293
|
-
// node_modules/.pnpm/hono@4.13.
|
|
125513
|
+
// node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/hono.js
|
|
125294
125514
|
var Hono2 = class extends Hono {
|
|
125295
125515
|
/**
|
|
125296
125516
|
* Creates an instance of the Hono class.
|
|
@@ -125305,7 +125525,7 @@ var Hono2 = class extends Hono {
|
|
|
125305
125525
|
}
|
|
125306
125526
|
};
|
|
125307
125527
|
|
|
125308
|
-
// node_modules/.pnpm/mcp-proxy@6.7.
|
|
125528
|
+
// node_modules/.pnpm/mcp-proxy@6.7.11/node_modules/mcp-proxy/dist/startStdioServer-C4sEMMHS.mjs
|
|
125309
125529
|
import { createRequire } from "node:module";
|
|
125310
125530
|
import { randomUUID as randomUUID2, timingSafeEqual } from "node:crypto";
|
|
125311
125531
|
|
|
@@ -132561,11 +132781,11 @@ var require_dataType2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
132561
132781
|
gen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr));
|
|
132562
132782
|
}
|
|
132563
132783
|
function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
|
|
132564
|
-
const
|
|
132784
|
+
const EQ2 = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
|
|
132565
132785
|
let cond;
|
|
132566
132786
|
switch (dataType) {
|
|
132567
132787
|
case "null":
|
|
132568
|
-
return (0, codegen_1._)`${data} ${
|
|
132788
|
+
return (0, codegen_1._)`${data} ${EQ2} null`;
|
|
132569
132789
|
case "array":
|
|
132570
132790
|
cond = (0, codegen_1._)`Array.isArray(${data})`;
|
|
132571
132791
|
break;
|
|
@@ -132579,7 +132799,7 @@ var require_dataType2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
132579
132799
|
cond = numCond();
|
|
132580
132800
|
break;
|
|
132581
132801
|
default:
|
|
132582
|
-
return (0, codegen_1._)`typeof ${data} ${
|
|
132802
|
+
return (0, codegen_1._)`typeof ${data} ${EQ2} ${dataType}`;
|
|
132583
132803
|
}
|
|
132584
132804
|
return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);
|
|
132585
132805
|
function numCond(_cond = codegen_1.nil) {
|
|
@@ -140904,7 +141124,7 @@ function createMcpHandler(factory, options = {}) {
|
|
|
140904
141124
|
};
|
|
140905
141125
|
}
|
|
140906
141126
|
|
|
140907
|
-
// node_modules/.pnpm/mcp-proxy@6.7.
|
|
141127
|
+
// node_modules/.pnpm/mcp-proxy@6.7.11/node_modules/mcp-proxy/dist/startStdioServer-C4sEMMHS.mjs
|
|
140908
141128
|
import http from "http";
|
|
140909
141129
|
import { Http2ServerRequest } from "http2";
|
|
140910
141130
|
import { Readable } from "stream";
|
|
@@ -146612,11 +146832,11 @@ var require_dataType3 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
146612
146832
|
gen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr));
|
|
146613
146833
|
}
|
|
146614
146834
|
function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
|
|
146615
|
-
const
|
|
146835
|
+
const EQ2 = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
|
|
146616
146836
|
let cond;
|
|
146617
146837
|
switch (dataType) {
|
|
146618
146838
|
case "null":
|
|
146619
|
-
return (0, codegen_1._)`${data} ${
|
|
146839
|
+
return (0, codegen_1._)`${data} ${EQ2} null`;
|
|
146620
146840
|
case "array":
|
|
146621
146841
|
cond = (0, codegen_1._)`Array.isArray(${data})`;
|
|
146622
146842
|
break;
|
|
@@ -146630,7 +146850,7 @@ var require_dataType3 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
146630
146850
|
cond = numCond();
|
|
146631
146851
|
break;
|
|
146632
146852
|
default:
|
|
146633
|
-
return (0, codegen_1._)`typeof ${data} ${
|
|
146853
|
+
return (0, codegen_1._)`typeof ${data} ${EQ2} ${dataType}`;
|
|
146634
146854
|
}
|
|
146635
146855
|
return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);
|
|
146636
146856
|
function numCond(_cond = codegen_1.nil) {
|
|
@@ -152309,7 +152529,7 @@ var SseError = class extends Error {
|
|
|
152309
152529
|
}
|
|
152310
152530
|
};
|
|
152311
152531
|
|
|
152312
|
-
// node_modules/.pnpm/mcp-proxy@6.7.
|
|
152532
|
+
// node_modules/.pnpm/mcp-proxy@6.7.11/node_modules/mcp-proxy/dist/startStdioServer-C4sEMMHS.mjs
|
|
152313
152533
|
var __create4 = Object.create;
|
|
152314
152534
|
var __defProp$1 = Object.defineProperty;
|
|
152315
152535
|
var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
|
|
@@ -152417,6 +152637,12 @@ var InMemoryEventStore = class {
|
|
|
152417
152637
|
get size() {
|
|
152418
152638
|
return this.events.size;
|
|
152419
152639
|
}
|
|
152640
|
+
/**
|
|
152641
|
+
* Keeps event IDs in stream-local insertion order so replay can walk only the
|
|
152642
|
+
* relevant stream instead of sorting the entire global event map on every
|
|
152643
|
+
* reconnect.
|
|
152644
|
+
*/
|
|
152645
|
+
eventIdsByStream = /* @__PURE__ */ new Map();
|
|
152420
152646
|
events = /* @__PURE__ */ new Map();
|
|
152421
152647
|
lastTimestamp = 0;
|
|
152422
152648
|
lastTimestampCounter = 0;
|
|
@@ -152440,15 +152666,15 @@ var InMemoryEventStore = class {
|
|
|
152440
152666
|
if (!lastEventId) return "";
|
|
152441
152667
|
const streamId = await this.getStreamIdForEventId(lastEventId);
|
|
152442
152668
|
if (!streamId) return "";
|
|
152443
|
-
|
|
152444
|
-
|
|
152445
|
-
|
|
152446
|
-
|
|
152447
|
-
|
|
152448
|
-
|
|
152449
|
-
|
|
152450
|
-
|
|
152451
|
-
|
|
152669
|
+
const eventIdsForStream = this.eventIdsByStream.get(streamId);
|
|
152670
|
+
if (!eventIdsForStream) return "";
|
|
152671
|
+
const lastEventIndex = eventIdsForStream.indexOf(lastEventId);
|
|
152672
|
+
if (lastEventIndex === -1) return "";
|
|
152673
|
+
for (let index = lastEventIndex + 1; index < eventIdsForStream.length; index++) {
|
|
152674
|
+
const eventId = eventIdsForStream[index];
|
|
152675
|
+
const storedEvent = this.events.get(eventId);
|
|
152676
|
+
if (!storedEvent) continue;
|
|
152677
|
+
await send(eventId, storedEvent.message);
|
|
152452
152678
|
}
|
|
152453
152679
|
return streamId;
|
|
152454
152680
|
}
|
|
@@ -152462,10 +152688,22 @@ var InMemoryEventStore = class {
|
|
|
152462
152688
|
message,
|
|
152463
152689
|
streamId
|
|
152464
152690
|
});
|
|
152691
|
+
const streamEvents = this.eventIdsByStream.get(streamId) ?? [];
|
|
152692
|
+
streamEvents.push(eventId);
|
|
152693
|
+
this.eventIdsByStream.set(streamId, streamEvents);
|
|
152465
152694
|
while (this.events.size > this.maxEvents) {
|
|
152466
152695
|
const oldestEventId = this.events.keys().next().value;
|
|
152467
152696
|
if (oldestEventId === void 0) break;
|
|
152697
|
+
const oldestEvent = this.events.get(oldestEventId);
|
|
152468
152698
|
this.events.delete(oldestEventId);
|
|
152699
|
+
if (oldestEvent) {
|
|
152700
|
+
const streamEventIds = this.eventIdsByStream.get(oldestEvent.streamId);
|
|
152701
|
+
if (streamEventIds) {
|
|
152702
|
+
const index = streamEventIds.indexOf(oldestEventId);
|
|
152703
|
+
if (index !== -1) streamEventIds.splice(index, 1);
|
|
152704
|
+
if (streamEventIds.length === 0) this.eventIdsByStream.delete(oldestEvent.streamId);
|
|
152705
|
+
}
|
|
152706
|
+
}
|
|
152469
152707
|
}
|
|
152470
152708
|
return eventId;
|
|
152471
152709
|
}
|
|
@@ -169030,6 +169268,34 @@ data: ${JSON.stringify(message)}
|
|
|
169030
169268
|
}
|
|
169031
169269
|
};
|
|
169032
169270
|
var DEFAULT_KEEP_ALIVE_TIMEOUT = 3e5;
|
|
169271
|
+
var addUtf8Charset = (contentType$1) => {
|
|
169272
|
+
if (/;\s*charset=/i.test(contentType$1) || !/^(application\/json|text\/event-stream)(?:\s*;|$)/i.test(contentType$1)) return contentType$1;
|
|
169273
|
+
return `${contentType$1}; charset=utf-8`;
|
|
169274
|
+
};
|
|
169275
|
+
var normalizeResponseHeaders = (headers) => {
|
|
169276
|
+
if (Array.isArray(headers)) return headers.map((value2, index) => {
|
|
169277
|
+
const headerName = headers[index - 1];
|
|
169278
|
+
if (index % 2 === 1 && typeof headerName === "string" && headerName.toLowerCase() === "content-type" && typeof value2 === "string") return addUtf8Charset(value2);
|
|
169279
|
+
return value2;
|
|
169280
|
+
});
|
|
169281
|
+
const normalizedHeaders = { ...headers };
|
|
169282
|
+
for (const [name, value2] of Object.entries(headers)) if (name.toLowerCase() === "content-type" && typeof value2 === "string") normalizedHeaders[name] = addUtf8Charset(value2);
|
|
169283
|
+
return normalizedHeaders;
|
|
169284
|
+
};
|
|
169285
|
+
var ensureUtf8ResponseCharset = (res) => {
|
|
169286
|
+
const originalWriteHead = res.writeHead.bind(res);
|
|
169287
|
+
res.writeHead = ((statusCode, statusMessageOrHeaders, headers) => {
|
|
169288
|
+
const currentContentType = res.getHeader("Content-Type");
|
|
169289
|
+
if (typeof currentContentType === "string") res.setHeader("Content-Type", addUtf8Charset(currentContentType));
|
|
169290
|
+
const responseHeaders = typeof statusMessageOrHeaders === "string" ? headers : statusMessageOrHeaders;
|
|
169291
|
+
if (responseHeaders) {
|
|
169292
|
+
const normalizedHeaders = normalizeResponseHeaders(responseHeaders);
|
|
169293
|
+
if (typeof statusMessageOrHeaders === "string") return originalWriteHead(statusCode, statusMessageOrHeaders, normalizedHeaders);
|
|
169294
|
+
return originalWriteHead(statusCode, normalizedHeaders);
|
|
169295
|
+
}
|
|
169296
|
+
return originalWriteHead(statusCode, statusMessageOrHeaders, headers);
|
|
169297
|
+
});
|
|
169298
|
+
};
|
|
169033
169299
|
var DEFAULT_SESSION_IDLE_TIMEOUT = 18e5;
|
|
169034
169300
|
var SESSION_SWEEP_INTERVAL = 6e4;
|
|
169035
169301
|
var FORCE_CLOSE_GRACE_PERIOD = 1e3;
|
|
@@ -169077,6 +169343,7 @@ var getBody = (request2, maxBodySize = DEFAULT_MAX_BODY_SIZE) => {
|
|
|
169077
169343
|
if (maxBodySize !== false) {
|
|
169078
169344
|
size += chunk.length;
|
|
169079
169345
|
if (size > maxBodySize) {
|
|
169346
|
+
request2.pause();
|
|
169080
169347
|
resolve3({
|
|
169081
169348
|
limit: maxBodySize,
|
|
169082
169349
|
tooLarge: true
|
|
@@ -169182,6 +169449,10 @@ var isScopeChallengeError = (error52) => {
|
|
|
169182
169449
|
var handleResponseError = async (error52, res) => {
|
|
169183
169450
|
if (error52 && typeof error52 === "object" && "status" in error52 && "headers" in error52 && "statusText" in error52 || error52 instanceof Response) {
|
|
169184
169451
|
const responseError = error52;
|
|
169452
|
+
if (res.headersSent) {
|
|
169453
|
+
res.end();
|
|
169454
|
+
return true;
|
|
169455
|
+
}
|
|
169185
169456
|
const fixedHeaders = {};
|
|
169186
169457
|
responseError.headers.forEach((value2, key$1) => {
|
|
169187
169458
|
if (fixedHeaders[key$1]) if (Array.isArray(fixedHeaders[key$1])) fixedHeaders[key$1].push(value2);
|
|
@@ -169257,8 +169528,9 @@ var applyCorsHeaders = (req, res, corsOptions) => {
|
|
|
169257
169528
|
else if (Array.isArray(finalCorsOptions.origin)) allowedOrigin = finalCorsOptions.origin.includes(origin.origin) ? origin.origin : "false";
|
|
169258
169529
|
else if (typeof finalCorsOptions.origin === "function") allowedOrigin = finalCorsOptions.origin(origin.origin) ? origin.origin : "false";
|
|
169259
169530
|
}
|
|
169531
|
+
res.setHeader("Vary", "Origin");
|
|
169260
169532
|
if (allowedOrigin !== "false") res.setHeader("Access-Control-Allow-Origin", allowedOrigin);
|
|
169261
|
-
if (finalCorsOptions.credentials !== void 0) res.setHeader("Access-Control-Allow-Credentials", finalCorsOptions.credentials.toString());
|
|
169533
|
+
if (finalCorsOptions.credentials !== void 0 && allowedOrigin !== "*") res.setHeader("Access-Control-Allow-Credentials", finalCorsOptions.credentials.toString());
|
|
169262
169534
|
if (finalCorsOptions.methods) res.setHeader("Access-Control-Allow-Methods", finalCorsOptions.methods.join(", "));
|
|
169263
169535
|
if (finalCorsOptions.allowedHeaders) {
|
|
169264
169536
|
const allowedHeaders = typeof finalCorsOptions.allowedHeaders === "string" ? finalCorsOptions.allowedHeaders : finalCorsOptions.allowedHeaders.join(", ");
|
|
@@ -169492,8 +169764,16 @@ var handleStreamRequest = async ({ activeTransports, authenticate, authMiddlewar
|
|
|
169492
169764
|
});
|
|
169493
169765
|
return true;
|
|
169494
169766
|
}
|
|
169495
|
-
|
|
169496
|
-
|
|
169767
|
+
try {
|
|
169768
|
+
await server.connect(transport);
|
|
169769
|
+
if (onConnect) await onConnect(server);
|
|
169770
|
+
} catch (error52) {
|
|
169771
|
+
if (!isCleaningUp) {
|
|
169772
|
+
isCleaningUp = true;
|
|
169773
|
+
await cleanupServer(server, onClose);
|
|
169774
|
+
}
|
|
169775
|
+
throw error52;
|
|
169776
|
+
}
|
|
169497
169777
|
await transport.handleRequest(req, res, body);
|
|
169498
169778
|
return true;
|
|
169499
169779
|
} else if (stateless && !sessionId && !isInitializeRequest(body)) {
|
|
@@ -169515,8 +169795,13 @@ var handleStreamRequest = async ({ activeTransports, authenticate, authMiddlewar
|
|
|
169515
169795
|
});
|
|
169516
169796
|
return true;
|
|
169517
169797
|
}
|
|
169518
|
-
|
|
169519
|
-
|
|
169798
|
+
try {
|
|
169799
|
+
await server.connect(transport);
|
|
169800
|
+
if (onConnect) await onConnect(server);
|
|
169801
|
+
} catch (error52) {
|
|
169802
|
+
await cleanupServer(server, onClose);
|
|
169803
|
+
throw error52;
|
|
169804
|
+
}
|
|
169520
169805
|
await transport.handleRequest(req, res, body);
|
|
169521
169806
|
return true;
|
|
169522
169807
|
} else {
|
|
@@ -169535,6 +169820,11 @@ var handleStreamRequest = async ({ activeTransports, authenticate, authMiddlewar
|
|
|
169535
169820
|
await transport.handleRequest(req, res, body);
|
|
169536
169821
|
return true;
|
|
169537
169822
|
} catch (error52) {
|
|
169823
|
+
if (res.headersSent) {
|
|
169824
|
+
console.error("[mcp-proxy] error handling request after headers sent", error52);
|
|
169825
|
+
res.end();
|
|
169826
|
+
return true;
|
|
169827
|
+
}
|
|
169538
169828
|
if (isScopeChallengeError(error52)) {
|
|
169539
169829
|
const response = authMiddleware.getScopeChallengeResponse(error52.data.requiredScopes, error52.data.errorDescription, body?.id);
|
|
169540
169830
|
res.writeHead(response.statusCode, response.headers);
|
|
@@ -169580,7 +169870,13 @@ var handleStreamRequest = async ({ activeTransports, authenticate, authMiddlewar
|
|
|
169580
169870
|
if (lastEventId) console.log(`[mcp-proxy] client reconnecting with Last-Event-ID ${lastEventId} for session ID ${sessionId}`);
|
|
169581
169871
|
else console.log(`[mcp-proxy] establishing new SSE stream for session ID ${sessionId}`);
|
|
169582
169872
|
trackSessionStream(activeTransport, res);
|
|
169583
|
-
|
|
169873
|
+
try {
|
|
169874
|
+
await activeTransport.transport.handleRequest(req, res);
|
|
169875
|
+
} catch (error52) {
|
|
169876
|
+
console.error("[mcp-proxy] error handling stream request", error52);
|
|
169877
|
+
if (res.headersSent) res.end();
|
|
169878
|
+
else res.writeHead(500).end("Error handling request");
|
|
169879
|
+
}
|
|
169584
169880
|
return true;
|
|
169585
169881
|
}
|
|
169586
169882
|
if (req.method === "DELETE" && new URL(req.url, "http://localhost").pathname === endpoint2) {
|
|
@@ -169690,6 +169986,7 @@ var startHTTPServer = async ({ apiKey, authenticate, cors, createServer: createS
|
|
|
169690
169986
|
onListenSubscriptions
|
|
169691
169987
|
}) : void 0;
|
|
169692
169988
|
const requestListener = async (req, res) => {
|
|
169989
|
+
ensureUtf8ResponseCharset(res);
|
|
169693
169990
|
applyCorsHeaders(req, res, cors);
|
|
169694
169991
|
if (req.method === "OPTIONS") {
|
|
169695
169992
|
res.writeHead(204);
|
|
@@ -182062,10 +182359,111 @@ function withDefaults(oldDefaults, newDefaults) {
|
|
|
182062
182359
|
}
|
|
182063
182360
|
var endpoint = withDefaults(null, DEFAULTS);
|
|
182064
182361
|
|
|
182065
|
-
// node_modules/.pnpm
|
|
182066
|
-
var
|
|
182362
|
+
// node_modules/.pnpm/content-type@3.0.0/node_modules/content-type/dist/index.js
|
|
182363
|
+
var NullObject = /* @__PURE__ */ (() => {
|
|
182364
|
+
const C = function() {
|
|
182365
|
+
};
|
|
182366
|
+
C.prototype = /* @__PURE__ */ Object.create(null);
|
|
182367
|
+
return C;
|
|
182368
|
+
})();
|
|
182369
|
+
function parse5(header, options) {
|
|
182370
|
+
const stopChar = options?.comma === true ? COMMA : 65536;
|
|
182371
|
+
const len = header.length;
|
|
182372
|
+
let index = skipOWS(header, options?.start ?? 0, len);
|
|
182373
|
+
const valueStart = index;
|
|
182374
|
+
index = skipValue(header, index, len, stopChar);
|
|
182375
|
+
const valueEnd = trailingOWS(header, valueStart, index);
|
|
182376
|
+
const type2 = header.slice(valueStart, valueEnd).toLowerCase();
|
|
182377
|
+
if (options?.parameters === false) {
|
|
182378
|
+
return { type: type2, index, parameters: new NullObject() };
|
|
182379
|
+
}
|
|
182380
|
+
return parseParameters(header, type2, index, len, stopChar);
|
|
182381
|
+
}
|
|
182382
|
+
var SP = 32;
|
|
182383
|
+
var HTAB = 9;
|
|
182384
|
+
var SEMI = 59;
|
|
182385
|
+
var EQ = 61;
|
|
182386
|
+
var DQUOTE = 34;
|
|
182387
|
+
var BSLASH = 92;
|
|
182388
|
+
var COMMA = 44;
|
|
182389
|
+
function parseParameters(header, type2, index, len, stopChar) {
|
|
182390
|
+
const parameters = new NullObject();
|
|
182391
|
+
parameter: while (index < len) {
|
|
182392
|
+
if (header.charCodeAt(index) === stopChar)
|
|
182393
|
+
break;
|
|
182394
|
+
index = skipOWS(header, index + 1, len);
|
|
182395
|
+
const keyStart = index;
|
|
182396
|
+
while (index < len) {
|
|
182397
|
+
const code = header.charCodeAt(index);
|
|
182398
|
+
if (code === stopChar)
|
|
182399
|
+
break parameter;
|
|
182400
|
+
if (code === SEMI)
|
|
182401
|
+
continue parameter;
|
|
182402
|
+
if (code === EQ) {
|
|
182403
|
+
const keyEnd = trailingOWS(header, keyStart, index);
|
|
182404
|
+
const key = header.slice(keyStart, keyEnd).toLowerCase();
|
|
182405
|
+
index = skipOWS(header, index + 1, len);
|
|
182406
|
+
if (index < len && header.charCodeAt(index) === DQUOTE) {
|
|
182407
|
+
index++;
|
|
182408
|
+
let value2 = "";
|
|
182409
|
+
while (index < len) {
|
|
182410
|
+
const code2 = header.charCodeAt(index++);
|
|
182411
|
+
if (code2 === DQUOTE) {
|
|
182412
|
+
index = skipValue(header, index, len, stopChar);
|
|
182413
|
+
if (parameters[key] === void 0)
|
|
182414
|
+
parameters[key] = value2;
|
|
182415
|
+
break;
|
|
182416
|
+
}
|
|
182417
|
+
if (code2 === BSLASH && index < len) {
|
|
182418
|
+
value2 += header[index++];
|
|
182419
|
+
continue;
|
|
182420
|
+
}
|
|
182421
|
+
value2 += String.fromCharCode(code2);
|
|
182422
|
+
}
|
|
182423
|
+
continue parameter;
|
|
182424
|
+
}
|
|
182425
|
+
const valueStart = index;
|
|
182426
|
+
index = skipValue(header, index, len, stopChar);
|
|
182427
|
+
if (parameters[key] === void 0) {
|
|
182428
|
+
const valueEnd = trailingOWS(header, valueStart, index);
|
|
182429
|
+
parameters[key] = header.slice(valueStart, valueEnd);
|
|
182430
|
+
}
|
|
182431
|
+
continue parameter;
|
|
182432
|
+
}
|
|
182433
|
+
index++;
|
|
182434
|
+
}
|
|
182435
|
+
}
|
|
182436
|
+
return { type: type2, index, parameters };
|
|
182437
|
+
}
|
|
182438
|
+
function skipValue(str, index, len, stopChar) {
|
|
182439
|
+
while (index < len) {
|
|
182440
|
+
const code = str.charCodeAt(index);
|
|
182441
|
+
if (code === SEMI || code === stopChar)
|
|
182442
|
+
break;
|
|
182443
|
+
index++;
|
|
182444
|
+
}
|
|
182445
|
+
return index;
|
|
182446
|
+
}
|
|
182447
|
+
function skipOWS(header, index, len) {
|
|
182448
|
+
while (index < len) {
|
|
182449
|
+
const char = header.charCodeAt(index);
|
|
182450
|
+
if (char !== SP && char !== HTAB)
|
|
182451
|
+
break;
|
|
182452
|
+
index++;
|
|
182453
|
+
}
|
|
182454
|
+
return index;
|
|
182455
|
+
}
|
|
182456
|
+
function trailingOWS(header, start, end) {
|
|
182457
|
+
while (end > start) {
|
|
182458
|
+
const char = header.charCodeAt(end - 1);
|
|
182459
|
+
if (char !== SP && char !== HTAB)
|
|
182460
|
+
break;
|
|
182461
|
+
end--;
|
|
182462
|
+
}
|
|
182463
|
+
return end;
|
|
182464
|
+
}
|
|
182067
182465
|
|
|
182068
|
-
// node_modules/.pnpm/json-with-bigint@3.5.
|
|
182466
|
+
// node_modules/.pnpm/json-with-bigint@3.5.12/node_modules/json-with-bigint/json-with-bigint.js
|
|
182069
182467
|
var intRegex = /^-?\d+$/;
|
|
182070
182468
|
var noiseValue = /^-?\d+n+$/;
|
|
182071
182469
|
var originalStringify = JSON.stringify;
|
|
@@ -182322,7 +182720,7 @@ var JSONParseV2 = (text, reviver) => {
|
|
|
182322
182720
|
};
|
|
182323
182721
|
var MAX_INT = Number.MAX_SAFE_INTEGER.toString();
|
|
182324
182722
|
var MAX_DIGITS = MAX_INT.length;
|
|
182325
|
-
var stringsOrLargeNumbers = /"(
|
|
182723
|
+
var stringsOrLargeNumbers = /"(?:[^"\\]|\\.)*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g;
|
|
182326
182724
|
var noiseValueWithQuotes = /^"-?\d+n+"$/;
|
|
182327
182725
|
var applyReviverIteratively = (parsed2, userReviver) => {
|
|
182328
182726
|
const rootHolder = { "": parsed2 };
|
|
@@ -182439,8 +182837,8 @@ var RequestError2 = class extends Error {
|
|
|
182439
182837
|
}
|
|
182440
182838
|
};
|
|
182441
182839
|
|
|
182442
|
-
// node_modules/.pnpm/@octokit+request@10.0.
|
|
182443
|
-
var VERSION3 = "10.0.
|
|
182840
|
+
// node_modules/.pnpm/@octokit+request@10.0.15/node_modules/@octokit/request/dist-bundle/index.js
|
|
182841
|
+
var VERSION3 = "10.0.15";
|
|
182444
182842
|
var defaults_default = {
|
|
182445
182843
|
headers: {
|
|
182446
182844
|
"user-agent": `octokit-request.js/${VERSION3} ${getUserAgent2()}`
|
|
@@ -182558,7 +182956,7 @@ async function getResponseData(response) {
|
|
|
182558
182956
|
if (!contentType) {
|
|
182559
182957
|
return response.text().catch(noop2);
|
|
182560
182958
|
}
|
|
182561
|
-
const mimetype = (
|
|
182959
|
+
const mimetype = parse5(contentType);
|
|
182562
182960
|
if (isJSONResponse(mimetype)) {
|
|
182563
182961
|
let text = "";
|
|
182564
182962
|
try {
|
|
@@ -185930,7 +186328,7 @@ function resolveRepoCtx(ctx, repo) {
|
|
|
185930
186328
|
// node_modules/.pnpm/@toon-format+toon@1.4.0/node_modules/@toon-format/toon/dist/index.mjs
|
|
185931
186329
|
var LIST_ITEM_MARKER = "-";
|
|
185932
186330
|
var LIST_ITEM_PREFIX = "- ";
|
|
185933
|
-
var
|
|
186331
|
+
var COMMA2 = ",";
|
|
185934
186332
|
var PIPE = "|";
|
|
185935
186333
|
var DOT = ".";
|
|
185936
186334
|
var NULL_LITERAL = "null";
|
|
@@ -185940,7 +186338,7 @@ var BACKSLASH = "\\";
|
|
|
185940
186338
|
var DOUBLE_QUOTE = '"';
|
|
185941
186339
|
var TAB = " ";
|
|
185942
186340
|
var DELIMITERS = {
|
|
185943
|
-
comma:
|
|
186341
|
+
comma: COMMA2,
|
|
185944
186342
|
tab: TAB,
|
|
185945
186343
|
pipe: PIPE
|
|
185946
186344
|
};
|
|
@@ -186085,7 +186483,7 @@ function encodeAndJoinPrimitives(values, delimiter2 = DEFAULT_DELIMITER) {
|
|
|
186085
186483
|
function formatHeader(length, options) {
|
|
186086
186484
|
const key = options?.key;
|
|
186087
186485
|
const fields = options?.fields;
|
|
186088
|
-
const delimiter2 = options?.delimiter ??
|
|
186486
|
+
const delimiter2 = options?.delimiter ?? COMMA2;
|
|
186089
186487
|
let header = "";
|
|
186090
186488
|
if (key) header += encodeKey(key);
|
|
186091
186489
|
header += `[${length}${delimiter2 !== DEFAULT_DELIMITER ? delimiter2 : ""}]`;
|
|
@@ -192509,116 +192907,16 @@ function subagentDeniedToolNames(ctx, outputSchema) {
|
|
|
192509
192907
|
return names;
|
|
192510
192908
|
}
|
|
192511
192909
|
|
|
192512
|
-
// utils/agent.ts
|
|
192513
|
-
function hasEnvVar2(name) {
|
|
192514
|
-
const val = process.env[name];
|
|
192515
|
-
return typeof val === "string" && val.length > 0;
|
|
192516
|
-
}
|
|
192517
|
-
function hasClaudeCodeAuth() {
|
|
192518
|
-
return hasEnvVar2("CLAUDE_CODE_OAUTH_TOKEN") || hasEnvVar2("ANTHROPIC_API_KEY") || hasEnvVar2("ANTHROPIC_AUTH_TOKEN");
|
|
192519
|
-
}
|
|
192520
|
-
function hasCodexAuth() {
|
|
192521
|
-
return hasEnvVar2("CODEX_AUTH_JSON") || hasEnvVar2("OPENAI_API_KEY");
|
|
192522
|
-
}
|
|
192523
|
-
function hasBedrockAuth() {
|
|
192524
|
-
return hasEnvVar2("AWS_BEARER_TOKEN_BEDROCK") || hasEnvVar2("AWS_ACCESS_KEY_ID") && hasEnvVar2("AWS_SECRET_ACCESS_KEY");
|
|
192525
|
-
}
|
|
192526
|
-
function hasVertexAuth() {
|
|
192527
|
-
return hasEnvVar2(VERTEX_SERVICE_ACCOUNT_JSON_ENV);
|
|
192528
|
-
}
|
|
192529
|
-
function resolveSlug(slug2) {
|
|
192530
|
-
const alias = resolveDisplayAlias(slug2);
|
|
192531
|
-
if (alias?.routing === "bedrock") {
|
|
192532
|
-
const bedrockId = process.env[BEDROCK_MODEL_ID_ENV]?.trim();
|
|
192533
|
-
if (!bedrockId) {
|
|
192534
|
-
throw new Error(
|
|
192535
|
-
`${BEDROCK_MODEL_ID_ENV} env var is required when the model is set to "${slug2}". set it to an AWS Bedrock model ID from the Bedrock console. see https://docs.pullfrog.com/bedrock for setup.`
|
|
192536
|
-
);
|
|
192537
|
-
}
|
|
192538
|
-
return bedrockId;
|
|
192539
|
-
}
|
|
192540
|
-
if (alias?.routing === "vertex") {
|
|
192541
|
-
const vertexId = process.env[VERTEX_MODEL_ID_ENV]?.trim();
|
|
192542
|
-
if (!vertexId) {
|
|
192543
|
-
throw new Error(
|
|
192544
|
-
`${VERTEX_MODEL_ID_ENV} env var is required when the model is set to "${slug2}". set it to a Google Vertex AI model ID from Model Garden. see https://docs.pullfrog.com/vertex for setup.`
|
|
192545
|
-
);
|
|
192546
|
-
}
|
|
192547
|
-
return vertexId;
|
|
192548
|
-
}
|
|
192549
|
-
if (alias?.routing === "azure") {
|
|
192550
|
-
const deployment = process.env[AZURE_DEPLOYMENT_ENV]?.trim();
|
|
192551
|
-
if (!deployment) {
|
|
192552
|
-
throw new Error(
|
|
192553
|
-
`${AZURE_DEPLOYMENT_ENV} env var is required when the model is set to "${slug2}". set it to the name of your Azure OpenAI deployment (not the model it serves \u2014 Azure routes on the deployment name). see https://docs.pullfrog.com/azure for setup.`
|
|
192554
|
-
);
|
|
192555
|
-
}
|
|
192556
|
-
return `${AZURE_PROVIDER}/${deployment}`;
|
|
192557
|
-
}
|
|
192558
|
-
if (alias?.routing === "openai-compatible") {
|
|
192559
|
-
const modelId = process.env[OPENAI_COMPATIBLE_MODEL_ENV]?.trim();
|
|
192560
|
-
if (!modelId) {
|
|
192561
|
-
throw new Error(
|
|
192562
|
-
`${OPENAI_COMPATIBLE_MODEL_ENV} env var is required when the model is set to "${slug2}". set it to the model ID served by your OpenAI-compatible endpoint (e.g. a Cloudflare AI Gateway or DashScope model). see https://docs.pullfrog.com/openai-compatible for setup.`
|
|
192563
|
-
);
|
|
192564
|
-
}
|
|
192565
|
-
return `${OPENAI_COMPATIBLE_PROVIDER}/${modelId}`;
|
|
192566
|
-
}
|
|
192567
|
-
return resolveCliModel(slug2);
|
|
192568
|
-
}
|
|
192569
|
-
function resolveModel(ctx) {
|
|
192570
|
-
const envModel = process.env.PULLFROG_MODEL?.trim();
|
|
192571
|
-
if (envModel) {
|
|
192572
|
-
return resolveSlug(envModel) ?? envModel;
|
|
192573
|
-
}
|
|
192574
|
-
const slug2 = ctx.slug?.trim();
|
|
192575
|
-
if (slug2) {
|
|
192576
|
-
const resolved = resolveSlug(slug2);
|
|
192577
|
-
if (resolved) {
|
|
192578
|
-
return resolved;
|
|
192579
|
-
}
|
|
192580
|
-
if (slug2.includes("/")) {
|
|
192581
|
-
log.info(`\xBB "${slug2}" is not a curated alias \u2014 passing through as a raw model specifier`);
|
|
192582
|
-
return slug2;
|
|
192583
|
-
}
|
|
192584
|
-
log.warning(`\xBB unknown model slug "${slug2}" \u2014 agent will auto-select`);
|
|
192585
|
-
}
|
|
192586
|
-
return void 0;
|
|
192587
|
-
}
|
|
192588
|
-
function resolveAgent(ctx) {
|
|
192589
|
-
const envAgent = process.env.PULLFROG_AGENT?.trim();
|
|
192590
|
-
if (envAgent) {
|
|
192591
|
-
if (envAgent in agents) {
|
|
192592
|
-
return agents[envAgent];
|
|
192593
|
-
}
|
|
192594
|
-
log.warning(`\xBB unknown PULLFROG_AGENT="${envAgent}" \u2014 falling through to auto-select`);
|
|
192595
|
-
}
|
|
192596
|
-
if (ctx.proxyModel) return agents.opencode;
|
|
192597
|
-
if (ctx.model && hasBedrockAuth() && process.env[BEDROCK_MODEL_ID_ENV]?.trim() === ctx.model) {
|
|
192598
|
-
return isBedrockAnthropicId(ctx.model) ? agents.claude : agents.opencode;
|
|
192599
|
-
}
|
|
192600
|
-
if (ctx.model && hasVertexAuth() && process.env[VERTEX_MODEL_ID_ENV]?.trim() === ctx.model) {
|
|
192601
|
-
return isVertexAnthropicId(ctx.model) ? agents.claude : agents.opencode;
|
|
192602
|
-
}
|
|
192603
|
-
if (ctx.model) {
|
|
192604
|
-
try {
|
|
192605
|
-
const provider2 = getModelProvider(ctx.model);
|
|
192606
|
-
if (provider2 === "anthropic" && hasClaudeCodeAuth()) return agents.claude;
|
|
192607
|
-
if (provider2 === "openai" && ctx.codexAgent && hasCodexAuth()) return agents.codex;
|
|
192608
|
-
} catch {
|
|
192609
|
-
}
|
|
192610
|
-
}
|
|
192611
|
-
if (!ctx.model) {
|
|
192612
|
-
if (hasEnvVar2("ANTHROPIC_AUTH_TOKEN") && !hasEnvVar2("ANTHROPIC_API_KEY") && !hasEnvVar2("CLAUDE_CODE_OAUTH_TOKEN")) {
|
|
192613
|
-
return agents.claude;
|
|
192614
|
-
}
|
|
192615
|
-
if (ctx.codexAgent && hasCodexAuth() && !hasClaudeCodeAuth()) return agents.codex;
|
|
192616
|
-
}
|
|
192617
|
-
return agents.opencode;
|
|
192618
|
-
}
|
|
192619
|
-
|
|
192620
192910
|
// utils/apiKeys.ts
|
|
192621
192911
|
var MISSING_KEY_MARKER = "no API key found";
|
|
192912
|
+
var BYOK_SLUG_MARKER = "env var is required when the model is set to";
|
|
192913
|
+
var BYOK_CONFIG_MARKER = "selected but required configuration is missing:";
|
|
192914
|
+
var BYOK_SETUP_PATTERN = new RegExp(
|
|
192915
|
+
`^(?:[A-Z][A-Z0-9_]+ ${BYOK_SLUG_MARKER}|[A-Z][\\w-]*(?: [\\w-]+){0,3} ${BYOK_CONFIG_MARKER})`
|
|
192916
|
+
);
|
|
192917
|
+
function isByokSetupError(text) {
|
|
192918
|
+
return BYOK_SETUP_PATTERN.test(text);
|
|
192919
|
+
}
|
|
192622
192920
|
var SECRETS_UNAVAILABLE_MARKER = "couldn't load your Pullfrog secrets";
|
|
192623
192921
|
var ROUTER_UNFUNDED_MARKER = "your Pullfrog Router balance is empty";
|
|
192624
192922
|
var CREDENTIAL_REJECTED_MARKER = "was rejected by its provider";
|
|
@@ -192667,7 +192965,7 @@ function buildMissingApiKeyError(params) {
|
|
|
192667
192965
|
}
|
|
192668
192966
|
function buildBedrockSetupError(params) {
|
|
192669
192967
|
const githubSecretsUrl = `https://github.com/${params.owner}/${params.name}/settings/secrets/actions`;
|
|
192670
|
-
return `Bedrock model
|
|
192968
|
+
return `Bedrock model ${BYOK_CONFIG_MARKER} ${params.missing.join(", ")}.
|
|
192671
192969
|
|
|
192672
192970
|
add the missing secret(s) to your GitHub repository at ${githubSecretsUrl}, then reference them in your workflow's \`env:\` block:
|
|
192673
192971
|
|
|
@@ -192681,7 +192979,7 @@ for full setup instructions, see https://docs.pullfrog.com/bedrock`;
|
|
|
192681
192979
|
}
|
|
192682
192980
|
function buildVertexSetupError(params) {
|
|
192683
192981
|
const githubSecretsUrl = `https://github.com/${params.owner}/${params.name}/settings/secrets/actions`;
|
|
192684
|
-
return `Google Vertex AI model
|
|
192982
|
+
return `Google Vertex AI model ${BYOK_CONFIG_MARKER} ${params.missing.join(", ")}.
|
|
192685
192983
|
|
|
192686
192984
|
add the missing secret(s) to your GitHub repository at ${githubSecretsUrl}, then reference them in your workflow's \`env:\` block:
|
|
192687
192985
|
|
|
@@ -192694,7 +192992,7 @@ for full setup instructions, see https://docs.pullfrog.com/vertex`;
|
|
|
192694
192992
|
}
|
|
192695
192993
|
function buildOpenAICompatibleSetupError(params) {
|
|
192696
192994
|
const githubSecretsUrl = `https://github.com/${params.owner}/${params.name}/settings/secrets/actions`;
|
|
192697
|
-
return `OpenAI-compatible model
|
|
192995
|
+
return `OpenAI-compatible model ${BYOK_CONFIG_MARKER} ${params.missing.join(", ")}.
|
|
192698
192996
|
|
|
192699
192997
|
only the API key is sensitive \u2014 add it as a secret at ${githubSecretsUrl}. everything else is plain workflow \`env:\`:
|
|
192700
192998
|
|
|
@@ -192713,7 +193011,7 @@ for full setup instructions, see https://docs.pullfrog.com/openai-compatible`;
|
|
|
192713
193011
|
}
|
|
192714
193012
|
function buildAzureSetupError(params) {
|
|
192715
193013
|
const githubSecretsUrl = `https://github.com/${params.owner}/${params.name}/settings/secrets/actions`;
|
|
192716
|
-
return `Azure OpenAI
|
|
193014
|
+
return `Azure OpenAI ${BYOK_CONFIG_MARKER} ${params.missing.join(", ")}.
|
|
192717
193015
|
|
|
192718
193016
|
only the API key is sensitive \u2014 add it as a secret at ${githubSecretsUrl}. the rest is plain workflow \`env:\`:
|
|
192719
193017
|
|
|
@@ -192734,22 +193032,22 @@ is disabled, so long runs grow until Azure refuses them.
|
|
|
192734
193032
|
|
|
192735
193033
|
for full setup instructions, see https://docs.pullfrog.com/azure`;
|
|
192736
193034
|
}
|
|
192737
|
-
function
|
|
193035
|
+
function hasEnvVar2(name) {
|
|
192738
193036
|
const value2 = process.env[name];
|
|
192739
193037
|
return typeof value2 === "string" && value2.length > 0;
|
|
192740
193038
|
}
|
|
192741
193039
|
function modelHasRuntimeAuth(model) {
|
|
192742
193040
|
const authVars = [...getModelEnvVars(model), ...getModelManagedCredentials(model)];
|
|
192743
|
-
return authVars.length === 0 || authVars.some(
|
|
193041
|
+
return authVars.length === 0 || authVars.some(hasEnvVar2);
|
|
192744
193042
|
}
|
|
192745
193043
|
function hasPositiveNumberEnvVar(name) {
|
|
192746
193044
|
return Number(process.env[name]) > 0;
|
|
192747
193045
|
}
|
|
192748
193046
|
function validateOpenAICompatibleSetup(params) {
|
|
192749
193047
|
const missing = [];
|
|
192750
|
-
if (!
|
|
192751
|
-
if (!
|
|
192752
|
-
if (!
|
|
193048
|
+
if (!hasEnvVar2(OPENAI_COMPATIBLE_BASE_URL_ENV)) missing.push(OPENAI_COMPATIBLE_BASE_URL_ENV);
|
|
193049
|
+
if (!hasEnvVar2(OPENAI_COMPATIBLE_API_KEY_ENV)) missing.push(OPENAI_COMPATIBLE_API_KEY_ENV);
|
|
193050
|
+
if (!hasEnvVar2(OPENAI_COMPATIBLE_MODEL_ENV)) missing.push(OPENAI_COMPATIBLE_MODEL_ENV);
|
|
192753
193051
|
if (!hasPositiveNumberEnvVar(OPENAI_COMPATIBLE_CONTEXT_ENV))
|
|
192754
193052
|
missing.push(OPENAI_COMPATIBLE_CONTEXT_ENV);
|
|
192755
193053
|
if (!hasPositiveNumberEnvVar(OPENAI_COMPATIBLE_MAX_OUTPUT_ENV))
|
|
@@ -192762,9 +193060,9 @@ function validateOpenAICompatibleSetup(params) {
|
|
|
192762
193060
|
}
|
|
192763
193061
|
function validateAzureSetup(params) {
|
|
192764
193062
|
const missing = [];
|
|
192765
|
-
if (!
|
|
192766
|
-
if (!
|
|
192767
|
-
if (!
|
|
193063
|
+
if (!hasEnvVar2(AZURE_API_KEY_ENV)) missing.push(AZURE_API_KEY_ENV);
|
|
193064
|
+
if (!hasEnvVar2(AZURE_RESOURCE_NAME_ENV)) missing.push(AZURE_RESOURCE_NAME_ENV);
|
|
193065
|
+
if (!hasEnvVar2(AZURE_DEPLOYMENT_ENV)) missing.push(AZURE_DEPLOYMENT_ENV);
|
|
192768
193066
|
if (!hasPositiveNumberEnvVar(AZURE_CONTEXT_ENV)) missing.push(AZURE_CONTEXT_ENV);
|
|
192769
193067
|
if (!hasPositiveNumberEnvVar(AZURE_MAX_OUTPUT_ENV)) missing.push(AZURE_MAX_OUTPUT_ENV);
|
|
192770
193068
|
if (missing.length > 0) {
|
|
@@ -192772,33 +193070,33 @@ function validateAzureSetup(params) {
|
|
|
192772
193070
|
}
|
|
192773
193071
|
}
|
|
192774
193072
|
function validateBedrockSetup(params) {
|
|
192775
|
-
const hasAuth =
|
|
193073
|
+
const hasAuth = hasEnvVar2("AWS_BEARER_TOKEN_BEDROCK") || hasEnvVar2("AWS_ACCESS_KEY_ID") && hasEnvVar2("AWS_SECRET_ACCESS_KEY");
|
|
192776
193074
|
const missing = [];
|
|
192777
193075
|
if (!hasAuth)
|
|
192778
193076
|
missing.push("AWS_BEARER_TOKEN_BEDROCK (or AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY)");
|
|
192779
|
-
if (!
|
|
192780
|
-
if (!
|
|
193077
|
+
if (!hasEnvVar2("AWS_REGION")) missing.push("AWS_REGION");
|
|
193078
|
+
if (!hasEnvVar2(BEDROCK_MODEL_ID_ENV)) missing.push(BEDROCK_MODEL_ID_ENV);
|
|
192781
193079
|
if (missing.length > 0) {
|
|
192782
193080
|
throw new Error(buildBedrockSetupError({ owner: params.owner, name: params.name, missing }));
|
|
192783
193081
|
}
|
|
192784
193082
|
}
|
|
192785
193083
|
function validateVertexSetup(params) {
|
|
192786
|
-
const hasAuth =
|
|
192787
|
-
const hasProject =
|
|
193084
|
+
const hasAuth = hasEnvVar2(VERTEX_SERVICE_ACCOUNT_JSON_ENV);
|
|
193085
|
+
const hasProject = hasEnvVar2(GOOGLE_CLOUD_PROJECT_ENV) || readProjectIdFromVertexServiceAccountJson() !== void 0;
|
|
192788
193086
|
const missing = [];
|
|
192789
193087
|
if (!hasAuth) missing.push(VERTEX_SERVICE_ACCOUNT_JSON_ENV);
|
|
192790
193088
|
if (!hasProject) missing.push(GOOGLE_CLOUD_PROJECT_ENV);
|
|
192791
|
-
if (!
|
|
192792
|
-
if (!
|
|
193089
|
+
if (!hasEnvVar2(VERTEX_LOCATION_ENV)) missing.push(VERTEX_LOCATION_ENV);
|
|
193090
|
+
if (!hasEnvVar2(VERTEX_MODEL_ID_ENV)) missing.push(VERTEX_MODEL_ID_ENV);
|
|
192793
193091
|
if (missing.length > 0) {
|
|
192794
193092
|
throw new Error(buildVertexSetupError({ owner: params.owner, name: params.name, missing }));
|
|
192795
193093
|
}
|
|
192796
193094
|
}
|
|
192797
193095
|
function hasSingleProviderAuth(agentName) {
|
|
192798
193096
|
if (agentName === "codex") {
|
|
192799
|
-
return
|
|
193097
|
+
return hasEnvVar2("OPENAI_API_KEY") || hasEnvVar2("CODEX_AUTH_JSON");
|
|
192800
193098
|
}
|
|
192801
|
-
return
|
|
193099
|
+
return hasEnvVar2("ANTHROPIC_API_KEY") || hasEnvVar2("ANTHROPIC_AUTH_TOKEN") || hasEnvVar2("CLAUDE_CODE_OAUTH_TOKEN");
|
|
192802
193100
|
}
|
|
192803
193101
|
function validateAgentApiKey(params) {
|
|
192804
193102
|
if (params.model) {
|
|
@@ -192831,7 +193129,7 @@ function validateAgentApiKey(params) {
|
|
|
192831
193129
|
if (params.authorized.has(params.model)) return;
|
|
192832
193130
|
const reason = getModelsFailure();
|
|
192833
193131
|
if (reason) throw new Error(reason);
|
|
192834
|
-
if (getModelEnvVars(params.model).some(
|
|
193132
|
+
if (getModelEnvVars(params.model).some(hasEnvVar2)) return;
|
|
192835
193133
|
throw new Error(
|
|
192836
193134
|
buildKeyError({
|
|
192837
193135
|
owner: params.owner,
|
|
@@ -192878,7 +193176,7 @@ function validateAgentApiKey(params) {
|
|
|
192878
193176
|
}
|
|
192879
193177
|
function isApiKeyAuthError(text) {
|
|
192880
193178
|
if (!text) return false;
|
|
192881
|
-
return text.includes(MISSING_KEY_MARKER) || /Invalid API key/i.test(text) || /\bUser not found\b/i.test(text) || /\bInvalid authentication\b/i.test(text) || /authentication_error/i.test(text) || /Invalid bearer token/i.test(text) || /api_error_status\s*=\s*401/i.test(text) || /API Error:\s*401/i.test(text) || /Failed to authenticate\. API Error:/i.test(text) || /Your api key:.*is invalid/i.test(text) || isMalformedKeyError(text) || isClaudeSubscriptionDisabledError(text) || isClaudeSessionLimitError(text) || isOAuthCredentialExpiredError(text);
|
|
193179
|
+
return text.includes(MISSING_KEY_MARKER) || /Invalid API key/i.test(text) || /Incorrect API key provided/i.test(text) || /\bUser not found\b/i.test(text) || /\bInvalid authentication\b/i.test(text) || /authentication_error/i.test(text) || /Invalid bearer token/i.test(text) || /api_error_status\s*=\s*401/i.test(text) || /API Error:\s*401/i.test(text) || /Failed to authenticate\. API Error:/i.test(text) || /Your api key:.*is invalid/i.test(text) || isMalformedKeyError(text) || isClaudeSubscriptionDisabledError(text) || isClaudeSessionLimitError(text) || isOAuthCredentialExpiredError(text);
|
|
192882
193180
|
}
|
|
192883
193181
|
function isOAuthCredentialExpiredError(text) {
|
|
192884
193182
|
return (
|
|
@@ -192974,8 +193272,8 @@ function formatApiKeyErrorSummary(params) {
|
|
|
192974
193272
|
`[Claude subscription \u2192](https://docs.pullfrog.com/claude-auth) \xB7 [ChatGPT subscription \u2192](https://docs.pullfrog.com/codex-auth) \xB7 [Model settings \u2192](${settingsUrl}) \xB7 [Ask in Discord \u2192](https://discord.gg/8y96raFg8e)`
|
|
192975
193273
|
].join("\n");
|
|
192976
193274
|
}
|
|
192977
|
-
const subscription = Object.keys(SUBSCRIPTION_CREDENTIALS).find(
|
|
192978
|
-
if (subscription && !
|
|
193275
|
+
const subscription = Object.keys(SUBSCRIPTION_CREDENTIALS).find(hasEnvVar2);
|
|
193276
|
+
if (subscription && !hasEnvVar2("ANTHROPIC_API_KEY")) {
|
|
192979
193277
|
const details = SUBSCRIPTION_CREDENTIALS[subscription];
|
|
192980
193278
|
return [
|
|
192981
193279
|
`**Your ${details?.label} was rejected during this run.** Re-authenticate with \`${details?.command}\` and re-trigger \u2014 a subscription credential can't be rotated from a provider dashboard.`,
|
|
@@ -192990,6 +193288,114 @@ function formatApiKeyErrorSummary(params) {
|
|
|
192990
193288
|
].join("\n");
|
|
192991
193289
|
}
|
|
192992
193290
|
|
|
193291
|
+
// utils/agent.ts
|
|
193292
|
+
function hasEnvVar3(name) {
|
|
193293
|
+
const val = process.env[name];
|
|
193294
|
+
return typeof val === "string" && val.length > 0;
|
|
193295
|
+
}
|
|
193296
|
+
function hasClaudeCodeAuth() {
|
|
193297
|
+
return hasEnvVar3("CLAUDE_CODE_OAUTH_TOKEN") || hasEnvVar3("ANTHROPIC_API_KEY") || hasEnvVar3("ANTHROPIC_AUTH_TOKEN");
|
|
193298
|
+
}
|
|
193299
|
+
function hasCodexAuth() {
|
|
193300
|
+
return hasEnvVar3("CODEX_AUTH_JSON") || hasEnvVar3("OPENAI_API_KEY");
|
|
193301
|
+
}
|
|
193302
|
+
function hasBedrockAuth() {
|
|
193303
|
+
return hasEnvVar3("AWS_BEARER_TOKEN_BEDROCK") || hasEnvVar3("AWS_ACCESS_KEY_ID") && hasEnvVar3("AWS_SECRET_ACCESS_KEY");
|
|
193304
|
+
}
|
|
193305
|
+
function hasVertexAuth() {
|
|
193306
|
+
return hasEnvVar3(VERTEX_SERVICE_ACCOUNT_JSON_ENV);
|
|
193307
|
+
}
|
|
193308
|
+
function resolveSlug(slug2) {
|
|
193309
|
+
const alias = resolveDisplayAlias(slug2);
|
|
193310
|
+
if (alias?.routing === "bedrock") {
|
|
193311
|
+
const bedrockId = process.env[BEDROCK_MODEL_ID_ENV]?.trim();
|
|
193312
|
+
if (!bedrockId) {
|
|
193313
|
+
throw new Error(
|
|
193314
|
+
`${BEDROCK_MODEL_ID_ENV} ${BYOK_SLUG_MARKER} "${slug2}". set it to an AWS Bedrock model ID from the Bedrock console. see https://docs.pullfrog.com/bedrock for setup.`
|
|
193315
|
+
);
|
|
193316
|
+
}
|
|
193317
|
+
return bedrockId;
|
|
193318
|
+
}
|
|
193319
|
+
if (alias?.routing === "vertex") {
|
|
193320
|
+
const vertexId = process.env[VERTEX_MODEL_ID_ENV]?.trim();
|
|
193321
|
+
if (!vertexId) {
|
|
193322
|
+
throw new Error(
|
|
193323
|
+
`${VERTEX_MODEL_ID_ENV} ${BYOK_SLUG_MARKER} "${slug2}". set it to a Google Vertex AI model ID from Model Garden. see https://docs.pullfrog.com/vertex for setup.`
|
|
193324
|
+
);
|
|
193325
|
+
}
|
|
193326
|
+
return vertexId;
|
|
193327
|
+
}
|
|
193328
|
+
if (alias?.routing === "azure") {
|
|
193329
|
+
const deployment = process.env[AZURE_DEPLOYMENT_ENV]?.trim();
|
|
193330
|
+
if (!deployment) {
|
|
193331
|
+
throw new Error(
|
|
193332
|
+
`${AZURE_DEPLOYMENT_ENV} ${BYOK_SLUG_MARKER} "${slug2}". set it to the name of your Azure OpenAI deployment (not the model it serves \u2014 Azure routes on the deployment name). see https://docs.pullfrog.com/azure for setup.`
|
|
193333
|
+
);
|
|
193334
|
+
}
|
|
193335
|
+
return `${AZURE_PROVIDER}/${deployment}`;
|
|
193336
|
+
}
|
|
193337
|
+
if (alias?.routing === "openai-compatible") {
|
|
193338
|
+
const modelId = process.env[OPENAI_COMPATIBLE_MODEL_ENV]?.trim();
|
|
193339
|
+
if (!modelId) {
|
|
193340
|
+
throw new Error(
|
|
193341
|
+
`${OPENAI_COMPATIBLE_MODEL_ENV} ${BYOK_SLUG_MARKER} "${slug2}". set it to the model ID served by your OpenAI-compatible endpoint (e.g. a Cloudflare AI Gateway or DashScope model). see https://docs.pullfrog.com/openai-compatible for setup.`
|
|
193342
|
+
);
|
|
193343
|
+
}
|
|
193344
|
+
return `${OPENAI_COMPATIBLE_PROVIDER}/${modelId}`;
|
|
193345
|
+
}
|
|
193346
|
+
return resolveCliModel(slug2);
|
|
193347
|
+
}
|
|
193348
|
+
function resolveModel(ctx) {
|
|
193349
|
+
const envModel = process.env.PULLFROG_MODEL?.trim();
|
|
193350
|
+
if (envModel) {
|
|
193351
|
+
return resolveSlug(envModel) ?? envModel;
|
|
193352
|
+
}
|
|
193353
|
+
const slug2 = ctx.slug?.trim();
|
|
193354
|
+
if (slug2) {
|
|
193355
|
+
const resolved = resolveSlug(slug2);
|
|
193356
|
+
if (resolved) {
|
|
193357
|
+
return resolved;
|
|
193358
|
+
}
|
|
193359
|
+
if (slug2.includes("/")) {
|
|
193360
|
+
log.info(`\xBB "${slug2}" is not a curated alias \u2014 passing through as a raw model specifier`);
|
|
193361
|
+
return slug2;
|
|
193362
|
+
}
|
|
193363
|
+
log.warning(`\xBB unknown model slug "${slug2}" \u2014 agent will auto-select`);
|
|
193364
|
+
}
|
|
193365
|
+
return void 0;
|
|
193366
|
+
}
|
|
193367
|
+
function resolveAgent(ctx) {
|
|
193368
|
+
const envAgent = process.env.PULLFROG_AGENT?.trim();
|
|
193369
|
+
if (envAgent) {
|
|
193370
|
+
if (envAgent in agents) {
|
|
193371
|
+
return agents[envAgent];
|
|
193372
|
+
}
|
|
193373
|
+
log.warning(`\xBB unknown PULLFROG_AGENT="${envAgent}" \u2014 falling through to auto-select`);
|
|
193374
|
+
}
|
|
193375
|
+
if (ctx.proxyModel) return agents.opencode;
|
|
193376
|
+
if (ctx.model && hasBedrockAuth() && process.env[BEDROCK_MODEL_ID_ENV]?.trim() === ctx.model) {
|
|
193377
|
+
return isBedrockAnthropicId(ctx.model) ? agents.claude : agents.opencode;
|
|
193378
|
+
}
|
|
193379
|
+
if (ctx.model && hasVertexAuth() && process.env[VERTEX_MODEL_ID_ENV]?.trim() === ctx.model) {
|
|
193380
|
+
return isVertexAnthropicId(ctx.model) ? agents.claude : agents.opencode;
|
|
193381
|
+
}
|
|
193382
|
+
if (ctx.model) {
|
|
193383
|
+
try {
|
|
193384
|
+
const provider2 = getModelProvider(ctx.model);
|
|
193385
|
+
if (provider2 === "anthropic" && hasClaudeCodeAuth()) return agents.claude;
|
|
193386
|
+
if (provider2 === "openai" && ctx.codexAgent && hasCodexAuth()) return agents.codex;
|
|
193387
|
+
} catch {
|
|
193388
|
+
}
|
|
193389
|
+
}
|
|
193390
|
+
if (!ctx.model) {
|
|
193391
|
+
if (hasEnvVar3("ANTHROPIC_AUTH_TOKEN") && !hasEnvVar3("ANTHROPIC_API_KEY") && !hasEnvVar3("CLAUDE_CODE_OAUTH_TOKEN")) {
|
|
193392
|
+
return agents.claude;
|
|
193393
|
+
}
|
|
193394
|
+
if (ctx.codexAgent && hasCodexAuth() && !hasClaudeCodeAuth()) return agents.codex;
|
|
193395
|
+
}
|
|
193396
|
+
return agents.opencode;
|
|
193397
|
+
}
|
|
193398
|
+
|
|
192993
193399
|
// utils/billingErrors.ts
|
|
192994
193400
|
var BillingError = class extends Error {
|
|
192995
193401
|
code;
|
|
@@ -193842,10 +194248,7 @@ async function persistLearnings(ctx) {
|
|
|
193842
194248
|
authorization: `Bearer ${ctx.apiToken}`,
|
|
193843
194249
|
"content-type": "application/json"
|
|
193844
194250
|
},
|
|
193845
|
-
body: JSON.stringify({
|
|
193846
|
-
learnings: current,
|
|
193847
|
-
model: ctx.toolState.model
|
|
193848
|
-
}),
|
|
194251
|
+
body: JSON.stringify({ learnings: current }),
|
|
193849
194252
|
signal: AbortSignal.timeout(1e4)
|
|
193850
194253
|
});
|
|
193851
194254
|
if (!response.ok) {
|
|
@@ -193887,7 +194290,7 @@ async function persistXrepoLearnings(ctx) {
|
|
|
193887
194290
|
authorization: `Bearer ${ctx.apiToken}`,
|
|
193888
194291
|
"content-type": "application/json"
|
|
193889
194292
|
},
|
|
193890
|
-
body: JSON.stringify({ learnings: current
|
|
194293
|
+
body: JSON.stringify({ learnings: current }),
|
|
193891
194294
|
signal: AbortSignal.timeout(1e4)
|
|
193892
194295
|
});
|
|
193893
194296
|
if (!response.ok) {
|
|
@@ -195298,6 +195701,15 @@ ${input.errorMessage}
|
|
|
195298
195701
|
\`\`\``
|
|
195299
195702
|
].join("\n");
|
|
195300
195703
|
}
|
|
195704
|
+
function formatByokSetupSummary(input) {
|
|
195705
|
+
return [
|
|
195706
|
+
"**This repo's model isn't fully set up yet.**",
|
|
195707
|
+
"",
|
|
195708
|
+
input.raw,
|
|
195709
|
+
"",
|
|
195710
|
+
`[Configure model \u2192](${getApiUrl()}/console/${input.owner}/${input.name})`
|
|
195711
|
+
].join("\n");
|
|
195712
|
+
}
|
|
195301
195713
|
function formatProviderModelNotFoundSummary(input) {
|
|
195302
195714
|
return `The configured model is no longer available in OpenCode's catalog. Pick a different model in the Pullfrog console for \`${input.owner}/${input.name}\`, or contact support if this persists.
|
|
195303
195715
|
|
|
@@ -195353,6 +195765,16 @@ ${body}`, comment: body };
|
|
|
195353
195765
|
});
|
|
195354
195766
|
return { summary: `### \u274C Pullfrog failed
|
|
195355
195767
|
|
|
195768
|
+
${body}`, comment: body };
|
|
195769
|
+
}
|
|
195770
|
+
if (isByokSetupError(input.errorMessage)) {
|
|
195771
|
+
const body = formatByokSetupSummary({
|
|
195772
|
+
owner: input.repo.owner,
|
|
195773
|
+
name: input.repo.name,
|
|
195774
|
+
raw: input.errorMessage
|
|
195775
|
+
});
|
|
195776
|
+
return { summary: `### \u274C Pullfrog failed
|
|
195777
|
+
|
|
195356
195778
|
${body}`, comment: body };
|
|
195357
195779
|
}
|
|
195358
195780
|
const apiKeySource = hangBody ?? input.errorMessage;
|
|
@@ -196661,13 +197083,6 @@ undici/lib/websocket/frame.js:
|
|
|
196661
197083
|
undici/lib/web/websocket/frame.js:
|
|
196662
197084
|
(*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
|
|
196663
197085
|
|
|
196664
|
-
content-type/dist/index.js:
|
|
196665
|
-
(*!
|
|
196666
|
-
* content-type
|
|
196667
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
196668
|
-
* MIT Licensed
|
|
196669
|
-
*)
|
|
196670
|
-
|
|
196671
197086
|
@mixmark-io/domino/lib/style_parser.js:
|
|
196672
197087
|
(**
|
|
196673
197088
|
* @license
|
|
@@ -196688,7 +197103,7 @@ ieee754/index.js:
|
|
|
196688
197103
|
* MIT Licensed
|
|
196689
197104
|
*)
|
|
196690
197105
|
|
|
196691
|
-
mcp-proxy/dist/startStdioServer-
|
|
197106
|
+
mcp-proxy/dist/startStdioServer-C4sEMMHS.mjs:
|
|
196692
197107
|
(*!
|
|
196693
197108
|
* content-type
|
|
196694
197109
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
@@ -196734,6 +197149,13 @@ mcp-proxy/dist/startStdioServer-BomI-BJR.mjs:
|
|
|
196734
197149
|
* MIT Licensed
|
|
196735
197150
|
*)
|
|
196736
197151
|
|
|
197152
|
+
content-type/dist/index.js:
|
|
197153
|
+
(*!
|
|
197154
|
+
* content-type
|
|
197155
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
197156
|
+
* MIT Licensed
|
|
197157
|
+
*)
|
|
197158
|
+
|
|
196737
197159
|
@octokit/request-error/dist-src/index.js:
|
|
196738
197160
|
(* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist *)
|
|
196739
197161
|
|