@layoutdesign/context 0.1.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/LICENSE +21 -0
- package/README.md +424 -0
- package/dist/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +57 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/src/cli/import-zip.d.ts +2 -0
- package/dist/src/cli/import-zip.d.ts.map +1 -0
- package/dist/src/cli/import-zip.js +156 -0
- package/dist/src/cli/import-zip.js.map +1 -0
- package/dist/src/cli/init.d.ts +4 -0
- package/dist/src/cli/init.d.ts.map +1 -0
- package/dist/src/cli/init.js +104 -0
- package/dist/src/cli/init.js.map +1 -0
- package/dist/src/cli/install.d.ts +5 -0
- package/dist/src/cli/install.d.ts.map +1 -0
- package/dist/src/cli/install.js +192 -0
- package/dist/src/cli/install.js.map +1 -0
- package/dist/src/cli/list.d.ts +2 -0
- package/dist/src/cli/list.d.ts.map +1 -0
- package/dist/src/cli/list.js +36 -0
- package/dist/src/cli/list.js.map +1 -0
- package/dist/src/cli/serve.d.ts +2 -0
- package/dist/src/cli/serve.d.ts.map +1 -0
- package/dist/src/cli/serve.js +9 -0
- package/dist/src/cli/serve.js.map +1 -0
- package/dist/src/cli/use.d.ts +2 -0
- package/dist/src/cli/use.d.ts.map +1 -0
- package/dist/src/cli/use.js +54 -0
- package/dist/src/cli/use.js.map +1 -0
- package/dist/src/compliance/checker.d.ts +23 -0
- package/dist/src/compliance/checker.d.ts.map +1 -0
- package/dist/src/compliance/checker.js +31 -0
- package/dist/src/compliance/checker.js.map +1 -0
- package/dist/src/compliance/rules.d.ts +11 -0
- package/dist/src/compliance/rules.d.ts.map +1 -0
- package/dist/src/compliance/rules.js +147 -0
- package/dist/src/compliance/rules.js.map +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/kit/loader.d.ts +16 -0
- package/dist/src/kit/loader.d.ts.map +1 -0
- package/dist/src/kit/loader.js +98 -0
- package/dist/src/kit/loader.js.map +1 -0
- package/dist/src/kit/parser.d.ts +21 -0
- package/dist/src/kit/parser.d.ts.map +1 -0
- package/dist/src/kit/parser.js +98 -0
- package/dist/src/kit/parser.js.map +1 -0
- package/dist/src/kit/registry.d.ts +4 -0
- package/dist/src/kit/registry.d.ts.map +1 -0
- package/dist/src/kit/registry.js +91 -0
- package/dist/src/kit/registry.js.map +1 -0
- package/dist/src/kit/types.d.ts +51 -0
- package/dist/src/kit/types.d.ts.map +1 -0
- package/dist/src/kit/types.js +11 -0
- package/dist/src/kit/types.js.map +1 -0
- package/dist/src/mcp/server.d.ts +6 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +56 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/tools/check-compliance.d.ts +16 -0
- package/dist/src/mcp/tools/check-compliance.d.ts.map +1 -0
- package/dist/src/mcp/tools/check-compliance.js +44 -0
- package/dist/src/mcp/tools/check-compliance.js.map +1 -0
- package/dist/src/mcp/tools/design-in-figma.d.ts +24 -0
- package/dist/src/mcp/tools/design-in-figma.d.ts.map +1 -0
- package/dist/src/mcp/tools/design-in-figma.js +202 -0
- package/dist/src/mcp/tools/design-in-figma.js.map +1 -0
- package/dist/src/mcp/tools/get-component.d.ts +16 -0
- package/dist/src/mcp/tools/get-component.d.ts.map +1 -0
- package/dist/src/mcp/tools/get-component.js +52 -0
- package/dist/src/mcp/tools/get-component.js.map +1 -0
- package/dist/src/mcp/tools/get-design-system.d.ts +16 -0
- package/dist/src/mcp/tools/get-design-system.d.ts.map +1 -0
- package/dist/src/mcp/tools/get-design-system.js +51 -0
- package/dist/src/mcp/tools/get-design-system.js.map +1 -0
- package/dist/src/mcp/tools/get-screenshots.d.ts +23 -0
- package/dist/src/mcp/tools/get-screenshots.d.ts.map +1 -0
- package/dist/src/mcp/tools/get-screenshots.js +78 -0
- package/dist/src/mcp/tools/get-screenshots.js.map +1 -0
- package/dist/src/mcp/tools/get-tokens.d.ts +20 -0
- package/dist/src/mcp/tools/get-tokens.d.ts.map +1 -0
- package/dist/src/mcp/tools/get-tokens.js +50 -0
- package/dist/src/mcp/tools/get-tokens.js.map +1 -0
- package/dist/src/mcp/tools/list-components.d.ts +11 -0
- package/dist/src/mcp/tools/list-components.d.ts.map +1 -0
- package/dist/src/mcp/tools/list-components.js +38 -0
- package/dist/src/mcp/tools/list-components.js.map +1 -0
- package/dist/src/mcp/tools/preview.d.ts +21 -0
- package/dist/src/mcp/tools/preview.d.ts.map +1 -0
- package/dist/src/mcp/tools/preview.js +63 -0
- package/dist/src/mcp/tools/preview.js.map +1 -0
- package/dist/src/mcp/tools/push-to-figma.d.ts +24 -0
- package/dist/src/mcp/tools/push-to-figma.d.ts.map +1 -0
- package/dist/src/mcp/tools/push-to-figma.js +101 -0
- package/dist/src/mcp/tools/push-to-figma.js.map +1 -0
- package/dist/src/mcp/tools/update-tokens.d.ts +21 -0
- package/dist/src/mcp/tools/update-tokens.d.ts.map +1 -0
- package/dist/src/mcp/tools/update-tokens.js +187 -0
- package/dist/src/mcp/tools/update-tokens.js.map +1 -0
- package/dist/src/mcp/tools/url-to-figma.d.ts +29 -0
- package/dist/src/mcp/tools/url-to-figma.d.ts.map +1 -0
- package/dist/src/mcp/tools/url-to-figma.js +103 -0
- package/dist/src/mcp/tools/url-to-figma.js.map +1 -0
- package/dist/src/preview/server.d.ts +15 -0
- package/dist/src/preview/server.d.ts.map +1 -0
- package/dist/src/preview/server.js +146 -0
- package/dist/src/preview/server.js.map +1 -0
- package/dist/src/preview/static/index.html +493 -0
- package/dist/src/preview/transpile.d.ts +10 -0
- package/dist/src/preview/transpile.d.ts.map +1 -0
- package/dist/src/preview/transpile.js +40 -0
- package/dist/src/preview/transpile.js.map +1 -0
- package/dist/src/preview/ws.d.ts +17 -0
- package/dist/src/preview/ws.d.ts.map +1 -0
- package/dist/src/preview/ws.js +66 -0
- package/dist/src/preview/ws.js.map +1 -0
- package/kits/linear-lite/DESIGN.md +421 -0
- package/kits/linear-lite/kit.json +12 -0
- package/kits/linear-lite/tokens.css +46 -0
- package/kits/linear-lite/tokens.json +47 -0
- package/kits/notion-lite/DESIGN.md +528 -0
- package/kits/notion-lite/kit.json +12 -0
- package/kits/notion-lite/tokens.css +50 -0
- package/kits/notion-lite/tokens.json +51 -0
- package/kits/stripe-lite/DESIGN.md +539 -0
- package/kits/stripe-lite/kit.json +12 -0
- package/kits/stripe-lite/tokens.css +57 -0
- package/kits/stripe-lite/tokens.json +58 -0
- package/package.json +63 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { loadKit } from "../kit/loader.js";
|
|
4
|
+
import { startPreviewServer } from "../preview/server.js";
|
|
5
|
+
// Tool modules
|
|
6
|
+
import * as getDesignSystem from "./tools/get-design-system.js";
|
|
7
|
+
import * as getTokens from "./tools/get-tokens.js";
|
|
8
|
+
import * as getComponent from "./tools/get-component.js";
|
|
9
|
+
import * as listComponents from "./tools/list-components.js";
|
|
10
|
+
import * as checkCompliance from "./tools/check-compliance.js";
|
|
11
|
+
import * as preview from "./tools/preview.js";
|
|
12
|
+
import * as pushToFigma from "./tools/push-to-figma.js";
|
|
13
|
+
import * as urlToFigma from "./tools/url-to-figma.js";
|
|
14
|
+
import * as designInFigma from "./tools/design-in-figma.js";
|
|
15
|
+
import * as updateTokens from "./tools/update-tokens.js";
|
|
16
|
+
import * as getScreenshots from "./tools/get-screenshots.js";
|
|
17
|
+
/**
|
|
18
|
+
* Start the Layout Context MCP server.
|
|
19
|
+
* Loads the kit from the current working directory and registers all tools.
|
|
20
|
+
*/
|
|
21
|
+
export async function startServer() {
|
|
22
|
+
const kit = loadKit();
|
|
23
|
+
const kitName = kit?.manifest.displayName ?? "none";
|
|
24
|
+
const componentCount = kit?.components.length ?? 0;
|
|
25
|
+
// Log to stderr so it doesn't interfere with stdio transport
|
|
26
|
+
console.error(`[layout-context] Kit: ${kitName} (${componentCount} components)`);
|
|
27
|
+
// Start the preview server (HTTP + WebSocket on :4321)
|
|
28
|
+
try {
|
|
29
|
+
const previewServer = await startPreviewServer(undefined, { openBrowser: false });
|
|
30
|
+
console.error(`[layout-context] Preview: ${previewServer.url}`);
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
34
|
+
console.error(`[layout-context] Preview server skipped: ${msg}`);
|
|
35
|
+
}
|
|
36
|
+
const server = new McpServer({
|
|
37
|
+
name: "layout-context",
|
|
38
|
+
version: "0.1.0",
|
|
39
|
+
});
|
|
40
|
+
// Register all 11 tools
|
|
41
|
+
server.tool(getDesignSystem.name, getDesignSystem.description, getDesignSystem.inputSchema, getDesignSystem.handler(kit));
|
|
42
|
+
server.tool(getTokens.name, getTokens.description, getTokens.inputSchema, getTokens.handler(kit));
|
|
43
|
+
server.tool(getComponent.name, getComponent.description, getComponent.inputSchema, getComponent.handler(kit));
|
|
44
|
+
server.tool(listComponents.name, listComponents.description, listComponents.inputSchema, listComponents.handler(kit));
|
|
45
|
+
server.tool(checkCompliance.name, checkCompliance.description, checkCompliance.inputSchema, checkCompliance.handler(kit));
|
|
46
|
+
server.tool(preview.name, preview.description, preview.inputSchema, preview.handler(kit));
|
|
47
|
+
server.tool(pushToFigma.name, pushToFigma.description, pushToFigma.inputSchema, pushToFigma.handler(kit));
|
|
48
|
+
server.tool(urlToFigma.name, urlToFigma.description, urlToFigma.inputSchema, urlToFigma.handler());
|
|
49
|
+
server.tool(designInFigma.name, designInFigma.description, designInFigma.inputSchema, designInFigma.handler(kit));
|
|
50
|
+
server.tool(updateTokens.name, updateTokens.description, updateTokens.inputSchema, updateTokens.handler());
|
|
51
|
+
server.tool(getScreenshots.name, getScreenshots.description, getScreenshots.inputSchema, getScreenshots.handler());
|
|
52
|
+
// Connect via stdio
|
|
53
|
+
const transport = new StdioServerTransport();
|
|
54
|
+
await server.connect(transport);
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,eAAe;AACf,OAAO,KAAK,eAAe,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,aAAa,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAE7D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,MAAM,GAAG,GAAe,OAAO,EAAE,CAAC;IAElC,MAAM,OAAO,GAAG,GAAG,EAAE,QAAQ,CAAC,WAAW,IAAI,MAAM,CAAC;IACpD,MAAM,cAAc,GAAG,GAAG,EAAE,UAAU,CAAC,MAAM,IAAI,CAAC,CAAC;IAEnD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
2
|
+
import type { Kit } from "../../kit/types.js";
|
|
3
|
+
export declare const name = "check-compliance";
|
|
4
|
+
export declare const description: string;
|
|
5
|
+
export declare const inputSchema: {
|
|
6
|
+
code: z.ZodString;
|
|
7
|
+
};
|
|
8
|
+
export declare function handler(kit: Kit | null): ({ code }: {
|
|
9
|
+
code: string;
|
|
10
|
+
}) => Promise<{
|
|
11
|
+
content: {
|
|
12
|
+
type: "text";
|
|
13
|
+
text: string;
|
|
14
|
+
}[];
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=check-compliance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-compliance.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/check-compliance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAI9C,eAAO,MAAM,IAAI,qBAAqB,CAAC;AAEvC,eAAO,MAAM,WAAW,QAGmD,CAAC;AAE5E,eAAO,MAAM,WAAW;;CAEvB,CAAC;AAEF,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,IACvB,UAAU;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE;;;;;GAuCzC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { checkCompliance } from "../../compliance/checker.js";
|
|
3
|
+
export const name = "check-compliance";
|
|
4
|
+
export const description = "Validates a code snippet against the active design system's rules and tokens. " +
|
|
5
|
+
"Returns a list of compliance issues found (hardcoded colours, wrong tokens, missing patterns). " +
|
|
6
|
+
"Use this to verify UI code matches the design system before committing.";
|
|
7
|
+
export const inputSchema = {
|
|
8
|
+
code: z.string().describe("The UI code snippet to check for design system compliance"),
|
|
9
|
+
};
|
|
10
|
+
export function handler(kit) {
|
|
11
|
+
return async ({ code }) => {
|
|
12
|
+
if (!kit) {
|
|
13
|
+
return {
|
|
14
|
+
content: [
|
|
15
|
+
{
|
|
16
|
+
type: "text",
|
|
17
|
+
text: "No design system kit found. Run `npx @layoutdesign/context init` to set one up.",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const result = checkCompliance(code, kit);
|
|
23
|
+
if (result.passed && result.issues.length === 0) {
|
|
24
|
+
return {
|
|
25
|
+
content: [
|
|
26
|
+
{
|
|
27
|
+
type: "text",
|
|
28
|
+
text: "All checks passed. No design system compliance issues found.",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const lines = result.issues.map((issue) => `- [${issue.severity.toUpperCase()}] ${issue.ruleId}${issue.line ? ` (line ${issue.line})` : ""}: ${issue.message}`);
|
|
34
|
+
return {
|
|
35
|
+
content: [
|
|
36
|
+
{
|
|
37
|
+
type: "text",
|
|
38
|
+
text: `# Compliance Check: ${result.summary}\n\n${lines.join("\n")}`,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=check-compliance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-compliance.js","sourceRoot":"","sources":["../../../../src/mcp/tools/check-compliance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAEvC,MAAM,CAAC,MAAM,WAAW,GACtB,gFAAgF;IAChF,iGAAiG;IACjG,yEAAyE,CAAC;AAE5E,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;CACvF,CAAC;AAEF,MAAM,UAAU,OAAO,CAAC,GAAe;IACrC,OAAO,KAAK,EAAE,EAAE,IAAI,EAAoB,EAAE,EAAE;QAC1C,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,iFAAiF;qBACxF;iBACF;aACF,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAqB,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAE5D,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,8DAA8D;qBACrE;iBACF;aACF,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAC7B,CAAC,KAAK,EAAE,EAAE,CACR,MAAM,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,OAAO,EAAE,CACtH,CAAC;QAEF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,uBAAuB,MAAM,CAAC,OAAO,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;iBACrE;aACF;SACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { Kit } from "../../kit/types.js";
|
|
3
|
+
export declare const name = "design-in-figma";
|
|
4
|
+
export declare const description: string;
|
|
5
|
+
export declare const inputSchema: {
|
|
6
|
+
prompt: z.ZodString;
|
|
7
|
+
fileKey: z.ZodOptional<z.ZodString>;
|
|
8
|
+
viewports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
9
|
+
desktop: "desktop";
|
|
10
|
+
tablet: "tablet";
|
|
11
|
+
mobile: "mobile";
|
|
12
|
+
}>>>;
|
|
13
|
+
};
|
|
14
|
+
export declare function handler(kit: Kit | null): ({ prompt, fileKey, viewports, }: {
|
|
15
|
+
prompt: string;
|
|
16
|
+
fileKey?: string;
|
|
17
|
+
viewports?: string[];
|
|
18
|
+
}) => Promise<{
|
|
19
|
+
content: {
|
|
20
|
+
type: "text";
|
|
21
|
+
text: string;
|
|
22
|
+
}[];
|
|
23
|
+
}>;
|
|
24
|
+
//# sourceMappingURL=design-in-figma.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-in-figma.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/design-in-figma.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAE9C,eAAO,MAAM,IAAI,oBAAoB,CAAC;AAEtC,eAAO,MAAM,WAAW,QAIkE,CAAC;AAE3F,eAAO,MAAM,WAAW;;;;;;;;CAkBvB,CAAC;AAEF,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,IACvB,iCAIX;IACD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;;;;;GA4JF"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const name = "design-in-figma";
|
|
3
|
+
export const description = "Design UI components and screens directly in Figma using the loaded design system. " +
|
|
4
|
+
"Takes a natural language prompt (e.g. 'A pricing card with 3 tiers') and returns " +
|
|
5
|
+
"design tokens, component specs, and step-by-step instructions for the AI agent to " +
|
|
6
|
+
"call Figma MCP's generate_figma_design. Requires the Figma MCP server to be connected.";
|
|
7
|
+
export const inputSchema = {
|
|
8
|
+
prompt: z
|
|
9
|
+
.string()
|
|
10
|
+
.describe("What to design — e.g. 'A settings page with sidebar navigation' or 'A pricing card with 3 tiers'"),
|
|
11
|
+
fileKey: z
|
|
12
|
+
.string()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe("Figma file key to add frames to. If omitted, instructions will use newFile mode."),
|
|
15
|
+
viewports: z
|
|
16
|
+
.array(z.enum(["desktop", "tablet", "mobile"]))
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Viewports to create frames for (default: ['desktop']). Each gets a separate Figma frame."),
|
|
19
|
+
};
|
|
20
|
+
export function handler(kit) {
|
|
21
|
+
return async ({ prompt, fileKey, viewports, }) => {
|
|
22
|
+
if (!kit) {
|
|
23
|
+
return {
|
|
24
|
+
content: [
|
|
25
|
+
{
|
|
26
|
+
type: "text",
|
|
27
|
+
text: "No design system kit loaded. Run `npx @layoutdesign/context init` to set up a kit first, or import one with `npx @layoutdesign/context import <path-to-zip>`.",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const resolvedViewports = viewports ?? ["desktop"];
|
|
33
|
+
const outputMode = fileKey ? "existingFile" : "newFile";
|
|
34
|
+
// Build colour palette from tokens
|
|
35
|
+
const colourTokens = extractTokensByCategory(kit, [
|
|
36
|
+
"color",
|
|
37
|
+
"colour",
|
|
38
|
+
"bg",
|
|
39
|
+
"background",
|
|
40
|
+
"text",
|
|
41
|
+
"border",
|
|
42
|
+
"surface",
|
|
43
|
+
"accent",
|
|
44
|
+
]);
|
|
45
|
+
// Build typography tokens
|
|
46
|
+
const typographyTokens = extractTokensByCategory(kit, [
|
|
47
|
+
"font",
|
|
48
|
+
"size",
|
|
49
|
+
"weight",
|
|
50
|
+
"line-height",
|
|
51
|
+
"letter-spacing",
|
|
52
|
+
"heading",
|
|
53
|
+
"body",
|
|
54
|
+
"text",
|
|
55
|
+
]);
|
|
56
|
+
// Build spacing + layout tokens
|
|
57
|
+
const spacingTokens = extractTokensByCategory(kit, [
|
|
58
|
+
"spacing",
|
|
59
|
+
"gap",
|
|
60
|
+
"padding",
|
|
61
|
+
"margin",
|
|
62
|
+
"radius",
|
|
63
|
+
"border-radius",
|
|
64
|
+
"shadow",
|
|
65
|
+
]);
|
|
66
|
+
// Build component inventory
|
|
67
|
+
const componentList = kit.components.length > 0
|
|
68
|
+
? kit.components
|
|
69
|
+
.map((c) => {
|
|
70
|
+
const desc = c.description ? ` — ${c.description}` : "";
|
|
71
|
+
return `- **${c.name}**${desc}`;
|
|
72
|
+
})
|
|
73
|
+
.join("\n")
|
|
74
|
+
: "No components defined in kit.";
|
|
75
|
+
// Build design rules from DESIGN.md
|
|
76
|
+
const designRules = extractDesignRules(kit);
|
|
77
|
+
// Viewport dimensions
|
|
78
|
+
const viewportDimensions = {
|
|
79
|
+
desktop: "1440×900",
|
|
80
|
+
tablet: "768×1024",
|
|
81
|
+
mobile: "375×812",
|
|
82
|
+
};
|
|
83
|
+
const viewportFrames = resolvedViewports
|
|
84
|
+
.map((vp) => `- **${vp}** (${viewportDimensions[vp] ?? "1440×900"}): Create a frame named "${kit.manifest.displayName} — ${prompt} (${vp})"`)
|
|
85
|
+
.join("\n");
|
|
86
|
+
const response = [
|
|
87
|
+
"# Design in Figma",
|
|
88
|
+
"",
|
|
89
|
+
`## Design Brief`,
|
|
90
|
+
"",
|
|
91
|
+
`**Prompt:** ${prompt}`,
|
|
92
|
+
`**Design system:** ${kit.manifest.displayName}`,
|
|
93
|
+
kit.manifest.aesthetic ? `**Aesthetic:** ${kit.manifest.aesthetic}` : "",
|
|
94
|
+
"",
|
|
95
|
+
"---",
|
|
96
|
+
"",
|
|
97
|
+
"## Design Tokens",
|
|
98
|
+
"",
|
|
99
|
+
"Use these exact tokens when creating the design. Map CSS custom properties to Figma styles.",
|
|
100
|
+
"",
|
|
101
|
+
"### Colours",
|
|
102
|
+
"",
|
|
103
|
+
colourTokens || "_No colour tokens found in kit._",
|
|
104
|
+
"",
|
|
105
|
+
"### Typography",
|
|
106
|
+
"",
|
|
107
|
+
typographyTokens || "_No typography tokens found in kit._",
|
|
108
|
+
"",
|
|
109
|
+
"### Spacing & Layout",
|
|
110
|
+
"",
|
|
111
|
+
spacingTokens || "_No spacing tokens found in kit._",
|
|
112
|
+
"",
|
|
113
|
+
"---",
|
|
114
|
+
"",
|
|
115
|
+
"## Available Components",
|
|
116
|
+
"",
|
|
117
|
+
"Reuse these existing component patterns where possible:",
|
|
118
|
+
"",
|
|
119
|
+
componentList,
|
|
120
|
+
"",
|
|
121
|
+
"---",
|
|
122
|
+
"",
|
|
123
|
+
designRules ? `## Design Rules\n\n${designRules}\n\n---\n` : "",
|
|
124
|
+
"## Frames to Create",
|
|
125
|
+
"",
|
|
126
|
+
viewportFrames,
|
|
127
|
+
"",
|
|
128
|
+
"---",
|
|
129
|
+
"",
|
|
130
|
+
"## Instructions",
|
|
131
|
+
"",
|
|
132
|
+
"Follow these steps to create the design in Figma:",
|
|
133
|
+
"",
|
|
134
|
+
`1. Call \`generate_figma_design\` with:`,
|
|
135
|
+
` - \`outputMode: "${outputMode}"\``,
|
|
136
|
+
fileKey ? ` - \`fileKey: "${fileKey}"\`` : "",
|
|
137
|
+
` - \`title: "${kit.manifest.displayName} — ${prompt}"\``,
|
|
138
|
+
` - \`description:\` A detailed HTML description of the UI to create, using the tokens and components listed above`,
|
|
139
|
+
"",
|
|
140
|
+
"2. In your description to `generate_figma_design`, include:",
|
|
141
|
+
" - Exact hex colour values from the token palette above",
|
|
142
|
+
" - Font family, sizes, and weights from the typography tokens",
|
|
143
|
+
" - Spacing values from the spacing tokens",
|
|
144
|
+
" - Component structure matching the patterns listed above",
|
|
145
|
+
" - Layout structure appropriate for each viewport",
|
|
146
|
+
"",
|
|
147
|
+
"3. Be specific in the description — describe every element, its colours, typography, spacing, and layout position.",
|
|
148
|
+
"",
|
|
149
|
+
"## Setup (if Figma MCP is not connected)",
|
|
150
|
+
"",
|
|
151
|
+
"```bash",
|
|
152
|
+
"claude mcp add --transport http figma https://mcp.figma.com/mcp",
|
|
153
|
+
"```",
|
|
154
|
+
"",
|
|
155
|
+
"Authentication is via OAuth — no API key needed.",
|
|
156
|
+
]
|
|
157
|
+
.filter(Boolean)
|
|
158
|
+
.join("\n");
|
|
159
|
+
return {
|
|
160
|
+
content: [{ type: "text", text: response }],
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Extract token lines from tokensCss that match any of the given category keywords.
|
|
166
|
+
*/
|
|
167
|
+
function extractTokensByCategory(kit, keywords) {
|
|
168
|
+
if (!kit.tokensCss)
|
|
169
|
+
return "";
|
|
170
|
+
const lines = kit.tokensCss
|
|
171
|
+
.split("\n")
|
|
172
|
+
.filter((line) => {
|
|
173
|
+
if (!line.includes("--"))
|
|
174
|
+
return false;
|
|
175
|
+
const lower = line.toLowerCase();
|
|
176
|
+
return keywords.some((kw) => lower.includes(kw));
|
|
177
|
+
})
|
|
178
|
+
.slice(0, 40);
|
|
179
|
+
if (lines.length === 0)
|
|
180
|
+
return "";
|
|
181
|
+
return "```css\n" + lines.join("\n") + "\n```";
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Extract design rules from kit sections (looks for "rules", "guidelines", "principles" sections).
|
|
185
|
+
*/
|
|
186
|
+
function extractDesignRules(kit) {
|
|
187
|
+
const rulesSections = kit.sections.filter((s) => {
|
|
188
|
+
const lower = s.id.toLowerCase();
|
|
189
|
+
return (lower.includes("rule") ||
|
|
190
|
+
lower.includes("guideline") ||
|
|
191
|
+
lower.includes("principle") ||
|
|
192
|
+
lower.includes("do-and-don") ||
|
|
193
|
+
lower.includes("constraint"));
|
|
194
|
+
});
|
|
195
|
+
if (rulesSections.length === 0)
|
|
196
|
+
return "";
|
|
197
|
+
return rulesSections
|
|
198
|
+
.map((s) => s.content)
|
|
199
|
+
.join("\n\n")
|
|
200
|
+
.slice(0, 2000);
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=design-in-figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-in-figma.js","sourceRoot":"","sources":["../../../../src/mcp/tools/design-in-figma.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAEtC,MAAM,CAAC,MAAM,WAAW,GACtB,qFAAqF;IACrF,mFAAmF;IACnF,oFAAoF;IACpF,wFAAwF,CAAC;AAE3F,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,QAAQ,CACP,kGAAkG,CACnG;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,kFAAkF,CACnF;IACH,SAAS,EAAE,CAAC;SACT,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;SAC9C,QAAQ,EAAE;SACV,QAAQ,CACP,0FAA0F,CAC3F;CACJ,CAAC;AAEF,MAAM,UAAU,OAAO,CAAC,GAAe;IACrC,OAAO,KAAK,EAAE,EACZ,MAAM,EACN,OAAO,EACP,SAAS,GAKV,EAAE,EAAE;QACH,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,+JAA+J;qBACtK;iBACF;aACF,CAAC;QACJ,CAAC;QAED,MAAM,iBAAiB,GAAG,SAAS,IAAI,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;QAExD,mCAAmC;QACnC,MAAM,YAAY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G,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC;QACjC,OAAO,CACL,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;YACtB,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC;YAC3B,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC;YAC3B,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC5B,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAC7B,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE1C,OAAO,aAAa;SACjB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;SACrB,IAAI,CAAC,MAAM,CAAC;SACZ,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { Kit } from "../../kit/types.js";
|
|
3
|
+
export declare const name = "get-component";
|
|
4
|
+
export declare const description: string;
|
|
5
|
+
export declare const inputSchema: {
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
};
|
|
8
|
+
export declare function handler(kit: Kit | null): ({ name: componentName }: {
|
|
9
|
+
name: string;
|
|
10
|
+
}) => Promise<{
|
|
11
|
+
content: {
|
|
12
|
+
type: "text";
|
|
13
|
+
text: string;
|
|
14
|
+
}[];
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=get-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-component.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/get-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAE9C,eAAO,MAAM,IAAI,kBAAkB,CAAC;AAEpC,eAAO,MAAM,WAAW,QAEsE,CAAC;AAE/F,eAAO,MAAM,WAAW;;CAEvB,CAAC;AAEF,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,IACvB,yBAAyB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE;;;;;GAmDxD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const name = "get-component";
|
|
3
|
+
export const description = "Returns a specific component's specification including description, design tokens used, and code example. " +
|
|
4
|
+
"Use this when you need to implement or modify a specific component from the design system.";
|
|
5
|
+
export const inputSchema = {
|
|
6
|
+
name: z.string().describe("Component name to look up (case-insensitive, e.g. 'Button', 'card', 'NavBar')"),
|
|
7
|
+
};
|
|
8
|
+
export function handler(kit) {
|
|
9
|
+
return async ({ name: componentName }) => {
|
|
10
|
+
if (!kit) {
|
|
11
|
+
return {
|
|
12
|
+
content: [
|
|
13
|
+
{
|
|
14
|
+
type: "text",
|
|
15
|
+
text: "No design system kit found. Run `npx @layoutdesign/context init` to set one up.",
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const lower = componentName.toLowerCase();
|
|
21
|
+
const component = kit.components.find((c) => c.name.toLowerCase() === lower);
|
|
22
|
+
if (!component) {
|
|
23
|
+
const available = kit.components.map((c) => c.name).join(", ");
|
|
24
|
+
return {
|
|
25
|
+
content: [
|
|
26
|
+
{
|
|
27
|
+
type: "text",
|
|
28
|
+
text: `Component "${componentName}" not found. Available components: ${available || "none"}`,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const parts = [`# ${component.name}`, ""];
|
|
34
|
+
if (component.description) {
|
|
35
|
+
parts.push(component.description, "");
|
|
36
|
+
}
|
|
37
|
+
if (component.tokens.length > 0) {
|
|
38
|
+
parts.push("## Tokens Used", "");
|
|
39
|
+
for (const token of component.tokens) {
|
|
40
|
+
parts.push(`- \`${token}\``);
|
|
41
|
+
}
|
|
42
|
+
parts.push("");
|
|
43
|
+
}
|
|
44
|
+
if (component.codeExample) {
|
|
45
|
+
parts.push("## Code Example", "", "```tsx", component.codeExample, "```");
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
content: [{ type: "text", text: parts.join("\n") }],
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=get-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-component.js","sourceRoot":"","sources":["../../../../src/mcp/tools/get-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAC;AAEpC,MAAM,CAAC,MAAM,WAAW,GACtB,4GAA4G;IAC5G,4FAA4F,CAAC;AAE/F,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+EAA+E,CAAC;CAC3G,CAAC;AAEF,MAAM,UAAU,OAAO,CAAC,GAAe;IACrC,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,aAAa,EAAoB,EAAE,EAAE;QACzD,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,iFAAiF;qBACxF;iBACF;aACF,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,aAAa,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,IAAI,CACnC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,CACtC,CAAC;QAEF,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,SAAS,GAAG,GAAG,CAAC,UA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|
3
|
+
export declare const name = "get-design-system";
|
|
4
|
+
export declare const description: string;
|
|
5
|
+
export declare const inputSchema: {
|
|
6
|
+
section: z.ZodOptional<z.ZodString>;
|
|
7
|
+
};
|
|
8
|
+
export declare function handler(kit: Kit | null): ({ section }: {
|
|
9
|
+
section?: string;
|
|
10
|
+
}) => Promise<{
|
|
11
|
+
content: {
|
|
12
|
+
type: "text";
|
|
13
|
+
text: string;
|
|
14
|
+
}[];
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=get-design-system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-design-system.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/get-design-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAG9C,eAAO,MAAM,IAAI,sBAAsB,CAAC;AAExC,eAAO,MAAM,WAAW,QAE0F,CAAC;AAEnH,eAAO,MAAM,WAAW;;CAOvB,CAAC;AAEF,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,IACvB,aAAa;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;GAuChD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { extractSection } from "../../kit/parser.js";
|
|
3
|
+
export const name = "get-design-system";
|
|
4
|
+
export const description = "Returns the full DESIGN.md content for the active design system, or a specific section. " +
|
|
5
|
+
"Use this to understand colours, typography, spacing, layout rules, and component specs before writing UI code.";
|
|
6
|
+
export const inputSchema = {
|
|
7
|
+
section: z
|
|
8
|
+
.string()
|
|
9
|
+
.optional()
|
|
10
|
+
.describe("Optional keyword to filter to a specific section (e.g. 'colours', 'typography', 'spacing', 'components')"),
|
|
11
|
+
};
|
|
12
|
+
export function handler(kit) {
|
|
13
|
+
return async ({ section }) => {
|
|
14
|
+
if (!kit) {
|
|
15
|
+
return {
|
|
16
|
+
content: [
|
|
17
|
+
{
|
|
18
|
+
type: "text",
|
|
19
|
+
text: "No design system kit found. Run `npx @layoutdesign/context init` in your project root to set one up, or place a DESIGN.md in .layout/.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
if (section) {
|
|
25
|
+
const match = extractSection(kit.sections, section);
|
|
26
|
+
if (!match) {
|
|
27
|
+
const available = kit.sections.map((s) => s.title).join(", ");
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{
|
|
31
|
+
type: "text",
|
|
32
|
+
text: `No section matching "${section}" found. Available sections: ${available}`,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: "text",
|
|
41
|
+
text: `## ${match.title}\n\n${match.content}`,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
content: [{ type: "text", text: kit.designMd }],
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=get-design-system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-design-system.js","sourceRoot":"","sources":["../../../../src/mcp/tools/get-design-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,IAAI,GAAG,mBAAmB,CAAC;AAExC,MAAM,CAAC,MAAM,WAAW,GACtB,0FAA0F;IAC1F,gHAAgH,CAAC;AAEnH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,0GAA0G,CAC3G;CACJ,CAAC;AAEF,MAAM,UAAU,OAAO,CAAC,GAAe;IACrC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAwB,EAAE,EAAE;QACjD,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,wIAAwI;qBAC/I;iBACF;aACF,CAAC;QACJ,CAAC;QAED,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACpD,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,SAAS,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC9D,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,wBAAwB,OAAO,gCAAgC,SAAS,EAAE;yBACjF;qBACF;iBACF,CAAC;YACJ,CAAC;YACD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,MAAM,KAAK,CAAC,KAAK,OAAO,KAAK,CAAC,OAAO,EAAE;qBAC9C;iBACF;aACF,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC;SACzD,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const name = "get-screenshots";
|
|
3
|
+
export declare const description: string;
|
|
4
|
+
export declare const inputSchema: {
|
|
5
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
viewport: "viewport";
|
|
7
|
+
"full-page": "full-page";
|
|
8
|
+
all: "all";
|
|
9
|
+
}>>>;
|
|
10
|
+
};
|
|
11
|
+
export declare function handler(): ({ type }: {
|
|
12
|
+
type?: "full-page" | "viewport" | "all";
|
|
13
|
+
}) => Promise<{
|
|
14
|
+
content: ({
|
|
15
|
+
type: "text";
|
|
16
|
+
text: string;
|
|
17
|
+
} | {
|
|
18
|
+
type: "image";
|
|
19
|
+
data: string;
|
|
20
|
+
mimeType: string;
|
|
21
|
+
})[];
|
|
22
|
+
}>;
|
|
23
|
+
//# sourceMappingURL=get-screenshots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-screenshots.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/get-screenshots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,IAAI,oBAAoB,CAAC;AAEtC,eAAO,MAAM,WAAW,QAG0B,CAAC;AAEnD,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAC;AAIF,wBAAgB,OAAO,KACP,UAAkB;IAAE,IAAI,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,KAAK,CAAA;CAAE;;cA4C5C,MAAM;cAAQ,MAAM;;cAAa,OAAO;cAAQ,MAAM;kBAAY,MAAM;;GAoBxG"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { readFileSync, existsSync, readdirSync } from "node:fs";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
import { LAYOUT_DIR } from "../../kit/types.js";
|
|
5
|
+
export const name = "get-screenshots";
|
|
6
|
+
export const description = "Get design system reference screenshots captured during website extraction. " +
|
|
7
|
+
"Returns full-page and/or viewport screenshots as images that can be used for " +
|
|
8
|
+
"visual comparison when building UI components.";
|
|
9
|
+
export const inputSchema = {
|
|
10
|
+
type: z
|
|
11
|
+
.enum(["full-page", "viewport", "all"])
|
|
12
|
+
.optional()
|
|
13
|
+
.default("all")
|
|
14
|
+
.describe("Which screenshot to return: full-page, viewport, or all (default)"),
|
|
15
|
+
};
|
|
16
|
+
const SCREENSHOTS_DIR = "screenshots";
|
|
17
|
+
export function handler() {
|
|
18
|
+
return async ({ type = "all" }) => {
|
|
19
|
+
const dir = resolve(process.cwd(), LAYOUT_DIR, SCREENSHOTS_DIR);
|
|
20
|
+
if (!existsSync(dir)) {
|
|
21
|
+
return {
|
|
22
|
+
content: [
|
|
23
|
+
{
|
|
24
|
+
type: "text",
|
|
25
|
+
text: "No screenshots found. Screenshots are captured during website extraction in the Studio and included in exported bundles.",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const files = readdirSync(dir).filter((f) => f.endsWith(".png"));
|
|
31
|
+
if (files.length === 0) {
|
|
32
|
+
return {
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
type: "text",
|
|
36
|
+
text: "Screenshots directory exists but contains no PNG files.",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const wantedFiles = files.filter((f) => {
|
|
42
|
+
if (type === "all")
|
|
43
|
+
return true;
|
|
44
|
+
if (type === "full-page")
|
|
45
|
+
return f.includes("full-page");
|
|
46
|
+
if (type === "viewport")
|
|
47
|
+
return f.includes("viewport");
|
|
48
|
+
return false;
|
|
49
|
+
});
|
|
50
|
+
if (wantedFiles.length === 0) {
|
|
51
|
+
return {
|
|
52
|
+
content: [
|
|
53
|
+
{
|
|
54
|
+
type: "text",
|
|
55
|
+
text: `No ${type} screenshot found. Available: ${files.join(", ")}`,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const content = [];
|
|
61
|
+
for (const file of wantedFiles) {
|
|
62
|
+
const filePath = join(dir, file);
|
|
63
|
+
const buffer = readFileSync(filePath);
|
|
64
|
+
const base64 = buffer.toString("base64");
|
|
65
|
+
content.push({
|
|
66
|
+
type: "text",
|
|
67
|
+
text: `Screenshot: ${file}`,
|
|
68
|
+
});
|
|
69
|
+
content.push({
|
|
70
|
+
type: "image",
|
|
71
|
+
data: base64,
|
|
72
|
+
mimeType: "image/png",
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return { content };
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=get-screenshots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-screenshots.js","sourceRoot":"","sources":["../../../../src/mcp/tools/get-screenshots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,CAAC,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAEtC,MAAM,CAAC,MAAM,WAAW,GACtB,8EAA8E;IAC9E,+EAA+E;IAC/E,gDAAgD,CAAC;AAEnD,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;SACtC,QAAQ,EAAE;SACV,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CAAC,mEAAmE,CAAC;CACjF,CAAC;AAEF,MAAM,eAAe,GAAG,aAAa,CAAC;AAEtC,MAAM,UAAU,OAAO;IACrB,OAAO,KAAK,EAAE,EAAE,IAAI,GAAG,KAAK,EAA+C,EAAE,EAAE;QAC7E,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,eAAe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