@leadbay/mcp 0.23.4 → 0.23.5

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/bin.js CHANGED
@@ -26059,7 +26059,7 @@ ${url}
26059
26059
 
26060
26060
  // installer/install-shared.ts
26061
26061
  import { spawn } from "child_process";
26062
- import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
26062
+ import { existsSync as existsSync2, readFileSync as readFileSync2, readdirSync as readdirSync2 } from "fs";
26063
26063
  import { join as join3 } from "path";
26064
26064
  import { homedir as homedir3 } from "os";
26065
26065
  var HOSTED_MCP_URL = "https://leadbay-mcp-prod.fly.dev/mcp";
@@ -26116,6 +26116,15 @@ async function windowsStoreAppInstalled(packageName, appName) {
26116
26116
  child.on("error", () => resolve(false));
26117
26117
  });
26118
26118
  }
26119
+ function isClaudeStorePackagePresent(localAppData) {
26120
+ const packagesDir = join3(localAppData, "Packages");
26121
+ if (!existsSync2(packagesDir)) return false;
26122
+ try {
26123
+ return readdirSync2(packagesDir).some((name) => /^Claude_/i.test(name));
26124
+ } catch {
26125
+ return false;
26126
+ }
26127
+ }
26119
26128
  async function isClaudeDesktopInstalled(home) {
26120
26129
  if (process.platform === "darwin") {
26121
26130
  return existsSync2("/Applications/Claude.app") || existsSync2(home + "/Applications/Claude.app");
@@ -26124,12 +26133,15 @@ async function isClaudeDesktopInstalled(home) {
26124
26133
  const local = process.env.LOCALAPPDATA ?? home + "/AppData/Local";
26125
26134
  const programFiles = process.env.ProgramFiles;
26126
26135
  const programFilesX86 = process.env["ProgramFiles(x86)"];
26127
- return [
26136
+ const exeInstalled = [
26128
26137
  local + "/Programs/Claude/Claude.exe",
26129
26138
  local + "/Claude/Claude.exe",
26130
26139
  programFiles ? programFiles + "/Claude/Claude.exe" : null,
26131
26140
  programFilesX86 ? programFilesX86 + "/Claude/Claude.exe" : null
26132
26141
  ].some((candidate) => candidate !== null && existsSync2(candidate));
26142
+ if (exeInstalled) return true;
26143
+ if (isClaudeStorePackagePresent(local)) return true;
26144
+ return await windowsStoreAppInstalled("AnthropicPBC.Claude", "Claude");
26133
26145
  }
26134
26146
  const desktopBin = await findOnPath("claude-desktop");
26135
26147
  if (desktopBin) return true;
@@ -26936,7 +26948,7 @@ import { createHash as createHash5, randomBytes } from "crypto";
26936
26948
  import { createServer } from "http";
26937
26949
  import { request as httpsRequestRaw } from "https";
26938
26950
  import { spawn as spawn3 } from "child_process";
26939
- import { readdirSync as readdirSync2, existsSync as existsSync3 } from "fs";
26951
+ import { readdirSync as readdirSync3, existsSync as existsSync3 } from "fs";
26940
26952
  var LEADBAY_LOOPBACK_PORTS = [51789, 51790, 51791, 51792];
26941
26953
  var BrowserOpenFailedError = class extends Error {
26942
26954
  authorizeUrl;
@@ -27272,7 +27284,7 @@ function browserLaunchEnv(debug) {
27272
27284
  }
27273
27285
  if (!env.WAYLAND_DISPLAY && runtimeDir) {
27274
27286
  try {
27275
- const sock = readdirSync2(runtimeDir).find((f) => /^wayland-\d+$/.test(f));
27287
+ const sock = readdirSync3(runtimeDir).find((f) => /^wayland-\d+$/.test(f));
27276
27288
  if (sock) {
27277
27289
  env.WAYLAND_DISPLAY = sock;
27278
27290
  debug?.(`browserLaunchEnv: injected WAYLAND_DISPLAY=${sock}`);
@@ -27289,7 +27301,7 @@ function browserLaunchEnv(debug) {
27289
27301
  }
27290
27302
  if (!env.DISPLAY) {
27291
27303
  try {
27292
- const x = readdirSync2("/tmp/.X11-unix").map((f) => f.match(/^X(\d+)$/)?.[1]).filter((n) => !!n).sort((a, b) => Number(a) - Number(b))[0];
27304
+ const x = readdirSync3("/tmp/.X11-unix").map((f) => f.match(/^X(\d+)$/)?.[1]).filter((n) => !!n).sort((a, b) => Number(a) - Number(b))[0];
27293
27305
  env.DISPLAY = x !== void 0 ? `:${x}` : ":0";
27294
27306
  } catch {
27295
27307
  env.DISPLAY = ":0";
@@ -27300,7 +27312,7 @@ function browserLaunchEnv(debug) {
27300
27312
  try {
27301
27313
  let xauth;
27302
27314
  if (runtimeDir) {
27303
- const cookie = readdirSync2(runtimeDir).find(
27315
+ const cookie = readdirSync3(runtimeDir).find(
27304
27316
  (f) => /^\.mutter-Xwaylandauth\./.test(f)
27305
27317
  );
27306
27318
  if (cookie) xauth = `${runtimeDir}/${cookie}`;
@@ -27439,7 +27451,7 @@ var OAUTH_BASE_URLS = {
27439
27451
  fr: "https://staging.api.leadbay.app"
27440
27452
  }
27441
27453
  };
27442
- var VERSION = "0.23.4";
27454
+ var VERSION = "0.23.5";
27443
27455
  var HELP = `
27444
27456
  leadbay-mcp ${VERSION} \u2014 Leadbay Model Context Protocol server
27445
27457
 
@@ -23750,7 +23750,7 @@ function parseWriteEnv(env = process.env) {
23750
23750
  }
23751
23751
 
23752
23752
  // src/http-server.ts
23753
- var VERSION = true ? "0.23.4" : "0.0.0-dev";
23753
+ var VERSION = true ? "0.23.5" : "0.0.0-dev";
23754
23754
  var PORT = Number(process.env.PORT ?? 8080);
23755
23755
  var HOST = process.env.HOST ?? "0.0.0.0";
23756
23756
  var sseSessions = /* @__PURE__ */ new Map();
@@ -399,7 +399,7 @@ var init_install_dxt = __esm({
399
399
 
400
400
  // installer/install-shared.ts
401
401
  import { spawn as spawn2 } from "child_process";
402
- import { existsSync, readFileSync } from "fs";
402
+ import { existsSync, readFileSync, readdirSync } from "fs";
403
403
  import { join } from "path";
404
404
  import { homedir } from "os";
405
405
  function formatInstallOsLabel(platform = process.platform, arch = process.arch) {
@@ -455,6 +455,15 @@ async function windowsStoreAppInstalled(packageName, appName) {
455
455
  child.on("error", () => resolve(false));
456
456
  });
457
457
  }
458
+ function isClaudeStorePackagePresent(localAppData) {
459
+ const packagesDir = join(localAppData, "Packages");
460
+ if (!existsSync(packagesDir)) return false;
461
+ try {
462
+ return readdirSync(packagesDir).some((name) => /^Claude_/i.test(name));
463
+ } catch {
464
+ return false;
465
+ }
466
+ }
458
467
  async function isClaudeDesktopInstalled(home) {
459
468
  if (process.platform === "darwin") {
460
469
  return existsSync("/Applications/Claude.app") || existsSync(home + "/Applications/Claude.app");
@@ -463,12 +472,15 @@ async function isClaudeDesktopInstalled(home) {
463
472
  const local = process.env.LOCALAPPDATA ?? home + "/AppData/Local";
464
473
  const programFiles = process.env.ProgramFiles;
465
474
  const programFilesX86 = process.env["ProgramFiles(x86)"];
466
- return [
475
+ const exeInstalled = [
467
476
  local + "/Programs/Claude/Claude.exe",
468
477
  local + "/Claude/Claude.exe",
469
478
  programFiles ? programFiles + "/Claude/Claude.exe" : null,
470
479
  programFilesX86 ? programFilesX86 + "/Claude/Claude.exe" : null
471
480
  ].some((candidate) => candidate !== null && existsSync(candidate));
481
+ if (exeInstalled) return true;
482
+ if (isClaudeStorePackagePresent(local)) return true;
483
+ return await windowsStoreAppInstalled("AnthropicPBC.Claude", "Claude");
472
484
  }
473
485
  const desktopBin = await findOnPath("claude-desktop");
474
486
  if (desktopBin) return true;
@@ -550,7 +562,7 @@ import { createHash, randomBytes } from "crypto";
550
562
  import { createServer } from "http";
551
563
  import { request as httpsRequestRaw } from "https";
552
564
  import { spawn as spawn3 } from "child_process";
553
- import { readdirSync, existsSync as existsSync2 } from "fs";
565
+ import { readdirSync as readdirSync2, existsSync as existsSync2 } from "fs";
554
566
  async function inferRegionViaStargate(opts) {
555
567
  const url = STARGATE_URLS[opts.staging ? "staging" : "prod"];
556
568
  const res = await httpsCall("GET", url, { Accept: "application/json" });
@@ -853,7 +865,7 @@ function browserLaunchEnv(debug) {
853
865
  }
854
866
  if (!env.WAYLAND_DISPLAY && runtimeDir) {
855
867
  try {
856
- const sock = readdirSync(runtimeDir).find((f) => /^wayland-\d+$/.test(f));
868
+ const sock = readdirSync2(runtimeDir).find((f) => /^wayland-\d+$/.test(f));
857
869
  if (sock) {
858
870
  env.WAYLAND_DISPLAY = sock;
859
871
  debug?.(`browserLaunchEnv: injected WAYLAND_DISPLAY=${sock}`);
@@ -870,7 +882,7 @@ function browserLaunchEnv(debug) {
870
882
  }
871
883
  if (!env.DISPLAY) {
872
884
  try {
873
- const x = readdirSync("/tmp/.X11-unix").map((f) => f.match(/^X(\d+)$/)?.[1]).filter((n) => !!n).sort((a, b) => Number(a) - Number(b))[0];
885
+ const x = readdirSync2("/tmp/.X11-unix").map((f) => f.match(/^X(\d+)$/)?.[1]).filter((n) => !!n).sort((a, b) => Number(a) - Number(b))[0];
874
886
  env.DISPLAY = x !== void 0 ? `:${x}` : ":0";
875
887
  } catch {
876
888
  env.DISPLAY = ":0";
@@ -881,7 +893,7 @@ function browserLaunchEnv(debug) {
881
893
  try {
882
894
  let xauth;
883
895
  if (runtimeDir) {
884
- const cookie = readdirSync(runtimeDir).find(
896
+ const cookie = readdirSync2(runtimeDir).find(
885
897
  (f) => /^\.mutter-Xwaylandauth\./.test(f)
886
898
  );
887
899
  if (cookie) xauth = `${runtimeDir}/${cookie}`;
@@ -1721,7 +1733,7 @@ var init_installer_gui = __esm({
1721
1733
  init_install_dxt();
1722
1734
  init_install_shared();
1723
1735
  init_oauth();
1724
- VERSION = true ? "0.23.4" : "0.0.0-dev";
1736
+ VERSION = true ? "0.23.5" : "0.0.0-dev";
1725
1737
  PORT = Number(process.env.LEADBAY_INSTALLER_PORT ?? 0);
1726
1738
  sessions = /* @__PURE__ */ new Map();
1727
1739
  OAUTH_BASE_URLS = {
@@ -378,7 +378,7 @@ import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
378
378
 
379
379
  // installer/install-shared.ts
380
380
  import { spawn as spawn2 } from "child_process";
381
- import { existsSync, readFileSync } from "fs";
381
+ import { existsSync, readFileSync, readdirSync } from "fs";
382
382
  import { join } from "path";
383
383
  import { homedir } from "os";
384
384
  var HOSTED_MCP_URL = "https://leadbay-mcp-prod.fly.dev/mcp";
@@ -435,6 +435,15 @@ async function windowsStoreAppInstalled(packageName, appName) {
435
435
  child.on("error", () => resolve(false));
436
436
  });
437
437
  }
438
+ function isClaudeStorePackagePresent(localAppData) {
439
+ const packagesDir = join(localAppData, "Packages");
440
+ if (!existsSync(packagesDir)) return false;
441
+ try {
442
+ return readdirSync(packagesDir).some((name) => /^Claude_/i.test(name));
443
+ } catch {
444
+ return false;
445
+ }
446
+ }
438
447
  async function isClaudeDesktopInstalled(home) {
439
448
  if (process.platform === "darwin") {
440
449
  return existsSync("/Applications/Claude.app") || existsSync(home + "/Applications/Claude.app");
@@ -443,12 +452,15 @@ async function isClaudeDesktopInstalled(home) {
443
452
  const local = process.env.LOCALAPPDATA ?? home + "/AppData/Local";
444
453
  const programFiles = process.env.ProgramFiles;
445
454
  const programFilesX86 = process.env["ProgramFiles(x86)"];
446
- return [
455
+ const exeInstalled = [
447
456
  local + "/Programs/Claude/Claude.exe",
448
457
  local + "/Claude/Claude.exe",
449
458
  programFiles ? programFiles + "/Claude/Claude.exe" : null,
450
459
  programFilesX86 ? programFilesX86 + "/Claude/Claude.exe" : null
451
460
  ].some((candidate) => candidate !== null && existsSync(candidate));
461
+ if (exeInstalled) return true;
462
+ if (isClaudeStorePackagePresent(local)) return true;
463
+ return await windowsStoreAppInstalled("AnthropicPBC.Claude", "Claude");
452
464
  }
453
465
  const desktopBin = await findOnPath("claude-desktop");
454
466
  if (desktopBin) return true;
@@ -523,7 +535,7 @@ import { createHash, randomBytes } from "crypto";
523
535
  import { createServer } from "http";
524
536
  import { request as httpsRequestRaw } from "https";
525
537
  import { spawn as spawn3 } from "child_process";
526
- import { readdirSync, existsSync as existsSync2 } from "fs";
538
+ import { readdirSync as readdirSync2, existsSync as existsSync2 } from "fs";
527
539
  var LEADBAY_LOOPBACK_PORTS = [51789, 51790, 51791, 51792];
528
540
  var BrowserOpenFailedError = class extends Error {
529
541
  authorizeUrl;
@@ -859,7 +871,7 @@ function browserLaunchEnv(debug) {
859
871
  }
860
872
  if (!env.WAYLAND_DISPLAY && runtimeDir) {
861
873
  try {
862
- const sock = readdirSync(runtimeDir).find((f) => /^wayland-\d+$/.test(f));
874
+ const sock = readdirSync2(runtimeDir).find((f) => /^wayland-\d+$/.test(f));
863
875
  if (sock) {
864
876
  env.WAYLAND_DISPLAY = sock;
865
877
  debug?.(`browserLaunchEnv: injected WAYLAND_DISPLAY=${sock}`);
@@ -876,7 +888,7 @@ function browserLaunchEnv(debug) {
876
888
  }
877
889
  if (!env.DISPLAY) {
878
890
  try {
879
- const x = readdirSync("/tmp/.X11-unix").map((f) => f.match(/^X(\d+)$/)?.[1]).filter((n) => !!n).sort((a, b) => Number(a) - Number(b))[0];
891
+ const x = readdirSync2("/tmp/.X11-unix").map((f) => f.match(/^X(\d+)$/)?.[1]).filter((n) => !!n).sort((a, b) => Number(a) - Number(b))[0];
880
892
  env.DISPLAY = x !== void 0 ? `:${x}` : ":0";
881
893
  } catch {
882
894
  env.DISPLAY = ":0";
@@ -887,7 +899,7 @@ function browserLaunchEnv(debug) {
887
899
  try {
888
900
  let xauth;
889
901
  if (runtimeDir) {
890
- const cookie = readdirSync(runtimeDir).find(
902
+ const cookie = readdirSync2(runtimeDir).find(
891
903
  (f) => /^\.mutter-Xwaylandauth\./.test(f)
892
904
  );
893
905
  if (cookie) xauth = `${runtimeDir}/${cookie}`;
@@ -1015,7 +1027,7 @@ async function oauthLogin(opts) {
1015
1027
  }
1016
1028
 
1017
1029
  // installer/installer-gui.ts
1018
- var VERSION = true ? "0.23.4" : "0.0.0-dev";
1030
+ var VERSION = true ? "0.23.5" : "0.0.0-dev";
1019
1031
  var PORT = Number(process.env.LEADBAY_INSTALLER_PORT ?? 0);
1020
1032
  var sessions = /* @__PURE__ */ new Map();
1021
1033
  var OAUTH_BASE_URLS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leadbay/mcp",
3
- "version": "0.23.4",
3
+ "version": "0.23.5",
4
4
  "mcpName": "io.github.leadbay/leadbay-mcp",
5
5
  "description": "Model Context Protocol (MCP) server for Leadbay — AI lead discovery, qualification, and enrichment for Claude Desktop, Cursor, and Claude Code.",
6
6
  "type": "module",