@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/index.cjs CHANGED
@@ -5488,11 +5488,31 @@ function registerSketchTools(server, state) {
5488
5488
  ).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.'),
5489
5489
  addToWorkspace: import_zod2.z.string().optional().describe("Path to workspace to add sketch to after creation"),
5490
5490
  agent: import_zod2.z.string().optional().describe("Your CLI agent name (e.g. 'claude-code', 'codex-cli', 'gemini-cli', 'opencode', 'kiro')"),
5491
- model: import_zod2.z.string().optional().describe("Your AI model identifier (e.g. 'claude-opus-4-6', 'gpt-4o', 'gemini-2.5-pro')")
5491
+ model: import_zod2.z.string().optional().describe("Your AI model identifier (e.g. 'claude-opus-4-6', 'gpt-4o', 'gemini-2.5-pro')"),
5492
+ capture: import_zod2.z.boolean().optional().describe("When true, automatically capture a screenshot after creation and return it inline (avoids a separate capture_screenshot call)")
5492
5493
  },
5493
5494
  async (args) => {
5494
5495
  try {
5495
5496
  const result = await createSketch(state, args);
5497
+ if (args.capture && !state.remoteMode) {
5498
+ try {
5499
+ const captureResult = await captureScreenshot(state, {
5500
+ target: "sketch",
5501
+ sketchId: args.id
5502
+ });
5503
+ return {
5504
+ content: [
5505
+ { type: "text", text: JSON.stringify({ ...result, capture: captureResult.metadata }, null, 2) },
5506
+ { type: "image", data: captureResult.previewJpegBase64, mimeType: "image/jpeg" }
5507
+ ]
5508
+ };
5509
+ } catch (captureErr) {
5510
+ return jsonResult({
5511
+ ...result,
5512
+ captureError: captureErr instanceof Error ? captureErr.message : String(captureErr)
5513
+ });
5514
+ }
5515
+ }
5496
5516
  return jsonResult(result);
5497
5517
  } catch (e) {
5498
5518
  return toolError(e instanceof Error ? e.message : String(e));