@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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP UI Solid - Components
|
|
3
|
+
*
|
|
4
|
+
* SolidJS components for rendering MCP-generated UI resources
|
|
5
|
+
*/
|
|
6
|
+
export { UIResourceRenderer } from "./UIResourceRenderer.cjs";
|
|
7
|
+
export type { UIResourceRendererProps } from "./UIResourceRenderer.cjs";
|
|
8
|
+
export { StreamingUIRenderer } from "./StreamingUIRenderer.cjs";
|
|
9
|
+
export type { StreamingUIRendererProps } from "./StreamingUIRenderer.cjs";
|
|
10
|
+
export { PresentationFeedback, DEFAULT_PRESENTATION_FEEDBACK_LABELS, } from "./PresentationFeedback.cjs";
|
|
11
|
+
export type { PresentationFeedbackProps, PresentationFeedbackLabels, } from "./PresentationFeedback.cjs";
|
|
12
|
+
export { GenerativeUIErrorBoundary } from "./GenerativeUIErrorBoundary.cjs";
|
|
13
|
+
export type { GenerativeUIErrorBoundaryProps } from "./GenerativeUIErrorBoundary.cjs";
|
|
14
|
+
export { FooterRenderer } from "./FooterRenderer.cjs";
|
|
15
|
+
export type { FooterComponentParams } from "./FooterRenderer.cjs";
|
|
16
|
+
export { ActionRenderer } from "./ActionRenderer.cjs";
|
|
17
|
+
export type { ActionRendererProps } from "./ActionRenderer.cjs";
|
|
18
|
+
export { ArtifactRenderer } from "./ArtifactRenderer.cjs";
|
|
19
|
+
export type { ArtifactComponentParams } from "./ArtifactRenderer.cjs";
|
|
20
|
+
export { CarouselRenderer } from "./CarouselRenderer.cjs";
|
|
21
|
+
export type { CarouselRendererProps } from "./CarouselRenderer.cjs";
|
|
22
|
+
export { GridRenderer } from "./GridRenderer.cjs";
|
|
23
|
+
export type { GridRendererProps, GridComponentParams } from "./GridRenderer.cjs";
|
|
24
|
+
export { FormRenderer } from "./FormRenderer.cjs";
|
|
25
|
+
export type { FormRendererProps } from "./FormRenderer.cjs";
|
|
26
|
+
export { FormFieldRenderer } from "./FormFieldRenderer.cjs";
|
|
27
|
+
export type { FormFieldRendererProps } from "./FormFieldRenderer.cjs";
|
|
28
|
+
export { ModalRenderer } from "./ModalRenderer.cjs";
|
|
29
|
+
export type { ModalRendererProps } from "./ModalRenderer.cjs";
|
|
30
|
+
export { ActionGroupRenderer } from "./ActionGroupRenderer.cjs";
|
|
31
|
+
export type { ActionGroupRendererProps } from "./ActionGroupRenderer.cjs";
|
|
32
|
+
export { ChartJSRenderer, isChartJSAvailable } from "./ChartJSRenderer.cjs";
|
|
33
|
+
export type { ChartJSRendererProps } from "./ChartJSRenderer.cjs";
|
|
34
|
+
export { LightboxOverlay } from "./LightboxOverlay.cjs";
|
|
35
|
+
export type { LightboxOverlayProps } from "./LightboxOverlay.cjs";
|
|
36
|
+
export { ImageGalleryRenderer } from "./ImageGalleryRenderer.cjs";
|
|
37
|
+
export type { ImageGalleryRendererProps } from "./ImageGalleryRenderer.cjs";
|
|
38
|
+
export { VideoRenderer, isSupportedVideoUrl, getVideoProvider } from "./VideoRenderer.cjs";
|
|
39
|
+
export type { VideoRendererProps } from "./VideoRenderer.cjs";
|
|
40
|
+
export { CodeBlockRenderer } from "./CodeBlockRenderer.cjs";
|
|
41
|
+
export type { CodeBlockRendererProps } from "./CodeBlockRenderer.cjs";
|
|
42
|
+
export { MapRenderer } from "./MapRenderer.cjs";
|
|
43
|
+
export type { MapRendererProps } from "./MapRenderer.cjs";
|
|
44
|
+
export { AgentCard, AgentStatusBadge } from "./AgentCard.cjs";
|
|
45
|
+
export type { AgentCardProps, AgentStatusBadgeProps } from "./AgentCard.cjs";
|
|
46
|
+
export { SplitStepper } from "./SplitStepper.cjs";
|
|
47
|
+
export type { SplitStepperProps } from "./SplitStepper.cjs";
|
|
48
|
+
export { AgentHandoff } from "./AgentHandoff.cjs";
|
|
49
|
+
export type { AgentHandoffProps } from "./AgentHandoff.cjs";
|
|
50
|
+
export { BriefingDiff } from "./BriefingDiff.cjs";
|
|
51
|
+
export type { BriefingDiffProps } from "./BriefingDiff.cjs";
|
|
52
|
+
export { VerifiedText } from "./VerifiedText.cjs";
|
|
53
|
+
export type { VerifiedTextProps } from "./VerifiedText.cjs";
|
|
54
|
+
export { DataPreviewSection } from "./DataPreviewSection.cjs";
|
|
55
|
+
export type { DataPreviewSectionProps } from "./DataPreviewSection.cjs";
|
|
56
|
+
export { RenderContext, RenderProvider, useRenderContext } from "./RenderContext.cjs";
|
|
57
|
+
export type { RenderContextValue, RenderComponentFn } from "./RenderContext.cjs";
|
|
58
|
+
export { ElicitationForm } from "./ElicitationForm.cjs";
|
|
59
|
+
export type { ElicitationFormProps } from "./ElicitationForm.cjs";
|
|
60
|
+
export { PortalDropdownMenu } from "./PortalDropdownMenu.cjs";
|
|
61
|
+
export type { PortalDropdownMenuProps } from "./PortalDropdownMenu.cjs";
|
|
62
|
+
export { UIResourceRenderer as default } from "./UIResourceRenderer.cjs";
|
|
@@ -3,61 +3,60 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SolidJS components for rendering MCP-generated UI resources
|
|
5
5
|
*/
|
|
6
|
-
export { UIResourceRenderer } from
|
|
7
|
-
export type { UIResourceRendererProps } from
|
|
8
|
-
export { StreamingUIRenderer } from
|
|
9
|
-
export type { StreamingUIRendererProps } from
|
|
10
|
-
export { PresentationFeedback, DEFAULT_PRESENTATION_FEEDBACK_LABELS, } from
|
|
11
|
-
export type { PresentationFeedbackProps, PresentationFeedbackLabels, } from
|
|
12
|
-
export { GenerativeUIErrorBoundary } from
|
|
13
|
-
export type { GenerativeUIErrorBoundaryProps } from
|
|
14
|
-
export { FooterRenderer } from
|
|
15
|
-
export type { FooterComponentParams } from
|
|
16
|
-
export { ActionRenderer } from
|
|
17
|
-
export type { ActionRendererProps } from
|
|
18
|
-
export { ArtifactRenderer } from
|
|
19
|
-
export type { ArtifactComponentParams } from
|
|
20
|
-
export { CarouselRenderer } from
|
|
21
|
-
export type { CarouselRendererProps } from
|
|
22
|
-
export { GridRenderer } from
|
|
23
|
-
export type { GridRendererProps, GridComponentParams } from
|
|
24
|
-
export { FormRenderer } from
|
|
25
|
-
export type { FormRendererProps } from
|
|
26
|
-
export { FormFieldRenderer } from
|
|
27
|
-
export type { FormFieldRendererProps } from
|
|
28
|
-
export { ModalRenderer } from
|
|
29
|
-
export type { ModalRendererProps } from
|
|
30
|
-
export { ActionGroupRenderer } from
|
|
31
|
-
export type { ActionGroupRendererProps } from
|
|
32
|
-
export { ChartJSRenderer, isChartJSAvailable } from
|
|
33
|
-
export type { ChartJSRendererProps } from
|
|
34
|
-
export { LightboxOverlay } from
|
|
35
|
-
export type { LightboxOverlayProps } from
|
|
36
|
-
export { ImageGalleryRenderer } from
|
|
37
|
-
export type { ImageGalleryRendererProps } from
|
|
38
|
-
export { VideoRenderer, isSupportedVideoUrl, getVideoProvider } from
|
|
39
|
-
export type { VideoRendererProps } from
|
|
40
|
-
export { CodeBlockRenderer } from
|
|
41
|
-
export type { CodeBlockRendererProps } from
|
|
42
|
-
export { MapRenderer } from
|
|
43
|
-
export type { MapRendererProps } from
|
|
44
|
-
export { AgentCard, AgentStatusBadge } from
|
|
45
|
-
export type { AgentCardProps, AgentStatusBadgeProps } from
|
|
46
|
-
export { SplitStepper } from
|
|
47
|
-
export type { SplitStepperProps } from
|
|
48
|
-
export { AgentHandoff } from
|
|
49
|
-
export type { AgentHandoffProps } from
|
|
50
|
-
export { BriefingDiff } from
|
|
51
|
-
export type { BriefingDiffProps } from
|
|
52
|
-
export { VerifiedText } from
|
|
53
|
-
export type { VerifiedTextProps } from
|
|
54
|
-
export { DataPreviewSection } from
|
|
55
|
-
export type { DataPreviewSectionProps } from
|
|
56
|
-
export { RenderContext, RenderProvider, useRenderContext } from
|
|
57
|
-
export type { RenderContextValue, RenderComponentFn } from
|
|
58
|
-
export { ElicitationForm } from
|
|
59
|
-
export type { ElicitationFormProps } from
|
|
60
|
-
export { PortalDropdownMenu } from
|
|
61
|
-
export type { PortalDropdownMenuProps } from
|
|
62
|
-
export { UIResourceRenderer as default } from
|
|
63
|
-
//# sourceMappingURL=index.d.ts.map
|
|
6
|
+
export { UIResourceRenderer } from "./UIResourceRenderer.js";
|
|
7
|
+
export type { UIResourceRendererProps } from "./UIResourceRenderer.js";
|
|
8
|
+
export { StreamingUIRenderer } from "./StreamingUIRenderer.js";
|
|
9
|
+
export type { StreamingUIRendererProps } from "./StreamingUIRenderer.js";
|
|
10
|
+
export { PresentationFeedback, DEFAULT_PRESENTATION_FEEDBACK_LABELS, } from "./PresentationFeedback.js";
|
|
11
|
+
export type { PresentationFeedbackProps, PresentationFeedbackLabels, } from "./PresentationFeedback.js";
|
|
12
|
+
export { GenerativeUIErrorBoundary } from "./GenerativeUIErrorBoundary.js";
|
|
13
|
+
export type { GenerativeUIErrorBoundaryProps } from "./GenerativeUIErrorBoundary.js";
|
|
14
|
+
export { FooterRenderer } from "./FooterRenderer.js";
|
|
15
|
+
export type { FooterComponentParams } from "./FooterRenderer.js";
|
|
16
|
+
export { ActionRenderer } from "./ActionRenderer.js";
|
|
17
|
+
export type { ActionRendererProps } from "./ActionRenderer.js";
|
|
18
|
+
export { ArtifactRenderer } from "./ArtifactRenderer.js";
|
|
19
|
+
export type { ArtifactComponentParams } from "./ArtifactRenderer.js";
|
|
20
|
+
export { CarouselRenderer } from "./CarouselRenderer.js";
|
|
21
|
+
export type { CarouselRendererProps } from "./CarouselRenderer.js";
|
|
22
|
+
export { GridRenderer } from "./GridRenderer.js";
|
|
23
|
+
export type { GridRendererProps, GridComponentParams } from "./GridRenderer.js";
|
|
24
|
+
export { FormRenderer } from "./FormRenderer.js";
|
|
25
|
+
export type { FormRendererProps } from "./FormRenderer.js";
|
|
26
|
+
export { FormFieldRenderer } from "./FormFieldRenderer.js";
|
|
27
|
+
export type { FormFieldRendererProps } from "./FormFieldRenderer.js";
|
|
28
|
+
export { ModalRenderer } from "./ModalRenderer.js";
|
|
29
|
+
export type { ModalRendererProps } from "./ModalRenderer.js";
|
|
30
|
+
export { ActionGroupRenderer } from "./ActionGroupRenderer.js";
|
|
31
|
+
export type { ActionGroupRendererProps } from "./ActionGroupRenderer.js";
|
|
32
|
+
export { ChartJSRenderer, isChartJSAvailable } from "./ChartJSRenderer.js";
|
|
33
|
+
export type { ChartJSRendererProps } from "./ChartJSRenderer.js";
|
|
34
|
+
export { LightboxOverlay } from "./LightboxOverlay.js";
|
|
35
|
+
export type { LightboxOverlayProps } from "./LightboxOverlay.js";
|
|
36
|
+
export { ImageGalleryRenderer } from "./ImageGalleryRenderer.js";
|
|
37
|
+
export type { ImageGalleryRendererProps } from "./ImageGalleryRenderer.js";
|
|
38
|
+
export { VideoRenderer, isSupportedVideoUrl, getVideoProvider } from "./VideoRenderer.js";
|
|
39
|
+
export type { VideoRendererProps } from "./VideoRenderer.js";
|
|
40
|
+
export { CodeBlockRenderer } from "./CodeBlockRenderer.js";
|
|
41
|
+
export type { CodeBlockRendererProps } from "./CodeBlockRenderer.js";
|
|
42
|
+
export { MapRenderer } from "./MapRenderer.js";
|
|
43
|
+
export type { MapRendererProps } from "./MapRenderer.js";
|
|
44
|
+
export { AgentCard, AgentStatusBadge } from "./AgentCard.js";
|
|
45
|
+
export type { AgentCardProps, AgentStatusBadgeProps } from "./AgentCard.js";
|
|
46
|
+
export { SplitStepper } from "./SplitStepper.js";
|
|
47
|
+
export type { SplitStepperProps } from "./SplitStepper.js";
|
|
48
|
+
export { AgentHandoff } from "./AgentHandoff.js";
|
|
49
|
+
export type { AgentHandoffProps } from "./AgentHandoff.js";
|
|
50
|
+
export { BriefingDiff } from "./BriefingDiff.js";
|
|
51
|
+
export type { BriefingDiffProps } from "./BriefingDiff.js";
|
|
52
|
+
export { VerifiedText } from "./VerifiedText.js";
|
|
53
|
+
export type { VerifiedTextProps } from "./VerifiedText.js";
|
|
54
|
+
export { DataPreviewSection } from "./DataPreviewSection.js";
|
|
55
|
+
export type { DataPreviewSectionProps } from "./DataPreviewSection.js";
|
|
56
|
+
export { RenderContext, RenderProvider, useRenderContext } from "./RenderContext.js";
|
|
57
|
+
export type { RenderContextValue, RenderComponentFn } from "./RenderContext.js";
|
|
58
|
+
export { ElicitationForm } from "./ElicitationForm.js";
|
|
59
|
+
export type { ElicitationFormProps } from "./ElicitationForm.js";
|
|
60
|
+
export { PortalDropdownMenu } from "./PortalDropdownMenu.js";
|
|
61
|
+
export type { PortalDropdownMenuProps } from "./PortalDropdownMenu.js";
|
|
62
|
+
export { UIResourceRenderer as default } from "./UIResourceRenderer.js";
|
package/dist/components.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { default } from
|
|
1
|
+
export * from "./components/index.cjs";
|
|
2
|
+
export { default } from "./components/index.cjs";
|
package/dist/components.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { default } from
|
|
1
|
+
export * from "./components/index.js";
|
|
2
|
+
export { default } from "./components/index.js";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AutocompleteContext - Context provider for autocomplete functionality
|
|
3
|
+
* Manages plugins and provides unified autocomplete API
|
|
4
|
+
*
|
|
5
|
+
* Sprint Autocomplete Feature
|
|
6
|
+
*/
|
|
7
|
+
import { ParentComponent, Accessor } from 'solid-js';
|
|
8
|
+
import type { AutocompletePlugin, AutocompleteResult, AutocompleteContext as AutocompleteContextData, AutocompleteProviderConfig } from "../types.cjs";
|
|
9
|
+
/**
|
|
10
|
+
* Context value interface
|
|
11
|
+
*/
|
|
12
|
+
export interface AutocompleteContextValue {
|
|
13
|
+
/**
|
|
14
|
+
* Get suggestions from a plugin
|
|
15
|
+
*/
|
|
16
|
+
getSuggestions: (input: string, pluginId?: string, context?: AutocompleteContextData) => Promise<AutocompleteResult>;
|
|
17
|
+
/**
|
|
18
|
+
* Get registered plugins
|
|
19
|
+
*/
|
|
20
|
+
plugins: Accessor<AutocompletePlugin[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Get default plugin ID
|
|
23
|
+
*/
|
|
24
|
+
defaultPluginId: Accessor<string | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* Check if a plugin is ready
|
|
27
|
+
*/
|
|
28
|
+
isPluginReady: (pluginId: string) => boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Get plugin by ID
|
|
31
|
+
*/
|
|
32
|
+
getPlugin: (pluginId: string) => AutocompletePlugin | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Register a new plugin
|
|
35
|
+
*/
|
|
36
|
+
registerPlugin: (plugin: AutocompletePlugin) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Unregister a plugin
|
|
39
|
+
*/
|
|
40
|
+
unregisterPlugin: (pluginId: string) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Clear cache
|
|
43
|
+
*/
|
|
44
|
+
clearCache: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* Global config
|
|
47
|
+
*/
|
|
48
|
+
config: {
|
|
49
|
+
debounceMs: number;
|
|
50
|
+
minChars: number;
|
|
51
|
+
cacheTtl: number;
|
|
52
|
+
cacheEnabled: boolean;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
declare const AutocompleteCtx: import("solid-js").Context<AutocompleteContextValue | undefined>;
|
|
56
|
+
/**
|
|
57
|
+
* Props for AutocompleteProvider
|
|
58
|
+
*/
|
|
59
|
+
export interface AutocompleteProviderProps extends AutocompleteProviderConfig {
|
|
60
|
+
children: any;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* AutocompleteProvider Component
|
|
64
|
+
* Provides autocomplete context to child components
|
|
65
|
+
*/
|
|
66
|
+
export declare const AutocompleteProvider: ParentComponent<AutocompleteProviderProps>;
|
|
67
|
+
/**
|
|
68
|
+
* Hook to use autocomplete context
|
|
69
|
+
* @throws Error if used outside provider
|
|
70
|
+
*/
|
|
71
|
+
export declare function useAutocompleteContext(): AutocompleteContextValue;
|
|
72
|
+
/**
|
|
73
|
+
* Safe hook that returns undefined if outside provider
|
|
74
|
+
*/
|
|
75
|
+
export declare function useAutocompleteContextSafe(): AutocompleteContextValue | undefined;
|
|
76
|
+
export { AutocompleteCtx };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Sprint Autocomplete Feature
|
|
6
6
|
*/
|
|
7
7
|
import { ParentComponent, Accessor } from 'solid-js';
|
|
8
|
-
import type { AutocompletePlugin, AutocompleteResult, AutocompleteContext as AutocompleteContextData, AutocompleteProviderConfig } from
|
|
8
|
+
import type { AutocompletePlugin, AutocompleteResult, AutocompleteContext as AutocompleteContextData, AutocompleteProviderConfig } from "../types.js";
|
|
9
9
|
/**
|
|
10
10
|
* Context value interface
|
|
11
11
|
*/
|
|
@@ -74,4 +74,3 @@ export declare function useAutocompleteContext(): AutocompleteContextValue;
|
|
|
74
74
|
*/
|
|
75
75
|
export declare function useAutocompleteContextSafe(): AutocompleteContextValue | undefined;
|
|
76
76
|
export { AutocompleteCtx };
|
|
77
|
-
//# sourceMappingURL=AutocompleteContext.d.ts.map
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCPActionContext - Context provider for MCP action execution
|
|
3
|
+
* Phase 5.0: Quick Wins - Replaces CustomEvent with typed context for Mastra integration
|
|
4
|
+
*/
|
|
5
|
+
import { ParentComponent, Accessor } from 'solid-js';
|
|
6
|
+
/**
|
|
7
|
+
* Action request payload
|
|
8
|
+
*/
|
|
9
|
+
export interface ActionRequest {
|
|
10
|
+
/**
|
|
11
|
+
* MCP tool name to execute. For a `submit` action with no associated
|
|
12
|
+
* tool, renderers pass the sentinel `'submit'` — branch on `action`,
|
|
13
|
+
* not on `toolName`, to tell a submit apart from a tool call.
|
|
14
|
+
*/
|
|
15
|
+
toolName: string;
|
|
16
|
+
/**
|
|
17
|
+
* Tool parameters
|
|
18
|
+
*/
|
|
19
|
+
params?: Record<string, any>;
|
|
20
|
+
/**
|
|
21
|
+
* Optional space IDs for multi-space context
|
|
22
|
+
*/
|
|
23
|
+
spaceIds?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Optional macro ID for template execution
|
|
26
|
+
*/
|
|
27
|
+
macroId?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Action kind (v6.6.1). Lets a host `executor` tell a tool call apart
|
|
30
|
+
* from a form-style `submit`. Absent ⇒ treat as `'tool-call'` (backward
|
|
31
|
+
* compatible — every pre-v6.6.1 request omits it).
|
|
32
|
+
*
|
|
33
|
+
* A `submit` action carries its payload in `params` (e.g. `submit_url`,
|
|
34
|
+
* `connector_id`, `feedback_value`) and **must NOT** be executed as a
|
|
35
|
+
* tool call — the host routes it (e.g. POST to `params.submit_url`).
|
|
36
|
+
*/
|
|
37
|
+
action?: 'tool-call' | 'submit' | 'link';
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Action result from execution
|
|
41
|
+
*/
|
|
42
|
+
export interface ActionResult {
|
|
43
|
+
/**
|
|
44
|
+
* Whether the action was successful
|
|
45
|
+
*/
|
|
46
|
+
success: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Result data (if successful)
|
|
49
|
+
*/
|
|
50
|
+
data?: any;
|
|
51
|
+
/**
|
|
52
|
+
* Error message (if failed)
|
|
53
|
+
*/
|
|
54
|
+
error?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Execution timestamp
|
|
57
|
+
*/
|
|
58
|
+
timestamp: string;
|
|
59
|
+
/**
|
|
60
|
+
* Tool that was executed
|
|
61
|
+
*/
|
|
62
|
+
toolName: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Context value interface
|
|
66
|
+
*/
|
|
67
|
+
export interface MCPActionContextValue {
|
|
68
|
+
/**
|
|
69
|
+
* Execute an MCP action
|
|
70
|
+
*/
|
|
71
|
+
executeAction: (request: ActionRequest) => Promise<ActionResult>;
|
|
72
|
+
/**
|
|
73
|
+
* Currently available tools (from MCP server)
|
|
74
|
+
*/
|
|
75
|
+
availableTools: Accessor<string[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Space IDs in current context
|
|
78
|
+
*/
|
|
79
|
+
spaceIds: Accessor<string[]>;
|
|
80
|
+
/**
|
|
81
|
+
* Current macro ID (if executing within a template)
|
|
82
|
+
*/
|
|
83
|
+
macroId: Accessor<string | undefined>;
|
|
84
|
+
/**
|
|
85
|
+
* Whether an action is currently executing
|
|
86
|
+
*/
|
|
87
|
+
isExecuting: Accessor<boolean>;
|
|
88
|
+
/**
|
|
89
|
+
* Last action result
|
|
90
|
+
*/
|
|
91
|
+
lastResult: Accessor<ActionResult | undefined>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Props for MCPActionProvider
|
|
95
|
+
*/
|
|
96
|
+
export interface MCPActionProviderProps {
|
|
97
|
+
/**
|
|
98
|
+
* Space IDs for multi-space queries
|
|
99
|
+
*/
|
|
100
|
+
spaceIds?: string[];
|
|
101
|
+
/**
|
|
102
|
+
* Macro ID when executing within a template
|
|
103
|
+
*/
|
|
104
|
+
macroId?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Available MCP tools
|
|
107
|
+
*/
|
|
108
|
+
availableTools?: string[];
|
|
109
|
+
/**
|
|
110
|
+
* Callback for action execution (for audit logging)
|
|
111
|
+
*/
|
|
112
|
+
onAction?: (request: ActionRequest, result: ActionResult) => void;
|
|
113
|
+
/**
|
|
114
|
+
* Callback for webhook events (n8n, Zapier integration)
|
|
115
|
+
*/
|
|
116
|
+
onWebhook?: (event: {
|
|
117
|
+
type: string;
|
|
118
|
+
payload: any;
|
|
119
|
+
}) => void;
|
|
120
|
+
/**
|
|
121
|
+
* Custom action executor (override default)
|
|
122
|
+
*/
|
|
123
|
+
executor?: (request: ActionRequest) => Promise<ActionResult>;
|
|
124
|
+
}
|
|
125
|
+
declare const MCPActionContext: import("solid-js").Context<MCPActionContextValue | undefined>;
|
|
126
|
+
/**
|
|
127
|
+
* MCPActionProvider - Provides action execution context to child components
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```tsx
|
|
131
|
+
* <MCPActionProvider
|
|
132
|
+
* spaceIds={['space-123']}
|
|
133
|
+
* macroId="sales_overview"
|
|
134
|
+
* onAction={(req, res) => audit(req, res)}
|
|
135
|
+
* >
|
|
136
|
+
* <UIResourceRenderer layout={layout} />
|
|
137
|
+
* </MCPActionProvider>
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
export declare const MCPActionProvider: ParentComponent<MCPActionProviderProps>;
|
|
141
|
+
/**
|
|
142
|
+
* Hook to access MCP action context
|
|
143
|
+
* Throws if used outside of MCPActionProvider
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```tsx
|
|
147
|
+
* const { executeAction, isExecuting } = useMCPAction()
|
|
148
|
+
*
|
|
149
|
+
* const handleClick = async () => {
|
|
150
|
+
* const result = await executeAction({
|
|
151
|
+
* toolName: 'search.hub',
|
|
152
|
+
* params: { query: 'revenue Q4' },
|
|
153
|
+
* })
|
|
154
|
+
* }
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
export declare function useMCPAction(): MCPActionContextValue;
|
|
158
|
+
/**
|
|
159
|
+
* Hook to access MCP action context with fallback for components
|
|
160
|
+
* outside of provider (uses CustomEvent fallback)
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```tsx
|
|
164
|
+
* const { executeAction, isExecuting } = useMCPActionSafe()
|
|
165
|
+
* // Works even without MCPActionProvider
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
export declare function useMCPActionSafe(): MCPActionContextValue;
|
|
169
|
+
export { MCPActionContext };
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCPUIConfigContext — host-level rendering policy: the library's iframes
|
|
3
|
+
* (v6.21.0) and, since v6.22.0, where a chart may capture the wheel.
|
|
4
|
+
*
|
|
5
|
+
* @since v6.21.0
|
|
6
|
+
*
|
|
7
|
+
* ## Why
|
|
8
|
+
*
|
|
9
|
+
* A host that serves `Cross-Origin-Embedder-Policy: credentialless` makes the
|
|
10
|
+
* browser refuse every cross-origin iframe whose own document does not send a
|
|
11
|
+
* COEP header — which is YouTube, Vimeo, Google Docs, Notion and nearly all of
|
|
12
|
+
* `DEFAULT_IFRAME_DOMAINS`. The escape hatch is the boolean HTML attribute
|
|
13
|
+
* `credentialless` on the `<iframe>` itself: the document then loads, but
|
|
14
|
+
* without access to the cookies and storage of its own origin.
|
|
15
|
+
*
|
|
16
|
+
* That trade-off is free for a public video or chart and fatal for an
|
|
17
|
+
* authenticated embed, so the library keys it on the distinction it already
|
|
18
|
+
* makes: `TRUSTED_IFRAME_DOMAINS` (the hosts that receive `allow-same-origin`
|
|
19
|
+
* because they need their own cookies) do NOT get the attribute; everything
|
|
20
|
+
* else does. This context lets a host override that, add its own trusted
|
|
21
|
+
* hosts, and control the "open in a new tab" fallback link.
|
|
22
|
+
*
|
|
23
|
+
* ## Scope — policy only, NOT strings
|
|
24
|
+
*
|
|
25
|
+
* Text lives in `MCPUIStrings` (`MCPUIStringsContext`). This context carries
|
|
26
|
+
* only behavioural switches, and like the strings context every renderer works
|
|
27
|
+
* standalone: with no provider mounted, `DEFAULT_MCPUI_CONFIG` applies.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* import { MCPUIConfigProvider } from '@seed-ship/mcp-ui-solid'
|
|
32
|
+
*
|
|
33
|
+
* <MCPUIConfigProvider config={{ customTrustedIframeDomains: ['embed.acme.com'] }}>
|
|
34
|
+
* <App />
|
|
35
|
+
* </MCPUIConfigProvider>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
import { type JSX } from 'solid-js';
|
|
39
|
+
import type { IframePolicy } from "../types.cjs";
|
|
40
|
+
/**
|
|
41
|
+
* Host-level rendering policy. Every field has a default — a provider passes
|
|
42
|
+
* a partial override.
|
|
43
|
+
*
|
|
44
|
+
* ## Two names, because there are two jobs
|
|
45
|
+
*
|
|
46
|
+
* This type grows a key every time the library gains a policy switch, and
|
|
47
|
+
* those releases are MINOR — so neither AUTHORING a config nor READING one
|
|
48
|
+
* may break when a key appears. Those two demands pull in opposite
|
|
49
|
+
* directions, and one name cannot serve both:
|
|
50
|
+
*
|
|
51
|
+
* - an author must be allowed to omit the new key, so the fields they write
|
|
52
|
+
* have to be OPTIONAL;
|
|
53
|
+
* - a reader assigning `const p: IframePolicy = config.iframePolicy` must not
|
|
54
|
+
* suddenly face `undefined`, so the fields they read have to be REQUIRED.
|
|
55
|
+
*
|
|
56
|
+
* Hence {@link MCPUIConfigInput} (what a host writes — every field optional)
|
|
57
|
+
* and {@link MCPUIConfig} (what the library hands back — every field
|
|
58
|
+
* resolved). `MCPUIConfig` is derived from the input type, so the two can
|
|
59
|
+
* never drift and a key is declared exactly once.
|
|
60
|
+
*
|
|
61
|
+
* Which one you name depends on the surface:
|
|
62
|
+
*
|
|
63
|
+
* - `<MCPUIConfigProvider config={…}>` takes `MCPUIConfigInput` — name that
|
|
64
|
+
* type for a partial you build, and it merges the rest;
|
|
65
|
+
* - `<MCPUIConfigContext.Provider value={…}>` takes the RESOLVED
|
|
66
|
+
* `MCPUIConfig`, because that context is read as well as written, so a
|
|
67
|
+
* direct provider hands over `{ ...DEFAULT_MCPUI_CONFIG, ...mine }`;
|
|
68
|
+
* - anything you RECEIVE is `MCPUIConfig`, which is what
|
|
69
|
+
* {@link useMCPUIConfig} returns.
|
|
70
|
+
*/
|
|
71
|
+
export interface MCPUIConfigInput {
|
|
72
|
+
/**
|
|
73
|
+
* When the library puts the boolean `credentialless` attribute on an
|
|
74
|
+
* `<iframe>` it renders.
|
|
75
|
+
*
|
|
76
|
+
* - `'auto'` (default) — on every iframe whose host is NOT in
|
|
77
|
+
* `TRUSTED_IFRAME_DOMAINS` (plus `customTrustedIframeDomains`). Those
|
|
78
|
+
* hosts already ran without cookies, since their sandbox has no
|
|
79
|
+
* `allow-same-origin`; the attribute is what unblocks them under COEP.
|
|
80
|
+
* - `'always'` — on every iframe, trusted hosts included. An authenticated
|
|
81
|
+
* embed will then render its login screen.
|
|
82
|
+
* - `'never'` — never. The right value for a host that sends no COEP header
|
|
83
|
+
* and does not want its embeds to lose their cookies.
|
|
84
|
+
*
|
|
85
|
+
* Chrome/Edge 110+ honour the attribute; Firefox ignores it (iframes stay
|
|
86
|
+
* blocked while the host sends COEP); Safari ignores the COEP value itself,
|
|
87
|
+
* so nothing is blocked there in the first place.
|
|
88
|
+
*/
|
|
89
|
+
iframeCredentialless?: 'auto' | 'always' | 'never';
|
|
90
|
+
/**
|
|
91
|
+
* Extra hosts treated as trusted, on top of `TRUSTED_IFRAME_DOMAINS`:
|
|
92
|
+
* no `credentialless` attribute, and `allow-same-origin` in the sandbox.
|
|
93
|
+
* A subdomain of a listed host matches too.
|
|
94
|
+
*
|
|
95
|
+
* This only RECLASSIFIES a host the allow-list already accepts. To render an
|
|
96
|
+
* iframe whose host is outside `DEFAULT_IFRAME_DOMAINS`, add it to
|
|
97
|
+
* {@link MCPUIConfigInput.customIframeDomains} with `iframePolicy: 'extend'`.
|
|
98
|
+
*/
|
|
99
|
+
customTrustedIframeDomains?: string[];
|
|
100
|
+
/**
|
|
101
|
+
* How `UIResourceRenderer` validates an `iframe` component's host:
|
|
102
|
+
* `'strict'` (default) accepts `DEFAULT_IFRAME_DOMAINS` only, `'extend'`
|
|
103
|
+
* also accepts {@link MCPUIConfigInput.customIframeDomains}.
|
|
104
|
+
*/
|
|
105
|
+
iframePolicy?: IframePolicy;
|
|
106
|
+
/**
|
|
107
|
+
* Extra hosts the allow-list accepts when `iframePolicy` is `'extend'`.
|
|
108
|
+
* Without this, a component pointing at an unlisted host is replaced by the
|
|
109
|
+
* validation card before any renderer runs.
|
|
110
|
+
*/
|
|
111
|
+
customIframeDomains?: string[];
|
|
112
|
+
/**
|
|
113
|
+
* When the library renders an "open in a new tab" link under an embed
|
|
114
|
+
* (`strings.iframeOpenInNewTab`).
|
|
115
|
+
*
|
|
116
|
+
* A COEP-blocked iframe fires no event the parent page can observe, so
|
|
117
|
+
* without this the user sees an unexplained blank frame.
|
|
118
|
+
*
|
|
119
|
+
* - `'auto'` (default) — only when the page is cross-origin isolated
|
|
120
|
+
* (`window.crossOriginIsolated`). That flag needs COOP `same-origin` AND
|
|
121
|
+
* COEP, so a host that sends COEP alone still blocks embeds while the
|
|
122
|
+
* flag is false: set `'always'` there. Read after mount, never during
|
|
123
|
+
* render, so SSR markup and hydration agree.
|
|
124
|
+
* - `'always'` / `'never'` — unconditional.
|
|
125
|
+
*/
|
|
126
|
+
iframeFallbackLink?: 'auto' | 'always' | 'never';
|
|
127
|
+
/**
|
|
128
|
+
* Where `ChartJSRenderer` enables wheel-zoom / drag-pan / pinch on a chart
|
|
129
|
+
* (through the optional `chartjs-plugin-zoom` peer dependency — absent, the
|
|
130
|
+
* chart renders exactly as it does without this setting).
|
|
131
|
+
*
|
|
132
|
+
* Hijacking the mouse wheel on a component sitting inline in a scrolling
|
|
133
|
+
* chat feed is hostile: the user scrolls the conversation and the chart eats
|
|
134
|
+
* the gesture. So zoom belongs to a surface that OWNS its viewport, which
|
|
135
|
+
* here is `ExpandableWrapper`'s fullscreen modal.
|
|
136
|
+
*
|
|
137
|
+
* - `'expanded'` (default) — only inside the fullscreen modal.
|
|
138
|
+
* - `'always'` — inline as well. For a host that lays charts out in a
|
|
139
|
+
* dashboard rather than in a feed, where the wheel has nothing to steal.
|
|
140
|
+
* - `'never'` — off everywhere; the plugin is never registered.
|
|
141
|
+
*
|
|
142
|
+
* @since 6.22.0
|
|
143
|
+
*/
|
|
144
|
+
chartZoom?: 'expanded' | 'always' | 'never';
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The resolved host policy: every key present. This is what the library hands
|
|
148
|
+
* back, so a reader never null-checks a policy.
|
|
149
|
+
*
|
|
150
|
+
* Extends `Required<`{@link MCPUIConfigInput}`>` rather than declaring the
|
|
151
|
+
* fields again, so a key exists in exactly one place and the two views cannot
|
|
152
|
+
* drift. It remains an interface so existing consumers can extend or augment
|
|
153
|
+
* the public contract as they could before 6.22.0.
|
|
154
|
+
*/
|
|
155
|
+
export interface MCPUIConfig extends Required<MCPUIConfigInput> {
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Defaults. Chosen so a host that sends no COEP header sees no change from
|
|
159
|
+
* 6.20.0 apart from the fallback link, which `'auto'` keeps hidden there —
|
|
160
|
+
* and, since 6.22.0, so no inline component ever captures the wheel
|
|
161
|
+
* (`chartZoom: 'expanded'`).
|
|
162
|
+
*
|
|
163
|
+
* Typed `MCPUIConfig` (i.e. resolved): that annotation is what stops a new
|
|
164
|
+
* key from shipping without a default.
|
|
165
|
+
*/
|
|
166
|
+
export declare const DEFAULT_MCPUI_CONFIG: MCPUIConfig;
|
|
167
|
+
/**
|
|
168
|
+
* Typed with the RESOLVED view, because this context is read as well as
|
|
169
|
+
* written: it is exported, so a consumer may call
|
|
170
|
+
* `useContext(MCPUIConfigContext)` directly, and typing it as the input view
|
|
171
|
+
* would hand them `IframePolicy | undefined` — exactly the regression this
|
|
172
|
+
* whole split exists to undo.
|
|
173
|
+
*
|
|
174
|
+
* The cost lands on the rarer side: a host feeding this context directly
|
|
175
|
+
* passes a COMPLETE value, `{ ...DEFAULT_MCPUI_CONFIG, ...mine }`. Anyone who
|
|
176
|
+
* wants to pass only the keys they care about uses `MCPUIConfigProvider`,
|
|
177
|
+
* whose `config` prop takes `Partial<`{@link MCPUIConfig}`>` and does that
|
|
178
|
+
* merge. That preserves optional properties added through declaration
|
|
179
|
+
* merging; {@link MCPUIConfigInput} remains the unaugmented built-in input
|
|
180
|
+
* shape a host can name for ordinary authored configs.
|
|
181
|
+
*/
|
|
182
|
+
export declare const MCPUIConfigContext: import("solid-js").Context<MCPUIConfig>;
|
|
183
|
+
/**
|
|
184
|
+
* Reads the active host config, resolved: every key is present, whether it
|
|
185
|
+
* came from the provider or from `DEFAULT_MCPUI_CONFIG`. Returns the defaults
|
|
186
|
+
* outright when no `<MCPUIConfigProvider>` is mounted above.
|
|
187
|
+
*/
|
|
188
|
+
export declare function useMCPUIConfig(): MCPUIConfig;
|
|
189
|
+
export interface MCPUIConfigProviderProps {
|
|
190
|
+
/**
|
|
191
|
+
* Partial override of the host config. Any key left unset falls back to
|
|
192
|
+
* `DEFAULT_MCPUI_CONFIG`.
|
|
193
|
+
*/
|
|
194
|
+
config?: Partial<MCPUIConfig>;
|
|
195
|
+
children: JSX.Element;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Provides the host config to every MCP-UI renderer below it.
|
|
199
|
+
* Merges the partial `config` override over the defaults.
|
|
200
|
+
*/
|
|
201
|
+
export declare function MCPUIConfigProvider(props: MCPUIConfigProviderProps): JSX.Element;
|