@vertesia/ui 1.5.0-dev.20260717.131047Z → 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/SidePanel.js +1 -1
- package/lib/core/components/SidePanel.js.map +1 -1
- package/lib/core/components/shadcn/button.d.ts +10 -3
- package/lib/core/components/shadcn/button.d.ts.map +1 -1
- package/lib/core/components/shadcn/button.js +41 -9
- package/lib/core/components/shadcn/button.js.map +1 -1
- 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 +3 -1
- 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/components/shadcn/theme/ThemeSwitcher.js +1 -1
- package/lib/core/components/shadcn/theme/ThemeSwitcher.js.map +1 -1
- package/lib/features/agent/chat/AgentChatPlaybackControls.d.ts.map +1 -1
- package/lib/features/agent/chat/AgentChatPlaybackControls.js +2 -2
- package/lib/features/agent/chat/AgentChatPlaybackControls.js.map +1 -1
- package/lib/features/agent/chat/AgentRequestInputOverlay.d.ts.map +1 -1
- package/lib/features/agent/chat/AgentRequestInputOverlay.js +2 -2
- 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 +53 -13
- 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/ImageLightbox.d.ts.map +1 -1
- package/lib/features/agent/chat/ImageLightbox.js +1 -1
- package/lib/features/agent/chat/ImageLightbox.js.map +1 -1
- 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 +96 -51
- 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/Header.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/Header.js +4 -2
- package/lib/features/agent/chat/ModernAgentOutput/Header.js.map +1 -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 -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/requestInputMessages.d.ts +6 -0
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js +15 -1
- 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 +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/environment/SelectEnvironment.d.ts +28 -0
- package/lib/features/environment/SelectEnvironment.d.ts.map +1 -0
- package/lib/features/environment/SelectEnvironment.js +97 -0
- package/lib/features/environment/SelectEnvironment.js.map +1 -0
- package/lib/features/environment/index.d.ts +2 -0
- package/lib/features/environment/index.d.ts.map +1 -0
- package/lib/features/environment/index.js +2 -0
- package/lib/features/environment/index.js.map +1 -0
- package/lib/features/index.d.ts +2 -0
- package/lib/features/index.d.ts.map +1 -1
- package/lib/features/index.js +2 -0
- package/lib/features/index.js.map +1 -1
- package/lib/features/magic-pdf/AnnotatedImageSlider.js +12 -12
- package/lib/features/magic-pdf/AnnotatedImageSlider.js.map +1 -1
- package/lib/features/magic-pdf/DownloadPopover.d.ts.map +1 -1
- package/lib/features/magic-pdf/DownloadPopover.js +3 -17
- package/lib/features/magic-pdf/DownloadPopover.js.map +1 -1
- package/lib/features/magic-pdf/ExtractedContentView.js +2 -6
- package/lib/features/magic-pdf/ExtractedContentView.js.map +1 -1
- package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.d.ts +25 -0
- package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.d.ts.map +1 -0
- package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.js +42 -0
- package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.js.map +1 -0
- package/lib/features/magic-pdf/GroundedExtractionView.d.ts +27 -0
- package/lib/features/magic-pdf/GroundedExtractionView.d.ts.map +1 -0
- package/lib/features/magic-pdf/GroundedExtractionView.js +377 -0
- package/lib/features/magic-pdf/GroundedExtractionView.js.map +1 -0
- package/lib/features/magic-pdf/MagicPdfProvider.d.ts +0 -2
- package/lib/features/magic-pdf/MagicPdfProvider.d.ts.map +1 -1
- package/lib/features/magic-pdf/MagicPdfProvider.js +15 -42
- package/lib/features/magic-pdf/MagicPdfProvider.js.map +1 -1
- package/lib/features/magic-pdf/MagicPdfView.d.ts.map +1 -1
- package/lib/features/magic-pdf/MagicPdfView.js +2 -19
- package/lib/features/magic-pdf/MagicPdfView.js.map +1 -1
- package/lib/features/magic-pdf/index.d.ts +1 -0
- package/lib/features/magic-pdf/index.d.ts.map +1 -1
- package/lib/features/magic-pdf/index.js +1 -0
- package/lib/features/magic-pdf/index.js.map +1 -1
- package/lib/features/magic-pdf/types.d.ts +1 -1
- package/lib/features/magic-pdf/types.d.ts.map +1 -1
- package/lib/features/oauth/McpConnectionsButton.d.ts.map +1 -1
- package/lib/features/oauth/McpConnectionsButton.js +2 -2
- package/lib/features/oauth/McpConnectionsButton.js.map +1 -1
- package/lib/features/oauth/McpConnectionsDialog.d.ts.map +1 -1
- package/lib/features/oauth/McpConnectionsDialog.js +1 -1
- package/lib/features/oauth/McpConnectionsDialog.js.map +1 -1
- package/lib/features/oauth/RemoteMcpConnectionButton.d.ts.map +1 -1
- package/lib/features/oauth/RemoteMcpConnectionButton.js +1 -1
- package/lib/features/oauth/RemoteMcpConnectionButton.js.map +1 -1
- package/lib/features/pdf-viewer/PdfPageSlider.js +2 -2
- package/lib/features/pdf-viewer/PdfPageSlider.js.map +1 -1
- package/lib/features/pdf-viewer/SimplePdfViewer.d.ts.map +1 -1
- package/lib/features/pdf-viewer/SimplePdfViewer.js +3 -3
- package/lib/features/pdf-viewer/SimplePdfViewer.js.map +1 -1
- package/lib/features/permissions/UserPermissionsProvider.js +1 -1
- package/lib/features/permissions/UserPermissionsProvider.js.map +1 -1
- package/lib/features/store/objects/DocumentQuickFilter.d.ts.map +1 -1
- package/lib/features/store/objects/DocumentQuickFilter.js +5 -5
- package/lib/features/store/objects/DocumentQuickFilter.js.map +1 -1
- package/lib/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
- package/lib/features/store/objects/DocumentSearchResults.js +4 -4
- package/lib/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/features/store/objects/components/ContentDispositionButton.d.ts.map +1 -1
- package/lib/features/store/objects/components/ContentDispositionButton.js +1 -1
- package/lib/features/store/objects/components/ContentDispositionButton.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 +159 -31
- 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/DocumentIcon.js +1 -1
- 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/VectorSearchWidget.js +1 -1
- package/lib/features/store/objects/components/VectorSearchWidget.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 +6 -3
- package/lib/features/store/objects/components/useContentPanelHooks.d.ts.map +1 -1
- package/lib/features/store/objects/components/useContentPanelHooks.js +57 -37
- 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/layout/renderers.d.ts.map +1 -1
- package/lib/features/store/objects/layout/renderers.js +2 -2
- package/lib/features/store/objects/layout/renderers.js.map +1 -1
- package/lib/features/store/objects/selection/SelectionActions.js +1 -1
- package/lib/features/store/objects/selection/SelectionActions.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/features/store/types/ContentObjectTypesTable.d.ts.map +1 -1
- package/lib/features/store/types/ContentObjectTypesTable.js +4 -4
- package/lib/features/store/types/ContentObjectTypesTable.js.map +1 -1
- package/lib/features/store/types/IntakePolicyEditor.d.ts +15 -0
- package/lib/features/store/types/IntakePolicyEditor.d.ts.map +1 -0
- package/lib/features/store/types/IntakePolicyEditor.js +455 -0
- package/lib/features/store/types/IntakePolicyEditor.js.map +1 -0
- package/lib/features/store/types/IntakePolicyForm.d.ts +11 -0
- package/lib/features/store/types/IntakePolicyForm.d.ts.map +1 -0
- package/lib/features/store/types/IntakePolicyForm.js +91 -0
- package/lib/features/store/types/IntakePolicyForm.js.map +1 -0
- package/lib/features/store/types/SelectContentTypeModal.js +1 -1
- package/lib/features/store/types/SelectContentTypeModal.js.map +1 -1
- package/lib/features/store/types/index.d.ts +2 -0
- package/lib/features/store/types/index.d.ts.map +1 -1
- package/lib/features/store/types/index.js +2 -0
- package/lib/features/store/types/index.js.map +1 -1
- package/lib/features/store/types/intake-policy-editor.logic.d.ts +7 -0
- package/lib/features/store/types/intake-policy-editor.logic.d.ts.map +1 -0
- package/lib/features/store/types/intake-policy-editor.logic.js +60 -0
- package/lib/features/store/types/intake-policy-editor.logic.js.map +1 -0
- package/lib/features/store/types/typeCatalogCache.d.ts +5 -0
- package/lib/features/store/types/typeCatalogCache.d.ts.map +1 -0
- package/lib/features/store/types/typeCatalogCache.js +40 -0
- package/lib/features/store/types/typeCatalogCache.js.map +1 -0
- package/lib/features/user/UserInfo.js +7 -3
- package/lib/features/user/UserInfo.js.map +1 -1
- package/lib/features/views/ViewExperience.d.ts +20 -0
- package/lib/features/views/ViewExperience.d.ts.map +1 -0
- package/lib/features/views/ViewExperience.js +188 -0
- package/lib/features/views/ViewExperience.js.map +1 -0
- package/lib/features/views/ViewNavigation.d.ts +3 -0
- package/lib/features/views/ViewNavigation.d.ts.map +1 -0
- package/lib/features/views/ViewNavigation.js +36 -0
- package/lib/features/views/ViewNavigation.js.map +1 -0
- package/lib/features/views/ViewResults.d.ts +9 -0
- package/lib/features/views/ViewResults.d.ts.map +1 -0
- package/lib/features/views/ViewResults.js +229 -0
- package/lib/features/views/ViewResults.js.map +1 -0
- package/lib/features/views/ViewSearch.d.ts +3 -0
- package/lib/features/views/ViewSearch.d.ts.map +1 -0
- package/lib/features/views/ViewSearch.js +74 -0
- package/lib/features/views/ViewSearch.js.map +1 -0
- package/lib/features/views/index.d.ts +7 -0
- package/lib/features/views/index.d.ts.map +1 -0
- package/lib/features/views/index.js +7 -0
- package/lib/features/views/index.js.map +1 -0
- package/lib/features/views/types.d.ts +39 -0
- package/lib/features/views/types.d.ts.map +1 -0
- package/lib/features/views/types.js +2 -0
- package/lib/features/views/types.js.map +1 -0
- package/lib/features/views/viewState.d.ts +14 -0
- package/lib/features/views/viewState.d.ts.map +1 -0
- package/lib/features/views/viewState.js +117 -0
- package/lib/features/views/viewState.js.map +1 -0
- package/lib/i18n/locales/ar.json +134 -1
- package/lib/i18n/locales/de.json +130 -1
- package/lib/i18n/locales/en.json +363 -33
- package/lib/i18n/locales/es.json +131 -1
- package/lib/i18n/locales/fr.json +131 -1
- package/lib/i18n/locales/it.json +131 -1
- package/lib/i18n/locales/ja.json +129 -1
- package/lib/i18n/locales/ko.json +129 -1
- package/lib/i18n/locales/pt.json +131 -1
- package/lib/i18n/locales/ru.json +132 -1
- package/lib/i18n/locales/tr.json +130 -1
- package/lib/i18n/locales/zh-TW.json +129 -1
- package/lib/i18n/locales/zh.json +129 -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/router/HistoryNavigator.d.ts.map +1 -1
- package/lib/router/HistoryNavigator.js +23 -13
- package/lib/router/HistoryNavigator.js.map +1 -1
- package/lib/router/Nav.d.ts.map +1 -1
- package/lib/router/Nav.js +15 -6
- package/lib/router/Nav.js.map +1 -1
- package/lib/session/UserSession.d.ts.map +1 -1
- package/lib/session/UserSession.js +5 -3
- package/lib/session/UserSession.js.map +1 -1
- package/lib/vertesia-ui-core.js +4 -4
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +40 -28
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-i18n.js +15 -15
- 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-router.js +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-shell.js +1 -1
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +25 -7
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/lib/widgets/form/Form.js +1 -1
- package/lib/widgets/form/Form.js.map +1 -1
- package/lib/widgets/json-view/JSONSwitcher.js +1 -1
- package/lib/widgets/json-view/JSONSwitcher.js.map +1 -1
- package/lib/widgets/json-view/JSONView.js +6 -6
- package/lib/widgets/json-view/JSONView.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.map +1 -1
- package/lib/widgets/monacoEditor/MonacoEditor.js +29 -0
- package/lib/widgets/monacoEditor/MonacoEditor.js.map +1 -1
- package/lib/widgets/schema-editor/ManagedSchema.d.ts +8 -0
- package/lib/widgets/schema-editor/ManagedSchema.d.ts.map +1 -1
- package/lib/widgets/schema-editor/ManagedSchema.js +16 -0
- package/lib/widgets/schema-editor/ManagedSchema.js.map +1 -1
- package/lib/widgets/schema-editor/editor/EditableSchemaProperty.d.ts +2 -0
- package/lib/widgets/schema-editor/editor/EditableSchemaProperty.d.ts.map +1 -1
- package/lib/widgets/schema-editor/editor/EditableSchemaProperty.js +1 -0
- package/lib/widgets/schema-editor/editor/EditableSchemaProperty.js.map +1 -1
- package/lib/widgets/schema-editor/editor/PropertyViewer.d.ts.map +1 -1
- package/lib/widgets/schema-editor/editor/PropertyViewer.js +4 -1
- package/lib/widgets/schema-editor/editor/PropertyViewer.js.map +1 -1
- package/lib/widgets/schema-editor/editor/SchemaEditor.d.ts.map +1 -1
- package/lib/widgets/schema-editor/editor/SchemaEditor.js +22 -11
- package/lib/widgets/schema-editor/editor/SchemaEditor.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 +37 -33
- package/src/__tests__/a11y.test.tsx +77 -1
- package/src/__tests__/axe-helper.ts +17 -7
- package/src/__tests__/setup.ts +25 -0
- package/src/core/components/SidePanel.tsx +1 -1
- package/src/core/components/shadcn/button.tsx +67 -12
- package/src/core/components/shadcn/filters/filterBar.tsx +1 -0
- package/src/core/components/shadcn/modal/dialog.tsx +4 -2
- package/src/core/components/shadcn/tabs.test.tsx +65 -0
- package/src/core/components/shadcn/tabs.tsx +25 -3
- package/src/core/components/shadcn/theme/ThemeSwitcher.tsx +1 -1
- package/src/features/agent/chat/AgentChatPlaybackControls.tsx +0 -5
- package/src/features/agent/chat/AgentRequestInputOverlay.test.tsx +31 -0
- package/src/features/agent/chat/AgentRequestInputOverlay.tsx +6 -2
- 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 +222 -61
- package/src/features/agent/chat/DocumentEditingActionCard.test.tsx +105 -0
- package/src/features/agent/chat/DocumentEditingActionCard.tsx +210 -0
- package/src/features/agent/chat/ImageLightbox.tsx +0 -1
- package/src/features/agent/chat/ModernAgentConversation.test.tsx +285 -40
- package/src/features/agent/chat/ModernAgentConversation.tsx +247 -77
- 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 +263 -35
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +236 -118
- 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/Header.tsx +3 -3
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +0 -2
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +34 -47
- 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 +80 -0
- package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.ts +21 -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/environment/SelectEnvironment.tsx +186 -0
- package/src/features/environment/index.ts +1 -0
- package/src/features/index.ts +2 -0
- package/src/features/magic-pdf/AnnotatedImageSlider.tsx +62 -66
- package/src/features/magic-pdf/DownloadPopover.tsx +5 -48
- package/src/features/magic-pdf/ExtractedContentView.tsx +2 -14
- package/src/features/magic-pdf/GroundedExtractionAssistantPanel.tsx +86 -0
- package/src/features/magic-pdf/GroundedExtractionView.test.tsx +65 -0
- package/src/features/magic-pdf/GroundedExtractionView.tsx +1055 -0
- package/src/features/magic-pdf/MagicPdfProvider.tsx +17 -47
- package/src/features/magic-pdf/MagicPdfView.tsx +3 -51
- package/src/features/magic-pdf/index.ts +1 -0
- package/src/features/magic-pdf/types.ts +1 -1
- package/src/features/oauth/McpConnectionsButton.tsx +0 -2
- package/src/features/oauth/McpConnectionsDialog.tsx +0 -1
- package/src/features/oauth/RemoteMcpConnectionButton.tsx +0 -1
- package/src/features/pdf-viewer/PdfPageSlider.tsx +5 -5
- package/src/features/pdf-viewer/SimplePdfViewer.tsx +11 -12
- package/src/features/permissions/UserPermissionsProvider.tsx +1 -1
- package/src/features/store/objects/DocumentQuickFilter.tsx +13 -15
- package/src/features/store/objects/DocumentSearchResults.tsx +5 -8
- package/src/features/store/objects/components/ContentDispositionButton.tsx +5 -1
- package/src/features/store/objects/components/ContentOverview.tsx +356 -105
- 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/DocumentIcon.tsx +1 -1
- 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/VectorSearchWidget.tsx +2 -2
- 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 +55 -42
- 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/layout/renderers.tsx +1 -2
- package/src/features/store/objects/selection/SelectionActions.tsx +1 -1
- package/src/features/store/objects/selection/actions/StartWorkflowButton.tsx +2 -2
- package/src/features/store/types/ContentObjectTypesTable.tsx +12 -14
- package/src/features/store/types/IntakePolicyEditor.tsx +679 -0
- package/src/features/store/types/IntakePolicyForm.tsx +838 -0
- package/src/features/store/types/SelectContentTypeModal.tsx +2 -2
- package/src/features/store/types/index.ts +2 -0
- package/src/features/store/types/intake-policy-editor.logic.test.ts +109 -0
- package/src/features/store/types/intake-policy-editor.logic.ts +87 -0
- package/src/features/store/types/typeCatalogCache.ts +45 -0
- package/src/features/user/UserInfo.tsx +7 -7
- package/src/features/views/ViewExperience.test.tsx +273 -0
- package/src/features/views/ViewExperience.tsx +408 -0
- package/src/features/views/ViewNavigation.test.tsx +86 -0
- package/src/features/views/ViewNavigation.tsx +187 -0
- package/src/features/views/ViewResults.test.ts +82 -0
- package/src/features/views/ViewResults.tsx +609 -0
- package/src/features/views/ViewSearch.test.tsx +147 -0
- package/src/features/views/ViewSearch.tsx +205 -0
- package/src/features/views/index.ts +6 -0
- package/src/features/views/types.ts +57 -0
- package/src/features/views/viewState.test.ts +111 -0
- package/src/features/views/viewState.ts +132 -0
- package/src/i18n/locales/ar.json +134 -1
- package/src/i18n/locales/de.json +130 -1
- package/src/i18n/locales/en.json +1083 -753
- package/src/i18n/locales/es.json +131 -1
- package/src/i18n/locales/fr.json +131 -1
- package/src/i18n/locales/it.json +131 -1
- package/src/i18n/locales/ja.json +129 -1
- package/src/i18n/locales/ko.json +129 -1
- package/src/i18n/locales/pt.json +131 -1
- package/src/i18n/locales/ru.json +132 -1
- package/src/i18n/locales/tr.json +130 -1
- package/src/i18n/locales/zh-TW.json +129 -1
- package/src/i18n/locales/zh.json +129 -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/router/HistoryNavigator.test.ts +48 -0
- package/src/router/HistoryNavigator.ts +24 -13
- package/src/router/Nav.tsx +18 -8
- package/src/session/UserSession.test.ts +39 -0
- package/src/session/UserSession.ts +5 -3
- package/src/widgets/form/Form.tsx +1 -1
- package/src/widgets/json-view/JSONSwitcher.tsx +2 -2
- package/src/widgets/json-view/JSONView.tsx +7 -7
- 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/monacoEditor/MonacoEditor.tsx +29 -0
- package/src/widgets/schema-editor/ManagedSchema.ts +22 -0
- package/src/widgets/schema-editor/editor/EditableSchemaProperty.tsx +3 -0
- package/src/widgets/schema-editor/editor/PropertyViewer.tsx +14 -3
- package/src/widgets/schema-editor/editor/SchemaEditor.tsx +80 -29
- package/src/widgets/xml-viewer/hooks/useXMLViewer.test.ts +26 -0
- package/src/widgets/xml-viewer/hooks/useXMLViewer.ts +23 -18
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { AgentResourceReference } from '@vertesia/common';
|
|
2
|
+
import { Badge, Button, cn } from '@vertesia/ui/core';
|
|
3
|
+
import { useUITranslation } from '@vertesia/ui/i18n';
|
|
4
|
+
import { NavLink } from '@vertesia/ui/router';
|
|
5
|
+
import { useAgentResourceResolver } from '@vertesia/ui/widgets';
|
|
6
|
+
import { getResourceActionVariant, getResourceIcon } from './resourceLinks';
|
|
7
|
+
|
|
8
|
+
interface ResourceChipProps {
|
|
9
|
+
resource: AgentResourceReference;
|
|
10
|
+
/** Originating run, passed to the resolver for run-scoped resources. */
|
|
11
|
+
workflowRunId?: string;
|
|
12
|
+
/** Hide the action badge when surrounding text already communicates the action. */
|
|
13
|
+
showAction?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A compact resource chip for something an agent tool created/updated/deleted. The host resolver may
|
|
19
|
+
* make it navigable (NavLink applies tenant sticky params), activate a host callback, or leave it
|
|
20
|
+
* non-interactive.
|
|
21
|
+
*/
|
|
22
|
+
export function ResourceChip({ resource, workflowRunId, showAction = true, className }: ResourceChipProps) {
|
|
23
|
+
const { t } = useUITranslation();
|
|
24
|
+
const resolve = useAgentResourceResolver();
|
|
25
|
+
const target = resolve(resource, { workflowRunId, source: 'structured' });
|
|
26
|
+
const Icon = getResourceIcon(resource.type);
|
|
27
|
+
// Literal keys (not a dynamic lookup) so i18next-cli can statically extract them.
|
|
28
|
+
const actionLabel =
|
|
29
|
+
resource.action === 'created'
|
|
30
|
+
? t('agent.resourceActionCreated')
|
|
31
|
+
: resource.action === 'deleted'
|
|
32
|
+
? t('agent.resourceActionDeleted')
|
|
33
|
+
: t('agent.resourceActionUpdated');
|
|
34
|
+
|
|
35
|
+
const body = (
|
|
36
|
+
<>
|
|
37
|
+
<Icon className="size-3.5 shrink-0 text-foreground" aria-hidden="true" />
|
|
38
|
+
<span className="truncate">{resource.label}</span>
|
|
39
|
+
{showAction && (
|
|
40
|
+
<Badge variant={getResourceActionVariant(resource.action)} className="shrink-0 px-1.5 py-0 text-[10px]">
|
|
41
|
+
{actionLabel}
|
|
42
|
+
</Badge>
|
|
43
|
+
)}
|
|
44
|
+
</>
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const baseClass = cn(
|
|
48
|
+
'inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-background px-2 py-1 text-xs',
|
|
49
|
+
className,
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
if (target.kind === 'navigate') {
|
|
53
|
+
return (
|
|
54
|
+
<NavLink
|
|
55
|
+
href={target.href}
|
|
56
|
+
topLevelNav
|
|
57
|
+
className={cn(baseClass, 'font-medium transition-colors hover:bg-muted/60')}
|
|
58
|
+
>
|
|
59
|
+
{body}
|
|
60
|
+
</NavLink>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (target.kind === 'activate') {
|
|
65
|
+
return (
|
|
66
|
+
<Button
|
|
67
|
+
variant="unstyled"
|
|
68
|
+
onClick={target.onActivate}
|
|
69
|
+
className={cn(baseClass, 'font-medium transition-colors hover:bg-muted/60')}
|
|
70
|
+
>
|
|
71
|
+
{body}
|
|
72
|
+
</Button>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Deleted or unresolvable resource: no navigation target, render a non-interactive chip.
|
|
77
|
+
return <span className={cn(baseClass, 'text-muted')}>{body}</span>;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
interface ResourceActivityLinkListProps {
|
|
81
|
+
resources: AgentResourceReference[];
|
|
82
|
+
workflowRunId?: string;
|
|
83
|
+
className?: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Inline action + deep-link presentation for completed tool timeline rows. */
|
|
87
|
+
export function ResourceActivityLinkList({ resources, workflowRunId, className }: ResourceActivityLinkListProps) {
|
|
88
|
+
const { t } = useUITranslation();
|
|
89
|
+
if (resources.length === 0) return null;
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<div
|
|
93
|
+
className={cn('flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1', className)}
|
|
94
|
+
data-agent-resource-activity
|
|
95
|
+
>
|
|
96
|
+
{resources.map((resource) => {
|
|
97
|
+
const actionLabel =
|
|
98
|
+
resource.action === 'created'
|
|
99
|
+
? t('agent.resourceActionCreated')
|
|
100
|
+
: resource.action === 'deleted'
|
|
101
|
+
? t('agent.resourceActionDeleted')
|
|
102
|
+
: t('agent.resourceActionUpdated');
|
|
103
|
+
return (
|
|
104
|
+
<span
|
|
105
|
+
key={`${resource.type}:${resource.id}:${resource.action}`}
|
|
106
|
+
className="inline-flex min-w-0 items-center gap-1.5"
|
|
107
|
+
>
|
|
108
|
+
<span className="shrink-0 text-sm text-muted">{actionLabel}</span>
|
|
109
|
+
<ResourceChip
|
|
110
|
+
resource={resource}
|
|
111
|
+
workflowRunId={workflowRunId}
|
|
112
|
+
showAction={false}
|
|
113
|
+
className="py-0.5"
|
|
114
|
+
/>
|
|
115
|
+
</span>
|
|
116
|
+
);
|
|
117
|
+
})}
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
interface ResourceChipListProps {
|
|
123
|
+
resources: AgentResourceReference[];
|
|
124
|
+
workflowRunId?: string;
|
|
125
|
+
className?: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function ResourceChipList({ resources, workflowRunId, className }: ResourceChipListProps) {
|
|
129
|
+
if (resources.length === 0) return null;
|
|
130
|
+
return (
|
|
131
|
+
<div className={cn('flex flex-wrap gap-1.5', className)}>
|
|
132
|
+
{resources.map((resource) => (
|
|
133
|
+
<ResourceChip
|
|
134
|
+
key={`${resource.type}:${resource.id}:${resource.action}`}
|
|
135
|
+
resource={resource}
|
|
136
|
+
workflowRunId={workflowRunId}
|
|
137
|
+
/>
|
|
138
|
+
))}
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type AgentMessage,
|
|
3
|
+
AgentMessageType,
|
|
4
|
+
type AgentResourceReference,
|
|
5
|
+
getResourcesFromMessage,
|
|
6
|
+
} from '@vertesia/common';
|
|
2
7
|
import { Button, cn, onActivateKey, useToast } from '@vertesia/ui/core';
|
|
3
8
|
import { useUITranslation } from '@vertesia/ui/i18n';
|
|
4
9
|
import { useUserSession } from '@vertesia/ui/session';
|
|
@@ -9,6 +14,7 @@ import { memo, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
9
14
|
import { PulsatingCircle } from '../AnimatedThinkingDots';
|
|
10
15
|
import { useImageLightbox } from '../ImageLightbox';
|
|
11
16
|
import { getArtifactCacheKey, useArtifactUrlCache } from '../useArtifactUrlCache.js';
|
|
17
|
+
import { ResourceChipList } from './ResourceChip';
|
|
12
18
|
import type { ToolExecutionStatus } from './utils';
|
|
13
19
|
|
|
14
20
|
/** Keys that are internal metadata and not interesting to display */
|
|
@@ -27,8 +33,10 @@ const META_KEYS = new Set([
|
|
|
27
33
|
'files',
|
|
28
34
|
'outputFiles',
|
|
29
35
|
'display_role',
|
|
36
|
+
'duration_ms',
|
|
30
37
|
'observation',
|
|
31
38
|
'progress_messages',
|
|
39
|
+
'resources',
|
|
32
40
|
'browseruse',
|
|
33
41
|
'browser_use',
|
|
34
42
|
]);
|
|
@@ -797,6 +805,23 @@ function ToolCallGroupComponent({
|
|
|
797
805
|
// Extract workflow_run_id from messages (any message in the group should have it)
|
|
798
806
|
const artifactRunId = messages.find((m) => m.workflow_run_id)?.workflow_run_id ?? messages[0]?.workflow_run_id;
|
|
799
807
|
|
|
808
|
+
// Aggregate resource references across the whole group so deep links stay visible even when the
|
|
809
|
+
// group is collapsed (mirrors how group images/files are surfaced at the group level).
|
|
810
|
+
const groupResources = useMemo(() => {
|
|
811
|
+
const seen = new Set<string>();
|
|
812
|
+
const out: AgentResourceReference[] = [];
|
|
813
|
+
for (const m of messages) {
|
|
814
|
+
for (const ref of getResourcesFromMessage(m)) {
|
|
815
|
+
const key = `${ref.type}:${ref.id}:${ref.action}`;
|
|
816
|
+
if (!seen.has(key)) {
|
|
817
|
+
seen.add(key);
|
|
818
|
+
out.push(ref);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
return out;
|
|
823
|
+
}, [messages]);
|
|
824
|
+
|
|
800
825
|
// Render status indicator based on tool execution status
|
|
801
826
|
const renderStatusIndicator = () => {
|
|
802
827
|
// Only pulse for the currently active/latest group
|
|
@@ -966,6 +991,13 @@ function ToolCallGroupComponent({
|
|
|
966
991
|
{/* Show all images from the group prominently at the top */}
|
|
967
992
|
<GroupImageDisplay messages={messages} artifactRunId={artifactRunId} />
|
|
968
993
|
|
|
994
|
+
{/* Deep links to resources created/updated/deleted in this group, independent of expansion state. */}
|
|
995
|
+
{groupResources.length > 0 && (
|
|
996
|
+
<div className="px-4 pt-1 pb-2">
|
|
997
|
+
<ResourceChipList resources={groupResources} workflowRunId={artifactRunId} />
|
|
998
|
+
</div>
|
|
999
|
+
)}
|
|
1000
|
+
|
|
969
1001
|
{/* Collapsed summary - show tool calls as single-line rows with expand option */}
|
|
970
1002
|
{isCollapsed && (
|
|
971
1003
|
<div className="px-3 py-0.5 space-y-0">
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type AgentMessage, AgentMessageType } from '@vertesia/common';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import {
|
|
4
|
+
getAnsweredToolApprovalRequestInputKeys,
|
|
5
|
+
getRequestInputMessageKey,
|
|
6
|
+
getToolApprovalResponseMetadata,
|
|
7
|
+
} from './requestInputMessages';
|
|
8
|
+
|
|
9
|
+
const APPROVAL_KEY = 'create_interaction:name:JDE AR Payment Processing Agent';
|
|
10
|
+
|
|
11
|
+
function makeApprovalRequest(): AgentMessage {
|
|
12
|
+
return {
|
|
13
|
+
timestamp: 1,
|
|
14
|
+
type: AgentMessageType.REQUEST_INPUT,
|
|
15
|
+
message: 'Approve Create a new draft interaction: JDE AR Payment Processing Agent?',
|
|
16
|
+
workstream_id: 'main',
|
|
17
|
+
details: {
|
|
18
|
+
tool_approval: { tool_name: 'create_interaction', approval_key: APPROVAL_KEY },
|
|
19
|
+
ux: { options: [{ id: 'allow_once' }, { id: 'allow_for_run' }, { id: 'deny' }] },
|
|
20
|
+
},
|
|
21
|
+
} as unknown as AgentMessage;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function makeUserAnswer(message: string, metadata?: Record<string, unknown>): AgentMessage {
|
|
25
|
+
return {
|
|
26
|
+
timestamp: 2,
|
|
27
|
+
type: AgentMessageType.QUESTION,
|
|
28
|
+
message,
|
|
29
|
+
workstream_id: 'main',
|
|
30
|
+
details: metadata ? { metadata } : undefined,
|
|
31
|
+
} as unknown as AgentMessage;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
describe('getToolApprovalResponseMetadata', () => {
|
|
35
|
+
it('builds structured response metadata for approval options', () => {
|
|
36
|
+
expect(getToolApprovalResponseMetadata(makeApprovalRequest(), 'allow_for_run')).toEqual({
|
|
37
|
+
tool_approval_response: { decision: 'allow_for_run', approval_key: APPROVAL_KEY },
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('returns undefined for prompts that are not tool approvals', () => {
|
|
42
|
+
const plainPrompt = {
|
|
43
|
+
timestamp: 1,
|
|
44
|
+
type: AgentMessageType.REQUEST_INPUT,
|
|
45
|
+
message: 'Which environment?',
|
|
46
|
+
workstream_id: 'main',
|
|
47
|
+
details: { ux: { options: [{ id: 'staging' }, { id: 'production' }] } },
|
|
48
|
+
} as unknown as AgentMessage;
|
|
49
|
+
expect(getToolApprovalResponseMetadata(plainPrompt, 'staging')).toBeUndefined();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('returns undefined for unknown option ids', () => {
|
|
53
|
+
expect(getToolApprovalResponseMetadata(makeApprovalRequest(), 'staging')).toBeUndefined();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('getAnsweredToolApprovalRequestInputKeys', () => {
|
|
58
|
+
it('treats a bare option answer as answered', () => {
|
|
59
|
+
const request = makeApprovalRequest();
|
|
60
|
+
const answer = makeUserAnswer('allow_for_run');
|
|
61
|
+
const answered = getAnsweredToolApprovalRequestInputKeys([request, answer]);
|
|
62
|
+
expect(answered.has(getRequestInputMessageKey(request))).toBe(true);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('treats a metadata-carrying answer as answered regardless of its text', () => {
|
|
66
|
+
const request = makeApprovalRequest();
|
|
67
|
+
const answer = makeUserAnswer('Allow this action for this run\n\nUploaded artifacts:\n[a.png](artifact:a)', {
|
|
68
|
+
tool_approval_response: { decision: 'allow_for_run', approval_key: APPROVAL_KEY },
|
|
69
|
+
});
|
|
70
|
+
const answered = getAnsweredToolApprovalRequestInputKeys([request, answer]);
|
|
71
|
+
expect(answered.has(getRequestInputMessageKey(request))).toBe(true);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('does not treat unrelated prose as an approval answer', () => {
|
|
75
|
+
const request = makeApprovalRequest();
|
|
76
|
+
const answer = makeUserAnswer('please proceed\n\nUploaded artifacts:\n[a.png](artifact:a)');
|
|
77
|
+
const answered = getAnsweredToolApprovalRequestInputKeys([request, answer]);
|
|
78
|
+
expect(answered.size).toBe(0);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
@@ -169,6 +169,22 @@ export function isToolApprovalRequestInput(message: AgentMessage): boolean {
|
|
|
169
169
|
return message.type === AgentMessageType.REQUEST_INPUT && getToolApprovalKey(message) !== undefined;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
+
const TOOL_APPROVAL_OPTION_DECISIONS = new Set(['allow_once', 'allow_for_run', 'deny']);
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Metadata to attach when the user picks an option on a tool-approval prompt, so the workflow
|
|
176
|
+
* reads the decision structurally instead of from the message text (which clients may decorate,
|
|
177
|
+
* e.g. with an attachments footer). Returns undefined for non-approval prompts or unknown options.
|
|
178
|
+
*/
|
|
179
|
+
export function getToolApprovalResponseMetadata(
|
|
180
|
+
message: AgentMessage,
|
|
181
|
+
optionId: string,
|
|
182
|
+
): Record<string, unknown> | undefined {
|
|
183
|
+
const approvalKey = getToolApprovalKey(message);
|
|
184
|
+
if (!approvalKey || !TOOL_APPROVAL_OPTION_DECISIONS.has(optionId)) return undefined;
|
|
185
|
+
return { tool_approval_response: { decision: optionId, approval_key: approvalKey } };
|
|
186
|
+
}
|
|
187
|
+
|
|
172
188
|
function isToolApprovalOptionResponse(message: AgentMessage): boolean {
|
|
173
189
|
if (message.type !== AgentMessageType.QUESTION) return false;
|
|
174
190
|
const normalized = getAgentMessageText(message).trim().toLowerCase();
|
|
@@ -181,7 +197,11 @@ function isToolApprovalMetadataResponse(message: AgentMessage): boolean {
|
|
|
181
197
|
const metadata = getRecord(details?.metadata);
|
|
182
198
|
const toolApprovalResponse =
|
|
183
199
|
getRecord(details?.tool_approval_response) ?? getRecord(metadata?.tool_approval_response);
|
|
184
|
-
|
|
200
|
+
const decision = toolApprovalResponse?.decision;
|
|
201
|
+
return (
|
|
202
|
+
decision === 'deny_with_feedback' ||
|
|
203
|
+
(typeof decision === 'string' && TOOL_APPROVAL_OPTION_DECISIONS.has(decision))
|
|
204
|
+
);
|
|
185
205
|
}
|
|
186
206
|
|
|
187
207
|
function isToolApprovalResponse(message: AgentMessage): boolean {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AgentResourceAction, AgentResourceType } from '@vertesia/common';
|
|
2
|
+
import type { LucideIcon } from 'lucide-react';
|
|
3
|
+
import {
|
|
4
|
+
Boxes,
|
|
5
|
+
BrainCircuit,
|
|
6
|
+
Database,
|
|
7
|
+
FileType,
|
|
8
|
+
MessagesSquare,
|
|
9
|
+
PanelsTopLeft,
|
|
10
|
+
PlayCircle,
|
|
11
|
+
SquareTerminal,
|
|
12
|
+
Workflow,
|
|
13
|
+
} from 'lucide-react';
|
|
14
|
+
|
|
15
|
+
const RESOURCE_ICONS: Record<AgentResourceType, LucideIcon> = {
|
|
16
|
+
document: Database,
|
|
17
|
+
collection: Boxes,
|
|
18
|
+
content_type: FileType,
|
|
19
|
+
interaction: MessagesSquare,
|
|
20
|
+
prompt: SquareTerminal,
|
|
21
|
+
agent: BrainCircuit,
|
|
22
|
+
workflow: Workflow,
|
|
23
|
+
process: Workflow,
|
|
24
|
+
process_run: PlayCircle,
|
|
25
|
+
interaction_run: PlayCircle,
|
|
26
|
+
view: PanelsTopLeft,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function getResourceIcon(type: AgentResourceType): LucideIcon {
|
|
30
|
+
return RESOURCE_ICONS[type];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Badge variant for a resource action, using the semantic color system. */
|
|
34
|
+
export function getResourceActionVariant(action: AgentResourceAction): 'success' | 'info' | 'outline' {
|
|
35
|
+
switch (action) {
|
|
36
|
+
case 'created':
|
|
37
|
+
return 'success';
|
|
38
|
+
case 'deleted':
|
|
39
|
+
return 'outline';
|
|
40
|
+
default:
|
|
41
|
+
return 'info';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { type AgentMessage, AgentMessageType, type AgentResourceReference } from '@vertesia/common';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import {
|
|
4
|
+
aggregateLatestTurnResources,
|
|
5
|
+
interleaveTurnSummaries,
|
|
6
|
+
isResourceSummaryReady,
|
|
7
|
+
segmentTurnResources,
|
|
8
|
+
} from './resourceSummary';
|
|
9
|
+
|
|
10
|
+
let seq = 0;
|
|
11
|
+
function msg(type: AgentMessageType, resources?: AgentResourceReference[], workstream_id = 'main'): AgentMessage {
|
|
12
|
+
seq += 1;
|
|
13
|
+
return {
|
|
14
|
+
timestamp: seq,
|
|
15
|
+
workflow_run_id: 'run-1',
|
|
16
|
+
type,
|
|
17
|
+
message: '',
|
|
18
|
+
workstream_id,
|
|
19
|
+
...(resources ? { details: { event_class: 'activity', resources } } : {}),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function ref(
|
|
24
|
+
type: AgentResourceReference['type'],
|
|
25
|
+
id: string,
|
|
26
|
+
action: AgentResourceReference['action'],
|
|
27
|
+
label = id,
|
|
28
|
+
): AgentResourceReference {
|
|
29
|
+
return { type, id, label, action };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
describe('aggregateLatestTurnResources', () => {
|
|
33
|
+
it('returns resources from tool messages in the latest turn', () => {
|
|
34
|
+
const result = aggregateLatestTurnResources([
|
|
35
|
+
msg(AgentMessageType.QUESTION),
|
|
36
|
+
msg(AgentMessageType.THOUGHT, [ref('document', 'd1', 'created', 'Doc One')]),
|
|
37
|
+
msg(AgentMessageType.THOUGHT, [ref('collection', 'c1', 'created', 'Col One')]),
|
|
38
|
+
msg(AgentMessageType.COMPLETE),
|
|
39
|
+
]);
|
|
40
|
+
expect(result).toEqual([
|
|
41
|
+
ref('document', 'd1', 'created', 'Doc One'),
|
|
42
|
+
ref('collection', 'c1', 'created', 'Col One'),
|
|
43
|
+
]);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('ignores resources from earlier turns', () => {
|
|
47
|
+
const result = aggregateLatestTurnResources([
|
|
48
|
+
msg(AgentMessageType.QUESTION),
|
|
49
|
+
msg(AgentMessageType.THOUGHT, [ref('document', 'old', 'created')]),
|
|
50
|
+
msg(AgentMessageType.COMPLETE),
|
|
51
|
+
msg(AgentMessageType.QUESTION),
|
|
52
|
+
msg(AgentMessageType.THOUGHT, [ref('document', 'new', 'created')]),
|
|
53
|
+
msg(AgentMessageType.COMPLETE),
|
|
54
|
+
]);
|
|
55
|
+
expect(result).toEqual([ref('document', 'new', 'created')]);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('dedupes by (type, id) and lets create win over later updates', () => {
|
|
59
|
+
const result = aggregateLatestTurnResources([
|
|
60
|
+
msg(AgentMessageType.QUESTION),
|
|
61
|
+
msg(AgentMessageType.THOUGHT, [ref('document', 'd1', 'created', 'First')]),
|
|
62
|
+
msg(AgentMessageType.THOUGHT, [ref('document', 'd1', 'updated', 'Renamed')]),
|
|
63
|
+
]);
|
|
64
|
+
// create wins, but the most recent label is retained
|
|
65
|
+
expect(result).toEqual([ref('document', 'd1', 'created', 'Renamed')]);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('drops a resource created then deleted in the same turn', () => {
|
|
69
|
+
const result = aggregateLatestTurnResources([
|
|
70
|
+
msg(AgentMessageType.QUESTION),
|
|
71
|
+
msg(AgentMessageType.THOUGHT, [ref('document', 'scratch', 'created')]),
|
|
72
|
+
msg(AgentMessageType.THOUGHT, [ref('document', 'scratch', 'deleted')]),
|
|
73
|
+
]);
|
|
74
|
+
expect(result).toEqual([]);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('keeps a resource deleted then re-created in the same turn (order matters)', () => {
|
|
78
|
+
const result = aggregateLatestTurnResources([
|
|
79
|
+
msg(AgentMessageType.QUESTION),
|
|
80
|
+
msg(AgentMessageType.THOUGHT, [ref('view', 'v1', 'deleted')]),
|
|
81
|
+
msg(AgentMessageType.THOUGHT, [ref('view', 'v1', 'created', 'Rebuilt View')]),
|
|
82
|
+
]);
|
|
83
|
+
expect(result).toEqual([ref('view', 'v1', 'created', 'Rebuilt View')]);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('reports a pre-existing resource deleted → recreated → deleted as deleted (not transient)', () => {
|
|
87
|
+
const result = aggregateLatestTurnResources([
|
|
88
|
+
msg(AgentMessageType.QUESTION),
|
|
89
|
+
msg(AgentMessageType.THOUGHT, [ref('view', 'v1', 'deleted')]),
|
|
90
|
+
msg(AgentMessageType.THOUGHT, [ref('view', 'v1', 'created')]),
|
|
91
|
+
msg(AgentMessageType.THOUGHT, [ref('view', 'v1', 'deleted', 'Old View')]),
|
|
92
|
+
]);
|
|
93
|
+
expect(result).toEqual([ref('view', 'v1', 'deleted', 'Old View')]);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('omits a resource created → deleted → created → deleted (never existed before the turn)', () => {
|
|
97
|
+
const result = aggregateLatestTurnResources([
|
|
98
|
+
msg(AgentMessageType.QUESTION),
|
|
99
|
+
msg(AgentMessageType.THOUGHT, [ref('view', 'v1', 'created')]),
|
|
100
|
+
msg(AgentMessageType.THOUGHT, [ref('view', 'v1', 'deleted')]),
|
|
101
|
+
msg(AgentMessageType.THOUGHT, [ref('view', 'v1', 'created')]),
|
|
102
|
+
msg(AgentMessageType.THOUGHT, [ref('view', 'v1', 'deleted')]),
|
|
103
|
+
]);
|
|
104
|
+
expect(result).toEqual([]);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('keeps a delete of a pre-existing resource', () => {
|
|
108
|
+
const result = aggregateLatestTurnResources([
|
|
109
|
+
msg(AgentMessageType.QUESTION),
|
|
110
|
+
msg(AgentMessageType.THOUGHT, [ref('interaction', 'i1', 'deleted', 'Old Interaction')]),
|
|
111
|
+
]);
|
|
112
|
+
expect(result).toEqual([ref('interaction', 'i1', 'deleted', 'Old Interaction')]);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('collapses repeated updates into a single entry', () => {
|
|
116
|
+
const result = aggregateLatestTurnResources([
|
|
117
|
+
msg(AgentMessageType.QUESTION),
|
|
118
|
+
msg(AgentMessageType.THOUGHT, [ref('collection', 'c1', 'updated')]),
|
|
119
|
+
msg(AgentMessageType.THOUGHT, [ref('collection', 'c1', 'updated')]),
|
|
120
|
+
]);
|
|
121
|
+
expect(result).toEqual([ref('collection', 'c1', 'updated')]);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('aggregates resources across child workstreams in the turn', () => {
|
|
125
|
+
const result = aggregateLatestTurnResources([
|
|
126
|
+
msg(AgentMessageType.QUESTION),
|
|
127
|
+
msg(AgentMessageType.THOUGHT, [ref('document', 'main-doc', 'created')], 'main'),
|
|
128
|
+
msg(AgentMessageType.THOUGHT, [ref('document', 'child-doc', 'created')], 'ws-2'),
|
|
129
|
+
]);
|
|
130
|
+
expect(result).toEqual([ref('document', 'main-doc', 'created'), ref('document', 'child-doc', 'created')]);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
describe('segmentTurnResources', () => {
|
|
135
|
+
it('returns one entry per turn with that turn’s resources', () => {
|
|
136
|
+
const turns = segmentTurnResources([
|
|
137
|
+
msg(AgentMessageType.QUESTION),
|
|
138
|
+
msg(AgentMessageType.THOUGHT, [ref('document', 'd1', 'created')]),
|
|
139
|
+
msg(AgentMessageType.COMPLETE),
|
|
140
|
+
msg(AgentMessageType.QUESTION),
|
|
141
|
+
msg(AgentMessageType.THOUGHT, [ref('collection', 'c1', 'created')]),
|
|
142
|
+
msg(AgentMessageType.COMPLETE),
|
|
143
|
+
]);
|
|
144
|
+
expect(turns).toEqual([[ref('document', 'd1', 'created')], [ref('collection', 'c1', 'created')]]);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it('folds leading non-question messages into the first turn (index alignment)', () => {
|
|
148
|
+
const turns = segmentTurnResources([
|
|
149
|
+
msg(AgentMessageType.SYSTEM),
|
|
150
|
+
msg(AgentMessageType.QUESTION),
|
|
151
|
+
msg(AgentMessageType.THOUGHT, [ref('document', 'd1', 'created')]),
|
|
152
|
+
msg(AgentMessageType.QUESTION),
|
|
153
|
+
msg(AgentMessageType.THOUGHT, [ref('document', 'd2', 'created')]),
|
|
154
|
+
]);
|
|
155
|
+
expect(turns).toHaveLength(2);
|
|
156
|
+
expect(turns[0]).toEqual([ref('document', 'd1', 'created')]);
|
|
157
|
+
expect(turns[1]).toEqual([ref('document', 'd2', 'created')]);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
describe('isResourceSummaryReady', () => {
|
|
162
|
+
it('treats a final answer as the end of an interactive turn', () => {
|
|
163
|
+
expect(
|
|
164
|
+
isResourceSummaryReady([
|
|
165
|
+
msg(AgentMessageType.QUESTION),
|
|
166
|
+
msg(AgentMessageType.THOUGHT, [ref('document', 'd1', 'created')]),
|
|
167
|
+
msg(AgentMessageType.ANSWER),
|
|
168
|
+
]),
|
|
169
|
+
).toBe(true);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it('does not treat an answer as final when later main-workstream activity exists', () => {
|
|
173
|
+
expect(
|
|
174
|
+
isResourceSummaryReady([
|
|
175
|
+
msg(AgentMessageType.QUESTION),
|
|
176
|
+
msg(AgentMessageType.ANSWER),
|
|
177
|
+
msg(AgentMessageType.THOUGHT),
|
|
178
|
+
]),
|
|
179
|
+
).toBe(false);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it('does not let a child-workstream answer complete the main turn', () => {
|
|
183
|
+
expect(
|
|
184
|
+
isResourceSummaryReady([
|
|
185
|
+
msg(AgentMessageType.QUESTION),
|
|
186
|
+
msg(AgentMessageType.THOUGHT),
|
|
187
|
+
msg(AgentMessageType.ANSWER, undefined, 'child'),
|
|
188
|
+
]),
|
|
189
|
+
).toBe(false);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
describe('interleaveTurnSummaries', () => {
|
|
194
|
+
type Item = { kind: 'q' | 'x'; id: string };
|
|
195
|
+
const q = (id: string): Item => ({ kind: 'q', id });
|
|
196
|
+
const x = (id: string): Item => ({ kind: 'x', id });
|
|
197
|
+
const isBoundary = (i: Item) => i.kind === 'q';
|
|
198
|
+
const turn = (id: string, action: AgentResourceReference['action'] = 'created'): AgentResourceReference[] => [
|
|
199
|
+
ref('document', id, action),
|
|
200
|
+
];
|
|
201
|
+
|
|
202
|
+
it('inserts a completed turn’s summary before the next turn boundary and at the end', () => {
|
|
203
|
+
const items = [q('q1'), x('a'), q('q2'), x('b')];
|
|
204
|
+
const out = interleaveTurnSummaries(items, isBoundary, [turn('d1'), turn('d2')], true);
|
|
205
|
+
const kinds = out.map((i) => ('type' in i ? i.type : i.kind));
|
|
206
|
+
// summary for turn 0 appears before q2; summary for turn 1 at the end
|
|
207
|
+
expect(kinds).toEqual(['q', 'x', 'resource_summary', 'q', 'x', 'resource_summary']);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
it('does not render the last (in-progress) turn summary until the stream is complete', () => {
|
|
211
|
+
const items = [q('q1'), x('a')];
|
|
212
|
+
const out = interleaveTurnSummaries(items, isBoundary, [turn('d1')], false);
|
|
213
|
+
expect(out.some((i) => 'type' in i && i.type === 'resource_summary')).toBe(false);
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
it('skips turns with no resources', () => {
|
|
217
|
+
const items = [q('q1'), x('a'), q('q2')];
|
|
218
|
+
const empty: AgentResourceReference[] = [];
|
|
219
|
+
const out = interleaveTurnSummaries(items, isBoundary, [empty, turn('d2')], true);
|
|
220
|
+
// turn 0 empty → no summary before q2; turn 1 has resources → summary at end
|
|
221
|
+
const kinds = out.map((i) => ('type' in i ? i.type : i.kind));
|
|
222
|
+
expect(kinds).toEqual(['q', 'x', 'q', 'resource_summary']);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it('returns items unchanged when there are no turn summaries', () => {
|
|
226
|
+
const items = [q('q1'), x('a')];
|
|
227
|
+
expect(interleaveTurnSummaries(items, isBoundary, [], true)).toBe(items);
|
|
228
|
+
});
|
|
229
|
+
});
|