@seed-ship/mcp-ui-solid 1.0.18 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/components/ActionRenderer.d.ts +10 -0
  2. package/dist/components/ActionRenderer.d.ts.map +1 -0
  3. package/dist/components/ArtifactRenderer.d.ts +12 -0
  4. package/dist/components/ArtifactRenderer.d.ts.map +1 -0
  5. package/dist/components/CarouselRenderer.d.ts +9 -0
  6. package/dist/components/CarouselRenderer.d.ts.map +1 -0
  7. package/dist/components/FooterRenderer.d.ts +16 -0
  8. package/dist/components/FooterRenderer.d.ts.map +1 -0
  9. package/dist/components/UIResourceRenderer.d.ts.map +1 -1
  10. package/dist/mcp-ui-solid/src/components/GenerativeUIErrorBoundary.cjs +35 -18
  11. package/dist/mcp-ui-solid/src/components/GenerativeUIErrorBoundary.cjs.map +1 -1
  12. package/dist/mcp-ui-solid/src/components/GenerativeUIErrorBoundary.js +36 -19
  13. package/dist/mcp-ui-solid/src/components/GenerativeUIErrorBoundary.js.map +1 -1
  14. package/dist/mcp-ui-solid/src/components/StreamingUIRenderer.cjs +192 -103
  15. package/dist/mcp-ui-solid/src/components/StreamingUIRenderer.cjs.map +1 -1
  16. package/dist/mcp-ui-solid/src/components/StreamingUIRenderer.js +193 -104
  17. package/dist/mcp-ui-solid/src/components/StreamingUIRenderer.js.map +1 -1
  18. package/dist/mcp-ui-solid/src/components/UIResourceRenderer.cjs +359 -119
  19. package/dist/mcp-ui-solid/src/components/UIResourceRenderer.cjs.map +1 -1
  20. package/dist/mcp-ui-solid/src/components/UIResourceRenderer.js +360 -120
  21. package/dist/mcp-ui-solid/src/components/UIResourceRenderer.js.map +1 -1
  22. package/dist/mcp-ui-solid/src/services/validation.cjs +10 -0
  23. package/dist/mcp-ui-solid/src/services/validation.cjs.map +1 -1
  24. package/dist/mcp-ui-solid/src/services/validation.js +10 -0
  25. package/dist/mcp-ui-solid/src/services/validation.js.map +1 -1
  26. package/dist/services/validation.d.ts.map +1 -1
  27. package/dist/types/index.d.ts +17 -2
  28. package/dist/types/index.d.ts.map +1 -1
  29. package/package.json +1 -1
@@ -0,0 +1,10 @@
1
+ import { Component } from 'solid-js';
2
+ type ActionSpec = any;
3
+ export interface ActionRendererProps {
4
+ action: ActionSpec;
5
+ onExecute: (toolName: string, params: any) => Promise<any>;
6
+ disabled?: boolean;
7
+ }
8
+ export declare const ActionRenderer: Component<ActionRendererProps>;
9
+ export {};
10
+ //# sourceMappingURL=ActionRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionRenderer.d.ts","sourceRoot":"","sources":["../../src/components/ActionRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,MAAM,UAAU,CAAA;AAE1C,KAAK,UAAU,GAAG,GAAG,CAAA;AAErB,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,UAAU,CAAA;IAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,mBAAmB,CAsBzD,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { Component } from 'solid-js';
2
+ export interface ArtifactComponentParams {
3
+ url: string;
4
+ filename: string;
5
+ mimeType: string;
6
+ size?: number;
7
+ description?: string;
8
+ }
9
+ export declare const ArtifactRenderer: Component<{
10
+ params: ArtifactComponentParams;
11
+ }>;
12
+ //# sourceMappingURL=ArtifactRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArtifactRenderer.d.ts","sourceRoot":"","sources":["../../src/components/ArtifactRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,uBAAuB;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC;IAAE,MAAM,EAAE,uBAAuB,CAAA;CAAE,CA2C3E,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { Component } from 'solid-js';
2
+ type UIComponent = any;
3
+ export interface CarouselRendererProps {
4
+ items: UIComponent[];
5
+ height?: string;
6
+ }
7
+ export declare const CarouselRenderer: Component<CarouselRendererProps>;
8
+ export {};
9
+ //# sourceMappingURL=CarouselRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CarouselRenderer.d.ts","sourceRoot":"","sources":["../../src/components/CarouselRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,UAAU,CAAA;AAIvD,KAAK,WAAW,GAAG,GAAG,CAAA;AAEtB,MAAM,WAAW,qBAAqB;IAClC,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC,qBAAqB,CAgE7D,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { Component } from 'solid-js';
2
+ export interface FooterComponentParams {
3
+ poweredBy?: string;
4
+ executionTime?: number;
5
+ model?: string;
6
+ sourceCount?: number;
7
+ customText?: string;
8
+ links?: {
9
+ label: string;
10
+ url: string;
11
+ }[];
12
+ }
13
+ export declare const FooterRenderer: Component<{
14
+ params: FooterComponentParams;
15
+ }>;
16
+ //# sourceMappingURL=FooterRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FooterRenderer.d.ts","sourceRoot":"","sources":["../../src/components/FooterRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,UAAU,CAAA;AAE/C,MAAM,WAAW,qBAAqB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC3C;AAED,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC;IAAE,MAAM,EAAE,qBAAqB,CAAA;CAAE,CAsDvE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"UIResourceRenderer.d.ts","sourceRoot":"","sources":["../../src/components/UIResourceRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAgD,MAAM,UAAU,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAiB,MAAM,UAAU,CAAA;AAKnF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,OAAO,EAAE,WAAW,GAAG,QAAQ,CAAA;IAE/B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IAExC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAmYD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,uBAAuB,CAiEjE,CAAA"}
1
+ {"version":3,"file":"UIResourceRenderer.d.ts","sourceRoot":"","sources":["../../src/components/UIResourceRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAgD,MAAM,UAAU,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAiB,MAAM,UAAU,CAAA;AAKnF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,OAAO,EAAE,WAAW,GAAG,QAAQ,CAAA;IAE/B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IAExC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AA2cD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,uBAAuB,CAiEjE,CAAA"}
@@ -3,25 +3,41 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const web = require("solid-js/web");
4
4
  const solidJs = require("solid-js");
5
5
  const logger$1 = require("../utils/logger.cjs");
6
- var _tmpl$ = ["<p", ' class="text-xs text-yellow-600 dark:text-yellow-400 mt-2 font-mono">', "</p>"], _tmpl$2 = ["<button", ' class="mt-3 text-xs font-medium text-yellow-800 dark:text-yellow-200 hover:text-yellow-900 dark:hover:text-yellow-100 underline">Retry Rendering</button>'], _tmpl$3 = ["<div", ' class="w-full h-full bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4"><div class="flex items-start gap-3"><div class="flex-shrink-0"><svg class="w-5 h-5 text-yellow-600 dark:text-yellow-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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"><p class="text-sm font-medium text-yellow-900 dark:text-yellow-100">Component Failed to Render</p><p class="text-xs text-yellow-700 dark:text-yellow-300 mt-1">Type: <!--$-->', "<!--/--> | ID: <!--$-->", "<!--/-->...</p><!--$-->", "<!--/--><!--$-->", "<!--/--></div></div></div>"];
6
+ var _tmpl$ = /* @__PURE__ */ web.template(`<p class="text-xs text-yellow-600 dark:text-yellow-400 mt-2 font-mono">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button class="mt-3 text-xs font-medium text-yellow-800 dark:text-yellow-200 hover:text-yellow-900 dark:hover:text-yellow-100 underline">Retry Rendering`), _tmpl$3 = /* @__PURE__ */ web.template(`<div class="w-full h-full bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4"><div class="flex items-start gap-3"><div class=flex-shrink-0><svg class="w-5 h-5 text-yellow-600 dark:text-yellow-400"fill=none stroke=currentColor viewBox="0 0 24 24"><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"><p class="text-sm font-medium text-yellow-900 dark:text-yellow-100">Component Failed to Render</p><p class="text-xs text-yellow-700 dark:text-yellow-300 mt-1">Type: <!$><!/> | ID: <!$><!/>...</p><!$><!/><!$><!/>`);
7
7
  const logger = logger$1.createLogger("generative-ui");
8
8
  function DefaultErrorFallback(props) {
9
- var _a;
10
- return web.ssr(_tmpl$3, web.ssrHydrationKey(), web.escape(props.componentType) || "unknown", web.escape((_a = props.componentId) == null ? void 0 : _a.slice(0, 8)) || "unknown", web.escape(web.createComponent(solidJs.Show, {
11
- get when() {
12
- return false;
13
- },
14
- get children() {
15
- return web.ssr(_tmpl$, web.ssrHydrationKey(), web.escape(props.error.message));
16
- }
17
- })), web.escape(web.createComponent(solidJs.Show, {
18
- get when() {
19
- return props.allowRetry;
20
- },
21
- get children() {
22
- return web.ssr(_tmpl$2, web.ssrHydrationKey());
23
- }
24
- })));
9
+ return (() => {
10
+ var _el$ = web.getNextElement(_tmpl$3), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild, _el$0 = _el$7.nextSibling, [_el$1, _co$] = web.getNextMarker(_el$0.nextSibling), _el$8 = _el$1.nextSibling, _el$10 = _el$8.nextSibling, [_el$11, _co$2] = web.getNextMarker(_el$10.nextSibling);
11
+ _el$11.nextSibling;
12
+ var _el$14 = _el$6.nextSibling, [_el$15, _co$3] = web.getNextMarker(_el$14.nextSibling), _el$16 = _el$15.nextSibling, [_el$17, _co$4] = web.getNextMarker(_el$16.nextSibling);
13
+ web.insert(_el$6, () => props.componentType || "unknown", _el$1, _co$);
14
+ web.insert(_el$6, () => {
15
+ var _a;
16
+ return ((_a = props.componentId) == null ? void 0 : _a.slice(0, 8)) || "unknown";
17
+ }, _el$11, _co$2);
18
+ web.insert(_el$4, web.createComponent(solidJs.Show, {
19
+ get when() {
20
+ return false;
21
+ },
22
+ get children() {
23
+ var _el$12 = web.getNextElement(_tmpl$);
24
+ web.insert(_el$12, () => props.error.message);
25
+ return _el$12;
26
+ }
27
+ }), _el$15, _co$3);
28
+ web.insert(_el$4, web.createComponent(solidJs.Show, {
29
+ get when() {
30
+ return props.allowRetry;
31
+ },
32
+ get children() {
33
+ var _el$13 = web.getNextElement(_tmpl$2);
34
+ web.addEventListener(_el$13, "click", props.onRetry, true);
35
+ web.runHydrationEvents();
36
+ return _el$13;
37
+ }
38
+ }), _el$17, _co$4);
39
+ return _el$;
40
+ })();
25
41
  }
26
42
  const GenerativeUIErrorBoundary = (props) => {
27
43
  const [retryKey, setRetryKey] = solidJs.createSignal(0);
@@ -86,10 +102,11 @@ const GenerativeUIErrorBoundary = (props) => {
86
102
  get children() {
87
103
  return (() => {
88
104
  retryKey();
89
- return props.children;
105
+ return web.memo(() => props.children);
90
106
  })();
91
107
  }
92
108
  });
93
109
  };
110
+ web.delegateEvents(["click"]);
94
111
  exports.GenerativeUIErrorBoundary = GenerativeUIErrorBoundary;
95
112
  //# sourceMappingURL=GenerativeUIErrorBoundary.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenerativeUIErrorBoundary.cjs","sources":["../../../../src/components/GenerativeUIErrorBoundary.tsx"],"sourcesContent":["/**\n * Generative UI Error Boundary with Telemetry\n * Phase 0: Error isolation + structured logging\n *\n * Features:\n * - Component-level error isolation\n * - Structured logging with context\n * - Performance timing\n * - Retry mechanism\n * - User-friendly fallback UI\n */\n\nimport { Component, ErrorBoundary, createSignal, Show } from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport { createLogger } from '../utils/logger'\nimport type { RendererError } from '../types'\n\nconst logger = createLogger('generative-ui')\n\n/**\n * Props for GenerativeUIErrorBoundary\n */\nexport interface GenerativeUIErrorBoundaryProps {\n /**\n * Component identifier for telemetry\n */\n componentId: string\n\n /**\n * Component type for context\n */\n componentType: string\n\n /**\n * Error callback\n */\n onError?: (error: RendererError) => void\n\n /**\n * Allow retry on error\n */\n allowRetry?: boolean\n\n /**\n * Child components to wrap\n */\n children: any\n\n /**\n * Custom fallback UI (optional)\n */\n fallback?: (error: Error, retry?: () => void) => any\n}\n\n/**\n * Default fallback UI for errors\n */\nfunction DefaultErrorFallback(props: {\n error: Error\n componentId: string\n componentType: string\n allowRetry?: boolean\n onRetry?: () => void\n}) {\n return (\n <div class=\"w-full h-full bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4\">\n <div class=\"flex items-start gap-3\">\n <div class=\"flex-shrink-0\">\n <svg\n class=\"w-5 h-5 text-yellow-600 dark:text-yellow-400\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n 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\"\n />\n </svg>\n </div>\n <div class=\"flex-1 min-w-0\">\n <p class=\"text-sm font-medium text-yellow-900 dark:text-yellow-100\">\n Component Failed to Render\n </p>\n <p class=\"text-xs text-yellow-700 dark:text-yellow-300 mt-1\">\n Type: {props.componentType || 'unknown'} | ID: {props.componentId?.slice(0, 8) || 'unknown'}...\n </p>\n <Show when={import.meta.env.DEV}>\n <p class=\"text-xs text-yellow-600 dark:text-yellow-400 mt-2 font-mono\">\n {props.error.message}\n </p>\n </Show>\n <Show when={props.allowRetry}>\n <button\n onClick={props.onRetry}\n class=\"mt-3 text-xs font-medium text-yellow-800 dark:text-yellow-200 hover:text-yellow-900 dark:hover:text-yellow-100 underline\"\n >\n Retry Rendering\n </button>\n </Show>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * Generative UI Error Boundary Component\n */\nexport const GenerativeUIErrorBoundary: Component<GenerativeUIErrorBoundaryProps> = (props) => {\n const [retryKey, setRetryKey] = createSignal(0)\n const [renderStartTime] = createSignal(isServer ? 0 : performance.now())\n\n // Handle error with telemetry\n const handleError = (error: Error) => {\n const renderEndTime = isServer ? 0 : performance.now()\n const renderDuration = renderEndTime - renderStartTime()\n\n // Structure error context\n const errorContext = {\n componentId: props.componentId,\n componentType: props.componentType,\n errorMessage: error.message,\n errorStack: error.stack,\n renderDuration,\n retryCount: retryKey(),\n timestamp: new Date().toISOString(),\n userAgent: isServer ? 'server' : navigator.userAgent,\n viewport: isServer\n ? { width: 0, height: 0 }\n : { width: window.innerWidth, height: window.innerHeight },\n }\n\n // Log to structured logger\n logger.error(`Component render failed: ${props.componentType}`, errorContext)\n\n // Call error callback\n props.onError?.({\n type: 'render',\n message: error.message,\n componentId: props.componentId,\n details: errorContext,\n })\n\n // In production, send to monitoring service\n if (import.meta.env.PROD) {\n // Future: Send to Sentry or other APM\n // Sentry.captureException(error, { contexts: { component: errorContext } })\n }\n }\n\n // Retry mechanism\n const handleRetry = () => {\n const newRetryCount = retryKey() + 1\n logger.info(`Retrying component render: ${props.componentType}`, {\n componentId: props.componentId,\n retryCount: newRetryCount,\n })\n setRetryKey(newRetryCount)\n }\n\n return (\n <ErrorBoundary\n fallback={(error) => {\n handleError(error)\n\n // Use custom fallback if provided\n if (props.fallback) {\n return props.fallback(error, props.allowRetry ? handleRetry : undefined)\n }\n\n // Default fallback\n return (\n <DefaultErrorFallback\n error={error}\n componentId={props.componentId}\n componentType={props.componentType}\n allowRetry={props.allowRetry}\n onRetry={handleRetry}\n />\n )\n }}\n >\n {/* Key prop for forcing remount on retry */}\n {(() => {\n const _ = retryKey() // Access signal to track changes\n return <>{props.children}</>\n })()}\n </ErrorBoundary>\n )\n}\n\n/**\n * Performance monitoring wrapper\n * Logs render times for performance analysis\n */\nexport function withPerformanceMonitoring<P extends { componentId: string; componentType: string }>(\n WrappedComponent: Component<P>\n) {\n return (props: P) => {\n const renderStart = isServer ? 0 : performance.now()\n\n // Log render start\n logger.debug(`Component render start: ${props.componentType}`, {\n componentId: props.componentId,\n timestamp: new Date().toISOString(),\n })\n\n // Measure on mount completion (client-side only)\n if (!isServer && typeof window !== 'undefined') {\n requestAnimationFrame(() => {\n const renderEnd = performance.now()\n const duration = renderEnd - renderStart\n\n logger.info(`Component rendered: ${props.componentType}`, {\n componentId: props.componentId,\n renderDuration: duration,\n timestamp: new Date().toISOString(),\n })\n\n // Warn if render is slow (>50ms target)\n if (duration > 50) {\n logger.warn(`Slow component render: ${props.componentType}`, {\n componentId: props.componentId,\n renderDuration: duration,\n threshold: 50,\n })\n }\n })\n }\n\n return <WrappedComponent {...props} />\n }\n}\n\n/**\n * Hook to track component lifecycle events\n */\nexport function useComponentTelemetry(componentId: string, componentType: string) {\n const mountTime = isServer ? 0 : performance.now()\n\n // Log mount\n logger.debug(`Component mounted: ${componentType}`, {\n componentId,\n timestamp: new Date().toISOString(),\n })\n\n // Return cleanup function for unmount\n return () => {\n const lifetime = isServer ? 0 : performance.now() - mountTime\n logger.debug(`Component unmounted: ${componentType}`, {\n componentId,\n lifetime,\n timestamp: new Date().toISOString(),\n })\n }\n}\n"],"names":["logger","createLogger","DefaultErrorFallback","props","_$ssr","_tmpl$3","_$ssrHydrationKey","_$escape","componentType","componentId","slice","_$createComponent","Show","when","import","children","_tmpl$","error","message","allowRetry","_tmpl$2","GenerativeUIErrorBoundary","retryKey","setRetryKey","createSignal","renderStartTime","isServer","performance","now","handleError","renderEndTime","renderDuration","errorContext","errorMessage","errorStack","stack","retryCount","timestamp","Date","toISOString","userAgent","navigator","viewport","width","height","window","innerWidth","innerHeight","onError","type","details","handleRetry","newRetryCount","info","ErrorBoundary","fallback","undefined","onRetry"],"mappings":";;;;;;AAiBA,MAAMA,SAASC,SAAAA,aAAa,eAAe;AAwC3C,SAASC,qBAAqBC,OAM3B;;AACD,SAAAC,IAAAA,IAAAC,SAAAC,oBAAAA,GAuBiBC,IAAAA,OAAAJ,MAAMK,aAAa,KAAI,WAAkBD,IAAAA,QAAAJ,WAAMM,gBAANN,mBAAmBO,MAAM,GAAG,EAAE,KAAI,WAASH,IAAAA,OAAAI,IAAAA,gBAE5FC,cAAI;AAAA,IAAA,IAACC,OAAI;AAAA,aAAEC;AAAAA,IAAmB;AAAA,IAAA,IAAAC,WAAA;AAAA,aAAAX,IAAAA,IAAAY,QAAAV,oBAAAA,GAAAC,IAAAA,OAE1BJ,MAAMc,MAAMC,OAAO,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA,CAAA,GAAAX,IAAAA,OAAAI,IAAAA,gBAGvBC,cAAI;AAAA,IAAA,IAACC,OAAI;AAAA,aAAEV,MAAMgB;AAAAA,IAAU;AAAA,IAAA,IAAAJ,WAAA;AAAA,aAAAX,IAAAA,IAAAgB,SAAAd,IAAAA,iBAAA;AAAA,IAAA;AAAA,EAAA,CAAA,CAAA,CAAA;AAYtC;AAKO,MAAMe,4BAAwElB,CAAAA,UAAU;AAC7F,QAAM,CAACmB,UAAUC,WAAW,IAAIC,QAAAA,aAAa,CAAC;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AMoD,UAAU;AAClB,eAAOpD,MAAMoD,SAAStC,OAAOd,MAAMgB,aAAagC,cAAcK,MAAS;AAAA,MACzE;AAGA,aAAA7C,IAAAA,gBACGT,sBAAoB;AAAA,QACnBe;AAAAA,QAAY,IACZR,cAAW;AAAA,iBAAEN,MAAMM;AAAAA,QAAW;AAAA,QAAA,IAC9BD,gBAAa;AAAA,iBAAEL,MAAMK;AAAAA,QAAa;AAAA,QAAA,IAClCW,aAAU;AAAA,iBAAEhB,MAAMgB;AAAAA,QAAU;AAAA,QAC5BsC,SAASN;AAAAA,MAAAA,CAAW;AAAA,IAG1B;AAAA,IAAC,IAAApC,WAAA;AAAA,cAGC,MAAM;AACIO,iBAAAA;AACV,eAAUnB,MAAMY;AAAAA,MAClB,GAAA;AAAA,IAAI;AAAA,EAAA,CAAA;AAGV;;"}
1
+ {"version":3,"file":"GenerativeUIErrorBoundary.cjs","sources":["../../../../src/components/GenerativeUIErrorBoundary.tsx"],"sourcesContent":["/**\n * Generative UI Error Boundary with Telemetry\n * Phase 0: Error isolation + structured logging\n *\n * Features:\n * - Component-level error isolation\n * - Structured logging with context\n * - Performance timing\n * - Retry mechanism\n * - User-friendly fallback UI\n */\n\nimport { Component, ErrorBoundary, createSignal, Show } from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport { createLogger } from '../utils/logger'\nimport type { RendererError } from '../types'\n\nconst logger = createLogger('generative-ui')\n\n/**\n * Props for GenerativeUIErrorBoundary\n */\nexport interface GenerativeUIErrorBoundaryProps {\n /**\n * Component identifier for telemetry\n */\n componentId: string\n\n /**\n * Component type for context\n */\n componentType: string\n\n /**\n * Error callback\n */\n onError?: (error: RendererError) => void\n\n /**\n * Allow retry on error\n */\n allowRetry?: boolean\n\n /**\n * Child components to wrap\n */\n children: any\n\n /**\n * Custom fallback UI (optional)\n */\n fallback?: (error: Error, retry?: () => void) => any\n}\n\n/**\n * Default fallback UI for errors\n */\nfunction DefaultErrorFallback(props: {\n error: Error\n componentId: string\n componentType: string\n allowRetry?: boolean\n onRetry?: () => void\n}) {\n return (\n <div class=\"w-full h-full bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4\">\n <div class=\"flex items-start gap-3\">\n <div class=\"flex-shrink-0\">\n <svg\n class=\"w-5 h-5 text-yellow-600 dark:text-yellow-400\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n 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\"\n />\n </svg>\n </div>\n <div class=\"flex-1 min-w-0\">\n <p class=\"text-sm font-medium text-yellow-900 dark:text-yellow-100\">\n Component Failed to Render\n </p>\n <p class=\"text-xs text-yellow-700 dark:text-yellow-300 mt-1\">\n Type: {props.componentType || 'unknown'} | ID: {props.componentId?.slice(0, 8) || 'unknown'}...\n </p>\n <Show when={import.meta.env.DEV}>\n <p class=\"text-xs text-yellow-600 dark:text-yellow-400 mt-2 font-mono\">\n {props.error.message}\n </p>\n </Show>\n <Show when={props.allowRetry}>\n <button\n onClick={props.onRetry}\n class=\"mt-3 text-xs font-medium text-yellow-800 dark:text-yellow-200 hover:text-yellow-900 dark:hover:text-yellow-100 underline\"\n >\n Retry Rendering\n </button>\n </Show>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * Generative UI Error Boundary Component\n */\nexport const GenerativeUIErrorBoundary: Component<GenerativeUIErrorBoundaryProps> = (props) => {\n const [retryKey, setRetryKey] = createSignal(0)\n const [renderStartTime] = createSignal(isServer ? 0 : performance.now())\n\n // Handle error with telemetry\n const handleError = (error: Error) => {\n const renderEndTime = isServer ? 0 : performance.now()\n const renderDuration = renderEndTime - renderStartTime()\n\n // Structure error context\n const errorContext = {\n componentId: props.componentId,\n componentType: props.componentType,\n errorMessage: error.message,\n errorStack: error.stack,\n renderDuration,\n retryCount: retryKey(),\n timestamp: new Date().toISOString(),\n userAgent: isServer ? 'server' : navigator.userAgent,\n viewport: isServer\n ? { width: 0, height: 0 }\n : { width: window.innerWidth, height: window.innerHeight },\n }\n\n // Log to structured logger\n logger.error(`Component render failed: ${props.componentType}`, errorContext)\n\n // Call error callback\n props.onError?.({\n type: 'render',\n message: error.message,\n componentId: props.componentId,\n details: errorContext,\n })\n\n // In production, send to monitoring service\n if (import.meta.env.PROD) {\n // Future: Send to Sentry or other APM\n // Sentry.captureException(error, { contexts: { component: errorContext } })\n }\n }\n\n // Retry mechanism\n const handleRetry = () => {\n const newRetryCount = retryKey() + 1\n logger.info(`Retrying component render: ${props.componentType}`, {\n componentId: props.componentId,\n retryCount: newRetryCount,\n })\n setRetryKey(newRetryCount)\n }\n\n return (\n <ErrorBoundary\n fallback={(error) => {\n handleError(error)\n\n // Use custom fallback if provided\n if (props.fallback) {\n return props.fallback(error, props.allowRetry ? handleRetry : undefined)\n }\n\n // Default fallback\n return (\n <DefaultErrorFallback\n error={error}\n componentId={props.componentId}\n componentType={props.componentType}\n allowRetry={props.allowRetry}\n onRetry={handleRetry}\n />\n )\n }}\n >\n {/* Key prop for forcing remount on retry */}\n {(() => {\n const _ = retryKey() // Access signal to track changes\n return <>{props.children}</>\n })()}\n </ErrorBoundary>\n )\n}\n\n/**\n * Performance monitoring wrapper\n * Logs render times for performance analysis\n */\nexport function withPerformanceMonitoring<P extends { componentId: string; componentType: string }>(\n WrappedComponent: Component<P>\n) {\n return (props: P) => {\n const renderStart = isServer ? 0 : performance.now()\n\n // Log render start\n logger.debug(`Component render start: ${props.componentType}`, {\n componentId: props.componentId,\n timestamp: new Date().toISOString(),\n })\n\n // Measure on mount completion (client-side only)\n if (!isServer && typeof window !== 'undefined') {\n requestAnimationFrame(() => {\n const renderEnd = performance.now()\n const duration = renderEnd - renderStart\n\n logger.info(`Component rendered: ${props.componentType}`, {\n componentId: props.componentId,\n renderDuration: duration,\n timestamp: new Date().toISOString(),\n })\n\n // Warn if render is slow (>50ms target)\n if (duration > 50) {\n logger.warn(`Slow component render: ${props.componentType}`, {\n componentId: props.componentId,\n renderDuration: duration,\n threshold: 50,\n })\n }\n })\n }\n\n return <WrappedComponent {...props} />\n }\n}\n\n/**\n * Hook to track component lifecycle events\n */\nexport function useComponentTelemetry(componentId: string, componentType: string) {\n const mountTime = isServer ? 0 : performance.now()\n\n // Log mount\n logger.debug(`Component mounted: ${componentType}`, {\n componentId,\n timestamp: new Date().toISOString(),\n })\n\n // Return cleanup function for unmount\n return () => {\n const lifetime = isServer ? 0 : performance.now() - mountTime\n logger.debug(`Component unmounted: ${componentType}`, {\n componentId,\n lifetime,\n timestamp: new Date().toISOString(),\n })\n }\n}\n"],"names":["logger","createLogger","DefaultErrorFallback","props","_el$","_$getNextElement","_tmpl$3","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$6","_el$7","_el$0","_el$1","_co$","_$getNextMarker","_el$8","_el$10","_el$11","_co$2","_el$14","_el$15","_co$3","_el$16","_el$17","_co$4","_$insert","componentType","componentId","slice","_$createComponent","Show","when","import","children","_el$12","_tmpl$","error","message","allowRetry","_el$13","_tmpl$2","_$addEventListener","onRetry","_$runHydrationEvents","GenerativeUIErrorBoundary","retryKey","setRetryKey","createSignal","renderStartTime","isServer","performance","now","handleError","renderEndTime","renderDuration","errorContext","errorMessage","errorStack","stack","retryCount","timestamp","Date","toISOString","userAgent","navigator","viewport","width","height","window","innerWidth","innerHeight","onError","type","details","handleRetry","newRetryCount","info","ErrorBoundary","fallback","undefined","_$memo","_$delegateEvents"],"mappings":";;;;;;AAiBA,MAAMA,SAASC,SAAAA,aAAa,eAAe;AAwC3C,SAASC,qBAAqBC,OAM3B;AACD,UAAA,MAAA;AAAA,QAAAC,OAAAC,IAAAA,eAAAC,OAAA,GAAAC,QAAAH,KAAAI,YAAAC,QAAAF,MAAAC,YAAAE,QAAAD,MAAAE,aAAAC,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,CACb;AACD7B,gBAAY6B,aAAa;AAAA,EAC3B;AAEA,SAAA9C,IAAAA,gBACGgD,QAAAA,eAAa;AAAA,IACZC,UAAW1C,CAAAA,UAAU;AACnBgB,kBAAYhB,KAAK;AAGjB,UAAIrC,MAAM+E,UAAU;AAClB,eAAO/E,MAAM+E,SAAS1C,OAAOrC,MAAMuC,aAAaoC,cAAcK,MAAS;AAAA,MACzE;AAGA,aAAAlD,IAAAA,gBACG/B,sBAAoB;AAAA,QACnBsC;AAAAA,QAAY,IACZT,cAAW;AAAA,iBAAE5B,MAAM4B;AAAAA,QAAW;AAAA,QAAA,IAC9BD,gBAAa;AAAA,iBAAE3B,MAAM2B;AAAAA,QAAa;AAAA,QAAA,IAClCY,aAAU;AAAA,iBAAEvC,MAAMuC;AAAAA,QAAU;AAAA,QAC5BI,SAASgC;AAAAA,MAAAA,CAAW;AAAA,IAG1B;AAAA,IAAC,IAAAzC,WAAA;AAAA,cAGC,MAAM;AACIY,iBAAAA;AACV,eAAAmC,IAAAA,KAAA,MAAUjF,MAAMkC,QAAQ;AAAA,MAC1B,GAAA;AAAA,IAAI;AAAA,EAAA,CAAA;AAGV;AAkECgD,IAAAA,eAAA,CAAA,OAAA,CAAA;;"}
@@ -1,25 +1,41 @@
1
- import { isServer, createComponent, ssr, ssrHydrationKey, escape } from "solid-js/web";
1
+ import { delegateEvents, isServer, createComponent, memo, getNextElement, template, getNextMarker, insert, addEventListener, runHydrationEvents } from "solid-js/web";
2
2
  import { createSignal, ErrorBoundary, Show } from "solid-js";
3
3
  import { createLogger } from "../utils/logger.js";
4
- var _tmpl$ = ["<p", ' class="text-xs text-yellow-600 dark:text-yellow-400 mt-2 font-mono">', "</p>"], _tmpl$2 = ["<button", ' class="mt-3 text-xs font-medium text-yellow-800 dark:text-yellow-200 hover:text-yellow-900 dark:hover:text-yellow-100 underline">Retry Rendering</button>'], _tmpl$3 = ["<div", ' class="w-full h-full bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4"><div class="flex items-start gap-3"><div class="flex-shrink-0"><svg class="w-5 h-5 text-yellow-600 dark:text-yellow-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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"><p class="text-sm font-medium text-yellow-900 dark:text-yellow-100">Component Failed to Render</p><p class="text-xs text-yellow-700 dark:text-yellow-300 mt-1">Type: <!--$-->', "<!--/--> | ID: <!--$-->", "<!--/-->...</p><!--$-->", "<!--/--><!--$-->", "<!--/--></div></div></div>"];
4
+ var _tmpl$ = /* @__PURE__ */ template(`<p class="text-xs text-yellow-600 dark:text-yellow-400 mt-2 font-mono">`), _tmpl$2 = /* @__PURE__ */ template(`<button class="mt-3 text-xs font-medium text-yellow-800 dark:text-yellow-200 hover:text-yellow-900 dark:hover:text-yellow-100 underline">Retry Rendering`), _tmpl$3 = /* @__PURE__ */ template(`<div class="w-full h-full bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4"><div class="flex items-start gap-3"><div class=flex-shrink-0><svg class="w-5 h-5 text-yellow-600 dark:text-yellow-400"fill=none stroke=currentColor viewBox="0 0 24 24"><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"><p class="text-sm font-medium text-yellow-900 dark:text-yellow-100">Component Failed to Render</p><p class="text-xs text-yellow-700 dark:text-yellow-300 mt-1">Type: <!$><!/> | ID: <!$><!/>...</p><!$><!/><!$><!/>`);
5
5
  const logger = createLogger("generative-ui");
6
6
  function DefaultErrorFallback(props) {
7
- var _a;
8
- return ssr(_tmpl$3, ssrHydrationKey(), escape(props.componentType) || "unknown", escape((_a = props.componentId) == null ? void 0 : _a.slice(0, 8)) || "unknown", escape(createComponent(Show, {
9
- get when() {
10
- return false;
11
- },
12
- get children() {
13
- return ssr(_tmpl$, ssrHydrationKey(), escape(props.error.message));
14
- }
15
- })), escape(createComponent(Show, {
16
- get when() {
17
- return props.allowRetry;
18
- },
19
- get children() {
20
- return ssr(_tmpl$2, ssrHydrationKey());
21
- }
22
- })));
7
+ return (() => {
8
+ var _el$ = getNextElement(_tmpl$3), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild, _el$0 = _el$7.nextSibling, [_el$1, _co$] = getNextMarker(_el$0.nextSibling), _el$8 = _el$1.nextSibling, _el$10 = _el$8.nextSibling, [_el$11, _co$2] = getNextMarker(_el$10.nextSibling);
9
+ _el$11.nextSibling;
10
+ var _el$14 = _el$6.nextSibling, [_el$15, _co$3] = getNextMarker(_el$14.nextSibling), _el$16 = _el$15.nextSibling, [_el$17, _co$4] = getNextMarker(_el$16.nextSibling);
11
+ insert(_el$6, () => props.componentType || "unknown", _el$1, _co$);
12
+ insert(_el$6, () => {
13
+ var _a;
14
+ return ((_a = props.componentId) == null ? void 0 : _a.slice(0, 8)) || "unknown";
15
+ }, _el$11, _co$2);
16
+ insert(_el$4, createComponent(Show, {
17
+ get when() {
18
+ return false;
19
+ },
20
+ get children() {
21
+ var _el$12 = getNextElement(_tmpl$);
22
+ insert(_el$12, () => props.error.message);
23
+ return _el$12;
24
+ }
25
+ }), _el$15, _co$3);
26
+ insert(_el$4, createComponent(Show, {
27
+ get when() {
28
+ return props.allowRetry;
29
+ },
30
+ get children() {
31
+ var _el$13 = getNextElement(_tmpl$2);
32
+ addEventListener(_el$13, "click", props.onRetry, true);
33
+ runHydrationEvents();
34
+ return _el$13;
35
+ }
36
+ }), _el$17, _co$4);
37
+ return _el$;
38
+ })();
23
39
  }
24
40
  const GenerativeUIErrorBoundary = (props) => {
25
41
  const [retryKey, setRetryKey] = createSignal(0);
@@ -84,11 +100,12 @@ const GenerativeUIErrorBoundary = (props) => {
84
100
  get children() {
85
101
  return (() => {
86
102
  retryKey();
87
- return props.children;
103
+ return memo(() => props.children);
88
104
  })();
89
105
  }
90
106
  });
91
107
  };
108
+ delegateEvents(["click"]);
92
109
  export {
93
110
  GenerativeUIErrorBoundary
94
111
  };
@@ -1 +1 @@
1
- {"version":3,"file":"GenerativeUIErrorBoundary.js","sources":["../../../../src/components/GenerativeUIErrorBoundary.tsx"],"sourcesContent":["/**\n * Generative UI Error Boundary with Telemetry\n * Phase 0: Error isolation + structured logging\n *\n * Features:\n * - Component-level error isolation\n * - Structured logging with context\n * - Performance timing\n * - Retry mechanism\n * - User-friendly fallback UI\n */\n\nimport { Component, ErrorBoundary, createSignal, Show } from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport { createLogger } from '../utils/logger'\nimport type { RendererError } from '../types'\n\nconst logger = createLogger('generative-ui')\n\n/**\n * Props for GenerativeUIErrorBoundary\n */\nexport interface GenerativeUIErrorBoundaryProps {\n /**\n * Component identifier for telemetry\n */\n componentId: string\n\n /**\n * Component type for context\n */\n componentType: string\n\n /**\n * Error callback\n */\n onError?: (error: RendererError) => void\n\n /**\n * Allow retry on error\n */\n allowRetry?: boolean\n\n /**\n * Child components to wrap\n */\n children: any\n\n /**\n * Custom fallback UI (optional)\n */\n fallback?: (error: Error, retry?: () => void) => any\n}\n\n/**\n * Default fallback UI for errors\n */\nfunction DefaultErrorFallback(props: {\n error: Error\n componentId: string\n componentType: string\n allowRetry?: boolean\n onRetry?: () => void\n}) {\n return (\n <div class=\"w-full h-full bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4\">\n <div class=\"flex items-start gap-3\">\n <div class=\"flex-shrink-0\">\n <svg\n class=\"w-5 h-5 text-yellow-600 dark:text-yellow-400\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n 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\"\n />\n </svg>\n </div>\n <div class=\"flex-1 min-w-0\">\n <p class=\"text-sm font-medium text-yellow-900 dark:text-yellow-100\">\n Component Failed to Render\n </p>\n <p class=\"text-xs text-yellow-700 dark:text-yellow-300 mt-1\">\n Type: {props.componentType || 'unknown'} | ID: {props.componentId?.slice(0, 8) || 'unknown'}...\n </p>\n <Show when={import.meta.env.DEV}>\n <p class=\"text-xs text-yellow-600 dark:text-yellow-400 mt-2 font-mono\">\n {props.error.message}\n </p>\n </Show>\n <Show when={props.allowRetry}>\n <button\n onClick={props.onRetry}\n class=\"mt-3 text-xs font-medium text-yellow-800 dark:text-yellow-200 hover:text-yellow-900 dark:hover:text-yellow-100 underline\"\n >\n Retry Rendering\n </button>\n </Show>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * Generative UI Error Boundary Component\n */\nexport const GenerativeUIErrorBoundary: Component<GenerativeUIErrorBoundaryProps> = (props) => {\n const [retryKey, setRetryKey] = createSignal(0)\n const [renderStartTime] = createSignal(isServer ? 0 : performance.now())\n\n // Handle error with telemetry\n const handleError = (error: Error) => {\n const renderEndTime = isServer ? 0 : performance.now()\n const renderDuration = renderEndTime - renderStartTime()\n\n // Structure error context\n const errorContext = {\n componentId: props.componentId,\n componentType: props.componentType,\n errorMessage: error.message,\n errorStack: error.stack,\n renderDuration,\n retryCount: retryKey(),\n timestamp: new Date().toISOString(),\n userAgent: isServer ? 'server' : navigator.userAgent,\n viewport: isServer\n ? { width: 0, height: 0 }\n : { width: window.innerWidth, height: window.innerHeight },\n }\n\n // Log to structured logger\n logger.error(`Component render failed: ${props.componentType}`, errorContext)\n\n // Call error callback\n props.onError?.({\n type: 'render',\n message: error.message,\n componentId: props.componentId,\n details: errorContext,\n })\n\n // In production, send to monitoring service\n if (import.meta.env.PROD) {\n // Future: Send to Sentry or other APM\n // Sentry.captureException(error, { contexts: { component: errorContext } })\n }\n }\n\n // Retry mechanism\n const handleRetry = () => {\n const newRetryCount = retryKey() + 1\n logger.info(`Retrying component render: ${props.componentType}`, {\n componentId: props.componentId,\n retryCount: newRetryCount,\n })\n setRetryKey(newRetryCount)\n }\n\n return (\n <ErrorBoundary\n fallback={(error) => {\n handleError(error)\n\n // Use custom fallback if provided\n if (props.fallback) {\n return props.fallback(error, props.allowRetry ? handleRetry : undefined)\n }\n\n // Default fallback\n return (\n <DefaultErrorFallback\n error={error}\n componentId={props.componentId}\n componentType={props.componentType}\n allowRetry={props.allowRetry}\n onRetry={handleRetry}\n />\n )\n }}\n >\n {/* Key prop for forcing remount on retry */}\n {(() => {\n const _ = retryKey() // Access signal to track changes\n return <>{props.children}</>\n })()}\n </ErrorBoundary>\n )\n}\n\n/**\n * Performance monitoring wrapper\n * Logs render times for performance analysis\n */\nexport function withPerformanceMonitoring<P extends { componentId: string; componentType: string }>(\n WrappedComponent: Component<P>\n) {\n return (props: P) => {\n const renderStart = isServer ? 0 : performance.now()\n\n // Log render start\n logger.debug(`Component render start: ${props.componentType}`, {\n componentId: props.componentId,\n timestamp: new Date().toISOString(),\n })\n\n // Measure on mount completion (client-side only)\n if (!isServer && typeof window !== 'undefined') {\n requestAnimationFrame(() => {\n const renderEnd = performance.now()\n const duration = renderEnd - renderStart\n\n logger.info(`Component rendered: ${props.componentType}`, {\n componentId: props.componentId,\n renderDuration: duration,\n timestamp: new Date().toISOString(),\n })\n\n // Warn if render is slow (>50ms target)\n if (duration > 50) {\n logger.warn(`Slow component render: ${props.componentType}`, {\n componentId: props.componentId,\n renderDuration: duration,\n threshold: 50,\n })\n }\n })\n }\n\n return <WrappedComponent {...props} />\n }\n}\n\n/**\n * Hook to track component lifecycle events\n */\nexport function useComponentTelemetry(componentId: string, componentType: string) {\n const mountTime = isServer ? 0 : performance.now()\n\n // Log mount\n logger.debug(`Component mounted: ${componentType}`, {\n componentId,\n timestamp: new Date().toISOString(),\n })\n\n // Return cleanup function for unmount\n return () => {\n const lifetime = isServer ? 0 : performance.now() - mountTime\n logger.debug(`Component unmounted: ${componentType}`, {\n componentId,\n lifetime,\n timestamp: new Date().toISOString(),\n })\n }\n}\n"],"names":["logger","createLogger","DefaultErrorFallback","props","_$ssr","_tmpl$3","_$ssrHydrationKey","_$escape","componentType","componentId","slice","_$createComponent","Show","when","import","children","_tmpl$","error","message","allowRetry","_tmpl$2","GenerativeUIErrorBoundary","retryKey","setRetryKey","createSignal","renderStartTime","isServer","performance","now","handleError","renderEndTime","renderDuration","errorContext","errorMessage","errorStack","stack","retryCount","timestamp","Date","toISOString","userAgent","navigator","viewport","width","height","window","innerWidth","innerHeight","onError","type","details","handleRetry","newRetryCount","info","ErrorBoundary","fallback","undefined","onRetry"],"mappings":";;;;AAiBA,MAAMA,SAASC,aAAa,eAAe;AAwC3C,SAASC,qBAAqBC,OAM3B;;AACD,SAAAC,IAAAC,SAAAC,gBAAAA,GAuBiBC,OAAAJ,MAAMK,aAAa,KAAI,WAAkBD,QAAAJ,WAAMM,gBAANN,mBAAmBO,MAAM,GAAG,EAAE,KAAI,WAASH,OAAAI,gBAE5FC,MAAI;AAAA,IAAA,IAACC,OAAI;AAAA,aAAEC;AAAAA,IAAmB;AAAA,IAAA,IAAAC,WAAA;AAAA,aAAAX,IAAAY,QAAAV,gBAAAA,GAAAC,OAE1BJ,MAAMc,MAAMC,OAAO,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA,CAAA,GAAAX,OAAAI,gBAGvBC,MAAI;AAAA,IAAA,IAACC,OAAI;AAAA,aAAEV,MAAMgB;AAAAA,IAAU;AAAA,IAAA,IAAAJ,WAAA;AAAA,aAAAX,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A,EAC3B;AAEA,SAAAzC,gBACG2C,eAAa;AAAA,IACZC,UAAWtC,CAAAA,UAAU;AACnBY,kBAAYZ,KAAK;AAGjB,UAAId,MAAMoD,UAAU;AAClB,eAAOpD,MAAMoD,SAAStC,OAAOd,MAAMgB,aAAagC,cAAcK,MAAS;AAAA,MACzE;AAGA,aAAA7C,gBACGT,sBAAoB;AAAA,QACnBe;AAAAA,QAAY,IACZR,cAAW;AAAA,iBAAEN,MAAMM;AAAAA,QAAW;AAAA,QAAA,IAC9BD,gBAAa;AAAA,iBAAEL,MAAMK;AAAAA,QAAa;AAAA,QAAA,IAClCW,aAAU;AAAA,iBAAEhB,MAAMgB;AAAAA,QAAU;AAAA,QAC5BsC,SAASN;AAAAA,MAAAA,CAAW;AAAA,IAG1B;AAAA,IAAC,IAAApC,WAAA;AAAA,cAGC,MAAM;AACIO,iBAAAA;AACV,eAAUnB,MAAMY;AAAAA,MAClB,GAAA;AAAA,IAAI;AAAA,EAAA,CAAA;AAGV;"}
1
+ {"version":3,"file":"GenerativeUIErrorBoundary.js","sources":["../../../../src/components/GenerativeUIErrorBoundary.tsx"],"sourcesContent":["/**\n * Generative UI Error Boundary with Telemetry\n * Phase 0: Error isolation + structured logging\n *\n * Features:\n * - Component-level error isolation\n * - Structured logging with context\n * - Performance timing\n * - Retry mechanism\n * - User-friendly fallback UI\n */\n\nimport { Component, ErrorBoundary, createSignal, Show } from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport { createLogger } from '../utils/logger'\nimport type { RendererError } from '../types'\n\nconst logger = createLogger('generative-ui')\n\n/**\n * Props for GenerativeUIErrorBoundary\n */\nexport interface GenerativeUIErrorBoundaryProps {\n /**\n * Component identifier for telemetry\n */\n componentId: string\n\n /**\n * Component type for context\n */\n componentType: string\n\n /**\n * Error callback\n */\n onError?: (error: RendererError) => void\n\n /**\n * Allow retry on error\n */\n allowRetry?: boolean\n\n /**\n * Child components to wrap\n */\n children: any\n\n /**\n * Custom fallback UI (optional)\n */\n fallback?: (error: Error, retry?: () => void) => any\n}\n\n/**\n * Default fallback UI for errors\n */\nfunction DefaultErrorFallback(props: {\n error: Error\n componentId: string\n componentType: string\n allowRetry?: boolean\n onRetry?: () => void\n}) {\n return (\n <div class=\"w-full h-full bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4\">\n <div class=\"flex items-start gap-3\">\n <div class=\"flex-shrink-0\">\n <svg\n class=\"w-5 h-5 text-yellow-600 dark:text-yellow-400\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n 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\"\n />\n </svg>\n </div>\n <div class=\"flex-1 min-w-0\">\n <p class=\"text-sm font-medium text-yellow-900 dark:text-yellow-100\">\n Component Failed to Render\n </p>\n <p class=\"text-xs text-yellow-700 dark:text-yellow-300 mt-1\">\n Type: {props.componentType || 'unknown'} | ID: {props.componentId?.slice(0, 8) || 'unknown'}...\n </p>\n <Show when={import.meta.env.DEV}>\n <p class=\"text-xs text-yellow-600 dark:text-yellow-400 mt-2 font-mono\">\n {props.error.message}\n </p>\n </Show>\n <Show when={props.allowRetry}>\n <button\n onClick={props.onRetry}\n class=\"mt-3 text-xs font-medium text-yellow-800 dark:text-yellow-200 hover:text-yellow-900 dark:hover:text-yellow-100 underline\"\n >\n Retry Rendering\n </button>\n </Show>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * Generative UI Error Boundary Component\n */\nexport const GenerativeUIErrorBoundary: Component<GenerativeUIErrorBoundaryProps> = (props) => {\n const [retryKey, setRetryKey] = createSignal(0)\n const [renderStartTime] = createSignal(isServer ? 0 : performance.now())\n\n // Handle error with telemetry\n const handleError = (error: Error) => {\n const renderEndTime = isServer ? 0 : performance.now()\n const renderDuration = renderEndTime - renderStartTime()\n\n // Structure error context\n const errorContext = {\n componentId: props.componentId,\n componentType: props.componentType,\n errorMessage: error.message,\n errorStack: error.stack,\n renderDuration,\n retryCount: retryKey(),\n timestamp: new Date().toISOString(),\n userAgent: isServer ? 'server' : navigator.userAgent,\n viewport: isServer\n ? { width: 0, height: 0 }\n : { width: window.innerWidth, height: window.innerHeight },\n }\n\n // Log to structured logger\n logger.error(`Component render failed: ${props.componentType}`, errorContext)\n\n // Call error callback\n props.onError?.({\n type: 'render',\n message: error.message,\n componentId: props.componentId,\n details: errorContext,\n })\n\n // In production, send to monitoring service\n if (import.meta.env.PROD) {\n // Future: Send to Sentry or other APM\n // Sentry.captureException(error, { contexts: { component: errorContext } })\n }\n }\n\n // Retry mechanism\n const handleRetry = () => {\n const newRetryCount = retryKey() + 1\n logger.info(`Retrying component render: ${props.componentType}`, {\n componentId: props.componentId,\n retryCount: newRetryCount,\n })\n setRetryKey(newRetryCount)\n }\n\n return (\n <ErrorBoundary\n fallback={(error) => {\n handleError(error)\n\n // Use custom fallback if provided\n if (props.fallback) {\n return props.fallback(error, props.allowRetry ? handleRetry : undefined)\n }\n\n // Default fallback\n return (\n <DefaultErrorFallback\n error={error}\n componentId={props.componentId}\n componentType={props.componentType}\n allowRetry={props.allowRetry}\n onRetry={handleRetry}\n />\n )\n }}\n >\n {/* Key prop for forcing remount on retry */}\n {(() => {\n const _ = retryKey() // Access signal to track changes\n return <>{props.children}</>\n })()}\n </ErrorBoundary>\n )\n}\n\n/**\n * Performance monitoring wrapper\n * Logs render times for performance analysis\n */\nexport function withPerformanceMonitoring<P extends { componentId: string; componentType: string }>(\n WrappedComponent: Component<P>\n) {\n return (props: P) => {\n const renderStart = isServer ? 0 : performance.now()\n\n // Log render start\n logger.debug(`Component render start: ${props.componentType}`, {\n componentId: props.componentId,\n timestamp: new Date().toISOString(),\n })\n\n // Measure on mount completion (client-side only)\n if (!isServer && typeof window !== 'undefined') {\n requestAnimationFrame(() => {\n const renderEnd = performance.now()\n const duration = renderEnd - renderStart\n\n logger.info(`Component rendered: ${props.componentType}`, {\n componentId: props.componentId,\n renderDuration: duration,\n timestamp: new Date().toISOString(),\n })\n\n // Warn if render is slow (>50ms target)\n if (duration > 50) {\n logger.warn(`Slow component render: ${props.componentType}`, {\n componentId: props.componentId,\n renderDuration: duration,\n threshold: 50,\n })\n }\n })\n }\n\n return <WrappedComponent {...props} />\n }\n}\n\n/**\n * Hook to track component lifecycle events\n */\nexport function useComponentTelemetry(componentId: string, componentType: string) {\n const mountTime = isServer ? 0 : performance.now()\n\n // Log mount\n logger.debug(`Component mounted: ${componentType}`, {\n componentId,\n timestamp: new Date().toISOString(),\n })\n\n // Return cleanup function for unmount\n return () => {\n const lifetime = isServer ? 0 : performance.now() - mountTime\n logger.debug(`Component unmounted: ${componentType}`, {\n componentId,\n lifetime,\n timestamp: new Date().toISOString(),\n })\n }\n}\n"],"names":["logger","createLogger","DefaultErrorFallback","props","_el$","_$getNextElement","_tmpl$3","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$6","_el$7","_el$0","_el$1","_co$","_$getNextMarker","_el$8","_el$10","_el$11","_co$2","_el$14","_el$15","_co$3","_el$16","_el$17","_co$4","_$insert","componentType","componentId","slice","_$createComponent","Show","when","import","children","_el$12","_tmpl$","error","message","allowRetry","_el$13","_tmpl$2","_$addEventListener","onRetry","_$runHydrationEvents","GenerativeUIErrorBoundary","retryKey","setRetryKey","createSignal","renderStartTime","isServer","performance","now","handleError","renderEndTime","renderDuration","errorContext","errorMessage","errorStack","stack","retryCount","timestamp","Date","toISOString","userAgent","navigator","viewport","width","height","window","innerWidth","innerHeight","onError","type","details","handleRetry","newRetryCount","info","ErrorBoundary","fallback","undefined","_$memo","_$delegateEvents"],"mappings":";;;;AAiBA,MAAMA,SAASC,aAAa,eAAe;AAwC3C,SAASC,qBAAqBC,OAM3B;AACD,UAAA,MAAA;AAAA,QAAAC,OAAAC,eA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