@genart-dev/mcp-server 0.4.7 → 0.4.9

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,
@@ -5502,7 +5514,12 @@ function registerSketchTools(server, state) {
5502
5514
  });
5503
5515
  return {
5504
5516
  content: [
5505
- { type: "image", data: captureResult.previewJpegBase64, mimeType: "image/jpeg" },
5517
+ {
5518
+ type: "image",
5519
+ data: captureResult.previewJpegBase64,
5520
+ mimeType: "image/jpeg",
5521
+ annotations: { audience: ["user", "assistant"] }
5522
+ },
5506
5523
  { type: "text", text: JSON.stringify({
5507
5524
  ...result,
5508
5525
  capture: captureResult.metadata
@@ -6088,7 +6105,12 @@ function registerCaptureTools(server, state) {
6088
6105
  console.error(`[capture_screenshot] jpeg base64 length: ${result.previewJpegBase64.length}`);
6089
6106
  return {
6090
6107
  content: [
6091
- { type: "image", data: result.previewJpegBase64, mimeType: "image/jpeg" },
6108
+ {
6109
+ type: "image",
6110
+ data: result.previewJpegBase64,
6111
+ mimeType: "image/jpeg",
6112
+ annotations: { audience: ["user", "assistant"] }
6113
+ },
6092
6114
  { type: "text", text: JSON.stringify(result.metadata, null, 2) }
6093
6115
  ]
6094
6116
  };
@@ -6118,7 +6140,8 @@ function registerCaptureTools(server, state) {
6118
6140
  content.push({
6119
6141
  type: "image",
6120
6142
  data: item.inlineJpegBase64,
6121
- mimeType: "image/jpeg"
6143
+ mimeType: "image/jpeg",
6144
+ annotations: { audience: ["user", "assistant"] }
6122
6145
  });
6123
6146
  content.push({
6124
6147
  type: "text",