@genart-dev/mcp-server 0.4.7 → 0.4.8

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
@@ -2743,6 +2743,7 @@ function isDirectComponent(name, components) {
2743
2743
  }
2744
2744
 
2745
2745
  // src/tools/capture.ts
2746
+ import { exec } from "child_process";
2746
2747
  import { mkdir, writeFile as writeFile6 } from "fs/promises";
2747
2748
  import { dirname as dirname6, join as join3 } from "path";
2748
2749
  import {
@@ -2828,6 +2829,12 @@ async function captureHtmlMulti(options) {
2828
2829
 
2829
2830
  // src/tools/capture.ts
2830
2831
  var registry2 = createDefaultRegistry2();
2832
+ function openPreview(filePath) {
2833
+ const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
2834
+ exec(`${cmd} "${filePath}"`, (err) => {
2835
+ if (err) console.error(`[openPreview] failed: ${err.message}`);
2836
+ });
2837
+ }
2831
2838
  function applyOverrides(sketch, overrides) {
2832
2839
  if (overrides.seed === void 0 && overrides.params === void 0) {
2833
2840
  return sketch;
@@ -2914,6 +2921,9 @@ async function buildScreenshotMetadata(state, multi, info) {
2914
2921
  await writeFile6(info.previewPath, multi.previewPng);
2915
2922
  metadata.savedPreviewTo = info.previewPath;
2916
2923
  metadata.previewWritten = true;
2924
+ if (info.autoOpen !== false) {
2925
+ openPreview(info.previewPath);
2926
+ }
2917
2927
  }
2918
2928
  return metadata;
2919
2929
  }
@@ -2948,7 +2958,9 @@ async function captureBatch(state, input) {
2948
2958
  target: "sketch",
2949
2959
  sketchId: id,
2950
2960
  seed: effectiveSeed,
2951
- previewPath
2961
+ previewPath,
2962
+ autoOpen: false
2963
+ // Don't flood windows for batch captures
2952
2964
  });
2953
2965
  items.push({
2954
2966
  metadata: itemMetadata,