@genart-dev/mcp-server 0.4.3 → 0.4.4

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.js CHANGED
@@ -5184,11 +5184,31 @@ function registerSketchTools(server, state) {
5184
5184
  ).optional().describe('Component dependencies. Use list_components to see available. Keys are component names, values are semver ranges (e.g. "^1.0.0") or objects with version/code/exports.'),
5185
5185
  addToWorkspace: z2.string().optional().describe("Path to workspace to add sketch to after creation"),
5186
5186
  agent: z2.string().optional().describe("Your CLI agent name (e.g. 'claude-code', 'codex-cli', 'gemini-cli', 'opencode', 'kiro')"),
5187
- model: z2.string().optional().describe("Your AI model identifier (e.g. 'claude-opus-4-6', 'gpt-4o', 'gemini-2.5-pro')")
5187
+ model: z2.string().optional().describe("Your AI model identifier (e.g. 'claude-opus-4-6', 'gpt-4o', 'gemini-2.5-pro')"),
5188
+ capture: z2.boolean().optional().describe("When true, automatically capture a screenshot after creation and return it inline (avoids a separate capture_screenshot call)")
5188
5189
  },
5189
5190
  async (args) => {
5190
5191
  try {
5191
5192
  const result = await createSketch(state, args);
5193
+ if (args.capture && !state.remoteMode) {
5194
+ try {
5195
+ const captureResult = await captureScreenshot(state, {
5196
+ target: "sketch",
5197
+ sketchId: args.id
5198
+ });
5199
+ return {
5200
+ content: [
5201
+ { type: "text", text: JSON.stringify({ ...result, capture: captureResult.metadata }, null, 2) },
5202
+ { type: "image", data: captureResult.previewJpegBase64, mimeType: "image/jpeg" }
5203
+ ]
5204
+ };
5205
+ } catch (captureErr) {
5206
+ return jsonResult({
5207
+ ...result,
5208
+ captureError: captureErr instanceof Error ? captureErr.message : String(captureErr)
5209
+ });
5210
+ }
5211
+ }
5192
5212
  return jsonResult(result);
5193
5213
  } catch (e) {
5194
5214
  return toolError(e instanceof Error ? e.message : String(e));