@seed-ship/mcp-ui-solid 6.10.0 → 6.12.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.
@@ -1 +1 @@
1
- {"version":3,"file":"component-registry.js","sources":["../../src/services/component-registry.ts"],"sourcesContent":["/**\n * Component Registry Service\n * Phase 0: Static registry with Quickchart and Table definitions\n * Phase 1: Dynamic registry populated from /api/mcp/tools/list\n *\n * Provides component schemas for LLM prompt engineering\n */\n\nimport type { ComponentRegistryEntry, ComponentType } from '../types'\nimport { DEFAULT_RESOURCE_LIMITS } from './validation'\n\n/**\n * Quickchart Component Registry Entry\n * Based on Quickchart API documentation\n */\nexport const QuickchartRegistry: ComponentRegistryEntry = {\n type: 'chart',\n name: 'Quickchart',\n description:\n 'Render charts using Quickchart.io API. Supports bar, line, pie, doughnut, radar, and scatter charts. Best for visualizing numerical data with 2-10 data series and up to 1000 data points.',\n schema: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n enum: ['bar', 'line', 'pie', 'doughnut', 'radar', 'scatter'],\n description: 'Chart type',\n },\n title: {\n type: 'string',\n description: 'Chart title (optional)',\n },\n data: {\n type: 'object',\n properties: {\n labels: {\n type: 'array',\n items: { type: 'string' },\n description: 'X-axis labels',\n },\n datasets: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n label: { type: 'string' },\n data: {\n type: 'array',\n items: { type: 'number' },\n },\n backgroundColor: {\n oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }],\n },\n borderColor: {\n oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }],\n },\n borderWidth: { type: 'number' },\n },\n required: ['label', 'data'],\n },\n },\n },\n required: ['labels', 'datasets'],\n },\n options: {\n type: 'object',\n description: 'Chart.js options for customization',\n },\n },\n required: ['type', 'data'],\n },\n examples: [\n {\n query: 'Show me document types distribution',\n component: {\n id: 'example-bar-1',\n type: 'chart',\n position: { colStart: 1, colSpan: 6 },\n params: {\n type: 'bar',\n title: 'Document Types',\n data: {\n labels: ['PDF', 'DOCX', 'TXT', 'XLSX'],\n datasets: [\n {\n label: 'Count',\n data: [245, 189, 123, 98],\n backgroundColor: ['rgba(59, 130, 246, 0.8)'],\n },\n ],\n },\n },\n },\n },\n {\n query: 'Display upload trends over the last week',\n component: {\n id: 'example-line-1',\n type: 'chart',\n position: { colStart: 1, colSpan: 6 },\n params: {\n type: 'line',\n title: 'Upload Trends',\n data: {\n labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],\n datasets: [\n {\n label: 'Uploads',\n data: [42, 38, 51, 47, 63, 29, 15],\n borderColor: 'rgb(59, 130, 246)',\n },\n ],\n },\n options: {\n tension: 0.4,\n },\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Table Component Registry Entry\n */\nexport const TableRegistry: ComponentRegistryEntry = {\n type: 'table',\n name: 'DataTable',\n description:\n 'Render tabular data with sortable columns and pagination. Best for displaying structured records with up to 100 rows. Supports column width customization and cell formatting.',\n schema: {\n type: 'object',\n properties: {\n title: {\n type: 'string',\n description: 'Table title (optional)',\n },\n columns: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n key: { type: 'string', description: 'Data key for this column' },\n label: { type: 'string', description: 'Column header label' },\n sortable: { type: 'boolean', description: 'Whether column is sortable' },\n width: { type: 'string', description: 'CSS width (e.g., \"30%\")' },\n },\n required: ['key', 'label'],\n },\n minItems: 1,\n },\n rows: {\n type: 'array',\n items: {\n type: 'object',\n description: 'Row data matching column keys',\n },\n maxItems: 100,\n },\n pagination: {\n type: 'object',\n properties: {\n currentPage: { type: 'number' },\n pageSize: { type: 'number' },\n totalRows: { type: 'number' },\n },\n },\n },\n required: ['columns', 'rows'],\n },\n examples: [\n {\n query: 'Show me the most recent documents',\n component: {\n id: 'example-table-1',\n type: 'table',\n position: { colStart: 1, colSpan: 8 },\n params: {\n title: 'Recent Documents',\n columns: [\n { key: 'name', label: 'Name', sortable: true, width: '40%' },\n { key: 'type', label: 'Type', sortable: true, width: '15%' },\n { key: 'size', label: 'Size', width: '15%' },\n { key: 'modified', label: 'Modified', sortable: true, width: '30%' },\n ],\n rows: [\n { name: 'Report.pdf', type: 'PDF', size: '2.4 MB', modified: '2 hours ago' },\n { name: 'Slides.pptx', type: 'PPTX', size: '8.7 MB', modified: '1 day ago' },\n ],\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Metric Card Component Registry Entry\n */\nexport const MetricRegistry: ComponentRegistryEntry = {\n type: 'metric',\n name: 'MetricCard',\n description:\n 'Display a single metric with optional trend indicator. Best for KPIs, statistics, and summary numbers. Supports trend direction (up/down/neutral) and subtitles.',\n schema: {\n type: 'object',\n properties: {\n title: {\n type: 'string',\n description: 'Metric title',\n },\n value: {\n oneOf: [{ type: 'string' }, { type: 'number' }],\n description: 'Metric value',\n },\n unit: {\n type: 'string',\n description: 'Unit of measurement (optional)',\n },\n trend: {\n type: 'object',\n properties: {\n value: { type: 'number', description: 'Percentage change' },\n direction: { type: 'string', enum: ['up', 'down', 'neutral'] },\n },\n },\n subtitle: {\n type: 'string',\n description: 'Additional context (optional)',\n },\n },\n required: ['title', 'value'],\n },\n examples: [\n {\n query: 'Show total document count',\n component: {\n id: 'example-metric-1',\n type: 'metric',\n position: { colStart: 1, colSpan: 3 },\n params: {\n title: 'Total Documents',\n value: '1,247',\n trend: {\n value: 12.5,\n direction: 'up',\n },\n subtitle: '+142 this month',\n },\n },\n },\n ],\n limits: {\n maxDataPoints: 1,\n maxTableRows: 1,\n maxPayloadSize: 5 * 1024, // 5KB\n renderTimeout: 1000, // 1s\n },\n}\n\n/**\n * Text Component Registry Entry\n */\nexport const TextRegistry: ComponentRegistryEntry = {\n type: 'text',\n name: 'TextBlock',\n description:\n 'Render text content with optional markdown support. Best for explanations, summaries, and context. Supports basic HTML formatting.',\n schema: {\n type: 'object',\n properties: {\n content: {\n type: 'string',\n description: 'Text content (HTML allowed, will be sanitized)',\n },\n markdown: {\n type: 'boolean',\n description: 'Whether content is markdown (not yet implemented)',\n },\n className: {\n type: 'string',\n description: 'Custom CSS classes',\n },\n },\n required: ['content'],\n },\n examples: [\n {\n query: 'Explain the document distribution',\n component: {\n id: 'example-text-1',\n type: 'text',\n position: { colStart: 1, colSpan: 12 },\n params: {\n content:\n '<p>Your document library contains <strong>1,247 files</strong> across 5 different formats. PDFs represent the largest category at 35% of total storage.</p>',\n },\n },\n },\n ],\n limits: {\n maxDataPoints: 1,\n maxTableRows: 1,\n maxPayloadSize: 10 * 1024, // 10KB\n renderTimeout: 1000, // 1s\n },\n}\n\n// ============================================================================\n// Sprint 4: Additional Component Registry Entries\n// ============================================================================\n\n/**\n * Grid Component Registry Entry\n * Nested CSS Grid layout for organizing multiple components\n */\nexport const GridRegistry: ComponentRegistryEntry = {\n type: 'grid',\n name: 'GridLayout',\n description:\n 'Nested CSS Grid layout for organizing multiple components. Supports named areas, responsive columns (1-12), and custom gap spacing. Best for complex dashboard layouts and template builder.',\n schema: {\n type: 'object',\n properties: {\n columns: {\n type: 'number',\n description: 'Number of columns (default: 12)',\n },\n gap: {\n type: 'string',\n description: 'Gap between items (e.g., \"1rem\")',\n },\n minRowHeight: {\n type: 'string',\n description: 'Minimum row height (optional)',\n },\n areas: {\n type: 'array',\n items: {\n type: 'array',\n items: { type: 'string' },\n },\n description: 'CSS Grid template areas for named regions',\n },\n children: {\n type: 'array',\n items: { type: 'object' },\n description: 'Child UIComponents to render within the grid',\n },\n },\n required: ['children'],\n },\n examples: [],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Action Component Registry Entry\n * Interactive button or link that triggers tool calls\n */\nexport const ActionRegistry: ComponentRegistryEntry = {\n type: 'action',\n name: 'ActionButton',\n description:\n 'Interactive button or link that triggers tool calls or navigation. Best for user interactions, form submissions, and workflow triggers.',\n schema: {\n type: 'object',\n properties: {\n label: {\n type: 'string',\n description: 'Button text',\n },\n type: {\n type: 'string',\n enum: ['button', 'link'],\n description: 'Render as button or link',\n },\n action: {\n type: 'string',\n enum: ['tool-call', 'link', 'submit'],\n description: 'Action type to perform',\n },\n toolName: {\n type: 'string',\n description: 'Tool name to call (for tool-call action)',\n },\n params: {\n type: 'object',\n description: 'Parameters to pass to the tool',\n },\n url: {\n type: 'string',\n description: 'URL for link action',\n },\n variant: {\n type: 'string',\n enum: ['primary', 'secondary', 'outline', 'ghost', 'danger'],\n description: 'Visual style variant',\n },\n size: {\n type: 'string',\n enum: ['sm', 'md', 'lg'],\n description: 'Button size',\n },\n disabled: {\n type: 'boolean',\n description: 'Whether the action is disabled',\n },\n },\n required: ['label', 'type', 'action'],\n },\n examples: [],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Footer Component Registry Entry\n * Display execution metadata like timing and source count\n */\nexport const FooterRegistry: ComponentRegistryEntry = {\n type: 'footer',\n name: 'FooterSection',\n description:\n 'Footer section displaying execution metadata. Best for showing timing, model info, and source counts. Auto-injected by layouts when metadata is provided.',\n schema: {\n type: 'object',\n properties: {\n poweredBy: {\n type: 'string',\n description: 'Powered by text (optional)',\n },\n executionTime: {\n type: 'number',\n description: 'Execution time in milliseconds',\n },\n model: {\n type: 'string',\n description: 'LLM model used',\n },\n sourceCount: {\n type: 'number',\n description: 'Number of sources used',\n },\n customText: {\n type: 'string',\n description: 'Custom footer text',\n },\n links: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n label: { type: 'string' },\n url: { type: 'string' },\n },\n },\n description: 'Footer links',\n },\n },\n },\n examples: [],\n limits: {\n maxDataPoints: 1,\n maxTableRows: 1,\n maxPayloadSize: 5 * 1024,\n renderTimeout: 1000,\n },\n}\n\n/**\n * Carousel Component Registry Entry\n * Display multiple items with horizontal scrolling\n */\nexport const CarouselRegistry: ComponentRegistryEntry = {\n type: 'carousel',\n name: 'Carousel',\n description:\n 'Horizontal carousel for displaying multiple items with snap scrolling and navigation buttons. Best for showcasing related content, image galleries, or card collections.',\n schema: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: { type: 'object' },\n description: 'Array of UIComponents to display in carousel',\n },\n height: {\n type: 'string',\n description: 'Carousel height (optional)',\n },\n },\n required: ['items'],\n },\n examples: [],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Artifact Component Registry Entry\n * Display downloadable artifacts like generated files\n */\nexport const ArtifactRegistry: ComponentRegistryEntry = {\n type: 'artifact',\n name: 'Artifact',\n description:\n 'Display downloadable artifacts like generated files or exports. Shows filename, size, and download button. Best for CSV exports, PDF reports, and generated documents.',\n schema: {\n type: 'object',\n properties: {\n url: {\n type: 'string',\n description: 'Download URL for the artifact',\n },\n filename: {\n type: 'string',\n description: 'Display filename',\n },\n mimeType: {\n type: 'string',\n description: 'MIME type (e.g., \"text/csv\", \"application/pdf\")',\n },\n size: {\n type: 'number',\n description: 'File size in bytes',\n },\n description: {\n type: 'string',\n description: 'Description of the artifact',\n },\n },\n required: ['url', 'filename', 'mimeType'],\n },\n examples: [],\n limits: {\n maxDataPoints: 1,\n maxTableRows: 1,\n maxPayloadSize: 5 * 1024,\n renderTimeout: 1000,\n },\n}\n\n/**\n * Code Block Registry Entry\n */\nexport const CodeRegistry: ComponentRegistryEntry = {\n type: 'code',\n name: 'CodeBlock',\n description:\n 'Render syntax-highlighted code blocks with line numbers, copy button, and word wrap toggle. Supports all languages via highlight.js auto-detection. Best for displaying source code, configuration files, CLI output, or API responses.',\n schema: {\n type: 'object',\n properties: {\n code: { type: 'string', description: 'The code content to display' },\n language: { type: 'string', description: 'Programming language for syntax highlighting (auto-detected if omitted)' },\n filename: { type: 'string', description: 'Filename shown in header bar' },\n showLineNumbers: { type: 'boolean', description: 'Show line numbers (default: true)' },\n startLine: { type: 'number', description: 'Starting line number (default: 1)' },\n maxHeight: { type: 'string', description: 'CSS max-height for scrollable code blocks' },\n theme: { type: 'string', enum: ['light', 'dark'], description: 'Color theme (follows system preference by default)' },\n },\n required: ['code'],\n },\n examples: [\n {\n query: 'Show me how to connect to the API',\n component: {\n id: 'example-code-1',\n type: 'code',\n position: { colStart: 1, colSpan: 8 },\n params: {\n code: 'const client = new MCPClient({ url: \"https://api.example.com\" });\\nawait client.connect();\\nconst result = await client.query(\"SELECT * FROM documents\");',\n language: 'typescript',\n filename: 'example.ts',\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Map Registry Entry\n */\nexport const MapRegistry: ComponentRegistryEntry = {\n type: 'map',\n name: 'InteractiveMap',\n description:\n 'Render interactive maps with markers using Leaflet. Supports marker clustering, custom tile layers, and auto-fitting bounds. Best for displaying geographic data with up to 1000 markers.',\n schema: {\n type: 'object',\n properties: {\n center: { type: 'array', items: { type: 'number' }, minItems: 2, maxItems: 2, description: 'Map center [lat, lng]' },\n zoom: { type: 'number', description: 'Zoom level (1-18, default: 13)' },\n markers: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n position: { type: 'array', items: { type: 'number' }, minItems: 2, maxItems: 2 },\n title: { type: 'string' },\n popup: { type: 'string' },\n },\n required: ['position'],\n },\n },\n height: { type: 'string', description: 'CSS height (default: 400px)' },\n fitBounds: { type: 'boolean', description: 'Auto-fit to show all markers' },\n clustering: { type: 'boolean', description: 'Enable marker clustering for large datasets' },\n },\n required: [],\n },\n examples: [\n {\n query: 'Show office locations on a map',\n component: {\n id: 'example-map-1',\n type: 'map',\n position: { colStart: 1, colSpan: 12 },\n params: {\n center: [48.8566, 2.3522],\n zoom: 5,\n markers: [\n { position: [48.8566, 2.3522], tooltip: 'Paris', popup: 'HQ — 120 employees' },\n { position: [51.5074, -0.1278], tooltip: 'London', popup: 'UK Office — 45 employees' },\n ],\n fitBounds: true,\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Form Registry Entry\n */\nexport const FormRegistry: ComponentRegistryEntry = {\n type: 'form',\n name: 'Form',\n description:\n 'Render interactive forms with text inputs, selects, checkboxes, date pickers, and conditional fields. Supports persistence, validation, and submit actions that trigger MCP tool calls.',\n schema: {\n type: 'object',\n properties: {\n title: { type: 'string', description: 'Form title' },\n fields: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n label: { type: 'string' },\n type: { type: 'string', enum: ['text', 'number', 'email', 'password', 'textarea', 'select', 'checkbox', 'radio', 'date'] },\n required: { type: 'boolean' },\n placeholder: { type: 'string' },\n options: { type: 'array', items: { type: 'object', properties: { label: { type: 'string' }, value: { type: 'string' } } } },\n },\n required: ['name', 'label', 'type'],\n },\n },\n submitLabel: { type: 'string', description: 'Submit button text (default: \"Submit\")' },\n layout: { type: 'string', enum: ['vertical', 'horizontal', 'inline'] },\n },\n required: ['fields'],\n },\n examples: [\n {\n query: 'Create a document upload form',\n component: {\n id: 'example-form-1',\n type: 'form',\n position: { colStart: 1, colSpan: 6 },\n params: {\n title: 'Upload Document',\n fields: [\n { name: 'title', label: 'Document Title', type: 'text', required: true },\n { name: 'category', label: 'Category', type: 'select', options: [{ label: 'Report', value: 'report' }, { label: 'Invoice', value: 'invoice' }] },\n { name: 'notes', label: 'Notes', type: 'textarea' },\n ],\n submitLabel: 'Upload',\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Modal Registry Entry\n */\nexport const ModalRegistry: ComponentRegistryEntry = {\n type: 'modal',\n name: 'Modal',\n description:\n 'Render a dialog overlay with Portal rendering. Supports sizes from small to fullscreen, close on Escape/backdrop, and nested content. Best for confirmations, detail views, and focused interactions.',\n schema: {\n type: 'object',\n properties: {\n title: { type: 'string', description: 'Modal header title' },\n size: { type: 'string', enum: ['sm', 'md', 'lg', 'xl', 'full'], description: 'Modal width (default: md)' },\n showClose: { type: 'boolean', description: 'Show close button (default: true)' },\n closeOnEscape: { type: 'boolean', description: 'Close on Escape key (default: true)' },\n closeOnBackdrop: { type: 'boolean', description: 'Close on backdrop click (default: true)' },\n maxHeight: { type: 'string', description: 'CSS max-height for scrollable content' },\n },\n required: [],\n },\n examples: [\n {\n query: 'Show document details in a dialog',\n component: {\n id: 'example-modal-1',\n type: 'modal',\n position: { colStart: 1, colSpan: 12 },\n params: {\n title: 'Document Details',\n size: 'lg',\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Action Group Registry Entry\n */\nexport const ActionGroupRegistry: ComponentRegistryEntry = {\n type: 'action-group',\n name: 'ActionGroup',\n description:\n 'Render a group of action buttons in horizontal, vertical, or grid layout. Each action triggers an MCP tool call. Best for presenting multiple related actions like CRUD operations or workflow steps.',\n schema: {\n type: 'object',\n properties: {\n actions: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n label: { type: 'string' },\n toolName: { type: 'string' },\n params: { type: 'object' },\n variant: { type: 'string', enum: ['primary', 'secondary', 'danger', 'ghost'] },\n icon: { type: 'string' },\n },\n required: ['label', 'toolName'],\n },\n },\n layout: { type: 'string', enum: ['horizontal', 'vertical', 'grid'], description: 'Button layout' },\n label: { type: 'string', description: 'Group label' },\n },\n required: ['actions'],\n },\n examples: [\n {\n query: 'Show actions for this document',\n component: {\n id: 'example-action-group-1',\n type: 'action-group',\n position: { colStart: 1, colSpan: 6 },\n params: {\n label: 'Document Actions',\n actions: [\n { label: 'Download', type: 'button', action: 'tool-call', toolName: 'document_download', params: { id: '123' }, variant: 'primary' },\n { label: 'Share', type: 'button', action: 'tool-call', toolName: 'document_share', params: { id: '123' }, variant: 'secondary' },\n { label: 'Delete', type: 'button', action: 'tool-call', toolName: 'document_delete', params: { id: '123' }, variant: 'danger' },\n ],\n layout: 'horizontal',\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Image Gallery Registry Entry\n */\nexport const ImageGalleryRegistry: ComponentRegistryEntry = {\n type: 'image-gallery',\n name: 'ImageGallery',\n description:\n 'Render a grid of images with lightbox overlay for fullscreen viewing. Supports captions, configurable columns, aspect ratios, and keyboard navigation in lightbox mode.',\n schema: {\n type: 'object',\n properties: {\n title: { type: 'string', description: 'Gallery title' },\n images: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n url: { type: 'string', description: 'Image URL' },\n alt: { type: 'string', description: 'Alt text' },\n caption: { type: 'string', description: 'Caption text' },\n thumbnail: { type: 'string', description: 'Thumbnail URL (optional, falls back to url)' },\n },\n required: ['url'],\n },\n },\n columns: { type: 'number', enum: [2, 3, 4, 5], description: 'Grid columns (default: 3)' },\n aspectRatio: { type: 'string', enum: ['1:1', '16:9', '4:3', 'auto'] },\n lightbox: { type: 'boolean', description: 'Enable lightbox overlay (default: true)' },\n },\n required: ['images'],\n },\n examples: [\n {\n query: 'Show document thumbnails',\n component: {\n id: 'example-gallery-1',\n type: 'image-gallery',\n position: { colStart: 1, colSpan: 12 },\n params: {\n title: 'Recent Documents',\n images: [\n { url: '/thumbnails/doc1.png', alt: 'Q4 Report', caption: 'Q4 Report — 24 pages' },\n { url: '/thumbnails/doc2.png', alt: 'Invoice #4521', caption: 'Invoice #4521' },\n ],\n columns: 4,\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Video Registry Entry\n */\nexport const VideoRegistry: ComponentRegistryEntry = {\n type: 'video',\n name: 'Video',\n description:\n 'Embed video from YouTube, Vimeo, or direct URLs. Auto-detects provider from URL and renders appropriate embed. Supports aspect ratios, autoplay, and start time.',\n schema: {\n type: 'object',\n properties: {\n url: { type: 'string', description: 'Video URL (YouTube, Vimeo, or direct)' },\n title: { type: 'string', description: 'Video title' },\n caption: { type: 'string', description: 'Caption below video' },\n aspectRatio: { type: 'string', enum: ['16:9', '4:3', '1:1', '21:9'], description: 'Aspect ratio (default: 16:9)' },\n autoplay: { type: 'boolean', description: 'Auto-play video' },\n startTime: { type: 'number', description: 'Start time in seconds' },\n },\n required: ['url'],\n },\n examples: [\n {\n query: 'Show the product demo video',\n component: {\n id: 'example-video-1',\n type: 'video',\n position: { colStart: 1, colSpan: 8 },\n params: {\n url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',\n title: 'Product Demo',\n aspectRatio: '16:9',\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Iframe Registry Entry\n */\nexport const IframeRegistry: ComponentRegistryEntry = {\n type: 'iframe',\n name: 'Iframe',\n description:\n 'Embed external content via sandboxed iframe. Domain whitelist enforced for security. Supports Mermaid diagrams, Excalidraw, GitHub Gists, Figma, and 60+ whitelisted domains.',\n schema: {\n type: 'object',\n properties: {\n url: { type: 'string', description: 'URL to embed (must be on whitelist)' },\n title: { type: 'string', description: 'Iframe title for accessibility' },\n height: { type: 'string', description: 'CSS height (default: 400px)' },\n sandbox: { type: 'string', description: 'Sandbox attribute (default: restrictive)' },\n },\n required: ['url'],\n },\n examples: [\n {\n query: 'Show the architecture diagram',\n component: {\n id: 'example-iframe-1',\n type: 'iframe',\n position: { colStart: 1, colSpan: 12 },\n params: {\n url: 'https://mermaid.ink/svg/graph+TD;A-->B;B-->C',\n title: 'Architecture Diagram',\n height: '500px',\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Image Registry Entry\n */\nexport const ImageRegistry: ComponentRegistryEntry = {\n type: 'image',\n name: 'Image',\n description:\n 'Render a single image with optional alt text, caption, and link. Best for logos, screenshots, diagrams, or any standalone visual content.',\n schema: {\n type: 'object',\n properties: {\n url: { type: 'string', description: 'Image URL' },\n alt: { type: 'string', description: 'Alt text for accessibility' },\n title: { type: 'string', description: 'Image title / heading' },\n width: { type: 'string', description: 'CSS width' },\n height: { type: 'string', description: 'CSS height' },\n },\n required: ['url'],\n },\n examples: [\n {\n query: 'Show the company logo',\n component: {\n id: 'example-image-1',\n type: 'image',\n position: { colStart: 1, colSpan: 4 },\n params: {\n url: '/images/logo.png',\n alt: 'Company Logo',\n } as any,\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Link Registry Entry\n */\nexport const LinkRegistry: ComponentRegistryEntry = {\n type: 'link',\n name: 'Link',\n description:\n 'Render a styled link card with title, description, and URL. Best for navigation, references, and external resource links.',\n schema: {\n type: 'object',\n properties: {\n url: { type: 'string', description: 'Link destination URL' },\n label: { type: 'string', description: 'Link display text' },\n description: { type: 'string', description: 'Link description' },\n icon: { type: 'string', description: 'Icon identifier' },\n },\n required: ['url', 'label'],\n },\n examples: [\n {\n query: 'Link to the API documentation',\n component: {\n id: 'example-link-1',\n type: 'link',\n position: { colStart: 1, colSpan: 4 },\n params: {\n url: 'https://docs.example.com/api',\n label: 'API Documentation',\n description: 'Full reference for the REST API',\n } as any,\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Component Registry - All components indexed by type\n */\nexport const ComponentRegistry: Map<ComponentType, ComponentRegistryEntry> = new Map([\n ['chart', QuickchartRegistry],\n ['table', TableRegistry],\n ['metric', MetricRegistry],\n ['text', TextRegistry],\n // Sprint 4 additions\n ['grid', GridRegistry],\n ['action', ActionRegistry],\n ['footer', FooterRegistry],\n ['carousel', CarouselRegistry],\n ['artifact', ArtifactRegistry],\n // v2.2.5: Complete registry\n ['code', CodeRegistry],\n ['map', MapRegistry],\n ['form', FormRegistry],\n ['modal', ModalRegistry],\n ['action-group', ActionGroupRegistry],\n ['image-gallery', ImageGalleryRegistry],\n ['video', VideoRegistry],\n ['iframe', IframeRegistry],\n ['image', ImageRegistry],\n ['link', LinkRegistry],\n])\n\n/**\n * Get component registry entry by type\n */\nexport function getComponentEntry(type: ComponentType): ComponentRegistryEntry | undefined {\n return ComponentRegistry.get(type)\n}\n\n/**\n * Get all component types\n */\nexport function getAllComponentTypes(): ComponentType[] {\n return Array.from(ComponentRegistry.keys())\n}\n\n/**\n * Get registry as JSON for LLM context\n */\nexport function getRegistryForLLM(): string {\n const entries = Array.from(ComponentRegistry.values()).map((entry) => ({\n type: entry.type,\n name: entry.name,\n description: entry.description,\n schema: entry.schema,\n examples: entry.examples.map((ex) => ({\n query: ex.query,\n component: ex.component,\n })),\n limits: entry.limits,\n }))\n\n return JSON.stringify(entries, null, 2)\n}\n\n/**\n * Validate component against registry schema\n * (Future: Use Zod for runtime validation)\n */\nexport function validateAgainstRegistry(\n componentType: ComponentType,\n params: any\n): { valid: boolean; errors?: string[]; warnings?: string[] } {\n const entry = getComponentEntry(componentType)\n if (!entry) {\n // Warn but don't block — renderer may exist even without registry entry\n return { valid: true, warnings: [`No registry entry for type: ${componentType}`] }\n }\n\n // Basic validation (Phase 1 will add Zod schema validation)\n const required = entry.schema.required || []\n const missing = required.filter((key: string) => !(key in params))\n\n if (missing.length > 0) {\n return {\n valid: false,\n errors: missing.map((key: string) => `Missing required field: ${key}`),\n }\n }\n\n return { valid: true }\n}\n"],"names":[],"mappings":";AAeO,MAAM,qBAA6C;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aACE;AAAA,EACF,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,MAAM,CAAC,OAAO,QAAQ,OAAO,YAAY,SAAS,SAAS;AAAA,QAC3D,aAAa;AAAA,MAAA;AAAA,MAEf,OAAO;AAAA,QACL,MAAM;AAAA,QACN,aAAa;AAAA,MAAA;AAAA,MAEf,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,YAAY;AAAA,UACV,QAAQ;AAAA,YACN,MAAM;AAAA,YACN,OAAO,EAAE,MAAM,SAAA;AAAA,YACf,aAAa;AAAA,UAAA;AAAA,UAEf,UAAU;AAAA,YACR,MAAM;AAAA,YACN,OAAO;AAAA,cACL,MAAM;AAAA,cACN,YAAY;AAAA,gBACV,OAAO,EAAE,MAAM,SAAA;AAAA,gBACf,MAAM;AAAA,kBACJ,MAAM;AAAA,kBACN,OAAO,EAAE,MAAM,SAAA;AAAA,gBAAS;AAAA,gBAE1B,iBAAiB;AAAA,kBACf,OAAO,CAAC,EAAE,MAAM,YAAY,EAAE,MAAM,SAAS,OAAO,EAAE,MAAM,SAAA,GAAY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,CAAC,QAAQ,YAAY;AAAA,EACrB,CAAC,OAAO,WAAW;AAAA,EACnB,CAAC,QAAQ,YAAY;AAAA,EACrB,CAAC,SAAS,aAAa;AAAA,EACvB,CAAC,gBAAgB,mBAAmB;AAAA,EACpC,CAAC,iBAAiB,oBAAoB;AAAA,EACtC,CAAC,SAAS,aAAa;AAAA,EACvB,CAAC,UAAU,cAAc;AAAA,EACzB,CAAC,SAAS,aAAa;AAAA,EACvB,CAAC,QAAQ,YAAY;AACvB,CAAC;"}
1
+ {"version":3,"file":"component-registry.js","sources":["../../src/services/component-registry.ts"],"sourcesContent":["/**\n * Component Registry Service\n * Phase 0: Static registry with Quickchart and Table definitions\n * Phase 1: Dynamic registry populated from /api/mcp/tools/list\n *\n * Provides component schemas for LLM prompt engineering\n */\n\nimport type { ComponentRegistryEntry, ComponentType } from '../types'\nimport { DEFAULT_RESOURCE_LIMITS } from './validation'\n\n/**\n * Quickchart Component Registry Entry\n * Based on Quickchart API documentation\n */\nexport const QuickchartRegistry: ComponentRegistryEntry = {\n type: 'chart',\n name: 'Quickchart',\n description:\n 'Render charts using Quickchart.io API. Supports bar, line, pie, doughnut, radar, and scatter charts. Best for visualizing numerical data with 2-10 data series and up to 1000 data points.',\n schema: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n enum: ['bar', 'line', 'pie', 'doughnut', 'radar', 'scatter'],\n description: 'Chart type',\n },\n title: {\n type: 'string',\n description: 'Chart title (optional)',\n },\n data: {\n type: 'object',\n properties: {\n labels: {\n type: 'array',\n items: { type: 'string' },\n description: 'X-axis labels',\n },\n datasets: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n label: { type: 'string' },\n data: {\n type: 'array',\n items: { type: 'number' },\n },\n backgroundColor: {\n oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }],\n },\n borderColor: {\n oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }],\n },\n borderWidth: { type: 'number' },\n },\n required: ['label', 'data'],\n },\n },\n },\n required: ['labels', 'datasets'],\n },\n options: {\n type: 'object',\n description: 'Chart.js options for customization',\n },\n },\n required: ['type', 'data'],\n },\n examples: [\n {\n query: 'Show me document types distribution',\n component: {\n id: 'example-bar-1',\n type: 'chart',\n position: { colStart: 1, colSpan: 6 },\n params: {\n type: 'bar',\n title: 'Document Types',\n data: {\n labels: ['PDF', 'DOCX', 'TXT', 'XLSX'],\n datasets: [\n {\n label: 'Count',\n data: [245, 189, 123, 98],\n backgroundColor: ['rgba(59, 130, 246, 0.8)'],\n },\n ],\n },\n },\n },\n },\n {\n query: 'Display upload trends over the last week',\n component: {\n id: 'example-line-1',\n type: 'chart',\n position: { colStart: 1, colSpan: 6 },\n params: {\n type: 'line',\n title: 'Upload Trends',\n data: {\n labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],\n datasets: [\n {\n label: 'Uploads',\n data: [42, 38, 51, 47, 63, 29, 15],\n borderColor: 'rgb(59, 130, 246)',\n },\n ],\n },\n options: {\n tension: 0.4,\n },\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Table Component Registry Entry\n */\nexport const TableRegistry: ComponentRegistryEntry = {\n type: 'table',\n name: 'DataTable',\n description:\n 'Render tabular data with sortable columns and pagination. Best for displaying structured records with up to 100 rows. Supports column width customization and cell formatting.',\n schema: {\n type: 'object',\n properties: {\n title: {\n type: 'string',\n description: 'Table title (optional)',\n },\n columns: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n key: { type: 'string', description: 'Data key for this column' },\n label: { type: 'string', description: 'Column header label' },\n sortable: { type: 'boolean', description: 'Whether column is sortable' },\n width: { type: 'string', description: 'CSS width (e.g., \"30%\")' },\n },\n required: ['key', 'label'],\n },\n minItems: 1,\n },\n rows: {\n type: 'array',\n items: {\n type: 'object',\n description: 'Row data matching column keys',\n },\n maxItems: 100,\n },\n pagination: {\n type: 'object',\n properties: {\n currentPage: { type: 'number' },\n pageSize: { type: 'number' },\n totalRows: { type: 'number' },\n },\n },\n },\n required: ['columns', 'rows'],\n },\n examples: [\n {\n query: 'Show me the most recent documents',\n component: {\n id: 'example-table-1',\n type: 'table',\n position: { colStart: 1, colSpan: 8 },\n params: {\n title: 'Recent Documents',\n columns: [\n { key: 'name', label: 'Name', sortable: true, width: '40%' },\n { key: 'type', label: 'Type', sortable: true, width: '15%' },\n { key: 'size', label: 'Size', width: '15%' },\n { key: 'modified', label: 'Modified', sortable: true, width: '30%' },\n ],\n rows: [\n { name: 'Report.pdf', type: 'PDF', size: '2.4 MB', modified: '2 hours ago' },\n { name: 'Slides.pptx', type: 'PPTX', size: '8.7 MB', modified: '1 day ago' },\n ],\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Metric Card Component Registry Entry\n */\nexport const MetricRegistry: ComponentRegistryEntry = {\n type: 'metric',\n name: 'MetricCard',\n description:\n 'Display a single metric with optional trend indicator. Best for KPIs, statistics, and summary numbers. Supports trend direction (up/down/neutral) and subtitles.',\n schema: {\n type: 'object',\n properties: {\n title: {\n type: 'string',\n description: 'Metric title',\n },\n value: {\n oneOf: [{ type: 'string' }, { type: 'number' }],\n description: 'Metric value',\n },\n unit: {\n type: 'string',\n description: 'Unit of measurement (optional)',\n },\n trend: {\n type: 'object',\n properties: {\n value: { type: 'number', description: 'Percentage change' },\n direction: { type: 'string', enum: ['up', 'down', 'neutral'] },\n },\n },\n subtitle: {\n type: 'string',\n description: 'Additional context (optional)',\n },\n },\n required: ['title', 'value'],\n },\n examples: [\n {\n query: 'Show total document count',\n component: {\n id: 'example-metric-1',\n type: 'metric',\n position: { colStart: 1, colSpan: 3 },\n params: {\n title: 'Total Documents',\n value: '1,247',\n trend: {\n value: 12.5,\n direction: 'up',\n },\n subtitle: '+142 this month',\n },\n },\n },\n ],\n limits: {\n maxDataPoints: 1,\n maxTableRows: 1,\n maxPayloadSize: 5 * 1024, // 5KB\n renderTimeout: 1000, // 1s\n },\n}\n\n/**\n * Text Component Registry Entry\n */\nexport const TextRegistry: ComponentRegistryEntry = {\n type: 'text',\n name: 'TextBlock',\n description:\n 'Render text content with optional markdown support. Best for explanations, summaries, and context. Supports basic HTML formatting.',\n schema: {\n type: 'object',\n properties: {\n content: {\n type: 'string',\n description: 'Text content (HTML allowed, will be sanitized)',\n },\n markdown: {\n type: 'boolean',\n description: 'Whether content is markdown (not yet implemented)',\n },\n className: {\n type: 'string',\n description: 'Custom CSS classes',\n },\n },\n required: ['content'],\n },\n examples: [\n {\n query: 'Explain the document distribution',\n component: {\n id: 'example-text-1',\n type: 'text',\n position: { colStart: 1, colSpan: 12 },\n params: {\n content:\n '<p>Your document library contains <strong>1,247 files</strong> across 5 different formats. PDFs represent the largest category at 35% of total storage.</p>',\n },\n },\n },\n ],\n limits: {\n maxDataPoints: 1,\n maxTableRows: 1,\n maxPayloadSize: 10 * 1024, // 10KB\n renderTimeout: 1000, // 1s\n },\n}\n\n// ============================================================================\n// Sprint 4: Additional Component Registry Entries\n// ============================================================================\n\n/**\n * Grid Component Registry Entry\n * Nested CSS Grid layout for organizing multiple components\n */\nexport const GridRegistry: ComponentRegistryEntry = {\n type: 'grid',\n name: 'GridLayout',\n description:\n 'Nested CSS Grid layout for organizing multiple components. Supports named areas, responsive columns (1-12), and custom gap spacing. Best for complex dashboard layouts and template builder.',\n schema: {\n type: 'object',\n properties: {\n columns: {\n type: 'number',\n description: 'Number of columns (default: 12)',\n },\n gap: {\n type: 'string',\n description: 'Gap between items (e.g., \"1rem\")',\n },\n minRowHeight: {\n type: 'string',\n description: 'Minimum row height (optional)',\n },\n areas: {\n type: 'array',\n items: {\n type: 'array',\n items: { type: 'string' },\n },\n description: 'CSS Grid template areas for named regions',\n },\n children: {\n type: 'array',\n items: { type: 'object' },\n description: 'Child UIComponents to render within the grid',\n },\n },\n required: ['children'],\n },\n examples: [],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Action Component Registry Entry\n * Interactive button or link that triggers tool calls\n */\nexport const ActionRegistry: ComponentRegistryEntry = {\n type: 'action',\n name: 'ActionButton',\n description:\n 'Interactive button or link that triggers tool calls or navigation. Best for user interactions, form submissions, and workflow triggers.',\n schema: {\n type: 'object',\n properties: {\n label: {\n type: 'string',\n description: 'Button text',\n },\n type: {\n type: 'string',\n enum: ['button', 'link'],\n description: 'Render as button or link',\n },\n action: {\n type: 'string',\n enum: ['tool-call', 'link', 'submit'],\n description: 'Action type to perform',\n },\n toolName: {\n type: 'string',\n description: 'Tool name to call (for tool-call action)',\n },\n params: {\n type: 'object',\n description: 'Parameters to pass to the tool',\n },\n url: {\n type: 'string',\n description: 'URL for link action',\n },\n variant: {\n type: 'string',\n enum: ['primary', 'secondary', 'outline', 'ghost', 'danger'],\n description: 'Visual style variant',\n },\n size: {\n type: 'string',\n enum: ['sm', 'md', 'lg'],\n description: 'Button size',\n },\n disabled: {\n type: 'boolean',\n description: 'Whether the action is disabled',\n },\n },\n required: ['label', 'type', 'action'],\n },\n examples: [],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Footer Component Registry Entry\n * Display execution metadata like timing and source count\n */\nexport const FooterRegistry: ComponentRegistryEntry = {\n type: 'footer',\n name: 'FooterSection',\n description:\n 'Footer section displaying execution metadata. Best for showing timing, model info, and source counts. Auto-injected by layouts when metadata is provided.',\n schema: {\n type: 'object',\n properties: {\n poweredBy: {\n type: 'string',\n description: 'Powered by text (optional)',\n },\n executionTime: {\n type: 'number',\n description: 'Execution time in milliseconds',\n },\n model: {\n type: 'string',\n description: 'LLM model used',\n },\n sourceCount: {\n type: 'number',\n description: 'Number of sources used',\n },\n customText: {\n type: 'string',\n description: 'Custom footer text',\n },\n links: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n label: { type: 'string' },\n url: { type: 'string' },\n },\n },\n description: 'Footer links',\n },\n },\n },\n examples: [],\n limits: {\n maxDataPoints: 1,\n maxTableRows: 1,\n maxPayloadSize: 5 * 1024,\n renderTimeout: 1000,\n },\n}\n\n/**\n * Carousel Component Registry Entry\n * Display multiple items with horizontal scrolling\n */\nexport const CarouselRegistry: ComponentRegistryEntry = {\n type: 'carousel',\n name: 'Carousel',\n description:\n 'Horizontal carousel for displaying multiple items with snap scrolling and navigation buttons. Best for showcasing related content, image galleries, or card collections.',\n schema: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: { type: 'object' },\n description: 'Array of UIComponents to display in carousel',\n },\n height: {\n type: 'string',\n description: 'Carousel height (optional)',\n },\n },\n required: ['items'],\n },\n examples: [],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Artifact Component Registry Entry\n * Display downloadable artifacts like generated files\n */\nexport const ArtifactRegistry: ComponentRegistryEntry = {\n type: 'artifact',\n name: 'Artifact',\n description:\n 'Display downloadable artifacts like generated files or exports. Shows filename, size, and download button. Best for CSV exports, PDF reports, and generated documents.',\n schema: {\n type: 'object',\n properties: {\n url: {\n type: 'string',\n description: 'Download URL for the artifact',\n },\n filename: {\n type: 'string',\n description: 'Display filename',\n },\n mimeType: {\n type: 'string',\n description: 'MIME type (e.g., \"text/csv\", \"application/pdf\")',\n },\n size: {\n type: 'number',\n description: 'File size in bytes',\n },\n description: {\n type: 'string',\n description: 'Description of the artifact',\n },\n },\n required: ['url', 'filename', 'mimeType'],\n },\n examples: [],\n limits: {\n maxDataPoints: 1,\n maxTableRows: 1,\n maxPayloadSize: 5 * 1024,\n renderTimeout: 1000,\n },\n}\n\n/**\n * Code Block Registry Entry\n */\nexport const CodeRegistry: ComponentRegistryEntry = {\n type: 'code',\n name: 'CodeBlock',\n description:\n 'Render syntax-highlighted code blocks with line numbers, copy button, and word wrap toggle. Supports all languages via highlight.js auto-detection. Best for displaying source code, configuration files, CLI output, or API responses.',\n schema: {\n type: 'object',\n properties: {\n code: { type: 'string', description: 'The code content to display' },\n language: { type: 'string', description: 'Programming language for syntax highlighting (auto-detected if omitted)' },\n filename: { type: 'string', description: 'Filename shown in header bar' },\n showLineNumbers: { type: 'boolean', description: 'Show line numbers (default: true)' },\n startLine: { type: 'number', description: 'Starting line number (default: 1)' },\n maxHeight: { type: 'string', description: 'CSS max-height for scrollable code blocks' },\n theme: { type: 'string', enum: ['light', 'dark'], description: 'Color theme (follows system preference by default)' },\n },\n required: ['code'],\n },\n examples: [\n {\n query: 'Show me how to connect to the API',\n component: {\n id: 'example-code-1',\n type: 'code',\n position: { colStart: 1, colSpan: 8 },\n params: {\n code: 'const client = new MCPClient({ url: \"https://api.example.com\" });\\nawait client.connect();\\nconst result = await client.query(\"SELECT * FROM documents\");',\n language: 'typescript',\n filename: 'example.ts',\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Map Registry Entry\n */\nexport const MapRegistry: ComponentRegistryEntry = {\n type: 'map',\n name: 'InteractiveMap',\n description:\n 'Render interactive maps with markers using Leaflet. Supports marker clustering, custom tile layers, and auto-fitting bounds. Best for displaying geographic data with up to 1000 markers.',\n schema: {\n type: 'object',\n properties: {\n center: { type: 'array', items: { type: 'number' }, minItems: 2, maxItems: 2, description: 'Map center [lat, lng]' },\n zoom: { type: 'number', description: 'Zoom level (1-18, default: 13)' },\n markers: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n position: { type: 'array', items: { type: 'number' }, minItems: 2, maxItems: 2 },\n title: { type: 'string' },\n popup: { type: 'string' },\n },\n required: ['position'],\n },\n },\n height: { type: 'string', description: 'CSS height (default: 400px)' },\n fitBounds: { type: 'boolean', description: 'Auto-fit to show all markers' },\n clustering: { type: 'boolean', description: 'Enable marker clustering for large datasets' },\n },\n required: [],\n },\n examples: [\n {\n query: 'Show office locations on a map',\n component: {\n id: 'example-map-1',\n type: 'map',\n position: { colStart: 1, colSpan: 12 },\n params: {\n center: [48.8566, 2.3522],\n zoom: 5,\n markers: [\n { position: [48.8566, 2.3522], tooltip: 'Paris', popup: 'HQ — 120 employees' },\n { position: [51.5074, -0.1278], tooltip: 'London', popup: 'UK Office — 45 employees' },\n ],\n fitBounds: true,\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Graph Registry Entry (v6.12.0 — audit P1.5)\n */\nexport const GraphRegistry: ComponentRegistryEntry = {\n type: 'graph',\n name: 'NodeLinkGraph',\n description:\n 'Render a node-link graph (entities and their relationships) with @antv/g6. Best for provenance/source chains, dependency or process graphs, and ontology-lite entity/relation views. Degrades to an edge table when the graph engine is unavailable.',\n schema: {\n type: 'object',\n properties: {\n nodes: {\n type: 'array',\n description: 'Graph nodes (at least one required)',\n items: {\n type: 'object',\n properties: {\n id: { type: 'string' },\n label: { type: 'string' },\n group: { type: 'string' },\n },\n required: ['id'],\n },\n },\n edges: {\n type: 'array',\n description: 'Edges between node ids',\n items: {\n type: 'object',\n properties: {\n source: { type: 'string' },\n target: { type: 'string' },\n label: { type: 'string' },\n weight: { type: 'number' },\n },\n required: ['source', 'target'],\n },\n },\n layout: {\n type: 'string',\n enum: ['force', 'radial', 'grid', 'dagre', 'circular'],\n description: 'Layout algorithm (default: force)',\n },\n directed: { type: 'boolean', description: 'Render edges as directed (arrows)' },\n },\n required: ['nodes'],\n },\n // No typed example yet: the registry `ComponentExample` `params` type is a\n // union of the legacy component params that does not (yet) include graph\n // (`nodes` / `edges`). The `schema` above fully documents graph params; a\n // typed example can be added once `GraphComponentParams` joins the\n // `UIComponent` params union (a separate solid-types task).\n examples: [],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Form Registry Entry\n */\nexport const FormRegistry: ComponentRegistryEntry = {\n type: 'form',\n name: 'Form',\n description:\n 'Render interactive forms with text inputs, selects, checkboxes, date pickers, and conditional fields. Supports persistence, validation, and submit actions that trigger MCP tool calls.',\n schema: {\n type: 'object',\n properties: {\n title: { type: 'string', description: 'Form title' },\n fields: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n label: { type: 'string' },\n type: { type: 'string', enum: ['text', 'number', 'email', 'password', 'textarea', 'select', 'checkbox', 'radio', 'date'] },\n required: { type: 'boolean' },\n placeholder: { type: 'string' },\n options: { type: 'array', items: { type: 'object', properties: { label: { type: 'string' }, value: { type: 'string' } } } },\n },\n required: ['name', 'label', 'type'],\n },\n },\n submitLabel: { type: 'string', description: 'Submit button text (default: \"Submit\")' },\n layout: { type: 'string', enum: ['vertical', 'horizontal', 'inline'] },\n },\n required: ['fields'],\n },\n examples: [\n {\n query: 'Create a document upload form',\n component: {\n id: 'example-form-1',\n type: 'form',\n position: { colStart: 1, colSpan: 6 },\n params: {\n title: 'Upload Document',\n fields: [\n { name: 'title', label: 'Document Title', type: 'text', required: true },\n { name: 'category', label: 'Category', type: 'select', options: [{ label: 'Report', value: 'report' }, { label: 'Invoice', value: 'invoice' }] },\n { name: 'notes', label: 'Notes', type: 'textarea' },\n ],\n submitLabel: 'Upload',\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Modal Registry Entry\n */\nexport const ModalRegistry: ComponentRegistryEntry = {\n type: 'modal',\n name: 'Modal',\n description:\n 'Render a dialog overlay with Portal rendering. Supports sizes from small to fullscreen, close on Escape/backdrop, and nested content. Best for confirmations, detail views, and focused interactions.',\n schema: {\n type: 'object',\n properties: {\n title: { type: 'string', description: 'Modal header title' },\n size: { type: 'string', enum: ['sm', 'md', 'lg', 'xl', 'full'], description: 'Modal width (default: md)' },\n showClose: { type: 'boolean', description: 'Show close button (default: true)' },\n closeOnEscape: { type: 'boolean', description: 'Close on Escape key (default: true)' },\n closeOnBackdrop: { type: 'boolean', description: 'Close on backdrop click (default: true)' },\n maxHeight: { type: 'string', description: 'CSS max-height for scrollable content' },\n },\n required: [],\n },\n examples: [\n {\n query: 'Show document details in a dialog',\n component: {\n id: 'example-modal-1',\n type: 'modal',\n position: { colStart: 1, colSpan: 12 },\n params: {\n title: 'Document Details',\n size: 'lg',\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Action Group Registry Entry\n */\nexport const ActionGroupRegistry: ComponentRegistryEntry = {\n type: 'action-group',\n name: 'ActionGroup',\n description:\n 'Render a group of action buttons in horizontal, vertical, or grid layout. Each action triggers an MCP tool call. Best for presenting multiple related actions like CRUD operations or workflow steps.',\n schema: {\n type: 'object',\n properties: {\n actions: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n label: { type: 'string' },\n toolName: { type: 'string' },\n params: { type: 'object' },\n variant: { type: 'string', enum: ['primary', 'secondary', 'danger', 'ghost'] },\n icon: { type: 'string' },\n },\n required: ['label', 'toolName'],\n },\n },\n layout: { type: 'string', enum: ['horizontal', 'vertical', 'grid'], description: 'Button layout' },\n label: { type: 'string', description: 'Group label' },\n },\n required: ['actions'],\n },\n examples: [\n {\n query: 'Show actions for this document',\n component: {\n id: 'example-action-group-1',\n type: 'action-group',\n position: { colStart: 1, colSpan: 6 },\n params: {\n label: 'Document Actions',\n actions: [\n { label: 'Download', type: 'button', action: 'tool-call', toolName: 'document_download', params: { id: '123' }, variant: 'primary' },\n { label: 'Share', type: 'button', action: 'tool-call', toolName: 'document_share', params: { id: '123' }, variant: 'secondary' },\n { label: 'Delete', type: 'button', action: 'tool-call', toolName: 'document_delete', params: { id: '123' }, variant: 'danger' },\n ],\n layout: 'horizontal',\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Image Gallery Registry Entry\n */\nexport const ImageGalleryRegistry: ComponentRegistryEntry = {\n type: 'image-gallery',\n name: 'ImageGallery',\n description:\n 'Render a grid of images with lightbox overlay for fullscreen viewing. Supports captions, configurable columns, aspect ratios, and keyboard navigation in lightbox mode.',\n schema: {\n type: 'object',\n properties: {\n title: { type: 'string', description: 'Gallery title' },\n images: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n url: { type: 'string', description: 'Image URL' },\n alt: { type: 'string', description: 'Alt text' },\n caption: { type: 'string', description: 'Caption text' },\n thumbnail: { type: 'string', description: 'Thumbnail URL (optional, falls back to url)' },\n },\n required: ['url'],\n },\n },\n columns: { type: 'number', enum: [2, 3, 4, 5], description: 'Grid columns (default: 3)' },\n aspectRatio: { type: 'string', enum: ['1:1', '16:9', '4:3', 'auto'] },\n lightbox: { type: 'boolean', description: 'Enable lightbox overlay (default: true)' },\n },\n required: ['images'],\n },\n examples: [\n {\n query: 'Show document thumbnails',\n component: {\n id: 'example-gallery-1',\n type: 'image-gallery',\n position: { colStart: 1, colSpan: 12 },\n params: {\n title: 'Recent Documents',\n images: [\n { url: '/thumbnails/doc1.png', alt: 'Q4 Report', caption: 'Q4 Report — 24 pages' },\n { url: '/thumbnails/doc2.png', alt: 'Invoice #4521', caption: 'Invoice #4521' },\n ],\n columns: 4,\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Video Registry Entry\n */\nexport const VideoRegistry: ComponentRegistryEntry = {\n type: 'video',\n name: 'Video',\n description:\n 'Embed video from YouTube, Vimeo, or direct URLs. Auto-detects provider from URL and renders appropriate embed. Supports aspect ratios, autoplay, and start time.',\n schema: {\n type: 'object',\n properties: {\n url: { type: 'string', description: 'Video URL (YouTube, Vimeo, or direct)' },\n title: { type: 'string', description: 'Video title' },\n caption: { type: 'string', description: 'Caption below video' },\n aspectRatio: { type: 'string', enum: ['16:9', '4:3', '1:1', '21:9'], description: 'Aspect ratio (default: 16:9)' },\n autoplay: { type: 'boolean', description: 'Auto-play video' },\n startTime: { type: 'number', description: 'Start time in seconds' },\n },\n required: ['url'],\n },\n examples: [\n {\n query: 'Show the product demo video',\n component: {\n id: 'example-video-1',\n type: 'video',\n position: { colStart: 1, colSpan: 8 },\n params: {\n url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',\n title: 'Product Demo',\n aspectRatio: '16:9',\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Iframe Registry Entry\n */\nexport const IframeRegistry: ComponentRegistryEntry = {\n type: 'iframe',\n name: 'Iframe',\n description:\n 'Embed external content via sandboxed iframe. Domain whitelist enforced for security. Supports Mermaid diagrams, Excalidraw, GitHub Gists, Figma, and 60+ whitelisted domains.',\n schema: {\n type: 'object',\n properties: {\n url: { type: 'string', description: 'URL to embed (must be on whitelist)' },\n title: { type: 'string', description: 'Iframe title for accessibility' },\n height: { type: 'string', description: 'CSS height (default: 400px)' },\n sandbox: { type: 'string', description: 'Sandbox attribute (default: restrictive)' },\n },\n required: ['url'],\n },\n examples: [\n {\n query: 'Show the architecture diagram',\n component: {\n id: 'example-iframe-1',\n type: 'iframe',\n position: { colStart: 1, colSpan: 12 },\n params: {\n url: 'https://mermaid.ink/svg/graph+TD;A-->B;B-->C',\n title: 'Architecture Diagram',\n height: '500px',\n },\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Image Registry Entry\n */\nexport const ImageRegistry: ComponentRegistryEntry = {\n type: 'image',\n name: 'Image',\n description:\n 'Render a single image with optional alt text, caption, and link. Best for logos, screenshots, diagrams, or any standalone visual content.',\n schema: {\n type: 'object',\n properties: {\n url: { type: 'string', description: 'Image URL' },\n alt: { type: 'string', description: 'Alt text for accessibility' },\n title: { type: 'string', description: 'Image title / heading' },\n width: { type: 'string', description: 'CSS width' },\n height: { type: 'string', description: 'CSS height' },\n },\n required: ['url'],\n },\n examples: [\n {\n query: 'Show the company logo',\n component: {\n id: 'example-image-1',\n type: 'image',\n position: { colStart: 1, colSpan: 4 },\n params: {\n url: '/images/logo.png',\n alt: 'Company Logo',\n } as any,\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Link Registry Entry\n */\nexport const LinkRegistry: ComponentRegistryEntry = {\n type: 'link',\n name: 'Link',\n description:\n 'Render a styled link card with title, description, and URL. Best for navigation, references, and external resource links.',\n schema: {\n type: 'object',\n properties: {\n url: { type: 'string', description: 'Link destination URL' },\n label: { type: 'string', description: 'Link display text' },\n description: { type: 'string', description: 'Link description' },\n icon: { type: 'string', description: 'Icon identifier' },\n },\n required: ['url', 'label'],\n },\n examples: [\n {\n query: 'Link to the API documentation',\n component: {\n id: 'example-link-1',\n type: 'link',\n position: { colStart: 1, colSpan: 4 },\n params: {\n url: 'https://docs.example.com/api',\n label: 'API Documentation',\n description: 'Full reference for the REST API',\n } as any,\n },\n },\n ],\n limits: DEFAULT_RESOURCE_LIMITS,\n}\n\n/**\n * Component Registry - All components indexed by type\n */\nexport const ComponentRegistry: Map<ComponentType, ComponentRegistryEntry> = new Map([\n ['chart', QuickchartRegistry],\n ['table', TableRegistry],\n ['metric', MetricRegistry],\n ['text', TextRegistry],\n // Sprint 4 additions\n ['grid', GridRegistry],\n ['action', ActionRegistry],\n ['footer', FooterRegistry],\n ['carousel', CarouselRegistry],\n ['artifact', ArtifactRegistry],\n // v2.2.5: Complete registry\n ['code', CodeRegistry],\n ['map', MapRegistry],\n ['graph', GraphRegistry], // v6.12.0: audit P1.5 — registry/schema parity\n\n ['form', FormRegistry],\n ['modal', ModalRegistry],\n ['action-group', ActionGroupRegistry],\n ['image-gallery', ImageGalleryRegistry],\n ['video', VideoRegistry],\n ['iframe', IframeRegistry],\n ['image', ImageRegistry],\n ['link', LinkRegistry],\n])\n\n/**\n * Get component registry entry by type\n */\nexport function getComponentEntry(type: ComponentType): ComponentRegistryEntry | undefined {\n return ComponentRegistry.get(type)\n}\n\n/**\n * Get all component types\n */\nexport function getAllComponentTypes(): ComponentType[] {\n return Array.from(ComponentRegistry.keys())\n}\n\n/**\n * Get registry as JSON for LLM context\n */\nexport function getRegistryForLLM(): string {\n const entries = Array.from(ComponentRegistry.values()).map((entry) => ({\n type: entry.type,\n name: entry.name,\n description: entry.description,\n schema: entry.schema,\n examples: entry.examples.map((ex) => ({\n query: ex.query,\n component: ex.component,\n })),\n limits: entry.limits,\n }))\n\n return JSON.stringify(entries, null, 2)\n}\n\n/**\n * Validate component against registry schema\n * (Future: Use Zod for runtime validation)\n */\nexport function validateAgainstRegistry(\n componentType: ComponentType,\n params: any\n): { valid: boolean; errors?: string[]; warnings?: string[] } {\n const entry = getComponentEntry(componentType)\n if (!entry) {\n // Warn but don't block — renderer may exist even without registry entry\n return { valid: true, warnings: [`No registry entry for type: ${componentType}`] }\n }\n\n // Basic validation (Phase 1 will add Zod schema validation)\n const required = entry.schema.required || []\n const missing = required.filter((key: string) => !(key in params))\n\n if (missing.length > 0) {\n return {\n valid: false,\n errors: missing.map((key: string) => `Missing required field: ${key}`),\n }\n }\n\n return { valid: true }\n}\n"],"names":[],"mappings":";AAeO,MAAM,qBAA6C;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aACE;AAAA,EACF,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,MAAM,CAAC,OAAO,QAAQ,OAAO,YAAY,SAAS,SAAS;AAAA,QAC3D,aAAa;AAAA,MAAA;AAAA,MAEf,OAAO;AAAA,QACL,MAAM;AAAA,QACN,aAAa;AAAA,MAAA;AAAA,MAEf,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,YAAY;AAAA,UACV,QAAQ;AAAA,YACN,MAAM;AAAA,YACN,OAAO,EAAE,MAAM,SAAA;AAAA,YACf,aAAa;AAAA,UAAA;AAAA,UAEf,UAAU;AAAA,YACR,MAAM;AAAA,YACN,OAAO;AAAA,cACL,MAAM;AAAA,cACN,YAAY;AAAA,gBACV,OAAO,EAAE,MAAM,SAAA;AAAA,gBACf,MAAM;AAAA,kBACJ,MAAM;AAAA,kBACN,OAAO,EAAE,MAAM,SAAA;AAAA,gBAAS;AAAA,gBAE1B,iBAAiB;AAAA,kBACf,OAAO,CAAC,EAAE,MAAM,YAAY,EAAE,MAAM,SAAS,OAAO,EAAE,MAAM,SAAA,GAAY;AAAA,gBAAA;AAAA,gBAE1E,aAAa;AAAA,kBACX,OAAO,CAAC,EAAE,MAAM,YAAY,EAAE,MAAM,SAAS,OAAO,EAAE,MAAM,SAAA,GAAY;AAAA,gBAAA;AAAA,gBAE1E,aAAa,EA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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-ship/mcp-ui-solid",
3
- "version": "6.10.0",
3
+ "version": "6.12.0",
4
4
  "description": "SolidJS components for rendering MCP-generated UI resources",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -0,0 +1,68 @@
1
+ /**
2
+ * v6.11.0 — map hardening.
3
+ *
4
+ * Covers the marker tooltip/popup escaping wiring (audit P1.2 completion: the
5
+ * `bindMarkerContent` helper shipped in v6.10.0 but the marker loops still
6
+ * bound raw HTML until v6.11.0) and the `popupSafeText` contract reused by the
7
+ * PMTiles-failure path (P1.3).
8
+ */
9
+
10
+ import { describe, it, expect } from 'vitest'
11
+ import { bindMarkerContent, popupSafeText } from './MapRenderer'
12
+
13
+ const XSS = '<img src=x onerror=alert(1)>'
14
+
15
+ // Minimal Leaflet marker stub recording what gets bound.
16
+ function fakeMarker() {
17
+ const calls: { tooltip?: string; popup?: string } = {}
18
+ return {
19
+ calls,
20
+ bindTooltip(html: string) {
21
+ calls.tooltip = html
22
+ return this
23
+ },
24
+ bindPopup(html: string) {
25
+ calls.popup = html
26
+ return this
27
+ },
28
+ }
29
+ }
30
+
31
+ describe('bindMarkerContent (audit P1.2 wiring)', () => {
32
+ it('escapes marker tooltip/popup by default (untrusted host)', () => {
33
+ const m = fakeMarker()
34
+ bindMarkerContent(m, { tooltip: XSS, popup: XSS }, false)
35
+ expect(m.calls.tooltip).not.toContain('<img')
36
+ expect(m.calls.tooltip).toContain('&lt;img')
37
+ expect(m.calls.popup).not.toContain('<img')
38
+ expect(m.calls.popup).toContain('&lt;img')
39
+ })
40
+
41
+ it('passes raw HTML through only when the host opts in (allowHtml=true)', () => {
42
+ const m = fakeMarker()
43
+ bindMarkerContent(m, { tooltip: XSS, popup: XSS }, true)
44
+ expect(m.calls.tooltip).toBe(XSS)
45
+ expect(m.calls.popup).toBe(XSS)
46
+ })
47
+
48
+ it('binds nothing when tooltip/popup are absent', () => {
49
+ const m = fakeMarker()
50
+ bindMarkerContent(m, {}, false)
51
+ expect(m.calls.tooltip).toBeUndefined()
52
+ expect(m.calls.popup).toBeUndefined()
53
+ })
54
+ })
55
+
56
+ describe('popupSafeText', () => {
57
+ it('escapes by default', () => {
58
+ expect(popupSafeText(XSS)).toBe('&lt;img src=x onerror=alert(1)&gt;')
59
+ })
60
+
61
+ it('is identity when the host trusts the payload', () => {
62
+ expect(popupSafeText(XSS, true)).toBe(XSS)
63
+ })
64
+
65
+ it('returns undefined for missing values', () => {
66
+ expect(popupSafeText(undefined)).toBeUndefined()
67
+ })
68
+ })
@@ -192,7 +192,7 @@ export function popupSafeText(value: string | undefined, allowHtml = false): str
192
192
  }
193
193
 
194
194
  /** Bind a marker's tooltip + popup, escaping by default (see popupSafeText). */
195
- function bindMarkerContent(
195
+ export function bindMarkerContent(
196
196
  m: any,
197
197
  marker: { tooltip?: string; popup?: string },
198
198
  allowHtml: boolean
@@ -276,6 +276,10 @@ export const MapRenderer: Component<MapRendererProps> = (props) => {
276
276
  let mapInstance: any = null;
277
277
  const [isLeafletLoaded, setIsLeafletLoaded] = createSignal(false);
278
278
  const [error, setError] = createSignal<string | null>(null);
279
+ // PMTiles is an optional overlay on top of the base map. When it fails we
280
+ // keep the base map but surface a visible notice (audit P1.3) instead of a
281
+ // silent console.warn that leaves the user with an unexplained empty layer.
282
+ const [pmtilesError, setPmtilesError] = createSignal<string | null>(null);
279
283
  const isExpanded = useExpanded();
280
284
  const telemetry = useTelemetry();
281
285
  // Host-level trust for raw HTML in marker/popup content (audit P1.2).
@@ -390,8 +394,7 @@ export const MapRenderer: Component<MapRendererProps> = (props) => {
390
394
  });
391
395
  p?.markers?.forEach((marker) => {
392
396
  const m = L.marker(marker.position);
393
- if (marker.tooltip) m.bindTooltip(marker.tooltip);
394
- if (marker.popup) m.bindPopup(marker.popup);
397
+ bindMarkerContent(m, marker, allowHtml());
395
398
  clusterGroup.addLayer(m);
396
399
  markers.push(m);
397
400
  });
@@ -399,16 +402,14 @@ export const MapRenderer: Component<MapRendererProps> = (props) => {
399
402
  } catch {
400
403
  p?.markers?.forEach((marker) => {
401
404
  const m = L.marker(marker.position).addTo(mapInstance);
402
- if (marker.tooltip) m.bindTooltip(marker.tooltip);
403
- if (marker.popup) m.bindPopup(marker.popup);
405
+ bindMarkerContent(m, marker, allowHtml());
404
406
  markers.push(m);
405
407
  });
406
408
  }
407
409
  } else {
408
410
  p?.markers?.forEach((marker) => {
409
411
  const m = L.marker(marker.position).addTo(mapInstance);
410
- if (marker.tooltip) m.bindTooltip(marker.tooltip);
411
- if (marker.popup) m.bindPopup(marker.popup);
412
+ bindMarkerContent(m, marker, allowHtml());
412
413
  markers.push(m);
413
414
  });
414
415
  }
@@ -452,6 +453,7 @@ export const MapRenderer: Component<MapRendererProps> = (props) => {
452
453
  }
453
454
 
454
455
  // ─── PMTiles (v3.1.0) ────────────────────────
456
+ setPmtilesError(null);
455
457
  if (p?.pmtiles) {
456
458
  try {
457
459
  // @ts-ignore — optional peer dependency, may not be installed
@@ -495,7 +497,23 @@ export const MapRenderer: Component<MapRendererProps> = (props) => {
495
497
 
496
498
  pmLayer.addTo(mapInstance);
497
499
  } catch (e) {
498
- console.warn('[MCP-UI] Failed to load protomaps-leaflet for PMTiles:', e);
500
+ // P1.3 do NOT fail silently. Keep the base map, but surface a
501
+ // visible notice and report a renderer error via telemetry. The
502
+ // most common cause is the optional `protomaps-leaflet` peer not
503
+ // being installed.
504
+ const detail = e instanceof Error ? e.message : String(e);
505
+ const message =
506
+ 'PMTiles layer unavailable — the optional "protomaps-leaflet" ' +
507
+ 'peer dependency failed to load or render.';
508
+ console.warn('[MCP-UI] ' + message, e);
509
+ setPmtilesError(message);
510
+ telemetry?.dispatch({
511
+ type: 'render:error',
512
+ errorMessage: `${message} (${detail})`,
513
+ id: props.component?.id ?? '',
514
+ componentType: 'map',
515
+ ts: Date.now(),
516
+ });
499
517
  }
500
518
  }
501
519
 
@@ -557,6 +575,16 @@ export const MapRenderer: Component<MapRendererProps> = (props) => {
557
575
  </div>
558
576
  </Show>
559
577
  <Show when={!error()}>
578
+ {/* P1.3 — visible notice when the PMTiles overlay fails but the
579
+ base map is still usable. */}
580
+ <Show when={pmtilesError()}>
581
+ <div
582
+ role="alert"
583
+ class="m-2 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:border-amber-700/50 dark:bg-amber-900/20 dark:text-amber-200"
584
+ >
585
+ {pmtilesError()} The base map is still shown.
586
+ </div>
587
+ </Show>
560
588
  <div
561
589
  ref={mapContainer}
562
590
  style={
@@ -5,19 +5,46 @@
5
5
  import { describe, it, expect } from 'vitest'
6
6
  import { validateAgainstRegistry, getComponentEntry, ComponentRegistry } from './component-registry'
7
7
  import type { ComponentType } from '../types'
8
+ import { ComponentTypeSchema } from '@seed-ship/mcp-ui-spec'
8
9
 
9
- /** All 19 component types in the registry */
10
+ /** All 20 component types in the registry */
10
11
  const ALL_TYPES: ComponentType[] = [
11
12
  'chart', 'table', 'metric', 'text', 'grid',
12
13
  'action', 'footer', 'carousel', 'artifact',
13
- 'code', 'map', 'form', 'modal', 'action-group',
14
+ 'code', 'map', 'graph', 'form', 'modal', 'action-group',
14
15
  'image-gallery', 'video', 'iframe', 'image', 'link',
15
16
  ]
16
17
 
18
+ // Schema component types that are intentionally NOT standalone registry
19
+ // entries. `composite` is a layout container rendered inline by
20
+ // UIResourceRenderer (like a bare layout), not a leaf component with its own
21
+ // params schema / examples.
22
+ const REGISTRY_EXCEPTIONS = new Set<string>(['composite'])
23
+
24
+ describe('registry ↔ schema parity (P1.5)', () => {
25
+ it('every schema component type has a registry entry (except documented containers)', () => {
26
+ const missing = (ComponentTypeSchema.options as readonly string[]).filter(
27
+ (t) => !REGISTRY_EXCEPTIONS.has(t) && !ComponentRegistry.has(t as ComponentType)
28
+ )
29
+ expect(missing).toEqual([])
30
+ })
31
+
32
+ it('every registry type is a valid schema component type', () => {
33
+ const schemaTypes = new Set<string>(ComponentTypeSchema.options)
34
+ const extra = Array.from(ComponentRegistry.keys()).filter((t) => !schemaTypes.has(t))
35
+ expect(extra).toEqual([])
36
+ })
37
+
38
+ it('graph is registered (regression for P1.5)', () => {
39
+ expect(ComponentRegistry.has('graph')).toBe(true)
40
+ expect(getComponentEntry('graph')?.type).toBe('graph')
41
+ })
42
+ })
43
+
17
44
  describe('ComponentRegistry', () => {
18
45
  describe('registry completeness', () => {
19
- it('has exactly 19 registered types', () => {
20
- expect(ComponentRegistry.size).toBe(19)
46
+ it('has exactly 20 registered types', () => {
47
+ expect(ComponentRegistry.size).toBe(20)
21
48
  })
22
49
 
23
50
  it.each(ALL_TYPES)('has registry entry for "%s"', (type) => {
@@ -632,6 +632,62 @@ export const MapRegistry: ComponentRegistryEntry = {
632
632
  limits: DEFAULT_RESOURCE_LIMITS,
633
633
  }
634
634
 
635
+ /**
636
+ * Graph Registry Entry (v6.12.0 — audit P1.5)
637
+ */
638
+ export const GraphRegistry: ComponentRegistryEntry = {
639
+ type: 'graph',
640
+ name: 'NodeLinkGraph',
641
+ description:
642
+ 'Render a node-link graph (entities and their relationships) with @antv/g6. Best for provenance/source chains, dependency or process graphs, and ontology-lite entity/relation views. Degrades to an edge table when the graph engine is unavailable.',
643
+ schema: {
644
+ type: 'object',
645
+ properties: {
646
+ nodes: {
647
+ type: 'array',
648
+ description: 'Graph nodes (at least one required)',
649
+ items: {
650
+ type: 'object',
651
+ properties: {
652
+ id: { type: 'string' },
653
+ label: { type: 'string' },
654
+ group: { type: 'string' },
655
+ },
656
+ required: ['id'],
657
+ },
658
+ },
659
+ edges: {
660
+ type: 'array',
661
+ description: 'Edges between node ids',
662
+ items: {
663
+ type: 'object',
664
+ properties: {
665
+ source: { type: 'string' },
666
+ target: { type: 'string' },
667
+ label: { type: 'string' },
668
+ weight: { type: 'number' },
669
+ },
670
+ required: ['source', 'target'],
671
+ },
672
+ },
673
+ layout: {
674
+ type: 'string',
675
+ enum: ['force', 'radial', 'grid', 'dagre', 'circular'],
676
+ description: 'Layout algorithm (default: force)',
677
+ },
678
+ directed: { type: 'boolean', description: 'Render edges as directed (arrows)' },
679
+ },
680
+ required: ['nodes'],
681
+ },
682
+ // No typed example yet: the registry `ComponentExample` `params` type is a
683
+ // union of the legacy component params that does not (yet) include graph
684
+ // (`nodes` / `edges`). The `schema` above fully documents graph params; a
685
+ // typed example can be added once `GraphComponentParams` joins the
686
+ // `UIComponent` params union (a separate solid-types task).
687
+ examples: [],
688
+ limits: DEFAULT_RESOURCE_LIMITS,
689
+ }
690
+
635
691
  /**
636
692
  * Form Registry Entry
637
693
  */
@@ -990,6 +1046,8 @@ export const ComponentRegistry: Map<ComponentType, ComponentRegistryEntry> = new
990
1046
  // v2.2.5: Complete registry
991
1047
  ['code', CodeRegistry],
992
1048
  ['map', MapRegistry],
1049
+ ['graph', GraphRegistry], // v6.12.0: audit P1.5 — registry/schema parity
1050
+
993
1051
  ['form', FormRegistry],
994
1052
  ['modal', ModalRegistry],
995
1053
  ['action-group', ActionGroupRegistry],