@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.cjs CHANGED
@@ -2743,6 +2743,7 @@ function isDirectComponent(name, components) {
2743
2743
  }
2744
2744
 
2745
2745
  // src/tools/capture.ts
2746
+ var import_child_process = require("child_process");
2746
2747
  var import_promises8 = require("fs/promises");
2747
2748
  var import_path9 = require("path");
2748
2749
  var import_core9 = require("@genart-dev/core");
@@ -2826,6 +2827,12 @@ async function captureHtmlMulti(options) {
2826
2827
 
2827
2828
  // src/tools/capture.ts
2828
2829
  var registry2 = (0, import_core9.createDefaultRegistry)();
2830
+ function openPreview(filePath) {
2831
+ const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
2832
+ (0, import_child_process.exec)(`${cmd} "${filePath}"`, (err) => {
2833
+ if (err) console.error(`[openPreview] failed: ${err.message}`);
2834
+ });
2835
+ }
2829
2836
  function applyOverrides(sketch, overrides) {
2830
2837
  if (overrides.seed === void 0 && overrides.params === void 0) {
2831
2838
  return sketch;
@@ -2912,6 +2919,9 @@ async function buildScreenshotMetadata(state, multi, info) {
2912
2919
  await (0, import_promises8.writeFile)(info.previewPath, multi.previewPng);
2913
2920
  metadata.savedPreviewTo = info.previewPath;
2914
2921
  metadata.previewWritten = true;
2922
+ if (info.autoOpen !== false) {
2923
+ openPreview(info.previewPath);
2924
+ }
2915
2925
  }
2916
2926
  return metadata;
2917
2927
  }
@@ -2946,7 +2956,9 @@ async function captureBatch(state, input) {
2946
2956
  target: "sketch",
2947
2957
  sketchId: id,
2948
2958
  seed: effectiveSeed,
2949
- previewPath
2959
+ previewPath,
2960
+ autoOpen: false
2961
+ // Don't flood windows for batch captures
2950
2962
  });
2951
2963
  items.push({
2952
2964
  metadata: itemMetadata,