@seed-ship/mcp-ui-solid 2.8.0 → 2.8.1

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 (2) hide show
  1. package/README.md +61 -10
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -5,16 +5,15 @@ SolidJS components + chat toolkit for MCP-generated UI. Part of the [MCP UI ecos
5
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
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
- ## What's New in v2.6.0
9
-
10
- - **Multi-select fields** - `{ type: 'select', multiple: true }` with dropdown checkboxes + removable chips
11
- - **Autocomplete fields** - Debounced API fetch for large datasets (communes 35K+, SIRENE, addresses)
12
- - **ChatPrompt form refactor** - All 10 field types now available in ChatPrompt (was 4)
13
- - **ChatPrompt dismissLabel** - "Send as-is" button replaces X icon for better UX
14
- - **Chat Bus** (`@experimental`) - Bidirectional event/command bus for agent interactions (15 events, 10 commands)
15
- - **ChatPrompt** (`@experimental`) - Structured interactions above chat input (choice, confirm, form)
8
+ ## What's New in v2.8.0
9
+
10
+ - **ScratchpadPanel** (`@experimental`) - HITL/AITL shared workspace: agent fills sections, human edits filters and validates. Sections: data, filter (chips), preview (live stats), message, action, steps
11
+ - **Dependent fields** (`dependsOn`) - Child field fetches options from API when parent changes (e.g. department commune)
12
+ - **Live preview** - Form shows real-time stats as user fills fields (debounced POST to preview endpoint)
13
+ - **Multi-select + Autocomplete** - Dropdown checkboxes with chips, API fetch for large datasets (35K+ communes)
14
+ - **Chat Bus** (`@experimental`) - Bidirectional event/command bus for agent interactions (16 events, 10 commands)
15
+ - **ChatPrompt** (`@experimental`) - Structured interactions above chat input (choice, confirm, form, dismissLabel)
16
16
  - **19 component renderers** - chart, table, metric, text, code, map, form, modal, image-gallery, video, iframe, image, link, action, action-group, grid, carousel, artifact, footer
17
- - **Tiered iframe sandbox** - Trusted domains get `allow-same-origin`; untrusted get restrictive sandbox
18
17
 
19
18
  ## Installation
20
19
 
@@ -283,6 +282,57 @@ Three subtypes for common agent interaction patterns:
283
282
  // → response.value = { commune: "34172" }
284
283
  ```
285
284
 
285
+ ## ScratchpadPanel — HITL/AITL Shared Workspace (`@experimental`)
286
+
287
+ A shared workspace where agent and human collaborate in real-time. The agent fills sections (data, filters, preview), the human can edit filters and validate. Works for both HITL (human supervises agent) and AITL (agent supervises human/other agent).
288
+
289
+ ```tsx
290
+ import { ScratchpadPanel } from '@seed-ship/mcp-ui-solid'
291
+ import type { ScratchpadState } from '@seed-ship/mcp-ui-solid'
292
+
293
+ function WorkspaceView() {
294
+ const [state, setState] = createSignal<ScratchpadState>(/* from SSE */)
295
+
296
+ // Listen for scratchpad SSE events
297
+ bus.events.on('onScratchpad', (event) => {
298
+ if (event.scratchpad.action === 'create') setState(event.scratchpad)
299
+ if (event.scratchpad.action === 'update') setState(prev => ({ ...prev, ...event.scratchpad }))
300
+ })
301
+
302
+ return (
303
+ <ScratchpadPanel
304
+ state={state()}
305
+ onFilterChange={(filters) => {
306
+ // Send updated filters to agent
307
+ fetch('/api/chat-stream/scratchpad-update', {
308
+ method: 'POST',
309
+ body: JSON.stringify({ id: state().id, filters })
310
+ })
311
+ }}
312
+ onAction={(action) => {
313
+ if (action === 'validate') bus.commands.exec('sendPrompt', 'Valider et synthetiser')
314
+ }}
315
+ />
316
+ )
317
+ }
318
+ ```
319
+
320
+ ### Section Types
321
+
322
+ | Type | Renders | Editable | Use case |
323
+ |------|---------|:--------:|----------|
324
+ | `data` | Key-value pairs | No | Dataset info, column list |
325
+ | `filter` | Editable chips + remove | Yes | Active filters (dept, year) |
326
+ | `preview` | Count badge + summary + mini-table | No | Live result count |
327
+ | `message` | Agent bubble (info/question/warning) | No | Agent explanations |
328
+ | `action` | Buttons (primary/danger/default) | No | Validate, refine, change |
329
+ | `steps` | Stepper (done/active/pending) | No | Pipeline progress |
330
+ | `form` | Embedded form | Yes | Configuration |
331
+
332
+ ### Status Badges
333
+
334
+ `loading` → `ready` → `waiting_human` (pulsing) → `processing` → `complete`
335
+
286
336
  ## Component Renderers (19 types)
287
337
 
288
338
  | Type | Renderer | Features |
@@ -359,7 +409,7 @@ export default defineConfig({
359
409
  // Components
360
410
  import {
361
411
  UIResourceRenderer, StreamingUIRenderer, GenerativeUIErrorBoundary,
362
- ExpandableWrapper, ComponentToolbar, ChatPrompt,
412
+ ExpandableWrapper, ComponentToolbar, ChatPrompt, ScratchpadPanel,
363
413
  } from '@seed-ship/mcp-ui-solid'
364
414
 
365
415
  // Chat Bus
@@ -380,6 +430,7 @@ import type {
380
430
  ChatBus, ChatEvents, ChatCommands,
381
431
  ChatPromptConfig, ChatPromptResponse,
382
432
  AgentContext, BriefingEvent,
433
+ ScratchpadState, ScratchpadSection, ScratchpadEvent,
383
434
  UIComponent, UILayout, ComponentType,
384
435
  } from '@seed-ship/mcp-ui-solid'
385
436
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-ship/mcp-ui-solid",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "SolidJS components for rendering MCP-generated UI resources",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",