@lousy-agents/mcp 5.17.2 → 5.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31635,8 +31635,6 @@ const pathe_M_eThtNZ_path = (/* unused pure expression or super */ null && ({
31635
31635
  var lib_main = __webpack_require__(5599);
31636
31636
  // EXTERNAL MODULE: external "node:assert"
31637
31637
  var external_node_assert_ = __webpack_require__(4589);
31638
- // EXTERNAL MODULE: external "node:v8"
31639
- var external_node_v8_ = __webpack_require__(8877);
31640
31638
  // EXTERNAL MODULE: external "node:util"
31641
31639
  var external_node_util_ = __webpack_require__(7975);
31642
31640
  ;// CONCATENATED MODULE: ../../node_modules/exsolve/dist/index.mjs
@@ -31646,9 +31644,6 @@ var external_node_util_ = __webpack_require__(7975);
31646
31644
 
31647
31645
 
31648
31646
 
31649
-
31650
-
31651
- //#region src/internal/builtins.ts
31652
31647
  const nodeBuiltins = [
31653
31648
  "_http_agent",
31654
31649
  "_http_client",
@@ -31719,12 +31714,8 @@ const nodeBuiltins = [
31719
31714
  "worker_threads",
31720
31715
  "zlib"
31721
31716
  ];
31722
-
31723
- //#endregion
31724
- //#region src/internal/errors.ts
31725
- const own$1 = {}.hasOwnProperty;
31726
31717
  const classRegExp = /^([A-Z][a-z\d]*)+$/;
31727
- const kTypes = new Set([
31718
+ const kTypes = /* @__PURE__ */ new Set([
31728
31719
  "string",
31729
31720
  "function",
31730
31721
  "number",
@@ -31736,83 +31727,95 @@ const kTypes = new Set([
31736
31727
  "symbol"
31737
31728
  ]);
31738
31729
  const dist_messages = /* @__PURE__ */ new Map();
31739
- const nodeInternalPrefix = "__node_internal_";
31740
- let userStackTraceLimit;
31741
- /**
31742
- * Create a list string in the form like 'A and B' or 'A, B, ..., and Z'.
31743
- * We cannot use Intl.ListFormat because it's not available in
31744
- * --without-intl builds.
31745
- *
31746
- * @param {Array<string>} array
31747
- * An array of strings.
31748
- * @param {string} [type]
31749
- * The list type to be inserted before the last element.
31750
- * @returns {string}
31751
- */
31752
31730
  function formatList(array, type = "and") {
31753
- return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
31731
+ switch (array.length) {
31732
+ case 0: return "";
31733
+ case 1: return `${array[0]}`;
31734
+ case 2: return `${array[0]} ${type} ${array[1]}`;
31735
+ case 3: return `${array[0]}, ${array[1]}, ${type} ${array[2]}`;
31736
+ default: return `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
31737
+ }
31738
+ }
31739
+ function getExpectedArgumentLength(message) {
31740
+ let expectedLength = 0;
31741
+ const regex = /%[dfijoOs]/g;
31742
+ while (regex.exec(message) !== null) expectedLength++;
31743
+ return expectedLength;
31754
31744
  }
31755
- /**
31756
- * Utility function for registering the error codes.
31757
- */
31758
31745
  function createError(sym, value, constructor) {
31759
31746
  dist_messages.set(sym, value);
31760
31747
  return makeNodeErrorWithCode(constructor, sym);
31761
31748
  }
31749
+ const kIsNodeError = Symbol("kIsNodeError");
31762
31750
  function makeNodeErrorWithCode(Base, key) {
31763
- return function NodeError(...parameters) {
31764
- const limit = Error.stackTraceLimit;
31765
- if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
31766
- const error = new Base();
31767
- if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
31768
- const message = getMessage(key, parameters, error);
31769
- Object.defineProperties(error, {
31770
- message: {
31771
- value: message,
31772
- enumerable: false,
31773
- writable: true,
31774
- configurable: true
31775
- },
31776
- toString: {
31777
- value() {
31751
+ const message = dist_messages.get(key);
31752
+ const expectedLength = typeof message === "string" ? getExpectedArgumentLength(message) : -1;
31753
+ switch (expectedLength) {
31754
+ case 0: {
31755
+ class NodeError extends Base {
31756
+ code = key;
31757
+ constructor(...args) {
31758
+ external_node_assert_.ok(args.length === 0, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`);
31759
+ super(message);
31760
+ }
31761
+ get ["constructor"]() {
31762
+ return Base;
31763
+ }
31764
+ get [kIsNodeError]() {
31765
+ return true;
31766
+ }
31767
+ toString() {
31778
31768
  return `${this.name} [${key}]: ${this.message}`;
31779
- },
31780
- enumerable: false,
31781
- writable: true,
31782
- configurable: true
31769
+ }
31783
31770
  }
31784
- });
31785
- captureLargerStackTrace(error);
31786
- error.code = key;
31787
- return error;
31788
- };
31789
- }
31790
- function isErrorStackTraceLimitWritable() {
31791
- try {
31792
- if (external_node_v8_.startupSnapshot.isBuildingSnapshot()) return false;
31793
- } catch {}
31794
- const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
31795
- if (desc === void 0) return Object.isExtensible(Error);
31796
- return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
31797
- }
31798
- /**
31799
- * This function removes unnecessary frames from Node.js core errors.
31800
- */
31801
- function hideStackFrames(wrappedFunction) {
31802
- const hidden = nodeInternalPrefix + wrappedFunction.name;
31803
- Object.defineProperty(wrappedFunction, "name", { value: hidden });
31804
- return wrappedFunction;
31805
- }
31806
- const captureLargerStackTrace = hideStackFrames(function(error) {
31807
- const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
31808
- if (stackTraceLimitIsWritable) {
31809
- userStackTraceLimit = Error.stackTraceLimit;
31810
- Error.stackTraceLimit = Number.POSITIVE_INFINITY;
31771
+ return NodeError;
31772
+ }
31773
+ case -1: {
31774
+ class NodeError extends Base {
31775
+ code = key;
31776
+ constructor(...args) {
31777
+ super();
31778
+ Object.defineProperty(this, "message", {
31779
+ value: getMessage(key, args, this),
31780
+ enumerable: false,
31781
+ writable: true,
31782
+ configurable: true
31783
+ });
31784
+ }
31785
+ get ["constructor"]() {
31786
+ return Base;
31787
+ }
31788
+ get [kIsNodeError]() {
31789
+ return true;
31790
+ }
31791
+ toString() {
31792
+ return `${this.name} [${key}]: ${this.message}`;
31793
+ }
31794
+ }
31795
+ return NodeError;
31796
+ }
31797
+ default: {
31798
+ class NodeError extends Base {
31799
+ code = key;
31800
+ constructor(...args) {
31801
+ external_node_assert_.ok(args.length === expectedLength, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`);
31802
+ args.unshift(message);
31803
+ super(Reflect.apply(external_node_util_.format, null, args));
31804
+ }
31805
+ get ["constructor"]() {
31806
+ return Base;
31807
+ }
31808
+ get [kIsNodeError]() {
31809
+ return true;
31810
+ }
31811
+ toString() {
31812
+ return `${this.name} [${key}]: ${this.message}`;
31813
+ }
31814
+ }
31815
+ return NodeError;
31816
+ }
31811
31817
  }
31812
- Error.captureStackTrace(error);
31813
- if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;
31814
- return error;
31815
- });
31818
+ }
31816
31819
  function getMessage(key, parameters, self) {
31817
31820
  const message = dist_messages.get(key);
31818
31821
  external_node_assert_.ok(message !== void 0, "expected `message` to be found");
@@ -31820,29 +31823,44 @@ function getMessage(key, parameters, self) {
31820
31823
  external_node_assert_.ok(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`);
31821
31824
  return Reflect.apply(message, self, parameters);
31822
31825
  }
31823
- const regex = /%[dfijoOs]/g;
31824
- let expectedLength = 0;
31825
- while (regex.exec(message) !== null) expectedLength++;
31826
+ const expectedLength = getExpectedArgumentLength(message);
31826
31827
  external_node_assert_.ok(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`);
31827
31828
  if (parameters.length === 0) return message;
31828
31829
  parameters.unshift(message);
31829
31830
  return Reflect.apply(external_node_util_.format, null, parameters);
31830
31831
  }
31831
- /**
31832
- * Determine the specific type of a value for type-mismatch errors.
31833
- */
31834
31832
  function determineSpecificType(value) {
31835
- if (value === null || value === void 0) return String(value);
31836
- if (typeof value === "function" && value.name) return `function ${value.name}`;
31837
- if (typeof value === "object") {
31838
- if (value.constructor && value.constructor.name) return `an instance of ${value.constructor.name}`;
31839
- return `${(0,external_node_util_.inspect)(value, { depth: -1 })}`;
31833
+ if (value === null) return "null";
31834
+ else if (value === void 0) return "undefined";
31835
+ const type = typeof value;
31836
+ switch (type) {
31837
+ case "bigint": return `type bigint (${value}n)`;
31838
+ case "number":
31839
+ if (value === 0) return 1 / value === Number.NEGATIVE_INFINITY ? "type number (-0)" : "type number (0)";
31840
+ else if (Number.isNaN(value)) return "type number (NaN)";
31841
+ else if (value === Number.POSITIVE_INFINITY) return "type number (Infinity)";
31842
+ else if (value === Number.NEGATIVE_INFINITY) return "type number (-Infinity)";
31843
+ return `type number (${value})`;
31844
+ case "boolean": return value ? "type boolean (true)" : "type boolean (false)";
31845
+ case "symbol": return `type symbol (${String(value)})`;
31846
+ case "function": return `function ${value.name}`;
31847
+ case "object":
31848
+ if (value.constructor && value.constructor.name) return `an instance of ${value.constructor.name}`;
31849
+ return `${(0,external_node_util_.inspect)(value, { depth: -1 })}`;
31850
+ case "string": {
31851
+ let string = value;
31852
+ if (string.length > 28) string = `${string.slice(0, 25)}...`;
31853
+ if (!string.includes("'")) return `type string ('${string}')`;
31854
+ return `type string (${JSON.stringify(string)})`;
31855
+ }
31856
+ default: {
31857
+ let inspected = (0,external_node_util_.inspect)(value, { colors: false });
31858
+ if (inspected.length > 28) inspected = `${inspected.slice(0, 25)}...`;
31859
+ return `type ${type} (${inspected})`;
31860
+ }
31840
31861
  }
31841
- let inspected = (0,external_node_util_.inspect)(value, { colors: false });
31842
- if (inspected.length > 28) inspected = `${inspected.slice(0, 25)}...`;
31843
- return `type ${typeof value} (${inspected})`;
31844
31862
  }
31845
- const ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
31863
+ createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
31846
31864
  external_node_assert_.ok(typeof name === "string", "'name' must be a string");
31847
31865
  if (!Array.isArray(expected)) expected = [expected];
31848
31866
  let message = "The ";
@@ -31866,7 +31884,7 @@ const ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (name, expected
31866
31884
  if (instances.length > 0) {
31867
31885
  const pos = types.indexOf("object");
31868
31886
  if (pos !== -1) {
31869
- types.slice(pos, 1);
31887
+ types.splice(pos, 1);
31870
31888
  instances.push("Object");
31871
31889
  }
31872
31890
  }
@@ -31886,20 +31904,11 @@ const ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (name, expected
31886
31904
  message += `. Received ${determineSpecificType(actual)}`;
31887
31905
  return message;
31888
31906
  }, TypeError);
31889
- const ERR_INVALID_MODULE_SPECIFIER = createError(
31890
- "ERR_INVALID_MODULE_SPECIFIER",
31891
- /**
31892
- * @param {string} request
31893
- * @param {string} reason
31894
- * @param {string} [base]
31895
- */
31896
- (request, reason, base) => {
31897
- return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
31898
- },
31899
- TypeError
31900
- );
31901
- const ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path$1, base, message) => {
31902
- return `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
31907
+ const ERR_INVALID_MODULE_SPECIFIER = createError("ERR_INVALID_MODULE_SPECIFIER", (request, reason, base) => {
31908
+ return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
31909
+ }, TypeError);
31910
+ const ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path, base, message) => {
31911
+ return `Invalid package config ${path}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
31903
31912
  }, Error);
31904
31913
  const ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = false, base) => {
31905
31914
  const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
@@ -31909,39 +31918,30 @@ const ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (pa
31909
31918
  }
31910
31919
  return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? "; targets must start with \"./\"" : ""}`;
31911
31920
  }, Error);
31912
- const ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (path$1, base, exactUrl = false) => {
31913
- return `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`;
31921
+ const ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", function(path, base, exactUrl = false) {
31922
+ if (exactUrl && typeof exactUrl === "string") this.url = `${exactUrl}`;
31923
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path}' imported from ${base}`;
31914
31924
  }, Error);
31915
- const ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error);
31916
31925
  const ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => {
31917
31926
  return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`;
31918
31927
  }, TypeError);
31919
- const ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
31920
- "ERR_PACKAGE_PATH_NOT_EXPORTED",
31921
- /**
31922
- * @param {string} packagePath
31923
- * @param {string} subpath
31924
- * @param {string} [base]
31925
- */
31926
- (packagePath, subpath, base) => {
31927
- if (subpath === ".") return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
31928
- return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
31929
- },
31930
- Error
31931
- );
31932
- const ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error);
31928
+ const ERR_PACKAGE_PATH_NOT_EXPORTED = createError("ERR_PACKAGE_PATH_NOT_EXPORTED", (packagePath, subpath, base) => {
31929
+ if (subpath === ".") return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
31930
+ return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
31931
+ }, Error);
31932
+ const ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", function(path, base, exactUrl = void 0) {
31933
+ this.url = exactUrl;
31934
+ return `Directory import '${path}' is not supported resolving ES modules imported from ${base}`;
31935
+ }, Error);
31933
31936
  const ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", "Failed to resolve module specifier \"%s\" from \"%s\": Invalid relative URL or base scheme is not hierarchical.", TypeError);
31934
- const ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path$1) => {
31935
- return `Unknown file extension "${extension}" for ${path$1}`;
31937
+ const ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path) => {
31938
+ return `Unknown file extension "${extension}" for ${path}`;
31936
31939
  }, TypeError);
31937
- const ERR_INVALID_ARG_VALUE = createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
31940
+ createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
31938
31941
  let inspected = (0,external_node_util_.inspect)(value);
31939
31942
  if (inspected.length > 128) inspected = `${inspected.slice(0, 128)}...`;
31940
31943
  return `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
31941
31944
  }, TypeError);
31942
-
31943
- //#endregion
31944
- //#region src/internal/package-json-reader.ts
31945
31945
  const hasOwnProperty$1 = {}.hasOwnProperty;
31946
31946
  const dist_cache = /* @__PURE__ */ new Map();
31947
31947
  function read(jsonPath, { base, specifier }) {
@@ -31998,9 +31998,6 @@ function getPackageScopeConfig(resolved) {
31998
31998
  type: "none"
31999
31999
  };
32000
32000
  }
32001
-
32002
- //#endregion
32003
- //#region src/internal/get-format.ts
32004
32001
  const dist_hasOwnProperty = {}.hasOwnProperty;
32005
32002
  const extensionFormatMap = {
32006
32003
  __proto__: null,
@@ -32019,33 +32016,25 @@ const protocolHandlers = {
32019
32016
  "node:": () => "builtin"
32020
32017
  };
32021
32018
  function mimeToFormat(mime) {
32022
- if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime)) return "module";
32019
+ if (mime && /^\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?$/i.test(mime)) return "module";
32023
32020
  if (mime === "application/json") return "json";
32024
32021
  return null;
32025
32022
  }
32026
32023
  function getDataProtocolModuleFormat(parsed) {
32027
- const { 1: mime } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(parsed.pathname) || [
32024
+ const { 1: mime } = /^([^/]+\/[^;,]+)(?:[^,]*?)(;base64)?,/.exec(parsed.pathname) || [
32028
32025
  null,
32029
32026
  null,
32030
32027
  null
32031
32028
  ];
32032
32029
  return mimeToFormat(mime);
32033
32030
  }
32034
- /**
32035
- * Returns the file extension from a URL.
32036
- *
32037
- * Should give similar result to
32038
- * `require('node:path').extname(require('node:url').fileURLToPath(url))`
32039
- * when used with a `file:` URL.
32040
- *
32041
- */
32031
+ const DOT_CODE = 46;
32032
+ const SLASH_CODE = 47;
32042
32033
  function dist_extname(url) {
32043
32034
  const pathname = url.pathname;
32044
- let index = pathname.length;
32045
- while (index--) {
32046
- const code = pathname.codePointAt(index);
32047
- if (code === 47) return "";
32048
- if (code === 46) return pathname.codePointAt(index - 1) === 47 ? "" : pathname.slice(index);
32035
+ for (let i = pathname.length - 1; i > 0; i--) switch (pathname.charCodeAt(i)) {
32036
+ case SLASH_CODE: return "";
32037
+ case DOT_CODE: return pathname.charCodeAt(i - 1) === SLASH_CODE ? "" : pathname.slice(i);
32049
32038
  }
32050
32039
  return "";
32051
32040
  }
@@ -32058,11 +32047,12 @@ function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
32058
32047
  }
32059
32048
  if (ext === "") {
32060
32049
  const { type: packageType } = getPackageScopeConfig(url);
32061
- if (packageType === "none" || packageType === "commonjs") return "commonjs";
32062
- return "module";
32050
+ if (packageType === "module") return "module";
32051
+ if (packageType !== "none") return packageType;
32052
+ return "commonjs";
32063
32053
  }
32064
- const format$1 = extensionFormatMap[ext];
32065
- if (format$1) return format$1;
32054
+ const format = extensionFormatMap[ext];
32055
+ if (format) return format;
32066
32056
  if (ignoreErrors) return;
32067
32057
  throw new ERR_UNKNOWN_FILE_EXTENSION(ext, (0,external_node_url_.fileURLToPath)(url));
32068
32058
  }
@@ -32071,9 +32061,6 @@ function defaultGetFormatWithoutErrors(url, context) {
32071
32061
  if (!dist_hasOwnProperty.call(protocolHandlers, protocol)) return null;
32072
32062
  return protocolHandlers[protocol](url, context, true) || null;
32073
32063
  }
32074
-
32075
- //#endregion
32076
- //#region src/internal/resolve.ts
32077
32064
  const RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
32078
32065
  const own = {}.hasOwnProperty;
32079
32066
  const invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i;
@@ -32098,19 +32085,11 @@ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
32098
32085
  if (!main) external_node_process_.emitWarning(`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
32099
32086
  else if (external_node_path_.resolve(packagePath, main) !== urlPath) external_node_process_.emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
32100
32087
  }
32101
- function tryStatSync(path$1) {
32088
+ function tryStatSync(path) {
32102
32089
  try {
32103
- return (0,external_node_fs_.statSync)(path$1);
32090
+ return (0,external_node_fs_.statSync)(path);
32104
32091
  } catch {}
32105
32092
  }
32106
- /**
32107
- * Legacy CommonJS main resolution:
32108
- * 1. let M = pkg_url + (json main field)
32109
- * 2. TRY(M, M.js, M.json, M.node)
32110
- * 3. TRY(M/index.js, M/index.json, M/index.node)
32111
- * 4. TRY(pkg_url/index.js, pkg_url/index.json, pkg_url/index.node)
32112
- * 5. NOT_FOUND
32113
- */
32114
32093
  function dist_fileExists(url) {
32115
32094
  const stats = (0,external_node_fs_.statSync)(url, { throwIfNoEntry: false });
32116
32095
  const isFile = stats ? stats.isFile() : void 0;
@@ -32121,7 +32100,7 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
32121
32100
  if (packageConfig.main !== void 0) {
32122
32101
  guess = new external_node_url_.URL(packageConfig.main, packageJsonUrl);
32123
32102
  if (dist_fileExists(guess)) return guess;
32124
- const tries$1 = [
32103
+ const tries = [
32125
32104
  `./${packageConfig.main}.js`,
32126
32105
  `./${packageConfig.main}.json`,
32127
32106
  `./${packageConfig.main}.node`,
@@ -32129,9 +32108,9 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
32129
32108
  `./${packageConfig.main}/index.json`,
32130
32109
  `./${packageConfig.main}/index.node`
32131
32110
  ];
32132
- let i$1 = -1;
32133
- while (++i$1 < tries$1.length) {
32134
- guess = new external_node_url_.URL(tries$1[i$1], packageJsonUrl);
32111
+ let i = -1;
32112
+ while (++i < tries.length) {
32113
+ guess = new external_node_url_.URL(tries[i], packageJsonUrl);
32135
32114
  if (dist_fileExists(guess)) break;
32136
32115
  guess = void 0;
32137
32116
  }
@@ -32263,7 +32242,7 @@ function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, b
32263
32242
  }
32264
32243
  return resolveResult;
32265
32244
  }
32266
- if (lastException === void 0 || lastException === null) return null;
32245
+ if (lastException === void 0 || lastException === null) return lastException;
32267
32246
  throw lastException;
32268
32247
  }
32269
32248
  if (typeof target === "object" && target !== null) {
@@ -32283,7 +32262,7 @@ function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, b
32283
32262
  return resolveResult;
32284
32263
  }
32285
32264
  }
32286
- return null;
32265
+ return;
32287
32266
  }
32288
32267
  if (target === null) return null;
32289
32268
  throw invalidPackageTarget(packageSubpath, target, packageJsonUrl, internal, base);
@@ -32357,7 +32336,7 @@ function patternKeyCompare(a, b) {
32357
32336
  return 0;
32358
32337
  }
32359
32338
  function packageImportsResolve(name, base, conditions) {
32360
- if (name === "#" || name.startsWith("#/") || name.endsWith("/")) throw new ERR_INVALID_MODULE_SPECIFIER(name, "is not a valid internal imports specifier name", (0,external_node_url_.fileURLToPath)(base));
32339
+ if (name === "#" || name.endsWith("/")) throw new ERR_INVALID_MODULE_SPECIFIER(name, "is not a valid internal imports specifier name", (0,external_node_url_.fileURLToPath)(base));
32361
32340
  let packageJsonUrl;
32362
32341
  const packageConfig = getPackageScopeConfig(base);
32363
32342
  if (packageConfig.exists) {
@@ -32391,10 +32370,6 @@ function packageImportsResolve(name, base, conditions) {
32391
32370
  }
32392
32371
  throw importNotDefined(name, packageJsonUrl, base);
32393
32372
  }
32394
- /**
32395
- * @param {string} specifier
32396
- * @param {URL} base
32397
- */
32398
32373
  function parsePackageName(specifier, base) {
32399
32374
  let separatorIndex = specifier.indexOf("/");
32400
32375
  let validPackageName = true;
@@ -32429,12 +32404,12 @@ function packageResolve(specifier, base, conditions) {
32429
32404
  packageJsonPath = (0,external_node_url_.fileURLToPath)(packageJsonUrl);
32430
32405
  continue;
32431
32406
  }
32432
- const packageConfig$1 = read(packageJsonPath, {
32407
+ const packageConfig = read(packageJsonPath, {
32433
32408
  base,
32434
32409
  specifier
32435
32410
  });
32436
- if (packageConfig$1.exports !== void 0 && packageConfig$1.exports !== null) return packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig$1, base, conditions);
32437
- if (packageSubpath === ".") return legacyMainResolve(packageJsonUrl, packageConfig$1, base);
32411
+ if (packageConfig.exports !== void 0 && packageConfig.exports !== null) return packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions);
32412
+ if (packageSubpath === ".") return legacyMainResolve(packageJsonUrl, packageConfig, base);
32438
32413
  return new external_node_url_.URL(packageSubpath, packageJsonUrl);
32439
32414
  } while (packageJsonPath.length !== lastPath.length);
32440
32415
  // removed by dead control flow
@@ -32452,21 +32427,6 @@ function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
32452
32427
  if (specifier[0] === "/") return true;
32453
32428
  return isRelativeSpecifier(specifier);
32454
32429
  }
32455
- /**
32456
- * The “Resolver Algorithm Specification” as detailed in the Node docs (which is
32457
- * sync and slightly lower-level than `resolve`).
32458
- *
32459
- * @param {string} specifier
32460
- * `/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`, etc.
32461
- * @param {URL} base
32462
- * Full URL (to a file) that `specifier` is resolved relative from.
32463
- * @param {Set<string>} [conditions]
32464
- * Conditions.
32465
- * @param {boolean} [preserveSymlinks]
32466
- * Keep symlinks instead of resolving them.
32467
- * @returns {URL}
32468
- * A URL object to the found thing.
32469
- */
32470
32430
  function moduleResolve(specifier, base, conditions, preserveSymlinks) {
32471
32431
  const protocol = base.protocol;
32472
32432
  const isData = protocol === "data:";
@@ -32493,19 +32453,10 @@ function moduleResolve(specifier, base, conditions, preserveSymlinks) {
32493
32453
  if (resolved.protocol !== "file:") return resolved;
32494
32454
  return finalizeResolution(resolved, base, preserveSymlinks);
32495
32455
  }
32496
-
32497
- //#endregion
32498
- //#region src/resolve.ts
32499
- const DEFAULT_CONDITIONS_SET = /* @__PURE__ */ new Set(["node", "import"]);
32500
- const isWindows = /* @__PURE__ */ (() => process.platform === "win32")();
32501
- const globalCache = /* @__PURE__ */ (() => globalThis["__EXSOLVE_CACHE__"] ||= /* @__PURE__ */ new Map())();
32502
- /**
32503
- * Synchronously resolves a module url based on the options provided.
32504
- *
32505
- * @param {string} input - The identifier or path of the module to resolve.
32506
- * @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
32507
- * @returns {string} The resolved URL as a string.
32508
- */
32456
+ const DEFAULT_CONDITIONS_SET = /* #__PURE__ */ new Set(["node", "import"]);
32457
+ const DEFAULT_CONDITIONS_KEY = "2:6:import4:node";
32458
+ const isWindows = /* #__PURE__ */ (() => process.platform === "win32")();
32459
+ const globalCache = /* #__PURE__ */ (() => globalThis["__EXSOLVE_CACHE__"] ||= /* @__PURE__ */ new Map())();
32509
32460
  function resolveModuleURL(input, options) {
32510
32461
  const parsedInput = _parseInput(input);
32511
32462
  if ("external" in parsedInput) return parsedInput.external;
@@ -32570,15 +32521,6 @@ function resolveModuleURL(input, options) {
32570
32521
  if (cacheObj) cacheObj.set(cacheKey, resolved.href);
32571
32522
  return resolved.href;
32572
32523
  }
32573
- /**
32574
- * Synchronously resolves a module then converts it to a file path
32575
- *
32576
- * (throws error if reolved path is not file:// scheme)
32577
- *
32578
- * @param {string} id - The identifier or path of the module to resolve.
32579
- * @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
32580
- * @returns {string} The resolved URL as a string.
32581
- */
32582
32524
  function resolveModulePath(id, options) {
32583
32525
  const resolved = resolveModuleURL(id, options);
32584
32526
  if (!resolved) return;
@@ -32638,21 +32580,31 @@ function _fmtPath(input) {
32638
32580
  return input;
32639
32581
  }
32640
32582
  }
32641
- function _cacheKey(id, opts) {
32642
- return JSON.stringify([
32643
- id,
32644
- (opts?.conditions || ["node", "import"]).sort(),
32645
- opts?.extensions,
32646
- opts?.from,
32647
- opts?.suffixes
32648
- ]);
32583
+ function _cacheKey(id, options) {
32584
+ let from;
32585
+ if (Array.isArray(options?.from)) from = options.from;
32586
+ else if (options?.from) from = [options.from];
32587
+ return _cacheKeyValues([id]) + _conditionsKey(options?.conditions) + _cacheKeyValues(options?.extensions) + _cacheKeyValues(from) + _cacheKeyValues(options?.suffixes);
32588
+ }
32589
+ function _conditionsKey(conditions) {
32590
+ if (!conditions) return DEFAULT_CONDITIONS_KEY;
32591
+ return _cacheKeyValues([...new Set(conditions)].sort());
32592
+ }
32593
+ function _cacheKeyValues(values) {
32594
+ if (!values) return "-";
32595
+ let key = `${values.length}:`;
32596
+ for (const value of values) {
32597
+ const stringValue = String(value);
32598
+ key += `${stringValue.length}:${stringValue}`;
32599
+ }
32600
+ return key;
32649
32601
  }
32650
32602
  function _join(a, b) {
32651
32603
  if (!a || !b || b === "/") return a;
32652
32604
  return (a.endsWith("/") ? a : a + "/") + (b.startsWith("/") ? b.slice(1) : b);
32653
32605
  }
32654
- function _normalizeWinPath(path$1) {
32655
- return path$1.replace(/\\/g, "/").replace(/^[a-z]:\//, (r) => r.toUpperCase());
32606
+ function _normalizeWinPath(path) {
32607
+ return path.replace(/\\/g, "/").replace(/^[a-z]:\//, (r) => r.toUpperCase());
32656
32608
  }
32657
32609
  function _isURL(input) {
32658
32610
  return input instanceof URL || input?.constructor?.name === "URL";
@@ -32684,7 +32636,6 @@ function _parseInput(input) {
32684
32636
  throw new TypeError("id must be a `string` or `URL`");
32685
32637
  }
32686
32638
 
32687
- //#endregion
32688
32639
 
32689
32640
  // EXTERNAL MODULE: external "node:module"
32690
32641
  var external_node_module_ = __webpack_require__(8995);
@@ -59655,7 +59606,7 @@ function parseWithStatus (uri, opts) {
59655
59606
  if (parsed.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost)) && isIP === false && nonSimpleDomain(parsed.host)) {
59656
59607
  // convert Unicode IDN -> ASCII IDN
59657
59608
  try {
59658
- parsed.host = URL.domainToASCII(parsed.host.toLowerCase())
59609
+ parsed.host = new URL('http://' + parsed.host).hostname
59659
59610
  } catch (e) {
59660
59611
  parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e
59661
59612
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lousy-agents/mcp",
3
- "version": "5.17.2",
3
+ "version": "5.17.3",
4
4
  "description": "MCP server for lousy-agents - provides AI coding assistant tools via the Model Context Protocol",
5
5
  "type": "module",
6
6
  "repository": {