@vertesia/ui 1.5.0-dev.20260722.120446Z → 1.5.0-dev.20260725.083715Z
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/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 +19 -1
- package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentConversation.js +125 -27
- package/lib/features/agent/chat/ModernAgentConversation.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 +94 -49
- 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 +9 -5
- 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/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 +22 -24
- 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/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 +24 -9
- 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/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 +86 -15
- 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 +5 -1
- 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/selection/actions/StartWorkflowButton.js +1 -1
- package/lib/features/store/objects/selection/actions/StartWorkflowButton.js.map +1 -1
- package/lib/i18n/locales/ar.json +118 -1
- package/lib/i18n/locales/de.json +118 -1
- package/lib/i18n/locales/en.json +118 -0
- package/lib/i18n/locales/es.json +118 -1
- package/lib/i18n/locales/fr.json +118 -1
- package/lib/i18n/locales/it.json +118 -1
- package/lib/i18n/locales/ja.json +118 -1
- package/lib/i18n/locales/ko.json +118 -1
- package/lib/i18n/locales/pt.json +118 -1
- package/lib/i18n/locales/ru.json +118 -1
- package/lib/i18n/locales/tr.json +118 -1
- package/lib/i18n/locales/zh-TW.json +118 -1
- package/lib/i18n/locales/zh.json +118 -1
- 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/vertesia-ui-core.js +2 -2
- 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/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 +13 -9
- 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/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 +237 -40
- package/src/features/agent/chat/ModernAgentConversation.tsx +247 -75
- 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 +257 -34
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +217 -105
- package/src/features/agent/chat/ModernAgentOutput/AttachmentPreview.tsx +17 -0
- 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/MessageItem.tsx +30 -46
- 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/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 +188 -0
- package/src/features/agent/chat/hooks/useAgentStream.ts +28 -8
- package/src/features/agent/chat/index.ts +11 -0
- package/src/features/store/objects/DocumentSearchResults.tsx +2 -2
- package/src/features/store/objects/components/ContentOverview.tsx +216 -65
- 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/actions/StartWorkflowButton.tsx +2 -2
- package/src/i18n/locales/ar.json +118 -1
- package/src/i18n/locales/de.json +118 -1
- package/src/i18n/locales/en.json +118 -0
- package/src/i18n/locales/es.json +118 -1
- package/src/i18n/locales/fr.json +118 -1
- package/src/i18n/locales/it.json +118 -1
- package/src/i18n/locales/ja.json +118 -1
- package/src/i18n/locales/ko.json +118 -1
- package/src/i18n/locales/pt.json +118 -1
- package/src/i18n/locales/ru.json +118 -1
- package/src/i18n/locales/tr.json +118 -1
- package/src/i18n/locales/zh-TW.json +118 -1
- package/src/i18n/locales/zh.json +118 -1
- 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/widgets/markdown/AgentResourceResolver.test.ts +24 -0
- package/src/widgets/markdown/AgentResourceResolver.tsx +70 -0
- package/src/widgets/markdown/ArtifactEditingSurface.test.tsx +537 -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/xml-viewer/hooks/useXMLViewer.test.ts +26 -0
- package/src/widgets/xml-viewer/hooks/useXMLViewer.ts +23 -18
|
@@ -4,6 +4,7 @@ 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 { AgentResourceResolverProvider, isArtifactRefreshEvent, } from '@vertesia/ui/widgets';
|
|
7
8
|
import { ArrowUpIcon, Bot, CheckCircle, 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';
|
|
@@ -23,7 +24,7 @@ import AllMessagesMixed from './ModernAgentOutput/AllMessagesMixed';
|
|
|
23
24
|
import Header from './ModernAgentOutput/Header';
|
|
24
25
|
import MessageInput from './ModernAgentOutput/MessageInput';
|
|
25
26
|
import { getPendingRequestInputMessage } from './ModernAgentOutput/requestInputMessages';
|
|
26
|
-
import { debugAgentChat, filterMessagesForActiveWorkstream, getConversationUrl, getWorkstreamId, isInProgress, } from './ModernAgentOutput/utils';
|
|
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';
|
|
@@ -351,9 +352,10 @@ function downloadJsonFile(filename, payload) {
|
|
|
351
352
|
URL.revokeObjectURL(url);
|
|
352
353
|
}
|
|
353
354
|
export function ModernAgentConversation(props) {
|
|
354
|
-
const { agentRunId, startWorkflow } = props;
|
|
355
|
+
const { agentRunId, startWorkflow, resourceResolver } = props;
|
|
355
356
|
if (agentRunId) {
|
|
356
|
-
|
|
357
|
+
const conversation = (_jsx(SkillWidgetProvider, { children: _jsx(ModernAgentConversationInner, { ...props, agentRunId: agentRunId }) }));
|
|
358
|
+
return resourceResolver ? (_jsx(AgentResourceResolverProvider, { value: resourceResolver, children: conversation })) : (conversation);
|
|
357
359
|
}
|
|
358
360
|
else if (startWorkflow) {
|
|
359
361
|
// If we have startWorkflow capability but no agentRunId yet
|
|
@@ -375,8 +377,10 @@ function StartWorkflowView({ initialMessage, interactive = true, startWorkflow,
|
|
|
375
377
|
// Attachment callback - used to include existing document attachments in the first message
|
|
376
378
|
getAttachedDocs, onAttachmentsSent,
|
|
377
379
|
// File upload props
|
|
378
|
-
acceptedFileTypes, maxFiles = 5, hideHeader = false, hideFileUpload = false, hideObjectLinking, headerVariant, inputContainerClassName, inputClassName, className, allowWorkflowControl, initialToolApprovalMode, }) {
|
|
380
|
+
acceptedFileTypes, maxFiles = 5, hideHeader = false, hideFileUpload = false, hideObjectLinking, headerVariant, startViewVariant = 'default', inputContainerClassName, inputClassName, className, allowWorkflowControl, initialToolApprovalMode, onAgentWorkingChange, }) {
|
|
379
381
|
const { t } = useUITranslation();
|
|
382
|
+
const isCompactStartView = startViewVariant !== 'default';
|
|
383
|
+
const isExpandedStartComposer = startViewVariant === 'expanded-composer';
|
|
380
384
|
const canStageFiles = !hideFileUpload;
|
|
381
385
|
const resolvedPlaceholder = placeholder ?? t('agent.typeYourMessage');
|
|
382
386
|
const resolvedStartButtonText = startButtonText ?? t('agent.startAgent');
|
|
@@ -393,6 +397,9 @@ acceptedFileTypes, maxFiles = 5, hideHeader = false, hideFileUpload = false, hid
|
|
|
393
397
|
const fileInputRef = useRef(null);
|
|
394
398
|
// Staged files - stored locally until workflow starts
|
|
395
399
|
const [stagedFiles, setStagedFiles] = useState([]);
|
|
400
|
+
useEffect(() => {
|
|
401
|
+
onAgentWorkingChange?.(isSending);
|
|
402
|
+
}, [isSending, onAgentWorkingChange]);
|
|
396
403
|
// Drag and drop state
|
|
397
404
|
const [isDragOver, setIsDragOver] = useState(false);
|
|
398
405
|
const dragCounterRef = useRef(0);
|
|
@@ -596,10 +603,14 @@ acceptedFileTypes, maxFiles = 5, hideHeader = false, hideFileUpload = false, hid
|
|
|
596
603
|
const adjustTextareaHeight = useCallback(() => {
|
|
597
604
|
const textarea = inputRef.current;
|
|
598
605
|
if (textarea) {
|
|
606
|
+
if (isExpandedStartComposer) {
|
|
607
|
+
textarea.style.height = '100%';
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
599
610
|
textarea.style.height = 'auto';
|
|
600
611
|
textarea.style.height = `${Math.min(textarea.scrollHeight, 200)}px`;
|
|
601
612
|
}
|
|
602
|
-
}, []);
|
|
613
|
+
}, [isExpandedStartComposer]);
|
|
603
614
|
useEffect(() => {
|
|
604
615
|
void inputValue;
|
|
605
616
|
adjustTextareaHeight();
|
|
@@ -618,9 +629,12 @@ acceptedFileTypes, maxFiles = 5, hideHeader = false, hideFileUpload = false, hid
|
|
|
618
629
|
inputContainerClassName,
|
|
619
630
|
inputClassName,
|
|
620
631
|
className,
|
|
621
|
-
allowWorkflowControl,
|
|
632
|
+
allowWorkflowControl,
|
|
633
|
+
onAgentWorkingChange, agentRunId: startedAgentRunId, title: title, pendingStartMessage: pendingStartMessage ?? undefined, pendingStartTimestamp: pendingStartTimestamp ?? undefined, initialToolApprovalMode: toolApprovalMode }));
|
|
622
634
|
}
|
|
623
|
-
return (_jsx("div", { className: cn('flex
|
|
635
|
+
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 && (_jsx("div", { className: "flex flex-wrap gap-2", children: stagedFiles.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}`))) })), _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
|
|
636
|
+
? { minHeight: '72px', maxHeight: 'none' }
|
|
637
|
+
: { 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
638
|
}
|
|
625
639
|
// Inner component that handles the agent conversation - similar to ModernAgentOutput
|
|
626
640
|
function ModernAgentConversationInner({ agentRunId, title, interactive = true, onClose, isModal = false, fullWidth = false, placeholder, resetWorkflow, onRestart, onClone, onShowDetails, allowWorkflowControl = true,
|
|
@@ -639,11 +653,11 @@ isUploading = false,
|
|
|
639
653
|
// Context callback
|
|
640
654
|
getMessageContext,
|
|
641
655
|
// Styling props
|
|
642
|
-
className, inputContainerClassName, inputClassName,
|
|
656
|
+
className, inputContainerClassName, inputClassName, composerContext,
|
|
643
657
|
// Fusion fragment data
|
|
644
658
|
fusionData,
|
|
645
659
|
// External file upload API
|
|
646
|
-
fileUploadRef, onProcessingFilesChange, processingFiles: processingFilesProp,
|
|
660
|
+
fileUploadRef, sendMessageRef, onMessage, onAgentWorkingChange, onProcessingFilesChange, processingFiles: processingFilesProp,
|
|
647
661
|
// External plan panel API
|
|
648
662
|
onPlansChange, onWorkstreamStatusChange,
|
|
649
663
|
// External view mode control
|
|
@@ -666,7 +680,7 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
666
680
|
// ────────────────────────────────────────────
|
|
667
681
|
// Extracted hooks
|
|
668
682
|
// ────────────────────────────────────────────
|
|
669
|
-
const { messages, streamingMessages, isCompleted, initialHistoryStatus, debugChunkFlash, addOptimisticMessage, updateOptimisticMessageStatus, reconnect: reconnectStream, agentRunStatus, workflowRunId, serverFileUpdates, } = useAgentStream(client, agentRunId);
|
|
683
|
+
const { messages, streamingMessages, isCompleted, initialHistoryStatus, debugChunkFlash, addOptimisticMessage, updateOptimisticMessageStatus, reconnect: reconnectStream, agentRunStatus, workflowRunId, serverFileUpdates, } = useAgentStream(client, agentRunId, onMessage);
|
|
670
684
|
const { plans, activePlanIndex, setActivePlanIndex, workstreamStatusMap, showInput, showSlidingPanel, setShowSlidingPanel, } = useAgentPlans(messages, interactive, isModal);
|
|
671
685
|
const { openDocuments, activeDocumentId, isDocPanelOpen, docRefreshKey, closeDocPanel: handleCloseDocPanel, closeDocument: handleCloseDocument, selectDocument, openDocInPanel, updateDocumentTitle, } = useDocumentPanel(messages);
|
|
672
686
|
const { processingFiles, hasProcessingFiles, handleFileUpload, removeProcessingFile, clearProcessingFiles } = useFileProcessing(client, agentRunId, serverFileUpdates, toast);
|
|
@@ -812,9 +826,8 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
812
826
|
const canShowPlaybackToggle = showPlaybackToggle && enablePlayback === undefined && isAgentChatPlaybackAvailable();
|
|
813
827
|
const isPlaybackEnabled = enablePlayback ?? (isAgentChatPlaybackEnabled() || isPlaybackToggleEnabled);
|
|
814
828
|
const playbackSourceMessages = useMemo(() => {
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
: messages;
|
|
829
|
+
// Passive artifact autosaves are surfaced by the editor's own save indicator, not the chat.
|
|
830
|
+
const visibleMessages = messages.filter((message) => !isPassiveArtifactUpdate(message) && !(hiddenMessageTypes?.includes(message.type) ?? false));
|
|
818
831
|
return filterMessagesForActiveWorkstream(visibleMessages, activeWorkstream);
|
|
819
832
|
}, [activeWorkstream, hiddenMessageTypes, messages]);
|
|
820
833
|
const playbackState = useMemo(() => createPlaybackState(playbackSourceMessages, playbackCursor, isPlaybackEnabled), [isPlaybackEnabled, playbackCursor, playbackSourceMessages]);
|
|
@@ -827,8 +840,15 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
827
840
|
const playbackActiveWorkstreams = useMemo(() => playbackDerivedWorkstreams.filter((ws) => isActiveWorkstreamStatus(ws.status)), [playbackDerivedWorkstreams]);
|
|
828
841
|
const effectiveIsCompleted = useMemo(() => isCompleted || !isInProgress(messages), [isCompleted, messages]);
|
|
829
842
|
const displayedIsCompleted = isPlaybackLive || isPlaybackAtLatest ? effectiveIsCompleted : false;
|
|
843
|
+
const isAgentWorking = !effectiveIsCompleted && !isWorkflowTerminal;
|
|
844
|
+
useEffect(() => {
|
|
845
|
+
onAgentWorkingChange?.(isAgentWorking);
|
|
846
|
+
}, [isAgentWorking, onAgentWorkingChange]);
|
|
830
847
|
const pendingRequestInputMessage = useMemo(() => getPendingRequestInputMessage(displayedMessages), [displayedMessages]);
|
|
831
|
-
|
|
848
|
+
// A terminal run silently drops user input unless it can be continued (see the guard in
|
|
849
|
+
// handleSendMessage), so never surface an actionable question overlay in that state —
|
|
850
|
+
// the terminal status box renders instead.
|
|
851
|
+
const shouldShowRequestInputOverlay = Boolean(pendingRequestInputMessage) && !isFailed && (!isWorkflowTerminal || canContinueConversation);
|
|
832
852
|
const isViewingPlaybackHistory = isPlaybackEnabled && !isPlaybackLive;
|
|
833
853
|
const shouldRenderLiveMessageInputArea = shouldRenderMessageInputArea && !isViewingPlaybackHistory;
|
|
834
854
|
const contextWindowUsage = useMemo(() => toContextWindowUsage(messages), [messages]);
|
|
@@ -915,26 +935,44 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
915
935
|
// ────────────────────────────────────────────
|
|
916
936
|
// Stable callbacks
|
|
917
937
|
// ────────────────────────────────────────────
|
|
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
938
|
const handleChangePlan = useCallback((index) => {
|
|
927
939
|
setActivePlanIndex(index);
|
|
928
940
|
}, [setActivePlanIndex]);
|
|
929
941
|
const [rightPanelTab, setRightPanelTab] = useState(conversationContent || conversationTab ? 'conversation' : 'plan');
|
|
942
|
+
const [selectedArtifactPath, setSelectedArtifactPath] = useState(null);
|
|
930
943
|
const [rightPanelWidth, setRightPanelWidth] = useState(400);
|
|
931
944
|
const [isRightPanelResizing, setIsRightPanelResizing] = useState(false);
|
|
945
|
+
// Master override for the "Toggle right sidebar" control. `showSlidingPanel` only tracks the
|
|
946
|
+
// plan; open documents/workstreams keep the panel visible on their own, so without this the
|
|
947
|
+
// toggle can't hide the panel while a document is open. Explicit reveals (opening an artifact
|
|
948
|
+
// or document) clear it again.
|
|
949
|
+
const [rightPanelManuallyClosed, setRightPanelManuallyClosed] = useState(false);
|
|
932
950
|
const isRightPanelVisible = showRightPanelProp &&
|
|
951
|
+
!rightPanelManuallyClosed &&
|
|
933
952
|
(showSlidingPanel ||
|
|
934
953
|
isDocPanelOpen ||
|
|
935
954
|
(!hideWorkstreamTabs && panelWorkstreams.length > 0) ||
|
|
936
955
|
!!conversationContent ||
|
|
937
956
|
conversationTab);
|
|
957
|
+
// A newly opened document should reveal the panel even if the user had manually collapsed it.
|
|
958
|
+
const previousDocPanelOpenRef = useRef(isDocPanelOpen);
|
|
959
|
+
useEffect(() => {
|
|
960
|
+
if (isDocPanelOpen && !previousDocPanelOpenRef.current) {
|
|
961
|
+
setRightPanelManuallyClosed(false);
|
|
962
|
+
}
|
|
963
|
+
previousDocPanelOpenRef.current = isDocPanelOpen;
|
|
964
|
+
}, [isDocPanelOpen]);
|
|
965
|
+
const handleTogglePlanPanel = useCallback(() => {
|
|
966
|
+
if (isRightPanelVisible) {
|
|
967
|
+
setRightPanelManuallyClosed(true);
|
|
968
|
+
setShowSlidingPanel(false);
|
|
969
|
+
}
|
|
970
|
+
else {
|
|
971
|
+
setRightPanelManuallyClosed(false);
|
|
972
|
+
setShowSlidingPanel(true);
|
|
973
|
+
sessionStorage.setItem('plan-panel-shown', 'true');
|
|
974
|
+
}
|
|
975
|
+
}, [isRightPanelVisible, setShowSlidingPanel]);
|
|
938
976
|
useEffect(() => {
|
|
939
977
|
if (!isRightPanelVisible && isRightPanelResizing) {
|
|
940
978
|
setIsRightPanelResizing(false);
|
|
@@ -970,9 +1008,40 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
970
1008
|
};
|
|
971
1009
|
}, [isRightPanelResizing]);
|
|
972
1010
|
const handleCloseRightPanel = useCallback(() => {
|
|
1011
|
+
setRightPanelManuallyClosed(true);
|
|
973
1012
|
setShowSlidingPanel(false);
|
|
974
1013
|
handleCloseDocPanel();
|
|
975
1014
|
}, [setShowSlidingPanel, handleCloseDocPanel]);
|
|
1015
|
+
const handleOpenArtifact = useCallback((path) => {
|
|
1016
|
+
if (!/\.md$/i.test(path))
|
|
1017
|
+
return;
|
|
1018
|
+
setRightPanelManuallyClosed(false);
|
|
1019
|
+
setSelectedArtifactPath(path);
|
|
1020
|
+
setRightPanelTab('artifacts');
|
|
1021
|
+
setShowSlidingPanel(true);
|
|
1022
|
+
}, [setShowSlidingPanel]);
|
|
1023
|
+
// The `display_artifact` tool emits a `display_artifact` stream event asking the UI
|
|
1024
|
+
// to reveal a text artifact in the editor. Act on the latest such event, once per
|
|
1025
|
+
// distinct occurrence so the user can still close the panel without it snapping back.
|
|
1026
|
+
const displayedArtifactMarkerRef = useRef(null);
|
|
1027
|
+
useEffect(() => {
|
|
1028
|
+
let target;
|
|
1029
|
+
let marker;
|
|
1030
|
+
for (const message of messages) {
|
|
1031
|
+
const details = message.details;
|
|
1032
|
+
if (details?.event_class === 'display_artifact' && typeof details.path === 'string') {
|
|
1033
|
+
target = details.path;
|
|
1034
|
+
marker = `${message.timestamp ?? ''}:${details.path}`;
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
if (!target || !marker || marker === displayedArtifactMarkerRef.current)
|
|
1038
|
+
return;
|
|
1039
|
+
displayedArtifactMarkerRef.current = marker;
|
|
1040
|
+
setRightPanelManuallyClosed(false);
|
|
1041
|
+
setSelectedArtifactPath(target);
|
|
1042
|
+
setRightPanelTab('artifacts');
|
|
1043
|
+
setShowSlidingPanel(true);
|
|
1044
|
+
}, [messages, setShowSlidingPanel]);
|
|
976
1045
|
// Default StoreLinkComponent that opens documents in the panel
|
|
977
1046
|
const internalStoreLinkComponent = useCallback(({ href, documentId, children }) => (_jsx("a", { href: href, className: "text-info underline cursor-pointer hover:text-info/80", onClick: (e) => {
|
|
978
1047
|
e.preventDefault();
|
|
@@ -1007,6 +1076,7 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1007
1076
|
}, [workstreamStatusMap, onWorkstreamStatusChange]);
|
|
1008
1077
|
useEffect(() => {
|
|
1009
1078
|
void agentRunId;
|
|
1079
|
+
setSelectedArtifactPath(null);
|
|
1010
1080
|
workstreamFetchFailedRef.current = false;
|
|
1011
1081
|
setIsWorkstreamQueryUnavailable(false);
|
|
1012
1082
|
setQueriedActiveWorkstreams([]);
|
|
@@ -1171,7 +1241,12 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1171
1241
|
type: AgentMessageType.QUESTION,
|
|
1172
1242
|
message: messageContent,
|
|
1173
1243
|
workstream_id: 'main',
|
|
1174
|
-
details: {
|
|
1244
|
+
details: {
|
|
1245
|
+
_optimistic: true,
|
|
1246
|
+
_messageId: messageId,
|
|
1247
|
+
_deliveryStatus: 'sending',
|
|
1248
|
+
...(inputMetadata?.editing_action ? { editing_action: inputMetadata.editing_action } : {}),
|
|
1249
|
+
},
|
|
1175
1250
|
};
|
|
1176
1251
|
addOptimisticMessage(optimisticMessage);
|
|
1177
1252
|
const metadata = {
|
|
@@ -1232,6 +1307,14 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1232
1307
|
t,
|
|
1233
1308
|
waitForPendingToolApprovalModeChange,
|
|
1234
1309
|
]);
|
|
1310
|
+
useEffect(() => {
|
|
1311
|
+
if (sendMessageRef)
|
|
1312
|
+
sendMessageRef.current = handleSendMessage;
|
|
1313
|
+
return () => {
|
|
1314
|
+
if (sendMessageRef?.current === handleSendMessage)
|
|
1315
|
+
sendMessageRef.current = null;
|
|
1316
|
+
};
|
|
1317
|
+
}, [handleSendMessage, sendMessageRef]);
|
|
1235
1318
|
// After the user connects an MCP server requested via request_mcp_connection, flag the
|
|
1236
1319
|
// conversation for tool re-discovery and resume it with a confirmation message so the agent
|
|
1237
1320
|
// continues automatically with the newly-available tools.
|
|
@@ -1530,13 +1613,28 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1530
1613
|
return false;
|
|
1531
1614
|
}).length;
|
|
1532
1615
|
}, [messages]);
|
|
1616
|
+
const selectedArtifactRefresh = useMemo(() => {
|
|
1617
|
+
if (!selectedArtifactPath)
|
|
1618
|
+
return { key: artifactRefreshKey, details: undefined };
|
|
1619
|
+
let key = 0;
|
|
1620
|
+
let details;
|
|
1621
|
+
for (const message of messages) {
|
|
1622
|
+
const candidate = message.details;
|
|
1623
|
+
if (!isArtifactRefreshEvent(candidate, selectedArtifactPath))
|
|
1624
|
+
continue;
|
|
1625
|
+
key++;
|
|
1626
|
+
details = candidate;
|
|
1627
|
+
}
|
|
1628
|
+
return { key, details };
|
|
1629
|
+
}, [artifactRefreshKey, messages, selectedArtifactPath]);
|
|
1630
|
+
const canCollaborateWithArtifacts = interactive && isPlaybackLive && effectiveWorkflowStatus?.toUpperCase() === 'RUNNING';
|
|
1533
1631
|
// PERFORMANCE: Memoize taskLabels to prevent AllMessagesMixed re-renders
|
|
1534
1632
|
const taskLabels = useMemo(() => getActivePlan.plan.plan?.reduce((acc, task) => {
|
|
1535
1633
|
if (task.id && task.goal)
|
|
1536
1634
|
acc.set(task.id.toString(), task.goal);
|
|
1537
1635
|
return acc;
|
|
1538
1636
|
}, 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:
|
|
1637
|
+
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
1638
|
// Conversation area inner content — shared between main layout and conversationTab mode
|
|
1541
1639
|
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": displayedMessages.length, className: cn('flex flex-col min-h-0 min-w-0 border-0', conversationTab
|
|
1542
1640
|
? 'flex-1 h-full'
|
|
@@ -1544,13 +1642,13 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1544
1642
|
? 'w-full flex-1 min-h-[50vh]'
|
|
1545
1643
|
: fullWidth
|
|
1546
1644
|
? '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: displayedMessages, workstreamSourceMessages: messages, 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, 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 }) })) : (shouldRenderLiveMessageInputArea && (_jsx("div", { className: "flex-shrink-0 pb-safe-area", children: isFailed ? (
|
|
1645
|
+
: `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: displayedMessages, workstreamSourceMessages: messages, 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 }) })) : (shouldRenderLiveMessageInputArea && (_jsx("div", { className: "flex-shrink-0 pb-safe-area", children: isFailed ? (
|
|
1548
1646
|
// FAILED takes priority over every other branch so the composer can
|
|
1549
1647
|
// never render for a failed run. Use the caller's action when provided,
|
|
1550
1648
|
// otherwise fall back to the default failed message box.
|
|
1551
1649
|
(failedAction ?? (_jsx(MessageBox, { status: "error", icon: null, className: "m-2", children: "This Workflow is FAILED" })))) : effectiveWorkflowStatus &&
|
|
1552
1650
|
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 }))) })))] }));
|
|
1651
|
+
!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, 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
1652
|
// Main content - wrapped with FusionFragmentProvider when fusionData is provided
|
|
1555
1653
|
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
1654
|
if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight')
|
|
@@ -1584,7 +1682,7 @@ workingIndicatorClassName, messageListClassName, StoreLinkComponent, CollectionL
|
|
|
1584
1682
|
// Uploads
|
|
1585
1683
|
processingFiles: processingFilesProp ?? processingFiles,
|
|
1586
1684
|
// Artifacts
|
|
1587
|
-
showArtifacts: showArtifacts, artifactRefreshKey:
|
|
1685
|
+
showArtifacts: showArtifacts, artifactRefreshKey: selectedArtifactRefresh.key, artifactRefreshDetails: selectedArtifactRefresh.details, selectedArtifactPath: selectedArtifactPath, onSelectedArtifactPathChange: setSelectedArtifactPath, onSendMessage: canCollaborateWithArtifacts ? handleSendMessage : undefined,
|
|
1588
1686
|
// Messages (for workstreams tab context)
|
|
1589
1687
|
messages: messages,
|
|
1590
1688
|
// Payload content
|