@vertesia/ui 1.5.0-dev.20260722.120446Z → 1.5.0-dev.20260804.124748Z
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/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
- package/lib/core/components/shadcn/filters/filterBar.js +1 -1
- package/lib/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/core/components/shadcn/modal/dialog.d.ts +1 -1
- package/lib/core/components/shadcn/modal/dialog.d.ts.map +1 -1
- package/lib/core/components/shadcn/modal/dialog.js +2 -0
- package/lib/core/components/shadcn/modal/dialog.js.map +1 -1
- package/lib/core/components/shadcn/tabs.d.ts +12 -1
- package/lib/core/components/shadcn/tabs.d.ts.map +1 -1
- package/lib/core/components/shadcn/tabs.js +12 -4
- package/lib/core/components/shadcn/tabs.js.map +1 -1
- package/lib/core/hooks/useScrollableSearch.d.ts +1 -1
- package/lib/core/hooks/useScrollableSearch.d.ts.map +1 -1
- package/lib/core/hooks/useScrollableSearch.js +15 -2
- package/lib/core/hooks/useScrollableSearch.js.map +1 -1
- package/lib/env/index.d.ts +4 -0
- package/lib/env/index.d.ts.map +1 -1
- package/lib/env/index.js.map +1 -1
- package/lib/features/agent/chat/AgentRequestInputOverlay.d.ts +1 -1
- package/lib/features/agent/chat/AgentRequestInputOverlay.d.ts.map +1 -1
- package/lib/features/agent/chat/AgentRequestInputOverlay.js +3 -8
- package/lib/features/agent/chat/AgentRequestInputOverlay.js.map +1 -1
- package/lib/features/agent/chat/AgentRightPanel.d.ts +5 -1
- package/lib/features/agent/chat/AgentRightPanel.d.ts.map +1 -1
- package/lib/features/agent/chat/AgentRightPanel.js +2 -2
- package/lib/features/agent/chat/AgentRightPanel.js.map +1 -1
- package/lib/features/agent/chat/ArtifactsTab.d.ts +5 -1
- package/lib/features/agent/chat/ArtifactsTab.d.ts.map +1 -1
- package/lib/features/agent/chat/ArtifactsTab.js +48 -11
- package/lib/features/agent/chat/ArtifactsTab.js.map +1 -1
- package/lib/features/agent/chat/DocumentEditingActionCard.d.ts +6 -0
- package/lib/features/agent/chat/DocumentEditingActionCard.d.ts.map +1 -0
- package/lib/features/agent/chat/DocumentEditingActionCard.js +129 -0
- package/lib/features/agent/chat/DocumentEditingActionCard.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentConversation.d.ts +27 -2
- package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentConversation.js +174 -40
- package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.d.ts +2 -1
- package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.js +25 -10
- package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.d.ts +45 -0
- package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.js +40 -0
- package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +3 -1
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +118 -58
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.d.ts +2 -1
- package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js +23 -7
- package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.d.ts +25 -0
- package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.js +33 -0
- package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/Header.js +2 -2
- package/lib/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +2 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js +2 -2
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +3 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +23 -25
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.d.ts +14 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.js +21 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.d.ts +30 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.js +53 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js +21 -2
- package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts +9 -1
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js +97 -2
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.d.ts +6 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.js +29 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.d.ts +33 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.js +129 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts +7 -0
- package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/utils.js +11 -1
- package/lib/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
- package/lib/features/agent/chat/hooks/useAgentStream.d.ts +1 -1
- package/lib/features/agent/chat/hooks/useAgentStream.d.ts.map +1 -1
- package/lib/features/agent/chat/hooks/useAgentStream.js +34 -10
- package/lib/features/agent/chat/hooks/useAgentStream.js.map +1 -1
- package/lib/features/agent/chat/index.d.ts +2 -1
- package/lib/features/agent/chat/index.d.ts.map +1 -1
- package/lib/features/agent/chat/index.js +3 -0
- package/lib/features/agent/chat/index.js.map +1 -1
- package/lib/features/facets/PromptsFacetsNav.d.ts +8 -6
- package/lib/features/facets/PromptsFacetsNav.d.ts.map +1 -1
- package/lib/features/facets/PromptsFacetsNav.js +8 -3
- package/lib/features/facets/PromptsFacetsNav.js.map +1 -1
- package/lib/features/store/objects/DocumentSearchResults.js +2 -2
- package/lib/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/features/store/objects/components/ContentOverview.d.ts +2 -1
- package/lib/features/store/objects/components/ContentOverview.d.ts.map +1 -1
- package/lib/features/store/objects/components/ContentOverview.js +90 -16
- package/lib/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.d.ts +16 -0
- package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.d.ts.map +1 -0
- package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.js +116 -0
- package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.js.map +1 -0
- package/lib/features/store/objects/components/DocumentEditingLockStatus.d.ts +7 -0
- package/lib/features/store/objects/components/DocumentEditingLockStatus.d.ts.map +1 -0
- package/lib/features/store/objects/components/DocumentEditingLockStatus.js +13 -0
- package/lib/features/store/objects/components/DocumentEditingLockStatus.js.map +1 -0
- package/lib/features/store/objects/components/DocumentEditingPanel.d.ts +48 -0
- package/lib/features/store/objects/components/DocumentEditingPanel.d.ts.map +1 -0
- package/lib/features/store/objects/components/DocumentEditingPanel.js +720 -0
- package/lib/features/store/objects/components/DocumentEditingPanel.js.map +1 -0
- package/lib/features/store/objects/components/TextEditorPanel.d.ts.map +1 -1
- package/lib/features/store/objects/components/TextEditorPanel.js +22 -9
- package/lib/features/store/objects/components/TextEditorPanel.js.map +1 -1
- package/lib/features/store/objects/components/documentArtifactRefs.d.ts +26 -0
- package/lib/features/store/objects/components/documentArtifactRefs.d.ts.map +1 -0
- package/lib/features/store/objects/components/documentArtifactRefs.js +52 -0
- package/lib/features/store/objects/components/documentArtifactRefs.js.map +1 -0
- package/lib/features/store/objects/components/documentEditingAgentConfig.d.ts +4 -0
- package/lib/features/store/objects/components/documentEditingAgentConfig.d.ts.map +1 -0
- package/lib/features/store/objects/components/documentEditingAgentConfig.js +40 -0
- package/lib/features/store/objects/components/documentEditingAgentConfig.js.map +1 -0
- package/lib/features/store/objects/components/documentEditingPrompts.d.ts +3 -0
- package/lib/features/store/objects/components/documentEditingPrompts.d.ts.map +1 -0
- package/lib/features/store/objects/components/documentEditingPrompts.js +13 -0
- package/lib/features/store/objects/components/documentEditingPrompts.js.map +1 -0
- package/lib/features/store/objects/components/documentEditingRun.d.ts +27 -0
- package/lib/features/store/objects/components/documentEditingRun.d.ts.map +1 -0
- package/lib/features/store/objects/components/documentEditingRun.js +126 -0
- package/lib/features/store/objects/components/documentEditingRun.js.map +1 -0
- package/lib/features/store/objects/components/documentEditingTarget.d.ts +20 -0
- package/lib/features/store/objects/components/documentEditingTarget.d.ts.map +1 -0
- package/lib/features/store/objects/components/documentEditingTarget.js +40 -0
- package/lib/features/store/objects/components/documentEditingTarget.js.map +1 -0
- package/lib/features/store/objects/components/index.d.ts +1 -0
- package/lib/features/store/objects/components/index.d.ts.map +1 -1
- package/lib/features/store/objects/components/index.js +1 -0
- package/lib/features/store/objects/components/index.js.map +1 -1
- package/lib/features/store/objects/components/useContentPanelHooks.d.ts +36 -4
- package/lib/features/store/objects/components/useContentPanelHooks.d.ts.map +1 -1
- package/lib/features/store/objects/components/useContentPanelHooks.js +53 -29
- package/lib/features/store/objects/components/useContentPanelHooks.js.map +1 -1
- package/lib/features/store/objects/components/useDownloadFile.d.ts +2 -1
- package/lib/features/store/objects/components/useDownloadFile.d.ts.map +1 -1
- package/lib/features/store/objects/components/useDownloadFile.js +3 -0
- package/lib/features/store/objects/components/useDownloadFile.js.map +1 -1
- package/lib/features/store/objects/search/DocumentSearchContext.d.ts +128 -6
- package/lib/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
- package/lib/features/store/objects/selection/ObjectsActionContext.d.ts +2 -2
- package/lib/features/store/objects/selection/ObjectsActionContext.d.ts.map +1 -1
- package/lib/features/store/objects/selection/ObjectsActionSpec.d.ts +2 -2
- package/lib/features/store/objects/selection/ObjectsActionSpec.d.ts.map +1 -1
- package/lib/features/store/objects/selection/SelectionActions.d.ts +2 -2
- package/lib/features/store/objects/selection/SelectionActions.d.ts.map +1 -1
- package/lib/features/store/objects/selection/actions/StartWorkflowButton.js +1 -1
- package/lib/features/store/objects/selection/actions/StartWorkflowButton.js.map +1 -1
- package/lib/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
- package/lib/features/store/types/IntakePolicyEditor.d.ts +2 -2
- package/lib/features/store/types/IntakePolicyEditor.d.ts.map +1 -1
- package/lib/features/store/types/IntakePolicyEditor.js +5 -1
- package/lib/features/store/types/IntakePolicyEditor.js.map +1 -1
- package/lib/features/store/types/IntakePolicyForm.d.ts.map +1 -1
- package/lib/features/store/types/IntakePolicyForm.js +2 -2
- package/lib/features/store/types/IntakePolicyForm.js.map +1 -1
- package/lib/features/store/types/ObjectSchemaEditor.d.ts +2 -2
- package/lib/features/store/types/ObjectSchemaEditor.d.ts.map +1 -1
- package/lib/features/store/types/SelectContentType.d.ts +2 -2
- package/lib/features/store/types/SelectContentType.d.ts.map +1 -1
- package/lib/features/store/types/SelectContentType.js.map +1 -1
- package/lib/features/store/types/SelectContentTypeModal.d.ts +2 -2
- package/lib/features/store/types/SelectContentTypeModal.d.ts.map +1 -1
- package/lib/features/store/types/SelectContentTypeModal.js.map +1 -1
- package/lib/features/store/types/TableLayoutEditor.d.ts +2 -2
- package/lib/features/store/types/TableLayoutEditor.d.ts.map +1 -1
- package/lib/features/store/types/TypeRegistry.d.ts +1267 -6
- package/lib/features/store/types/TypeRegistry.d.ts.map +1 -1
- package/lib/features/store/types/TypeRegistry.js +5 -0
- package/lib/features/store/types/TypeRegistry.js.map +1 -1
- package/lib/features/store/types/intake-policy-editor.logic.d.ts +9 -1
- package/lib/features/store/types/intake-policy-editor.logic.d.ts.map +1 -1
- package/lib/features/store/types/intake-policy-editor.logic.js +9 -1
- package/lib/features/store/types/intake-policy-editor.logic.js.map +1 -1
- package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts +1251 -1
- package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts.map +1 -1
- package/lib/features/store/types/typeCatalogCache.d.ts +2 -2
- package/lib/features/store/types/typeCatalogCache.d.ts.map +1 -1
- package/lib/features/store/types/typeCatalogCache.js +4 -0
- package/lib/features/store/types/typeCatalogCache.js.map +1 -1
- package/lib/features/user/UserInfo.d.ts +118 -7
- package/lib/features/user/UserInfo.d.ts.map +1 -1
- package/lib/i18n/locales/ar.json +120 -2
- package/lib/i18n/locales/de.json +120 -2
- package/lib/i18n/locales/en.json +123 -1
- package/lib/i18n/locales/es.json +120 -2
- package/lib/i18n/locales/fr.json +120 -2
- package/lib/i18n/locales/it.json +120 -2
- package/lib/i18n/locales/ja.json +120 -2
- package/lib/i18n/locales/ko.json +120 -2
- package/lib/i18n/locales/pt.json +120 -2
- package/lib/i18n/locales/ru.json +120 -2
- package/lib/i18n/locales/tr.json +120 -2
- package/lib/i18n/locales/zh-TW.json +120 -2
- package/lib/i18n/locales/zh.json +120 -2
- package/lib/rich-text/EditorToolbar.d.ts +37 -0
- package/lib/rich-text/EditorToolbar.d.ts.map +1 -0
- package/lib/rich-text/EditorToolbar.js +215 -0
- package/lib/rich-text/EditorToolbar.js.map +1 -0
- package/lib/rich-text/VertesiaRichTextEditor.d.ts +26 -0
- package/lib/rich-text/VertesiaRichTextEditor.d.ts.map +1 -0
- package/lib/rich-text/VertesiaRichTextEditor.js +67 -0
- package/lib/rich-text/VertesiaRichTextEditor.js.map +1 -0
- package/lib/rich-text/index.d.ts +2 -0
- package/lib/rich-text/index.d.ts.map +1 -0
- package/lib/rich-text/index.js +2 -0
- package/lib/rich-text/index.js.map +1 -0
- package/lib/session/UserSession.d.ts +18 -4
- package/lib/session/UserSession.d.ts.map +1 -1
- package/lib/shell/apps/AppInstallationProvider.d.ts +222 -2
- package/lib/shell/apps/AppInstallationProvider.d.ts.map +1 -1
- package/lib/shell/login/InviteAcceptModal.js.map +1 -1
- package/lib/vertesia-ui-core.js +3 -3
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +35 -30
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-i18n.js +14 -14
- package/lib/vertesia-ui-i18n.js.map +1 -1
- package/lib/vertesia-ui-rich-text.js +5 -0
- package/lib/vertesia-ui-rich-text.js.map +1 -0
- package/lib/vertesia-ui-widgets.js +25 -7
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/lib/widgets/markdown/AgentResourceResolver.d.ts +31 -0
- package/lib/widgets/markdown/AgentResourceResolver.d.ts.map +1 -0
- package/lib/widgets/markdown/AgentResourceResolver.js +39 -0
- package/lib/widgets/markdown/AgentResourceResolver.js.map +1 -0
- package/lib/widgets/markdown/ArtifactEditingSurface.d.ts +63 -0
- package/lib/widgets/markdown/ArtifactEditingSurface.d.ts.map +1 -0
- package/lib/widgets/markdown/ArtifactEditingSurface.js +582 -0
- package/lib/widgets/markdown/ArtifactEditingSurface.js.map +1 -0
- package/lib/widgets/markdown/CollaborativeMarkdownRenderer.d.ts +69 -0
- package/lib/widgets/markdown/CollaborativeMarkdownRenderer.d.ts.map +1 -0
- package/lib/widgets/markdown/CollaborativeMarkdownRenderer.js +374 -0
- package/lib/widgets/markdown/CollaborativeMarkdownRenderer.js.map +1 -0
- package/lib/widgets/markdown/MarkdownLink.d.ts +3 -1
- package/lib/widgets/markdown/MarkdownLink.d.ts.map +1 -1
- package/lib/widgets/markdown/MarkdownLink.js +41 -14
- package/lib/widgets/markdown/MarkdownLink.js.map +1 -1
- package/lib/widgets/markdown/MarkdownRenderer.d.ts +8 -1
- package/lib/widgets/markdown/MarkdownRenderer.d.ts.map +1 -1
- package/lib/widgets/markdown/MarkdownRenderer.js +20 -4
- package/lib/widgets/markdown/MarkdownRenderer.js.map +1 -1
- package/lib/widgets/markdown/index.d.ts +5 -1
- package/lib/widgets/markdown/index.d.ts.map +1 -1
- package/lib/widgets/markdown/index.js +5 -1
- package/lib/widgets/markdown/index.js.map +1 -1
- package/lib/widgets/markdown/normalizeCustomSchemeLinks.d.ts.map +1 -1
- package/lib/widgets/markdown/normalizeCustomSchemeLinks.js +14 -2
- package/lib/widgets/markdown/normalizeCustomSchemeLinks.js.map +1 -1
- package/lib/widgets/markdown/textDiff.d.ts +52 -0
- package/lib/widgets/markdown/textDiff.d.ts.map +1 -0
- package/lib/widgets/markdown/textDiff.js +362 -0
- package/lib/widgets/markdown/textDiff.js.map +1 -0
- package/lib/widgets/markdown/useArtifactContent.d.ts +5 -3
- package/lib/widgets/markdown/useArtifactContent.d.ts.map +1 -1
- package/lib/widgets/markdown/useArtifactContent.js +6 -3
- package/lib/widgets/markdown/useArtifactContent.js.map +1 -1
- package/lib/widgets/markdown/useResolvedUrl.d.ts +1 -5
- package/lib/widgets/markdown/useResolvedUrl.d.ts.map +1 -1
- package/lib/widgets/markdown/useResolvedUrl.js +19 -31
- package/lib/widgets/markdown/useResolvedUrl.js.map +1 -1
- package/lib/widgets/monacoEditor/MonacoEditor.d.ts +7 -1
- package/lib/widgets/monacoEditor/MonacoEditor.d.ts.map +1 -1
- package/lib/widgets/monacoEditor/MonacoEditor.js +62 -6
- package/lib/widgets/monacoEditor/MonacoEditor.js.map +1 -1
- package/lib/widgets/xml-viewer/hooks/useXMLViewer.d.ts +9 -0
- package/lib/widgets/xml-viewer/hooks/useXMLViewer.d.ts.map +1 -1
- package/lib/widgets/xml-viewer/hooks/useXMLViewer.js +20 -17
- package/lib/widgets/xml-viewer/hooks/useXMLViewer.js.map +1 -1
- package/package.json +36 -32
- package/src/__tests__/a11y.test.tsx +4 -1
- package/src/__tests__/axe-helper.ts +17 -7
- package/src/__tests__/setup.ts +25 -0
- package/src/core/components/shadcn/filters/filterBar.tsx +1 -0
- package/src/core/components/shadcn/modal/dialog.tsx +3 -1
- package/src/core/components/shadcn/tabs.test.tsx +65 -0
- package/src/core/components/shadcn/tabs.tsx +25 -3
- package/src/core/hooks/useScrollableSearch.test.tsx +139 -0
- package/src/core/hooks/useScrollableSearch.tsx +17 -3
- package/src/env/index.ts +2 -0
- package/src/features/agent/chat/AgentChatPlaybackControls.test.tsx +2 -0
- package/src/features/agent/chat/AgentRequestInputOverlay.test.tsx +51 -6
- package/src/features/agent/chat/AgentRequestInputOverlay.tsx +5 -7
- package/src/features/agent/chat/AgentRightPanel.tsx +16 -1
- package/src/features/agent/chat/ArtifactsTab.test.tsx +55 -0
- package/src/features/agent/chat/ArtifactsTab.tsx +203 -52
- package/src/features/agent/chat/DocumentEditingActionCard.test.tsx +105 -0
- package/src/features/agent/chat/DocumentEditingActionCard.tsx +210 -0
- package/src/features/agent/chat/ModernAgentConversation.test.tsx +432 -43
- package/src/features/agent/chat/ModernAgentConversation.tsx +352 -96
- package/src/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.tsx +75 -20
- package/src/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.test.tsx +79 -0
- package/src/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.tsx +94 -0
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +369 -34
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +279 -115
- package/src/features/agent/chat/ModernAgentOutput/AttachmentPreview.tsx +53 -4
- package/src/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.test.tsx +44 -0
- package/src/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.tsx +88 -0
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +2 -2
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.test.tsx +71 -0
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +3 -1
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +48 -50
- package/src/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.tsx +40 -0
- package/src/features/agent/chat/ModernAgentOutput/ResourceChip.test.tsx +148 -0
- package/src/features/agent/chat/ModernAgentOutput/ResourceChip.tsx +141 -0
- package/src/features/agent/chat/ModernAgentOutput/ToolCallGroup.tsx +33 -1
- package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.test.ts +95 -0
- package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.ts +111 -1
- package/src/features/agent/chat/ModernAgentOutput/resourceLinks.tsx +43 -0
- package/src/features/agent/chat/ModernAgentOutput/resourceSummary.test.ts +229 -0
- package/src/features/agent/chat/ModernAgentOutput/resourceSummary.ts +152 -0
- package/src/features/agent/chat/ModernAgentOutput/utils.test.ts +17 -0
- package/src/features/agent/chat/ModernAgentOutput/utils.ts +14 -1
- package/src/features/agent/chat/hooks/useAgentStream.test.tsx +245 -0
- package/src/features/agent/chat/hooks/useAgentStream.ts +38 -9
- package/src/features/agent/chat/index.ts +12 -0
- package/src/features/facets/PromptsFacetsNav.tsx +17 -9
- package/src/features/store/objects/DocumentSearchResults.tsx +2 -2
- package/src/features/store/objects/components/ContentOverview.tsx +220 -66
- package/src/features/store/objects/components/DocumentEditingConfigurationSelector.test.ts +34 -0
- package/src/features/store/objects/components/DocumentEditingConfigurationSelector.tsx +211 -0
- package/src/features/store/objects/components/DocumentEditingLockStatus.test.tsx +32 -0
- package/src/features/store/objects/components/DocumentEditingLockStatus.tsx +45 -0
- package/src/features/store/objects/components/DocumentEditingPanel.test.tsx +336 -0
- package/src/features/store/objects/components/DocumentEditingPanel.tsx +1236 -0
- package/src/features/store/objects/components/TextEditorPanel.test.tsx +48 -0
- package/src/features/store/objects/components/TextEditorPanel.tsx +41 -20
- package/src/features/store/objects/components/documentArtifactRefs.test.ts +65 -0
- package/src/features/store/objects/components/documentArtifactRefs.ts +72 -0
- package/src/features/store/objects/components/documentEditingAgentConfig.test.ts +28 -0
- package/src/features/store/objects/components/documentEditingAgentConfig.ts +41 -0
- package/src/features/store/objects/components/documentEditingPrompts.test.ts +26 -0
- package/src/features/store/objects/components/documentEditingPrompts.ts +12 -0
- package/src/features/store/objects/components/documentEditingRun.test.ts +176 -0
- package/src/features/store/objects/components/documentEditingRun.ts +184 -0
- package/src/features/store/objects/components/documentEditingTarget.test.ts +96 -0
- package/src/features/store/objects/components/documentEditingTarget.ts +63 -0
- package/src/features/store/objects/components/index.ts +1 -0
- package/src/features/store/objects/components/useContentPanelHooks.ts +52 -27
- package/src/features/store/objects/components/useDownloadFile.test.ts +20 -0
- package/src/features/store/objects/components/useDownloadFile.ts +5 -1
- package/src/features/store/objects/selection/ObjectsActionContext.tsx +2 -2
- package/src/features/store/objects/selection/ObjectsActionSpec.ts +2 -2
- package/src/features/store/objects/selection/SelectionActions.tsx +2 -2
- package/src/features/store/objects/selection/actions/StartWorkflowButton.tsx +2 -2
- package/src/features/store/objects/upload/DocumentUploadModal.tsx +2 -2
- package/src/features/store/types/IntakePolicyEditor.tsx +12 -4
- package/src/features/store/types/IntakePolicyForm.tsx +25 -0
- package/src/features/store/types/ObjectSchemaEditor.tsx +2 -2
- package/src/features/store/types/SelectContentType.tsx +9 -9
- package/src/features/store/types/SelectContentTypeModal.tsx +5 -5
- package/src/features/store/types/TableLayoutEditor.tsx +2 -2
- package/src/features/store/types/TypeRegistry.ts +8 -3
- package/src/features/store/types/intake-policy-editor.logic.ts +10 -2
- package/src/features/store/types/typeCatalogCache.ts +10 -3
- package/src/i18n/locales/ar.json +120 -2
- package/src/i18n/locales/de.json +120 -2
- package/src/i18n/locales/en.json +123 -1
- package/src/i18n/locales/es.json +120 -2
- package/src/i18n/locales/fr.json +120 -2
- package/src/i18n/locales/it.json +120 -2
- package/src/i18n/locales/ja.json +120 -2
- package/src/i18n/locales/ko.json +120 -2
- package/src/i18n/locales/pt.json +120 -2
- package/src/i18n/locales/ru.json +120 -2
- package/src/i18n/locales/tr.json +120 -2
- package/src/i18n/locales/zh-TW.json +120 -2
- package/src/i18n/locales/zh.json +120 -2
- package/src/rich-text/EditorToolbar.tsx +708 -0
- package/src/rich-text/VertesiaRichTextEditor.test.tsx +211 -0
- package/src/rich-text/VertesiaRichTextEditor.tsx +241 -0
- package/src/rich-text/index.ts +9 -0
- package/src/session/UserSession.test.ts +11 -11
- package/src/shell/login/InviteAcceptModal.tsx +4 -4
- package/src/widgets/markdown/AgentResourceResolver.test.ts +24 -0
- package/src/widgets/markdown/AgentResourceResolver.tsx +70 -0
- package/src/widgets/markdown/ArtifactEditingSurface.test.tsx +541 -0
- package/src/widgets/markdown/ArtifactEditingSurface.tsx +878 -0
- package/src/widgets/markdown/CollaborativeMarkdownRenderer.test.tsx +484 -0
- package/src/widgets/markdown/CollaborativeMarkdownRenderer.tsx +825 -0
- package/src/widgets/markdown/MarkdownLink.test.tsx +122 -0
- package/src/widgets/markdown/MarkdownLink.tsx +102 -17
- package/src/widgets/markdown/MarkdownRenderer.tsx +30 -3
- package/src/widgets/markdown/index.ts +39 -1
- package/src/widgets/markdown/normalizeCustomSchemeLinks.ts +15 -2
- package/src/widgets/markdown/textDiff.test.ts +156 -0
- package/src/widgets/markdown/textDiff.ts +399 -0
- package/src/widgets/markdown/useArtifactContent.ts +9 -3
- package/src/widgets/markdown/useResolvedUrl.test.ts +29 -40
- package/src/widgets/markdown/useResolvedUrl.ts +33 -35
- package/src/widgets/monacoEditor/MonacoEditor.tsx +83 -7
- package/src/widgets/xml-viewer/hooks/useXMLViewer.test.ts +26 -0
- package/src/widgets/xml-viewer/hooks/useXMLViewer.ts +23 -18
|
@@ -4,7 +4,8 @@ import { FusionFragmentProvider } from '@vertesia/fusion-ux';
|
|
|
4
4
|
import { Button, cn, insertNewlineAtCursor, MessageBox, Modal, ModalBody, ModalFooter, ModalTitle, Spinner, Textarea, useToast, } from '@vertesia/ui/core';
|
|
5
5
|
import { useUITranslation } from '@vertesia/ui/i18n';
|
|
6
6
|
import { useUserSession } from '@vertesia/ui/session';
|
|
7
|
-
import {
|
|
7
|
+
import { AgentResourceResolverProvider, isArtifactRefreshEvent, } from '@vertesia/ui/widgets';
|
|
8
|
+
import { ArrowUpIcon, Bot, CheckCircle, ChevronDown, Cpu, FileTextIcon, UploadIcon, XIcon } from 'lucide-react';
|
|
8
9
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
10
|
import { McpConnectionsActionMenu } from '../../oauth/McpConnectionsButton.js';
|
|
10
11
|
import { AgentApprovalModeSelector } from './AgentApprovalModeSelector';
|
|
@@ -22,8 +23,8 @@ import { ActiveWorkstreamsSummary } from './ModernAgentOutput/ActiveWorkstreamsS
|
|
|
22
23
|
import AllMessagesMixed from './ModernAgentOutput/AllMessagesMixed';
|
|
23
24
|
import Header from './ModernAgentOutput/Header';
|
|
24
25
|
import MessageInput from './ModernAgentOutput/MessageInput';
|
|
25
|
-
import { getPendingRequestInputMessage } from './ModernAgentOutput/requestInputMessages';
|
|
26
|
-
import { debugAgentChat, filterMessagesForActiveWorkstream, getConversationUrl, getWorkstreamId, isInProgress, } from './ModernAgentOutput/utils';
|
|
26
|
+
import { clearRequestInputIdAnsweredForSession, getPendingRequestInputMessage, getRequestInputResolutionKey, getRequestInputResponseIdFromMetadata, isRequestInputAnsweredForSession, markRequestInputIdAnsweredForSession, } from './ModernAgentOutput/requestInputMessages';
|
|
27
|
+
import { debugAgentChat, filterMessagesForActiveWorkstream, getConversationUrl, getWorkstreamId, isInProgress, isPassiveArtifactUpdate, } from './ModernAgentOutput/utils';
|
|
27
28
|
import { createPlaybackState, getPlaybackCursorIndex, isAgentChatPlaybackAvailable, isAgentChatPlaybackEnabled, } from './playback';
|
|
28
29
|
import { SkillWidgetProvider } from './SkillWidgetProvider';
|
|
29
30
|
import { ArtifactUrlCacheProvider } from './useArtifactUrlCache.js';
|
|
@@ -31,6 +32,7 @@ import { VegaLiteChart } from './VegaLiteChart';
|
|
|
31
32
|
import { ThinkingMessages } from './WaitingMessages';
|
|
32
33
|
import { getWorkstreamDisplayName, getWorkstreamLaunchDetails, getWorkstreamLifecycleStatus, isWorkstreamInternalResultMessage, } from './workstreams.js';
|
|
33
34
|
const EMPTY_STREAMING_MESSAGES = new Map();
|
|
35
|
+
const COLLAPSED_STAGED_FILE_COUNT = 3;
|
|
34
36
|
function getTimestampMs(timestamp) {
|
|
35
37
|
if (typeof timestamp === 'number')
|
|
36
38
|
return timestamp;
|
|
@@ -54,7 +56,12 @@ function toContextWindowUsage(messages) {
|
|
|
54
56
|
if (!details)
|
|
55
57
|
continue;
|
|
56
58
|
const tokenUsage = details.token_usage;
|
|
57
|
-
|
|
59
|
+
// Mirror the server's checkpoint trigger (getContextPressureTokens):
|
|
60
|
+
// the last call's prompt size is the actual context; `total` includes
|
|
61
|
+
// reasoning output that never re-enters context and would overstate
|
|
62
|
+
// pressure on reasoning models. Fall back to total when no breakdown.
|
|
63
|
+
const promptTokens = getNumberDetail(tokenUsage?.prompt);
|
|
64
|
+
const usedTokens = promptTokens && promptTokens > 0 ? promptTokens : getNumberDetail(tokenUsage?.total);
|
|
58
65
|
const checkpointTokens = getNumberDetail(details.checkpoint_threshold) ?? getNumberDetail(details.checkpoint_at);
|
|
59
66
|
if (typeof usedTokens !== 'number' || typeof checkpointTokens !== 'number' || checkpointTokens <= 0) {
|
|
60
67
|
continue;
|
|
@@ -351,9 +358,10 @@ function downloadJsonFile(filename, payload) {
|
|
|
351
358
|
URL.revokeObjectURL(url);
|
|
352
359
|
}
|
|
353
360
|
export function ModernAgentConversation(props) {
|
|
354
|
-
const { agentRunId, startWorkflow } = props;
|
|
361
|
+
const { agentRunId, startWorkflow, resourceResolver } = props;
|
|
355
362
|
if (agentRunId) {
|
|
356
|
-
|
|
363
|
+
const conversation = (_jsx(SkillWidgetProvider, { children: _jsx(ModernAgentConversationInner, { ...props, agentRunId: agentRunId }) }));
|
|
364
|
+
return resourceResolver ? (_jsx(AgentResourceResolverProvider, { value: resourceResolver, children: conversation })) : (conversation);
|
|
357
365
|
}
|
|
358
366
|
else if (startWorkflow) {
|
|
359
367
|
// If we have startWorkflow capability but no agentRunId yet
|
|
@@ -375,8 +383,10 @@ function StartWorkflowView({ initialMessage, interactive = true, startWorkflow,
|
|
|
375
383
|
// Attachment callback - used to include existing document attachments in the first message
|
|
376
384
|
getAttachedDocs, onAttachmentsSent,
|
|
377
385
|
// File upload props
|
|
378
|
-
acceptedFileTypes, maxFiles = 5, hideHeader = false, hideFileUpload = false, hideObjectLinking, headerVariant, inputContainerClassName, inputClassName, className, allowWorkflowControl, initialToolApprovalMode, }) {
|
|
386
|
+
acceptedFileTypes, maxFiles = 5, hideHeader = false, hideFileUpload = false, hideObjectLinking, headerVariant, startViewVariant = 'default', inputContainerClassName, inputClassName, className, allowWorkflowControl, initialToolApprovalMode, onAgentWorkingChange, }) {
|
|
379
387
|
const { t } = useUITranslation();
|
|
388
|
+
const isCompactStartView = startViewVariant !== 'default';
|
|
389
|
+
const isExpandedStartComposer = startViewVariant === 'expanded-composer';
|
|
380
390
|
const canStageFiles = !hideFileUpload;
|
|
381
391
|
const resolvedPlaceholder = placeholder ?? t('agent.typeYourMessage');
|
|
382
392
|
const resolvedStartButtonText = startButtonText ?? t('agent.startAgent');
|
|
@@ -393,6 +403,12 @@ acceptedFileTypes, maxFiles = 5, hideHeader = false, hideFileUpload = false, hid
|
|
|
393
403
|
const fileInputRef = useRef(null);
|
|
394
404
|
// Staged files - stored locally until workflow starts
|
|
395
405
|
const [stagedFiles, setStagedFiles] = useState([]);
|
|
406
|
+
const [areStagedFilesExpanded, setAreStagedFilesExpanded] = useState(false);
|
|
407
|
+
const visibleStagedFiles = areStagedFilesExpanded ? stagedFiles : stagedFiles.slice(0, COLLAPSED_STAGED_FILE_COUNT);
|
|
408
|
+
const hiddenStagedFileCount = stagedFiles.length - COLLAPSED_STAGED_FILE_COUNT;
|
|
409
|
+
useEffect(() => {
|
|
410
|
+
onAgentWorkingChange?.(isSending);
|
|
411
|
+
}, [isSending, onAgentWorkingChange]);
|
|
396
412
|
// Drag and drop state
|
|
397
413
|
const [isDragOver, setIsDragOver] = useState(false);
|
|
398
414
|
const dragCounterRef = useRef(0);
|
|
@@ -463,6 +479,11 @@ acceptedFileTypes, maxFiles = 5, hideHeader = false, hideFileUpload = false, hid
|
|
|
463
479
|
const removeStagedFile = useCallback((index) => {
|
|
464
480
|
setStagedFiles((prev) => prev.filter((_, i) => i !== index));
|
|
465
481
|
}, []);
|
|
482
|
+
useEffect(() => {
|
|
483
|
+
if (stagedFiles.length <= COLLAPSED_STAGED_FILE_COUNT) {
|
|
484
|
+
setAreStagedFilesExpanded(false);
|
|
485
|
+
}
|
|
486
|
+
}, [stagedFiles.length]);
|
|
466
487
|
useEffect(() => {
|
|
467
488
|
// Focus the input field when component mounts
|
|
468
489
|
if (inputRef.current) {
|
|
@@ -596,10 +617,14 @@ acceptedFileTypes, maxFiles = 5, hideHeader = false, hideFileUpload = false, hid
|
|
|
596
617
|
const adjustTextareaHeight = useCallback(() => {
|
|
597
618
|
const textarea = inputRef.current;
|
|
598
619
|
if (textarea) {
|
|
620
|
+
if (isExpandedStartComposer) {
|
|
621
|
+
textarea.style.height = '100%';
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
599
624
|
textarea.style.height = 'auto';
|
|
600
625
|
textarea.style.height = `${Math.min(textarea.scrollHeight, 200)}px`;
|
|
601
626
|
}
|
|
602
|
-
}, []);
|
|
627
|
+
}, [isExpandedStartComposer]);
|
|
603
628
|
useEffect(() => {
|
|
604
629
|
void inputValue;
|
|
605
630
|
adjustTextareaHeight();
|
|
@@ -618,9 +643,12 @@ acceptedFileTypes, maxFiles = 5, hideHeader = false, hideFileUpload = false, hid
|
|
|
618
643
|
inputContainerClassName,
|
|
619
644
|
inputClassName,
|
|
620
645
|
className,
|
|
621
|
-
allowWorkflowControl,
|
|
646
|
+
allowWorkflowControl,
|
|
647
|
+
onAgentWorkingChange, agentRunId: startedAgentRunId, title: title, pendingStartMessage: pendingStartMessage ?? undefined, pendingStartTimestamp: pendingStartTimestamp ?? undefined, initialToolApprovalMode: toolApprovalMode }));
|
|
622
648
|
}
|
|
623
|
-
return (_jsx("div", { className: cn('flex
|
|
649
|
+
return (_jsx("div", { className: cn('flex flex-col items-center bg-background', isCompactStartView && !isExpandedStartComposer ? '' : 'h-full', className), children: _jsxs("div", { className: cn('relative flex w-full flex-col overflow-hidden border-0', isCompactStartView && !isExpandedStartComposer ? '' : 'h-full', fullWidth ? '' : 'max-w-4xl'), onDragEnter: canStageFiles ? handleDragEnter : undefined, onDragOver: canStageFiles ? handleDragOver : undefined, onDragLeave: canStageFiles ? handleDragLeave : undefined, onDrop: canStageFiles ? handleDrop : undefined, children: [canStageFiles && isDragOver && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-info-background z-50 pointer-events-none rounded-lg", children: _jsxs("div", { className: "text-info font-medium flex items-center gap-2 text-lg", children: [_jsx(UploadIcon, { className: "size-6" }), "Drop files to stage for upload"] }) })), canStageFiles && (_jsx("input", { ref: fileInputRef, type: "file", multiple: true, accept: acceptedFileTypes, onChange: handleFileInputChange, className: "hidden" })), !hideHeader && (_jsxs("div", { className: "flex items-center justify-between border-b border-border/60 bg-background px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "p-1", children: _jsx(Cpu, { className: "size-3.5 text-muted" }) }), _jsx("span", { className: "text-sm font-medium text-foreground", children: resolvedTitle })] }), onClose && !isModal && (_jsx(Button, { size: "xs", variant: "ghost", onClick: onClose, title: t('agent.close'), className: "text-muted hover:text-foreground", children: _jsx(XIcon, { className: "size-4" }) }))] })), _jsx("div", { className: cn('flex flex-col items-center justify-end bg-background px-4', isCompactStartView ? 'shrink-0 pt-3' : 'flex-1 overflow-y-auto'), children: pendingStartMessage && pendingStartTimestamp ? (_jsx(PendingStartConversation, { message: pendingStartMessage, startedAt: pendingStartTimestamp })) : (_jsx("div", { className: cn('mx-auto flex w-full max-w-3xl flex-col justify-end', isCompactStartView ? '' : 'min-h-full py-8'), children: initialMessage && (_jsx("div", { className: "text-[15px] leading-relaxed text-foreground/80", children: initialMessage })) })) }), _jsx("div", { className: cn('bg-background px-4 pb-safe-area-4 pt-2', isExpandedStartComposer ? 'flex min-h-0 flex-1 flex-col' : 'shrink-0'), children: _jsxs("div", { className: cn('mx-auto flex max-w-3xl flex-col gap-3 rounded-2xl border border-border/70 bg-mixer-muted/15 p-3 shadow-lg shadow-black/5', isExpandedStartComposer && 'min-h-0 w-full flex-1', inputContainerClassName), children: [canStageFiles && stagedFiles.length > 0 && (_jsxs("div", { className: "flex flex-wrap gap-2", children: [visibleStagedFiles.map((file, index) => (_jsxs("div", { className: "flex items-center gap-1.5 rounded-md bg-attention/10 px-2 py-1 text-sm text-attention", title: t('agent.fileStagedTooltip'), children: [_jsx(FileTextIcon, { className: "size-3.5" }), _jsx("span", { className: "max-w-[120px] truncate", children: file.name }), _jsx("span", { className: "text-xs opacity-70", children: t('agent.staged') }), _jsx(Button, { variant: "unstyled", "aria-label": `Remove staged file ${file.name}`, onClick: () => removeStagedFile(index), className: "ms-1 rounded p-0.5 hover:bg-attention/20", children: _jsx(XIcon, { className: "size-3" }) })] }, `${file.name}-${file.size}-${file.lastModified}`))), stagedFiles.length > COLLAPSED_STAGED_FILE_COUNT && (_jsxs(Button, { type: "button", variant: "ghost", size: "sm", "aria-expanded": areStagedFilesExpanded, onClick: () => setAreStagedFilesExpanded((expanded) => !expanded), className: "h-8 shrink-0 gap-1 rounded-xl px-2.5 text-xs text-muted", children: [!areStagedFilesExpanded && _jsxs("span", { children: ["+", hiddenStagedFileCount] }), areStagedFilesExpanded ? t('agent.showLess') : t('agent.showMore'), _jsx(ChevronDown, { className: cn('size-3.5 transition-transform', areStagedFilesExpanded && 'rotate-180'), "aria-hidden": "true" })] }))] })), _jsx(Textarea, { ref: inputRef, value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, onPaste: handlePaste, placeholder: resolvedPlaceholder, disabled: isSending, rows: 2, className: cn('min-h-[72px] resize-none overflow-hidden border-0 bg-transparent px-0 py-0 text-sm leading-6 shadow-none focus-visible:ring-0', isExpandedStartComposer && 'min-h-0 flex-1', inputClassName), style: isExpandedStartComposer
|
|
650
|
+
? { minHeight: '72px', maxHeight: 'none' }
|
|
651
|
+
: { minHeight: '72px', maxHeight: '200px' } }), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [canStageFiles && (_jsx(Button, { variant: "ghost", size: "icon", onClick: () => fileInputRef.current?.click(), disabled: isSending || stagedFiles.length >= maxFiles, "aria-label": t('agent.upload'), className: "rounded-full text-muted", title: t('agent.upload'), children: _jsx(UploadIcon, { className: "size-4" }) })), interactive && (_jsx(AgentApprovalModeSelector, { mode: toolApprovalMode, onChange: setToolApprovalMode, disabled: isSending }))] }), _jsx(Button, { onClick: startWorkflowWithMessage, disabled: !inputValue.trim() || isSending, variant: "ghost", size: "icon", className: cn('size-9 rounded-full border border-border/60 bg-foreground text-background shadow-sm', 'hover:bg-foreground/90 hover:text-background', 'disabled:bg-mixer-muted/25 disabled:text-muted disabled:opacity-100'), title: resolvedStartButtonText, children: isSending ? _jsx(Spinner, { size: "sm" }) : _jsx(ArrowUpIcon, { className: "size-4" }) })] })] }) })] }) }));
|
|
624
652
|
}
|
|
625
653
|
// Inner component that handles the agent conversation - similar to ModernAgentOutput
|
|
626
654
|
function ModernAgentConversationInner({ agentRunId, title, interactive = true, onClose, isModal = false, fullWidth = false, placeholder, resetWorkflow, onRestart, onClone, onShowDetails, allowWorkflowControl = true,
|
|
@@ -639,11 +667,11 @@ isUploading = false,
|
|
|
639
667
|
// Context callback
|
|
640
668
|
getMessageContext,
|
|
641
669
|
// Styling props
|
|
642
|
-
className, inputContainerClassName, inputClassName,
|
|
670
|
+
className, inputContainerClassName, inputClassName, composerContext,
|
|
643
671
|
// Fusion fragment data
|
|
644
672
|
fusionData,
|
|
645
673
|
// External file upload API
|
|
646
|
-
fileUploadRef, onProcessingFilesChange, processingFiles: processingFilesProp,
|
|
674
|
+
fileUploadRef, sendMessageRef, onMessage, onAgentWorkingChange, onProcessingFilesChange, processingFiles: processingFilesProp,
|
|
647
675
|
// External plan panel API
|
|
648
676
|
onPlansChange, onWorkstreamStatusChange,
|
|
649
677
|
// External view mode control
|
|
@@ -659,14 +687,14 @@ streamingMessageClassNames,
|
|
|
659
687
|
// BatchProgressPanel className overrides
|
|
660
688
|
batchProgressPanelClassNames,
|
|
661
689
|
// AllMessagesMixed className overrides
|
|
662
|
-
workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionLinkComponent, prependFriendlyMessage, initialRequestData, initialRequestSchema, initialRequestTitle, initialRequestTemplate, payloadContent, conversationContent, conversationTab = false, pendingStartMessage, pendingStartTimestamp, initialToolApprovalMode, enablePlayback, showPlaybackToggle = true, }) {
|
|
690
|
+
workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionLinkComponent, prependFriendlyMessage, initialRequestData, initialRequestSchema, initialRequestTitle, initialRequestTemplate, payloadContent, conversationContent, conversationTab = false, pendingStartMessage, pendingStartTimestamp, initialToolApprovalMode, enablePlayback, showPlaybackToggle = true, messageFilter, }) {
|
|
663
691
|
const { t } = useUITranslation();
|
|
664
692
|
const { client } = useUserSession();
|
|
665
693
|
const toast = useToast();
|
|
666
694
|
// ────────────────────────────────────────────
|
|
667
695
|
// Extracted hooks
|
|
668
696
|
// ────────────────────────────────────────────
|
|
669
|
-
const { messages, streamingMessages, isCompleted, initialHistoryStatus, debugChunkFlash, addOptimisticMessage, updateOptimisticMessageStatus, reconnect: reconnectStream, agentRunStatus, workflowRunId, serverFileUpdates, } = useAgentStream(client, agentRunId);
|
|
697
|
+
const { messages, streamingMessages, isCompleted, initialHistoryStatus, debugChunkFlash, addOptimisticMessage, updateOptimisticMessageStatus, reconnect: reconnectStream, agentRunStatus, workflowRunId, serverFileUpdates, } = useAgentStream(client, agentRunId, onMessage);
|
|
670
698
|
const { plans, activePlanIndex, setActivePlanIndex, workstreamStatusMap, showInput, showSlidingPanel, setShowSlidingPanel, } = useAgentPlans(messages, interactive, isModal);
|
|
671
699
|
const { openDocuments, activeDocumentId, isDocPanelOpen, docRefreshKey, closeDocPanel: handleCloseDocPanel, closeDocument: handleCloseDocument, selectDocument, openDocInPanel, updateDocumentTitle, } = useDocumentPanel(messages);
|
|
672
700
|
const { processingFiles, hasProcessingFiles, handleFileUpload, removeProcessingFile, clearProcessingFiles } = useFileProcessing(client, agentRunId, serverFileUpdates, toast);
|
|
@@ -811,24 +839,42 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
811
839
|
}, [activeWorkstreamDisplayName, placeholder, t]);
|
|
812
840
|
const canShowPlaybackToggle = showPlaybackToggle && enablePlayback === undefined && isAgentChatPlaybackAvailable();
|
|
813
841
|
const isPlaybackEnabled = enablePlayback ?? (isAgentChatPlaybackEnabled() || isPlaybackToggleEnabled);
|
|
814
|
-
const
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
}, [activeWorkstream, hiddenMessageTypes, messages]);
|
|
842
|
+
const transcriptSourceMessages = useMemo(() => {
|
|
843
|
+
// Passive artifact autosaves are surfaced by the editor's own save indicator, not the chat.
|
|
844
|
+
return messages.filter((message) => !isPassiveArtifactUpdate(message) && !(hiddenMessageTypes?.includes(message.type) ?? false));
|
|
845
|
+
}, [hiddenMessageTypes, messages]);
|
|
846
|
+
const playbackSourceMessages = useMemo(() => filterMessagesForActiveWorkstream(transcriptSourceMessages, activeWorkstream), [activeWorkstream, transcriptSourceMessages]);
|
|
820
847
|
const playbackState = useMemo(() => createPlaybackState(playbackSourceMessages, playbackCursor, isPlaybackEnabled), [isPlaybackEnabled, playbackCursor, playbackSourceMessages]);
|
|
821
848
|
const clampedPlaybackCursor = playbackState.cursor;
|
|
822
849
|
const isPlaybackLive = playbackState.isLive;
|
|
823
850
|
const isPlaybackAtLatest = isPlaybackEnabled && !isPlaybackLive && playbackState.cursorIndex === playbackSourceMessages.length - 1;
|
|
824
851
|
const displayedMessages = playbackState.displayedMessages;
|
|
852
|
+
const renderedMessages = useMemo(() => (messageFilter ? displayedMessages.filter((message) => messageFilter(message)) : displayedMessages), [displayedMessages, messageFilter]);
|
|
853
|
+
const renderedWorkstreamSourceMessages = useMemo(() => messageFilter
|
|
854
|
+
? transcriptSourceMessages.filter((message) => messageFilter(message))
|
|
855
|
+
: transcriptSourceMessages, [messageFilter, transcriptSourceMessages]);
|
|
825
856
|
const displayedStreamingMessages = isPlaybackLive ? streamingMessages : EMPTY_STREAMING_MESSAGES;
|
|
826
857
|
const playbackDerivedWorkstreams = useMemo(() => deriveWorkstreamsFromMessages(displayedMessages), [displayedMessages]);
|
|
827
858
|
const playbackActiveWorkstreams = useMemo(() => playbackDerivedWorkstreams.filter((ws) => isActiveWorkstreamStatus(ws.status)), [playbackDerivedWorkstreams]);
|
|
828
859
|
const effectiveIsCompleted = useMemo(() => isCompleted || !isInProgress(messages), [isCompleted, messages]);
|
|
829
860
|
const displayedIsCompleted = isPlaybackLive || isPlaybackAtLatest ? effectiveIsCompleted : false;
|
|
830
|
-
const
|
|
831
|
-
|
|
861
|
+
const isAgentWorking = !effectiveIsCompleted && !isWorkflowTerminal;
|
|
862
|
+
useEffect(() => {
|
|
863
|
+
onAgentWorkingChange?.(isAgentWorking);
|
|
864
|
+
}, [isAgentWorking, onAgentWorkingChange]);
|
|
865
|
+
const pendingRequestInputMessage = useMemo(() => {
|
|
866
|
+
const answeredRequestInputKeys = new Set();
|
|
867
|
+
for (const message of displayedMessages) {
|
|
868
|
+
if (isRequestInputAnsweredForSession(agentRunId, message)) {
|
|
869
|
+
answeredRequestInputKeys.add(getRequestInputResolutionKey(message));
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
return getPendingRequestInputMessage(displayedMessages, 'main', answeredRequestInputKeys);
|
|
873
|
+
}, [agentRunId, displayedMessages]);
|
|
874
|
+
// A terminal run silently drops user input unless it can be continued (see the guard in
|
|
875
|
+
// handleSendMessage), so never surface an actionable question overlay in that state —
|
|
876
|
+
// the terminal status box renders instead.
|
|
877
|
+
const shouldShowRequestInputOverlay = Boolean(pendingRequestInputMessage) && !isFailed && (!isWorkflowTerminal || canContinueConversation);
|
|
832
878
|
const isViewingPlaybackHistory = isPlaybackEnabled && !isPlaybackLive;
|
|
833
879
|
const shouldRenderLiveMessageInputArea = shouldRenderMessageInputArea && !isViewingPlaybackHistory;
|
|
834
880
|
const contextWindowUsage = useMemo(() => toContextWindowUsage(messages), [messages]);
|
|
@@ -840,7 +886,7 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
840
886
|
agentRunId,
|
|
841
887
|
messageCount: messages.length,
|
|
842
888
|
playbackMessageCount: playbackSourceMessages.length,
|
|
843
|
-
displayedMessageCount:
|
|
889
|
+
displayedMessageCount: renderedMessages.length,
|
|
844
890
|
streamingCount: streamingMessages.size,
|
|
845
891
|
displayedStreamingCount: displayedStreamingMessages.size,
|
|
846
892
|
initialHistoryStatus,
|
|
@@ -864,7 +910,7 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
864
910
|
agentRunStatus,
|
|
865
911
|
clampedPlaybackCursor,
|
|
866
912
|
displayedIsCompleted,
|
|
867
|
-
|
|
913
|
+
renderedMessages.length,
|
|
868
914
|
displayedStreamingMessages.size,
|
|
869
915
|
effectiveIsCompleted,
|
|
870
916
|
effectiveWorkflowStatus,
|
|
@@ -915,26 +961,44 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
915
961
|
// ────────────────────────────────────────────
|
|
916
962
|
// Stable callbacks
|
|
917
963
|
// ────────────────────────────────────────────
|
|
918
|
-
const handleTogglePlanPanel = useCallback(() => {
|
|
919
|
-
setShowSlidingPanel((prev) => {
|
|
920
|
-
if (!prev) {
|
|
921
|
-
sessionStorage.setItem('plan-panel-shown', 'true');
|
|
922
|
-
}
|
|
923
|
-
return !prev;
|
|
924
|
-
});
|
|
925
|
-
}, [setShowSlidingPanel]);
|
|
926
964
|
const handleChangePlan = useCallback((index) => {
|
|
927
965
|
setActivePlanIndex(index);
|
|
928
966
|
}, [setActivePlanIndex]);
|
|
929
967
|
const [rightPanelTab, setRightPanelTab] = useState(conversationContent || conversationTab ? 'conversation' : 'plan');
|
|
968
|
+
const [selectedArtifactPath, setSelectedArtifactPath] = useState(null);
|
|
930
969
|
const [rightPanelWidth, setRightPanelWidth] = useState(400);
|
|
931
970
|
const [isRightPanelResizing, setIsRightPanelResizing] = useState(false);
|
|
971
|
+
// Master override for the "Toggle right sidebar" control. `showSlidingPanel` only tracks the
|
|
972
|
+
// plan; open documents/workstreams keep the panel visible on their own, so without this the
|
|
973
|
+
// toggle can't hide the panel while a document is open. Explicit reveals (opening an artifact
|
|
974
|
+
// or document) clear it again.
|
|
975
|
+
const [rightPanelManuallyClosed, setRightPanelManuallyClosed] = useState(false);
|
|
932
976
|
const isRightPanelVisible = showRightPanelProp &&
|
|
977
|
+
!rightPanelManuallyClosed &&
|
|
933
978
|
(showSlidingPanel ||
|
|
934
979
|
isDocPanelOpen ||
|
|
935
980
|
(!hideWorkstreamTabs && panelWorkstreams.length > 0) ||
|
|
936
981
|
!!conversationContent ||
|
|
937
982
|
conversationTab);
|
|
983
|
+
// A newly opened document should reveal the panel even if the user had manually collapsed it.
|
|
984
|
+
const previousDocPanelOpenRef = useRef(isDocPanelOpen);
|
|
985
|
+
useEffect(() => {
|
|
986
|
+
if (isDocPanelOpen && !previousDocPanelOpenRef.current) {
|
|
987
|
+
setRightPanelManuallyClosed(false);
|
|
988
|
+
}
|
|
989
|
+
previousDocPanelOpenRef.current = isDocPanelOpen;
|
|
990
|
+
}, [isDocPanelOpen]);
|
|
991
|
+
const handleTogglePlanPanel = useCallback(() => {
|
|
992
|
+
if (isRightPanelVisible) {
|
|
993
|
+
setRightPanelManuallyClosed(true);
|
|
994
|
+
setShowSlidingPanel(false);
|
|
995
|
+
}
|
|
996
|
+
else {
|
|
997
|
+
setRightPanelManuallyClosed(false);
|
|
998
|
+
setShowSlidingPanel(true);
|
|
999
|
+
sessionStorage.setItem('plan-panel-shown', 'true');
|
|
1000
|
+
}
|
|
1001
|
+
}, [isRightPanelVisible, setShowSlidingPanel]);
|
|
938
1002
|
useEffect(() => {
|
|
939
1003
|
if (!isRightPanelVisible && isRightPanelResizing) {
|
|
940
1004
|
setIsRightPanelResizing(false);
|
|
@@ -970,9 +1034,40 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
970
1034
|
};
|
|
971
1035
|
}, [isRightPanelResizing]);
|
|
972
1036
|
const handleCloseRightPanel = useCallback(() => {
|
|
1037
|
+
setRightPanelManuallyClosed(true);
|
|
973
1038
|
setShowSlidingPanel(false);
|
|
974
1039
|
handleCloseDocPanel();
|
|
975
1040
|
}, [setShowSlidingPanel, handleCloseDocPanel]);
|
|
1041
|
+
const handleOpenArtifact = useCallback((path) => {
|
|
1042
|
+
if (!/\.md$/i.test(path))
|
|
1043
|
+
return;
|
|
1044
|
+
setRightPanelManuallyClosed(false);
|
|
1045
|
+
setSelectedArtifactPath(path);
|
|
1046
|
+
setRightPanelTab('artifacts');
|
|
1047
|
+
setShowSlidingPanel(true);
|
|
1048
|
+
}, [setShowSlidingPanel]);
|
|
1049
|
+
// The `display_artifact` tool emits a `display_artifact` stream event asking the UI
|
|
1050
|
+
// to reveal a text artifact in the editor. Act on the latest such event, once per
|
|
1051
|
+
// distinct occurrence so the user can still close the panel without it snapping back.
|
|
1052
|
+
const displayedArtifactMarkerRef = useRef(null);
|
|
1053
|
+
useEffect(() => {
|
|
1054
|
+
let target;
|
|
1055
|
+
let marker;
|
|
1056
|
+
for (const message of messages) {
|
|
1057
|
+
const details = message.details;
|
|
1058
|
+
if (details?.event_class === 'display_artifact' && typeof details.path === 'string') {
|
|
1059
|
+
target = details.path;
|
|
1060
|
+
marker = `${message.timestamp ?? ''}:${details.path}`;
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
if (!target || !marker || marker === displayedArtifactMarkerRef.current)
|
|
1064
|
+
return;
|
|
1065
|
+
displayedArtifactMarkerRef.current = marker;
|
|
1066
|
+
setRightPanelManuallyClosed(false);
|
|
1067
|
+
setSelectedArtifactPath(target);
|
|
1068
|
+
setRightPanelTab('artifacts');
|
|
1069
|
+
setShowSlidingPanel(true);
|
|
1070
|
+
}, [messages, setShowSlidingPanel]);
|
|
976
1071
|
// Default StoreLinkComponent that opens documents in the panel
|
|
977
1072
|
const internalStoreLinkComponent = useCallback(({ href, documentId, children }) => (_jsx("a", { href: href, className: "text-info underline cursor-pointer hover:text-info/80", onClick: (e) => {
|
|
978
1073
|
e.preventDefault();
|
|
@@ -1007,6 +1102,7 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1007
1102
|
}, [workstreamStatusMap, onWorkstreamStatusChange]);
|
|
1008
1103
|
useEffect(() => {
|
|
1009
1104
|
void agentRunId;
|
|
1105
|
+
setSelectedArtifactPath(null);
|
|
1010
1106
|
workstreamFetchFailedRef.current = false;
|
|
1011
1107
|
setIsWorkstreamQueryUnavailable(false);
|
|
1012
1108
|
setQueriedActiveWorkstreams([]);
|
|
@@ -1139,6 +1235,7 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1139
1235
|
});
|
|
1140
1236
|
return;
|
|
1141
1237
|
}
|
|
1238
|
+
const requestInputId = getRequestInputResponseIdFromMetadata(inputMetadata);
|
|
1142
1239
|
setIsSending(true);
|
|
1143
1240
|
const attachedDocs = getAttachedDocs?.() || [];
|
|
1144
1241
|
const contextMetadata = getMessageContext?.() || {};
|
|
@@ -1171,7 +1268,15 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1171
1268
|
type: AgentMessageType.QUESTION,
|
|
1172
1269
|
message: messageContent,
|
|
1173
1270
|
workstream_id: 'main',
|
|
1174
|
-
details: {
|
|
1271
|
+
details: {
|
|
1272
|
+
_optimistic: true,
|
|
1273
|
+
_messageId: messageId,
|
|
1274
|
+
_deliveryStatus: 'sending',
|
|
1275
|
+
...(inputMetadata?.editing_action ? { editing_action: inputMetadata.editing_action } : {}),
|
|
1276
|
+
...(inputMetadata?.request_input_response
|
|
1277
|
+
? { request_input_response: inputMetadata.request_input_response }
|
|
1278
|
+
: {}),
|
|
1279
|
+
},
|
|
1175
1280
|
};
|
|
1176
1281
|
addOptimisticMessage(optimisticMessage);
|
|
1177
1282
|
const metadata = {
|
|
@@ -1196,6 +1301,9 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1196
1301
|
// buffers the signal until the new run is ready to receive it. We reconnect
|
|
1197
1302
|
// the stream in place (rather than remounting via onRestart) so the existing
|
|
1198
1303
|
// timeline is preserved and the new exchange appends seamlessly at the bottom.
|
|
1304
|
+
if (requestInputId) {
|
|
1305
|
+
markRequestInputIdAnsweredForSession(agentRunId, requestInputId);
|
|
1306
|
+
}
|
|
1199
1307
|
const deliver = (async () => {
|
|
1200
1308
|
await waitForPendingToolApprovalModeChange();
|
|
1201
1309
|
if (isWorkflowTerminalRef.current) {
|
|
@@ -1207,6 +1315,9 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1207
1315
|
})();
|
|
1208
1316
|
deliver
|
|
1209
1317
|
.catch((err) => {
|
|
1318
|
+
if (requestInputId) {
|
|
1319
|
+
clearRequestInputIdAnsweredForSession(agentRunId, requestInputId);
|
|
1320
|
+
}
|
|
1210
1321
|
updateOptimisticMessageStatus(messageId, 'failed');
|
|
1211
1322
|
toast({
|
|
1212
1323
|
status: 'error',
|
|
@@ -1232,10 +1343,18 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1232
1343
|
t,
|
|
1233
1344
|
waitForPendingToolApprovalModeChange,
|
|
1234
1345
|
]);
|
|
1346
|
+
useEffect(() => {
|
|
1347
|
+
if (sendMessageRef)
|
|
1348
|
+
sendMessageRef.current = handleSendMessage;
|
|
1349
|
+
return () => {
|
|
1350
|
+
if (sendMessageRef?.current === handleSendMessage)
|
|
1351
|
+
sendMessageRef.current = null;
|
|
1352
|
+
};
|
|
1353
|
+
}, [handleSendMessage, sendMessageRef]);
|
|
1235
1354
|
// After the user connects an MCP server requested via request_mcp_connection, flag the
|
|
1236
1355
|
// conversation for tool re-discovery and resume it with a confirmation message so the agent
|
|
1237
1356
|
// continues automatically with the newly-available tools.
|
|
1238
|
-
const handleMcpConnected = useCallback(async (cfg) => {
|
|
1357
|
+
const handleMcpConnected = useCallback(async (cfg, metadata) => {
|
|
1239
1358
|
// Await the dirty-flag signal BEFORE sending the follow-up message so Temporal records
|
|
1240
1359
|
// McpConfigChanged ahead of the UserInput. Otherwise the resume turn could run before
|
|
1241
1360
|
// the flag is set and use the stale tool catalog. An omitted disabled list preserves
|
|
@@ -1246,7 +1365,7 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1246
1365
|
catch (err) {
|
|
1247
1366
|
console.error('Failed to signal MCP config change', err);
|
|
1248
1367
|
}
|
|
1249
|
-
handleSendMessage(t('agent.mcpConnectedMessage', { name: cfg.name }));
|
|
1368
|
+
handleSendMessage(t('agent.mcpConnectedMessage', { name: cfg.name }), metadata);
|
|
1250
1369
|
}, [client, agentRunId, handleSendMessage, t]);
|
|
1251
1370
|
// Per-conversation MCP deactivation set, seeded from the run and updated live via the
|
|
1252
1371
|
// MCP action menu in the composer toolbar. Changes are pushed to the running workflow
|
|
@@ -1530,27 +1649,42 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1530
1649
|
return false;
|
|
1531
1650
|
}).length;
|
|
1532
1651
|
}, [messages]);
|
|
1652
|
+
const selectedArtifactRefresh = useMemo(() => {
|
|
1653
|
+
if (!selectedArtifactPath)
|
|
1654
|
+
return { key: artifactRefreshKey, details: undefined };
|
|
1655
|
+
let key = 0;
|
|
1656
|
+
let details;
|
|
1657
|
+
for (const message of messages) {
|
|
1658
|
+
const candidate = message.details;
|
|
1659
|
+
if (!isArtifactRefreshEvent(candidate, selectedArtifactPath))
|
|
1660
|
+
continue;
|
|
1661
|
+
key++;
|
|
1662
|
+
details = candidate;
|
|
1663
|
+
}
|
|
1664
|
+
return { key, details };
|
|
1665
|
+
}, [artifactRefreshKey, messages, selectedArtifactPath]);
|
|
1666
|
+
const canCollaborateWithArtifacts = interactive && isPlaybackLive && effectiveWorkflowStatus?.toUpperCase() === 'RUNNING';
|
|
1533
1667
|
// PERFORMANCE: Memoize taskLabels to prevent AllMessagesMixed re-renders
|
|
1534
1668
|
const taskLabels = useMemo(() => getActivePlan.plan.plan?.reduce((acc, task) => {
|
|
1535
1669
|
if (task.id && task.goal)
|
|
1536
1670
|
acc.set(task.id.toString(), task.goal);
|
|
1537
1671
|
return acc;
|
|
1538
1672
|
}, new Map()), [getActivePlan.plan]);
|
|
1539
|
-
const renderConversationHeader = (variant) => (_jsx(Header, { title: actualTitle, variant: variant, isCompleted: effectiveIsCompleted, isTerminal: isWorkflowTerminal, onClose: onClose, isModal: isModal, agentRunId: agentRunId, workflowRunId: workflowRunId || '', viewMode: viewMode, onViewModeChange: handleViewModeChange, showPlanPanel:
|
|
1673
|
+
const renderConversationHeader = (variant) => (_jsx(Header, { title: actualTitle, variant: variant, isCompleted: effectiveIsCompleted, isTerminal: isWorkflowTerminal, onClose: onClose, isModal: isModal, agentRunId: agentRunId, workflowRunId: workflowRunId || '', viewMode: viewMode, onViewModeChange: handleViewModeChange, showPlanPanel: isRightPanelVisible, hasPlan: showRightPanelProp && plans.length > 0, showPlanButton: showRightPanelProp && !conversationTab, onTogglePlanPanel: handleTogglePlanPanel, showPlaybackButton: canShowPlaybackToggle, isPlaybackEnabled: isPlaybackEnabled, onTogglePlayback: handleTogglePlayback, onDownload: downloadConversation, onExportFixture: exportReplayFixture, resetWorkflow: resetWorkflow, onClone: onClone, onShowDetails: onShowDetails, allowWorkflowControl: allowWorkflowControl, onExportPdf: exportConversationPdf, isReceivingChunks: debugChunkFlash }));
|
|
1540
1674
|
// Conversation area inner content — shared between main layout and conversationTab mode
|
|
1541
|
-
const conversationAreaJsx = (_jsxs("div", { ref: conversationRef, "data-agent-playback-enabled": isPlaybackEnabled || undefined, "data-agent-playback-cursor": isPlaybackEnabled ? clampedPlaybackCursor : undefined, "data-agent-live-message-count": messages.length, "data-agent-rendered-message-count":
|
|
1675
|
+
const conversationAreaJsx = (_jsxs("div", { ref: conversationRef, "data-agent-playback-enabled": isPlaybackEnabled || undefined, "data-agent-playback-cursor": isPlaybackEnabled ? clampedPlaybackCursor : undefined, "data-agent-live-message-count": messages.length, "data-agent-rendered-message-count": renderedMessages.length, className: cn('flex flex-col min-h-0 min-w-0 border-0', conversationTab
|
|
1542
1676
|
? 'flex-1 h-full'
|
|
1543
1677
|
: isRightPanelVisible
|
|
1544
1678
|
? 'w-full flex-1 min-h-[50vh]'
|
|
1545
1679
|
: fullWidth
|
|
1546
1680
|
? 'flex-1 w-full'
|
|
1547
|
-
: `flex-1 mx-auto ${!isModal ? 'max-w-4xl' : ''}`), children: [!hideHeader && headerVariant === 'compact' && (_jsx("div", { className: "flex flex-shrink-0 justify-end border-b border-border/60 px-2 py-1 lg:hidden", children: renderConversationHeader('compact') })), !hideHeader && headerVariant !== 'compact' && (_jsx("div", { className: "flex-shrink-0", children: renderConversationHeader(headerVariant) })), isPlaybackEnabled && (_jsx("div", { className: "flex flex-shrink-0 justify-end px-2 py-1.5", children: _jsx(AgentChatPlaybackControls, { cursor: clampedPlaybackCursor, messages: playbackSourceMessages, onChangeCursor: handleChangePlaybackCursor }) })), messages.length === 0 && !effectiveIsCompleted && pendingStartMessage && pendingStartTimestamp ? (_jsx(PendingStartConversation, { message: pendingStartMessage, startedAt: pendingStartTimestamp })) : (_jsx(AllMessagesMixed, { messages:
|
|
1681
|
+
: `flex-1 mx-auto ${!isModal ? 'max-w-4xl' : ''}`), children: [!hideHeader && headerVariant === 'compact' && (_jsx("div", { className: "flex flex-shrink-0 justify-end border-b border-border/60 px-2 py-1 lg:hidden", children: renderConversationHeader('compact') })), !hideHeader && headerVariant !== 'compact' && (_jsx("div", { className: "flex-shrink-0", children: renderConversationHeader(headerVariant) })), isPlaybackEnabled && (_jsx("div", { className: "flex flex-shrink-0 justify-end px-2 py-1.5", children: _jsx(AgentChatPlaybackControls, { cursor: clampedPlaybackCursor, messages: playbackSourceMessages, onChangeCursor: handleChangePlaybackCursor }) })), messages.length === 0 && !effectiveIsCompleted && pendingStartMessage && pendingStartTimestamp ? (_jsx(PendingStartConversation, { message: pendingStartMessage, startedAt: pendingStartTimestamp })) : (_jsx(AllMessagesMixed, { messages: renderedMessages, workstreamSourceMessages: renderedWorkstreamSourceMessages, bottomRef: bottomRef, isCompleted: displayedIsCompleted, plan: getActivePlan.plan, workstreamStatus: getActivePlan.workstreamStatus, showPlanPanel: showRightPanelProp && showSlidingPanel, onTogglePlanPanel: handleTogglePlanPanel, plans: plans, activePlanIndex: activePlanIndex, onChangePlan: handleChangePlan, taskLabels: taskLabels, streamingMessages: displayedStreamingMessages, onSendMessage: isPlaybackLive ? handleSendMessage : undefined, onOpenArtifact: showArtifacts ? handleOpenArtifact : undefined, messageItemClassNames: messageItemClassNames, messageStyleOverrides: messageStyleOverrides, toolCallGroupClassNames: toolCallGroupClassNames, hideToolCallsInViewMode: hideToolCallsInViewMode, streamingMessageClassNames: streamingMessageClassNames, batchProgressPanelClassNames: batchProgressPanelClassNames, artifactRunId: agentRunId, viewMode: viewMode, hideWorkstreamTabs: hideWorkstreamTabs, workingIndicatorClassName: workingIndicatorClassName, messageListClassName: messageListClassName, StoreLinkComponent: effectiveStoreLinkComponent, CollectionLinkComponent: CollectionLinkComponent, prependFriendlyMessage: prependFriendlyMessage, initialRequestData: initialRequestData, initialRequestSchema: initialRequestSchema, initialRequestTitle: initialRequestTitle, initialRequestTemplate: initialRequestTemplate, showInitialRequest: initialHistoryStatus === 'empty' && messages.length === 0, hiddenMessageTypes: hiddenMessageTypes, disableAutoScroll: !isPlaybackLive, renderRequestInputControls: !shouldShowRequestInputOverlay, activeWorkstream: activeWorkstream, onActiveWorkstreamChange: setActiveWorkstream })), shouldShowRequestInputOverlay ? (_jsx(AgentRequestInputOverlay, { message: pendingRequestInputMessage, onSendMessage: isPlaybackLive ? handleSendMessage : undefined, onMcpConnected: isPlaybackLive ? handleMcpConnected : undefined, disabled: isUploading || !isPlaybackLive, isLoading: isSending || isUploading })) : isViewingPlaybackHistory && playbackActiveWorkstreams.length > 0 ? (_jsx("div", { className: "flex-shrink-0 pb-safe-area", children: _jsx(ActiveWorkstreamsSummary, { activeWorkstreams: playbackActiveWorkstreams, onSelectWorkstream: setActiveWorkstream }) })) : (shouldRenderLiveMessageInputArea && (_jsx("div", { className: "flex-shrink-0 pb-safe-area", children: isFailed ? (
|
|
1548
1682
|
// FAILED takes priority over every other branch so the composer can
|
|
1549
1683
|
// never render for a failed run. Use the caller's action when provided,
|
|
1550
1684
|
// otherwise fall back to the default failed message box.
|
|
1551
1685
|
(failedAction ?? (_jsx(MessageBox, { status: "error", icon: null, className: "m-2", children: "This Workflow is FAILED" })))) : effectiveWorkflowStatus &&
|
|
1552
1686
|
effectiveWorkflowStatus !== 'RUNNING' &&
|
|
1553
|
-
!canContinueConversation ? (viewMode === 'sliding' && effectiveWorkflowStatus === 'COMPLETED' ? (_jsx("div", { className: "mx-auto w-full max-w-3xl px-4 py-3 text-sm text-muted", children: _jsxs("div", { className: "flex items-center gap-2 border-t border-success/25 pt-3 text-success", children: [_jsx(CheckCircle, { className: "size-4" }), _jsx("span", { className: "font-medium", children: "Workflow completed" })] }) })) : (_jsxs(MessageBox, { status: effectiveWorkflowStatus === 'COMPLETED' ? 'success' : 'done', icon: null, className: "m-2", children: ["This Workflow is ", effectiveWorkflowStatus] }))) : ((showInput || canContinueConversation) && (_jsx(MessageInput, { onSend: handleSendMessage, onStop: allowWorkflowControl ? handleStopWorkflow : undefined, approvalModeSlot: interactive && toolApprovalMode ? (_jsx(AgentApprovalModeSelector, { mode: toolApprovalMode, onChange: handleToolApprovalModeChange, disabled: !isPlaybackLive || isWorkflowTerminal || !allowWorkflowControl })) : undefined, mcpSlot: _jsx(McpConnectionsActionMenu, { disabledCollections: mcpDisabled, onChange: handleMcpDisabledChange, onConnectionChange: handleMcpConnectionChange }), disabled: isUploading || !isPlaybackLive, isSending: isSending || isUploading, isStopping: isStopping, isStreaming: !effectiveIsCompleted, isCompleted: effectiveIsCompleted, contextWindowUsage: canCompactContext ? contextWindowUsage : undefined, onCompactContext: canCompactContext ? handleCompactContext : undefined, isCompactingContext: isCompactingContext, activeTaskCount: activeTaskCount, activeWorkstreams: composerActiveWorkstreams, placeholder: composerPlaceholder, onFilesSelected: canUploadFiles ? handleFileUpload : undefined, uploadedFiles: uploadedFiles, onRemoveFile: onRemoveFile, onRemoveProcessingFile: handleRemoveProcessingFile, acceptedFileTypes: acceptedFileTypes, maxFiles: maxFiles, processingFiles: processingFiles, artifactRunId: agentRunId, hasProcessingFiles: hasProcessingFiles, renderDocumentSearch: renderDocumentSearch, selectedDocuments: selectedDocuments, onRemoveDocument: onRemoveDocument, hideObjectLinking: hideObjectLinking, hideFileUpload: !canUploadFiles, disableDropZone: canUploadFiles, className: inputContainerClassName, inputClassName: inputClassName }))) })))] }));
|
|
1687
|
+
!canContinueConversation ? (viewMode === 'sliding' && effectiveWorkflowStatus === 'COMPLETED' ? (_jsx("div", { className: "mx-auto w-full max-w-3xl px-4 py-3 text-sm text-muted", children: _jsxs("div", { className: "flex items-center gap-2 border-t border-success/25 pt-3 text-success", children: [_jsx(CheckCircle, { className: "size-4" }), _jsx("span", { className: "font-medium", children: "Workflow completed" })] }) })) : (_jsxs(MessageBox, { status: effectiveWorkflowStatus === 'COMPLETED' ? 'success' : 'done', icon: null, className: "m-2", children: ["This Workflow is ", effectiveWorkflowStatus] }))) : ((showInput || canContinueConversation) && (_jsxs(_Fragment, { children: [composerContext, _jsx(MessageInput, { onSend: handleSendMessage, onStop: allowWorkflowControl ? handleStopWorkflow : undefined, approvalModeSlot: interactive && toolApprovalMode ? (_jsx(AgentApprovalModeSelector, { mode: toolApprovalMode, onChange: handleToolApprovalModeChange, disabled: !isPlaybackLive || isWorkflowTerminal || !allowWorkflowControl })) : undefined, mcpSlot: _jsx(McpConnectionsActionMenu, { disabledCollections: mcpDisabled, onChange: handleMcpDisabledChange, onConnectionChange: handleMcpConnectionChange }), disabled: isUploading || !isPlaybackLive, isSending: isSending || isUploading, isStopping: isStopping, isStreaming: !effectiveIsCompleted, isCompleted: effectiveIsCompleted, contextWindowUsage: canCompactContext ? contextWindowUsage : undefined, onCompactContext: canCompactContext ? handleCompactContext : undefined, isCompactingContext: isCompactingContext, activeTaskCount: activeTaskCount, activeWorkstreams: composerActiveWorkstreams, onSelectWorkstream: setActiveWorkstream, placeholder: composerPlaceholder, onFilesSelected: canUploadFiles ? handleFileUpload : undefined, uploadedFiles: uploadedFiles, onRemoveFile: onRemoveFile, onRemoveProcessingFile: handleRemoveProcessingFile, acceptedFileTypes: acceptedFileTypes, maxFiles: maxFiles, processingFiles: processingFiles, artifactRunId: agentRunId, hasProcessingFiles: hasProcessingFiles, renderDocumentSearch: renderDocumentSearch, selectedDocuments: selectedDocuments, onRemoveDocument: onRemoveDocument, hideObjectLinking: hideObjectLinking, hideFileUpload: !canUploadFiles, disableDropZone: canUploadFiles, className: inputContainerClassName, inputClassName: inputClassName })] }))) })))] }));
|
|
1554
1688
|
// Main content - wrapped with FusionFragmentProvider when fusionData is provided
|
|
1555
1689
|
const mainContent = (_jsx(ArtifactUrlCacheProvider, { children: _jsx(ImageLightboxProvider, { children: _jsxs("div", { ref: conversationLayoutRef, className: cn('flex flex-col lg:flex-row gap-2 w-full h-full relative overflow-hidden', canUploadFiles && isDragOver && 'ring-2 ring-blue-400 ring-inset', className), onDragEnter: canUploadFiles ? handleDragEnter : undefined, onDragOver: canUploadFiles ? handleDragOver : undefined, onDragLeave: canUploadFiles ? handleDragLeave : undefined, onDrop: canUploadFiles ? handleDrop : undefined, children: [canUploadFiles && isDragOver && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-blue-100/80 dark:bg-blue-900/40 z-50 pointer-events-none rounded-lg", children: _jsxs("div", { className: "text-blue-600 dark:text-blue-400 font-medium flex items-center gap-2 text-lg", children: [_jsx(UploadIcon, { className: "size-6" }), "Drop files to upload"] }) })), !conversationTab && conversationAreaJsx, !conversationTab && headerVariant === 'compact' && !hideHeader && (_jsx("div", { className: "hidden h-full w-12 shrink-0 items-start justify-center px-1 pt-2 lg:flex", children: renderConversationHeader('compact') })), isRightPanelVisible && (_jsxs(_Fragment, { children: [!conversationTab && (_jsx("div", { role: "separator", "aria-orientation": "vertical", "aria-label": "Resize right panel", "aria-valuenow": Math.round(rightPanelWidth), "aria-valuemin": 300, "aria-valuetext": `${Math.round(rightPanelWidth)} pixels`, tabIndex: 0, className: "hidden lg:block lg:w-1 lg:shrink-0 cursor-col-resize bg-border/70 hover:bg-border transition-colors", onMouseDown: () => setIsRightPanelResizing(true), onKeyDown: (event) => {
|
|
1556
1690
|
if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight')
|
|
@@ -1584,7 +1718,7 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1584
1718
|
// Uploads
|
|
1585
1719
|
processingFiles: processingFilesProp ?? processingFiles,
|
|
1586
1720
|
// Artifacts
|
|
1587
|
-
showArtifacts: showArtifacts, artifactRefreshKey:
|
|
1721
|
+
showArtifacts: showArtifacts, artifactRefreshKey: selectedArtifactRefresh.key, artifactRefreshDetails: selectedArtifactRefresh.details, selectedArtifactPath: selectedArtifactPath, onSelectedArtifactPathChange: setSelectedArtifactPath, onSendMessage: canCollaborateWithArtifacts ? handleSendMessage : undefined,
|
|
1588
1722
|
// Messages (for workstreams tab context)
|
|
1589
1723
|
messages: messages,
|
|
1590
1724
|
// Payload content
|