mcp-squared 0.3.2 → 0.3.4

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
@@ -286,36 +286,28 @@ var exports_monitor_loader = {};
286
286
  __export(exports_monitor_loader, {
287
287
  runMonitorTui: () => runMonitorTui
288
288
  });
289
- function getMonitorModuleSpecifier() {
290
- const modulePath = ["./", "monitor", ".js"].join("");
291
- const baseUrl = new URL(".", import.meta.url);
292
- return new URL(modulePath, baseUrl).href;
293
- }
294
289
  async function loadMonitorModule() {
295
- return import(getMonitorModuleSpecifier());
290
+ return import(MONITOR_MODULE_SPECIFIER);
296
291
  }
297
292
  async function runMonitorTui(options = {}) {
298
293
  const { runMonitorTui: runMonitor } = await loadMonitorModule();
299
294
  return runMonitor(options);
300
295
  }
296
+ var MONITOR_MODULE_SPECIFIER = "./tui/monitor.js";
301
297
 
302
298
  // src/tui/config-loader.ts
303
299
  var exports_config_loader = {};
304
300
  __export(exports_config_loader, {
305
301
  runConfigTui: () => runConfigTui
306
302
  });
307
- function getConfigModuleSpecifier() {
308
- const modulePath = ["./", "config", ".js"].join("");
309
- const baseUrl = new URL(".", import.meta.url);
310
- return new URL(modulePath, baseUrl).href;
311
- }
312
303
  function loadConfigModule() {
313
- return import(getConfigModuleSpecifier());
304
+ return import(CONFIG_MODULE_SPECIFIER);
314
305
  }
315
306
  async function runConfigTui() {
316
307
  const { runConfigTui: _run } = await loadConfigModule();
317
308
  return _run();
318
309
  }
310
+ var CONFIG_MODULE_SPECIFIER = "./tui/config.js";
319
311
 
320
312
  // src/init/runner.ts
321
313
  var exports_runner = {};
@@ -1880,18 +1872,32 @@ function readManifestFile(manifestUrl) {
1880
1872
  }
1881
1873
  function readBundledManifestFile() {
1882
1874
  const require2 = createRequire(import.meta.url);
1883
- return require2("../package.json");
1875
+ const candidates = ["../package.json", "../../package.json"];
1876
+ for (const candidate of candidates) {
1877
+ try {
1878
+ return require2(candidate);
1879
+ } catch {}
1880
+ }
1881
+ throw new Error("Unable to resolve bundled package.json");
1882
+ }
1883
+ function getDefaultManifestUrls() {
1884
+ return [
1885
+ new URL("../package.json", import.meta.url),
1886
+ new URL("../../package.json", import.meta.url)
1887
+ ];
1884
1888
  }
1885
1889
  function resolveVersion(options = {}) {
1886
1890
  const readManifest = options.readManifest ?? readManifestFile;
1887
- const manifestUrl = options.manifestUrl ?? new URL("../package.json", import.meta.url);
1888
- try {
1889
- const manifest = readManifest(manifestUrl);
1890
- const manifestVersion = normalizeVersion(manifest.version);
1891
- if (manifestVersion) {
1892
- return manifestVersion;
1893
- }
1894
- } catch {}
1891
+ const manifestUrls = options.manifestUrls ? [...options.manifestUrls] : options.manifestUrl ? [options.manifestUrl] : getDefaultManifestUrls();
1892
+ for (const manifestUrl of manifestUrls) {
1893
+ try {
1894
+ const manifest = readManifest(manifestUrl);
1895
+ const manifestVersion = normalizeVersion(manifest.version);
1896
+ if (manifestVersion) {
1897
+ return manifestVersion;
1898
+ }
1899
+ } catch {}
1900
+ }
1895
1901
  const envVersion = normalizeVersion((options.env ?? process.env)["npm_package_version"]);
1896
1902
  if (envVersion) {
1897
1903
  return envVersion;