@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.js CHANGED
@@ -5503,11 +5503,31 @@ function registerSketchTools(server, state) {
5503
5503
  ).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.'),
5504
5504
  addToWorkspace: z2.string().optional().describe("Path to workspace to add sketch to after creation"),
5505
5505
  agent: z2.string().optional().describe("Your CLI agent name (e.g. 'claude-code', 'codex-cli', 'gemini-cli', 'opencode', 'kiro')"),
5506
- model: z2.string().optional().describe("Your AI model identifier (e.g. 'claude-opus-4-6', 'gpt-4o', 'gemini-2.5-pro')")
5506
+ model: z2.string().optional().describe("Your AI model identifier (e.g. 'claude-opus-4-6', 'gpt-4o', 'gemini-2.5-pro')"),
5507
+ capture: z2.boolean().optional().describe("When true, automatically capture a screenshot after creation and return it inline (avoids a separate capture_screenshot call)")
5507
5508
  },
5508
5509
  async (args) => {
5509
5510
  try {
5510
5511
  const result = await createSketch(state, args);
5512
+ if (args.capture && !state.remoteMode) {
5513
+ try {
5514
+ const captureResult = await captureScreenshot(state, {
5515
+ target: "sketch",
5516
+ sketchId: args.id
5517
+ });
5518
+ return {
5519
+ content: [
5520
+ { type: "text", text: JSON.stringify({ ...result, capture: captureResult.metadata }, null, 2) },
5521
+ { type: "image", data: captureResult.previewJpegBase64, mimeType: "image/jpeg" }
5522
+ ]
5523
+ };
5524
+ } catch (captureErr) {
5525
+ return jsonResult({
5526
+ ...result,
5527
+ captureError: captureErr instanceof Error ? captureErr.message : String(captureErr)
5528
+ });
5529
+ }
5530
+ }
5511
5531
  return jsonResult(result);
5512
5532
  } catch (e) {
5513
5533
  return toolError(e instanceof Error ? e.message : String(e));