bitfab-cli 0.2.388 → 0.2.390
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/index.js +151 -429
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5093,34 +5093,15 @@ var require_data = __commonJS({
|
|
|
5093
5093
|
}
|
|
5094
5094
|
});
|
|
5095
5095
|
|
|
5096
|
-
// ../node_modules/.pnpm/fast-uri@3.1.
|
|
5096
|
+
// ../node_modules/.pnpm/fast-uri@3.1.5/node_modules/fast-uri/lib/utils.js
|
|
5097
5097
|
var require_utils = __commonJS({
|
|
5098
|
-
"../node_modules/.pnpm/fast-uri@3.1.
|
|
5098
|
+
"../node_modules/.pnpm/fast-uri@3.1.5/node_modules/fast-uri/lib/utils.js"(exports, module) {
|
|
5099
5099
|
"use strict";
|
|
5100
5100
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
5101
5101
|
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);
|
|
5102
|
-
var isPort = RegExp.prototype.test.bind(/^\d*$/u);
|
|
5103
5102
|
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
5104
5103
|
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
5105
|
-
var isPathCharacter = RegExp.prototype.test.bind(/^[
|
|
5106
|
-
var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u);
|
|
5107
|
-
var isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);
|
|
5108
|
-
var BYTE_HEX = new Array(256);
|
|
5109
|
-
{
|
|
5110
|
-
const HEX_DIGITS = "0123456789ABCDEF";
|
|
5111
|
-
for (let i = 0; i < 256; i++) {
|
|
5112
|
-
BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15];
|
|
5113
|
-
}
|
|
5114
|
-
}
|
|
5115
|
-
function percentEncodeNonAscii(cp) {
|
|
5116
|
-
if (cp < 2048) {
|
|
5117
|
-
return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63];
|
|
5118
|
-
}
|
|
5119
|
-
if (cp < 65536) {
|
|
5120
|
-
return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
5121
|
-
}
|
|
5122
|
-
return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
5123
|
-
}
|
|
5104
|
+
var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
|
|
5124
5105
|
function stringArrayToHexStripped(input) {
|
|
5125
5106
|
let acc = "";
|
|
5126
5107
|
let code2 = 0;
|
|
@@ -5145,105 +5126,91 @@ var require_utils = __commonJS({
|
|
|
5145
5126
|
}
|
|
5146
5127
|
return acc;
|
|
5147
5128
|
}
|
|
5148
|
-
var isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/);
|
|
5149
|
-
var isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/);
|
|
5150
|
-
var isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/);
|
|
5151
5129
|
var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
|
|
5152
|
-
function
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5130
|
+
function consumeIsZone(buffer) {
|
|
5131
|
+
buffer.length = 0;
|
|
5132
|
+
return true;
|
|
5133
|
+
}
|
|
5134
|
+
function consumeHextets(buffer, address, output) {
|
|
5135
|
+
if (buffer.length) {
|
|
5136
|
+
const hex3 = stringArrayToHexStripped(buffer);
|
|
5137
|
+
if (hex3 !== "") {
|
|
5138
|
+
address.push(hex3);
|
|
5139
|
+
} else {
|
|
5140
|
+
output.error = true;
|
|
5141
|
+
return false;
|
|
5159
5142
|
}
|
|
5160
|
-
|
|
5143
|
+
buffer.length = 0;
|
|
5161
5144
|
}
|
|
5162
5145
|
return true;
|
|
5163
5146
|
}
|
|
5164
|
-
function
|
|
5165
|
-
let
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5147
|
+
function getIPV6(input) {
|
|
5148
|
+
let tokenCount = 0;
|
|
5149
|
+
const output = { error: false, address: "", zone: "" };
|
|
5150
|
+
const address = [];
|
|
5151
|
+
const buffer = [];
|
|
5152
|
+
let endipv6Encountered = false;
|
|
5153
|
+
let endIpv6 = false;
|
|
5154
|
+
let consume = consumeHextets;
|
|
5155
|
+
for (let i = 0; i < input.length; i++) {
|
|
5156
|
+
const cursor = input[i];
|
|
5157
|
+
if (cursor === "[" || cursor === "]") {
|
|
5158
|
+
continue;
|
|
5159
|
+
}
|
|
5160
|
+
if (cursor === ":") {
|
|
5161
|
+
if (endipv6Encountered === true) {
|
|
5162
|
+
endIpv6 = true;
|
|
5163
|
+
}
|
|
5164
|
+
if (!consume(buffer, address, output)) {
|
|
5165
|
+
break;
|
|
5166
|
+
}
|
|
5167
|
+
if (++tokenCount > 7) {
|
|
5168
|
+
output.error = true;
|
|
5169
|
+
break;
|
|
5176
5170
|
}
|
|
5171
|
+
if (i > 0 && input[i - 1] === ":") {
|
|
5172
|
+
endipv6Encountered = true;
|
|
5173
|
+
}
|
|
5174
|
+
address.push(":");
|
|
5175
|
+
continue;
|
|
5176
|
+
} else if (cursor === "%") {
|
|
5177
|
+
if (!consume(buffer, address, output)) {
|
|
5178
|
+
break;
|
|
5179
|
+
}
|
|
5180
|
+
consume = consumeIsZone;
|
|
5177
5181
|
} else {
|
|
5178
|
-
|
|
5179
|
-
runLength = 0;
|
|
5180
|
-
}
|
|
5181
|
-
}
|
|
5182
|
-
if (bestLength < 2) return hextets.join(":");
|
|
5183
|
-
const head = hextets.slice(0, bestStart).join(":");
|
|
5184
|
-
const tail = hextets.slice(bestStart + bestLength).join(":");
|
|
5185
|
-
return head + "::" + tail;
|
|
5186
|
-
}
|
|
5187
|
-
function normalizeIPv6Address(input) {
|
|
5188
|
-
const compression = input.indexOf("::");
|
|
5189
|
-
if (compression !== -1 && input.indexOf("::", compression + 1) !== -1) return void 0;
|
|
5190
|
-
const left = compression === -1 ? input.split(":") : input.slice(0, compression).split(":");
|
|
5191
|
-
const right = compression === -1 ? [] : input.slice(compression + 2).split(":");
|
|
5192
|
-
if (compression !== -1) {
|
|
5193
|
-
if (left.length === 1 && left[0] === "") left.length = 0;
|
|
5194
|
-
if (right.length === 1 && right[0] === "") right.length = 0;
|
|
5195
|
-
}
|
|
5196
|
-
const parts = left.concat(right);
|
|
5197
|
-
let hextetCount = 0;
|
|
5198
|
-
for (let i = 0; i < parts.length; i++) {
|
|
5199
|
-
const part = parts[i];
|
|
5200
|
-
if (part === "") return void 0;
|
|
5201
|
-
if (part.indexOf(".") !== -1) {
|
|
5202
|
-
if (i !== parts.length - 1 || compression !== -1 && right.length === 0 || !isIPv4(part)) return void 0;
|
|
5203
|
-
hextetCount += 2;
|
|
5182
|
+
buffer.push(cursor);
|
|
5204
5183
|
continue;
|
|
5205
5184
|
}
|
|
5206
|
-
if (!isHextet(part)) return void 0;
|
|
5207
|
-
parts[i] = parseInt(part, 16).toString(16);
|
|
5208
|
-
hextetCount++;
|
|
5209
5185
|
}
|
|
5210
|
-
if (
|
|
5211
|
-
if (
|
|
5212
|
-
|
|
5186
|
+
if (buffer.length) {
|
|
5187
|
+
if (consume === consumeIsZone) {
|
|
5188
|
+
output.zone = buffer.join("");
|
|
5189
|
+
} else if (endIpv6) {
|
|
5190
|
+
address.push(buffer.join(""));
|
|
5191
|
+
} else {
|
|
5192
|
+
address.push(stringArrayToHexStripped(buffer));
|
|
5193
|
+
}
|
|
5213
5194
|
}
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
for (let i = hextetCount; i < 8; i++) expanded.push("0");
|
|
5217
|
-
for (let i = left.length; i < parts.length; i++) expanded.push(parts[i]);
|
|
5218
|
-
return compressIPv6ZeroRun(expanded);
|
|
5195
|
+
output.address = address.join("");
|
|
5196
|
+
return output;
|
|
5219
5197
|
}
|
|
5220
5198
|
function normalizeIPv6(host) {
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
if (
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
zoneIdentifier = input.slice(zoneSeparator + separatorLength);
|
|
5237
|
-
if (!isZoneIdentifier(zoneIdentifier)) return { host, isIPV6: false, error: true };
|
|
5238
|
-
input = input.slice(0, zoneSeparator);
|
|
5239
|
-
}
|
|
5240
|
-
const address = normalizeIPv6Address(input);
|
|
5241
|
-
if (address === void 0) return { host, isIPV6: false, error: true };
|
|
5242
|
-
return {
|
|
5243
|
-
host: address + (zoneIdentifier ? "%" + zoneIdentifier : ""),
|
|
5244
|
-
escapedHost: address + (zoneIdentifier ? "%25" + zoneIdentifier : ""),
|
|
5245
|
-
isIPV6: true
|
|
5246
|
-
};
|
|
5199
|
+
if (findToken(host, ":") < 2) {
|
|
5200
|
+
return { host, isIPV6: false };
|
|
5201
|
+
}
|
|
5202
|
+
const ipv63 = getIPV6(host);
|
|
5203
|
+
if (!ipv63.error) {
|
|
5204
|
+
let newHost = ipv63.address;
|
|
5205
|
+
let escapedHost = ipv63.address;
|
|
5206
|
+
if (ipv63.zone) {
|
|
5207
|
+
newHost += "%" + ipv63.zone;
|
|
5208
|
+
escapedHost += "%25" + ipv63.zone;
|
|
5209
|
+
}
|
|
5210
|
+
return { host: newHost, isIPV6: true, escapedHost };
|
|
5211
|
+
} else {
|
|
5212
|
+
return { host, isIPV6: false };
|
|
5213
|
+
}
|
|
5247
5214
|
}
|
|
5248
5215
|
function findToken(str, token) {
|
|
5249
5216
|
let ind = 0;
|
|
@@ -5362,8 +5329,7 @@ var require_utils = __commonJS({
|
|
|
5362
5329
|
function normalizePathEncoding(input) {
|
|
5363
5330
|
let output = "";
|
|
5364
5331
|
for (let i = 0; i < input.length; i++) {
|
|
5365
|
-
|
|
5366
|
-
if (ch === "%" && i + 2 < input.length) {
|
|
5332
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
5367
5333
|
const hex3 = input.slice(i + 1, i + 3);
|
|
5368
5334
|
if (isHexPair(hex3)) {
|
|
5369
5335
|
const normalizedHex = hex3.toUpperCase();
|
|
@@ -5377,152 +5343,10 @@ var require_utils = __commonJS({
|
|
|
5377
5343
|
continue;
|
|
5378
5344
|
}
|
|
5379
5345
|
}
|
|
5380
|
-
if (isPathCharacter(
|
|
5381
|
-
output +=
|
|
5346
|
+
if (isPathCharacter(input[i])) {
|
|
5347
|
+
output += input[i];
|
|
5382
5348
|
} else {
|
|
5383
|
-
|
|
5384
|
-
if (code2 < 128) {
|
|
5385
|
-
output += isEscapeSafe(code2) ? ch : BYTE_HEX[code2];
|
|
5386
|
-
} else if (code2 < 55296 || code2 > 57343) {
|
|
5387
|
-
output += percentEncodeNonAscii(code2);
|
|
5388
|
-
} else if (code2 <= 56319 && i + 1 < input.length) {
|
|
5389
|
-
const low = input.charCodeAt(i + 1);
|
|
5390
|
-
if (low >= 56320 && low <= 57343) {
|
|
5391
|
-
output += percentEncodeNonAscii(65536 + (code2 - 55296 << 10) + (low - 56320));
|
|
5392
|
-
i++;
|
|
5393
|
-
} else {
|
|
5394
|
-
output += percentEncodeNonAscii(65533);
|
|
5395
|
-
}
|
|
5396
|
-
} else {
|
|
5397
|
-
output += percentEncodeNonAscii(65533);
|
|
5398
|
-
}
|
|
5399
|
-
}
|
|
5400
|
-
}
|
|
5401
|
-
return output;
|
|
5402
|
-
}
|
|
5403
|
-
function serializePathEncoding(input, pathNoScheme = false) {
|
|
5404
|
-
let output = "";
|
|
5405
|
-
let firstSegment = pathNoScheme && input[0] !== "/";
|
|
5406
|
-
for (let i = 0; i < input.length; i++) {
|
|
5407
|
-
const ch = input[i];
|
|
5408
|
-
if (ch === "%" && i + 2 < input.length) {
|
|
5409
|
-
const hex3 = input.slice(i + 1, i + 3);
|
|
5410
|
-
if (isHexPair(hex3)) {
|
|
5411
|
-
output += "%" + hex3.toUpperCase();
|
|
5412
|
-
i += 2;
|
|
5413
|
-
continue;
|
|
5414
|
-
}
|
|
5415
|
-
}
|
|
5416
|
-
if (ch === "/") {
|
|
5417
|
-
firstSegment = false;
|
|
5418
|
-
}
|
|
5419
|
-
if (isPathCharacter(ch) && (ch !== ":" || !firstSegment)) {
|
|
5420
|
-
output += ch;
|
|
5421
|
-
} else {
|
|
5422
|
-
const code2 = input.charCodeAt(i);
|
|
5423
|
-
if (code2 < 128) {
|
|
5424
|
-
output += BYTE_HEX[code2];
|
|
5425
|
-
} else if (code2 < 55296 || code2 > 57343) {
|
|
5426
|
-
output += percentEncodeNonAscii(code2);
|
|
5427
|
-
} else if (code2 <= 56319 && i + 1 < input.length) {
|
|
5428
|
-
const low = input.charCodeAt(i + 1);
|
|
5429
|
-
if (low >= 56320 && low <= 57343) {
|
|
5430
|
-
output += percentEncodeNonAscii(65536 + (code2 - 55296 << 10) + (low - 56320));
|
|
5431
|
-
i++;
|
|
5432
|
-
} else {
|
|
5433
|
-
output += percentEncodeNonAscii(65533);
|
|
5434
|
-
}
|
|
5435
|
-
} else {
|
|
5436
|
-
output += percentEncodeNonAscii(65533);
|
|
5437
|
-
}
|
|
5438
|
-
}
|
|
5439
|
-
}
|
|
5440
|
-
return output;
|
|
5441
|
-
}
|
|
5442
|
-
function encodeComponent(input, isAllowed) {
|
|
5443
|
-
let output = "";
|
|
5444
|
-
for (let i = 0; i < input.length; i++) {
|
|
5445
|
-
const ch = input[i];
|
|
5446
|
-
if (ch === "%" && i + 2 < input.length) {
|
|
5447
|
-
const hex3 = input.slice(i + 1, i + 3);
|
|
5448
|
-
if (isHexPair(hex3)) {
|
|
5449
|
-
output += "%" + hex3.toUpperCase();
|
|
5450
|
-
i += 2;
|
|
5451
|
-
continue;
|
|
5452
|
-
}
|
|
5453
|
-
}
|
|
5454
|
-
if (isAllowed(ch)) {
|
|
5455
|
-
output += ch;
|
|
5456
|
-
} else {
|
|
5457
|
-
const code2 = input.charCodeAt(i);
|
|
5458
|
-
if (code2 < 128) {
|
|
5459
|
-
output += BYTE_HEX[code2];
|
|
5460
|
-
} else if (code2 < 55296 || code2 > 57343) {
|
|
5461
|
-
output += percentEncodeNonAscii(code2);
|
|
5462
|
-
} else if (code2 <= 56319 && i + 1 < input.length) {
|
|
5463
|
-
const low = input.charCodeAt(i + 1);
|
|
5464
|
-
if (low >= 56320 && low <= 57343) {
|
|
5465
|
-
output += percentEncodeNonAscii(65536 + (code2 - 55296 << 10) + (low - 56320));
|
|
5466
|
-
i++;
|
|
5467
|
-
} else {
|
|
5468
|
-
output += percentEncodeNonAscii(65533);
|
|
5469
|
-
}
|
|
5470
|
-
} else {
|
|
5471
|
-
output += percentEncodeNonAscii(65533);
|
|
5472
|
-
}
|
|
5473
|
-
}
|
|
5474
|
-
}
|
|
5475
|
-
return output;
|
|
5476
|
-
}
|
|
5477
|
-
function encodeUserinfo(input) {
|
|
5478
|
-
return encodeComponent(input, isUserinfoCharacter);
|
|
5479
|
-
}
|
|
5480
|
-
function encodeQuery(input) {
|
|
5481
|
-
return encodeComponent(input, isQueryFragmentCharacter);
|
|
5482
|
-
}
|
|
5483
|
-
function encodeFragment(input) {
|
|
5484
|
-
return encodeComponent(input, isQueryFragmentCharacter);
|
|
5485
|
-
}
|
|
5486
|
-
function isEscapeSafe(cp) {
|
|
5487
|
-
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;
|
|
5488
|
-
}
|
|
5489
|
-
function normalizeQueryFragmentEncoding(input) {
|
|
5490
|
-
let output = "";
|
|
5491
|
-
for (let i = 0; i < input.length; i++) {
|
|
5492
|
-
const ch = input[i];
|
|
5493
|
-
if (ch === "%" && i + 2 < input.length) {
|
|
5494
|
-
const hex3 = input.slice(i + 1, i + 3);
|
|
5495
|
-
if (isHexPair(hex3)) {
|
|
5496
|
-
const normalizedHex = hex3.toUpperCase();
|
|
5497
|
-
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
5498
|
-
if (isUnreserved(decoded)) {
|
|
5499
|
-
output += decoded;
|
|
5500
|
-
} else {
|
|
5501
|
-
output += "%" + normalizedHex;
|
|
5502
|
-
}
|
|
5503
|
-
i += 2;
|
|
5504
|
-
continue;
|
|
5505
|
-
}
|
|
5506
|
-
}
|
|
5507
|
-
if (isQueryFragmentCharacter(ch)) {
|
|
5508
|
-
output += ch;
|
|
5509
|
-
} else {
|
|
5510
|
-
const code2 = input.charCodeAt(i);
|
|
5511
|
-
if (code2 < 128) {
|
|
5512
|
-
output += isEscapeSafe(code2) ? ch : BYTE_HEX[code2];
|
|
5513
|
-
} else if (code2 < 55296 || code2 > 57343) {
|
|
5514
|
-
output += percentEncodeNonAscii(code2);
|
|
5515
|
-
} else if (code2 <= 56319 && i + 1 < input.length) {
|
|
5516
|
-
const low = input.charCodeAt(i + 1);
|
|
5517
|
-
if (low >= 56320 && low <= 57343) {
|
|
5518
|
-
output += percentEncodeNonAscii(65536 + (code2 - 55296 << 10) + (low - 56320));
|
|
5519
|
-
i++;
|
|
5520
|
-
} else {
|
|
5521
|
-
output += percentEncodeNonAscii(65533);
|
|
5522
|
-
}
|
|
5523
|
-
} else {
|
|
5524
|
-
output += percentEncodeNonAscii(65533);
|
|
5525
|
-
}
|
|
5349
|
+
output += escape(input[i]);
|
|
5526
5350
|
}
|
|
5527
5351
|
}
|
|
5528
5352
|
return output;
|
|
@@ -5545,18 +5369,14 @@ var require_utils = __commonJS({
|
|
|
5545
5369
|
function recomposeAuthority(component) {
|
|
5546
5370
|
const uriTokens = [];
|
|
5547
5371
|
if (component.userinfo !== void 0) {
|
|
5548
|
-
uriTokens.push(
|
|
5372
|
+
uriTokens.push(component.userinfo);
|
|
5549
5373
|
uriTokens.push("@");
|
|
5550
5374
|
}
|
|
5551
5375
|
if (component.host !== void 0) {
|
|
5552
|
-
let host = component.host;
|
|
5376
|
+
let host = unescape(component.host);
|
|
5553
5377
|
if (!isIPv4(host)) {
|
|
5554
|
-
|
|
5555
|
-
if (ipV6res.isIPV6
|
|
5556
|
-
host = normalizePercentEncoding(host, true);
|
|
5557
|
-
ipV6res = normalizeIPv6(host);
|
|
5558
|
-
}
|
|
5559
|
-
if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
|
|
5378
|
+
const ipV6res = normalizeIPv6(host);
|
|
5379
|
+
if (ipV6res.isIPV6 === true) {
|
|
5560
5380
|
host = `[${ipV6res.escapedHost}]`;
|
|
5561
5381
|
} else {
|
|
5562
5382
|
host = reescapeHostDelimiters(host, false);
|
|
@@ -5565,12 +5385,8 @@ var require_utils = __commonJS({
|
|
|
5565
5385
|
uriTokens.push(host);
|
|
5566
5386
|
}
|
|
5567
5387
|
if (typeof component.port === "number" || typeof component.port === "string") {
|
|
5568
|
-
const port = String(component.port);
|
|
5569
|
-
if (!isPort(port)) {
|
|
5570
|
-
throw new TypeError("URI port is malformed.");
|
|
5571
|
-
}
|
|
5572
5388
|
uriTokens.push(":");
|
|
5573
|
-
uriTokens.push(port);
|
|
5389
|
+
uriTokens.push(String(component.port));
|
|
5574
5390
|
}
|
|
5575
5391
|
return uriTokens.length ? uriTokens.join("") : void 0;
|
|
5576
5392
|
}
|
|
@@ -5580,11 +5396,6 @@ var require_utils = __commonJS({
|
|
|
5580
5396
|
reescapeHostDelimiters,
|
|
5581
5397
|
normalizePercentEncoding,
|
|
5582
5398
|
normalizePathEncoding,
|
|
5583
|
-
serializePathEncoding,
|
|
5584
|
-
normalizeQueryFragmentEncoding,
|
|
5585
|
-
encodeUserinfo,
|
|
5586
|
-
encodeQuery,
|
|
5587
|
-
encodeFragment,
|
|
5588
5399
|
escapePreservingEscapes,
|
|
5589
5400
|
removeDotSegments,
|
|
5590
5401
|
isIPv4,
|
|
@@ -5595,12 +5406,12 @@ var require_utils = __commonJS({
|
|
|
5595
5406
|
}
|
|
5596
5407
|
});
|
|
5597
5408
|
|
|
5598
|
-
// ../node_modules/.pnpm/fast-uri@3.1.
|
|
5409
|
+
// ../node_modules/.pnpm/fast-uri@3.1.5/node_modules/fast-uri/lib/schemes.js
|
|
5599
5410
|
var require_schemes = __commonJS({
|
|
5600
|
-
"../node_modules/.pnpm/fast-uri@3.1.
|
|
5411
|
+
"../node_modules/.pnpm/fast-uri@3.1.5/node_modules/fast-uri/lib/schemes.js"(exports, module) {
|
|
5601
5412
|
"use strict";
|
|
5602
5413
|
var { isUUID } = require_utils();
|
|
5603
|
-
var URN_REG =
|
|
5414
|
+
var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
|
|
5604
5415
|
var supportedSchemeNames = (
|
|
5605
5416
|
/** @type {const} */
|
|
5606
5417
|
[
|
|
@@ -5661,10 +5472,9 @@ var require_schemes = __commonJS({
|
|
|
5661
5472
|
wsComponent.secure = void 0;
|
|
5662
5473
|
}
|
|
5663
5474
|
if (wsComponent.resourceName) {
|
|
5664
|
-
const
|
|
5665
|
-
const path15 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
5475
|
+
const [path15, query] = wsComponent.resourceName.split("?");
|
|
5666
5476
|
wsComponent.path = path15 && path15 !== "/" ? path15 : void 0;
|
|
5667
|
-
wsComponent.query =
|
|
5477
|
+
wsComponent.query = query;
|
|
5668
5478
|
wsComponent.resourceName = void 0;
|
|
5669
5479
|
}
|
|
5670
5480
|
wsComponent.fragment = void 0;
|
|
@@ -5676,7 +5486,7 @@ var require_schemes = __commonJS({
|
|
|
5676
5486
|
return urnComponent;
|
|
5677
5487
|
}
|
|
5678
5488
|
const matches = urnComponent.path.match(URN_REG);
|
|
5679
|
-
if (matches
|
|
5489
|
+
if (matches) {
|
|
5680
5490
|
const scheme = options.scheme || urnComponent.scheme || "urn";
|
|
5681
5491
|
urnComponent.nid = matches[1].toLowerCase();
|
|
5682
5492
|
urnComponent.nss = matches[2];
|
|
@@ -5806,21 +5616,12 @@ var require_schemes = __commonJS({
|
|
|
5806
5616
|
}
|
|
5807
5617
|
});
|
|
5808
5618
|
|
|
5809
|
-
// ../node_modules/.pnpm/fast-uri@3.1.
|
|
5619
|
+
// ../node_modules/.pnpm/fast-uri@3.1.5/node_modules/fast-uri/index.js
|
|
5810
5620
|
var require_fast_uri = __commonJS({
|
|
5811
|
-
"../node_modules/.pnpm/fast-uri@3.1.
|
|
5621
|
+
"../node_modules/.pnpm/fast-uri@3.1.5/node_modules/fast-uri/index.js"(exports, module) {
|
|
5812
5622
|
"use strict";
|
|
5813
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding,
|
|
5623
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
5814
5624
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
5815
|
-
var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
|
|
5816
|
-
var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
|
|
5817
|
-
function decodeValidScheme(scheme) {
|
|
5818
|
-
const decodedScheme = unescape(String(scheme));
|
|
5819
|
-
if (!VALID_SCHEME.test(decodedScheme)) {
|
|
5820
|
-
throw new TypeError(MALFORMED_SCHEME_ERROR);
|
|
5821
|
-
}
|
|
5822
|
-
return decodedScheme;
|
|
5823
|
-
}
|
|
5824
5625
|
function normalize(uri, options) {
|
|
5825
5626
|
if (typeof uri === "string") {
|
|
5826
5627
|
uri = /** @type {T} */
|
|
@@ -5833,34 +5634,12 @@ var require_fast_uri = __commonJS({
|
|
|
5833
5634
|
}
|
|
5834
5635
|
function resolve5(baseURI, relativeURI, options) {
|
|
5835
5636
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
5836
|
-
const {
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
malformedPercentEncoding: baseMalformedPercentEncoding,
|
|
5840
|
-
malformedSchemeSpecific: baseMalformedSchemeSpecific,
|
|
5841
|
-
malformedHost: baseMalformedHost,
|
|
5842
|
-
malformedScheme: baseMalformedScheme
|
|
5843
|
-
} = parseWithStatus(baseURI, schemelessOptions);
|
|
5844
|
-
const {
|
|
5845
|
-
parsed: relativeParsed,
|
|
5846
|
-
malformedAuthorityOrPort: relativeMalformed,
|
|
5847
|
-
malformedPercentEncoding: relativeMalformedPercentEncoding,
|
|
5848
|
-
malformedSchemeSpecific: relativeMalformedSchemeSpecific,
|
|
5849
|
-
malformedHost: relativeMalformedHost,
|
|
5850
|
-
malformedScheme: relativeMalformedScheme
|
|
5851
|
-
} = parseWithStatus(relativeURI, schemelessOptions);
|
|
5852
|
-
if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) {
|
|
5637
|
+
const { parsed: baseParsed, malformedAuthorityOrPort: baseMalformed } = parseWithStatus(baseURI, schemelessOptions);
|
|
5638
|
+
const { parsed: relativeParsed, malformedAuthorityOrPort: relativeMalformed } = parseWithStatus(relativeURI, schemelessOptions);
|
|
5639
|
+
if (baseMalformed || relativeMalformed) {
|
|
5853
5640
|
throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
|
|
5854
5641
|
}
|
|
5855
5642
|
const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
|
|
5856
|
-
const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
|
|
5857
|
-
const resolvedHost = resolved.host;
|
|
5858
|
-
const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
|
|
5859
|
-
canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
|
|
5860
|
-
const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !new RegExp("\\P{ASCII}", "u").test(resolvedHost);
|
|
5861
|
-
if (resolved.error && !encodedASCIIHost) {
|
|
5862
|
-
throw new Error(resolved.error);
|
|
5863
|
-
}
|
|
5864
5643
|
schemelessOptions.skipEscape = true;
|
|
5865
5644
|
return serialize(resolved, schemelessOptions);
|
|
5866
5645
|
}
|
|
@@ -5920,7 +5699,7 @@ var require_fast_uri = __commonJS({
|
|
|
5920
5699
|
function equal(uriA, uriB, options) {
|
|
5921
5700
|
const normalizedA = normalizeComparableURI(uriA, options);
|
|
5922
5701
|
const normalizedB = normalizeComparableURI(uriB, options);
|
|
5923
|
-
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA === normalizedB;
|
|
5702
|
+
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase();
|
|
5924
5703
|
}
|
|
5925
5704
|
function serialize(cmpts, opts) {
|
|
5926
5705
|
const component = {
|
|
@@ -5941,22 +5720,19 @@ var require_fast_uri = __commonJS({
|
|
|
5941
5720
|
};
|
|
5942
5721
|
const options = Object.assign({}, opts);
|
|
5943
5722
|
const uriTokens = [];
|
|
5944
|
-
if (component.scheme) {
|
|
5945
|
-
component.scheme = decodeValidScheme(component.scheme);
|
|
5946
|
-
}
|
|
5947
5723
|
const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
|
|
5948
5724
|
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
5949
|
-
const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0;
|
|
5950
|
-
const pathNoScheme = !options.skipEscape && component.scheme === void 0 && !hasAuthority;
|
|
5951
5725
|
if (component.path !== void 0) {
|
|
5952
5726
|
if (!options.skipEscape) {
|
|
5953
|
-
component.path =
|
|
5727
|
+
component.path = escapePreservingEscapes(component.path);
|
|
5728
|
+
if (component.scheme !== void 0) {
|
|
5729
|
+
component.path = component.path.split("%3A").join(":");
|
|
5730
|
+
}
|
|
5954
5731
|
} else {
|
|
5955
5732
|
component.path = normalizePercentEncoding(component.path);
|
|
5956
5733
|
}
|
|
5957
5734
|
}
|
|
5958
5735
|
if (options.reference !== "suffix" && component.scheme) {
|
|
5959
|
-
component.scheme = decodeValidScheme(component.scheme);
|
|
5960
5736
|
uriTokens.push(component.scheme, ":");
|
|
5961
5737
|
}
|
|
5962
5738
|
const authority = recomposeAuthority(component);
|
|
@@ -5974,19 +5750,16 @@ var require_fast_uri = __commonJS({
|
|
|
5974
5750
|
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
5975
5751
|
s2 = removeDotSegments(s2);
|
|
5976
5752
|
}
|
|
5977
|
-
if (pathNoScheme) {
|
|
5978
|
-
s2 = serializePathEncoding(s2, true);
|
|
5979
|
-
}
|
|
5980
5753
|
if (authority === void 0 && s2[0] === "/" && s2[1] === "/") {
|
|
5981
5754
|
s2 = "/%2F" + s2.slice(2);
|
|
5982
5755
|
}
|
|
5983
5756
|
uriTokens.push(s2);
|
|
5984
5757
|
}
|
|
5985
5758
|
if (component.query !== void 0) {
|
|
5986
|
-
uriTokens.push("?",
|
|
5759
|
+
uriTokens.push("?", component.query);
|
|
5987
5760
|
}
|
|
5988
5761
|
if (component.fragment !== void 0) {
|
|
5989
|
-
uriTokens.push("#",
|
|
5762
|
+
uriTokens.push("#", component.fragment);
|
|
5990
5763
|
}
|
|
5991
5764
|
return uriTokens.join("");
|
|
5992
5765
|
}
|
|
@@ -6002,35 +5775,6 @@ var require_fast_uri = __commonJS({
|
|
|
6002
5775
|
}
|
|
6003
5776
|
return void 0;
|
|
6004
5777
|
}
|
|
6005
|
-
function hasMalformedPercentEncoding(component) {
|
|
6006
|
-
if (component === void 0) return false;
|
|
6007
|
-
let percent = component.indexOf("%");
|
|
6008
|
-
while (percent !== -1) {
|
|
6009
|
-
if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) {
|
|
6010
|
-
return true;
|
|
6011
|
-
}
|
|
6012
|
-
percent = component.indexOf("%", percent + 3);
|
|
6013
|
-
}
|
|
6014
|
-
return false;
|
|
6015
|
-
}
|
|
6016
|
-
function isIPLiteral(host) {
|
|
6017
|
-
return host[0] === "[" && host[host.length - 1] === "]";
|
|
6018
|
-
}
|
|
6019
|
-
function hasMalformedComponentPercentEncoding(matches) {
|
|
6020
|
-
const host = matches[4];
|
|
6021
|
-
return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
|
|
6022
|
-
}
|
|
6023
|
-
function canonicalizeHost(parsed, options, schemeHandler, isIP) {
|
|
6024
|
-
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
6025
|
-
try {
|
|
6026
|
-
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
6027
|
-
} catch (e) {
|
|
6028
|
-
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
6029
|
-
return true;
|
|
6030
|
-
}
|
|
6031
|
-
}
|
|
6032
|
-
return false;
|
|
6033
|
-
}
|
|
6034
5778
|
function parseWithStatus(uri, opts) {
|
|
6035
5779
|
const options = Object.assign({}, opts);
|
|
6036
5780
|
const parsed = {
|
|
@@ -6043,11 +5787,6 @@ var require_fast_uri = __commonJS({
|
|
|
6043
5787
|
fragment: void 0
|
|
6044
5788
|
};
|
|
6045
5789
|
let malformedAuthorityOrPort = false;
|
|
6046
|
-
let malformedPercentEncoding = false;
|
|
6047
|
-
let malformedSchemeSpecific = false;
|
|
6048
|
-
let malformedHost = false;
|
|
6049
|
-
let malformedIPLiteral = false;
|
|
6050
|
-
let malformedScheme = false;
|
|
6051
5790
|
let isIP = false;
|
|
6052
5791
|
if (options.reference === "suffix") {
|
|
6053
5792
|
if (options.scheme) {
|
|
@@ -6084,19 +5823,6 @@ var require_fast_uri = __commonJS({
|
|
|
6084
5823
|
parsed.path = matches[6] || "";
|
|
6085
5824
|
parsed.query = matches[7];
|
|
6086
5825
|
parsed.fragment = matches[8];
|
|
6087
|
-
if (parsed.scheme !== void 0) {
|
|
6088
|
-
const decodedScheme = unescape(parsed.scheme);
|
|
6089
|
-
if (VALID_SCHEME.test(decodedScheme)) {
|
|
6090
|
-
parsed.scheme = decodedScheme.toLowerCase();
|
|
6091
|
-
} else {
|
|
6092
|
-
parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
|
|
6093
|
-
malformedScheme = true;
|
|
6094
|
-
}
|
|
6095
|
-
}
|
|
6096
|
-
malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches);
|
|
6097
|
-
if (malformedPercentEncoding) {
|
|
6098
|
-
parsed.error = parsed.error || "URI contains malformed percent-encoding.";
|
|
6099
|
-
}
|
|
6100
5826
|
if (isNaN(parsed.port)) {
|
|
6101
5827
|
parsed.port = matches[5];
|
|
6102
5828
|
}
|
|
@@ -6108,16 +5834,9 @@ var require_fast_uri = __commonJS({
|
|
|
6108
5834
|
if (parsed.host) {
|
|
6109
5835
|
const ipv4result = isIPv4(parsed.host);
|
|
6110
5836
|
if (ipv4result === false) {
|
|
6111
|
-
const bracketedIPLiteral = isIPLiteral(parsed.host);
|
|
6112
|
-
const hasIPLiteralBracket = parsed.host.indexOf("[") !== -1 || parsed.host.indexOf("]") !== -1;
|
|
6113
5837
|
const ipv6result = normalizeIPv6(parsed.host);
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
|
|
6117
|
-
if (malformedIPLiteral) {
|
|
6118
|
-
parsed.error = parsed.error || "URI host is malformed.";
|
|
6119
|
-
malformedAuthorityOrPort = true;
|
|
6120
|
-
}
|
|
5838
|
+
parsed.host = ipv6result.host.toLowerCase();
|
|
5839
|
+
isIP = ipv6result.isIPV6;
|
|
6121
5840
|
} else {
|
|
6122
5841
|
isIP = true;
|
|
6123
5842
|
}
|
|
@@ -6135,37 +5854,42 @@ var require_fast_uri = __commonJS({
|
|
|
6135
5854
|
parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
|
|
6136
5855
|
}
|
|
6137
5856
|
const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
|
|
6138
|
-
if (!
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
5857
|
+
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
5858
|
+
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
5859
|
+
try {
|
|
5860
|
+
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
5861
|
+
} catch (e) {
|
|
5862
|
+
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
5863
|
+
}
|
|
6145
5864
|
}
|
|
6146
|
-
parsed.host = reescapeHostDelimiters(host, isIP);
|
|
6147
5865
|
}
|
|
6148
5866
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
5867
|
+
if (uri.indexOf("%") !== -1) {
|
|
5868
|
+
if (parsed.scheme !== void 0) {
|
|
5869
|
+
parsed.scheme = unescape(parsed.scheme);
|
|
5870
|
+
}
|
|
5871
|
+
if (parsed.host !== void 0) {
|
|
5872
|
+
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
|
|
5873
|
+
}
|
|
5874
|
+
}
|
|
6149
5875
|
if (parsed.path) {
|
|
6150
5876
|
parsed.path = normalizePathEncoding(parsed.path);
|
|
6151
5877
|
}
|
|
6152
|
-
if (parsed.query) {
|
|
6153
|
-
parsed.query = normalizeQueryFragmentEncoding(parsed.query);
|
|
6154
|
-
}
|
|
6155
5878
|
if (parsed.fragment) {
|
|
6156
|
-
|
|
5879
|
+
try {
|
|
5880
|
+
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
5881
|
+
} catch {
|
|
5882
|
+
parsed.error = parsed.error || "URI malformed";
|
|
5883
|
+
}
|
|
6157
5884
|
}
|
|
6158
5885
|
}
|
|
6159
5886
|
if (schemeHandler && schemeHandler.parse) {
|
|
6160
5887
|
schemeHandler.parse(parsed, options);
|
|
6161
|
-
if (schemeHandler === SCHEMES.urn && parsed.nid === void 0) {
|
|
6162
|
-
malformedSchemeSpecific = true;
|
|
6163
|
-
}
|
|
6164
5888
|
}
|
|
6165
5889
|
} else {
|
|
6166
5890
|
parsed.error = parsed.error || "URI can not be parsed.";
|
|
6167
5891
|
}
|
|
6168
|
-
return { parsed, malformedAuthorityOrPort
|
|
5892
|
+
return { parsed, malformedAuthorityOrPort };
|
|
6169
5893
|
}
|
|
6170
5894
|
function parse3(uri, opts) {
|
|
6171
5895
|
return parseWithStatus(uri, opts).parsed;
|
|
@@ -6174,28 +5898,20 @@ var require_fast_uri = __commonJS({
|
|
|
6174
5898
|
return normalizeStringWithStatus(uri, opts).normalized;
|
|
6175
5899
|
}
|
|
6176
5900
|
function normalizeStringWithStatus(uri, opts) {
|
|
6177
|
-
const { parsed, malformedAuthorityOrPort
|
|
5901
|
+
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
6178
5902
|
return {
|
|
6179
|
-
normalized: malformedAuthorityOrPort
|
|
6180
|
-
malformedAuthorityOrPort
|
|
6181
|
-
malformedPercentEncoding,
|
|
6182
|
-
malformedSchemeSpecific,
|
|
6183
|
-
malformedHost,
|
|
6184
|
-
malformedScheme
|
|
5903
|
+
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
|
5904
|
+
malformedAuthorityOrPort
|
|
6185
5905
|
};
|
|
6186
5906
|
}
|
|
6187
5907
|
function normalizeComparableURI(uri, opts) {
|
|
6188
|
-
if (typeof uri
|
|
6189
|
-
|
|
5908
|
+
if (typeof uri === "string") {
|
|
5909
|
+
const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
|
|
5910
|
+
return malformedAuthorityOrPort ? void 0 : normalized;
|
|
6190
5911
|
}
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
value = typeof uri === "string" ? uri : serialize(uri, opts);
|
|
6194
|
-
} catch {
|
|
6195
|
-
return void 0;
|
|
5912
|
+
if (typeof uri === "object") {
|
|
5913
|
+
return serialize(uri, opts);
|
|
6196
5914
|
}
|
|
6197
|
-
const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts);
|
|
6198
|
-
return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? void 0 : normalized;
|
|
6199
5915
|
}
|
|
6200
5916
|
var fastUri = {
|
|
6201
5917
|
SCHEMES,
|
|
@@ -24194,7 +23910,7 @@ var listExperimentTraces = {
|
|
|
24194
23910
|
var getReplayStatus = {
|
|
24195
23911
|
name: "get_replay_status",
|
|
24196
23912
|
title: "Get Replay Status",
|
|
24197
|
-
description: "Read
|
|
23913
|
+
description: "Read an experiment's replay progress: status, local to server replay trace IDs, and finished and remaining trace attempts. Call it while a replay runs, or after one crashes to check `resumable` before rerunning with `--resume <experimentId>`.",
|
|
24198
23914
|
inputSchema: {
|
|
24199
23915
|
experimentId: external_exports.uuid().describe("The experiment ID to get status for")
|
|
24200
23916
|
}
|
|
@@ -24962,10 +24678,10 @@ var semver3 = __toESM(require_semver2(), 1);
|
|
|
24962
24678
|
|
|
24963
24679
|
// ../bitfab-plugin-lib/dist/bakedSdkVersions.js
|
|
24964
24680
|
var BAKED_SDK_VERSIONS = {
|
|
24965
|
-
typescript: "0.61.
|
|
24966
|
-
python: "0.61.
|
|
24967
|
-
ruby: "0.61.
|
|
24968
|
-
go: "0.61.
|
|
24681
|
+
typescript: "0.61.3",
|
|
24682
|
+
python: "0.61.3",
|
|
24683
|
+
ruby: "0.61.1",
|
|
24684
|
+
go: "0.61.1"
|
|
24969
24685
|
};
|
|
24970
24686
|
|
|
24971
24687
|
// ../bitfab-plugin-lib/dist/installedSdk.js
|
|
@@ -26073,7 +25789,7 @@ import { dirname as dirname3, resolve as resolve3 } from "path";
|
|
|
26073
25789
|
import { createInterface } from "readline";
|
|
26074
25790
|
|
|
26075
25791
|
// ../bitfab-plugin-lib/dist/replayItemWriter.js
|
|
26076
|
-
import { mkdirSync as mkdirSync3, renameSync, writeFileSync as writeFileSync3 } from "fs";
|
|
25792
|
+
import { existsSync as existsSync2, mkdirSync as mkdirSync3, renameSync, writeFileSync as writeFileSync3 } from "fs";
|
|
26077
25793
|
import { join as join3 } from "path";
|
|
26078
25794
|
|
|
26079
25795
|
// ../bitfab-plugin-lib/dist/bestEffortFs.js
|
|
@@ -28925,7 +28641,7 @@ var assistantFlow = Flow.parse({
|
|
|
28925
28641
|
},
|
|
28926
28642
|
replayProgress: {
|
|
28927
28643
|
description: "Run a replay and emit one ready-to-relay line per trace to stdout (header, then per trace: a pass/fail glyph, running n/total, and that trace's duration, with the error reason inline on failure; a liveness heartbeat line when a slow trace goes quiet; then a summary with total + average time), write a per-run replay event index to .bitfab/replays/<run-id>/events.jsonl, and write full item payloads to .bitfab/replays/<run-id>/items/*.json. Background it and relay each new line to the user",
|
|
28928
|
-
args: "[--label <key>] [--total N] [--run-dir <path>] -- <replay command...>"
|
|
28644
|
+
args: "[--label <key>] [--total N] [--run-dir <path>] [--resume <experimentId> [--force]] -- <replay command...>"
|
|
28929
28645
|
},
|
|
28930
28646
|
readTracesBatched: {
|
|
28931
28647
|
description: "Read many traces at once: fans get_traces out in parallel batches of 10, writes the concatenated result to a temp file, and prints its path as JSON",
|
|
@@ -30516,7 +30232,8 @@ If \`completed === 0\`, do not score pass/fail on an empty set, branch to \`chec
|
|
|
30516
30232
|
"edit",
|
|
30517
30233
|
"getTraces",
|
|
30518
30234
|
"searchTraces",
|
|
30519
|
-
"ask"
|
|
30235
|
+
"ask",
|
|
30236
|
+
"getReplayStatus"
|
|
30520
30237
|
],
|
|
30521
30238
|
title: "Check replay health",
|
|
30522
30239
|
body: `**Route on the counts and exit code.** Goal: keep infra noise out of evaluation. Read a sample of \`item.error\` strings (and stderr on crash) first to identify the DB-shaped pattern (missing record, FK / unique constraint, write rejected, connection refused, missing env).
|
|
@@ -30539,6 +30256,11 @@ After whichever workaround the user picks, re-run \`replay-against-dataset\` and
|
|
|
30539
30256
|
description: `the function's shape drifted since these traces were captured, so replay can't call it with the recorded inputs. This is recoverable: route to \`adapt-replay-inputs\` to map the recorded inputs onto the current signature, then re-run`,
|
|
30540
30257
|
next: "iterate/adapt-replay-inputs"
|
|
30541
30258
|
},
|
|
30259
|
+
{
|
|
30260
|
+
when: "whole replay command crashed after it printed an experiment ID (the `[replay] Experiment <id>` line, the `Resume with:` line, or `experimentId` in this run's `run.json`), and the experiment's status reports `resumable: true`",
|
|
30261
|
+
description: `before any other crash handling, call {{tool:getReplayStatus}} with that experiment ID. When it returns \`resumable: true\`, tell the user in plain words how many traces already finished (\`finishedCount\`) and how many are left (\`remainingCount\`), and that the finished ones will be kept, not replayed again. Then show stderr and the exit code, diagnose the crash, confirm the fix with the user, and apply it. When the cause was outside the code (the process was killed, the network dropped, a rate limit, running out of memory, or the machine went to sleep), resume as described next. If that resume is refused because the working tree differs from the one the experiment started with (the refusal names the stored commit and tree, and {{tool:getReplayStatus}} returns them as \`commitSha\` and \`experimentSha\`), do not change the user's working tree yourself. Relay the refusal, name the commit and tree, and give the user three choices: return their working tree to that state their own way and ask you to resume again, resume on their current code by adding \`--force\` to the same command (finished traces from the old code are kept alongside new ones), or start a fresh replay through the crash route below. When fixing the crash needed a code change, do not resume: tell the user plainly that resuming would run the old code the experiment started with, which would hit the same crash, and start a fresh replay with the fixed code through the crash route below. Loop back to \`replay-against-dataset\`, but instead of a fresh replay, run the same \`{{command:replayProgress}}\` command with \`--resume <experimentId>\` added before \`--\`, and the replay command after \`--\` changed to the \`Resume with:\` line the crashed run printed, or else \`bitfab-replay --registry <registry-path> <pipeline-name> --resume <experimentId>\` behind the same package runner. Keep the same \`--code-change\` file, \`--mock\`, and \`--param\` / \`--params\` flags as the crashed run. Drop \`--trace-ids\`, \`--dataset-id\`, \`--limit\`, \`--attempts\`, \`--grader-ids\`, \`--only-with-assertions\`, \`--name\`, and \`--experiment-group-id\`, because the experiment already stores its traces and settings. Keep the same run directory, since resume adds to that run's \`events.jsonl\` and item files, and items marked \`carriedOver\` in the final result count as already finished. If the resume is refused, relay the refusal message as is. When it says the replay may still be running, wait two minutes and try again. For any other refusal, or when {{tool:getReplayStatus}} does not return \`resumable: true\`, use the crash route below and start a fresh replay`,
|
|
30262
|
+
next: "iterate/replay-against-dataset"
|
|
30263
|
+
},
|
|
30542
30264
|
{
|
|
30543
30265
|
when: "whole replay command crashed (non-zero child exit, or the server confirms zero replay items)",
|
|
30544
30266
|
description: `show stderr / exit code, diagnose, confirm a script fix with the user, apply, loop back to \`replay-against-dataset\``,
|
|
@@ -45700,7 +45422,7 @@ import * as p8 from "@clack/prompts";
|
|
|
45700
45422
|
|
|
45701
45423
|
// src/setupV2Verification.ts
|
|
45702
45424
|
import { spawnSync as spawnSync4 } from "child_process";
|
|
45703
|
-
import { existsSync as
|
|
45425
|
+
import { existsSync as existsSync3, readFileSync as readFileSync4 } from "fs";
|
|
45704
45426
|
import { basename, relative, resolve as resolve4 } from "path";
|
|
45705
45427
|
var MUTATING_TOOLS = /* @__PURE__ */ new Set(["Edit", "Write"]);
|
|
45706
45428
|
var CODE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
@@ -45857,7 +45579,7 @@ function importedSourcePaths(registryPath, source, sourcePaths) {
|
|
|
45857
45579
|
}
|
|
45858
45580
|
function projectTypecheckCoversRegistry(cwd, registryPath) {
|
|
45859
45581
|
const configPath = resolve4(cwd, "tsconfig.json");
|
|
45860
|
-
if (!
|
|
45582
|
+
if (!existsSync3(configPath)) {
|
|
45861
45583
|
return false;
|
|
45862
45584
|
}
|
|
45863
45585
|
const config4 = readFileSync4(configPath, "utf8");
|
|
@@ -45954,7 +45676,7 @@ var SetupV2VerificationGate = class {
|
|
|
45954
45676
|
candidatePaths.add(path15);
|
|
45955
45677
|
}
|
|
45956
45678
|
}
|
|
45957
|
-
const readableFiles = [...candidatePaths].filter((path15) =>
|
|
45679
|
+
const readableFiles = [...candidatePaths].filter((path15) => existsSync3(path15));
|
|
45958
45680
|
const sources = /* @__PURE__ */ new Map();
|
|
45959
45681
|
const issues = [];
|
|
45960
45682
|
for (const path15 of readableFiles) {
|
package/package.json
CHANGED