@genart-dev/mcp-server 0.4.6 → 0.4.7
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 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -25
- package/dist/index.js.map +1 -1
- package/dist/lib.cjs +13 -25
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.js +13 -25
- package/dist/lib.js.map +1 -1
- package/package.json +1 -1
package/dist/lib.js
CHANGED
|
@@ -2574,9 +2574,7 @@ async function captureScreenshot(state, input) {
|
|
|
2574
2574
|
previewPath
|
|
2575
2575
|
});
|
|
2576
2576
|
const previewJpegBase64 = Buffer.from(multi.inlineJpeg).toString("base64");
|
|
2577
|
-
|
|
2578
|
-
metadata.previewDataUri = previewDataUri;
|
|
2579
|
-
return { metadata, previewJpegBase64, previewDataUri };
|
|
2577
|
+
return { metadata, previewJpegBase64 };
|
|
2580
2578
|
} catch (e) {
|
|
2581
2579
|
const msg = e instanceof Error ? e.message : String(e);
|
|
2582
2580
|
throw new Error(`Renderer error for '${sketchId}': ${msg}`);
|
|
@@ -5187,7 +5185,7 @@ function registerSketchTools(server, state) {
|
|
|
5187
5185
|
addToWorkspace: z2.string().optional().describe("Path to workspace to add sketch to after creation"),
|
|
5188
5186
|
agent: z2.string().optional().describe("Your CLI agent name (e.g. 'claude-code', 'codex-cli', 'gemini-cli', 'opencode', 'kiro')"),
|
|
5189
5187
|
model: z2.string().optional().describe("Your AI model identifier (e.g. 'claude-opus-4-6', 'gpt-4o', 'gemini-2.5-pro')"),
|
|
5190
|
-
capture: z2.boolean().optional().describe("When true, automatically capture a screenshot after creation
|
|
5188
|
+
capture: z2.boolean().optional().describe("When true, automatically capture a screenshot after creation and return it inline (avoids a separate capture_screenshot call)")
|
|
5191
5189
|
},
|
|
5192
5190
|
async (args) => {
|
|
5193
5191
|
try {
|
|
@@ -5198,15 +5196,13 @@ function registerSketchTools(server, state) {
|
|
|
5198
5196
|
target: "sketch",
|
|
5199
5197
|
sketchId: args.id
|
|
5200
5198
|
});
|
|
5201
|
-
const captureMeta = captureResult.metadata;
|
|
5202
5199
|
return {
|
|
5203
5200
|
content: [
|
|
5201
|
+
{ type: "image", data: captureResult.previewJpegBase64, mimeType: "image/jpeg" },
|
|
5204
5202
|
{ type: "text", text: JSON.stringify({
|
|
5205
5203
|
...result,
|
|
5206
|
-
capture:
|
|
5207
|
-
}, null, 2) }
|
|
5208
|
-
{ type: "image", data: captureResult.previewJpegBase64, mimeType: "image/jpeg" },
|
|
5209
|
-
...captureMeta.savedPreviewTo ? [{ type: "text", text: `` }] : []
|
|
5204
|
+
capture: captureResult.metadata
|
|
5205
|
+
}, null, 2) }
|
|
5210
5206
|
]
|
|
5211
5207
|
};
|
|
5212
5208
|
} catch (captureErr) {
|
|
@@ -5772,7 +5768,7 @@ function registerSnapshotTools(server, state) {
|
|
|
5772
5768
|
function registerCaptureTools(server, state) {
|
|
5773
5769
|
server.tool(
|
|
5774
5770
|
"capture_screenshot",
|
|
5775
|
-
"Capture a screenshot of a sketch. Returns
|
|
5771
|
+
"Capture a screenshot of a sketch. Returns an inline JPEG image + metadata as text. In local mode, also writes a full-res PNG to snapshots/<sketchId>-<seed>-preview.png (path in savedPreviewTo).",
|
|
5776
5772
|
{
|
|
5777
5773
|
target: z2.enum(["selected", "sketch"]).optional().describe("What to capture (default: selected)"),
|
|
5778
5774
|
sketchId: z2.string().optional().describe("Required when target is 'sketch'"),
|
|
@@ -5785,13 +5781,11 @@ function registerCaptureTools(server, state) {
|
|
|
5785
5781
|
async (args) => {
|
|
5786
5782
|
try {
|
|
5787
5783
|
const result = await captureScreenshot(state, args);
|
|
5788
|
-
console.error(`[capture_screenshot] jpeg base64 length: ${result.previewJpegBase64.length}
|
|
5784
|
+
console.error(`[capture_screenshot] jpeg base64 length: ${result.previewJpegBase64.length}`);
|
|
5789
5785
|
return {
|
|
5790
5786
|
content: [
|
|
5791
|
-
{ type: "text", text: JSON.stringify(result.metadata, null, 2) },
|
|
5792
5787
|
{ type: "image", data: result.previewJpegBase64, mimeType: "image/jpeg" },
|
|
5793
|
-
|
|
5794
|
-
...result.metadata.savedPreviewTo ? [{ type: "text", text: `` }] : []
|
|
5788
|
+
{ type: "text", text: JSON.stringify(result.metadata, null, 2) }
|
|
5795
5789
|
]
|
|
5796
5790
|
};
|
|
5797
5791
|
} catch (e) {
|
|
@@ -5802,7 +5796,7 @@ function registerCaptureTools(server, state) {
|
|
|
5802
5796
|
);
|
|
5803
5797
|
server.tool(
|
|
5804
5798
|
"capture_batch",
|
|
5805
|
-
"Capture screenshots of multiple sketches in parallel. Returns
|
|
5799
|
+
"Capture screenshots of multiple sketches in parallel. Returns inline JPEG images + per-sketch metadata. In local mode, writes full-res PNGs to snapshots/.",
|
|
5806
5800
|
{
|
|
5807
5801
|
sketchIds: z2.array(z2.string()).optional().describe("IDs of sketches to capture (default: all)"),
|
|
5808
5802
|
width: z2.number().optional().describe("Override width for all captures"),
|
|
@@ -5817,21 +5811,15 @@ function registerCaptureTools(server, state) {
|
|
|
5817
5811
|
{ type: "text", text: JSON.stringify(result.metadata, null, 2) }
|
|
5818
5812
|
];
|
|
5819
5813
|
for (const item of result.items) {
|
|
5820
|
-
content.push({
|
|
5821
|
-
type: "text",
|
|
5822
|
-
text: JSON.stringify(item.metadata, null, 2)
|
|
5823
|
-
});
|
|
5824
5814
|
content.push({
|
|
5825
5815
|
type: "image",
|
|
5826
5816
|
data: item.inlineJpegBase64,
|
|
5827
5817
|
mimeType: "image/jpeg"
|
|
5828
5818
|
});
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
});
|
|
5834
|
-
}
|
|
5819
|
+
content.push({
|
|
5820
|
+
type: "text",
|
|
5821
|
+
text: JSON.stringify(item.metadata, null, 2)
|
|
5822
|
+
});
|
|
5835
5823
|
}
|
|
5836
5824
|
return { content };
|
|
5837
5825
|
} catch (e) {
|