@ada-mcp/mcp-server 0.1.25 → 0.1.26

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.
Files changed (2) hide show
  1. package/dist/cli.cjs +124 -86
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ if (!process.env.ADA_MCP_SERVER_ENTRY) process.env.ADA_MCP_SERVER_ENTRY = __filename;
2
3
  "use strict";
3
4
  var __create = Object.create;
4
5
  var __defProp = Object.defineProperty;
@@ -5555,6 +5556,66 @@ var init_src3 = __esm({
5555
5556
  }
5556
5557
  });
5557
5558
 
5559
+ // ../../packages/plugin-host/src/resolve-plugin-dir.ts
5560
+ function resolvePackagePluginDir() {
5561
+ const candidates = [];
5562
+ const push = (dir) => {
5563
+ const trimmed = dir?.trim();
5564
+ if (!trimmed) {
5565
+ return;
5566
+ }
5567
+ candidates.push(import_node_path6.default.resolve(trimmed));
5568
+ };
5569
+ push(process.env.ADA_PLUGIN_DIR);
5570
+ const entryFromEnv = process.env.ADA_MCP_SERVER_ENTRY?.trim();
5571
+ if (entryFromEnv) {
5572
+ const entryDir = import_node_path6.default.dirname(import_node_path6.default.resolve(entryFromEnv));
5573
+ push(import_node_path6.default.join(entryDir, "plugins"));
5574
+ push(import_node_path6.default.join(entryDir, "..", "plugins"));
5575
+ }
5576
+ const argv1 = process.argv[1]?.trim();
5577
+ if (argv1) {
5578
+ const entryDir = import_node_path6.default.dirname(import_node_path6.default.resolve(argv1));
5579
+ push(import_node_path6.default.join(entryDir, "plugins"));
5580
+ push(import_node_path6.default.join(entryDir, "..", "plugins"));
5581
+ }
5582
+ if (typeof __filename === "string") {
5583
+ const fromFile = import_node_path6.default.dirname(__filename);
5584
+ push(import_node_path6.default.join(fromFile, "plugins"));
5585
+ push(import_node_path6.default.join(fromFile, "..", "plugins"));
5586
+ }
5587
+ try {
5588
+ const req = (0, import_node_module2.createRequire)(typeof __filename === "string" ? __filename : process.cwd());
5589
+ for (const specifier of ["@ada-mcp/mcp-server/package.json", "@ada-mcp/mcp-server"]) {
5590
+ try {
5591
+ const resolved = req.resolve(specifier);
5592
+ const root = specifier.endsWith("package.json") ? import_node_path6.default.dirname(resolved) : import_node_path6.default.join(import_node_path6.default.dirname(resolved), "..");
5593
+ push(import_node_path6.default.join(root, "plugins"));
5594
+ } catch {
5595
+ }
5596
+ }
5597
+ } catch {
5598
+ }
5599
+ const seen = /* @__PURE__ */ new Set();
5600
+ for (const dir of candidates) {
5601
+ if (seen.has(dir) || !(0, import_node_fs2.existsSync)(dir)) {
5602
+ continue;
5603
+ }
5604
+ seen.add(dir);
5605
+ return dir;
5606
+ }
5607
+ return void 0;
5608
+ }
5609
+ var import_node_fs2, import_node_path6, import_node_module2;
5610
+ var init_resolve_plugin_dir = __esm({
5611
+ "../../packages/plugin-host/src/resolve-plugin-dir.ts"() {
5612
+ "use strict";
5613
+ import_node_fs2 = require("node:fs");
5614
+ import_node_path6 = __toESM(require("node:path"), 1);
5615
+ import_node_module2 = require("node:module");
5616
+ }
5617
+ });
5618
+
5558
5619
  // ../../packages/plugin-host/src/index.ts
5559
5620
  function assertManifest(plugin) {
5560
5621
  const m = plugin.manifest;
@@ -5584,7 +5645,7 @@ function entryScriptDir() {
5584
5645
  return void 0;
5585
5646
  }
5586
5647
  try {
5587
- return import_node_path6.default.dirname(import_node_path6.default.resolve(argv1));
5648
+ return import_node_path7.default.dirname(import_node_path7.default.resolve(argv1));
5588
5649
  } catch {
5589
5650
  return void 0;
5590
5651
  }
@@ -5596,28 +5657,28 @@ function resolvePluginDirs(explicitPluginDir) {
5596
5657
  if (!trimmed) {
5597
5658
  return;
5598
5659
  }
5599
- ordered.push(import_node_path6.default.resolve(trimmed));
5660
+ ordered.push(import_node_path7.default.resolve(trimmed));
5600
5661
  };
5601
5662
  push(explicitPluginDir);
5602
5663
  push(process.env.ADA_PLUGIN_DIR);
5603
5664
  const entryDir = entryScriptDir();
5604
5665
  if (entryDir) {
5605
- push(import_node_path6.default.join(entryDir, "plugins"));
5606
- push(import_node_path6.default.join(entryDir, "..", "plugins"));
5666
+ push(import_node_path7.default.join(entryDir, "plugins"));
5667
+ push(import_node_path7.default.join(entryDir, "..", "plugins"));
5607
5668
  }
5608
5669
  if (typeof __filename === "string") {
5609
- const fromModule = import_node_path6.default.dirname(__filename);
5610
- push(import_node_path6.default.join(fromModule, "plugins"));
5611
- push(import_node_path6.default.join(fromModule, "..", "plugins"));
5670
+ const fromModule = import_node_path7.default.dirname(__filename);
5671
+ push(import_node_path7.default.join(fromModule, "plugins"));
5672
+ push(import_node_path7.default.join(fromModule, "..", "plugins"));
5612
5673
  }
5613
5674
  const initCwd = process.env.INIT_CWD?.trim();
5614
5675
  if (initCwd) {
5615
- push(import_node_path6.default.join(initCwd, "plugins"));
5616
- push(import_node_path6.default.join(initCwd, "release", "plugins"));
5676
+ push(import_node_path7.default.join(initCwd, "plugins"));
5677
+ push(import_node_path7.default.join(initCwd, "release", "plugins"));
5617
5678
  }
5618
5679
  const cwd = process.cwd();
5619
- push(import_node_path6.default.join(cwd, "plugins"));
5620
- push(import_node_path6.default.join(cwd, "release", "plugins"));
5680
+ push(import_node_path7.default.join(cwd, "plugins"));
5681
+ push(import_node_path7.default.join(cwd, "release", "plugins"));
5621
5682
  const seen = /* @__PURE__ */ new Set();
5622
5683
  return ordered.filter((dir) => {
5623
5684
  if (seen.has(dir)) {
@@ -5628,10 +5689,10 @@ function resolvePluginDirs(explicitPluginDir) {
5628
5689
  });
5629
5690
  }
5630
5691
  function pluginDirHasModules(pluginDir) {
5631
- if (!import_node_fs2.default.existsSync(pluginDir)) {
5692
+ if (!import_node_fs3.default.existsSync(pluginDir)) {
5632
5693
  return false;
5633
5694
  }
5634
- return import_node_fs2.default.readdirSync(pluginDir, { withFileTypes: true }).some((ent) => ent.isFile() && (ent.name.endsWith(".cjs") || ent.name.endsWith(".js")));
5695
+ return import_node_fs3.default.readdirSync(pluginDir, { withFileTypes: true }).some((ent) => ent.isFile() && (ent.name.endsWith(".cjs") || ent.name.endsWith(".js")));
5635
5696
  }
5636
5697
  function loadPluginFromModule(requireFn, moduleId) {
5637
5698
  try {
@@ -5643,16 +5704,16 @@ function loadPluginFromModule(requireFn, moduleId) {
5643
5704
  }
5644
5705
  }
5645
5706
  function registerPluginsFromDirectory(host, pluginDir) {
5646
- if (!import_node_fs2.default.existsSync(pluginDir)) {
5707
+ if (!import_node_fs3.default.existsSync(pluginDir)) {
5647
5708
  return [];
5648
5709
  }
5649
- const entries = import_node_fs2.default.readdirSync(pluginDir, { withFileTypes: true }).filter((ent) => ent.isFile() && (ent.name.endsWith(".cjs") || ent.name.endsWith(".js"))).map((ent) => import_node_path6.default.join(pluginDir, ent.name)).sort((a, b) => a.localeCompare(b));
5710
+ const entries = import_node_fs3.default.readdirSync(pluginDir, { withFileTypes: true }).filter((ent) => ent.isFile() && (ent.name.endsWith(".cjs") || ent.name.endsWith(".js"))).map((ent) => import_node_path7.default.join(pluginDir, ent.name)).sort((a, b) => a.localeCompare(b));
5650
5711
  if (entries.length === 0) {
5651
5712
  return [];
5652
5713
  }
5653
5714
  const loaded = [];
5654
5715
  for (const file2 of entries) {
5655
- const requireFn = (0, import_node_module2.createRequire)(file2);
5716
+ const requireFn = (0, import_node_module3.createRequire)(file2);
5656
5717
  const plugin = loadPluginFromModule(requireFn, file2);
5657
5718
  if (!plugin) {
5658
5719
  continue;
@@ -5666,7 +5727,7 @@ function registerPluginsFromDirectory(host, pluginDir) {
5666
5727
  return loaded;
5667
5728
  }
5668
5729
  function registerPluginsFromModuleIds(host, moduleIds) {
5669
- const req = (0, import_node_module2.createRequire)(typeof __filename === "string" ? __filename : process.cwd());
5730
+ const req = (0, import_node_module3.createRequire)(typeof __filename === "string" ? __filename : process.cwd());
5670
5731
  const loaded = [];
5671
5732
  for (const moduleId of moduleIds) {
5672
5733
  const plugin = loadPluginFromModule(req, moduleId);
@@ -5691,14 +5752,15 @@ function registerRuntimePlugins(host, options) {
5691
5752
  const fallbackModuleIds = options?.moduleIds?.length ? options.moduleIds : DEFAULT_PLUGIN_MODULE_IDS;
5692
5753
  return registerPluginsFromModuleIds(host, fallbackModuleIds);
5693
5754
  }
5694
- var import_node_fs2, import_node_path6, import_node_module2, PluginHost, DEFAULT_PLUGIN_MODULE_IDS;
5755
+ var import_node_fs3, import_node_path7, import_node_module3, PluginHost, DEFAULT_PLUGIN_MODULE_IDS;
5695
5756
  var init_src4 = __esm({
5696
5757
  "../../packages/plugin-host/src/index.ts"() {
5697
5758
  "use strict";
5698
5759
  init_src3();
5699
- import_node_fs2 = __toESM(require("node:fs"), 1);
5700
- import_node_path6 = __toESM(require("node:path"), 1);
5701
- import_node_module2 = require("node:module");
5760
+ import_node_fs3 = __toESM(require("node:fs"), 1);
5761
+ import_node_path7 = __toESM(require("node:path"), 1);
5762
+ import_node_module3 = require("node:module");
5763
+ init_resolve_plugin_dir();
5702
5764
  PluginHost = class {
5703
5765
  plugins = /* @__PURE__ */ new Map();
5704
5766
  webEngines = /* @__PURE__ */ new Map();
@@ -5812,12 +5874,12 @@ var init_src4 = __esm({
5812
5874
  // ../ada-agent/src/plugin-registry.ts
5813
5875
  function buildPluginHost() {
5814
5876
  const host = new PluginHost();
5815
- registerRuntimePlugins(host);
5877
+ const pluginDir = resolvePackagePluginDir();
5878
+ registerRuntimePlugins(host, pluginDir ? { pluginDir } : void 0);
5816
5879
  return host;
5817
5880
  }
5818
5881
  function listBuiltInPluginManifests() {
5819
- const host = new PluginHost();
5820
- return registerRuntimePlugins(host);
5882
+ return buildPluginHost().listManifests();
5821
5883
  }
5822
5884
  var init_plugin_registry = __esm({
5823
5885
  "../ada-agent/src/plugin-registry.ts"() {
@@ -5847,9 +5909,9 @@ async function isPortAvailable(host, port) {
5847
5909
  async function runDoctor(config2) {
5848
5910
  const root = await resolveWorkspaceRoot2(process.cwd());
5849
5911
  const queue = {
5850
- inboxDir: import_node_path7.default.resolve(root, config2.queue.inboxDir),
5851
- processedDir: import_node_path7.default.resolve(root, config2.queue.processedDir),
5852
- failedDir: import_node_path7.default.resolve(root, config2.queue.failedDir)
5912
+ inboxDir: import_node_path8.default.resolve(root, config2.queue.inboxDir),
5913
+ processedDir: import_node_path8.default.resolve(root, config2.queue.processedDir),
5914
+ failedDir: import_node_path8.default.resolve(root, config2.queue.failedDir)
5853
5915
  };
5854
5916
  const deps = await getDependencyHealth(config2);
5855
5917
  const portFree = await isPortAvailable(config2.bootstrapUI.host, config2.bootstrapUI.port);
@@ -5960,7 +6022,7 @@ async function checkNativeBootstrap(config2, root) {
5960
6022
  const hasPathHint = native.command.includes("/") || native.command.includes("\\") || native.command.startsWith(".");
5961
6023
  let reachable = false;
5962
6024
  if (hasPathHint) {
5963
- const resolved = import_node_path7.default.resolve(root, native.command);
6025
+ const resolved = import_node_path8.default.resolve(root, native.command);
5964
6026
  reachable = await fileExists2(resolved);
5965
6027
  } else {
5966
6028
  reachable = await commandExists(native.command);
@@ -6000,12 +6062,12 @@ async function checkAppiumServer(serverUrl) {
6000
6062
  };
6001
6063
  }
6002
6064
  }
6003
- var import_promises6, import_node_net, import_node_path7, import_node_url, import_node_child_process3;
6065
+ var import_promises6, import_node_net, import_node_path8, import_node_url, import_node_child_process3;
6004
6066
  var init_doctor = __esm({
6005
6067
  "../ada-agent/src/doctor.ts"() {
6006
6068
  import_promises6 = __toESM(require("node:fs/promises"));
6007
6069
  import_node_net = __toESM(require("node:net"));
6008
- import_node_path7 = __toESM(require("node:path"));
6070
+ import_node_path8 = __toESM(require("node:path"));
6009
6071
  import_node_url = require("node:url");
6010
6072
  import_node_child_process3 = require("node:child_process");
6011
6073
  init_dependency_installer();
@@ -7412,11 +7474,11 @@ function getScreenshotPath(result) {
7412
7474
  return typeof pathValue === "string" ? pathValue : null;
7413
7475
  }
7414
7476
  function buildMonitorOutputPath(config2, sourcePath, requestId, sessionId) {
7415
- const ext = import_node_path8.default.extname(sourcePath) || ".png";
7477
+ const ext = import_node_path9.default.extname(sourcePath) || ".png";
7416
7478
  if (config2.monitoring.groupBySession) {
7417
- return import_node_path8.default.join(config2.monitoring.outputDir, sessionId, `${requestId}${ext}`);
7479
+ return import_node_path9.default.join(config2.monitoring.outputDir, sessionId, `${requestId}${ext}`);
7418
7480
  }
7419
- return import_node_path8.default.join(config2.monitoring.outputDir, `${requestId}${ext}`);
7481
+ return import_node_path9.default.join(config2.monitoring.outputDir, `${requestId}${ext}`);
7420
7482
  }
7421
7483
  async function captureOperationMonitor(command, result, index, context) {
7422
7484
  if (!shouldMonitorCommand(command, context.config, index)) {
@@ -7438,7 +7500,7 @@ async function captureOperationMonitor(command, result, index, context) {
7438
7500
  return;
7439
7501
  }
7440
7502
  const targetPath = buildMonitorOutputPath(context.config, sourcePath, command.requestId, command.sessionId);
7441
- await import_promises9.default.mkdir(import_node_path8.default.dirname(targetPath), { recursive: true });
7503
+ await import_promises9.default.mkdir(import_node_path9.default.dirname(targetPath), { recursive: true });
7442
7504
  const { maxWidth, maxHeight, keepAspectRatio } = context.config.monitoring.resolution;
7443
7505
  const mw = Math.max(1, maxWidth);
7444
7506
  const mh = Math.max(1, maxHeight);
@@ -7462,12 +7524,12 @@ async function captureOperationMonitor(command, result, index, context) {
7462
7524
  }
7463
7525
  });
7464
7526
  }
7465
- var import_promises9, import_node_path8, import_jimp;
7527
+ var import_promises9, import_node_path9, import_jimp;
7466
7528
  var init_monitoring = __esm({
7467
7529
  "../ada-agent/src/monitoring.ts"() {
7468
7530
  "use strict";
7469
7531
  import_promises9 = __toESM(require("node:fs/promises"), 1);
7470
- import_node_path8 = __toESM(require("node:path"), 1);
7532
+ import_node_path9 = __toESM(require("node:path"), 1);
7471
7533
  import_jimp = require("jimp");
7472
7534
  init_logger();
7473
7535
  }
@@ -7553,16 +7615,16 @@ async function ensureDirs(config2) {
7553
7615
  }
7554
7616
  async function listTaskFiles(inboxDir) {
7555
7617
  const entries = await import_promises10.default.readdir(inboxDir, { withFileTypes: true });
7556
- return entries.filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => import_node_path9.default.join(inboxDir, entry.name)).sort((a, b) => a.localeCompare(b));
7618
+ return entries.filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => import_node_path10.default.join(inboxDir, entry.name)).sort((a, b) => a.localeCompare(b));
7557
7619
  }
7558
7620
  async function moveTo(targetDir, sourcePath) {
7559
- const fileName = import_node_path9.default.basename(sourcePath);
7560
- const destination = import_node_path9.default.join(targetDir, fileName);
7621
+ const fileName = import_node_path10.default.basename(sourcePath);
7622
+ const destination = import_node_path10.default.join(targetDir, fileName);
7561
7623
  await import_promises10.default.rename(sourcePath, destination);
7562
7624
  }
7563
7625
  async function writeFailedMeta(targetDir, sourcePath, meta3) {
7564
- const fileName = `${import_node_path9.default.basename(sourcePath)}.error.json`;
7565
- const destination = import_node_path9.default.join(targetDir, fileName);
7626
+ const fileName = `${import_node_path10.default.basename(sourcePath)}.error.json`;
7627
+ const destination = import_node_path10.default.join(targetDir, fileName);
7566
7628
  await import_promises10.default.writeFile(destination, JSON.stringify(meta3, null, 2), "utf8");
7567
7629
  }
7568
7630
  async function processQueueOnce(config2, options = {}) {
@@ -7638,11 +7700,11 @@ async function watchQueue(config2, shouldStop, options = {}) {
7638
7700
  }
7639
7701
  log("info", { event: "queue.watch.stopped" });
7640
7702
  }
7641
- var import_promises10, import_node_path9;
7703
+ var import_promises10, import_node_path10;
7642
7704
  var init_queue_runner = __esm({
7643
7705
  "../ada-agent/src/queue-runner.ts"() {
7644
7706
  import_promises10 = __toESM(require("node:fs/promises"));
7645
- import_node_path9 = __toESM(require("node:path"));
7707
+ import_node_path10 = __toESM(require("node:path"));
7646
7708
  init_task_loader();
7647
7709
  init_runtime();
7648
7710
  init_logger();
@@ -18186,41 +18248,11 @@ var init_streamableHttp = __esm({
18186
18248
  });
18187
18249
 
18188
18250
  // src/executor.ts
18189
- function resolveBundledPluginDir() {
18190
- const candidates = [];
18191
- const argv1 = process.argv[1]?.trim();
18192
- if (argv1) {
18193
- const entryDir = import_node_path11.default.dirname(import_node_path11.default.resolve(argv1));
18194
- candidates.push(import_node_path11.default.join(entryDir, "plugins"));
18195
- candidates.push(import_node_path11.default.join(entryDir, "..", "plugins"));
18196
- }
18197
- const dirname = globalThis.__dirname;
18198
- if (typeof dirname === "string") {
18199
- candidates.push(import_node_path11.default.join(dirname, "plugins"));
18200
- candidates.push(import_node_path11.default.join(dirname, "..", "plugins"));
18201
- }
18202
- try {
18203
- const here = import_node_path11.default.dirname((0, import_node_url3.fileURLToPath)(import_meta.url));
18204
- candidates.push(import_node_path11.default.join(here, "plugins"));
18205
- candidates.push(import_node_path11.default.join(here, "..", "plugins"));
18206
- } catch {
18207
- }
18208
- const seen = /* @__PURE__ */ new Set();
18209
- for (const dir of candidates) {
18210
- const resolved = import_node_path11.default.resolve(dir);
18211
- if (seen.has(resolved) || !(0, import_node_fs4.existsSync)(resolved)) {
18212
- continue;
18213
- }
18214
- seen.add(resolved);
18215
- return resolved;
18216
- }
18217
- return void 0;
18218
- }
18219
18251
  function getPluginHost() {
18220
18252
  if (sharedHost) {
18221
18253
  return sharedHost;
18222
18254
  }
18223
- const bundledDir = resolveBundledPluginDir();
18255
+ const bundledDir = resolvePackagePluginDir();
18224
18256
  const host = new PluginHost();
18225
18257
  registerRuntimePlugins(host, bundledDir ? { pluginDir: bundledDir } : void 0);
18226
18258
  sharedHost = host;
@@ -18251,16 +18283,12 @@ async function closeSession(platform, sessionId, options) {
18251
18283
  async function closeAllSessions() {
18252
18284
  return getExecutor().closeAllSessions();
18253
18285
  }
18254
- var import_node_fs4, import_node_path11, import_node_url3, import_meta, sharedHost, sharedExecutor;
18286
+ var sharedHost, sharedExecutor;
18255
18287
  var init_executor = __esm({
18256
18288
  "src/executor.ts"() {
18257
18289
  "use strict";
18258
- import_node_fs4 = require("node:fs");
18259
- import_node_path11 = __toESM(require("node:path"));
18260
- import_node_url3 = require("node:url");
18261
18290
  init_src7();
18262
18291
  init_src4();
18263
- import_meta = {};
18264
18292
  sharedHost = null;
18265
18293
  sharedExecutor = null;
18266
18294
  }
@@ -31424,7 +31452,7 @@ async function isPortOpen(host, port) {
31424
31452
  });
31425
31453
  }
31426
31454
  function parseServerEndpoint(serverUrl) {
31427
- const parsed = new import_node_url4.URL(serverUrl);
31455
+ const parsed = new import_node_url3.URL(serverUrl);
31428
31456
  const host = parsed.hostname;
31429
31457
  const port = Number(parsed.port || (parsed.protocol === "https:" ? 443 : 80));
31430
31458
  return { host, port };
@@ -33080,7 +33108,7 @@ async function startMcpServer() {
33080
33108
  await server.connect(transport);
33081
33109
  console.error("[ADA-MCP] server connected");
33082
33110
  }
33083
- var import_promises13, import_node_fs5, import_node_net2, import_node_path14, import_node_child_process5, import_node_url4, appiumEnsureJob, persistedHomesCache, appiumReadyCache, APPIUM_READY_CACHE_TTL_MS, supportedCommands, riskyCommandDefaults, riskyCommandAllowlist, perfStats, PERF_MAX_SAMPLES_PER_LABEL, shuttingDown, server;
33111
+ var import_promises13, import_node_fs5, import_node_net2, import_node_path14, import_node_child_process5, import_node_url3, appiumEnsureJob, persistedHomesCache, appiumReadyCache, APPIUM_READY_CACHE_TTL_MS, supportedCommands, riskyCommandDefaults, riskyCommandAllowlist, perfStats, PERF_MAX_SAMPLES_PER_LABEL, shuttingDown, server;
33084
33112
  var init_main = __esm({
33085
33113
  "src/main.ts"() {
33086
33114
  "use strict";
@@ -33089,7 +33117,7 @@ var init_main = __esm({
33089
33117
  import_node_net2 = __toESM(require("node:net"));
33090
33118
  import_node_path14 = __toESM(require("node:path"));
33091
33119
  import_node_child_process5 = require("node:child_process");
33092
- import_node_url4 = require("node:url");
33120
+ import_node_url3 = require("node:url");
33093
33121
  init_server2();
33094
33122
  init_stdio2();
33095
33123
  init_types();
@@ -33414,9 +33442,12 @@ var init_remote_server = __esm({
33414
33442
  }
33415
33443
  });
33416
33444
 
33445
+ // src/cli.ts
33446
+ var import_node_url4 = require("node:url");
33447
+
33417
33448
  // src/bootstrap-deps.ts
33418
- var import_node_fs3 = __toESM(require("node:fs"));
33419
- var import_node_path10 = __toESM(require("node:path"));
33449
+ var import_node_fs4 = __toESM(require("node:fs"));
33450
+ var import_node_path11 = __toESM(require("node:path"));
33420
33451
  init_src8();
33421
33452
  var INSTALL_SCOPE_TOKENS = /* @__PURE__ */ new Set([
33422
33453
  "playwright",
@@ -33499,9 +33530,9 @@ function applyPreinstallPlaywrightHostFile() {
33499
33530
  (x) => typeof x === "string" && x.trim().length > 0
33500
33531
  );
33501
33532
  for (const root of roots) {
33502
- const file2 = import_node_path10.default.join(root, ".ada-mcp-playwright-host");
33533
+ const file2 = import_node_path11.default.join(root, ".ada-mcp-playwright-host");
33503
33534
  try {
33504
- const host = normalizePlaywrightHost(import_node_fs3.default.readFileSync(file2, "utf8").trim());
33535
+ const host = normalizePlaywrightHost(import_node_fs4.default.readFileSync(file2, "utf8").trim());
33505
33536
  if (host.length > 0 && PREINSTALL_PLAYWRIGHT_HOST_ALLOW.has(host)) {
33506
33537
  process.env.PLAYWRIGHT_DOWNLOAD_HOST = host;
33507
33538
  process.env.ADA_PLAYWRIGHT_HOST_FROM_PREINSTALL = "1";
@@ -33552,6 +33583,13 @@ async function runBootstrapInstallDeps(argv2) {
33552
33583
  }
33553
33584
 
33554
33585
  // src/cli.ts
33586
+ var import_meta = {};
33587
+ if (!process.env.ADA_MCP_SERVER_ENTRY?.trim()) {
33588
+ try {
33589
+ process.env.ADA_MCP_SERVER_ENTRY = (0, import_node_url4.fileURLToPath)(import_meta.url);
33590
+ } catch {
33591
+ }
33592
+ }
33555
33593
  function argValue(name, fallback = "") {
33556
33594
  const argv2 = process.argv.slice(2);
33557
33595
  const hit = argv2.find((x) => x.startsWith(`${name}=`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-mcp/mcp-server",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "ADA MCP server for web/mobile automation (stdio + remote HTTP)",
5
5
  "private": false,
6
6
  "type": "commonjs",