From 5ea1d95b705b0d351fa71e6445fce09abf608434 Mon Sep 17 00:00:00 2001 From: David Blass Date: Thu, 6 Nov 2025 20:38:20 -0500 Subject: [PATCH] debug dir structure --- entry.js | 2418 +++++++++++++++++++++++++++----------------------- entry.ts | 7 +- package.json | 2 +- 3 files changed, 1291 insertions(+), 1136 deletions(-) diff --git a/entry.js b/entry.js index 3a62c43..9a40f26 100755 --- a/entry.js +++ b/entry.js @@ -195,14 +195,14 @@ var require_file_command = __commonJS({ var os = __importStar(__require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { - const filePath = process.env[`GITHUB_${command}`]; - if (!filePath) { + const filePath2 = process.env[`GITHUB_${command}`]; + if (!filePath2) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs2.existsSync(filePath)) { - throw new Error(`Missing file at path: ${filePath}`); + if (!fs2.existsSync(filePath2)) { + throw new Error(`Missing file at path: ${filePath2}`); } - fs2.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { + fs2.appendFileSync(filePath2, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { encoding: "utf8" }); } @@ -380,7 +380,7 @@ var require_tunnel = __commonJS({ function onFree() { self2.emit("free", socket, options); } - function onCloseOrRemove(err) { + function onCloseOrRemove(err2) { self2.removeSocket(socket); socket.removeListener("free", onFree); socket.removeListener("close", onCloseOrRemove); @@ -1005,14 +1005,14 @@ var require_util = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol}//${url2.hostname}:${port}`; - let path = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path2 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin.endsWith("/")) { origin = origin.substring(0, origin.length - 1); } - if (path && !path.startsWith("/")) { - path = `/${path}`; + if (path2 && !path2.startsWith("/")) { + path2 = `/${path2}`; } - url2 = new URL(origin + path); + url2 = new URL(origin + path2); } return url2; } @@ -1073,7 +1073,7 @@ var require_util = __commonJS({ const state = stream2 && stream2._readableState; return isDestroyed(stream2) && state && !state.endEmitted; } - function destroy(stream2, err) { + function destroy(stream2, err2) { if (stream2 == null || !isStream(stream2) || isDestroyed(stream2)) { return; } @@ -1081,11 +1081,11 @@ var require_util = __commonJS({ if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) { stream2.socket = null; } - stream2.destroy(err); - } else if (err) { - process.nextTick((stream3, err2) => { - stream3.emit("error", err2); - }, stream2, err); + stream2.destroy(err2); + } else if (err2) { + process.nextTick((stream3, err3) => { + stream3.emit("error", err3); + }, stream2, err2); } if (stream2.destroyed !== true) { stream2[kDestroyed] = true; @@ -1250,9 +1250,9 @@ var require_util = __commonJS({ signal.throwIfAborted(); } else { if (signal.aborted) { - const err = new Error("The operation was aborted"); - err.name = "AbortError"; - throw err; + const err2 = new Error("The operation was aborted"); + err2.name = "AbortError"; + throw err2; } } } @@ -2626,20 +2626,20 @@ var require_parseParams = __commonJS({ var require_basename = __commonJS({ "node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/basename.js"(exports, module) { "use strict"; - module.exports = function basename(path) { - if (typeof path !== "string") { + module.exports = function basename(path2) { + if (typeof path2 !== "string") { return ""; } - for (var i = path.length - 1; i >= 0; --i) { - switch (path.charCodeAt(i)) { + for (var i = path2.length - 1; i >= 0; --i) { + switch (path2.charCodeAt(i)) { case 47: // '/' case 92: - path = path.slice(i + 1); - return path === ".." || path === "." ? "" : path; + path2 = path2.slice(i + 1); + return path2 === ".." || path2 === "." ? "" : path2; } } - return path === ".." || path === "." ? "" : path; + return path2 === ".." || path2 === "." ? "" : path2; }; } }); @@ -2877,13 +2877,13 @@ var require_multipart = __commonJS({ part._readableState.sync = false; part.on("data", onData); part.on("end", onEnd); - }).on("error", function(err) { + }).on("error", function(err2) { if (curFile) { - curFile.emit("error", err); + curFile.emit("error", err2); } }); - }).on("error", function(err) { - boy.emit("error", err); + }).on("error", function(err2) { + boy.emit("error", err2); }).on("finish", function() { finished = true; checkFinished(); @@ -3549,8 +3549,8 @@ var require_constants2 = __commonJS({ var DOMException2 = globalThis.DOMException ?? (() => { try { atob("~"); - } catch (err) { - return Object.getPrototypeOf(err).constructor; + } catch (err2) { + return Object.getPrototypeOf(err2).constructor; } })(); var channel; @@ -4153,9 +4153,9 @@ var require_util2 = __commonJS({ function readableStreamClose(controller) { try { controller.close(); - } catch (err) { - if (!err.message.includes("Controller is already closed")) { - throw err; + } catch (err2) { + if (!err2.message.includes("Controller is already closed")) { + throw err2; } } } @@ -5508,8 +5508,8 @@ Content-Type: ${value2.type || "application/octet-stream"}\r headers, preservePath: true }); - } catch (err) { - throw new DOMException2(`${err}`, "AbortError"); + } catch (err2) { + throw new DOMException2(`${err2}`, "AbortError"); } busboy.on("field", (name, value2) => { responseFormData.append(name, value2); @@ -5539,7 +5539,7 @@ Content-Type: ${value2.type || "application/octet-stream"}\r }); const busboyResolve = new Promise((resolve, reject) => { busboy.on("finish", resolve); - busboy.on("error", (err) => reject(new TypeError(err))); + busboy.on("error", (err2) => reject(new TypeError(err2))); }); if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk); busboy.end(); @@ -5558,8 +5558,8 @@ Content-Type: ${value2.type || "application/octet-stream"}\r } text += streamingDecoder.decode(); entries = new URLSearchParams(text); - } catch (err) { - throw Object.assign(new TypeError(), { cause: err }); + } catch (err2) { + throw Object.assign(new TypeError(), { cause: err2 }); } const formData = new FormData2(); for (const [name, value2] of entries) { @@ -5669,7 +5669,7 @@ var require_request = __commonJS({ } var Request2 = class _Request { constructor(origin, { - path, + path: path2, method, body, headers, @@ -5683,11 +5683,11 @@ var require_request = __commonJS({ throwOnError, expectContinue }, handler2) { - if (typeof path !== "string") { + if (typeof path2 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") { + } else if (path2[0] !== "/" && !(path2.startsWith("http://") || path2.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.exec(path) !== null) { + } else if (invalidPathRegex.exec(path2) !== null) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -5726,11 +5726,11 @@ var require_request = __commonJS({ }; this.body.on("end", this.endHandler); } - this.errorHandler = (err) => { + this.errorHandler = (err2) => { if (this.abort) { - this.abort(err); + this.abort(err2); } else { - this.error = err; + this.error = err2; } }; this.body.on("error", this.errorHandler); @@ -5750,7 +5750,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query2 ? util3.buildURL(path, query2) : path; + this.path = query2 ? util3.buildURL(path2, query2) : path2; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -5807,8 +5807,8 @@ var require_request = __commonJS({ if (this[kHandler].onBodySent) { try { return this[kHandler].onBodySent(chunk); - } catch (err) { - this.abort(err); + } catch (err2) { + this.abort(err2); } } } @@ -5819,8 +5819,8 @@ var require_request = __commonJS({ if (this[kHandler].onRequestSent) { try { return this[kHandler].onRequestSent(); - } catch (err) { - this.abort(err); + } catch (err2) { + this.abort(err2); } } } @@ -5842,8 +5842,8 @@ var require_request = __commonJS({ } try { return this[kHandler].onHeaders(statusCode, headers, resume, statusText); - } catch (err) { - this.abort(err); + } catch (err2) { + this.abort(err2); } } onData(chunk) { @@ -5851,8 +5851,8 @@ var require_request = __commonJS({ assert2(!this.completed); try { return this[kHandler].onData(chunk); - } catch (err) { - this.abort(err); + } catch (err2) { + this.abort(err2); return false; } } @@ -5870,8 +5870,8 @@ var require_request = __commonJS({ } try { return this[kHandler].onComplete(trailers); - } catch (err) { - this.onError(err); + } catch (err2) { + this.onError(err2); } } onError(error41) { @@ -6073,8 +6073,8 @@ var require_dispatcher_base = __commonJS({ close(callback) { if (callback === void 0) { return new Promise((resolve, reject) => { - this.close((err, data) => { - return err ? reject(err) : resolve(data); + this.close((err2, data) => { + return err2 ? reject(err2) : resolve(data); }); }); } @@ -6106,17 +6106,17 @@ var require_dispatcher_base = __commonJS({ queueMicrotask(onClosed); }); } - destroy(err, callback) { - if (typeof err === "function") { - callback = err; - err = null; + destroy(err2, callback) { + if (typeof err2 === "function") { + callback = err2; + err2 = null; } if (callback === void 0) { return new Promise((resolve, reject) => { - this.destroy(err, (err2, data) => { - return err2 ? ( + this.destroy(err2, (err3, data) => { + return err3 ? ( /* istanbul ignore next: should never error */ - reject(err2) + reject(err3) ) : resolve(data); }); }); @@ -6132,8 +6132,8 @@ var require_dispatcher_base = __commonJS({ } return; } - if (!err) { - err = new ClientDestroyedError(); + if (!err2) { + err2 = new ClientDestroyedError(); } this[kDestroyed] = true; this[kOnDestroyed] = this[kOnDestroyed] || []; @@ -6145,7 +6145,7 @@ var require_dispatcher_base = __commonJS({ callbacks[i](null, null); } }; - this[kDestroy](err).then(() => { + this[kDestroy](err2).then(() => { queueMicrotask(onDestroyed); }); } @@ -6176,11 +6176,11 @@ var require_dispatcher_base = __commonJS({ throw new ClientClosedError(); } return this[kInterceptedDispatch](opts, handler2); - } catch (err) { + } catch (err2) { if (typeof handler2.onError !== "function") { throw new InvalidArgumentError("invalid onError method"); } - handler2.onError(err); + handler2.onError(err2); return false; } } @@ -6305,12 +6305,12 @@ var require_connect = __commonJS({ callback = null; cb(null, this); } - }).on("error", function(err) { + }).on("error", function(err2) { cancelTimeout(); if (callback) { const cb = callback; callback = null; - cb(err); + cb(err2); } }); return socket; @@ -6758,9 +6758,9 @@ var require_RedirectHandler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search: search2 } = util3.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path = search2 ? `${pathname}${search2}` : pathname; + const path2 = search2 ? `${pathname}${search2}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path; + this.opts.path = path2; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -7185,12 +7185,12 @@ var require_client = __commonJS({ } }); } - async [kDestroy](err) { + async [kDestroy](err2) { return new Promise((resolve) => { const requests = this[kQueue].splice(this[kPendingIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - errorRequest(this, request2, err); + errorRequest(this, request2, err2); } const callback = () => { if (this[kClosedResolve]) { @@ -7200,29 +7200,29 @@ var require_client = __commonJS({ resolve(); }; if (this[kHTTP2Session] != null) { - util3.destroy(this[kHTTP2Session], err); + util3.destroy(this[kHTTP2Session], err2); this[kHTTP2Session] = null; this[kHTTP2SessionState] = null; } if (!this[kSocket]) { queueMicrotask(callback); } else { - util3.destroy(this[kSocket].on("close", callback), err); + util3.destroy(this[kSocket].on("close", callback), err2); } resume(this); }); } }; - function onHttp2SessionError(err) { - assert2(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); - this[kSocket][kError] = err; - onError(this[kClient], err); + function onHttp2SessionError(err2) { + assert2(err2.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + this[kSocket][kError] = err2; + onError(this[kClient], err2); } function onHttp2FrameError(type2, code, id) { - const err = new InformationalError(`HTTP/2: "frameError" received - type ${type2}, code ${code}`); + const err2 = new InformationalError(`HTTP/2: "frameError" received - type ${type2}, code ${code}`); if (id === 0) { - this[kSocket][kError] = err; - onError(this[kClient], err); + this[kSocket][kError] = err2; + onError(this[kClient], err2); } } function onHttp2SessionEnd() { @@ -7231,7 +7231,7 @@ var require_client = __commonJS({ } function onHTTP2GoAway(code) { const client = this[kClient]; - const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`); + const err2 = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`); client[kSocket] = null; client[kHTTP2Session] = null; if (client.destroyed) { @@ -7239,12 +7239,12 @@ var require_client = __commonJS({ const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - errorRequest(this, request2, err); + errorRequest(this, request2, err2); } } else if (client[kRunning] > 0) { const request2 = client[kQueue][client[kRunningIdx]]; client[kQueue][client[kRunningIdx]++] = null; - errorRequest(client, request2, err); + errorRequest(client, request2, err2); } client[kPendingIdx] = client[kRunningIdx]; assert2(client[kRunning] === 0); @@ -7252,7 +7252,7 @@ var require_client = __commonJS({ "disconnect", client[kUrl], [client], - err + err2 ); resume(client); } @@ -7408,8 +7408,8 @@ var require_client = __commonJS({ currentBufferRef = data; currentParser = this; ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length); - } catch (err) { - throw err; + } catch (err2) { + throw err2; } finally { currentParser = null; currentBufferRef = null; @@ -7429,8 +7429,8 @@ var require_client = __commonJS({ } throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)); } - } catch (err) { - util3.destroy(socket, err); + } catch (err2) { + util3.destroy(socket, err2); } } destroy() { @@ -7516,8 +7516,8 @@ var require_client = __commonJS({ client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade")); try { request2.onUpgrade(statusCode, headers, socket); - } catch (err) { - util3.destroy(socket, err); + } catch (err2) { + util3.destroy(socket, err2); } resume(client); } @@ -7690,25 +7690,25 @@ var require_client = __commonJS({ parser.readMore(); } } - function onSocketError(err) { + function onSocketError(err2) { const { [kClient]: client, [kParser]: parser } = this; - assert2(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + assert2(err2.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); if (client[kHTTPConnVersion] !== "h2") { - if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { + if (err2.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { parser.onMessageComplete(); return; } } - this[kError] = err; - onError(this[kClient], err); + this[kError] = err2; + onError(this[kClient], err2); } - function onError(client, err) { - if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { + function onError(client, err2) { + if (client[kRunning] === 0 && err2.code !== "UND_ERR_INFO" && err2.code !== "UND_ERR_SOCKET") { assert2(client[kPendingIdx] === client[kRunningIdx]); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - errorRequest(client, request2, err); + errorRequest(client, request2, err2); } assert2(client[kSize] === 0); } @@ -7732,23 +7732,23 @@ var require_client = __commonJS({ this[kParser].destroy(); this[kParser] = null; } - const err = this[kError] || new SocketError("closed", util3.getSocketInfo(this)); + const err2 = this[kError] || new SocketError("closed", util3.getSocketInfo(this)); client[kSocket] = null; if (client.destroyed) { assert2(client[kPending] === 0); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - errorRequest(client, request2, err); + errorRequest(client, request2, err2); } - } else if (client[kRunning] > 0 && err.code !== "UND_ERR_INFO") { + } else if (client[kRunning] > 0 && err2.code !== "UND_ERR_INFO") { const request2 = client[kQueue][client[kRunningIdx]]; client[kQueue][client[kRunningIdx]++] = null; - errorRequest(client, request2, err); + errorRequest(client, request2, err2); } client[kPendingIdx] = client[kRunningIdx]; assert2(client[kRunning] === 0); - client.emit("disconnect", client[kUrl], [client], err); + client.emit("disconnect", client[kUrl], [client], err2); resume(client); } async function connect(client) { @@ -7785,9 +7785,9 @@ var require_client = __commonJS({ port, servername: client[kServerName], localAddress: client[kLocalAddress] - }, (err, socket2) => { - if (err) { - reject(err); + }, (err2, socket2) => { + if (err2) { + reject(err2); } else { resolve(socket2); } @@ -7855,7 +7855,7 @@ var require_client = __commonJS({ }); } client.emit("connect", client[kUrl], [client]); - } catch (err) { + } catch (err2) { if (client.destroyed) { return; } @@ -7871,19 +7871,19 @@ var require_client = __commonJS({ localAddress: client[kLocalAddress] }, connector: client[kConnector], - error: err + error: err2 }); } - if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { + if (err2.code === "ERR_TLS_CERT_ALTNAME_INVALID") { assert2(client[kRunning] === 0); while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { const request2 = client[kQueue][client[kPendingIdx]++]; - errorRequest(client, request2, err); + errorRequest(client, request2, err2); } } else { - onError(client, err); + onError(client, err2); } - client.emit("connectionError", client[kUrl], [client], err); + client.emit("connectionError", client[kUrl], [client], err2); } resume(client); } @@ -8000,7 +8000,7 @@ var require_client = __commonJS({ writeH2(client, client[kHTTP2Session], request2); return; } - const { body, method, path, host, upgrade, headers, blocking, reset } = request2; + const { body, method, path: path2, host, upgrade, headers, blocking, reset } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); @@ -8022,15 +8022,15 @@ var require_client = __commonJS({ } const socket = client[kSocket]; try { - request2.onConnect((err) => { + request2.onConnect((err2) => { if (request2.aborted || request2.completed) { return; } - errorRequest(client, request2, err || new RequestAbortedError()); + errorRequest(client, request2, err2 || new RequestAbortedError()); util3.destroy(socket, new InformationalError("aborted")); }); - } catch (err) { - errorRequest(client, request2, err); + } catch (err2) { + errorRequest(client, request2, err2); } if (request2.aborted) { return false; @@ -8050,7 +8050,7 @@ var require_client = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path} HTTP/1.1\r + let header = `${method} ${path2} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -8113,7 +8113,7 @@ upgrade: ${upgrade}\r return true; } function writeH2(client, session, request2) { - const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { body, method, path: path2, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let headers; if (typeof reqHeaders === "string") headers = Request2[kHTTP2CopyHeaders](reqHeaders.trim()); else headers = reqHeaders; @@ -8122,14 +8122,14 @@ upgrade: ${upgrade}\r return false; } try { - request2.onConnect((err) => { + request2.onConnect((err2) => { if (request2.aborted || request2.completed) { return; } - errorRequest(client, request2, err || new RequestAbortedError()); + errorRequest(client, request2, err2 || new RequestAbortedError()); }); - } catch (err) { - errorRequest(client, request2, err); + } catch (err2) { + errorRequest(client, request2, err2); } if (request2.aborted) { return false; @@ -8156,7 +8156,7 @@ upgrade: ${upgrade}\r }); return true; } - headers[HTTP2_HEADER_PATH] = path; + headers[HTTP2_HEADER_PATH] = path2; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -8214,18 +8214,18 @@ upgrade: ${upgrade}\r session.unref(); } }); - stream.once("error", function(err) { + stream.once("error", function(err2) { if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1; - util3.destroy(stream, err); + util3.destroy(stream, err2); } }); stream.once("frameError", (type2, code) => { - const err = new InformationalError(`HTTP/2: "frameError" received - type ${type2}, code ${code}`); - errorRequest(client, request2, err); + const err2 = new InformationalError(`HTTP/2: "frameError" received - type ${type2}, code ${code}`); + errorRequest(client, request2, err2); if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1; - util3.destroy(stream, err); + util3.destroy(stream, err2); } }); return true; @@ -8300,10 +8300,10 @@ upgrade: ${upgrade}\r const pipe = pipeline2( body, h2stream, - (err) => { - if (err) { - util3.destroy(body, err); - util3.destroy(h2stream, err); + (err2) => { + if (err2) { + util3.destroy(body, err2); + util3.destroy(h2stream, err2); } else { request2.onRequestSent(); } @@ -8326,8 +8326,8 @@ upgrade: ${upgrade}\r if (!writer.write(chunk) && this.pause) { this.pause(); } - } catch (err) { - util3.destroy(this, err); + } catch (err2) { + util3.destroy(this, err2); } }; const onDrain = function() { @@ -8342,10 +8342,10 @@ upgrade: ${upgrade}\r if (finished) { return; } - const err = new RequestAbortedError(); - queueMicrotask(() => onFinished(err)); + const err2 = new RequestAbortedError(); + queueMicrotask(() => onFinished(err2)); }; - const onFinished = function(err) { + const onFinished = function(err2) { if (finished) { return; } @@ -8353,16 +8353,16 @@ upgrade: ${upgrade}\r assert2(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); socket.off("drain", onDrain).off("error", onFinished); body.removeListener("data", onData).removeListener("end", onFinished).removeListener("error", onFinished).removeListener("close", onAbort); - if (!err) { + if (!err2) { try { writer.end(); } catch (er) { - err = er; + err2 = er; } } - writer.destroy(err); - if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { - util3.destroy(body, err); + writer.destroy(err2); + if (err2 && (err2.code !== "UND_ERR_INFO" || err2.message !== "reset")) { + util3.destroy(body, err2); } else { util3.destroy(body); } @@ -8399,8 +8399,8 @@ upgrade: ${upgrade}\r socket[kReset] = true; } resume(client); - } catch (err) { - util3.destroy(isH2 ? h2stream : socket, err); + } catch (err2) { + util3.destroy(isH2 ? h2stream : socket, err2); } } async function writeIterable({ h2stream, body, client, request: request2, socket, contentLength, header, expectsPayload }) { @@ -8434,8 +8434,8 @@ upgrade: ${upgrade}\r await waitForDrain(); } } - } catch (err) { - h2stream.destroy(err); + } catch (err2) { + h2stream.destroy(err2); } finally { request2.onRequestSent(); h2stream.end(); @@ -8455,8 +8455,8 @@ upgrade: ${upgrade}\r } } writer.end(); - } catch (err) { - writer.destroy(err); + } catch (err2) { + writer.destroy(err2); } finally { socket.off("close", onDrain).off("drain", onDrain); } @@ -8558,21 +8558,21 @@ ${len.toString(16)}\r } resume(client); } - destroy(err) { + destroy(err2) { const { socket, client } = this; socket[kWriting] = false; - if (err) { + if (err2) { assert2(client[kRunning] <= 1, "pipeline should only contain this request"); - util3.destroy(socket, err); + util3.destroy(socket, err2); } } }; - function errorRequest(client, request2, err) { + function errorRequest(client, request2, err2) { try { - request2.onError(err); + request2.onError(err2); assert2(request2.aborted); - } catch (err2) { - client.emit("error", err2); + } catch (err3) { + client.emit("error", err3); } } module.exports = Client2; @@ -8718,11 +8718,11 @@ var require_pool_base = __commonJS({ this[kOnConnect] = (origin, targets) => { pool.emit("connect", origin, [pool, ...targets]); }; - this[kOnDisconnect] = (origin, targets, err) => { - pool.emit("disconnect", origin, [pool, ...targets], err); + this[kOnDisconnect] = (origin, targets, err2) => { + pool.emit("disconnect", origin, [pool, ...targets], err2); }; - this[kOnConnectionError] = (origin, targets, err) => { - pool.emit("connectionError", origin, [pool, ...targets], err); + this[kOnConnectionError] = (origin, targets, err2) => { + pool.emit("connectionError", origin, [pool, ...targets], err2); }; this[kStats] = new PoolStats(this); } @@ -8768,15 +8768,15 @@ var require_pool_base = __commonJS({ }); } } - async [kDestroy](err) { + async [kDestroy](err2) { while (true) { const item = this[kQueue].shift(); if (!item) { break; } - item.handler.onError(err); + item.handler.onError(err2); } - return Promise.all(this[kClients].map((c) => c.destroy(err))); + return Promise.all(this[kClients].map((c) => c.destroy(err2))); } [kDispatch](opts, handler2) { const dispatcher = this[kGetDispatcher](); @@ -8983,8 +8983,8 @@ var require_balanced_pool = __commonJS({ this._updateBalancedPoolStats(); }); pool.on("disconnect", (...args2) => { - const err = args2[2]; - if (err && err.code === "UND_ERR_SOCKET") { + const err2 = args2[2]; + if (err2 && err2.code === "UND_ERR_SOCKET") { pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); this._updateBalancedPoolStats(); } @@ -9150,11 +9150,11 @@ var require_agent = __commonJS({ this[kOnConnect] = (origin, targets) => { agent.emit("connect", origin, [agent, ...targets]); }; - this[kOnDisconnect] = (origin, targets, err) => { - agent.emit("disconnect", origin, [agent, ...targets], err); + this[kOnDisconnect] = (origin, targets, err2) => { + agent.emit("disconnect", origin, [agent, ...targets], err2); }; - this[kOnConnectionError] = (origin, targets, err) => { - agent.emit("connectionError", origin, [agent, ...targets], err); + this[kOnConnectionError] = (origin, targets, err2) => { + agent.emit("connectionError", origin, [agent, ...targets], err2); }; } get [kRunning]() { @@ -9193,12 +9193,12 @@ var require_agent = __commonJS({ } await Promise.all(closePromises); } - async [kDestroy](err) { + async [kDestroy](err2) { const destroyPromises = []; for (const ref of this[kClients].values()) { const client = ref.deref(); if (client) { - destroyPromises.push(client.destroy(err)); + destroyPromises.push(client.destroy(err2)); } } await Promise.all(destroyPromises); @@ -9245,17 +9245,17 @@ var require_readable = __commonJS({ this[kContentType] = contentType; this[kReading] = false; } - destroy(err) { + destroy(err2) { if (this.destroyed) { return this; } - if (!err && !this._readableState.endEmitted) { - err = new RequestAbortedError(); + if (!err2 && !this._readableState.endEmitted) { + err2 = new RequestAbortedError(); } - if (err) { + if (err2) { this[kAbort](); } - return super.destroy(err); + return super.destroy(err2); } emit(ev, ...args2) { if (ev === "data") { @@ -9335,8 +9335,8 @@ var require_readable = __commonJS({ throw new InvalidArgumentError("signal must be an AbortSignal"); } util3.throwIfAborted(signal); - } catch (err) { - return Promise.reject(err); + } catch (err2) { + return Promise.reject(err2); } } if (this.closed) { @@ -9382,8 +9382,8 @@ var require_readable = __commonJS({ length: 0, body: [] }; - stream.on("error", function(err) { - consumeFinish(this[kConsume], err); + stream.on("error", function(err2) { + consumeFinish(this[kConsume], err2); }).on("close", function() { if (this[kConsume].body !== null) { consumeFinish(this[kConsume], new RequestAbortedError()); @@ -9433,20 +9433,20 @@ var require_readable = __commonJS({ resolve(new Blob2(body, { type: stream[kContentType] })); } consumeFinish(consume2); - } catch (err) { - stream.destroy(err); + } catch (err2) { + stream.destroy(err2); } } function consumePush(consume2, chunk) { consume2.length += chunk.length; consume2.body.push(chunk); } - function consumeFinish(consume2, err) { + function consumeFinish(consume2, err2) { if (consume2.body === null) { return; } - if (err) { - consume2.reject(err); + if (err2) { + consume2.reject(err2); } else { consume2.resolve(); } @@ -9495,7 +9495,7 @@ var require_util3 = __commonJS({ process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers, payload)); return; } - } catch (err) { + } catch (err2) { } process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers)); } @@ -9588,11 +9588,11 @@ var require_api_request = __commonJS({ throw new InvalidArgumentError("invalid onInfo callback"); } super("UNDICI_REQUEST"); - } catch (err) { + } catch (err2) { if (util3.isStream(body)) { - util3.destroy(body.on("error", util3.nop), err); + util3.destroy(body.on("error", util3.nop), err2); } - throw err; + throw err2; } this.responseHeaders = responseHeaders || null; this.opaque = opaque || null; @@ -9606,8 +9606,8 @@ var require_api_request = __commonJS({ this.throwOnError = throwOnError; this.highWaterMark = highWaterMark; if (util3.isStream(body)) { - body.on("error", (err) => { - this.onError(err); + body.on("error", (err2) => { + this.onError(err2); }); } addSignal(this, signal); @@ -9662,43 +9662,43 @@ var require_api_request = __commonJS({ util3.parseHeaders(trailers, this.trailers); res.push(null); } - onError(err) { + onError(err2) { const { res, callback, body, opaque } = this; removeSignal(this); if (callback) { this.callback = null; queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); + this.runInAsyncScope(callback, null, err2, { opaque }); }); } if (res) { this.res = null; queueMicrotask(() => { - util3.destroy(res, err); + util3.destroy(res, err2); }); } if (body) { this.body = null; - util3.destroy(body, err); + util3.destroy(body, err2); } } }; function request2(opts, callback) { if (callback === void 0) { return new Promise((resolve, reject) => { - request2.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data); + request2.call(this, opts, (err2, data) => { + return err2 ? reject(err2) : resolve(data); }); }); } try { this.dispatch(opts, new RequestHandler(opts, callback)); - } catch (err) { + } catch (err2) { if (typeof callback !== "function") { - throw err; + throw err2; } const opaque = opts && opts.opaque; - queueMicrotask(() => callback(err, { opaque })); + queueMicrotask(() => callback(err2, { opaque })); } } module.exports = request2; @@ -9743,11 +9743,11 @@ var require_api_stream = __commonJS({ throw new InvalidArgumentError("invalid onInfo callback"); } super("UNDICI_STREAM"); - } catch (err) { + } catch (err2) { if (util3.isStream(body)) { - util3.destroy(body.on("error", util3.nop), err); + util3.destroy(body.on("error", util3.nop), err2); } - throw err; + throw err2; } this.responseHeaders = responseHeaders || null; this.opaque = opaque || null; @@ -9761,8 +9761,8 @@ var require_api_stream = __commonJS({ this.onInfo = onInfo || null; this.throwOnError = throwOnError || false; if (util3.isStream(body)) { - body.on("error", (err) => { - this.onError(err); + body.on("error", (err2) => { + this.onError(err2); }); } addSignal(this, signal); @@ -9808,15 +9808,15 @@ var require_api_stream = __commonJS({ if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); } - finished(res, { readable: false }, (err) => { + finished(res, { readable: false }, (err2) => { const { callback: callback2, res: res2, opaque: opaque2, trailers, abort } = this; this.res = null; - if (err || !res2.readable) { - util3.destroy(res2, err); + if (err2 || !res2.readable) { + util3.destroy(res2, err2); } this.callback = null; - this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers }); - if (err) { + this.runInAsyncScope(callback2, null, err2 || null, { opaque: opaque2, trailers }); + if (err2) { abort(); } }); @@ -9839,41 +9839,41 @@ var require_api_stream = __commonJS({ this.trailers = util3.parseHeaders(trailers); res.end(); } - onError(err) { + onError(err2) { const { res, callback, opaque, body } = this; removeSignal(this); this.factory = null; if (res) { this.res = null; - util3.destroy(res, err); + util3.destroy(res, err2); } else if (callback) { this.callback = null; queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); + this.runInAsyncScope(callback, null, err2, { opaque }); }); } if (body) { this.body = null; - util3.destroy(body, err); + util3.destroy(body, err2); } } }; function stream(opts, factory, callback) { if (callback === void 0) { return new Promise((resolve, reject) => { - stream.call(this, opts, factory, (err, data) => { - return err ? reject(err) : resolve(data); + stream.call(this, opts, factory, (err2, data) => { + return err2 ? reject(err2) : resolve(data); }); }); } try { this.dispatch(opts, new StreamHandler(opts, factory, callback)); - } catch (err) { + } catch (err2) { if (typeof callback !== "function") { - throw err; + throw err2; } const opaque = opts && opts.opaque; - queueMicrotask(() => callback(err, { opaque })); + queueMicrotask(() => callback(err2, { opaque })); } } module.exports = stream; @@ -9911,9 +9911,9 @@ var require_api_pipeline = __commonJS({ resume(); } } - _destroy(err, callback) { + _destroy(err2, callback) { this._read(); - callback(err); + callback(err2); } }; var PipelineResponse = class extends Readable { @@ -9924,11 +9924,11 @@ var require_api_pipeline = __commonJS({ _read() { this[kResume](); } - _destroy(err, callback) { - if (!err && !this._readableState.endEmitted) { - err = new RequestAbortedError(); + _destroy(err2, callback) { + if (!err2 && !this._readableState.endEmitted) { + err2 = new RequestAbortedError(); } - callback(err); + callback(err2); } }; var PipelineHandler = class extends AsyncResource { @@ -9974,19 +9974,19 @@ var require_api_pipeline = __commonJS({ req[kResume] = callback; } }, - destroy: (err, callback) => { + destroy: (err2, callback) => { const { body, req, res, ret, abort } = this; - if (!err && !ret._readableState.endEmitted) { - err = new RequestAbortedError(); + if (!err2 && !ret._readableState.endEmitted) { + err2 = new RequestAbortedError(); } - if (abort && err) { + if (abort && err2) { abort(); } - util3.destroy(body, err); - util3.destroy(req, err); - util3.destroy(res, err); + util3.destroy(body, err2); + util3.destroy(req, err2); + util3.destroy(res, err2); removeSignal(this); - callback(err); + callback(err2); } }).on("prefinish", () => { const { req } = this; @@ -10025,9 +10025,9 @@ var require_api_pipeline = __commonJS({ body: this.res, context }); - } catch (err) { + } catch (err2) { this.res.on("error", util3.nop); - throw err; + throw err2; } if (!body || typeof body.on !== "function") { throw new InvalidReturnValueError("expected Readable"); @@ -10037,9 +10037,9 @@ var require_api_pipeline = __commonJS({ if (!ret.push(chunk) && body2.pause) { body2.pause(); } - }).on("error", (err) => { + }).on("error", (err2) => { const { ret } = this; - util3.destroy(ret, err); + util3.destroy(ret, err2); }).on("end", () => { const { ret } = this; ret.push(null); @@ -10059,10 +10059,10 @@ var require_api_pipeline = __commonJS({ const { res } = this; res.push(null); } - onError(err) { + onError(err2) { const { ret } = this; this.handler = null; - util3.destroy(ret, err); + util3.destroy(ret, err2); } }; function pipeline2(opts, handler2) { @@ -10070,8 +10070,8 @@ var require_api_pipeline = __commonJS({ const pipelineHandler = new PipelineHandler(opts, handler2); this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler); return pipelineHandler.ret; - } catch (err) { - return new PassThrough().destroy(err); + } catch (err2) { + return new PassThrough().destroy(err2); } } module.exports = pipeline2; @@ -10130,13 +10130,13 @@ var require_api_upgrade = __commonJS({ context }); } - onError(err) { + onError(err2) { const { callback, opaque } = this; removeSignal(this); if (callback) { this.callback = null; queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); + this.runInAsyncScope(callback, null, err2, { opaque }); }); } } @@ -10144,8 +10144,8 @@ var require_api_upgrade = __commonJS({ function upgrade(opts, callback) { if (callback === void 0) { return new Promise((resolve, reject) => { - upgrade.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data); + upgrade.call(this, opts, (err2, data) => { + return err2 ? reject(err2) : resolve(data); }); }); } @@ -10156,12 +10156,12 @@ var require_api_upgrade = __commonJS({ method: opts.method || "GET", upgrade: opts.protocol || "Websocket" }, upgradeHandler); - } catch (err) { + } catch (err2) { if (typeof callback !== "function") { - throw err; + throw err2; } const opaque = opts && opts.opaque; - queueMicrotask(() => callback(err, { opaque })); + queueMicrotask(() => callback(err2, { opaque })); } } module.exports = upgrade; @@ -10221,13 +10221,13 @@ var require_api_connect = __commonJS({ context }); } - onError(err) { + onError(err2) { const { callback, opaque } = this; removeSignal(this); if (callback) { this.callback = null; queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); + this.runInAsyncScope(callback, null, err2, { opaque }); }); } } @@ -10235,20 +10235,20 @@ var require_api_connect = __commonJS({ function connect(opts, callback) { if (callback === void 0) { return new Promise((resolve, reject) => { - connect.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data); + connect.call(this, opts, (err2, data) => { + return err2 ? reject(err2) : resolve(data); }); }); } try { const connectHandler = new ConnectHandler(opts, callback); this.dispatch({ ...opts, method: "CONNECT" }, connectHandler); - } catch (err) { + } catch (err2) { if (typeof callback !== "function") { - throw err; + throw err2; } const opaque = opts && opts.opaque; - queueMicrotask(() => callback(err, { opaque })); + queueMicrotask(() => callback(err2, { opaque })); } } module.exports = connect; @@ -10396,20 +10396,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path) { - if (typeof path !== "string") { - return path; + function safeUrl(path2) { + if (typeof path2 !== "string") { + return path2; } - const pathSegments = path.split("?"); + const pathSegments = path2.split("?"); if (pathSegments.length !== 2) { - return path; + return path2; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path); + function matchKey(mockDispatch2, { path: path2, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path2); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10427,7 +10427,7 @@ var require_mock_utils = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path2 }) => matchValue(safeUrl(path2), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10464,9 +10464,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path, method, body, headers, query: query2 } = opts; + const { path: path2, method, body, headers, query: query2 } = opts; return { - path, + path: path2, method, body, headers, @@ -10915,10 +10915,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path2, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path, + Path: path2, "Status code": statusCode, Persistent: persist ? "\u2705" : "\u274C", Invocations: timesInvoked, @@ -11076,7 +11076,7 @@ var require_proxy_agent = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/proxy-agent.js"(exports, module) { "use strict"; var { kProxy, kClose, kDestroy, kInterceptors } = require_symbols(); - var { URL: URL2 } = __require("url"); + var { URL: URL3 } = __require("url"); var Agent = require_agent(); var Pool = require_pool(); var DispatcherBase = require_dispatcher_base(); @@ -11125,7 +11125,7 @@ var require_proxy_agent = __commonJS({ this[kRequestTls] = opts.requestTls; this[kProxyTls] = opts.proxyTls; this[kProxyHeaders] = opts.headers || {}; - const resolvedUrl = new URL2(opts.uri); + const resolvedUrl = new URL3(opts.uri); const { origin, port, host, username, password } = resolvedUrl; if (opts.auth && opts.token) { throw new InvalidArgumentError("opts.auth cannot be used in combination with opts.token"); @@ -11173,14 +11173,14 @@ var require_proxy_agent = __commonJS({ servername = opts2.servername; } this[kConnectEndpoint]({ ...opts2, servername, httpSocket: socket }, callback); - } catch (err) { - callback(err); + } catch (err2) { + callback(err2); } } }); } dispatch(opts, handler2) { - const { host } = new URL2(opts.origin); + const { host } = new URL3(opts.origin); const headers = buildHeaders(opts.headers); throwIfProxyAuthIsSent(headers); return this[kAgent].dispatch( @@ -11315,8 +11315,8 @@ var require_RetryHandler = __commonJS({ onBodySent(chunk) { if (this.handler.onBodySent) return this.handler.onBodySent(chunk); } - static [kRetryHandlerDefaultRetry](err, { state, opts }, cb) { - const { statusCode, code, headers } = err; + static [kRetryHandlerDefaultRetry](err2, { state, opts }, cb) { + const { statusCode, code, headers } = err2; const { method, retryOptions } = opts; const { maxRetries, @@ -11330,19 +11330,19 @@ var require_RetryHandler = __commonJS({ let { counter, currentTimeout } = state; currentTimeout = currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout; if (code && code !== "UND_ERR_REQ_RETRY" && code !== "UND_ERR_SOCKET" && !errorCodes.includes(code)) { - cb(err); + cb(err2); return; } if (Array.isArray(methods) && !methods.includes(method)) { - cb(err); + cb(err2); return; } if (statusCode != null && Array.isArray(statusCodes) && !statusCodes.includes(statusCode)) { - cb(err); + cb(err2); return; } if (counter > maxRetries) { - cb(err); + cb(err2); return; } let retryAfterHeader = headers != null && headers["retry-after"]; @@ -11438,11 +11438,11 @@ var require_RetryHandler = __commonJS({ statusMessage ); } - const err = new RequestRetryError("Request failed", statusCode, { + const err2 = new RequestRetryError("Request failed", statusCode, { headers, count: this.retryCount }); - this.abort(err); + this.abort(err2); return false; } onData(chunk) { @@ -11453,21 +11453,21 @@ var require_RetryHandler = __commonJS({ this.retryCount = 0; return this.handler.onComplete(rawTrailers); } - onError(err) { + onError(err2) { if (this.aborted || isDisturbed(this.opts.body)) { - return this.handler.onError(err); + return this.handler.onError(err2); } this.retryOpts.retry( - err, + err2, { state: { counter: this.retryCount++, currentTimeout: this.retryAfter }, opts: { retryOptions: this.retryOpts, ...this.opts } }, onRetry.bind(this) ); - function onRetry(err2) { - if (err2 != null || this.aborted || isDisturbed(this.opts.body)) { - return this.handler.onError(err2); + function onRetry(err3) { + if (err3 != null || this.aborted || isDisturbed(this.opts.body)) { + return this.handler.onError(err3); } if (this.start !== 0) { this.opts = { @@ -11480,8 +11480,8 @@ var require_RetryHandler = __commonJS({ } try { this.dispatch(this.opts, this); - } catch (err3) { - this.handler.onError(err3); + } catch (err4) { + this.handler.onError(err4); } } } @@ -12015,9 +12015,9 @@ var require_response = __commonJS({ let parsedURL; try { parsedURL = new URL(url2, getGlobalOrigin()); - } catch (err) { + } catch (err2) { throw Object.assign(new TypeError("Failed to parse URL from " + url2), { - cause: err + cause: err2 }); } if (!redirectStatusSet.has(status)) { @@ -12225,9 +12225,9 @@ var require_response = __commonJS({ assert2(false); } } - function makeAppropriateNetworkError(fetchParams, err = null) { + function makeAppropriateNetworkError(fetchParams, err2 = null) { assert2(isCancelled(fetchParams)); - return isAborted4(fetchParams) ? makeNetworkError(Object.assign(new DOMException2("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException2("Request was cancelled."), { cause: err })); + return isAborted4(fetchParams) ? makeNetworkError(Object.assign(new DOMException2("The operation was aborted.", "AbortError"), { cause: err2 })) : makeNetworkError(Object.assign(new DOMException2("Request was cancelled."), { cause: err2 })); } function initializeResponse(response, init, body) { if (init.status !== null && (init.status < 200 || init.status > 599)) { @@ -12387,8 +12387,8 @@ var require_request2 = __commonJS({ let parsedURL; try { parsedURL = new URL(input, baseUrl); - } catch (err) { - throw new TypeError("Failed to parse URL from " + input, { cause: err }); + } catch (err2) { + throw new TypeError("Failed to parse URL from " + input, { cause: err2 }); } if (parsedURL.username || parsedURL.password) { throw new TypeError( @@ -12477,8 +12477,8 @@ var require_request2 = __commonJS({ let parsedReferrer; try { parsedReferrer = new URL(referrer, baseUrl); - } catch (err) { - throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err }); + } catch (err2) { + throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err2 }); } if (parsedReferrer.protocol === "about:" && parsedReferrer.hostname === "client" || origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl)) { request2.referrer = "client"; @@ -13167,11 +13167,11 @@ var require_fetch = __commonJS({ } p.reject(error41); if (request2.body != null && isReadable(request2.body?.stream)) { - request2.body.stream.cancel(error41).catch((err) => { - if (err.code === "ERR_INVALID_STATE") { + request2.body.stream.cancel(error41).catch((err2) => { + if (err2.code === "ERR_INVALID_STATE") { return; } - throw err; + throw err2; }); } if (responseObject == null) { @@ -13179,11 +13179,11 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error41).catch((err) => { - if (err.code === "ERR_INVALID_STATE") { + response.body.stream.cancel(error41).catch((err2) => { + if (err2.code === "ERR_INVALID_STATE") { return; } - throw err; + throw err2; }); } } @@ -13247,8 +13247,8 @@ var require_fetch = __commonJS({ } if (subresourceSet.has(request2.destination)) { } - mainFetch(fetchParams).catch((err) => { - fetchParams.controller.terminate(err); + mainFetch(fetchParams).catch((err2) => { + fetchParams.controller.terminate(err2); }); return fetchParams.controller; } @@ -13405,7 +13405,7 @@ var require_fetch = __commonJS({ } case "http:": case "https:": { - return httpFetch(fetchParams).catch((err) => makeNetworkError(err)); + return httpFetch(fetchParams).catch((err2) => makeNetworkError(err2)); } default: { return Promise.resolve(makeNetworkError("unknown scheme")); @@ -13523,8 +13523,8 @@ var require_fetch = __commonJS({ if (locationURL == null) { return response; } - } catch (err) { - return Promise.resolve(makeNetworkError(err)); + } catch (err2) { + return Promise.resolve(makeNetworkError(err2)); } if (!urlIsHttpHttpsScheme(locationURL)) { return Promise.resolve(makeNetworkError("URL scheme must be a HTTP(S) scheme")); @@ -13695,10 +13695,10 @@ var require_fetch = __commonJS({ fetchParams.controller.connection = { abort: null, destroyed: false, - destroy(err) { + destroy(err2) { if (!this.destroyed) { this.destroyed = true; - this.abort?.(err ?? new DOMException2("The operation was aborted.", "AbortError")); + this.abort?.(err2 ?? new DOMException2("The operation was aborted.", "AbortError")); } } }; @@ -13748,8 +13748,8 @@ var require_fetch = __commonJS({ yield* processBodyChunk(bytes); } processEndOfBody(); - } catch (err) { - processBodyError(err); + } catch (err2) { + processBodyError(err2); } })(); } @@ -13762,12 +13762,12 @@ var require_fetch = __commonJS({ fetchParams.controller.next = () => iterator2.next(); response = makeResponse({ status, statusText, headersList }); } - } catch (err) { - if (err.name === "AbortError") { + } catch (err2) { + if (err2.name === "AbortError") { fetchParams.controller.connection.destroy(); - return makeAppropriateNetworkError(fetchParams, err); + return makeAppropriateNetworkError(fetchParams, err2); } - return makeNetworkError(err); + return makeNetworkError(err2); } const pullAlgorithm = () => { fetchParams.controller.resume(); @@ -13809,11 +13809,11 @@ var require_fetch = __commonJS({ break; } bytes = done ? void 0 : value2; - } catch (err) { + } catch (err2) { if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { bytes = void 0; } else { - bytes = err; + bytes = err2; isFailure = true; } } @@ -15538,8 +15538,8 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path) { - for (const char of path) { + function validateCookiePath(path2) { + for (const char of path2) { const code = char.charCodeAt(0); if (code < 33 || char === ";") { throw new Error("Invalid cookie path"); @@ -16598,8 +16598,8 @@ var require_receiver = __commonJS({ const closeFrame = new WebsocketFrameSend(body2); this.ws[kResponse].socket.write( closeFrame.createFrame(opcodes.CLOSE), - (err) => { - if (!err) { + (err2) => { + if (!err2) { this.ws[kSentClose] = true; } } @@ -16892,8 +16892,8 @@ var require_websocket = __commonJS({ frame.frameData = emptyBuffer; } const socket = this[kResponse].socket; - socket.write(frame.createFrame(opcodes.CLOSE), (err) => { - if (!err) { + socket.write(frame.createFrame(opcodes.CLOSE), (err2) => { + if (!err2) { this[kSentClose] = true; } }); @@ -17219,11 +17219,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path = opts.path; + let path2 = opts.path; if (!opts.path.startsWith("/")) { - path = `/${path}`; + path2 = `/${path2}`; } - url2 = new URL(util3.parseOrigin(url2).origin + path); + url2 = new URL(util3.parseOrigin(url2).origin + path2); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -17252,11 +17252,11 @@ var require_undici = __commonJS({ } try { return await fetchImpl(...arguments); - } catch (err) { - if (typeof err === "object") { - Error.captureStackTrace(err, this); + } catch (err2) { + if (typeof err2 === "object") { + Error.captureStackTrace(err2, this); } - throw err; + throw err2; } }; module.exports.Headers = require_headers().Headers; @@ -17666,9 +17666,9 @@ var require_lib = __commonJS({ requestRaw(info2, data) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); + function callbackForResult(err2, res) { + if (err2) { + reject(err2); } else if (!res) { reject(new Error("Unknown error")); } else { @@ -17693,10 +17693,10 @@ var require_lib = __commonJS({ info2.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } let callbackCalled = false; - function handleResult4(err, res) { + function handleResult4(err2, res) { if (!callbackCalled) { callbackCalled = true; - onResult(err, res); + onResult(err2, res); } } const req = info2.httpModule.request(info2.options, (msg) => { @@ -17713,8 +17713,8 @@ var require_lib = __commonJS({ } handleResult4(new Error(`Request timeout: ${info2.options.path}`)); }); - req.on("error", function(err) { - handleResult4(err); + req.on("error", function(err2) { + handleResult4(err2); }); if (data && typeof data === "string") { req.write(data, "utf8"); @@ -17891,7 +17891,7 @@ var require_lib = __commonJS({ response.result = obj; } response.headers = res.message.headers; - } catch (err) { + } catch (err2) { } if (statusCode > 299) { let msg; @@ -17902,9 +17902,9 @@ var require_lib = __commonJS({ } else { msg = `Failed request: (${statusCode})`; } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); + const err2 = new HttpClientError(msg, statusCode); + err2.result = response.result; + reject(err2); } else { resolve(response); } @@ -18211,9 +18211,9 @@ var require_summary = __commonJS({ write(options) { return __awaiter(this, void 0, void 0, function* () { const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); - const filePath = yield this.filePath(); + const filePath2 = yield this.filePath(); const writeFunc = overwrite ? writeFile : appendFile; - yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); + yield writeFunc(filePath2, this._buffer, { encoding: "utf8" }); return this.emptyBuffer(); }); } @@ -18446,7 +18446,7 @@ var require_path_utils = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; - var path = __importStar(__require("path")); + var path2 = __importStar(__require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -18456,7 +18456,7 @@ var require_path_utils = __commonJS({ } exports.toWin32Path = toWin32Path; function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path.sep); + return pth.replace(/[/\\]/g, path2.sep); } exports.toPlatformPath = toPlatformPath; } @@ -18520,7 +18520,7 @@ var require_io_util = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; var fs2 = __importStar(__require("fs")); - var path = __importStar(__require("path")); + var path2 = __importStar(__require("path")); _a = fs2.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; exports.IS_WINDOWS = process.platform === "win32"; exports.UV_FS_O_EXLOCK = 268435456; @@ -18529,11 +18529,11 @@ var require_io_util = __commonJS({ return __awaiter(this, void 0, void 0, function* () { try { yield exports.stat(fsPath); - } catch (err) { - if (err.code === "ENOENT") { + } catch (err2) { + if (err2.code === "ENOENT") { return false; } - throw err; + throw err2; } return true; }); @@ -18557,57 +18557,57 @@ var require_io_util = __commonJS({ return p.startsWith("/"); } exports.isRooted = isRooted; - function tryGetExecutablePath(filePath, extensions) { + function tryGetExecutablePath(filePath2, extensions) { return __awaiter(this, void 0, void 0, function* () { let stats = void 0; try { - stats = yield exports.stat(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + stats = yield exports.stat(filePath2); + } catch (err2) { + if (err2.code !== "ENOENT") { + console.log(`Unexpected error attempting to determine if executable file exists '${filePath2}': ${err2}`); } } if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { - const upperExt = path.extname(filePath).toUpperCase(); + const upperExt = path2.extname(filePath2).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { - return filePath; + return filePath2; } } else { if (isUnixExecutable(stats)) { - return filePath; + return filePath2; } } } - const originalFilePath = filePath; + const originalFilePath = filePath2; for (const extension of extensions) { - filePath = originalFilePath + extension; + filePath2 = originalFilePath + extension; stats = void 0; try { - stats = yield exports.stat(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + stats = yield exports.stat(filePath2); + } catch (err2) { + if (err2.code !== "ENOENT") { + console.log(`Unexpected error attempting to determine if executable file exists '${filePath2}': ${err2}`); } } if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { try { - const directory = path.dirname(filePath); - const upperName = path.basename(filePath).toUpperCase(); + const directory = path2.dirname(filePath2); + const upperName = path2.basename(filePath2).toUpperCase(); for (const actualName of yield exports.readdir(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path.join(directory, actualName); + filePath2 = path2.join(directory, actualName); break; } } - } catch (err) { - console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); + } catch (err2) { + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath2}': ${err2}`); } - return filePath; + return filePath2; } else { if (isUnixExecutable(stats)) { - return filePath; + return filePath2; } } } @@ -18692,7 +18692,7 @@ var require_io = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; var assert_1 = __require("assert"); - var path = __importStar(__require("path")); + var path2 = __importStar(__require("path")); var ioUtil = __importStar(require_io_util()); function cp(source, dest, options = {}) { return __awaiter(this, void 0, void 0, function* () { @@ -18701,7 +18701,7 @@ var require_io = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path.join(dest, path.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path2.join(dest, path2.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -18713,7 +18713,7 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path.relative(source, newDest) === "") { + if (path2.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); @@ -18726,7 +18726,7 @@ var require_io = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path.join(dest, path.basename(source)); + dest = path2.join(dest, path2.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -18737,7 +18737,7 @@ var require_io = __commonJS({ } } } - yield mkdirP(path.dirname(dest)); + yield mkdirP(path2.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -18756,8 +18756,8 @@ var require_io = __commonJS({ recursive: true, retryDelay: 300 }); - } catch (err) { - throw new Error(`File was unable to be removed ${err}`); + } catch (err2) { + throw new Error(`File was unable to be removed ${err2}`); } }); } @@ -18800,25 +18800,25 @@ var require_io = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path2.delimiter)) { if (extension) { extensions.push(extension); } } } if (ioUtil.isRooted(tool2)) { - const filePath = yield ioUtil.tryGetExecutablePath(tool2, extensions); - if (filePath) { - return [filePath]; + const filePath2 = yield ioUtil.tryGetExecutablePath(tool2, extensions); + if (filePath2) { + return [filePath2]; } return []; } - if (tool2.includes(path.sep)) { + if (tool2.includes(path2.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path.delimiter)) { + for (const p of process.env.PATH.split(path2.delimiter)) { if (p) { directories.push(p); } @@ -18826,9 +18826,9 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool2), extensions); - if (filePath) { - matches.push(filePath); + const filePath2 = yield ioUtil.tryGetExecutablePath(path2.join(directory, tool2), extensions); + if (filePath2) { + matches.push(filePath2); } } return matches; @@ -18942,7 +18942,7 @@ var require_toolrunner = __commonJS({ var os = __importStar(__require("os")); var events = __importStar(__require("events")); var child = __importStar(__require("child_process")); - var path = __importStar(__require("path")); + var path2 = __importStar(__require("path")); var io = __importStar(require_io()); var ioUtil = __importStar(require_io_util()); var timers_1 = __require("timers"); @@ -19002,8 +19002,8 @@ var require_toolrunner = __commonJS({ n = s.indexOf(os.EOL); } return s; - } catch (err) { - this._debug(`error processing line. Failed with error ${err}`); + } catch (err2) { + this._debug(`error processing line. Failed with error ${err2}`); return ""; } } @@ -19157,7 +19157,7 @@ var require_toolrunner = __commonJS({ exec() { return __awaiter(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path2.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io.which(this.toolPath, true); return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { @@ -19213,8 +19213,8 @@ var require_toolrunner = __commonJS({ }); }); } - cp.on("error", (err) => { - state.processError = err.message; + cp.on("error", (err2) => { + state.processError = err2.message; state.processExited = true; state.processClosed = true; state.CheckComplete(); @@ -19657,7 +19657,7 @@ var require_core = __commonJS({ var file_command_1 = require_file_command(); var utils_1 = require_utils(); var os = __importStar(__require("os")); - var path = __importStar(__require("path")); + var path2 = __importStar(__require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { @@ -19667,8 +19667,8 @@ var require_core = __commonJS({ function exportVariable(name, val) { const convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; - const filePath = process.env["GITHUB_ENV"] || ""; - if (filePath) { + const filePath2 = process.env["GITHUB_ENV"] || ""; + if (filePath2) { return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, command_1.issueCommand)("set-env", { name }, convertedVal); @@ -19679,13 +19679,13 @@ var require_core = __commonJS({ } exports.setSecret = setSecret2; function addPath(inputPath) { - const filePath = process.env["GITHUB_PATH"] || ""; - if (filePath) { + const filePath2 = process.env["GITHUB_PATH"] || ""; + if (filePath2) { (0, file_command_1.issueFileCommand)("PATH", inputPath); } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path2.delimiter}${process.env["PATH"]}`; } exports.addPath = addPath; function getInput3(name, options) { @@ -19720,8 +19720,8 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } exports.getBooleanInput = getBooleanInput; function setOutput(name, value2) { - const filePath = process.env["GITHUB_OUTPUT"] || ""; - if (filePath) { + const filePath2 = process.env["GITHUB_OUTPUT"] || ""; + if (filePath2) { return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value2)); } process.stdout.write(os.EOL); @@ -19783,8 +19783,8 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } exports.group = group; function saveState(name, value2) { - const filePath = process.env["GITHUB_STATE"] || ""; - if (filePath) { + const filePath2 = process.env["GITHUB_STATE"] || ""; + if (filePath2) { return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value2)); } (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value2)); @@ -20234,8 +20234,8 @@ var init_parseUtil = __esm({ init_errors(); init_en(); makeIssue2 = (params) => { - const { data, path, errorMaps, issueData } = params; - const fullPath = [...path, ...issueData.path || []]; + const { data, path: path2, errorMaps, issueData } = params; + const fullPath = [...path2, ...issueData.path || []]; const fullIssue = { ...issueData, path: fullPath @@ -20543,11 +20543,11 @@ var init_types = __esm({ init_parseUtil(); init_util(); ParseInputLazyPath2 = class { - constructor(parent, value2, path, key) { + constructor(parent, value2, path2, key) { this._cachedPath = []; this.parent = parent; this.data = value2; - this._path = path; + this._path = path2; this._key = key; } get path() { @@ -20663,8 +20663,8 @@ var init_types = __esm({ } : { issues: ctx.common.issues }; - } catch (err) { - if (err?.message?.toLowerCase()?.includes("encountered")) { + } catch (err2) { + if (err2?.message?.toLowerCase()?.includes("encountered")) { this["~standard"].async = true; } ctx.common = { @@ -24004,9 +24004,9 @@ var require_uri_all2 = __commonJS({ _arr.push(_s.value); if (i && _arr.length === i) break; } - } catch (err) { + } catch (err2) { _d = true; - _e = err; + _e = err2; } finally { try { if (!_n && _i["return"]) _i["return"](); @@ -24199,9 +24199,9 @@ var require_uri_all2 = __commonJS({ output.push(stringFromCharCode(_currentValue2)); } } - } catch (err) { + } catch (err2) { _didIteratorError = true; - _iteratorError = err; + _iteratorError = err2; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { @@ -24230,9 +24230,9 @@ var require_uri_all2 = __commonJS({ m = currentValue; } } - } catch (err) { + } catch (err2) { _didIteratorError2 = true; - _iteratorError2 = err; + _iteratorError2 = err2; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { @@ -24282,9 +24282,9 @@ var require_uri_all2 = __commonJS({ ++handledCPCount; } } - } catch (err) { + } catch (err2) { _didIteratorError3 = true; - _iteratorError3 = err; + _iteratorError3 = err2; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return) { @@ -24451,7 +24451,7 @@ var require_uri_all2 = __commonJS({ } var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === void 0; - function parse4(uriString) { + function parse5(uriString) { var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; var components = {}; var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; @@ -24620,8 +24620,8 @@ var require_uri_all2 = __commonJS({ var skipNormalization = arguments[3]; var target = {}; if (!skipNormalization) { - base2 = parse4(serialize(base2, options), options); - relative = parse4(serialize(relative, options), options); + base2 = parse5(serialize(base2, options), options); + relative = parse5(serialize(relative, options), options); } options = options || {}; if (!options.tolerant && relative.scheme) { @@ -24672,24 +24672,24 @@ var require_uri_all2 = __commonJS({ } function resolve(baseURI, relativeURI, options) { var schemelessOptions = assign({ scheme: "null" }, options); - return serialize(resolveComponents(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); + return serialize(resolveComponents(parse5(baseURI, schemelessOptions), parse5(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); } function normalize2(uri, options) { if (typeof uri === "string") { - uri = serialize(parse4(uri, options), options); + uri = serialize(parse5(uri, options), options); } else if (typeOf(uri) === "object") { - uri = parse4(serialize(uri, options), options); + uri = parse5(serialize(uri, options), options); } return uri; } function equal(uriA, uriB, options) { if (typeof uriA === "string") { - uriA = serialize(parse4(uriA, options), options); + uriA = serialize(parse5(uriA, options), options); } else if (typeOf(uriA) === "object") { uriA = serialize(uriA, options); } if (typeof uriB === "string") { - uriB = serialize(parse4(uriB, options), options); + uriB = serialize(parse5(uriB, options), options); } else if (typeOf(uriB) === "object") { uriB = serialize(uriB, options); } @@ -24704,7 +24704,7 @@ var require_uri_all2 = __commonJS({ var handler2 = { scheme: "http", domainHost: true, - parse: function parse5(components, options) { + parse: function parse6(components, options) { if (!components.host) { components.error = components.error || "HTTP URIs must have a host."; } @@ -24733,7 +24733,7 @@ var require_uri_all2 = __commonJS({ var handler$2 = { scheme: "ws", domainHost: true, - parse: function parse5(components, options) { + parse: function parse6(components, options) { var wsComponents = components; wsComponents.secure = isSecure(wsComponents); wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : ""); @@ -24750,8 +24750,8 @@ var require_uri_all2 = __commonJS({ wsComponents.secure = void 0; } if (wsComponents.resourceName) { - var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path = _wsComponents$resourc2[0], query2 = _wsComponents$resourc2[1]; - wsComponents.path = path && path !== "/" ? path : void 0; + var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path2 = _wsComponents$resourc2[0], query2 = _wsComponents$resourc2[1]; + wsComponents.path = path2 && path2 !== "/" ? path2 : void 0; wsComponents.query = query2; wsComponents.resourceName = void 0; } @@ -24906,7 +24906,7 @@ var require_uri_all2 = __commonJS({ var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; var handler$6 = { scheme: "urn:uuid", - parse: function parse5(urnComponents, options) { + parse: function parse6(urnComponents, options) { var uuidComponents = urnComponents; uuidComponents.uuid = uuidComponents.nss; uuidComponents.nss = void 0; @@ -24931,7 +24931,7 @@ var require_uri_all2 = __commonJS({ exports2.SCHEMES = SCHEMES; exports2.pctEncChar = pctEncChar; exports2.pctDecChars = pctDecChars; - exports2.parse = parse4; + exports2.parse = parse5; exports2.removeDotSegments = removeDotSegments; exports2.serialize = serialize; exports2.resolveComponents = resolveComponents; @@ -25124,12 +25124,12 @@ var require_util9 = __commonJS({ return "'" + escapeQuotes(str) + "'"; } function getPathExpr(currentPath, expr, jsonPointers, isNumber2) { - var path = jsonPointers ? "'/' + " + expr + (isNumber2 ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber2 ? "'[' + " + expr + " + ']'" : "'[\\'' + " + expr + " + '\\']'"; - return joinPaths(currentPath, path); + var path2 = jsonPointers ? "'/' + " + expr + (isNumber2 ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber2 ? "'[' + " + expr + " + ']'" : "'[\\'' + " + expr + " + '\\']'"; + return joinPaths(currentPath, path2); } function getPath(currentPath, prop, jsonPointers) { - var path = jsonPointers ? toQuotedString("/" + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop)); - return joinPaths(currentPath, path); + var path2 = jsonPointers ? toQuotedString("/" + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop)); + return joinPaths(currentPath, path2); } var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; @@ -26357,7 +26357,7 @@ var require_formats2 = __commonJS({ var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; - var URL2 = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; + var URL3 = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/; var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; @@ -26377,7 +26377,7 @@ var require_formats2 = __commonJS({ uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, "uri-template": URITEMPLATE, - url: URL2, + url: URL3, // email (sources from jsen validator): // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') @@ -26404,7 +26404,7 @@ var require_formats2 = __commonJS({ uri, "uri-reference": URIREF, "uri-template": URITEMPLATE, - url: URL2, + url: URL3, email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, hostname: HOSTNAME, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, @@ -31218,14 +31218,14 @@ var require_util11 = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`; - let path = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path2 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path && path[0] !== "/") { - path = `/${path}`; + if (path2 && path2[0] !== "/") { + path2 = `/${path2}`; } - return new URL(`${origin}${path}`); + return new URL(`${origin}${path2}`); } if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -31285,7 +31285,7 @@ var require_util11 = __commonJS({ function isDestroyed(body) { return body && !!(body.destroyed || body[kDestroyed] || stream.isDestroyed?.(body)); } - function destroy(stream2, err) { + function destroy(stream2, err2) { if (stream2 == null || !isStream(stream2) || isDestroyed(stream2)) { return; } @@ -31293,10 +31293,10 @@ var require_util11 = __commonJS({ if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) { stream2.socket = null; } - stream2.destroy(err); - } else if (err) { + stream2.destroy(err2); + } else if (err2) { queueMicrotask(() => { - stream2.emit("error", err); + stream2.emit("error", err2); }); } if (stream2.destroyed !== true) { @@ -31528,12 +31528,12 @@ var require_util11 = __commonJS({ } return obj; } - function errorRequest(client, request2, err) { + function errorRequest(client, request2, err2) { try { - request2.onError(err); + request2.onError(err2); assert2(request2.aborted); - } catch (err2) { - client.emit("error", err2); + } catch (err3) { + client.emit("error", err3); } } var setupConnectTimeout = process.platform === "win32" ? (socketWeakRef, opts) => { @@ -31786,9 +31786,9 @@ var require_diagnostics = __commonJS({ "undici:client:sendHeaders", (evt) => { const { - request: { method, path, origin } + request: { method, path: path2, origin } } = evt; - debugLog("sending request to %s %s%s", method, origin, path); + debugLog("sending request to %s %s%s", method, origin, path2); } ); } @@ -31802,14 +31802,14 @@ var require_diagnostics = __commonJS({ "undici:request:headers", (evt) => { const { - request: { method, path, origin }, + request: { method, path: path2, origin }, response: { statusCode } } = evt; debugLog( "received response to %s %s%s - HTTP %d", method, origin, - path, + path2, statusCode ); } @@ -31818,23 +31818,23 @@ var require_diagnostics = __commonJS({ "undici:request:trailers", (evt) => { const { - request: { method, path, origin } + request: { method, path: path2, origin } } = evt; - debugLog("trailers received from %s %s%s", method, origin, path); + debugLog("trailers received from %s %s%s", method, origin, path2); } ); diagnosticsChannel.subscribe( "undici:request:error", (evt) => { const { - request: { method, path, origin }, + request: { method, path: path2, origin }, error: error41 } = evt; debugLog( "request to %s %s%s errored - %s", method, origin, - path, + path2, error41.message ); } @@ -31869,8 +31869,8 @@ var require_diagnostics = __commonJS({ ); diagnosticsChannel.subscribe( "undici:websocket:socket_error", - (err) => { - debugLog("connection errored - %s", err.message); + (err2) => { + debugLog("connection errored - %s", err2.message); } ); diagnosticsChannel.subscribe( @@ -31930,7 +31930,7 @@ var require_request3 = __commonJS({ var kHandler = Symbol("handler"); var Request2 = class { constructor(origin, { - path, + path: path2, method, body, headers, @@ -31946,11 +31946,11 @@ var require_request3 = __commonJS({ throwOnError, maxRedirections }, handler2) { - if (typeof path !== "string") { + if (typeof path2 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") { + } else if (path2[0] !== "/" && !(path2.startsWith("http://") || path2.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path)) { + } else if (invalidPathRegex.test(path2)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -31994,11 +31994,11 @@ var require_request3 = __commonJS({ }; this.body.on("end", this.endHandler); } - this.errorHandler = (err) => { + this.errorHandler = (err2) => { if (this.abort) { - this.abort(err); + this.abort(err2); } else { - this.error = err; + this.error = err2; } }; this.body.on("error", this.errorHandler); @@ -32018,7 +32018,7 @@ var require_request3 = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query2 ? serializePathWithQuery(path, query2) : path; + this.path = query2 ? serializePathWithQuery(path2, query2) : path2; this.origin = origin; this.protocol = getProtocolFromUrlString(origin); this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; @@ -32067,8 +32067,8 @@ var require_request3 = __commonJS({ if (this[kHandler].onBodySent) { try { return this[kHandler].onBodySent(chunk); - } catch (err) { - this.abort(err); + } catch (err2) { + this.abort(err2); } } } @@ -32079,8 +32079,8 @@ var require_request3 = __commonJS({ if (this[kHandler].onRequestSent) { try { return this[kHandler].onRequestSent(); - } catch (err) { - this.abort(err); + } catch (err2) { + this.abort(err2); } } } @@ -32105,8 +32105,8 @@ var require_request3 = __commonJS({ } try { return this[kHandler].onHeaders(statusCode, headers, resume, statusText); - } catch (err) { - this.abort(err); + } catch (err2) { + this.abort(err2); } } onData(chunk) { @@ -32117,8 +32117,8 @@ var require_request3 = __commonJS({ } try { return this[kHandler].onData(chunk); - } catch (err) { - this.abort(err); + } catch (err2) { + this.abort(err2); return false; } } @@ -32137,8 +32137,8 @@ var require_request3 = __commonJS({ } try { return this[kHandler].onComplete(trailers); - } catch (err) { - this.onError(err); + } catch (err2) { + this.onError(err2); } } onError(error41) { @@ -32268,11 +32268,11 @@ var require_wrap_handler = __commonJS({ onComplete(trailers) { return this.#handler.onComplete?.(trailers); } - onError(err) { + onError(err2) { if (!this.#handler.onError) { - throw err; + throw err2; } - return this.#handler.onError?.(err); + return this.#handler.onError?.(err2); } // Wrap Interface onRequestStart(controller, context) { @@ -32306,11 +32306,11 @@ var require_wrap_handler = __commonJS({ } this.#handler.onComplete?.(rawTrailers); } - onResponseError(controller, err) { + onResponseError(controller, err2) { if (!this.#handler.onError) { throw new InvalidArgumentError("invalid onError method"); } - this.#handler.onError?.(err); + this.#handler.onError?.(err2); } }; } @@ -32428,11 +32428,11 @@ var require_unwrap_handler = __commonJS({ onComplete(rawTrailers) { this.#handler.onResponseEnd?.(this.#controller, parseHeaders(rawTrailers)); } - onError(err) { + onError(err2) { if (!this.#handler.onResponseError) { throw new InvalidArgumentError("invalid onError method"); } - this.#handler.onResponseError?.(this.#controller, err); + this.#handler.onResponseError?.(this.#controller, err2); } }; } @@ -32472,8 +32472,8 @@ var require_dispatcher_base2 = __commonJS({ close(callback) { if (callback === void 0) { return new Promise((resolve, reject) => { - this.close((err, data) => { - return err ? reject(err) : resolve(data); + this.close((err2, data) => { + return err2 ? reject(err2) : resolve(data); }); }); } @@ -32505,17 +32505,17 @@ var require_dispatcher_base2 = __commonJS({ queueMicrotask(onClosed); }); } - destroy(err, callback) { - if (typeof err === "function") { - callback = err; - err = null; + destroy(err2, callback) { + if (typeof err2 === "function") { + callback = err2; + err2 = null; } if (callback === void 0) { return new Promise((resolve, reject) => { - this.destroy(err, (err2, data) => { - return err2 ? ( + this.destroy(err2, (err3, data) => { + return err3 ? ( /* istanbul ignore next: should never error */ - reject(err2) + reject(err3) ) : resolve(data); }); }); @@ -32531,8 +32531,8 @@ var require_dispatcher_base2 = __commonJS({ } return; } - if (!err) { - err = new ClientDestroyedError(); + if (!err2) { + err2 = new ClientDestroyedError(); } this[kDestroyed] = true; this[kOnDestroyed] = this[kOnDestroyed] || []; @@ -32544,7 +32544,7 @@ var require_dispatcher_base2 = __commonJS({ callbacks[i](null, null); } }; - this[kDestroy](err).then(() => { + this[kDestroy](err2).then(() => { queueMicrotask(onDestroyed); }); } @@ -32564,11 +32564,11 @@ var require_dispatcher_base2 = __commonJS({ throw new ClientClosedError(); } return this[kDispatch](opts, handler2); - } catch (err) { + } catch (err2) { if (typeof handler2.onError !== "function") { - throw err; + throw err2; } - handler2.onError(err); + handler2.onError(err2); return false; } } @@ -32671,12 +32671,12 @@ var require_connect2 = __commonJS({ callback = null; cb(null, this); } - }).on("error", function(err) { + }).on("error", function(err2) { queueMicrotask(clearConnectTimeout); if (callback) { const cb = callback; callback = null; - cb(err); + cb(err2); } }); return socket; @@ -34007,18 +34007,18 @@ var require_webidl2 = __commonJS({ }; webidl.brandCheck = function(V, I) { if (!FunctionPrototypeSymbolHasInstance(I, V)) { - const err = new TypeError("Illegal invocation"); - err.code = "ERR_INVALID_THIS"; - throw err; + const err2 = new TypeError("Illegal invocation"); + err2.code = "ERR_INVALID_THIS"; + throw err2; } }; webidl.brandCheckMultiple = function(List) { const prototypes = List.map((c) => webidl.util.MakeTypeAssertion(c)); return (V) => { if (prototypes.every((typeCheck) => !typeCheck(V))) { - const err = new TypeError("Illegal invocation"); - err.code = "ERR_INVALID_THIS"; - throw err; + const err2 = new TypeError("Illegal invocation"); + err2.code = "ERR_INVALID_THIS"; + throw err2; } }; }; @@ -35028,9 +35028,9 @@ var require_util12 = __commonJS({ try { controller.close(); controller.byobRequest?.respond(0); - } catch (err) { - if (!err.message.includes("Controller is already closed") && !err.message.includes("ReadableStream is already closed")) { - throw err; + } catch (err2) { + if (!err2.message.includes("Controller is already closed") && !err2.message.includes("ReadableStream is already closed")) { + throw err2; } } } @@ -35169,7 +35169,7 @@ var require_util12 = __commonJS({ this._inflateStream = (chunk[0] & 15) === 8 ? zlib.createInflate(this.#zlibOptions) : zlib.createInflateRaw(this.#zlibOptions); this._inflateStream.on("data", this.push.bind(this)); this._inflateStream.on("end", () => this.push(null)); - this._inflateStream.on("error", (err) => this.destroy(err)); + this._inflateStream.on("error", (err2) => this.destroy(err2)); } this._inflateStream.write(chunk, encoding, callback); } @@ -36370,8 +36370,8 @@ var require_client_h1 = __commonJS({ throw new HTTPParserError(message, constants.ERROR[ret], data); } } - } catch (err) { - util3.destroy(socket, err); + } catch (err2) { + util3.destroy(socket, err2); } } destroy() { @@ -36487,8 +36487,8 @@ var require_client_h1 = __commonJS({ client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade")); try { request2.onUpgrade(statusCode, headers, socket); - } catch (err) { - util3.destroy(socket, err); + } catch (err2) { + util3.destroy(socket, err2); } client[kResume](); } @@ -36705,12 +36705,12 @@ var require_client_h1 = __commonJS({ * @param {Error|undefined} err * @param {() => void} callback */ - destroy(err, callback) { + destroy(err2, callback) { if (socket[kClosed]) { queueMicrotask(callback); } else { socket.on("close", callback); - socket.destroy(err); + socket.destroy(err2); } }, /** @@ -36742,15 +36742,15 @@ var require_client_h1 = __commonJS({ } }; } - function onHttpSocketError(err) { - assert2(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + function onHttpSocketError(err2) { + assert2(err2.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); const parser = this[kParser]; - if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { + if (err2.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { parser.onMessageComplete(); return; } - this[kError] = err; - this[kClient][kOnError](err); + this[kError] = err2; + this[kClient][kOnError](err2); } function onHttpSocketReadable() { this[kParser]?.readMore(); @@ -36772,7 +36772,7 @@ var require_client_h1 = __commonJS({ this[kParser].destroy(); this[kParser] = null; } - const err = this[kError] || new SocketError("closed", util3.getSocketInfo(this)); + const err2 = this[kError] || new SocketError("closed", util3.getSocketInfo(this)); const client = this[kClient]; client[kSocket] = null; client[kHTTPContext] = null; @@ -36781,16 +36781,16 @@ var require_client_h1 = __commonJS({ const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - util3.errorRequest(client, request2, err); + util3.errorRequest(client, request2, err2); } - } else if (client[kRunning] > 0 && err.code !== "UND_ERR_INFO") { + } else if (client[kRunning] > 0 && err2.code !== "UND_ERR_INFO") { const request2 = client[kQueue][client[kRunningIdx]]; client[kQueue][client[kRunningIdx]++] = null; - util3.errorRequest(client, request2, err); + util3.errorRequest(client, request2, err2); } client[kPendingIdx] = client[kRunningIdx]; assert2(client[kRunning] === 0); - client.emit("disconnect", client[kUrl], [client], err); + client.emit("disconnect", client[kUrl], [client], err2); client[kResume](); } function onSocketClose() { @@ -36825,7 +36825,7 @@ var require_client_h1 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path, host, upgrade, blocking, reset } = request2; + const { method, path: path2, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util3.isFormDataLike(body)) { @@ -36860,18 +36860,18 @@ var require_client_h1 = __commonJS({ process.emitWarning(new RequestContentLengthMismatchError()); } const socket = client[kSocket]; - const abort = (err) => { + const abort = (err2) => { if (request2.aborted || request2.completed) { return; } - util3.errorRequest(client, request2, err || new RequestAbortedError()); + util3.errorRequest(client, request2, err2 || new RequestAbortedError()); util3.destroy(body); util3.destroy(socket, new InformationalError("aborted")); }; try { request2.onConnect(abort); - } catch (err) { - util3.errorRequest(client, request2, err); + } catch (err2) { + util3.errorRequest(client, request2, err2); } if (request2.aborted) { return false; @@ -36891,7 +36891,7 @@ var require_client_h1 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path} HTTP/1.1\r + let header = `${method} ${path2} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -36957,8 +36957,8 @@ upgrade: ${upgrade}\r if (!writer.write(chunk) && this.pause) { this.pause(); } - } catch (err) { - util3.destroy(this, err); + } catch (err2) { + util3.destroy(this, err2); } }; const onDrain = function() { @@ -36974,11 +36974,11 @@ upgrade: ${upgrade}\r body.removeListener("error", onFinished); }); if (!finished) { - const err = new RequestAbortedError(); - queueMicrotask(() => onFinished(err)); + const err2 = new RequestAbortedError(); + queueMicrotask(() => onFinished(err2)); } }; - const onFinished = function(err) { + const onFinished = function(err2) { if (finished) { return; } @@ -36986,16 +36986,16 @@ upgrade: ${upgrade}\r assert2(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); socket.off("drain", onDrain).off("error", onFinished); body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose); - if (!err) { + if (!err2) { try { writer.end(); } catch (er) { - err = er; + err2 = er; } } - writer.destroy(err); - if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { - util3.destroy(body, err); + writer.destroy(err2); + if (err2 && (err2.code !== "UND_ERR_INFO" || err2.message !== "reset")) { + util3.destroy(body, err2); } else { util3.destroy(body); } @@ -37041,8 +37041,8 @@ upgrade: ${upgrade}\r } request2.onRequestSent(); client[kResume](); - } catch (err) { - abort(err); + } catch (err2) { + abort(err2); } } async function writeBlob(abort, body, client, request2, socket, contentLength, header, expectsPayload) { @@ -37064,8 +37064,8 @@ upgrade: ${upgrade}\r socket[kReset] = true; } client[kResume](); - } catch (err) { - abort(err); + } catch (err2) { + abort(err2); } } async function writeIterable(abort, body, client, request2, socket, contentLength, header, expectsPayload) { @@ -37098,8 +37098,8 @@ upgrade: ${upgrade}\r } } writer.end(); - } catch (err) { - writer.destroy(err); + } catch (err2) { + writer.destroy(err2); } finally { socket.off("close", onDrain).off("drain", onDrain); } @@ -37224,12 +37224,12 @@ ${len.toString(16)}\r * @param {Error} [err] * @returns {void} */ - destroy(err) { + destroy(err2) { const { socket, client, abort } = this; socket[kWriting] = false; - if (err) { + if (err2) { assert2(client[kRunning] <= 1, "pipeline should only contain this request"); - abort(err); + abort(err2); } } }; @@ -37340,11 +37340,11 @@ var require_client_h2 = __commonJS({ resume() { resumeH2(client); }, - destroy(err, callback) { + destroy(err2, callback) { if (socket[kClosed]) { queueMicrotask(callback); } else { - socket.destroy(err).on("close", callback); + socket.destroy(err2).on("close", callback); } }, get destroyed() { @@ -37367,46 +37367,46 @@ var require_client_h2 = __commonJS({ } } } - function onHttp2SessionError(err) { - assert2(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); - this[kSocket][kError] = err; - this[kClient][kOnError](err); + function onHttp2SessionError(err2) { + assert2(err2.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + this[kSocket][kError] = err2; + this[kClient][kOnError](err2); } function onHttp2FrameError(type2, code, id) { if (id === 0) { - const err = new InformationalError(`HTTP/2: "frameError" received - type ${type2}, code ${code}`); - this[kSocket][kError] = err; - this[kClient][kOnError](err); + const err2 = new InformationalError(`HTTP/2: "frameError" received - type ${type2}, code ${code}`); + this[kSocket][kError] = err2; + this[kClient][kOnError](err2); } } function onHttp2SessionEnd() { - const err = new SocketError("other side closed", util3.getSocketInfo(this[kSocket])); - this.destroy(err); - util3.destroy(this[kSocket], err); + const err2 = new SocketError("other side closed", util3.getSocketInfo(this[kSocket])); + this.destroy(err2); + util3.destroy(this[kSocket], err2); } function onHttp2SessionGoAway(errorCode) { - const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${errorCode}`, util3.getSocketInfo(this[kSocket])); + const err2 = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${errorCode}`, util3.getSocketInfo(this[kSocket])); const client = this[kClient]; client[kSocket] = null; client[kHTTPContext] = null; this.close(); this[kHTTP2Session] = null; - util3.destroy(this[kSocket], err); + util3.destroy(this[kSocket], err2); if (client[kRunningIdx] < client[kQueue].length) { const request2 = client[kQueue][client[kRunningIdx]]; client[kQueue][client[kRunningIdx]++] = null; - util3.errorRequest(client, request2, err); + util3.errorRequest(client, request2, err2); client[kPendingIdx] = client[kRunningIdx]; } assert2(client[kRunning] === 0); - client.emit("disconnect", client[kUrl], [client], err); - client.emit("connectionError", client[kUrl], [client], err); + client.emit("disconnect", client[kUrl], [client], err2); + client.emit("connectionError", client[kUrl], [client], err2); client[kResume](); } function onHttp2SessionClose() { const { [kClient]: client } = this; const { [kSocket]: socket } = client; - const err = this[kSocket][kError] || this[kError] || new SocketError("closed", util3.getSocketInfo(socket)); + const err2 = this[kSocket][kError] || this[kError] || new SocketError("closed", util3.getSocketInfo(socket)); client[kSocket] = null; client[kHTTPContext] = null; if (client.destroyed) { @@ -37414,27 +37414,27 @@ var require_client_h2 = __commonJS({ const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - util3.errorRequest(client, request2, err); + util3.errorRequest(client, request2, err2); } } } function onHttp2SocketClose() { - const err = this[kError] || new SocketError("closed", util3.getSocketInfo(this)); + const err2 = this[kError] || new SocketError("closed", util3.getSocketInfo(this)); const client = this[kHTTP2Session][kClient]; client[kSocket] = null; client[kHTTPContext] = null; if (this[kHTTP2Session] !== null) { - this[kHTTP2Session].destroy(err); + this[kHTTP2Session].destroy(err2); } client[kPendingIdx] = client[kRunningIdx]; assert2(client[kRunning] === 0); - client.emit("disconnect", client[kUrl], [client], err); + client.emit("disconnect", client[kUrl], [client], err2); client[kResume](); } - function onHttp2SocketError(err) { - assert2(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); - this[kError] = err; - this[kClient][kOnError](err); + function onHttp2SocketError(err2) { + assert2(err2.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + this[kError] = err2; + this[kClient][kOnError](err2); } function onHttp2SocketEnd() { util3.destroy(this, new SocketError("other side closed", util3.getSocketInfo(this))); @@ -37448,7 +37448,7 @@ var require_client_h2 = __commonJS({ function writeH2(client, request2) { const requestTimeout = request2.bodyTimeout ?? client[kBodyTimeout]; const session = client[kHTTP2Session]; - const { method, path, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request2; + const { method, path: path2, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { util3.errorRequest(client, request2, new Error("Upgrade not supported for H2")); @@ -37484,24 +37484,24 @@ var require_client_h2 = __commonJS({ const { hostname: hostname2, port } = client[kUrl]; headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname2}${port ? `:${port}` : ""}`; headers[HTTP2_HEADER_METHOD] = method; - const abort = (err) => { + const abort = (err2) => { if (request2.aborted || request2.completed) { return; } - err = err || new RequestAbortedError(); - util3.errorRequest(client, request2, err); + err2 = err2 || new RequestAbortedError(); + util3.errorRequest(client, request2, err2); if (stream != null) { stream.removeAllListeners("data"); stream.close(); - client[kOnError](err); + client[kOnError](err2); client[kResume](); } - util3.destroy(body, err); + util3.destroy(body, err2); }; try { request2.onConnect(abort); - } catch (err) { - util3.errorRequest(client, request2, err); + } catch (err2) { + util3.errorRequest(client, request2, err2); } if (request2.aborted) { return false; @@ -37527,7 +37527,7 @@ var require_client_h2 = __commonJS({ stream.setTimeout(requestTimeout); return true; } - headers[HTTP2_HEADER_PATH] = path; + headers[HTTP2_HEADER_PATH] = path2; headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -37597,7 +37597,7 @@ var require_client_h2 = __commonJS({ stream.pause(); } }); - stream.once("end", (err) => { + stream.once("end", (err2) => { stream.removeAllListeners("data"); if (stream.state?.state == null || stream.state.state < 6) { if (!request2.aborted && !request2.completed) { @@ -37610,7 +37610,7 @@ var require_client_h2 = __commonJS({ if (session[kOpenStreams] === 0) { session.unref(); } - abort(err ?? new InformationalError("HTTP/2: stream half-closed (remote)")); + abort(err2 ?? new InformationalError("HTTP/2: stream half-closed (remote)")); client[kQueue][client[kRunningIdx]++] = null; client[kPendingIdx] = client[kRunningIdx]; client[kResume](); @@ -37623,9 +37623,9 @@ var require_client_h2 = __commonJS({ session.unref(); } }); - stream.once("error", function(err) { + stream.once("error", function(err2) { stream.removeAllListeners("data"); - abort(err); + abort(err2); }); stream.once("frameError", (type2, code) => { stream.removeAllListeners("data"); @@ -37635,13 +37635,13 @@ var require_client_h2 = __commonJS({ stream.removeAllListeners("data"); }); stream.on("timeout", () => { - const err = new InformationalError(`HTTP/2: "stream timeout after ${requestTimeout}"`); + const err2 = new InformationalError(`HTTP/2: "stream timeout after ${requestTimeout}"`); stream.removeAllListeners("data"); session[kOpenStreams] -= 1; if (session[kOpenStreams] === 0) { session.unref(); } - abort(err); + abort(err2); }); stream.once("trailers", (trailers) => { if (request2.aborted || request2.completed) { @@ -37748,10 +37748,10 @@ var require_client_h2 = __commonJS({ const pipe = pipeline2( body, h2stream, - (err) => { - if (err) { - util3.destroy(pipe, err); - abort(err); + (err2) => { + if (err2) { + util3.destroy(pipe, err2); + abort(err2); } else { util3.removeAllListeners(pipe); request2.onRequestSent(); @@ -37784,8 +37784,8 @@ var require_client_h2 = __commonJS({ socket[kReset] = true; } client[kResume](); - } catch (err) { - abort(err); + } catch (err2) { + abort(err2); } } async function writeIterable(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) { @@ -37824,8 +37824,8 @@ var require_client_h2 = __commonJS({ socket[kReset] = true; } client[kResume](); - } catch (err) { - abort(err); + } catch (err2) { + abort(err2); } finally { h2stream.off("close", onDrain).off("drain", onDrain); } @@ -38039,7 +38039,7 @@ var require_client2 = __commonJS({ this[kRunningIdx] = 0; this[kPendingIdx] = 0; this[kResume] = (sync) => resume(this, sync); - this[kOnError] = (err) => onError(this, err); + this[kOnError] = (err2) => onError(this, err2); } get pipelining() { return this[kPipelining]; @@ -38097,12 +38097,12 @@ var require_client2 = __commonJS({ } }); } - [kDestroy](err) { + [kDestroy](err2) { return new Promise((resolve) => { const requests = this[kQueue].splice(this[kPendingIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - util3.errorRequest(this, request2, err); + util3.errorRequest(this, request2, err2); } const callback = () => { if (this[kClosedResolve]) { @@ -38112,7 +38112,7 @@ var require_client2 = __commonJS({ resolve(null); }; if (this[kHTTPContext]) { - this[kHTTPContext].destroy(err, callback); + this[kHTTPContext].destroy(err2, callback); this[kHTTPContext] = null; } else { queueMicrotask(callback); @@ -38121,13 +38121,13 @@ var require_client2 = __commonJS({ }); } }; - function onError(client, err) { - if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { + function onError(client, err2) { + if (client[kRunning] === 0 && err2.code !== "UND_ERR_INFO" && err2.code !== "UND_ERR_SOCKET") { assert2(client[kPendingIdx] === client[kRunningIdx]); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - util3.errorRequest(client, request2, err); + util3.errorRequest(client, request2, err2); } assert2(client[kSize] === 0); } @@ -38165,9 +38165,9 @@ var require_client2 = __commonJS({ port, servername: client[kServerName], localAddress: client[kLocalAddress] - }, (err, socket) => { - if (err) { - handleConnectError(client, err, { host, hostname: hostname2, protocol, port }); + }, (err2, socket) => { + if (err2) { + handleConnectError(client, err2, { host, hostname: hostname2, protocol, port }); client[kResume](); return; } @@ -38179,9 +38179,9 @@ var require_client2 = __commonJS({ assert2(socket); try { client[kHTTPContext] = socket.alpnProtocol === "h2" ? connectH2(client, socket) : connectH1(client, socket); - } catch (err2) { + } catch (err3) { socket.destroy().on("error", noop3); - handleConnectError(client, err2, { host, hostname: hostname2, protocol, port }); + handleConnectError(client, err3, { host, hostname: hostname2, protocol, port }); client[kResume](); return; } @@ -38209,7 +38209,7 @@ var require_client2 = __commonJS({ client[kResume](); }); } - function handleConnectError(client, err, { host, hostname: hostname2, protocol, port }) { + function handleConnectError(client, err2, { host, hostname: hostname2, protocol, port }) { if (client.destroyed) { return; } @@ -38226,19 +38226,19 @@ var require_client2 = __commonJS({ localAddress: client[kLocalAddress] }, connector: client[kConnector], - error: err + error: err2 }); } - if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { + if (err2.code === "ERR_TLS_CERT_ALTNAME_INVALID") { assert2(client[kRunning] === 0); while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { const request2 = client[kQueue][client[kPendingIdx]++]; - util3.errorRequest(client, request2, err); + util3.errorRequest(client, request2, err2); } } else { - onError(client, err); + onError(client, err2); } - client.emit("connectionError", client[kUrl], [client], err); + client.emit("connectionError", client[kUrl], [client], err2); } function emitDrain(client) { client[kNeedDrain] = 0; @@ -38445,11 +38445,11 @@ var require_pool_base2 = __commonJS({ [kOnConnect] = (origin, targets) => { this.emit("connect", origin, [this, ...targets]); }; - [kOnDisconnect] = (origin, targets, err) => { - this.emit("disconnect", origin, [this, ...targets], err); + [kOnDisconnect] = (origin, targets, err2) => { + this.emit("disconnect", origin, [this, ...targets], err2); }; - [kOnConnectionError] = (origin, targets, err) => { - this.emit("connectionError", origin, [this, ...targets], err); + [kOnConnectionError] = (origin, targets, err2) => { + this.emit("connectionError", origin, [this, ...targets], err2); }; get [kBusy]() { return this[kNeedDrain]; @@ -38505,17 +38505,17 @@ var require_pool_base2 = __commonJS({ }); } } - [kDestroy](err) { + [kDestroy](err2) { while (true) { const item = this[kQueue].shift(); if (!item) { break; } - item.handler.onError(err); + item.handler.onError(err2); } const destroyAll = new Array(this[kClients].length); for (let i = 0; i < this[kClients].length; i++) { - destroyAll[i] = this[kClients][i].destroy(err); + destroyAll[i] = this[kClients][i].destroy(err2); } return Promise.all(destroyAll); } @@ -38740,8 +38740,8 @@ var require_balanced_pool2 = __commonJS({ this._updateBalancedPoolStats(); }); pool.on("disconnect", (...args2) => { - const err = args2[2]; - if (err && err.code === "UND_ERR_SOCKET") { + const err2 = args2[2]; + if (err2 && err2.code === "UND_ERR_SOCKET") { pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); this._updateBalancedPoolStats(); } @@ -38854,11 +38854,11 @@ var require_agent2 = __commonJS({ this[kOnConnect] = (origin, targets) => { this.emit("connect", origin, [this, ...targets]); }; - this[kOnDisconnect] = (origin, targets, err) => { - this.emit("disconnect", origin, [this, ...targets], err); + this[kOnDisconnect] = (origin, targets, err2) => { + this.emit("disconnect", origin, [this, ...targets], err2); }; - this[kOnConnectionError] = (origin, targets, err) => { - this.emit("connectionError", origin, [this, ...targets], err); + this[kOnConnectionError] = (origin, targets, err2) => { + this.emit("connectionError", origin, [this, ...targets], err2); }; } get [kRunning]() { @@ -38898,12 +38898,12 @@ var require_agent2 = __commonJS({ result2.count += 1; } this[kOnConnect](origin, targets); - }).on("disconnect", (origin, targets, err) => { + }).on("disconnect", (origin, targets, err2) => { closeClientIfUnused(true); - this[kOnDisconnect](origin, targets, err); - }).on("connectionError", (origin, targets, err) => { + this[kOnDisconnect](origin, targets, err2); + }).on("connectionError", (origin, targets, err2) => { closeClientIfUnused(false); - this[kOnConnectionError](origin, targets, err); + this[kOnConnectionError](origin, targets, err2); }); this[kClients].set(key, { count: 0, dispatcher }); this[kOrigins].add(key); @@ -38918,10 +38918,10 @@ var require_agent2 = __commonJS({ this[kClients].clear(); return Promise.all(closePromises); } - [kDestroy](err) { + [kDestroy](err2) { const destroyPromises = []; for (const { dispatcher } of this[kClients].values()) { - destroyPromises.push(dispatcher.destroy(err)); + destroyPromises.push(dispatcher.destroy(err2)); } this[kClients].clear(); return Promise.all(destroyPromises); @@ -38999,10 +38999,10 @@ var require_proxy_agent2 = __commonJS({ }; const { origin, - path = "/", + path: path2 = "/", headers = {} } = opts; - opts.path = origin + path; + opts.path = origin + path2; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL(origin); headers.host = host; @@ -39013,8 +39013,8 @@ var require_proxy_agent2 = __commonJS({ [kClose]() { return this.#client.close(); } - [kDestroy](err) { - return this.#client.destroy(err); + [kDestroy](err2) { + return this.#client.destroy(err2); } }; var ProxyAgent = class extends DispatcherBase { @@ -39095,11 +39095,11 @@ var require_proxy_agent2 = __commonJS({ servername = opts2.servername; } this[kConnectEndpoint]({ ...opts2, servername, httpSocket: socket }, callback); - } catch (err) { - if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { - callback(new SecureProxyConnectionError(err)); + } catch (err2) { + if (err2.code === "ERR_TLS_CERT_ALTNAME_INVALID") { + callback(new SecureProxyConnectionError(err2)); } else { - callback(err); + callback(err2); } } } @@ -39213,11 +39213,11 @@ var require_env_http_proxy_agent = __commonJS({ !this[kHttpsProxyAgent][kClosed] && this[kHttpsProxyAgent].close() ]); } - [kDestroy](err) { + [kDestroy](err2) { return Promise.all([ - this[kNoProxyAgent].destroy(err), - !this[kHttpProxyAgent][kDestroyed] && this[kHttpProxyAgent].destroy(err), - !this[kHttpsProxyAgent][kDestroyed] && this[kHttpsProxyAgent].destroy(err) + this[kNoProxyAgent].destroy(err2), + !this[kHttpProxyAgent][kDestroyed] && this[kHttpProxyAgent].destroy(err2), + !this[kHttpsProxyAgent][kDestroyed] && this[kHttpsProxyAgent].destroy(err2) ]); } #getProxyAgentForUrl(url2) { @@ -39363,13 +39363,13 @@ var require_retry_handler = __commonJS({ this.end = null; this.etag = null; } - onResponseStartWithRetry(controller, statusCode, headers, statusMessage, err) { + onResponseStartWithRetry(controller, statusCode, headers, statusMessage, err2) { if (this.retryOpts.throwOnError) { if (this.retryOpts.statusCodes.includes(statusCode) === false) { this.headersSent = true; this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage); } else { - this.error = err; + this.error = err2; } return; } @@ -39386,12 +39386,12 @@ var require_retry_handler = __commonJS({ controller.resume(); return; } - this.error = err; + this.error = err2; controller.resume(); } controller.pause(); this.retryOpts.retry( - err, + err2, { state: { counter: this.retryCount }, opts: { retryOptions: this.retryOpts, ...this.opts } @@ -39407,8 +39407,8 @@ var require_retry_handler = __commonJS({ onRequestUpgrade(controller, statusCode, headers, socket) { this.handler.onRequestUpgrade?.(controller, statusCode, headers, socket); } - static [kRetryHandlerDefaultRetry](err, { state, opts }, cb) { - const { statusCode, code, headers } = err; + static [kRetryHandlerDefaultRetry](err2, { state, opts }, cb) { + const { statusCode, code, headers } = err2; const { method, retryOptions } = opts; const { maxRetries, @@ -39421,19 +39421,19 @@ var require_retry_handler = __commonJS({ } = retryOptions; const { counter } = state; if (code && code !== "UND_ERR_REQ_RETRY" && !errorCodes.includes(code)) { - cb(err); + cb(err2); return; } if (Array.isArray(methods) && !methods.includes(method)) { - cb(err); + cb(err2); return; } if (statusCode != null && Array.isArray(statusCodes) && !statusCodes.includes(statusCode)) { - cb(err); + cb(err2); return; } if (counter > maxRetries) { - cb(err); + cb(err2); return; } let retryAfterHeader = headers?.["retry-after"]; @@ -39448,13 +39448,13 @@ var require_retry_handler = __commonJS({ this.error = null; this.retryCount += 1; if (statusCode >= 300) { - const err = new RequestRetryError("Request failed", statusCode, { + const err2 = new RequestRetryError("Request failed", statusCode, { headers, data: { count: this.retryCount } }); - this.onResponseStartWithRetry(controller, statusCode, headers, statusMessage, err); + this.onResponseStartWithRetry(controller, statusCode, headers, statusMessage, err2); return; } if (this.headersSent) { @@ -39566,13 +39566,13 @@ var require_retry_handler = __commonJS({ try { this.retryCountCheckpoint = this.retryCount; this.dispatch(this.opts, this); - } catch (err) { - this.handler.onResponseError?.(controller, err); + } catch (err2) { + this.handler.onResponseError?.(controller, err2); } } - onResponseError(controller, err) { + onResponseError(controller, err2) { if (controller?.aborted || isDisturbed(this.opts.body)) { - this.handler.onResponseError?.(controller, err); + this.handler.onResponseError?.(controller, err2); return; } function shouldRetry(returnedErr) { @@ -39588,7 +39588,7 @@ var require_retry_handler = __commonJS({ this.retryCount += 1; } this.retryOpts.retry( - err, + err2, { state: { counter: this.retryCount }, opts: { retryOptions: this.retryOpts, ...this.opts } @@ -39706,12 +39706,12 @@ var require_h2c_client = __commonJS({ callback = null; cb(null, this); } - }).on("error", function(err) { + }).on("error", function(err2) { queueMicrotask(clearConnectTimeout); if (callback) { const cb = callback; callback = null; - cb(err); + cb(err2); } }); return socket; @@ -39787,17 +39787,17 @@ var require_readable2 = __commonJS({ * @param {(error:(Error|null)) => void} callback * @returns {void} */ - _destroy(err, callback) { - if (!err && !this._readableState.endEmitted) { - err = new RequestAbortedError(); + _destroy(err2, callback) { + if (!err2 && !this._readableState.endEmitted) { + err2 = new RequestAbortedError(); } - if (err) { + if (err2) { this[kAbort](); } if (!this[kUsed]) { - setImmediate(callback, err); + setImmediate(callback, err2); } else { - callback(err); + callback(err2); } } /** @@ -40019,8 +40019,8 @@ var require_readable2 = __commonJS({ length: 0, body: [] }; - stream.on("error", function(err) { - consumeFinish(this[kConsume], err); + stream.on("error", function(err2) { + consumeFinish(this[kConsume], err2); }).on("close", function() { if (this[kConsume].body !== null) { consumeFinish(this[kConsume], new RequestAbortedError()); @@ -40102,20 +40102,20 @@ var require_readable2 = __commonJS({ resolve(chunksConcat(body, length)); } consumeFinish(consume2); - } catch (err) { - stream.destroy(err); + } catch (err2) { + stream.destroy(err2); } } function consumePush(consume2, chunk) { consume2.length += chunk.length; consume2.body.push(chunk); } - function consumeFinish(consume2, err) { + function consumeFinish(consume2, err2) { if (consume2.body === null) { return; } - if (err) { - consume2.reject(err); + if (err2) { + consume2.reject(err2); } else { consume2.resolve(); } @@ -40167,11 +40167,11 @@ var require_api_request2 = __commonJS({ throw new InvalidArgumentError("invalid onInfo callback"); } super("UNDICI_REQUEST"); - } catch (err) { + } catch (err2) { if (util3.isStream(body)) { - util3.destroy(body.on("error", noop3), err); + util3.destroy(body.on("error", noop3), err2); } - throw err; + throw err2; } this.method = method; this.responseHeaders = responseHeaders || null; @@ -40243,11 +40243,11 @@ var require_api_request2 = __commonJS({ body: res, context }); - } catch (err) { + } catch (err2) { this.res = null; - util3.destroy(res.on("error", noop3), err); + util3.destroy(res.on("error", noop3), err2); queueMicrotask(() => { - throw err; + throw err2; }); } } @@ -40259,25 +40259,25 @@ var require_api_request2 = __commonJS({ util3.parseHeaders(trailers, this.trailers); this.res.push(null); } - onError(err) { + onError(err2) { const { res, callback, body, opaque } = this; if (callback) { this.callback = null; queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); + this.runInAsyncScope(callback, null, err2, { opaque }); }); } if (res) { this.res = null; queueMicrotask(() => { - util3.destroy(res.on("error", noop3), err); + util3.destroy(res.on("error", noop3), err2); }); } if (body) { this.body = null; if (util3.isStream(body)) { body.on("error", noop3); - util3.destroy(body, err); + util3.destroy(body, err2); } } if (this.removeAbortListener) { @@ -40289,20 +40289,20 @@ var require_api_request2 = __commonJS({ function request2(opts, callback) { if (callback === void 0) { return new Promise((resolve, reject) => { - request2.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data); + request2.call(this, opts, (err2, data) => { + return err2 ? reject(err2) : resolve(data); }); }); } try { const handler2 = new RequestHandler(opts, callback); this.dispatch(opts, handler2); - } catch (err) { + } catch (err2) { if (typeof callback !== "function") { - throw err; + throw err2; } const opaque = opts?.opaque; - queueMicrotask(() => callback(err, { opaque })); + queueMicrotask(() => callback(err2, { opaque })); } } module.exports = request2; @@ -40397,11 +40397,11 @@ var require_api_stream2 = __commonJS({ throw new InvalidArgumentError("invalid onInfo callback"); } super("UNDICI_STREAM"); - } catch (err) { + } catch (err2) { if (util3.isStream(body)) { - util3.destroy(body.on("error", noop3), err); + util3.destroy(body.on("error", noop3), err2); } - throw err; + throw err2; } this.responseHeaders = responseHeaders || null; this.opaque = opaque || null; @@ -40414,8 +40414,8 @@ var require_api_stream2 = __commonJS({ this.body = body; this.onInfo = onInfo || null; if (util3.isStream(body)) { - body.on("error", (err) => { - this.onError(err); + body.on("error", (err2) => { + this.onError(err2); }); } addSignal(this, signal); @@ -40451,15 +40451,15 @@ var require_api_stream2 = __commonJS({ if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); } - finished(res, { readable: false }, (err) => { + finished(res, { readable: false }, (err2) => { const { callback, res: res2, opaque: opaque2, trailers, abort } = this; this.res = null; - if (err || !res2?.readable) { - util3.destroy(res2, err); + if (err2 || !res2?.readable) { + util3.destroy(res2, err2); } this.callback = null; - this.runInAsyncScope(callback, null, err || null, { opaque: opaque2, trailers }); - if (err) { + this.runInAsyncScope(callback, null, err2 || null, { opaque: opaque2, trailers }); + if (err2) { abort(); } }); @@ -40481,42 +40481,42 @@ var require_api_stream2 = __commonJS({ this.trailers = util3.parseHeaders(trailers); res.end(); } - onError(err) { + onError(err2) { const { res, callback, opaque, body } = this; removeSignal(this); this.factory = null; if (res) { this.res = null; - util3.destroy(res, err); + util3.destroy(res, err2); } else if (callback) { this.callback = null; queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); + this.runInAsyncScope(callback, null, err2, { opaque }); }); } if (body) { this.body = null; - util3.destroy(body, err); + util3.destroy(body, err2); } } }; function stream(opts, factory, callback) { if (callback === void 0) { return new Promise((resolve, reject) => { - stream.call(this, opts, factory, (err, data) => { - return err ? reject(err) : resolve(data); + stream.call(this, opts, factory, (err2, data) => { + return err2 ? reject(err2) : resolve(data); }); }); } try { const handler2 = new StreamHandler(opts, factory, callback); this.dispatch(opts, handler2); - } catch (err) { + } catch (err2) { if (typeof callback !== "function") { - throw err; + throw err2; } const opaque = opts?.opaque; - queueMicrotask(() => callback(err, { opaque })); + queueMicrotask(() => callback(err2, { opaque })); } } module.exports = stream; @@ -40556,9 +40556,9 @@ var require_api_pipeline2 = __commonJS({ resume(); } } - _destroy(err, callback) { + _destroy(err2, callback) { this._read(); - callback(err); + callback(err2); } }; var PipelineResponse = class extends Readable { @@ -40569,11 +40569,11 @@ var require_api_pipeline2 = __commonJS({ _read() { this[kResume](); } - _destroy(err, callback) { - if (!err && !this._readableState.endEmitted) { - err = new RequestAbortedError(); + _destroy(err2, callback) { + if (!err2 && !this._readableState.endEmitted) { + err2 = new RequestAbortedError(); } - callback(err); + callback(err2); } }; var PipelineHandler = class extends AsyncResource { @@ -40619,19 +40619,19 @@ var require_api_pipeline2 = __commonJS({ req[kResume] = callback; } }, - destroy: (err, callback) => { + destroy: (err2, callback) => { const { body, req, res, ret, abort } = this; - if (!err && !ret._readableState.endEmitted) { - err = new RequestAbortedError(); + if (!err2 && !ret._readableState.endEmitted) { + err2 = new RequestAbortedError(); } - if (abort && err) { + if (abort && err2) { abort(); } - util3.destroy(body, err); - util3.destroy(req, err); - util3.destroy(res, err); + util3.destroy(body, err2); + util3.destroy(req, err2); + util3.destroy(res, err2); removeSignal(this); - callback(err); + callback(err2); } }).on("prefinish", () => { const { req } = this; @@ -40671,9 +40671,9 @@ var require_api_pipeline2 = __commonJS({ body: this.res, context }); - } catch (err) { + } catch (err2) { this.res.on("error", noop3); - throw err; + throw err2; } if (!body || typeof body.on !== "function") { throw new InvalidReturnValueError("expected Readable"); @@ -40683,9 +40683,9 @@ var require_api_pipeline2 = __commonJS({ if (!ret.push(chunk) && body2.pause) { body2.pause(); } - }).on("error", (err) => { + }).on("error", (err2) => { const { ret } = this; - util3.destroy(ret, err); + util3.destroy(ret, err2); }).on("end", () => { const { ret } = this; ret.push(null); @@ -40705,10 +40705,10 @@ var require_api_pipeline2 = __commonJS({ const { res } = this; res.push(null); } - onError(err) { + onError(err2) { const { ret } = this; this.handler = null; - util3.destroy(ret, err); + util3.destroy(ret, err2); } }; function pipeline2(opts, handler2) { @@ -40716,8 +40716,8 @@ var require_api_pipeline2 = __commonJS({ const pipelineHandler = new PipelineHandler(opts, handler2); this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler); return pipelineHandler.ret; - } catch (err) { - return new PassThrough().destroy(err); + } catch (err2) { + return new PassThrough().destroy(err2); } } module.exports = pipeline2; @@ -40778,13 +40778,13 @@ var require_api_upgrade2 = __commonJS({ context }); } - onError(err) { + onError(err2) { const { callback, opaque } = this; removeSignal(this); if (callback) { this.callback = null; queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); + this.runInAsyncScope(callback, null, err2, { opaque }); }); } } @@ -40792,8 +40792,8 @@ var require_api_upgrade2 = __commonJS({ function upgrade(opts, callback) { if (callback === void 0) { return new Promise((resolve, reject) => { - upgrade.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data); + upgrade.call(this, opts, (err2, data) => { + return err2 ? reject(err2) : resolve(data); }); }); } @@ -40805,12 +40805,12 @@ var require_api_upgrade2 = __commonJS({ upgrade: opts.protocol || "Websocket" }; this.dispatch(upgradeOpts, upgradeHandler); - } catch (err) { + } catch (err2) { if (typeof callback !== "function") { - throw err; + throw err2; } const opaque = opts?.opaque; - queueMicrotask(() => callback(err, { opaque })); + queueMicrotask(() => callback(err2, { opaque })); } } module.exports = upgrade; @@ -40873,13 +40873,13 @@ var require_api_connect2 = __commonJS({ context }); } - onError(err) { + onError(err2) { const { callback, opaque } = this; removeSignal(this); if (callback) { this.callback = null; queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); + this.runInAsyncScope(callback, null, err2, { opaque }); }); } } @@ -40887,8 +40887,8 @@ var require_api_connect2 = __commonJS({ function connect(opts, callback) { if (callback === void 0) { return new Promise((resolve, reject) => { - connect.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data); + connect.call(this, opts, (err2, data) => { + return err2 ? reject(err2) : resolve(data); }); }); } @@ -40896,12 +40896,12 @@ var require_api_connect2 = __commonJS({ const connectHandler = new ConnectHandler(opts, callback); const connectOptions = { ...opts, method: "CONNECT" }; this.dispatch(connectOptions, connectHandler); - } catch (err) { + } catch (err2) { if (typeof callback !== "function") { - throw err; + throw err2; } const opaque = opts?.opaque; - queueMicrotask(() => callback(err, { opaque })); + queueMicrotask(() => callback(err2, { opaque })); } } module.exports = connect; @@ -41088,20 +41088,20 @@ var require_mock_utils2 = __commonJS({ } return normalizedQp; } - function safeUrl(path) { - if (typeof path !== "string") { - return path; + function safeUrl(path2) { + if (typeof path2 !== "string") { + return path2; } - const pathSegments = path.split("?", 3); + const pathSegments = path2.split("?", 3); if (pathSegments.length !== 2) { - return path; + return path2; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path); + function matchKey(mockDispatch2, { path: path2, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path2); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -41126,8 +41126,8 @@ var require_mock_utils2 = __commonJS({ const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath); - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path, ignoreTrailingSlash }) => { - return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path), resolvedPath); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path2, ignoreTrailingSlash }) => { + return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path2)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path2), resolvedPath); }); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); @@ -41165,19 +41165,19 @@ var require_mock_utils2 = __commonJS({ mockDispatches.splice(index, 1); } } - function removeTrailingSlash(path) { - while (path.endsWith("/")) { - path = path.slice(0, -1); + function removeTrailingSlash(path2) { + while (path2.endsWith("/")) { + path2 = path2.slice(0, -1); } - if (path.length === 0) { - path = "/"; + if (path2.length === 0) { + path2 = "/"; } - return path; + return path2; } function buildKey(opts) { - const { path, method, body, headers, query: query2 } = opts; + const { path: path2, method, body, headers, query: query2 } = opts; return { - path, + path: path2, method, body, headers, @@ -41244,7 +41244,7 @@ var require_mock_utils2 = __commonJS({ const responseData = getResponseData2(body); const responseHeaders = generateKeyValues(headers); const responseTrailers = generateKeyValues(trailers); - handler2.onConnect?.((err) => handler2.onError(err), null); + handler2.onConnect?.((err2) => handler2.onError(err2), null); handler2.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode)); handler2.onData?.(Buffer.from(responseData)); handler2.onComplete?.(responseTrailers); @@ -41835,10 +41835,10 @@ var require_pending_interceptors_formatter2 = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path2, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path, + Path: path2, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -41918,9 +41918,9 @@ var require_mock_agent2 = __commonJS({ const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters]; const dispatchOpts = { ...opts }; if (acceptNonStandardSearchParameters && dispatchOpts.path) { - const [path, searchParams] = dispatchOpts.path.split("?"); + const [path2, searchParams] = dispatchOpts.path.split("?"); const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters); - dispatchOpts.path = `${path}?${normalizedSearchParams}`; + dispatchOpts.path = `${path2}?${normalizedSearchParams}`; } return this[kAgent].dispatch(dispatchOpts, handler2); } @@ -42128,7 +42128,7 @@ var require_snapshot_recorder = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) { "use strict"; var { writeFile, readFile, mkdir } = __require("node:fs/promises"); - var { dirname: dirname2, resolve } = __require("node:path"); + var { dirname: dirname3, resolve } = __require("node:path"); var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers"); var { InvalidArgumentError, UndiciError } = require_errors2(); var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils(); @@ -42316,13 +42316,13 @@ var require_snapshot_recorder = __commonJS({ * @param {string} [filePath] - Optional file path to load snapshots from * @return {Promise} - Resolves when snapshots are loaded */ - async loadSnapshots(filePath) { - const path = filePath || this.#snapshotPath; - if (!path) { + async loadSnapshots(filePath2) { + const path2 = filePath2 || this.#snapshotPath; + if (!path2) { throw new InvalidArgumentError("Snapshot path is required"); } try { - const data = await readFile(resolve(path), "utf8"); + const data = await readFile(resolve(path2), "utf8"); const parsed2 = JSON.parse(data); if (Array.isArray(parsed2)) { this.#snapshots.clear(); @@ -42336,7 +42336,7 @@ var require_snapshot_recorder = __commonJS({ if (error41.code === "ENOENT") { this.#snapshots.clear(); } else { - throw new UndiciError(`Failed to load snapshots from ${path}`, { cause: error41 }); + throw new UndiciError(`Failed to load snapshots from ${path2}`, { cause: error41 }); } } } @@ -42346,13 +42346,13 @@ var require_snapshot_recorder = __commonJS({ * @param {string} [filePath] - Optional file path to save snapshots * @returns {Promise} - Resolves when snapshots are saved */ - async saveSnapshots(filePath) { - const path = filePath || this.#snapshotPath; - if (!path) { + async saveSnapshots(filePath2) { + const path2 = filePath2 || this.#snapshotPath; + if (!path2) { throw new InvalidArgumentError("Snapshot path is required"); } - const resolvedPath = resolve(path); - await mkdir(dirname2(resolvedPath), { recursive: true }); + const resolvedPath = resolve(path2); + await mkdir(dirname3(resolvedPath), { recursive: true }); const data = Array.from(this.#snapshots.entries()).map(([hash, snapshot2]) => ({ hash, snapshot: snapshot2 @@ -42667,8 +42667,8 @@ var require_snapshot_agent = __commonJS({ * @param {string} [filePath] - Optional file path to load snapshots from. * @returns {Promise} - Resolves when snapshots are loaded. */ - async loadSnapshots(filePath) { - await this[kSnapshotRecorder].loadSnapshots(filePath || this[kSnapshotPath]); + async loadSnapshots(filePath2) { + await this[kSnapshotRecorder].loadSnapshots(filePath2 || this[kSnapshotPath]); this[kSnapshotLoaded] = true; if (this[kSnapshotMode] === "playback") { this.#setupMockInterceptors(); @@ -42680,8 +42680,8 @@ var require_snapshot_agent = __commonJS({ * @param {string} [filePath] - Optional file path to save snapshots to. * @returns {Promise} - Resolves when snapshots are saved. */ - async saveSnapshots(filePath) { - return this[kSnapshotRecorder].saveSnapshots(filePath || this[kSnapshotPath]); + async saveSnapshots(filePath2) { + return this[kSnapshotRecorder].saveSnapshots(filePath2 || this[kSnapshotPath]); } /** * Sets up MockAgent interceptors based on recorded snapshots. @@ -42977,15 +42977,15 @@ var require_redirect_handler = __commonJS({ return; } const { origin, pathname, search: search2 } = util3.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path = search2 ? `${pathname}${search2}` : pathname; - const redirectUrlString = `${origin}${path}`; + const path2 = search2 ? `${pathname}${search2}` : pathname; + const redirectUrlString = `${origin}${path2}`; for (const historyUrl of this.history) { if (historyUrl.toString() === redirectUrlString) { throw new InvalidArgumentError(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`); } } this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path; + this.opts.path = path2; this.opts.origin = origin; this.opts.query = null; } @@ -43117,24 +43117,24 @@ var require_response_error = __commonJS({ } catch { } } - let err; + let err2; const stackTraceLimit = Error.stackTraceLimit; Error.stackTraceLimit = 0; try { - err = new ResponseError("Response Error", this.#statusCode, { + err2 = new ResponseError("Response Error", this.#statusCode, { body: this.#body, headers: this.#headers }); } finally { Error.stackTraceLimit = stackTraceLimit; } - super.onResponseError(controller, err); + super.onResponseError(controller, err2); } else { super.onResponseEnd(controller, trailers); } } - onResponseError(controller, err) { - super.onResponseError(controller, err); + onResponseError(controller, err2) { + super.onResponseError(controller, err2); } }; module.exports = () => { @@ -43212,12 +43212,12 @@ var require_dump = __commonJS({ } return super.onResponseStart(controller, statusCode, headers, statusMessage); } - onResponseError(controller, err) { + onResponseError(controller, err2) { if (this.#dumped) { return; } - err = this.#controller?.reason ?? err; - super.onResponseError(controller, err); + err2 = this.#controller?.reason ?? err2; + super.onResponseError(controller, err2); } onResponseData(controller, chunk) { this.#size = this.#size + chunk.length; @@ -43301,9 +43301,9 @@ var require_dns = __commonJS({ maxItems: this.#maxItems }; if (ips == null) { - this.lookup(origin, newOpts, (err, addresses) => { - if (err || addresses == null || addresses.length === 0) { - cb(err ?? new InformationalError("No DNS entries found")); + this.lookup(origin, newOpts, (err2, addresses) => { + if (err2 || addresses == null || addresses.length === 0) { + cb(err2 ?? new InformationalError("No DNS entries found")); return; } this.setRecords(origin, addresses); @@ -43359,9 +43359,9 @@ var require_dns = __commonJS({ family: this.dualStack === false ? this.affinity : 0, order: "ipv4first" }, - (err, addresses) => { - if (err) { - return cb(err); + (err2, addresses) => { + if (err2) { + return cb(err2); } const results = /* @__PURE__ */ new Map(); for (const addr of addresses) { @@ -43475,20 +43475,20 @@ var require_dns = __commonJS({ this.#state = state; this.#dispatch = dispatch; } - onResponseError(controller, err) { - switch (err.code) { + onResponseError(controller, err2) { + switch (err2.code) { case "ETIMEDOUT": case "ECONNREFUSED": { if (this.#state.dualStack) { if (!this.#firstTry) { - super.onResponseError(controller, err); + super.onResponseError(controller, err2); return; } this.#firstTry = false; const otherFamily = this.#newOrigin.hostname[0] === "[" ? 4 : 6; const ip2 = this.#state.pickFamily(this.#origin, otherFamily); if (ip2 == null) { - super.onResponseError(controller, err); + super.onResponseError(controller, err2); return; } let port; @@ -43506,15 +43506,15 @@ var require_dns = __commonJS({ this.#dispatch(dispatchOpts, this); return; } - super.onResponseError(controller, err); + super.onResponseError(controller, err2); break; } case "ENOTFOUND": this.#state.deleteRecords(this.#origin); - super.onResponseError(controller, err); + super.onResponseError(controller, err2); break; default: - super.onResponseError(controller, err); + super.onResponseError(controller, err2); break; } } @@ -43563,9 +43563,9 @@ var require_dns = __commonJS({ if (isIP(origin.hostname) !== 0) { return dispatch(origDispatchOpts, handler2); } - instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => { - if (err) { - return handler2.onResponseError(null, err); + instance.runLookup(origin, origDispatchOpts, (err2, newOrigin) => { + if (err2) { + return handler2.onResponseError(null, err2); } const dispatchOpts = { ...origDispatchOpts, @@ -44510,10 +44510,10 @@ var require_cache_handler = __commonJS({ this.#writeStream?.end(); this.#handler.onResponseEnd?.(controller, trailers); } - onResponseError(controller, err) { - this.#writeStream?.destroy(err); + onResponseError(controller, err2) { + this.#writeStream?.destroy(err2); this.#writeStream = void 0; - this.#handler.onResponseError?.(controller, err); + this.#handler.onResponseError?.(controller, err2); } }; function canCacheResponse(cacheType, statusCode, resHeaders, cacheControlDirectives) { @@ -44895,7 +44895,7 @@ var require_cache_revalidation_handler = __commonJS({ } this.#handler.onResponseEnd?.(controller, trailers); } - onResponseError(controller, err) { + onResponseError(controller, err2) { if (this.#successful) { return; } @@ -44904,9 +44904,9 @@ var require_cache_revalidation_handler = __commonJS({ this.#callback = null; } if (typeof this.#handler.onResponseError === "function") { - this.#handler.onResponseError(controller, err); + this.#handler.onResponseError(controller, err2); } else { - throw err; + throw err2; } } }; @@ -44979,9 +44979,9 @@ var require_cache6 = __commonJS({ if (typeof handler2.onComplete === "function") { handler2.onComplete([]); } - } catch (err) { + } catch (err2) { if (typeof handler2.onError === "function") { - handler2.onError(err); + handler2.onError(err2); } } return true; @@ -45012,12 +45012,12 @@ var require_cache6 = __commonJS({ stream.destroy(reason ?? new AbortError2()); } }; - stream.on("error", function(err) { + stream.on("error", function(err2) { if (!this.readableEnded) { if (typeof handler2.onResponseError === "function") { - handler2.onResponseError(controller, err); + handler2.onResponseError(controller, err2); } else { - throw err; + throw err2; } } }).on("close", function() { @@ -45321,9 +45321,9 @@ var require_decompress = __commonJS({ #setupMultipleDecompressors(controller) { const lastDecompressor = this.#decompressors[this.#decompressors.length - 1]; this.#setupDecompressorEvents(lastDecompressor, controller); - this.#pipelineStream = pipeline2(this.#decompressors, (err) => { - if (err) { - super.onResponseError(controller, err); + this.#pipelineStream = pipeline2(this.#decompressors, (err2) => { + if (err2) { + super.onResponseError(controller, err2); return; } super.onResponseEnd(controller, {}); @@ -45393,14 +45393,14 @@ var require_decompress = __commonJS({ * @param {Error} err * @returns {void} */ - onResponseError(controller, err) { + onResponseError(controller, err2) { if (this.#decompressors.length > 0) { for (const decompressor of this.#decompressors) { - decompressor.destroy(err); + decompressor.destroy(err2); } this.#cleanupDecompressors(); } - super.onResponseError(controller, err); + super.onResponseError(controller, err2); } }; function createDecompressInterceptor(options = {}) { @@ -46300,8 +46300,8 @@ var require_response2 = __commonJS({ let parsedURL; try { parsedURL = new URL(url2, relevantRealm.settingsObject.baseUrl); - } catch (err) { - throw new TypeError(`Failed to parse URL from ${url2}`, { cause: err }); + } catch (err2) { + throw new TypeError(`Failed to parse URL from ${url2}`, { cause: err2 }); } if (!redirectStatusSet.has(status)) { throw new RangeError(`Invalid status code ${status}`); @@ -46560,9 +46560,9 @@ var require_response2 = __commonJS({ assert2(false); } } - function makeAppropriateNetworkError(fetchParams, err = null) { + function makeAppropriateNetworkError(fetchParams, err2 = null) { assert2(isCancelled(fetchParams)); - return isAborted4(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err })); + return isAborted4(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err2 })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err2 })); } function initializeResponse(response, init, body) { if (init.status !== null && (init.status < 200 || init.status > 599)) { @@ -46757,8 +46757,8 @@ var require_request4 = __commonJS({ let parsedURL; try { parsedURL = new URL(input, baseUrl); - } catch (err) { - throw new TypeError("Failed to parse URL from " + input, { cause: err }); + } catch (err2) { + throw new TypeError("Failed to parse URL from " + input, { cause: err2 }); } if (parsedURL.username || parsedURL.password) { throw new TypeError( @@ -46848,8 +46848,8 @@ var require_request4 = __commonJS({ let parsedReferrer; try { parsedReferrer = new URL(referrer, baseUrl); - } catch (err) { - throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err }); + } catch (err2) { + throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err2 }); } if (parsedReferrer.protocol === "about:" && parsedReferrer.hostname === "client" || origin && !sameOrigin(parsedReferrer, environmentSettingsObject.settingsObject.baseUrl)) { request2.referrer = "client"; @@ -47751,11 +47751,11 @@ var require_fetch2 = __commonJS({ p.reject(error41); } if (request2.body?.stream != null && isReadable(request2.body.stream)) { - request2.body.stream.cancel(error41).catch((err) => { - if (err.code === "ERR_INVALID_STATE") { + request2.body.stream.cancel(error41).catch((err2) => { + if (err2.code === "ERR_INVALID_STATE") { return; } - throw err; + throw err2; }); } if (responseObject == null) { @@ -47763,11 +47763,11 @@ var require_fetch2 = __commonJS({ } const response = getResponseState(responseObject); if (response.body?.stream != null && isReadable(response.body.stream)) { - response.body.stream.cancel(error41).catch((err) => { - if (err.code === "ERR_INVALID_STATE") { + response.body.stream.cancel(error41).catch((err2) => { + if (err2.code === "ERR_INVALID_STATE") { return; } - throw err; + throw err2; }); } } @@ -47929,8 +47929,8 @@ var require_fetch2 = __commonJS({ } else { fetchFinale(fetchParams, response); } - } catch (err) { - fetchParams.controller.terminate(err); + } catch (err2) { + fetchParams.controller.terminate(err2); } } function schemeFetch(fetchParams) { @@ -48017,7 +48017,7 @@ var require_fetch2 = __commonJS({ } case "http:": case "https:": { - return httpFetch(fetchParams).catch((err) => makeNetworkError(err)); + return httpFetch(fetchParams).catch((err2) => makeNetworkError(err2)); } default: { return Promise.resolve(makeNetworkError("unknown scheme")); @@ -48142,8 +48142,8 @@ var require_fetch2 = __commonJS({ if (locationURL == null) { return response; } - } catch (err) { - return Promise.resolve(makeNetworkError(err)); + } catch (err2) { + return Promise.resolve(makeNetworkError(err2)); } if (!urlIsHttpHttpsScheme(locationURL)) { return Promise.resolve(makeNetworkError("URL scheme must be a HTTP(S) scheme")); @@ -48314,11 +48314,11 @@ var require_fetch2 = __commonJS({ fetchParams.controller.connection = { abort: null, destroyed: false, - destroy(err, abort = true) { + destroy(err2, abort = true) { if (!this.destroyed) { this.destroyed = true; if (abort) { - this.abort?.(err ?? new DOMException("The operation was aborted.", "AbortError")); + this.abort?.(err2 ?? new DOMException("The operation was aborted.", "AbortError")); } } } @@ -48369,8 +48369,8 @@ var require_fetch2 = __commonJS({ yield* processBodyChunk(bytes); } processEndOfBody(); - } catch (err) { - processBodyError(err); + } catch (err2) { + processBodyError(err2); } })(); } @@ -48383,12 +48383,12 @@ var require_fetch2 = __commonJS({ fetchParams.controller.next = () => iterator2.next(); response = makeResponse({ status, statusText, headersList }); } - } catch (err) { - if (err.name === "AbortError") { + } catch (err2) { + if (err2.name === "AbortError") { fetchParams.controller.connection.destroy(); - return makeAppropriateNetworkError(fetchParams, err); + return makeAppropriateNetworkError(fetchParams, err2); } - return makeNetworkError(err); + return makeNetworkError(err2); } const pullAlgorithm = () => { return fetchParams.controller.resume(); @@ -48422,11 +48422,11 @@ var require_fetch2 = __commonJS({ break; } bytes = done ? void 0 : value2; - } catch (err) { + } catch (err2) { if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { bytes = void 0; } else { - bytes = err; + bytes = err2; isFailure = true; } } @@ -48553,9 +48553,9 @@ var require_fetch2 = __commonJS({ status, statusText, headersList, - body: decoders.length ? pipeline2(this.body, ...decoders, (err) => { - if (err) { - this.onError(err); + body: decoders.length ? pipeline2(this.body, ...decoders, (err2) => { + if (err2) { + this.onError(err2); } }).on("error", onError) : this.body.on("error", onError) }); @@ -49376,9 +49376,9 @@ var require_util14 = __commonJS({ } } } - function validateCookiePath(path) { - for (let i = 0; i < path.length; ++i) { - const code = path.charCodeAt(i); + function validateCookiePath(path2) { + for (let i = 0; i < path2.length; ++i) { + const code = path2.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -50553,9 +50553,9 @@ var require_permessage_deflate = __commonJS({ this.#inflate[kBuffer].push(data); this.#inflate[kLength] += data.length; }); - this.#inflate.on("error", (err) => { + this.#inflate.on("error", (err2) => { this.#inflate = null; - callback(err); + callback(err2); }); } this.#inflate.write(chunk); @@ -51017,17 +51017,17 @@ var require_websocket2 = __commonJS({ #handler = { onConnectionEstablished: (response, extensions) => this.#onConnectionEstablished(response, extensions), onMessage: (opcode, data) => this.#onMessage(opcode, data), - onParserError: (err) => failWebsocketConnection(this.#handler, null, err.message), + onParserError: (err2) => failWebsocketConnection(this.#handler, null, err2.message), onParserDrain: () => this.#onParserDrain(), onSocketData: (chunk) => { if (!this.#parser.write(chunk)) { this.#handler.socket.pause(); } }, - onSocketError: (err) => { + onSocketError: (err2) => { this.#handler.readyState = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(err); + channels.socketError.publish(err2); } this.#handler.socket.destroy(); }, @@ -51256,7 +51256,7 @@ var require_websocket2 = __commonJS({ this.#handler.socket = response.socket; const parser = new ByteParser(this.#handler, parsedExtensions); parser.on("drain", () => this.#handler.onParserDrain()); - parser.on("error", (err) => this.#handler.onParserError(err)); + parser.on("error", (err2) => this.#handler.onParserError(err2)); this.#parser = parser; this.#sendQueue = new SendQueue(response.socket); this.#handler.readyState = states.OPEN; @@ -51570,17 +51570,17 @@ var require_websocketstream = __commonJS({ // https://whatpr.org/websockets/48/7b748d3...d5570f3.html#feedback-to-websocket-stream-from-the-protocol onConnectionEstablished: (response, extensions) => this.#onConnectionEstablished(response, extensions), onMessage: (opcode, data) => this.#onMessage(opcode, data), - onParserError: (err) => failWebsocketConnection(this.#handler, null, err.message), + onParserError: (err2) => failWebsocketConnection(this.#handler, null, err2.message), onParserDrain: () => this.#handler.socket.resume(), onSocketData: (chunk) => { if (!this.#parser.write(chunk)) { this.#handler.socket.pause(); } }, - onSocketError: (err) => { + onSocketError: (err2) => { this.#handler.readyState = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(err); + channels.socketError.publish(err2); } this.#handler.socket.destroy(); }, @@ -51700,7 +51700,7 @@ var require_websocketstream = __commonJS({ this.#handler.socket = response.socket; const parser = new ByteParser(this.#handler, parsedExtensions); parser.on("drain", () => this.#handler.onParserDrain()); - parser.on("error", (err) => this.#handler.onParserError(err)); + parser.on("error", (err2) => this.#handler.onParserError(err2)); this.#parser = parser; this.#handler.readyState = states.OPEN; const extensions = parsedExtensions ?? ""; @@ -52486,11 +52486,11 @@ var require_undici2 = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path = opts.path; + let path2 = opts.path; if (!opts.path.startsWith("/")) { - path = `/${path}`; + path2 = `/${path2}`; } - url2 = new URL(util3.parseOrigin(url2).origin + path); + url2 = new URL(util3.parseOrigin(url2).origin + path2); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -52513,11 +52513,11 @@ var require_undici2 = __commonJS({ module.exports.getGlobalDispatcher = getGlobalDispatcher; var fetchImpl = require_fetch2().fetch; module.exports.fetch = function fetch3(init, options = void 0) { - return fetchImpl(init, options).catch((err) => { - if (err && typeof err === "object") { - Error.captureStackTrace(err); + return fetchImpl(init, options).catch((err2) => { + if (err2 && typeof err2 === "object") { + Error.captureStackTrace(err2); } - throw err; + throw err2; }); }; module.exports.Headers = require_headers2().Headers; @@ -53288,10 +53288,10 @@ function assignProp(target, prop, value2) { configurable: true }); } -function getElementAtPath(obj, path) { - if (!path) +function getElementAtPath(obj, path2) { + if (!path2) return obj; - return path.reduce((acc, key) => acc?.[key], obj); + return path2.reduce((acc, key) => acc?.[key], obj); } function promiseAllObject(promisesObj) { const keys = Object.keys(promisesObj); @@ -53540,11 +53540,11 @@ function aborted(x, startIndex = 0) { } return false; } -function prefixIssues(path, issues) { +function prefixIssues(path2, issues) { return issues.map((iss) => { var _a; (_a = iss).path ?? (_a.path = []); - iss.path.unshift(path); + iss.path.unshift(path2); return iss; }); } @@ -53733,7 +53733,7 @@ function treeifyError(error41, _mapper) { return issue2.message; }; const result = { errors: [] }; - const processError = (error42, path = []) => { + const processError = (error42, path2 = []) => { var _a, _b; for (const issue2 of error42.issues) { if (issue2.code === "invalid_union" && issue2.errors.length) { @@ -53743,7 +53743,7 @@ function treeifyError(error41, _mapper) { } else if (issue2.code === "invalid_element") { processError({ issues: issue2.issues }, issue2.path); } else { - const fullpath = [...path, ...issue2.path]; + const fullpath = [...path2, ...issue2.path]; if (fullpath.length === 0) { result.errors.push(mapper(issue2)); continue; @@ -53773,9 +53773,9 @@ function treeifyError(error41, _mapper) { processError(error41); return result; } -function toDotPath(path) { +function toDotPath(path2) { const segs = []; - for (const seg of path) { + for (const seg of path2) { if (typeof seg === "number") segs.push(`[${seg}]`); else if (typeof seg === "symbol") @@ -53833,7 +53833,7 @@ var init_errors2 = __esm({ }); // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/parse.js -var _parse, parse2, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync; +var _parse, parse3, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync; var init_parse = __esm({ "node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/parse.js"() { init_core(); @@ -53852,7 +53852,7 @@ var init_parse = __esm({ } return result.value; }; - parse2 = /* @__PURE__ */ _parse($ZodRealError); + parse3 = /* @__PURE__ */ _parse($ZodRealError); _parseAsync = (_Err) => async (schema2, value2, _ctx, params) => { const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; let result = schema2._zod.run({ value: value2, issues: [] }, ctx); @@ -62237,12 +62237,12 @@ var init_function = __esm({ throw new Error("implement() must be called with a function"); } const impl = ((...args2) => { - const parsedArgs = this._def.input ? parse2(this._def.input, args2, void 0, { callee: impl }) : args2; + const parsedArgs = this._def.input ? parse3(this._def.input, args2, void 0, { callee: impl }) : args2; if (!Array.isArray(parsedArgs)) { throw new Error("Invalid arguments schema: not an array or tuple schema."); } const output = func(...parsedArgs); - return this._def.output ? parse2(this._def.output, output, void 0, { callee: impl }) : output; + return this._def.output ? parse3(this._def.output, output, void 0, { callee: impl }) : output; }); return impl; } @@ -63302,7 +63302,7 @@ __export(core_exports2, { isValidBase64URL: () => isValidBase64URL, isValidJWT: () => isValidJWT4, locales: () => locales_exports, - parse: () => parse2, + parse: () => parse3, parseAsync: () => parseAsync, prettifyError: () => prettifyError, regexes: () => regexes_exports, @@ -64988,16 +64988,16 @@ var init_zod_Bw_60DVU = __esm({ try { const { toJSONSchema: toJSONSchema2 } = await Promise.resolve().then(() => (init_core2(), core_exports2)); zodV4toJSONSchema = toJSONSchema2; - } catch (err) { - if (err instanceof Error) - console.error(err.message); + } catch (err2) { + if (err2 instanceof Error) + console.error(err2.message); } try { const { zodToJsonSchema: zodToJsonSchema2 } = await Promise.resolve().then(() => (init_esm(), esm_exports)); zodV3ToJSONSchema = zodToJsonSchema2; - } catch (err) { - if (err instanceof Error) - console.error(err.message); + } catch (err2) { + if (err2 instanceof Error) + console.error(err2.message); } return async (schema2) => { if ("_zod" in schema2) @@ -65054,7 +65054,7 @@ var require_fast_content_type_parse = __commonJS({ var defaultContentType = { type: "", parameters: new NullObject() }; Object.freeze(defaultContentType.parameters); Object.freeze(defaultContentType); - function parse4(header) { + function parse5(header) { if (typeof header !== "string") { throw new TypeError("argument header is required and must be a string"); } @@ -65130,8 +65130,8 @@ var require_fast_content_type_parse = __commonJS({ } return result; } - module.exports.default = { parse: parse4, safeParse: safeParse3 }; - module.exports.parse = parse4; + module.exports.default = { parse: parse5, safeParse: safeParse3 }; + module.exports.parse = parse5; module.exports.safeParse = safeParse3; module.exports.defaultContentType = defaultContentType; } @@ -65142,6 +65142,160 @@ var core3 = __toESM(require_core(), 1); import { readdir } from "node:fs/promises"; import { join as join5 } from "node:path"; +// node_modules/.pnpm/@ark+fs@0.53.0/node_modules/@ark/fs/out/caller.js +import path from "node:path"; +import * as process2 from "node:process"; +import { fileURLToPath } from "node:url"; +import { isDeepStrictEqual } from "node:util"; + +// node_modules/.pnpm/@ark+fs@0.53.0/node_modules/@ark/fs/out/getCurrentLine.js +var getFramesFromError = (error41) => { + let stack, frames; + try { + stack = error41.stack; + } catch (error1) { + try { + const previous = err.__previous__ || err.__previous; + stack = previous && previous.stack; + } catch (error210) { + stack = null; + } + } + if (stack) + frames = Array.isArray(stack) ? Array(stack) : stack.toString().split("\n"); + else + frames = []; + return frames; +}; +var lineRegex = /\s+at\s(?:(?.+?)\s\()?(?.+?):(?\d+):(?\d+)\)?\s*$/; +var getLocationsFromFrames = (frames) => { + const locations = []; + for (const frame of frames) { + const line = (frame || "").toString(); + if (line.length === 0) + continue; + const match2 = line.match(lineRegex); + if (match2 && match2.groups) { + locations.push({ + method: match2.groups.method || "", + file: match2.groups.file || "", + line: Number(match2.groups.line), + char: Number(match2.groups.char) + }); + } + } + return locations; +}; +var failureLocation = { + line: -1, + char: -1, + method: "", + file: "" +}; +var getLocationWithOffset = (locations, offset) => { + let found = !offset.file && !offset.method; + let i = 0; + while (i < locations.length) { + const location = locations[i]; + if (offset.file && (typeof offset.file === "string" ? location.file.includes(offset.file) : offset.file.test(location.file)) || offset.method && (typeof offset.method === "string" ? location.method.includes(offset.method) : offset.method.test(location.method))) { + if (offset.immediate) { + i += offset.frames || 0; + return locations[i]; + } else { + found = true; + ++i; + continue; + } + } else if (found) { + i += offset.frames || 0; + return locations[i]; + } else { + ++i; + continue; + } + } + return failureLocation; +}; +var getLocationsFromError = (error41) => { + const frames = getFramesFromError(error41); + return getLocationsFromFrames(frames); +}; +var getLocationFromError = (error41, offset = { + immediate: true +}) => { + const locations = getLocationsFromError(error41); + return getLocationWithOffset(locations, offset); +}; +var getCurrentLine = (offset = { + method: "getCurrentLine", + frames: 0, + immediate: false +}) => getLocationFromError(new Error(), offset); + +// node_modules/.pnpm/@ark+fs@0.53.0/node_modules/@ark/fs/out/caller.js +var nonexistentCurrentLine = { + line: -1, + char: -1, + method: "", + file: "" +}; +var formatFilePath = (original, { relative, separator: separator2 }) => { + let formatted = original; + if (original.startsWith("file:///")) + formatted = fileURLToPath(original); + if (relative) { + formatted = path.relative(typeof relative === "string" ? relative : process2.cwd(), formatted); + } + if (separator2) { + formatted = formatted.replaceAll(new RegExp(`\\${path.sep}`, "g"), separator2); + } + return formatted; +}; +var caller = (options = {}) => { + let upStackBy = options.upStackBy ?? 0; + if (!options.methodName && !options.upStackBy) + upStackBy = 3; + let match2; + while (!match2) { + const location = getCurrentLine({ + method: options.methodName, + frames: upStackBy + }); + if (!location || isDeepStrictEqual(location, nonexistentCurrentLine)) { + throw new Error(`No caller of '${options.methodName}' matches given options: ${JSON.stringify(options, null, 4)}.`); + } + const candidate = { + ...location, + file: formatFilePath(location.file, options.formatPath ?? {}) + }; + if (options.skip?.(candidate)) + upStackBy++; + else + match2 = candidate; + } + if (match2.file.startsWith("file:///")) + match2.file = fileURLToPath(match2.file); + return match2; +}; + +// node_modules/.pnpm/@ark+fs@0.53.0/node_modules/@ark/fs/out/fs.js +import { dirname, join, parse } from "node:path"; +import * as process3 from "node:process"; +import { URL as URL2, fileURLToPath as fileURLToPath2 } from "node:url"; +var filePath = (path2) => { + let file; + if (path2.includes("://")) { + const url2 = new URL2(path2); + file = url2.protocol === "file:" ? fileURLToPath2(url2) : url2.href; + } else { + file = path2; + } + return file; +}; +var dirOfCaller = () => dirname(filePath(caller({ methodName: "dirOfCaller", upStackBy: 1 }).file)); +var dirName = () => dirOfCaller(); +var fsRoot = parse(process3.cwd()).root; + // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/arrays.js var liftArray = (data) => Array.isArray(data) ? data : [data]; var spliterate = (arr, predicate) => { @@ -65498,8 +65652,8 @@ var fileName = () => { try { const error41 = new Error(); const stackLine = error41.stack?.split("\n")[2]?.trim() || ""; - const filePath = stackLine.match(/\(?(.+?)(?::\d+:\d+)?\)?$/)?.[1] || "unknown"; - return filePath.replace(/^file:\/\//, ""); + const filePath2 = stackLine.match(/\(?(.+?)(?::\d+:\d+)?\)?$/)?.[1] || "unknown"; + return filePath2.replace(/^file:\/\//, ""); } catch { return "unknown"; } @@ -65766,29 +65920,29 @@ var timeWithUnnecessarySeconds = /:\d\d:00$/; var pad = (value2, length) => String(value2).padStart(length, "0"); // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/path.js -var appendStringifiedKey = (path, prop, ...[opts]) => { +var appendStringifiedKey = (path2, prop, ...[opts]) => { const stringifySymbol = opts?.stringifySymbol ?? printable; - let propAccessChain = path; + let propAccessChain = path2; switch (typeof prop) { case "string": - propAccessChain = isDotAccessible(prop) ? path === "" ? prop : `${path}.${prop}` : `${path}[${JSON.stringify(prop)}]`; + propAccessChain = isDotAccessible(prop) ? path2 === "" ? prop : `${path2}.${prop}` : `${path2}[${JSON.stringify(prop)}]`; break; case "number": - propAccessChain = `${path}[${prop}]`; + propAccessChain = `${path2}[${prop}]`; break; case "symbol": - propAccessChain = `${path}[${stringifySymbol(prop)}]`; + propAccessChain = `${path2}[${stringifySymbol(prop)}]`; break; default: if (opts?.stringifyNonKey) - propAccessChain = `${path}[${opts.stringifyNonKey(prop)}]`; + propAccessChain = `${path2}[${opts.stringifyNonKey(prop)}]`; else { throwParseError(`${printable(prop)} must be a PropertyKey or stringifyNonKey must be passed to options`); } } return propAccessChain; }; -var stringifyPath = (path, ...opts) => path.reduce((s, k) => appendStringifiedKey(s, k, ...opts), ""); +var stringifyPath = (path2, ...opts) => path2.reduce((s, k) => appendStringifiedKey(s, k, ...opts), ""); var ReadonlyPath = class extends ReadonlyArray { // alternate strategy for caching since the base object is frozen cache = {}; @@ -65815,8 +65969,8 @@ var ReadonlyPath = class extends ReadonlyArray { return this.cache.stringifyAncestors; let propString = ""; const result = [propString]; - for (const path of this) { - propString = appendStringifiedKey(propString, path); + for (const path2 of this) { + propString = appendStringifiedKey(propString, path2); result.push(propString); } return this.cache.stringifyAncestors = result; @@ -66437,15 +66591,15 @@ var ArkErrors = class _ArkErrors extends ReadonlyArray { /** * @internal */ - affectsPath(path) { + affectsPath(path2) { if (this.length === 0) return false; return ( // this would occur if there is an existing error at a prefix of path // e.g. the path is ["foo", "bar"] and there is an error at ["foo"] - path.stringifyAncestors().some((s) => s in this.byPath) || // this would occur if there is an existing error at a suffix of path + path2.stringifyAncestors().some((s) => s in this.byPath) || // this would occur if there is an existing error at a suffix of path // e.g. the path is ["foo"] and there is an error at ["foo", "bar"] - path.stringify() in this.byAncestorPath + path2.stringify() in this.byAncestorPath ); } /** @@ -66632,23 +66786,23 @@ var Traversal = class { while (this.queuedMorphs.length) { const queuedMorphs = this.queuedMorphs; this.queuedMorphs = []; - for (const { path, morphs } of queuedMorphs) { - if (this.errors.affectsPath(path)) + for (const { path: path2, morphs } of queuedMorphs) { + if (this.errors.affectsPath(path2)) continue; - this.applyMorphsAtPath(path, morphs); + this.applyMorphsAtPath(path2, morphs); } } } - applyMorphsAtPath(path, morphs) { - const key = path.at(-1); + applyMorphsAtPath(path2, morphs) { + const key = path2.at(-1); let parent; if (key !== void 0) { parent = this.root; - for (let pathIndex = 0; pathIndex < path.length - 1; pathIndex++) - parent = parent[path[pathIndex]]; + for (let pathIndex = 0; pathIndex < path2.length - 1; pathIndex++) + parent = parent[path2[pathIndex]]; } for (const morph of morphs) { - this.path = [...path]; + this.path = [...path2]; const morphIsNode = isNode(morph); const result = morph(parent === void 0 ? this.root : parent[key], this); if (result instanceof ArkError) { @@ -67023,15 +67177,15 @@ var NodeSelector = { normalize: (selector) => typeof selector === "function" ? { boundary: "references", method: "filter", where: selector } : typeof selector === "string" ? isKeyOf(selector, NodeSelector.applyBoundary) ? { method: "filter", boundary: selector } : { boundary: "references", method: "filter", kind: selector } : { boundary: "references", method: "filter", ...selector } }; var writeSelectAssertionMessage = (from, selector) => `${from} had no references matching ${printable(selector)}.`; -var typePathToPropString = (path) => stringifyPath(path, { +var typePathToPropString = (path2) => stringifyPath(path2, { stringifyNonKey: (node2) => node2.expression }); var referenceMatcher = /"(\$ark\.[^"]+)"/g; var compileMeta = (metaJson) => JSON.stringify(metaJson).replaceAll(referenceMatcher, "$1"); -var flatRef = (path, node2) => ({ - path, +var flatRef = (path2, node2) => ({ + path: path2, node: node2, - propString: typePathToPropString(path) + propString: typePathToPropString(path2) }); var flatRefsAreEqual = (l, r) => l.propString === r.propString && l.node.equals(r.node); var appendUniqueFlatRefs = (existing, refs) => appendUnique(existing, refs, { @@ -67067,12 +67221,12 @@ var Disjoint = class _Disjoint extends Array { } describeReasons() { if (this.length === 1) { - const { path, l, r } = this[0]; - const pathString = stringifyPath(path); + const { path: path2, l, r } = this[0]; + const pathString = stringifyPath(path2); return writeUnsatisfiableExpressionError(`Intersection${pathString && ` at ${pathString}`} of ${describeReasons(l, r)}`); } return `The following intersections result in unsatisfiable types: -\u2022 ${this.map(({ path, l, r }) => `${path}: ${describeReasons(l, r)}`).join("\n\u2022 ")}`; +\u2022 ${this.map(({ path: path2, l, r }) => `${path2}: ${describeReasons(l, r)}`).join("\n\u2022 ")}`; } throw() { return throwParseError(this.describeReasons()); @@ -68455,10 +68609,10 @@ var BaseRoot = class extends BaseNode { }); }); } - get(...path) { - if (path[0] === void 0) + get(...path2) { + if (path2[0] === void 0) return this; - return this.$.schema(this.applyStructuralOperation("get", path)); + return this.$.schema(this.applyStructuralOperation("get", path2)); } extract(r) { const rNode = this.$.parseDefinition(r); @@ -69390,13 +69544,13 @@ var implementation17 = implementNode({ description: (node2) => node2.distribute((branch) => branch.description, describeBranches), expected: (ctx) => { const byPath = groupBy(ctx.errors, "propString"); - const pathDescriptions = Object.entries(byPath).map(([path, errors]) => { + const pathDescriptions = Object.entries(byPath).map(([path2, errors]) => { const branchesAtPath = []; for (const errorAtPath of errors) appendUnique(branchesAtPath, errorAtPath.expected); const expected = describeBranches(branchesAtPath); const actual = errors.every((e) => e.actual === errors[0].actual) ? errors[0].actual : printable(errors[0].data); - return `${path && `${path} `}must be ${expected}${actual && ` (was ${actual})`}`; + return `${path2 && `${path2} `}must be ${expected}${actual && ` (was ${actual})`}`; }); return describeBranches(pathDescriptions); }, @@ -69778,10 +69932,10 @@ var viableOrderedCandidates = (candidates, originalBranches) => { }); return viableCandidates; }; -var discriminantCaseToNode = (caseDiscriminant, path, $) => { +var discriminantCaseToNode = (caseDiscriminant, path2, $) => { let node2 = caseDiscriminant === "undefined" ? $.node("unit", { unit: void 0 }) : caseDiscriminant === "null" ? $.node("unit", { unit: null }) : caseDiscriminant === "boolean" ? $.units([true, false]) : caseDiscriminant; - for (let i = path.length - 1; i >= 0; i--) { - const key = path[i]; + for (let i = path2.length - 1; i >= 0; i--) { + const key = path2[i]; node2 = $.node("intersection", typeof key === "number" ? { proto: "Array", // create unknown for preceding elements (could be optimized with safe imports) @@ -69793,7 +69947,7 @@ var discriminantCaseToNode = (caseDiscriminant, path, $) => { } return node2; }; -var optionallyChainPropString = (path) => path.reduce((acc, k) => acc + compileLiteralPropAccess(k, true), "data"); +var optionallyChainPropString = (path2) => path2.reduce((acc, k) => acc + compileLiteralPropAccess(k, true), "data"); var serializedTypeOfDescriptions = registeredReference(jsTypeOfDescriptions); var serializedPrintable = registeredReference(printable); var Union = { @@ -70769,7 +70923,7 @@ var StructureNode = class extends BaseConstraint { return throwParseError(writeInvalidKeysMessage(this.expression, invalidKeys)); } } - get(indexer, ...path) { + get(indexer, ...path2) { let value2; let required2 = false; const key = indexerToKey(indexer); @@ -70805,7 +70959,7 @@ var StructureNode = class extends BaseConstraint { } return throwParseError(writeInvalidKeysMessage(this.expression, [key])); } - const result = value2.get(...path); + const result = value2.get(...path2); return required2 ? result : result.or($ark.intrinsic.undefined); } pick(...keys) { @@ -73511,16 +73665,16 @@ import { pipeline } from "node:stream/promises"; // node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.1.30_zod@3.25.76/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs import { join as join3 } from "path"; -import { fileURLToPath } from "url"; +import { fileURLToPath as fileURLToPath3 } from "url"; import { setMaxListeners } from "events"; import { spawn } from "child_process"; import { createInterface } from "readline"; import * as fs from "fs"; import { stat as statPromise, open } from "fs/promises"; -import { join } from "path"; +import { join as join2 } from "path"; import { homedir } from "os"; -import { dirname, join as join2 } from "path"; -import { cwd } from "process"; +import { dirname as dirname2, join as join22 } from "path"; +import { cwd as cwd3 } from "process"; import { realpathSync as realpathSync2 } from "fs"; import { randomUUID } from "crypto"; var __create2 = Object.create; @@ -73622,9 +73776,9 @@ var require_uri_all = __commonJS2((exports, module) => { if (i && _arr.length === i) break; } - } catch (err) { + } catch (err2) { _d = true; - _e = err; + _e = err2; } finally { try { if (!_n && _i["return"]) @@ -73810,9 +73964,9 @@ var require_uri_all = __commonJS2((exports, module) => { output.push(stringFromCharCode(_currentValue2)); } } - } catch (err) { + } catch (err2) { _didIteratorError = true; - _iteratorError = err; + _iteratorError = err2; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { @@ -73841,9 +73995,9 @@ var require_uri_all = __commonJS2((exports, module) => { m = currentValue; } } - } catch (err) { + } catch (err2) { _didIteratorError2 = true; - _iteratorError2 = err; + _iteratorError2 = err2; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { @@ -73888,9 +74042,9 @@ var require_uri_all = __commonJS2((exports, module) => { ++handledCPCount; } } - } catch (err) { + } catch (err2) { _didIteratorError3 = true; - _iteratorError3 = err; + _iteratorError3 = err2; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return) { @@ -74055,7 +74209,7 @@ var require_uri_all = __commonJS2((exports, module) => { } var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === void 0; - function parse4(uriString) { + function parse5(uriString) { var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; var components = {}; var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; @@ -74226,8 +74380,8 @@ var require_uri_all = __commonJS2((exports, module) => { var skipNormalization = arguments[3]; var target = {}; if (!skipNormalization) { - base2 = parse4(serialize(base2, options), options); - relative = parse4(serialize(relative, options), options); + base2 = parse5(serialize(base2, options), options); + relative = parse5(serialize(relative, options), options); } options = options || {}; if (!options.tolerant && relative.scheme) { @@ -74278,24 +74432,24 @@ var require_uri_all = __commonJS2((exports, module) => { } function resolve(baseURI, relativeURI, options) { var schemelessOptions = assign({ scheme: "null" }, options); - return serialize(resolveComponents(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); + return serialize(resolveComponents(parse5(baseURI, schemelessOptions), parse5(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); } function normalize2(uri, options) { if (typeof uri === "string") { - uri = serialize(parse4(uri, options), options); + uri = serialize(parse5(uri, options), options); } else if (typeOf(uri) === "object") { - uri = parse4(serialize(uri, options), options); + uri = parse5(serialize(uri, options), options); } return uri; } function equal(uriA, uriB, options) { if (typeof uriA === "string") { - uriA = serialize(parse4(uriA, options), options); + uriA = serialize(parse5(uriA, options), options); } else if (typeOf(uriA) === "object") { uriA = serialize(uriA, options); } if (typeof uriB === "string") { - uriB = serialize(parse4(uriB, options), options); + uriB = serialize(parse5(uriB, options), options); } else if (typeOf(uriB) === "object") { uriB = serialize(uriB, options); } @@ -74310,7 +74464,7 @@ var require_uri_all = __commonJS2((exports, module) => { var handler2 = { scheme: "http", domainHost: true, - parse: function parse5(components, options) { + parse: function parse6(components, options) { if (!components.host) { components.error = components.error || "HTTP URIs must have a host."; } @@ -74339,7 +74493,7 @@ var require_uri_all = __commonJS2((exports, module) => { var handler$2 = { scheme: "ws", domainHost: true, - parse: function parse5(components, options) { + parse: function parse6(components, options) { var wsComponents = components; wsComponents.secure = isSecure(wsComponents); wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : ""); @@ -74356,8 +74510,8 @@ var require_uri_all = __commonJS2((exports, module) => { wsComponents.secure = void 0; } if (wsComponents.resourceName) { - var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path = _wsComponents$resourc2[0], query2 = _wsComponents$resourc2[1]; - wsComponents.path = path && path !== "/" ? path : void 0; + var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path2 = _wsComponents$resourc2[0], query2 = _wsComponents$resourc2[1]; + wsComponents.path = path2 && path2 !== "/" ? path2 : void 0; wsComponents.query = query2; wsComponents.resourceName = void 0; } @@ -74515,7 +74669,7 @@ var require_uri_all = __commonJS2((exports, module) => { var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; var handler$6 = { scheme: "urn:uuid", - parse: function parse5(urnComponents, options) { + parse: function parse6(urnComponents, options) { var uuidComponents = urnComponents; uuidComponents.uuid = uuidComponents.nss; uuidComponents.nss = void 0; @@ -74540,7 +74694,7 @@ var require_uri_all = __commonJS2((exports, module) => { exports2.SCHEMES = SCHEMES; exports2.pctEncChar = pctEncChar; exports2.pctDecChars = pctDecChars; - exports2.parse = parse4; + exports2.parse = parse5; exports2.removeDotSegments = removeDotSegments; exports2.serialize = serialize; exports2.resolveComponents = resolveComponents; @@ -74744,12 +74898,12 @@ var require_util8 = __commonJS2((exports, module) => { return "'" + escapeQuotes(str) + "'"; } function getPathExpr(currentPath, expr, jsonPointers, isNumber2) { - var path = jsonPointers ? "'/' + " + expr + (isNumber2 ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber2 ? "'[' + " + expr + " + ']'" : "'[\\'' + " + expr + " + '\\']'"; - return joinPaths(currentPath, path); + var path2 = jsonPointers ? "'/' + " + expr + (isNumber2 ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber2 ? "'[' + " + expr + " + ']'" : "'[\\'' + " + expr + " + '\\']'"; + return joinPaths(currentPath, path2); } function getPath(currentPath, prop, jsonPointers) { - var path = jsonPointers ? toQuotedString("/" + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop)); - return joinPaths(currentPath, path); + var path2 = jsonPointers ? toQuotedString("/" + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop)); + return joinPaths(currentPath, path2); } var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; @@ -75975,7 +76129,7 @@ var require_formats = __commonJS2((exports, module) => { var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; - var URL2 = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; + var URL22 = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/; var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; @@ -75992,7 +76146,7 @@ var require_formats = __commonJS2((exports, module) => { uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, "uri-template": URITEMPLATE, - url: URL2, + url: URL22, email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, hostname: HOSTNAME, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, @@ -76010,7 +76164,7 @@ var require_formats = __commonJS2((exports, module) => { uri, "uri-reference": URIREF, "uri-template": URITEMPLATE, - url: URL2, + url: URL22, email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, hostname: HOSTNAME, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, @@ -79688,29 +79842,29 @@ var NodeFsOperations = { } } }, - appendFileSync(path, data) { - fs.appendFileSync(path, data); + appendFileSync(path2, data) { + fs.appendFileSync(path2, data); }, copyFileSync(src, dest) { fs.copyFileSync(src, dest); }, - unlinkSync(path) { - fs.unlinkSync(path); + unlinkSync(path2) { + fs.unlinkSync(path2); }, renameSync(oldPath, newPath) { fs.renameSync(oldPath, newPath); }, - linkSync(target, path) { - fs.linkSync(target, path); + linkSync(target, path2) { + fs.linkSync(target, path2); }, - symlinkSync(target, path) { - fs.symlinkSync(target, path); + symlinkSync(target, path2) { + fs.symlinkSync(target, path2); }, - readlinkSync(path) { - return fs.readlinkSync(path); + readlinkSync(path2) { + return fs.readlinkSync(path2); }, - realpathSync(path) { - return fs.realpathSync(path); + realpathSync(path2) { + return fs.realpathSync(path2); }, mkdirSync(dirPath) { if (!fs.existsSync(dirPath)) { @@ -79730,11 +79884,11 @@ var NodeFsOperations = { rmdirSync(dirPath) { fs.rmdirSync(dirPath); }, - rmSync(path, options) { - fs.rmSync(path, options); + rmSync(path2, options) { + fs.rmSync(path2, options); }, - createWriteStream(path) { - return fs.createWriteStream(path); + createWriteStream(path2) { + return fs.createWriteStream(path2); } }; var activeFs = NodeFsOperations; @@ -79767,7 +79921,7 @@ var ProcessTransport = class { const { additionalDirectories = [], agents, - cwd: cwd2, + cwd: cwd4, executable = isRunningWithBun() ? "bun" : "node", executableArgs = [], extraArgs = {}, @@ -79902,7 +80056,7 @@ var ProcessTransport = class { this.logForDebugging(isNative ? `Spawning Claude Code native binary: ${spawnCommand} ${spawnArgs.join(" ")}` : `Spawning Claude Code process: ${spawnCommand} ${spawnArgs.join(" ")}`); const stderrMode = env2.DEBUG || stderr ? "pipe" : "ignore"; this.child = spawn(spawnCommand, spawnArgs, { - cwd: cwd2, + cwd: cwd4, stdio: ["pipe", "pipe", stderrMode], signal: this.abortController.signal, env: env2 @@ -80596,7 +80750,7 @@ function shouldShowDebugMessage(message, filter) { return shouldShowDebugCategories(categories, filter); } function getClaudeConfigHomeDir() { - return process.env.CLAUDE_CONFIG_DIR ?? join(homedir(), ".claude"); + return process.env.CLAUDE_CONFIG_DIR ?? join2(homedir(), ".claude"); } function isEnvTruthy(envVar) { if (!envVar) @@ -80664,7 +80818,7 @@ var maxOutputTokensValidator = { } }; function getInitialState() { - const resolvedCwd = realpathSync2(cwd()); + const resolvedCwd = realpathSync2(cwd3()); return { originalCwd: resolvedCwd, totalCostUSD: 0, @@ -80762,20 +80916,20 @@ function logForDebugging(message, { level } = { writeToStderr(output); return; } - if (!getFsImplementation().existsSync(dirname(getDebugLogPath()))) { - getFsImplementation().mkdirSync(dirname(getDebugLogPath())); + if (!getFsImplementation().existsSync(dirname2(getDebugLogPath()))) { + getFsImplementation().mkdirSync(dirname2(getDebugLogPath())); } getFsImplementation().appendFileSync(getDebugLogPath(), output); updateLatestDebugLogSymlink(); } function getDebugLogPath() { - return process.env.CLAUDE_CODE_DEBUG_LOGS_DIR ?? join2(getClaudeConfigHomeDir(), "debug", `${getSessionId()}.txt`); + return process.env.CLAUDE_CODE_DEBUG_LOGS_DIR ?? join22(getClaudeConfigHomeDir(), "debug", `${getSessionId()}.txt`); } var updateLatestDebugLogSymlink = memoize_default(() => { try { const debugLogPath = getDebugLogPath(); - const debugLogsDir = dirname(debugLogPath); - const latestSymlinkPath = join2(debugLogsDir, "latest"); + const debugLogsDir = dirname2(debugLogPath); + const latestSymlinkPath = join22(debugLogsDir, "latest"); if (!getFsImplementation().existsSync(debugLogsDir)) { getFsImplementation().mkdirSync(debugLogsDir); } @@ -81631,8 +81785,8 @@ function getErrorMap() { return overrideErrorMap; } var makeIssue = (params) => { - const { data, path, errorMaps, issueData } = params; - const fullPath = [...path, ...issueData.path || []]; + const { data, path: path2, errorMaps, issueData } = params; + const fullPath = [...path2, ...issueData.path || []]; const fullIssue = { ...issueData, path: fullPath @@ -81740,11 +81894,11 @@ var errorUtil; errorUtil22.toString = (message) => typeof message === "string" ? message : message?.message; })(errorUtil || (errorUtil = {})); var ParseInputLazyPath = class { - constructor(parent, value2, path, key) { + constructor(parent, value2, path2, key) { this._cachedPath = []; this.parent = parent; this.data = value2; - this._path = path; + this._path = path2; this._key = key; } get path() { @@ -81883,8 +82037,8 @@ var ZodType = class { } : { issues: ctx.common.issues }; - } catch (err) { - if (err?.message?.toLowerCase()?.includes("encountered")) { + } catch (err2) { + if (err2?.message?.toLowerCase()?.includes("encountered")) { this["~standard"].async = true; } ctx.common = { @@ -85687,9 +85841,9 @@ function query({ } let pathToClaudeCodeExecutable = rest.pathToClaudeCodeExecutable; if (!pathToClaudeCodeExecutable) { - const filename = fileURLToPath(import.meta.url); - const dirname2 = join3(filename, ".."); - pathToClaudeCodeExecutable = join3(dirname2, "cli.js"); + const filename = fileURLToPath3(import.meta.url); + const dirname22 = join3(filename, ".."); + pathToClaudeCodeExecutable = join3(dirname22, "cli.js"); } process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.30"; const { @@ -85699,7 +85853,7 @@ function query({ allowedTools = [], canUseTool, continue: continueConversation, - cwd: cwd2, + cwd: cwd22, disallowedTools = [], env: env2, executable = isRunningWithBun() ? "bun" : "node", @@ -85753,7 +85907,7 @@ function query({ abortController, additionalDirectories, agents, - cwd: cwd2, + cwd: cwd22, executable, executableArgs, extraArgs, @@ -85805,7 +85959,7 @@ function query({ // package.json var package_default = { name: "@pullfrog/action", - version: "0.0.83", + version: "0.0.84", type: "module", files: [ "index.js", @@ -86127,9 +86281,9 @@ var generateJWT = (appId, privateKey) => { const signature = createSign("RSA-SHA256").update(signaturePart).sign(privateKey, "base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""); return `${signaturePart}.${signature}`; }; -var githubRequest = async (path, options = {}) => { +var githubRequest = async (path2, options = {}) => { const { method = "GET", headers = {}, body } = options; - const url2 = `https://api.github.com${path}`; + const url2 = `https://api.github.com${path2}`; const requestHeaders = { Accept: "application/vnd.github.v3+json", "User-Agent": "Pullfrog-Installation-Token-Generator/1.0", @@ -88106,7 +88260,7 @@ var Server = class extends Protocol { }; // node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js -import process2 from "node:process"; +import process4 from "node:process"; // node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js var ReadBuffer = class { @@ -88138,7 +88292,7 @@ function serializeMessage(message) { // node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js var StdioServerTransport = class { - constructor(_stdin = process2.stdin, _stdout = process2.stdout) { + constructor(_stdin = process4.stdin, _stdout = process4.stdout) { this._stdin = _stdin; this._stdout = _stdout; this._readBuffer = new ReadBuffer(); @@ -88274,14 +88428,14 @@ var KeyStore = class { } }; function createKey(key) { - let path = null; + let path2 = null; let id = null; let src = null; let weight = 1; let getFn = null; if (isString(key) || isArray2(key)) { src = key; - path = createKeyPath(key); + path2 = createKeyPath(key); id = createKeyId(key); } else { if (!hasOwn.call(key, "name")) { @@ -88295,11 +88449,11 @@ function createKey(key) { throw new Error(INVALID_KEY_WEIGHT_VALUE(name)); } } - path = createKeyPath(name); + path2 = createKeyPath(name); id = createKeyId(name); getFn = key.getFn; } - return { path, id, weight, src, getFn }; + return { path: path2, id, weight, src, getFn }; } function createKeyPath(key) { return isArray2(key) ? key : key.split("."); @@ -88307,34 +88461,34 @@ function createKeyPath(key) { function createKeyId(key) { return isArray2(key) ? key.join(".") : key; } -function get(obj, path) { +function get(obj, path2) { let list = []; let arr = false; - const deepGet = (obj2, path2, index) => { + const deepGet = (obj2, path3, index) => { if (!isDefined(obj2)) { return; } - if (!path2[index]) { + if (!path3[index]) { list.push(obj2); } else { - let key = path2[index]; + let key = path3[index]; const value2 = obj2[key]; if (!isDefined(value2)) { return; } - if (index === path2.length - 1 && (isString(value2) || isNumber(value2) || isBoolean(value2))) { + if (index === path3.length - 1 && (isString(value2) || isNumber(value2) || isBoolean(value2))) { list.push(toString(value2)); } else if (isArray2(value2)) { arr = true; for (let i = 0, len = value2.length; i < len; i += 1) { - deepGet(value2[i], path2, index + 1); + deepGet(value2[i], path3, index + 1); } - } else if (path2.length) { - deepGet(value2, path2, index + 1); + } else if (path3.length) { + deepGet(value2, path3, index + 1); } } }; - deepGet(obj, isString(path) ? path.split(".") : path, 0); + deepGet(obj, isString(path2) ? path2.split(".") : path2, 0); return arr ? list : list[0]; } var MatchOptions = { @@ -89211,7 +89365,7 @@ var convertToExplicit = (query2) => ({ [key]: query2[key] })) }); -function parse(query2, options, { auto = true } = {}) { +function parse2(query2, options, { auto = true } = {}) { const next2 = (query3) => { let keys = Object.keys(query3); const isQueryPath = isPath(query3); @@ -89400,7 +89554,7 @@ var Fuse = class { return results; } _searchLogical(query2) { - const expression = parse(query2, this.options); + const expression = parse2(query2, this.options); const evaluate = (node2, item, idx) => { if (!node2.children) { const { keyId, searcher } = node2; @@ -89516,7 +89670,7 @@ Fuse.createIndex = createIndex; Fuse.parseIndex = parseIndex; Fuse.config = Config; { - Fuse.parseQuery = parse; + Fuse.parseQuery = parse2; } { register2(ExtendedSearch); @@ -89907,8 +90061,8 @@ function getErrorMap3() { return overrideErrorMap3; } var makeIssue3 = (params) => { - const { data, path, errorMaps, issueData } = params; - const fullPath = [...path, ...issueData.path || []]; + const { data, path: path2, errorMaps, issueData } = params; + const fullPath = [...path2, ...issueData.path || []]; const fullIssue = { ...issueData, path: fullPath @@ -90014,11 +90168,11 @@ var errorUtil3; errorUtil$1.toString = (message) => typeof message === "string" ? message : message?.message; })(errorUtil3 || (errorUtil3 = {})); var ParseInputLazyPath3 = class { - constructor(parent, value2, path, key$1) { + constructor(parent, value2, path2, key$1) { this._cachedPath = []; this.parent = parent; this.data = value2; - this._path = path; + this._path = path2; this._key = key$1; } get path() { @@ -90147,8 +90301,8 @@ var ZodType3 = class { parent: ctx }); return isValid3(result) ? { value: result.value } : { issues: ctx.common.issues }; - } catch (err) { - if (err?.message?.toLowerCase()?.includes("encountered")) this["~standard"].async = true; + } catch (err2) { + if (err2?.message?.toLowerCase()?.includes("encountered")) this["~standard"].async = true; ctx.common = { issues: [], async: true @@ -93780,7 +93934,7 @@ var require_depd = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/depd@2.0.0/ function log2(message, site) { var haslisteners = eehaslisteners(process, "deprecation"); if (!haslisteners && this._ignored) return; - var caller; + var caller2; var callFile; var callSite; var depSite; @@ -93799,23 +93953,23 @@ var require_depd = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/depd@2.0.0/ callSite = depSite; } for (; i$3 < stack.length; i$3++) { - caller = callSiteLocation(stack[i$3]); - callFile = caller[0]; + caller2 = callSiteLocation(stack[i$3]); + callFile = caller2[0]; if (callFile === file) seen = true; else if (callFile === this._file) file = this._file; else if (seen) break; } - var key$1 = caller ? depSite.join(":") + "__" + caller.join(":") : void 0; + var key$1 = caller2 ? depSite.join(":") + "__" + caller2.join(":") : void 0; if (key$1 !== void 0 && key$1 in this._warned) return; this._warned[key$1] = true; var msg = message; if (!msg) msg = callSite === depSite || !callSite.name ? defaultMessage(depSite) : defaultMessage(callSite); if (haslisteners) { - var err = DeprecationError(this._namespace, msg, stack.slice(i$3)); - process.emit("deprecation", err); + var err2 = DeprecationError(this._namespace, msg, stack.slice(i$3)); + process.emit("deprecation", err2); return; } - var output = (process.stderr.isTTY ? formatColor : formatPlain).call(this, msg, caller, stack.slice(i$3)); + var output = (process.stderr.isTTY ? formatColor : formatPlain).call(this, msg, caller2, stack.slice(i$3)); process.stderr.write(output + "\n", "utf8"); } function callSiteLocation(callSite) { @@ -93842,22 +93996,22 @@ var require_depd = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/depd@2.0.0/ if (typeName === "Function") typeName = context.name || typeName; return typeName && callSite.getMethodName() ? typeName + "." + funcName : funcName; } - function formatPlain(msg, caller, stack) { + function formatPlain(msg, caller2, stack) { var formatted = (/* @__PURE__ */ new Date()).toUTCString() + " " + this._namespace + " deprecated " + msg; if (this._traced) { for (var i$3 = 0; i$3 < stack.length; i$3++) formatted += "\n at " + stack[i$3].toString(); return formatted; } - if (caller) formatted += " at " + formatLocation(caller); + if (caller2) formatted += " at " + formatLocation(caller2); return formatted; } - function formatColor(msg, caller, stack) { + function formatColor(msg, caller2, stack) { var formatted = "\x1B[36;1m" + this._namespace + "\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m" + msg + "\x1B[39m"; if (this._traced) { for (var i$3 = 0; i$3 < stack.length; i$3++) formatted += "\n \x1B[36mat " + stack[i$3].toString() + "\x1B[39m"; return formatted; } - if (caller) formatted += " \x1B[36m" + formatLocation(caller) + "\x1B[39m"; + if (caller2) formatted += " \x1B[36m" + formatLocation(caller2) + "\x1B[39m"; return formatted; } function formatLocation(callSite) { @@ -94132,7 +94286,7 @@ var require_http_errors = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/http return Number(String(status$1).charAt(0) + "00"); } function createError$1() { - var err; + var err2; var msg; var status$1 = 500; var props = {}; @@ -94140,8 +94294,8 @@ var require_http_errors = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/http var arg = arguments[i$3]; var type2 = typeof arg; if (type2 === "object" && arg instanceof Error) { - err = arg; - status$1 = err.status || err.statusCode || status$1; + err2 = arg; + status$1 = err2.status || err2.statusCode || status$1; } else if (type2 === "number" && i$3 === 0) status$1 = arg; else if (type2 === "string") msg = arg; else if (type2 === "object") props = arg; @@ -94150,16 +94304,16 @@ var require_http_errors = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/http if (typeof status$1 === "number" && (status$1 < 400 || status$1 >= 600)) deprecate("non-error status code; use only 4xx or 5xx status codes"); if (typeof status$1 !== "number" || !statuses.message[status$1] && (status$1 < 400 || status$1 >= 600)) status$1 = 500; var HttpError = createError$1[status$1] || createError$1[codeClass(status$1)]; - if (!err) { - err = HttpError ? new HttpError(msg) : new Error(msg || statuses.message[status$1]); - Error.captureStackTrace(err, createError$1); + if (!err2) { + err2 = HttpError ? new HttpError(msg) : new Error(msg || statuses.message[status$1]); + Error.captureStackTrace(err2, createError$1); } - if (!HttpError || !(err instanceof HttpError) || err.status !== status$1) { - err.expose = status$1 < 500; - err.status = err.statusCode = status$1; + if (!HttpError || !(err2 instanceof HttpError) || err2.status !== status$1) { + err2.expose = status$1 < 500; + err2.status = err2.statusCode = status$1; } - for (var key$1 in props) if (key$1 !== "status" && key$1 !== "statusCode") err[key$1] = props[key$1]; - return err; + for (var key$1 in props) if (key$1 !== "status" && key$1 !== "statusCode") err2[key$1] = props[key$1]; + return err2; } function createHttpErrorConstructor() { function HttpError() { @@ -94172,22 +94326,22 @@ var require_http_errors = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/http var className = toClassName(name); function ClientError(message) { var msg = message != null ? message : statuses.message[code]; - var err = new Error(msg); - Error.captureStackTrace(err, ClientError); - setPrototypeOf(err, ClientError.prototype); - Object.defineProperty(err, "message", { + var err2 = new Error(msg); + Error.captureStackTrace(err2, ClientError); + setPrototypeOf(err2, ClientError.prototype); + Object.defineProperty(err2, "message", { enumerable: true, configurable: true, value: msg, writable: true }); - Object.defineProperty(err, "name", { + Object.defineProperty(err2, "name", { enumerable: false, configurable: true, value: className, writable: true }); - return err; + return err2; } inherits(ClientError, HttpError); nameFunc(ClientError, className); @@ -94207,22 +94361,22 @@ var require_http_errors = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/http var className = toClassName(name); function ServerError2(message) { var msg = message != null ? message : statuses.message[code]; - var err = new Error(msg); - Error.captureStackTrace(err, ServerError2); - setPrototypeOf(err, ServerError2.prototype); - Object.defineProperty(err, "message", { + var err2 = new Error(msg); + Error.captureStackTrace(err2, ServerError2); + setPrototypeOf(err2, ServerError2.prototype); + Object.defineProperty(err2, "message", { enumerable: true, configurable: true, value: msg, writable: true }); - Object.defineProperty(err, "name", { + Object.defineProperty(err2, "name", { enumerable: false, configurable: true, value: className, writable: true }); - return err; + return err2; } inherits(ServerError2, HttpError); nameFunc(ServerError2, className); @@ -102993,8 +103147,8 @@ var require_raw_body = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/raw-bod var length = opts.length != null && !isNaN(opts.length) ? parseInt(opts.length, 10) : null; if (done) return readStream(stream, encoding, length, limit, wrap(done)); return new Promise(function executor(resolve$4, reject) { - readStream(stream, encoding, length, limit, function onRead(err, buf) { - if (err) return reject(err); + readStream(stream, encoding, length, limit, function onRead(err2, buf) { + if (err2) return reject(err2); resolve$4(buf); }); }); @@ -103019,8 +103173,8 @@ var require_raw_body = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/raw-bod var decoder; try { decoder = getDecoder(encoding); - } catch (err) { - return done(err); + } catch (err2) { + return done(err2); } var buffer$1 = decoder ? "" : []; stream.on("aborted", onAborted); @@ -103062,9 +103216,9 @@ var require_raw_body = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/raw-bod else if (decoder) buffer$1 += decoder.write(chunk); else buffer$1.push(chunk); } - function onEnd(err) { + function onEnd(err2) { if (complete) return; - if (err) return done(err); + if (err2) return done(err2); if (length !== null && received !== length) done(createError(400, "request size did not match content length", { expected: length, length, @@ -103103,8 +103257,8 @@ var require_content_type = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/con var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g; var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g; var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; - exports.parse = parse4; - function parse4(string3) { + exports.parse = parse5; + function parse5(string3) { if (!string3) throw new TypeError("argument string is required"); var header = typeof string3 === "object" ? getcontenttype(string3) : string3; if (typeof header !== "string") throw new TypeError("argument string is required to be a string"); @@ -104162,9 +104316,9 @@ var require_uri_all3 = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/uri-js@ _arr.push(_s.value); if (i$3 && _arr.length === i$3) break; } - } catch (err) { + } catch (err2) { _d = true; - _e = err; + _e = err2; } finally { try { if (!_n && _i["return"]) _i["return"](); @@ -104312,9 +104466,9 @@ var require_uri_all3 = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/uri-js@ var _currentValue2 = _step.value; if (_currentValue2 < 128) output.push(stringFromCharCode(_currentValue2)); } - } catch (err) { + } catch (err2) { _didIteratorError = true; - _iteratorError = err; + _iteratorError = err2; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) _iterator.return(); @@ -104335,9 +104489,9 @@ var require_uri_all3 = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/uri-js@ var currentValue = _step2.value; if (currentValue >= n && currentValue < m) m = currentValue; } - } catch (err) { + } catch (err2) { _didIteratorError2 = true; - _iteratorError2 = err; + _iteratorError2 = err2; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) _iterator2.return(); @@ -104372,9 +104526,9 @@ var require_uri_all3 = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/uri-js@ ++handledCPCount; } } - } catch (err) { + } catch (err2) { _didIteratorError3 = true; - _iteratorError3 = err; + _iteratorError3 = err2; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return) _iterator3.return(); @@ -104741,8 +104895,8 @@ var require_uri_all3 = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/uri-js@ wsComponents.secure = void 0; } if (wsComponents.resourceName) { - var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path = _wsComponents$resourc2[0], query2 = _wsComponents$resourc2[1]; - wsComponents.path = path && path !== "/" ? path : void 0; + var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path2 = _wsComponents$resourc2[0], query2 = _wsComponents$resourc2[1]; + wsComponents.path = path2 && path2 !== "/" ? path2 : void 0; wsComponents.query = query2; wsComponents.resourceName = void 0; } @@ -105079,12 +105233,12 @@ var require_util10 = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/ajv@6.12. return "'" + escapeQuotes(str) + "'"; } function getPathExpr(currentPath, expr, jsonPointers, isNumber2) { - var path = jsonPointers ? "'/' + " + expr + (isNumber2 ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber2 ? "'[' + " + expr + " + ']'" : "'[\\'' + " + expr + " + '\\']'"; - return joinPaths(currentPath, path); + var path2 = jsonPointers ? "'/' + " + expr + (isNumber2 ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber2 ? "'[' + " + expr + " + ']'" : "'[\\'' + " + expr + " + '\\']'"; + return joinPaths(currentPath, path2); } function getPath(currentPath, prop, jsonPointers) { - var path = jsonPointers ? toQuotedString("/" + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop)); - return joinPaths(currentPath, path); + var path2 = jsonPointers ? toQuotedString("/" + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop)); + return joinPaths(currentPath, path2); } var JSON_POINTER$1 = /^\/(?:[^~]|~0|~1)*$/; var RELATIVE_JSON_POINTER$1 = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; @@ -109100,17 +109254,17 @@ function syntaxError(message) { const DomException = globalThis.DOMException; return typeof DomException == "function" ? new DomException(message, "SyntaxError") : new SyntaxError(message); } -function flattenError(err) { - return err instanceof Error ? "errors" in err && Array.isArray(err.errors) ? err.errors.map(flattenError).join(", ") : "cause" in err && err.cause instanceof Error ? `${err}: ${flattenError(err.cause)}` : err.message : `${err}`; +function flattenError(err2) { + return err2 instanceof Error ? "errors" in err2 && Array.isArray(err2.errors) ? err2.errors.map(flattenError).join(", ") : "cause" in err2 && err2.cause instanceof Error ? `${err2}: ${flattenError(err2.cause)}` : err2.message : `${err2}`; } -function inspectableError(err) { +function inspectableError(err2) { return { - type: err.type, - message: err.message, - code: err.code, - defaultPrevented: err.defaultPrevented, - cancelable: err.cancelable, - timeStamp: err.timeStamp + type: err2.type, + message: err2.message, + code: err2.code, + defaultPrevented: err2.defaultPrevented, + cancelable: err2.cancelable, + timeStamp: err2.timeStamp }; } var __typeError = (msg) => { @@ -109176,8 +109330,8 @@ var EventSource = class extends EventTarget { const { done, value: value2 } = await reader.read(); value2 && __privateGet(this, _parser).feed(decoder.decode(value2, { stream: !done })), done && (open2 = false, __privateGet(this, _parser).reset(), __privateMethod(this, _EventSource_instances, scheduleReconnect_fn).call(this)); } while (open2); - }), __privateAdd(this, _onFetchError, (err) => { - __privateSet(this, _controller, void 0), !(err.name === "AbortError" || err.type === "aborted") && __privateMethod(this, _EventSource_instances, scheduleReconnect_fn).call(this, flattenError(err)); + }), __privateAdd(this, _onFetchError, (err2) => { + __privateSet(this, _controller, void 0), !(err2.name === "AbortError" || err2.type === "aborted") && __privateMethod(this, _EventSource_instances, scheduleReconnect_fn).call(this, flattenError(err2)); }), __privateAdd(this, _onEvent, (event) => { typeof event.id == "string" && __privateSet(this, _lastEventId, event.id); const messageEvent = new MessageEvent(event.event || "message", { @@ -110259,8 +110413,8 @@ ${error41 instanceof Error ? error41.stack : JSON.stringify(error41)}` ); if (parsed2.issues) { const friendlyErrors = this.#utils?.formatInvalidParamsErrorMessage ? this.#utils.formatInvalidParamsErrorMessage(parsed2.issues) : parsed2.issues.map((issue2) => { - const path = issue2.path?.join(".") || "root"; - return `${path}: ${issue2.message}`; + const path2 = issue2.path?.join(".") || "root"; + return `${path2}: ${issue2.message}`; }).join(", "); throw new McpError( ErrorCode2.InvalidParams, @@ -110704,10 +110858,10 @@ var FastMCP = class extends FastMCPEventEmitter { const healthConfig = this.#options.health ?? {}; const enabled = healthConfig.enabled === void 0 ? true : healthConfig.enabled; if (enabled) { - const path = healthConfig.path ?? "/health"; + const path2 = healthConfig.path ?? "/health"; const url2 = new URL(req.url || "", `http://${host}`); try { - if (req.method === "GET" && url2.pathname === path) { + if (req.method === "GET" && url2.pathname === path2) { res.writeHead(healthConfig.status ?? 200, { "Content-Type": "text/plain" }).end(healthConfig.message ?? "\u2713 Ok"); @@ -111170,7 +111324,7 @@ function expand(template, context) { return template.replace(/\/$/, ""); } } -function parse3(options) { +function parse4(options) { let method = options.method.toUpperCase(); let url2 = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); let headers = Object.assign({}, options.headers); @@ -111234,7 +111388,7 @@ function parse3(options) { ); } function endpointWithDefaults(defaults, route, options) { - return parse3(merge2(defaults, route, options)); + return parse4(merge2(defaults, route, options)); } function withDefaults(oldDefaults, newDefaults) { const DEFAULTS2 = merge2(oldDefaults, newDefaults); @@ -111243,7 +111397,7 @@ function withDefaults(oldDefaults, newDefaults) { DEFAULTS: DEFAULTS2, defaults: withDefaults.bind(null, DEFAULTS2), merge: merge2.bind(null, DEFAULTS2), - parse: parse3 + parse: parse4 }); } var endpoint = withDefaults(null, DEFAULTS); @@ -111414,7 +111568,7 @@ async function getResponseData(response) { try { text = await response.text(); return JSON.parse(text); - } catch (err) { + } catch (err2) { return text; } } else if (mimetype.type.startsWith("text/") || mimetype.parameters.charset?.toLowerCase() === "utf-8") { @@ -111762,17 +111916,17 @@ function requestLog(octokit) { octokit.log.debug("request", options); const start = Date.now(); const requestOptions = octokit.request.endpoint.parse(options); - const path = requestOptions.url.replace(options.baseUrl, ""); + const path2 = requestOptions.url.replace(options.baseUrl, ""); return request2(options).then((response) => { const requestId = response.headers["x-github-request-id"]; octokit.log.info( - `${requestOptions.method} ${path} - ${response.status} with id ${requestId} in ${Date.now() - start}ms` + `${requestOptions.method} ${path2} - ${response.status} with id ${requestId} in ${Date.now() - start}ms` ); return response; }).catch((error41) => { const requestId = error41.response?.headers["x-github-request-id"] || "UNKNOWN"; octokit.log.error( - `${requestOptions.method} ${path} - ${error41.status} with id ${requestId} in ${Date.now() - start}ms` + `${requestOptions.method} ${path2} - ${error41.status} with id ${requestId} in ${Date.now() - start}ms` ); throw error41; }); @@ -114556,10 +114710,10 @@ async function printDirectoryTree(dir, prefix = "", rootDir = dir) { return lines.join("\n"); } async function run() { - const cwd2 = process.cwd(); - log.info(`Current working directory: ${cwd2}`); + const actionDir = dirName(); + log.info(`action dir: ${actionDir}`); try { - const tree = await printDirectoryTree(cwd2); + const tree = await printDirectoryTree(actionDir); log.info(`Directory tree: ${tree}`); } catch (error41) { diff --git a/entry.ts b/entry.ts index d791029..083a859 100644 --- a/entry.ts +++ b/entry.ts @@ -7,6 +7,7 @@ import { readdir } from "node:fs/promises"; import { join } from "node:path"; import * as core from "@actions/core"; +import { dirName } from "@ark/fs"; import { type Inputs, main } from "./main.ts"; import { createMcpServer } from "./mcp/server.ts"; import { log } from "./utils/cli.ts"; @@ -38,10 +39,10 @@ async function printDirectoryTree(dir: string, prefix = "", rootDir = dir): Prom async function run(): Promise { // Debug: Print current directory tree before changing directories - const cwd = process.cwd(); - log.info(`Current working directory: ${cwd}`); + const actionDir = dirName(); + log.info(`action dir: ${actionDir}`); try { - const tree = await printDirectoryTree(cwd); + const tree = await printDirectoryTree(actionDir); log.info(`Directory tree:\n${tree}`); } catch (error) { log.warning( diff --git a/package.json b/package.json index dad0204..261e73a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pullfrog/action", - "version": "0.0.83", + "version": "0.0.84", "type": "module", "files": [ "index.js",