@manta-eu/react 0.11.0 → 0.13.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 +59 -0
- package/dist/components/AppErrorBoundary.d.ts.map +1 -1
- package/dist/components/AppErrorBoundary.js +14 -11
- package/dist/components/AppErrorBoundary.js.map +1 -1
- package/dist/components/app-gate/AppGate.d.ts +8 -0
- package/dist/components/app-gate/AppGate.d.ts.map +1 -0
- package/dist/components/app-gate/AppGate.js +68 -0
- package/dist/components/app-gate/AppGate.js.map +1 -0
- package/dist/components/app-gate/AwaitingDatastoreStatus.d.ts +7 -0
- package/dist/components/app-gate/AwaitingDatastoreStatus.d.ts.map +1 -0
- package/dist/components/app-gate/AwaitingDatastoreStatus.js +19 -0
- package/dist/components/app-gate/AwaitingDatastoreStatus.js.map +1 -0
- package/dist/components/app-gate/EnterDatastoreRoute.d.ts +2 -0
- package/dist/components/app-gate/EnterDatastoreRoute.d.ts.map +1 -0
- package/dist/components/app-gate/EnterDatastoreRoute.js +25 -0
- package/dist/components/app-gate/EnterDatastoreRoute.js.map +1 -0
- package/dist/components/app-gate/ErrorRoute.d.ts +2 -0
- package/dist/components/app-gate/ErrorRoute.d.ts.map +1 -0
- package/dist/components/app-gate/ErrorRoute.js +27 -0
- package/dist/components/app-gate/ErrorRoute.js.map +1 -0
- package/dist/components/app-gate/FailureAlert.d.ts +5 -0
- package/dist/components/app-gate/FailureAlert.d.ts.map +1 -0
- package/dist/components/app-gate/FailureAlert.js +9 -0
- package/dist/components/app-gate/FailureAlert.js.map +1 -0
- package/dist/components/app-gate/NoDatastoreAccess.d.ts +8 -0
- package/dist/components/app-gate/NoDatastoreAccess.d.ts.map +1 -0
- package/dist/components/app-gate/NoDatastoreAccess.js +9 -0
- package/dist/components/app-gate/NoDatastoreAccess.js.map +1 -0
- package/dist/components/app-gate/NotFoundRoute.d.ts +2 -0
- package/dist/components/app-gate/NotFoundRoute.d.ts.map +1 -0
- package/dist/components/app-gate/NotFoundRoute.js +9 -0
- package/dist/components/app-gate/NotFoundRoute.js.map +1 -0
- package/dist/components/app-gate/PendingInvitations.d.ts +5 -0
- package/dist/components/app-gate/PendingInvitations.d.ts.map +1 -0
- package/dist/components/app-gate/PendingInvitations.js +58 -0
- package/dist/components/app-gate/PendingInvitations.js.map +1 -0
- package/dist/components/app-gate/ServiceError.d.ts +8 -0
- package/dist/components/app-gate/ServiceError.d.ts.map +1 -0
- package/dist/components/app-gate/ServiceError.js +10 -0
- package/dist/components/app-gate/ServiceError.js.map +1 -0
- package/dist/components/app-gate/index.d.ts +3 -0
- package/dist/components/app-gate/index.d.ts.map +1 -0
- package/dist/components/app-gate/index.js +3 -0
- package/dist/components/app-gate/index.js.map +1 -0
- package/dist/components/app-gate/sdk-route-elements.d.ts +23 -0
- package/dist/components/app-gate/sdk-route-elements.d.ts.map +1 -0
- package/dist/components/app-gate/sdk-route-elements.js +35 -0
- package/dist/components/app-gate/sdk-route-elements.js.map +1 -0
- package/dist/components/app-shell/AppShell.d.ts +7 -0
- package/dist/components/app-shell/AppShell.d.ts.map +1 -0
- package/dist/components/app-shell/AppShell.js +10 -0
- package/dist/components/app-shell/AppShell.js.map +1 -0
- package/dist/components/app-shell/AppShellRoutes.d.ts +9 -0
- package/dist/components/app-shell/AppShellRoutes.d.ts.map +1 -0
- package/dist/components/app-shell/AppShellRoutes.js +20 -0
- package/dist/components/app-shell/AppShellRoutes.js.map +1 -0
- package/dist/components/app-shell/GroupDatastores.d.ts +8 -0
- package/dist/components/app-shell/GroupDatastores.d.ts.map +1 -0
- package/dist/components/app-shell/GroupDatastores.js +15 -0
- package/dist/components/app-shell/GroupDatastores.js.map +1 -0
- package/dist/components/app-shell/GroupRoute.d.ts +2 -0
- package/dist/components/app-shell/GroupRoute.d.ts.map +1 -0
- package/dist/components/app-shell/GroupRoute.js +22 -0
- package/dist/components/app-shell/GroupRoute.js.map +1 -0
- package/dist/components/app-shell/index.d.ts +3 -0
- package/dist/components/app-shell/index.d.ts.map +1 -0
- package/dist/components/app-shell/index.js +3 -0
- package/dist/components/app-shell/index.js.map +1 -0
- package/dist/components/authenticated-chat/index.d.ts +1 -2
- package/dist/components/authenticated-chat/index.d.ts.map +1 -1
- package/dist/components/authenticated-chat/index.js +1 -12
- package/dist/components/authenticated-chat/index.js.map +1 -1
- package/dist/components/chat-view/Chat.d.ts +2 -1
- package/dist/components/chat-view/Chat.d.ts.map +1 -1
- package/dist/components/chat-view/Chat.js +3 -2
- package/dist/components/chat-view/Chat.js.map +1 -1
- package/dist/components/chat-view/MessageItem.d.ts.map +1 -1
- package/dist/components/chat-view/MessageItem.js +4 -2
- package/dist/components/chat-view/MessageItem.js.map +1 -1
- package/dist/components/chat-view/tool-part-rendering.d.ts +1 -0
- package/dist/components/chat-view/tool-part-rendering.d.ts.map +1 -1
- package/dist/components/chat-view/tool-part-rendering.js +8 -1
- package/dist/components/chat-view/tool-part-rendering.js.map +1 -1
- package/dist/components/chip/index.d.ts +1 -0
- package/dist/components/chip/index.d.ts.map +1 -1
- package/dist/components/chip/index.js +2 -1
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/embedded-chat/index.d.ts +1 -1
- package/dist/components/embedded-chat/index.d.ts.map +1 -1
- package/dist/components/embedded-chat/index.js +1 -1
- package/dist/components/embedded-chat/index.js.map +1 -1
- package/dist/components/input/input-date-time.d.ts +6 -0
- package/dist/components/input/input-date-time.d.ts.map +1 -1
- package/dist/components/input/input-date-time.js +2 -1
- package/dist/components/input/input-date-time.js.map +1 -1
- package/dist/components/input/input-date.d.ts +22 -0
- package/dist/components/input/input-date.d.ts.map +1 -1
- package/dist/components/input/input-date.js +28 -14
- package/dist/components/input/input-date.js.map +1 -1
- package/dist/components/input/input-time.d.ts +9 -0
- package/dist/components/input/input-time.d.ts.map +1 -1
- package/dist/components/input/input-time.js +29 -18
- package/dist/components/input/input-time.js.map +1 -1
- package/dist/components/layouts/RouteLayout.d.ts +0 -9
- package/dist/components/layouts/RouteLayout.d.ts.map +1 -1
- package/dist/components/layouts/RouteLayout.js +7 -4
- package/dist/components/layouts/RouteLayout.js.map +1 -1
- package/dist/components/layouts/Sidebar.d.ts +1 -8
- package/dist/components/layouts/Sidebar.d.ts.map +1 -1
- package/dist/components/layouts/Sidebar.js +7 -14
- package/dist/components/layouts/Sidebar.js.map +1 -1
- package/dist/components/plan-limits/PlanLimitsDialog.d.ts +20 -0
- package/dist/components/plan-limits/PlanLimitsDialog.d.ts.map +1 -0
- package/dist/components/plan-limits/PlanLimitsDialog.js +109 -0
- package/dist/components/plan-limits/PlanLimitsDialog.js.map +1 -0
- package/dist/components/plan-limits/index.d.ts +4 -0
- package/dist/components/plan-limits/index.d.ts.map +1 -0
- package/dist/components/plan-limits/index.js +2 -0
- package/dist/components/plan-limits/index.js.map +1 -0
- package/dist/components/plan-limits/plan-limits-client.d.ts +15 -0
- package/dist/components/plan-limits/plan-limits-client.d.ts.map +1 -0
- package/dist/components/plan-limits/plan-limits-client.js +44 -0
- package/dist/components/plan-limits/plan-limits-client.js.map +1 -0
- package/dist/components/plan-limits/plan-limits-model.d.ts +66 -0
- package/dist/components/plan-limits/plan-limits-model.d.ts.map +1 -0
- package/dist/components/plan-limits/plan-limits-model.js +123 -0
- package/dist/components/plan-limits/plan-limits-model.js.map +1 -0
- package/dist/components/plan-limits/plan-limits-save.d.ts +31 -0
- package/dist/components/plan-limits/plan-limits-save.d.ts.map +1 -0
- package/dist/components/plan-limits/plan-limits-save.js +43 -0
- package/dist/components/plan-limits/plan-limits-save.js.map +1 -0
- package/dist/components/planning/PlanLimitsAction.d.ts +6 -0
- package/dist/components/planning/PlanLimitsAction.d.ts.map +1 -0
- package/dist/components/planning/PlanLimitsAction.js +19 -0
- package/dist/components/planning/PlanLimitsAction.js.map +1 -0
- package/dist/components/slider/index.d.ts.map +1 -1
- package/dist/components/slider/index.js +2 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/datastore-picker/datastore-picker-rows.d.ts +7 -0
- package/dist/datastore-picker/datastore-picker-rows.d.ts.map +1 -1
- package/dist/datastore-picker/datastore-picker-rows.js +26 -22
- package/dist/datastore-picker/datastore-picker-rows.js.map +1 -1
- package/dist/globals.css +85 -2
- package/dist/hooks/use-action-plans-list.d.ts +3 -0
- package/dist/hooks/use-action-plans-list.d.ts.map +1 -1
- package/dist/hooks/use-action-plans-list.js +8 -9
- package/dist/hooks/use-action-plans-list.js.map +1 -1
- package/dist/hooks/use-activity-feed.d.ts +10 -1
- package/dist/hooks/use-activity-feed.d.ts.map +1 -1
- package/dist/hooks/use-activity-feed.js +9 -11
- package/dist/hooks/use-activity-feed.js.map +1 -1
- package/dist/hooks/use-entity.d.ts +4 -3
- package/dist/hooks/use-entity.d.ts.map +1 -1
- package/dist/hooks/use-entity.js +4 -4
- package/dist/hooks/use-entity.js.map +1 -1
- package/dist/hooks/use-manual-actions.d.ts +1 -1
- package/dist/hooks/use-manual-actions.d.ts.map +1 -1
- package/dist/hooks/use-manual-actions.js +5 -5
- package/dist/hooks/use-manual-actions.js.map +1 -1
- package/dist/hooks/use-unsaved-changes-warning.d.ts +2 -0
- package/dist/hooks/use-unsaved-changes-warning.d.ts.map +1 -0
- package/dist/hooks/use-unsaved-changes-warning.js +13 -0
- package/dist/hooks/use-unsaved-changes-warning.js.map +1 -0
- package/dist/hooks/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth.js +4 -3
- package/dist/hooks/useAuth.js.map +1 -1
- package/dist/hooks/useChatPanelSync.d.ts.map +1 -1
- package/dist/hooks/useChatPanelSync.js +2 -3
- package/dist/hooks/useChatPanelSync.js.map +1 -1
- package/dist/hooks/useDatastoreSelection.d.ts.map +1 -1
- package/dist/hooks/useDatastoreSelection.js +11 -4
- package/dist/hooks/useDatastoreSelection.js.map +1 -1
- package/dist/hooks/useExecuteAction.d.ts +1 -0
- package/dist/hooks/useExecuteAction.d.ts.map +1 -1
- package/dist/hooks/useExecuteAction.js.map +1 -1
- package/dist/hooks/useLoginRedirect.d.ts +6 -0
- package/dist/hooks/useLoginRedirect.d.ts.map +1 -0
- package/dist/hooks/useLoginRedirect.js +51 -0
- package/dist/hooks/useLoginRedirect.js.map +1 -0
- package/dist/hooks/usePlanLimits.d.ts +18 -0
- package/dist/hooks/usePlanLimits.d.ts.map +1 -0
- package/dist/hooks/usePlanLimits.js +56 -0
- package/dist/hooks/usePlanLimits.js.map +1 -0
- package/dist/ldo-ui.d.ts +1 -1
- package/dist/ldo-ui.d.ts.map +1 -1
- package/dist/ldo-ui.js.map +1 -1
- package/dist/lib/app-tools.d.ts +18 -0
- package/dist/lib/app-tools.d.ts.map +1 -0
- package/dist/lib/app-tools.js +42 -0
- package/dist/lib/app-tools.js.map +1 -0
- package/dist/lib/chat-types.d.ts +3 -0
- package/dist/lib/chat-types.d.ts.map +1 -1
- package/dist/lib/chat-types.js.map +1 -1
- package/dist/lib/datastore-route-table.d.ts +3 -0
- package/dist/lib/datastore-route-table.d.ts.map +1 -1
- package/dist/lib/datastore-route-table.js +6 -0
- package/dist/lib/datastore-route-table.js.map +1 -1
- package/dist/lib/graphql-error.d.ts +2 -0
- package/dist/lib/graphql-error.d.ts.map +1 -0
- package/dist/lib/graphql-error.js +7 -0
- package/dist/lib/graphql-error.js.map +1 -0
- package/dist/lib/update-notice.d.ts +2 -1
- package/dist/lib/update-notice.d.ts.map +1 -1
- package/dist/lib/update-notice.js +8 -2
- package/dist/lib/update-notice.js.map +1 -1
- package/dist/providers/ActiveChatProvider.d.ts +2 -0
- package/dist/providers/ActiveChatProvider.d.ts.map +1 -1
- package/dist/providers/ActiveChatProvider.js +6 -3
- package/dist/providers/ActiveChatProvider.js.map +1 -1
- package/dist/providers/ActiveDatastoreProvider.d.ts +12 -0
- package/dist/providers/ActiveDatastoreProvider.d.ts.map +1 -1
- package/dist/providers/ActiveDatastoreProvider.js +114 -11
- package/dist/providers/ActiveDatastoreProvider.js.map +1 -1
- package/dist/providers/AuthContext.d.ts +1 -0
- package/dist/providers/AuthContext.d.ts.map +1 -1
- package/dist/providers/AuthContext.js.map +1 -1
- package/dist/providers/KnowledgeGraphStateContext.d.ts +2 -2
- package/dist/providers/KnowledgeGraphStateContext.d.ts.map +1 -1
- package/dist/providers/KnowledgeGraphStateProvider.d.ts.map +1 -1
- package/dist/providers/KnowledgeGraphStateProvider.js +8 -49
- package/dist/providers/KnowledgeGraphStateProvider.js.map +1 -1
- package/dist/providers/MantaClientProvider.d.ts.map +1 -1
- package/dist/providers/MantaClientProvider.js +3 -3
- package/dist/providers/MantaClientProvider.js.map +1 -1
- package/dist/providers/index.d.ts +3 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +2 -2
- package/dist/providers/index.js.map +1 -1
- package/dist/routes/activity/detail/ActivityDetailRoute.d.ts.map +1 -1
- package/dist/routes/activity/detail/ActivityDetailRoute.js +1 -3
- package/dist/routes/activity/detail/ActivityDetailRoute.js.map +1 -1
- package/dist/routes/activity/index.d.ts.map +1 -1
- package/dist/routes/activity/index.js +1 -3
- package/dist/routes/activity/index.js.map +1 -1
- package/dist/routes/chat/index.d.ts +2 -21
- package/dist/routes/chat/index.d.ts.map +1 -1
- package/dist/routes/chat/index.js +4 -2
- package/dist/routes/chat/index.js.map +1 -1
- package/dist/routes/data-collection/index.d.ts.map +1 -1
- package/dist/routes/data-collection/index.js +1 -3
- package/dist/routes/data-collection/index.js.map +1 -1
- package/dist/routes/data-explorer/components/DataExplorerLayout.d.ts.map +1 -1
- package/dist/routes/data-explorer/components/DataExplorerLayout.js +1 -3
- package/dist/routes/data-explorer/components/DataExplorerLayout.js.map +1 -1
- package/dist/routes/data-explorer/components/class-detail/UsedByRules.js +2 -2
- package/dist/routes/data-explorer/components/class-detail/UsedByRules.js.map +1 -1
- package/dist/routes/datastores/index.d.ts.map +1 -1
- package/dist/routes/datastores/index.js +2 -2
- package/dist/routes/datastores/index.js.map +1 -1
- package/dist/routes/explain/index.d.ts.map +1 -1
- package/dist/routes/explain/index.js +1 -3
- package/dist/routes/explain/index.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/DashConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/DashConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/DashConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/GoogleMerchantCenterConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/GoogleMerchantCenterConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/GoogleMerchantCenterConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.d.ts +0 -1
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.js +3 -2
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/MicrosoftAdsConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/MicrosoftAdsConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/MicrosoftAdsConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.d.ts +0 -1
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.js +4 -3
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.js.map +1 -1
- package/dist/routes/integrations/types.d.ts +2 -1
- package/dist/routes/integrations/types.d.ts.map +1 -1
- package/dist/routes/integrations/types.js +16 -0
- package/dist/routes/integrations/types.js.map +1 -1
- package/dist/routes/memories/components/DateValueInput.d.ts +16 -0
- package/dist/routes/memories/components/DateValueInput.d.ts.map +1 -0
- package/dist/routes/memories/components/DateValueInput.js +35 -0
- package/dist/routes/memories/components/DateValueInput.js.map +1 -0
- package/dist/routes/memories/components/EntityValuePicker.d.ts +11 -0
- package/dist/routes/memories/components/EntityValuePicker.d.ts.map +1 -0
- package/dist/routes/memories/components/EntityValuePicker.js +61 -0
- package/dist/routes/memories/components/EntityValuePicker.js.map +1 -0
- package/dist/routes/memories/components/FieldLabel.d.ts +12 -0
- package/dist/routes/memories/components/FieldLabel.d.ts.map +1 -0
- package/dist/routes/memories/components/FieldLabel.js +12 -0
- package/dist/routes/memories/components/FieldLabel.js.map +1 -0
- package/dist/routes/memories/components/ImportanceSlider.d.ts +2 -0
- package/dist/routes/memories/components/ImportanceSlider.d.ts.map +1 -1
- package/dist/routes/memories/components/ImportanceSlider.js +4 -1
- package/dist/routes/memories/components/ImportanceSlider.js.map +1 -1
- package/dist/routes/memories/components/MemoriesFilters.d.ts +2 -2
- package/dist/routes/memories/components/MemoriesFilters.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoriesFilters.js.map +1 -1
- package/dist/routes/memories/components/MemoriesPanel.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoriesPanel.js +4 -0
- package/dist/routes/memories/components/MemoriesPanel.js.map +1 -1
- package/dist/routes/memories/components/MemoriesTabPanel.d.ts +2 -2
- package/dist/routes/memories/components/MemoriesTabPanel.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryActions.d.ts +2 -0
- package/dist/routes/memories/components/MemoryActions.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryActions.js +3 -3
- package/dist/routes/memories/components/MemoryActions.js.map +1 -1
- package/dist/routes/memories/components/MemoryFields.d.ts +15 -3
- package/dist/routes/memories/components/MemoryFields.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryFields.js +34 -5
- package/dist/routes/memories/components/MemoryFields.js.map +1 -1
- package/dist/routes/memories/components/MemoryFormDialog.d.ts +6 -3
- package/dist/routes/memories/components/MemoryFormDialog.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryFormDialog.js +105 -59
- package/dist/routes/memories/components/MemoryFormDialog.js.map +1 -1
- package/dist/routes/memories/components/MemoryPropertyFields.d.ts +10 -0
- package/dist/routes/memories/components/MemoryPropertyFields.d.ts.map +1 -0
- package/dist/routes/memories/components/MemoryPropertyFields.js +67 -0
- package/dist/routes/memories/components/MemoryPropertyFields.js.map +1 -0
- package/dist/routes/memories/components/RuleDraftDialog.d.ts +7 -0
- package/dist/routes/memories/components/RuleDraftDialog.d.ts.map +1 -0
- package/dist/routes/memories/components/RuleDraftDialog.js +20 -0
- package/dist/routes/memories/components/RuleDraftDialog.js.map +1 -0
- package/dist/routes/memories/components/SchemasTab.d.ts +17 -2
- package/dist/routes/memories/components/SchemasTab.d.ts.map +1 -1
- package/dist/routes/memories/components/SchemasTab.js +146 -28
- package/dist/routes/memories/components/SchemasTab.js.map +1 -1
- package/dist/routes/memories/components/badges.d.ts +7 -0
- package/dist/routes/memories/components/badges.d.ts.map +1 -1
- package/dist/routes/memories/components/badges.js +11 -3
- package/dist/routes/memories/components/badges.js.map +1 -1
- package/dist/routes/memories/hooks/useMemoryColumns.d.ts +4 -2
- package/dist/routes/memories/hooks/useMemoryColumns.d.ts.map +1 -1
- package/dist/routes/memories/hooks/useMemoryColumns.js +31 -15
- package/dist/routes/memories/hooks/useMemoryColumns.js.map +1 -1
- package/dist/routes/memories/index.d.ts +2 -1
- package/dist/routes/memories/index.d.ts.map +1 -1
- package/dist/routes/memories/index.js +72 -30
- package/dist/routes/memories/index.js.map +1 -1
- package/dist/routes/memories/memory-mutation-input.d.ts.map +1 -1
- package/dist/routes/memories/memory-mutation-input.js +5 -2
- package/dist/routes/memories/memory-mutation-input.js.map +1 -1
- package/dist/routes/memories/memory-property-values.d.ts +13 -0
- package/dist/routes/memories/memory-property-values.d.ts.map +1 -0
- package/dist/routes/memories/memory-property-values.js +40 -0
- package/dist/routes/memories/memory-property-values.js.map +1 -0
- package/dist/routes/memories/schemas/AllowedValuesField.d.ts +14 -0
- package/dist/routes/memories/schemas/AllowedValuesField.d.ts.map +1 -0
- package/dist/routes/memories/schemas/AllowedValuesField.js +64 -0
- package/dist/routes/memories/schemas/AllowedValuesField.js.map +1 -0
- package/dist/routes/memories/schemas/MemorySchemaPage.d.ts +127 -0
- package/dist/routes/memories/schemas/MemorySchemaPage.d.ts.map +1 -0
- package/dist/routes/memories/schemas/MemorySchemaPage.js +285 -0
- package/dist/routes/memories/schemas/MemorySchemaPage.js.map +1 -0
- package/dist/routes/memories/schemas/SchemaChangeReviewDialog.d.ts +20 -0
- package/dist/routes/memories/schemas/SchemaChangeReviewDialog.d.ts.map +1 -0
- package/dist/routes/memories/schemas/SchemaChangeReviewDialog.js +54 -0
- package/dist/routes/memories/schemas/SchemaChangeReviewDialog.js.map +1 -0
- package/dist/routes/memories/schemas/SchemaConfirmDialog.d.ts +15 -0
- package/dist/routes/memories/schemas/SchemaConfirmDialog.d.ts.map +1 -0
- package/dist/routes/memories/schemas/SchemaConfirmDialog.js +8 -0
- package/dist/routes/memories/schemas/SchemaConfirmDialog.js.map +1 -0
- package/dist/routes/memories/schemas/SchemaDetailPage.d.ts +15 -0
- package/dist/routes/memories/schemas/SchemaDetailPage.d.ts.map +1 -0
- package/dist/routes/memories/schemas/SchemaDetailPage.js +74 -0
- package/dist/routes/memories/schemas/SchemaDetailPage.js.map +1 -0
- package/dist/routes/memories/schemas/SchemaEditorForm.d.ts +10 -0
- package/dist/routes/memories/schemas/SchemaEditorForm.d.ts.map +1 -0
- package/dist/routes/memories/schemas/SchemaEditorForm.js +242 -0
- package/dist/routes/memories/schemas/SchemaEditorForm.js.map +1 -0
- package/dist/routes/memories/schemas/SchemaTemplatesDialog.d.ts +13 -0
- package/dist/routes/memories/schemas/SchemaTemplatesDialog.d.ts.map +1 -0
- package/dist/routes/memories/schemas/SchemaTemplatesDialog.js +13 -0
- package/dist/routes/memories/schemas/SchemaTemplatesDialog.js.map +1 -0
- package/dist/routes/memories/schemas/ValueTypeSelect.d.ts +12 -0
- package/dist/routes/memories/schemas/ValueTypeSelect.d.ts.map +1 -0
- package/dist/routes/memories/schemas/ValueTypeSelect.js +10 -0
- package/dist/routes/memories/schemas/ValueTypeSelect.js.map +1 -0
- package/dist/routes/memories/schemas/schema-form.d.ts +72 -0
- package/dist/routes/memories/schemas/schema-form.d.ts.map +1 -0
- package/dist/routes/memories/schemas/schema-form.js +279 -0
- package/dist/routes/memories/schemas/schema-form.js.map +1 -0
- package/dist/routes/memories/schemas/schema-impact.d.ts +13 -0
- package/dist/routes/memories/schemas/schema-impact.d.ts.map +1 -0
- package/dist/routes/memories/schemas/schema-impact.js +40 -0
- package/dist/routes/memories/schemas/schema-impact.js.map +1 -0
- package/dist/routes/memories/schemas/schema-route.d.ts +18 -0
- package/dist/routes/memories/schemas/schema-route.d.ts.map +1 -0
- package/dist/routes/memories/schemas/schema-route.js +21 -0
- package/dist/routes/memories/schemas/schema-route.js.map +1 -0
- package/dist/routes/memories/schemas/schema-rule-context.d.ts +17 -0
- package/dist/routes/memories/schemas/schema-rule-context.d.ts.map +1 -0
- package/dist/routes/memories/schemas/schema-rule-context.js +83 -0
- package/dist/routes/memories/schemas/schema-rule-context.js.map +1 -0
- package/dist/routes/memories/schemas/schema-table.d.ts +11 -0
- package/dist/routes/memories/schemas/schema-table.d.ts.map +1 -0
- package/dist/routes/memories/schemas/schema-table.js +34 -0
- package/dist/routes/memories/schemas/schema-table.js.map +1 -0
- package/dist/routes/memories/schemas/useMemorySchemaMutations.d.ts +32 -0
- package/dist/routes/memories/schemas/useMemorySchemaMutations.d.ts.map +1 -0
- package/dist/routes/memories/schemas/useMemorySchemaMutations.js +31 -0
- package/dist/routes/memories/schemas/useMemorySchemaMutations.js.map +1 -0
- package/dist/routes/memories/schemas/useSchemaChangeReview.d.ts +51 -0
- package/dist/routes/memories/schemas/useSchemaChangeReview.d.ts.map +1 -0
- package/dist/routes/memories/schemas/useSchemaChangeReview.js +175 -0
- package/dist/routes/memories/schemas/useSchemaChangeReview.js.map +1 -0
- package/dist/routes/memories/schemas/useSchemaLifecycle.d.ts +46 -0
- package/dist/routes/memories/schemas/useSchemaLifecycle.d.ts.map +1 -0
- package/dist/routes/memories/schemas/useSchemaLifecycle.js +93 -0
- package/dist/routes/memories/schemas/useSchemaLifecycle.js.map +1 -0
- package/dist/routes/memories/schemas/useSchemasTab.d.ts +18 -0
- package/dist/routes/memories/schemas/useSchemasTab.d.ts.map +1 -0
- package/dist/routes/memories/schemas/useSchemasTab.js +92 -0
- package/dist/routes/memories/schemas/useSchemasTab.js.map +1 -0
- package/dist/routes/plans/index.d.ts.map +1 -1
- package/dist/routes/plans/index.js +2 -2
- package/dist/routes/plans/index.js.map +1 -1
- package/dist/routes/rules/components/CreateRuleChatModal.d.ts +7 -1
- package/dist/routes/rules/components/CreateRuleChatModal.d.ts.map +1 -1
- package/dist/routes/rules/components/CreateRuleChatModal.js +9 -4
- package/dist/routes/rules/components/CreateRuleChatModal.js.map +1 -1
- package/dist/routes/rules/components/RuleValueControls.d.ts.map +1 -1
- package/dist/routes/rules/components/RuleValueControls.js +3 -24
- package/dist/routes/rules/components/RuleValueControls.js.map +1 -1
- package/dist/routes/rules/components/rule-value-input.d.ts +11 -0
- package/dist/routes/rules/components/rule-value-input.d.ts.map +1 -0
- package/dist/routes/rules/components/rule-value-input.js +24 -0
- package/dist/routes/rules/components/rule-value-input.js.map +1 -0
- package/dist/routes/rules/components/rules.utils.d.ts +5 -0
- package/dist/routes/rules/components/rules.utils.d.ts.map +1 -1
- package/dist/routes/rules/components/rules.utils.js +18 -3
- package/dist/routes/rules/components/rules.utils.js.map +1 -1
- package/dist/routes/rules/pages.d.ts +1 -1
- package/dist/routes/rules/pages.d.ts.map +1 -1
- package/dist/routes/rules/pages.js +1 -1
- package/dist/routes/rules/pages.js.map +1 -1
- package/dist/shared/graph-derived-queries.d.ts.map +1 -1
- package/dist/shared/graph-derived-queries.js +4 -1
- package/dist/shared/graph-derived-queries.js.map +1 -1
- package/dist/worker/index.d.ts +22 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +110 -0
- package/dist/worker/index.js.map +1 -0
- package/dist/worker/policy.d.ts +21 -0
- package/dist/worker/policy.d.ts.map +1 -0
- package/dist/worker/policy.js +42 -0
- package/dist/worker/policy.js.map +1 -0
- package/dist/worker/proxy.d.ts +14 -0
- package/dist/worker/proxy.d.ts.map +1 -0
- package/dist/worker/proxy.js +58 -0
- package/dist/worker/proxy.js.map +1 -0
- package/dist/worker/session.d.ts +24 -0
- package/dist/worker/session.d.ts.map +1 -0
- package/dist/worker/session.js +72 -0
- package/dist/worker/session.js.map +1 -0
- package/package.json +52 -7
- package/src/app-subpaths.json +9 -1
- package/src/components/AppErrorBoundary.tsx +14 -11
- package/src/components/app-gate/AppGate.tsx +122 -0
- package/src/components/app-gate/AwaitingDatastoreStatus.tsx +35 -0
- package/src/components/app-gate/EnterDatastoreRoute.tsx +30 -0
- package/src/components/app-gate/ErrorRoute.tsx +43 -0
- package/src/components/app-gate/FailureAlert.tsx +15 -0
- package/src/components/app-gate/NoDatastoreAccess.tsx +26 -0
- package/src/components/app-gate/NotFoundRoute.tsx +20 -0
- package/src/components/app-gate/PendingInvitations.tsx +134 -0
- package/src/components/app-gate/ServiceError.tsx +27 -0
- package/src/components/app-gate/index.ts +2 -0
- package/src/components/app-gate/sdk-route-elements.tsx +46 -0
- package/src/components/app-shell/AppShell.tsx +22 -0
- package/src/components/app-shell/AppShellRoutes.tsx +34 -0
- package/src/components/app-shell/GroupDatastores.tsx +28 -0
- package/src/components/app-shell/GroupRoute.tsx +34 -0
- package/src/components/app-shell/index.ts +2 -0
- package/src/components/authenticated-chat/index.tsx +1 -34
- package/src/components/chat-view/Chat.tsx +9 -3
- package/src/components/chat-view/MessageItem.tsx +10 -2
- package/src/components/chat-view/tool-part-rendering.ts +10 -1
- package/src/components/chip/index.tsx +8 -1
- package/src/components/embedded-chat/index.tsx +2 -1
- package/src/components/input/input-date-time.tsx +10 -3
- package/src/components/input/input-date.tsx +93 -21
- package/src/components/input/input-time.tsx +59 -26
- package/src/components/layouts/RouteLayout.tsx +11 -50
- package/src/components/layouts/Sidebar.tsx +21 -23
- package/src/components/plan-limits/PlanLimitsDialog.tsx +331 -0
- package/src/components/plan-limits/index.tsx +3 -0
- package/src/components/plan-limits/plan-limits-client.ts +71 -0
- package/src/components/plan-limits/plan-limits-model.ts +180 -0
- package/src/components/plan-limits/plan-limits-save.ts +68 -0
- package/src/components/planning/PlanLimitsAction.tsx +44 -0
- package/src/components/slider/index.tsx +2 -1
- package/src/datastore-picker/datastore-picker-rows.ts +36 -20
- package/src/hooks/use-action-plans-list.ts +20 -12
- package/src/hooks/use-activity-feed.ts +30 -14
- package/src/hooks/use-entity.ts +11 -6
- package/src/hooks/use-manual-actions.ts +11 -6
- package/src/hooks/use-unsaved-changes-warning.ts +12 -0
- package/src/hooks/useAuth.ts +5 -3
- package/src/hooks/useChatPanelSync.ts +2 -3
- package/src/hooks/useDatastoreSelection.ts +10 -4
- package/src/hooks/useExecuteAction.ts +2 -0
- package/src/hooks/useLoginRedirect.ts +66 -0
- package/src/hooks/usePlanLimits.ts +97 -0
- package/src/ldo-ui.ts +1 -0
- package/src/lib/app-tools.ts +63 -0
- package/src/lib/chat-types.ts +5 -0
- package/src/lib/datastore-route-table.ts +9 -0
- package/src/lib/graphql-error.ts +7 -0
- package/src/lib/update-notice.ts +12 -2
- package/src/providers/ActiveChatProvider.tsx +8 -3
- package/src/providers/ActiveDatastoreProvider.tsx +179 -9
- package/src/providers/AuthContext.ts +1 -0
- package/src/providers/KnowledgeGraphStateContext.ts +2 -2
- package/src/providers/KnowledgeGraphStateProvider.tsx +13 -65
- package/src/providers/MantaClientProvider.tsx +8 -3
- package/src/providers/index.tsx +7 -4
- package/src/routes/activity/detail/ActivityDetailRoute.tsx +1 -10
- package/src/routes/activity/index.tsx +1 -10
- package/src/routes/chat/index.tsx +11 -47
- package/src/routes/data-collection/index.tsx +1 -11
- package/src/routes/data-explorer/components/DataExplorerLayout.tsx +1 -11
- package/src/routes/data-explorer/components/class-detail/UsedByRules.tsx +2 -2
- package/src/routes/datastores/index.tsx +3 -9
- package/src/routes/explain/index.tsx +1 -11
- package/src/routes/integrations/components/connect-forms/DashConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/GoogleAdsConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/GoogleMerchantCenterConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/InferalCredentialConnectForm.tsx +5 -3
- package/src/routes/integrations/components/connect-forms/KlaviyoConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/MicrosoftAdsConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/OAuthSetupConnectForm.tsx +7 -7
- package/src/routes/integrations/components/connect-forms/TriplewhaleConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/WoocommerceConnectForm.tsx +0 -1
- package/src/routes/integrations/types.ts +22 -6
- package/src/routes/memories/components/DateValueInput.tsx +72 -0
- package/src/routes/memories/components/EntityValuePicker.tsx +132 -0
- package/src/routes/memories/components/FieldLabel.tsx +49 -0
- package/src/routes/memories/components/ImportanceSlider.tsx +5 -1
- package/src/routes/memories/components/MemoriesFilters.tsx +2 -2
- package/src/routes/memories/components/MemoriesPanel.tsx +7 -3
- package/src/routes/memories/components/MemoriesTabPanel.tsx +2 -2
- package/src/routes/memories/components/MemoryActions.tsx +26 -2
- package/src/routes/memories/components/MemoryFields.tsx +75 -12
- package/src/routes/memories/components/MemoryFormDialog.tsx +305 -199
- package/src/routes/memories/components/MemoryPropertyFields.tsx +288 -0
- package/src/routes/memories/components/RuleDraftDialog.tsx +35 -0
- package/src/routes/memories/components/SchemasTab.tsx +481 -118
- package/src/routes/memories/components/badges.tsx +16 -4
- package/src/routes/memories/hooks/useMemoryColumns.tsx +69 -35
- package/src/routes/memories/index.tsx +125 -51
- package/src/routes/memories/memory-mutation-input.ts +5 -2
- package/src/routes/memories/memory-property-values.ts +83 -0
- package/src/routes/memories/schemas/AllowedValuesField.tsx +188 -0
- package/src/routes/memories/schemas/MemorySchemaPage.tsx +476 -0
- package/src/routes/memories/schemas/SchemaChangeReviewDialog.tsx +290 -0
- package/src/routes/memories/schemas/SchemaConfirmDialog.tsx +62 -0
- package/src/routes/memories/schemas/SchemaDetailPage.tsx +373 -0
- package/src/routes/memories/schemas/SchemaEditorForm.tsx +990 -0
- package/src/routes/memories/schemas/SchemaTemplatesDialog.tsx +81 -0
- package/src/routes/memories/schemas/ValueTypeSelect.tsx +37 -0
- package/src/routes/memories/schemas/schema-form.ts +360 -0
- package/src/routes/memories/schemas/schema-impact.ts +66 -0
- package/src/routes/memories/schemas/schema-route.ts +30 -0
- package/src/routes/memories/schemas/schema-rule-context.ts +103 -0
- package/src/routes/memories/schemas/schema-table.ts +54 -0
- package/src/routes/memories/schemas/useMemorySchemaMutations.ts +49 -0
- package/src/routes/memories/schemas/useSchemaChangeReview.ts +238 -0
- package/src/routes/memories/schemas/useSchemaLifecycle.tsx +151 -0
- package/src/routes/memories/schemas/useSchemasTab.ts +119 -0
- package/src/routes/plans/index.tsx +3 -14
- package/src/routes/rules/components/CreateRuleChatModal.tsx +46 -22
- package/src/routes/rules/components/RuleValueControls.tsx +3 -35
- package/src/routes/rules/components/rule-value-input.ts +34 -0
- package/src/routes/rules/components/rules.utils.ts +25 -3
- package/src/routes/rules/pages.ts +5 -1
- package/src/shared/graph-derived-queries.ts +6 -0
- package/src/themes/manta-dark.css +4 -0
- package/src/worker/index.ts +175 -0
- package/src/worker/policy.ts +62 -0
- package/src/worker/proxy.ts +101 -0
- package/src/worker/session.ts +111 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { AITool, OnToolCallCallback } from "@cloudflare/think/react";
|
|
2
|
+
import { requestUserInputToolName } from "@manta-eu/client/shared/questionnaire";
|
|
3
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
4
|
+
|
|
5
|
+
/** A tool the host app lends the agent. It runs in the browser, with the app's own access. */
|
|
6
|
+
export type AppTool<Input = never, Output = unknown> = Required<
|
|
7
|
+
Pick<AITool<Input, Output>, "description" | "parameters">
|
|
8
|
+
> & {
|
|
9
|
+
execute: (input: Input) => Output | Promise<Output>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// oxlint-disable-next-line typescript/no-explicit-any -- each tool narrows its own input
|
|
13
|
+
export type AppTools = Record<string, AppTool<any>>;
|
|
14
|
+
|
|
15
|
+
type AppToolChatOptions = { tools?: AppTools; onToolCall?: OnToolCallCallback; body?: { clientTools: [] } };
|
|
16
|
+
|
|
17
|
+
type AppToolCallEvent = Parameters<OnToolCallCallback>[0];
|
|
18
|
+
|
|
19
|
+
// The pattern the model providers accept for a tool name.
|
|
20
|
+
const validToolName = /^[a-zA-Z0-9_-]{1,64}$/;
|
|
21
|
+
|
|
22
|
+
// The chat runs onToolCall for the agent's own tool calls too, so an app tool must not share a name with one.
|
|
23
|
+
const reservedToolNames = new Set([requestUserInputToolName]);
|
|
24
|
+
|
|
25
|
+
export function appToolChatOptions(appTools: AppTools | undefined): AppToolChatOptions {
|
|
26
|
+
// Think keeps the last tools a chat sent until a request sends an empty list.
|
|
27
|
+
if (!isPresent(appTools)) return { body: { clientTools: [] } };
|
|
28
|
+
|
|
29
|
+
refuseInvalidToolNames(appTools);
|
|
30
|
+
return { tools: appTools, onToolCall: (event) => runAppToolCall(appTools, event) };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export async function runAppToolCall(appTools: AppTools, event: AppToolCallEvent): Promise<void> {
|
|
34
|
+
const { toolCall, addToolOutput } = event;
|
|
35
|
+
const tool = appToolNamed(appTools, toolCall.toolName);
|
|
36
|
+
if (!isPresent(tool)) return;
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
addToolOutput({ toolCallId: toolCall.toolCallId, output: await tool.execute(toolCall.input as never) });
|
|
40
|
+
} catch (error) {
|
|
41
|
+
// An "output-error" result ends the turn, so the agent gets the error as a normal output and can continue.
|
|
42
|
+
const errorText = error instanceof Error ? error.message : String(error);
|
|
43
|
+
addToolOutput({ toolCallId: toolCall.toolCallId, output: { error: errorText } });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function refuseInvalidToolNames(appTools: AppTools): void {
|
|
48
|
+
const names = Object.keys(appTools);
|
|
49
|
+
|
|
50
|
+
const invalid = names.find((name) => !validToolName.test(name));
|
|
51
|
+
if (invalid !== undefined) {
|
|
52
|
+
throw new Error(`The app tool name "${invalid}" is not valid. Use 1 to 64 letters, digits, underscores or dashes.`);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const reserved = names.find((name) => reservedToolNames.has(name));
|
|
56
|
+
if (reserved !== undefined) {
|
|
57
|
+
throw new Error(`The app tool name "${reserved}" is reserved for the agent's own tool.`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function appToolNamed(appTools: AppTools, name: string): AppTools[string] | undefined {
|
|
62
|
+
return Object.hasOwn(appTools, name) ? appTools[name] : undefined;
|
|
63
|
+
}
|
package/src/lib/chat-types.ts
CHANGED
|
@@ -19,6 +19,10 @@ import type { PageContext } from "@manta-eu/client/shared/page-context";
|
|
|
19
19
|
|
|
20
20
|
export type { PageContext };
|
|
21
21
|
|
|
22
|
+
import type { AppTool, AppTools } from "#lib/app-tools";
|
|
23
|
+
|
|
24
|
+
export type { AppTool, AppTools };
|
|
25
|
+
|
|
22
26
|
export type CopilotMenuDefaults = {
|
|
23
27
|
openInManta: ReactNode | null;
|
|
24
28
|
debugMessages: ReactNode | null;
|
|
@@ -55,6 +59,7 @@ export type AuthenticatedChatProps = {
|
|
|
55
59
|
collapsible?: boolean;
|
|
56
60
|
isCollapsed?: boolean;
|
|
57
61
|
pageContext?: PageContext;
|
|
62
|
+
appTools?: AppTools;
|
|
58
63
|
mode?: ConversationMode;
|
|
59
64
|
allowedModels?: MantaModelId[];
|
|
60
65
|
initialPrompt?: string;
|
|
@@ -11,10 +11,13 @@ export type RouteElements = {
|
|
|
11
11
|
Explain?: ReactNode;
|
|
12
12
|
Streams?: ReactNode;
|
|
13
13
|
Datastores?: ReactNode;
|
|
14
|
+
Group?: ReactNode;
|
|
14
15
|
Memories?: ReactNode;
|
|
15
16
|
Activity?: ReactNode;
|
|
16
17
|
ActivityDetail?: ReactNode;
|
|
17
18
|
Integrations?: ReactNode;
|
|
19
|
+
IntegrationsMcp?: ReactNode;
|
|
20
|
+
IntegrationsMcpServer?: ReactNode;
|
|
18
21
|
ShopifyConnect?: ReactNode;
|
|
19
22
|
Team?: ReactNode;
|
|
20
23
|
CustomApps?: ReactNode;
|
|
@@ -48,6 +51,7 @@ export const notFoundRoutePath = "*";
|
|
|
48
51
|
|
|
49
52
|
export const globalRoutes: RouteDefinition[] = [
|
|
50
53
|
{ path: "/datastores", render: (e) => e.Datastores || notFoundElement(e) },
|
|
54
|
+
{ path: "/g/:group", render: (e) => e.Group || notFoundElement(e) },
|
|
51
55
|
// Global, not datastore-scoped: Shopify sends the merchant here before any datastore is known.
|
|
52
56
|
{ path: "/shopify/connect", render: (e) => e.ShopifyConnect || notFoundElement(e) },
|
|
53
57
|
{ path: "/custom-apps", render: (e) => e.CustomApps || notFoundElement(e) },
|
|
@@ -64,9 +68,14 @@ export const datastoreRoutes: RouteDefinition[] = [
|
|
|
64
68
|
{ path: "/explain", render: (e) => e.Explain || e.Chat },
|
|
65
69
|
{ path: "/streams", render: (e) => e.Streams || notFoundElement(e) },
|
|
66
70
|
{ path: "/memories", render: (e) => e.Memories || e.Chat },
|
|
71
|
+
{ path: "/memories/schemas/new", render: (e) => e.Memories || e.Chat },
|
|
72
|
+
{ path: "/memories/schemas/:schemaName", render: (e) => e.Memories || e.Chat },
|
|
73
|
+
{ path: "/memories/schemas/:schemaName/edit", render: (e) => e.Memories || e.Chat },
|
|
67
74
|
{ path: "/activity", render: (e) => e.Activity || notFoundElement(e) },
|
|
68
75
|
{ path: "/activity/:id", render: (e) => e.ActivityDetail || notFoundElement(e) },
|
|
69
76
|
{ path: "/integrations", render: (e) => e.Integrations || e.Chat },
|
|
77
|
+
{ path: "/integrations/mcp", render: (e) => e.IntegrationsMcp || notFoundElement(e) },
|
|
78
|
+
{ path: "/integrations/mcp/:serverId", render: (e) => e.IntegrationsMcpServer || notFoundElement(e) },
|
|
70
79
|
{ path: "/team", render: (e) => e.Team || notFoundElement(e) },
|
|
71
80
|
{
|
|
72
81
|
path: "/data",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ClientError } from "graphql-request";
|
|
2
|
+
|
|
3
|
+
export function graphqlErrorMessage(error: unknown, fallback: string): string {
|
|
4
|
+
if (error instanceof ClientError) return error.response.errors?.[0]?.message ?? fallback;
|
|
5
|
+
|
|
6
|
+
return error instanceof Error ? error.message : fallback;
|
|
7
|
+
}
|
package/src/lib/update-notice.ts
CHANGED
|
@@ -22,6 +22,14 @@ export type Channel = "none" | "toast" | "screen";
|
|
|
22
22
|
|
|
23
23
|
let shown: Channel = "none";
|
|
24
24
|
|
|
25
|
+
const defaultAppName = "Manta";
|
|
26
|
+
|
|
27
|
+
let appName = defaultAppName;
|
|
28
|
+
|
|
29
|
+
export function updateNoticeAppName() {
|
|
30
|
+
return appName;
|
|
31
|
+
}
|
|
32
|
+
|
|
25
33
|
export function announceUpdate(channel: Exclude<Channel, "none">) {
|
|
26
34
|
if (channel === "screen") {
|
|
27
35
|
if (shown === "toast") toast.dismiss(noticeId);
|
|
@@ -35,7 +43,7 @@ export function announceUpdate(channel: Exclude<Channel, "none">) {
|
|
|
35
43
|
|
|
36
44
|
shown = "toast";
|
|
37
45
|
|
|
38
|
-
toast(
|
|
46
|
+
toast(`A new version of ${appName} is available`, {
|
|
39
47
|
id: noticeId,
|
|
40
48
|
description: "Parts of the app can't load until you reload the page.",
|
|
41
49
|
duration: Number.POSITIVE_INFINITY,
|
|
@@ -44,7 +52,9 @@ export function announceUpdate(channel: Exclude<Channel, "none">) {
|
|
|
44
52
|
});
|
|
45
53
|
}
|
|
46
54
|
|
|
47
|
-
export function installUpdateNotice() {
|
|
55
|
+
export function installUpdateNotice(name = defaultAppName) {
|
|
56
|
+
appName = name;
|
|
57
|
+
|
|
48
58
|
window.addEventListener("vite:preloadError", () => {
|
|
49
59
|
announceUpdate("toast");
|
|
50
60
|
});
|
|
@@ -12,6 +12,7 @@ import { createChatReconnectRecoveryTracker } from "./chat-reconnect-recovery";
|
|
|
12
12
|
import { useChatSocketAuth, useChatTokenRefresh } from "./chat-socket-auth";
|
|
13
13
|
import { prepareThinkChatSendRequest } from "./think-chat-request";
|
|
14
14
|
import { useGraphRefreshAfterTurn } from "#hooks/use-graph-refresh-after-turn";
|
|
15
|
+
import { appToolChatOptions, type AppTools } from "#lib/app-tools";
|
|
15
16
|
|
|
16
17
|
export type { ActiveChatConnectionState } from "./chat-connection-lifecycle";
|
|
17
18
|
|
|
@@ -29,8 +30,8 @@ export function useActiveChatConnection(): ActiveChatConnectionContextValue | un
|
|
|
29
30
|
return useContext(ActiveChatConnectionContext);
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
export function ActiveChatProvider(props: { children: ReactNode }) {
|
|
33
|
-
const { children } = props;
|
|
33
|
+
export function ActiveChatProvider(props: { appTools?: AppTools; children: ReactNode }) {
|
|
34
|
+
const { appTools, children } = props;
|
|
34
35
|
const { session } = useChatManagerContext();
|
|
35
36
|
const recoveredResponsesRef = useRef(new Set<string>());
|
|
36
37
|
const [sessionGeneration, setSessionGeneration] = useState(0);
|
|
@@ -58,6 +59,7 @@ export function ActiveChatProvider(props: { children: ReactNode }) {
|
|
|
58
59
|
key={`${session.activeConversationId}:${sessionGeneration}`}
|
|
59
60
|
conversationId={session.activeConversationId}
|
|
60
61
|
session={session}
|
|
62
|
+
appTools={appTools}
|
|
61
63
|
onStaleTerminalResponse={recoverStaleTerminalResponse}
|
|
62
64
|
>
|
|
63
65
|
{children}
|
|
@@ -68,12 +70,13 @@ export function ActiveChatProvider(props: { children: ReactNode }) {
|
|
|
68
70
|
type ThinkChatSessionProps = {
|
|
69
71
|
conversationId: string;
|
|
70
72
|
session: ThinkChatSessionConfig;
|
|
73
|
+
appTools: AppTools | undefined;
|
|
71
74
|
onStaleTerminalResponse: (assistantMessageId: string) => void;
|
|
72
75
|
children: ReactNode;
|
|
73
76
|
};
|
|
74
77
|
|
|
75
78
|
function ThinkChatSession(props: ThinkChatSessionProps) {
|
|
76
|
-
const { conversationId, session, onStaleTerminalResponse, children } = props;
|
|
79
|
+
const { conversationId, session, appTools, onStaleTerminalResponse, children } = props;
|
|
77
80
|
const { host, datastoreQuery, messageHandoff, consumeMessageHandoff } = session;
|
|
78
81
|
const wasCompactingRef = useRef(false);
|
|
79
82
|
const sentHandoffMessageIdRef = useRef<string | undefined>(undefined);
|
|
@@ -117,12 +120,14 @@ function ThinkChatSession(props: ThinkChatSessionProps) {
|
|
|
117
120
|
});
|
|
118
121
|
useChatTokenRefresh(childAgent);
|
|
119
122
|
|
|
123
|
+
const appToolOptions = useMemo(() => appToolChatOptions(appTools), [appTools]);
|
|
120
124
|
const chatData = useAgentChat<ThinkChatState, ChatUIMessage>({
|
|
121
125
|
agent: childAgent,
|
|
122
126
|
credentials: socketAuth.credentials,
|
|
123
127
|
getInitialMessages: null,
|
|
124
128
|
prepareSendMessagesRequest: prepareThinkChatSendRequest,
|
|
125
129
|
resume: true,
|
|
130
|
+
...appToolOptions,
|
|
126
131
|
});
|
|
127
132
|
|
|
128
133
|
useGraphRefreshAfterTurn(chatData.isStreaming);
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { datastoreBasename, parseDatastorePath, withDatastorePrefix } from "@manta-eu/client/shared/datastore-path";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
createContext,
|
|
4
|
+
use,
|
|
5
|
+
useCallback,
|
|
6
|
+
useEffect,
|
|
7
|
+
useLayoutEffect,
|
|
8
|
+
useMemo,
|
|
9
|
+
useRef,
|
|
10
|
+
useState,
|
|
11
|
+
type ReactNode,
|
|
12
|
+
} from "react";
|
|
3
13
|
import {
|
|
4
14
|
createPath,
|
|
15
|
+
NavigationType as NavigationAction,
|
|
5
16
|
Router,
|
|
6
17
|
UNSAFE_createBrowserHistory as createBrowserHistory,
|
|
7
18
|
useNavigate,
|
|
@@ -17,7 +28,31 @@ export type ActiveDatastoreState = {
|
|
|
17
28
|
navigateAbsolute: (path: string, options?: { replace?: boolean }) => void;
|
|
18
29
|
};
|
|
19
30
|
|
|
20
|
-
type
|
|
31
|
+
type BrowserHistory = ReturnType<typeof createBrowserHistory>;
|
|
32
|
+
|
|
33
|
+
type RouterState = { history: BrowserHistory; navigator: Navigator; action: NavigationType; location: Location };
|
|
34
|
+
|
|
35
|
+
type Navigator = Pick<BrowserHistory, "createHref" | "encodeLocation" | "go" | "push" | "replace">;
|
|
36
|
+
|
|
37
|
+
type NavigationGuard = {
|
|
38
|
+
hold: () => () => void;
|
|
39
|
+
pending: boolean;
|
|
40
|
+
proceed: () => void;
|
|
41
|
+
reset: () => void;
|
|
42
|
+
bypass: (navigation: () => void) => void;
|
|
43
|
+
confirmLeave: () => Promise<boolean>;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
type HeldNavigation = { resume: () => void; cancel?: () => void };
|
|
47
|
+
|
|
48
|
+
const NavigationGuardContext = createContext<NavigationGuard>({
|
|
49
|
+
hold: () => () => {},
|
|
50
|
+
pending: false,
|
|
51
|
+
proceed: () => {},
|
|
52
|
+
reset: () => {},
|
|
53
|
+
bypass: (navigation) => navigation(),
|
|
54
|
+
confirmLeave: async () => true,
|
|
55
|
+
});
|
|
21
56
|
|
|
22
57
|
const ActiveDatastoreContext = createContext<ActiveDatastoreState>({
|
|
23
58
|
datastoreId: undefined,
|
|
@@ -44,17 +79,124 @@ export function ActiveDatastoreProvider(props: ActiveDatastoreProviderProps) {
|
|
|
44
79
|
action: history.action,
|
|
45
80
|
location: history.location,
|
|
46
81
|
}));
|
|
82
|
+
const holds = useRef(0);
|
|
83
|
+
const bypassing = useRef(false);
|
|
84
|
+
const passingDelta = useRef<number | null>(null);
|
|
85
|
+
const revertingPop = useRef(false);
|
|
86
|
+
const heldRef = useRef<HeldNavigation | null>(null);
|
|
87
|
+
const [held, setHeld] = useState<HeldNavigation | null>(null);
|
|
88
|
+
|
|
89
|
+
const replaceHeld = useCallback((next: HeldNavigation | null) => {
|
|
90
|
+
const previous = heldRef.current;
|
|
91
|
+
heldRef.current = next;
|
|
92
|
+
setHeld(next);
|
|
93
|
+
return previous;
|
|
94
|
+
}, []);
|
|
95
|
+
|
|
96
|
+
const attempt = useCallback(
|
|
97
|
+
(navigation: () => void) => {
|
|
98
|
+
if (holds.current > 0 && !bypassing.current) replaceHeld({ resume: navigation })?.cancel?.();
|
|
99
|
+
else navigation();
|
|
100
|
+
},
|
|
101
|
+
[replaceHeld],
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
// A bypassed step lands on a later popstate, so the next update passes only if it moves by the same delta.
|
|
105
|
+
const step = useCallback(
|
|
106
|
+
(delta: number) => {
|
|
107
|
+
if (bypassing.current) passingDelta.current = delta;
|
|
108
|
+
history.go(delta);
|
|
109
|
+
},
|
|
110
|
+
[history],
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
// A back or forward step has already moved the URL, so a held one is stepped back first and replayed on proceed.
|
|
114
|
+
useLayoutEffect(
|
|
115
|
+
() =>
|
|
116
|
+
history.listen((update) => {
|
|
117
|
+
if (revertingPop.current) {
|
|
118
|
+
revertingPop.current = false;
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const passing = passingDelta.current;
|
|
122
|
+
passingDelta.current = null;
|
|
123
|
+
if (update.action === NavigationAction.Pop && holds.current > 0 && update.delta && update.delta !== passing) {
|
|
124
|
+
const { delta } = update;
|
|
125
|
+
revertingPop.current = true;
|
|
126
|
+
history.go(-delta);
|
|
127
|
+
replaceHeld({ resume: () => step(delta) })?.cancel?.();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
setRouterState(update);
|
|
131
|
+
}),
|
|
132
|
+
[history, replaceHeld, step],
|
|
133
|
+
);
|
|
47
134
|
|
|
48
|
-
|
|
135
|
+
const navigator = useMemo<Navigator>(
|
|
136
|
+
() => ({
|
|
137
|
+
createHref: history.createHref,
|
|
138
|
+
encodeLocation: history.encodeLocation,
|
|
139
|
+
go: (delta) => attempt(() => step(delta)),
|
|
140
|
+
push: (to, state) => attempt(() => history.push(to, state)),
|
|
141
|
+
replace: (to, state) => attempt(() => history.replace(to, state)),
|
|
142
|
+
}),
|
|
143
|
+
[history, attempt, step],
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
const bypass = useCallback((navigation: () => void) => {
|
|
147
|
+
bypassing.current = true;
|
|
148
|
+
try {
|
|
149
|
+
navigation();
|
|
150
|
+
} finally {
|
|
151
|
+
bypassing.current = false;
|
|
152
|
+
}
|
|
153
|
+
}, []);
|
|
154
|
+
|
|
155
|
+
// For a caller that must act before it navigates, such as switching the session's datastore.
|
|
156
|
+
const confirmLeave = useCallback(
|
|
157
|
+
() =>
|
|
158
|
+
holds.current > 0
|
|
159
|
+
? new Promise<boolean>((resolve) => {
|
|
160
|
+
replaceHeld({ resume: () => resolve(true), cancel: () => resolve(false) })?.cancel?.();
|
|
161
|
+
})
|
|
162
|
+
: Promise.resolve(true),
|
|
163
|
+
[replaceHeld],
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
// Once no page guards, nothing can proceed or reset a held navigation, so it is dropped and its caller hears no.
|
|
167
|
+
const hold = useCallback(() => {
|
|
168
|
+
holds.current += 1;
|
|
169
|
+
return () => {
|
|
170
|
+
holds.current -= 1;
|
|
171
|
+
if (holds.current === 0) replaceHeld(null)?.cancel?.();
|
|
172
|
+
};
|
|
173
|
+
}, [replaceHeld]);
|
|
174
|
+
|
|
175
|
+
const guard = useMemo<NavigationGuard>(
|
|
176
|
+
() => ({
|
|
177
|
+
hold,
|
|
178
|
+
pending: held !== null,
|
|
179
|
+
proceed: () => {
|
|
180
|
+
const current = replaceHeld(null);
|
|
181
|
+
if (current) bypass(current.resume);
|
|
182
|
+
},
|
|
183
|
+
reset: () => replaceHeld(null)?.cancel?.(),
|
|
184
|
+
bypass,
|
|
185
|
+
confirmLeave,
|
|
186
|
+
}),
|
|
187
|
+
[hold, held, bypass, confirmLeave, replaceHeld],
|
|
188
|
+
);
|
|
49
189
|
|
|
50
190
|
const moveTo = useCallback(
|
|
51
191
|
(target: string, replace: boolean) => {
|
|
52
192
|
if (createPath(history.location) === target) return;
|
|
53
193
|
|
|
54
|
-
|
|
55
|
-
|
|
194
|
+
attempt(() => {
|
|
195
|
+
if (replace) history.replace(target);
|
|
196
|
+
else history.push(target);
|
|
197
|
+
});
|
|
56
198
|
},
|
|
57
|
-
[history],
|
|
199
|
+
[history, attempt],
|
|
58
200
|
);
|
|
59
201
|
|
|
60
202
|
const enterDatastore = useCallback(
|
|
@@ -76,11 +218,13 @@ export function ActiveDatastoreProvider(props: ActiveDatastoreProviderProps) {
|
|
|
76
218
|
[datastoreId, enterDatastore, navigateAbsolute],
|
|
77
219
|
);
|
|
78
220
|
|
|
79
|
-
const routerState = useMemo(() => ({ history, action, location }), [history, action, location]);
|
|
221
|
+
const routerState = useMemo(() => ({ history, navigator, action, location }), [history, navigator, action, location]);
|
|
80
222
|
|
|
81
223
|
return (
|
|
82
224
|
<ActiveDatastoreContext.Provider value={value}>
|
|
83
|
-
<
|
|
225
|
+
<NavigationGuardContext.Provider value={guard}>
|
|
226
|
+
<RouterStateContext.Provider value={routerState}>{children}</RouterStateContext.Provider>
|
|
227
|
+
</NavigationGuardContext.Provider>
|
|
84
228
|
</ActiveDatastoreContext.Provider>
|
|
85
229
|
);
|
|
86
230
|
}
|
|
@@ -101,7 +245,7 @@ export function ActiveDatastoreRouter(props: ActiveDatastoreRouterProps) {
|
|
|
101
245
|
basename={basename}
|
|
102
246
|
location={routerState.location}
|
|
103
247
|
navigationType={routerState.action}
|
|
104
|
-
navigator={routerState.
|
|
248
|
+
navigator={routerState.navigator}
|
|
105
249
|
>
|
|
106
250
|
{children}
|
|
107
251
|
</Router>
|
|
@@ -121,3 +265,29 @@ export function useAbsoluteNavigate(): (path: string) => void {
|
|
|
121
265
|
[datastoreId, navigateAbsolute, navigate],
|
|
122
266
|
);
|
|
123
267
|
}
|
|
268
|
+
|
|
269
|
+
export type NavigationBlocker = {
|
|
270
|
+
blocked: boolean;
|
|
271
|
+
proceed: () => void;
|
|
272
|
+
reset: () => void;
|
|
273
|
+
bypass: (navigation: () => void) => void;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
export type LeaveConfirmation = {
|
|
277
|
+
confirmLeave: () => Promise<boolean>;
|
|
278
|
+
bypass: (navigation: () => void) => void;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
export function useLeaveConfirmation(): LeaveConfirmation {
|
|
282
|
+
const { confirmLeave, bypass } = use(NavigationGuardContext);
|
|
283
|
+
return useMemo(() => ({ confirmLeave, bypass }), [confirmLeave, bypass]);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export function useNavigationBlocker(when: boolean): NavigationBlocker {
|
|
287
|
+
const guard = use(NavigationGuardContext);
|
|
288
|
+
const { hold } = guard;
|
|
289
|
+
|
|
290
|
+
useEffect(() => (when ? hold() : undefined), [when, hold]);
|
|
291
|
+
|
|
292
|
+
return { blocked: guard.pending, proceed: guard.proceed, reset: guard.reset, bypass: guard.bypass };
|
|
293
|
+
}
|
|
@@ -18,6 +18,7 @@ export type AuthContextValue = Pick<
|
|
|
18
18
|
| "allowedModels"
|
|
19
19
|
> & {
|
|
20
20
|
user: User;
|
|
21
|
+
canManageDatastores?: boolean;
|
|
21
22
|
// Only Manta's own web app may list the apps connected to someone; any other host's token is refused.
|
|
22
23
|
canDisconnectCustomApps?: boolean;
|
|
23
24
|
hasProfilePage?: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GQLKnowledgeGraphStateQuery } from "@manta-eu/client";
|
|
2
2
|
import { createContext, use } from "react";
|
|
3
3
|
import type { KnowledgeGraphAvailability } from "./knowledge-graph-availability";
|
|
4
4
|
|
|
5
5
|
export const KnowledgeGraphStateContext = createContext<KnowledgeGraphStateContextValue | undefined>(undefined);
|
|
6
6
|
|
|
7
7
|
export type KnowledgeGraphStateContextValue = {
|
|
8
|
-
knowledgeGraphState:
|
|
8
|
+
knowledgeGraphState: GQLKnowledgeGraphStateQuery["knowledgeGraphState"] | null;
|
|
9
9
|
knowledgeGraphAvailability: KnowledgeGraphAvailability | null;
|
|
10
10
|
isKnowledgeGraphUnavailable: boolean;
|
|
11
11
|
isLoading: boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { GQLKnowledgeGraphCapacity } from "@manta-eu/client";
|
|
2
1
|
import { useBringDatastoreOnlineMutation, useKnowledgeGraphStateQuery } from "@manta-eu/client";
|
|
3
2
|
import { isPresent } from "@manta-eu/lib/present";
|
|
4
3
|
import { usePostHog } from "@posthog/react";
|
|
@@ -26,67 +25,16 @@ export function KnowledgeGraphStateProvider(props: KnowledgeGraphStateProviderPr
|
|
|
26
25
|
const reportedNotProvisionedDatastoreIds = useRef(new Set<string>());
|
|
27
26
|
|
|
28
27
|
const [previousDataVersion, setPreviousDataVersion] = useState<string>();
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// Keep dataVersion out of the key. It only lets the server skip the triple count, and with one cache
|
|
36
|
-
// entry per version the effect below can bounce between two cached answers forever.
|
|
37
|
-
queryKey: useKnowledgeGraphStateQuery.getKey(),
|
|
38
|
-
refetchInterval: pollIntervalMs,
|
|
39
|
-
refetchIntervalInBackground: false,
|
|
40
|
-
staleTime: 0,
|
|
41
|
-
},
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
const rawState = data?.knowledgeGraphState;
|
|
46
|
-
if (!rawState) return;
|
|
47
|
-
|
|
48
|
-
const isCachedResponse =
|
|
49
|
-
rawState.capacity.currentTriples === null &&
|
|
50
|
-
rawState.capacity.percentageFull === null &&
|
|
51
|
-
rawState.capacity.remainingCapacity === null &&
|
|
52
|
-
rawState.capacity.entitySummary === null &&
|
|
53
|
-
rawState.exists;
|
|
54
|
-
|
|
55
|
-
if (!isCachedResponse && (rawState.capacity.currentTriples !== null || !rawState.exists)) {
|
|
56
|
-
setCachedCapacity(rawState.capacity);
|
|
57
|
-
}
|
|
58
|
-
}, [data?.knowledgeGraphState]);
|
|
59
|
-
|
|
60
|
-
const enrichedKnowledgeGraphState = useMemo(() => {
|
|
61
|
-
const rawState = data?.knowledgeGraphState;
|
|
62
|
-
if (!rawState) return null;
|
|
63
|
-
|
|
64
|
-
const isCachedResponse =
|
|
65
|
-
rawState.capacity.currentTriples === null &&
|
|
66
|
-
rawState.capacity.percentageFull === null &&
|
|
67
|
-
rawState.capacity.remainingCapacity === null &&
|
|
68
|
-
rawState.capacity.entitySummary === null &&
|
|
69
|
-
rawState.exists;
|
|
70
|
-
|
|
71
|
-
if (isCachedResponse && cachedCapacity) {
|
|
72
|
-
return {
|
|
73
|
-
...rawState,
|
|
74
|
-
capacity: {
|
|
75
|
-
...rawState.capacity,
|
|
76
|
-
currentTriples: cachedCapacity.currentTriples,
|
|
77
|
-
percentageFull: cachedCapacity.percentageFull,
|
|
78
|
-
remainingCapacity: cachedCapacity.remainingCapacity,
|
|
79
|
-
entitySummary: cachedCapacity.entitySummary,
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
} else {
|
|
83
|
-
return rawState;
|
|
84
|
-
}
|
|
85
|
-
}, [data?.knowledgeGraphState, cachedCapacity]);
|
|
28
|
+
const { data, isLoading, error } = useKnowledgeGraphStateQuery(mantaClient, undefined, {
|
|
29
|
+
refetchInterval: pollIntervalMs,
|
|
30
|
+
refetchIntervalInBackground: false,
|
|
31
|
+
staleTime: 0,
|
|
32
|
+
});
|
|
33
|
+
const knowledgeGraphState = data?.knowledgeGraphState ?? null;
|
|
86
34
|
|
|
87
35
|
const knowledgeGraphAvailability = useMemo(
|
|
88
|
-
() => (
|
|
89
|
-
[
|
|
36
|
+
() => (knowledgeGraphState ? deriveAvailability(knowledgeGraphState) : null),
|
|
37
|
+
[knowledgeGraphState],
|
|
90
38
|
);
|
|
91
39
|
|
|
92
40
|
useEffect(
|
|
@@ -115,15 +63,15 @@ export function KnowledgeGraphStateProvider(props: KnowledgeGraphStateProviderPr
|
|
|
115
63
|
|
|
116
64
|
useEffect(
|
|
117
65
|
function bringOnline() {
|
|
118
|
-
if (!
|
|
66
|
+
if (!knowledgeGraphState?.exists || !knowledgeGraphState?.offline) return;
|
|
119
67
|
if (bringDataStoreOnline.isPending) return;
|
|
120
68
|
if (datastoreId && bringOnlineRefusedFor.current.has(datastoreId)) return;
|
|
121
69
|
|
|
122
70
|
bringDataStoreOnline.mutate({});
|
|
123
71
|
},
|
|
124
72
|
[
|
|
125
|
-
|
|
126
|
-
|
|
73
|
+
knowledgeGraphState?.exists,
|
|
74
|
+
knowledgeGraphState?.offline,
|
|
127
75
|
bringDataStoreOnline.isPending,
|
|
128
76
|
bringDataStoreOnline.mutate,
|
|
129
77
|
datastoreId,
|
|
@@ -146,13 +94,13 @@ export function KnowledgeGraphStateProvider(props: KnowledgeGraphStateProviderPr
|
|
|
146
94
|
|
|
147
95
|
const value = useMemo<KnowledgeGraphStateContextValue>(
|
|
148
96
|
() => ({
|
|
149
|
-
knowledgeGraphState
|
|
97
|
+
knowledgeGraphState,
|
|
150
98
|
knowledgeGraphAvailability,
|
|
151
99
|
isKnowledgeGraphUnavailable: isPresent(knowledgeGraphAvailability) && knowledgeGraphAvailability !== "online",
|
|
152
100
|
isLoading,
|
|
153
101
|
error: error as Error | null,
|
|
154
102
|
}),
|
|
155
|
-
[
|
|
103
|
+
[knowledgeGraphState, knowledgeGraphAvailability, isLoading, error],
|
|
156
104
|
);
|
|
157
105
|
|
|
158
106
|
return <KnowledgeGraphStateContext.Provider value={value}>{children}</KnowledgeGraphStateContext.Provider>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { bearerFetch, mantaGQLPath, mantaGraphQLClient, type AccessTokenSource } from "@manta-eu/client";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
datastoreHeader,
|
|
4
|
+
sparqlRoutePath,
|
|
5
|
+
uploadPartRoutePath,
|
|
6
|
+
withDatastorePrefix,
|
|
7
|
+
} from "@manta-eu/client/shared/datastore-path";
|
|
3
8
|
import { ontologyGraphIri as defaultOntologyGraphIri } from "@manta-eu/client/shared/rdf-namespaces";
|
|
4
9
|
import type { ReactNode } from "react";
|
|
5
10
|
import { use, useCallback, useMemo } from "react";
|
|
@@ -46,7 +51,7 @@ export function MantaClientProvider(props: MantaClientProviderProps) {
|
|
|
46
51
|
} = props;
|
|
47
52
|
|
|
48
53
|
const mantaBaseUrl = useMemo(() => new URL(mantaGQLPath, baseUrl), [baseUrl]);
|
|
49
|
-
const sparqlUrl = useMemo(() => new URL(
|
|
54
|
+
const sparqlUrl = useMemo(() => new URL(sparqlRoutePath, baseUrl), [baseUrl]);
|
|
50
55
|
const datastoreHeaders = useMemo(() => datastoreHeader(datastoreId), [datastoreId]);
|
|
51
56
|
const datastorePath = useCallback(
|
|
52
57
|
(path: string) => (datastoreId ? withDatastorePrefix(datastoreId, path) : path),
|
|
@@ -78,7 +83,7 @@ export function MantaClientProvider(props: MantaClientProviderProps) {
|
|
|
78
83
|
getAccessToken
|
|
79
84
|
? {
|
|
80
85
|
partUrl: (presignedUrl: string) => {
|
|
81
|
-
const url = new URL(datastorePath(
|
|
86
|
+
const url = new URL(datastorePath(uploadPartRoutePath), baseUrl);
|
|
82
87
|
url.searchParams.set("url", presignedUrl);
|
|
83
88
|
return url.toString();
|
|
84
89
|
},
|
package/src/providers/index.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { NuqsAdapter } from "nuqs/adapters/react-router/v7";
|
|
|
6
6
|
import type { ReactNode } from "react";
|
|
7
7
|
import { useState } from "react";
|
|
8
8
|
import { Link } from "react-router";
|
|
9
|
-
import { EntityLinkProvider, type EntityLinkProps } from "../graph/entity-link";
|
|
9
|
+
import { EntityLinkProvider, type EntityLinkComponent, type EntityLinkProps } from "../graph/entity-link";
|
|
10
10
|
import { ActiveDatastoreProvider, ActiveDatastoreRouter, useActiveDatastore } from "./ActiveDatastoreProvider";
|
|
11
11
|
import { GenerateStructuredDataProvider } from "./GenerateStructuredDataProvider";
|
|
12
12
|
import { KnowledgeGraphPollingProvider } from "./KnowledgeGraphPollingProvider";
|
|
@@ -40,6 +40,7 @@ export type ProvidersProps = {
|
|
|
40
40
|
getAccessToken?: AccessTokenSource;
|
|
41
41
|
/** What Log out does for a getAccessToken host; see MantaClientProvider. */
|
|
42
42
|
onSignOut?: () => void;
|
|
43
|
+
entityLink?: EntityLinkComponent;
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
// Each datastore gets its own cache, but passing through "no datastore" (the global picker) must not discard it.
|
|
@@ -103,7 +104,7 @@ function RecordEntityLink(props: EntityLinkProps) {
|
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
export function Providers(props: ProvidersProps) {
|
|
106
|
-
const { children, ...coreProps } = props;
|
|
107
|
+
const { children, entityLink = RecordEntityLink, ...coreProps } = props;
|
|
107
108
|
|
|
108
109
|
return (
|
|
109
110
|
<ActiveDatastoreProvider>
|
|
@@ -111,7 +112,7 @@ export function Providers(props: ProvidersProps) {
|
|
|
111
112
|
<CoreProviders {...coreProps}>
|
|
112
113
|
<ActiveDatastoreRouter>
|
|
113
114
|
<NuqsAdapter>
|
|
114
|
-
<EntityLinkProvider component={
|
|
115
|
+
<EntityLinkProvider component={entityLink}>{children}</EntityLinkProvider>
|
|
115
116
|
</NuqsAdapter>
|
|
116
117
|
</ActiveDatastoreRouter>
|
|
117
118
|
</CoreProviders>
|
|
@@ -120,7 +121,9 @@ export function Providers(props: ProvidersProps) {
|
|
|
120
121
|
);
|
|
121
122
|
}
|
|
122
123
|
|
|
123
|
-
export type EmbeddedChatProvidersProps = Omit<ProvidersProps, "mantaBaseUrl"> & {
|
|
124
|
+
export type EmbeddedChatProvidersProps = Omit<ProvidersProps, "mantaBaseUrl" | "entityLink"> & {
|
|
125
|
+
mantaBaseUrl?: string;
|
|
126
|
+
};
|
|
124
127
|
|
|
125
128
|
// IMPORTANT: Avoid redirects from embedded manta client
|
|
126
129
|
export function EmbeddedChatProviders(props: EmbeddedChatProvidersProps) {
|