@miragon/mcp-toolkit-ui 2.6.0 → 2.8.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/README.md +14 -5
- package/dist/app/adapt-data-widget.d.ts +1 -22
- package/dist/app/adapt-data-widget.d.ts.map +1 -1
- package/dist/app/adapt-data-widget.js +1 -35
- package/dist/app/adapt-data-widget.js.map +1 -1
- package/dist/app/builder/BuilderBanners.d.ts +7 -2
- package/dist/app/builder/BuilderBanners.d.ts.map +1 -1
- package/dist/app/builder/BuilderBanners.js +8 -3
- package/dist/app/builder/BuilderBanners.js.map +1 -1
- package/dist/app/builder/CanvasRow.d.ts +4 -2
- package/dist/app/builder/CanvasRow.d.ts.map +1 -1
- package/dist/app/builder/CanvasRow.js +29 -17
- package/dist/app/builder/CanvasRow.js.map +1 -1
- package/dist/app/builder/CatalogueSheet.d.ts.map +1 -1
- package/dist/app/builder/CatalogueSheet.js +14 -6
- package/dist/app/builder/CatalogueSheet.js.map +1 -1
- package/dist/app/builder/CellPropsSheet.d.ts +7 -3
- package/dist/app/builder/CellPropsSheet.d.ts.map +1 -1
- package/dist/app/builder/CellPropsSheet.js +10 -3
- package/dist/app/builder/CellPropsSheet.js.map +1 -1
- package/dist/app/builder/DiscardDialog.d.ts +18 -0
- package/dist/app/builder/DiscardDialog.d.ts.map +1 -0
- package/dist/app/builder/DiscardDialog.js +18 -0
- package/dist/app/builder/DiscardDialog.js.map +1 -0
- package/dist/app/builder/EmptyHint.d.ts +4 -0
- package/dist/app/builder/EmptyHint.d.ts.map +1 -1
- package/dist/app/builder/EmptyHint.js +6 -1
- package/dist/app/builder/EmptyHint.js.map +1 -1
- package/dist/app/builder/LayoutSurface.d.ts +33 -9
- package/dist/app/builder/LayoutSurface.d.ts.map +1 -1
- package/dist/app/builder/LayoutSurface.js +74 -23
- package/dist/app/builder/LayoutSurface.js.map +1 -1
- package/dist/app/builder/PipelineStrip.d.ts +5 -2
- package/dist/app/builder/PipelineStrip.d.ts.map +1 -1
- package/dist/app/builder/PipelineStrip.js +33 -15
- package/dist/app/builder/PipelineStrip.js.map +1 -1
- package/dist/app/builder/SaveDialog.d.ts +9 -1
- package/dist/app/builder/SaveDialog.d.ts.map +1 -1
- package/dist/app/builder/SaveDialog.js +9 -3
- package/dist/app/builder/SaveDialog.js.map +1 -1
- package/dist/app/builder/Toolbar.d.ts +14 -4
- package/dist/app/builder/Toolbar.d.ts.map +1 -1
- package/dist/app/builder/Toolbar.js +24 -7
- package/dist/app/builder/Toolbar.js.map +1 -1
- package/dist/app/builder/Workspace.d.ts +23 -3
- package/dist/app/builder/Workspace.d.ts.map +1 -1
- package/dist/app/builder/Workspace.js +58 -8
- package/dist/app/builder/Workspace.js.map +1 -1
- package/dist/app/builder/builder-model.d.ts +146 -3
- package/dist/app/builder/builder-model.d.ts.map +1 -1
- package/dist/app/builder/builder-model.js +196 -5
- package/dist/app/builder/builder-model.js.map +1 -1
- package/dist/app/builder/labels.d.ts +13 -62
- package/dist/app/builder/labels.d.ts.map +1 -1
- package/dist/app/builder/labels.js +9 -58
- package/dist/app/builder/labels.js.map +1 -1
- package/dist/app/builder/reveal.d.ts +10 -0
- package/dist/app/builder/reveal.d.ts.map +1 -0
- package/dist/app/builder/reveal.js +10 -0
- package/dist/app/builder/reveal.js.map +1 -0
- package/dist/app/builder/status-chip.d.ts.map +1 -1
- package/dist/app/builder/status-chip.js +3 -2
- package/dist/app/builder/status-chip.js.map +1 -1
- package/dist/app/builder/use-builder-catalogue.d.ts +5 -1
- package/dist/app/builder/use-builder-catalogue.d.ts.map +1 -1
- package/dist/app/builder/use-builder-catalogue.js +50 -17
- package/dist/app/builder/use-builder-catalogue.js.map +1 -1
- package/dist/app/builder/use-builder-session.d.ts +30 -0
- package/dist/app/builder/use-builder-session.d.ts.map +1 -0
- package/dist/app/builder/use-builder-session.js +58 -0
- package/dist/app/builder/use-builder-session.js.map +1 -0
- package/dist/app/builder/use-display-resolver.d.ts +17 -0
- package/dist/app/builder/use-display-resolver.d.ts.map +1 -0
- package/dist/app/builder/use-display-resolver.js +16 -0
- package/dist/app/builder/use-display-resolver.js.map +1 -0
- package/dist/app/builder/use-save-dashboard.d.ts +3 -1
- package/dist/app/builder/use-save-dashboard.d.ts.map +1 -1
- package/dist/app/builder/use-save-dashboard.js +3 -1
- package/dist/app/builder/use-save-dashboard.js.map +1 -1
- package/dist/app/index.d.ts +8 -3
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +8 -2
- package/dist/app/index.js.map +1 -1
- package/dist/app/layout-builder.d.ts +18 -25
- package/dist/app/layout-builder.d.ts.map +1 -1
- package/dist/app/layout-builder.js +84 -78
- package/dist/app/layout-builder.js.map +1 -1
- package/dist/app/mcp-app-view-chrome.d.ts +103 -20
- package/dist/app/mcp-app-view-chrome.d.ts.map +1 -1
- package/dist/app/mcp-app-view-chrome.js +125 -40
- package/dist/app/mcp-app-view-chrome.js.map +1 -1
- package/dist/app/mcp-app-view-states.d.ts +23 -0
- package/dist/app/mcp-app-view-states.d.ts.map +1 -0
- package/dist/app/mcp-app-view-states.js +55 -0
- package/dist/app/mcp-app-view-states.js.map +1 -0
- package/dist/app/mcp-app-view.d.ts +72 -5
- package/dist/app/mcp-app-view.d.ts.map +1 -1
- package/dist/app/mcp-app-view.js +241 -141
- package/dist/app/mcp-app-view.js.map +1 -1
- package/dist/app/mcp-toolkit-app.d.ts +8 -2
- package/dist/app/mcp-toolkit-app.d.ts.map +1 -1
- package/dist/app/mcp-toolkit-app.js +33 -4
- package/dist/app/mcp-toolkit-app.js.map +1 -1
- package/dist/app/mcp-use-host-bridge.d.ts +15 -6
- package/dist/app/mcp-use-host-bridge.d.ts.map +1 -1
- package/dist/app/mcp-use-host-bridge.js +51 -22
- package/dist/app/mcp-use-host-bridge.js.map +1 -1
- package/dist/app/model-context.d.ts +71 -0
- package/dist/app/model-context.d.ts.map +1 -0
- package/dist/app/model-context.js +101 -0
- package/dist/app/model-context.js.map +1 -0
- package/dist/app/use-build-mode-focus.d.ts +33 -0
- package/dist/app/use-build-mode-focus.d.ts.map +1 -0
- package/dist/app/use-build-mode-focus.js +59 -0
- package/dist/app/use-build-mode-focus.js.map +1 -0
- package/dist/app/use-view-actions.d.ts +31 -0
- package/dist/app/use-view-actions.d.ts.map +1 -0
- package/dist/app/use-view-actions.js +81 -0
- package/dist/app/use-view-actions.js.map +1 -0
- package/dist/app/use-view-lifecycle.d.ts +42 -0
- package/dist/app/use-view-lifecycle.d.ts.map +1 -0
- package/dist/app/use-view-lifecycle.js +81 -0
- package/dist/app/use-view-lifecycle.js.map +1 -0
- package/dist/app/view-lifecycle.d.ts +185 -0
- package/dist/app/view-lifecycle.d.ts.map +1 -0
- package/dist/app/view-lifecycle.js +207 -0
- package/dist/app/view-lifecycle.js.map +1 -0
- package/dist/app/widget-fixture.d.ts +10 -3
- package/dist/app/widget-fixture.d.ts.map +1 -1
- package/dist/app/widget-fixture.js +21 -8
- package/dist/app/widget-fixture.js.map +1 -1
- package/dist/app/widget-props-sheet.d.ts +6 -10
- package/dist/app/widget-props-sheet.d.ts.map +1 -1
- package/dist/app/widget-props-sheet.js +25 -20
- package/dist/app/widget-props-sheet.js.map +1 -1
- package/dist/app/widget-renderer.d.ts +41 -1
- package/dist/app/widget-renderer.d.ts.map +1 -1
- package/dist/app/widget-renderer.js +82 -31
- package/dist/app/widget-renderer.js.map +1 -1
- package/dist/components/DrillButton.d.ts +9 -6
- package/dist/components/DrillButton.d.ts.map +1 -1
- package/dist/components/DrillButton.js +9 -6
- package/dist/components/DrillButton.js.map +1 -1
- package/dist/components/EmptyState.d.ts +33 -0
- package/dist/components/EmptyState.d.ts.map +1 -0
- package/dist/components/EmptyState.js +19 -0
- package/dist/components/EmptyState.js.map +1 -0
- package/dist/components/ErrorState.d.ts +53 -0
- package/dist/components/ErrorState.d.ts.map +1 -0
- package/dist/components/ErrorState.js +77 -0
- package/dist/components/ErrorState.js.map +1 -0
- package/dist/components/FilterBar.d.ts +16 -5
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +13 -5
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/GroupCard.d.ts.map +1 -1
- package/dist/components/GroupCard.js +2 -1
- package/dist/components/GroupCard.js.map +1 -1
- package/dist/components/KpiGrid.d.ts +70 -18
- package/dist/components/KpiGrid.d.ts.map +1 -1
- package/dist/components/KpiGrid.js +112 -23
- package/dist/components/KpiGrid.js.map +1 -1
- package/dist/components/ListFooter.d.ts +32 -4
- package/dist/components/ListFooter.d.ts.map +1 -1
- package/dist/components/ListFooter.js +35 -6
- package/dist/components/ListFooter.js.map +1 -1
- package/dist/components/PagedListFooter.d.ts +57 -0
- package/dist/components/PagedListFooter.d.ts.map +1 -0
- package/dist/components/PagedListFooter.js +27 -0
- package/dist/components/PagedListFooter.js.map +1 -0
- package/dist/components/Pills.d.ts +36 -12
- package/dist/components/Pills.d.ts.map +1 -1
- package/dist/components/Pills.js +29 -8
- package/dist/components/Pills.js.map +1 -1
- package/dist/components/SectionHeading.d.ts +3 -1
- package/dist/components/SectionHeading.d.ts.map +1 -1
- package/dist/components/SectionHeading.js +6 -2
- package/dist/components/SectionHeading.js.map +1 -1
- package/dist/components/Toast.d.ts +43 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/Toast.js +106 -0
- package/dist/components/Toast.js.map +1 -0
- package/dist/components/WidgetHeader.d.ts +34 -10
- package/dist/components/WidgetHeader.d.ts.map +1 -1
- package/dist/components/WidgetHeader.js +11 -6
- package/dist/components/WidgetHeader.js.map +1 -1
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/tool-result-recovery-model.d.ts +155 -0
- package/dist/hooks/tool-result-recovery-model.d.ts.map +1 -0
- package/dist/hooks/tool-result-recovery-model.js +273 -0
- package/dist/hooks/tool-result-recovery-model.js.map +1 -0
- package/dist/hooks/use-tool-query.d.ts +56 -14
- package/dist/hooks/use-tool-query.d.ts.map +1 -1
- package/dist/hooks/use-tool-query.js +102 -25
- package/dist/hooks/use-tool-query.js.map +1 -1
- package/dist/hooks/use-tool-result-recovery.d.ts +61 -44
- package/dist/hooks/use-tool-result-recovery.d.ts.map +1 -1
- package/dist/hooks/use-tool-result-recovery.js +62 -110
- package/dist/hooks/use-tool-result-recovery.js.map +1 -1
- package/dist/hooks/use-view-data.d.ts +55 -7
- package/dist/hooks/use-view-data.d.ts.map +1 -1
- package/dist/hooks/use-view-data.js +81 -11
- package/dist/hooks/use-view-data.js.map +1 -1
- package/dist/hooks/use-view-tool-query.d.ts +12 -7
- package/dist/hooks/use-view-tool-query.d.ts.map +1 -1
- package/dist/hooks/use-view-tool-query.js +15 -14
- package/dist/hooks/use-view-tool-query.js.map +1 -1
- package/dist/index.d.ts +27 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/focus-return.d.ts +61 -0
- package/dist/lib/focus-return.d.ts.map +1 -0
- package/dist/lib/focus-return.js +46 -0
- package/dist/lib/focus-return.js.map +1 -0
- package/dist/lib/focus-ring.d.ts +18 -0
- package/dist/lib/focus-ring.d.ts.map +1 -0
- package/dist/lib/focus-ring.js +18 -0
- package/dist/lib/focus-ring.js.map +1 -0
- package/dist/lib/icon-stroke.d.ts +12 -0
- package/dist/lib/icon-stroke.d.ts.map +1 -0
- package/dist/lib/icon-stroke.js +12 -0
- package/dist/lib/icon-stroke.js.map +1 -0
- package/dist/lib/parse-tool-result.d.ts +23 -1
- package/dist/lib/parse-tool-result.d.ts.map +1 -1
- package/dist/lib/parse-tool-result.js +38 -2
- package/dist/lib/parse-tool-result.js.map +1 -1
- package/dist/lib/toast-model.d.ts +86 -0
- package/dist/lib/toast-model.d.ts.map +1 -0
- package/dist/lib/toast-model.js +102 -0
- package/dist/lib/toast-model.js.map +1 -0
- package/dist/lib/tone-utils.d.ts +95 -9
- package/dist/lib/tone-utils.d.ts.map +1 -1
- package/dist/lib/tone-utils.js +100 -9
- package/dist/lib/tone-utils.js.map +1 -1
- package/dist/lib/tool-query.d.ts +107 -0
- package/dist/lib/tool-query.d.ts.map +1 -0
- package/dist/lib/tool-query.js +182 -0
- package/dist/lib/tool-query.js.map +1 -0
- package/dist/lib/tool-result-observer.d.ts +108 -0
- package/dist/lib/tool-result-observer.d.ts.map +1 -0
- package/dist/lib/tool-result-observer.js +158 -0
- package/dist/lib/tool-result-observer.js.map +1 -0
- package/dist/lib/typography.d.ts +37 -0
- package/dist/lib/typography.d.ts.map +1 -0
- package/dist/lib/typography.js +41 -0
- package/dist/lib/typography.js.map +1 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +11 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/locale/index.d.ts +3 -1
- package/dist/locale/index.d.ts.map +1 -1
- package/dist/locale/index.js +2 -1
- package/dist/locale/index.js.map +1 -1
- package/dist/locale/locale-provider.d.ts +42 -1
- package/dist/locale/locale-provider.d.ts.map +1 -1
- package/dist/locale/locale-provider.js +44 -3
- package/dist/locale/locale-provider.js.map +1 -1
- package/dist/locale/message-types.d.ts +336 -0
- package/dist/locale/message-types.d.ts.map +1 -0
- package/dist/locale/message-types.js +7 -0
- package/dist/locale/message-types.js.map +1 -0
- package/dist/locale/messages-de.d.ts +9 -0
- package/dist/locale/messages-de.d.ts.map +1 -0
- package/dist/locale/messages-de.js +185 -0
- package/dist/locale/messages-de.js.map +1 -0
- package/dist/locale/messages-en.d.ts +8 -0
- package/dist/locale/messages-en.d.ts.map +1 -0
- package/dist/locale/messages-en.js +184 -0
- package/dist/locale/messages-en.js.map +1 -0
- package/dist/locale/toolkit-messages.d.ts +57 -0
- package/dist/locale/toolkit-messages.d.ts.map +1 -0
- package/dist/locale/toolkit-messages.js +103 -0
- package/dist/locale/toolkit-messages.js.map +1 -0
- package/dist/primitives/alert.d.ts +1 -1
- package/dist/primitives/alert.d.ts.map +1 -1
- package/dist/primitives/alert.js +6 -2
- package/dist/primitives/alert.js.map +1 -1
- package/dist/primitives/badge.d.ts +1 -1
- package/dist/primitives/badge.d.ts.map +1 -1
- package/dist/primitives/badge.js +19 -6
- package/dist/primitives/badge.js.map +1 -1
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/button.d.ts.map +1 -1
- package/dist/primitives/button.js +12 -8
- package/dist/primitives/button.js.map +1 -1
- package/dist/primitives/card.js +4 -4
- package/dist/primitives/card.js.map +1 -1
- package/dist/primitives/dialog.d.ts +7 -3
- package/dist/primitives/dialog.d.ts.map +1 -1
- package/dist/primitives/dialog.js +22 -8
- package/dist/primitives/dialog.js.map +1 -1
- package/dist/primitives/input.d.ts.map +1 -1
- package/dist/primitives/input.js +4 -1
- package/dist/primitives/input.js.map +1 -1
- package/dist/primitives/scroll-area.js +1 -1
- package/dist/primitives/scroll-area.js.map +1 -1
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +6 -3
- package/dist/primitives/select.js.map +1 -1
- package/dist/primitives/sheet.d.ts +3 -1
- package/dist/primitives/sheet.d.ts.map +1 -1
- package/dist/primitives/sheet.js +17 -7
- package/dist/primitives/sheet.js.map +1 -1
- package/dist/primitives/skeleton.js +1 -1
- package/dist/primitives/skeleton.js.map +1 -1
- package/dist/primitives/switch.d.ts.map +1 -1
- package/dist/primitives/switch.js +2 -1
- package/dist/primitives/switch.js.map +1 -1
- package/dist/primitives/tabs.d.ts.map +1 -1
- package/dist/primitives/tabs.js +5 -3
- package/dist/primitives/tabs.js.map +1 -1
- package/dist/providers/query-provider.d.ts +32 -1
- package/dist/providers/query-provider.d.ts.map +1 -1
- package/dist/providers/query-provider.js +53 -4
- package/dist/providers/query-provider.js.map +1 -1
- package/dist/render-cases-primitives.js +1 -1
- package/dist/render-cases-primitives.js.map +1 -1
- package/dist/render-cases.d.ts.map +1 -1
- package/dist/render-cases.js +48 -6
- package/dist/render-cases.js.map +1 -1
- package/dist/render-effects.d.ts +42 -0
- package/dist/render-effects.d.ts.map +1 -0
- package/dist/render-effects.js +81 -0
- package/dist/render-effects.js.map +1 -0
- package/dist/render-scan.d.ts +25 -0
- package/dist/render-scan.d.ts.map +1 -0
- package/dist/render-scan.js +66 -0
- package/dist/render-scan.js.map +1 -0
- package/dist/theme/cd-tokens.d.ts +66 -0
- package/dist/theme/cd-tokens.d.ts.map +1 -0
- package/dist/theme/cd-tokens.js +64 -0
- package/dist/theme/cd-tokens.js.map +1 -0
- package/dist/theme/create-theme.d.ts +214 -39
- package/dist/theme/create-theme.d.ts.map +1 -1
- package/dist/theme/create-theme.js +204 -13
- package/dist/theme/create-theme.js.map +1 -1
- package/dist/theme/fonts.d.ts +38 -0
- package/dist/theme/fonts.d.ts.map +1 -0
- package/dist/theme/fonts.js +56 -0
- package/dist/theme/fonts.js.map +1 -0
- package/dist/theme/host-fonts.d.ts +39 -0
- package/dist/theme/host-fonts.d.ts.map +1 -0
- package/dist/theme/host-fonts.js +44 -0
- package/dist/theme/host-fonts.js.map +1 -0
- package/dist/theme/index.d.ts +8 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +5 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/portal-container.d.ts +16 -0
- package/dist/theme/portal-container.d.ts.map +1 -0
- package/dist/theme/portal-container.js +19 -0
- package/dist/theme/portal-container.js.map +1 -0
- package/dist/theme/presets.d.ts +24 -9
- package/dist/theme/presets.d.ts.map +1 -1
- package/dist/theme/presets.js +44 -11
- package/dist/theme/presets.js.map +1 -1
- package/dist/theme/theme-provider.d.ts +27 -9
- package/dist/theme/theme-provider.d.ts.map +1 -1
- package/dist/theme/theme-provider.js +42 -20
- package/dist/theme/theme-provider.js.map +1 -1
- package/package.json +11 -5
- package/src/app/adapt-data-widget.tsx +2 -42
- package/src/app/builder/BuilderBanners.tsx +26 -13
- package/src/app/builder/CanvasRow.tsx +79 -32
- package/src/app/builder/CatalogueSheet.tsx +58 -35
- package/src/app/builder/CellPropsSheet.tsx +17 -2
- package/src/app/builder/DiscardDialog.tsx +59 -0
- package/src/app/builder/EmptyHint.tsx +16 -11
- package/src/app/builder/LayoutSurface.tsx +207 -67
- package/src/app/builder/PipelineStrip.tsx +265 -156
- package/src/app/builder/SaveDialog.tsx +25 -14
- package/src/app/builder/Toolbar.tsx +154 -57
- package/src/app/builder/Workspace.tsx +226 -56
- package/src/app/builder/builder-feedback.test.tsx +75 -0
- package/src/app/builder/builder-model.test.ts +5 -0
- package/src/app/builder/builder-model.ts +346 -6
- package/src/app/builder/builder-model.ux.test.ts +456 -0
- package/src/app/builder/builder-ux.test.tsx +844 -0
- package/src/app/builder/labels.ts +15 -121
- package/src/app/builder/reveal.ts +10 -0
- package/src/app/builder/status-chip.tsx +8 -4
- package/src/app/builder/use-builder-catalogue.ts +62 -19
- package/src/app/builder/use-builder-session.ts +68 -0
- package/src/app/builder/use-display-resolver.ts +24 -0
- package/src/app/builder/use-save-dashboard.ts +5 -0
- package/src/app/index.ts +20 -3
- package/src/app/layout-builder.tsx +193 -186
- package/src/app/mcp-app-view-chrome.test.tsx +487 -14
- package/src/app/mcp-app-view-chrome.tsx +328 -100
- package/src/app/mcp-app-view-states.tsx +140 -0
- package/src/app/mcp-app-view.effects.test.tsx +292 -0
- package/src/app/mcp-app-view.test.tsx +478 -0
- package/src/app/mcp-app-view.tsx +447 -190
- package/src/app/mcp-toolkit-app.test.tsx +40 -0
- package/src/app/mcp-toolkit-app.tsx +39 -8
- package/src/app/mcp-use-host-bridge.test.tsx +180 -0
- package/src/app/mcp-use-host-bridge.tsx +67 -24
- package/src/app/model-context.test.tsx +116 -0
- package/src/app/model-context.tsx +125 -0
- package/src/app/use-build-mode-focus.ts +62 -0
- package/src/app/use-view-actions.ts +89 -0
- package/src/app/use-view-lifecycle.ts +122 -0
- package/src/app/view-lifecycle.test.ts +443 -0
- package/src/app/view-lifecycle.ts +334 -0
- package/src/app/widget-fixture.effects.test.tsx +51 -0
- package/src/app/widget-fixture.render.test.tsx +81 -0
- package/src/app/widget-fixture.tsx +34 -11
- package/src/app/widget-props-sheet.tsx +67 -39
- package/src/app/widget-renderer.render.test.tsx +131 -0
- package/src/app/widget-renderer.tsx +136 -38
- package/src/components/DrillButton.tsx +24 -10
- package/src/components/EmptyState.tsx +83 -0
- package/src/components/ErrorState.tsx +204 -0
- package/src/components/FilterBar.test.tsx +82 -0
- package/src/components/FilterBar.tsx +56 -27
- package/src/components/GroupCard.tsx +3 -2
- package/src/components/KpiGrid.test.tsx +279 -0
- package/src/components/KpiGrid.tsx +329 -91
- package/src/components/ListFooter.test.tsx +116 -0
- package/src/components/ListFooter.tsx +110 -12
- package/src/components/PagedListFooter.test.tsx +140 -0
- package/src/components/PagedListFooter.tsx +107 -0
- package/src/components/Pills.test.tsx +77 -0
- package/src/components/Pills.tsx +78 -16
- package/src/components/SectionHeading.tsx +9 -3
- package/src/components/Toast.tsx +206 -0
- package/src/components/WidgetHeader.test.tsx +78 -0
- package/src/components/WidgetHeader.tsx +63 -16
- package/src/components/feedback-states.test.tsx +314 -0
- package/src/components/tone-figures.test.tsx +58 -0
- package/src/fonts.css +19 -0
- package/src/globals.css +9 -165
- package/src/hooks/index.ts +6 -3
- package/src/hooks/tool-result-recovery-model.test.ts +744 -0
- package/src/hooks/tool-result-recovery-model.ts +418 -0
- package/src/hooks/use-tool-query.effects.test.tsx +205 -0
- package/src/hooks/use-tool-query.ts +156 -33
- package/src/hooks/use-tool-result-recovery.effects.test.tsx +141 -0
- package/src/hooks/use-tool-result-recovery.test.ts +28 -5
- package/src/hooks/use-tool-result-recovery.ts +101 -131
- package/src/hooks/use-view-data.test.tsx +169 -0
- package/src/hooks/use-view-data.ts +131 -10
- package/src/hooks/use-view-tool-query.ts +25 -19
- package/src/i18n-coverage.test.tsx +425 -0
- package/src/index.ts +102 -13
- package/src/lib/focus-return.test.ts +288 -0
- package/src/lib/focus-return.ts +96 -0
- package/src/lib/focus-ring.ts +20 -0
- package/src/lib/icon-stroke.test.ts +59 -0
- package/src/lib/icon-stroke.ts +13 -0
- package/src/lib/parse-tool-result.test.ts +46 -1
- package/src/lib/parse-tool-result.ts +40 -2
- package/src/lib/toast-model.test.ts +233 -0
- package/src/lib/toast-model.ts +165 -0
- package/src/lib/tone-utils.test.ts +125 -16
- package/src/lib/tone-utils.ts +144 -15
- package/src/lib/tool-query.test.ts +569 -0
- package/src/lib/tool-query.ts +253 -0
- package/src/lib/tool-result-observer.test.ts +296 -0
- package/src/lib/tool-result-observer.ts +211 -0
- package/src/lib/typography.test.ts +45 -0
- package/src/lib/typography.ts +47 -0
- package/src/lib/utils.ts +12 -1
- package/src/locale/index.ts +14 -1
- package/src/locale/locale-provider.test.tsx +87 -0
- package/src/locale/locale-provider.tsx +90 -3
- package/src/locale/message-types.ts +337 -0
- package/src/locale/messages-de.ts +198 -0
- package/src/locale/messages-en.ts +196 -0
- package/src/locale/toolkit-messages.test.ts +349 -0
- package/src/locale/toolkit-messages.ts +143 -0
- package/src/no-hardcoded-copy.test.ts +432 -0
- package/src/primitives/alert.tsx +7 -2
- package/src/primitives/badge.tsx +19 -7
- package/src/primitives/button.tsx +13 -8
- package/src/primitives/card.tsx +4 -4
- package/src/primitives/dialog.tsx +42 -8
- package/src/primitives/input.tsx +5 -3
- package/src/primitives/scroll-area.tsx +1 -1
- package/src/primitives/select.tsx +7 -4
- package/src/primitives/sheet.tsx +33 -6
- package/src/primitives/skeleton.tsx +1 -1
- package/src/primitives/switch.tsx +4 -2
- package/src/primitives/tabs.tsx +9 -6
- package/src/providers/query-provider.test.tsx +154 -0
- package/src/providers/query-provider.tsx +66 -5
- package/src/render-cases-primitives.tsx +1 -1
- package/src/render-cases.tsx +82 -6
- package/src/render-effects.tsx +96 -0
- package/src/render-scan.ts +75 -0
- package/src/theme/cd-tokens.generated.css +48 -0
- package/src/theme/cd-tokens.test.ts +109 -0
- package/src/theme/cd-tokens.ts +67 -0
- package/src/theme/create-theme.test.ts +253 -5
- package/src/theme/create-theme.ts +341 -41
- package/src/theme/fonts.test.ts +85 -0
- package/src/theme/fonts.ts +72 -0
- package/src/theme/host-fonts.test.ts +135 -0
- package/src/theme/host-fonts.ts +52 -0
- package/src/theme/index.ts +15 -1
- package/src/theme/portal-container.ts +20 -0
- package/src/theme/presets.ts +44 -11
- package/src/theme/theme-css.test.ts +619 -0
- package/src/theme/theme-provider.test.tsx +82 -0
- package/src/theme/theme-provider.tsx +60 -24
- package/src/theme.css +344 -0
- package/ui-catalog.json +783 -49
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
|
-
* Presentational chrome for `McpAppView` — the
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Split out of `mcp-app-view.tsx` so the shell
|
|
7
|
-
* host-sync and state logic while
|
|
3
|
+
* Presentational chrome for `McpAppView` — the toolbar, the failed-steps
|
|
4
|
+
* alert, and the build/render body — plus the view-envelope types they share.
|
|
5
|
+
* The pre-payload states (waiting / error / cancelled) live in
|
|
6
|
+
* `mcp-app-view-states.tsx`. Split out of `mcp-app-view.tsx` so the shell
|
|
7
|
+
* component keeps only the host-sync and state logic while these files stay
|
|
8
|
+
* hook-light.
|
|
8
9
|
*/
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { createElement } from "react";
|
|
11
|
+
import { LucideProvider, Maximize2, Minimize2, Pencil, RefreshCw } from "lucide-react";
|
|
12
|
+
import { ErrorState } from "../components/ErrorState.js";
|
|
13
|
+
import { DENSE_ICON_STROKE } from "../lib/icon-stroke.js";
|
|
14
|
+
import { TOOLKIT_MESSAGES } from "../locale/toolkit-messages.js";
|
|
15
|
+
import { Button } from "../primitives/button.js";
|
|
16
|
+
import { LayoutBuilder, } from "./layout-builder.js";
|
|
12
17
|
import { WidgetRenderer } from "./widget-renderer.js";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
exitFullscreen: "Collapse",
|
|
20
|
-
build: "Build",
|
|
21
|
-
};
|
|
18
|
+
/**
|
|
19
|
+
* English chrome strings.
|
|
20
|
+
* @deprecated Read the active locale's strings with `useToolkitMessages().view`
|
|
21
|
+
* (or `TOOLKIT_MESSAGES.en.view`); this alias stays for existing imports.
|
|
22
|
+
*/
|
|
23
|
+
export const DEFAULT_LABELS = TOOLKIT_MESSAGES.en.view;
|
|
22
24
|
/**
|
|
23
25
|
* A renderable view payload: the envelope `render-view`/`show_*` tools emit
|
|
24
26
|
* as `structuredContent`. Module-level so it is referentially stable as the
|
|
@@ -28,35 +30,118 @@ export function isCompleteViewData(value) {
|
|
|
28
30
|
const v = value;
|
|
29
31
|
return Boolean(v?.context && v?.layout);
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Commit the builder's draft into the view payload so the renderer shows the
|
|
35
|
+
* just-built layout and Refresh re-issues it. Exported for tests.
|
|
36
|
+
*/
|
|
37
|
+
export function applyBuilderCommit(prev, commit) {
|
|
38
|
+
const title = commit.title ?? prev.title;
|
|
39
|
+
return {
|
|
40
|
+
...prev,
|
|
41
|
+
layout: commit.layout,
|
|
42
|
+
title,
|
|
43
|
+
context: commit.context ?? prev.context,
|
|
44
|
+
_refreshParams: { keys: commit.keys, steps: commit.steps, layout: commit.layout, title },
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Whether the Fullscreen toggle may render: the host offers fullscreen
|
|
49
|
+
* (mcp-use's negotiated `availableDisplayModes`, toolkit#178 K22), or the view
|
|
50
|
+
* is already there (its exit toggle must stay).
|
|
51
|
+
*/
|
|
52
|
+
export function fullscreenAvailable(displayMode, availableDisplayModes) {
|
|
53
|
+
return displayMode === "fullscreen" || availableDisplayModes.includes("fullscreen");
|
|
54
|
+
}
|
|
55
|
+
/** The toolbar title per {@link ViewTitleMode}: a heading, the consumer's slot, or nothing. */
|
|
56
|
+
function ToolbarTitle({ title, mode, level, renderTitle, }) {
|
|
57
|
+
if (mode === "slot")
|
|
58
|
+
return _jsx("div", { className: "min-w-0 flex-1", children: renderTitle?.(title) });
|
|
59
|
+
if (mode === "hide" || !title)
|
|
60
|
+
return null;
|
|
61
|
+
return createElement(`h${level}`, { className: "min-w-0 flex-1 truncate text-lg font-semibold tracking-tight" }, title);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The title, and under it the stamp of data the view re-loaded itself. The
|
|
65
|
+
* stamp is a second line of the title column, never an item beside the
|
|
66
|
+
* controls: the title keeps the row's width (it is the user's orientation),
|
|
67
|
+
* and the stamp truncates only against its own column. Its words carry its
|
|
68
|
+
* meaning, so it needs no tooltip that touch and keyboard users never reach.
|
|
69
|
+
* Without a stamp the title renders as before, straight in the row.
|
|
70
|
+
*/
|
|
71
|
+
function ToolbarHeading({ title, mode, level, renderTitle, stamp, }) {
|
|
72
|
+
const heading = _jsx(ToolbarTitle, { title: title, mode: mode, level: level, renderTitle: renderTitle });
|
|
73
|
+
if (!stamp)
|
|
74
|
+
return heading;
|
|
75
|
+
return (_jsxs("div", { "data-slot": "view-heading", className: "min-w-0 flex-1", children: [heading, _jsx("p", { "data-slot": "view-data-as-of", className: "text-muted-foreground truncate text-sm", children: stamp })] }));
|
|
76
|
+
}
|
|
77
|
+
/** Which toolbar controls render — pure, so the gates are unit-testable. */
|
|
78
|
+
export function toolbarControls(input) {
|
|
79
|
+
const refreshable = Boolean(input.viewData._refreshParams && input.viewData.layout);
|
|
80
|
+
const edit = input.builderAvailable && Boolean(input.viewData._refreshParams);
|
|
81
|
+
const title = input.titleMode === "slot" || (input.titleMode === "show" && Boolean(input.viewData.title));
|
|
82
|
+
return {
|
|
83
|
+
title,
|
|
84
|
+
refresh: refreshable,
|
|
85
|
+
edit,
|
|
86
|
+
fullscreen: input.canFullscreen,
|
|
87
|
+
any: title || refreshable || edit || input.canFullscreen,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The CI §8 chrome button (Icon-Button, Chrome): surface, `--cd-linie` border,
|
|
92
|
+
* shadow-1, blue on hover. The `outline` variant brings the surface, the
|
|
93
|
+
* border and the blue hover (it is also CI §8's secondary button, which has no
|
|
94
|
+
* shadow), so the chrome adds `shadow-1` on top instead of changing it.
|
|
95
|
+
*/
|
|
96
|
+
const CHROME_BUTTON = { variant: "outline", className: "shadow-1" };
|
|
97
|
+
function RefreshButton({ isRefreshing, labels, onRefresh, }) {
|
|
98
|
+
const label = isRefreshing ? labels.refreshing : labels.refresh;
|
|
99
|
+
return (_jsx(Button, { type: "button", ...CHROME_BUTTON, size: "icon-sm", "aria-label": label, title: label, disabled: isRefreshing, onClick: () => {
|
|
100
|
+
void onRefresh();
|
|
101
|
+
}, children: _jsx(RefreshCw, { "aria-hidden": "true", className: isRefreshing ? "motion-safe:animate-spin" : undefined }) }));
|
|
39
102
|
}
|
|
40
|
-
|
|
41
|
-
|
|
103
|
+
function FullscreenButton({ isFullscreen, labels, onToggle, }) {
|
|
104
|
+
const label = isFullscreen ? labels.exitFullscreen : labels.enterFullscreen;
|
|
105
|
+
const Icon = isFullscreen ? Minimize2 : Maximize2;
|
|
106
|
+
return (_jsx(Button, { type: "button", ...CHROME_BUTTON, size: "icon-sm", "aria-label": label, title: label, onClick: () => {
|
|
107
|
+
void onToggle();
|
|
108
|
+
}, children: _jsx(Icon, { "aria-hidden": "true" }) }));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The view toolbar: the title (per {@link ViewTitleMode}, so a widget that
|
|
112
|
+
* renders its own heading is not titled twice), then Edit, Refresh and
|
|
113
|
+
* Fullscreen. Refresh and Fullscreen are 32 px icon buttons named by
|
|
114
|
+
* `aria-label`; Fullscreen renders only when the host offers it. All three are
|
|
115
|
+
* chrome buttons in the CI pattern (CI §8: surface, border, shadow-1, blue
|
|
116
|
+
* hover; {@link CHROME_BUTTON}). A 16 px inset keeps the bar off the frame
|
|
117
|
+
* edge, also in fullscreen. The controls never shrink; the stamp of re-loaded
|
|
118
|
+
* data sits under the title ({@link ToolbarHeading}), so neither the title
|
|
119
|
+
* nor the stamp competes with the controls for width.
|
|
120
|
+
*/
|
|
121
|
+
export function ViewToolbar({ hidden, viewData, builderAvailable, isFullscreen, canFullscreen, isRefreshing, labels, titleMode, titleLevel, renderTitle, onRefresh, onEnterBuildMode, onToggleFullscreen, dataAsOf, }) {
|
|
122
|
+
const show = toolbarControls({ viewData, builderAvailable, canFullscreen, titleMode });
|
|
123
|
+
if (hidden || (!show.any && !dataAsOf))
|
|
42
124
|
return null;
|
|
43
|
-
return (_jsxs("div", {
|
|
44
|
-
void onRefresh();
|
|
45
|
-
}, disabled: isRefreshing, className: "hover:bg-accent hover:text-accent-foreground inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-sm font-medium transition-colors disabled:opacity-50", children: [_jsx(RefreshCw, { "aria-hidden": "true", className: `h-4 w-4 ${isRefreshing ? "animate-spin" : ""}` }), isRefreshing ? labels.refreshing : labels.refresh] })), builderAvailable && viewData._refreshParams && (_jsxs("button", { onClick: onEnterBuildMode, className: "hover:bg-accent hover:text-accent-foreground inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-sm font-medium transition-colors", children: [_jsx(Pencil, { className: "h-4 w-4" }), labels.build] })), _jsxs("button", { onClick: () => {
|
|
46
|
-
void onToggleFullscreen();
|
|
47
|
-
}, className: "hover:bg-accent hover:text-accent-foreground inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-sm font-medium transition-colors", children: [isFullscreen ? (_jsx(Minimize2, { "aria-hidden": "true", className: "h-4 w-4" })) : (_jsx(Maximize2, { "aria-hidden": "true", className: "h-4 w-4" })), isFullscreen ? labels.exitFullscreen : labels.enterFullscreen] })] })] }));
|
|
125
|
+
return (_jsx(LucideProvider, { strokeWidth: DENSE_ICON_STROKE, children: _jsxs("div", { "data-slot": "view-toolbar", className: "flex min-h-12 items-center gap-2 px-4 py-2", children: [_jsx(ToolbarHeading, { title: viewData.title, mode: titleMode, level: titleLevel, renderTitle: renderTitle, stamp: dataAsOf ? labels.dataAsOf(dataAsOf) : undefined }), _jsxs("div", { className: "ml-auto flex shrink-0 items-center gap-1", children: [show.edit && (_jsxs(Button, { type: "button", ...CHROME_BUTTON, size: "sm", "data-slot": "view-edit", onClick: onEnterBuildMode, children: [_jsx(Pencil, { "aria-hidden": "true" }), labels.build] })), show.refresh && (_jsx(RefreshButton, { isRefreshing: isRefreshing, labels: labels, onRefresh: onRefresh })), show.fullscreen && (_jsx(FullscreenButton, { isFullscreen: isFullscreen, labels: labels, onToggle: onToggleFullscreen }))] })] }) }));
|
|
48
126
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
127
|
+
/**
|
|
128
|
+
* The failed data steps as ONE inline alert: what happened (the title), which
|
|
129
|
+
* data is affected (each step by its human title, else its step id), what you
|
|
130
|
+
* can do (retry, or ask in the chat when the view cannot refresh). The raw
|
|
131
|
+
* step reasons stay under "Details", out of the user copy.
|
|
132
|
+
*/
|
|
133
|
+
export function StepErrors({ hidden, errors, steps, labels, describeStep, onRetry, }) {
|
|
53
134
|
if (hidden || errors.length === 0)
|
|
54
135
|
return null;
|
|
55
|
-
|
|
136
|
+
const failed = errors.map((err) => {
|
|
137
|
+
const ref = { id: err.stepId, step: steps?.find((s) => s.id === err.stepId)?.step };
|
|
138
|
+
return { ref, human: describeStep?.(ref), reason: err.reason };
|
|
139
|
+
});
|
|
140
|
+
return (_jsx("div", { className: "px-4 pb-4", children: _jsx(ErrorState, { variant: "inline", title: labels.stepErrorsTitle, retryLabel: labels.retry, onRetry: onRetry, detailsLabel: labels.errorDetails, details: failed.map(({ ref, reason }) => `${ref.step ?? ref.id}: ${reason}`).join("\n"), description: _jsxs(_Fragment, { children: [_jsx("ul", { className: "flex flex-col gap-1", children: failed.map(({ ref, human }) => (_jsx("li", { className: "break-words", children: human ? (_jsx("span", { className: "font-medium", children: human })) : (_jsx("span", { className: "text-small font-mono", children: ref.step ?? ref.id })) }, ref.id))) }), _jsx("p", { className: "mt-1", children: onRetry ? labels.stepErrorsHint : labels.errorHintNoRetry })] }) }) }));
|
|
56
141
|
}
|
|
57
|
-
export function ViewBody({ buildMode, viewData, widgets, callTool, onExit }) {
|
|
142
|
+
export function ViewBody({ buildMode, viewData, widgets, callTool, onExit, builderLabels, }) {
|
|
58
143
|
if (buildMode) {
|
|
59
|
-
return (_jsx(LayoutBuilder, { initialLayout: viewData.layout, title: viewData.title, initialKeys: viewData._refreshParams?.keys, initialSteps: viewData._refreshParams?.steps, widgets: widgets, callTool: callTool, onExit: onExit }));
|
|
144
|
+
return (_jsx(LayoutBuilder, { initialLayout: viewData.layout, title: viewData.title, initialKeys: viewData._refreshParams?.keys, initialSteps: viewData._refreshParams?.steps, widgets: widgets, callTool: callTool, labels: builderLabels, onExit: onExit }));
|
|
60
145
|
}
|
|
61
146
|
if (!viewData.layout)
|
|
62
147
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-app-view-chrome.js","sourceRoot":"","sources":["../../src/app/mcp-app-view-chrome.tsx"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"mcp-app-view-chrome.js","sourceRoot":"","sources":["../../src/app/mcp-app-view-chrome.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,aAAa,EAAkB,MAAM,OAAO,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEtF,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE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AAC,OAAO,CAAC,MAAM,EAC/B,OAAO,EAAE,OAAO,GAChB,CACH,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { McpAppViewLabels } from "./mcp-app-view-chrome.js";
|
|
2
|
+
import type { ViewErrorKind, ViewLifecycle } from "./view-lifecycle.js";
|
|
3
|
+
export type { ViewErrorKind } from "./view-lifecycle.js";
|
|
4
|
+
/**
|
|
5
|
+
* Human text for a raw error reason (e.g. map "503" to "the engine is down").
|
|
6
|
+
* `info.kind` tells a failure (`"failed"`) from a result the chat did not pass
|
|
7
|
+
* to the view (`"blocked"`, no reason); return `undefined` to keep the
|
|
8
|
+
* toolkit's words for that state.
|
|
9
|
+
*/
|
|
10
|
+
export type DescribeViewError = (reason: string | undefined, info?: {
|
|
11
|
+
kind: ViewErrorKind;
|
|
12
|
+
}) => {
|
|
13
|
+
title?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
} | undefined;
|
|
16
|
+
export declare function ViewPlaceholder({ lifecycle, labels, onRetry, describeError, }: {
|
|
17
|
+
/** The current phase; `result` renders nothing (the view takes over). */
|
|
18
|
+
lifecycle: ViewLifecycle;
|
|
19
|
+
labels: Required<McpAppViewLabels>;
|
|
20
|
+
onRetry: () => void;
|
|
21
|
+
describeError?: DescribeViewError;
|
|
22
|
+
}): import("react").JSX.Element | null;
|
|
23
|
+
//# sourceMappingURL=mcp-app-view-states.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-app-view-states.d.ts","sourceRoot":"","sources":["../../src/app/mcp-app-view-states.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEvE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAC9B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,IAAI,CAAC,EAAE;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,KAC3B;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAA;AAEzD,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,MAAM,EACN,OAAO,EACP,aAAa,GACd,EAAE;IACD,yEAAyE;IACzE,SAAS,EAAE,aAAa,CAAA;IACxB,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAA;IAClC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,aAAa,CAAC,EAAE,iBAAiB,CAAA;CAClC,sCA0BA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The pre-payload states of `McpAppView`, one per lifecycle phase
|
|
4
|
+
* (`view-lifecycle.ts`): waiting (skeleton + status line + slow hint),
|
|
5
|
+
* cancelled, and error (icon, title, what to do, raw reason under "Details",
|
|
6
|
+
* retry when the originating tool is known). A `blocked` error is a notice in
|
|
7
|
+
* the info tone, not a failure: the tool ran, but the chat did not pass its
|
|
8
|
+
* result to the view. Hook-free and SSR-renderable, so each phase is pinned
|
|
9
|
+
* by a test.
|
|
10
|
+
*/
|
|
11
|
+
import { ErrorState } from "../components/ErrorState.js";
|
|
12
|
+
import { Skeleton } from "../primitives/skeleton.js";
|
|
13
|
+
export function ViewPlaceholder({ lifecycle, labels, onRetry, describeError, }) {
|
|
14
|
+
switch (lifecycle.phase) {
|
|
15
|
+
case "result":
|
|
16
|
+
return null;
|
|
17
|
+
case "cancelled":
|
|
18
|
+
return (_jsx("div", { className: "px-4 py-4", children: _jsx("p", { role: "status", className: "text-muted-foreground text-sm", children: labels.cancelled }) }));
|
|
19
|
+
case "error":
|
|
20
|
+
return (_jsx(ViewErrorState, { kind: lifecycle.kind, reason: lifecycle.reason, canRetry: lifecycle.canRetry, labels: labels, onRetry: onRetry, describeError: describeError }));
|
|
21
|
+
case "waiting":
|
|
22
|
+
return _jsx(ViewWaiting, { slow: lifecycle.slow, labels: labels });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function ViewWaiting({ slow, labels }) {
|
|
26
|
+
// No aria-busy on an ancestor of the live region: assistive technology may
|
|
27
|
+
// hold back changes inside a busy subtree, and the slow hint is one.
|
|
28
|
+
return (_jsxs("div", { className: "flex flex-col gap-4 px-4 py-4", children: [_jsx(Skeleton, { "aria-hidden": "true", className: "h-8 w-48" }), _jsx(Skeleton, { "aria-hidden": "true", className: "h-32 w-full" }), _jsxs("div", { role: "status", className: "text-muted-foreground flex flex-col gap-1 text-sm", children: [_jsx("p", { children: labels.loading }), slow && _jsx("p", { "data-slot": "slow-hint", children: labels.slowHint })] })] }));
|
|
29
|
+
}
|
|
30
|
+
/** The words and tone of an error phase; the hint never promises a retry the state does not offer. */
|
|
31
|
+
function errorStateCopy(kind, canRetry, labels) {
|
|
32
|
+
if (kind === "blocked") {
|
|
33
|
+
// Nothing failed: a quiet notice that says what happened and what to do.
|
|
34
|
+
return {
|
|
35
|
+
tone: "info",
|
|
36
|
+
role: "status",
|
|
37
|
+
title: labels.blockedTitle,
|
|
38
|
+
hint: canRetry ? labels.blockedHint : labels.blockedHintNoRetry,
|
|
39
|
+
retry: labels.blockedRetry,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
tone: "danger",
|
|
44
|
+
role: "alert",
|
|
45
|
+
title: labels.errorTitle,
|
|
46
|
+
hint: canRetry ? labels.errorHint : labels.errorHintNoRetry,
|
|
47
|
+
retry: labels.retry,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function ViewErrorState({ kind = "failed", reason, canRetry, labels, onRetry, describeError, }) {
|
|
51
|
+
const human = describeError?.(reason, { kind });
|
|
52
|
+
const copy = errorStateCopy(kind, canRetry, labels);
|
|
53
|
+
return (_jsx("div", { className: "px-4 py-4", children: _jsx(ErrorState, { tone: copy.tone, role: copy.role, title: human?.title ?? copy.title, description: human?.description ?? copy.hint, details: reason, detailsLabel: labels.errorDetails, retryLabel: copy.retry, onRetry: canRetry ? onRetry : undefined }) }));
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=mcp-app-view-states.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-app-view-states.js","sourceRoot":"","sources":["../../src/app/mcp-app-view-states.tsx"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAuB,MAAM,6BAA6B,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAiBpD,MAAM,UAAU,eAAe,CAAC,EAC9B,SAAS,EACT,MAAM,EACN,OAAO,EACP,aAAa,GAOd;IACC,QAAQ,SAAS,CAAC,KAAK,EAAE,CAAC;QACxB,KAAK,QAAQ;YACX,OAAO,IAAI,CAAA;QACb,KAAK,WAAW;YACd,OAAO,CACL,cAAK,SAAS,EAAC,WAAW,YACxB,YAAG,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,+BAA+B,YACvD,MAAM,CAAC,SAAS,GACf,GACA,CACP,CAAA;QACH,KAAK,OAAO;YACV,OAAO,CACL,KAAC,cAAc,IACb,IAAI,EAAE,SAAS,CAAC,IAAI,EACpB,MAAM,EAAE,SAAS,CAAC,MAAM,EACxB,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAC5B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,GAC5B,CACH,CAAA;QACH,KAAK,SAAS;YACZ,OAAO,KAAC,WAAW,IAAC,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAI,CAAA;IAChE,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC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AAI,EAAE,CAAC,CAAA;IAC/C,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;IACnD,OAAO,CACL,cAAK,SAAS,EAAC,WAAW,YACxB,KAAC,UAAU,IACT,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,IAAI,CAAC,KAAK,EACjC,WAAW,EAAE,KAAK,EAAE,WAAW,IAAI,IAAI,CAAC,IAAI,EAC5C,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,UAAU,EAAE,IAAI,CAAC,KAAK,EACtB,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,GACvC,GACE,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type RecoveryPolicy } from "../hooks/use-tool-result-recovery.js";
|
|
3
|
+
import { type DescribeStep, type McpAppViewLabels, type ViewTitleLevel, type ViewTitleMode } from "./mcp-app-view-chrome.js";
|
|
4
|
+
import { type DescribeViewError } from "./mcp-app-view-states.js";
|
|
5
|
+
import type { LayoutBuilderLabels } from "./layout-builder.js";
|
|
2
6
|
import type { WidgetComponent } from "./widget-renderer.js";
|
|
3
|
-
export type { McpAppViewLabels } from "./mcp-app-view-chrome.js";
|
|
7
|
+
export type { McpAppViewLabels, ViewTitleLevel, ViewTitleMode } from "./mcp-app-view-chrome.js";
|
|
8
|
+
export type { DescribeStep } from "./mcp-app-view-chrome.js";
|
|
9
|
+
export type { DescribeViewError, ViewErrorKind } from "./mcp-app-view-states.js";
|
|
10
|
+
export type { RecoveryPolicy } from "../hooks/use-tool-result-recovery.js";
|
|
4
11
|
export interface McpAppViewProps {
|
|
5
12
|
/**
|
|
6
13
|
* Map of widget ID to React component. The consumer aggregates this from
|
|
@@ -28,10 +35,70 @@ export interface McpAppViewProps {
|
|
|
28
35
|
*/
|
|
29
36
|
builderEnabled?: boolean;
|
|
30
37
|
/**
|
|
31
|
-
* Override
|
|
32
|
-
* Defaults to
|
|
38
|
+
* Override chrome strings (loading, error, refresh, fullscreen, edit, …).
|
|
39
|
+
* Defaults to the active locale's toolkit catalog: the nearest
|
|
40
|
+
* `LocaleProvider`, else the host's locale (`en`/`de`, English otherwise).
|
|
33
41
|
*/
|
|
34
42
|
labels?: McpAppViewLabels;
|
|
43
|
+
/** Override strings of the embedded view builder (defaults: the locale's catalog). */
|
|
44
|
+
builderLabels?: LayoutBuilderLabels;
|
|
45
|
+
/**
|
|
46
|
+
* How the toolbar shows the view title, so a view carries ONE title:
|
|
47
|
+
* `"show"` (default) renders it as a heading, `"hide"` leaves the title to
|
|
48
|
+
* the widget's own header, `"slot"` renders {@link McpAppViewProps.renderTitle}.
|
|
49
|
+
*/
|
|
50
|
+
titleMode?: ViewTitleMode;
|
|
51
|
+
/** Heading level of the toolbar title in `"show"` mode. Default `2`. */
|
|
52
|
+
titleLevel?: ViewTitleLevel;
|
|
53
|
+
/** Renders the toolbar title in `"slot"` mode; receives the view's title. */
|
|
54
|
+
renderTitle?: (title: string | undefined) => ReactNode;
|
|
55
|
+
/** Delay before the loading placeholder adds its "taking longer" hint. Default 8000 ms. */
|
|
56
|
+
slowHintAfterMs?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Map a raw rendering error (the tool's `isError` text) onto human text.
|
|
59
|
+
* The raw reason always stays available under "Details".
|
|
60
|
+
*/
|
|
61
|
+
describeError?: DescribeViewError;
|
|
62
|
+
/** Human title of a pipeline step in the failed-steps alert (default: the step id). */
|
|
63
|
+
describeStep?: DescribeStep;
|
|
64
|
+
/**
|
|
65
|
+
* Which originating tools the view may re-execute on its own when the host
|
|
66
|
+
* strips the result's `structuredContent` (claude.ai, Claude Desktop).
|
|
67
|
+
* `"auto"` (default): any tool the host does not report as writing
|
|
68
|
+
* (`readOnlyHint: false` or `destructiveHint: true`); `"read-only"`: only
|
|
69
|
+
* tools reported with `readOnlyHint: true`; `"never"`: none. A recovery
|
|
70
|
+
* the policy forbids shows a note that the chat did not pass the result to
|
|
71
|
+
* the view. It offers to load the view only for a tool the host does not
|
|
72
|
+
* report as writing; for a writing tool it asks for the current state in
|
|
73
|
+
* the chat, so one click never runs the write a second time.
|
|
74
|
+
*/
|
|
75
|
+
recoverStrippedResult?: RecoveryPolicy;
|
|
76
|
+
/**
|
|
77
|
+
* Grace period (ms) after which a silent call counts as a stripped result.
|
|
78
|
+
* Only used where the view could not watch the host's notifications from
|
|
79
|
+
* the start (e.g. a custom shell mounted under its own `bootstrapView`
|
|
80
|
+
* without `installToolResultObserver`); a view mounted by
|
|
81
|
+
* `mountMcpToolkitApp` sees the stripped result itself and never guesses,
|
|
82
|
+
* so a slow tool is never re-run. Default 2500 ms.
|
|
83
|
+
*/
|
|
84
|
+
strippedResultGraceMs?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Put the tool name into the cache keys of the data hooks inside the view
|
|
87
|
+
* (`[...queryKey, toolName, args]`, see `toolQueryKey`), so two tools never
|
|
88
|
+
* share an entry. Omitted: an enclosing `AppQueryProvider`'s setting, else
|
|
89
|
+
* the 2.x key `[...queryKey, args]`. The next major makes it the default.
|
|
90
|
+
*/
|
|
91
|
+
toolNameInQueryKey?: boolean;
|
|
35
92
|
}
|
|
36
|
-
|
|
93
|
+
/**
|
|
94
|
+
* The toolkit's MCP App view: lifecycle placeholder (waiting / error /
|
|
95
|
+
* cancelled), toolbar, failed-steps alert and the rendered layout (or the
|
|
96
|
+
* builder). Mounts a `ToastProvider` and binds the toolkit's own strings to
|
|
97
|
+
* the host's locale unless a `LocaleProvider` sets one, so the chrome follows
|
|
98
|
+
* the host language; `useLocale()` in consumer widgets is unaffected. Lucide
|
|
99
|
+
* icons draw at the CI stroke (2.5) throughout, the toast stack included.
|
|
100
|
+
* The widgets' data hooks fetch through an enclosing `AppQueryProvider`'s
|
|
101
|
+
* client, else the toolkit's shared `queryClient`.
|
|
102
|
+
*/
|
|
103
|
+
export declare function McpAppView(props: McpAppViewProps): import("react").JSX.Element;
|
|
37
104
|
//# sourceMappingURL=mcp-app-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-app-view.d.ts","sourceRoot":"","sources":["../../src/app/mcp-app-view.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-app-view.d.ts","sourceRoot":"","sources":["../../src/app/mcp-app-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAYjF,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,sCAAsC,CAAA;AAK7C,OAAO,EAOL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAErB,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAW9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC/F,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAChF,YAAY,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AAE1E,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IACxC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,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