@seed-ship/mcp-ui-solid 5.1.0 → 5.2.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 (48) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +64 -13
  3. package/dist/components/FeedbackInline.cjs +57 -0
  4. package/dist/components/FeedbackInline.cjs.map +1 -0
  5. package/dist/components/FeedbackInline.d.ts +71 -0
  6. package/dist/components/FeedbackInline.d.ts.map +1 -0
  7. package/dist/components/FeedbackInline.js +57 -0
  8. package/dist/components/FeedbackInline.js.map +1 -0
  9. package/dist/index.cjs +9 -0
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +8 -2
  12. package/dist/index.d.ts +8 -2
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +11 -2
  15. package/dist/index.js.map +1 -1
  16. package/dist/services/chat-bus.cjs +71 -0
  17. package/dist/services/chat-bus.cjs.map +1 -1
  18. package/dist/services/chat-bus.d.ts +31 -1
  19. package/dist/services/chat-bus.d.ts.map +1 -1
  20. package/dist/services/chat-bus.js +71 -0
  21. package/dist/services/chat-bus.js.map +1 -1
  22. package/dist/services/chat-prompt-controller.cjs +83 -0
  23. package/dist/services/chat-prompt-controller.cjs.map +1 -0
  24. package/dist/services/chat-prompt-controller.d.ts +93 -0
  25. package/dist/services/chat-prompt-controller.d.ts.map +1 -0
  26. package/dist/services/chat-prompt-controller.js +83 -0
  27. package/dist/services/chat-prompt-controller.js.map +1 -0
  28. package/dist/stores/scratchpad-store.cjs +105 -77
  29. package/dist/stores/scratchpad-store.cjs.map +1 -1
  30. package/dist/stores/scratchpad-store.d.ts +88 -19
  31. package/dist/stores/scratchpad-store.d.ts.map +1 -1
  32. package/dist/stores/scratchpad-store.js +105 -77
  33. package/dist/stores/scratchpad-store.js.map +1 -1
  34. package/dist/types/chat-bus.d.ts +39 -0
  35. package/dist/types/chat-bus.d.ts.map +1 -1
  36. package/package.json +1 -1
  37. package/src/components/FeedbackInline.test.tsx +117 -0
  38. package/src/components/FeedbackInline.tsx +143 -0
  39. package/src/index.ts +23 -1
  40. package/src/services/chat-bus.test.ts +154 -2
  41. package/src/services/chat-bus.ts +115 -0
  42. package/src/services/chat-prompt-controller.test.ts +144 -0
  43. package/src/services/chat-prompt-controller.ts +214 -0
  44. package/src/stores/scratchpad-store.test.tsx +140 -0
  45. package/src/stores/scratchpad-store.tsx +244 -0
  46. package/src/types/chat-bus.ts +40 -0
  47. package/tsconfig.tsbuildinfo +1 -1
  48. package/src/stores/scratchpad-store.ts +0 -126
package/CHANGELOG.md CHANGED
@@ -5,6 +5,60 @@ 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
+ ## [5.2.0] - 2026-04-22
9
+
10
+ ### Added — D1 multi-instance scratchpad store
11
+
12
+ - **`createScratchpadStore()`** factory — returns an isolated `ScratchpadStoreHandle` (`dispatch`, `state`, `pinned`, `close`). Closes the v4.x known limitation that two `ScratchpadPanel` instances shared state.
13
+ - **`ScratchpadStoreProvider`** + **`ScratchpadStoreContext`** — scope a store to a SolidJS subtree. Accepts an optional `store` prop; creates one internally otherwise.
14
+ - **`useScratchpadState()` is now context-aware** — reads the provider's store when mounted inside one, falls back to the module singleton otherwise. Zero-breaking for v4.x single-instance consumers.
15
+ - Type export : `ScratchpadStoreHandle`.
16
+
17
+ ### Added — D2 ChatPrompt controller primitive
18
+
19
+ - **`createChatPromptController()`** — one primitive owning resolver closure + `AbortSignal` wiring + re-entrance policy. Consumers go from ~20 LOC of hand-threaded resolver to `bus.commands.handle('showChatPrompt', ctrl.handle)` + `<Show when={ctrl.activePrompt()}>{cfg => <ChatPrompt ... />}</Show>`.
20
+ - **`PromptReplacedError`** — exported error class thrown when a new `showChatPrompt` arrives before the previous resolves. Use `instanceof` or `err.name === 'PromptReplacedError'`.
21
+ - **`AbortSignal` honoured** — already-aborted signals reject synchronously with `DOMException('Prompt aborted', 'AbortError')` without showing UI. In-flight aborts reject + clear `activePrompt`.
22
+ - **`ctrl.abort(reason?)`** — programmatic cancellation (route change, modal close, ...).
23
+ - Type export : `ChatPromptController`.
24
+
25
+ ### Added — D5 per-message inline feedback
26
+
27
+ - **`<FeedbackInline>`** — per-message thumbs up/down, non-blocking, many can coexist. Complements `ChatPrompt` (modal one-at-a-time) and `ScratchpadPanel` feedback section (structured, panel-side). Optimistic UI, best-effort persistence via consumer-owned `onSubmit(rating, context)`.
28
+ - Type exports : `FeedbackInlineProps`, `FeedbackInlineContext`.
29
+
30
+ ### Added — D6 MCP elicitation handling
31
+
32
+ - **`ChatEvents.onElicitation`** — new event for MCP `elicitation/create` requests (spec 2025-06-18). Symmetric to `onClarificationNeeded`.
33
+ - **Types** : `ElicitationEvent`, `ElicitationRequestedSchema`, `ElicitationPropertySchema`.
34
+ - **`elicitationToPromptConfig(event)`** — converts an MCP elicitation payload to a `ChatPromptConfig`. Smart mapping :
35
+ - Single `boolean` property → `type: 'confirm'`
36
+ - Single property with `enum` of ≤4 values → `type: 'choice'`
37
+ - Anything else → `type: 'form'` with per-property field-type inference
38
+ - Inferences : `string` → `text`, `string/format:email` → `email`, `string/format:date|date-time` → `date`, `number|integer` → `number`, `boolean` → `checkbox`, any `enum` → `select`.
39
+
40
+ ### Tests
41
+
42
+ - **467 passing** (+29 vs v5.1.0).
43
+ - New files : `stores/scratchpad-store.test.tsx` (7), `services/chat-prompt-controller.test.ts` (7), `components/FeedbackInline.test.tsx` (7).
44
+ - Extended `services/chat-bus.test.ts` with 8 new elicitation tests.
45
+
46
+ ### Non-breaking
47
+
48
+ - All additions are optional.
49
+ - `scratchpad-store.ts` refactored to extract a factory; module singleton remains as default so `dispatchScratchpad` / `useScratchpadState` keep working identically.
50
+
51
+ ### Design rationale
52
+
53
+ Full scope doc lives in the Deposium project : `docs/2026/r&d/mcpui-v5.2.0-scope.md`. It regroups v5.1.0 consensus carry-forward (D1, D2) with two new items arising from the MCP SDK audit 2026-04-14 (D5 feedback inline, D6 elicitation helper).
54
+
55
+ ### Deferred
56
+
57
+ - `<ElicitationForm>` schema-driven form renderer — waiting for real Claude Desktop payloads.
58
+ - `createChatPromptController` FIFO queue mode — YAGNI until a concrete need.
59
+ - `useServerCapabilities()` hook — needs a second consumer + Phase B protocol align on `capabilities.extensions`.
60
+ - OAuth client-side docs — add as a doc patch when Deposium moves to OAuth Resource Server.
61
+
8
62
  ## [5.1.0] - 2026-04-14
9
63
 
10
64
  ### Added — D4 custom choice rendering
package/README.md CHANGED
@@ -5,13 +5,21 @@ 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 v5.2.0 (`mcp-ui-solid` only)
9
+
10
+ - **`createChatPromptController()`** primitive — closes the v5.1.0 boilerplate. Owns resolver closure + `AbortSignal` wiring + re-entrance. Consumers write `bus.commands.handle('showChatPrompt', ctrl.handle)` + `<Show when={ctrl.activePrompt()}>{cfg => <ChatPrompt ... />}</Show>`. `PromptReplacedError` exported for `instanceof` checks.
11
+ - **`createScratchpadStore()`** factory + `ScratchpadStoreProvider` + `ScratchpadStoreContext` — isolated scratchpad state per subtree. `useScratchpadState()` now context-aware with module-singleton fallback (zero-breaking for v4.x).
12
+ - **`<FeedbackInline>`** — per-message thumbs up/down, non-blocking. Complements `ChatPrompt` (modal) and `ScratchpadPanel` feedback section (panel-side).
13
+ - **`onElicitation` event + `elicitationToPromptConfig()` helper** — MCP `elicitation/create` (spec 2025-06-18) mapped to `ChatPromptConfig`. Smart mapping : single boolean → confirm, single enum ≤4 → choice, everything else → form with per-property field inference.
14
+ - **29 new tests** (438 → 467). Scope doc : `docs/2026/r&d/mcpui-v5.2.0-scope.md` in the Deposium project.
15
+
8
16
  ## What's New in v5.1.0 (`mcp-ui-solid` only)
9
17
 
10
18
  - **`optionRenderer` render prop** on `ChoicePromptConfig` — take full control of option bodies (confidence badges, rich layouts). mcp-ui still wraps the returned JSX in its own `<button>` with `onClick` + focus handling. See `optionRenderer (v5.1.0)` tests in `ChatPrompt.test.tsx` for usage.
11
19
  - **Generic `ChoicePromptConfig<TMeta>`** — `ChoiceOption<TMeta>` flows through so your renderer closures get strongly-typed `option.metadata` without casting. Default `TMeta = Record<string, unknown>` keeps the non-generic shape valid for existing callers.
12
20
  - **`buttonClass?` + `containerClass?`** escape hatches on `ChoicePromptConfig` — Tailwind class extensions that append to mcp-ui's defaults for light cosmetic tweaks without writing a full renderer.
13
21
  - **`type="button"` on option buttons** — prevents accidental form submission when a `ChatPrompt` is nested inside an HTML `<form>`.
14
- - **`ChatPrompt` + `showChatPrompt` JSDoc rewritten** — explicitly states the consumer contract : no default handler, Promise wiring is host-side, `AbortSignal` rejects with `DOMException('AbortError')` per Web Platform convention, re-entrance policy is host-enforced. Full reference wiring example in the README below. A `createChatPromptController()` primitive landing in v5.2.0 will bundle all of this.
22
+ - **`ChatPrompt` + `showChatPrompt` JSDoc rewritten** — explicitly states the consumer contract : no default handler, Promise wiring is host-side, `AbortSignal` rejects with `DOMException('AbortError')` per Web Platform convention, re-entrance policy is host-enforced. Now available as a one-call primitive via `createChatPromptController()` in v5.2.0.
15
23
 
16
24
  ## What's New in v5.0.0
17
25
 
@@ -417,18 +425,60 @@ Every `ChatPrompt` exchange ends in one of three outcomes:
417
425
  | Dismissed | Click the X icon, click Cancel (confirm type) | `true` | resolves |
418
426
  | Aborted | Host app rejects the Promise via `AbortSignal` | *(n/a — never resolves)* | rejects with `DOMException('AbortError')` |
419
427
 
420
- > **v5.1.0 note** — `showChatPrompt` has **no default handler** in mcp-ui.
421
- > The command name is declared on the bus, but every consumer wires its own
422
- > handler. The handler is responsible for threading the Promise resolver
423
- > through the SolidJS lifecycle AND for honouring the optional `AbortSignal`.
424
- > A `createChatPromptController()` primitive that bundles all of this will
425
- > land in v5.2.0 — see the v5.1.0 design doc.
428
+ > **v5.2.0** — use `createChatPromptController()` (below). The manual pattern
429
+ > documented after it is kept for context and for consumers who prefer full
430
+ > control over the resolver lifecycle.
431
+
432
+ #### Recommended `createChatPromptController()` (v5.2.0)
433
+
434
+ ```tsx
435
+ import { Show } from 'solid-js'
436
+ import {
437
+ ChatPrompt,
438
+ useChatBus,
439
+ createChatPromptController,
440
+ PromptReplacedError,
441
+ } from '@seed-ship/mcp-ui-solid'
442
+
443
+ function HitlHost() {
444
+ const bus = useChatBus()
445
+ const ctrl = createChatPromptController()
446
+ bus.commands.handle('showChatPrompt', ctrl.handle)
447
+
448
+ return (
449
+ <Show when={ctrl.activePrompt()}>
450
+ {(cfg) => (
451
+ <ChatPrompt
452
+ config={cfg()}
453
+ onSubmit={ctrl.resolveActive}
454
+ onDismiss={ctrl.dismissActive}
455
+ />
456
+ )}
457
+ </Show>
458
+ )
459
+ }
460
+ ```
461
+
462
+ Caller-side, re-entrance and abort are standard :
463
+
464
+ ```ts
465
+ try {
466
+ const response = await bus.commands.exec('showChatPrompt', config, ac.signal)
467
+ // ...
468
+ } catch (err) {
469
+ if (err instanceof PromptReplacedError) return // superseded by a newer prompt
470
+ if (err instanceof Error && err.name === 'AbortError') return // navigation killed it
471
+ throw err
472
+ }
473
+ ```
474
+
475
+ `ctrl.abort(reason?)` is also available for programmatic cancellation
476
+ (modal close, route change, ...).
426
477
 
427
- #### Wiring a handler yourself (v5.1.0)
478
+ #### Manual wiring (v5.1.0 reference pattern)
428
479
 
429
- Until the v5.2.0 controller ships, here is the reference pattern every
430
- consumer should implement. It honours re-entrance (auto-reject the previous
431
- prompt) and `AbortSignal` (rejects with a Web-Platform `DOMException`):
480
+ Equivalent to the controller above useful if you want full control over
481
+ the resolver closure, or if you're maintaining a v5.1.0 codebase :
432
482
 
433
483
  ```tsx
434
484
  import { createSignal } from 'solid-js'
@@ -513,8 +563,9 @@ try {
513
563
  }
514
564
  ```
515
565
 
516
- Once `createChatPromptController()` ships in v5.2.0 this boilerplate
517
- collapses to `bus.commands.handle('showChatPrompt', ctrl.handle)`.
566
+ v5.2.0 collapses this to a single `createChatPromptController()` call see
567
+ above. Prefer the controller unless you have a reason to manage the
568
+ lifecycle yourself.
518
569
 
519
570
  ### correlationId — host-propagated (v4.3.9)
520
571
 
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const web = require("solid-js/web");
4
+ const solidJs = require("solid-js");
5
+ var _tmpl$ = /* @__PURE__ */ web.template(`<button type=button class="p-1 rounded hover:bg-green-500/10 text-deposium-slate-500 hover:text-green-500 transition-colors"title=Utile aria-label="Mark response as useful"data-feedback-inline-rating=positive><svg class="w-3.5 h-3.5"fill=none stroke=currentColor viewBox="0 0 24 24"><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M14 9V5a3 3 0 00-3-3l-4 9v11h11.28a2 2 0 002-1.7l1.38-9a2 2 0 00-2-2.3H14z M3 15v7">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button type=button class="p-1 rounded hover:bg-red-500/10 text-deposium-slate-500 hover:text-red-500 transition-colors"title="Pas utile"aria-label="Mark response as not useful"data-feedback-inline-rating=negative><svg class="w-3.5 h-3.5"fill=none stroke=currentColor viewBox="0 0 24 24"><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M10 15v4a3 3 0 003 3l4-9V2H5.72a2 2 0 00-2 1.7l-1.38 9a2 2 0 002 2.3H10z M21 4v7">`), _tmpl$3 = /* @__PURE__ */ web.template(`<div>`), _tmpl$4 = /* @__PURE__ */ web.template(`<span class="text-[11px] text-deposium-slate-500">`);
6
+ const FeedbackInline = (props) => {
7
+ const [rating, setRating] = solidJs.createSignal(null);
8
+ const handle = (value) => {
9
+ if (rating() !== null) return;
10
+ setRating(value);
11
+ try {
12
+ const result = props.onSubmit(value, props.context);
13
+ if (result && typeof result.catch === "function") {
14
+ ;
15
+ result.catch(() => {
16
+ });
17
+ }
18
+ } catch {
19
+ }
20
+ };
21
+ return (() => {
22
+ var _el$ = web.getNextElement(_tmpl$3);
23
+ web.insert(_el$, web.createComponent(solidJs.Show, {
24
+ get when() {
25
+ return rating() === null;
26
+ },
27
+ get fallback() {
28
+ return (() => {
29
+ var _el$4 = web.getNextElement(_tmpl$4);
30
+ web.insert(_el$4, (() => {
31
+ var _c$ = web.memo(() => rating() === "positive");
32
+ return () => _c$() ? props.positiveAck ?? "Merci !" : props.negativeAck ?? "Noté, on s'améliore";
33
+ })());
34
+ return _el$4;
35
+ })();
36
+ },
37
+ get children() {
38
+ return [(() => {
39
+ var _el$2 = web.getNextElement(_tmpl$);
40
+ _el$2.$$click = () => handle("positive");
41
+ web.runHydrationEvents();
42
+ return _el$2;
43
+ })(), (() => {
44
+ var _el$3 = web.getNextElement(_tmpl$2);
45
+ _el$3.$$click = () => handle("negative");
46
+ web.runHydrationEvents();
47
+ return _el$3;
48
+ })()];
49
+ }
50
+ }));
51
+ web.effect(() => web.className(_el$, `flex items-center gap-1 ${props.class ?? ""}`.trim()));
52
+ return _el$;
53
+ })();
54
+ };
55
+ web.delegateEvents(["click"]);
56
+ exports.FeedbackInline = FeedbackInline;
57
+ //# sourceMappingURL=FeedbackInline.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedbackInline.cjs","sources":["../../src/components/FeedbackInline.tsx"],"sourcesContent":["/**\n * FeedbackInline — per-message inline feedback (thumbs up/down)\n *\n * @experimental\n * @since v5.2.0\n *\n * A small, non-blocking per-message feedback primitive. Sits next to an\n * assistant message, captures a rating, calls back to the consumer for\n * persistence. Best-effort by design — no retry UX, no revision UX.\n *\n * ## When to use vs other feedback primitives\n *\n * - **`FeedbackInline`** (this) → per-message thumb-up/down, non-blocking,\n * many can coexist.\n * - **`ChatPrompt` (type=choice)** → modal, one-at-a-time above the input,\n * used when the agent needs a blocking answer.\n * - **`ScratchpadPanel` feedback section** → structured feedback bound to a\n * scratchpad turn, panel-side.\n *\n * ## Persistence is the consumer's job\n *\n * The component flips to \"submitted\" state *optimistically* on click and\n * calls `onSubmit(rating, context)`. Network failures do not revert the UI —\n * feedback is best-effort. If you need stricter semantics (offline retry,\n * revision, ...) wrap this in your own component.\n *\n * @example\n * ```tsx\n * <FeedbackInline\n * messageHash={msg.hash}\n * context={{ intent: msg.intent, confidenceBand: msg.band }}\n * onSubmit={(rating, ctx) =>\n * fetch('/api/feedback', {\n * method: 'POST',\n * headers: { 'Content-Type': 'application/json' },\n * body: JSON.stringify({ message_hash: msg.hash, rating, ...ctx }),\n * })\n * }\n * />\n * ```\n */\n\nimport { Component, Show, createSignal } from 'solid-js'\n\nexport interface FeedbackInlineContext {\n intent?: string\n confidenceBand?: string\n tags?: string[]\n [key: string]: unknown\n}\n\nexport interface FeedbackInlineProps {\n /** Stable identifier for the message being rated. */\n messageHash?: string\n /**\n * Called on click. Consumer is responsible for persistence (HTTP, store,\n * localStorage). Return value ignored.\n */\n onSubmit: (rating: 'positive' | 'negative', context?: FeedbackInlineContext) => void | Promise<void>\n /** Extra context forwarded to `onSubmit`. */\n context?: FeedbackInlineContext\n /** Ack text shown after positive rating. Default: 'Merci !' */\n positiveAck?: string\n /** Ack text shown after negative rating. Default: \"Noté, on s'améliore\" */\n negativeAck?: string\n /** Extra Tailwind classes on the container. */\n class?: string\n}\n\n/**\n * @experimental\n * Per-message inline feedback (thumbs up/down). Non-blocking.\n */\nexport const FeedbackInline: Component<FeedbackInlineProps> = (props) => {\n const [rating, setRating] = createSignal<'positive' | 'negative' | null>(null)\n\n const handle = (value: 'positive' | 'negative') => {\n if (rating() !== null) return // already submitted, final state\n setRating(value)\n try {\n // Fire-and-forget. If the consumer returns a Promise that rejects,\n // swallow it — feedback is best-effort by design.\n const result = props.onSubmit(value, props.context)\n if (result && typeof (result as Promise<void>).catch === 'function') {\n ;(result as Promise<void>).catch(() => {\n /* non-blocking */\n })\n }\n } catch {\n /* non-blocking */\n }\n }\n\n return (\n <div class={`flex items-center gap-1 ${props.class ?? ''}`.trim()}>\n <Show\n when={rating() === null}\n fallback={\n <span class=\"text-[11px] text-deposium-slate-500\">\n {rating() === 'positive'\n ? (props.positiveAck ?? 'Merci !')\n : (props.negativeAck ?? \"Noté, on s'améliore\")}\n </span>\n }\n >\n <button\n type=\"button\"\n onClick={() => handle('positive')}\n class=\"p-1 rounded hover:bg-green-500/10 text-deposium-slate-500 hover:text-green-500 transition-colors\"\n title=\"Utile\"\n aria-label=\"Mark response as useful\"\n data-feedback-inline-rating=\"positive\"\n >\n <svg class=\"w-3.5 h-3.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M14 9V5a3 3 0 00-3-3l-4 9v11h11.28a2 2 0 002-1.7l1.38-9a2 2 0 00-2-2.3H14z M3 15v7\"\n />\n </svg>\n </button>\n <button\n type=\"button\"\n onClick={() => handle('negative')}\n class=\"p-1 rounded hover:bg-red-500/10 text-deposium-slate-500 hover:text-red-500 transition-colors\"\n title=\"Pas utile\"\n aria-label=\"Mark response as not useful\"\n data-feedback-inline-rating=\"negative\"\n >\n <svg class=\"w-3.5 h-3.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M10 15v4a3 3 0 003 3l4-9V2H5.72a2 2 0 00-2 1.7l-1.38 9a2 2 0 002 2.3H10z M21 4v7\"\n />\n </svg>\n </button>\n </Show>\n </div>\n )\n}\n"],"names":["FeedbackInline","props","rating","setRating","createSignal","handle","value","result","onSubmit","context","catch","_el$","_$getNextElement","_tmpl$3","_$insert","_$createComponent","Show","when","fallback","_el$4","_tmpl$4","_c$","_$memo","positiveAck","negativeAck","children","_el$2","_tmpl$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O,UAAU;AAACwB,iCAAAA;AAAA,iBAAAC;AAAAA,QAAA,IAAA;AAAA,MAAA;AAAA,IAAA,CAAA,CAAA;AAAAE,QAAAA,OAAA,MAAAC,IAAAA,UAAAtB,MA9B3B,2BAA2BV,MAAMiC,SAAS,EAAE,GAAGC,KAAAA,CAAM,CAAA;AAAA,WAAAxB;AAAAA,EAAA,GAAA;AAgDrE;AAACyB,IAAAA,eAAA,CAAA,OAAA,CAAA;;"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * FeedbackInline — per-message inline feedback (thumbs up/down)
3
+ *
4
+ * @experimental
5
+ * @since v5.2.0
6
+ *
7
+ * A small, non-blocking per-message feedback primitive. Sits next to an
8
+ * assistant message, captures a rating, calls back to the consumer for
9
+ * persistence. Best-effort by design — no retry UX, no revision UX.
10
+ *
11
+ * ## When to use vs other feedback primitives
12
+ *
13
+ * - **`FeedbackInline`** (this) → per-message thumb-up/down, non-blocking,
14
+ * many can coexist.
15
+ * - **`ChatPrompt` (type=choice)** → modal, one-at-a-time above the input,
16
+ * used when the agent needs a blocking answer.
17
+ * - **`ScratchpadPanel` feedback section** → structured feedback bound to a
18
+ * scratchpad turn, panel-side.
19
+ *
20
+ * ## Persistence is the consumer's job
21
+ *
22
+ * The component flips to "submitted" state *optimistically* on click and
23
+ * calls `onSubmit(rating, context)`. Network failures do not revert the UI —
24
+ * feedback is best-effort. If you need stricter semantics (offline retry,
25
+ * revision, ...) wrap this in your own component.
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * <FeedbackInline
30
+ * messageHash={msg.hash}
31
+ * context={{ intent: msg.intent, confidenceBand: msg.band }}
32
+ * onSubmit={(rating, ctx) =>
33
+ * fetch('/api/feedback', {
34
+ * method: 'POST',
35
+ * headers: { 'Content-Type': 'application/json' },
36
+ * body: JSON.stringify({ message_hash: msg.hash, rating, ...ctx }),
37
+ * })
38
+ * }
39
+ * />
40
+ * ```
41
+ */
42
+ import { Component } from 'solid-js';
43
+ export interface FeedbackInlineContext {
44
+ intent?: string;
45
+ confidenceBand?: string;
46
+ tags?: string[];
47
+ [key: string]: unknown;
48
+ }
49
+ export interface FeedbackInlineProps {
50
+ /** Stable identifier for the message being rated. */
51
+ messageHash?: string;
52
+ /**
53
+ * Called on click. Consumer is responsible for persistence (HTTP, store,
54
+ * localStorage). Return value ignored.
55
+ */
56
+ onSubmit: (rating: 'positive' | 'negative', context?: FeedbackInlineContext) => void | Promise<void>;
57
+ /** Extra context forwarded to `onSubmit`. */
58
+ context?: FeedbackInlineContext;
59
+ /** Ack text shown after positive rating. Default: 'Merci !' */
60
+ positiveAck?: string;
61
+ /** Ack text shown after negative rating. Default: "Noté, on s'améliore" */
62
+ negativeAck?: string;
63
+ /** Extra Tailwind classes on the container. */
64
+ class?: string;
65
+ }
66
+ /**
67
+ * @experimental
68
+ * Per-message inline feedback (thumbs up/down). Non-blocking.
69
+ */
70
+ export declare const FeedbackInline: Component<FeedbackInlineProps>;
71
+ //# sourceMappingURL=FeedbackInline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedbackInline.d.ts","sourceRoot":"","sources":["../../src/components/FeedbackInline.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,SAAS,EAAsB,MAAM,UAAU,CAAA;AAExD,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,EAAE,OAAO,CAAC,EAAE,qBAAqB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpG,6CAA6C;IAC7C,OAAO,CAAC,EAAE,qBAAqB,CAAA;IAC/B,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,mBAAmB,CAqEzD,CAAA"}
@@ -0,0 +1,57 @@
1
+ import { delegateEvents, getNextElement, template, insert, createComponent, runHydrationEvents, memo, effect, className } from "solid-js/web";
2
+ import { createSignal, Show } from "solid-js";
3
+ var _tmpl$ = /* @__PURE__ */ template(`<button type=button class="p-1 rounded hover:bg-green-500/10 text-deposium-slate-500 hover:text-green-500 transition-colors"title=Utile aria-label="Mark response as useful"data-feedback-inline-rating=positive><svg class="w-3.5 h-3.5"fill=none stroke=currentColor viewBox="0 0 24 24"><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M14 9V5a3 3 0 00-3-3l-4 9v11h11.28a2 2 0 002-1.7l1.38-9a2 2 0 00-2-2.3H14z M3 15v7">`), _tmpl$2 = /* @__PURE__ */ template(`<button type=button class="p-1 rounded hover:bg-red-500/10 text-deposium-slate-500 hover:text-red-500 transition-colors"title="Pas utile"aria-label="Mark response as not useful"data-feedback-inline-rating=negative><svg class="w-3.5 h-3.5"fill=none stroke=currentColor viewBox="0 0 24 24"><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M10 15v4a3 3 0 003 3l4-9V2H5.72a2 2 0 00-2 1.7l-1.38 9a2 2 0 002 2.3H10z M21 4v7">`), _tmpl$3 = /* @__PURE__ */ template(`<div>`), _tmpl$4 = /* @__PURE__ */ template(`<span class="text-[11px] text-deposium-slate-500">`);
4
+ const FeedbackInline = (props) => {
5
+ const [rating, setRating] = createSignal(null);
6
+ const handle = (value) => {
7
+ if (rating() !== null) return;
8
+ setRating(value);
9
+ try {
10
+ const result = props.onSubmit(value, props.context);
11
+ if (result && typeof result.catch === "function") {
12
+ ;
13
+ result.catch(() => {
14
+ });
15
+ }
16
+ } catch {
17
+ }
18
+ };
19
+ return (() => {
20
+ var _el$ = getNextElement(_tmpl$3);
21
+ insert(_el$, createComponent(Show, {
22
+ get when() {
23
+ return rating() === null;
24
+ },
25
+ get fallback() {
26
+ return (() => {
27
+ var _el$4 = getNextElement(_tmpl$4);
28
+ insert(_el$4, (() => {
29
+ var _c$ = memo(() => rating() === "positive");
30
+ return () => _c$() ? props.positiveAck ?? "Merci !" : props.negativeAck ?? "Noté, on s'améliore";
31
+ })());
32
+ return _el$4;
33
+ })();
34
+ },
35
+ get children() {
36
+ return [(() => {
37
+ var _el$2 = getNextElement(_tmpl$);
38
+ _el$2.$$click = () => handle("positive");
39
+ runHydrationEvents();
40
+ return _el$2;
41
+ })(), (() => {
42
+ var _el$3 = getNextElement(_tmpl$2);
43
+ _el$3.$$click = () => handle("negative");
44
+ runHydrationEvents();
45
+ return _el$3;
46
+ })()];
47
+ }
48
+ }));
49
+ effect(() => className(_el$, `flex items-center gap-1 ${props.class ?? ""}`.trim()));
50
+ return _el$;
51
+ })();
52
+ };
53
+ delegateEvents(["click"]);
54
+ export {
55
+ FeedbackInline
56
+ };
57
+ //# sourceMappingURL=FeedbackInline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedbackInline.js","sources":["../../src/components/FeedbackInline.tsx"],"sourcesContent":["/**\n * FeedbackInline — per-message inline feedback (thumbs up/down)\n *\n * @experimental\n * @since v5.2.0\n *\n * A small, non-blocking per-message feedback primitive. Sits next to an\n * assistant message, captures a rating, calls back to the consumer for\n * persistence. Best-effort by design — no retry UX, no revision UX.\n *\n * ## When to use vs other feedback primitives\n *\n * - **`FeedbackInline`** (this) → per-message thumb-up/down, non-blocking,\n * many can coexist.\n * - **`ChatPrompt` (type=choice)** → modal, one-at-a-time above the input,\n * used when the agent needs a blocking answer.\n * - **`ScratchpadPanel` feedback section** → structured feedback bound to a\n * scratchpad turn, panel-side.\n *\n * ## Persistence is the consumer's job\n *\n * The component flips to \"submitted\" state *optimistically* on click and\n * calls `onSubmit(rating, context)`. Network failures do not revert the UI —\n * feedback is best-effort. If you need stricter semantics (offline retry,\n * revision, ...) wrap this in your own component.\n *\n * @example\n * ```tsx\n * <FeedbackInline\n * messageHash={msg.hash}\n * context={{ intent: msg.intent, confidenceBand: msg.band }}\n * onSubmit={(rating, ctx) =>\n * fetch('/api/feedback', {\n * method: 'POST',\n * headers: { 'Content-Type': 'application/json' },\n * body: JSON.stringify({ message_hash: msg.hash, rating, ...ctx }),\n * })\n * }\n * />\n * ```\n */\n\nimport { Component, Show, createSignal } from 'solid-js'\n\nexport interface FeedbackInlineContext {\n intent?: string\n confidenceBand?: string\n tags?: string[]\n [key: string]: unknown\n}\n\nexport interface FeedbackInlineProps {\n /** Stable identifier for the message being rated. */\n messageHash?: string\n /**\n * Called on click. Consumer is responsible for persistence (HTTP, store,\n * localStorage). Return value ignored.\n */\n onSubmit: (rating: 'positive' | 'negative', context?: FeedbackInlineContext) => void | Promise<void>\n /** Extra context forwarded to `onSubmit`. */\n context?: FeedbackInlineContext\n /** Ack text shown after positive rating. Default: 'Merci !' */\n positiveAck?: string\n /** Ack text shown after negative rating. Default: \"Noté, on s'améliore\" */\n negativeAck?: string\n /** Extra Tailwind classes on the container. */\n class?: string\n}\n\n/**\n * @experimental\n * Per-message inline feedback (thumbs up/down). Non-blocking.\n */\nexport const FeedbackInline: Component<FeedbackInlineProps> = (props) => {\n const [rating, setRating] = createSignal<'positive' | 'negative' | null>(null)\n\n const handle = (value: 'positive' | 'negative') => {\n if (rating() !== null) return // already submitted, final state\n setRating(value)\n try {\n // Fire-and-forget. If the consumer returns a Promise that rejects,\n // swallow it — feedback is best-effort by design.\n const result = props.onSubmit(value, props.context)\n if (result && typeof (result as Promise<void>).catch === 'function') {\n ;(result as Promise<void>).catch(() => {\n /* non-blocking */\n })\n }\n } catch {\n /* non-blocking */\n }\n }\n\n return (\n <div class={`flex items-center gap-1 ${props.class ?? ''}`.trim()}>\n <Show\n when={rating() === null}\n fallback={\n <span class=\"text-[11px] text-deposium-slate-500\">\n {rating() === 'positive'\n ? (props.positiveAck ?? 'Merci !')\n : (props.negativeAck ?? \"Noté, on s'améliore\")}\n </span>\n }\n >\n <button\n type=\"button\"\n onClick={() => handle('positive')}\n class=\"p-1 rounded hover:bg-green-500/10 text-deposium-slate-500 hover:text-green-500 transition-colors\"\n title=\"Utile\"\n aria-label=\"Mark response as useful\"\n data-feedback-inline-rating=\"positive\"\n >\n <svg class=\"w-3.5 h-3.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M14 9V5a3 3 0 00-3-3l-4 9v11h11.28a2 2 0 002-1.7l1.38-9a2 2 0 00-2-2.3H14z M3 15v7\"\n />\n </svg>\n </button>\n <button\n type=\"button\"\n onClick={() => handle('negative')}\n class=\"p-1 rounded hover:bg-red-500/10 text-deposium-slate-500 hover:text-red-500 transition-colors\"\n title=\"Pas utile\"\n aria-label=\"Mark response as not useful\"\n data-feedback-inline-rating=\"negative\"\n >\n <svg class=\"w-3.5 h-3.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M10 15v4a3 3 0 003 3l4-9V2H5.72a2 2 0 00-2 1.7l-1.38 9a2 2 0 002 2.3H10z M21 4v7\"\n />\n </svg>\n </button>\n </Show>\n </div>\n )\n}\n"],"names":["FeedbackInline","props","rating","setRating","createSignal","handle","value","result","onSubmit","context","catch","_el$","_$getNextElement","_tmpl$3","_$insert","_$createComponent","Show","when","fallback","_el$4","_tmpl$4","_c$","_$memo","positiveAck","negativeAck","children","_el$2","_tmpl$","$$click","_$runHydrationEvents","_el$3","_tmpl$2","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AAAAE,WAAA,MAAAC,UAAAtB,MA9B3B,2BAA2BV,MAAMiC,SAAS,EAAE,GAAGC,KAAAA,CAAM,CAAA;AAAA,WAAAxB;AAAAA,EAAA,GAAA;AAgDrE;AAACyB,eAAA,CAAA,OAAA,CAAA;"}
package/dist/index.cjs CHANGED
@@ -27,6 +27,7 @@ const ResizeHandle = require("./components/ResizeHandle.cjs");
27
27
  const EditableUIResourceRenderer = require("./components/EditableUIResourceRenderer.cjs");
28
28
  const ExpandableWrapper = require("./components/ExpandableWrapper.cjs");
29
29
  const ComponentToolbar = require("./components/ComponentToolbar.cjs");
30
+ const FeedbackInline = require("./components/FeedbackInline.cjs");
30
31
  const useChatBus = require("./hooks/useChatBus.cjs");
31
32
  const ChatPrompt = require("./components/ChatPrompt.cjs");
32
33
  const ScratchpadPanel = require("./components/ScratchpadPanel.cjs");
@@ -52,6 +53,7 @@ const validation = require("./services/validation.cjs");
52
53
  const componentRegistry = require("./services/component-registry.cjs");
53
54
  const chatBus = require("./services/chat-bus.cjs");
54
55
  const dataValidator = require("./services/data-validator.cjs");
56
+ const chatPromptController = require("./services/chat-prompt-controller.cjs");
55
57
  const index = require("./testing/index.cjs");
56
58
  exports.UIResourceRenderer = UIResourceRenderer.UIResourceRenderer;
57
59
  exports.StreamingUIRenderer = StreamingUIRenderer.StreamingUIRenderer;
@@ -69,10 +71,14 @@ exports.EditableUIResourceRenderer = EditableUIResourceRenderer.EditableUIResour
69
71
  exports.ExpandableWrapper = ExpandableWrapper.ExpandableWrapper;
70
72
  exports.useExpanded = ExpandableWrapper.useExpanded;
71
73
  exports.ComponentToolbar = ComponentToolbar.ComponentToolbar;
74
+ exports.FeedbackInline = FeedbackInline.FeedbackInline;
72
75
  exports.ChatBusProvider = useChatBus.ChatBusProvider;
73
76
  exports.useChatBus = useChatBus.useChatBus;
74
77
  exports.ChatPrompt = ChatPrompt.ChatPrompt;
75
78
  exports.ScratchpadPanel = ScratchpadPanel.ScratchpadPanel;
79
+ exports.ScratchpadStoreContext = scratchpadStore.ScratchpadStoreContext;
80
+ exports.ScratchpadStoreProvider = scratchpadStore.ScratchpadStoreProvider;
81
+ exports.createScratchpadStore = scratchpadStore.createScratchpadStore;
76
82
  exports.dispatchScratchpad = scratchpadStore.dispatchScratchpad;
77
83
  exports.useScratchpadState = scratchpadStore.useScratchpadState;
78
84
  exports.GhostText = GhostText.GhostText;
@@ -113,7 +119,10 @@ exports.clarificationToPromptConfig = chatBus.clarificationToPromptConfig;
113
119
  exports.createChatBus = chatBus.createChatBus;
114
120
  exports.createCommandHandler = chatBus.createCommandHandler;
115
121
  exports.createEventEmitter = chatBus.createEventEmitter;
122
+ exports.elicitationToPromptConfig = chatBus.elicitationToPromptConfig;
116
123
  exports.mergeScratchpadSections = chatBus.mergeScratchpadSections;
117
124
  exports.validateAgainstSource = dataValidator.validateAgainstSource;
125
+ exports.PromptReplacedError = chatPromptController.PromptReplacedError;
126
+ exports.createChatPromptController = chatPromptController.createChatPromptController;
118
127
  exports.createMockChatBus = index.createMockChatBus;
119
128
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.cts CHANGED
@@ -33,10 +33,13 @@ export { ResizeHandle } from './components/ResizeHandle';
33
33
  export { EditableUIResourceRenderer } from './components/EditableUIResourceRenderer';
34
34
  export { ExpandableWrapper, useExpanded } from './components/ExpandableWrapper';
35
35
  export { ComponentToolbar } from './components/ComponentToolbar';
36
+ export { FeedbackInline } from './components/FeedbackInline';
37
+ export type { FeedbackInlineProps, FeedbackInlineContext } from './components/FeedbackInline';
36
38
  export { ChatBusProvider, useChatBus } from './hooks/useChatBus';
37
39
  export { ChatPrompt } from './components/ChatPrompt';
38
40
  export { ScratchpadPanel } from './components/ScratchpadPanel';
39
- export { dispatchScratchpad, useScratchpadState } from './stores/scratchpad-store';
41
+ export { dispatchScratchpad, useScratchpadState, createScratchpadStore, ScratchpadStoreContext, ScratchpadStoreProvider, } from './stores/scratchpad-store';
42
+ export type { ScratchpadStoreHandle } from './stores/scratchpad-store';
40
43
  export { VerifiedText } from './components/VerifiedText';
41
44
  export { DataPreviewSection } from './components/DataPreviewSection';
42
45
  export { AgentCard, AgentStatusBadge } from './components/AgentCard';
@@ -73,7 +76,10 @@ export { createGroqPlugin, createSupabasePlugin, createRestPlugin, } from './plu
73
76
  export type { UIComponent, UILayout, GridPosition, ComponentType, RendererError, ChartComponentParams, TableComponentParams, MetricComponentParams, TextComponentParams, ActionComponentParams, GridComponentParams, FormFieldOption, FormFieldType, FormFieldParams, FormComponentParams, ShowWhenOperator, ShowWhenCondition, ActionRequestBase, ActionResultBase, ActionLifecycleCallbacks, ModalSize, ModalComponentParams, ActionGroupLayout, ActionGroupGap, ActionGroupParams, GalleryImage, ImageGalleryParams, VideoComponentParams, CodeComponentParams, MapMarker, MapComponentParams, MapPopupConfig, MapGeoJSONStyle, MapLayer, MapPMTilesConfig, IframePolicy, ValidationOptions, ResizeConstraints, DragDropConfig, DragEventData, DraggableGridItemProps as DraggableGridItemPropsType, AutocompleteResultType, AutocompleteOption, AutocompleteResult, AutocompleteContext, AutocompletePlugin, GroqPluginConfig, SupabasePluginConfig, DuckDBPluginConfig, RestPluginConfig, FieldAutocompleteConfig, AutocompleteProviderConfig, } from './types';
74
77
  export { validateComponent, validateLayout, validateIframeDomain, getIframeSandbox, DEFAULT_RESOURCE_LIMITS, DEFAULT_IFRAME_DOMAINS, TRUSTED_IFRAME_DOMAINS, ComponentRegistry, createEventEmitter, createCommandHandler, createChatBus, mergeScratchpadSections, validateAgainstSource, } from './services';
75
78
  export { clarificationToPromptConfig } from './services/chat-bus';
79
+ export { elicitationToPromptConfig } from './services/chat-bus';
80
+ export { createChatPromptController, PromptReplacedError, } from './services/chat-prompt-controller';
81
+ export type { ChatPromptController } from './services/chat-prompt-controller';
76
82
  export { createMockChatBus } from './testing';
77
83
  export type { MockChatBusOptions } from './testing';
78
- export type { ChatEventBase, ChatEvents, ChatCommands, ChatBus, ChatEventEmitter, ChatCommandHandler, EventSubscribeOptions, ChatPromptConfig, ChatPromptResponse, ChoicePromptConfig, ChoiceOption, ConfirmPromptConfig, FormPromptConfig, SuggestionItem, AgentContext, BriefingEvent, BriefingSection, ScratchpadState, ScratchpadSection, ScratchpadEvent, StreamDoneMetadata, ChatError, Citation, ToolCallEvent, ClarificationEvent, DataValidation, LLMNumber, HallucinatedNumber, DataValidationOptions, VerifiedTextContent, DataPreviewColumn, DataPreviewContent, MapSectionContent, AgentCardContent, SplitStepperContent, AgentHandoffContent, BriefingDiffContent, } from './types/chat-bus';
84
+ export type { ChatEventBase, ChatEvents, ChatCommands, ChatBus, ChatEventEmitter, ChatCommandHandler, EventSubscribeOptions, ChatPromptConfig, ChatPromptResponse, ChoicePromptConfig, ChoiceOption, ConfirmPromptConfig, FormPromptConfig, SuggestionItem, AgentContext, BriefingEvent, BriefingSection, ScratchpadState, ScratchpadSection, ScratchpadEvent, StreamDoneMetadata, ChatError, Citation, ToolCallEvent, ClarificationEvent, ElicitationEvent, ElicitationRequestedSchema, ElicitationPropertySchema, DataValidation, LLMNumber, HallucinatedNumber, DataValidationOptions, VerifiedTextContent, DataPreviewColumn, DataPreviewContent, MapSectionContent, AgentCardContent, SplitStepperContent, AgentHandoffContent, BriefingDiffContent, } from './types/chat-bus';
79
85
  //# sourceMappingURL=index.d.ts.map
package/dist/index.d.ts CHANGED
@@ -33,10 +33,13 @@ export { ResizeHandle } from './components/ResizeHandle';
33
33
  export { EditableUIResourceRenderer } from './components/EditableUIResourceRenderer';
34
34
  export { ExpandableWrapper, useExpanded } from './components/ExpandableWrapper';
35
35
  export { ComponentToolbar } from './components/ComponentToolbar';
36
+ export { FeedbackInline } from './components/FeedbackInline';
37
+ export type { FeedbackInlineProps, FeedbackInlineContext } from './components/FeedbackInline';
36
38
  export { ChatBusProvider, useChatBus } from './hooks/useChatBus';
37
39
  export { ChatPrompt } from './components/ChatPrompt';
38
40
  export { ScratchpadPanel } from './components/ScratchpadPanel';
39
- export { dispatchScratchpad, useScratchpadState } from './stores/scratchpad-store';
41
+ export { dispatchScratchpad, useScratchpadState, createScratchpadStore, ScratchpadStoreContext, ScratchpadStoreProvider, } from './stores/scratchpad-store';
42
+ export type { ScratchpadStoreHandle } from './stores/scratchpad-store';
40
43
  export { VerifiedText } from './components/VerifiedText';
41
44
  export { DataPreviewSection } from './components/DataPreviewSection';
42
45
  export { AgentCard, AgentStatusBadge } from './components/AgentCard';
@@ -73,7 +76,10 @@ export { createGroqPlugin, createSupabasePlugin, createRestPlugin, } from './plu
73
76
  export type { UIComponent, UILayout, GridPosition, ComponentType, RendererError, ChartComponentParams, TableComponentParams, MetricComponentParams, TextComponentParams, ActionComponentParams, GridComponentParams, FormFieldOption, FormFieldType, FormFieldParams, FormComponentParams, ShowWhenOperator, ShowWhenCondition, ActionRequestBase, ActionResultBase, ActionLifecycleCallbacks, ModalSize, ModalComponentParams, ActionGroupLayout, ActionGroupGap, ActionGroupParams, GalleryImage, ImageGalleryParams, VideoComponentParams, CodeComponentParams, MapMarker, MapComponentParams, MapPopupConfig, MapGeoJSONStyle, MapLayer, MapPMTilesConfig, IframePolicy, ValidationOptions, ResizeConstraints, DragDropConfig, DragEventData, DraggableGridItemProps as DraggableGridItemPropsType, AutocompleteResultType, AutocompleteOption, AutocompleteResult, AutocompleteContext, AutocompletePlugin, GroqPluginConfig, SupabasePluginConfig, DuckDBPluginConfig, RestPluginConfig, FieldAutocompleteConfig, AutocompleteProviderConfig, } from './types';
74
77
  export { validateComponent, validateLayout, validateIframeDomain, getIframeSandbox, DEFAULT_RESOURCE_LIMITS, DEFAULT_IFRAME_DOMAINS, TRUSTED_IFRAME_DOMAINS, ComponentRegistry, createEventEmitter, createCommandHandler, createChatBus, mergeScratchpadSections, validateAgainstSource, } from './services';
75
78
  export { clarificationToPromptConfig } from './services/chat-bus';
79
+ export { elicitationToPromptConfig } from './services/chat-bus';
80
+ export { createChatPromptController, PromptReplacedError, } from './services/chat-prompt-controller';
81
+ export type { ChatPromptController } from './services/chat-prompt-controller';
76
82
  export { createMockChatBus } from './testing';
77
83
  export type { MockChatBusOptions } from './testing';
78
- export type { ChatEventBase, ChatEvents, ChatCommands, ChatBus, ChatEventEmitter, ChatCommandHandler, EventSubscribeOptions, ChatPromptConfig, ChatPromptResponse, ChoicePromptConfig, ChoiceOption, ConfirmPromptConfig, FormPromptConfig, SuggestionItem, AgentContext, BriefingEvent, BriefingSection, ScratchpadState, ScratchpadSection, ScratchpadEvent, StreamDoneMetadata, ChatError, Citation, ToolCallEvent, ClarificationEvent, DataValidation, LLMNumber, HallucinatedNumber, DataValidationOptions, VerifiedTextContent, DataPreviewColumn, DataPreviewContent, MapSectionContent, AgentCardContent, SplitStepperContent, AgentHandoffContent, BriefingDiffContent, } from './types/chat-bus';
84
+ export type { ChatEventBase, ChatEvents, ChatCommands, ChatBus, ChatEventEmitter, ChatCommandHandler, EventSubscribeOptions, ChatPromptConfig, ChatPromptResponse, ChoicePromptConfig, ChoiceOption, ConfirmPromptConfig, FormPromptConfig, SuggestionItem, AgentContext, BriefingEvent, BriefingSection, ScratchpadState, ScratchpadSection, ScratchpadEvent, StreamDoneMetadata, ChatError, Citation, ToolCallEvent, ClarificationEvent, ElicitationEvent, ElicitationRequestedSchema, ElicitationPropertySchema, DataValidation, LLMNumber, HallucinatedNumber, DataValidationOptions, VerifiedTextContent, DataPreviewColumn, DataPreviewContent, MapSectionContent, AgentCardContent, SplitStepperContent, AgentHandoffContent, BriefingDiffContent, } from './types/chat-bus';
79
85
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAGjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AACpF,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAGhE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAGlF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAGpE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGxD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAE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B,SAAS,EACT,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,EAEzB,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAEjB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,kBAAkB,CAAA"}
package/dist/index.js CHANGED
@@ -25,10 +25,11 @@ import { ResizeHandle } from "./components/ResizeHandle.js";
25
25
  import { EditableUIResourceRenderer } from "./components/EditableUIResourceRenderer.js";
26
26
  import { ExpandableWrapper, useExpanded } from "./components/ExpandableWrapper.js";
27
27
  import { ComponentToolbar } from "./components/ComponentToolbar.js";
28
+ import { FeedbackInline } from "./components/FeedbackInline.js";
28
29
  import { ChatBusProvider, useChatBus } from "./hooks/useChatBus.js";
29
30
  import { ChatPrompt } from "./components/ChatPrompt.js";
30
31
  import { ScratchpadPanel } from "./components/ScratchpadPanel.js";
31
- import { dispatchScratchpad, useScratchpadState } from "./stores/scratchpad-store.js";
32
+ import { ScratchpadStoreContext, ScratchpadStoreProvider, createScratchpadStore, dispatchScratchpad, useScratchpadState } from "./stores/scratchpad-store.js";
32
33
  import { GhostText, GhostTextInput } from "./components/GhostText.js";
33
34
  import { AutocompleteDropdown } from "./components/AutocompleteDropdown.js";
34
35
  import { AutocompleteFormField } from "./components/AutocompleteFormField.js";
@@ -48,8 +49,9 @@ import { createSupabasePlugin } from "./plugins/supabase.js";
48
49
  import { createRestPlugin } from "./plugins/rest.js";
49
50
  import { DEFAULT_IFRAME_DOMAINS, DEFAULT_RESOURCE_LIMITS, TRUSTED_IFRAME_DOMAINS, getIframeSandbox, validateComponent, validateIframeDomain, validateLayout } from "./services/validation.js";
50
51
  import { ComponentRegistry } from "./services/component-registry.js";
51
- import { clarificationToPromptConfig, createChatBus, createCommandHandler, createEventEmitter, mergeScratchpadSections } from "./services/chat-bus.js";
52
+ import { clarificationToPromptConfig, createChatBus, createCommandHandler, createEventEmitter, elicitationToPromptConfig, mergeScratchpadSections } from "./services/chat-bus.js";
52
53
  import { validateAgainstSource } from "./services/data-validator.js";
54
+ import { PromptReplacedError, createChatPromptController } from "./services/chat-prompt-controller.js";
53
55
  import { createMockChatBus } from "./testing/index.js";
54
56
  export {
55
57
  AgentCard,
@@ -69,13 +71,17 @@ export {
69
71
  DraggableGridItem,
70
72
  EditableUIResourceRenderer,
71
73
  ExpandableWrapper,
74
+ FeedbackInline,
72
75
  GenerativeUIErrorBoundary,
73
76
  GhostText,
74
77
  GhostTextInput,
75
78
  MCPActionContext,
76
79
  MCPActionProvider,
80
+ PromptReplacedError,
77
81
  ResizeHandle,
78
82
  ScratchpadPanel,
83
+ ScratchpadStoreContext,
84
+ ScratchpadStoreProvider,
79
85
  SplitStepper,
80
86
  StreamingUIRenderer,
81
87
  TRUSTED_IFRAME_DOMAINS,
@@ -83,13 +89,16 @@ export {
83
89
  VerifiedText,
84
90
  clarificationToPromptConfig,
85
91
  createChatBus,
92
+ createChatPromptController,
86
93
  createCommandHandler,
87
94
  createEventEmitter,
88
95
  createGroqPlugin,
89
96
  createMockChatBus,
90
97
  createRestPlugin,
98
+ createScratchpadStore,
91
99
  createSupabasePlugin,
92
100
  dispatchScratchpad,
101
+ elicitationToPromptConfig,
93
102
  evaluateCondition,
94
103
  getIframeSandbox,
95
104
  mergeScratchpadSections,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}