nodebench-mcp 3.1.1 → 3.1.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.
package/dist/index.js CHANGED
@@ -532,6 +532,7 @@ if (healthFlag) {
532
532
  // 1. Tool count + preset - load only the active preset for a fast health path
533
533
  const activePreset = requestedPreset;
534
534
  const presetToolsets = PRESETS[activePreset];
535
+ const activeDomainSet = new Set(presetToolsets ?? []);
535
536
  if (presetToolsets) {
536
537
  await loadToolsets(presetToolsets);
537
538
  }
@@ -591,8 +592,6 @@ if (healthFlag) {
591
592
  lines.push(` ${set ? ok : `${Y}--${X}`} ${key.padEnd(22)} ${desc}${set ? ` ${C}${val}${X}` : ""}`);
592
593
  }
593
594
  // 7. Optional npm packages
594
- lines.push("");
595
- lines.push(`${B}Optional Packages${X}`);
596
595
  const { createRequire } = await import("node:module");
597
596
  const _require = createRequire(import.meta.url);
598
597
  const _isInstalled = (pkg) => { try {
@@ -602,34 +601,76 @@ if (healthFlag) {
602
601
  catch {
603
602
  return false;
604
603
  } };
605
- const pkgChecks = [
606
- ["playwright", "UI capture + screenshots"],
607
- ["sharp", "Image processing"],
608
- ["@huggingface/transformers", "Local embeddings (384-dim)"],
609
- ["tesseract.js", "OCR text extraction"],
610
- ["pdf-parse", "PDF parsing"],
611
- ["mammoth", "DOCX parsing"],
612
- ["xlsx", "Spreadsheet parsing"],
604
+ const packageCheckSpecs = [
605
+ {
606
+ pkg: "playwright",
607
+ desc: "UI capture + screenshots",
608
+ show: activeDomainSet.has("ui_capture")
609
+ || activeDomainSet.has("qa_orchestration")
610
+ || activeDomainSet.has("dogfood_judge"),
611
+ },
612
+ {
613
+ pkg: "sharp",
614
+ desc: "Image processing",
615
+ show: activeDomainSet.has("ui_capture")
616
+ || activeDomainSet.has("vision")
617
+ || activeDomainSet.has("qa_orchestration")
618
+ || activeDomainSet.has("dogfood_judge"),
619
+ },
620
+ {
621
+ pkg: "@huggingface/transformers",
622
+ desc: "Local embeddings (384-dim)",
623
+ show: useEmbedding,
624
+ },
625
+ {
626
+ pkg: "tesseract.js",
627
+ desc: "OCR text extraction",
628
+ show: activeDomainSet.has("local_file") || activeDomainSet.has("vision"),
629
+ },
630
+ {
631
+ pkg: "pdf-parse",
632
+ desc: "PDF parsing",
633
+ show: activeDomainSet.has("local_file"),
634
+ },
635
+ {
636
+ pkg: "mammoth",
637
+ desc: "DOCX parsing",
638
+ show: activeDomainSet.has("local_file"),
639
+ },
640
+ {
641
+ pkg: "read-excel-file",
642
+ desc: "Spreadsheet parsing",
643
+ show: activeDomainSet.has("local_file"),
644
+ },
613
645
  ];
614
- for (const [pkg, desc] of pkgChecks) {
615
- const installed = _isInstalled(pkg);
616
- lines.push(` ${installed ? ok : `${Y}--${X}`} ${pkg.padEnd(30)} ${desc}`);
646
+ const pkgChecks = packageCheckSpecs
647
+ .filter((spec) => spec.show)
648
+ .map((spec) => [spec.pkg, spec.desc]);
649
+ if (pkgChecks.length > 0) {
650
+ lines.push("");
651
+ lines.push(`${B}Optional Packages${X}`);
652
+ for (const [pkg, desc] of pkgChecks) {
653
+ const installed = _isInstalled(pkg);
654
+ lines.push(` ${installed ? ok : `${Y}--${X}`} ${pkg.padEnd(30)} ${desc}`);
655
+ }
617
656
  }
618
657
  // 8. Python servers
619
- lines.push("");
620
- lines.push(`${B}Python Servers${X}`);
621
658
  const serverChecks = [
622
- ["Flicker Detection", 8006],
623
- ["Figma Flow", 8007],
659
+ ...(activeDomainSet.has("flicker_detection") ? [["Flicker Detection", 8006]] : []),
660
+ ...(activeDomainSet.has("figma_flow") ? [["Figma Flow", 8007]] : []),
624
661
  ];
625
- for (const [name, port] of serverChecks) {
626
- let reachable = false;
627
- try {
628
- const resp = await fetch(`http://127.0.0.1:${port}/health`, { signal: AbortSignal.timeout(2000) });
629
- reachable = resp.ok;
662
+ if (serverChecks.length > 0) {
663
+ lines.push("");
664
+ lines.push(`${B}Python Servers${X}`);
665
+ for (const [name, port] of serverChecks) {
666
+ let reachable = false;
667
+ try {
668
+ const resp = await fetch(`http://127.0.0.1:${port}/health`, { signal: AbortSignal.timeout(2000) });
669
+ reachable = resp.ok;
670
+ }
671
+ catch { /* not running */ }
672
+ lines.push(` ${reachable ? ok : `${Y}--${X}`} ${name.padEnd(22)} :${port}${reachable ? "" : " (not running)"}`);
630
673
  }
631
- catch { /* not running */ }
632
- lines.push(` ${reachable ? ok : `${Y}--${X}`} ${name.padEnd(22)} :${port}${reachable ? "" : " (not running)"}`);
633
674
  }
634
675
  // 9. Version check (npm registry)
635
676
  lines.push("");
@@ -668,7 +709,10 @@ if (healthFlag) {
668
709
  lines.push("");
669
710
  const allEnvSet = envChecks.filter(([k]) => !!process.env[k]).length;
670
711
  const allPkgSet = pkgChecks.filter(([p]) => _isInstalled(p)).length;
671
- lines.push(`${B}Summary${X} ${allEnvSet}/${envChecks.length} env vars | ${allPkgSet}/${pkgChecks.length} packages | ${dbExists ? "DB ready" : "DB pending"}`);
712
+ const packageSummary = pkgChecks.length > 0
713
+ ? `${allPkgSet}/${pkgChecks.length} packages`
714
+ : "no preset-specific package deps";
715
+ lines.push(`${B}Summary${X} ${allEnvSet}/${envChecks.length} env vars | ${packageSummary} | ${dbExists ? "DB ready" : "DB pending"}`);
672
716
  console.log(lines.join("\n"));
673
717
  process.exit(0);
674
718
  }