@brander/mcp-tools 0.2.0

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.
Files changed (57) hide show
  1. package/README.md +126 -0
  2. package/dist/app/index.html +8406 -0
  3. package/dist/server/brand/brand-loader.d.ts +26 -0
  4. package/dist/server/brand/brand-loader.d.ts.map +1 -0
  5. package/dist/server/brand/brand-loader.js +89 -0
  6. package/dist/server/brand/brand-types.d.ts +93 -0
  7. package/dist/server/brand/brand-types.d.ts.map +1 -0
  8. package/dist/server/brand/brand-types.js +32 -0
  9. package/dist/server/config/server-config.d.ts +16 -0
  10. package/dist/server/config/server-config.d.ts.map +1 -0
  11. package/dist/server/config/server-config.js +71 -0
  12. package/dist/server/config/types.d.ts +21 -0
  13. package/dist/server/config/types.d.ts.map +1 -0
  14. package/dist/server/config/types.js +4 -0
  15. package/dist/server/elements/click-behaviors.d.ts +13 -0
  16. package/dist/server/elements/click-behaviors.d.ts.map +1 -0
  17. package/dist/server/elements/click-behaviors.js +71 -0
  18. package/dist/server/elements/element-functions.d.ts +24 -0
  19. package/dist/server/elements/element-functions.d.ts.map +1 -0
  20. package/dist/server/elements/element-functions.js +167 -0
  21. package/dist/server/index.d.ts +9 -0
  22. package/dist/server/index.d.ts.map +1 -0
  23. package/dist/server/index.js +30 -0
  24. package/dist/server/lib-entry.d.ts +16 -0
  25. package/dist/server/lib-entry.d.ts.map +1 -0
  26. package/dist/server/lib-entry.js +14 -0
  27. package/dist/server/register.d.ts +35 -0
  28. package/dist/server/register.d.ts.map +1 -0
  29. package/dist/server/register.js +49 -0
  30. package/dist/server/resource/html-loader.d.ts +9 -0
  31. package/dist/server/resource/html-loader.d.ts.map +1 -0
  32. package/dist/server/resource/html-loader.js +20 -0
  33. package/dist/server/resource/resource-registry.d.ts +15 -0
  34. package/dist/server/resource/resource-registry.d.ts.map +1 -0
  35. package/dist/server/resource/resource-registry.js +45 -0
  36. package/dist/server/server.d.ts +13 -0
  37. package/dist/server/server.d.ts.map +1 -0
  38. package/dist/server/server.js +36 -0
  39. package/dist/server/tools/element-definitions.d.ts +15 -0
  40. package/dist/server/tools/element-definitions.d.ts.map +1 -0
  41. package/dist/server/tools/element-definitions.js +51 -0
  42. package/dist/server/tools/generate-screen-schema.d.ts +262 -0
  43. package/dist/server/tools/generate-screen-schema.d.ts.map +1 -0
  44. package/dist/server/tools/generate-screen-schema.js +227 -0
  45. package/dist/server/tools/tool-handler.d.ts +11 -0
  46. package/dist/server/tools/tool-handler.d.ts.map +1 -0
  47. package/dist/server/tools/tool-handler.js +83 -0
  48. package/dist/server/tools/tool-registry.d.ts +15 -0
  49. package/dist/server/tools/tool-registry.d.ts.map +1 -0
  50. package/dist/server/tools/tool-registry.js +30 -0
  51. package/dist/server/types/element-types.d.ts +37 -0
  52. package/dist/server/types/element-types.d.ts.map +1 -0
  53. package/dist/server/types/element-types.js +22 -0
  54. package/dist/server/types/mcp-types.d.ts +52 -0
  55. package/dist/server/types/mcp-types.d.ts.map +1 -0
  56. package/dist/server/types/mcp-types.js +4 -0
  57. package/package.json +56 -0
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * BranderUX MCP Server — entry point.
4
+ *
5
+ * Exposes 14 BranderUX Element types as MCP App tools.
6
+ * Each tool returns branded, interactive UI rendered in the host's chat.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG"}
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * BranderUX MCP Server — entry point.
4
+ *
5
+ * Exposes 14 BranderUX Element types as MCP App tools.
6
+ * Each tool returns branded, interactive UI rendered in the host's chat.
7
+ */
8
+ import { loadServerConfig, validateConfig } from "./config/server-config.js";
9
+ import { createBranderMCPServer } from "./server.js";
10
+ async function main() {
11
+ // Load configuration
12
+ const config = loadServerConfig();
13
+ const errors = validateConfig(config);
14
+ if (errors.length > 0) {
15
+ console.error("Configuration errors:");
16
+ for (const error of errors) {
17
+ console.error(` - ${error}`);
18
+ }
19
+ process.exit(1);
20
+ }
21
+ // Start server
22
+ try {
23
+ await createBranderMCPServer(config);
24
+ }
25
+ catch (error) {
26
+ console.error("Fatal error starting BranderUX MCP server:", error);
27
+ process.exit(1);
28
+ }
29
+ }
30
+ main();
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @brander/mcp-tools — library entry point.
3
+ *
4
+ * Usage:
5
+ * ```typescript
6
+ * import { registerBranderTools } from "@brander/mcp-tools";
7
+ *
8
+ * const server = new McpServer({ name: "my-app", version: "1.0.0" });
9
+ * server.registerTool("my_tool", { ... }, handler);
10
+ * await registerBranderTools(server, { projectId: "proj_abc", betaKey: "bux_dp_xyz" });
11
+ * await server.connect(transport);
12
+ * ```
13
+ */
14
+ export { registerBranderTools } from "./register.js";
15
+ export type { BranderToolsConfig } from "./register.js";
16
+ //# sourceMappingURL=lib-entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib-entry.d.ts","sourceRoot":"","sources":["../../src/lib-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @brander/mcp-tools — library entry point.
3
+ *
4
+ * Usage:
5
+ * ```typescript
6
+ * import { registerBranderTools } from "@brander/mcp-tools";
7
+ *
8
+ * const server = new McpServer({ name: "my-app", version: "1.0.0" });
9
+ * server.registerTool("my_tool", { ... }, handler);
10
+ * await registerBranderTools(server, { projectId: "proj_abc", betaKey: "bux_dp_xyz" });
11
+ * await server.connect(transport);
12
+ * ```
13
+ */
14
+ export { registerBranderTools } from "./register.js";
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Public API — one-liner to add BranderUX branded UI rendering to any MCP server.
3
+ *
4
+ * Usage:
5
+ * ```typescript
6
+ * import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
7
+ * import { registerBranderTools } from "@brander/mcp-tools";
8
+ *
9
+ * const server = new McpServer({ name: "my-app", version: "1.0.0" });
10
+ * await registerBranderTools(server, { projectId: "proj_abc", betaKey: "bux_dp_xyz" });
11
+ * ```
12
+ */
13
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
14
+ export interface BranderToolsConfig {
15
+ /** BranderUX project ID — identifies which project's brand + screens to load */
16
+ projectId: string;
17
+ /** Beta design partner key (bux_dp_xxx) for authentication */
18
+ betaKey: string;
19
+ /** BranderUX API base URL (defaults to https://app.branderux.com) */
20
+ apiBaseUrl?: string;
21
+ /** Path to local brandSettings.json file (alternative to API for development) */
22
+ brandSettingsPath?: string;
23
+ }
24
+ /**
25
+ * Register BranderUX tools on an existing MCP server.
26
+ *
27
+ * Adds:
28
+ * - `generate_screen` tool — renders 1-N branded elements in a composed screen
29
+ * - MCP App resource — universal HTML renderer for all 14 element types
30
+ *
31
+ * This composable API allows customers to mix their own data tools with
32
+ * BranderUX UI rendering on a single MCP server.
33
+ */
34
+ export declare function registerBranderTools(server: McpServer, config: BranderToolsConfig): Promise<void>;
35
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQpE,MAAM,WAAW,kBAAkB;IACjC,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAElB,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAEhB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Public API — one-liner to add BranderUX branded UI rendering to any MCP server.
3
+ *
4
+ * Usage:
5
+ * ```typescript
6
+ * import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
7
+ * import { registerBranderTools } from "@brander/mcp-tools";
8
+ *
9
+ * const server = new McpServer({ name: "my-app", version: "1.0.0" });
10
+ * await registerBranderTools(server, { projectId: "proj_abc", betaKey: "bux_dp_xyz" });
11
+ * ```
12
+ */
13
+ import { loadProjectConfig } from "./brand/brand-loader.js";
14
+ import { registerTools } from "./tools/tool-registry.js";
15
+ import { registerAppResourceHandler } from "./resource/resource-registry.js";
16
+ const DEFAULT_API_BASE_URL = "https://app.branderux.com";
17
+ /**
18
+ * Register BranderUX tools on an existing MCP server.
19
+ *
20
+ * Adds:
21
+ * - `generate_screen` tool — renders 1-N branded elements in a composed screen
22
+ * - MCP App resource — universal HTML renderer for all 14 element types
23
+ *
24
+ * This composable API allows customers to mix their own data tools with
25
+ * BranderUX UI rendering on a single MCP server.
26
+ */
27
+ export async function registerBranderTools(server, config) {
28
+ // 1. Load full project configuration (API or local file)
29
+ const apiBaseUrl = config.apiBaseUrl || DEFAULT_API_BASE_URL;
30
+ console.error("Loading BranderUX project configuration...");
31
+ const projectConfig = await loadProjectConfig({
32
+ projectId: config.projectId,
33
+ betaKey: config.betaKey,
34
+ apiBaseUrl,
35
+ brandSettingsPath: config.brandSettingsPath,
36
+ });
37
+ console.error(`BranderUX project loaded: "${projectConfig.projectName}" ` +
38
+ `(brand: "${projectConfig.brandSettings.brandName}")`);
39
+ // 2. Build API config for app-side query enhancement
40
+ const apiConfig = {
41
+ apiBaseUrl,
42
+ betaKey: config.betaKey,
43
+ projectId: config.projectId,
44
+ };
45
+ // 3. Register the universal renderer app resource
46
+ registerAppResourceHandler(server, projectConfig);
47
+ // 4. Register the generate_screen tool
48
+ registerTools(server, projectConfig, apiConfig);
49
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * HTML loader — reads the bundled universal renderer app from dist/app/index.html.
3
+ */
4
+ /**
5
+ * Load the bundled universal renderer HTML.
6
+ * Returns the single-file HTML string (JS + CSS inlined by vite-plugin-singlefile).
7
+ */
8
+ export declare function loadAppHtml(): string;
9
+ //# sourceMappingURL=html-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-loader.d.ts","sourceRoot":"","sources":["../../../src/resource/html-loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH;;;GAGG;AACH,wBAAgB,WAAW,IAAI,MAAM,CASpC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * HTML loader — reads the bundled universal renderer app from dist/app/index.html.
3
+ */
4
+ import { readFileSync, existsSync } from "fs";
5
+ import { resolve, dirname } from "path";
6
+ import { fileURLToPath } from "url";
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ /** Path to the bundled app HTML (dist/server/resource/ → ../../app/index.html → dist/app/) */
9
+ const APP_HTML_PATH = resolve(__dirname, "../../app/index.html");
10
+ /**
11
+ * Load the bundled universal renderer HTML.
12
+ * Returns the single-file HTML string (JS + CSS inlined by vite-plugin-singlefile).
13
+ */
14
+ export function loadAppHtml() {
15
+ if (!existsSync(APP_HTML_PATH)) {
16
+ throw new Error(`Universal renderer app not found at ${APP_HTML_PATH}. ` +
17
+ `Run "npm run build:app" first to bundle the renderer.`);
18
+ }
19
+ return readFileSync(APP_HTML_PATH, "utf-8");
20
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Resource registration — serves the bundled universal renderer HTML as an MCP App resource.
3
+ *
4
+ * Uses the high-level McpServer.registerResource() API for composability — customers
5
+ * can register their own resources alongside BranderUX resources on the same server.
6
+ */
7
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
8
+ import { ProjectConfig } from "../brand/brand-types.js";
9
+ export declare const RESOURCE_URI = "ui://brander/element-renderer";
10
+ /**
11
+ * Register the universal renderer app as an MCP App resource.
12
+ * All 14 element tools share this single HTML resource.
13
+ */
14
+ export declare function registerAppResourceHandler(server: McpServer, projectConfig: ProjectConfig): void;
15
+ //# sourceMappingURL=resource-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-registry.d.ts","sourceRoot":"","sources":["../../../src/resource/resource-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,eAAO,MAAM,YAAY,kCAAkC,CAAC;AAkB5D;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,GAAG,IAAI,CAwBhG"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Resource registration — serves the bundled universal renderer HTML as an MCP App resource.
3
+ *
4
+ * Uses the high-level McpServer.registerResource() API for composability — customers
5
+ * can register their own resources alongside BranderUX resources on the same server.
6
+ */
7
+ import { loadAppHtml } from "./html-loader.js";
8
+ export const RESOURCE_URI = "ui://brander/element-renderer";
9
+ /** MCP Apps MIME type — required for hosts to recognize this as an interactive app */
10
+ const MCP_APP_MIME_TYPE = "text/html;profile=mcp-app";
11
+ /** Inject brand + project config as a window global before the app scripts run */
12
+ function injectInitialConfig(html, projectConfig) {
13
+ const config = {
14
+ brandSettings: projectConfig.brandSettings,
15
+ projectSettings: projectConfig.settings,
16
+ screenVisibility: projectConfig.screenVisibility,
17
+ customScreens: projectConfig.customScreens,
18
+ };
19
+ const script = `<script>window.__BRANDER_INITIAL_CONFIG__=${JSON.stringify(config)};</script>`;
20
+ // Insert before closing </head> so it runs before the app bundle
21
+ return html.replace("</head>", `${script}</head>`);
22
+ }
23
+ /**
24
+ * Register the universal renderer app as an MCP App resource.
25
+ * All 14 element tools share this single HTML resource.
26
+ */
27
+ export function registerAppResourceHandler(server, projectConfig) {
28
+ server.registerResource("BranderUX Element Renderer", RESOURCE_URI, {
29
+ description: "Universal HTML renderer for all 14 BranderUX element types",
30
+ mimeType: MCP_APP_MIME_TYPE,
31
+ }, async (uri) => {
32
+ const html = loadAppHtml();
33
+ const injected = injectInitialConfig(html, projectConfig);
34
+ return {
35
+ contents: [
36
+ {
37
+ uri: uri.href,
38
+ mimeType: MCP_APP_MIME_TYPE,
39
+ text: injected,
40
+ },
41
+ ],
42
+ };
43
+ });
44
+ console.error(`Registered MCP App resource: ${RESOURCE_URI}`);
45
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Standalone MCP server — creates a server, registers BranderUX tools, and starts stdio transport.
3
+ *
4
+ * For library usage (composing with your own tools), use registerBranderTools() from the
5
+ * package root instead. This module is only for standalone/demo mode.
6
+ */
7
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
8
+ import { BranderMCPServerConfig } from "./config/types.js";
9
+ /**
10
+ * Create and start the BranderUX MCP server in standalone mode.
11
+ */
12
+ export declare function createBranderMCPServer(config: BranderMCPServerConfig): Promise<McpServer>;
13
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAG3D;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC,CA6B/F"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Standalone MCP server — creates a server, registers BranderUX tools, and starts stdio transport.
3
+ *
4
+ * For library usage (composing with your own tools), use registerBranderTools() from the
5
+ * package root instead. This module is only for standalone/demo mode.
6
+ */
7
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
8
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
9
+ import { registerBranderTools } from "./register.js";
10
+ /**
11
+ * Create and start the BranderUX MCP server in standalone mode.
12
+ */
13
+ export async function createBranderMCPServer(config) {
14
+ // 1. Create MCP server instance
15
+ const server = new McpServer({
16
+ name: config.serverName || "brander-mcp",
17
+ version: config.serverVersion || "0.1.0",
18
+ }, {
19
+ capabilities: {
20
+ tools: {},
21
+ resources: {},
22
+ },
23
+ });
24
+ // 2. Register BranderUX tools + resources
25
+ await registerBranderTools(server, {
26
+ projectId: config.projectId,
27
+ betaKey: config.betaKey,
28
+ apiBaseUrl: config.apiBaseUrl,
29
+ brandSettingsPath: config.brandSettingsPath,
30
+ });
31
+ // 3. Connect stdio transport
32
+ const transport = new StdioServerTransport();
33
+ await server.connect(transport);
34
+ console.error("BranderUX MCP server running on stdio");
35
+ return server;
36
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Element definitions — static metadata for the 14 BranderUX element types.
3
+ *
4
+ * Inlined here so the compiled dist/server can run as standalone Node.js without
5
+ * depending on @brander/elements TypeScript source at runtime (CJS/ESM interop issue).
6
+ */
7
+ interface ElementInfo {
8
+ id: string;
9
+ name: string;
10
+ description: string;
11
+ }
12
+ /** Get element info by type (for names, click behaviors, summaries) */
13
+ export declare function getElementDefinition(elementType: string): ElementInfo | undefined;
14
+ export {};
15
+ //# sourceMappingURL=element-definitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-definitions.d.ts","sourceRoot":"","sources":["../../../src/tools/element-definitions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AA6CD,uEAAuE;AACvE,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEjF"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Element definitions — static metadata for the 14 BranderUX element types.
3
+ *
4
+ * Inlined here so the compiled dist/server can run as standalone Node.js without
5
+ * depending on @brander/elements TypeScript source at runtime (CJS/ESM interop issue).
6
+ */
7
+ const ELEMENT_INFO = [
8
+ { id: "header", name: "Header", description: "Page header with title and subtitle" },
9
+ { id: "stats-grid", name: "Stats Grid", description: "Grid of KPI statistics with trends" },
10
+ {
11
+ id: "data-table",
12
+ name: "Data Table",
13
+ description: "Dynamic data table with sorting and filtering",
14
+ },
15
+ { id: "line-chart", name: "Line Chart", description: "Time series line chart for trends" },
16
+ {
17
+ id: "pie-chart",
18
+ name: "Pie Chart",
19
+ description: "Pie chart for proportional data visualization",
20
+ },
21
+ { id: "item-grid", name: "Item Grid", description: "Grid of item cards with images" },
22
+ { id: "item-card", name: "Item Card", description: "Individual item card component" },
23
+ { id: "image", name: "Image", description: "Image display component" },
24
+ { id: "details-data", name: "Details Data", description: "Detailed information cards" },
25
+ {
26
+ id: "chat-bubble",
27
+ name: "Chat Bubble",
28
+ description: "Text message bubble for simple text responses",
29
+ },
30
+ { id: "form", name: "Form", description: "Dynamic form with various input types" },
31
+ {
32
+ id: "button",
33
+ name: "Button",
34
+ description: "Interactive button with action or link functionality",
35
+ },
36
+ {
37
+ id: "bar-chart",
38
+ name: "Bar Chart",
39
+ description: "Bar chart for comparing values across categories",
40
+ },
41
+ {
42
+ id: "alert",
43
+ name: "Alert",
44
+ description: "Notification banner for messages, warnings, and feedback",
45
+ },
46
+ ];
47
+ const ELEMENT_INFO_MAP = new Map(ELEMENT_INFO.map((e) => [e.id, e]));
48
+ /** Get element info by type (for names, click behaviors, summaries) */
49
+ export function getElementDefinition(elementType) {
50
+ return ELEMENT_INFO_MAP.get(elementType);
51
+ }
@@ -0,0 +1,262 @@
1
+ /**
2
+ * Self-contained generate_screen Zod schema + tool description for the MCP server.
3
+ *
4
+ * All 14 element prop schemas are defined here so the compiled dist/server can run
5
+ * as a standalone Node.js server without depending on @brander/elements at runtime.
6
+ * (Avoids CJS/ESM interop issues — brander-elements is CJS but mcp-tools is ESM.)
7
+ */
8
+ import { z } from "zod";
9
+ /** Full input schema for the MCP `generate_screen` tool */
10
+ export declare const generateScreenInputSchema: z.ZodObject<{
11
+ elements: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
12
+ elementType: z.ZodLiteral<"header">;
13
+ props: z.ZodObject<{
14
+ title: z.ZodString;
15
+ subtitle: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>;
17
+ clickQuery: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ elementType: z.ZodLiteral<"chat-bubble">;
20
+ props: z.ZodObject<{
21
+ text: z.ZodString;
22
+ markdown: z.ZodOptional<z.ZodBoolean>;
23
+ }, z.core.$strip>;
24
+ clickQuery: z.ZodOptional<z.ZodString>;
25
+ }, z.core.$strip>, z.ZodObject<{
26
+ elementType: z.ZodLiteral<"stats-grid">;
27
+ props: z.ZodObject<{
28
+ stats: z.ZodArray<z.ZodObject<{
29
+ id: z.ZodString;
30
+ title: z.ZodString;
31
+ value: z.ZodString;
32
+ period: z.ZodOptional<z.ZodString>;
33
+ trend: z.ZodOptional<z.ZodObject<{
34
+ direction: z.ZodEnum<{
35
+ up: "up";
36
+ down: "down";
37
+ neutral: "neutral";
38
+ }>;
39
+ percentage: z.ZodString;
40
+ }, z.core.$strip>>;
41
+ subtitle: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>>;
43
+ }, z.core.$strip>;
44
+ clickQuery: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ elementType: z.ZodLiteral<"data-table">;
47
+ props: z.ZodObject<{
48
+ title: z.ZodOptional<z.ZodString>;
49
+ columns: z.ZodArray<z.ZodObject<{
50
+ key: z.ZodString;
51
+ label: z.ZodString;
52
+ type: z.ZodEnum<{
53
+ number: "number";
54
+ boolean: "boolean";
55
+ text: "text";
56
+ date: "date";
57
+ status: "status";
58
+ currency: "currency";
59
+ }>;
60
+ sortable: z.ZodOptional<z.ZodBoolean>;
61
+ filterable: z.ZodOptional<z.ZodBoolean>;
62
+ }, z.core.$strip>>;
63
+ rows: z.ZodArray<z.ZodObject<{
64
+ id: z.ZodString;
65
+ }, z.core.$loose>>;
66
+ pageSize: z.ZodOptional<z.ZodNumber>;
67
+ }, z.core.$strip>;
68
+ clickQuery: z.ZodOptional<z.ZodString>;
69
+ }, z.core.$strip>, z.ZodObject<{
70
+ elementType: z.ZodLiteral<"line-chart">;
71
+ props: z.ZodObject<{
72
+ title: z.ZodString;
73
+ labels: z.ZodArray<z.ZodString>;
74
+ data: z.ZodArray<z.ZodNumber>;
75
+ }, z.core.$strip>;
76
+ clickQuery: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$strip>, z.ZodObject<{
78
+ elementType: z.ZodLiteral<"pie-chart">;
79
+ props: z.ZodObject<{
80
+ title: z.ZodString;
81
+ data: z.ZodArray<z.ZodObject<{
82
+ label: z.ZodString;
83
+ value: z.ZodNumber;
84
+ color: z.ZodOptional<z.ZodString>;
85
+ }, z.core.$strip>>;
86
+ }, z.core.$strip>;
87
+ clickQuery: z.ZodOptional<z.ZodString>;
88
+ }, z.core.$strip>, z.ZodObject<{
89
+ elementType: z.ZodLiteral<"bar-chart">;
90
+ props: z.ZodObject<{
91
+ id: z.ZodString;
92
+ title: z.ZodOptional<z.ZodString>;
93
+ categories: z.ZodArray<z.ZodString>;
94
+ series: z.ZodArray<z.ZodObject<{
95
+ name: z.ZodString;
96
+ data: z.ZodArray<z.ZodNumber>;
97
+ }, z.core.$strip>>;
98
+ stacked: z.ZodOptional<z.ZodBoolean>;
99
+ showLegend: z.ZodOptional<z.ZodBoolean>;
100
+ }, z.core.$strip>;
101
+ clickQuery: z.ZodOptional<z.ZodString>;
102
+ }, z.core.$strip>, z.ZodObject<{
103
+ elementType: z.ZodLiteral<"item-grid">;
104
+ props: z.ZodObject<{
105
+ title: z.ZodOptional<z.ZodString>;
106
+ items: z.ZodArray<z.ZodObject<{
107
+ id: z.ZodString;
108
+ title: z.ZodString;
109
+ description: z.ZodOptional<z.ZodString>;
110
+ price: z.ZodString;
111
+ image: z.ZodOptional<z.ZodString>;
112
+ category: z.ZodOptional<z.ZodString>;
113
+ rating: z.ZodOptional<z.ZodNumber>;
114
+ stock: z.ZodOptional<z.ZodNumber>;
115
+ }, z.core.$strip>>;
116
+ pageSize: z.ZodOptional<z.ZodNumber>;
117
+ }, z.core.$strip>;
118
+ clickQuery: z.ZodOptional<z.ZodString>;
119
+ }, z.core.$strip>, z.ZodObject<{
120
+ elementType: z.ZodLiteral<"item-card">;
121
+ props: z.ZodObject<{
122
+ id: z.ZodString;
123
+ title: z.ZodString;
124
+ subtitle: z.ZodOptional<z.ZodString>;
125
+ image: z.ZodOptional<z.ZodString>;
126
+ price: z.ZodOptional<z.ZodString>;
127
+ category: z.ZodOptional<z.ZodString>;
128
+ stock: z.ZodOptional<z.ZodNumber>;
129
+ rating: z.ZodOptional<z.ZodNumber>;
130
+ description: z.ZodOptional<z.ZodString>;
131
+ }, z.core.$strip>;
132
+ clickQuery: z.ZodOptional<z.ZodString>;
133
+ }, z.core.$strip>, z.ZodObject<{
134
+ elementType: z.ZodLiteral<"image">;
135
+ props: z.ZodObject<{
136
+ src: z.ZodString;
137
+ alt: z.ZodString;
138
+ title: z.ZodOptional<z.ZodString>;
139
+ caption: z.ZodOptional<z.ZodString>;
140
+ width: z.ZodOptional<z.ZodNumber>;
141
+ height: z.ZodOptional<z.ZodNumber>;
142
+ }, z.core.$strip>;
143
+ clickQuery: z.ZodOptional<z.ZodString>;
144
+ }, z.core.$strip>, z.ZodObject<{
145
+ elementType: z.ZodLiteral<"details-data">;
146
+ props: z.ZodObject<{
147
+ items: z.ZodArray<z.ZodObject<{
148
+ id: z.ZodString;
149
+ title: z.ZodString;
150
+ value: z.ZodString;
151
+ type: z.ZodEnum<{
152
+ text: "text";
153
+ status: "status";
154
+ price: "price";
155
+ }>;
156
+ category: z.ZodString;
157
+ color: z.ZodOptional<z.ZodEnum<{
158
+ success: "success";
159
+ default: "default";
160
+ primary: "primary";
161
+ secondary: "secondary";
162
+ error: "error";
163
+ info: "info";
164
+ warning: "warning";
165
+ }>>;
166
+ variant: z.ZodOptional<z.ZodEnum<{
167
+ outlined: "outlined";
168
+ filled: "filled";
169
+ }>>;
170
+ size: z.ZodOptional<z.ZodEnum<{
171
+ small: "small";
172
+ medium: "medium";
173
+ }>>;
174
+ }, z.core.$strip>>;
175
+ }, z.core.$strip>;
176
+ clickQuery: z.ZodOptional<z.ZodString>;
177
+ }, z.core.$strip>, z.ZodObject<{
178
+ elementType: z.ZodLiteral<"form">;
179
+ props: z.ZodObject<{
180
+ title: z.ZodString;
181
+ description: z.ZodOptional<z.ZodString>;
182
+ fields: z.ZodArray<z.ZodObject<{
183
+ id: z.ZodString;
184
+ name: z.ZodString;
185
+ label: z.ZodString;
186
+ type: z.ZodEnum<{
187
+ number: "number";
188
+ text: "text";
189
+ date: "date";
190
+ email: "email";
191
+ amount: "amount";
192
+ tel: "tel";
193
+ select: "select";
194
+ textarea: "textarea";
195
+ checkbox: "checkbox";
196
+ }>;
197
+ required: z.ZodOptional<z.ZodBoolean>;
198
+ placeholder: z.ZodOptional<z.ZodString>;
199
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
200
+ value: z.ZodString;
201
+ label: z.ZodString;
202
+ }, z.core.$strip>>>;
203
+ }, z.core.$strip>>;
204
+ submitButton: z.ZodOptional<z.ZodObject<{
205
+ label: z.ZodOptional<z.ZodString>;
206
+ action: z.ZodOptional<z.ZodString>;
207
+ }, z.core.$strip>>;
208
+ }, z.core.$strip>;
209
+ clickQuery: z.ZodOptional<z.ZodString>;
210
+ }, z.core.$strip>, z.ZodObject<{
211
+ elementType: z.ZodLiteral<"button">;
212
+ props: z.ZodObject<{
213
+ id: z.ZodString;
214
+ label: z.ZodString;
215
+ variant: z.ZodEnum<{
216
+ primary: "primary";
217
+ secondary: "secondary";
218
+ tertiary: "tertiary";
219
+ }>;
220
+ type: z.ZodEnum<{
221
+ link: "link";
222
+ action: "action";
223
+ }>;
224
+ action: z.ZodOptional<z.ZodString>;
225
+ url: z.ZodOptional<z.ZodString>;
226
+ size: z.ZodOptional<z.ZodEnum<{
227
+ small: "small";
228
+ medium: "medium";
229
+ large: "large";
230
+ }>>;
231
+ disabled: z.ZodOptional<z.ZodBoolean>;
232
+ startIcon: z.ZodOptional<z.ZodString>;
233
+ endIcon: z.ZodOptional<z.ZodString>;
234
+ }, z.core.$strip>;
235
+ clickQuery: z.ZodOptional<z.ZodString>;
236
+ }, z.core.$strip>, z.ZodObject<{
237
+ elementType: z.ZodLiteral<"alert">;
238
+ props: z.ZodObject<{
239
+ id: z.ZodString;
240
+ severity: z.ZodEnum<{
241
+ success: "success";
242
+ error: "error";
243
+ info: "info";
244
+ warning: "warning";
245
+ }>;
246
+ title: z.ZodOptional<z.ZodString>;
247
+ message: z.ZodString;
248
+ variant: z.ZodOptional<z.ZodEnum<{
249
+ outlined: "outlined";
250
+ standard: "standard";
251
+ }>>;
252
+ closeable: z.ZodOptional<z.ZodBoolean>;
253
+ showIcon: z.ZodOptional<z.ZodBoolean>;
254
+ actionText: z.ZodOptional<z.ZodString>;
255
+ actionQuery: z.ZodOptional<z.ZodString>;
256
+ }, z.core.$strip>;
257
+ clickQuery: z.ZodOptional<z.ZodString>;
258
+ }, z.core.$strip>], "elementType">>;
259
+ }, z.core.$strip>;
260
+ /** Tool description for generate_screen */
261
+ export declare const GENERATE_SCREEN_DESCRIPTION: string;
262
+ //# sourceMappingURL=generate-screen-schema.d.ts.map