@solidxai/core-ui 0.1.20 → 0.1.21-beta.2
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/dist/components/common/FileReaderExt.d.ts.map +1 -1
- package/dist/components/common/FileReaderExt.js +22 -11
- package/dist/components/common/FileReaderExt.js.map +1 -1
- package/dist/components/common/FileReaderExt.tsx +27 -14
- package/dist/components/common/SocialMediaLogin.d.ts.map +1 -1
- package/dist/components/common/SocialMediaLogin.js +1 -1
- package/dist/components/common/SocialMediaLogin.js.map +1 -1
- package/dist/components/common/SocialMediaLogin.tsx +50 -19
- package/dist/components/common/SolidPopupContainer.js +1 -1
- package/dist/components/common/SolidPopupContainer.js.map +1 -1
- package/dist/components/common/SolidPopupContainer.tsx +1 -1
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.d.ts +1 -0
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.d.ts.map +1 -1
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js +46 -19
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js.map +1 -1
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.tsx +69 -14
- package/dist/components/common/solid-export.css +75 -0
- package/dist/components/core/card/CardItem.d.ts.map +1 -1
- package/dist/components/core/card/CardItem.js +13 -2
- package/dist/components/core/card/CardItem.js.map +1 -1
- package/dist/components/core/card/CardItem.tsx +13 -2
- package/dist/components/core/card/SolidCardView.js +2 -2
- package/dist/components/core/card/SolidCardView.js.map +1 -1
- package/dist/components/core/card/SolidCardView.tsx +2 -2
- package/dist/components/core/chatter/SolidChatterAuditMessage.css +68 -0
- package/dist/components/core/chatter/SolidChatterAuditMessage.d.ts +1 -0
- package/dist/components/core/chatter/SolidChatterAuditMessage.d.ts.map +1 -1
- package/dist/components/core/chatter/SolidChatterAuditMessage.js +20 -2
- package/dist/components/core/chatter/SolidChatterAuditMessage.js.map +1 -1
- package/dist/components/core/chatter/SolidChatterAuditMessage.tsx +49 -12
- package/dist/components/core/common/SolidGenericImport/SolidImport.module.css +71 -0
- package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.js +83 -1
- package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.module.css +45 -1
- package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.tsx +106 -2
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionChatFormWidget.d.ts +3 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionChatFormWidget.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionChatFormWidget.js +163 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionChatFormWidget.js.map +1 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionChatFormWidget.module.css +86 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionChatFormWidget.tsx +129 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionComparisonHeaderAction.d.ts +23 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionComparisonHeaderAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionComparisonHeaderAction.js +270 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionComparisonHeaderAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionComparisonHeaderAction.module.css +167 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionComparisonHeaderAction.tsx +270 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionConfigVersionListWidget.d.ts +3 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionConfigVersionListWidget.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionConfigVersionListWidget.js +67 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionConfigVersionListWidget.js.map +1 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionConfigVersionListWidget.module.css +68 -0
- package/dist/components/core/extension/solid-core/agentSession/AgentSessionConfigVersionListWidget.tsx +107 -0
- package/dist/components/core/form/SolidFormFieldRender.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormFieldRender.js +2 -1
- package/dist/components/core/form/SolidFormFieldRender.js.map +1 -1
- package/dist/components/core/form/SolidFormFieldRender.tsx +6 -3
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +29 -4
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +27 -5
- package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.js +4 -4
- package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.tsx +15 -3
- package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.js +1 -1
- package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.tsx +5 -4
- package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.js +3 -5
- package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.tsx +7 -8
- package/dist/components/core/form/fields/SolidDecimalField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.js +2 -1
- package/dist/components/core/form/fields/SolidDecimalField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.tsx +6 -1
- package/dist/components/core/form/fields/SolidEmailField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidEmailField.js +2 -1
- package/dist/components/core/form/fields/SolidEmailField.js.map +1 -1
- package/dist/components/core/form/fields/SolidEmailField.tsx +6 -1
- package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.js +3 -3
- package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.tsx +11 -5
- package/dist/components/core/form/fields/SolidJsonField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.js +1 -1
- package/dist/components/core/form/fields/SolidJsonField.js.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.tsx +5 -3
- package/dist/components/core/form/fields/SolidLongTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.js +2 -2
- package/dist/components/core/form/fields/SolidLongTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.tsx +10 -4
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +4 -4
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +8 -6
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +3 -3
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +7 -5
- package/dist/components/core/form/fields/SolidPasswordField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidPasswordField.js +4 -3
- package/dist/components/core/form/fields/SolidPasswordField.js.map +1 -1
- package/dist/components/core/form/fields/SolidPasswordField.tsx +21 -4
- package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.js +2 -1
- package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.tsx +5 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js +2 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.tsx +6 -3
- package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.js +6 -5
- package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.tsx +26 -7
- package/dist/components/core/form/fields/SolidShortTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.js +3 -2
- package/dist/components/core/form/fields/SolidShortTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.tsx +11 -2
- package/dist/components/core/form/fields/SolidTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.js +1 -1
- package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.tsx +5 -3
- package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanCard.js +13 -2
- package/dist/components/core/kanban/KanbanCard.js.map +1 -1
- package/dist/components/core/kanban/KanbanCard.tsx +13 -2
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +18 -11
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +10 -6
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +49 -38
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +20 -21
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +2 -2
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +4 -4
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +3 -3
- package/dist/components/core/solid-agent/AgentContextPill.d.ts +9 -0
- package/dist/components/core/solid-agent/AgentContextPill.d.ts.map +1 -0
- package/dist/components/core/solid-agent/AgentContextPill.js +92 -0
- package/dist/components/core/solid-agent/AgentContextPill.js.map +1 -0
- package/dist/components/core/solid-agent/AgentContextPill.tsx +175 -0
- package/dist/components/core/solid-agent/AgentModelIndicator.d.ts +29 -3
- package/dist/components/core/solid-agent/AgentModelIndicator.d.ts.map +1 -1
- package/dist/components/core/solid-agent/AgentModelIndicator.js +279 -4
- package/dist/components/core/solid-agent/AgentModelIndicator.js.map +1 -1
- package/dist/components/core/solid-agent/AgentModelIndicator.tsx +546 -18
- package/dist/components/core/solid-agent/SolidAgent.module.css +1271 -128
- package/dist/components/core/solid-agent/SolidAgentChat.d.ts +6 -1
- package/dist/components/core/solid-agent/SolidAgentChat.d.ts.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentChat.js +693 -68
- package/dist/components/core/solid-agent/SolidAgentChat.js.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentChat.tsx +832 -62
- package/dist/components/core/solid-agent/SolidAgentEmbedded.d.ts +4 -0
- package/dist/components/core/solid-agent/SolidAgentEmbedded.d.ts.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentEmbedded.js +19 -13
- package/dist/components/core/solid-agent/SolidAgentEmbedded.js.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentEmbedded.tsx +40 -12
- package/dist/components/core/solid-agent/SolidAgentHost.d.ts.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentHost.js +84 -1
- package/dist/components/core/solid-agent/SolidAgentHost.js.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentHost.tsx +75 -2
- package/dist/components/core/solid-agent/agentEvents.d.ts +4 -1
- package/dist/components/core/solid-agent/agentEvents.d.ts.map +1 -1
- package/dist/components/core/solid-agent/agentEvents.js +108 -27
- package/dist/components/core/solid-agent/agentEvents.js.map +1 -1
- package/dist/components/core/solid-agent/agentEvents.ts +105 -14
- package/dist/components/core/solid-agent/agentFormat.d.ts.map +1 -1
- package/dist/components/core/solid-agent/agentFormat.js +80 -9
- package/dist/components/core/solid-agent/agentFormat.js.map +1 -1
- package/dist/components/core/solid-agent/agentFormat.ts +85 -8
- package/dist/components/core/solid-agent/client/agentPublicEvents.d.ts +88 -0
- package/dist/components/core/solid-agent/client/agentPublicEvents.d.ts.map +1 -0
- package/dist/components/core/solid-agent/client/agentPublicEvents.js +26 -0
- package/dist/components/core/solid-agent/client/agentPublicEvents.js.map +1 -0
- package/dist/components/core/solid-agent/client/agentPublicEvents.ts +66 -0
- package/dist/components/core/solid-agent/client/agentRest.d.ts +23 -2
- package/dist/components/core/solid-agent/client/agentRest.d.ts.map +1 -1
- package/dist/components/core/solid-agent/client/agentRest.js +223 -1
- package/dist/components/core/solid-agent/client/agentRest.js.map +1 -1
- package/dist/components/core/solid-agent/client/agentRest.ts +173 -5
- package/dist/components/core/solid-agent/client/agentRuntime.d.ts +38 -5
- package/dist/components/core/solid-agent/client/agentRuntime.d.ts.map +1 -1
- package/dist/components/core/solid-agent/client/agentRuntime.js +400 -59
- package/dist/components/core/solid-agent/client/agentRuntime.js.map +1 -1
- package/dist/components/core/solid-agent/client/agentRuntime.ts +322 -32
- package/dist/components/core/solid-agent/client/agentSocket.d.ts +28 -6
- package/dist/components/core/solid-agent/client/agentSocket.d.ts.map +1 -1
- package/dist/components/core/solid-agent/client/agentSocket.js +206 -39
- package/dist/components/core/solid-agent/client/agentSocket.js.map +1 -1
- package/dist/components/core/solid-agent/client/agentSocket.ts +153 -24
- package/dist/components/core/solid-agent/client/beforeUserMessageSend.d.ts +9 -0
- package/dist/components/core/solid-agent/client/beforeUserMessageSend.d.ts.map +1 -0
- package/dist/components/core/solid-agent/client/beforeUserMessageSend.js +53 -0
- package/dist/components/core/solid-agent/client/beforeUserMessageSend.js.map +1 -0
- package/dist/components/core/solid-agent/client/beforeUserMessageSend.ts +26 -0
- package/dist/components/core/solid-agent/composer/AgentComposer.d.ts +3 -1
- package/dist/components/core/solid-agent/composer/AgentComposer.d.ts.map +1 -1
- package/dist/components/core/solid-agent/composer/AgentComposer.js +37 -21
- package/dist/components/core/solid-agent/composer/AgentComposer.js.map +1 -1
- package/dist/components/core/solid-agent/composer/AgentComposer.tsx +113 -71
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.d.ts.map +1 -1
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js +4 -3
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js.map +1 -1
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.tsx +4 -2
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts +29 -0
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts.map +1 -1
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js +45 -2
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js.map +1 -1
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.ts +49 -2
- package/dist/components/core/solid-agent/embed/agentEmbedSamples.d.ts +1 -0
- package/dist/components/core/solid-agent/embed/agentEmbedSamples.d.ts.map +1 -1
- package/dist/components/core/solid-agent/embed/agentEmbedSamples.js +2 -1
- package/dist/components/core/solid-agent/embed/agentEmbedSamples.js.map +1 -1
- package/dist/components/core/solid-agent/embed/agentEmbedSamples.ts +15 -1
- package/dist/components/core/solid-agent/sdk/solidAgent.d.ts +4 -1
- package/dist/components/core/solid-agent/sdk/solidAgent.d.ts.map +1 -1
- package/dist/components/core/solid-agent/sdk/solidAgent.js.map +1 -1
- package/dist/components/core/solid-agent/sdk/solidAgent.ts +2 -2
- package/dist/components/core/solid-agent/thread/AgentThread.d.ts +2 -1
- package/dist/components/core/solid-agent/thread/AgentThread.d.ts.map +1 -1
- package/dist/components/core/solid-agent/thread/AgentThread.js +46 -36
- package/dist/components/core/solid-agent/thread/AgentThread.js.map +1 -1
- package/dist/components/core/solid-agent/thread/AgentThread.tsx +65 -62
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts +2 -2
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts.map +1 -1
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js +9 -3
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js.map +1 -1
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.tsx +12 -3
- package/dist/components/core/solid-agent/thread/inlineWidget.d.ts +15 -0
- package/dist/components/core/solid-agent/thread/inlineWidget.d.ts.map +1 -1
- package/dist/components/core/solid-agent/thread/inlineWidget.js +170 -19
- package/dist/components/core/solid-agent/thread/inlineWidget.js.map +1 -1
- package/dist/components/core/solid-agent/thread/inlineWidget.ts +164 -15
- package/dist/components/core/solid-agent/types.d.ts +86 -4
- package/dist/components/core/solid-agent/types.d.ts.map +1 -1
- package/dist/components/core/solid-agent/types.js +2 -0
- package/dist/components/core/solid-agent/types.js.map +1 -1
- package/dist/components/core/solid-agent/types.ts +76 -4
- package/dist/components/core/solid-agent/useAgentAvailability.d.ts +3 -1
- package/dist/components/core/solid-agent/useAgentAvailability.d.ts.map +1 -1
- package/dist/components/core/solid-agent/useAgentAvailability.js +16 -7
- package/dist/components/core/solid-agent/useAgentAvailability.js.map +1 -1
- package/dist/components/core/solid-agent/useAgentAvailability.ts +13 -6
- package/dist/components/core/solid-agent/useAgentChat.d.ts +1 -1
- package/dist/components/core/solid-agent/useAgentChat.d.ts.map +1 -1
- package/dist/components/core/solid-agent/useAgentChat.js +7 -4
- package/dist/components/core/solid-agent/useAgentChat.js.map +1 -1
- package/dist/components/core/solid-agent/useAgentChat.ts +9 -5
- package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.d.ts +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.d.ts.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.js +7 -38
- package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.tsx +8 -51
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.d.ts.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js +12 -4
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.tsx +18 -0
- package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.d.ts +4 -0
- package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.d.ts.map +1 -0
- package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.js +30 -0
- package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.js.map +1 -0
- package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.tsx +41 -0
- package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.js +2 -1
- package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.tsx +2 -2
- package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.d.ts.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.js +3 -1
- package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.tsx +3 -2
- package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.d.ts +1 -1
- package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.d.ts.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.js +77 -10
- package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.tsx +96 -18
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.d.ts.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js +1 -2
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.tsx +1 -3
- package/dist/components/core/solid-agent/widgets/solidChatWidgets.module.css +101 -76
- package/dist/components/core/solid-ai/SolidAiChat.d.ts.map +1 -1
- package/dist/components/core/solid-ai/SolidAiChat.js +2 -2
- package/dist/components/core/solid-ai/SolidAiChat.js.map +1 -1
- package/dist/components/core/solid-ai/SolidAiChat.tsx +12 -10
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
- package/dist/components/core/tree/SolidTreeView.js +42 -44
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +2 -20
- package/dist/components/layout/AdminTopHeader.d.ts.map +1 -1
- package/dist/components/layout/AdminTopHeader.js +20 -4
- package/dist/components/layout/AdminTopHeader.js.map +1 -1
- package/dist/components/layout/AdminTopHeader.tsx +19 -4
- package/dist/components/layout/user-profile-menu.d.ts.map +1 -1
- package/dist/components/layout/user-profile-menu.js +12 -8
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/components/layout/user-profile-menu.tsx +26 -7
- package/dist/components/shad-cn-ui/SolidCodeEditor.d.ts +2 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.js +3 -2
- package/dist/components/shad-cn-ui/SolidCodeEditor.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.tsx +3 -0
- package/dist/helpers/adminViewRefresh.d.ts +13 -0
- package/dist/helpers/adminViewRefresh.d.ts.map +1 -0
- package/dist/helpers/adminViewRefresh.js +14 -0
- package/dist/helpers/adminViewRefresh.js.map +1 -0
- package/dist/helpers/adminViewRefresh.ts +26 -0
- package/dist/helpers/eventBus.d.ts +1 -0
- package/dist/helpers/eventBus.d.ts.map +1 -1
- package/dist/helpers/eventBus.js +1 -0
- package/dist/helpers/eventBus.js.map +1 -1
- package/dist/helpers/eventBus.ts +1 -0
- package/dist/helpers/fileTypeIcon.d.ts.map +1 -1
- package/dist/helpers/fileTypeIcon.js +4 -1
- package/dist/helpers/fileTypeIcon.js.map +1 -1
- package/dist/helpers/fileTypeIcon.tsx +15 -0
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +8 -0
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +8 -0
- package/dist/helpers/routePaths.d.ts +16 -0
- package/dist/helpers/routePaths.d.ts.map +1 -1
- package/dist/helpers/routePaths.js +71 -0
- package/dist/helpers/routePaths.js.map +1 -1
- package/dist/helpers/routePaths.ts +75 -0
- package/dist/redux/api/solidEntityApi.d.ts +1 -1
- package/dist/redux/api/solidEntityApi.js +5 -2
- package/dist/redux/api/solidEntityApi.js.map +1 -1
- package/dist/redux/api/solidEntityApi.tsx +5 -2
- package/dist/redux/features/agentSlice.d.ts +3 -1
- package/dist/redux/features/agentSlice.d.ts.map +1 -1
- package/dist/redux/features/agentSlice.js +7 -3
- package/dist/redux/features/agentSlice.js.map +1 -1
- package/dist/redux/features/agentSlice.ts +17 -5
- package/dist/redux/store/StoreProvider.d.ts.map +1 -1
- package/dist/redux/store/StoreProvider.js +46 -5
- package/dist/redux/store/StoreProvider.js.map +1 -1
- package/dist/redux/store/StoreProvider.tsx +48 -5
- package/dist/redux/store/createSolidStore.d.ts +3 -1
- package/dist/redux/store/createSolidStore.d.ts.map +1 -1
- package/dist/redux/store/createSolidStore.js +2 -1
- package/dist/redux/store/createSolidStore.js.map +1 -1
- package/dist/redux/store/createSolidStore.ts +2 -1
- package/dist/resources/globals.css +31 -4
- package/dist/resources/solid-custom.css +136 -0
- package/dist/resources/solid-tailwind-generated.css +1 -1
- package/dist/routes/pages/admin/core/AgentConfigComparisonPage.css +124 -0
- package/dist/routes/pages/admin/core/AgentConfigComparisonPage.d.ts +3 -0
- package/dist/routes/pages/admin/core/AgentConfigComparisonPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/AgentConfigComparisonPage.js +144 -0
- package/dist/routes/pages/admin/core/AgentConfigComparisonPage.js.map +1 -0
- package/dist/routes/pages/admin/core/AgentConfigComparisonPage.tsx +164 -0
- package/dist/routes/pages/admin/core/AgentConfigVersionsPanel.d.ts +6 -0
- package/dist/routes/pages/admin/core/AgentConfigVersionsPanel.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/AgentConfigVersionsPanel.js +52 -0
- package/dist/routes/pages/admin/core/AgentConfigVersionsPanel.js.map +1 -0
- package/dist/routes/pages/admin/core/AgentConfigVersionsPanel.tsx +53 -0
- package/dist/routes/pages/admin/core/AgentHubModuleField.css +15 -0
- package/dist/routes/pages/admin/core/AgentHubModuleField.d.ts +22 -0
- package/dist/routes/pages/admin/core/AgentHubModuleField.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/AgentHubModuleField.js +42 -0
- package/dist/routes/pages/admin/core/AgentHubModuleField.js.map +1 -0
- package/dist/routes/pages/admin/core/AgentHubModuleField.tsx +54 -0
- package/dist/routes/pages/admin/core/AgentHubTagsField.d.ts +3 -1
- package/dist/routes/pages/admin/core/AgentHubTagsField.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentHubTagsField.js +3 -3
- package/dist/routes/pages/admin/core/AgentHubTagsField.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentHubTagsField.tsx +7 -3
- package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.js +6 -2
- package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.tsx +5 -3
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.css +23 -2
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +284 -135
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +179 -27
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js +22 -15
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.tsx +17 -7
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js +21 -15
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.tsx +16 -9
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.js +149 -37
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.js.map +1 -1
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.tsx +283 -73
- package/dist/routes/pages/admin/core/CardPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.js +9 -1
- package/dist/routes/pages/admin/core/CardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.tsx +9 -1
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.css +361 -37
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js +1 -1
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js.map +1 -1
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.tsx +2 -0
- package/dist/routes/pages/admin/core/KanbanPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.js +9 -1
- package/dist/routes/pages/admin/core/KanbanPage.js.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.tsx +9 -1
- package/dist/routes/pages/admin/core/ListPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.js +10 -1
- package/dist/routes/pages/admin/core/ListPage.js.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.tsx +10 -1
- package/dist/routes/pages/admin/core/TreePage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/TreePage.js +9 -1
- package/dist/routes/pages/admin/core/TreePage.js.map +1 -1
- package/dist/routes/pages/admin/core/TreePage.tsx +9 -1
- package/dist/routes/pages/admin/core/agentConfigComparison.d.ts +84 -0
- package/dist/routes/pages/admin/core/agentConfigComparison.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/agentConfigComparison.js +75 -0
- package/dist/routes/pages/admin/core/agentConfigComparison.js.map +1 -0
- package/dist/routes/pages/admin/core/agentConfigComparison.ts +40 -0
- package/dist/routes/pages/embed/AgentEmbedPage.d.ts.map +1 -1
- package/dist/routes/pages/embed/AgentEmbedPage.js +67 -4
- package/dist/routes/pages/embed/AgentEmbedPage.js.map +1 -1
- package/dist/routes/pages/embed/AgentEmbedPage.tsx +61 -4
- package/dist/routes/solidRoutes.d.ts.map +1 -1
- package/dist/routes/solidRoutes.js +2 -0
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +2 -0
- package/package.json +1 -1
package/dist/helpers/registry.ts
CHANGED
|
@@ -62,6 +62,9 @@ import MqMessageKanbanCardWidget from "../components/core/extension/solid-core/m
|
|
|
62
62
|
import MqMessageDetailsKanbanCardAction from "../components/core/extension/solid-core/mqMessage/kanban/MqMessageDetailsKanbanCardAction";
|
|
63
63
|
import MqMessageKanbanQuickFilterHeaderAction from "../components/core/extension/solid-core/mqMessage/kanban/MqMessageKanbanQuickFilterHeaderAction";
|
|
64
64
|
import MqMessageSelectedRecordsSummaryHeaderAction from "../components/core/extension/solid-core/mqMessage/MqMessageSelectedRecordsSummaryHeaderAction";
|
|
65
|
+
import AgentSessionComparisonHeaderAction from "../components/core/extension/solid-core/agentSession/AgentSessionComparisonHeaderAction";
|
|
66
|
+
import { AgentSessionChatFormWidget } from "../components/core/extension/solid-core/agentSession/AgentSessionChatFormWidget";
|
|
67
|
+
import { AgentSessionConfigVersionListWidget } from "../components/core/extension/solid-core/agentSession/AgentSessionConfigVersionListWidget";
|
|
65
68
|
import MediaCardWidget from "../components/core/extension/solid-core/media/card/MediaCardWidget";
|
|
66
69
|
import { AgentRegistryCardWidget } from "../components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget";
|
|
67
70
|
import { AgentResourceCardWidget } from "../components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget";
|
|
@@ -114,6 +117,7 @@ import { SolidGalleryChatWidget } from "../components/core/solid-agent/widgets/S
|
|
|
114
117
|
import { SolidProgressChatWidget } from "../components/core/solid-agent/widgets/SolidProgressChatWidget";
|
|
115
118
|
import { SolidStatusChatWidget } from "../components/core/solid-agent/widgets/SolidStatusChatWidget";
|
|
116
119
|
import { SolidLinkCardChatWidget } from "../components/core/solid-agent/widgets/SolidLinkCardChatWidget";
|
|
120
|
+
import { SolidNavigationIntentChatWidget } from "../components/core/solid-agent/widgets/SolidNavigationIntentChatWidget";
|
|
117
121
|
import { SolidToolActivityChatWidget } from "../components/core/solid-agent/widgets/SolidToolActivityChatWidget";
|
|
118
122
|
|
|
119
123
|
|
|
@@ -277,6 +281,9 @@ registerExtensionComponent("AgentEventOutcomeListWidget", AgentEventOutcomeListW
|
|
|
277
281
|
registerExtensionComponent("SolidMqMessagesSummarizeListHeaderAction", SolidMqMessagesSummarizeListHeaderAction, ExtensionComponentTypes.listHeaderAction);
|
|
278
282
|
registerExtensionComponent("ModuleImportListHeaderAction", ModuleImportListHeaderAction, ExtensionComponentTypes.listHeaderAction);
|
|
279
283
|
registerExtensionComponent("ClearModulePackageRuntimeHeaderAction", ClearModulePackageRuntimeHeaderAction, ExtensionComponentTypes.listHeaderAction);
|
|
284
|
+
registerExtensionComponent("AgentSessionComparisonHeaderAction", AgentSessionComparisonHeaderAction, ExtensionComponentTypes.listHeaderAction);
|
|
285
|
+
registerExtensionComponent("AgentSessionChatFormWidget", AgentSessionChatFormWidget, ExtensionComponentTypes.formFieldViewWidget);
|
|
286
|
+
registerExtensionComponent("AgentSessionConfigVersionListWidget", AgentSessionConfigVersionListWidget, ExtensionComponentTypes.listFieldWidget);
|
|
280
287
|
|
|
281
288
|
// ...
|
|
282
289
|
|
|
@@ -541,4 +548,5 @@ registerExtensionComponent("SolidGalleryChatWidget", SolidGalleryChatWidget, Ext
|
|
|
541
548
|
registerExtensionComponent("SolidProgressChatWidget", SolidProgressChatWidget, ExtensionComponentTypes.chatInteractionWidget, ["progress"]);
|
|
542
549
|
registerExtensionComponent("SolidStatusChatWidget", SolidStatusChatWidget, ExtensionComponentTypes.chatInteractionWidget, ["status"]);
|
|
543
550
|
registerExtensionComponent("SolidLinkCardChatWidget", SolidLinkCardChatWidget, ExtensionComponentTypes.chatInteractionWidget, ["link-card"]);
|
|
551
|
+
registerExtensionComponent("SolidNavigationIntentChatWidget", SolidNavigationIntentChatWidget, ExtensionComponentTypes.chatInteractionWidget, ["navigation-intent"]);
|
|
544
552
|
registerExtensionComponent("SolidToolActivityChatWidget", SolidToolActivityChatWidget, ExtensionComponentTypes.chatInteractionWidget, ["tool-activity"]);
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
export declare const normalizeSolidListTreeKanbanActionPath: (currentPath: string, actionUrl: string) => string;
|
|
2
|
+
/** Build the optional record label query parameter from collection row data. */
|
|
3
|
+
export declare const getRecordUserKeyQuery: (record: any, viewMetadata: any) => string;
|
|
4
|
+
export declare const getRecordActionQuery: (viewMetadata: any) => string;
|
|
2
5
|
export declare const buildAdminRecordFormPath: ({ moduleName, modelName, recordId, viewMode, }: {
|
|
3
6
|
moduleName?: string | null | undefined;
|
|
4
7
|
modelName?: string | null | undefined;
|
|
5
8
|
recordId?: string | number | null | undefined;
|
|
6
9
|
viewMode?: "view" | "edit" | undefined;
|
|
7
10
|
}) => string;
|
|
11
|
+
/** Build an internal standard SolidX admin model-view path from structured route fields. */
|
|
12
|
+
export declare const buildAdminModelViewPath: ({ moduleName, modelName, viewName, }: {
|
|
13
|
+
moduleName?: string | null | undefined;
|
|
14
|
+
modelName?: string | null | undefined;
|
|
15
|
+
viewName?: string | null | undefined;
|
|
16
|
+
}) => string;
|
|
17
|
+
/** Build the standard SolidX dashboard route from metadata identifiers. */
|
|
18
|
+
export declare const buildAdminDashboardPath: ({ moduleName, dashboardName, }: {
|
|
19
|
+
moduleName?: string | null | undefined;
|
|
20
|
+
dashboardName?: string | null | undefined;
|
|
21
|
+
}) => string;
|
|
22
|
+
/** Accept only concrete same-origin SolidX admin routes read from custom action metadata. */
|
|
23
|
+
export declare const buildAdminCustomPath: (customRoute?: string | null) => string;
|
|
8
24
|
export declare const normalizeSolidFormActionPath: (currentPath: string, actionUrl: string) => string;
|
|
9
25
|
//# sourceMappingURL=routePaths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routePaths.d.ts","sourceRoot":"","sources":["../../src/helpers/routePaths.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sCAAsC,gBAAiB,MAAM,aAAa,MAAM,WAW5F,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;YAuBpC,CAAC;AAEF,eAAO,MAAM,4BAA4B,gBAAiB,MAAM,aAAa,MAAM,WAWlF,CAAC"}
|
|
1
|
+
{"version":3,"file":"routePaths.d.ts","sourceRoot":"","sources":["../../src/helpers/routePaths.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sCAAsC,gBAAiB,MAAM,aAAa,MAAM,WAW5F,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,qBAAqB,WAAY,GAAG,gBAAgB,GAAG,WAcnE,CAAC;AAEF,eAAO,MAAM,oBAAoB,iBAAkB,GAAG,WAQrD,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;YAuBpC,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,uBAAuB;;;;YAmBnC,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB;;;YAUnC,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,oBAAoB,iBAAkB,MAAM,GAAG,IAAI,WAU/D,CAAC;AAEF,eAAO,MAAM,4BAA4B,gBAAiB,MAAM,aAAa,MAAM,WAWlF,CAAC"}
|
|
@@ -9,6 +9,38 @@ export var normalizeSolidListTreeKanbanActionPath = function (currentPath, actio
|
|
|
9
9
|
var actionTrimmed = actionUrl.replace(/^\/+/, "");
|
|
10
10
|
return "".concat(normalizedBase.replace(/\/+$/, ""), "/").concat(actionTrimmed);
|
|
11
11
|
};
|
|
12
|
+
/** Build the optional record label query parameter from collection row data. */
|
|
13
|
+
export var getRecordUserKeyQuery = function (record, viewMetadata) {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
var data = (viewMetadata === null || viewMetadata === void 0 ? void 0 : viewMetadata.data) || viewMetadata;
|
|
16
|
+
var model = (_a = data === null || data === void 0 ? void 0 : data.solidView) === null || _a === void 0 ? void 0 : _a.model;
|
|
17
|
+
var configuredUserKey = model === null || model === void 0 ? void 0 : model.userKeyField;
|
|
18
|
+
var userKeyFieldName = typeof configuredUserKey === "string"
|
|
19
|
+
? configuredUserKey
|
|
20
|
+
: configuredUserKey === null || configuredUserKey === void 0 ? void 0 : configuredUserKey.name;
|
|
21
|
+
var metadataUserKeyFieldName = (_b = Object.entries((data === null || data === void 0 ? void 0 : data.solidFieldsMetadata) || {})
|
|
22
|
+
.find(function (_a) {
|
|
23
|
+
var fieldMetadata = _a[1];
|
|
24
|
+
return fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.isUserKey;
|
|
25
|
+
})) === null || _b === void 0 ? void 0 : _b[0];
|
|
26
|
+
var value = record === null || record === void 0 ? void 0 : record[userKeyFieldName || metadataUserKeyFieldName];
|
|
27
|
+
return value === undefined || value === null || value === ""
|
|
28
|
+
? ""
|
|
29
|
+
: "recordUserKey=".concat(encodeURIComponent(String(value)));
|
|
30
|
+
};
|
|
31
|
+
export var getRecordActionQuery = function (viewMetadata) {
|
|
32
|
+
var _a, _b, _c;
|
|
33
|
+
var data = (viewMetadata === null || viewMetadata === void 0 ? void 0 : viewMetadata.data) || viewMetadata;
|
|
34
|
+
var editAction = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.solidView) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.attrs) === null || _c === void 0 ? void 0 : _c.editAction;
|
|
35
|
+
var params = new URLSearchParams();
|
|
36
|
+
if (editAction === null || editAction === void 0 ? void 0 : editAction.name)
|
|
37
|
+
params.set("actionName", editAction.name);
|
|
38
|
+
if (editAction === null || editAction === void 0 ? void 0 : editAction.type)
|
|
39
|
+
params.set("actionType", editAction.type);
|
|
40
|
+
if (editAction === null || editAction === void 0 ? void 0 : editAction.context)
|
|
41
|
+
params.set("actionContext", editAction.context);
|
|
42
|
+
return params.toString();
|
|
43
|
+
};
|
|
12
44
|
export var buildAdminRecordFormPath = function (_a) {
|
|
13
45
|
var moduleName = _a.moduleName, modelName = _a.modelName, recordId = _a.recordId, viewMode = _a.viewMode;
|
|
14
46
|
if (!moduleName || !modelName || recordId === null || recordId === undefined || recordId === "") {
|
|
@@ -22,6 +54,45 @@ export var buildAdminRecordFormPath = function (_a) {
|
|
|
22
54
|
var basePath = "/admin/core/".concat(moduleName.trim(), "/").concat(normalizedModelName, "/form/").concat(recordId);
|
|
23
55
|
return viewMode ? "".concat(basePath, "?viewMode=").concat(viewMode) : basePath;
|
|
24
56
|
};
|
|
57
|
+
/** Build an internal standard SolidX admin model-view path from structured route fields. */
|
|
58
|
+
export var buildAdminModelViewPath = function (_a) {
|
|
59
|
+
var moduleName = _a.moduleName, modelName = _a.modelName, viewName = _a.viewName;
|
|
60
|
+
if (!moduleName || !modelName || !viewName)
|
|
61
|
+
return "";
|
|
62
|
+
var safeSegment = /^[A-Za-z0-9_-]+$/;
|
|
63
|
+
if (!safeSegment.test(moduleName.trim()) || !safeSegment.test(modelName.trim()))
|
|
64
|
+
return "";
|
|
65
|
+
if (!["list", "tree", "kanban", "card"].includes(viewName))
|
|
66
|
+
return "";
|
|
67
|
+
var normalizedModelName = modelName.trim()
|
|
68
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1-$2")
|
|
69
|
+
.replace(/[_\s]+/g, "-")
|
|
70
|
+
.toLowerCase();
|
|
71
|
+
return "/admin/core/".concat(encodeURIComponent(moduleName.trim()), "/").concat(encodeURIComponent(normalizedModelName), "/").concat(viewName);
|
|
72
|
+
};
|
|
73
|
+
/** Build the standard SolidX dashboard route from metadata identifiers. */
|
|
74
|
+
export var buildAdminDashboardPath = function (_a) {
|
|
75
|
+
var moduleName = _a.moduleName, dashboardName = _a.dashboardName;
|
|
76
|
+
var safeSegment = /^[A-Za-z0-9_-]+$/;
|
|
77
|
+
if (!moduleName || !dashboardName || !safeSegment.test(moduleName.trim()) || !safeSegment.test(dashboardName.trim()))
|
|
78
|
+
return "";
|
|
79
|
+
return "/admin/core/".concat(encodeURIComponent(moduleName.trim()), "/dashboard/").concat(encodeURIComponent(dashboardName.trim()));
|
|
80
|
+
};
|
|
81
|
+
/** Accept only concrete same-origin SolidX admin routes read from custom action metadata. */
|
|
82
|
+
export var buildAdminCustomPath = function (customRoute) {
|
|
83
|
+
if (!customRoute || !customRoute.startsWith("/admin/") || customRoute.startsWith("//") || customRoute.includes("\\")
|
|
84
|
+
|| /[\u0000-\u001f\u007f]/.test(customRoute))
|
|
85
|
+
return "";
|
|
86
|
+
try {
|
|
87
|
+
var resolved = new URL(customRoute, "https://solidx.local");
|
|
88
|
+
if (resolved.origin !== "https://solidx.local" || !resolved.pathname.startsWith("/admin/"))
|
|
89
|
+
return "";
|
|
90
|
+
return "".concat(resolved.pathname).concat(resolved.search).concat(resolved.hash);
|
|
91
|
+
}
|
|
92
|
+
catch (_a) {
|
|
93
|
+
return "";
|
|
94
|
+
}
|
|
95
|
+
};
|
|
25
96
|
export var normalizeSolidFormActionPath = function (currentPath, actionUrl) {
|
|
26
97
|
if (!actionUrl)
|
|
27
98
|
return "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routePaths.js","sourceRoot":"","sources":["../../src/helpers/routePaths.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,sCAAsC,GAAG,UAAC,WAAmB,EAAE,SAAiB;IAC3F,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAC1B,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAC7D,OAAO,SAAS,CAAC;KAClB;IAED,IAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,iCAAiC,EAAE,EAAE,CAAC,CAAC;IAC5E,IAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5D,IAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAEpD,OAAO,UAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,cAAI,aAAa,CAAE,CAAC;AAClE,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,wBAAwB,GAAG,UAAC,EAUxC;QATC,UAAU,gBAAA,EACV,SAAS,eAAA,EACT,QAAQ,cAAA,EACR,QAAQ,cAAA;IAOR,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,EAAE,EAAE;QAC/F,OAAO,EAAE,CAAC;KACX;IAED,IAAM,mBAAmB,GAAG,SAAS;SAClC,IAAI,EAAE;SACN,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC;SACtC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,WAAW,EAAE,CAAC;IACjB,IAAM,QAAQ,GAAG,sBAAe,UAAU,CAAC,IAAI,EAAE,cAAI,mBAAmB,mBAAS,QAAQ,CAAE,CAAC;IAE5F,OAAO,QAAQ,CAAC,CAAC,CAAC,UAAG,QAAQ,uBAAa,QAAQ,CAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;AAClE,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,4BAA4B,GAAG,UAAC,WAAmB,EAAE,SAAiB;IACjF,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAC1B,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAC7D,OAAO,SAAS,CAAC;KAClB;IAED,IAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;IACnE,IAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5D,IAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAEpD,OAAO,UAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,cAAI,aAAa,CAAE,CAAC;AAClE,CAAC,CAAC","sourcesContent":["export const normalizeSolidListTreeKanbanActionPath = (currentPath: string, actionUrl: string) => {\n if (!actionUrl) return \"\";\n if (actionUrl.startsWith(\"http\") || actionUrl.startsWith(\"/\")) {\n return actionUrl;\n }\n\n const basePath = currentPath.replace(/\\/(list|tree|kanban|card)(\\/)?$/, \"\");\n const normalizedBase = basePath.length > 0 ? basePath : \"/\";\n const actionTrimmed = actionUrl.replace(/^\\/+/, \"\");\n\n return `${normalizedBase.replace(/\\/+$/, \"\")}/${actionTrimmed}`;\n};\n\nexport const buildAdminRecordFormPath = ({\n moduleName,\n modelName,\n recordId,\n viewMode,\n}: {\n moduleName?: string | null;\n modelName?: string | null;\n recordId?: string | number | null;\n viewMode?: \"view\" | \"edit\";\n}) => {\n if (!moduleName || !modelName || recordId === null || recordId === undefined || recordId === \"\") {\n return \"\";\n }\n\n const normalizedModelName = modelName\n .trim()\n .replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n .replace(/[_\\s]+/g, \"-\")\n .toLowerCase();\n const basePath = `/admin/core/${moduleName.trim()}/${normalizedModelName}/form/${recordId}`;\n\n return viewMode ? `${basePath}?viewMode=${viewMode}` : basePath;\n};\n\nexport const normalizeSolidFormActionPath = (currentPath: string, actionUrl: string) => {\n if (!actionUrl) return \"\";\n if (actionUrl.startsWith(\"http\") || actionUrl.startsWith(\"/\")) {\n return actionUrl;\n }\n\n const basePath = currentPath.replace(/\\/form(\\/[^/]+)?(\\/)?$/, \"\");\n const normalizedBase = basePath.length > 0 ? basePath : \"/\";\n const actionTrimmed = actionUrl.replace(/^\\/+/, \"\");\n\n return `${normalizedBase.replace(/\\/+$/, \"\")}/${actionTrimmed}`;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"routePaths.js","sourceRoot":"","sources":["../../src/helpers/routePaths.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,sCAAsC,GAAG,UAAC,WAAmB,EAAE,SAAiB;IAC3F,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAC1B,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAC7D,OAAO,SAAS,CAAC;KAClB;IAED,IAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,iCAAiC,EAAE,EAAE,CAAC,CAAC;IAC5E,IAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5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C7D,OAAO,SAAS,CAAC;KAClB;IAED,IAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;IACnE,IAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5D,IAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAEpD,OAAO,UAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,cAAI,aAAa,CAAE,CAAC;AAClE,CAAC,CAAC","sourcesContent":["export const normalizeSolidListTreeKanbanActionPath = (currentPath: string, actionUrl: string) => {\n if (!actionUrl) return \"\";\n if (actionUrl.startsWith(\"http\") || actionUrl.startsWith(\"/\")) {\n return actionUrl;\n }\n\n const basePath = currentPath.replace(/\\/(list|tree|kanban|card)(\\/)?$/, \"\");\n const normalizedBase = basePath.length > 0 ? basePath : \"/\";\n const actionTrimmed = actionUrl.replace(/^\\/+/, \"\");\n\n return `${normalizedBase.replace(/\\/+$/, \"\")}/${actionTrimmed}`;\n};\n\n/** Build the optional record label query parameter from collection row data. */\nexport const getRecordUserKeyQuery = (record: any, viewMetadata: any) => {\n const data = viewMetadata?.data || viewMetadata;\n const model = data?.solidView?.model;\n const configuredUserKey = model?.userKeyField;\n const userKeyFieldName = typeof configuredUserKey === \"string\"\n ? configuredUserKey\n : configuredUserKey?.name;\n const metadataUserKeyFieldName = Object.entries(data?.solidFieldsMetadata || {})\n .find(([, fieldMetadata]: [string, any]) => fieldMetadata?.isUserKey)?.[0];\n const value = record?.[userKeyFieldName || metadataUserKeyFieldName];\n\n return value === undefined || value === null || value === \"\"\n ? \"\"\n : `recordUserKey=${encodeURIComponent(String(value))}`;\n};\n\nexport const getRecordActionQuery = (viewMetadata: any) => {\n const data = viewMetadata?.data || viewMetadata;\n const editAction = data?.solidView?.layout?.attrs?.editAction;\n const params = new URLSearchParams();\n if (editAction?.name) params.set(\"actionName\", editAction.name);\n if (editAction?.type) params.set(\"actionType\", editAction.type);\n if (editAction?.context) params.set(\"actionContext\", editAction.context);\n return params.toString();\n};\n\nexport const buildAdminRecordFormPath = ({\n moduleName,\n modelName,\n recordId,\n viewMode,\n}: {\n moduleName?: string | null;\n modelName?: string | null;\n recordId?: string | number | null;\n viewMode?: \"view\" | \"edit\";\n}) => {\n if (!moduleName || !modelName || recordId === null || recordId === undefined || recordId === \"\") {\n return \"\";\n }\n\n const normalizedModelName = modelName\n .trim()\n .replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n .replace(/[_\\s]+/g, \"-\")\n .toLowerCase();\n const basePath = `/admin/core/${moduleName.trim()}/${normalizedModelName}/form/${recordId}`;\n\n return viewMode ? `${basePath}?viewMode=${viewMode}` : basePath;\n};\n\n/** Build an internal standard SolidX admin model-view path from structured route fields. */\nexport const buildAdminModelViewPath = ({\n moduleName,\n modelName,\n viewName,\n}: {\n moduleName?: string | null;\n modelName?: string | null;\n viewName?: string | null;\n}) => {\n if (!moduleName || !modelName || !viewName) return \"\";\n const safeSegment = /^[A-Za-z0-9_-]+$/;\n if (!safeSegment.test(moduleName.trim()) || !safeSegment.test(modelName.trim())) return \"\";\n if (![\"list\", \"tree\", \"kanban\", \"card\"].includes(viewName)) return \"\";\n\n const normalizedModelName = modelName.trim()\n .replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n .replace(/[_\\s]+/g, \"-\")\n .toLowerCase();\n return `/admin/core/${encodeURIComponent(moduleName.trim())}/${encodeURIComponent(normalizedModelName)}/${viewName}`;\n};\n\n/** Build the standard SolidX dashboard route from metadata identifiers. */\nexport const buildAdminDashboardPath = ({\n moduleName,\n dashboardName,\n}: {\n moduleName?: string | null;\n dashboardName?: string | null;\n}) => {\n const safeSegment = /^[A-Za-z0-9_-]+$/;\n if (!moduleName || !dashboardName || !safeSegment.test(moduleName.trim()) || !safeSegment.test(dashboardName.trim())) return \"\";\n return `/admin/core/${encodeURIComponent(moduleName.trim())}/dashboard/${encodeURIComponent(dashboardName.trim())}`;\n};\n\n/** Accept only concrete same-origin SolidX admin routes read from custom action metadata. */\nexport const buildAdminCustomPath = (customRoute?: string | null) => {\n if (!customRoute || !customRoute.startsWith(\"/admin/\") || customRoute.startsWith(\"//\") || customRoute.includes(\"\\\\\")\n || /[\\u0000-\\u001f\\u007f]/.test(customRoute)) return \"\";\n try {\n const resolved = new URL(customRoute, \"https://solidx.local\");\n if (resolved.origin !== \"https://solidx.local\" || !resolved.pathname.startsWith(\"/admin/\")) return \"\";\n return `${resolved.pathname}${resolved.search}${resolved.hash}`;\n } catch {\n return \"\";\n }\n};\n\nexport const normalizeSolidFormActionPath = (currentPath: string, actionUrl: string) => {\n if (!actionUrl) return \"\";\n if (actionUrl.startsWith(\"http\") || actionUrl.startsWith(\"/\")) {\n return actionUrl;\n }\n\n const basePath = currentPath.replace(/\\/form(\\/[^/]+)?(\\/)?$/, \"\");\n const normalizedBase = basePath.length > 0 ? basePath : \"/\";\n const actionTrimmed = actionUrl.replace(/^\\/+/, \"\");\n\n return `${normalizedBase.replace(/\\/+$/, \"\")}/${actionTrimmed}`;\n};\n"]}
|
|
@@ -11,6 +11,33 @@ export const normalizeSolidListTreeKanbanActionPath = (currentPath: string, acti
|
|
|
11
11
|
return `${normalizedBase.replace(/\/+$/, "")}/${actionTrimmed}`;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
+
/** Build the optional record label query parameter from collection row data. */
|
|
15
|
+
export const getRecordUserKeyQuery = (record: any, viewMetadata: any) => {
|
|
16
|
+
const data = viewMetadata?.data || viewMetadata;
|
|
17
|
+
const model = data?.solidView?.model;
|
|
18
|
+
const configuredUserKey = model?.userKeyField;
|
|
19
|
+
const userKeyFieldName = typeof configuredUserKey === "string"
|
|
20
|
+
? configuredUserKey
|
|
21
|
+
: configuredUserKey?.name;
|
|
22
|
+
const metadataUserKeyFieldName = Object.entries(data?.solidFieldsMetadata || {})
|
|
23
|
+
.find(([, fieldMetadata]: [string, any]) => fieldMetadata?.isUserKey)?.[0];
|
|
24
|
+
const value = record?.[userKeyFieldName || metadataUserKeyFieldName];
|
|
25
|
+
|
|
26
|
+
return value === undefined || value === null || value === ""
|
|
27
|
+
? ""
|
|
28
|
+
: `recordUserKey=${encodeURIComponent(String(value))}`;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const getRecordActionQuery = (viewMetadata: any) => {
|
|
32
|
+
const data = viewMetadata?.data || viewMetadata;
|
|
33
|
+
const editAction = data?.solidView?.layout?.attrs?.editAction;
|
|
34
|
+
const params = new URLSearchParams();
|
|
35
|
+
if (editAction?.name) params.set("actionName", editAction.name);
|
|
36
|
+
if (editAction?.type) params.set("actionType", editAction.type);
|
|
37
|
+
if (editAction?.context) params.set("actionContext", editAction.context);
|
|
38
|
+
return params.toString();
|
|
39
|
+
};
|
|
40
|
+
|
|
14
41
|
export const buildAdminRecordFormPath = ({
|
|
15
42
|
moduleName,
|
|
16
43
|
modelName,
|
|
@@ -36,6 +63,54 @@ export const buildAdminRecordFormPath = ({
|
|
|
36
63
|
return viewMode ? `${basePath}?viewMode=${viewMode}` : basePath;
|
|
37
64
|
};
|
|
38
65
|
|
|
66
|
+
/** Build an internal standard SolidX admin model-view path from structured route fields. */
|
|
67
|
+
export const buildAdminModelViewPath = ({
|
|
68
|
+
moduleName,
|
|
69
|
+
modelName,
|
|
70
|
+
viewName,
|
|
71
|
+
}: {
|
|
72
|
+
moduleName?: string | null;
|
|
73
|
+
modelName?: string | null;
|
|
74
|
+
viewName?: string | null;
|
|
75
|
+
}) => {
|
|
76
|
+
if (!moduleName || !modelName || !viewName) return "";
|
|
77
|
+
const safeSegment = /^[A-Za-z0-9_-]+$/;
|
|
78
|
+
if (!safeSegment.test(moduleName.trim()) || !safeSegment.test(modelName.trim())) return "";
|
|
79
|
+
if (!["list", "tree", "kanban", "card"].includes(viewName)) return "";
|
|
80
|
+
|
|
81
|
+
const normalizedModelName = modelName.trim()
|
|
82
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1-$2")
|
|
83
|
+
.replace(/[_\s]+/g, "-")
|
|
84
|
+
.toLowerCase();
|
|
85
|
+
return `/admin/core/${encodeURIComponent(moduleName.trim())}/${encodeURIComponent(normalizedModelName)}/${viewName}`;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/** Build the standard SolidX dashboard route from metadata identifiers. */
|
|
89
|
+
export const buildAdminDashboardPath = ({
|
|
90
|
+
moduleName,
|
|
91
|
+
dashboardName,
|
|
92
|
+
}: {
|
|
93
|
+
moduleName?: string | null;
|
|
94
|
+
dashboardName?: string | null;
|
|
95
|
+
}) => {
|
|
96
|
+
const safeSegment = /^[A-Za-z0-9_-]+$/;
|
|
97
|
+
if (!moduleName || !dashboardName || !safeSegment.test(moduleName.trim()) || !safeSegment.test(dashboardName.trim())) return "";
|
|
98
|
+
return `/admin/core/${encodeURIComponent(moduleName.trim())}/dashboard/${encodeURIComponent(dashboardName.trim())}`;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/** Accept only concrete same-origin SolidX admin routes read from custom action metadata. */
|
|
102
|
+
export const buildAdminCustomPath = (customRoute?: string | null) => {
|
|
103
|
+
if (!customRoute || !customRoute.startsWith("/admin/") || customRoute.startsWith("//") || customRoute.includes("\\")
|
|
104
|
+
|| /[\u0000-\u001f\u007f]/.test(customRoute)) return "";
|
|
105
|
+
try {
|
|
106
|
+
const resolved = new URL(customRoute, "https://solidx.local");
|
|
107
|
+
if (resolved.origin !== "https://solidx.local" || !resolved.pathname.startsWith("/admin/")) return "";
|
|
108
|
+
return `${resolved.pathname}${resolved.search}${resolved.hash}`;
|
|
109
|
+
} catch {
|
|
110
|
+
return "";
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
39
114
|
export const normalizeSolidFormActionPath = (currentPath: string, actionUrl: string) => {
|
|
40
115
|
if (!actionUrl) return "";
|
|
41
116
|
if (actionUrl.startsWith("http") || actionUrl.startsWith("/")) {
|
|
@@ -15,7 +15,7 @@ export declare const createSolidEntityApi: (entityName: string) => import("@redu
|
|
|
15
15
|
updateSolidEntity: import("@reduxjs/toolkit/query/react").MutationDefinition<any, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, string, any, `genericSolid${string}Api`>;
|
|
16
16
|
deleteMultipleSolidEntities: import("@reduxjs/toolkit/query/react").MutationDefinition<any, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, string, any, `genericSolid${string}Api`>;
|
|
17
17
|
deleteSolidEntity: import("@reduxjs/toolkit/query/react").MutationDefinition<any, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, string, any, `genericSolid${string}Api`>;
|
|
18
|
-
recoverSolidEntityById: import("@reduxjs/toolkit/query/react").
|
|
18
|
+
recoverSolidEntityById: import("@reduxjs/toolkit/query/react").MutationDefinition<any, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, string, any, `genericSolid${string}Api`>;
|
|
19
19
|
recoverSolidEntity: import("@reduxjs/toolkit/query/react").MutationDefinition<any, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, string, any, `genericSolid${string}Api`>;
|
|
20
20
|
patchUpdateSolidEntity: import("@reduxjs/toolkit/query/react").MutationDefinition<any, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, string, any, `genericSolid${string}Api`>;
|
|
21
21
|
publishSolidEntity: import("@reduxjs/toolkit/query/react").MutationDefinition<any, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, string, any, `genericSolid${string}Api`>;
|
|
@@ -133,9 +133,12 @@ var createSolidEntityApiInternal = function (entityName) {
|
|
|
133
133
|
{ type: entityName, id: 'LIST' },
|
|
134
134
|
]; },
|
|
135
135
|
}),
|
|
136
|
-
recoverSolidEntityById: builder.
|
|
136
|
+
recoverSolidEntityById: builder.mutation({
|
|
137
137
|
query: function (id) { return "/".concat(kebabEntityName, "/recover/").concat(id); },
|
|
138
|
-
|
|
138
|
+
invalidatesTags: function (_result, _error, id) { return [
|
|
139
|
+
{ type: entityName, id: id },
|
|
140
|
+
{ type: entityName, id: 'LIST' },
|
|
141
|
+
]; },
|
|
139
142
|
}),
|
|
140
143
|
recoverSolidEntity: builder.mutation({
|
|
141
144
|
query: function (data) { return ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solidEntityApi.js","sourceRoot":"","sources":["../../../src/redux/api/solidEntityApi.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,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oB,EAAE,OAAO,CAAC,QAAQ,CAAC;gBACnC,KAAK,EAAE,UAAC,EAAE,IAAK,OAAA,CAAC;oBACZ,GAAG,EAAE,WAAI,eAAe,cAAI,EAAE,eAAY;oBAC1C,MAAM,EAAE,MAAM;iBACjB,CAAC,EAHa,CAGb;gBACF,eAAe,EAAE,UAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAK,OAAA;oBACtC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,IAAA,EAAE;oBACxB,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE;iBACnC,EAHyC,CAGzC;aACJ,CAAC;SAEL,CAAC,EA1IsB,CA0ItB;KACL,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,iBAAiB;AACjB,oCAAoC;AACpC,8CAA8C;AAC9C,oCAAoC;AACpC,gCAAgC;AAChC,kCAAkC;AAClC,oCAAoC;AACpC,sCAAsC;AACtC,mBAAmB;AACnB,mCAAmC;AACnC,sBAAsB","sourcesContent":["import { createApi } from '@reduxjs/toolkit/query/react';\nimport { baseQueryWithAuth } from './fetchBaseQuery';\nimport { kebabCase } from 'lodash';\nimport { ensureSolidEntityApiRegistered } from '../store/solidEntityApiPool';\n\nconst solidEntityApiCache = new Map<string, ReturnType<typeof createSolidEntityApiInternal>>();\n\nexport const createSolidEntityApi = (entityName: string) => {\n const cachedApi = solidEntityApiCache.get(entityName);\n if (cachedApi) {\n ensureSolidEntityApiRegistered(entityName, cachedApi);\n return cachedApi;\n }\n\n const api = createSolidEntityApiInternal(entityName);\n solidEntityApiCache.set(entityName, api);\n ensureSolidEntityApiRegistered(entityName, api);\n return api;\n};\n\nconst createSolidEntityApiInternal = (entityName: string) => {\n const kebabEntityName = kebabCase(entityName);\n\n return createApi({\n reducerPath: `genericSolid${entityName}Api`,\n baseQuery: baseQueryWithAuth,\n tagTypes: [entityName],\n endpoints: (builder) => ({\n getSolidEntities: builder.query({\n query: (qs) => {\n return `/${kebabEntityName}?&${qs}`\n },\n transformResponse: (response: any) => {\n if (response.error) {\n throw new Error(response.error);\n }\n return {\n records: response.data.records,\n meta: response.data.meta,\n groupMeta: response?.data?.groupMeta,\n groupRecords: response?.data?.groupRecords ? response.data.groupRecords : [],\n }\n },\n providesTags: (result) =>\n result?.records\n ? [\n ...result.records.map((record: { id: any; }) => ({\n type: entityName,\n id: record.id,\n })),\n { type: entityName, id: 'LIST' },\n ]\n : [{ type: entityName, id: 'LIST' }]\n }),\n getSolidKanbanEntities: builder.query({\n query: (qs) => {\n return `/${kebabEntityName}/group-kanban?&${qs}`\n },\n transformResponse: (response: any) => {\n if (response.error) {\n throw new Error(response.error);\n }\n return {\n records: response.data.records.groupedData,\n meta: response.data.meta\n }\n },\n providesTags: [{ type: entityName, id: 'KANBAN' }],\n }),\n getSolidEntityById: builder.query({\n query: ({ id, qs }) => {\n return `/${kebabEntityName}/${id}?${qs}`\n },\n // providesTags: () => [{ type: entityName }],\n providesTags: (_result, _error, { id }) => [{ type: entityName, id }],\n }),\n createSolidEntity: builder.mutation({\n query: (entity) => ({\n url: `/${kebabEntityName}`,\n method: 'POST',\n body: entity\n }),\n invalidatesTags: [{ type: entityName, id: 'LIST' }],\n }),\n upsertSolidEntity: builder.mutation({\n query: (entity) => ({\n url: `/${kebabEntityName}/upsert`,\n method: 'POST',\n body: entity\n }),\n invalidatesTags: [{ type: entityName, id: 'LIST' }],\n }),\n updateSolidEntity: builder.mutation({\n query: ({ id, data }) => ({\n url: `/${kebabEntityName}/${id}`,\n method: 'PUT',\n body: data,\n }),\n invalidatesTags: (_result, _error, { id }) => [\n { type: entityName, id },\n { type: entityName, id: 'LIST' },\n ],\n }),\n deleteMultipleSolidEntities: builder.mutation({\n query: (data) => ({\n url: `/${kebabEntityName}/bulk/`,\n method: 'DELETE',\n body: data\n }),\n invalidatesTags: [{ type: entityName, id: 'LIST' }]\n }),\n deleteSolidEntity: builder.mutation({\n query: (id) => ({\n url: `/${kebabEntityName}/${id}`,\n method: 'DELETE',\n }),\n invalidatesTags: (_result, _error, id) => [\n { type: entityName, id },\n { type: entityName, id: 'LIST' },\n ],\n }),\n recoverSolidEntityById: builder.query({\n query: (id) => `/${kebabEntityName}/recover/${id}`,\n providesTags: (_result, _error, id) => [{ type: entityName, id }],\n }),\n recoverSolidEntity: builder.mutation({\n query: (data) => ({\n url: `/${kebabEntityName}/bulk-recover/`,\n method: 'POST',\n body: data\n }),\n invalidatesTags: [{ type: entityName, id: 'LIST' }],\n }),\n patchUpdateSolidEntity: builder.mutation({\n query: ({ id, data }) => ({\n url: `/${kebabEntityName}/${id}`,\n method: 'PATCH',\n body: data,\n }),\n invalidatesTags: (_result, _error, { id }) => [\n { type: entityName, id },\n { type: entityName, id: 'LIST' },\n ],\n }),\n publishSolidEntity: builder.mutation({\n query: (id) => ({\n url: `/${kebabEntityName}/${id}/publish`,\n method: 'POST'\n }),\n invalidatesTags: (_result, _error, id) => [\n { type: entityName, id },\n { type: entityName, id: 'LIST' }\n ]\n }),\n unpublishSolidEntity: builder.mutation({\n query: (id) => ({\n url: `/${kebabEntityName}/${id}/unpublish`,\n method: 'POST'\n }),\n invalidatesTags: (_result, _error, id) => [\n { type: entityName, id },\n { type: entityName, id: 'LIST' }\n ]\n }),\n\n }),\n });\n};\n\n// export const {\n// useCreateSolidEntityMutation,\n// useDeleteMultipleSolidEntitiesMutation,\n// useDeleteSolidEntityMutation,\n// useGetSolidEntitiesQuery,\n// useGetSolidEntityByIdQuery,\n// useLazyGetSolidEntitiesQuery,\n// useLazyGetSolidEntityByIdQuery,\n// usePrefetch,\n// useUpdateSolidEntityMutation\n// } = solidEntityApi;\n"]}
|
|
1
|
+
{"version":3,"file":"solidEntityApi.js","sourceRoot":"","sources":["../../../src/redux/api/solidEntityApi.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO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AAA,EAAE;oBACxB,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE;iBACnC,EAHyC,CAGzC;aACJ,CAAC;YACF,oBAAoB,EAAE,OAAO,CAAC,QAAQ,CAAC;gBACnC,KAAK,EAAE,UAAC,EAAE,IAAK,OAAA,CAAC;oBACZ,GAAG,EAAE,WAAI,eAAe,cAAI,EAAE,eAAY;oBAC1C,MAAM,EAAE,MAAM;iBACjB,CAAC,EAHa,CAGb;gBACF,eAAe,EAAE,UAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAK,OAAA;oBACtC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,IAAA,EAAE;oBACxB,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE;iBACnC,EAHyC,CAGzC;aACJ,CAAC;SAEL,CAAC,EA7IsB,CA6ItB;KACL,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,iBAAiB;AACjB,oCAAoC;AACpC,8CAA8C;AAC9C,oCAAoC;AACpC,gCAAgC;AAChC,kCAAkC;AAClC,oCAAoC;AACpC,sCAAsC;AACtC,mBAAmB;AACnB,mCAAmC;AACnC,sBAAsB","sourcesContent":["import { createApi } from '@reduxjs/toolkit/query/react';\nimport { baseQueryWithAuth } from './fetchBaseQuery';\nimport { kebabCase } from 'lodash';\nimport { ensureSolidEntityApiRegistered } from '../store/solidEntityApiPool';\n\nconst solidEntityApiCache = new Map<string, ReturnType<typeof createSolidEntityApiInternal>>();\n\nexport const createSolidEntityApi = (entityName: string) => {\n const cachedApi = solidEntityApiCache.get(entityName);\n if (cachedApi) {\n ensureSolidEntityApiRegistered(entityName, cachedApi);\n return cachedApi;\n }\n\n const api = createSolidEntityApiInternal(entityName);\n solidEntityApiCache.set(entityName, api);\n ensureSolidEntityApiRegistered(entityName, api);\n return api;\n};\n\nconst createSolidEntityApiInternal = (entityName: string) => {\n const kebabEntityName = kebabCase(entityName);\n\n return createApi({\n reducerPath: `genericSolid${entityName}Api`,\n baseQuery: baseQueryWithAuth,\n tagTypes: [entityName],\n endpoints: (builder) => ({\n getSolidEntities: builder.query({\n query: (qs) => {\n return `/${kebabEntityName}?&${qs}`\n },\n transformResponse: (response: any) => {\n if (response.error) {\n throw new Error(response.error);\n }\n return {\n records: response.data.records,\n meta: response.data.meta,\n groupMeta: response?.data?.groupMeta,\n groupRecords: response?.data?.groupRecords ? response.data.groupRecords : [],\n }\n },\n providesTags: (result) =>\n result?.records\n ? [\n ...result.records.map((record: { id: any; }) => ({\n type: entityName,\n id: record.id,\n })),\n { type: entityName, id: 'LIST' },\n ]\n : [{ type: entityName, id: 'LIST' }]\n }),\n getSolidKanbanEntities: builder.query({\n query: (qs) => {\n return `/${kebabEntityName}/group-kanban?&${qs}`\n },\n transformResponse: (response: any) => {\n if (response.error) {\n throw new Error(response.error);\n }\n return {\n records: response.data.records.groupedData,\n meta: response.data.meta\n }\n },\n providesTags: [{ type: entityName, id: 'KANBAN' }],\n }),\n getSolidEntityById: builder.query({\n query: ({ id, qs }) => {\n return `/${kebabEntityName}/${id}?${qs}`\n },\n // providesTags: () => [{ type: entityName }],\n providesTags: (_result, _error, { id }) => [{ type: entityName, id }],\n }),\n createSolidEntity: builder.mutation({\n query: (entity) => ({\n url: `/${kebabEntityName}`,\n method: 'POST',\n body: entity\n }),\n invalidatesTags: [{ type: entityName, id: 'LIST' }],\n }),\n upsertSolidEntity: builder.mutation({\n query: (entity) => ({\n url: `/${kebabEntityName}/upsert`,\n method: 'POST',\n body: entity\n }),\n invalidatesTags: [{ type: entityName, id: 'LIST' }],\n }),\n updateSolidEntity: builder.mutation({\n query: ({ id, data }) => ({\n url: `/${kebabEntityName}/${id}`,\n method: 'PUT',\n body: data,\n }),\n invalidatesTags: (_result, _error, { id }) => [\n { type: entityName, id },\n { type: entityName, id: 'LIST' },\n ],\n }),\n deleteMultipleSolidEntities: builder.mutation({\n query: (data) => ({\n url: `/${kebabEntityName}/bulk/`,\n method: 'DELETE',\n body: data\n }),\n invalidatesTags: [{ type: entityName, id: 'LIST' }]\n }),\n deleteSolidEntity: builder.mutation({\n query: (id) => ({\n url: `/${kebabEntityName}/${id}`,\n method: 'DELETE',\n }),\n invalidatesTags: (_result, _error, id) => [\n { type: entityName, id },\n { type: entityName, id: 'LIST' },\n ],\n }),\n recoverSolidEntityById: builder.mutation({\n query: (id) => `/${kebabEntityName}/recover/${id}`,\n invalidatesTags: (_result, _error, id) => [\n { type: entityName, id },\n { type: entityName, id: 'LIST' },\n ],\n }),\n recoverSolidEntity: builder.mutation({\n query: (data) => ({\n url: `/${kebabEntityName}/bulk-recover/`,\n method: 'POST',\n body: data\n }),\n invalidatesTags: [{ type: entityName, id: 'LIST' }],\n }),\n patchUpdateSolidEntity: builder.mutation({\n query: ({ id, data }) => ({\n url: `/${kebabEntityName}/${id}`,\n method: 'PATCH',\n body: data,\n }),\n invalidatesTags: (_result, _error, { id }) => [\n { type: entityName, id },\n { type: entityName, id: 'LIST' },\n ],\n }),\n publishSolidEntity: builder.mutation({\n query: (id) => ({\n url: `/${kebabEntityName}/${id}/publish`,\n method: 'POST'\n }),\n invalidatesTags: (_result, _error, id) => [\n { type: entityName, id },\n { type: entityName, id: 'LIST' }\n ]\n }),\n unpublishSolidEntity: builder.mutation({\n query: (id) => ({\n url: `/${kebabEntityName}/${id}/unpublish`,\n method: 'POST'\n }),\n invalidatesTags: (_result, _error, id) => [\n { type: entityName, id },\n { type: entityName, id: 'LIST' }\n ]\n }),\n\n }),\n });\n};\n\n// export const {\n// useCreateSolidEntityMutation,\n// useDeleteMultipleSolidEntitiesMutation,\n// useDeleteSolidEntityMutation,\n// useGetSolidEntitiesQuery,\n// useGetSolidEntityByIdQuery,\n// useLazyGetSolidEntitiesQuery,\n// useLazyGetSolidEntityByIdQuery,\n// usePrefetch,\n// useUpdateSolidEntityMutation\n// } = solidEntityApi;\n"]}
|
|
@@ -119,9 +119,12 @@ const createSolidEntityApiInternal = (entityName: string) => {
|
|
|
119
119
|
{ type: entityName, id: 'LIST' },
|
|
120
120
|
],
|
|
121
121
|
}),
|
|
122
|
-
recoverSolidEntityById: builder.
|
|
122
|
+
recoverSolidEntityById: builder.mutation({
|
|
123
123
|
query: (id) => `/${kebabEntityName}/recover/${id}`,
|
|
124
|
-
|
|
124
|
+
invalidatesTags: (_result, _error, id) => [
|
|
125
|
+
{ type: entityName, id },
|
|
126
|
+
{ type: entityName, id: 'LIST' },
|
|
127
|
+
],
|
|
125
128
|
}),
|
|
126
129
|
recoverSolidEntity: builder.mutation({
|
|
127
130
|
query: (data) => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AgentThreadState } from "../../components/core/solid-agent/agentEvents";
|
|
2
|
-
import { type AgentAttachmentMeta, type AgentChatEvent, type AgentChatItem, type AgentConnection, type AgentContext, type AgentMode, type SolidAgentOpenOptions } from "../../components/core/solid-agent/types";
|
|
2
|
+
import { type AgentAttachmentMeta, type AgentChatEvent, type AgentChatItem, type AgentConnection, type AgentContext, type AgentMessageContext, type AgentMode, type AgentUsageStats, type SolidAgentOpenOptions } from "../../components/core/solid-agent/types";
|
|
3
3
|
/**
|
|
4
4
|
* State of the SolidX Agent chat: window mode, connection, and the single global thread.
|
|
5
5
|
* The socket lives outside Redux (AgentRuntime); every normalised event is dispatched as
|
|
@@ -24,10 +24,12 @@ export type AgentState = AgentThreadState & {
|
|
|
24
24
|
export declare const agentOpenRequested: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<SolidAgentOpenOptions | undefined, "solidAgent/agentOpenRequested">, agentClosed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"solidAgent/agentClosed">, agentModeChanged: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgentMode, "solidAgent/agentModeChanged">, agentPrefillConsumed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"solidAgent/agentPrefillConsumed">, agentConnectionChanged: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgentConnection, "solidAgent/agentConnectionChanged">, agentUserMessageAdded: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
25
25
|
text: string;
|
|
26
26
|
attachments?: AgentAttachmentMeta[] | undefined;
|
|
27
|
+
messageContext?: AgentMessageContext | undefined;
|
|
27
28
|
}, "solidAgent/agentUserMessageAdded">, agentThreadReset: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"solidAgent/agentThreadReset">, agentHistoryLoaded: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
28
29
|
items: AgentChatItem[];
|
|
29
30
|
hasMore: boolean;
|
|
30
31
|
page: number;
|
|
32
|
+
usage?: AgentUsageStats | null | undefined;
|
|
31
33
|
}, "solidAgent/agentHistoryLoaded">, agentEventReceived: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgentChatEvent, "solidAgent/agentEventReceived">;
|
|
32
34
|
declare const _default: import("@reduxjs/toolkit").Reducer<AgentState>;
|
|
33
35
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentSlice.d.ts","sourceRoot":"","sources":["../../../src/redux/features/agentSlice.ts"],"names":[],"mappings":"AACA,OAAO,EAAkD,KAAK,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACtI,OAAO,EAEH,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC7B,MAAM,yCAAyC,CAAC;AAEjD;;;;GAIG;AAEH,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzG,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,eAA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MAAM;;qCA4B5G,kBAAkB,sGACA,CAAC;;AAEvB,wBAAkC"}
|
|
@@ -58,12 +58,12 @@ var agentSlice = createSlice({
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
agentUserMessageAdded: function (state, action) {
|
|
61
|
-
var _a = action.payload, text = _a.text, attachments = _a.attachments;
|
|
61
|
+
var _a = action.payload, text = _a.text, attachments = _a.attachments, messageContext = _a.messageContext;
|
|
62
62
|
state.items.push({
|
|
63
63
|
id: nextItemId("u"),
|
|
64
64
|
at: Date.now(),
|
|
65
65
|
eventType: AgentEventTypes.userMessage,
|
|
66
|
-
eventData: (attachments === null || attachments === void 0 ? void 0 : attachments.length) ? {
|
|
66
|
+
eventData: __assign(__assign({ content: text }, ((attachments === null || attachments === void 0 ? void 0 : attachments.length) ? { attachments: attachments } : {})), (messageContext ? { message_context: messageContext } : {})),
|
|
67
67
|
});
|
|
68
68
|
state.working = true;
|
|
69
69
|
state.thinking = true;
|
|
@@ -76,11 +76,15 @@ var agentSlice = createSlice({
|
|
|
76
76
|
Object.assign(state, createThreadState(), { commands: state.commands, hasMoreHistory: false, historyPage: 1 });
|
|
77
77
|
},
|
|
78
78
|
agentHistoryLoaded: function (state, action) {
|
|
79
|
-
var _a
|
|
79
|
+
var _a;
|
|
80
|
+
var _b = action.payload, items = _b.items, hasMore = _b.hasMore, page = _b.page, usage = _b.usage;
|
|
80
81
|
// History is always older than anything already in the thread.
|
|
81
82
|
state.items = __spreadArray(__spreadArray([], items, true), state.items, true);
|
|
82
83
|
state.hasMoreHistory = hasMore;
|
|
83
84
|
state.historyPage = page;
|
|
85
|
+
if (usage && (!state.usage || state.usage.totalTokens === 0)) {
|
|
86
|
+
state.usage = __assign(__assign({}, usage), { contextLimit: ((_a = state.usage) === null || _a === void 0 ? void 0 : _a.contextLimit) || usage.contextLimit || 0 });
|
|
87
|
+
}
|
|
84
88
|
},
|
|
85
89
|
agentEventReceived: function (state, action) {
|
|
86
90
|
applyAgentEvent(state, action.payload);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentSlice.js","sourceRoot":"","sources":["../../../src/redux/features/agentSlice.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAsB,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAyB,MAAM,+CAA+C,CAAC;AACtI,OAAO,EACH,eAAe,
|
|
1
|
+
{"version":3,"file":"agentSlice.js","sourceRoot":"","sources":["../../../src/redux/features/agentSlice.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAsB,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAyB,MAAM,+CAA+C,CAAC;AACtI,OAAO,EACH,eAAe,GAUlB,MAAM,yCAAyC,CAAC;AAqBjD,IAAM,YAAY,yBACX,iBAAiB,EAAE,KACtB,IAAI,EAAE,KAAK,EACX,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,IAAI,EACb,cAAc,EAAE,KAAK,EACrB,WAAW,EAAE,CAAC,EACd,OAAO,EAAE,IAAI,GAChB,CAAC;AAEF,IAAM,UAAU,GAAG,WAAW,CAAC;IAC3B,IAAI,EAAE,YAAY;IAClB,YAAY,cAAA;IACZ,QAAQ,EAAE;QACN,kBAAkB,YAAC,KAAK,EAAE,MAAwD;;YAC9E,IAAM,OAAO,GAAG,MAAA,MAAM,CAAC,OAAO,mCAAI,EAAE,CAAC;YACrC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;YAClB,KAAK,CAAC,IAAI,GAAG,MAAA,OAAO,CAAC,IAAI,mCAAI,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAChF,IAAI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AAC,WAAW,KAAK,CAAC,CAAC,EAAE;gBAC1D,KAAK,CAAC,KAAK,yBACJ,KAAK,KACR,YAAY,EAAE,CAAA,MAAA,KAAK,CAAC,KAAK,0CAAE,YAAY,KAAI,KAAK,CAAC,YAAY,IAAI,CAAC,GACrE,CAAC;aACL;QACL,CAAC;QACD,kBAAkB,YAAC,KAAK,EAAE,MAAqC;YAC3D,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;KACJ;CACJ,CAAC,CAAC;AAEH,MAAM,CACF,IAAA,kBAAkB,IADT,KAUT,UAAU,CAAC,OAAO,wBATA,EAClB,WAAW,iBAAA,EACX,gBAAgB,sBAAA,EAChB,oBAAoB,0BAAA,EACpB,sBAAsB,4BAAA,EACtB,qBAAqB,2BAAA,EACrB,gBAAgB,sBAAA,EAChB,kBAAkB,wBAAA,EAClB,kBAAkB,wBAAA,CACC;AAEvB,eAAe,UAAU,CAAC,OAAO,CAAC","sourcesContent":["import { createSlice, type PayloadAction } from \"@reduxjs/toolkit\";\nimport { applyAgentEvent, createThreadState, nextItemId, type AgentThreadState } from \"../../components/core/solid-agent/agentEvents\";\nimport {\n AgentEventTypes,\n type AgentAttachmentMeta,\n type AgentChatEvent,\n type AgentChatItem,\n type AgentConnection,\n type AgentContext,\n type AgentMessageContext,\n type AgentMode,\n type AgentUsageStats,\n type SolidAgentOpenOptions,\n} from \"../../components/core/solid-agent/types\";\n\n/**\n * State of the SolidX Agent chat: window mode, connection, and the single global thread.\n * The socket lives outside Redux (AgentRuntime); every normalised event is dispatched as\n * `agentEventReceived` and applied by the shared reducer in solid-agent/agentEvents.ts.\n */\n\nexport type AgentPrefill = { prompt: string; context?: AgentContext; autoSend?: boolean; nonce: number };\n\nexport type AgentState = AgentThreadState & {\n open: boolean;\n mode: AgentMode;\n connection: AgentConnection;\n prefill: AgentPrefill | null;\n hasMoreHistory: boolean;\n historyPage: number;\n /** Context of the last prompt sent from outside the chat (e.g. a Test Hub button). */\n context: AgentContext | null;\n};\n\nconst initialState: AgentState = {\n ...createThreadState(),\n open: false,\n mode: \"bubble\",\n connection: \"idle\",\n prefill: null,\n hasMoreHistory: false,\n historyPage: 1,\n context: null,\n};\n\nconst agentSlice = createSlice({\n name: \"solidAgent\",\n initialState,\n reducers: {\n agentOpenRequested(state, action: PayloadAction<SolidAgentOpenOptions | undefined>) {\n const options = action.payload ?? {};\n state.open = true;\n state.mode = options.mode ?? (state.mode === \"bubble\" ? \"compact\" : state.mode);\n if (options.prompt) {\n state.prefill = { prompt: options.prompt, context: options.context, autoSend: options.autoSend, nonce: Date.now() };\n }\n if (options.context) state.context = options.context;\n },\n agentClosed(state) {\n state.open = false;\n state.mode = \"bubble\";\n },\n agentModeChanged(state, action: PayloadAction<AgentMode>) {\n state.mode = action.payload;\n state.open = action.payload !== \"bubble\";\n },\n agentPrefillConsumed(state) {\n state.prefill = null;\n },\n agentConnectionChanged(state, action: PayloadAction<AgentConnection>) {\n state.connection = action.payload;\n if (action.payload !== \"open\" && state.working) {\n // A turn cannot finish on a dropped socket; unblock the composer.\n state.working = false;\n state.thinking = false;\n }\n },\n agentUserMessageAdded(state, action: PayloadAction<{ text: string; attachments?: AgentAttachmentMeta[]; messageContext?: AgentMessageContext }>) {\n const { text, attachments, messageContext } = action.payload;\n state.items.push({\n id: nextItemId(\"u\"),\n at: Date.now(),\n eventType: AgentEventTypes.userMessage,\n eventData: {\n content: text,\n ...(attachments?.length ? { attachments } : {}),\n ...(messageContext ? { message_context: messageContext } : {}),\n },\n });\n state.working = true;\n state.thinking = true;\n state.turnStreamed = false;\n state.streamingId = null;\n state.liveToolId = null;\n state.authError = null;\n },\n agentThreadReset(state) {\n Object.assign(state, createThreadState(), { commands: state.commands, hasMoreHistory: false, historyPage: 1 });\n },\n agentHistoryLoaded(state, action: PayloadAction<{ items: AgentChatItem[]; hasMore: boolean; page: number; usage?: AgentUsageStats | null }>) {\n const { items, hasMore, page, usage } = action.payload;\n // History is always older than anything already in the thread.\n state.items = [...items, ...state.items];\n state.hasMoreHistory = hasMore;\n state.historyPage = page;\n if (usage && (!state.usage || state.usage.totalTokens === 0)) {\n state.usage = {\n ...usage,\n contextLimit: state.usage?.contextLimit || usage.contextLimit || 0,\n };\n }\n },\n agentEventReceived(state, action: PayloadAction<AgentChatEvent>) {\n applyAgentEvent(state, action.payload);\n },\n },\n});\n\nexport const {\n agentOpenRequested,\n agentClosed,\n agentModeChanged,\n agentPrefillConsumed,\n agentConnectionChanged,\n agentUserMessageAdded,\n agentThreadReset,\n agentHistoryLoaded,\n agentEventReceived,\n} = agentSlice.actions;\n\nexport default agentSlice.reducer;\n"]}
|
|
@@ -7,7 +7,9 @@ import {
|
|
|
7
7
|
type AgentChatItem,
|
|
8
8
|
type AgentConnection,
|
|
9
9
|
type AgentContext,
|
|
10
|
+
type AgentMessageContext,
|
|
10
11
|
type AgentMode,
|
|
12
|
+
type AgentUsageStats,
|
|
11
13
|
type SolidAgentOpenOptions,
|
|
12
14
|
} from "../../components/core/solid-agent/types";
|
|
13
15
|
|
|
@@ -73,13 +75,17 @@ const agentSlice = createSlice({
|
|
|
73
75
|
state.thinking = false;
|
|
74
76
|
}
|
|
75
77
|
},
|
|
76
|
-
agentUserMessageAdded(state, action: PayloadAction<{ text: string; attachments?: AgentAttachmentMeta[] }>) {
|
|
77
|
-
const { text, attachments } = action.payload;
|
|
78
|
+
agentUserMessageAdded(state, action: PayloadAction<{ text: string; attachments?: AgentAttachmentMeta[]; messageContext?: AgentMessageContext }>) {
|
|
79
|
+
const { text, attachments, messageContext } = action.payload;
|
|
78
80
|
state.items.push({
|
|
79
81
|
id: nextItemId("u"),
|
|
80
82
|
at: Date.now(),
|
|
81
83
|
eventType: AgentEventTypes.userMessage,
|
|
82
|
-
eventData:
|
|
84
|
+
eventData: {
|
|
85
|
+
content: text,
|
|
86
|
+
...(attachments?.length ? { attachments } : {}),
|
|
87
|
+
...(messageContext ? { message_context: messageContext } : {}),
|
|
88
|
+
},
|
|
83
89
|
});
|
|
84
90
|
state.working = true;
|
|
85
91
|
state.thinking = true;
|
|
@@ -91,12 +97,18 @@ const agentSlice = createSlice({
|
|
|
91
97
|
agentThreadReset(state) {
|
|
92
98
|
Object.assign(state, createThreadState(), { commands: state.commands, hasMoreHistory: false, historyPage: 1 });
|
|
93
99
|
},
|
|
94
|
-
agentHistoryLoaded(state, action: PayloadAction<{ items: AgentChatItem[]; hasMore: boolean; page: number }>) {
|
|
95
|
-
const { items, hasMore, page } = action.payload;
|
|
100
|
+
agentHistoryLoaded(state, action: PayloadAction<{ items: AgentChatItem[]; hasMore: boolean; page: number; usage?: AgentUsageStats | null }>) {
|
|
101
|
+
const { items, hasMore, page, usage } = action.payload;
|
|
96
102
|
// History is always older than anything already in the thread.
|
|
97
103
|
state.items = [...items, ...state.items];
|
|
98
104
|
state.hasMoreHistory = hasMore;
|
|
99
105
|
state.historyPage = page;
|
|
106
|
+
if (usage && (!state.usage || state.usage.totalTokens === 0)) {
|
|
107
|
+
state.usage = {
|
|
108
|
+
...usage,
|
|
109
|
+
contextLimit: state.usage?.contextLimit || usage.contextLimit || 0,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
100
112
|
},
|
|
101
113
|
agentEventReceived(state, action: PayloadAction<AgentChatEvent>) {
|
|
102
114
|
applyAgentEvent(state, action.payload);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreProvider.d.ts","sourceRoot":"","sources":["../../../src/redux/store/StoreProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"StoreProvider.d.ts","sourceRoot":"","sources":["../../../src/redux/store/StoreProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,oBAAoB,CAAC;AA0BvE,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,EACR,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAC3E,WAAW,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;CAClF,2CAkEA"}
|