@seed-ship/mcp-ui-solid 1.2.2 → 1.2.6

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 CHANGED
@@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.2.6] - 2025-11-26
9
+
10
+ ### Fixed - Sprint 12: Component Rendering (tagged release)
11
+ - **CarouselRenderer**: Now actually rendered in UIResourceRenderer's ComponentRenderer
12
+ - **ArtifactRenderer**: Now actually rendered in UIResourceRenderer's ComponentRenderer
13
+ - Components were previously exported and registered but not rendered in the main switch
14
+ - Fixed props mapping for both components
15
+
16
+ ## [1.2.5] - 2025-11-26
17
+
18
+ ### Fixed - Sprint 12: Component Rendering (re-release)
19
+ - **CarouselRenderer**: Now actually rendered in UIResourceRenderer's ComponentRenderer
20
+ - **ArtifactRenderer**: Now actually rendered in UIResourceRenderer's ComponentRenderer
21
+ - Components were previously exported and registered but not rendered in the main switch
22
+ - Fixed props mapping for both components
23
+
24
+ ## [1.2.4] - 2025-11-26
25
+
26
+ ### Note
27
+ - Skipped due to npm publish issue (version already existed)
28
+
29
+ ## [1.2.3] - 2025-11-26
30
+
31
+ ### Fixed - Sprint 9: UI Fixes
32
+ - **ErrorCardRenderer**: Added for proper error display
33
+ - **UIResource vs UILayout routing**: Fixed validation routing
34
+ - **auto-layout.ts**: Fixed label → title property mapping
35
+
8
36
  ## [1.2.2] - 2025-11-26
9
37
 
10
38
  ### Added - Sprint 4: Public Exports & Registry
@@ -7,9 +7,11 @@ const validation = require("../services/validation.cjs");
7
7
  const GenerativeUIErrorBoundary = require("./GenerativeUIErrorBoundary.cjs");
8
8
  const GridRenderer = require("./GridRenderer.cjs");
9
9
  const FooterRenderer = require("./FooterRenderer.cjs");
10
+ const CarouselRenderer = require("./CarouselRenderer.cjs");
11
+ const ArtifactRenderer = require("./ArtifactRenderer.cjs");
10
12
  const useAction = require("../hooks/useAction.cjs");
11
13
  const marked_esm = require("../node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.cjs");
12
- var _tmpl$ = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button>`), _tmpl$3 = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$5 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$6 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$7 = /* @__PURE__ */ web.template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"><img alt="Chart visualization"class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$8 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$9 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$0 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden group"><!$><!/><div class=p-4><!$><!/><div class=overflow-x-auto><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-50 dark:bg-gray-900/50"><tr></tr></thead><tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700"></tbody></table></div><!$><!/>`), _tmpl$1 = /* @__PURE__ */ web.template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6">`), _tmpl$10 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$11 = /* @__PURE__ */ web.template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$12 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$13 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$14 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$15 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$16 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$17 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$18 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$19 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"sandbox="allow-scripts allow-same-origin allow-popups allow-forms"loading=lazy>`, true, false, false), _tmpl$20 = /* @__PURE__ */ web.template(`<div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$21 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$22 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$23 = /* @__PURE__ */ web.template(`<a target=_blank rel="noopener noreferrer"class="flex items-center gap-3 p-4 bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors group h-full"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$24 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$25 = /* @__PURE__ */ web.template(`<span>`), _tmpl$26 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$27 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full">`), _tmpl$28 = /* @__PURE__ */ web.template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$29 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$30 = /* @__PURE__ */ web.template(`<div>`);
14
+ var _tmpl$ = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button>`), _tmpl$3 = /* @__PURE__ */ web.template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$5 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$6 = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$7 = /* @__PURE__ */ web.template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"><img alt="Chart visualization"class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$8 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$9 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$0 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden group"><!$><!/><div class=p-4><!$><!/><div class=overflow-x-auto><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-50 dark:bg-gray-900/50"><tr></tr></thead><tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700"></tbody></table></div><!$><!/>`), _tmpl$1 = /* @__PURE__ */ web.template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6">`), _tmpl$10 = /* @__PURE__ */ web.template(`<tr>`), _tmpl$11 = /* @__PURE__ */ web.template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$12 = /* @__PURE__ */ web.template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$13 = /* @__PURE__ */ web.template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$14 = /* @__PURE__ */ web.template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$15 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$16 = /* @__PURE__ */ web.template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$17 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$18 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$19 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"sandbox="allow-scripts allow-same-origin allow-popups allow-forms"loading=lazy>`, true, false, false), _tmpl$20 = /* @__PURE__ */ web.template(`<div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$21 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$22 = /* @__PURE__ */ web.template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$23 = /* @__PURE__ */ web.template(`<a target=_blank rel="noopener noreferrer"class="flex items-center gap-3 p-4 bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors group h-full"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$24 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$25 = /* @__PURE__ */ web.template(`<span>`), _tmpl$26 = /* @__PURE__ */ web.template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$27 = /* @__PURE__ */ web.template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full">`), _tmpl$28 = /* @__PURE__ */ web.template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$29 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$30 = /* @__PURE__ */ web.template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$31 = /* @__PURE__ */ web.template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$32 = /* @__PURE__ */ web.template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$33 = /* @__PURE__ */ web.template(`<li>`), _tmpl$34 = /* @__PURE__ */ web.template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$35 = /* @__PURE__ */ web.template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$36 = /* @__PURE__ */ web.template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$37 = /* @__PURE__ */ web.template(`<div>`);
13
15
  function CopyButton(props) {
14
16
  const [copied, setCopied] = solidJs.createSignal(false);
15
17
  const handleCopy = async () => {
@@ -597,6 +599,33 @@ function ComponentRenderer(props) {
597
599
  }
598
600
  });
599
601
  }
602
+ }), web.createComponent(solidJs.Show, {
603
+ get when() {
604
+ return props.component.type === "carousel";
605
+ },
606
+ get children() {
607
+ return web.createComponent(CarouselRenderer.CarouselRenderer, {
608
+ get items() {
609
+ var _a2;
610
+ return ((_a2 = props.component.params) == null ? void 0 : _a2.items) || [];
611
+ },
612
+ get height() {
613
+ var _a2;
614
+ return (_a2 = props.component.params) == null ? void 0 : _a2.height;
615
+ }
616
+ });
617
+ }
618
+ }), web.createComponent(solidJs.Show, {
619
+ get when() {
620
+ return props.component.type === "artifact";
621
+ },
622
+ get children() {
623
+ return web.createComponent(ArtifactRenderer.ArtifactRenderer, {
624
+ get params() {
625
+ return props.component.params;
626
+ }
627
+ });
628
+ }
600
629
  })];
601
630
  }
602
631
  });
@@ -685,7 +714,113 @@ function ActionRenderer(props) {
685
714
  return _el$115;
686
715
  })();
687
716
  }
717
+ function ErrorCardRenderer(props) {
718
+ const getErrorText = () => {
719
+ return `Error in ${props.error.tool || "unknown tool"}: ${props.error.message || "Unknown error"}`;
720
+ };
721
+ return (() => {
722
+ var _el$124 = web.getNextElement(_tmpl$32), _el$147 = _el$124.firstChild, [_el$148, _co$29] = web.getNextMarker(_el$147.nextSibling), _el$125 = _el$148.nextSibling, _el$126 = _el$125.firstChild, _el$127 = _el$126.nextSibling, _el$128 = _el$127.firstChild, _el$129 = _el$128.firstChild, _el$130 = _el$129.nextSibling, [_el$131, _co$24] = web.getNextMarker(_el$130.nextSibling), _el$132 = _el$128.nextSibling, _el$141 = _el$132.nextSibling, [_el$142, _co$26] = web.getNextMarker(_el$141.nextSibling), _el$143 = _el$142.nextSibling, [_el$144, _co$27] = web.getNextMarker(_el$143.nextSibling), _el$145 = _el$144.nextSibling, [_el$146, _co$28] = web.getNextMarker(_el$145.nextSibling);
723
+ web.insert(_el$124, web.createComponent(CopyButton, {
724
+ getText: getErrorText,
725
+ title: "Copy error details",
726
+ position: "top-right"
727
+ }), _el$148, _co$29);
728
+ web.insert(_el$128, () => props.error.tool || "Unknown", _el$131, _co$24);
729
+ web.insert(_el$132, () => props.error.message || "An error occurred during tool execution");
730
+ web.insert(_el$127, web.createComponent(solidJs.Show, {
731
+ get when() {
732
+ return props.error.type;
733
+ },
734
+ get children() {
735
+ var _el$133 = web.getNextElement(_tmpl$29), _el$134 = _el$133.firstChild, _el$135 = _el$134.nextSibling, [_el$136, _co$25] = web.getNextMarker(_el$135.nextSibling);
736
+ web.insert(_el$133, () => props.error.type, _el$136, _co$25);
737
+ return _el$133;
738
+ }
739
+ }), _el$142, _co$26);
740
+ web.insert(_el$127, web.createComponent(solidJs.Show, {
741
+ get when() {
742
+ var _a;
743
+ return (_a = props.error.suggestions) == null ? void 0 : _a.length;
744
+ },
745
+ get children() {
746
+ var _el$137 = web.getNextElement(_tmpl$30), _el$138 = _el$137.firstChild, _el$139 = _el$138.nextSibling;
747
+ web.insert(_el$139, web.createComponent(solidJs.For, {
748
+ get each() {
749
+ return props.error.suggestions;
750
+ },
751
+ children: (suggestion) => (() => {
752
+ var _el$149 = web.getNextElement(_tmpl$33);
753
+ web.insert(_el$149, suggestion);
754
+ return _el$149;
755
+ })()
756
+ }));
757
+ return _el$137;
758
+ }
759
+ }), _el$144, _co$27);
760
+ web.insert(_el$127, web.createComponent(solidJs.Show, {
761
+ get when() {
762
+ return props.error.timestamp;
763
+ },
764
+ get children() {
765
+ var _el$140 = web.getNextElement(_tmpl$31);
766
+ web.insert(_el$140, () => new Date(props.error.timestamp).toLocaleString());
767
+ return _el$140;
768
+ }
769
+ }), _el$146, _co$28);
770
+ return _el$124;
771
+ })();
772
+ }
773
+ function isErrorResponse(content) {
774
+ return content && typeof content === "object" && content.error === true;
775
+ }
776
+ function isUIResource(content) {
777
+ var _a, _b, _c;
778
+ return content && typeof content === "object" && (((_a = content.uri) == null ? void 0 : _a.startsWith("ui://")) || ((_b = content.content) == null ? void 0 : _b.type) === "rawHtml" || ((_c = content.content) == null ? void 0 : _c.htmlString));
779
+ }
780
+ function UIResourceHtmlRenderer(props) {
781
+ const htmlContent = () => {
782
+ var _a;
783
+ if ((_a = props.resource.content) == null ? void 0 : _a.htmlString) {
784
+ return purify_es.sanitize(props.resource.content.htmlString);
785
+ }
786
+ return "";
787
+ };
788
+ const resourceTitle = () => {
789
+ var _a, _b;
790
+ return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || ((_b = props.resource.uri) == null ? void 0 : _b.replace("ui://deposium/", "")) || "Resource";
791
+ };
792
+ return (() => {
793
+ var _el$150 = web.getNextElement(_tmpl$35), _el$154 = _el$150.firstChild, [_el$155, _co$30] = web.getNextMarker(_el$154.nextSibling), _el$153 = _el$155.nextSibling;
794
+ web.insert(_el$150, web.createComponent(solidJs.Show, {
795
+ get when() {
796
+ var _a;
797
+ return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || props.resource.uri;
798
+ },
799
+ get children() {
800
+ var _el$151 = web.getNextElement(_tmpl$34), _el$152 = _el$151.firstChild;
801
+ web.insert(_el$152, resourceTitle);
802
+ return _el$151;
803
+ }
804
+ }), _el$155, _co$30);
805
+ web.effect(() => web.setProperty(_el$153, "innerHTML", htmlContent()));
806
+ return _el$150;
807
+ })();
808
+ }
688
809
  const UIResourceRenderer = (props) => {
810
+ if (isErrorResponse(props.content)) {
811
+ return web.createComponent(ErrorCardRenderer, {
812
+ get error() {
813
+ return props.content;
814
+ }
815
+ });
816
+ }
817
+ if (isUIResource(props.content)) {
818
+ return web.createComponent(UIResourceHtmlRenderer, {
819
+ get resource() {
820
+ return props.content;
821
+ }
822
+ });
823
+ }
689
824
  const layout = () => {
690
825
  if ("type" in props.content && props.content.type !== "composite") {
691
826
  return {
@@ -742,24 +877,24 @@ const UIResourceRenderer = (props) => {
742
877
  });
743
878
  const layoutData = layout();
744
879
  return (() => {
745
- var _el$124 = web.getNextElement(_tmpl$29), _el$125 = _el$124.firstChild, _el$126 = _el$125.nextSibling, [_el$127, _co$24] = web.getNextMarker(_el$126.nextSibling);
746
- web.insert(_el$125, web.createComponent(solidJs.For, {
880
+ var _el$156 = web.getNextElement(_tmpl$36), _el$157 = _el$156.firstChild, _el$158 = _el$157.nextSibling, [_el$159, _co$31] = web.getNextMarker(_el$158.nextSibling);
881
+ web.insert(_el$157, web.createComponent(solidJs.For, {
747
882
  get each() {
748
883
  return layoutData.components;
749
884
  },
750
885
  children: (component) => (() => {
751
- var _el$128 = web.getNextElement(_tmpl$30);
752
- web.insert(_el$128, web.createComponent(ComponentRenderer, {
886
+ var _el$160 = web.getNextElement(_tmpl$37);
887
+ web.insert(_el$160, web.createComponent(ComponentRenderer, {
753
888
  component,
754
889
  get onError() {
755
890
  return props.onError;
756
891
  }
757
892
  }));
758
- web.effect((_$p) => web.style(_el$128, getGridStyleString(component), _$p));
759
- return _el$128;
893
+ web.effect((_$p) => web.style(_el$160, getGridStyleString(component), _$p));
894
+ return _el$160;
760
895
  })()
761
896
  }));
762
- web.insert(_el$124, web.createComponent(solidJs.Show, {
897
+ web.insert(_el$156, web.createComponent(solidJs.Show, {
763
898
  get when() {
764
899
  return shouldShowAutoFooter();
765
900
  },
@@ -770,17 +905,17 @@ const UIResourceRenderer = (props) => {
770
905
  }
771
906
  });
772
907
  }
773
- }), _el$127, _co$24);
908
+ }), _el$159, _co$31);
774
909
  web.effect((_p$) => {
775
910
  var _v$18 = `w-full ${props.class || ""}`, _v$19 = gridContainerStyle();
776
- _v$18 !== _p$.e && web.className(_el$124, _p$.e = _v$18);
777
- _p$.t = web.style(_el$125, _v$19, _p$.t);
911
+ _v$18 !== _p$.e && web.className(_el$156, _p$.e = _v$18);
912
+ _p$.t = web.style(_el$157, _v$19, _p$.t);
778
913
  return _p$;
779
914
  }, {
780
915
  e: void 0,
781
916
  t: void 0
782
917
  });
783
- return _el$124;
918
+ return _el$156;
784
919
  })();
785
920
  };
786
921
  web.delegateEvents(["click"]);