@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,34 @@
|
|
|
1
|
+
import type { Project } from '@vertesia/common';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import { getDocumentEditingProjectDefault } from './DocumentEditingConfigurationSelector.js';
|
|
4
|
+
|
|
5
|
+
describe('document editing configuration', () => {
|
|
6
|
+
it('prefers the project agent default over the base default', () => {
|
|
7
|
+
const project = {
|
|
8
|
+
configuration: {
|
|
9
|
+
defaults: {
|
|
10
|
+
base: { environment: 'base-env', model: 'base-model' },
|
|
11
|
+
system: { agent: { environment: 'agent-env', model: 'agent-model' } },
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
} as Pick<Project, 'configuration'>;
|
|
15
|
+
|
|
16
|
+
expect(getDocumentEditingProjectDefault(project)).toEqual({
|
|
17
|
+
environment: 'agent-env',
|
|
18
|
+
model: 'agent-model',
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('falls back to the project base default', () => {
|
|
23
|
+
const project = {
|
|
24
|
+
configuration: {
|
|
25
|
+
defaults: { base: { environment: 'base-env', model: 'base-model' } },
|
|
26
|
+
},
|
|
27
|
+
} as Pick<Project, 'configuration'>;
|
|
28
|
+
|
|
29
|
+
expect(getDocumentEditingProjectDefault(project)).toEqual({
|
|
30
|
+
environment: 'base-env',
|
|
31
|
+
model: 'base-model',
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import type { ExecutionEnvironmentRef, InteractionExecutionConfiguration, Project } from '@vertesia/common';
|
|
2
|
+
import { Button, Popover, PopoverContent, PopoverTrigger, SelectBox, Spinner } from '@vertesia/ui/core';
|
|
3
|
+
import { useUITranslation } from '@vertesia/ui/i18n';
|
|
4
|
+
import { useUserSession } from '@vertesia/ui/session';
|
|
5
|
+
import { ChevronDown, SlidersHorizontal } from 'lucide-react';
|
|
6
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
export interface DocumentEditingConfiguration {
|
|
9
|
+
environment?: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
model_options?: InteractionExecutionConfiguration['model_options'];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ModelOption {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function getDocumentEditingProjectDefault(
|
|
20
|
+
project: Pick<Project, 'configuration'>,
|
|
21
|
+
): DocumentEditingConfiguration {
|
|
22
|
+
const defaults = project.configuration?.defaults?.system?.agent ?? project.configuration?.defaults?.base;
|
|
23
|
+
return {
|
|
24
|
+
environment: defaults?.environment,
|
|
25
|
+
model: defaults?.model,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function environmentLabel(environment: ExecutionEnvironmentRef): string {
|
|
30
|
+
return environment.name;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function modelLabel(model: ModelOption): string {
|
|
34
|
+
return model.name;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Provider model ids can be long resource paths; display only the final segment. */
|
|
38
|
+
function shortModelName(model: string): string {
|
|
39
|
+
const segment = model.split('/').filter(Boolean).pop();
|
|
40
|
+
return segment || model;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface DocumentEditingConfigurationSelectorProps {
|
|
44
|
+
value: DocumentEditingConfiguration;
|
|
45
|
+
onChange: (value: DocumentEditingConfiguration) => void;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
isLoading?: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function DocumentEditingConfigurationSelector({
|
|
51
|
+
value,
|
|
52
|
+
onChange,
|
|
53
|
+
disabled = false,
|
|
54
|
+
isLoading = false,
|
|
55
|
+
}: DocumentEditingConfigurationSelectorProps) {
|
|
56
|
+
const { client } = useUserSession();
|
|
57
|
+
const { t } = useUITranslation();
|
|
58
|
+
const [environments, setEnvironments] = useState<ExecutionEnvironmentRef[]>([]);
|
|
59
|
+
const [models, setModels] = useState<ModelOption[]>([]);
|
|
60
|
+
const [isLoadingEnvironments, setIsLoadingEnvironments] = useState(true);
|
|
61
|
+
const [isLoadingModels, setIsLoadingModels] = useState(false);
|
|
62
|
+
const latestEnvironmentRequestRef = useRef<string | undefined>(undefined);
|
|
63
|
+
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
let cancelled = false;
|
|
66
|
+
setIsLoadingEnvironments(true);
|
|
67
|
+
void client.environments
|
|
68
|
+
.list()
|
|
69
|
+
.then((items) => {
|
|
70
|
+
if (!cancelled) setEnvironments(items.slice().sort((a, b) => a.name.localeCompare(b.name)));
|
|
71
|
+
})
|
|
72
|
+
.catch((err: unknown) => {
|
|
73
|
+
console.warn('Failed to list document editing environments', err);
|
|
74
|
+
if (!cancelled) setEnvironments([]);
|
|
75
|
+
})
|
|
76
|
+
.finally(() => {
|
|
77
|
+
if (!cancelled) setIsLoadingEnvironments(false);
|
|
78
|
+
});
|
|
79
|
+
return () => {
|
|
80
|
+
cancelled = true;
|
|
81
|
+
};
|
|
82
|
+
}, [client]);
|
|
83
|
+
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (!value.environment) {
|
|
86
|
+
setModels([]);
|
|
87
|
+
setIsLoadingModels(false);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
let cancelled = false;
|
|
92
|
+
const environmentId = value.environment;
|
|
93
|
+
setIsLoadingModels(true);
|
|
94
|
+
void client.environments
|
|
95
|
+
.retrieve(environmentId)
|
|
96
|
+
.then((environment) => {
|
|
97
|
+
if (cancelled) return;
|
|
98
|
+
setModels(
|
|
99
|
+
(environment.enabled_models ?? [])
|
|
100
|
+
.map((model) => ({ id: model.id, name: model.name || model.id }))
|
|
101
|
+
.sort((a, b) => a.name.localeCompare(b.name)),
|
|
102
|
+
);
|
|
103
|
+
})
|
|
104
|
+
.catch((err: unknown) => {
|
|
105
|
+
console.warn('Failed to load document editing models', err);
|
|
106
|
+
if (!cancelled) setModels([]);
|
|
107
|
+
})
|
|
108
|
+
.finally(() => {
|
|
109
|
+
if (!cancelled) setIsLoadingModels(false);
|
|
110
|
+
});
|
|
111
|
+
return () => {
|
|
112
|
+
cancelled = true;
|
|
113
|
+
};
|
|
114
|
+
}, [client, value.environment]);
|
|
115
|
+
|
|
116
|
+
const selectedEnvironment = environments.find((environment) => environment.id === value.environment);
|
|
117
|
+
const selectedModel = useMemo<ModelOption | undefined>(() => {
|
|
118
|
+
if (!value.model) return undefined;
|
|
119
|
+
return (
|
|
120
|
+
models.find((model) => model.id === value.model) ?? { id: value.model, name: shortModelName(value.model) }
|
|
121
|
+
);
|
|
122
|
+
}, [models, value.model]);
|
|
123
|
+
|
|
124
|
+
const selectEnvironment = (environment: ExecutionEnvironmentRef) => {
|
|
125
|
+
latestEnvironmentRequestRef.current = environment.id;
|
|
126
|
+
onChange({ environment: environment.id });
|
|
127
|
+
void client.environments
|
|
128
|
+
.retrieve(environment.id)
|
|
129
|
+
.then((details) => {
|
|
130
|
+
if (latestEnvironmentRequestRef.current !== environment.id) return;
|
|
131
|
+
const nextModel = details.default_model ?? details.enabled_models?.[0]?.id;
|
|
132
|
+
onChange({ environment: environment.id, model: nextModel });
|
|
133
|
+
})
|
|
134
|
+
.catch((err: unknown) => {
|
|
135
|
+
console.warn('Failed to select a default document editing model', err);
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const selectModel = (model: ModelOption) => {
|
|
140
|
+
latestEnvironmentRequestRef.current = undefined;
|
|
141
|
+
onChange({ environment: value.environment, model: model.id });
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const buttonLabel = selectedModel?.name || t('agent.documentEditingSelectModel');
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
<Popover>
|
|
148
|
+
<PopoverTrigger asChild>
|
|
149
|
+
<Button
|
|
150
|
+
type="button"
|
|
151
|
+
variant="ghost"
|
|
152
|
+
size="sm"
|
|
153
|
+
className="h-7 max-w-[15rem] gap-1.5 px-2 text-xs"
|
|
154
|
+
aria-label={t('agent.documentEditingConfiguration')}
|
|
155
|
+
title={t('agent.documentEditingConfiguration')}
|
|
156
|
+
>
|
|
157
|
+
{isLoading ? <Spinner size="sm" /> : <SlidersHorizontal className="size-3.5 shrink-0" />}
|
|
158
|
+
<span className="min-w-0 truncate">{buttonLabel}</span>
|
|
159
|
+
<ChevronDown className="size-3.5 shrink-0 opacity-70" />
|
|
160
|
+
</Button>
|
|
161
|
+
</PopoverTrigger>
|
|
162
|
+
<PopoverContent align="end" className="z-[1000000] w-80 space-y-3 p-3">
|
|
163
|
+
<div>
|
|
164
|
+
<div className="text-sm font-semibold text-foreground">
|
|
165
|
+
{t('agent.documentEditingConfiguration')}
|
|
166
|
+
</div>
|
|
167
|
+
<div className="mt-0.5 text-xs leading-4 text-muted">
|
|
168
|
+
{disabled
|
|
169
|
+
? t('agent.documentEditingConfigurationLocked')
|
|
170
|
+
: t('agent.documentEditingConfigurationDescription')}
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
<div className="space-y-1">
|
|
174
|
+
<label className="text-xs font-medium text-foreground" htmlFor="document-editing-environment">
|
|
175
|
+
{t('agent.environment')}
|
|
176
|
+
</label>
|
|
177
|
+
<SelectBox
|
|
178
|
+
id="document-editing-environment"
|
|
179
|
+
by="id"
|
|
180
|
+
options={environments}
|
|
181
|
+
value={selectedEnvironment}
|
|
182
|
+
optionLabel={environmentLabel}
|
|
183
|
+
filterBy="name"
|
|
184
|
+
placeholder={t('agent.documentEditingSelectEnvironment')}
|
|
185
|
+
onChange={selectEnvironment}
|
|
186
|
+
disabled={disabled}
|
|
187
|
+
isLoading={isLoadingEnvironments}
|
|
188
|
+
/>
|
|
189
|
+
</div>
|
|
190
|
+
<div className="space-y-1">
|
|
191
|
+
<label className="text-xs font-medium text-foreground" htmlFor="document-editing-model">
|
|
192
|
+
{t('agent.model')}
|
|
193
|
+
</label>
|
|
194
|
+
<SelectBox
|
|
195
|
+
id="document-editing-model"
|
|
196
|
+
by="id"
|
|
197
|
+
options={models}
|
|
198
|
+
value={selectedModel}
|
|
199
|
+
optionLabel={modelLabel}
|
|
200
|
+
filterBy="name"
|
|
201
|
+
placeholder={t('agent.documentEditingSelectModel')}
|
|
202
|
+
onChange={selectModel}
|
|
203
|
+
disabled={disabled || !value.environment}
|
|
204
|
+
isLoading={isLoadingModels}
|
|
205
|
+
warnOnMissingValue={false}
|
|
206
|
+
/>
|
|
207
|
+
</div>
|
|
208
|
+
</PopoverContent>
|
|
209
|
+
</Popover>
|
|
210
|
+
);
|
|
211
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** @vitest-environment jsdom */
|
|
2
|
+
|
|
3
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
4
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
5
|
+
import { I18nProvider } from '../../../../i18n/index.js';
|
|
6
|
+
import { DocumentEditingLockStatus } from './DocumentEditingLockStatus.js';
|
|
7
|
+
|
|
8
|
+
describe('DocumentEditingLockStatus', () => {
|
|
9
|
+
it('shows the active lock and exposes manual unlock', () => {
|
|
10
|
+
const onToggleLock = vi.fn();
|
|
11
|
+
render(
|
|
12
|
+
<I18nProvider lng="en">
|
|
13
|
+
<DocumentEditingLockStatus isLocked onToggleLock={onToggleLock} />
|
|
14
|
+
</I18nProvider>,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
expect(screen.getByRole('status').textContent).toContain('AI is editing the working copy');
|
|
18
|
+
fireEvent.click(screen.getByRole('button', { name: 'Unlock editing' }));
|
|
19
|
+
expect(onToggleLock).toHaveBeenCalledTimes(1);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('warns when editing was manually unlocked and offers relocking', () => {
|
|
23
|
+
render(
|
|
24
|
+
<I18nProvider lng="en">
|
|
25
|
+
<DocumentEditingLockStatus isLocked={false} onToggleLock={vi.fn()} />
|
|
26
|
+
</I18nProvider>,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
expect(screen.getByRole('alert').textContent).toContain('Editing manually unlocked');
|
|
30
|
+
expect(screen.getByRole('button', { name: 'Lock editing' })).not.toBeNull();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Button, VTooltip } from '@vertesia/ui/core';
|
|
2
|
+
import { useUITranslation } from '@vertesia/ui/i18n';
|
|
3
|
+
import { LockKeyhole, LockOpen } from 'lucide-react';
|
|
4
|
+
|
|
5
|
+
export interface DocumentEditingLockStatusProps {
|
|
6
|
+
isLocked: boolean;
|
|
7
|
+
onToggleLock: () => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Compact turn-level lock status for the full-document editor toolbar. */
|
|
11
|
+
export function DocumentEditingLockStatus({ isLocked, onToggleLock }: DocumentEditingLockStatusProps) {
|
|
12
|
+
const { t } = useUITranslation();
|
|
13
|
+
const title = isLocked ? t('agent.editingLockedTitle') : t('agent.editingManuallyUnlockedTitle');
|
|
14
|
+
const description = isLocked ? t('agent.editingLockedDescription') : t('agent.editingManuallyUnlockedDescription');
|
|
15
|
+
const action = isLocked ? t('agent.unlockEditing') : t('agent.lockEditing');
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div
|
|
19
|
+
className="flex h-8 max-w-64 shrink-0 items-center gap-1 rounded-md border border-mixer-attention/30 bg-mixer-attention/10 ps-2 pe-1 text-attention"
|
|
20
|
+
role={isLocked ? 'status' : 'alert'}
|
|
21
|
+
aria-live="polite"
|
|
22
|
+
>
|
|
23
|
+
{isLocked ? (
|
|
24
|
+
<LockKeyhole className="size-3.5 shrink-0 animate-pulse" />
|
|
25
|
+
) : (
|
|
26
|
+
<LockOpen className="size-3.5 shrink-0" />
|
|
27
|
+
)}
|
|
28
|
+
<VTooltip description={description} asChild>
|
|
29
|
+
<span className="min-w-0 truncate text-xs font-medium text-foreground">{title}</span>
|
|
30
|
+
</VTooltip>
|
|
31
|
+
<span className="sr-only">{description}</span>
|
|
32
|
+
<VTooltip description={action} asChild>
|
|
33
|
+
<Button
|
|
34
|
+
variant="ghost"
|
|
35
|
+
size="sm"
|
|
36
|
+
className="size-6 shrink-0 rounded p-0 text-attention hover:bg-mixer-attention/15"
|
|
37
|
+
onClick={onToggleLock}
|
|
38
|
+
aria-label={action}
|
|
39
|
+
>
|
|
40
|
+
{isLocked ? <LockOpen className="size-3.5" /> : <LockKeyhole className="size-3.5" />}
|
|
41
|
+
</Button>
|
|
42
|
+
</VTooltip>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/** @vitest-environment jsdom */
|
|
2
|
+
|
|
3
|
+
import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react';
|
|
4
|
+
import type { ContentObject, Project } from '@vertesia/common';
|
|
5
|
+
import type { ReactNode } from 'react';
|
|
6
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
7
|
+
import { I18nProvider } from '../../../../i18n/index.js';
|
|
8
|
+
import { type DocumentEditingModelConfiguration, DocumentEditingWorkspace } from './DocumentEditingPanel.js';
|
|
9
|
+
|
|
10
|
+
const mocks = vi.hoisted(() => {
|
|
11
|
+
const retrieveProject = vi.fn();
|
|
12
|
+
const startAgent = vi.fn();
|
|
13
|
+
return {
|
|
14
|
+
findRun: vi.fn(),
|
|
15
|
+
resolveTarget: vi.fn(),
|
|
16
|
+
retrieveProject,
|
|
17
|
+
startAgent,
|
|
18
|
+
session: {
|
|
19
|
+
client: {
|
|
20
|
+
agents: {
|
|
21
|
+
start: startAgent,
|
|
22
|
+
terminate: vi.fn(),
|
|
23
|
+
},
|
|
24
|
+
files: {},
|
|
25
|
+
projects: { retrieve: retrieveProject },
|
|
26
|
+
},
|
|
27
|
+
project: { id: 'project-1' },
|
|
28
|
+
store: { objects: {} },
|
|
29
|
+
user: { sub: 'user-1' },
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
vi.mock('@vertesia/ui/core', () => ({
|
|
35
|
+
Button: ({
|
|
36
|
+
children,
|
|
37
|
+
className,
|
|
38
|
+
disabled,
|
|
39
|
+
onClick,
|
|
40
|
+
type,
|
|
41
|
+
'aria-label': ariaLabel,
|
|
42
|
+
}: {
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
className?: string;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
onClick?: () => void;
|
|
47
|
+
type?: 'button' | 'submit' | 'reset';
|
|
48
|
+
'aria-label'?: string;
|
|
49
|
+
}) => (
|
|
50
|
+
<button
|
|
51
|
+
type={type ?? 'button'}
|
|
52
|
+
className={className}
|
|
53
|
+
disabled={disabled}
|
|
54
|
+
onClick={onClick}
|
|
55
|
+
aria-label={ariaLabel}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
</button>
|
|
59
|
+
),
|
|
60
|
+
Center: ({ children, className }: { children?: ReactNode; className?: string }) => (
|
|
61
|
+
<div className={className}>{children}</div>
|
|
62
|
+
),
|
|
63
|
+
ConfirmModal: () => null,
|
|
64
|
+
errorMessage: (_error: unknown, fallback: string) => fallback,
|
|
65
|
+
Modal: ({ children }: { children?: ReactNode }) => <div>{children}</div>,
|
|
66
|
+
ResizableHandle: () => <div />,
|
|
67
|
+
ResizablePanel: ({ children, className }: { children?: ReactNode; className?: string }) => (
|
|
68
|
+
<div className={className}>{children}</div>
|
|
69
|
+
),
|
|
70
|
+
ResizablePanelGroup: ({ children, className }: { children?: ReactNode; className?: string }) => (
|
|
71
|
+
<div className={className}>{children}</div>
|
|
72
|
+
),
|
|
73
|
+
Spinner: () => <span>Loading</span>,
|
|
74
|
+
useToast: () => vi.fn(),
|
|
75
|
+
VTooltip: ({ children }: { children?: ReactNode }) => <>{children}</>,
|
|
76
|
+
}));
|
|
77
|
+
|
|
78
|
+
vi.mock('@vertesia/ui/session', () => ({
|
|
79
|
+
useUserSession: () => mocks.session,
|
|
80
|
+
}));
|
|
81
|
+
|
|
82
|
+
vi.mock('@vertesia/ui/widgets', () => ({
|
|
83
|
+
ArtifactEditingSurface: () => <div data-testid="artifact-editing-surface" />,
|
|
84
|
+
createUnifiedLineDiff: vi.fn(() => ''),
|
|
85
|
+
diffTextSegments: vi.fn(() => []),
|
|
86
|
+
isArtifactRefreshEvent: vi.fn(() => false),
|
|
87
|
+
}));
|
|
88
|
+
|
|
89
|
+
vi.mock('../../../agent/chat/ModernAgentConversation.js', () => ({
|
|
90
|
+
ModernAgentConversation: ({ agentRunId }: { agentRunId?: string }) => (
|
|
91
|
+
<div data-testid="agent-conversation" data-agent-run-id={agentRunId} />
|
|
92
|
+
),
|
|
93
|
+
}));
|
|
94
|
+
|
|
95
|
+
vi.mock('./DocumentEditingConfigurationSelector.js', () => ({
|
|
96
|
+
DocumentEditingConfigurationSelector: ({
|
|
97
|
+
value,
|
|
98
|
+
}: {
|
|
99
|
+
value: { environment?: string; model?: string; model_options?: Record<string, unknown> };
|
|
100
|
+
}) => (
|
|
101
|
+
<div
|
|
102
|
+
data-testid="editing-configuration"
|
|
103
|
+
data-environment={value.environment}
|
|
104
|
+
data-model={value.model}
|
|
105
|
+
data-model-options={JSON.stringify(value.model_options)}
|
|
106
|
+
/>
|
|
107
|
+
),
|
|
108
|
+
getDocumentEditingProjectDefault: (project: Pick<Project, 'configuration'>) => {
|
|
109
|
+
const defaults = project.configuration?.defaults?.system?.agent ?? project.configuration?.defaults?.base;
|
|
110
|
+
return { environment: defaults?.environment, model: defaults?.model };
|
|
111
|
+
},
|
|
112
|
+
}));
|
|
113
|
+
|
|
114
|
+
vi.mock('./documentEditingRun.js', () => ({
|
|
115
|
+
DOCUMENT_EDITING_DEFAULT_INTERACTION: 'sys:conversation',
|
|
116
|
+
createDocumentEditingRunIdentity: () => ({ tags: ['document-editing'], properties: {} }),
|
|
117
|
+
findDocumentEditingRun: mocks.findRun,
|
|
118
|
+
}));
|
|
119
|
+
|
|
120
|
+
vi.mock('./documentEditingTarget.js', () => ({
|
|
121
|
+
resolveDocumentEditingTarget: mocks.resolveTarget,
|
|
122
|
+
}));
|
|
123
|
+
|
|
124
|
+
vi.mock('./SaveVersionConfirmModal.js', () => ({
|
|
125
|
+
SaveVersionConfirmModal: () => null,
|
|
126
|
+
}));
|
|
127
|
+
|
|
128
|
+
const object = {
|
|
129
|
+
id: 'document-1',
|
|
130
|
+
name: 'Editing test',
|
|
131
|
+
content: {
|
|
132
|
+
etag: 'etag-1',
|
|
133
|
+
name: 'document.md',
|
|
134
|
+
type: 'text/markdown',
|
|
135
|
+
},
|
|
136
|
+
} as unknown as ContentObject;
|
|
137
|
+
|
|
138
|
+
function renderWorkspace(props?: { model?: DocumentEditingModelConfiguration; startImmediately?: boolean }) {
|
|
139
|
+
return render(
|
|
140
|
+
<I18nProvider lng="en">
|
|
141
|
+
<DocumentEditingWorkspace object={object} initialContent="# Editing test" {...props} />
|
|
142
|
+
</I18nProvider>,
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
describe('DocumentEditingWorkspace startup configuration', () => {
|
|
147
|
+
beforeEach(() => {
|
|
148
|
+
vi.clearAllMocks();
|
|
149
|
+
mocks.findRun.mockResolvedValue(undefined);
|
|
150
|
+
mocks.resolveTarget.mockResolvedValue({ id: 'document-1', etag: 'etag-1', content: '# Editing test' });
|
|
151
|
+
mocks.retrieveProject.mockResolvedValue({
|
|
152
|
+
configuration: {
|
|
153
|
+
defaults: {
|
|
154
|
+
system: { agent: { environment: 'project-environment', model: 'project-model' } },
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
mocks.startAgent.mockResolvedValue({ id: 'run-1' });
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
afterEach(cleanup);
|
|
162
|
+
|
|
163
|
+
it('starts immediately with the host-provided model configuration', async () => {
|
|
164
|
+
renderWorkspace({
|
|
165
|
+
model: {
|
|
166
|
+
env: 'app-environment',
|
|
167
|
+
model: 'app-model',
|
|
168
|
+
options: { _option_id: 'openai-text', temperature: 0.2 },
|
|
169
|
+
},
|
|
170
|
+
startImmediately: true,
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
await waitFor(() => expect(mocks.startAgent).toHaveBeenCalledTimes(1));
|
|
174
|
+
|
|
175
|
+
expect(mocks.retrieveProject).not.toHaveBeenCalled();
|
|
176
|
+
expect(mocks.startAgent.mock.calls[0]?.[0]).toMatchObject({
|
|
177
|
+
config: {
|
|
178
|
+
environment: 'app-environment',
|
|
179
|
+
model: 'app-model',
|
|
180
|
+
model_options: { _option_id: 'openai-text', temperature: 0.2 },
|
|
181
|
+
},
|
|
182
|
+
interaction: 'sys:conversation',
|
|
183
|
+
tool_approval_mode: 'full_control',
|
|
184
|
+
});
|
|
185
|
+
expect((await screen.findByTestId('agent-conversation')).getAttribute('data-agent-run-id')).toBe('run-1');
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it('keeps startup manual when startImmediately is omitted', async () => {
|
|
189
|
+
renderWorkspace({
|
|
190
|
+
model: {
|
|
191
|
+
env: 'app-environment',
|
|
192
|
+
model: 'app-model',
|
|
193
|
+
options: { _option_id: 'openai-text', temperature: 0.2 },
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
const startButton = await screen.findByRole('button', { name: 'Start editing' });
|
|
198
|
+
await waitFor(() => expect((startButton as HTMLButtonElement).disabled).toBe(false));
|
|
199
|
+
expect(mocks.startAgent).not.toHaveBeenCalled();
|
|
200
|
+
|
|
201
|
+
fireEvent.click(startButton);
|
|
202
|
+
|
|
203
|
+
await waitFor(() => expect(mocks.startAgent).toHaveBeenCalledTimes(1));
|
|
204
|
+
expect(mocks.startAgent.mock.calls[0]?.[0]).toMatchObject({
|
|
205
|
+
config: {
|
|
206
|
+
environment: 'app-environment',
|
|
207
|
+
model: 'app-model',
|
|
208
|
+
model_options: { _option_id: 'openai-text', temperature: 0.2 },
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it('uses project defaults when the host does not provide a model configuration', async () => {
|
|
214
|
+
renderWorkspace();
|
|
215
|
+
|
|
216
|
+
const startButton = await screen.findByRole('button', { name: 'Start editing' });
|
|
217
|
+
await waitFor(() => expect((startButton as HTMLButtonElement).disabled).toBe(false));
|
|
218
|
+
|
|
219
|
+
expect(mocks.retrieveProject).toHaveBeenCalledWith('project-1');
|
|
220
|
+
expect(screen.getByTestId('editing-configuration').getAttribute('data-environment')).toBe(
|
|
221
|
+
'project-environment',
|
|
222
|
+
);
|
|
223
|
+
expect(screen.getByTestId('editing-configuration').getAttribute('data-model')).toBe('project-model');
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
it('does not duplicate automatic startup for equivalent inline model objects', async () => {
|
|
227
|
+
let resolveStart: ((run: { id: string }) => void) | undefined;
|
|
228
|
+
mocks.startAgent.mockImplementation(
|
|
229
|
+
() =>
|
|
230
|
+
new Promise<{ id: string }>((resolve) => {
|
|
231
|
+
resolveStart = resolve;
|
|
232
|
+
}),
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
const firstProps = {
|
|
236
|
+
model: {
|
|
237
|
+
env: 'app-environment',
|
|
238
|
+
model: 'app-model',
|
|
239
|
+
options: { _option_id: 'openai-text' as const, temperature: 0.2 },
|
|
240
|
+
},
|
|
241
|
+
startImmediately: true,
|
|
242
|
+
};
|
|
243
|
+
const view = renderWorkspace(firstProps);
|
|
244
|
+
|
|
245
|
+
await waitFor(() => expect(mocks.startAgent).toHaveBeenCalledTimes(1));
|
|
246
|
+
|
|
247
|
+
view.rerender(
|
|
248
|
+
<I18nProvider lng="en">
|
|
249
|
+
<DocumentEditingWorkspace
|
|
250
|
+
object={object}
|
|
251
|
+
initialContent="# Editing test"
|
|
252
|
+
model={{
|
|
253
|
+
env: 'app-environment',
|
|
254
|
+
model: 'app-model',
|
|
255
|
+
options: { _option_id: 'openai-text', temperature: 0.2 },
|
|
256
|
+
}}
|
|
257
|
+
startImmediately
|
|
258
|
+
/>
|
|
259
|
+
</I18nProvider>,
|
|
260
|
+
);
|
|
261
|
+
await waitFor(() => expect(mocks.startAgent).toHaveBeenCalledTimes(1));
|
|
262
|
+
|
|
263
|
+
resolveStart?.({ id: 'run-1' });
|
|
264
|
+
await waitFor(() =>
|
|
265
|
+
expect(screen.getByTestId('agent-conversation').getAttribute('data-agent-run-id')).toBe('run-1'),
|
|
266
|
+
);
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
it('uses changed model options as a new automatic-start identity', async () => {
|
|
270
|
+
mocks.startAgent.mockRejectedValueOnce(new Error('temporary failure')).mockResolvedValueOnce({ id: 'run-2' });
|
|
271
|
+
const view = renderWorkspace({
|
|
272
|
+
model: {
|
|
273
|
+
env: 'app-environment',
|
|
274
|
+
model: 'app-model',
|
|
275
|
+
options: { _option_id: 'openai-text', temperature: 0.2 },
|
|
276
|
+
},
|
|
277
|
+
startImmediately: true,
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
await waitFor(() => expect(mocks.startAgent).toHaveBeenCalledTimes(1));
|
|
281
|
+
|
|
282
|
+
view.rerender(
|
|
283
|
+
<I18nProvider lng="en">
|
|
284
|
+
<DocumentEditingWorkspace
|
|
285
|
+
object={object}
|
|
286
|
+
initialContent="# Editing test"
|
|
287
|
+
model={{
|
|
288
|
+
env: 'app-environment',
|
|
289
|
+
model: 'app-model',
|
|
290
|
+
options: { _option_id: 'openai-text', temperature: 0.4 },
|
|
291
|
+
}}
|
|
292
|
+
startImmediately
|
|
293
|
+
/>
|
|
294
|
+
</I18nProvider>,
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
await waitFor(() => expect(mocks.startAgent).toHaveBeenCalledTimes(2));
|
|
298
|
+
expect(mocks.startAgent.mock.calls[1]?.[0]).toMatchObject({
|
|
299
|
+
config: {
|
|
300
|
+
environment: 'app-environment',
|
|
301
|
+
model: 'app-model',
|
|
302
|
+
model_options: { _option_id: 'openai-text', temperature: 0.4 },
|
|
303
|
+
},
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
it('restores model options when reattaching to an existing run', async () => {
|
|
308
|
+
mocks.findRun.mockResolvedValue({
|
|
309
|
+
id: 'existing-run',
|
|
310
|
+
config: {
|
|
311
|
+
environment: 'run-environment',
|
|
312
|
+
model: 'run-model',
|
|
313
|
+
model_options: { _option_id: 'openai-text', temperature: 0.2 },
|
|
314
|
+
},
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
renderWorkspace({
|
|
318
|
+
model: {
|
|
319
|
+
env: 'host-environment',
|
|
320
|
+
model: 'host-model',
|
|
321
|
+
options: { _option_id: 'openai-text', temperature: 0.4 },
|
|
322
|
+
},
|
|
323
|
+
startImmediately: true,
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
await waitFor(() =>
|
|
327
|
+
expect(screen.getByTestId('agent-conversation').getAttribute('data-agent-run-id')).toBe('existing-run'),
|
|
328
|
+
);
|
|
329
|
+
expect(mocks.startAgent).not.toHaveBeenCalled();
|
|
330
|
+
expect(screen.getByTestId('editing-configuration').getAttribute('data-environment')).toBe('run-environment');
|
|
331
|
+
expect(screen.getByTestId('editing-configuration').getAttribute('data-model')).toBe('run-model');
|
|
332
|
+
expect(screen.getByTestId('editing-configuration').getAttribute('data-model-options')).toBe(
|
|
333
|
+
JSON.stringify({ _option_id: 'openai-text', temperature: 0.2 }),
|
|
334
|
+
);
|
|
335
|
+
});
|
|
336
|
+
});
|