@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.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,
|