@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/lib.cjs CHANGED
@@ -2444,6 +2444,7 @@ function isDirectComponent(name, components) {
2444
2444
  }
2445
2445
 
2446
2446
  // src/tools/capture.ts
2447
+ var import_child_process = require("child_process");
2447
2448
  var import_promises6 = require("fs/promises");
2448
2449
  var import_path8 = require("path");
2449
2450
  var import_core8 = require("@genart-dev/core");
@@ -2527,6 +2528,12 @@ async function captureHtmlMulti(options) {
2527
2528
 
2528
2529
  // src/tools/capture.ts
2529
2530
  var registry2 = (0, import_core8.createDefaultRegistry)();
2531
+ function openPreview(filePath) {
2532
+ const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
2533
+ (0, import_child_process.exec)(`${cmd} "${filePath}"`, (err) => {
2534
+ if (err) console.error(`[openPreview] failed: ${err.message}`);
2535
+ });
2536
+ }
2530
2537
  function applyOverrides(sketch, overrides) {
2531
2538
  if (overrides.seed === void 0 && overrides.params === void 0) {
2532
2539
  return sketch;
@@ -2613,6 +2620,9 @@ async function buildScreenshotMetadata(state, multi, info) {
2613
2620
  await (0, import_promises6.writeFile)(info.previewPath, multi.previewPng);
2614
2621
  metadata.savedPreviewTo = info.previewPath;
2615
2622
  metadata.previewWritten = true;
2623
+ if (info.autoOpen !== false) {
2624
+ openPreview(info.previewPath);
2625
+ }
2616
2626
  }
2617
2627
  return metadata;
2618
2628
  }
@@ -2647,7 +2657,9 @@ async function captureBatch(state, input) {
2647
2657
  target: "sketch",
2648
2658
  sketchId: id,
2649
2659
  seed: effectiveSeed,
2650
- previewPath
2660
+ previewPath,
2661
+ autoOpen: false
2662
+ // Don't flood windows for batch captures
2651
2663
  });
2652
2664
  items.push({
2653
2665
  metadata: itemMetadata,
@@ -5203,7 +5215,12 @@ function registerSketchTools(server, state) {
5203
5215
  });
5204
5216
  return {
5205
5217
  content: [
5206
- { type: "image", data: captureResult.previewJpegBase64, mimeType: "image/jpeg" },
5218
+ {
5219
+ type: "image",
5220
+ data: captureResult.previewJpegBase64,
5221
+ mimeType: "image/jpeg",
5222
+ annotations: { audience: ["user", "assistant"] }
5223
+ },
5207
5224
  { type: "text", text: JSON.stringify({
5208
5225
  ...result,
5209
5226
  capture: captureResult.metadata
@@ -5789,7 +5806,12 @@ function registerCaptureTools(server, state) {
5789
5806
  console.error(`[capture_screenshot] jpeg base64 length: ${result.previewJpegBase64.length}`);
5790
5807
  return {
5791
5808
  content: [
5792
- { type: "image", data: result.previewJpegBase64, mimeType: "image/jpeg" },
5809
+ {
5810
+ type: "image",
5811
+ data: result.previewJpegBase64,
5812
+ mimeType: "image/jpeg",
5813
+ annotations: { audience: ["user", "assistant"] }
5814
+ },
5793
5815
  { type: "text", text: JSON.stringify(result.metadata, null, 2) }
5794
5816
  ]
5795
5817
  };
@@ -5819,7 +5841,8 @@ function registerCaptureTools(server, state) {
5819
5841
  content.push({
5820
5842
  type: "image",
5821
5843
  data: item.inlineJpegBase64,
5822
- mimeType: "image/jpeg"
5844
+ mimeType: "image/jpeg",
5845
+ annotations: { audience: ["user", "assistant"] }
5823
5846
  });
5824
5847
  content.push({
5825
5848
  type: "text",