@vertesia/ui 1.0.0-dev.20260128.144200 → 1.0.0-dev.20260225.024852Z
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/lib/esm/core/components/InputList.js +1 -1
- package/lib/esm/core/components/InputList.js.map +1 -1
- package/lib/esm/core/components/Overlay.js +1 -1
- package/lib/esm/core/components/Overlay.js.map +1 -1
- package/lib/esm/core/components/SidePanel.js +8 -2
- package/lib/esm/core/components/SidePanel.js.map +1 -1
- package/lib/esm/core/components/Switch.js +1 -1
- package/lib/esm/core/components/Switch.js.map +1 -1
- package/lib/esm/core/components/index.js +0 -8
- package/lib/esm/core/components/index.js.map +1 -1
- package/lib/esm/core/components/shadcn/MessageBox.js.map +1 -0
- package/lib/esm/core/components/shadcn/Panel.js +13 -0
- package/lib/esm/core/components/shadcn/Panel.js.map +1 -0
- package/lib/esm/core/components/{Badge.js → shadcn/badge.js} +2 -2
- package/lib/esm/core/components/shadcn/badge.js.map +1 -0
- package/lib/esm/core/components/shadcn/command.js +1 -1
- package/lib/esm/core/components/shadcn/command.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filterBar.js +73 -83
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/esm/core/components/shadcn/index.js +4 -2
- package/lib/esm/core/components/shadcn/index.js.map +1 -1
- package/lib/esm/core/components/shadcn/modal/ConfirmModal.js +10 -0
- package/lib/esm/core/components/shadcn/modal/ConfirmModal.js.map +1 -0
- package/lib/esm/core/components/{DeleteModal.js → shadcn/modal/DeleteModal.js} +1 -1
- package/lib/esm/core/components/shadcn/modal/DeleteModal.js.map +1 -0
- package/lib/esm/core/components/shadcn/{dialog.js → modal/dialog.js} +19 -15
- package/lib/esm/core/components/shadcn/modal/dialog.js.map +1 -0
- package/lib/esm/core/components/shadcn/modal/index.js +4 -0
- package/lib/esm/core/components/shadcn/modal/index.js.map +1 -0
- package/lib/esm/core/components/shadcn/popover.js +4 -2
- package/lib/esm/core/components/shadcn/popover.js.map +1 -1
- package/lib/esm/core/components/shadcn/selectBox.js +19 -15
- package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
- package/lib/esm/core/components/shadcn/tabs.js +16 -14
- package/lib/esm/core/components/shadcn/tabs.js.map +1 -1
- package/lib/esm/core/components/shadcn/textarea.js +30 -2
- package/lib/esm/core/components/shadcn/textarea.js.map +1 -1
- package/lib/esm/core/components/shadcn/tooltip.js +5 -1
- package/lib/esm/core/components/shadcn/tooltip.js.map +1 -1
- package/lib/esm/features/agent/PayloadBuilder.js +45 -0
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
- package/lib/esm/features/agent/chat/AgentChart.js +12 -232
- package/lib/esm/features/agent/chat/AgentChart.js.map +1 -1
- package/lib/esm/features/agent/chat/AskUserWidget.js +2 -1
- package/lib/esm/features/agent/chat/AskUserWidget.js.map +1 -1
- package/lib/esm/features/agent/chat/DocumentPanel.js +46 -0
- package/lib/esm/features/agent/chat/DocumentPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/DocumentTabBar.js +17 -0
- package/lib/esm/features/agent/chat/DocumentTabBar.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentConversation.js +159 -402
- package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +99 -57
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/BatchProgressPanel.js +4 -4
- package/lib/esm/features/agent/chat/ModernAgentOutput/BatchProgressPanel.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +4 -4
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js +3 -3
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js +25 -22
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +110 -55
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/StreamingMessage.js +2 -2
- package/lib/esm/features/agent/chat/ModernAgentOutput/StreamingMessage.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/ToolCallGroup.js +146 -55
- package/lib/esm/features/agent/chat/ModernAgentOutput/ToolCallGroup.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +5 -6
- package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js +110 -2
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
- package/lib/esm/features/agent/chat/SkillWidgetProvider.js +28 -15
- package/lib/esm/features/agent/chat/SkillWidgetProvider.js.map +1 -1
- package/lib/esm/features/agent/chat/hooks/useAgentPlans.js +146 -0
- package/lib/esm/features/agent/chat/hooks/useAgentPlans.js.map +1 -0
- package/lib/esm/features/agent/chat/hooks/useAgentStream.js +180 -0
- package/lib/esm/features/agent/chat/hooks/useAgentStream.js.map +1 -0
- package/lib/esm/features/agent/chat/hooks/useDocumentPanel.js +100 -0
- package/lib/esm/features/agent/chat/hooks/useDocumentPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/hooks/useFileProcessing.js +90 -0
- package/lib/esm/features/agent/chat/hooks/useFileProcessing.js.map +1 -0
- package/lib/esm/features/agent/chat/index.js +6 -5
- package/lib/esm/features/agent/chat/index.js.map +1 -1
- package/lib/esm/features/agent/chat/types/document.js +2 -0
- package/lib/esm/features/agent/chat/types/document.js.map +1 -0
- package/lib/esm/features/agent/index.js +0 -2
- package/lib/esm/features/agent/index.js.map +1 -1
- package/lib/esm/features/store/collections/BrowseCollectionView.js +4 -6
- package/lib/esm/features/store/collections/BrowseCollectionView.js.map +1 -1
- package/lib/esm/features/store/collections/CreateCollection.js +4 -4
- package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
- package/lib/esm/features/store/collections/EditCollectionView.js +1 -1
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentSearchResults.js +5 -5
- package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/esm/features/store/objects/ExportPropertiesModal.js +3 -3
- package/lib/esm/features/store/objects/ExportPropertiesModal.js.map +1 -1
- package/lib/esm/features/store/objects/components/ContentOverview.js +19 -120
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js +1 -1
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js.map +1 -1
- package/lib/esm/features/store/objects/components/SelectDocumentModal.js +2 -2
- package/lib/esm/features/store/objects/components/SelectDocumentModal.js.map +1 -1
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js +1 -1
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js.map +1 -1
- package/lib/esm/features/store/objects/components/index.js +1 -1
- package/lib/esm/features/store/objects/components/index.js.map +1 -1
- package/lib/esm/features/store/objects/components/useDownloadFile.js +192 -0
- package/lib/esm/features/store/objects/components/useDownloadFile.js.map +1 -0
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js +1 -2
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -1
- package/lib/esm/features/store/objects/selection/SelectionActions.js +5 -8
- package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +4 -4
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js +2 -2
- package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js +1 -1
- package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js +3 -3
- package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js.map +1 -1
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +13 -13
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
- package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js +15 -8
- package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js.map +1 -1
- package/lib/esm/features/store/types/ObjectSchemaEditor.js +6 -5
- package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
- package/lib/esm/features/store/types/SelectContentType.js +3 -3
- package/lib/esm/features/store/types/SelectContentType.js.map +1 -1
- package/lib/esm/features/store/types/SelectContentTypeModal.js +5 -4
- package/lib/esm/features/store/types/SelectContentTypeModal.js.map +1 -1
- package/lib/esm/features/store/types/TableLayoutEditor.js +4 -4
- package/lib/esm/features/store/types/TableLayoutEditor.js.map +1 -1
- package/lib/esm/features/user/UserInfo.js +73 -9
- package/lib/esm/features/user/UserInfo.js.map +1 -1
- package/lib/esm/features/utils/print.js +0 -1
- package/lib/esm/features/utils/print.js.map +1 -1
- package/lib/esm/layout/AppLayout.js +3 -4
- package/lib/esm/layout/AppLayout.js.map +1 -1
- package/lib/esm/layout/Sidebar.js +5 -5
- package/lib/esm/layout/Sidebar.js.map +1 -1
- package/lib/esm/router/HistoryNavigator.js +7 -1
- package/lib/esm/router/HistoryNavigator.js.map +1 -1
- package/lib/esm/router/Nav.js +2 -2
- package/lib/esm/router/Nav.js.map +1 -1
- package/lib/esm/session/UserSession.js +35 -9
- package/lib/esm/session/UserSession.js.map +1 -1
- package/lib/esm/session/UserSessionProvider.js +3 -2
- package/lib/esm/session/UserSessionProvider.js.map +1 -1
- package/lib/esm/shell/apps/AppProjectSelector.js +2 -2
- package/lib/esm/shell/apps/AppProjectSelector.js.map +1 -1
- package/lib/esm/shell/apps/StandaloneApp.js +2 -2
- package/lib/esm/shell/apps/StandaloneApp.js.map +1 -1
- package/lib/esm/shell/login/InviteAcceptModal.js +2 -2
- package/lib/esm/shell/login/InviteAcceptModal.js.map +1 -1
- package/lib/esm/shell/login/SignInModal.js +1 -1
- package/lib/esm/shell/login/SignInModal.js.map +1 -1
- package/lib/esm/shell/login/SignupForm.js +2 -2
- package/lib/esm/shell/login/SignupForm.js.map +1 -1
- package/lib/esm/shell/login/UserInfo.js +2 -2
- package/lib/esm/shell/login/UserInfo.js.map +1 -1
- package/lib/esm/widgets/json-view/JSONCode.js +1 -1
- package/lib/esm/widgets/json-view/JSONCode.js.map +1 -1
- package/lib/esm/widgets/json-view/JSONDisplay.js +1 -1
- package/lib/esm/widgets/json-view/JSONDisplay.js.map +1 -1
- package/lib/esm/widgets/markdown/ArtifactContentRenderer.js +84 -13
- package/lib/esm/widgets/markdown/ArtifactContentRenderer.js.map +1 -1
- package/lib/esm/widgets/markdown/MarkdownFigure.js +40 -0
- package/lib/esm/widgets/markdown/MarkdownFigure.js.map +1 -0
- package/lib/esm/widgets/markdown/MarkdownRenderer.js +42 -7
- package/lib/esm/widgets/markdown/MarkdownRenderer.js.map +1 -1
- package/lib/esm/widgets/markdown/MermaidDiagram.js +80 -5
- package/lib/esm/widgets/markdown/MermaidDiagram.js.map +1 -1
- package/lib/esm/widgets/markdown/codeBlockHandlers.js +33 -33
- package/lib/esm/widgets/markdown/codeBlockHandlers.js.map +1 -1
- package/lib/esm/widgets/markdown/codeBlockHandlers.test.js +2 -29
- package/lib/esm/widgets/markdown/codeBlockHandlers.test.js.map +1 -1
- package/lib/esm/widgets/markdown/index.js +1 -0
- package/lib/esm/widgets/markdown/index.js.map +1 -1
- package/lib/esm/widgets/markdown/normalizeCustomSchemeLinks.js +77 -0
- package/lib/esm/widgets/markdown/normalizeCustomSchemeLinks.js.map +1 -0
- package/lib/esm/widgets/markdown/normalizeDirectives.js +45 -0
- package/lib/esm/widgets/markdown/normalizeDirectives.js.map +1 -0
- package/lib/esm/widgets/markdown/remarkDirectiveHandler.js +96 -0
- package/lib/esm/widgets/markdown/remarkDirectiveHandler.js.map +1 -0
- package/lib/esm/widgets/monacoEditor/MonacoEditor.js +8 -14
- package/lib/esm/widgets/monacoEditor/MonacoEditor.js.map +1 -1
- package/lib/esm/widgets/schema-editor/ManagedSchema.js.map +1 -1
- package/lib/esm/widgets/schema-editor/editor/PropertyEditor.js +3 -3
- package/lib/esm/widgets/schema-editor/editor/PropertyEditor.js.map +1 -1
- package/lib/esm/widgets/schema-editor/json-schema4-utils.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/components/SidePanel.d.ts +4 -1
- package/lib/types/core/components/SidePanel.d.ts.map +1 -1
- package/lib/types/core/components/index.d.ts +0 -8
- package/lib/types/core/components/index.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/MessageBox.d.ts.map +1 -0
- package/lib/types/core/components/{Panel.d.ts → shadcn/Panel.d.ts} +3 -1
- package/lib/types/core/components/shadcn/Panel.d.ts.map +1 -0
- package/lib/types/core/components/{Badge.d.ts → shadcn/badge.d.ts} +4 -4
- package/lib/types/core/components/shadcn/badge.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/button.d.ts +1 -1
- package/lib/types/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/index.d.ts +4 -2
- package/lib/types/core/components/shadcn/index.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/input.d.ts +1 -1
- package/lib/types/core/components/shadcn/modal/ConfirmModal.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/modal/DeleteModal.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/{dialog.d.ts → modal/dialog.d.ts} +7 -4
- package/lib/types/core/components/shadcn/modal/dialog.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/modal/index.d.ts +4 -0
- package/lib/types/core/components/shadcn/modal/index.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/popover.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/selectBox.d.ts +9 -5
- package/lib/types/core/components/shadcn/selectBox.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/tabs.d.ts +14 -5
- package/lib/types/core/components/shadcn/tabs.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/textarea.d.ts +6 -2
- package/lib/types/core/components/shadcn/textarea.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/tooltip.d.ts.map +1 -1
- package/lib/types/features/agent/PayloadBuilder.d.ts +22 -4
- package/lib/types/features/agent/PayloadBuilder.d.ts.map +1 -1
- package/lib/types/features/agent/chat/AgentChart.d.ts +3 -44
- package/lib/types/features/agent/chat/AgentChart.d.ts.map +1 -1
- package/lib/types/features/agent/chat/AskUserWidget.d.ts.map +1 -1
- package/lib/types/features/agent/chat/DocumentPanel.d.ts +16 -0
- package/lib/types/features/agent/chat/DocumentPanel.d.ts.map +1 -0
- package/lib/types/features/agent/chat/DocumentTabBar.d.ts +10 -0
- package/lib/types/features/agent/chat/DocumentTabBar.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentConversation.d.ts +69 -1
- package/lib/types/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +36 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/BatchProgressPanel.d.ts +18 -2
- package/lib/types/features/agent/chat/ModernAgentOutput/BatchProgressPanel.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts +4 -7
- package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +2 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +35 -7
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/StreamingMessage.d.ts +11 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/StreamingMessage.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/ToolCallGroup.d.ts +20 -2
- package/lib/types/features/agent/chat/ModernAgentOutput/ToolCallGroup.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/WorkstreamTabs.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts +18 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts.map +1 -1
- package/lib/types/features/agent/chat/SkillWidgetProvider.d.ts.map +1 -1
- package/lib/types/features/agent/chat/hooks/useAgentPlans.d.ts +22 -0
- package/lib/types/features/agent/chat/hooks/useAgentPlans.d.ts.map +1 -0
- package/lib/types/features/agent/chat/hooks/useAgentStream.d.ts +42 -0
- package/lib/types/features/agent/chat/hooks/useAgentStream.d.ts.map +1 -0
- package/lib/types/features/agent/chat/hooks/useDocumentPanel.d.ts +22 -0
- package/lib/types/features/agent/chat/hooks/useDocumentPanel.d.ts.map +1 -0
- package/lib/types/features/agent/chat/hooks/useFileProcessing.d.ts +27 -0
- package/lib/types/features/agent/chat/hooks/useFileProcessing.d.ts.map +1 -0
- package/lib/types/features/agent/chat/index.d.ts +12 -8
- package/lib/types/features/agent/chat/index.d.ts.map +1 -1
- package/lib/types/features/agent/chat/types/document.d.ts +5 -0
- package/lib/types/features/agent/chat/types/document.d.ts.map +1 -0
- package/lib/types/features/agent/index.d.ts +0 -2
- package/lib/types/features/agent/index.d.ts.map +1 -1
- package/lib/types/features/store/collections/BrowseCollectionView.d.ts.map +1 -1
- package/lib/types/features/store/objects/ExportPropertiesModal.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/ContentOverview.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/index.d.ts +1 -1
- package/lib/types/features/store/objects/components/index.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/useDownloadFile.d.ts +35 -0
- package/lib/types/features/store/objects/components/useDownloadFile.d.ts.map +1 -0
- package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
- package/lib/types/features/store/objects/selection/SelectionActions.d.ts +1 -1
- package/lib/types/features/store/objects/selection/SelectionActions.d.ts.map +1 -1
- package/lib/types/features/store/objects/selection/actions/ChangeTypeAction.d.ts.map +1 -1
- package/lib/types/features/store/objects/selection/actions/ExportPropertiesAction.d.ts.map +1 -1
- package/lib/types/features/store/objects/upload/useSmartFileUploadProcessing.d.ts.map +1 -1
- package/lib/types/features/store/types/ObjectSchemaEditor.d.ts +2 -1
- package/lib/types/features/store/types/ObjectSchemaEditor.d.ts.map +1 -1
- package/lib/types/features/store/types/SelectContentTypeModal.d.ts +1 -1
- package/lib/types/features/store/types/SelectContentTypeModal.d.ts.map +1 -1
- package/lib/types/features/store/types/TableLayoutEditor.d.ts +2 -1
- package/lib/types/features/store/types/TableLayoutEditor.d.ts.map +1 -1
- package/lib/types/features/user/UserInfo.d.ts +12 -1
- package/lib/types/features/user/UserInfo.d.ts.map +1 -1
- package/lib/types/features/utils/print.d.ts.map +1 -1
- package/lib/types/layout/AppLayout.d.ts.map +1 -1
- package/lib/types/layout/Sidebar.d.ts +4 -2
- package/lib/types/layout/Sidebar.d.ts.map +1 -1
- package/lib/types/router/HistoryNavigator.d.ts.map +1 -1
- package/lib/types/router/Nav.d.ts +6 -1
- package/lib/types/router/Nav.d.ts.map +1 -1
- package/lib/types/session/UserSession.d.ts.map +1 -1
- package/lib/types/session/UserSessionProvider.d.ts +1 -0
- package/lib/types/session/UserSessionProvider.d.ts.map +1 -1
- package/lib/types/widgets/json-view/JSONCode.d.ts.map +1 -1
- package/lib/types/widgets/markdown/ArtifactContentRenderer.d.ts +10 -1
- package/lib/types/widgets/markdown/ArtifactContentRenderer.d.ts.map +1 -1
- package/lib/types/widgets/markdown/MarkdownFigure.d.ts +15 -0
- package/lib/types/widgets/markdown/MarkdownFigure.d.ts.map +1 -0
- package/lib/types/widgets/markdown/MarkdownRenderer.d.ts.map +1 -1
- package/lib/types/widgets/markdown/MermaidDiagram.d.ts.map +1 -1
- package/lib/types/widgets/markdown/codeBlockHandlers.d.ts +5 -2
- package/lib/types/widgets/markdown/codeBlockHandlers.d.ts.map +1 -1
- package/lib/types/widgets/markdown/index.d.ts +1 -0
- package/lib/types/widgets/markdown/index.d.ts.map +1 -1
- package/lib/types/widgets/markdown/normalizeCustomSchemeLinks.d.ts +9 -0
- package/lib/types/widgets/markdown/normalizeCustomSchemeLinks.d.ts.map +1 -0
- package/lib/types/widgets/markdown/normalizeDirectives.d.ts +20 -0
- package/lib/types/widgets/markdown/normalizeDirectives.d.ts.map +1 -0
- package/lib/types/widgets/markdown/remarkDirectiveHandler.d.ts +2 -0
- package/lib/types/widgets/markdown/remarkDirectiveHandler.d.ts.map +1 -0
- package/lib/types/widgets/monacoEditor/MonacoEditor.d.ts +1 -3
- package/lib/types/widgets/monacoEditor/MonacoEditor.d.ts.map +1 -1
- package/lib/types/widgets/schema-editor/ManagedSchema.d.ts +1 -1
- package/lib/types/widgets/schema-editor/ManagedSchema.d.ts.map +1 -1
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +1 -1
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-layout.js +1 -1
- package/lib/vertesia-ui-layout.js.map +1 -1
- package/lib/vertesia-ui-router.js +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-shell.js +1 -1
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +14 -10
- package/src/core/components/InputList.tsx +1 -1
- package/src/core/components/Overlay.tsx +1 -1
- package/src/core/components/SidePanel.tsx +29 -15
- package/src/core/components/Switch.tsx +1 -1
- package/src/core/components/index.ts +0 -8
- package/src/core/components/shadcn/Panel.tsx +50 -0
- package/src/core/components/{Badge.tsx → shadcn/badge.tsx} +3 -3
- package/src/core/components/shadcn/command.tsx +1 -1
- package/src/core/components/shadcn/filters/filterBar.tsx +76 -87
- package/src/core/components/shadcn/index.ts +5 -3
- package/src/core/components/{ConfirmModal.tsx → shadcn/modal/ConfirmModal.tsx} +8 -8
- package/src/core/components/{DeleteModal.tsx → shadcn/modal/DeleteModal.tsx} +1 -1
- package/src/core/components/shadcn/{dialog.tsx → modal/dialog.tsx} +43 -32
- package/src/core/components/shadcn/modal/index.ts +3 -0
- package/src/core/components/shadcn/popover.tsx +4 -2
- package/src/core/components/shadcn/selectBox.tsx +71 -52
- package/src/core/components/shadcn/tabs.tsx +36 -19
- package/src/core/components/shadcn/textarea.tsx +43 -2
- package/src/core/components/shadcn/tooltip.tsx +23 -17
- package/src/features/agent/PayloadBuilder.tsx +70 -9
- package/src/features/agent/chat/AgentChart.tsx +46 -678
- package/src/features/agent/chat/AskUserWidget.tsx +4 -3
- package/src/features/agent/chat/DocumentPanel.tsx +120 -0
- package/src/features/agent/chat/DocumentTabBar.tsx +49 -0
- package/src/features/agent/chat/ModernAgentConversation.tsx +403 -549
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +162 -55
- package/src/features/agent/chat/ModernAgentOutput/BatchProgressPanel.tsx +40 -10
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +12 -16
- package/src/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.tsx +3 -3
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +68 -75
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +206 -94
- package/src/features/agent/chat/ModernAgentOutput/StreamingMessage.tsx +22 -5
- package/src/features/agent/chat/ModernAgentOutput/ToolCallGroup.tsx +295 -113
- package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +11 -8
- package/src/features/agent/chat/ModernAgentOutput/utils.ts +133 -4
- package/src/features/agent/chat/SkillWidgetProvider.tsx +32 -15
- package/src/features/agent/chat/hooks/useAgentPlans.ts +190 -0
- package/src/features/agent/chat/hooks/useAgentStream.ts +239 -0
- package/src/features/agent/chat/hooks/useDocumentPanel.ts +118 -0
- package/src/features/agent/chat/hooks/useFileProcessing.ts +126 -0
- package/src/features/agent/chat/index.ts +18 -17
- package/src/features/agent/chat/types/document.ts +4 -0
- package/src/features/agent/index.ts +0 -2
- package/src/features/store/collections/BrowseCollectionView.tsx +5 -8
- package/src/features/store/collections/CreateCollection.tsx +8 -8
- package/src/features/store/collections/EditCollectionView.tsx +1 -1
- package/src/features/store/objects/DocumentSearchResults.tsx +9 -13
- package/src/features/store/objects/ExportPropertiesModal.tsx +9 -7
- package/src/features/store/objects/components/ContentOverview.tsx +29 -155
- package/src/features/store/objects/components/PropertiesEditorModal.tsx +0 -1
- package/src/features/store/objects/components/SelectDocumentModal.tsx +6 -6
- package/src/features/store/objects/components/VectorSearchWidget.tsx +2 -2
- package/src/features/store/objects/components/index.ts +1 -1
- package/src/features/store/objects/components/useDownloadFile.ts +237 -0
- package/src/features/store/objects/search/DocumentSearchContext.ts +1 -2
- package/src/features/store/objects/selection/SelectionActions.tsx +0 -4
- package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +13 -13
- package/src/features/store/objects/selection/actions/ChangeTypeAction.tsx +2 -6
- package/src/features/store/objects/selection/actions/ExportPropertiesAction.tsx +1 -3
- package/src/features/store/objects/selection/actions/StartWorkflowComponent.tsx +8 -8
- package/src/features/store/objects/upload/DocumentUploadModal.tsx +25 -25
- package/src/features/store/objects/upload/useSmartFileUploadProcessing.ts +16 -10
- package/src/features/store/types/ObjectSchemaEditor.tsx +32 -29
- package/src/features/store/types/SelectContentType.tsx +3 -3
- package/src/features/store/types/SelectContentTypeModal.tsx +17 -30
- package/src/features/store/types/TableLayoutEditor.tsx +14 -18
- package/src/features/user/UserInfo.tsx +176 -10
- package/src/features/utils/print.ts +0 -1
- package/src/layout/AppLayout.tsx +16 -44
- package/src/layout/Sidebar.tsx +7 -5
- package/src/router/HistoryNavigator.ts +9 -1
- package/src/router/Nav.tsx +7 -2
- package/src/session/UserSession.ts +38 -9
- package/src/session/UserSessionProvider.tsx +3 -2
- package/src/shell/apps/AppProjectSelector.tsx +2 -2
- package/src/shell/apps/StandaloneApp.tsx +3 -3
- package/src/shell/login/InviteAcceptModal.tsx +6 -6
- package/src/shell/login/SignInModal.tsx +1 -1
- package/src/shell/login/SignupForm.tsx +3 -3
- package/src/shell/login/UserInfo.tsx +5 -5
- package/src/widgets/json-view/JSONCode.tsx +1 -3
- package/src/widgets/json-view/JSONDisplay.tsx +1 -1
- package/src/widgets/markdown/ArtifactContentRenderer.tsx +115 -14
- package/src/widgets/markdown/MarkdownFigure.tsx +100 -0
- package/src/widgets/markdown/MarkdownRenderer.tsx +62 -9
- package/src/widgets/markdown/MermaidDiagram.tsx +97 -5
- package/src/widgets/markdown/codeBlockHandlers.test.tsx +3 -34
- package/src/widgets/markdown/codeBlockHandlers.tsx +47 -42
- package/src/widgets/markdown/index.ts +1 -0
- package/src/widgets/markdown/markdown.css +192 -0
- package/src/widgets/markdown/normalizeCustomSchemeLinks.test.ts +86 -0
- package/src/widgets/markdown/normalizeCustomSchemeLinks.ts +91 -0
- package/src/widgets/markdown/normalizeDirectives.ts +50 -0
- package/src/widgets/markdown/remarkDirectiveHandler.ts +119 -0
- package/src/widgets/monacoEditor/MonacoEditor.tsx +8 -22
- package/src/widgets/schema-editor/ManagedSchema.ts +1 -1
- package/src/widgets/schema-editor/editor/PropertyEditor.tsx +5 -5
- package/src/widgets/schema-editor/json-schema4-utils.ts +1 -1
- package/lib/esm/core/components/Badge.js.map +0 -1
- package/lib/esm/core/components/Button.js +0 -32
- package/lib/esm/core/components/Button.js.map +0 -1
- package/lib/esm/core/components/ConfirmModal.js +0 -10
- package/lib/esm/core/components/ConfirmModal.js.map +0 -1
- package/lib/esm/core/components/DeleteModal.js.map +0 -1
- package/lib/esm/core/components/MessageBox.js.map +0 -1
- package/lib/esm/core/components/Modal.js +0 -26
- package/lib/esm/core/components/Modal.js.map +0 -1
- package/lib/esm/core/components/Panel.js +0 -8
- package/lib/esm/core/components/Panel.js.map +0 -1
- package/lib/esm/core/components/SelectBox.js +0 -67
- package/lib/esm/core/components/SelectBox.js.map +0 -1
- package/lib/esm/core/components/shadcn/dialog.js.map +0 -1
- package/lib/esm/core/components/tabs/Tabs.js +0 -78
- package/lib/esm/core/components/tabs/Tabs.js.map +0 -1
- package/lib/esm/core/components/tabs/TabsContext.js +0 -7
- package/lib/esm/core/components/tabs/TabsContext.js.map +0 -1
- package/lib/esm/core/components/tabs/index.js +0 -3
- package/lib/esm/core/components/tabs/index.js.map +0 -1
- package/lib/esm/features/agent/createChartTool.js +0 -632
- package/lib/esm/features/agent/createChartTool.js.map +0 -1
- package/lib/esm/features/agent/examples.js +0 -295
- package/lib/esm/features/agent/examples.js.map +0 -1
- package/lib/esm/features/agent/visualization.js +0 -165
- package/lib/esm/features/agent/visualization.js.map +0 -1
- package/lib/esm/features/store/objects/components/useDownloadObject.js +0 -21
- package/lib/esm/features/store/objects/components/useDownloadObject.js.map +0 -1
- package/lib/types/core/components/Badge.d.ts.map +0 -1
- package/lib/types/core/components/Button.d.ts +0 -14
- package/lib/types/core/components/Button.d.ts.map +0 -1
- package/lib/types/core/components/ConfirmModal.d.ts.map +0 -1
- package/lib/types/core/components/DeleteModal.d.ts.map +0 -1
- package/lib/types/core/components/MessageBox.d.ts.map +0 -1
- package/lib/types/core/components/Modal.d.ts +0 -30
- package/lib/types/core/components/Modal.d.ts.map +0 -1
- package/lib/types/core/components/Panel.d.ts.map +0 -1
- package/lib/types/core/components/SelectBox.d.ts +0 -36
- package/lib/types/core/components/SelectBox.d.ts.map +0 -1
- package/lib/types/core/components/shadcn/dialog.d.ts.map +0 -1
- package/lib/types/core/components/tabs/Tabs.d.ts +0 -25
- package/lib/types/core/components/tabs/Tabs.d.ts.map +0 -1
- package/lib/types/core/components/tabs/TabsContext.d.ts +0 -17
- package/lib/types/core/components/tabs/TabsContext.d.ts.map +0 -1
- package/lib/types/core/components/tabs/index.d.ts +0 -3
- package/lib/types/core/components/tabs/index.d.ts.map +0 -1
- package/lib/types/features/agent/createChartTool.d.ts +0 -178
- package/lib/types/features/agent/createChartTool.d.ts.map +0 -1
- package/lib/types/features/agent/examples.d.ts +0 -59
- package/lib/types/features/agent/examples.d.ts.map +0 -1
- package/lib/types/features/agent/visualization.d.ts +0 -95
- package/lib/types/features/agent/visualization.d.ts.map +0 -1
- package/lib/types/features/store/objects/components/useDownloadObject.d.ts +0 -4
- package/lib/types/features/store/objects/components/useDownloadObject.d.ts.map +0 -1
- package/src/core/components/Button.tsx +0 -63
- package/src/core/components/Modal.tsx +0 -144
- package/src/core/components/Panel.tsx +0 -34
- package/src/core/components/SelectBox.tsx +0 -188
- package/src/core/components/tabs/Tabs.tsx +0 -132
- package/src/core/components/tabs/TabsContext.ts +0 -25
- package/src/core/components/tabs/index.ts +0 -2
- package/src/features/agent/CHART_INSTRUCTIONS.md +0 -228
- package/src/features/agent/createChartTool.ts +0 -643
- package/src/features/agent/examples.ts +0 -321
- package/src/features/agent/visualization.ts +0 -227
- package/src/features/store/objects/components/useDownloadObject.ts +0 -29
- /package/lib/esm/core/components/{MessageBox.js → shadcn/MessageBox.js} +0 -0
- /package/lib/types/core/components/{MessageBox.d.ts → shadcn/MessageBox.d.ts} +0 -0
- /package/lib/types/core/components/{ConfirmModal.d.ts → shadcn/modal/ConfirmModal.d.ts} +0 -0
- /package/lib/types/core/components/{DeleteModal.d.ts → shadcn/modal/DeleteModal.d.ts} +0 -0
- /package/src/core/components/{MessageBox.tsx → shadcn/MessageBox.tsx} +0 -0
|
@@ -7,26 +7,33 @@ import {
|
|
|
7
7
|
AgentMessageType,
|
|
8
8
|
ConversationFile,
|
|
9
9
|
ConversationFileRef,
|
|
10
|
-
FileProcessingDetails,
|
|
11
|
-
FileProcessingStatus,
|
|
12
10
|
Plan,
|
|
13
|
-
StreamingChunkDetails,
|
|
14
11
|
UserInputSignal,
|
|
15
12
|
} from "@vertesia/common";
|
|
16
13
|
import { FusionFragmentProvider } from "@vertesia/fusion-ux";
|
|
17
|
-
import { Button, MessageBox, Spinner, useToast,
|
|
14
|
+
import { Button, cn, MessageBox, Spinner, useToast, Modal, ModalBody, ModalFooter, ModalTitle } from "@vertesia/ui/core";
|
|
18
15
|
|
|
19
16
|
import { AnimatedThinkingDots, PulsatingCircle } from "./AnimatedThinkingDots";
|
|
17
|
+
import { type AgentConversationViewMode } from "./ModernAgentOutput/AllMessagesMixed";
|
|
18
|
+
import { type BatchProgressPanelClassNames } from "./ModernAgentOutput/BatchProgressPanel";
|
|
19
|
+
import { type MessageItemClassNames } from "./ModernAgentOutput/MessageItem";
|
|
20
|
+
import { type StreamingMessageClassNames } from "./ModernAgentOutput/StreamingMessage";
|
|
21
|
+
import { type ToolCallGroupClassNames } from "./ModernAgentOutput/ToolCallGroup";
|
|
20
22
|
import { ImageLightboxProvider } from "./ImageLightbox";
|
|
21
23
|
import AllMessagesMixed from "./ModernAgentOutput/AllMessagesMixed";
|
|
22
24
|
import Header from "./ModernAgentOutput/Header";
|
|
23
25
|
import MessageInput, { UploadedFile, SelectedDocument } from "./ModernAgentOutput/MessageInput";
|
|
24
|
-
import { getWorkstreamId
|
|
26
|
+
import { getWorkstreamId } from "./ModernAgentOutput/utils";
|
|
25
27
|
import { ThinkingMessages } from "./WaitingMessages";
|
|
26
28
|
import InlineSlidingPlanPanel from "./ModernAgentOutput/InlineSlidingPlanPanel";
|
|
27
29
|
import { SkillWidgetProvider } from "./SkillWidgetProvider";
|
|
28
30
|
import { ArtifactUrlCacheProvider } from "./useArtifactUrlCache.js";
|
|
29
31
|
import { VegaLiteChart } from "./VegaLiteChart";
|
|
32
|
+
import { DocumentPanel } from "./DocumentPanel.js";
|
|
33
|
+
import { useAgentStream } from "./hooks/useAgentStream.js";
|
|
34
|
+
import { useAgentPlans } from "./hooks/useAgentPlans.js";
|
|
35
|
+
import { useDocumentPanel } from "./hooks/useDocumentPanel.js";
|
|
36
|
+
import { useFileProcessing } from "./hooks/useFileProcessing.js";
|
|
30
37
|
|
|
31
38
|
export type StartWorkflowFn = (
|
|
32
39
|
initialMessage?: string,
|
|
@@ -102,6 +109,26 @@ interface ModernAgentConversationProps {
|
|
|
102
109
|
/** Max number of files allowed */
|
|
103
110
|
maxFiles?: number;
|
|
104
111
|
|
|
112
|
+
/** Ref populated with the internal file upload handler for external triggering */
|
|
113
|
+
fileUploadRef?: React.MutableRefObject<((files: File[]) => void) | null>;
|
|
114
|
+
/** Called when processingFiles state changes (for external progress display) */
|
|
115
|
+
onProcessingFilesChange?: (files: Map<string, ConversationFile>) => void;
|
|
116
|
+
/** Called when plans change (for external plan panel) */
|
|
117
|
+
onPlansChange?: (plans: Array<{ plan: Plan; timestamp: number }>, activePlanIndex: number) => void;
|
|
118
|
+
/** Called when workstream status changes (for external plan panel) */
|
|
119
|
+
onWorkstreamStatusChange?: (statusMap: Map<number, Map<string, "pending" | "in_progress" | "completed" | "skipped">>) => void;
|
|
120
|
+
|
|
121
|
+
/** Controlled view mode — when provided, overrides internal state */
|
|
122
|
+
viewMode?: AgentConversationViewMode;
|
|
123
|
+
/** Called when view mode changes (for external control) */
|
|
124
|
+
onViewModeChange?: (mode: AgentConversationViewMode) => void;
|
|
125
|
+
/** Called when follow-up input availability is determined (after messages load) */
|
|
126
|
+
onShowInputChange?: (canSendFollowUp: boolean) => void;
|
|
127
|
+
/** Ref populated with the stop handler — call to interrupt the active agent. null when stop unavailable. */
|
|
128
|
+
stopRef?: React.MutableRefObject<(() => void) | null>;
|
|
129
|
+
/** Called when the stopping (in-progress) state changes */
|
|
130
|
+
onStoppingChange?: (isStopping: boolean) => void;
|
|
131
|
+
|
|
105
132
|
// Document search props (render prop for custom search UI)
|
|
106
133
|
/** Render custom document search UI - if provided, shows search button */
|
|
107
134
|
renderDocumentSearch?: (props: {
|
|
@@ -116,10 +143,22 @@ interface ModernAgentConversationProps {
|
|
|
116
143
|
|
|
117
144
|
// Hide the default object linking (for apps that don't use it)
|
|
118
145
|
hideObjectLinking?: boolean;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
146
|
+
/** Hide the internal header (for apps that render their own) */
|
|
147
|
+
hideHeader?: boolean;
|
|
148
|
+
/** Hide the internal message input (for apps that render their own) */
|
|
149
|
+
hideMessageInput?: boolean;
|
|
150
|
+
/** Hide the internal plan panel (for apps that render their own) */
|
|
151
|
+
hidePlanPanel?: boolean;
|
|
152
|
+
/** Hide workstream tabs */
|
|
153
|
+
hideWorkstreamTabs?: boolean;
|
|
154
|
+
/** Hide the default file upload */
|
|
155
|
+
hideFileUpload?: boolean;
|
|
156
|
+
/** Hide the document preview panel that auto-opens on create_document */
|
|
157
|
+
hideDocumentPanel?: boolean;
|
|
158
|
+
|
|
159
|
+
// Callback to get attached documents when sending messages
|
|
160
|
+
// Returns array of { id, name } to include in message metadata and display
|
|
161
|
+
getAttachedDocs?: () => SelectedDocument[];
|
|
123
162
|
// Called after attachments are sent to allow clearing them
|
|
124
163
|
onAttachmentsSent?: () => void;
|
|
125
164
|
// Whether files are currently being uploaded - disables send/start buttons
|
|
@@ -134,6 +173,31 @@ interface ModernAgentConversationProps {
|
|
|
134
173
|
/** Additional className for the input field */
|
|
135
174
|
inputClassName?: string;
|
|
136
175
|
|
|
176
|
+
/** Additional className for the root container */
|
|
177
|
+
className?: string;
|
|
178
|
+
|
|
179
|
+
messageItemClassNames?: MessageItemClassNames;
|
|
180
|
+
/** Sparse MESSAGE_STYLES overrides passed to every MessageItem */
|
|
181
|
+
messageStyleOverrides?: import("./ModernAgentOutput/MessageItem").MessageItemProps['messageStyleOverrides'];
|
|
182
|
+
toolCallGroupClassNames?: ToolCallGroupClassNames;
|
|
183
|
+
/** Hide ToolCallGroup in this view mode */
|
|
184
|
+
hideToolCallsInViewMode?: AgentConversationViewMode[];
|
|
185
|
+
streamingMessageClassNames?: StreamingMessageClassNames;
|
|
186
|
+
batchProgressPanelClassNames?: BatchProgressPanelClassNames;
|
|
187
|
+
|
|
188
|
+
/** className override for the working indicator container */
|
|
189
|
+
workingIndicatorClassName?: string;
|
|
190
|
+
/** className override for the message list container */
|
|
191
|
+
messageListClassName?: string;
|
|
192
|
+
/** Custom component to render store/document links instead of default NavLink navigation */
|
|
193
|
+
StoreLinkComponent?: React.ComponentType<{ href: string; documentId: string; children: React.ReactNode }>;
|
|
194
|
+
/** Custom component to render store/collection links instead of default NavLink navigation */
|
|
195
|
+
CollectionLinkComponent?: React.ComponentType<{ href: string; collectionId: string; children: React.ReactNode }>;
|
|
196
|
+
|
|
197
|
+
/** Optional message to display as the first user message in the conversation.
|
|
198
|
+
* Purely visual/UI — not sent to temporal. Renders as a QUESTION MessageItem before real messages. */
|
|
199
|
+
prependFriendlyMessage?: string;
|
|
200
|
+
|
|
137
201
|
// Fusion fragment props
|
|
138
202
|
/**
|
|
139
203
|
* Data to provide to fusion-fragment code blocks for rendering.
|
|
@@ -162,7 +226,7 @@ export function ModernAgentConversation(
|
|
|
162
226
|
<SkillWidgetProvider>
|
|
163
227
|
<ModernAgentConversationInner {...props} run={execRun} />
|
|
164
228
|
</SkillWidgetProvider>
|
|
165
|
-
)
|
|
229
|
+
);
|
|
166
230
|
} else if (startWorkflow) {
|
|
167
231
|
// If we have startWorkflow capability but no run yet
|
|
168
232
|
return <StartWorkflowView {...props} />;
|
|
@@ -302,13 +366,13 @@ function StartWorkflowView({
|
|
|
302
366
|
duration: 3000,
|
|
303
367
|
});
|
|
304
368
|
|
|
305
|
-
// Get attached
|
|
369
|
+
// Get attached documents if callback provided
|
|
306
370
|
const attachedDocs = getAttachedDocs?.() || [];
|
|
307
371
|
|
|
308
|
-
// Build message content with attachment references
|
|
372
|
+
// Build message content with attachment references as markdown links
|
|
309
373
|
let messageContent = message;
|
|
310
374
|
if (attachedDocs.length > 0 && !/store:\S+/.test(message)) {
|
|
311
|
-
const lines = attachedDocs.map((
|
|
375
|
+
const lines = attachedDocs.map((doc) => `[${doc.name}](/store/objects/${doc.id})`);
|
|
312
376
|
messageContent = [message, '', 'Attachments:', ...lines].join('\n');
|
|
313
377
|
}
|
|
314
378
|
|
|
@@ -612,6 +676,13 @@ function ModernAgentConversationInner({
|
|
|
612
676
|
onRemoveDocument,
|
|
613
677
|
// Object linking
|
|
614
678
|
hideObjectLinking,
|
|
679
|
+
// Section visibility
|
|
680
|
+
hideHeader,
|
|
681
|
+
hideMessageInput,
|
|
682
|
+
hidePlanPanel,
|
|
683
|
+
hideWorkstreamTabs,
|
|
684
|
+
hideFileUpload,
|
|
685
|
+
hideDocumentPanel,
|
|
615
686
|
// Attachment callback
|
|
616
687
|
getAttachedDocs,
|
|
617
688
|
onAttachmentsSent,
|
|
@@ -620,74 +691,121 @@ function ModernAgentConversationInner({
|
|
|
620
691
|
// Context callback
|
|
621
692
|
getMessageContext,
|
|
622
693
|
// Styling props
|
|
694
|
+
className,
|
|
623
695
|
inputContainerClassName,
|
|
624
696
|
inputClassName,
|
|
625
697
|
// Fusion fragment data
|
|
626
698
|
fusionData,
|
|
699
|
+
// External file upload API
|
|
700
|
+
fileUploadRef,
|
|
701
|
+
onProcessingFilesChange,
|
|
702
|
+
// External plan panel API
|
|
703
|
+
onPlansChange,
|
|
704
|
+
onWorkstreamStatusChange,
|
|
705
|
+
// External view mode control
|
|
706
|
+
viewMode: controlledViewMode,
|
|
707
|
+
onViewModeChange: onViewModeChangeProp,
|
|
708
|
+
onShowInputChange,
|
|
709
|
+
// External stop API
|
|
710
|
+
stopRef,
|
|
711
|
+
onStoppingChange,
|
|
712
|
+
// MessageItem className/style overrides
|
|
713
|
+
messageItemClassNames,
|
|
714
|
+
messageStyleOverrides,
|
|
715
|
+
// ToolCallGroup className overrides + view mode visibility
|
|
716
|
+
toolCallGroupClassNames,
|
|
717
|
+
hideToolCallsInViewMode,
|
|
718
|
+
// StreamingMessage className overrides
|
|
719
|
+
streamingMessageClassNames,
|
|
720
|
+
// BatchProgressPanel className overrides
|
|
721
|
+
batchProgressPanelClassNames,
|
|
722
|
+
// AllMessagesMixed className overrides
|
|
723
|
+
workingIndicatorClassName,
|
|
724
|
+
messageListClassName,
|
|
725
|
+
StoreLinkComponent,
|
|
726
|
+
CollectionLinkComponent,
|
|
727
|
+
prependFriendlyMessage,
|
|
627
728
|
}: ModernAgentConversationProps & { run: AsyncExecutionResult }) {
|
|
628
729
|
const { client } = useUserSession();
|
|
730
|
+
const toast = useToast();
|
|
731
|
+
|
|
732
|
+
// ────────────────────────────────────────────
|
|
733
|
+
// Extracted hooks
|
|
734
|
+
// ────────────────────────────────────────────
|
|
735
|
+
const {
|
|
736
|
+
messages,
|
|
737
|
+
streamingMessages,
|
|
738
|
+
isCompleted,
|
|
739
|
+
debugChunkFlash,
|
|
740
|
+
addOptimisticMessage,
|
|
741
|
+
removeOptimisticMessages,
|
|
742
|
+
workflowStatus,
|
|
743
|
+
serverFileUpdates,
|
|
744
|
+
} = useAgentStream(client, run);
|
|
745
|
+
|
|
746
|
+
const {
|
|
747
|
+
plans,
|
|
748
|
+
activePlanIndex,
|
|
749
|
+
setActivePlanIndex,
|
|
750
|
+
workstreamStatusMap,
|
|
751
|
+
showInput,
|
|
752
|
+
showSlidingPanel,
|
|
753
|
+
setShowSlidingPanel,
|
|
754
|
+
} = useAgentPlans(messages, interactive, isModal);
|
|
755
|
+
|
|
756
|
+
const {
|
|
757
|
+
openDocuments,
|
|
758
|
+
activeDocumentId,
|
|
759
|
+
isDocPanelOpen,
|
|
760
|
+
docRefreshKey,
|
|
761
|
+
closeDocPanel: handleCloseDocPanel,
|
|
762
|
+
closeDocument: handleCloseDocument,
|
|
763
|
+
selectDocument,
|
|
764
|
+
openDocInPanel,
|
|
765
|
+
} = useDocumentPanel(messages);
|
|
766
|
+
|
|
767
|
+
const {
|
|
768
|
+
processingFiles,
|
|
769
|
+
hasProcessingFiles,
|
|
770
|
+
handleFileUpload,
|
|
771
|
+
} = useFileProcessing(client, run, serverFileUpdates, toast);
|
|
772
|
+
|
|
773
|
+
// ────────────────────────────────────────────
|
|
774
|
+
// Local state (UI-only concerns)
|
|
775
|
+
// ────────────────────────────────────────────
|
|
629
776
|
const bottomRef = useRef<HTMLDivElement | null>(null);
|
|
630
777
|
const conversationRef = useRef<HTMLDivElement | null>(null);
|
|
631
|
-
const [messages, setMessages] = useState<AgentMessage[]>([]);
|
|
632
|
-
const [isCompleted, setIsCompleted] = useState(false);
|
|
633
778
|
const [isSending, setIsSending] = useState(false);
|
|
634
|
-
const [
|
|
635
|
-
const
|
|
779
|
+
const [internalViewMode, setInternalViewMode] = useState<AgentConversationViewMode>("sliding");
|
|
780
|
+
const viewMode = controlledViewMode ?? internalViewMode;
|
|
781
|
+
const handleViewModeChange = useCallback((mode: AgentConversationViewMode) => {
|
|
782
|
+
if (onViewModeChangeProp) {
|
|
783
|
+
onViewModeChangeProp(mode);
|
|
784
|
+
} else {
|
|
785
|
+
setInternalViewMode(mode);
|
|
786
|
+
}
|
|
787
|
+
}, [onViewModeChangeProp]);
|
|
636
788
|
const [isStopping, setIsStopping] = useState(false);
|
|
637
|
-
// Keep track of multiple plans and their timestamps
|
|
638
|
-
const [plans, setPlans] = useState<Array<{ plan: Plan; timestamp: number }>>(
|
|
639
|
-
[],
|
|
640
|
-
);
|
|
641
|
-
// Track which plan is currently active in the UI
|
|
642
|
-
const [activePlanIndex, setActivePlanIndex] = useState<number>(0);
|
|
643
|
-
// Store workstream status for each plan separately
|
|
644
|
-
const [workstreamStatusMap, setWorkstreamStatusMap] = useState<
|
|
645
|
-
Map<
|
|
646
|
-
number,
|
|
647
|
-
Map<string, "pending" | "in_progress" | "completed" | "skipped">
|
|
648
|
-
>
|
|
649
|
-
>(new Map());
|
|
650
789
|
const [thinkingMessageIndex, setThinkingMessageIndex] = useState(0);
|
|
651
|
-
const toast = useToast();
|
|
652
|
-
const [showInput, setShowInput] = useState(interactive);
|
|
653
|
-
const [workflowStatus, setWorkflowStatus] = useState<string | null>(null);
|
|
654
|
-
// Track streaming messages by streaming_id for real-time chunk aggregation
|
|
655
|
-
// Include startTimestamp to preserve chronological order when converting to regular messages
|
|
656
|
-
const [streamingMessages, setStreamingMessages] = useState<Map<string, { text: string; workstreamId?: string; isComplete?: boolean; startTimestamp: number; activityId?: string }>>(new Map());
|
|
657
|
-
|
|
658
|
-
// Track files being processed by the workflow
|
|
659
|
-
const [processingFiles, setProcessingFiles] = useState<Map<string, ConversationFile>>(new Map());
|
|
660
|
-
|
|
661
|
-
// Check if any files are still uploading or processing
|
|
662
|
-
const hasProcessingFiles = useMemo(() =>
|
|
663
|
-
Array.from(processingFiles.values()).some(
|
|
664
|
-
f => f.status === FileProcessingStatus.UPLOADING || f.status === FileProcessingStatus.PROCESSING
|
|
665
|
-
), [processingFiles]);
|
|
666
|
-
|
|
667
|
-
// Performance optimization: Batch streaming updates using RAF
|
|
668
|
-
// Instead of updating state on every chunk (100+ times/sec), batch them per animation frame
|
|
669
|
-
const pendingStreamingChunks = useRef<Map<string, { text: string; workstreamId?: string; isComplete?: boolean; startTimestamp: number; activityId?: string }>>(new Map());
|
|
670
|
-
const streamingFlushScheduled = useRef<number | null>(null);
|
|
671
|
-
|
|
672
|
-
// Debug: Track chunk arrivals and renders
|
|
673
|
-
const [_debugChunkCount, setDebugChunkCount] = useState(0);
|
|
674
|
-
const [_debugRenderCount, setDebugRenderCount] = useState(0);
|
|
675
|
-
const [debugChunkFlash, setDebugChunkFlash] = useState(false);
|
|
676
|
-
const debugFlashTimeout = useRef<NodeJS.Timeout | null>(null);
|
|
677
|
-
|
|
678
|
-
const flushStreamingChunks = useCallback(() => {
|
|
679
|
-
if (pendingStreamingChunks.current.size > 0) {
|
|
680
|
-
setStreamingMessages(new Map(pendingStreamingChunks.current));
|
|
681
|
-
setDebugRenderCount(c => c + 1);
|
|
682
|
-
}
|
|
683
|
-
streamingFlushScheduled.current = null;
|
|
684
|
-
}, []);
|
|
685
|
-
|
|
686
|
-
// Drag and drop state for full-panel file upload
|
|
687
790
|
const [isDragOver, setIsDragOver] = useState(false);
|
|
688
791
|
const dragCounterRef = useRef(0);
|
|
689
792
|
|
|
690
|
-
//
|
|
793
|
+
// PERFORMANCE: Refs for values used inside useCallback to avoid re-creating the callback
|
|
794
|
+
const isSendingRef = useRef(isSending);
|
|
795
|
+
isSendingRef.current = isSending;
|
|
796
|
+
const hasProcessingFilesRef = useRef(hasProcessingFiles);
|
|
797
|
+
hasProcessingFilesRef.current = hasProcessingFiles;
|
|
798
|
+
|
|
799
|
+
// Derive effective workflow status (API status + TERMINATED from messages)
|
|
800
|
+
const effectiveWorkflowStatus = useMemo(() => {
|
|
801
|
+
const lastMsg = messages[messages.length - 1];
|
|
802
|
+
if (lastMsg?.type === AgentMessageType.TERMINATED) return "TERMINATED";
|
|
803
|
+
return workflowStatus;
|
|
804
|
+
}, [messages, workflowStatus]);
|
|
805
|
+
|
|
806
|
+
// ────────────────────────────────────────────
|
|
807
|
+
// Computed values
|
|
808
|
+
// ────────────────────────────────────────────
|
|
691
809
|
const getActivePlan = useMemo(() => {
|
|
692
810
|
const currentPlanData = plans[activePlanIndex] || {
|
|
693
811
|
plan: { plan: [] },
|
|
@@ -701,23 +819,44 @@ function ModernAgentConversationInner({
|
|
|
701
819
|
};
|
|
702
820
|
}, [plans, activePlanIndex, workstreamStatusMap]);
|
|
703
821
|
|
|
704
|
-
//
|
|
822
|
+
// ────────────────────────────────────────────
|
|
823
|
+
// Stable callbacks
|
|
824
|
+
// ────────────────────────────────────────────
|
|
705
825
|
const handleTogglePlanPanel = useCallback(() => {
|
|
706
|
-
setShowSlidingPanel((prev) => {
|
|
826
|
+
setShowSlidingPanel((prev: boolean) => {
|
|
707
827
|
if (!prev) {
|
|
708
828
|
sessionStorage.setItem("plan-panel-shown", "true");
|
|
709
829
|
}
|
|
710
830
|
return !prev;
|
|
711
831
|
});
|
|
712
|
-
}, []);
|
|
832
|
+
}, [setShowSlidingPanel]);
|
|
713
833
|
|
|
714
834
|
const handleChangePlan = useCallback((index: number) => {
|
|
715
835
|
setActivePlanIndex(index);
|
|
716
|
-
}, []);
|
|
836
|
+
}, [setActivePlanIndex]);
|
|
717
837
|
|
|
718
838
|
const handleClosePlanPanel = useCallback(() => {
|
|
719
839
|
setShowSlidingPanel(false);
|
|
720
|
-
}, []);
|
|
840
|
+
}, [setShowSlidingPanel]);
|
|
841
|
+
|
|
842
|
+
// Default StoreLinkComponent that opens documents in the panel
|
|
843
|
+
const internalStoreLinkComponent = useCallback(
|
|
844
|
+
({ documentId, children }: { href: string; documentId: string; children: React.ReactNode }) => (
|
|
845
|
+
<button
|
|
846
|
+
className="text-info underline cursor-pointer hover:text-info/80"
|
|
847
|
+
onClick={() => openDocInPanel(documentId)}
|
|
848
|
+
>
|
|
849
|
+
{children}
|
|
850
|
+
</button>
|
|
851
|
+
),
|
|
852
|
+
[openDocInPanel]
|
|
853
|
+
);
|
|
854
|
+
|
|
855
|
+
const effectiveStoreLinkComponent = StoreLinkComponent ?? internalStoreLinkComponent;
|
|
856
|
+
|
|
857
|
+
// ────────────────────────────────────────────
|
|
858
|
+
// Effects
|
|
859
|
+
// ────────────────────────────────────────────
|
|
721
860
|
|
|
722
861
|
// Show rotating thinking messages
|
|
723
862
|
useEffect(() => {
|
|
@@ -731,300 +870,54 @@ function ModernAgentConversationInner({
|
|
|
731
870
|
}
|
|
732
871
|
}, [isCompleted]);
|
|
733
872
|
|
|
734
|
-
|
|
735
|
-
try {
|
|
736
|
-
const statusResult = await client.store.workflows.getRunDetails(run.runId, run.workflowId);
|
|
737
|
-
setWorkflowStatus(statusResult.status as string);
|
|
738
|
-
} catch (error) {
|
|
739
|
-
console.error('Failed to check workflow status:', error);
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
// Stream messages from the agent
|
|
873
|
+
// Expose handleFileUpload to external callers via ref
|
|
744
874
|
useEffect(() => {
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
setActivePlanIndex(0);
|
|
749
|
-
setWorkstreamStatusMap(new Map());
|
|
750
|
-
setShowSlidingPanel(false);
|
|
751
|
-
setWorkflowStatus(null);
|
|
752
|
-
setStreamingMessages(new Map());
|
|
753
|
-
|
|
754
|
-
checkWorkflowStatus();
|
|
755
|
-
client.store.workflows.streamMessages(run.workflowId, run.runId, (message) => {
|
|
756
|
-
// Client now converts compact wire format to AgentMessage internally
|
|
757
|
-
|
|
758
|
-
// Handle streaming chunks separately for real-time aggregation
|
|
759
|
-
// PERFORMANCE: Batch updates using RAF instead of immediate state updates
|
|
760
|
-
if (message.type === AgentMessageType.STREAMING_CHUNK) {
|
|
761
|
-
const details = message.details as StreamingChunkDetails;
|
|
762
|
-
// Use activity_id as key if available (for dedup), fall back to streaming_id
|
|
763
|
-
const streamKey = details?.activity_id || details?.streaming_id;
|
|
764
|
-
if (!streamKey) return;
|
|
765
|
-
|
|
766
|
-
// Debug: Track chunk arrival with flash
|
|
767
|
-
setDebugChunkCount(c => c + 1);
|
|
768
|
-
setDebugChunkFlash(true);
|
|
769
|
-
if (debugFlashTimeout.current) clearTimeout(debugFlashTimeout.current);
|
|
770
|
-
debugFlashTimeout.current = setTimeout(() => setDebugChunkFlash(false), 50);
|
|
771
|
-
|
|
772
|
-
// Accumulate chunks in the ref (no state update yet)
|
|
773
|
-
const current = pendingStreamingChunks.current.get(streamKey) || {
|
|
774
|
-
text: '',
|
|
775
|
-
workstreamId: message.workstream_id,
|
|
776
|
-
startTimestamp: Date.now(),
|
|
777
|
-
activityId: details?.activity_id,
|
|
778
|
-
};
|
|
779
|
-
const newText = current.text + (message.message || '');
|
|
780
|
-
|
|
781
|
-
pendingStreamingChunks.current.set(streamKey, {
|
|
782
|
-
text: newText,
|
|
783
|
-
workstreamId: message.workstream_id,
|
|
784
|
-
isComplete: details.is_final,
|
|
785
|
-
startTimestamp: current.startTimestamp,
|
|
786
|
-
activityId: details?.activity_id,
|
|
787
|
-
});
|
|
788
|
-
|
|
789
|
-
// Schedule a flush if not already scheduled (batches ~60 updates/sec max)
|
|
790
|
-
if (streamingFlushScheduled.current === null) {
|
|
791
|
-
streamingFlushScheduled.current = requestAnimationFrame(flushStreamingChunks);
|
|
792
|
-
}
|
|
793
|
-
return;
|
|
794
|
-
}
|
|
875
|
+
if (fileUploadRef) fileUploadRef.current = handleFileUpload;
|
|
876
|
+
return () => { if (fileUploadRef) fileUploadRef.current = null; };
|
|
877
|
+
}, [fileUploadRef, handleFileUpload]);
|
|
795
878
|
|
|
796
|
-
|
|
797
|
-
if (message.type === AgentMessageType.SYSTEM) {
|
|
798
|
-
const details = message.details as FileProcessingDetails | undefined;
|
|
799
|
-
if (details?.system_type === 'file_processing' && details.files) {
|
|
800
|
-
setProcessingFiles(prev => {
|
|
801
|
-
const newMap = new Map(prev);
|
|
802
|
-
for (const file of details.files) {
|
|
803
|
-
newMap.set(file.id, file);
|
|
804
|
-
}
|
|
805
|
-
return newMap;
|
|
806
|
-
});
|
|
807
|
-
return; // Don't add to messages array - this is status only
|
|
808
|
-
}
|
|
809
|
-
// Other SYSTEM messages fall through to normal handling
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
// When THOUGHT or ANSWER arrives with activity_id, remove matching streaming message
|
|
813
|
-
// This prevents duplicate content (streamed content replaced by final message)
|
|
814
|
-
if ((message.type === AgentMessageType.THOUGHT || message.type === AgentMessageType.ANSWER) && message.details?.activity_id) {
|
|
815
|
-
const activityId = message.details.activity_id as string;
|
|
816
|
-
// Remove from pending chunks
|
|
817
|
-
pendingStreamingChunks.current.delete(activityId);
|
|
818
|
-
// Remove from streaming messages state
|
|
819
|
-
setStreamingMessages(prev => {
|
|
820
|
-
if (prev.has(activityId)) {
|
|
821
|
-
const next = new Map(prev);
|
|
822
|
-
next.delete(activityId);
|
|
823
|
-
return next;
|
|
824
|
-
}
|
|
825
|
-
return prev;
|
|
826
|
-
});
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
// On COMPLETE or IDLE, just flush any pending chunks
|
|
830
|
-
if (message.type === AgentMessageType.COMPLETE || message.type === AgentMessageType.IDLE) {
|
|
831
|
-
if (pendingStreamingChunks.current.size > 0) {
|
|
832
|
-
flushStreamingChunks();
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
if (message.message) {
|
|
837
|
-
setMessages((prev_messages) => {
|
|
838
|
-
// Check for duplicate by timestamp
|
|
839
|
-
if (prev_messages.find((m) => m.timestamp === message.timestamp)) {
|
|
840
|
-
return prev_messages;
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
// For QUESTION messages from server, replace any optimistic version
|
|
844
|
-
if (message.type === AgentMessageType.QUESTION && !message.details?._optimistic) {
|
|
845
|
-
const withoutOptimistic = prev_messages.filter(
|
|
846
|
-
(m) => !(m.type === AgentMessageType.QUESTION &&
|
|
847
|
-
m.details?._optimistic &&
|
|
848
|
-
m.message === message.message)
|
|
849
|
-
);
|
|
850
|
-
insertMessageInTimeline(withoutOptimistic, message);
|
|
851
|
-
return [...withoutOptimistic];
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
insertMessageInTimeline(prev_messages, message);
|
|
855
|
-
return [...prev_messages];
|
|
856
|
-
});
|
|
857
|
-
}
|
|
858
|
-
});
|
|
859
|
-
|
|
860
|
-
// Clear messages and unsubscribe when component unmounts or runId changes
|
|
861
|
-
return () => {
|
|
862
|
-
setMessages([]);
|
|
863
|
-
// Cancel any pending streaming flush
|
|
864
|
-
if (streamingFlushScheduled.current !== null) {
|
|
865
|
-
cancelAnimationFrame(streamingFlushScheduled.current);
|
|
866
|
-
streamingFlushScheduled.current = null;
|
|
867
|
-
}
|
|
868
|
-
pendingStreamingChunks.current.clear();
|
|
869
|
-
// Client handles unsubscribing from the message stream internally
|
|
870
|
-
};
|
|
871
|
-
}, [run.runId, client.store.workflows, flushStreamingChunks]);
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
// Update completion status when messages change
|
|
875
|
-
// This now accounts for multiple workstreams
|
|
879
|
+
// Notify parent when processingFiles changes
|
|
876
880
|
useEffect(() => {
|
|
877
|
-
|
|
881
|
+
onProcessingFilesChange?.(processingFiles);
|
|
882
|
+
}, [processingFiles, onProcessingFilesChange]);
|
|
878
883
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
setShowSlidingPanel(false);
|
|
884
|
-
}
|
|
885
|
-
// We removed the auto-show functionality to allow users to keep the panel closed if they want
|
|
886
|
-
}, [messages, plans.length]);
|
|
884
|
+
// Notify parent when plans change
|
|
885
|
+
useEffect(() => {
|
|
886
|
+
onPlansChange?.(plans, activePlanIndex);
|
|
887
|
+
}, [plans, activePlanIndex, onPlansChange]);
|
|
887
888
|
|
|
888
|
-
//
|
|
889
|
+
// Notify parent when workstream status changes
|
|
889
890
|
useEffect(() => {
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
plans.length === 1 &&
|
|
893
|
-
!showSlidingPanel &&
|
|
894
|
-
!sessionStorage.getItem("plan-panel-shown")
|
|
895
|
-
) {
|
|
896
|
-
// For first-time plan detection only, show the panel with a delay
|
|
897
|
-
const notificationTimeout = setTimeout(() => {
|
|
898
|
-
setShowSlidingPanel(true);
|
|
899
|
-
// Mark that we've shown the panel once
|
|
900
|
-
sessionStorage.setItem("plan-panel-shown", "true");
|
|
901
|
-
}, 500); // Short delay to ensure the UI has fully rendered
|
|
891
|
+
onWorkstreamStatusChange?.(workstreamStatusMap);
|
|
892
|
+
}, [workstreamStatusMap, onWorkstreamStatusChange]);
|
|
902
893
|
|
|
903
|
-
|
|
894
|
+
// Notify parent when input availability is determined
|
|
895
|
+
useEffect(() => {
|
|
896
|
+
if (messages.length === 0) return;
|
|
897
|
+
if (!showInput) {
|
|
898
|
+
onShowInputChange?.(false);
|
|
899
|
+
return;
|
|
904
900
|
}
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
if (message.type === AgentMessageType.PLAN) {
|
|
909
|
-
try {
|
|
910
|
-
// Log message details for debugging
|
|
911
|
-
console.log("PLAN message received:", message.type);
|
|
912
|
-
|
|
913
|
-
let newPlanDetails: Plan | null = null;
|
|
914
|
-
|
|
915
|
-
// Extract the plan from the message details object
|
|
916
|
-
if (message.details && typeof message.details === "object") {
|
|
917
|
-
// For a PLAN type message like the example you provided
|
|
918
|
-
if (message.details.plan && Array.isArray(message.details.plan)) {
|
|
919
|
-
console.log("Valid plan array found in message.details.plan");
|
|
920
|
-
newPlanDetails = { plan: message.details.plan } as Plan;
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
// Only proceed if we have a valid plan
|
|
925
|
-
if (newPlanDetails) {
|
|
926
|
-
const timestamp =
|
|
927
|
-
typeof message.timestamp === "number"
|
|
928
|
-
? message.timestamp
|
|
929
|
-
: new Date(message.timestamp).getTime();
|
|
930
|
-
|
|
931
|
-
// Check if we already have this plan
|
|
932
|
-
const existingPlanIndex = plans.findIndex(
|
|
933
|
-
(p) => p.timestamp === timestamp,
|
|
934
|
-
);
|
|
935
|
-
|
|
936
|
-
if (existingPlanIndex === -1 && newPlanDetails) {
|
|
937
|
-
console.log("Adding new plan to plans array");
|
|
938
|
-
// This is a new plan - add it to our plans array
|
|
939
|
-
const newPlan = {
|
|
940
|
-
plan: newPlanDetails,
|
|
941
|
-
timestamp,
|
|
942
|
-
};
|
|
943
|
-
|
|
944
|
-
// Add new plan to the beginning of the array (newest first)
|
|
945
|
-
console.log("Adding plan to plans array:", newPlan);
|
|
946
|
-
setPlans((prev) => {
|
|
947
|
-
const newPlans = [newPlan, ...prev];
|
|
948
|
-
console.log("New plans array:", newPlans);
|
|
949
|
-
return newPlans;
|
|
950
|
-
});
|
|
951
|
-
// Set this as the active plan
|
|
952
|
-
setActivePlanIndex(0);
|
|
953
|
-
|
|
954
|
-
// Automatically show sliding plan panel when a plan is detected
|
|
955
|
-
console.log("Setting showSlidingPanel to true");
|
|
956
|
-
setShowSlidingPanel(true);
|
|
957
|
-
|
|
958
|
-
// Initialize workstreams as pending based on the plan tasks
|
|
959
|
-
const newWorkstreamStatus = new Map<
|
|
960
|
-
string,
|
|
961
|
-
"pending" | "in_progress" | "completed" | "skipped"
|
|
962
|
-
>();
|
|
963
|
-
|
|
964
|
-
// Always initialize main workstream
|
|
965
|
-
newWorkstreamStatus.set("main", "in_progress");
|
|
966
|
-
|
|
967
|
-
// Initialize each task in the plan with its status
|
|
968
|
-
if (Array.isArray(newPlanDetails.plan)) {
|
|
969
|
-
newPlanDetails.plan.forEach((task) => {
|
|
970
|
-
if (task && typeof task === "object" && task.id) {
|
|
971
|
-
const taskId = task.id.toString();
|
|
972
|
-
// Use the task's status if available, otherwise default to pending
|
|
973
|
-
newWorkstreamStatus.set(taskId, task.status || "pending");
|
|
974
|
-
}
|
|
975
|
-
});
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
// Update the workstream status map with the new status for this plan
|
|
979
|
-
setWorkstreamStatusMap((prev) => {
|
|
980
|
-
const newMap = new Map(prev);
|
|
981
|
-
newMap.set(timestamp, newWorkstreamStatus);
|
|
982
|
-
return newMap;
|
|
983
|
-
});
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
} catch (error) {
|
|
987
|
-
console.error("Failed to parse plan from message:", error);
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
// Handle UPDATE type messages with plan updates
|
|
992
|
-
if (message.type === AgentMessageType.UPDATE && message.details) {
|
|
993
|
-
// We no longer process UPDATE messages with details.updates
|
|
994
|
-
// Instead, we rely on the PLAN message that follows with the complete plan
|
|
995
|
-
if (message.details.updates && Array.isArray(message.details.updates)) {
|
|
996
|
-
console.log(
|
|
997
|
-
"Ignoring UPDATE message with details.updates - waiting for PLAN message with full plan",
|
|
998
|
-
);
|
|
999
|
-
// This is an initial update notification, but we'll wait for the PLAN message that follows
|
|
1000
|
-
// with the complete updated plan before making any UI changes
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
});
|
|
1004
|
-
|
|
1005
|
-
const lastMessage = messages[messages.length - 1];
|
|
1006
|
-
if (lastMessage) {
|
|
1007
|
-
if (lastMessage.type === AgentMessageType.TERMINATED) {
|
|
1008
|
-
setShowInput(false);
|
|
1009
|
-
setWorkflowStatus("TERMINATED");
|
|
1010
|
-
}
|
|
1011
|
-
else {
|
|
1012
|
-
if (interactive) {
|
|
1013
|
-
setShowInput(true);
|
|
1014
|
-
} else {
|
|
1015
|
-
setShowInput(lastMessage.type === AgentMessageType.REQUEST_INPUT);
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
901
|
+
if (effectiveWorkflowStatus && effectiveWorkflowStatus !== "RUNNING") {
|
|
902
|
+
onShowInputChange?.(false);
|
|
903
|
+
return;
|
|
1018
904
|
}
|
|
1019
|
-
|
|
905
|
+
if (effectiveWorkflowStatus !== null) {
|
|
906
|
+
onShowInputChange?.(true);
|
|
907
|
+
}
|
|
908
|
+
}, [showInput, effectiveWorkflowStatus, messages.length, onShowInputChange]);
|
|
909
|
+
|
|
910
|
+
// ────────────────────────────────────────────
|
|
911
|
+
// Handlers
|
|
912
|
+
// ────────────────────────────────────────────
|
|
1020
913
|
|
|
1021
914
|
// Send a message to the agent
|
|
1022
|
-
const handleSendMessage = (message: string) => {
|
|
915
|
+
const handleSendMessage = useCallback((message: string) => {
|
|
1023
916
|
const trimmed = message.trim();
|
|
1024
|
-
if (!trimmed ||
|
|
917
|
+
if (!trimmed || isSendingRef.current) return;
|
|
1025
918
|
|
|
1026
919
|
// Block if files are still processing
|
|
1027
|
-
if (
|
|
920
|
+
if (hasProcessingFilesRef.current) {
|
|
1028
921
|
toast({
|
|
1029
922
|
status: "warning",
|
|
1030
923
|
title: "Files Still Processing",
|
|
@@ -1036,63 +929,46 @@ function ModernAgentConversationInner({
|
|
|
1036
929
|
|
|
1037
930
|
setIsSending(true);
|
|
1038
931
|
|
|
1039
|
-
// Add optimistic QUESTION message immediately for better UX
|
|
1040
|
-
const optimisticTimestamp = Date.now();
|
|
1041
|
-
const optimisticMessage: AgentMessage = {
|
|
1042
|
-
timestamp: optimisticTimestamp,
|
|
1043
|
-
workflow_run_id: run.runId,
|
|
1044
|
-
type: AgentMessageType.QUESTION,
|
|
1045
|
-
message: trimmed,
|
|
1046
|
-
workstream_id: "main",
|
|
1047
|
-
details: { _optimistic: true },
|
|
1048
|
-
};
|
|
1049
|
-
|
|
1050
|
-
console.log("[Optimistic] Adding user message:", trimmed);
|
|
1051
|
-
|
|
1052
|
-
setMessages((prev) => {
|
|
1053
|
-
const newMessages = [...prev, optimisticMessage];
|
|
1054
|
-
// Sort by timestamp to maintain order
|
|
1055
|
-
newMessages.sort((a, b) => {
|
|
1056
|
-
const timeA = typeof a.timestamp === "number" ? a.timestamp : new Date(a.timestamp).getTime();
|
|
1057
|
-
const timeB = typeof b.timestamp === "number" ? b.timestamp : new Date(b.timestamp).getTime();
|
|
1058
|
-
return timeA - timeB;
|
|
1059
|
-
});
|
|
1060
|
-
console.log("[Optimistic] Messages after add:", newMessages.length, "messages");
|
|
1061
|
-
return newMessages;
|
|
1062
|
-
});
|
|
1063
|
-
|
|
1064
|
-
// Get attached document IDs if callback provided
|
|
1065
932
|
const attachedDocs = getAttachedDocs?.() || [];
|
|
1066
|
-
|
|
1067
|
-
// Get additional context metadata if callback provided (e.g., fundId)
|
|
1068
933
|
const contextMetadata = getMessageContext?.() || {};
|
|
1069
934
|
|
|
1070
|
-
// Build message content with attachment references if present
|
|
1071
935
|
let messageContent = trimmed;
|
|
1072
936
|
if (attachedDocs.length > 0 && !/store:\S+/.test(trimmed)) {
|
|
1073
|
-
const lines = attachedDocs.map((
|
|
937
|
+
const lines = attachedDocs.map((doc) => `[${doc.name}](/store/objects/${doc.id})`);
|
|
1074
938
|
messageContent = [trimmed, '', 'Attachments:', ...lines].join('\n');
|
|
1075
939
|
}
|
|
1076
940
|
|
|
1077
|
-
|
|
941
|
+
const messageId = `msg-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
942
|
+
|
|
943
|
+
const optimisticMessage: AgentMessage = {
|
|
944
|
+
timestamp: Date.now(),
|
|
945
|
+
workflow_run_id: run.runId,
|
|
946
|
+
type: AgentMessageType.QUESTION,
|
|
947
|
+
message: messageContent,
|
|
948
|
+
workstream_id: "main",
|
|
949
|
+
details: { _optimistic: true, _messageId: messageId },
|
|
950
|
+
};
|
|
951
|
+
|
|
952
|
+
addOptimisticMessage(optimisticMessage);
|
|
953
|
+
|
|
1078
954
|
const metadata = {
|
|
1079
|
-
...(attachedDocs.length > 0 ? { attached_docs: attachedDocs } : {}),
|
|
955
|
+
...(attachedDocs.length > 0 ? { attached_docs: attachedDocs.map((d) => d.id) } : {}),
|
|
1080
956
|
...contextMetadata,
|
|
957
|
+
_messageId: messageId,
|
|
1081
958
|
};
|
|
1082
959
|
|
|
1083
960
|
client.store.workflows
|
|
1084
961
|
.sendSignal(run.workflowId, run.runId, "UserInput", {
|
|
1085
962
|
message: messageContent,
|
|
1086
|
-
metadata
|
|
963
|
+
metadata,
|
|
1087
964
|
} as UserInputSignal)
|
|
1088
965
|
.then(() => {
|
|
1089
|
-
setIsCompleted(false);
|
|
1090
|
-
// Clear attachments after successful send
|
|
1091
966
|
onAttachmentsSent?.();
|
|
1092
967
|
})
|
|
1093
968
|
.catch((err) => {
|
|
1094
|
-
|
|
1095
|
-
|
|
969
|
+
removeOptimisticMessages((m) =>
|
|
970
|
+
(m.details as any)?._messageId === messageId
|
|
971
|
+
);
|
|
1096
972
|
toast({
|
|
1097
973
|
status: "error",
|
|
1098
974
|
title: "Failed to Send Message",
|
|
@@ -1103,85 +979,13 @@ function ModernAgentConversationInner({
|
|
|
1103
979
|
.finally(() => {
|
|
1104
980
|
setIsSending(false);
|
|
1105
981
|
});
|
|
1106
|
-
};
|
|
1107
|
-
|
|
1108
|
-
// Handle file uploads - upload to artifact storage and signal workflow
|
|
1109
|
-
const handleFileUpload = useCallback(async (files: File[]) => {
|
|
1110
|
-
for (const file of files) {
|
|
1111
|
-
const fileId = `file-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
1112
|
-
const artifactPath = `files/${file.name}`;
|
|
1113
|
-
|
|
1114
|
-
// Add to local state immediately (optimistic - uploading status)
|
|
1115
|
-
const fileState: ConversationFile = {
|
|
1116
|
-
id: fileId,
|
|
1117
|
-
name: file.name,
|
|
1118
|
-
content_type: file.type || 'application/octet-stream',
|
|
1119
|
-
size: file.size,
|
|
1120
|
-
status: FileProcessingStatus.UPLOADING,
|
|
1121
|
-
started_at: Date.now(),
|
|
1122
|
-
};
|
|
1123
|
-
|
|
1124
|
-
setProcessingFiles(prev => new Map(prev).set(fileId, fileState));
|
|
1125
|
-
|
|
1126
|
-
try {
|
|
1127
|
-
// Upload to artifact storage
|
|
1128
|
-
await client.files.uploadArtifact(run.runId, artifactPath, file);
|
|
1129
|
-
|
|
1130
|
-
// Update local state to processing
|
|
1131
|
-
setProcessingFiles(prev => {
|
|
1132
|
-
const newMap = new Map(prev);
|
|
1133
|
-
const f = newMap.get(fileId);
|
|
1134
|
-
if (f) {
|
|
1135
|
-
f.status = FileProcessingStatus.PROCESSING;
|
|
1136
|
-
f.artifact_path = artifactPath;
|
|
1137
|
-
f.reference = `artifact:${artifactPath}`;
|
|
1138
|
-
}
|
|
1139
|
-
return newMap;
|
|
1140
|
-
});
|
|
1141
|
-
|
|
1142
|
-
// Signal workflow that file was uploaded
|
|
1143
|
-
await client.store.workflows.sendSignal(
|
|
1144
|
-
run.workflowId,
|
|
1145
|
-
run.runId,
|
|
1146
|
-
"FileUploaded",
|
|
1147
|
-
{
|
|
1148
|
-
id: fileId,
|
|
1149
|
-
name: file.name,
|
|
1150
|
-
content_type: file.type || 'application/octet-stream',
|
|
1151
|
-
reference: `artifact:${artifactPath}`,
|
|
1152
|
-
artifact_path: artifactPath,
|
|
1153
|
-
} as ConversationFileRef
|
|
1154
|
-
);
|
|
1155
|
-
|
|
1156
|
-
} catch (error) {
|
|
1157
|
-
// Update local state to error
|
|
1158
|
-
setProcessingFiles(prev => {
|
|
1159
|
-
const newMap = new Map(prev);
|
|
1160
|
-
const f = newMap.get(fileId);
|
|
1161
|
-
if (f) {
|
|
1162
|
-
f.status = FileProcessingStatus.ERROR;
|
|
1163
|
-
f.error = error instanceof Error ? error.message : 'Upload failed';
|
|
1164
|
-
f.completed_at = Date.now();
|
|
1165
|
-
}
|
|
1166
|
-
return newMap;
|
|
1167
|
-
});
|
|
1168
|
-
|
|
1169
|
-
toast({
|
|
1170
|
-
status: "error",
|
|
1171
|
-
title: "Upload Failed",
|
|
1172
|
-
description: error instanceof Error ? error.message : "Failed to upload file",
|
|
1173
|
-
duration: 3000,
|
|
1174
|
-
});
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
}, [client, run, toast]);
|
|
982
|
+
}, [run.runId, run.workflowId, client, toast, getAttachedDocs, getMessageContext, onAttachmentsSent, addOptimisticMessage, removeOptimisticMessages]);
|
|
1178
983
|
|
|
1179
984
|
// Drag and drop handlers for full-panel file upload
|
|
1180
985
|
const handleDragEnter = useCallback((e: React.DragEvent) => {
|
|
1181
986
|
e.preventDefault();
|
|
1182
987
|
e.stopPropagation();
|
|
1183
988
|
dragCounterRef.current++;
|
|
1184
|
-
// Enable drag if we have a run (for internal file processing)
|
|
1185
989
|
if (run && e.dataTransfer?.types?.includes('Files')) {
|
|
1186
990
|
setIsDragOver(true);
|
|
1187
991
|
}
|
|
@@ -1207,7 +1011,6 @@ function ModernAgentConversationInner({
|
|
|
1207
1011
|
dragCounterRef.current = 0;
|
|
1208
1012
|
setIsDragOver(false);
|
|
1209
1013
|
|
|
1210
|
-
// Use internal handleFileUpload for proper workflow signaling and status tracking
|
|
1211
1014
|
if (run && e.dataTransfer?.files && e.dataTransfer.files.length > 0) {
|
|
1212
1015
|
const filesArray = Array.from(e.dataTransfer.files);
|
|
1213
1016
|
handleFileUpload(filesArray);
|
|
@@ -1215,7 +1018,7 @@ function ModernAgentConversationInner({
|
|
|
1215
1018
|
}, [run, handleFileUpload]);
|
|
1216
1019
|
|
|
1217
1020
|
// Stop/interrupt the active workflow
|
|
1218
|
-
const handleStopWorkflow = async () => {
|
|
1021
|
+
const handleStopWorkflow = useCallback(async () => {
|
|
1219
1022
|
if (isStopping) return;
|
|
1220
1023
|
|
|
1221
1024
|
setIsStopping(true);
|
|
@@ -1230,7 +1033,6 @@ function ModernAgentConversationInner({
|
|
|
1230
1033
|
description: "Type your message to give new instructions",
|
|
1231
1034
|
duration: 3000,
|
|
1232
1035
|
});
|
|
1233
|
-
setIsCompleted(true);
|
|
1234
1036
|
} catch (err) {
|
|
1235
1037
|
toast({
|
|
1236
1038
|
status: "error",
|
|
@@ -1241,7 +1043,18 @@ function ModernAgentConversationInner({
|
|
|
1241
1043
|
} finally {
|
|
1242
1044
|
setIsStopping(false);
|
|
1243
1045
|
}
|
|
1244
|
-
};
|
|
1046
|
+
}, [isStopping, client, run.workflowId, run.runId, toast]);
|
|
1047
|
+
|
|
1048
|
+
// Expose stop handler to external callers via ref
|
|
1049
|
+
useEffect(() => {
|
|
1050
|
+
if (stopRef) stopRef.current = !isCompleted ? handleStopWorkflow : null;
|
|
1051
|
+
return () => { if (stopRef) stopRef.current = null; };
|
|
1052
|
+
}, [stopRef, isCompleted, handleStopWorkflow]);
|
|
1053
|
+
|
|
1054
|
+
// Notify parent when stopping state changes
|
|
1055
|
+
useEffect(() => {
|
|
1056
|
+
onStoppingChange?.(isStopping);
|
|
1057
|
+
}, [isStopping, onStoppingChange]);
|
|
1245
1058
|
|
|
1246
1059
|
// Calculate number of active tasks for the status indicator
|
|
1247
1060
|
const getActiveTaskCount = (): number => {
|
|
@@ -1356,12 +1169,20 @@ function ModernAgentConversationInner({
|
|
|
1356
1169
|
setIsPdfModalOpen(false);
|
|
1357
1170
|
};
|
|
1358
1171
|
|
|
1172
|
+
// PERFORMANCE: Memoize taskLabels to prevent AllMessagesMixed re-renders
|
|
1173
|
+
const taskLabels = useMemo(() =>
|
|
1174
|
+
getActivePlan.plan.plan?.reduce((acc, task) => {
|
|
1175
|
+
if (task.id && task.goal) acc.set(task.id.toString(), task.goal);
|
|
1176
|
+
return acc;
|
|
1177
|
+
}, new Map<string, string>()),
|
|
1178
|
+
[getActivePlan.plan]);
|
|
1179
|
+
|
|
1359
1180
|
// Main content - wrapped with FusionFragmentProvider when fusionData is provided
|
|
1360
1181
|
const mainContent = (
|
|
1361
1182
|
<ArtifactUrlCacheProvider>
|
|
1362
1183
|
<ImageLightboxProvider>
|
|
1363
1184
|
<div
|
|
1364
|
-
className={
|
|
1185
|
+
className={cn("flex flex-col lg:flex-row gap-2 h-full relative overflow-hidden", isDragOver && "ring-2 ring-blue-400 ring-inset", className)}
|
|
1365
1186
|
onDragEnter={handleDragEnter}
|
|
1366
1187
|
onDragOver={handleDragOver}
|
|
1367
1188
|
onDragLeave={handleDragLeave}
|
|
@@ -1379,36 +1200,39 @@ function ModernAgentConversationInner({
|
|
|
1379
1200
|
{/* Conversation Area - responsive width based on panel visibility */}
|
|
1380
1201
|
<div
|
|
1381
1202
|
ref={conversationRef}
|
|
1382
|
-
className={
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1203
|
+
className={cn(
|
|
1204
|
+
"flex flex-col min-h-0 border-0",
|
|
1205
|
+
(showSlidingPanel || isDocPanelOpen)
|
|
1206
|
+
? "w-full lg:w-3/5 flex-1 min-h-[50vh]"
|
|
1207
|
+
: fullWidth
|
|
1208
|
+
? "flex-1 w-full"
|
|
1209
|
+
: `flex-1 mx-auto ${!isModal ? "max-w-4xl" : ""}`
|
|
1210
|
+
)}
|
|
1389
1211
|
>
|
|
1390
1212
|
{/* Streaming activity indicator moved to Header */}
|
|
1391
1213
|
|
|
1392
1214
|
{/* Header - flex-shrink-0 to prevent shrinking */}
|
|
1393
|
-
|
|
1394
|
-
<
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1215
|
+
{!hideHeader && (
|
|
1216
|
+
<div className="flex-shrink-0">
|
|
1217
|
+
<Header
|
|
1218
|
+
title={actualTitle}
|
|
1219
|
+
isCompleted={isCompleted}
|
|
1220
|
+
onClose={onClose}
|
|
1221
|
+
isModal={isModal}
|
|
1222
|
+
run={run}
|
|
1223
|
+
viewMode={viewMode}
|
|
1224
|
+
onViewModeChange={handleViewModeChange}
|
|
1225
|
+
showPlanPanel={showSlidingPanel}
|
|
1226
|
+
hasPlan={plans.length > 0}
|
|
1227
|
+
onTogglePlanPanel={handleTogglePlanPanel}
|
|
1228
|
+
onDownload={downloadConversation}
|
|
1229
|
+
onCopyRunId={copyRunId}
|
|
1230
|
+
resetWorkflow={resetWorkflow}
|
|
1231
|
+
onExportPdf={exportConversationPdf}
|
|
1232
|
+
isReceivingChunks={debugChunkFlash}
|
|
1233
|
+
/>
|
|
1234
|
+
</div>
|
|
1235
|
+
)}
|
|
1412
1236
|
|
|
1413
1237
|
{messages.length === 0 && !isCompleted ? (
|
|
1414
1238
|
<div className="flex-1 flex flex-col items-center justify-center h-full text-center py-6">
|
|
@@ -1428,7 +1252,6 @@ function ModernAgentConversationInner({
|
|
|
1428
1252
|
<AllMessagesMixed
|
|
1429
1253
|
messages={messages}
|
|
1430
1254
|
bottomRef={bottomRef as React.RefObject<HTMLDivElement>}
|
|
1431
|
-
viewMode={viewMode}
|
|
1432
1255
|
isCompleted={isCompleted}
|
|
1433
1256
|
plan={getActivePlan.plan}
|
|
1434
1257
|
workstreamStatus={getActivePlan.workstreamStatus}
|
|
@@ -1437,65 +1260,77 @@ function ModernAgentConversationInner({
|
|
|
1437
1260
|
plans={plans}
|
|
1438
1261
|
activePlanIndex={activePlanIndex}
|
|
1439
1262
|
onChangePlan={handleChangePlan}
|
|
1440
|
-
taskLabels={
|
|
1441
|
-
if (task.id && task.goal) {
|
|
1442
|
-
acc.set(task.id.toString(), task.goal);
|
|
1443
|
-
}
|
|
1444
|
-
return acc;
|
|
1445
|
-
}, new Map<string, string>())}
|
|
1263
|
+
taskLabels={taskLabels}
|
|
1446
1264
|
streamingMessages={streamingMessages}
|
|
1447
1265
|
onSendMessage={handleSendMessage}
|
|
1448
1266
|
thinkingMessageIndex={thinkingMessageIndex}
|
|
1267
|
+
messageItemClassNames={messageItemClassNames}
|
|
1268
|
+
messageStyleOverrides={messageStyleOverrides}
|
|
1269
|
+
toolCallGroupClassNames={toolCallGroupClassNames}
|
|
1270
|
+
hideToolCallsInViewMode={hideToolCallsInViewMode}
|
|
1271
|
+
streamingMessageClassNames={streamingMessageClassNames}
|
|
1272
|
+
batchProgressPanelClassNames={batchProgressPanelClassNames}
|
|
1273
|
+
viewMode={viewMode}
|
|
1274
|
+
hideWorkstreamTabs={hideWorkstreamTabs}
|
|
1275
|
+
workingIndicatorClassName={workingIndicatorClassName}
|
|
1276
|
+
messageListClassName={messageListClassName}
|
|
1277
|
+
StoreLinkComponent={effectiveStoreLinkComponent}
|
|
1278
|
+
CollectionLinkComponent={CollectionLinkComponent}
|
|
1279
|
+
prependFriendlyMessage={prependFriendlyMessage}
|
|
1449
1280
|
/>
|
|
1450
1281
|
)}
|
|
1451
1282
|
|
|
1452
1283
|
{/* Show workflow status message when not running, or show input when running/unknown */}
|
|
1453
1284
|
{/* Input area - flex-shrink-0 to stay pinned at bottom, with iOS safe area support */}
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1285
|
+
{!hideMessageInput && (
|
|
1286
|
+
<div className="flex-shrink-0" style={{ paddingBottom: 'env(safe-area-inset-bottom, 0px)' }}>
|
|
1287
|
+
{effectiveWorkflowStatus && effectiveWorkflowStatus !== "RUNNING" ? (
|
|
1288
|
+
<MessageBox
|
|
1289
|
+
status={effectiveWorkflowStatus === "COMPLETED" ? 'success' : 'done'}
|
|
1290
|
+
icon={null}
|
|
1291
|
+
className="m-2"
|
|
1292
|
+
>
|
|
1293
|
+
This Workflow is {effectiveWorkflowStatus}
|
|
1294
|
+
</MessageBox>
|
|
1295
|
+
) : showInput && (
|
|
1296
|
+
<MessageInput
|
|
1297
|
+
onSend={handleSendMessage}
|
|
1298
|
+
onStop={handleStopWorkflow}
|
|
1299
|
+
disabled={isUploading}
|
|
1300
|
+
isSending={isSending || isUploading}
|
|
1301
|
+
isStopping={isStopping}
|
|
1302
|
+
isStreaming={!isCompleted}
|
|
1303
|
+
isCompleted={isCompleted}
|
|
1304
|
+
activeTaskCount={getActiveTaskCount()}
|
|
1305
|
+
placeholder={placeholder}
|
|
1306
|
+
// File upload props - use internal handler that signals workflow
|
|
1307
|
+
onFilesSelected={handleFileUpload}
|
|
1308
|
+
uploadedFiles={uploadedFiles}
|
|
1309
|
+
onRemoveFile={onRemoveFile}
|
|
1310
|
+
acceptedFileTypes={acceptedFileTypes}
|
|
1311
|
+
maxFiles={maxFiles}
|
|
1312
|
+
// File processing state
|
|
1313
|
+
processingFiles={processingFiles}
|
|
1314
|
+
hasProcessingFiles={hasProcessingFiles}
|
|
1315
|
+
// Document search props
|
|
1316
|
+
renderDocumentSearch={renderDocumentSearch}
|
|
1317
|
+
selectedDocuments={selectedDocuments}
|
|
1318
|
+
onRemoveDocument={onRemoveDocument}
|
|
1319
|
+
// Object linking
|
|
1320
|
+
hideObjectLinking={hideObjectLinking}
|
|
1321
|
+
// Files Uploaded
|
|
1322
|
+
hideFileUpload={hideFileUpload}
|
|
1323
|
+
// Styling props
|
|
1324
|
+
className={inputContainerClassName}
|
|
1325
|
+
inputClassName={inputClassName}
|
|
1326
|
+
/>
|
|
1327
|
+
)}
|
|
1328
|
+
</div>
|
|
1329
|
+
)}
|
|
1495
1330
|
</div>
|
|
1496
1331
|
|
|
1497
1332
|
{/* Plan Panel Area - only rendered when panel should be shown */}
|
|
1498
|
-
{showSlidingPanel && (
|
|
1333
|
+
{!hidePlanPanel && showSlidingPanel && (
|
|
1499
1334
|
<div className="w-full lg:w-1/3 min-h-[50vh] lg:h-full border-t lg:border-t-0 lg:border-l">
|
|
1500
1335
|
<InlineSlidingPlanPanel
|
|
1501
1336
|
plan={getActivePlan.plan}
|
|
@@ -1508,25 +1343,44 @@ function ModernAgentConversationInner({
|
|
|
1508
1343
|
/>
|
|
1509
1344
|
</div>
|
|
1510
1345
|
)}
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1346
|
+
|
|
1347
|
+
{/* Document Panel Area - slides in when documents are created/edited */}
|
|
1348
|
+
{!hideDocumentPanel && isDocPanelOpen && openDocuments.length > 0 && (
|
|
1349
|
+
<div className={cn(
|
|
1350
|
+
"w-full lg:w-2/5 min-h-[50vh] lg:h-full border-t lg:border-t-0 lg:border-l",
|
|
1351
|
+
showSlidingPanel && "lg:w-1/3"
|
|
1352
|
+
)}>
|
|
1353
|
+
<DocumentPanel
|
|
1354
|
+
isOpen={isDocPanelOpen}
|
|
1355
|
+
onClose={handleCloseDocPanel}
|
|
1356
|
+
documents={openDocuments}
|
|
1357
|
+
activeDocumentId={activeDocumentId}
|
|
1358
|
+
onSelectDocument={selectDocument}
|
|
1359
|
+
onCloseDocument={handleCloseDocument}
|
|
1360
|
+
refreshKey={docRefreshKey}
|
|
1361
|
+
runId={run.runId}
|
|
1362
|
+
/>
|
|
1363
|
+
</div>
|
|
1364
|
+
)}
|
|
1365
|
+
<Modal isOpen={isPdfModalOpen} onClose={() => setIsPdfModalOpen(false)}>
|
|
1366
|
+
<ModalTitle>Export conversation as PDF</ModalTitle>
|
|
1367
|
+
<ModalBody>
|
|
1514
1368
|
<p className="mb-2">
|
|
1515
1369
|
This will open your browser's print dialog with the current conversation.
|
|
1516
1370
|
</p>
|
|
1517
1371
|
<p className="text-sm text-muted">
|
|
1518
1372
|
To save a PDF, choose "Save as PDF" or a similar option in the print dialog.
|
|
1519
1373
|
</p>
|
|
1520
|
-
</
|
|
1521
|
-
<
|
|
1374
|
+
</ModalBody>
|
|
1375
|
+
<ModalFooter align="right">
|
|
1522
1376
|
<Button variant="ghost" size="sm" onClick={() => setIsPdfModalOpen(false)}>
|
|
1523
1377
|
Cancel
|
|
1524
1378
|
</Button>
|
|
1525
1379
|
<Button size="sm" onClick={handleConfirmExportPdf}>
|
|
1526
1380
|
Open print dialog
|
|
1527
1381
|
</Button>
|
|
1528
|
-
</
|
|
1529
|
-
</
|
|
1382
|
+
</ModalFooter>
|
|
1383
|
+
</Modal>
|
|
1530
1384
|
</div>
|
|
1531
1385
|
</ImageLightboxProvider>
|
|
1532
1386
|
</ArtifactUrlCacheProvider>
|