trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
101 lines • 2.74 kB
TypeScript
/**
* MCP Tools — Brand token management and catalog generation tools
* for the Model Context Protocol.
*
* These are standalone tool definitions that can be registered on any MCP server.
* Each tool follows the pattern: { name, description, inputSchema, handler }.
*
* @module trellis/plugins/brand
*/
import { z } from 'zod';
import type { TrellisKernel } from '../../core/kernel/trellis-kernel.js';
import { CatalogCache } from './cache.js';
interface McpToolResult {
content: Array<{
type: 'text';
text: string;
}>;
}
interface McpToolDef<T> {
name: string;
description: string;
inputSchema: Record<string, z.ZodType>;
handler: (input: T, ctx: BrandToolContext) => Promise<McpToolResult>;
}
export interface BrandToolContext {
kernel: TrellisKernel;
cache: CatalogCache;
/** The `defineCatalog` function from `@json-render/core` */
defineCatalog: (schema: unknown, input: {
components: Record<string, unknown>;
actions: Record<string, unknown>;
}) => unknown;
/** The schema instance from `@json-render/react/schema` (or other renderer) */
schema: unknown;
/** Base component definitions (e.g., shadcnComponentDefinitions) */
baseComponents: Record<string, {
props: unknown;
[key: string]: unknown;
}>;
}
export declare const brandCreateGuide: McpToolDef<{
guideId: string;
name: string;
complianceMode?: string;
voiceTone?: string;
}>;
export declare const brandUpsertToken: McpToolDef<{
tokenId: string;
guideId: string;
name: string;
tokenType: string;
role: string;
value: string;
description?: string;
lightMode?: string;
darkMode?: string;
wcagAA?: boolean;
wcagAAA?: boolean;
}>;
export declare const brandDeleteToken: McpToolDef<{
tokenId: string;
}>;
export declare const brandListTokens: McpToolDef<{
guideId: string;
tokenType?: string;
}>;
export declare const brandGenerateCatalog: McpToolDef<{
guideId: string;
}>;
export declare const brandGetPrompt: McpToolDef<{
guideId: string;
}>;
export declare const brandTools: readonly [McpToolDef<{
guideId: string;
name: string;
complianceMode?: string;
voiceTone?: string;
}>, McpToolDef<{
tokenId: string;
guideId: string;
name: string;
tokenType: string;
role: string;
value: string;
description?: string;
lightMode?: string;
darkMode?: string;
wcagAA?: boolean;
wcagAAA?: boolean;
}>, McpToolDef<{
tokenId: string;
}>, McpToolDef<{
guideId: string;
tokenType?: string;
}>, McpToolDef<{
guideId: string;
}>, McpToolDef<{
guideId: string;
}>];
export {};
//# sourceMappingURL=mcp-tools.d.ts.map