@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 +27 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -4
- package/dist/index.js.map +1 -1
- package/dist/lib.cjs +27 -4
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.js +27 -4
- package/dist/lib.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2743,6 +2743,7 @@ function isDirectComponent(name, components) {
|
|
|
2743
2743
|
}
|
|
2744
2744
|
|
|
2745
2745
|
// src/tools/capture.ts
|
|
2746
|
+
import { exec } from "child_process";
|
|
2746
2747
|
import { mkdir, writeFile as writeFile6 } from "fs/promises";
|
|
2747
2748
|
import { dirname as dirname6, join as join3 } from "path";
|
|
2748
2749
|
import {
|
|
@@ -2828,6 +2829,12 @@ async function captureHtmlMulti(options) {
|
|
|
2828
2829
|
|
|
2829
2830
|
// src/tools/capture.ts
|
|
2830
2831
|
var registry2 = createDefaultRegistry2();
|
|
2832
|
+
function openPreview(filePath) {
|
|
2833
|
+
const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
2834
|
+
exec(`${cmd} "${filePath}"`, (err) => {
|
|
2835
|
+
if (err) console.error(`[openPreview] failed: ${err.message}`);
|
|
2836
|
+
});
|
|
2837
|
+
}
|
|
2831
2838
|
function applyOverrides(sketch, overrides) {
|
|
2832
2839
|
if (overrides.seed === void 0 && overrides.params === void 0) {
|
|
2833
2840
|
return sketch;
|
|
@@ -2914,6 +2921,9 @@ async function buildScreenshotMetadata(state, multi, info) {
|
|
|
2914
2921
|
await writeFile6(info.previewPath, multi.previewPng);
|
|
2915
2922
|
metadata.savedPreviewTo = info.previewPath;
|
|
2916
2923
|
metadata.previewWritten = true;
|
|
2924
|
+
if (info.autoOpen !== false) {
|
|
2925
|
+
openPreview(info.previewPath);
|
|
2926
|
+
}
|
|
2917
2927
|
}
|
|
2918
2928
|
return metadata;
|
|
2919
2929
|
}
|
|
@@ -2948,7 +2958,9 @@ async function captureBatch(state, input) {
|
|
|
2948
2958
|
target: "sketch",
|
|
2949
2959
|
sketchId: id,
|
|
2950
2960
|
seed: effectiveSeed,
|
|
2951
|
-
previewPath
|
|
2961
|
+
previewPath,
|
|
2962
|
+
autoOpen: false
|
|
2963
|
+
// Don't flood windows for batch captures
|
|
2952
2964
|
});
|
|
2953
2965
|
items.push({
|
|
2954
2966
|
metadata: itemMetadata,
|
|
@@ -5517,7 +5529,12 @@ function registerSketchTools(server, state) {
|
|
|
5517
5529
|
});
|
|
5518
5530
|
return {
|
|
5519
5531
|
content: [
|
|
5520
|
-
{
|
|
5532
|
+
{
|
|
5533
|
+
type: "image",
|
|
5534
|
+
data: captureResult.previewJpegBase64,
|
|
5535
|
+
mimeType: "image/jpeg",
|
|
5536
|
+
annotations: { audience: ["user", "assistant"] }
|
|
5537
|
+
},
|
|
5521
5538
|
{ type: "text", text: JSON.stringify({
|
|
5522
5539
|
...result,
|
|
5523
5540
|
capture: captureResult.metadata
|
|
@@ -6103,7 +6120,12 @@ function registerCaptureTools(server, state) {
|
|
|
6103
6120
|
console.error(`[capture_screenshot] jpeg base64 length: ${result.previewJpegBase64.length}`);
|
|
6104
6121
|
return {
|
|
6105
6122
|
content: [
|
|
6106
|
-
{
|
|
6123
|
+
{
|
|
6124
|
+
type: "image",
|
|
6125
|
+
data: result.previewJpegBase64,
|
|
6126
|
+
mimeType: "image/jpeg",
|
|
6127
|
+
annotations: { audience: ["user", "assistant"] }
|
|
6128
|
+
},
|
|
6107
6129
|
{ type: "text", text: JSON.stringify(result.metadata, null, 2) }
|
|
6108
6130
|
]
|
|
6109
6131
|
};
|
|
@@ -6133,7 +6155,8 @@ function registerCaptureTools(server, state) {
|
|
|
6133
6155
|
content.push({
|
|
6134
6156
|
type: "image",
|
|
6135
6157
|
data: item.inlineJpegBase64,
|
|
6136
|
-
mimeType: "image/jpeg"
|
|
6158
|
+
mimeType: "image/jpeg",
|
|
6159
|
+
annotations: { audience: ["user", "assistant"] }
|
|
6137
6160
|
});
|
|
6138
6161
|
content.push({
|
|
6139
6162
|
type: "text",
|