@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 +13 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/lib.cjs +13 -1
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.js +13 -1
- package/dist/lib.js.map +1 -1
- package/package.json +1 -1
package/dist/lib.js
CHANGED
|
@@ -2424,6 +2424,7 @@ function isDirectComponent(name, components) {
|
|
|
2424
2424
|
}
|
|
2425
2425
|
|
|
2426
2426
|
// src/tools/capture.ts
|
|
2427
|
+
import { exec } from "child_process";
|
|
2427
2428
|
import { mkdir, writeFile as writeFile5 } from "fs/promises";
|
|
2428
2429
|
import { dirname as dirname5, join as join3 } from "path";
|
|
2429
2430
|
import {
|
|
@@ -2509,6 +2510,12 @@ async function captureHtmlMulti(options) {
|
|
|
2509
2510
|
|
|
2510
2511
|
// src/tools/capture.ts
|
|
2511
2512
|
var registry2 = createDefaultRegistry2();
|
|
2513
|
+
function openPreview(filePath) {
|
|
2514
|
+
const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
2515
|
+
exec(`${cmd} "${filePath}"`, (err) => {
|
|
2516
|
+
if (err) console.error(`[openPreview] failed: ${err.message}`);
|
|
2517
|
+
});
|
|
2518
|
+
}
|
|
2512
2519
|
function applyOverrides(sketch, overrides) {
|
|
2513
2520
|
if (overrides.seed === void 0 && overrides.params === void 0) {
|
|
2514
2521
|
return sketch;
|
|
@@ -2595,6 +2602,9 @@ async function buildScreenshotMetadata(state, multi, info) {
|
|
|
2595
2602
|
await writeFile5(info.previewPath, multi.previewPng);
|
|
2596
2603
|
metadata.savedPreviewTo = info.previewPath;
|
|
2597
2604
|
metadata.previewWritten = true;
|
|
2605
|
+
if (info.autoOpen !== false) {
|
|
2606
|
+
openPreview(info.previewPath);
|
|
2607
|
+
}
|
|
2598
2608
|
}
|
|
2599
2609
|
return metadata;
|
|
2600
2610
|
}
|
|
@@ -2629,7 +2639,9 @@ async function captureBatch(state, input) {
|
|
|
2629
2639
|
target: "sketch",
|
|
2630
2640
|
sketchId: id,
|
|
2631
2641
|
seed: effectiveSeed,
|
|
2632
|
-
previewPath
|
|
2642
|
+
previewPath,
|
|
2643
|
+
autoOpen: false
|
|
2644
|
+
// Don't flood windows for batch captures
|
|
2633
2645
|
});
|
|
2634
2646
|
items.push({
|
|
2635
2647
|
metadata: itemMetadata,
|