@seed-ship/mcp-ui-solid 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/components/ActionRenderer.cjs +34 -0
- package/dist/components/ActionRenderer.cjs.map +1 -0
- package/dist/components/ActionRenderer.js +34 -0
- package/dist/components/ActionRenderer.js.map +1 -0
- package/dist/components/ArtifactRenderer.cjs +37 -0
- package/dist/components/ArtifactRenderer.cjs.map +1 -0
- package/dist/components/ArtifactRenderer.js +37 -0
- package/dist/components/ArtifactRenderer.js.map +1 -0
- package/dist/components/CarouselRenderer.cjs +58 -0
- package/dist/components/CarouselRenderer.cjs.map +1 -0
- package/dist/components/CarouselRenderer.js +58 -0
- package/dist/components/CarouselRenderer.js.map +1 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components.cjs +10 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.ts +10 -0
- package/dist/components.js +10 -0
- package/dist/components.js.map +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/services/component-registry.cjs +211 -1
- package/dist/services/component-registry.cjs.map +1 -1
- package/dist/services/component-registry.d.ts +25 -0
- package/dist/services/component-registry.d.ts.map +1 -1
- package/dist/services/component-registry.js +211 -1
- package/dist/services/component-registry.js.map +1 -1
- package/package.json +1 -1
- package/src/components/index.ts +16 -0
- package/src/services/component-registry.ts +239 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -281,13 +281,223 @@ const TextRegistry = {
|
|
|
281
281
|
// 1s
|
|
282
282
|
}
|
|
283
283
|
};
|
|
284
|
+
const GridRegistry = {
|
|
285
|
+
type: "grid",
|
|
286
|
+
name: "GridLayout",
|
|
287
|
+
description: "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.",
|
|
288
|
+
schema: {
|
|
289
|
+
type: "object",
|
|
290
|
+
properties: {
|
|
291
|
+
columns: {
|
|
292
|
+
type: "number",
|
|
293
|
+
description: "Number of columns (default: 12)"
|
|
294
|
+
},
|
|
295
|
+
gap: {
|
|
296
|
+
type: "string",
|
|
297
|
+
description: 'Gap between items (e.g., "1rem")'
|
|
298
|
+
},
|
|
299
|
+
minRowHeight: {
|
|
300
|
+
type: "string",
|
|
301
|
+
description: "Minimum row height (optional)"
|
|
302
|
+
},
|
|
303
|
+
areas: {
|
|
304
|
+
type: "array",
|
|
305
|
+
items: {
|
|
306
|
+
type: "array",
|
|
307
|
+
items: { type: "string" }
|
|
308
|
+
},
|
|
309
|
+
description: "CSS Grid template areas for named regions"
|
|
310
|
+
},
|
|
311
|
+
children: {
|
|
312
|
+
type: "array",
|
|
313
|
+
items: { type: "object" },
|
|
314
|
+
description: "Child UIComponents to render within the grid"
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
required: ["children"]
|
|
318
|
+
},
|
|
319
|
+
examples: [],
|
|
320
|
+
limits: validation.DEFAULT_RESOURCE_LIMITS
|
|
321
|
+
};
|
|
322
|
+
const ActionRegistry = {
|
|
323
|
+
type: "action",
|
|
324
|
+
name: "ActionButton",
|
|
325
|
+
description: "Interactive button or link that triggers tool calls or navigation. Best for user interactions, form submissions, and workflow triggers.",
|
|
326
|
+
schema: {
|
|
327
|
+
type: "object",
|
|
328
|
+
properties: {
|
|
329
|
+
label: {
|
|
330
|
+
type: "string",
|
|
331
|
+
description: "Button text"
|
|
332
|
+
},
|
|
333
|
+
type: {
|
|
334
|
+
type: "string",
|
|
335
|
+
enum: ["button", "link"],
|
|
336
|
+
description: "Render as button or link"
|
|
337
|
+
},
|
|
338
|
+
action: {
|
|
339
|
+
type: "string",
|
|
340
|
+
enum: ["tool-call", "link", "submit"],
|
|
341
|
+
description: "Action type to perform"
|
|
342
|
+
},
|
|
343
|
+
toolName: {
|
|
344
|
+
type: "string",
|
|
345
|
+
description: "Tool name to call (for tool-call action)"
|
|
346
|
+
},
|
|
347
|
+
params: {
|
|
348
|
+
type: "object",
|
|
349
|
+
description: "Parameters to pass to the tool"
|
|
350
|
+
},
|
|
351
|
+
url: {
|
|
352
|
+
type: "string",
|
|
353
|
+
description: "URL for link action"
|
|
354
|
+
},
|
|
355
|
+
variant: {
|
|
356
|
+
type: "string",
|
|
357
|
+
enum: ["primary", "secondary", "outline", "ghost", "danger"],
|
|
358
|
+
description: "Visual style variant"
|
|
359
|
+
},
|
|
360
|
+
size: {
|
|
361
|
+
type: "string",
|
|
362
|
+
enum: ["sm", "md", "lg"],
|
|
363
|
+
description: "Button size"
|
|
364
|
+
},
|
|
365
|
+
disabled: {
|
|
366
|
+
type: "boolean",
|
|
367
|
+
description: "Whether the action is disabled"
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
required: ["label", "type", "action"]
|
|
371
|
+
},
|
|
372
|
+
examples: [],
|
|
373
|
+
limits: validation.DEFAULT_RESOURCE_LIMITS
|
|
374
|
+
};
|
|
375
|
+
const FooterRegistry = {
|
|
376
|
+
type: "footer",
|
|
377
|
+
name: "FooterSection",
|
|
378
|
+
description: "Footer section displaying execution metadata. Best for showing timing, model info, and source counts. Auto-injected by layouts when metadata is provided.",
|
|
379
|
+
schema: {
|
|
380
|
+
type: "object",
|
|
381
|
+
properties: {
|
|
382
|
+
poweredBy: {
|
|
383
|
+
type: "string",
|
|
384
|
+
description: "Powered by text (optional)"
|
|
385
|
+
},
|
|
386
|
+
executionTime: {
|
|
387
|
+
type: "number",
|
|
388
|
+
description: "Execution time in milliseconds"
|
|
389
|
+
},
|
|
390
|
+
model: {
|
|
391
|
+
type: "string",
|
|
392
|
+
description: "LLM model used"
|
|
393
|
+
},
|
|
394
|
+
sourceCount: {
|
|
395
|
+
type: "number",
|
|
396
|
+
description: "Number of sources used"
|
|
397
|
+
},
|
|
398
|
+
customText: {
|
|
399
|
+
type: "string",
|
|
400
|
+
description: "Custom footer text"
|
|
401
|
+
},
|
|
402
|
+
links: {
|
|
403
|
+
type: "array",
|
|
404
|
+
items: {
|
|
405
|
+
type: "object",
|
|
406
|
+
properties: {
|
|
407
|
+
label: { type: "string" },
|
|
408
|
+
url: { type: "string" }
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
description: "Footer links"
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
examples: [],
|
|
416
|
+
limits: {
|
|
417
|
+
maxDataPoints: 1,
|
|
418
|
+
maxTableRows: 1,
|
|
419
|
+
maxPayloadSize: 5 * 1024,
|
|
420
|
+
renderTimeout: 1e3
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
const CarouselRegistry = {
|
|
424
|
+
type: "carousel",
|
|
425
|
+
name: "Carousel",
|
|
426
|
+
description: "Horizontal carousel for displaying multiple items with snap scrolling and navigation buttons. Best for showcasing related content, image galleries, or card collections.",
|
|
427
|
+
schema: {
|
|
428
|
+
type: "object",
|
|
429
|
+
properties: {
|
|
430
|
+
items: {
|
|
431
|
+
type: "array",
|
|
432
|
+
items: { type: "object" },
|
|
433
|
+
description: "Array of UIComponents to display in carousel"
|
|
434
|
+
},
|
|
435
|
+
height: {
|
|
436
|
+
type: "string",
|
|
437
|
+
description: "Carousel height (optional)"
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
required: ["items"]
|
|
441
|
+
},
|
|
442
|
+
examples: [],
|
|
443
|
+
limits: validation.DEFAULT_RESOURCE_LIMITS
|
|
444
|
+
};
|
|
445
|
+
const ArtifactRegistry = {
|
|
446
|
+
type: "artifact",
|
|
447
|
+
name: "Artifact",
|
|
448
|
+
description: "Display downloadable artifacts like generated files or exports. Shows filename, size, and download button. Best for CSV exports, PDF reports, and generated documents.",
|
|
449
|
+
schema: {
|
|
450
|
+
type: "object",
|
|
451
|
+
properties: {
|
|
452
|
+
url: {
|
|
453
|
+
type: "string",
|
|
454
|
+
description: "Download URL for the artifact"
|
|
455
|
+
},
|
|
456
|
+
filename: {
|
|
457
|
+
type: "string",
|
|
458
|
+
description: "Display filename"
|
|
459
|
+
},
|
|
460
|
+
mimeType: {
|
|
461
|
+
type: "string",
|
|
462
|
+
description: 'MIME type (e.g., "text/csv", "application/pdf")'
|
|
463
|
+
},
|
|
464
|
+
size: {
|
|
465
|
+
type: "number",
|
|
466
|
+
description: "File size in bytes"
|
|
467
|
+
},
|
|
468
|
+
description: {
|
|
469
|
+
type: "string",
|
|
470
|
+
description: "Description of the artifact"
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
required: ["url", "filename", "mimeType"]
|
|
474
|
+
},
|
|
475
|
+
examples: [],
|
|
476
|
+
limits: {
|
|
477
|
+
maxDataPoints: 1,
|
|
478
|
+
maxTableRows: 1,
|
|
479
|
+
maxPayloadSize: 5 * 1024,
|
|
480
|
+
renderTimeout: 1e3
|
|
481
|
+
}
|
|
482
|
+
};
|
|
284
483
|
const ComponentRegistry = /* @__PURE__ */ new Map([
|
|
285
484
|
["chart", QuickchartRegistry],
|
|
286
485
|
["table", TableRegistry],
|
|
287
486
|
["metric", MetricRegistry],
|
|
288
|
-
["text", TextRegistry]
|
|
487
|
+
["text", TextRegistry],
|
|
488
|
+
// Sprint 4 additions
|
|
489
|
+
["grid", GridRegistry],
|
|
490
|
+
["action", ActionRegistry],
|
|
491
|
+
["footer", FooterRegistry],
|
|
492
|
+
["carousel", CarouselRegistry],
|
|
493
|
+
["artifact", ArtifactRegistry]
|
|
289
494
|
]);
|
|
495
|
+
exports.ActionRegistry = ActionRegistry;
|
|
496
|
+
exports.ArtifactRegistry = ArtifactRegistry;
|
|
497
|
+
exports.CarouselRegistry = CarouselRegistry;
|
|
290
498
|
exports.ComponentRegistry = ComponentRegistry;
|
|
499
|
+
exports.FooterRegistry = FooterRegistry;
|
|
500
|
+
exports.GridRegistry = GridRegistry;
|
|
291
501
|
exports.MetricRegistry = MetricRegistry;
|
|
292
502
|
exports.QuickchartRegistry = QuickchartRegistry;
|
|
293
503
|
exports.TableRegistry = TableRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-registry.cjs","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 * 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])\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[] } {\n const entry = getComponentEntry(componentType)\n if (!entry) {\n return { valid: false, errors: [`Unknown component 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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IACF;AAAA,EACF;AAAA,EAEF,QAAQ;AAAA,IACN,eAAe;AAAA,IACf,cAAc;AAAA,IACd,gBAAgB,IAAI;AAAA;AAAA,IACpB,eAAe;AAAA;AAAA,EAAA;AAEnB;AAKO,MAAM,eAAuC;AAAA,EAClD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aACE;AAAA,EACF,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,YAAY;AAAA,MACV,SAAS;AAAA,QACP,MAAM;AAAA,QACN,aAAa;AAAA,MAAA;AAAA,MAEf,UAAU;AAAA,QACR,MAAM;AAAA,QACN,aAAa;AAAA,MAAA;AAAA,MAEf,WAAW;AAAA,QACT,MAAM;AAAA,QACN,aAAa;AAAA,MAAA;AAAA,IACf;AAAA,IAEF,UAAU,CAAC,SAAS;AAAA,EAAA;AAAA,EAEtB,UAAU;AAAA,IACR;AAAA,MACE,OAAO;AAAA,MACP,WAAW;AAAA,QACT,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,UAAU,EAAE,UAAU,GAAG,SAAS,GAAA;AAAA,QAClC,QAAQ;AAAA,UACN,SACE;AAAA,QAAA;AAAA,MACJ;AAAA,IACF;AAAA,EACF;AAAA,EAEF,QAAQ;AAAA,IACN,eAAe;AAAA,IACf,cAAc;AAAA,IACd,gBAAgB,KAAK;AAAA;AAAA,IACrB,eAAe;AAAA;AAAA,EAAA;AAEnB;AAKO,MAAM,wCAAoE,IAAI;AAAA,EACnF,CAAC,SAAS,kBAAkB;AAAA,EAC5B,CAAC,SAAS,aAAa;AAAA,EACvB,CAAC,UAAU,cAAc;AAAA,EACzB,CAAC,QAAQ,YAAY;AACvB,CAAC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"component-registry.cjs","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 * 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])\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[] } {\n const entry = getComponentEntry(componentType)\n if (!entry) {\n return { valid: false, errors: [`Unknown component 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":["DEFAULT_RESOURCE_LIMITS"],"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,EAAE,MAAM,SAAA;AAAA,cAAS;AAAA,cAEhC,UAAU,CAAC,SAAS,MAAM;AAAA,YAAA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ntry;
|
|
|
23
23
|
* Text Component Registry Entry
|
|
24
24
|
*/
|
|
25
25
|
export declare const TextRegistry: ComponentRegistryEntry;
|
|
26
|
+
/**
|
|
27
|
+
* Grid Component Registry Entry
|
|
28
|
+
* Nested CSS Grid layout for organizing multiple components
|
|
29
|
+
*/
|
|
30
|
+
export declare const GridRegistry: ComponentRegistryEntry;
|
|
31
|
+
/**
|
|
32
|
+
* Action Component Registry Entry
|
|
33
|
+
* Interactive button or link that triggers tool calls
|
|
34
|
+
*/
|
|
35
|
+
export declare const ActionRegistry: ComponentRegistryEntry;
|
|
36
|
+
/**
|
|
37
|
+
* Footer Component Registry Entry
|
|
38
|
+
* Display execution metadata like timing and source count
|
|
39
|
+
*/
|
|
40
|
+
export declare const FooterRegistry: ComponentRegistryEntry;
|
|
41
|
+
/**
|
|
42
|
+
* Carousel Component Registry Entry
|
|
43
|
+
* Display multiple items with horizontal scrolling
|
|
44
|
+
*/
|
|
45
|
+
export declare const CarouselRegistry: ComponentRegistryEntry;
|
|
46
|
+
/**
|
|
47
|
+
* Artifact Component Registry Entry
|
|
48
|
+
* Display downloadable artifacts like generated files
|
|
49
|
+
*/
|
|
50
|
+
export declare const ArtifactRegistry: ComponentRegistryEntry;
|
|
26
51
|
/**
|
|
27
52
|
* Component Registry - All components indexed by type
|
|
28
53
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-registry.d.ts","sourceRoot":"","sources":["../../src/services/component-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGrE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,sBA0GhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,sBAqE3B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,sBA2D5B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,sBA2C1B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,GAAG,CAAC,aAAa,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"component-registry.d.ts","sourceRoot":"","sources":["../../src/services/component-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGrE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,sBA0GhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,sBAqE3B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,sBA2D5B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,sBA2C1B,CAAA;AAMD;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,sBAsC1B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,sBAqD5B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,sBAgD5B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,sBAsB9B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,sBAsC9B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,GAAG,CAAC,aAAa,EAAE,sBAAsB,CAWvE,CAAA;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,sBAAsB,GAAG,SAAS,CAEzF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,aAAa,EAAE,CAEtD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAc1C;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,GAAG,GACV;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAkBvC"}
|
|
@@ -279,14 +279,224 @@ const TextRegistry = {
|
|
|
279
279
|
// 1s
|
|
280
280
|
}
|
|
281
281
|
};
|
|
282
|
+
const GridRegistry = {
|
|
283
|
+
type: "grid",
|
|
284
|
+
name: "GridLayout",
|
|
285
|
+
description: "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.",
|
|
286
|
+
schema: {
|
|
287
|
+
type: "object",
|
|
288
|
+
properties: {
|
|
289
|
+
columns: {
|
|
290
|
+
type: "number",
|
|
291
|
+
description: "Number of columns (default: 12)"
|
|
292
|
+
},
|
|
293
|
+
gap: {
|
|
294
|
+
type: "string",
|
|
295
|
+
description: 'Gap between items (e.g., "1rem")'
|
|
296
|
+
},
|
|
297
|
+
minRowHeight: {
|
|
298
|
+
type: "string",
|
|
299
|
+
description: "Minimum row height (optional)"
|
|
300
|
+
},
|
|
301
|
+
areas: {
|
|
302
|
+
type: "array",
|
|
303
|
+
items: {
|
|
304
|
+
type: "array",
|
|
305
|
+
items: { type: "string" }
|
|
306
|
+
},
|
|
307
|
+
description: "CSS Grid template areas for named regions"
|
|
308
|
+
},
|
|
309
|
+
children: {
|
|
310
|
+
type: "array",
|
|
311
|
+
items: { type: "object" },
|
|
312
|
+
description: "Child UIComponents to render within the grid"
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
required: ["children"]
|
|
316
|
+
},
|
|
317
|
+
examples: [],
|
|
318
|
+
limits: DEFAULT_RESOURCE_LIMITS
|
|
319
|
+
};
|
|
320
|
+
const ActionRegistry = {
|
|
321
|
+
type: "action",
|
|
322
|
+
name: "ActionButton",
|
|
323
|
+
description: "Interactive button or link that triggers tool calls or navigation. Best for user interactions, form submissions, and workflow triggers.",
|
|
324
|
+
schema: {
|
|
325
|
+
type: "object",
|
|
326
|
+
properties: {
|
|
327
|
+
label: {
|
|
328
|
+
type: "string",
|
|
329
|
+
description: "Button text"
|
|
330
|
+
},
|
|
331
|
+
type: {
|
|
332
|
+
type: "string",
|
|
333
|
+
enum: ["button", "link"],
|
|
334
|
+
description: "Render as button or link"
|
|
335
|
+
},
|
|
336
|
+
action: {
|
|
337
|
+
type: "string",
|
|
338
|
+
enum: ["tool-call", "link", "submit"],
|
|
339
|
+
description: "Action type to perform"
|
|
340
|
+
},
|
|
341
|
+
toolName: {
|
|
342
|
+
type: "string",
|
|
343
|
+
description: "Tool name to call (for tool-call action)"
|
|
344
|
+
},
|
|
345
|
+
params: {
|
|
346
|
+
type: "object",
|
|
347
|
+
description: "Parameters to pass to the tool"
|
|
348
|
+
},
|
|
349
|
+
url: {
|
|
350
|
+
type: "string",
|
|
351
|
+
description: "URL for link action"
|
|
352
|
+
},
|
|
353
|
+
variant: {
|
|
354
|
+
type: "string",
|
|
355
|
+
enum: ["primary", "secondary", "outline", "ghost", "danger"],
|
|
356
|
+
description: "Visual style variant"
|
|
357
|
+
},
|
|
358
|
+
size: {
|
|
359
|
+
type: "string",
|
|
360
|
+
enum: ["sm", "md", "lg"],
|
|
361
|
+
description: "Button size"
|
|
362
|
+
},
|
|
363
|
+
disabled: {
|
|
364
|
+
type: "boolean",
|
|
365
|
+
description: "Whether the action is disabled"
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
required: ["label", "type", "action"]
|
|
369
|
+
},
|
|
370
|
+
examples: [],
|
|
371
|
+
limits: DEFAULT_RESOURCE_LIMITS
|
|
372
|
+
};
|
|
373
|
+
const FooterRegistry = {
|
|
374
|
+
type: "footer",
|
|
375
|
+
name: "FooterSection",
|
|
376
|
+
description: "Footer section displaying execution metadata. Best for showing timing, model info, and source counts. Auto-injected by layouts when metadata is provided.",
|
|
377
|
+
schema: {
|
|
378
|
+
type: "object",
|
|
379
|
+
properties: {
|
|
380
|
+
poweredBy: {
|
|
381
|
+
type: "string",
|
|
382
|
+
description: "Powered by text (optional)"
|
|
383
|
+
},
|
|
384
|
+
executionTime: {
|
|
385
|
+
type: "number",
|
|
386
|
+
description: "Execution time in milliseconds"
|
|
387
|
+
},
|
|
388
|
+
model: {
|
|
389
|
+
type: "string",
|
|
390
|
+
description: "LLM model used"
|
|
391
|
+
},
|
|
392
|
+
sourceCount: {
|
|
393
|
+
type: "number",
|
|
394
|
+
description: "Number of sources used"
|
|
395
|
+
},
|
|
396
|
+
customText: {
|
|
397
|
+
type: "string",
|
|
398
|
+
description: "Custom footer text"
|
|
399
|
+
},
|
|
400
|
+
links: {
|
|
401
|
+
type: "array",
|
|
402
|
+
items: {
|
|
403
|
+
type: "object",
|
|
404
|
+
properties: {
|
|
405
|
+
label: { type: "string" },
|
|
406
|
+
url: { type: "string" }
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
description: "Footer links"
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
examples: [],
|
|
414
|
+
limits: {
|
|
415
|
+
maxDataPoints: 1,
|
|
416
|
+
maxTableRows: 1,
|
|
417
|
+
maxPayloadSize: 5 * 1024,
|
|
418
|
+
renderTimeout: 1e3
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
const CarouselRegistry = {
|
|
422
|
+
type: "carousel",
|
|
423
|
+
name: "Carousel",
|
|
424
|
+
description: "Horizontal carousel for displaying multiple items with snap scrolling and navigation buttons. Best for showcasing related content, image galleries, or card collections.",
|
|
425
|
+
schema: {
|
|
426
|
+
type: "object",
|
|
427
|
+
properties: {
|
|
428
|
+
items: {
|
|
429
|
+
type: "array",
|
|
430
|
+
items: { type: "object" },
|
|
431
|
+
description: "Array of UIComponents to display in carousel"
|
|
432
|
+
},
|
|
433
|
+
height: {
|
|
434
|
+
type: "string",
|
|
435
|
+
description: "Carousel height (optional)"
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
required: ["items"]
|
|
439
|
+
},
|
|
440
|
+
examples: [],
|
|
441
|
+
limits: DEFAULT_RESOURCE_LIMITS
|
|
442
|
+
};
|
|
443
|
+
const ArtifactRegistry = {
|
|
444
|
+
type: "artifact",
|
|
445
|
+
name: "Artifact",
|
|
446
|
+
description: "Display downloadable artifacts like generated files or exports. Shows filename, size, and download button. Best for CSV exports, PDF reports, and generated documents.",
|
|
447
|
+
schema: {
|
|
448
|
+
type: "object",
|
|
449
|
+
properties: {
|
|
450
|
+
url: {
|
|
451
|
+
type: "string",
|
|
452
|
+
description: "Download URL for the artifact"
|
|
453
|
+
},
|
|
454
|
+
filename: {
|
|
455
|
+
type: "string",
|
|
456
|
+
description: "Display filename"
|
|
457
|
+
},
|
|
458
|
+
mimeType: {
|
|
459
|
+
type: "string",
|
|
460
|
+
description: 'MIME type (e.g., "text/csv", "application/pdf")'
|
|
461
|
+
},
|
|
462
|
+
size: {
|
|
463
|
+
type: "number",
|
|
464
|
+
description: "File size in bytes"
|
|
465
|
+
},
|
|
466
|
+
description: {
|
|
467
|
+
type: "string",
|
|
468
|
+
description: "Description of the artifact"
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
required: ["url", "filename", "mimeType"]
|
|
472
|
+
},
|
|
473
|
+
examples: [],
|
|
474
|
+
limits: {
|
|
475
|
+
maxDataPoints: 1,
|
|
476
|
+
maxTableRows: 1,
|
|
477
|
+
maxPayloadSize: 5 * 1024,
|
|
478
|
+
renderTimeout: 1e3
|
|
479
|
+
}
|
|
480
|
+
};
|
|
282
481
|
const ComponentRegistry = /* @__PURE__ */ new Map([
|
|
283
482
|
["chart", QuickchartRegistry],
|
|
284
483
|
["table", TableRegistry],
|
|
285
484
|
["metric", MetricRegistry],
|
|
286
|
-
["text", TextRegistry]
|
|
485
|
+
["text", TextRegistry],
|
|
486
|
+
// Sprint 4 additions
|
|
487
|
+
["grid", GridRegistry],
|
|
488
|
+
["action", ActionRegistry],
|
|
489
|
+
["footer", FooterRegistry],
|
|
490
|
+
["carousel", CarouselRegistry],
|
|
491
|
+
["artifact", ArtifactRegistry]
|
|
287
492
|
]);
|
|
288
493
|
export {
|
|
494
|
+
ActionRegistry,
|
|
495
|
+
ArtifactRegistry,
|
|
496
|
+
CarouselRegistry,
|
|
289
497
|
ComponentRegistry,
|
|
498
|
+
FooterRegistry,
|
|
499
|
+
GridRegistry,
|
|
290
500
|
MetricRegistry,
|
|
291
501
|
QuickchartRegistry,
|
|
292
502
|
TableRegistry,
|