@seed-ship/mcp-ui-solid 1.0.43 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +315 -142
  2. package/README.md +271 -21
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,10 +1,311 @@
1
- # @mcp-ui/solid Changelog
1
+ # @seed-ship/mcp-ui-solid Changelog
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
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.1.0] - 2025-11-25
9
+
10
+ ### Documentation
11
+ - **Comprehensive README Rewrite**: Complete documentation overhaul
12
+ - Added architecture diagram and SSR guide
13
+ - Documented all 12 component renderers with examples
14
+ - Added conditional export setup for SolidStart
15
+ - Included troubleshooting section for common SSR issues
16
+ - **CHANGELOG Catch-up**: Added 33 missing version entries (v1.0.11 to v1.0.43)
17
+ - **Phase 5 Roadmap**: Documented planned advanced components
18
+
19
+ ### Notes
20
+ - This minor version bump marks a documentation milestone
21
+ - No code changes - all functionality identical to v1.0.43
22
+
23
+ ## [1.0.43] - 2025-11-25
24
+
25
+ ### Fixed
26
+ - **Object-to-Link Conversion**: Handle object values in `renderCellValue()` for table cells
27
+ - Backend/LLM may send `{url, name}` objects instead of markdown strings
28
+ - Previous: `String(value)` produced `[object Object]` in cells and broken URLs
29
+ - Now: Auto-converts objects with `url` property to clickable HTML links
30
+ - Supports `name`, `label`, or `title` as link text (falls back to URL)
31
+ - Objects without `url` but with `name/label/title` render as plain text
32
+ - Other objects are serialized with `JSON.stringify()`
33
+
34
+ ### Technical Details
35
+ ```typescript
36
+ // Before: "[object Object]" displayed, broken links
37
+ // After: Proper clickable links
38
+ if (value.url) {
39
+ const label = value.name || value.label || value.title || value.url
40
+ return `<a href="${sanitizedUrl}">${sanitizedLabel}</a>`
41
+ }
42
+ ```
43
+
44
+ ## [1.0.42] - 2025-11-25
45
+
46
+ ### Added
47
+ - **Source Exports via "solid" Condition**: Add direct source exports for SolidStart SSR compatibility
48
+ - New `"solid"` condition in package.json exports points to TypeScript source files
49
+ - Allows Vite/SolidStart to compile components in the same context as the app
50
+ - Fixes SSR hydration mismatches when compiled separately
51
+ - **Requires**: Consuming app must add `conditions: ['solid']` in Vite config
52
+
53
+ ### Technical Details
54
+ ```json
55
+ {
56
+ "exports": {
57
+ ".": {
58
+ "solid": "./src/index.ts", // ← Source for SolidStart
59
+ "import": "./dist/index.js", // ← Compiled for other bundlers
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ ### Migration Notes
66
+ For SolidStart users on Railway/SSR platforms, add to `app.config.ts`:
67
+ ```typescript
68
+ resolve: {
69
+ conditions: ['solid', 'development', 'browser']
70
+ }
71
+ ```
72
+
73
+ ## [1.0.41] - 2025-11-25
74
+
75
+ ### Changed
76
+ - Switch from SSR to DOM mode for client-side rendering experiments
77
+ - Reverted in v1.0.42
78
+
79
+ ## [1.0.40] - 2025-11-25
80
+
81
+ ### Improved
82
+ - **Smart Cell Rendering**: Enhanced `renderCellValue()` with better markdown/link detection
83
+ - Extract actual URL from markdown links before validation
84
+ - Support image URLs in markdown format
85
+ - Improved detection of URLs without protocol prefix
86
+
87
+ ## [1.0.39] - 2025-11-24
88
+
89
+ ### Fixed
90
+ - Rebuild with fresh `dist/` containing createEffect fix from v1.0.38
91
+ - Clean rebuild to ensure all SSR fixes are included in the package
92
+
93
+ ## [1.0.38] - 2025-11-24
94
+
95
+ ### Fixed
96
+ - **SSR Compatibility**: Replace `onMount` with `createEffect` for better SSR behavior
97
+ - `createEffect` runs on both server and client
98
+ - More predictable execution timing
99
+ - Fixes certain edge cases in streaming UI
100
+
101
+ ## [1.0.37] - 2025-11-24
102
+
103
+ ### Fixed
104
+ - **SSR Mode Restoration**: Restore `generate: 'ssr'` mode for Railway Node 22 compatibility
105
+ - Previous version accidentally reverted to DOM mode
106
+ - Re-enables proper SSR compilation for server environments
107
+
108
+ ## [1.0.36] - 2025-11-24
109
+
110
+ ### Fixed
111
+ - **SSR Guard Improvement**: Use `typeof window` check instead of `isServer` import
112
+ - More reliable detection in mixed environments
113
+ - Fixes edge cases where `isServer` wasn't properly tree-shaken
114
+
115
+ ## [1.0.35] - 2025-11-24
116
+
117
+ ### Fixed
118
+ - **SSR Guard in useStreamingUI**: Add SSR guard to `fetch()` calls in useStreamingUI hook
119
+ - Prevents SSR crashes when hook is instantiated during server render
120
+ - `fetch` is guarded to only execute client-side
121
+
122
+ ## [1.0.34] - 2025-11-24
123
+
124
+ ### Fixed
125
+ - **Client-Only API Guards**: Use `onMount` pattern for all client-only APIs in GenerativeUIErrorBoundary
126
+ - Consistent pattern across all components
127
+ - Prevents accidental server-side execution
128
+
129
+ ## [1.0.33] - 2025-11-24
130
+
131
+ ### Fixed
132
+ - **Railway SSR Fix**: Wrap client APIs in GenerativeUIErrorBoundary for Railway SSR
133
+ - Additional guards for browser-only code
134
+ - Improved compatibility with Railway's Node.js environment
135
+
136
+ ## [1.0.32] - 2025-11-24
137
+
138
+ ### Fixed
139
+ - **CustomEvent SSR Fix**: Wrap CustomEvent in `onMount` for Railway SSR compatibility
140
+ - `CustomEvent` constructor doesn't exist in Node.js
141
+ - Now only created client-side during mount
142
+
143
+ ## [1.0.31] - 2025-11-24
144
+
145
+ ### Fixed
146
+ - Fix build configuration and TypeScript declarations
147
+ - Update pnpm-lock.yaml for v1.0.31 dependencies
148
+ - Ensure all type definitions are properly exported
149
+
150
+ ## [1.0.30] - 2025-11-24
151
+
152
+ ### Improved
153
+ - **Table Rendering**: Improve table rendering with markdown support
154
+ - Tables now parse markdown links in cell values
155
+ - Better export path configuration
156
+ - Enhanced styling for table cells
157
+
158
+ ## [1.0.29] - 2025-11-24
159
+
160
+ ### Added
161
+ - **SSR-Safe Type Imports**: Add `/types-only` sub-export for SSR-safe type imports
162
+ - Allows importing types without triggering component code
163
+ - Useful for server-side type checking
164
+
165
+ ```typescript
166
+ // SSR-safe type import
167
+ import type { UIResource } from '@seed-ship/mcp-ui-solid/types-only'
168
+ ```
169
+
170
+ ## [1.0.28] - 2025-11-24
171
+
172
+ ### Fixed
173
+ - **Validation Entry Point**: Compile validation.ts as proper entry point
174
+ - Fixes import errors when using `/validation` export
175
+
176
+ ## [1.0.27] - 2025-11-24
177
+
178
+ ### Fixed
179
+ - **Validation Imports**: validation.ts imports from dist instead of src
180
+ - Prevents source-map resolution issues
181
+
182
+ ## [1.0.26] - 2025-11-24
183
+
184
+ ### Changed
185
+ - Version bump (synced with mcp-ui-spec v1.0.15, mcp-ui-cli v1.0.14)
186
+
187
+ ## [1.0.25] - 2025-11-23
188
+
189
+ ### Added
190
+ - **Validation Sub-Export**: Add `/validation` sub-export for SSR-safe imports
191
+ - Validation utilities available without loading UI components
192
+ - Useful for server-side schema validation
193
+
194
+ ```typescript
195
+ import { validateUIResource } from '@seed-ship/mcp-ui-solid/validation'
196
+ ```
197
+
198
+ ### Fixed
199
+ - Add SSR compatibility checks for client-only APIs throughout codebase
200
+
201
+ ## [1.0.24] - 2025-11-23
202
+
203
+ ### Improved
204
+ - **Table Styling**: Improve table rendering with better styling
205
+ - Enhanced header styling
206
+ - Better cell padding and borders
207
+ - Improved responsive behavior
208
+
209
+ ## [1.0.23] - 2025-11-23
210
+
211
+ ### Changed
212
+ - Version bump for npm publication with updated token
213
+ - Synchronized with mcp-ui-spec v1.0.12, mcp-ui-cli v1.0.11
214
+
215
+ ## [1.0.22] - 2025-11-23
216
+
217
+ ### Changed
218
+ - Version bump for npm publication
219
+ - Synchronized with mcp-ui-spec v1.0.11, mcp-ui-cli v1.0.10
220
+
221
+ ## [1.0.21] - 2025-11-23
222
+
223
+ ### Added
224
+ - **New Renderers**: Four new component renderers for enhanced UI capabilities
225
+ - `ActionRenderer`: Interactive buttons with callback support
226
+ - `ArtifactRenderer`: File/download artifact display
227
+ - `CarouselRenderer`: Image/content carousel with navigation
228
+ - `FooterRenderer`: Metadata and footer information display
229
+ - **Validation Enhancements**: Extended validation for new component types
230
+
231
+ ### Technical Details
232
+ ActionRenderer example:
233
+ ```typescript
234
+ <ActionRenderer
235
+ action={{
236
+ type: 'action',
237
+ label: 'Download Report',
238
+ actionType: 'download',
239
+ payload: { fileId: '123' }
240
+ }}
241
+ onAction={(action) => handleAction(action)}
242
+ />
243
+ ```
244
+
245
+ ## [1.0.18] - 2025-11-22
246
+
247
+ ### Changed
248
+ - Version bump for npm publication
249
+ - Synchronized with mcp-ui-spec v1.0.8, mcp-ui-cli v1.0.8
250
+
251
+ ## [1.0.17] - 2025-11-22
252
+
253
+ ### Added
254
+ - **Component Type Validation**: Add validation for iframe, image, link component types
255
+ - Schema validation for `iframe` with src and sandbox attributes
256
+ - Schema validation for `image` with src, alt, and dimensions
257
+ - Schema validation for `link` with href and text
258
+
259
+ ## [1.0.16] - 2025-11-22
260
+
261
+ ### Fixed
262
+ - **SSR Compatibility**: Fix SSR compatibility by using CSS strings instead of style objects
263
+ - Vite's solid plugin generates different code for style objects vs strings
264
+ - CSS strings avoid the `setStyleProperty` issue in SSR
265
+
266
+ ## [1.0.15] - 2025-11-22
267
+
268
+ ### Changed
269
+ - Version bump for npm publication
270
+
271
+ ## [1.0.13] - 2025-11-17
272
+
273
+ ### Added
274
+ - **New Renderers**: Add iframe, image, and link renderers to mcp-ui-solid
275
+ - `IframeRenderer`: Secure iframe embedding with sandbox support
276
+ - `ImageRenderer`: Responsive image display with lazy loading
277
+ - `LinkRenderer`: External link rendering with proper security attributes
278
+ - **Markdown Support**: Add markdown rendering to TextRenderer
279
+ - Uses `marked` library for parsing
280
+ - Sanitizes output with DOMPurify
281
+
282
+ ### Technical Details
283
+ ```typescript
284
+ // TextRenderer now supports markdown
285
+ <TextRenderer
286
+ component={{
287
+ type: 'text',
288
+ content: '# Hello\n\nThis is **markdown**!'
289
+ }}
290
+ />
291
+ ```
292
+
293
+ ## [1.0.12] - 2025-11-17
294
+
295
+ ### Added
296
+ - **Markdown in TextRenderer**: Basic markdown support using `marked` library
297
+ - Headings, bold, italic, links, lists
298
+ - Code blocks with syntax highlighting
299
+ - Sanitized HTML output
300
+
301
+ ### Fixed
302
+ - Composite layout detection in UIResourceRenderer
303
+ - Optional chaining for componentId in error display
304
+ - Defensive position check in validateGridPosition
305
+ - Defensive position checks in UIResourceRenderer
306
+
307
+ ---
308
+
8
309
  ## [1.0.10] - 2025-11-17
9
310
 
10
311
  ### Fixed
@@ -16,8 +317,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
317
 
17
318
  ### Technical Details
18
319
  **The Missing Piece in v1.0.9:**
19
- - v1.0.9 correctly changed `generate: 'ssr'` in vite.config.ts
20
- - BUT package.json exports didn't include the `"solid"` condition
320
+ - v1.0.9 correctly changed `generate: 'ssr'` in vite.config.ts
321
+ - BUT package.json exports didn't include the `"solid"` condition
21
322
  - This caused Vite to load the same build for both SSR and browser
22
323
  - Result: Module resolution conflicts with `solid-js/web` during SSR
23
324
 
@@ -25,35 +326,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
25
326
  ```json
26
327
  {
27
328
  "./components": {
28
- "solid": "./dist/components/index.js", // ← NEW: SolidJS-aware loaders use this
29
- "import": "./dist/components/index.js", // Fallback for standard ESM
30
- "require": "./dist/components/index.cjs" // CommonJS
329
+ "solid": "./dist/components/index.js",
330
+ "import": "./dist/components/index.js",
331
+ "require": "./dist/components/index.cjs"
31
332
  }
32
333
  }
33
334
  ```
34
335
 
35
- With the `"solid"` condition:
36
- - Vite recognizes this as a SolidJS-specific module
37
- - Applies correct resolution strategy for SSR context
38
- - No more "Client-only API called on the server side" errors
39
-
40
336
  ### Why This Matters
41
337
  - **v1.0.8**: Added `isServer` guards (fixed symptoms)
42
338
  - **v1.0.9**: Changed to SSR compilation mode (fixed compilation)
43
- - **v1.0.10**: Added conditional exports (fixed module resolution) ← **Complete fix!**
44
-
45
- ### Affected Exports
46
- All package entry points now have the `"solid"` condition:
47
- - `"."` - Main export
48
- - `"./components"` - Component exports
49
- - `"./hooks"` - Hook exports
50
- - `"./types"` - Type exports
51
-
52
- ### Migration Notes
53
- - No breaking changes for consumers
54
- - Drop-in replacement for v1.0.9
55
- - Fixes persistent SSR errors on Railway, Vercel, Netlify, etc.
56
- - **This is the final piece** for complete SSR compatibility
339
+ - **v1.0.10**: Added conditional exports (fixed module resolution)
57
340
 
58
341
  ## [1.0.9] - 2025-11-17
59
342
 
@@ -62,125 +345,35 @@ All package entry points now have the `"solid"` condition:
62
345
  - Updated `generate: 'dom'` → `generate: 'ssr'` in vite.config.ts
63
346
  - Updated `hydratable: false` → `hydratable: true` in vite.config.ts
64
347
  - This prevents module-level `template()` calls that crash in SSR environments
65
- - Fixes the root cause of ALL previous SSR issues (setStyleProperty, use directive, template exports)
66
- - Package now works seamlessly in both Node.js SSR and browser environments without configuration
67
348
 
68
349
  ### Technical Details
69
- - **SSR mode** compiles JSX to server-safe string rendering instead of DOM template cloning
350
+ - **SSR mode** compiles JSX to server-safe string rendering
70
351
  - **Hydratable mode** enables client-side hydration after SSR
71
352
  - No module-level browser API calls that crash in Node.js
72
- - Components render to HTML on server, then hydrate in browser
73
- - Fully compatible with SolidStart, Railway SSR, Vercel, Netlify, and all SSR platforms
74
- - **No `ssr.external` configuration needed** in consuming applications
75
-
76
- ### Why This Is The Definitive Fix
77
- Previous versions (1.0.5-1.0.8) fixed symptoms:
78
- - v1.0.5: Fixed `setStyleProperty` by using CSS strings
79
- - v1.0.7: Fixed `use()` directive by replacing ref callbacks
80
- - v1.0.8: Fixed browser APIs by adding `isServer` guards
81
-
82
- **v1.0.9 fixes the root cause:** The `generate: 'dom'` configuration that created client-only template calls.
83
-
84
- With `generate: 'ssr'` + `hydratable: true`, the compiler generates universal code that:
85
- - ✅ Renders on the server (Node.js)
86
- - ✅ Hydrates in the browser
87
- - ✅ Falls back to client-only rendering if needed
88
- - ✅ No module-level side effects
89
-
90
- ### Performance Impact
91
- - Minimal bundle size increase (~2-5KB)
92
- - Negligible runtime performance difference (<5%)
93
- - Server-side rendering is now possible (major win!)
94
-
95
- ### Migration Notes
96
- - No breaking changes for consumers
97
- - Drop-in replacement for v1.0.8
98
- - **Recommended:** Remove `@seed-ship/mcp-ui-solid` from `ssr.external` in app.config.ts (no longer needed)
99
- - Components will now SSR by default (better SEO, faster initial load)
100
-
101
- ### Best Practices for Component Libraries
102
- This is the **recommended configuration** for SolidJS component libraries per official documentation:
103
- ```typescript
104
- solidPlugin({
105
- solid: {
106
- generate: 'ssr', // Universal code generation
107
- hydratable: true, // Enable hydration
108
- },
109
- })
110
- ```
111
353
 
112
354
  ## [1.0.8] - 2025-11-16
113
355
 
114
356
  ### Fixed
115
357
  - **CRITICAL SSR FIX**: Added `isServer` guards to all browser APIs in `GenerativeUIErrorBoundary.tsx`
116
- - Previous versions crashed on Railway SSR with: `Error: Client-only API called on the server side`
117
- - Browser APIs used without guards: `performance.now()`, `navigator.userAgent`, `window.innerWidth/height`
118
- - These APIs don't exist in Node.js SSR environment, causing immediate crashes
119
- - Solution: Wrapped all browser API calls with `isServer` conditionals
120
- - Affected locations:
121
- - Line 114: `createSignal(isServer ? 0 : performance.now())`
122
- - Line 118: `const renderEndTime = isServer ? 0 : performance.now()`
123
- - Line 130: `userAgent: isServer ? 'server' : navigator.userAgent`
124
- - Lines 131-133: `viewport: isServer ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }`
125
- - Line 203: `const renderStart = isServer ? 0 : performance.now()` (withPerformanceMonitoring)
126
- - Line 212: `if (!isServer && typeof window !== 'undefined')` (requestAnimationFrame guard)
127
- - Line 242: `const mountTime = isServer ? 0 : performance.now()` (useComponentTelemetry)
128
- - Line 252: `const lifetime = isServer ? 0 : performance.now() - mountTime`
129
-
130
- ### Technical Details
131
- - `isServer` is a compile-time constant from `solid-js/web`
132
- - On server: `isServer = true`, browser APIs return safe defaults (0, 'server', empty viewport)
133
- - On client: `isServer = false`, real browser APIs are used
134
- - No runtime overhead: dead code elimination removes unused branches
135
- - Fully compatible with SolidStart SSR on Railway and other Node.js platforms
136
-
137
- ### Migration Notes
138
- - No breaking changes for consumers
139
- - Drop-in replacement for v1.0.7
140
- - Fixes production SSR crashes on Railway and similar Node.js SSR platforms
141
- - Telemetry data will show default values on server-side renders (expected behavior)
358
+ - Browser APIs: `performance.now()`, `navigator.userAgent`, `window.innerWidth/height`
359
+ - These APIs don't exist in Node.js SSR environment
142
360
 
143
361
  ## [1.0.7] - 2025-11-16
144
362
 
145
363
  ### Fixed
146
364
  - **CRITICAL SSR FIX**: Replaced `ref` callback with `onMount` to eliminate `use()` directive
147
- - Previous versions (1.0.5, 1.0.6) used `ref={() => handleComponentRender(component.id)}`
148
- - vite-plugin-solid@2.11.8 transforms ref callbacks into `use()` directive calls
149
- - `use` is NOT exported from `solid-js/web` in Node/SSR environment (only in browser)
150
- - This caused SSR crashes on Railway: `SyntaxError: The requested module 'solid-js/web' does not provide an export named 'use'`
365
+ - `use` is NOT exported from `solid-js/web` in Node/SSR environment
151
366
  - Solution: Replaced `ref` callback with `onMount()` which is SSR-safe
152
- - Affected file: `StreamingUIRenderer.tsx` (line 207)
153
-
154
- ### Technical Details
155
- - `onMount` only executes client-side (after hydration), perfect for animations
156
- - No `use()` directive needed, no SSR/browser export mismatch
157
- - Maintains same functionality: animation triggers when component mounts
158
- - Fully compatible with solid-js@1.9.10 in both browser and Node environments
159
-
160
- ### Migration Notes
161
- - No breaking changes for consumers
162
- - Drop-in replacement for v1.0.6
163
- - Fixes production SSR crashes on Railway and similar Node.js SSR platforms
164
367
 
165
368
  ## [1.0.6] - 2025-11-16
166
369
 
167
370
  ### Fixed
168
371
  - Add `solid-js` to devDependencies for tests to pass in CI/CD
169
- - CI was failing because `solid-js` (peerDependency) wasn't available for tests
170
-
171
- ### Technical Details
172
- - `solid-js` remains a peerDependency for consuming apps
173
- - Added to devDependencies for package development and testing
174
- - No functional changes to the package itself
175
372
 
176
- ## [1.0.5] - 2025-11-16 (UNPUBLISHED - CI Failed)
373
+ ## [1.0.5] - 2025-11-16 (UNPUBLISHED)
177
374
 
178
375
  ### Fixed
179
- - **CRITICAL SSR FIX**: Replaced dynamic style objects with CSS strings to eliminate `setStyleProperty` usage
180
- - `setStyleProperty` was being generated by vite-plugin-solid but doesn't exist in solid-js/web API
181
- - This caused SSR crashes on Railway with error: `SyntaxError: The requested module 'solid-js/web' does not provide an export named 'setStyleProperty'`
182
- - Affected files: `UIResourceRenderer.tsx`, `StreamingUIRenderer.tsx`
183
- - Solution: Convert style objects to CSS strings (e.g., `style="width: 100%"` instead of `style={{ width: '100%' }}`)
376
+ - **CRITICAL SSR FIX**: Replaced dynamic style objects with CSS strings
184
377
 
185
378
  ### Changed
186
379
  - Updated `vite` from ^5.0.10 to ^6.3.6
@@ -188,29 +381,16 @@ solidPlugin({
188
381
  - Updated `vitest` from ^1.1.0 to ^4.0.8
189
382
  - Updated `solid-js` peerDependency from ^1.8.0 to ^1.9.0
190
383
 
191
- ### Technical Details
192
- The issue occurred because:
193
- 1. Old `vite-plugin-solid@2.8.2` compiled JSX style objects into calls to `setStyleProperty()`
194
- 2. `setStyleProperty` is not exported by `solid-js/web` in any version
195
- 3. The error only appeared in production SSR (Railway) because dev mode doesn't do full SSR
196
- 4. Local builds may have worked due to cached node_modules or different build artifacts
197
-
198
- ### Migration Notes
199
- - No breaking changes for consumers
200
- - Drop-in replacement for v1.0.4
201
- - Fully compatible with solid-js@1.9.x
202
-
203
384
  ## [1.0.0] - 2025-01-14
204
385
 
205
386
  ### Added
206
- - Initial release of `@mcp-ui/solid` package
387
+ - Initial release of `@seed-ship/mcp-ui-solid` package
207
388
  - `UIResourceRenderer` component for static dashboard rendering
208
389
  - `StreamingUIRenderer` component for progressive streaming rendering
209
390
  - `GenerativeUIErrorBoundary` for error isolation and retry logic
210
391
  - `useStreamingUI` hook for SSE connection management
211
392
  - Component validation and layout validation services
212
393
  - Component registry system
213
- - Internal logger utility (self-contained)
214
394
  - Full TypeScript support with comprehensive types
215
395
  - 12-column responsive grid layout system
216
396
  - Support for chart, table, metric, and text components
@@ -222,10 +402,3 @@ The issue occurred because:
222
402
  - **Type Safety**: Full TypeScript definitions
223
403
  - **Performance**: TTFB <500ms, optimized rendering
224
404
  - **Responsive**: 12-column grid with flexible positioning
225
- - **Clean API**: Simple, intuitive component interfaces
226
- - **Zero Config**: Works out of the box with sensible defaults
227
-
228
- ### Documentation
229
- - README with installation and usage examples
230
- - JSDoc comments for all public APIs
231
- - TypeScript definitions for IntelliSense support
package/README.md CHANGED
@@ -1,54 +1,304 @@
1
- # @mcp-ui/solid
1
+ # @seed-ship/mcp-ui-solid
2
2
 
3
- SolidJS components for rendering MCP-generated UI resources.
3
+ SolidJS components for rendering MCP-generated UI resources. Part of the MCP UI ecosystem.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@seed-ship/mcp-ui-solid.svg)](https://www.npmjs.com/package/@seed-ship/mcp-ui-solid)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## Overview
9
+
10
+ `@seed-ship/mcp-ui-solid` provides a complete rendering solution for MCP (Model Context Protocol) generated UIs. It enables AI/LLM systems to generate structured, interactive dashboards that are rendered with SolidJS.
11
+
12
+ **Key Use Cases:**
13
+ - Render AI-generated dashboards and reports
14
+ - Display streaming UI components progressively
15
+ - Build interactive data visualizations from MCP resources
4
16
 
5
17
  ## Installation
6
18
 
7
19
  ```bash
8
- pnpm add @mcp-ui/solid
20
+ pnpm add @seed-ship/mcp-ui-solid
21
+ # or
22
+ npm install @seed-ship/mcp-ui-solid
9
23
  ```
10
24
 
11
- ## Usage
25
+ **Peer Dependencies:**
26
+ - `solid-js` ^1.9.0
27
+
28
+ ## Quick Start
12
29
 
13
30
  ```tsx
14
- import { UIResourceRenderer, StreamingUIRenderer } from '@mcp-ui/solid'
15
- import { useStreamingUI } from '@mcp-ui/solid/hooks'
31
+ import { UIResourceRenderer, StreamingUIRenderer } from '@seed-ship/mcp-ui-solid'
16
32
 
17
- // Static rendering
33
+ // Static rendering of a pre-built layout
18
34
  function Dashboard() {
19
35
  const layout = {
20
36
  id: 'dashboard-1',
21
37
  type: 'composite',
22
- components: [/* ... */]
38
+ components: [
39
+ {
40
+ type: 'metric',
41
+ id: 'revenue',
42
+ title: 'Total Revenue',
43
+ value: '$125,430',
44
+ trend: { direction: 'up', value: '+12%' },
45
+ position: { x: 0, y: 0, width: 4, height: 1 }
46
+ },
47
+ {
48
+ type: 'chart',
49
+ id: 'sales-chart',
50
+ chartType: 'line',
51
+ data: { /* chart data */ },
52
+ position: { x: 0, y: 1, width: 8, height: 2 }
53
+ }
54
+ ]
23
55
  }
24
56
 
25
57
  return <UIResourceRenderer content={layout} />
26
58
  }
27
59
 
28
- // Streaming rendering
60
+ // Streaming rendering from an MCP server
29
61
  function StreamingDashboard() {
30
62
  return (
31
63
  <StreamingUIRenderer
32
- query="Show me revenue trends"
33
- spaceIds={['space-1']}
34
- onComplete={(metadata) => console.log('Done!', metadata)}
64
+ query="Show me quarterly revenue trends"
65
+ spaceIds={['analytics-space']}
66
+ onComplete={(metadata) => console.log('Render complete', metadata)}
67
+ onError={(error) => console.error('Render failed', error)}
35
68
  />
36
69
  )
37
70
  }
38
71
  ```
39
72
 
40
- ## Features
73
+ ## Architecture
74
+
75
+ ```
76
+ ┌─────────────────────────────────────────────────────────────┐
77
+ │ Your SolidJS App │
78
+ ├─────────────────────────────────────────────────────────────┤
79
+ │ UIResourceRenderer │ StreamingUIRenderer │
80
+ │ (static layouts) │ (progressive SSE streaming) │
81
+ ├─────────────────────────────────────────────────────────────┤
82
+ │ Component Registry │
83
+ │ ┌─────────┬─────────┬────────┬──────────┬───────────────┐ │
84
+ │ │ Chart │ Table │ Metric │ Text │ Image/Link... │ │
85
+ │ │Renderer │Renderer │Renderer│Renderer │ Renderers │ │
86
+ │ └─────────┴─────────┴────────┴──────────┴───────────────┘ │
87
+ ├─────────────────────────────────────────────────────────────┤
88
+ │ Validation │ Error Boundaries │ Grid Layout (12-col) │
89
+ └─────────────────────────────────────────────────────────────┘
90
+ ```
91
+
92
+ ## Components
93
+
94
+ ### Core Renderers
95
+
96
+ | Component | Description | Key Props |
97
+ |-----------|-------------|-----------|
98
+ | `UIResourceRenderer` | Static layout rendering | `content`, `className` |
99
+ | `StreamingUIRenderer` | Progressive SSE streaming | `query`, `spaceIds`, `onComplete`, `onError` |
100
+ | `GenerativeUIErrorBoundary` | Error isolation with retry | `fallback`, `onError` |
101
+
102
+ ### Data Display Renderers
103
+
104
+ | Component | Type | Description |
105
+ |-----------|------|-------------|
106
+ | `ChartRenderer` | `chart` | Line, bar, pie, area charts (Chart.js) |
107
+ | `TableRenderer` | `table` | Data tables with sorting, markdown links |
108
+ | `MetricRenderer` | `metric` | KPI cards with trends and sparklines |
109
+ | `TextRenderer` | `text` | Markdown-enabled text blocks |
110
+ | `ImageRenderer` | `image` | Responsive images with lazy loading |
111
+ | `LinkRenderer` | `link` | External links with security attributes |
112
+ | `IframeRenderer` | `iframe` | Secure iframe embedding (sandboxed) |
113
+
114
+ ### Interactive Renderers
115
+
116
+ | Component | Type | Description |
117
+ |-----------|------|-------------|
118
+ | `ActionRenderer` | `action` | Interactive buttons with callbacks |
119
+ | `ArtifactRenderer` | `artifact` | File download/preview |
120
+ | `CarouselRenderer` | `carousel` | Image/content carousel |
121
+ | `FooterRenderer` | `footer` | Metadata and attribution display |
122
+
123
+ ## Exports
124
+
125
+ ### Main Export
126
+
127
+ ```typescript
128
+ import {
129
+ UIResourceRenderer,
130
+ StreamingUIRenderer,
131
+ GenerativeUIErrorBoundary,
132
+ // Individual renderers
133
+ ChartRenderer,
134
+ TableRenderer,
135
+ MetricRenderer,
136
+ TextRenderer,
137
+ ActionRenderer,
138
+ // ...
139
+ } from '@seed-ship/mcp-ui-solid'
140
+ ```
141
+
142
+ ### Hooks
143
+
144
+ ```typescript
145
+ import { useStreamingUI } from '@seed-ship/mcp-ui-solid/hooks'
146
+
147
+ const { components, isComplete, error, metadata } = useStreamingUI({
148
+ query: 'Show revenue data',
149
+ spaceIds: ['space-1']
150
+ })
151
+ ```
152
+
153
+ ### Validation (SSR-Safe)
154
+
155
+ ```typescript
156
+ // Safe to import on server - no browser APIs
157
+ import { validateUIResource, validateLayout } from '@seed-ship/mcp-ui-solid/validation'
158
+
159
+ const result = validateUIResource(resource)
160
+ if (!result.valid) {
161
+ console.error(result.errors)
162
+ }
163
+ ```
164
+
165
+ ### Types Only (SSR-Safe)
166
+
167
+ ```typescript
168
+ // Type-only imports - no runtime code
169
+ import type { UIResource, UIComponent, GridPosition } from '@seed-ship/mcp-ui-solid/types-only'
170
+ ```
171
+
172
+ ## SSR Compatibility
173
+
174
+ This package is fully SSR-compatible with SolidStart, Astro, and other SSR frameworks.
175
+
176
+ ### For SolidStart Users
177
+
178
+ Add `conditions` to your `app.config.ts` for optimal SSR behavior:
179
+
180
+ ```typescript
181
+ // app.config.ts
182
+ import { defineConfig } from '@solidjs/start/config'
183
+
184
+ export default defineConfig({
185
+ vite: {
186
+ resolve: {
187
+ conditions: ['solid', 'development', 'browser']
188
+ }
189
+ }
190
+ })
191
+ ```
192
+
193
+ ### Why This Matters
194
+
195
+ The `"solid"` condition enables Vite to use source exports, which are compiled in the same context as your app. This prevents:
196
+ - Hydration mismatches between server and client
197
+ - Module resolution conflicts with `solid-js/web`
198
+ - SSR crashes from client-only APIs
199
+
200
+ ### SSR-Safe Imports
201
+
202
+ For server-side code, use the dedicated sub-exports:
203
+
204
+ ```typescript
205
+ // Server-side file (.server.ts)
206
+ import type { UIResource } from '@seed-ship/mcp-ui-solid/types-only'
207
+ import { validateUIResource } from '@seed-ship/mcp-ui-solid/validation'
208
+
209
+ // These imports don't trigger browser APIs
210
+ ```
211
+
212
+ ## Grid System
213
+
214
+ Components use a 12-column responsive grid:
215
+
216
+ ```typescript
217
+ interface GridPosition {
218
+ x: number // Column start (0-11)
219
+ y: number // Row start
220
+ width: number // Columns span (1-12)
221
+ height: number // Rows span
222
+ }
223
+
224
+ // Example: Full-width header
225
+ { x: 0, y: 0, width: 12, height: 1 }
226
+
227
+ // Example: Two columns
228
+ { x: 0, y: 1, width: 6, height: 2 } // Left half
229
+ { x: 6, y: 1, width: 6, height: 2 } // Right half
230
+ ```
231
+
232
+ ## Advanced Usage
233
+
234
+ ### Custom Component Registry
235
+
236
+ ```typescript
237
+ import { registerComponent } from '@seed-ship/mcp-ui-solid'
238
+
239
+ // Register a custom renderer
240
+ registerComponent('custom-widget', (props) => {
241
+ return <div class="custom-widget">{props.content}</div>
242
+ })
243
+ ```
244
+
245
+ ### Error Handling
246
+
247
+ ```tsx
248
+ import { GenerativeUIErrorBoundary } from '@seed-ship/mcp-ui-solid'
249
+
250
+ <GenerativeUIErrorBoundary
251
+ fallback={(error, reset) => (
252
+ <div>
253
+ <p>Something went wrong: {error.message}</p>
254
+ <button onClick={reset}>Try Again</button>
255
+ </div>
256
+ )}
257
+ onError={(error) => {
258
+ // Log to error tracking service
259
+ Sentry.captureException(error)
260
+ }}
261
+ >
262
+ <UIResourceRenderer content={layout} />
263
+ </GenerativeUIErrorBoundary>
264
+ ```
265
+
266
+ ### Streaming with Custom SSE Endpoint
267
+
268
+ ```tsx
269
+ import { useStreamingUI } from '@seed-ship/mcp-ui-solid/hooks'
270
+
271
+ function CustomStreaming() {
272
+ const { components, isComplete } = useStreamingUI({
273
+ endpoint: '/api/custom-mcp/stream',
274
+ query: 'Generate report',
275
+ headers: {
276
+ 'Authorization': 'Bearer token'
277
+ }
278
+ })
279
+
280
+ return (
281
+ <div>
282
+ {components().map(comp => (
283
+ <UIResourceRenderer content={comp} />
284
+ ))}
285
+ </div>
286
+ )
287
+ }
288
+ ```
289
+
290
+ ## Related Packages
291
+
292
+ | Package | Description |
293
+ |---------|-------------|
294
+ | [`@seed-ship/mcp-ui-spec`](../mcp-ui-spec) | JSON schemas and Zod validators |
295
+ | [`@seed-ship/mcp-ui-cli`](../mcp-ui-cli) | CLI for validation and type generation |
41
296
 
42
- - 📊 **12-Column Grid Layout**: Responsive Bootstrap-like grid system
43
- - ⚡ **Progressive Streaming**: Components appear as they're generated
44
- - 🎨 **Smooth Animations**: Fade-in effects and skeleton loading states
45
- - 🔒 **Type Safety**: Full TypeScript support
46
- - ✅ **Validation**: Built-in component and layout validation
47
- - 🛡️ **Error Boundaries**: Graceful error handling
297
+ ## Versioning
48
298
 
49
- ## Documentation
299
+ This package follows [Semantic Versioning](https://semver.org/). See [CHANGELOG.md](./CHANGELOG.md) for release notes.
50
300
 
51
- See the [full documentation](../../docs/features/generative-ui/) for more details.
301
+ **Current Version:** 1.0.43
52
302
 
53
303
  ## License
54
304
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-ship/mcp-ui-solid",
3
- "version": "1.0.43",
3
+ "version": "1.1.0",
4
4
  "description": "SolidJS components for rendering MCP-generated UI resources",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",