@mcpjam/cli 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,6 +2,9 @@
2
2
  import { config } from "dotenv";
3
3
  import { Command as Command2 } from "commander";
4
4
  import { createRequire as createRequire2 } from "module";
5
+ import path from "path";
6
+ import { existsSync as existsSync2 } from "fs";
7
+ import { fileURLToPath } from "url";
5
8
 
6
9
  // src/evals/index.ts
7
10
  import { Command } from "commander";
@@ -1005,12 +1008,12 @@ function createApi(pathParts = []) {
1005
1008
  `API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${found}\``
1006
1009
  );
1007
1010
  }
1008
- const path = pathParts.slice(0, -1).join("/");
1011
+ const path2 = pathParts.slice(0, -1).join("/");
1009
1012
  const exportName = pathParts[pathParts.length - 1];
1010
1013
  if (exportName === "default") {
1011
- return path;
1014
+ return path2;
1012
1015
  } else {
1013
- return path + ":" + exportName;
1016
+ return path2 + ":" + exportName;
1014
1017
  }
1015
1018
  } else if (prop === Symbol.toStringTag) {
1016
1019
  return "FunctionReference";
@@ -1709,7 +1712,7 @@ var require_constants = __commonJS({
1709
1712
  var require_node_gyp_build = __commonJS({
1710
1713
  "../common/temp/node_modules/.pnpm/node-gyp-build@4.8.4/node_modules/node-gyp-build/node-gyp-build.js"(exports, module) {
1711
1714
  var fs = __require("fs");
1712
- var path = __require("path");
1715
+ var path2 = __require("path");
1713
1716
  var os = __require("os");
1714
1717
  var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
1715
1718
  var vars = process.config && process.config.variables || {};
@@ -1726,21 +1729,21 @@ var require_node_gyp_build = __commonJS({
1726
1729
  return runtimeRequire(load.resolve(dir));
1727
1730
  }
1728
1731
  load.resolve = load.path = function(dir) {
1729
- dir = path.resolve(dir || ".");
1732
+ dir = path2.resolve(dir || ".");
1730
1733
  try {
1731
- var name2 = runtimeRequire(path.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
1734
+ var name2 = runtimeRequire(path2.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
1732
1735
  if (process.env[name2 + "_PREBUILD"]) dir = process.env[name2 + "_PREBUILD"];
1733
1736
  } catch (err) {
1734
1737
  }
1735
1738
  if (!prebuildsOnly) {
1736
- var release = getFirst(path.join(dir, "build/Release"), matchBuild);
1739
+ var release = getFirst(path2.join(dir, "build/Release"), matchBuild);
1737
1740
  if (release) return release;
1738
- var debug = getFirst(path.join(dir, "build/Debug"), matchBuild);
1741
+ var debug = getFirst(path2.join(dir, "build/Debug"), matchBuild);
1739
1742
  if (debug) return debug;
1740
1743
  }
1741
1744
  var prebuild = resolve2(dir);
1742
1745
  if (prebuild) return prebuild;
1743
- var nearby = resolve2(path.dirname(process.execPath));
1746
+ var nearby = resolve2(path2.dirname(process.execPath));
1744
1747
  if (nearby) return nearby;
1745
1748
  var target = [
1746
1749
  "platform=" + platform,
@@ -1757,14 +1760,14 @@ var require_node_gyp_build = __commonJS({
1757
1760
  ].filter(Boolean).join(" ");
1758
1761
  throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
1759
1762
  function resolve2(dir2) {
1760
- var tuples = readdirSync(path.join(dir2, "prebuilds")).map(parseTuple);
1763
+ var tuples = readdirSync(path2.join(dir2, "prebuilds")).map(parseTuple);
1761
1764
  var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];
1762
1765
  if (!tuple) return;
1763
- var prebuilds = path.join(dir2, "prebuilds", tuple.name);
1766
+ var prebuilds = path2.join(dir2, "prebuilds", tuple.name);
1764
1767
  var parsed = readdirSync(prebuilds).map(parseTags);
1765
1768
  var candidates = parsed.filter(matchTags(runtime, abi));
1766
1769
  var winner = candidates.sort(compareTags(runtime))[0];
1767
- if (winner) return path.join(prebuilds, winner.file);
1770
+ if (winner) return path2.join(prebuilds, winner.file);
1768
1771
  }
1769
1772
  };
1770
1773
  function readdirSync(dir) {
@@ -1776,7 +1779,7 @@ var require_node_gyp_build = __commonJS({
1776
1779
  }
1777
1780
  function getFirst(dir, filter) {
1778
1781
  var files = readdirSync(dir).filter(filter);
1779
- return files[0] && path.join(dir, files[0]);
1782
+ return files[0] && path2.join(dir, files[0]);
1780
1783
  }
1781
1784
  function matchBuild(name2) {
1782
1785
  return /\.node$/.test(name2);
@@ -6122,7 +6125,7 @@ import updateNotifier from "update-notifier";
6122
6125
  // package.json
6123
6126
  var package_default = {
6124
6127
  name: "@mcpjam/cli",
6125
- version: "1.1.4",
6128
+ version: "1.1.6",
6126
6129
  type: "module",
6127
6130
  description: "MCPJam CLI for programmatic MCP testing and evals",
6128
6131
  license: "Apache-2.0",
@@ -6183,7 +6186,12 @@ var require3 = createRequire2(import.meta.url);
6183
6186
  updateNotifier({ pkg: package_default, updateCheckInterval: 0 }).notify();
6184
6187
  var { name, version: version2 } = require3("../package.json");
6185
6188
  updateNotifier({ pkg: { name, version: version2 } }).notify();
6186
- var envFile = process.env.NODE_ENV === "production" ? ".env.production" : ".env.development";
6189
+ var __filename = fileURLToPath(import.meta.url);
6190
+ var __dirname2 = path.dirname(__filename);
6191
+ var packageRootDir = path.resolve(__dirname2, "..");
6192
+ var devEnvPath = path.join(packageRootDir, ".env.development");
6193
+ var prodEnvPath = path.join(packageRootDir, ".env.production");
6194
+ var envFile = existsSync2(devEnvPath) ? devEnvPath : prodEnvPath;
6187
6195
  config({ path: envFile });
6188
6196
  var program = new Command2();
6189
6197
  program.name("mcpjam").description("MCPJam CLI for programmatic MCP testing").version(version2);