@miragon/mcp-toolkit-ui 2.7.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 +7 -4
- 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.js +1 -1
- 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 +21 -7
- 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 +11 -4
- 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/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 +2 -1
- package/dist/app/builder/PipelineStrip.d.ts.map +1 -1
- package/dist/app/builder/PipelineStrip.js +26 -13
- 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 +8 -2
- package/dist/app/builder/SaveDialog.js.map +1 -1
- package/dist/app/builder/Toolbar.d.ts +12 -4
- package/dist/app/builder/Toolbar.d.ts.map +1 -1
- package/dist/app/builder/Toolbar.js +18 -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 +143 -1
- package/dist/app/builder/builder-model.d.ts.map +1 -1
- package/dist/app/builder/builder-model.js +191 -1
- package/dist/app/builder/builder-model.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/use-builder-catalogue.d.ts +4 -1
- package/dist/app/builder/use-builder-catalogue.d.ts.map +1 -1
- package/dist/app/builder/use-builder-catalogue.js +44 -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/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 +13 -25
- package/dist/app/layout-builder.d.ts.map +1 -1
- package/dist/app/layout-builder.js +75 -81
- package/dist/app/layout-builder.js.map +1 -1
- package/dist/app/mcp-app-view-chrome.d.ts +12 -3
- package/dist/app/mcp-app-view-chrome.d.ts.map +1 -1
- package/dist/app/mcp-app-view-chrome.js +21 -5
- package/dist/app/mcp-app-view-chrome.js.map +1 -1
- package/dist/app/mcp-app-view-states.d.ts +11 -3
- package/dist/app/mcp-app-view-states.d.ts.map +1 -1
- package/dist/app/mcp-app-view-states.js +29 -8
- package/dist/app/mcp-app-view-states.js.map +1 -1
- package/dist/app/mcp-app-view.d.ts +33 -1
- package/dist/app/mcp-app-view.d.ts.map +1 -1
- package/dist/app/mcp-app-view.js +181 -127
- package/dist/app/mcp-app-view.js.map +1 -1
- package/dist/app/mcp-toolkit-app.d.ts +6 -1
- package/dist/app/mcp-toolkit-app.d.ts.map +1 -1
- package/dist/app/mcp-toolkit-app.js +8 -1
- 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 +4 -0
- package/dist/app/use-view-lifecycle.d.ts.map +1 -1
- package/dist/app/use-view-lifecycle.js +2 -0
- package/dist/app/use-view-lifecycle.js.map +1 -1
- package/dist/app/view-lifecycle.d.ts +80 -4
- package/dist/app/view-lifecycle.d.ts.map +1 -1
- package/dist/app/view-lifecycle.js +90 -3
- package/dist/app/view-lifecycle.js.map +1 -1
- 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 +3 -1
- package/dist/app/widget-props-sheet.d.ts.map +1 -1
- package/dist/app/widget-props-sheet.js +22 -10
- package/dist/app/widget-props-sheet.js.map +1 -1
- package/dist/app/widget-renderer.js +1 -1
- 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 +8 -6
- package/dist/components/DrillButton.js.map +1 -1
- package/dist/components/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState.js +4 -2
- package/dist/components/EmptyState.js.map +1 -1
- package/dist/components/ErrorState.d.ts +5 -2
- package/dist/components/ErrorState.d.ts.map +1 -1
- package/dist/components/ErrorState.js +25 -8
- package/dist/components/ErrorState.js.map +1 -1
- package/dist/components/FilterBar.d.ts +15 -4
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +11 -6
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/KpiGrid.d.ts +66 -21
- package/dist/components/KpiGrid.d.ts.map +1 -1
- package/dist/components/KpiGrid.js +101 -34
- package/dist/components/KpiGrid.js.map +1 -1
- package/dist/components/ListFooter.d.ts +31 -4
- package/dist/components/ListFooter.d.ts.map +1 -1
- package/dist/components/ListFooter.js +30 -11
- 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 +27 -7
- package/dist/components/Pills.d.ts.map +1 -1
- package/dist/components/Pills.js +21 -6
- 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 +9 -3
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +31 -16
- package/dist/components/Toast.js.map +1 -1
- 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 +47 -52
- package/dist/hooks/use-tool-result-recovery.d.ts.map +1 -1
- package/dist/hooks/use-tool-result-recovery.js +58 -120
- package/dist/hooks/use-tool-result-recovery.js.map +1 -1
- package/dist/hooks/use-view-data.d.ts +52 -10
- package/dist/hooks/use-view-data.d.ts.map +1 -1
- package/dist/hooks/use-view-data.js +81 -16
- 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 +17 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -6
- 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/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 +41 -1
- package/dist/lib/toast-model.d.ts.map +1 -1
- package/dist/lib/toast-model.js +67 -1
- package/dist/lib/toast-model.js.map +1 -1
- package/dist/lib/tone-utils.d.ts +58 -6
- package/dist/lib/tone-utils.d.ts.map +1 -1
- package/dist/lib/tone-utils.js +66 -4
- 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 +1 -1
- package/dist/locale/index.d.ts.map +1 -1
- package/dist/locale/message-types.d.ts +117 -4
- package/dist/locale/message-types.d.ts.map +1 -1
- package/dist/locale/messages-de.d.ts.map +1 -1
- package/dist/locale/messages-de.js +44 -10
- package/dist/locale/messages-de.js.map +1 -1
- package/dist/locale/messages-en.d.ts.map +1 -1
- package/dist/locale/messages-en.js +44 -10
- package/dist/locale/messages-en.js.map +1 -1
- package/dist/locale/toolkit-messages.d.ts +19 -1
- package/dist/locale/toolkit-messages.d.ts.map +1 -1
- package/dist/locale/toolkit-messages.js +54 -1
- package/dist/locale/toolkit-messages.js.map +1 -1
- package/dist/primitives/alert.d.ts +1 -1
- package/dist/primitives/alert.d.ts.map +1 -1
- package/dist/primitives/alert.js +2 -0
- 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 +9 -4
- package/dist/primitives/badge.js.map +1 -1
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/button.js.map +1 -1
- package/dist/primitives/dialog.d.ts +1 -1
- package/dist/primitives/dialog.d.ts.map +1 -1
- package/dist/primitives/dialog.js +10 -3
- package/dist/primitives/dialog.js.map +1 -1
- package/dist/primitives/select.js +1 -1
- package/dist/primitives/select.js.map +1 -1
- package/dist/primitives/sheet.d.ts +1 -1
- package/dist/primitives/sheet.d.ts.map +1 -1
- package/dist/primitives/sheet.js +6 -2
- package/dist/primitives/sheet.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 +30 -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/theme/create-theme.d.ts +19 -1
- package/dist/theme/create-theme.d.ts.map +1 -1
- package/dist/theme/create-theme.js +15 -0
- package/dist/theme/create-theme.js.map +1 -1
- package/package.json +5 -4
- package/src/app/adapt-data-widget.tsx +2 -42
- package/src/app/builder/BuilderBanners.tsx +1 -1
- package/src/app/builder/CanvasRow.tsx +63 -17
- package/src/app/builder/CatalogueSheet.tsx +50 -29
- package/src/app/builder/CellPropsSheet.tsx +17 -2
- package/src/app/builder/DiscardDialog.tsx +59 -0
- package/src/app/builder/LayoutSurface.tsx +206 -66
- package/src/app/builder/PipelineStrip.tsx +253 -153
- package/src/app/builder/SaveDialog.tsx +14 -2
- package/src/app/builder/Toolbar.tsx +144 -59
- package/src/app/builder/Workspace.tsx +226 -58
- package/src/app/builder/builder-model.ts +341 -2
- 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/reveal.ts +10 -0
- package/src/app/builder/use-builder-catalogue.ts +56 -19
- package/src/app/builder/use-builder-session.ts +68 -0
- package/src/app/builder/use-display-resolver.ts +24 -0
- package/src/app/index.ts +12 -2
- package/src/app/layout-builder.tsx +178 -191
- package/src/app/mcp-app-view-chrome.test.tsx +141 -1
- package/src/app/mcp-app-view-chrome.tsx +56 -6
- package/src/app/mcp-app-view-states.tsx +51 -11
- package/src/app/mcp-app-view.effects.test.tsx +292 -0
- package/src/app/mcp-app-view.test.tsx +222 -2
- package/src/app/mcp-app-view.tsx +267 -117
- package/src/app/mcp-toolkit-app.test.tsx +40 -0
- package/src/app/mcp-toolkit-app.tsx +8 -1
- 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 +6 -0
- package/src/app/view-lifecycle.test.ts +216 -0
- package/src/app/view-lifecycle.ts +165 -5
- 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 +57 -16
- package/src/app/widget-renderer.tsx +1 -1
- package/src/components/DrillButton.tsx +23 -10
- package/src/components/EmptyState.tsx +6 -4
- package/src/components/ErrorState.tsx +31 -9
- package/src/components/FilterBar.test.tsx +82 -0
- package/src/components/FilterBar.tsx +52 -26
- package/src/components/KpiGrid.test.tsx +279 -0
- package/src/components/KpiGrid.tsx +297 -90
- package/src/components/ListFooter.test.tsx +116 -0
- package/src/components/ListFooter.tsx +102 -15
- 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 +63 -10
- package/src/components/SectionHeading.tsx +9 -3
- package/src/components/Toast.tsx +37 -19
- package/src/components/WidgetHeader.test.tsx +78 -0
- package/src/components/WidgetHeader.tsx +63 -16
- package/src/components/feedback-states.test.tsx +98 -9
- package/src/components/tone-figures.test.tsx +8 -4
- 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 +3 -4
- package/src/hooks/use-tool-result-recovery.ts +84 -142
- package/src/hooks/use-view-data.test.tsx +118 -9
- package/src/hooks/use-view-data.ts +128 -18
- package/src/hooks/use-view-tool-query.ts +25 -19
- package/src/i18n-coverage.test.tsx +104 -2
- package/src/index.ts +48 -11
- package/src/lib/focus-return.test.ts +288 -0
- package/src/lib/focus-return.ts +96 -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 +166 -1
- package/src/lib/toast-model.ts +104 -2
- package/src/lib/tone-utils.test.ts +86 -10
- package/src/lib/tone-utils.ts +89 -8
- 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 +1 -0
- package/src/locale/message-types.ts +118 -2
- package/src/locale/messages-de.ts +49 -10
- package/src/locale/messages-en.ts +49 -10
- package/src/locale/toolkit-messages.test.ts +133 -0
- package/src/locale/toolkit-messages.ts +63 -2
- package/src/primitives/alert.tsx +3 -0
- package/src/primitives/badge.tsx +9 -4
- package/src/primitives/button.tsx +1 -1
- package/src/primitives/dialog.tsx +10 -1
- package/src/primitives/select.tsx +1 -1
- package/src/primitives/sheet.tsx +7 -0
- 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 +38 -6
- package/src/render-effects.tsx +96 -0
- package/src/theme/cd-tokens.test.ts +3 -1
- package/src/theme/create-theme.test.ts +10 -0
- package/src/theme/create-theme.ts +28 -0
- package/src/theme/theme-css.test.ts +51 -0
- package/src/theme.css +31 -1
- package/ui-catalog.json +448 -41
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-model.js","sourceRoot":"","sources":["../../src/lib/toast-model.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"toast-model.js","sourceRoot":"","sources":["../../src/lib/toast-model.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAK7C;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAa;IAC5C,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACtC,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAA;AAC3C,CAAC;AA0BD,wDAAwD;AACxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,sFAAsF;AACtF,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAA;AAC3C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAEnC,uFAAuF;AACvF,MAAM,UAAU,aAAa,CAAC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GAAG,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;QACpC,OAAO,GAAG,KAAK,CAAA;QACf,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;IAC5B,CAAC,CAAA;IAED,KAAK,EAAE,CAAA;IACP,OAAO;QACL,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE;YACf,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YACjB,KAAK,EAAE,CAAA;QACT,CAAC;QACD,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE;YAClB,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;YACpB,KAAK,EAAE,CAAA;QACT,CAAC;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,OAAO,EAAE,EAAE,CAAC,CAAC;QAC9C,MAAM,EAAE,GAAG,EAAE;YACX,KAAK,EAAE,CAAA;YACP,QAAQ,GAAG,IAAI,CAAA;QACjB,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/lib/tone-utils.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Single source of truth for the semantic "tones" used across the tone-aware
|
|
3
|
-
* components (`Pills`, `
|
|
3
|
+
* components (`Pills`, `StatusBadge`, `KpiGrid`, `Badge`, …).
|
|
4
|
+
*
|
|
5
|
+
* ONE vocabulary: `success | warning | danger | info | neutral`
|
|
6
|
+
* ({@link TONE_VARIANTS}). Retired or foreign names (`critical`, `error`,
|
|
7
|
+
* `destructive`, …) map onto it through {@link resolveTone}, so a tone that
|
|
8
|
+
* arrives as data (a server-built KPI cell) never renders without a colour.
|
|
4
9
|
*
|
|
5
10
|
* Every status tone has THREE roles (Miragon CI §3.3), each its own token in
|
|
6
11
|
* `theme.css` with light and dark values:
|
|
@@ -8,14 +13,14 @@
|
|
|
8
13
|
* | Role | Token | Map |
|
|
9
14
|
* | ---------------------------- | --------------- | -------------- |
|
|
10
15
|
* | fill, dot, border, icon | `--<tone>` | `TONE_DOT`, `TONE_BORDER`, `TONE_ICON` |
|
|
11
|
-
* | tint (badge/banner surface) | `--<tone>-soft` | `TONE_SOFT` (text on it: the foreground) |
|
|
12
|
-
* | text on a plain surface | `--<tone>-ink` | `
|
|
16
|
+
* | tint (badge/banner surface) | `--<tone>-soft` | `TONE_SOFT`, `TONE_TINT` (text on it: the foreground) |
|
|
17
|
+
* | text on a plain surface | `--<tone>-ink` | `TONE_INK` |
|
|
13
18
|
*
|
|
14
19
|
* Status is never text in its own colour: success and warning reach only
|
|
15
20
|
* 1.67:1 / 1.83:1 on white, so their ink is the foreground and the tone shows
|
|
16
21
|
* as a dot, icon or border NEXT to the text. On a tint the text is always the
|
|
17
22
|
* foreground (CI §3.3: "-soft: Text darauf --cd-schwarz, Rand in der
|
|
18
|
-
* Statusfarbe"), so pair `TONE_SOFT` with `TONE_BORDER`. `
|
|
23
|
+
* Statusfarbe"), so pair `TONE_SOFT` with `TONE_BORDER`. `TONE_INK` is for
|
|
19
24
|
* a tone's words on a plain surface (a field error); figures — counts, KPI
|
|
20
25
|
* values, trends — never take it: they stay in the foreground next to a
|
|
21
26
|
* `TONE_DOT`. In dark mode the colours are the `-hell` values and the tints
|
|
@@ -26,13 +31,55 @@
|
|
|
26
31
|
* `tone === "x" ? "…" : "…"` ternaries at every call site.
|
|
27
32
|
*/
|
|
28
33
|
export type ToneVariant = "neutral" | "info" | "success" | "warning" | "danger";
|
|
34
|
+
/** Every tone, in severity order (for loops, pickers and validation). */
|
|
35
|
+
export declare const TONE_VARIANTS: readonly ToneVariant[];
|
|
36
|
+
/**
|
|
37
|
+
* Retired or foreign tone names and the tone each one means. One red and one
|
|
38
|
+
* amber (CI §3.3): `critical`, `error` and `destructive` are `danger`; there
|
|
39
|
+
* is no separate severity above it. The names on the left are deprecated:
|
|
40
|
+
* write the {@link ToneVariant} on the right. The map stays so data written
|
|
41
|
+
* against an older vocabulary (a widget-shell `critical`, a shadcn
|
|
42
|
+
* `destructive`) keeps its colour.
|
|
43
|
+
*/
|
|
44
|
+
export declare const TONE_ALIASES: {
|
|
45
|
+
readonly critical: "danger";
|
|
46
|
+
readonly error: "danger";
|
|
47
|
+
readonly destructive: "danger";
|
|
48
|
+
readonly failure: "danger";
|
|
49
|
+
readonly warn: "warning";
|
|
50
|
+
readonly ok: "success";
|
|
51
|
+
readonly positive: "success";
|
|
52
|
+
readonly notice: "info";
|
|
53
|
+
readonly default: "neutral";
|
|
54
|
+
readonly muted: "neutral";
|
|
55
|
+
readonly secondary: "neutral";
|
|
56
|
+
};
|
|
57
|
+
/** A name {@link resolveTone} maps onto a tone (see {@link TONE_ALIASES}). */
|
|
58
|
+
export type ToneAlias = keyof typeof TONE_ALIASES;
|
|
59
|
+
/**
|
|
60
|
+
* What a tone-aware component accepts: a {@link ToneVariant}, or a retired
|
|
61
|
+
* name that {@link resolveTone} maps onto one.
|
|
62
|
+
*/
|
|
63
|
+
export type ToneName = ToneVariant | ToneAlias;
|
|
64
|
+
/** Whether `value` is one of the five tones (a type guard for data from the wire). */
|
|
65
|
+
export declare function isToneVariant(value: unknown): value is ToneVariant;
|
|
66
|
+
/**
|
|
67
|
+
* Map any tone name onto the vocabulary: a {@link ToneVariant} as is, a
|
|
68
|
+
* retired name ({@link TONE_ALIASES}, case-insensitive) onto its tone, and
|
|
69
|
+
* anything else — unknown, empty, not a string — onto `fallback` (default
|
|
70
|
+
* `"neutral"`, the tone without a state).
|
|
71
|
+
*/
|
|
72
|
+
export declare function resolveTone(name: unknown, fallback?: ToneVariant): ToneVariant;
|
|
29
73
|
/**
|
|
30
74
|
* Tinted surface + its text (the foreground: CI §3.3) — badges, pills,
|
|
31
75
|
* banners. Pair it with {@link TONE_BORDER}: the rim carries the tone, and in
|
|
32
|
-
* dark mode (no tints) it is all that does.
|
|
76
|
+
* dark mode (no tints) it is all that does. The neutral tint is the muted
|
|
77
|
+
* surface, its text the foreground too (a count on it is a figure).
|
|
33
78
|
*/
|
|
34
79
|
export declare const TONE_SOFT: Record<ToneVariant, string>;
|
|
35
|
-
/**
|
|
80
|
+
/** The tint alone, for a surface that sets its text itself (a soft KPI card). */
|
|
81
|
+
export declare const TONE_TINT: Record<ToneVariant, string>;
|
|
82
|
+
/** Solid dot colour — a status dot next to a label, a bar, a meter fill. */
|
|
36
83
|
export declare const TONE_DOT: Record<ToneVariant, string>;
|
|
37
84
|
/**
|
|
38
85
|
* The tone's TEXT colour (its `-ink` role) for words on a plain surface — a
|
|
@@ -41,6 +88,11 @@ export declare const TONE_DOT: Record<ToneVariant, string>;
|
|
|
41
88
|
* {@link TONE_ICON} to show the tone. Never on a tint (use {@link TONE_SOFT})
|
|
42
89
|
* and never for figures (they stay in the foreground next to a dot).
|
|
43
90
|
*/
|
|
91
|
+
export declare const TONE_INK: Record<ToneVariant, string>;
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated Renamed to {@link TONE_INK} after the role it maps onto
|
|
94
|
+
* (`--<tone>-ink`); the same object, kept for existing imports.
|
|
95
|
+
*/
|
|
44
96
|
export declare const TONE_TEXT: Record<ToneVariant, string>;
|
|
45
97
|
/** Border colour in the tone — the rim of a tinted badge, banner or toast. */
|
|
46
98
|
export declare const TONE_BORDER: Record<ToneVariant, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tone-utils.d.ts","sourceRoot":"","sources":["../../src/lib/tone-utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tone-utils.d.ts","sourceRoot":"","sources":["../../src/lib/tone-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAA;AAE/E,yEAAyE;AACzE,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAM/C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;CAYuB,CAAA;AAEhD,8EAA8E;AAC9E,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,YAAY,CAAA;AAEjD;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAA;AAI9C,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,GAAE,WAAuB,GAAG,WAAW,CAKzF;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAMjD,CAAA;AAED,iFAAiF;AACjF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAMjD,CAAA;AAED,4EAA4E;AAC5E,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAMhD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAMhD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAY,CAAA;AAE9D,8EAA8E;AAC9E,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAMnD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAMjD,CAAA"}
|
package/dist/lib/tone-utils.js
CHANGED
|
@@ -1,16 +1,73 @@
|
|
|
1
|
+
/** Every tone, in severity order (for loops, pickers and validation). */
|
|
2
|
+
export const TONE_VARIANTS = [
|
|
3
|
+
"danger",
|
|
4
|
+
"warning",
|
|
5
|
+
"success",
|
|
6
|
+
"info",
|
|
7
|
+
"neutral",
|
|
8
|
+
];
|
|
9
|
+
/**
|
|
10
|
+
* Retired or foreign tone names and the tone each one means. One red and one
|
|
11
|
+
* amber (CI §3.3): `critical`, `error` and `destructive` are `danger`; there
|
|
12
|
+
* is no separate severity above it. The names on the left are deprecated:
|
|
13
|
+
* write the {@link ToneVariant} on the right. The map stays so data written
|
|
14
|
+
* against an older vocabulary (a widget-shell `critical`, a shadcn
|
|
15
|
+
* `destructive`) keeps its colour.
|
|
16
|
+
*/
|
|
17
|
+
export const TONE_ALIASES = {
|
|
18
|
+
critical: "danger",
|
|
19
|
+
error: "danger",
|
|
20
|
+
destructive: "danger",
|
|
21
|
+
failure: "danger",
|
|
22
|
+
warn: "warning",
|
|
23
|
+
ok: "success",
|
|
24
|
+
positive: "success",
|
|
25
|
+
notice: "info",
|
|
26
|
+
default: "neutral",
|
|
27
|
+
muted: "neutral",
|
|
28
|
+
secondary: "neutral",
|
|
29
|
+
};
|
|
30
|
+
const TONE_SET = new Set(TONE_VARIANTS);
|
|
31
|
+
/** Whether `value` is one of the five tones (a type guard for data from the wire). */
|
|
32
|
+
export function isToneVariant(value) {
|
|
33
|
+
return typeof value === "string" && TONE_SET.has(value);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Map any tone name onto the vocabulary: a {@link ToneVariant} as is, a
|
|
37
|
+
* retired name ({@link TONE_ALIASES}, case-insensitive) onto its tone, and
|
|
38
|
+
* anything else — unknown, empty, not a string — onto `fallback` (default
|
|
39
|
+
* `"neutral"`, the tone without a state).
|
|
40
|
+
*/
|
|
41
|
+
export function resolveTone(name, fallback = "neutral") {
|
|
42
|
+
if (typeof name !== "string")
|
|
43
|
+
return fallback;
|
|
44
|
+
const key = name.trim().toLowerCase();
|
|
45
|
+
if (TONE_SET.has(key))
|
|
46
|
+
return key;
|
|
47
|
+
return Object.hasOwn(TONE_ALIASES, key) ? TONE_ALIASES[key] : fallback;
|
|
48
|
+
}
|
|
1
49
|
/**
|
|
2
50
|
* Tinted surface + its text (the foreground: CI §3.3) — badges, pills,
|
|
3
51
|
* banners. Pair it with {@link TONE_BORDER}: the rim carries the tone, and in
|
|
4
|
-
* dark mode (no tints) it is all that does.
|
|
52
|
+
* dark mode (no tints) it is all that does. The neutral tint is the muted
|
|
53
|
+
* surface, its text the foreground too (a count on it is a figure).
|
|
5
54
|
*/
|
|
6
55
|
export const TONE_SOFT = {
|
|
7
|
-
neutral: "bg-muted text-
|
|
56
|
+
neutral: "bg-muted text-foreground",
|
|
8
57
|
info: "bg-info-soft text-foreground",
|
|
9
58
|
success: "bg-success-soft text-foreground",
|
|
10
59
|
warning: "bg-warning-soft text-foreground",
|
|
11
60
|
danger: "bg-danger-soft text-foreground",
|
|
12
61
|
};
|
|
13
|
-
/**
|
|
62
|
+
/** The tint alone, for a surface that sets its text itself (a soft KPI card). */
|
|
63
|
+
export const TONE_TINT = {
|
|
64
|
+
neutral: "bg-muted",
|
|
65
|
+
info: "bg-info-soft",
|
|
66
|
+
success: "bg-success-soft",
|
|
67
|
+
warning: "bg-warning-soft",
|
|
68
|
+
danger: "bg-danger-soft",
|
|
69
|
+
};
|
|
70
|
+
/** Solid dot colour — a status dot next to a label, a bar, a meter fill. */
|
|
14
71
|
export const TONE_DOT = {
|
|
15
72
|
neutral: "bg-muted-foreground",
|
|
16
73
|
info: "bg-info",
|
|
@@ -25,13 +82,18 @@ export const TONE_DOT = {
|
|
|
25
82
|
* {@link TONE_ICON} to show the tone. Never on a tint (use {@link TONE_SOFT})
|
|
26
83
|
* and never for figures (they stay in the foreground next to a dot).
|
|
27
84
|
*/
|
|
28
|
-
export const
|
|
85
|
+
export const TONE_INK = {
|
|
29
86
|
neutral: "text-foreground",
|
|
30
87
|
info: "text-info-ink",
|
|
31
88
|
success: "text-success-ink",
|
|
32
89
|
warning: "text-warning-ink",
|
|
33
90
|
danger: "text-danger-ink",
|
|
34
91
|
};
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated Renamed to {@link TONE_INK} after the role it maps onto
|
|
94
|
+
* (`--<tone>-ink`); the same object, kept for existing imports.
|
|
95
|
+
*/
|
|
96
|
+
export const TONE_TEXT = TONE_INK;
|
|
35
97
|
/** Border colour in the tone — the rim of a tinted badge, banner or toast. */
|
|
36
98
|
export const TONE_BORDER = {
|
|
37
99
|
neutral: "border-border",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tone-utils.js","sourceRoot":"","sources":["../../src/lib/tone-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tone-utils.js","sourceRoot":"","sources":["../../src/lib/tone-utils.ts"],"names":[],"mappings":"AAkCA,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,QAAQ;IACR,SAAS;IACT,SAAS;IACT,MAAM;IACN,SAAS;CACV,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,QAAQ;IACrB,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,SAAS;IACf,EAAE,EAAE,SAAS;IACb,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,SAAS;CAC0B,CAAA;AAWhD,MAAM,QAAQ,GAAwB,IAAI,GAAG,CAAC,aAAa,CAAC,CAAA;AAE5D,sFAAsF;AACtF,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;AACzD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,IAAa,EAAE,WAAwB,SAAS;IAC1E,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IACrC,IAAI,QAAQ,CAAC,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ED;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAgC;IACpD,OAAO,EAAE,uBAAuB;IAChC,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,aAAa;CACtB,CAAA"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plain logic behind `useToolQuery`, `useViewToolQuery`, `useViewData`
|
|
3
|
+
* and `useToolMutation` (toolkit#176 K18): the effective cache key and its
|
|
4
|
+
* collision guard, the opt-in retry policy for tool errors, the TanStack
|
|
5
|
+
* options a tool query runs with, and per-call mutation callbacks that fire
|
|
6
|
+
* for EVERY call. No React, no `mcp-use/react`, so it is unit-tested without
|
|
7
|
+
* a renderer.
|
|
8
|
+
*/
|
|
9
|
+
import { type MutateOptions, type MutationFunctionContext, type QueryClient, type UseQueryOptions } from "@tanstack/react-query";
|
|
10
|
+
/** A `(name, args)` tool caller — the shape of `useCallTool()` and `HostBridge.callTool`. */
|
|
11
|
+
export type ToolCaller = (name: string, args: object) => Promise<unknown>;
|
|
12
|
+
/**
|
|
13
|
+
* TanStack query options a tool query passes through: everything except the
|
|
14
|
+
* key and the fetcher, which the hooks build from the tool and its args
|
|
15
|
+
* (`retry`, `retryDelay`, `staleTime`, `placeholderData` / `keepPreviousData`,
|
|
16
|
+
* `initialData` + `initialDataUpdatedAt`, `enabled`, `select`, …).
|
|
17
|
+
*/
|
|
18
|
+
export type UseToolQueryOptions<TData = unknown, TSelected = TData> = Omit<UseQueryOptions<TData, Error, TSelected>, "queryKey" | "queryFn">;
|
|
19
|
+
/**
|
|
20
|
+
* Neither an `AppQueryProvider` `callTool` nor a `HostBridgeProvider` is in
|
|
21
|
+
* reach, so the query cannot call any tool. Never retried: nothing changes
|
|
22
|
+
* until the mount does.
|
|
23
|
+
*/
|
|
24
|
+
export declare class NoToolTransportError extends Error {
|
|
25
|
+
constructor(toolName: string);
|
|
26
|
+
}
|
|
27
|
+
/** Retries {@link shouldRetryToolCall} grants a failed transport (TanStack's own default count). */
|
|
28
|
+
export declare const TOOL_QUERY_RETRIES = 3;
|
|
29
|
+
/**
|
|
30
|
+
* A retry policy for tool queries: up to {@link TOOL_QUERY_RETRIES} retries
|
|
31
|
+
* for a failed transport, none for a tool's own `isError` answer
|
|
32
|
+
* (`isToolError`) or a missing transport — repeating a deterministic answer
|
|
33
|
+
* only repeats it and holds the error back about 7 s.
|
|
34
|
+
*
|
|
35
|
+
* Opt-in in 2.x (the hooks keep the client's `retry`, TanStack's 3 by
|
|
36
|
+
* default, because a tool may also answer a transient failure with
|
|
37
|
+
* `isError`): pass `retry: shouldRetryToolCall` to a hook, or set it as the
|
|
38
|
+
* client's default (`queryClient.setDefaultOptions`, or an `AppQueryProvider`
|
|
39
|
+
* `client` of your own).
|
|
40
|
+
*/
|
|
41
|
+
export declare function shouldRetryToolCall(failureCount: number, error: unknown): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The effective cache key of a tool query (toolkit#176 K18).
|
|
44
|
+
*
|
|
45
|
+
* - 2.x default: the caller's key, then the args (`[...queryKey, args]`), so
|
|
46
|
+
* two callers sharing a key with different args get separate entries.
|
|
47
|
+
* - `toolNameInKey`: the caller's key, the tool name, then the args
|
|
48
|
+
* (`[...queryKey, toolName, args]`), so two tools never share an entry,
|
|
49
|
+
* whatever key their callers pass. Opt-in in 2.x (`AppQueryProvider` /
|
|
50
|
+
* `McpAppView` `toolNameInQueryKey`), the default from the next major.
|
|
51
|
+
*
|
|
52
|
+
* Build exact keys (`getQueryData`, `setQueryData`, `cancelQueries` with
|
|
53
|
+
* `exact: true`) with this helper, or with `useToolQueryKey`, which reads the
|
|
54
|
+
* provider's setting, rather than by hand: code that goes through them keeps
|
|
55
|
+
* working when the default changes. Prefix invalidation by `queryKey`
|
|
56
|
+
* matches either way.
|
|
57
|
+
*/
|
|
58
|
+
export declare function toolQueryKey(queryKey: readonly unknown[], toolName: string, args: object, toolNameInKey?: boolean): unknown[];
|
|
59
|
+
/**
|
|
60
|
+
* Claim the cache key `keyId` (`hashKey` of a {@link toolQueryKey}) for
|
|
61
|
+
* `toolName` on `client`. Returns the tool that held it
|
|
62
|
+
* before when that is ANOTHER tool — a collision the hooks report — else
|
|
63
|
+
* `null`. The latest claim wins, so each collision is reported once per
|
|
64
|
+
* switch.
|
|
65
|
+
*/
|
|
66
|
+
export declare function claimToolQueryKey(client: QueryClient, keyId: string, toolName: string): string | null;
|
|
67
|
+
/** The console line for a {@link claimToolQueryKey} collision. */
|
|
68
|
+
export declare function toolKeyCollisionMessage(keyId: string, toolName: string, previous: string): string;
|
|
69
|
+
/** How {@link toolQueryOptions} decodes a result and builds the key. */
|
|
70
|
+
export interface ToolQueryBuild<TData> {
|
|
71
|
+
/** Decodes the tool result. Default: `parseToolResult` (structured-first). */
|
|
72
|
+
decode?: (result: unknown) => TData;
|
|
73
|
+
/** Put the tool name into the key (see {@link toolQueryKey}). Default `false`. */
|
|
74
|
+
toolNameInKey?: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The TanStack options of a tool query: the caller's options, the
|
|
78
|
+
* {@link toolQueryKey} and a fetcher that calls `toolName` and decodes the
|
|
79
|
+
* result. `retry` stays the caller's, else the client's default; only a
|
|
80
|
+
* missing transport is never retried. Without a transport the fetcher fails
|
|
81
|
+
* with {@link NoToolTransportError} instead of leaving the query idle.
|
|
82
|
+
*/
|
|
83
|
+
export declare function toolQueryOptions<TData, TSelected = TData>(queryKey: readonly unknown[], toolName: string, args: object, callTool: ToolCaller | undefined, opts?: UseToolQueryOptions<TData, TSelected>, build?: ToolQueryBuild<TData>): UseQueryOptions<TData, Error, TSelected>;
|
|
84
|
+
/**
|
|
85
|
+
* Seed `queryKey` with host-delivered `seed`: written when the entry is
|
|
86
|
+
* empty, or when the seed is a payload this client has not seeded for the
|
|
87
|
+
* key before (a new delivery). Returns whether the cache was written.
|
|
88
|
+
*/
|
|
89
|
+
export declare function seedToolQuery(client: QueryClient, queryKey: readonly unknown[], seed: unknown, updatedAt?: number): boolean;
|
|
90
|
+
/** Callbacks of one `mutate` call, typed as TanStack's per-call options. */
|
|
91
|
+
export type PerCallCallbacks<TData, TVariables> = MutateOptions<TData, Error, TVariables, unknown>;
|
|
92
|
+
/**
|
|
93
|
+
* Fire one call's per-call `onSuccess` / `onError` / `onSettled` once `call`
|
|
94
|
+
* settles — for EVERY call. TanStack's own `mutate` keeps only the latest
|
|
95
|
+
* call's callbacks, so two quick calls (retrying two incidents in a row)
|
|
96
|
+
* would confirm only the second. `context()` is read when the call settles:
|
|
97
|
+
* `null` (the component unmounted) skips the callbacks, as TanStack does.
|
|
98
|
+
* A rejected `call` is handled here, never left unhandled.
|
|
99
|
+
*/
|
|
100
|
+
export declare function settleEachCall<TData, TVariables>(call: Promise<TData>, variables: TVariables, callbacks: PerCallCallbacks<TData, TVariables> | undefined, context: () => MutationFunctionContext | null): void;
|
|
101
|
+
/**
|
|
102
|
+
* Invalidate the query keys (prefixes) a mutation names: matching ACTIVE
|
|
103
|
+
* queries refetch now, inactive ones are only marked stale and refetch when
|
|
104
|
+
* they are next used — never a refetch of every inactive cached page.
|
|
105
|
+
*/
|
|
106
|
+
export declare function invalidateToolQueries(client: QueryClient, keys: readonly (readonly unknown[])[] | undefined): Promise<void>;
|
|
107
|
+
//# sourceMappingURL=tool-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-query.d.ts","sourceRoot":"","sources":["../../src/lib/tool-query.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAA;AAG9B,6FAA6F;AAC7F,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;AAEzE;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AM,EACZ,QAAQ,EAAE,UAAU,GAAG,SAAS,EAChC,IAAI,CAAC,EAAE,mBAAmB,CAAC,KAAK,EAAE,SAAS,CAAC,EAC5C,KAAK,GAAE,cAAc,CAAC,KAAK,CAAM,GAChC,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,CAa1C;AAiBD;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,IAAI,EAAE,OAAO,EACb,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAUT;AAED,4EAA4E;AAC5E,MAAM,MAAM,gBAAgB,CAAC,KAAK,EAAE,UAAU,IAAI,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;AAYlG;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,EAC9C,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,EACpB,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,SAAS,EAC1D,OAAO,EAAE,MAAM,uBAAuB,GAAG,IAAI,GAC5C,IAAI,CAeN;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,GAAG,SAAS,GAChD,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plain logic behind `useToolQuery`, `useViewToolQuery`, `useViewData`
|
|
3
|
+
* and `useToolMutation` (toolkit#176 K18): the effective cache key and its
|
|
4
|
+
* collision guard, the opt-in retry policy for tool errors, the TanStack
|
|
5
|
+
* options a tool query runs with, and per-call mutation callbacks that fire
|
|
6
|
+
* for EVERY call. No React, no `mcp-use/react`, so it is unit-tested without
|
|
7
|
+
* a renderer.
|
|
8
|
+
*/
|
|
9
|
+
import { hashKey, } from "@tanstack/react-query";
|
|
10
|
+
import { isToolError, parseToolResult } from "./parse-tool-result.js";
|
|
11
|
+
/**
|
|
12
|
+
* Neither an `AppQueryProvider` `callTool` nor a `HostBridgeProvider` is in
|
|
13
|
+
* reach, so the query cannot call any tool. Never retried: nothing changes
|
|
14
|
+
* until the mount does.
|
|
15
|
+
*/
|
|
16
|
+
export class NoToolTransportError extends Error {
|
|
17
|
+
constructor(toolName) {
|
|
18
|
+
super(`[mcp-toolkit] cannot call "${toolName}": no tool transport. Mount the widget under ` +
|
|
19
|
+
"AppQueryProvider with callTool, or a HostBridgeProvider.");
|
|
20
|
+
this.name = "NoToolTransportError";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** Retries {@link shouldRetryToolCall} grants a failed transport (TanStack's own default count). */
|
|
24
|
+
export const TOOL_QUERY_RETRIES = 3;
|
|
25
|
+
/**
|
|
26
|
+
* A retry policy for tool queries: up to {@link TOOL_QUERY_RETRIES} retries
|
|
27
|
+
* for a failed transport, none for a tool's own `isError` answer
|
|
28
|
+
* (`isToolError`) or a missing transport — repeating a deterministic answer
|
|
29
|
+
* only repeats it and holds the error back about 7 s.
|
|
30
|
+
*
|
|
31
|
+
* Opt-in in 2.x (the hooks keep the client's `retry`, TanStack's 3 by
|
|
32
|
+
* default, because a tool may also answer a transient failure with
|
|
33
|
+
* `isError`): pass `retry: shouldRetryToolCall` to a hook, or set it as the
|
|
34
|
+
* client's default (`queryClient.setDefaultOptions`, or an `AppQueryProvider`
|
|
35
|
+
* `client` of your own).
|
|
36
|
+
*/
|
|
37
|
+
export function shouldRetryToolCall(failureCount, error) {
|
|
38
|
+
if (isToolError(error) || error instanceof NoToolTransportError)
|
|
39
|
+
return false;
|
|
40
|
+
return failureCount < TOOL_QUERY_RETRIES;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The effective cache key of a tool query (toolkit#176 K18).
|
|
44
|
+
*
|
|
45
|
+
* - 2.x default: the caller's key, then the args (`[...queryKey, args]`), so
|
|
46
|
+
* two callers sharing a key with different args get separate entries.
|
|
47
|
+
* - `toolNameInKey`: the caller's key, the tool name, then the args
|
|
48
|
+
* (`[...queryKey, toolName, args]`), so two tools never share an entry,
|
|
49
|
+
* whatever key their callers pass. Opt-in in 2.x (`AppQueryProvider` /
|
|
50
|
+
* `McpAppView` `toolNameInQueryKey`), the default from the next major.
|
|
51
|
+
*
|
|
52
|
+
* Build exact keys (`getQueryData`, `setQueryData`, `cancelQueries` with
|
|
53
|
+
* `exact: true`) with this helper, or with `useToolQueryKey`, which reads the
|
|
54
|
+
* provider's setting, rather than by hand: code that goes through them keeps
|
|
55
|
+
* working when the default changes. Prefix invalidation by `queryKey`
|
|
56
|
+
* matches either way.
|
|
57
|
+
*/
|
|
58
|
+
export function toolQueryKey(queryKey, toolName, args, toolNameInKey = false) {
|
|
59
|
+
return toolNameInKey ? [...queryKey, toolName, args] : [...queryKey, args];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The tool that last claimed each cache key, per client — the guard against
|
|
63
|
+
* two tools sharing one entry (their answers would overwrite each other).
|
|
64
|
+
*/
|
|
65
|
+
const keyOwners = new WeakMap();
|
|
66
|
+
/**
|
|
67
|
+
* Claim the cache key `keyId` (`hashKey` of a {@link toolQueryKey}) for
|
|
68
|
+
* `toolName` on `client`. Returns the tool that held it
|
|
69
|
+
* before when that is ANOTHER tool — a collision the hooks report — else
|
|
70
|
+
* `null`. The latest claim wins, so each collision is reported once per
|
|
71
|
+
* switch.
|
|
72
|
+
*/
|
|
73
|
+
export function claimToolQueryKey(client, keyId, toolName) {
|
|
74
|
+
const owners = keyOwners.get(client) ?? new Map();
|
|
75
|
+
keyOwners.set(client, owners);
|
|
76
|
+
const previous = owners.get(keyId);
|
|
77
|
+
owners.set(keyId, toolName);
|
|
78
|
+
return previous !== undefined && previous !== toolName ? previous : null;
|
|
79
|
+
}
|
|
80
|
+
/** The console line for a {@link claimToolQueryKey} collision. */
|
|
81
|
+
export function toolKeyCollisionMessage(keyId, toolName, previous) {
|
|
82
|
+
return (`[mcp-toolkit] the query key ${keyId} is used by "${previous}" and "${toolName}": ` +
|
|
83
|
+
"both share one cache entry and overwrite each other's answer. Give each tool its own queryKey.");
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The TanStack options of a tool query: the caller's options, the
|
|
87
|
+
* {@link toolQueryKey} and a fetcher that calls `toolName` and decodes the
|
|
88
|
+
* result. `retry` stays the caller's, else the client's default; only a
|
|
89
|
+
* missing transport is never retried. Without a transport the fetcher fails
|
|
90
|
+
* with {@link NoToolTransportError} instead of leaving the query idle.
|
|
91
|
+
*/
|
|
92
|
+
export function toolQueryOptions(queryKey, toolName, args, callTool, opts, build = {}) {
|
|
93
|
+
const decode = build.decode ?? ((result) => parseToolResult(result));
|
|
94
|
+
return {
|
|
95
|
+
...opts,
|
|
96
|
+
// An omitted `retry` must stay omitted: an explicit `undefined` would
|
|
97
|
+
// shadow the client's default.
|
|
98
|
+
...(callTool ? null : { retry: false }),
|
|
99
|
+
queryKey: toolQueryKey(queryKey, toolName, args, build.toolNameInKey),
|
|
100
|
+
queryFn: async () => {
|
|
101
|
+
if (!callTool)
|
|
102
|
+
throw new NoToolTransportError(toolName);
|
|
103
|
+
return decode(await callTool(toolName, args));
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The content of the payload last seeded per query key, per client: a
|
|
109
|
+
* remounted or re-rendered OLD payload must not roll a refetched answer
|
|
110
|
+
* back, while a payload not seeded before is a new delivery and wins.
|
|
111
|
+
*/
|
|
112
|
+
const lastSeeded = new WeakMap();
|
|
113
|
+
function contentOf(value) {
|
|
114
|
+
try {
|
|
115
|
+
return JSON.stringify(value);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Seed `queryKey` with host-delivered `seed`: written when the entry is
|
|
123
|
+
* empty, or when the seed is a payload this client has not seeded for the
|
|
124
|
+
* key before (a new delivery). Returns whether the cache was written.
|
|
125
|
+
*/
|
|
126
|
+
export function seedToolQuery(client, queryKey, seed, updatedAt) {
|
|
127
|
+
const keyId = hashKey(queryKey);
|
|
128
|
+
const seeded = lastSeeded.get(client) ?? new Map();
|
|
129
|
+
lastSeeded.set(client, seeded);
|
|
130
|
+
const content = contentOf(seed);
|
|
131
|
+
const delivered = content === undefined || seeded.get(keyId) !== content;
|
|
132
|
+
if (content !== undefined)
|
|
133
|
+
seeded.set(keyId, content);
|
|
134
|
+
if (!delivered && client.getQueryData(queryKey) !== undefined)
|
|
135
|
+
return false;
|
|
136
|
+
client.setQueryData(queryKey, seed, updatedAt === undefined ? undefined : { updatedAt });
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
function settle(run) {
|
|
140
|
+
try {
|
|
141
|
+
run();
|
|
142
|
+
}
|
|
143
|
+
catch (err) {
|
|
144
|
+
// Surface a throwing callback as an unhandled rejection, as TanStack
|
|
145
|
+
// does, without skipping the callbacks after it.
|
|
146
|
+
void Promise.reject(err instanceof Error ? err : new Error(String(err)));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Fire one call's per-call `onSuccess` / `onError` / `onSettled` once `call`
|
|
151
|
+
* settles — for EVERY call. TanStack's own `mutate` keeps only the latest
|
|
152
|
+
* call's callbacks, so two quick calls (retrying two incidents in a row)
|
|
153
|
+
* would confirm only the second. `context()` is read when the call settles:
|
|
154
|
+
* `null` (the component unmounted) skips the callbacks, as TanStack does.
|
|
155
|
+
* A rejected `call` is handled here, never left unhandled.
|
|
156
|
+
*/
|
|
157
|
+
export function settleEachCall(call, variables, callbacks, context) {
|
|
158
|
+
call.then((data) => {
|
|
159
|
+
const ctx = callbacks ? context() : null;
|
|
160
|
+
if (!callbacks || !ctx)
|
|
161
|
+
return;
|
|
162
|
+
settle(() => callbacks.onSuccess?.(data, variables, undefined, ctx));
|
|
163
|
+
settle(() => callbacks.onSettled?.(data, null, variables, undefined, ctx));
|
|
164
|
+
}, (error) => {
|
|
165
|
+
const ctx = callbacks ? context() : null;
|
|
166
|
+
if (!callbacks || !ctx)
|
|
167
|
+
return;
|
|
168
|
+
settle(() => callbacks.onError?.(error, variables, undefined, ctx));
|
|
169
|
+
settle(() => callbacks.onSettled?.(undefined, error, variables, undefined, ctx));
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Invalidate the query keys (prefixes) a mutation names: matching ACTIVE
|
|
174
|
+
* queries refetch now, inactive ones are only marked stale and refetch when
|
|
175
|
+
* they are next used — never a refetch of every inactive cached page.
|
|
176
|
+
*/
|
|
177
|
+
export async function invalidateToolQueries(client, keys) {
|
|
178
|
+
if (!keys)
|
|
179
|
+
return;
|
|
180
|
+
await Promise.all(keys.map((queryKey) => client.invalidateQueries({ queryKey })));
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=tool-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-query.js","sourceRoot":"","sources":["../../src/lib/tool-query.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,OAAO,GAKR,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAgBrE;;;;GAIG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,QAAgB;QAC1B,KAAK,CACH,8BAA8B,QAAQ,+CAA+C;YACnF,0DAA0D,CAC7D,CAAA;QACD,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAA;IACpC,CAAC;CACF;AAED,oGAAoG;AACpG,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAEnC;;;;;;;;;;;GAWG;AACH,MAAM,UA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,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC,CAAA;QACpE,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC,CAAA;IAC5E,CAAC,EACD,CAAC,KAAY,EAAE,EAAE;QACf,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;QACxC,IAAI,CAAC,SAAS,IAAI,CAAC,GAAG;YAAE,OAAM;QAC9B,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC,CAAA;QACnE,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC,CAAA;IAClF,CAAC,CACF,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,MAAmB,EACnB,IAAiD;IAEjD,IAAI,CAAC,IAAI;QAAE,OAAM;IACjB,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAA;AACnF,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A passive observer of the MCP Apps (SEP-1865) host → view lifecycle
|
|
3
|
+
* notifications, read straight off the postMessage channel the view runtime
|
|
4
|
+
* itself listens on (toolkit#176 K13, N21).
|
|
5
|
+
*
|
|
6
|
+
* mcp-use 2.x latches only a result WITH `structuredContent` (or an
|
|
7
|
+
* `isError`); a content-only result, which claude.ai and Claude Desktop send,
|
|
8
|
+
* leaves its status `"pending"` forever, and its tool input merges partial and
|
|
9
|
+
* complete arguments into one field. Watching the notifications themselves
|
|
10
|
+
* tells the three cases apart that the latch cannot:
|
|
11
|
+
*
|
|
12
|
+
* - the host delivered a STRIPPED result (re-run the tool now, with the
|
|
13
|
+
* complete arguments it was called with),
|
|
14
|
+
* - the host delivered a structured result (the latch follows; never re-run),
|
|
15
|
+
* - nothing arrived yet (a slow tool on a compliant host: keep waiting).
|
|
16
|
+
*
|
|
17
|
+
* The last case is only certain when the observer was listening before the
|
|
18
|
+
* host answered `ui/initialize` ({@link ToolObservation.sawHandshake}): hosts
|
|
19
|
+
* send the lifecycle notifications after the handshake, so an observer that
|
|
20
|
+
* saw it has seen everything sent so far. `mountMcpToolkitApp` installs it
|
|
21
|
+
* ahead of `bootstrapView` for exactly that reason.
|
|
22
|
+
*
|
|
23
|
+
* Read-only: it never sends, never answers and never stops a message.
|
|
24
|
+
*/
|
|
25
|
+
/** What the host's `ui/notifications/tool-result` carried. */
|
|
26
|
+
export type ObservedToolResult = "none" | "structured" | "stripped" | "error";
|
|
27
|
+
/** Everything the observer learned about the rendering call so far. */
|
|
28
|
+
export interface ToolObservation {
|
|
29
|
+
/**
|
|
30
|
+
* The observer saw the host answer `ui/initialize`, so it was listening
|
|
31
|
+
* before any lifecycle notification could be sent: a result it has not
|
|
32
|
+
* seen has not been delivered yet.
|
|
33
|
+
*/
|
|
34
|
+
sawHandshake: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The arguments of the complete `ui/notifications/tool-input` — never a
|
|
37
|
+
* partial stream (`tool-input-partial` is ignored). `undefined` until it
|
|
38
|
+
* arrived.
|
|
39
|
+
*/
|
|
40
|
+
completeInput: Record<string, unknown> | undefined;
|
|
41
|
+
/** What the first `ui/notifications/tool-result` carried. */
|
|
42
|
+
result: ObservedToolResult;
|
|
43
|
+
/** The host sent `ui/notifications/tool-cancelled`. */
|
|
44
|
+
cancelled: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare const EMPTY_TOOL_OBSERVATION: ToolObservation;
|
|
47
|
+
/** A host → view message the observer acts on. */
|
|
48
|
+
export type HostLifecycleMessage = {
|
|
49
|
+
kind: "handshake";
|
|
50
|
+
} | {
|
|
51
|
+
kind: "tool-input";
|
|
52
|
+
arguments: Record<string, unknown>;
|
|
53
|
+
} | {
|
|
54
|
+
kind: "tool-result";
|
|
55
|
+
result: Exclude<ObservedToolResult, "none">;
|
|
56
|
+
} | {
|
|
57
|
+
kind: "tool-cancelled";
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Classify a tool-result notification the way mcp-use 2.x's latch does: an
|
|
61
|
+
* `isError` result is an error, a result with `structuredContent` (even
|
|
62
|
+
* `null`) latches as ready, and anything else is the stripped, content-only
|
|
63
|
+
* result the latch ignores.
|
|
64
|
+
*/
|
|
65
|
+
export declare function classifyToolResult(params: Record<string, unknown>): Exclude<ObservedToolResult, "none">;
|
|
66
|
+
/**
|
|
67
|
+
* Decode one postMessage payload into the lifecycle message it is, or `null`
|
|
68
|
+
* for anything else (other methods, requests, responses, foreign traffic).
|
|
69
|
+
*/
|
|
70
|
+
export declare function classifyHostMessage(data: unknown): HostLifecycleMessage | null;
|
|
71
|
+
/**
|
|
72
|
+
* Fold one message into the observation. Like the mcp-use latch, the call
|
|
73
|
+
* settles once: after its result or cancellation, later inputs, results and
|
|
74
|
+
* cancellations change nothing.
|
|
75
|
+
*/
|
|
76
|
+
export declare function reduceToolObservation(state: ToolObservation, message: HostLifecycleMessage): ToolObservation;
|
|
77
|
+
/** The `window` slice the observer listens on (any `EventTarget`, e.g. in tests). */
|
|
78
|
+
export interface MessageEventSource {
|
|
79
|
+
addEventListener(type: "message", listener: (event: Event) => void): void;
|
|
80
|
+
removeEventListener(type: "message", listener: (event: Event) => void): void;
|
|
81
|
+
}
|
|
82
|
+
/** A subscribable observation, shaped for `useSyncExternalStore`. */
|
|
83
|
+
export interface ToolResultObserver {
|
|
84
|
+
subscribe: (listener: () => void) => () => void;
|
|
85
|
+
getSnapshot: () => ToolObservation;
|
|
86
|
+
/** Stop listening; the last observation stays readable. */
|
|
87
|
+
dispose: () => void;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Observe the lifecycle notifications arriving on `source`. `accept` filters
|
|
91
|
+
* the events (the view accepts only its host: `event.source === window.parent`,
|
|
92
|
+
* the same check the ext-apps transport makes).
|
|
93
|
+
*/
|
|
94
|
+
export declare function createToolResultObserver(source: MessageEventSource, accept?: (event: MessageEvent) => boolean): ToolResultObserver;
|
|
95
|
+
/**
|
|
96
|
+
* The view document's observer: installed once and kept for the document's
|
|
97
|
+
* lifetime (one document renders one view). `null` outside a browser and in
|
|
98
|
+
* a top-level window, where no host frames the view.
|
|
99
|
+
*
|
|
100
|
+
* It must listen before the view runtime connects, so it sees the
|
|
101
|
+
* handshake. This module therefore installs it as the bundle evaluates
|
|
102
|
+
* (below), ahead of any `bootstrapView` call in the entry module, whatever
|
|
103
|
+
* the mount; `mountMcpToolkitApp` calls it again (idempotent). Installed any
|
|
104
|
+
* later, it still sees what arrives afterwards, and the recovery falls back
|
|
105
|
+
* to its grace timer for the rest.
|
|
106
|
+
*/
|
|
107
|
+
export declare function installToolResultObserver(): ToolResultObserver | null;
|
|
108
|
+
//# sourceMappingURL=tool-result-observer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-result-observer.d.ts","sourceRoot":"","sources":["../../src/lib/tool-result-observer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,8DAA8D;AAC9D,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO,CAAA;AAE7E,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,YAAY,EAAE,OAAO,CAAA;IACrB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA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