@vertesia/ui 1.4.0-dev.20260615.051508Z → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/components/shadcn/dropdown.d.ts.map +1 -1
- package/lib/core/components/shadcn/dropdown.js +6 -2
- package/lib/core/components/shadcn/dropdown.js.map +1 -1
- package/lib/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
- package/lib/core/components/shadcn/filters/filterBar.js +9 -2
- package/lib/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/core/components/shadcn/modal/ConfirmModal.d.ts +16 -1
- package/lib/core/components/shadcn/modal/ConfirmModal.d.ts.map +1 -1
- package/lib/core/components/shadcn/modal/ConfirmModal.js +25 -3
- package/lib/core/components/shadcn/modal/ConfirmModal.js.map +1 -1
- package/lib/core/components/shadcn/modal/dialog.js +1 -1
- package/lib/core/components/shadcn/modal/dialog.js.map +1 -1
- package/lib/core/components/shadcn/popover.d.ts.map +1 -1
- package/lib/core/components/shadcn/popover.js +3 -1
- package/lib/core/components/shadcn/popover.js.map +1 -1
- package/lib/core/components/shadcn/switch.js +3 -3
- package/lib/core/components/shadcn/switch.js.map +1 -1
- package/lib/core/components/shadcn/tabs.js +1 -1
- package/lib/core/components/shadcn/tabs.js.map +1 -1
- package/lib/core/components/shadcn/tooltip.d.ts.map +1 -1
- package/lib/core/components/shadcn/tooltip.js +3 -1
- package/lib/core/components/shadcn/tooltip.js.map +1 -1
- package/lib/env/index.d.ts +0 -19
- package/lib/env/index.d.ts.map +1 -1
- package/lib/env/index.js +0 -6
- package/lib/env/index.js.map +1 -1
- package/lib/features/agent/PayloadBuilder.d.ts +4 -0
- package/lib/features/agent/PayloadBuilder.d.ts.map +1 -1
- package/lib/features/agent/PayloadBuilder.js +16 -0
- package/lib/features/agent/PayloadBuilder.js.map +1 -1
- package/lib/features/agent/chat/AgentApprovalModeSelector.d.ts +10 -0
- package/lib/features/agent/chat/AgentApprovalModeSelector.d.ts.map +1 -0
- package/lib/features/agent/chat/AgentApprovalModeSelector.js +50 -0
- package/lib/features/agent/chat/AgentApprovalModeSelector.js.map +1 -0
- package/lib/features/agent/chat/AgentChatFixtureReplay.d.ts +2 -1
- package/lib/features/agent/chat/AgentChatFixtureReplay.d.ts.map +1 -1
- package/lib/features/agent/chat/AgentChatFixtureReplay.js +3 -3
- package/lib/features/agent/chat/AgentChatFixtureReplay.js.map +1 -1
- package/lib/features/agent/chat/AgentRequestInputOverlay.d.ts +5 -2
- package/lib/features/agent/chat/AgentRequestInputOverlay.d.ts.map +1 -1
- package/lib/features/agent/chat/AgentRequestInputOverlay.js +41 -7
- package/lib/features/agent/chat/AgentRequestInputOverlay.js.map +1 -1
- package/lib/features/agent/chat/AgentRightPanel.d.ts.map +1 -1
- package/lib/features/agent/chat/AgentRightPanel.js +133 -12
- package/lib/features/agent/chat/AgentRightPanel.js.map +1 -1
- package/lib/features/agent/chat/AnimatedThinkingDots.js +1 -1
- package/lib/features/agent/chat/AnimatedThinkingDots.js.map +1 -1
- package/lib/features/agent/chat/ArtifactsTab.d.ts.map +1 -1
- package/lib/features/agent/chat/ArtifactsTab.js +11 -65
- package/lib/features/agent/chat/ArtifactsTab.js.map +1 -1
- package/lib/features/agent/chat/AskUserWidget.d.ts +3 -1
- package/lib/features/agent/chat/AskUserWidget.d.ts.map +1 -1
- package/lib/features/agent/chat/AskUserWidget.js +4 -3
- package/lib/features/agent/chat/AskUserWidget.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentConversation.d.ts +10 -2
- package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentConversation.js +526 -117
- package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.d.ts +8 -0
- package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.js +19 -0
- package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +8 -2
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +551 -92
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js +7 -6
- package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/Header.js +2 -2
- package/lib/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.d.ts +8 -0
- package/lib/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.js +61 -0
- package/lib/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +15 -2
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js +28 -38
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +3 -2
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/SlideInPanel.js +2 -1
- package/lib/features/agent/chat/ModernAgentOutput/SlideInPanel.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/SlidingMessages.js +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/SlidingMessages.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.d.ts +5 -0
- package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js +59 -4
- package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +2 -2
- package/lib/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts +9 -0
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js +180 -0
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts +6 -0
- package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/utils.js +92 -2
- package/lib/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
- package/lib/features/agent/chat/clipboardFiles.d.ts +15 -0
- package/lib/features/agent/chat/clipboardFiles.d.ts.map +1 -0
- package/lib/features/agent/chat/clipboardFiles.js +35 -0
- package/lib/features/agent/chat/clipboardFiles.js.map +1 -0
- package/lib/features/agent/chat/hooks/useAgentStream.d.ts +6 -0
- package/lib/features/agent/chat/hooks/useAgentStream.d.ts.map +1 -1
- package/lib/features/agent/chat/hooks/useAgentStream.js +218 -37
- package/lib/features/agent/chat/hooks/useAgentStream.js.map +1 -1
- package/lib/features/agent/chat/hooks/useArtifacts.d.ts +1 -8
- package/lib/features/agent/chat/hooks/useArtifacts.d.ts.map +1 -1
- package/lib/features/agent/chat/hooks/useArtifacts.js +10 -28
- package/lib/features/agent/chat/hooks/useArtifacts.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 +2 -1
- package/lib/features/agent/chat/index.js.map +1 -1
- package/lib/features/agent/chat/workstreams.d.ts +1 -0
- package/lib/features/agent/chat/workstreams.d.ts.map +1 -1
- package/lib/features/agent/chat/workstreams.js +28 -0
- package/lib/features/agent/chat/workstreams.js.map +1 -1
- package/lib/features/facets/AgentRunnerFacetsNav.d.ts +10 -1
- package/lib/features/facets/AgentRunnerFacetsNav.d.ts.map +1 -1
- package/lib/features/facets/AgentRunnerFacetsNav.js +6 -3
- package/lib/features/facets/AgentRunnerFacetsNav.js.map +1 -1
- package/lib/features/facets/CollectionsFacetsNav.d.ts +10 -1
- package/lib/features/facets/CollectionsFacetsNav.d.ts.map +1 -1
- package/lib/features/facets/CollectionsFacetsNav.js +14 -5
- package/lib/features/facets/CollectionsFacetsNav.js.map +1 -1
- package/lib/features/facets/PromptsFacetsNav.d.ts +10 -1
- package/lib/features/facets/PromptsFacetsNav.d.ts.map +1 -1
- package/lib/features/facets/PromptsFacetsNav.js +14 -5
- package/lib/features/facets/PromptsFacetsNav.js.map +1 -1
- package/lib/features/facets/RunsFacetsNav.d.ts +10 -1
- package/lib/features/facets/RunsFacetsNav.d.ts.map +1 -1
- package/lib/features/facets/RunsFacetsNav.js +14 -5
- package/lib/features/facets/RunsFacetsNav.js.map +1 -1
- package/lib/features/index.d.ts +0 -1
- package/lib/features/index.d.ts.map +1 -1
- package/lib/features/index.js +0 -1
- package/lib/features/index.js.map +1 -1
- package/lib/features/oauth/McpConnectionsButton.d.ts +30 -0
- package/lib/features/oauth/McpConnectionsButton.d.ts.map +1 -0
- package/lib/features/oauth/McpConnectionsButton.js +70 -0
- package/lib/features/oauth/McpConnectionsButton.js.map +1 -0
- package/lib/features/oauth/McpConnectionsDialog.d.ts +25 -0
- package/lib/features/oauth/McpConnectionsDialog.d.ts.map +1 -0
- package/lib/features/oauth/McpConnectionsDialog.js +26 -0
- package/lib/features/oauth/McpConnectionsDialog.js.map +1 -0
- package/lib/features/oauth/RemoteMcpConnectionButton.d.ts.map +1 -1
- package/lib/features/oauth/RemoteMcpConnectionButton.js +14 -6
- package/lib/features/oauth/RemoteMcpConnectionButton.js.map +1 -1
- package/lib/features/oauth/index.d.ts +3 -0
- package/lib/features/oauth/index.d.ts.map +1 -1
- package/lib/features/oauth/index.js +3 -0
- package/lib/features/oauth/index.js.map +1 -1
- package/lib/features/oauth/useMcpConnections.d.ts +44 -0
- package/lib/features/oauth/useMcpConnections.d.ts.map +1 -0
- package/lib/features/oauth/useMcpConnections.js +168 -0
- package/lib/features/oauth/useMcpConnections.js.map +1 -0
- package/lib/features/permissions/UserPermissionsProvider.d.ts +4 -6
- package/lib/features/permissions/UserPermissionsProvider.d.ts.map +1 -1
- package/lib/features/permissions/UserPermissionsProvider.js +40 -42
- package/lib/features/permissions/UserPermissionsProvider.js.map +1 -1
- package/lib/features/store/objects/DocumentPreviewPanel.d.ts.map +1 -1
- package/lib/features/store/objects/DocumentPreviewPanel.js +2 -1
- package/lib/features/store/objects/DocumentPreviewPanel.js.map +1 -1
- package/lib/features/store/objects/DocumentQuickFilter.d.ts +23 -0
- package/lib/features/store/objects/DocumentQuickFilter.d.ts.map +1 -0
- package/lib/features/store/objects/DocumentQuickFilter.js +30 -0
- package/lib/features/store/objects/DocumentQuickFilter.js.map +1 -0
- package/lib/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
- package/lib/features/store/objects/DocumentSearchResults.js +17 -1
- package/lib/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/features/store/objects/components/ContentOverview.d.ts.map +1 -1
- package/lib/features/store/objects/components/ContentOverview.js +17 -74
- package/lib/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/features/store/objects/layout/DocumentTableColumn.d.ts +7 -1
- package/lib/features/store/objects/layout/DocumentTableColumn.d.ts.map +1 -1
- package/lib/features/store/objects/layout/DocumentTableColumn.js +27 -3
- package/lib/features/store/objects/layout/DocumentTableColumn.js.map +1 -1
- package/lib/features/store/objects/layout/documentLayout.js +1 -1
- package/lib/features/store/objects/layout/renderers.d.ts +2 -1
- package/lib/features/store/objects/layout/renderers.d.ts.map +1 -1
- package/lib/features/store/objects/layout/renderers.js +27 -20
- package/lib/features/store/objects/layout/renderers.js.map +1 -1
- package/lib/features/store/types/ContentObjectTypesSearch.d.ts.map +1 -1
- package/lib/features/store/types/ContentObjectTypesSearch.js +4 -1
- package/lib/features/store/types/ContentObjectTypesSearch.js.map +1 -1
- package/lib/features/store/types/ContentObjectTypesTable.d.ts +2 -1
- package/lib/features/store/types/ContentObjectTypesTable.d.ts.map +1 -1
- package/lib/features/store/types/ContentObjectTypesTable.js +8 -3
- package/lib/features/store/types/ContentObjectTypesTable.js.map +1 -1
- package/lib/i18n/instance.d.ts.map +1 -1
- package/lib/i18n/instance.js +1 -0
- package/lib/i18n/instance.js.map +1 -1
- package/lib/i18n/locales/ar.json +72 -45
- package/lib/i18n/locales/de.json +65 -34
- package/lib/i18n/locales/en.json +63 -47
- package/lib/i18n/locales/es.json +65 -35
- package/lib/i18n/locales/fr.json +65 -35
- package/lib/i18n/locales/it.json +72 -42
- package/lib/i18n/locales/ja.json +72 -41
- package/lib/i18n/locales/ko.json +72 -41
- package/lib/i18n/locales/pt.json +72 -42
- package/lib/i18n/locales/ru.json +72 -43
- package/lib/i18n/locales/tr.json +72 -41
- package/lib/i18n/locales/zh-TW.json +72 -41
- package/lib/i18n/locales/zh.json +72 -41
- package/lib/session/UserSession.d.ts +0 -6
- package/lib/session/UserSession.d.ts.map +1 -1
- package/lib/session/UserSession.js +0 -15
- package/lib/session/UserSession.js.map +1 -1
- package/lib/session/UserSessionProvider.d.ts.map +1 -1
- package/lib/session/UserSessionProvider.js +39 -98
- package/lib/session/UserSessionProvider.js.map +1 -1
- package/lib/session/auth/composable.d.ts.map +1 -1
- package/lib/session/auth/composable.js +3 -33
- package/lib/session/auth/composable.js.map +1 -1
- package/lib/shell/login/SignInPrimitives.d.ts.map +1 -1
- package/lib/shell/login/SignInPrimitives.js +3 -2
- package/lib/shell/login/SignInPrimitives.js.map +1 -1
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-env.js +1 -1
- package/lib/vertesia-ui-env.js.map +1 -1
- package/lib/vertesia-ui-features.js +1 -1
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-i18n.js +1 -1
- package/lib/vertesia-ui-i18n.js.map +1 -1
- package/lib/vertesia-ui-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-shell.js +1 -1
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/lib/widgets/schema-editor/editor/Editable.js +1 -1
- package/lib/widgets/schema-editor/editor/Editable.js.map +1 -1
- package/llms.txt +70 -70
- package/package.json +35 -32
- package/src/core/components/shadcn/dropdown.tsx +2 -0
- package/src/core/components/shadcn/filters/filterBar.tsx +9 -2
- package/src/core/components/shadcn/modal/ConfirmModal.tsx +65 -3
- package/src/core/components/shadcn/modal/dialog.tsx +1 -1
- package/src/core/components/shadcn/popover.tsx +1 -0
- package/src/core/components/shadcn/switch.tsx +4 -4
- package/src/core/components/shadcn/tabs.tsx +1 -1
- package/src/core/components/shadcn/tooltip.tsx +1 -0
- package/src/env/index.ts +0 -24
- package/src/features/agent/PayloadBuilder.tsx +18 -0
- package/src/features/agent/chat/AgentApprovalModeSelector.tsx +130 -0
- package/src/features/agent/chat/AgentChatFixtureReplay.test.tsx +22 -2
- package/src/features/agent/chat/AgentChatFixtureReplay.tsx +33 -27
- package/src/features/agent/chat/AgentRequestInputOverlay.test.tsx +122 -0
- package/src/features/agent/chat/AgentRequestInputOverlay.tsx +91 -17
- package/src/features/agent/chat/AgentRightPanel.tsx +238 -50
- package/src/features/agent/chat/AnimatedThinkingDots.tsx +1 -1
- package/src/features/agent/chat/ArtifactsTab.tsx +21 -155
- package/src/features/agent/chat/AskUserWidget.tsx +6 -2
- package/src/features/agent/chat/ModernAgentConversation.test.tsx +1157 -47
- package/src/features/agent/chat/ModernAgentConversation.tsx +703 -136
- package/src/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.tsx +74 -0
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +1420 -126
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +934 -111
- package/src/features/agent/chat/ModernAgentOutput/AttachmentPreview.tsx +31 -40
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +28 -28
- package/src/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.tsx +83 -0
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.test.tsx +38 -2
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +121 -98
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +7 -1
- package/src/features/agent/chat/ModernAgentOutput/SlideInPanel.tsx +3 -3
- package/src/features/agent/chat/ModernAgentOutput/SlidingMessages.tsx +1 -1
- package/src/features/agent/chat/ModernAgentOutput/SummaryConversation.ts +82 -2
- package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +2 -2
- package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.ts +216 -0
- package/src/features/agent/chat/ModernAgentOutput/utils.test.ts +149 -0
- package/src/features/agent/chat/ModernAgentOutput/utils.ts +103 -2
- package/src/features/agent/chat/clipboardFiles.ts +33 -0
- package/src/features/agent/chat/hooks/useAgentStream.test.tsx +355 -4
- package/src/features/agent/chat/hooks/useAgentStream.ts +270 -43
- package/src/features/agent/chat/hooks/useArtifacts.ts +11 -44
- package/src/features/agent/chat/index.ts +10 -1
- package/src/features/agent/chat/workstreams.ts +42 -0
- package/src/features/facets/AgentRunnerFacetsNav.tsx +23 -3
- package/src/features/facets/CollectionsFacetsNav.tsx +30 -5
- package/src/features/facets/PromptsFacetsNav.tsx +30 -5
- package/src/features/facets/RunsFacetsNav.tsx +32 -5
- package/src/features/index.ts +0 -1
- package/src/features/oauth/McpConnectionsButton.test.tsx +248 -0
- package/src/features/oauth/McpConnectionsButton.tsx +269 -0
- package/src/features/oauth/McpConnectionsDialog.tsx +142 -0
- package/src/features/oauth/RemoteMcpConnectionButton.tsx +37 -14
- package/src/features/oauth/index.ts +3 -0
- package/src/features/oauth/useMcpConnections.test.ts +94 -0
- package/src/features/oauth/useMcpConnections.ts +210 -0
- package/src/features/permissions/UserPermissionsProvider.tsx +41 -59
- package/src/features/store/objects/DocumentPreviewPanel.tsx +4 -2
- package/src/features/store/objects/DocumentQuickFilter.tsx +72 -0
- package/src/features/store/objects/DocumentSearchResults.tsx +30 -11
- package/src/features/store/objects/components/ContentOverview.tsx +30 -99
- package/src/features/store/objects/layout/DocumentTableColumn.tsx +29 -4
- package/src/features/store/objects/layout/documentLayout.tsx +1 -1
- package/src/features/store/objects/layout/renderers.tsx +80 -20
- package/src/features/store/types/ContentObjectTypesSearch.tsx +7 -1
- package/src/features/store/types/ContentObjectTypesTable.tsx +34 -4
- package/src/i18n/instance.ts +1 -0
- package/src/i18n/locales/ar.json +72 -45
- package/src/i18n/locales/de.json +65 -34
- package/src/i18n/locales/en.json +63 -47
- package/src/i18n/locales/es.json +65 -35
- package/src/i18n/locales/fr.json +65 -35
- package/src/i18n/locales/it.json +72 -42
- package/src/i18n/locales/ja.json +72 -41
- package/src/i18n/locales/ko.json +72 -41
- package/src/i18n/locales/pt.json +72 -42
- package/src/i18n/locales/ru.json +72 -43
- package/src/i18n/locales/tr.json +72 -41
- package/src/i18n/locales/zh-TW.json +72 -41
- package/src/i18n/locales/zh.json +72 -41
- package/src/i18n/rtl.test.ts +57 -1
- package/src/session/UserSession.ts +0 -16
- package/src/session/UserSessionProvider.tsx +51 -123
- package/src/session/auth/composable.ts +3 -34
- package/src/shell/login/SignInPrimitives.tsx +3 -2
- package/src/widgets/schema-editor/editor/Editable.tsx +1 -1
- package/lib/features/document-viewer/UniversalDocumentViewer.d.ts +0 -73
- package/lib/features/document-viewer/UniversalDocumentViewer.d.ts.map +0 -1
- package/lib/features/document-viewer/UniversalDocumentViewer.js +0 -415
- package/lib/features/document-viewer/UniversalDocumentViewer.js.map +0 -1
- package/lib/features/document-viewer/index.d.ts +0 -2
- package/lib/features/document-viewer/index.d.ts.map +0 -1
- package/lib/features/document-viewer/index.js +0 -2
- package/lib/features/document-viewer/index.js.map +0 -1
- package/src/features/document-viewer/UniversalDocumentViewer.test.tsx +0 -123
- package/src/features/document-viewer/UniversalDocumentViewer.tsx +0 -746
- package/src/features/document-viewer/index.ts +0 -1
- package/src/session/auth/composable.test.ts +0 -79
|
@@ -30,6 +30,8 @@ export default function SlideInPanel({ isOpen, onClose, title, children, width =
|
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
const panelTranslateClass = isOpen ? 'translate-x-0' : 'translate-x-full rtl:-translate-x-full'; // rtl-ok: mirrored inline-end transform
|
|
34
|
+
|
|
33
35
|
return (
|
|
34
36
|
<>
|
|
35
37
|
{/* Backdrop overlay */}
|
|
@@ -46,9 +48,7 @@ export default function SlideInPanel({ isOpen, onClose, title, children, width =
|
|
|
46
48
|
|
|
47
49
|
{/* Slide-in panel */}
|
|
48
50
|
<div
|
|
49
|
-
className={`fixed top-0 end-0 bottom-0 z-50 bg-white dark:bg-gray-900 shadow-lg border-s border-gray-200 dark:border-gray-800 transition-transform duration-300 ease-in-out ${
|
|
50
|
-
isOpen ? 'translate-x-0' : 'translate-x-full rtl:-translate-x-full'
|
|
51
|
-
}`}
|
|
51
|
+
className={`fixed top-0 end-0 bottom-0 z-50 bg-white dark:bg-gray-900 shadow-lg border-s border-gray-200 dark:border-gray-800 transition-transform duration-300 ease-in-out ${panelTranslateClass}`}
|
|
52
52
|
style={{ width }}
|
|
53
53
|
>
|
|
54
54
|
{/* Header */}
|
|
@@ -82,7 +82,7 @@ export default function SlidingMessages({ messages, isCompleted }: SlidingMessag
|
|
|
82
82
|
{/* If no messages and not completed, show a placeholder thinking message */}
|
|
83
83
|
{messages.length === 0 && !isCompleted && (
|
|
84
84
|
<div className="flex items-center justify-center flex-1 text-center py-8">
|
|
85
|
-
<div className="flex items-center
|
|
85
|
+
<div className="flex items-center gap-3 bg-blue-50 rounded-lg border border-blue-100 px-4 py-3">
|
|
86
86
|
<div className="text-sm text-blue-700 font-medium">
|
|
87
87
|
{ThinkingMessages[thinkingMessageIndex]}
|
|
88
88
|
</div>
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import { type AgentMessage, AgentMessageType } from '@vertesia/common';
|
|
2
2
|
import {
|
|
3
|
+
getWorkstreamActivityDetails,
|
|
3
4
|
getWorkstreamLaunchDetails,
|
|
4
5
|
isWorkstreamInternalResultMessage,
|
|
5
6
|
isWorkstreamInternalResultText,
|
|
6
7
|
} from '../workstreams.js';
|
|
8
|
+
import { isToolApprovalRequestInput } from './requestInputMessages';
|
|
7
9
|
import {
|
|
8
10
|
isStreamReplacedByMessage,
|
|
9
11
|
isToolActivityMessage,
|
|
10
12
|
isToolPreambleMessage,
|
|
13
|
+
isUserStoppedMessage,
|
|
11
14
|
type StreamingData,
|
|
12
15
|
type ToolExecutionStatus,
|
|
13
16
|
} from './utils';
|
|
14
17
|
|
|
15
18
|
export type SummaryConversationItem =
|
|
16
19
|
| { type: 'message'; message: AgentMessage }
|
|
20
|
+
| {
|
|
21
|
+
type: 'stopped';
|
|
22
|
+
message: AgentMessage;
|
|
23
|
+
startTimestamp: number | string;
|
|
24
|
+
endTimestamp: number | string;
|
|
25
|
+
}
|
|
17
26
|
| {
|
|
18
27
|
type: 'work';
|
|
19
28
|
id: string;
|
|
@@ -154,14 +163,49 @@ function isToolScopedStatusMessage(message: AgentMessage): boolean {
|
|
|
154
163
|
);
|
|
155
164
|
}
|
|
156
165
|
|
|
166
|
+
function isLegacyAnalyzeConversationErrorMessage(message: AgentMessage): boolean {
|
|
167
|
+
if (message.type !== AgentMessageType.ERROR || isToolScopedStatusMessage(message)) return false;
|
|
168
|
+
|
|
169
|
+
const details = message.details as { error?: unknown } | undefined;
|
|
170
|
+
return getMessageText(message).startsWith('Error analyzing conversation:') && typeof details?.error === 'string';
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function isWorkstreamActivityFailureMessage(message: AgentMessage): boolean {
|
|
174
|
+
if (message.type !== AgentMessageType.ERROR) return false;
|
|
175
|
+
|
|
176
|
+
const details = message.details as
|
|
177
|
+
| {
|
|
178
|
+
activity_group_id?: unknown;
|
|
179
|
+
event_class?: unknown;
|
|
180
|
+
tool?: unknown;
|
|
181
|
+
tool_event?: unknown;
|
|
182
|
+
tool_run_id?: unknown;
|
|
183
|
+
tool_status?: unknown;
|
|
184
|
+
workstream_event?: unknown;
|
|
185
|
+
}
|
|
186
|
+
| undefined;
|
|
187
|
+
|
|
188
|
+
if (details?.event_class !== 'activity') return false;
|
|
189
|
+
if (details.workstream_event) return false;
|
|
190
|
+
|
|
191
|
+
return !(
|
|
192
|
+
details.tool ||
|
|
193
|
+
details.tool_status ||
|
|
194
|
+
details.tool_run_id ||
|
|
195
|
+
details.activity_group_id ||
|
|
196
|
+
details.tool_event
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
157
200
|
function isSummaryPrimaryMessage(message: AgentMessage): boolean {
|
|
158
201
|
if (isWorkstreamInternalResultMessage(message)) return false;
|
|
202
|
+
if (isWorkstreamActivityFailureMessage(message)) return false;
|
|
159
203
|
|
|
160
204
|
return (
|
|
161
205
|
message.type === AgentMessageType.QUESTION ||
|
|
162
206
|
Boolean(getWorkstreamLaunchDetails(message)) ||
|
|
163
207
|
isSummaryAssistantProseMessage(message) ||
|
|
164
|
-
message.type === AgentMessageType.REQUEST_INPUT ||
|
|
208
|
+
(message.type === AgentMessageType.REQUEST_INPUT && !isToolApprovalRequestInput(message)) ||
|
|
165
209
|
message.type === AgentMessageType.TERMINATED ||
|
|
166
210
|
((message.type === AgentMessageType.ERROR || message.type === AgentMessageType.WARNING) &&
|
|
167
211
|
!isToolScopedStatusMessage(message) &&
|
|
@@ -200,7 +244,9 @@ function isSummaryWorkMessage(message: AgentMessage): boolean {
|
|
|
200
244
|
if (isWorkstreamInternalResultMessage(message)) return false;
|
|
201
245
|
if (isSummaryAssistantProseMessage(message)) return false;
|
|
202
246
|
if (getWorkstreamLaunchDetails(message)) return false;
|
|
247
|
+
if (isWorkstreamActivityFailureMessage(message)) return true;
|
|
203
248
|
if (isTransientWorkStatusMessage(message)) return true;
|
|
249
|
+
if (isToolApprovalRequestInput(message)) return true;
|
|
204
250
|
if (isToolScopedStatusMessage(message)) return true;
|
|
205
251
|
if (isToolPreambleMessage(message)) return true;
|
|
206
252
|
if (isToolActivityMessage(message)) return true;
|
|
@@ -216,6 +262,7 @@ export function buildSummaryConversationItems(
|
|
|
216
262
|
): SummaryConversationItem[] {
|
|
217
263
|
const items: SummaryConversationItem[] = [];
|
|
218
264
|
let pendingWork: AgentMessage[] = [];
|
|
265
|
+
const seenWorkstreamStartIds = new Set<string>();
|
|
219
266
|
|
|
220
267
|
const flushWork = (isActive: boolean, endMessage?: AgentMessage) => {
|
|
221
268
|
if (pendingWork.length === 0) return;
|
|
@@ -244,12 +291,45 @@ export function buildSummaryConversationItems(
|
|
|
244
291
|
};
|
|
245
292
|
|
|
246
293
|
for (const message of messages) {
|
|
294
|
+
const launchDetails = getWorkstreamLaunchDetails(message);
|
|
295
|
+
const activityStartDetails = launchDetails ? null : getWorkstreamActivityDetails(message);
|
|
296
|
+
const workstreamStartDetails = launchDetails ?? activityStartDetails;
|
|
297
|
+
|
|
298
|
+
if (workstreamStartDetails) {
|
|
299
|
+
const hasSeenWorkstream = seenWorkstreamStartIds.has(workstreamStartDetails.workstreamId);
|
|
300
|
+
seenWorkstreamStartIds.add(workstreamStartDetails.workstreamId);
|
|
301
|
+
|
|
302
|
+
if (launchDetails || !hasSeenWorkstream) {
|
|
303
|
+
flushWork(false, message);
|
|
304
|
+
items.push({ type: 'message', message });
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
247
309
|
if (message.type === AgentMessageType.COMPLETE || message.type === AgentMessageType.IDLE) {
|
|
310
|
+
if (isUserStoppedMessage(message)) {
|
|
311
|
+
const pendingWorkStartTimestamp = pendingWork[0]?.timestamp;
|
|
312
|
+
flushWork(false, message);
|
|
313
|
+
const previousItem = items[items.length - 1];
|
|
314
|
+
items.push({
|
|
315
|
+
type: 'stopped',
|
|
316
|
+
message,
|
|
317
|
+
startTimestamp:
|
|
318
|
+
pendingWorkStartTimestamp !== undefined && previousItem?.type === 'work'
|
|
319
|
+
? previousItem.startTimestamp
|
|
320
|
+
: (pendingWorkStartTimestamp ?? message.timestamp),
|
|
321
|
+
endTimestamp: message.timestamp,
|
|
322
|
+
});
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
248
325
|
flushWork(false, message);
|
|
249
326
|
continue;
|
|
250
327
|
}
|
|
251
328
|
|
|
252
|
-
if (
|
|
329
|
+
if (
|
|
330
|
+
isSummaryWorkMessage(message) ||
|
|
331
|
+
(pendingWork.length > 0 && isLegacyAnalyzeConversationErrorMessage(message))
|
|
332
|
+
) {
|
|
253
333
|
if (shouldResumeCompletedWorkForTool(message, pendingWork)) {
|
|
254
334
|
const previousItem = items[items.length - 1];
|
|
255
335
|
if (previousItem?.type === 'work' && !previousItem.isActive) {
|
|
@@ -58,7 +58,7 @@ export default function WorkstreamTabs({
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
return (
|
|
61
|
-
<div className="flex overflow-x-auto
|
|
61
|
+
<div className="flex overflow-x-auto gap-1 mb-1 bg-muted border-b border-muted/20 sticky top-0 z-10">
|
|
62
62
|
{sortedWorkstreams.map(([id, name]) => (
|
|
63
63
|
<Button
|
|
64
64
|
variant="unstyled"
|
|
@@ -76,7 +76,7 @@ export default function WorkstreamTabs({
|
|
|
76
76
|
{name.length > 20 ? `${name.substring(0, 18)}...` : name}
|
|
77
77
|
{/* biome-ignore lint/style/noNonNullAssertion: intentional non-null assertion; TS can't prove narrowing here */}
|
|
78
78
|
{count?.has(id) && count.get(id)! > 0 && (
|
|
79
|
-
<div className="flex items-center
|
|
79
|
+
<div className="flex items-center gap-1">
|
|
80
80
|
<span
|
|
81
81
|
className={cn(
|
|
82
82
|
'inline-flex items-center justify-center p-1 text-xs rounded-full',
|
|
@@ -11,6 +11,68 @@ export function getAgentMessageText(message: AgentMessage): string {
|
|
|
11
11
|
return String(message.message).trim();
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
export function getRequestInputDisplayText(message: AgentMessage): string {
|
|
15
|
+
const toolApproval = getRecord((message.details as Record<string, unknown> | undefined)?.tool_approval);
|
|
16
|
+
if (!toolApproval) return getAgentMessageText(message);
|
|
17
|
+
|
|
18
|
+
const title = getString(toolApproval.tool_title) ?? getString(toolApproval.tool_name);
|
|
19
|
+
const target = formatToolApprovalTargetForDisplay(getString(toolApproval.target));
|
|
20
|
+
if (title && target) return `Approve ${title}: ${target}?`;
|
|
21
|
+
|
|
22
|
+
const actionSummary = getString(toolApproval.action_summary);
|
|
23
|
+
if (actionSummary) return `Approve ${formatToolApprovalActionSummaryForDisplay(actionSummary)}?`;
|
|
24
|
+
|
|
25
|
+
return getAgentMessageText(message);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getRecord(value: unknown): Record<string, unknown> | undefined {
|
|
29
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? (value as Record<string, unknown>) : undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function getString(value: unknown): string | undefined {
|
|
33
|
+
return typeof value === 'string' && value.trim() ? value.trim() : undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function formatToolApprovalActionSummaryForDisplay(actionSummary: string): string {
|
|
37
|
+
return actionSummary.replace(/:\s*name(?::|\s+)/i, ': ');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function formatToolApprovalTargetForDisplay(target: string | undefined): string | undefined {
|
|
41
|
+
if (!target) return undefined;
|
|
42
|
+
|
|
43
|
+
const separatorIndex = target.indexOf(':');
|
|
44
|
+
if (separatorIndex < 0) return target;
|
|
45
|
+
|
|
46
|
+
const key = target.slice(0, separatorIndex);
|
|
47
|
+
const value = target.slice(separatorIndex + 1).trim();
|
|
48
|
+
if (!value) return target;
|
|
49
|
+
|
|
50
|
+
switch (key) {
|
|
51
|
+
case 'document_id':
|
|
52
|
+
return `document ${value}`;
|
|
53
|
+
case 'object_id':
|
|
54
|
+
return `object ${value}`;
|
|
55
|
+
case 'collection_id':
|
|
56
|
+
return `collection ${value}`;
|
|
57
|
+
case 'process_id':
|
|
58
|
+
return `process ${value}`;
|
|
59
|
+
case 'process_definition_id':
|
|
60
|
+
return `process definition ${value}`;
|
|
61
|
+
case 'interaction_id':
|
|
62
|
+
return `interaction ${value}`;
|
|
63
|
+
case 'prompt_id':
|
|
64
|
+
return `prompt ${value}`;
|
|
65
|
+
case 'dashboard_id':
|
|
66
|
+
return `dashboard ${value}`;
|
|
67
|
+
case 'database_id':
|
|
68
|
+
return `database ${value}`;
|
|
69
|
+
case 'table_id':
|
|
70
|
+
return `table ${value}`;
|
|
71
|
+
default:
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
14
76
|
export function hasRequestInputUx(message: AgentMessage): message is RequestInputMessageWithUx {
|
|
15
77
|
const details = message.details as AskUserMessageDetails | undefined;
|
|
16
78
|
return message.type === AgentMessageType.REQUEST_INPUT && !!details?.ux;
|
|
@@ -34,6 +96,22 @@ export function getRequestInputMessageKey(message: AgentMessage): string {
|
|
|
34
96
|
.join('|');
|
|
35
97
|
}
|
|
36
98
|
|
|
99
|
+
export function getRequestInputAnswerMessageKey(message: AgentMessage): string {
|
|
100
|
+
const details = message.details as Record<string, unknown> | undefined;
|
|
101
|
+
const keyParts = [
|
|
102
|
+
details?.ack,
|
|
103
|
+
details?._messageId,
|
|
104
|
+
details?._deliveryStatus,
|
|
105
|
+
message.timestamp,
|
|
106
|
+
getWorkstreamId(message),
|
|
107
|
+
getAgentMessageText(message),
|
|
108
|
+
];
|
|
109
|
+
return keyParts
|
|
110
|
+
.filter((value): value is string | number => typeof value === 'string' || typeof value === 'number')
|
|
111
|
+
.map(String)
|
|
112
|
+
.join('|');
|
|
113
|
+
}
|
|
114
|
+
|
|
37
115
|
export function getAnsweredRequestInputKeys(messages: AgentMessage[]): Set<string> {
|
|
38
116
|
const answered = new Set<string>();
|
|
39
117
|
|
|
@@ -56,6 +134,142 @@ export function getAnsweredRequestInputKeys(messages: AgentMessage[]): Set<strin
|
|
|
56
134
|
return answered;
|
|
57
135
|
}
|
|
58
136
|
|
|
137
|
+
export function getResolvedToolApprovalKeys(messages: AgentMessage[]): Set<string> {
|
|
138
|
+
const resolved = new Set<string>();
|
|
139
|
+
|
|
140
|
+
for (const message of messages) {
|
|
141
|
+
const details = getRecord(message.details);
|
|
142
|
+
const approvalRequest = getRecord(details?.approval_request);
|
|
143
|
+
const approvalKey = approvalRequest?.approval_key;
|
|
144
|
+
const decision = details?.approval_decision;
|
|
145
|
+
|
|
146
|
+
if (
|
|
147
|
+
typeof approvalKey === 'string' &&
|
|
148
|
+
(decision === 'denied' ||
|
|
149
|
+
decision === 'denied_with_feedback' ||
|
|
150
|
+
decision === 'timeout' ||
|
|
151
|
+
decision === 'reviewer_denied' ||
|
|
152
|
+
decision === 'cancelled_after_denial')
|
|
153
|
+
) {
|
|
154
|
+
resolved.add(approvalKey);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return resolved;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function getToolApprovalKey(message: AgentMessage): string | undefined {
|
|
162
|
+
const details = getRecord(message.details);
|
|
163
|
+
const toolApproval = getRecord(details?.tool_approval);
|
|
164
|
+
const approvalKey = toolApproval?.approval_key;
|
|
165
|
+
return typeof approvalKey === 'string' ? approvalKey : undefined;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export function isToolApprovalRequestInput(message: AgentMessage): boolean {
|
|
169
|
+
return message.type === AgentMessageType.REQUEST_INPUT && getToolApprovalKey(message) !== undefined;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function isToolApprovalOptionResponse(message: AgentMessage): boolean {
|
|
173
|
+
if (message.type !== AgentMessageType.QUESTION) return false;
|
|
174
|
+
const normalized = getAgentMessageText(message).trim().toLowerCase();
|
|
175
|
+
return normalized === 'allow_once' || normalized === 'allow_for_run' || normalized === 'deny';
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function isToolApprovalMetadataResponse(message: AgentMessage): boolean {
|
|
179
|
+
if (message.type !== AgentMessageType.QUESTION) return false;
|
|
180
|
+
const details = getRecord(message.details);
|
|
181
|
+
const metadata = getRecord(details?.metadata);
|
|
182
|
+
const toolApprovalResponse =
|
|
183
|
+
getRecord(details?.tool_approval_response) ?? getRecord(metadata?.tool_approval_response);
|
|
184
|
+
return toolApprovalResponse?.decision === 'deny_with_feedback';
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function isToolApprovalResponse(message: AgentMessage): boolean {
|
|
188
|
+
return isToolApprovalOptionResponse(message) || isToolApprovalMetadataResponse(message);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function isRequestInputResolvedByToolApprovalEvent(
|
|
192
|
+
message: AgentMessage,
|
|
193
|
+
resolvedToolApprovalKeys: Set<string>,
|
|
194
|
+
): boolean {
|
|
195
|
+
if (message.type !== AgentMessageType.REQUEST_INPUT) return false;
|
|
196
|
+
const approvalKey = getToolApprovalKey(message);
|
|
197
|
+
return approvalKey ? resolvedToolApprovalKeys.has(approvalKey) : false;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export function getAnsweredToolApprovalRequestInputKeys(messages: AgentMessage[]): Set<string> {
|
|
201
|
+
const answered = new Set<string>();
|
|
202
|
+
|
|
203
|
+
messages.forEach((message, index) => {
|
|
204
|
+
if (!isToolApprovalRequestInput(message)) return;
|
|
205
|
+
|
|
206
|
+
const workstreamId = getWorkstreamId(message);
|
|
207
|
+
for (let nextIndex = index + 1; nextIndex < messages.length; nextIndex += 1) {
|
|
208
|
+
const nextMessage = messages[nextIndex];
|
|
209
|
+
if (getWorkstreamId(nextMessage) !== workstreamId) continue;
|
|
210
|
+
if (nextMessage.type === AgentMessageType.REQUEST_INPUT) break;
|
|
211
|
+
if (nextMessage.type === AgentMessageType.QUESTION) {
|
|
212
|
+
if (isToolApprovalResponse(nextMessage)) {
|
|
213
|
+
answered.add(getRequestInputMessageKey(message));
|
|
214
|
+
}
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
return answered;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export function isToolApprovalRequestInputHidden(
|
|
224
|
+
message: AgentMessage,
|
|
225
|
+
answeredToolApprovalRequestInputKeys: Set<string>,
|
|
226
|
+
resolvedToolApprovalKeys: Set<string>,
|
|
227
|
+
): boolean {
|
|
228
|
+
return (
|
|
229
|
+
isToolApprovalRequestInput(message) &&
|
|
230
|
+
(answeredToolApprovalRequestInputKeys.has(getRequestInputMessageKey(message)) ||
|
|
231
|
+
isRequestInputResolvedByToolApprovalEvent(message, resolvedToolApprovalKeys))
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export function getHiddenToolApprovalAnswerKeys(
|
|
236
|
+
messages: AgentMessage[],
|
|
237
|
+
resolvedToolApprovalKeys?: Set<string>,
|
|
238
|
+
): Set<string> {
|
|
239
|
+
const hidden = new Set<string>();
|
|
240
|
+
|
|
241
|
+
messages.forEach((message, index) => {
|
|
242
|
+
if (
|
|
243
|
+
!isToolApprovalRequestInput(message) ||
|
|
244
|
+
(resolvedToolApprovalKeys && !isRequestInputResolvedByToolApprovalEvent(message, resolvedToolApprovalKeys))
|
|
245
|
+
) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const workstreamId = getWorkstreamId(message);
|
|
250
|
+
for (let nextIndex = index + 1; nextIndex < messages.length; nextIndex += 1) {
|
|
251
|
+
const nextMessage = messages[nextIndex];
|
|
252
|
+
if (getWorkstreamId(nextMessage) !== workstreamId) continue;
|
|
253
|
+
if (nextMessage.type === AgentMessageType.REQUEST_INPUT) break;
|
|
254
|
+
if (nextMessage.type === AgentMessageType.QUESTION) {
|
|
255
|
+
if (isToolApprovalOptionResponse(nextMessage)) {
|
|
256
|
+
hidden.add(getRequestInputAnswerMessageKey(nextMessage));
|
|
257
|
+
}
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
return hidden;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export function isToolApprovalAnswerHidden(message: AgentMessage, hiddenToolApprovalAnswerKeys: Set<string>): boolean {
|
|
267
|
+
return (
|
|
268
|
+
message.type === AgentMessageType.QUESTION &&
|
|
269
|
+
hiddenToolApprovalAnswerKeys.has(getRequestInputAnswerMessageKey(message))
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
59
273
|
export function isRequestInputAnswered(message: AgentMessage, answeredRequestInputKeys: Set<string>): boolean {
|
|
60
274
|
return (
|
|
61
275
|
message.type === AgentMessageType.REQUEST_INPUT &&
|
|
@@ -68,12 +282,14 @@ export function getPendingRequestInputMessage(
|
|
|
68
282
|
workstreamId = 'main',
|
|
69
283
|
): RequestInputMessageWithUx | undefined {
|
|
70
284
|
const answeredRequestInputKeys = getAnsweredRequestInputKeys(messages);
|
|
285
|
+
const resolvedToolApprovalKeys = getResolvedToolApprovalKeys(messages);
|
|
71
286
|
|
|
72
287
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
73
288
|
const message = messages[index];
|
|
74
289
|
if (!hasRequestInputUx(message)) continue;
|
|
75
290
|
if (getWorkstreamId(message) !== workstreamId) continue;
|
|
76
291
|
if (isRequestInputAnswered(message, answeredRequestInputKeys)) continue;
|
|
292
|
+
if (isRequestInputResolvedByToolApprovalEvent(message, resolvedToolApprovalKeys)) continue;
|
|
77
293
|
return message;
|
|
78
294
|
}
|
|
79
295
|
|
|
@@ -498,6 +498,67 @@ describe('ModernAgentOutput summary conversation items', () => {
|
|
|
498
498
|
});
|
|
499
499
|
});
|
|
500
500
|
|
|
501
|
+
it('keeps legacy analyze conversation errors inside the surrounding work block', () => {
|
|
502
|
+
const analyzeStart = makeMessage({
|
|
503
|
+
timestamp: 1000,
|
|
504
|
+
type: AgentMessageType.THOUGHT,
|
|
505
|
+
message: 'Running analyze_conversation',
|
|
506
|
+
details: {
|
|
507
|
+
activity_group_id: 'activity-10',
|
|
508
|
+
tool: 'analyze_conversation',
|
|
509
|
+
tool_run_id: 'analyze-run-1',
|
|
510
|
+
tool_status: 'running',
|
|
511
|
+
},
|
|
512
|
+
});
|
|
513
|
+
const legacyAnalyzeError = makeMessage({
|
|
514
|
+
timestamp: 1100,
|
|
515
|
+
type: AgentMessageType.ERROR,
|
|
516
|
+
message: 'Error analyzing conversation: Could not find conversation for workflow run ID: run-1',
|
|
517
|
+
details: {
|
|
518
|
+
error: 'Could not find conversation for workflow run ID: run-1',
|
|
519
|
+
},
|
|
520
|
+
});
|
|
521
|
+
const answer = makeMessage({
|
|
522
|
+
timestamp: 1200,
|
|
523
|
+
type: AgentMessageType.ANSWER,
|
|
524
|
+
message: 'Here is the analysis.',
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
const items = buildSummaryConversationItems([analyzeStart, legacyAnalyzeError, answer], true);
|
|
528
|
+
|
|
529
|
+
expect(items).toHaveLength(2);
|
|
530
|
+
expect(items[0]).toMatchObject({
|
|
531
|
+
type: 'work',
|
|
532
|
+
isActive: false,
|
|
533
|
+
status: 'error',
|
|
534
|
+
messages: [analyzeStart, legacyAnalyzeError],
|
|
535
|
+
});
|
|
536
|
+
expect(items[1]).toMatchObject({
|
|
537
|
+
type: 'message',
|
|
538
|
+
message: answer,
|
|
539
|
+
});
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
it('keeps legacy analyze conversation errors without surrounding work as primary messages', () => {
|
|
543
|
+
const legacyAnalyzeError = makeMessage({
|
|
544
|
+
timestamp: 1000,
|
|
545
|
+
type: AgentMessageType.ERROR,
|
|
546
|
+
message: 'Error analyzing conversation: Could not find conversation for workflow run ID: run-1',
|
|
547
|
+
details: {
|
|
548
|
+
error: 'Could not find conversation for workflow run ID: run-1',
|
|
549
|
+
},
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
const items = buildSummaryConversationItems([legacyAnalyzeError], true);
|
|
553
|
+
|
|
554
|
+
expect(items).toEqual([
|
|
555
|
+
{
|
|
556
|
+
type: 'message',
|
|
557
|
+
message: legacyAnalyzeError,
|
|
558
|
+
},
|
|
559
|
+
]);
|
|
560
|
+
});
|
|
561
|
+
|
|
501
562
|
it('hides transient thinking once the work segment completes', () => {
|
|
502
563
|
const tool = makeMessage({
|
|
503
564
|
timestamp: 1000,
|
|
@@ -785,6 +846,37 @@ describe('ModernAgentOutput summary conversation items', () => {
|
|
|
785
846
|
expect(items).toEqual([]);
|
|
786
847
|
});
|
|
787
848
|
|
|
849
|
+
it('creates a visible stopped item for a consumed user stop idle marker', () => {
|
|
850
|
+
const thinking = makeMessage({
|
|
851
|
+
timestamp: 1000,
|
|
852
|
+
type: AgentMessageType.THOUGHT,
|
|
853
|
+
message: 'Thinking...',
|
|
854
|
+
details: {
|
|
855
|
+
display_role: 'thinking',
|
|
856
|
+
activity_group_id: 'activity-1',
|
|
857
|
+
},
|
|
858
|
+
});
|
|
859
|
+
const idle = makeMessage({
|
|
860
|
+
timestamp: 2000,
|
|
861
|
+
type: AgentMessageType.IDLE,
|
|
862
|
+
message: 'Stopped. Waiting for your command...',
|
|
863
|
+
details: {
|
|
864
|
+
ack: 'stop-1',
|
|
865
|
+
status_reason: 'user_stopped',
|
|
866
|
+
},
|
|
867
|
+
});
|
|
868
|
+
|
|
869
|
+
const items = buildSummaryConversationItems([thinking, idle], true);
|
|
870
|
+
|
|
871
|
+
expect(items).toHaveLength(1);
|
|
872
|
+
expect(items[0]).toMatchObject({
|
|
873
|
+
type: 'stopped',
|
|
874
|
+
message: idle,
|
|
875
|
+
startTimestamp: 1000,
|
|
876
|
+
endTimestamp: 2000,
|
|
877
|
+
});
|
|
878
|
+
});
|
|
879
|
+
|
|
788
880
|
it('closes pending work when an idle marker arrives even if parent completion lags', () => {
|
|
789
881
|
const tool = makeMessage({
|
|
790
882
|
timestamp: 1000,
|
|
@@ -1180,6 +1272,37 @@ describe('ModernAgentOutput summary conversation items', () => {
|
|
|
1180
1272
|
expect(summaryMessages).toEqual([answer]);
|
|
1181
1273
|
});
|
|
1182
1274
|
|
|
1275
|
+
it('does not duplicate completed tool preamble streams once persisted prose replaces them', () => {
|
|
1276
|
+
const preamble = makeMessage({
|
|
1277
|
+
timestamp: 3000,
|
|
1278
|
+
type: AgentMessageType.THOUGHT,
|
|
1279
|
+
message: 'Got my tools ready. Querying now!',
|
|
1280
|
+
details: {
|
|
1281
|
+
activity_id: 'activity-1',
|
|
1282
|
+
display_role: 'tool_preamble',
|
|
1283
|
+
tools: ['search_documents'],
|
|
1284
|
+
streamed: true,
|
|
1285
|
+
},
|
|
1286
|
+
});
|
|
1287
|
+
|
|
1288
|
+
const summaryMessages = buildSummaryDisplayMessages(
|
|
1289
|
+
[preamble],
|
|
1290
|
+
new Map([
|
|
1291
|
+
[
|
|
1292
|
+
'activity-1',
|
|
1293
|
+
{
|
|
1294
|
+
text: 'Got my tools ready. Querying now!',
|
|
1295
|
+
startTimestamp: 2000,
|
|
1296
|
+
activityId: 'activity-1',
|
|
1297
|
+
isComplete: true,
|
|
1298
|
+
},
|
|
1299
|
+
],
|
|
1300
|
+
]),
|
|
1301
|
+
);
|
|
1302
|
+
|
|
1303
|
+
expect(summaryMessages).toEqual([preamble]);
|
|
1304
|
+
});
|
|
1305
|
+
|
|
1183
1306
|
it('keeps completed answer streams as assistant prose when a later tool message follows', () => {
|
|
1184
1307
|
const question = makeMessage({
|
|
1185
1308
|
timestamp: 1000,
|
|
@@ -1287,6 +1410,32 @@ describe('ModernAgentOutput utils - streamed deduplication', () => {
|
|
|
1287
1410
|
expect(grouped[0].type).toBe('single');
|
|
1288
1411
|
});
|
|
1289
1412
|
|
|
1413
|
+
it('does not replace a run-scoped stream with a different stream using the same activity id', () => {
|
|
1414
|
+
const answer = makeMessage({
|
|
1415
|
+
timestamp: 2000,
|
|
1416
|
+
type: AgentMessageType.ANSWER,
|
|
1417
|
+
message: 'Different final text',
|
|
1418
|
+
details: {
|
|
1419
|
+
activity_id: 'activity-1',
|
|
1420
|
+
streaming_id: 'run-b-activity-1',
|
|
1421
|
+
streaming_id_scope: 'workflow_run',
|
|
1422
|
+
},
|
|
1423
|
+
});
|
|
1424
|
+
|
|
1425
|
+
expect(
|
|
1426
|
+
isStreamReplacedByMessage(
|
|
1427
|
+
{
|
|
1428
|
+
text: 'partial text',
|
|
1429
|
+
startTimestamp: 1000,
|
|
1430
|
+
workstreamId: 'main',
|
|
1431
|
+
activityId: 'activity-1',
|
|
1432
|
+
streamingId: 'run-a-activity-1',
|
|
1433
|
+
},
|
|
1434
|
+
[answer],
|
|
1435
|
+
),
|
|
1436
|
+
).toBe(false);
|
|
1437
|
+
});
|
|
1438
|
+
|
|
1290
1439
|
it('does not treat a tool event with the same activity id as a replacement for streamed prose', () => {
|
|
1291
1440
|
const tool = makeMessage({
|
|
1292
1441
|
timestamp: 2000,
|