@seed-ship/mcp-ui-solid 6.24.0 → 7.0.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.
- package/CHANGELOG.md +64 -0
- package/README.md +61 -0
- package/dist/adapters/connector.cjs +3 -3
- package/dist/adapters/connector.cjs.map +1 -1
- package/dist/adapters/connector.d.cts +108 -0
- package/dist/adapters/connector.d.ts +1 -2
- package/dist/adapters/connector.js +3 -3
- package/dist/adapters/connector.js.map +1 -1
- package/dist/adapters/index.d.cts +21 -0
- package/dist/adapters/index.d.ts +6 -7
- package/dist/adapters/macro-run.d.cts +99 -0
- package/dist/adapters/macro-run.d.ts +1 -2
- package/dist/adapters/presentation.d.cts +1 -2
- package/dist/adapters/presentation.d.ts +1 -2
- package/dist/adapters.d.cts +1 -1
- package/dist/adapters.d.ts +1 -1
- package/dist/components/ActionGroupRenderer.cjs +6 -6
- package/dist/components/ActionGroupRenderer.cjs.map +1 -1
- package/dist/components/ActionGroupRenderer.d.cts +38 -0
- package/dist/components/ActionGroupRenderer.d.ts +1 -2
- package/dist/components/ActionGroupRenderer.js +6 -6
- package/dist/components/ActionGroupRenderer.js.map +1 -1
- package/dist/components/ActionRenderer.d.cts +9 -0
- package/dist/components/ActionRenderer.d.ts +0 -1
- package/dist/components/AgentCard.d.cts +19 -0
- package/dist/components/AgentCard.d.ts +1 -2
- package/dist/components/AgentHandoff.d.cts +11 -0
- package/dist/components/AgentHandoff.d.ts +1 -2
- package/dist/components/ArtifactRenderer.d.cts +11 -0
- package/dist/components/ArtifactRenderer.d.ts +0 -1
- package/dist/components/AutocompleteDropdown.cjs +6 -6
- package/dist/components/AutocompleteDropdown.cjs.map +1 -1
- package/dist/components/AutocompleteDropdown.d.cts +70 -0
- package/dist/components/AutocompleteDropdown.d.ts +1 -2
- package/dist/components/AutocompleteDropdown.js +6 -6
- package/dist/components/AutocompleteDropdown.js.map +1 -1
- package/dist/components/AutocompleteFormField.cjs +6 -5
- package/dist/components/AutocompleteFormField.cjs.map +1 -1
- package/dist/components/AutocompleteFormField.d.cts +51 -0
- package/dist/components/AutocompleteFormField.d.ts +1 -2
- package/dist/components/AutocompleteFormField.d.ts.map +1 -1
- package/dist/components/AutocompleteFormField.js +6 -5
- package/dist/components/AutocompleteFormField.js.map +1 -1
- package/dist/components/BriefingDiff.d.cts +11 -0
- package/dist/components/BriefingDiff.d.ts +1 -2
- package/dist/components/CarouselRenderer.d.cts +12 -0
- package/dist/components/CarouselRenderer.d.ts +1 -2
- package/dist/components/ChartJSRenderer.cjs +216 -6
- package/dist/components/ChartJSRenderer.cjs.map +1 -1
- package/dist/components/ChartJSRenderer.d.cts +62 -0
- package/dist/components/ChartJSRenderer.d.ts +1 -2
- package/dist/components/ChartJSRenderer.d.ts.map +1 -1
- package/dist/components/ChartJSRenderer.js +217 -7
- package/dist/components/ChartJSRenderer.js.map +1 -1
- package/dist/components/ChatPrompt.cjs +5 -5
- package/dist/components/ChatPrompt.cjs.map +1 -1
- package/dist/components/ChatPrompt.d.cts +69 -0
- package/dist/components/ChatPrompt.d.ts +1 -2
- package/dist/components/ChatPrompt.js +5 -5
- package/dist/components/ChatPrompt.js.map +1 -1
- package/dist/components/CodeBlockRenderer.d.cts +23 -0
- package/dist/components/CodeBlockRenderer.d.ts +1 -2
- package/dist/components/ComponentToolbar.cjs +5 -5
- package/dist/components/ComponentToolbar.cjs.map +1 -1
- package/dist/components/ComponentToolbar.d.cts +46 -0
- package/dist/components/ComponentToolbar.d.ts +0 -1
- package/dist/components/ComponentToolbar.js +5 -5
- package/dist/components/ComponentToolbar.js.map +1 -1
- package/dist/components/DataPreviewSection.d.cts +11 -0
- package/dist/components/DataPreviewSection.d.ts +1 -2
- package/dist/components/DegradedFallback.cjs +1 -1
- package/dist/components/DegradedFallback.cjs.map +1 -1
- package/dist/components/DegradedFallback.d.cts +43 -0
- package/dist/components/DegradedFallback.d.ts +0 -1
- package/dist/components/DegradedFallback.js +1 -1
- package/dist/components/DegradedFallback.js.map +1 -1
- package/dist/components/DraggableGridItem.d.cts +94 -0
- package/dist/components/DraggableGridItem.d.ts +1 -2
- package/dist/components/EditableLayoutContext.d.cts +4 -0
- package/dist/components/EditableLayoutContext.d.ts +0 -1
- package/dist/components/EditableUIResourceRenderer.d.cts +42 -0
- package/dist/components/EditableUIResourceRenderer.d.ts +1 -2
- package/dist/components/ElicitationForm.d.cts +67 -0
- package/dist/components/ElicitationForm.d.ts +1 -2
- package/dist/components/ExpandableWrapper.cjs +10 -7
- package/dist/components/ExpandableWrapper.cjs.map +1 -1
- package/dist/components/ExpandableWrapper.d.cts +49 -0
- package/dist/components/ExpandableWrapper.d.ts +0 -1
- package/dist/components/ExpandableWrapper.d.ts.map +1 -1
- package/dist/components/ExpandableWrapper.js +10 -7
- package/dist/components/ExpandableWrapper.js.map +1 -1
- package/dist/components/FeedbackInline.d.cts +70 -0
- package/dist/components/FeedbackInline.d.ts +0 -1
- package/dist/components/FooterRenderer.d.cts +15 -0
- package/dist/components/FooterRenderer.d.ts +0 -1
- package/dist/components/FormFieldRenderer.cjs +13 -12
- package/dist/components/FormFieldRenderer.cjs.map +1 -1
- package/dist/components/FormFieldRenderer.d.cts +19 -0
- package/dist/components/FormFieldRenderer.d.ts +1 -2
- package/dist/components/FormFieldRenderer.d.ts.map +1 -1
- package/dist/components/FormFieldRenderer.js +13 -12
- package/dist/components/FormFieldRenderer.js.map +1 -1
- package/dist/components/FormRenderer.cjs +1 -1
- package/dist/components/FormRenderer.cjs.map +1 -1
- package/dist/components/FormRenderer.d.cts +14 -0
- package/dist/components/FormRenderer.d.ts +1 -2
- package/dist/components/FormRenderer.js +1 -1
- package/dist/components/FormRenderer.js.map +1 -1
- package/dist/components/GenerativeUIErrorBoundary.cjs +1 -1
- package/dist/components/GenerativeUIErrorBoundary.cjs.map +1 -1
- package/dist/components/GenerativeUIErrorBoundary.d.cts +58 -0
- package/dist/components/GenerativeUIErrorBoundary.d.ts +1 -2
- package/dist/components/GenerativeUIErrorBoundary.default.d.cts +1 -0
- package/dist/components/GenerativeUIErrorBoundary.default.d.ts +1 -2
- package/dist/components/GenerativeUIErrorBoundary.js +1 -1
- package/dist/components/GenerativeUIErrorBoundary.js.map +1 -1
- package/dist/components/GhostText.cjs +2 -2
- package/dist/components/GhostText.cjs.map +1 -1
- package/dist/components/GhostText.d.cts +112 -0
- package/dist/components/GhostText.d.ts +0 -1
- package/dist/components/GhostText.js +2 -2
- package/dist/components/GhostText.js.map +1 -1
- package/dist/components/GraphRenderer.cjs +100 -29
- package/dist/components/GraphRenderer.cjs.map +1 -1
- package/dist/components/GraphRenderer.d.cts +66 -0
- package/dist/components/GraphRenderer.d.ts +2 -3
- package/dist/components/GraphRenderer.d.ts.map +1 -1
- package/dist/components/GraphRenderer.js +100 -29
- package/dist/components/GraphRenderer.js.map +1 -1
- package/dist/components/GridRenderer.d.cts +49 -0
- package/dist/components/GridRenderer.d.ts +1 -2
- package/dist/components/IframeFallbackLink.d.cts +22 -0
- package/dist/components/IframeFallbackLink.d.ts +0 -1
- package/dist/components/ImageGalleryRenderer.d.cts +22 -0
- package/dist/components/ImageGalleryRenderer.d.ts +1 -2
- package/dist/components/LightboxOverlay.d.cts +31 -0
- package/dist/components/LightboxOverlay.d.ts +1 -2
- package/dist/components/MapRenderer.d.cts +77 -0
- package/dist/components/MapRenderer.d.ts +1 -2
- package/dist/components/MissingValue.cjs +2 -2
- package/dist/components/MissingValue.cjs.map +1 -1
- package/dist/components/MissingValue.d.cts +26 -0
- package/dist/components/MissingValue.d.ts +0 -1
- package/dist/components/MissingValue.js +2 -2
- package/dist/components/MissingValue.js.map +1 -1
- package/dist/components/ModalRenderer.cjs +39 -31
- package/dist/components/ModalRenderer.cjs.map +1 -1
- package/dist/components/ModalRenderer.d.cts +66 -0
- package/dist/components/ModalRenderer.d.ts +1 -2
- package/dist/components/ModalRenderer.d.ts.map +1 -1
- package/dist/components/ModalRenderer.js +40 -32
- package/dist/components/ModalRenderer.js.map +1 -1
- package/dist/components/PortalDropdownMenu.cjs +6 -3
- package/dist/components/PortalDropdownMenu.cjs.map +1 -1
- package/dist/components/PortalDropdownMenu.d.cts +55 -0
- package/dist/components/PortalDropdownMenu.d.ts +0 -1
- package/dist/components/PortalDropdownMenu.d.ts.map +1 -1
- package/dist/components/PortalDropdownMenu.js +7 -4
- package/dist/components/PortalDropdownMenu.js.map +1 -1
- package/dist/components/PresentationFeedback.d.cts +112 -0
- package/dist/components/PresentationFeedback.d.ts +0 -1
- package/dist/components/RenderContext.d.cts +41 -0
- package/dist/components/RenderContext.d.ts +1 -2
- package/dist/components/ResizeHandle.d.cts +49 -0
- package/dist/components/ResizeHandle.d.ts +0 -1
- package/dist/components/SafeHtml.d.cts +45 -0
- package/dist/components/SafeHtml.d.ts +0 -1
- package/dist/components/ScratchpadPanel.cjs +38 -44
- package/dist/components/ScratchpadPanel.cjs.map +1 -1
- package/dist/components/ScratchpadPanel.d.cts +34 -0
- package/dist/components/ScratchpadPanel.d.ts +1 -2
- package/dist/components/ScratchpadPanel.d.ts.map +1 -1
- package/dist/components/ScratchpadPanel.js +38 -44
- package/dist/components/ScratchpadPanel.js.map +1 -1
- package/dist/components/SplitStepper.d.cts +11 -0
- package/dist/components/SplitStepper.d.ts +1 -2
- package/dist/components/StreamingUIRenderer.d.cts +58 -0
- package/dist/components/StreamingUIRenderer.d.ts +3 -4
- package/dist/components/UIResourceRenderer.cjs +20 -20
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.cts +181 -0
- package/dist/components/UIResourceRenderer.d.ts +3 -4
- package/dist/components/UIResourceRenderer.default.d.cts +1 -0
- package/dist/components/UIResourceRenderer.default.d.ts +1 -2
- package/dist/components/UIResourceRenderer.js +20 -20
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/components/VerifiedText.d.cts +22 -0
- package/dist/components/VerifiedText.d.ts +1 -2
- package/dist/components/VideoRenderer.d.cts +41 -0
- package/dist/components/VideoRenderer.d.ts +1 -2
- package/dist/components/chart-data-table.d.cts +68 -0
- package/dist/components/chart-data-table.d.ts +0 -1
- package/dist/components/chart-missing-plugin.cjs +4 -4
- package/dist/components/chart-missing-plugin.cjs.map +1 -1
- package/dist/components/chart-missing-plugin.d.cts +128 -0
- package/dist/components/chart-missing-plugin.d.ts +4 -3
- package/dist/components/chart-missing-plugin.d.ts.map +1 -1
- package/dist/components/chart-missing-plugin.js +4 -4
- package/dist/components/chart-missing-plugin.js.map +1 -1
- package/dist/components/index.d.cts +62 -0
- package/dist/components/index.d.ts +57 -58
- package/dist/components.d.cts +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/context/AutocompleteContext.d.cts +76 -0
- package/dist/context/AutocompleteContext.d.ts +1 -2
- package/dist/context/MCPActionContext.d.cts +169 -0
- package/dist/context/MCPActionContext.d.ts +0 -1
- package/dist/context/MCPUIConfigContext.d.cts +201 -0
- package/dist/context/MCPUIConfigContext.d.ts +1 -2
- package/dist/context/MCPUIMathContext.d.cts +17 -0
- package/dist/context/MCPUIMathContext.d.ts +0 -1
- package/dist/context/MCPUIStringsContext.d.cts +802 -0
- package/dist/context/MCPUIStringsContext.d.ts +1 -2
- package/dist/context/MCPUITelemetryContext.d.cts +35 -0
- package/dist/context/MCPUITelemetryContext.d.ts +1 -2
- package/dist/context/index.d.cts +7 -0
- package/dist/context/index.d.ts +2 -3
- package/dist/hooks/createResponsiveGrid.d.cts +5 -0
- package/dist/hooks/createResponsiveGrid.d.ts +0 -1
- package/dist/hooks/index.d.cts +25 -0
- package/dist/hooks/index.d.ts +20 -21
- package/dist/hooks/useAction.d.cts +164 -0
- package/dist/hooks/useAction.d.ts +2 -3
- package/dist/hooks/useAutocomplete.d.cts +118 -0
- package/dist/hooks/useAutocomplete.d.ts +1 -2
- package/dist/hooks/useChatBus.d.cts +55 -0
- package/dist/hooks/useChatBus.d.ts +1 -2
- package/dist/hooks/useConditionalField.d.cts +34 -0
- package/dist/hooks/useConditionalField.d.ts +1 -2
- package/dist/hooks/useDataValidator.d.cts +41 -0
- package/dist/hooks/useDataValidator.d.ts +1 -2
- package/dist/hooks/useDragDrop.d.cts +99 -0
- package/dist/hooks/useDragDrop.d.ts +1 -2
- package/dist/hooks/useFormPersistence.d.cts +80 -0
- package/dist/hooks/useFormPersistence.d.ts +0 -1
- package/dist/hooks/useModal.d.cts +106 -0
- package/dist/hooks/useModal.d.ts +0 -1
- package/dist/hooks/useResize.d.cts +86 -0
- package/dist/hooks/useResize.d.ts +1 -2
- package/dist/hooks/useStreamingUI.d.cts +117 -0
- package/dist/hooks/useStreamingUI.d.ts +1 -2
- package/dist/hooks.d.cts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/index.d.cts +91 -92
- package/dist/index.d.ts +91 -92
- package/dist/plugins/duckdb.d.cts +1 -2
- package/dist/plugins/duckdb.d.ts +1 -2
- package/dist/plugins/groq.d.cts +12 -0
- package/dist/plugins/groq.d.ts +1 -2
- package/dist/plugins/index.d.cts +9 -0
- package/dist/plugins/index.d.ts +3 -4
- package/dist/plugins/katex.d.cts +1 -2
- package/dist/plugins/katex.d.ts +1 -2
- package/dist/plugins/rest.d.cts +12 -0
- package/dist/plugins/rest.d.ts +1 -2
- package/dist/plugins/supabase.d.cts +12 -0
- package/dist/plugins/supabase.d.ts +1 -2
- package/dist/services/chat-bus.d.cts +100 -0
- package/dist/services/chat-bus.d.ts +1 -2
- package/dist/services/chat-prompt-controller.d.cts +92 -0
- package/dist/services/chat-prompt-controller.d.ts +1 -2
- package/dist/services/component-registry.d.cts +119 -0
- package/dist/services/component-registry.d.ts +1 -2
- package/dist/services/data-validator.d.cts +27 -0
- package/dist/services/data-validator.d.ts +1 -2
- package/dist/services/index.d.cts +9 -0
- package/dist/services/index.d.ts +4 -5
- package/dist/services/telemetry.d.cts +86 -0
- package/dist/services/telemetry.d.ts +1 -2
- package/dist/services/validation.d.cts +169 -0
- package/dist/services/validation.d.ts +1 -2
- package/dist/stores/scratchpad-store.d.cts +109 -0
- package/dist/stores/scratchpad-store.d.ts +1 -2
- package/dist/stores/server-capabilities-store.d.cts +171 -0
- package/dist/stores/server-capabilities-store.d.ts +0 -1
- package/dist/test-setup.d.cts +5 -0
- package/dist/test-setup.d.ts +0 -1
- package/dist/testing/index.d.cts +34 -0
- package/dist/testing/index.d.ts +1 -2
- package/dist/types/chat-bus.d.cts +783 -0
- package/dist/types/chat-bus.d.ts +4 -5
- package/dist/types/index.d.cts +1616 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types-export.d.cts +1 -2
- package/dist/types-export.d.ts +1 -2
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/degraded-projections.d.cts +119 -0
- package/dist/utils/degraded-projections.d.ts +0 -1
- package/dist/utils/duplicate-mount-registry.d.cts +83 -0
- package/dist/utils/duplicate-mount-registry.d.ts +0 -1
- package/dist/utils/escape-html.d.cts +12 -0
- package/dist/utils/escape-html.d.ts +0 -1
- package/dist/utils/format-string.d.cts +25 -0
- package/dist/utils/format-string.d.ts +0 -1
- package/dist/utils/iframe-coep.d.cts +53 -0
- package/dist/utils/iframe-coep.d.ts +1 -2
- package/dist/utils/logger.d.cts +57 -0
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/math-markdown.cjs +1 -1
- package/dist/utils/math-markdown.cjs.map +1 -1
- package/dist/utils/math-markdown.d.cts +15 -0
- package/dist/utils/math-markdown.d.ts +1 -2
- package/dist/utils/math-markdown.js +1 -1
- package/dist/utils/math-markdown.js.map +1 -1
- package/dist/utils/missing-value.d.cts +78 -0
- package/dist/utils/missing-value.d.ts +0 -1
- package/dist/utils/pan-zoom.d.cts +234 -0
- package/dist/utils/pan-zoom.d.ts +0 -1
- package/dist/utils/perf.d.cts +18 -0
- package/dist/utils/perf.d.ts +0 -1
- package/dist/utils/safe-url.d.cts +33 -0
- package/dist/utils/safe-url.d.ts +0 -1
- package/dist/utils/sanitize-html.d.cts +142 -0
- package/dist/utils/sanitize-html.d.ts +0 -1
- package/dist/utils/stable-key.d.cts +32 -0
- package/dist/utils/stable-key.d.ts +0 -1
- package/dist/utils/theme.cjs +91 -0
- package/dist/utils/theme.cjs.map +1 -0
- package/dist/utils/theme.d.cts +10 -0
- package/dist/utils/theme.d.ts +10 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/theme.js +91 -0
- package/dist/utils/theme.js.map +1 -0
- package/dist/validation.d.cts +3 -4
- package/dist/validation.d.ts +3 -4
- package/docs/SECURITY-DEPENDENCIES.md +209 -0
- package/docs/THEMING.md +205 -0
- package/docs/ZOD4-STABLE-MIGRATION-2026-10-26.md +181 -0
- package/package.json +12 -9
- package/src/adapters/connector.ts +3 -3
- package/src/components/ActionGroupRenderer.tsx +6 -6
- package/src/components/AutocompleteDropdown.tsx +17 -17
- package/src/components/AutocompleteFormField.tsx +10 -9
- package/src/components/ChartJSRenderer.tsx +483 -239
- package/src/components/ChatPrompt.tsx +16 -16
- package/src/components/ComponentToolbar.tsx +5 -5
- package/src/components/DegradedFallback.tsx +9 -9
- package/src/components/ExpandableWrapper.tsx +15 -11
- package/src/components/FormFieldRenderer.tsx +52 -51
- package/src/components/FormRenderer.tsx +12 -12
- package/src/components/GenerativeUIErrorBoundary.tsx +6 -6
- package/src/components/GhostText.tsx +7 -7
- package/src/components/GraphRenderer.tsx +83 -67
- package/src/components/MissingValue.tsx +2 -2
- package/src/components/ModalRenderer.tsx +11 -5
- package/src/components/PortalDropdownMenu.tsx +6 -2
- package/src/components/ScratchpadPanel.tsx +144 -141
- package/src/components/UIResourceRenderer.tsx +101 -101
- package/src/components/chart-missing-plugin.ts +5 -3
- package/src/styles/autocomplete.css +53 -53
- package/src/utils/math-markdown.ts +1 -1
- package/src/utils/theme.ts +101 -0
|
@@ -774,7 +774,7 @@ export declare const DEFAULT_MCPUI_STRINGS: Required<MCPUIStrings>;
|
|
|
774
774
|
* importing `solid-js`. Re-exported here (and from the root barrel) so every
|
|
775
775
|
* existing import path keeps working.
|
|
776
776
|
*/
|
|
777
|
-
export { formatMCPUIString } from
|
|
777
|
+
export { formatMCPUIString } from "../utils/format-string.js";
|
|
778
778
|
export declare const MCPUIStringsContext: import("solid-js").Context<MCPUIStrings>;
|
|
779
779
|
/**
|
|
780
780
|
* Returns `locale` in canonical BCP-47 form, or `DEFAULT_MCPUI_STRINGS.locale`
|
|
@@ -800,4 +800,3 @@ export interface MCPUIStringsProviderProps {
|
|
|
800
800
|
* Merges the partial `strings` override over the English defaults.
|
|
801
801
|
*/
|
|
802
802
|
export declare function MCPUIStringsProvider(props: MCPUIStringsProviderProps): JSX.Element;
|
|
803
|
-
//# sourceMappingURL=MCPUIStringsContext.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCPUITelemetryProvider + useTelemetry hook (B.5 — v5.6.0)
|
|
3
|
+
*
|
|
4
|
+
* SolidJS Context wrapper around `createTelemetryDispatcher`. Optional —
|
|
5
|
+
* when no Provider is present, `useTelemetry()` returns `null` and dispatch
|
|
6
|
+
* sites no-op (zero behavior change for apps that don't opt in).
|
|
7
|
+
*
|
|
8
|
+
* See `services/telemetry.ts` for the dispatcher contract and
|
|
9
|
+
* `MCP-UI-AUDIT-2026-04-26.md` §M.6 for the full specification.
|
|
10
|
+
*/
|
|
11
|
+
import { type Component, type JSX } from 'solid-js';
|
|
12
|
+
import { type TelemetryDispatcher, type TelemetrySink, type TelemetryOptions } from "../services/telemetry.cjs";
|
|
13
|
+
export declare const MCPUITelemetryContext: import("solid-js").Context<TelemetryDispatcher | null>;
|
|
14
|
+
export interface MCPUITelemetryProviderProps {
|
|
15
|
+
/** Consumer-supplied sink. Receives a batch of events. Fail-open. */
|
|
16
|
+
sink: TelemetrySink;
|
|
17
|
+
/** Sampling + buffering knobs (defaults: 100% / 100ms / max 50). */
|
|
18
|
+
options?: TelemetryOptions;
|
|
19
|
+
children: JSX.Element;
|
|
20
|
+
}
|
|
21
|
+
export declare const MCPUITelemetryProvider: Component<MCPUITelemetryProviderProps>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the current telemetry dispatcher, or `null` when no Provider is
|
|
24
|
+
* mounted in the tree above. Dispatch sites should null-check and no-op
|
|
25
|
+
* when null — telemetry is OPT-IN and must not impose a Provider on apps.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* const telemetry = useTelemetry()
|
|
30
|
+
* onMount(() => {
|
|
31
|
+
* telemetry?.dispatch({ type: 'component:mounted', id, componentType, ts: Date.now() })
|
|
32
|
+
* })
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function useTelemetry(): TelemetryDispatcher | null;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* `MCP-UI-AUDIT-2026-04-26.md` §M.6 for the full specification.
|
|
10
10
|
*/
|
|
11
11
|
import { type Component, type JSX } from 'solid-js';
|
|
12
|
-
import { type TelemetryDispatcher, type TelemetrySink, type TelemetryOptions } from
|
|
12
|
+
import { type TelemetryDispatcher, type TelemetrySink, type TelemetryOptions } from "../services/telemetry.js";
|
|
13
13
|
export declare const MCPUITelemetryContext: import("solid-js").Context<TelemetryDispatcher | null>;
|
|
14
14
|
export interface MCPUITelemetryProviderProps {
|
|
15
15
|
/** Consumer-supplied sink. Receives a batch of events. Fail-open. */
|
|
@@ -33,4 +33,3 @@ export declare const MCPUITelemetryProvider: Component<MCPUITelemetryProviderPro
|
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
35
|
export declare function useTelemetry(): TelemetryDispatcher | null;
|
|
36
|
-
//# sourceMappingURL=MCPUITelemetryContext.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP UI Solid - Context Providers
|
|
3
|
+
*
|
|
4
|
+
* Context providers for action execution and state management
|
|
5
|
+
*/
|
|
6
|
+
export { MCPActionProvider, MCPActionContext, useMCPAction, useMCPActionSafe, } from "./MCPActionContext.cjs";
|
|
7
|
+
export type { MCPActionContextValue, MCPActionProviderProps, ActionRequest, ActionResult, } from "./MCPActionContext.cjs";
|
package/dist/context/index.d.ts
CHANGED
|
@@ -3,6 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Context providers for action execution and state management
|
|
5
5
|
*/
|
|
6
|
-
export { MCPActionProvider, MCPActionContext, useMCPAction, useMCPActionSafe, } from
|
|
7
|
-
export type { MCPActionContextValue, MCPActionProviderProps, ActionRequest, ActionResult, } from
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
6
|
+
export { MCPActionProvider, MCPActionContext, useMCPAction, useMCPActionSafe, } from "./MCPActionContext.js";
|
|
7
|
+
export type { MCPActionContextValue, MCPActionProviderProps, ActionRequest, ActionResult, } from "./MCPActionContext.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP UI Solid - Hooks
|
|
3
|
+
*
|
|
4
|
+
* SolidJS hooks for managing UI resource state and streaming
|
|
5
|
+
*/
|
|
6
|
+
export { useStreamingUI, DEFAULT_STREAMING_UI_MESSAGES } from "./useStreamingUI.cjs";
|
|
7
|
+
export type { UseStreamingUIOptions, StreamingUIMessages, StreamingUIState, StreamProgress, StreamError, CompleteMetadata, } from "./useStreamingUI.cjs";
|
|
8
|
+
export { useAction, useToolAction } from "./useAction.cjs";
|
|
9
|
+
export type { UseActionReturn, UseActionOptions, UseToolActionReturn, ActionRequest, ActionResult, } from "./useAction.cjs";
|
|
10
|
+
export { useConditionalField, evaluateCondition } from "./useConditionalField.cjs";
|
|
11
|
+
export type { UseConditionalFieldOptions } from "./useConditionalField.cjs";
|
|
12
|
+
export { useModal, useConfirmModal } from "./useModal.cjs";
|
|
13
|
+
export type { UseModalReturn, UseConfirmModalReturn } from "./useModal.cjs";
|
|
14
|
+
export { useFormPersistence } from "./useFormPersistence.cjs";
|
|
15
|
+
export type { UseFormPersistenceOptions, UseFormPersistenceReturn } from "./useFormPersistence.cjs";
|
|
16
|
+
export { useDragDrop } from "./useDragDrop.cjs";
|
|
17
|
+
export type { UseDragDropOptions, UseDragDropReturn, DragProps, } from "./useDragDrop.cjs";
|
|
18
|
+
export { useResize } from "./useResize.cjs";
|
|
19
|
+
export type { UseResizeOptions, UseResizeReturn, ResizeEdge, ResizeHandleProps, } from "./useResize.cjs";
|
|
20
|
+
export { useAutocomplete } from "./useAutocomplete.cjs";
|
|
21
|
+
export type { UseAutocompleteOptions, UseAutocompleteReturn, } from "./useAutocomplete.cjs";
|
|
22
|
+
export { createPanZoom } from "../utils/pan-zoom.cjs";
|
|
23
|
+
export type { PanZoomOptions, PanZoomController, PanZoomState, PanZoomPoint, PanZoomCursor, } from "../utils/pan-zoom.cjs";
|
|
24
|
+
export { useDataValidator } from "./useDataValidator.cjs";
|
|
25
|
+
export type { UseDataValidatorOptions, UseDataValidatorReturn, } from "./useDataValidator.cjs";
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -3,24 +3,23 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SolidJS hooks for managing UI resource state and streaming
|
|
5
5
|
*/
|
|
6
|
-
export { useStreamingUI, DEFAULT_STREAMING_UI_MESSAGES } from
|
|
7
|
-
export type { UseStreamingUIOptions, StreamingUIMessages, StreamingUIState, StreamProgress, StreamError, CompleteMetadata, } from
|
|
8
|
-
export { useAction, useToolAction } from
|
|
9
|
-
export type { UseActionReturn, UseActionOptions, UseToolActionReturn, ActionRequest, ActionResult, } from
|
|
10
|
-
export { useConditionalField, evaluateCondition } from
|
|
11
|
-
export type { UseConditionalFieldOptions } from
|
|
12
|
-
export { useModal, useConfirmModal } from
|
|
13
|
-
export type { UseModalReturn, UseConfirmModalReturn } from
|
|
14
|
-
export { useFormPersistence } from
|
|
15
|
-
export type { UseFormPersistenceOptions, UseFormPersistenceReturn } from
|
|
16
|
-
export { useDragDrop } from
|
|
17
|
-
export type { UseDragDropOptions, UseDragDropReturn, DragProps, } from
|
|
18
|
-
export { useResize } from
|
|
19
|
-
export type { UseResizeOptions, UseResizeReturn, ResizeEdge, ResizeHandleProps, } from
|
|
20
|
-
export { useAutocomplete } from
|
|
21
|
-
export type { UseAutocompleteOptions, UseAutocompleteReturn, } from
|
|
22
|
-
export { createPanZoom } from
|
|
23
|
-
export type { PanZoomOptions, PanZoomController, PanZoomState, PanZoomPoint, PanZoomCursor, } from
|
|
24
|
-
export { useDataValidator } from
|
|
25
|
-
export type { UseDataValidatorOptions, UseDataValidatorReturn, } from
|
|
26
|
-
//# sourceMappingURL=index.d.ts.map
|
|
6
|
+
export { useStreamingUI, DEFAULT_STREAMING_UI_MESSAGES } from "./useStreamingUI.js";
|
|
7
|
+
export type { UseStreamingUIOptions, StreamingUIMessages, StreamingUIState, StreamProgress, StreamError, CompleteMetadata, } from "./useStreamingUI.js";
|
|
8
|
+
export { useAction, useToolAction } from "./useAction.js";
|
|
9
|
+
export type { UseActionReturn, UseActionOptions, UseToolActionReturn, ActionRequest, ActionResult, } from "./useAction.js";
|
|
10
|
+
export { useConditionalField, evaluateCondition } from "./useConditionalField.js";
|
|
11
|
+
export type { UseConditionalFieldOptions } from "./useConditionalField.js";
|
|
12
|
+
export { useModal, useConfirmModal } from "./useModal.js";
|
|
13
|
+
export type { UseModalReturn, UseConfirmModalReturn } from "./useModal.js";
|
|
14
|
+
export { useFormPersistence } from "./useFormPersistence.js";
|
|
15
|
+
export type { UseFormPersistenceOptions, UseFormPersistenceReturn } from "./useFormPersistence.js";
|
|
16
|
+
export { useDragDrop } from "./useDragDrop.js";
|
|
17
|
+
export type { UseDragDropOptions, UseDragDropReturn, DragProps, } from "./useDragDrop.js";
|
|
18
|
+
export { useResize } from "./useResize.js";
|
|
19
|
+
export type { UseResizeOptions, UseResizeReturn, ResizeEdge, ResizeHandleProps, } from "./useResize.js";
|
|
20
|
+
export { useAutocomplete } from "./useAutocomplete.js";
|
|
21
|
+
export type { UseAutocompleteOptions, UseAutocompleteReturn, } from "./useAutocomplete.js";
|
|
22
|
+
export { createPanZoom } from "../utils/pan-zoom.js";
|
|
23
|
+
export type { PanZoomOptions, PanZoomController, PanZoomState, PanZoomPoint, PanZoomCursor, } from "../utils/pan-zoom.js";
|
|
24
|
+
export { useDataValidator } from "./useDataValidator.js";
|
|
25
|
+
export type { UseDataValidatorOptions, UseDataValidatorReturn, } from "./useDataValidator.js";
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAction - Hook for executing MCP actions from components
|
|
3
|
+
* Phase 5.0: Quick Wins - Simplified API for ActionRenderer and custom components
|
|
4
|
+
* Sprint 2: Lifecycle callbacks and retry support
|
|
5
|
+
*/
|
|
6
|
+
import { Accessor } from 'solid-js';
|
|
7
|
+
import { ActionRequest, ActionResult } from "../context/MCPActionContext.cjs";
|
|
8
|
+
import type { ActionLifecycleCallbacks } from "../types.cjs";
|
|
9
|
+
/**
|
|
10
|
+
* Options for useAction hook
|
|
11
|
+
*/
|
|
12
|
+
export interface UseActionOptions extends ActionLifecycleCallbacks {
|
|
13
|
+
/**
|
|
14
|
+
* Number of retry attempts on failure
|
|
15
|
+
*/
|
|
16
|
+
retryCount?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Delay between retries in milliseconds
|
|
19
|
+
*/
|
|
20
|
+
retryDelay?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Return type for useAction hook
|
|
24
|
+
*/
|
|
25
|
+
export interface UseActionReturn {
|
|
26
|
+
/**
|
|
27
|
+
* Execute a tool action
|
|
28
|
+
*/
|
|
29
|
+
execute: (toolName: string, params?: Record<string, any>) => Promise<ActionResult>;
|
|
30
|
+
/**
|
|
31
|
+
* Full execute with ActionRequest
|
|
32
|
+
*/
|
|
33
|
+
executeAction: (request: ActionRequest) => Promise<ActionResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Whether an action is currently executing
|
|
36
|
+
*/
|
|
37
|
+
isExecuting: Accessor<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Last result from action execution
|
|
40
|
+
*/
|
|
41
|
+
lastResult: Accessor<ActionResult | undefined>;
|
|
42
|
+
/**
|
|
43
|
+
* Last error (if any)
|
|
44
|
+
*/
|
|
45
|
+
lastError: Accessor<string | undefined>;
|
|
46
|
+
/**
|
|
47
|
+
* Retry the last failed action
|
|
48
|
+
*/
|
|
49
|
+
retry: () => Promise<ActionResult | undefined>;
|
|
50
|
+
/**
|
|
51
|
+
* Clear the last error
|
|
52
|
+
*/
|
|
53
|
+
clearError: () => void;
|
|
54
|
+
/**
|
|
55
|
+
* Reset all state
|
|
56
|
+
*/
|
|
57
|
+
reset: () => void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Hook for executing MCP actions
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```tsx
|
|
64
|
+
* function MyButton() {
|
|
65
|
+
* const { execute, isExecuting, lastError } = useAction()
|
|
66
|
+
*
|
|
67
|
+
* const handleClick = async () => {
|
|
68
|
+
* const result = await execute('search.hub', { query: 'test' })
|
|
69
|
+
* if (result.success) {
|
|
70
|
+
* console.log('Data:', result.data)
|
|
71
|
+
* }
|
|
72
|
+
* }
|
|
73
|
+
*
|
|
74
|
+
* return (
|
|
75
|
+
* <button onClick={handleClick} disabled={isExecuting()}>
|
|
76
|
+
* {isExecuting() ? 'Loading...' : 'Search'}
|
|
77
|
+
* </button>
|
|
78
|
+
* )
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @example With lifecycle callbacks
|
|
83
|
+
* ```tsx
|
|
84
|
+
* function MyActionButton() {
|
|
85
|
+
* const { execute, retry, clearError, lastError } = useAction({
|
|
86
|
+
* onBefore: (req) => {
|
|
87
|
+
* console.log('About to execute:', req.toolName)
|
|
88
|
+
* return true // proceed
|
|
89
|
+
* },
|
|
90
|
+
* onSuccess: (result) => {
|
|
91
|
+
* toast.success('Action completed!')
|
|
92
|
+
* },
|
|
93
|
+
* onError: (error) => {
|
|
94
|
+
* toast.error(`Action failed: ${error}`)
|
|
95
|
+
* },
|
|
96
|
+
* retryCount: 3,
|
|
97
|
+
* retryDelay: 1000,
|
|
98
|
+
* })
|
|
99
|
+
*
|
|
100
|
+
* return (
|
|
101
|
+
* <div>
|
|
102
|
+
* <button onClick={() => execute('search.hub', { query: 'test' })}>
|
|
103
|
+
* Search
|
|
104
|
+
* </button>
|
|
105
|
+
* <Show when={lastError()}>
|
|
106
|
+
* <button onClick={retry}>Retry</button>
|
|
107
|
+
* <button onClick={clearError}>Dismiss</button>
|
|
108
|
+
* </Show>
|
|
109
|
+
* </div>
|
|
110
|
+
* )
|
|
111
|
+
* }
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
export declare function useAction(options?: UseActionOptions): UseActionReturn;
|
|
115
|
+
/**
|
|
116
|
+
* Return type for useToolAction hook
|
|
117
|
+
*/
|
|
118
|
+
export interface UseToolActionReturn {
|
|
119
|
+
execute: (params?: Record<string, any>) => Promise<ActionResult>;
|
|
120
|
+
isExecuting: Accessor<boolean>;
|
|
121
|
+
lastResult: Accessor<ActionResult | undefined>;
|
|
122
|
+
lastError: Accessor<string | undefined>;
|
|
123
|
+
retry: () => Promise<ActionResult | undefined>;
|
|
124
|
+
clearError: () => void;
|
|
125
|
+
reset: () => void;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Hook for binding action to a specific tool
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```tsx
|
|
132
|
+
* function SearchButton() {
|
|
133
|
+
* const { execute, isExecuting } = useToolAction('search.hub')
|
|
134
|
+
*
|
|
135
|
+
* return (
|
|
136
|
+
* <button onClick={() => execute({ query: 'test' })} disabled={isExecuting()}>
|
|
137
|
+
* Search
|
|
138
|
+
* </button>
|
|
139
|
+
* )
|
|
140
|
+
* }
|
|
141
|
+
* ```
|
|
142
|
+
*
|
|
143
|
+
* @example With lifecycle callbacks
|
|
144
|
+
* ```tsx
|
|
145
|
+
* function SearchButton() {
|
|
146
|
+
* const { execute, retry, lastError } = useToolAction('search.hub', {
|
|
147
|
+
* onSuccess: (result) => toast.success('Search complete!'),
|
|
148
|
+
* onError: (error) => toast.error(`Search failed: ${error}`),
|
|
149
|
+
* retryCount: 2,
|
|
150
|
+
* })
|
|
151
|
+
*
|
|
152
|
+
* return (
|
|
153
|
+
* <div>
|
|
154
|
+
* <button onClick={() => execute({ query: 'test' })}>Search</button>
|
|
155
|
+
* <Show when={lastError()}>
|
|
156
|
+
* <button onClick={retry}>Retry</button>
|
|
157
|
+
* </Show>
|
|
158
|
+
* </div>
|
|
159
|
+
* )
|
|
160
|
+
* }
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
export declare function useToolAction(toolName: string, options?: UseActionOptions): UseToolActionReturn;
|
|
164
|
+
export type { ActionRequest, ActionResult };
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Sprint 2: Lifecycle callbacks and retry support
|
|
5
5
|
*/
|
|
6
6
|
import { Accessor } from 'solid-js';
|
|
7
|
-
import { ActionRequest, ActionResult } from
|
|
8
|
-
import type { ActionLifecycleCallbacks } from
|
|
7
|
+
import { ActionRequest, ActionResult } from "../context/MCPActionContext.js";
|
|
8
|
+
import type { ActionLifecycleCallbacks } from "../types.js";
|
|
9
9
|
/**
|
|
10
10
|
* Options for useAction hook
|
|
11
11
|
*/
|
|
@@ -162,4 +162,3 @@ export interface UseToolActionReturn {
|
|
|
162
162
|
*/
|
|
163
163
|
export declare function useToolAction(toolName: string, options?: UseActionOptions): UseToolActionReturn;
|
|
164
164
|
export type { ActionRequest, ActionResult };
|
|
165
|
-
//# sourceMappingURL=useAction.d.ts.map
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAutocomplete Hook
|
|
3
|
+
* Provides autocomplete functionality for form fields
|
|
4
|
+
*
|
|
5
|
+
* Sprint Autocomplete Feature
|
|
6
|
+
*/
|
|
7
|
+
import { Accessor } from 'solid-js';
|
|
8
|
+
import type { AutocompleteOption, AutocompleteContext, FieldAutocompleteConfig } from "../types.cjs";
|
|
9
|
+
/**
|
|
10
|
+
* Options for the useAutocomplete hook
|
|
11
|
+
*/
|
|
12
|
+
export interface UseAutocompleteOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Current input value accessor
|
|
15
|
+
*/
|
|
16
|
+
inputValue: Accessor<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Plugin ID to use (overrides default)
|
|
19
|
+
*/
|
|
20
|
+
pluginId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Field configuration
|
|
23
|
+
*/
|
|
24
|
+
fieldConfig?: FieldAutocompleteConfig;
|
|
25
|
+
/**
|
|
26
|
+
* Context data for suggestions
|
|
27
|
+
*/
|
|
28
|
+
context?: Accessor<AutocompleteContext>;
|
|
29
|
+
/**
|
|
30
|
+
* Whether autocomplete is enabled
|
|
31
|
+
*/
|
|
32
|
+
enabled?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Callback when input value should change (for accepting suggestions)
|
|
35
|
+
*/
|
|
36
|
+
onInputChange?: (value: string) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Minimum characters before triggering
|
|
39
|
+
*/
|
|
40
|
+
minChars?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Debounce delay in ms
|
|
43
|
+
*/
|
|
44
|
+
debounceMs?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Return type for the useAutocomplete hook
|
|
48
|
+
*/
|
|
49
|
+
export interface UseAutocompleteReturn {
|
|
50
|
+
/**
|
|
51
|
+
* Current completion text (for ghost text, LLM mode)
|
|
52
|
+
*/
|
|
53
|
+
completion: Accessor<string | null>;
|
|
54
|
+
/**
|
|
55
|
+
* Ghost text to show (remaining text after input)
|
|
56
|
+
*/
|
|
57
|
+
ghostText: Accessor<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Accept the current completion
|
|
60
|
+
*/
|
|
61
|
+
acceptCompletion: () => void;
|
|
62
|
+
/**
|
|
63
|
+
* Current options (for dropdown, data mode)
|
|
64
|
+
*/
|
|
65
|
+
options: Accessor<AutocompleteOption[]>;
|
|
66
|
+
/**
|
|
67
|
+
* Currently selected option index
|
|
68
|
+
*/
|
|
69
|
+
selectedIndex: Accessor<number>;
|
|
70
|
+
/**
|
|
71
|
+
* Select an option by index
|
|
72
|
+
*/
|
|
73
|
+
selectOption: (option: AutocompleteOption) => void;
|
|
74
|
+
/**
|
|
75
|
+
* Navigate to next option
|
|
76
|
+
*/
|
|
77
|
+
nextOption: () => void;
|
|
78
|
+
/**
|
|
79
|
+
* Navigate to previous option
|
|
80
|
+
*/
|
|
81
|
+
prevOption: () => void;
|
|
82
|
+
/**
|
|
83
|
+
* Select current highlighted option
|
|
84
|
+
*/
|
|
85
|
+
selectCurrentOption: () => void;
|
|
86
|
+
/**
|
|
87
|
+
* Whether suggestions are loading
|
|
88
|
+
*/
|
|
89
|
+
isLoading: Accessor<boolean>;
|
|
90
|
+
/**
|
|
91
|
+
* Error message if any
|
|
92
|
+
*/
|
|
93
|
+
error: Accessor<string | null>;
|
|
94
|
+
/**
|
|
95
|
+
* Dismiss suggestions
|
|
96
|
+
*/
|
|
97
|
+
dismiss: () => void;
|
|
98
|
+
/**
|
|
99
|
+
* Whether suggestions are visible
|
|
100
|
+
*/
|
|
101
|
+
isOpen: Accessor<boolean>;
|
|
102
|
+
/**
|
|
103
|
+
* Result type ('completion' or 'options')
|
|
104
|
+
*/
|
|
105
|
+
resultType: Accessor<'completion' | 'options' | null>;
|
|
106
|
+
/**
|
|
107
|
+
* Open/show suggestions
|
|
108
|
+
*/
|
|
109
|
+
open: () => void;
|
|
110
|
+
/**
|
|
111
|
+
* Handle keyboard events
|
|
112
|
+
*/
|
|
113
|
+
handleKeyDown: (e: KeyboardEvent) => boolean;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Hook for autocomplete functionality
|
|
117
|
+
*/
|
|
118
|
+
export declare function useAutocomplete(options: UseAutocompleteOptions): UseAutocompleteReturn;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Sprint Autocomplete Feature
|
|
6
6
|
*/
|
|
7
7
|
import { Accessor } from 'solid-js';
|
|
8
|
-
import type { AutocompleteOption, AutocompleteContext, FieldAutocompleteConfig } from
|
|
8
|
+
import type { AutocompleteOption, AutocompleteContext, FieldAutocompleteConfig } from "../types.js";
|
|
9
9
|
/**
|
|
10
10
|
* Options for the useAutocomplete hook
|
|
11
11
|
*/
|
|
@@ -116,4 +116,3 @@ export interface UseAutocompleteReturn {
|
|
|
116
116
|
* Hook for autocomplete functionality
|
|
117
117
|
*/
|
|
118
118
|
export declare function useAutocomplete(options: UseAutocompleteOptions): UseAutocompleteReturn;
|
|
119
|
-
//# sourceMappingURL=useAutocomplete.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useChatBus — SolidJS hook + context provider for the Chat Bus
|
|
3
|
+
* v2.4.0: Event-driven chat toolkit
|
|
4
|
+
*
|
|
5
|
+
* @experimental — This API may change without major bump until v2.5.0.
|
|
6
|
+
*/
|
|
7
|
+
import { type ParentComponent } from 'solid-js';
|
|
8
|
+
import type { ChatBus } from "../types/chat-bus.cjs";
|
|
9
|
+
/**
|
|
10
|
+
* @experimental
|
|
11
|
+
* Provider that creates and shares a ChatBus with all children.
|
|
12
|
+
* Cleans up all listeners on unmount.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <ChatBusProvider>
|
|
16
|
+
* <ChatInterfaceStreaming />
|
|
17
|
+
* <BriefingPanel />
|
|
18
|
+
* <AgentRouter />
|
|
19
|
+
* </ChatBusProvider>
|
|
20
|
+
*/
|
|
21
|
+
export declare const ChatBusProvider: ParentComponent<{
|
|
22
|
+
bus?: ChatBus;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* @experimental
|
|
26
|
+
* Access the ChatBus from any child component.
|
|
27
|
+
* Must be used within a `<ChatBusProvider>`.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* function BriefingPanel() {
|
|
31
|
+
* const bus = useChatBus()
|
|
32
|
+
*
|
|
33
|
+
* bus.events.on('onBriefing', (event) => {
|
|
34
|
+
* addBriefing(event.briefing)
|
|
35
|
+
* })
|
|
36
|
+
*
|
|
37
|
+
* return <div>...</div>
|
|
38
|
+
* }
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* function AgentRouter() {
|
|
42
|
+
* const bus = useChatBus()
|
|
43
|
+
*
|
|
44
|
+
* bus.events.on('onStreamEnd', (event) => {
|
|
45
|
+
* if (event.metadata.needs_clarification) {
|
|
46
|
+
* bus.commands.exec('showChatPrompt', {
|
|
47
|
+
* type: 'choice',
|
|
48
|
+
* title: 'Quelle periode ?',
|
|
49
|
+
* config: { options: [...] }
|
|
50
|
+
* })
|
|
51
|
+
* }
|
|
52
|
+
* })
|
|
53
|
+
* }
|
|
54
|
+
*/
|
|
55
|
+
export declare function useChatBus(): ChatBus;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @experimental — This API may change without major bump until v2.5.0.
|
|
6
6
|
*/
|
|
7
7
|
import { type ParentComponent } from 'solid-js';
|
|
8
|
-
import type { ChatBus } from
|
|
8
|
+
import type { ChatBus } from "../types/chat-bus.js";
|
|
9
9
|
/**
|
|
10
10
|
* @experimental
|
|
11
11
|
* Provider that creates and shares a ChatBus with all children.
|
|
@@ -53,4 +53,3 @@ export declare const ChatBusProvider: ParentComponent<{
|
|
|
53
53
|
* }
|
|
54
54
|
*/
|
|
55
55
|
export declare function useChatBus(): ChatBus;
|
|
56
|
-
//# sourceMappingURL=useChatBus.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useConditionalField - Evaluates showWhen conditions for form fields
|
|
3
|
+
* Sprint 2: Form Advanced
|
|
4
|
+
*/
|
|
5
|
+
import { Accessor } from 'solid-js';
|
|
6
|
+
import type { ShowWhenCondition } from "../types.cjs";
|
|
7
|
+
export interface UseConditionalFieldOptions {
|
|
8
|
+
condition?: ShowWhenCondition;
|
|
9
|
+
formData: Accessor<Record<string, any>>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Evaluates a showWhen condition against form data
|
|
13
|
+
*/
|
|
14
|
+
export declare function evaluateCondition(condition: ShowWhenCondition, formData: Record<string, any>): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Hook for conditional field visibility
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const { isVisible } = useConditionalField({
|
|
21
|
+
* condition: field.showWhen,
|
|
22
|
+
* formData: formDataAccessor
|
|
23
|
+
* })
|
|
24
|
+
*
|
|
25
|
+
* return (
|
|
26
|
+
* <Show when={isVisible()}>
|
|
27
|
+
* <input ... />
|
|
28
|
+
* </Show>
|
|
29
|
+
* )
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function useConditionalField(options: UseConditionalFieldOptions): {
|
|
33
|
+
isVisible: Accessor<boolean>;
|
|
34
|
+
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Sprint 2: Form Advanced
|
|
4
4
|
*/
|
|
5
5
|
import { Accessor } from 'solid-js';
|
|
6
|
-
import type { ShowWhenCondition } from
|
|
6
|
+
import type { ShowWhenCondition } from "../types.js";
|
|
7
7
|
export interface UseConditionalFieldOptions {
|
|
8
8
|
condition?: ShowWhenCondition;
|
|
9
9
|
formData: Accessor<Record<string, any>>;
|
|
@@ -32,4 +32,3 @@ export declare function evaluateCondition(condition: ShowWhenCondition, formData
|
|
|
32
32
|
export declare function useConditionalField(options: UseConditionalFieldOptions): {
|
|
33
33
|
isVisible: Accessor<boolean>;
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=useConditionalField.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useDataValidator — reactive SolidJS hook for data validation
|
|
3
|
+
* v3.1.0: Wraps validateAgainstSource in a reactive memo
|
|
4
|
+
*
|
|
5
|
+
* @experimental
|
|
6
|
+
*/
|
|
7
|
+
import type { DataValidation, DataValidationOptions } from "../types/chat-bus.cjs";
|
|
8
|
+
export interface UseDataValidatorOptions extends DataValidationOptions {
|
|
9
|
+
/** Disable validation (returns null) */
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface UseDataValidatorReturn {
|
|
13
|
+
/** Reactive validation result (null if disabled or no text) */
|
|
14
|
+
validation: () => DataValidation | null;
|
|
15
|
+
/** Is the text valid (no hallucinations)? */
|
|
16
|
+
valid: () => boolean;
|
|
17
|
+
/** Confidence score 0-1 */
|
|
18
|
+
confidence: () => number;
|
|
19
|
+
/** Count of hallucinated numbers */
|
|
20
|
+
hallucinatedCount: () => number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Reactive hook that validates LLM text against source data rows.
|
|
24
|
+
* Re-validates automatically when text or rows change.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* const { validation, valid, confidence } = useDataValidator(
|
|
29
|
+
* () => llmResponse(),
|
|
30
|
+
* () => sourceRows(),
|
|
31
|
+
* { tolerance: 0.02, ignoreColumns: ['code_geo'] }
|
|
32
|
+
* )
|
|
33
|
+
*
|
|
34
|
+
* return (
|
|
35
|
+
* <Show when={!valid()}>
|
|
36
|
+
* <span>⚠️ {validation()!.hallucinated.length} unverified numbers</span>
|
|
37
|
+
* </Show>
|
|
38
|
+
* )
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function useDataValidator(text: () => string, sourceRows: () => Record<string, unknown>[], options?: UseDataValidatorOptions): UseDataValidatorReturn;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @experimental
|
|
6
6
|
*/
|
|
7
|
-
import type { DataValidation, DataValidationOptions } from
|
|
7
|
+
import type { DataValidation, DataValidationOptions } from "../types/chat-bus.js";
|
|
8
8
|
export interface UseDataValidatorOptions extends DataValidationOptions {
|
|
9
9
|
/** Disable validation (returns null) */
|
|
10
10
|
enabled?: boolean;
|
|
@@ -39,4 +39,3 @@ export interface UseDataValidatorReturn {
|
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
41
|
export declare function useDataValidator(text: () => string, sourceRows: () => Record<string, unknown>[], options?: UseDataValidatorOptions): UseDataValidatorReturn;
|
|
42
|
-
//# sourceMappingURL=useDataValidator.d.ts.map
|