@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
|
@@ -7,7 +7,12 @@ import {
|
|
|
7
7
|
type FileProcessingDetails,
|
|
8
8
|
} from '@vertesia/common';
|
|
9
9
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
debugAgentChat,
|
|
12
|
+
insertMessageInTimeline,
|
|
13
|
+
isInProgress,
|
|
14
|
+
isUserStoppedMessage,
|
|
15
|
+
} from '../ModernAgentOutput/utils';
|
|
11
16
|
|
|
12
17
|
/** Streaming data for a single active stream, keyed by streaming/activity ID */
|
|
13
18
|
export interface StreamingData {
|
|
@@ -16,16 +21,24 @@ export interface StreamingData {
|
|
|
16
21
|
isComplete?: boolean;
|
|
17
22
|
startTimestamp: number;
|
|
18
23
|
activityId?: string;
|
|
24
|
+
streamingId?: string;
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
export interface UseAgentStreamResult {
|
|
22
28
|
messages: AgentMessage[];
|
|
23
29
|
streamingMessages: Map<string, StreamingData>;
|
|
24
30
|
isCompleted: boolean;
|
|
31
|
+
/** Initial history fetch state for deciding whether empty-run fallbacks are legitimate. */
|
|
32
|
+
initialHistoryStatus: 'loading' | 'empty' | 'has_messages' | 'error';
|
|
25
33
|
/** Whether we are receiving chunks right now (for visual indicators) */
|
|
26
34
|
debugChunkFlash: boolean;
|
|
27
35
|
/** Add an optimistic message (for user input) */
|
|
28
36
|
addOptimisticMessage: (msg: AgentMessage) => void;
|
|
37
|
+
/** Update optimistic delivery state for a client-generated message id */
|
|
38
|
+
updateOptimisticMessageStatus: (
|
|
39
|
+
messageId: string,
|
|
40
|
+
status: NonNullable<Common.AgentMessageDetails['_deliveryStatus']>,
|
|
41
|
+
) => void;
|
|
29
42
|
/** Remove optimistic messages matching a predicate */
|
|
30
43
|
removeOptimisticMessages: (predicate: (msg: AgentMessage) => boolean) => void;
|
|
31
44
|
/**
|
|
@@ -42,6 +55,146 @@ export interface UseAgentStreamResult {
|
|
|
42
55
|
serverFileUpdates: Map<string, ConversationFile>;
|
|
43
56
|
}
|
|
44
57
|
|
|
58
|
+
function withDeliveryStatus(
|
|
59
|
+
message: AgentMessage,
|
|
60
|
+
status: NonNullable<Common.AgentMessageDetails['_deliveryStatus']>,
|
|
61
|
+
): AgentMessage {
|
|
62
|
+
return {
|
|
63
|
+
...message,
|
|
64
|
+
details: {
|
|
65
|
+
...(message.details ?? {}),
|
|
66
|
+
_deliveryStatus: status,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function getClientMessageId(message: AgentMessage): string | undefined {
|
|
72
|
+
const details = message.details;
|
|
73
|
+
const messageId = details?._messageId;
|
|
74
|
+
if (typeof messageId === 'string' && messageId) return messageId;
|
|
75
|
+
|
|
76
|
+
const ack = details?.ack;
|
|
77
|
+
return typeof ack === 'string' && ack ? ack : undefined;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function getStringDetail(details: Common.AgentMessageDetails | undefined, key: string): string | undefined {
|
|
81
|
+
const value = details?.[key];
|
|
82
|
+
return typeof value === 'string' && value ? value : undefined;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function isWorkflowRunScopedStreamingId(details: Common.AgentMessageDetails | undefined): boolean {
|
|
86
|
+
return details?.streaming_id_scope === 'workflow_run';
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function isTimelineStateMessage(message: AgentMessage): boolean {
|
|
90
|
+
return [
|
|
91
|
+
AgentMessageType.COMPLETE,
|
|
92
|
+
AgentMessageType.IDLE,
|
|
93
|
+
AgentMessageType.TERMINATED,
|
|
94
|
+
AgentMessageType.REQUEST_INPUT,
|
|
95
|
+
].includes(message.type);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function shouldStoreTimelineMessage(message: AgentMessage): boolean {
|
|
99
|
+
if (message.type === AgentMessageType.STREAMING_CHUNK) return false;
|
|
100
|
+
|
|
101
|
+
if (message.type === AgentMessageType.SYSTEM) {
|
|
102
|
+
const details = message.details as FileProcessingDetails | undefined;
|
|
103
|
+
if (details?.system_type === 'file_processing' && details.files) return false;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return Boolean(message.message) || isTimelineStateMessage(message);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function summarizeMessage(message: AgentMessage | undefined): Record<string, unknown> | undefined {
|
|
110
|
+
if (!message) return undefined;
|
|
111
|
+
return {
|
|
112
|
+
type: message.type,
|
|
113
|
+
timestamp: message.timestamp,
|
|
114
|
+
workstream_id: message.workstream_id,
|
|
115
|
+
text:
|
|
116
|
+
typeof message.message === 'string' ? message.message.slice(0, 80) : message.message ? '[non-string]' : '',
|
|
117
|
+
display_role: message.details?.display_role,
|
|
118
|
+
source: message.details?.source,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function insertTimelineMessage(prev: AgentMessage[], message: AgentMessage): AgentMessage[] {
|
|
123
|
+
if (prev.find((m) => m.timestamp === message.timestamp)) {
|
|
124
|
+
return prev;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// For acked server messages, replace the matching optimistic version.
|
|
128
|
+
if (
|
|
129
|
+
!message.details?._optimistic &&
|
|
130
|
+
(message.type === AgentMessageType.QUESTION || isUserStoppedMessage(message))
|
|
131
|
+
) {
|
|
132
|
+
const ack = typeof message.details?.ack === 'string' ? message.details.ack : undefined;
|
|
133
|
+
const consumedMessage = ack ? withDeliveryStatus(message, 'consumed') : message;
|
|
134
|
+
|
|
135
|
+
if (ack) {
|
|
136
|
+
const next = prev.filter(
|
|
137
|
+
(m) =>
|
|
138
|
+
!(
|
|
139
|
+
(m.type === message.type || isUserStoppedMessage(m)) &&
|
|
140
|
+
m.details?._optimistic &&
|
|
141
|
+
getClientMessageId(m) === ack
|
|
142
|
+
),
|
|
143
|
+
);
|
|
144
|
+
insertMessageInTimeline(next, consumedMessage);
|
|
145
|
+
return next;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (message.type === AgentMessageType.QUESTION) {
|
|
149
|
+
// Legacy fallback for older workflow echoes that predate `details.ack`.
|
|
150
|
+
const matchingOptimistic = prev.filter(
|
|
151
|
+
(m) =>
|
|
152
|
+
m.type === AgentMessageType.QUESTION &&
|
|
153
|
+
m.details?._optimistic &&
|
|
154
|
+
m.message === message.message &&
|
|
155
|
+
(m.workstream_id ?? 'main') === (message.workstream_id ?? 'main'),
|
|
156
|
+
);
|
|
157
|
+
if (matchingOptimistic.length === 1) {
|
|
158
|
+
const next = prev.filter((m) => m !== matchingOptimistic[0]);
|
|
159
|
+
insertMessageInTimeline(next, message);
|
|
160
|
+
return next;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const next = [...prev];
|
|
166
|
+
insertMessageInTimeline(next, message);
|
|
167
|
+
return next;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function getStreamingChunkKey(message: AgentMessage): string | undefined {
|
|
171
|
+
const details = message.details;
|
|
172
|
+
const streamingId = getStringDetail(details, 'streaming_id');
|
|
173
|
+
const activityId = getStringDetail(details, 'activity_id');
|
|
174
|
+
|
|
175
|
+
if (streamingId && isWorkflowRunScopedStreamingId(details)) return streamingId;
|
|
176
|
+
|
|
177
|
+
// Backward compatibility: older compact chunks used workstream_id as
|
|
178
|
+
// streaming_id, so activity_id is the more specific key when present.
|
|
179
|
+
return activityId ?? streamingId;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function getStreamingReplacementKeys(message: AgentMessage): string[] {
|
|
183
|
+
const details = message.details;
|
|
184
|
+
const streamingId = getStringDetail(details, 'streaming_id');
|
|
185
|
+
const activityId = getStringDetail(details, 'activity_id');
|
|
186
|
+
const keys: string[] = [];
|
|
187
|
+
|
|
188
|
+
if (streamingId && isWorkflowRunScopedStreamingId(details)) {
|
|
189
|
+
keys.push(streamingId);
|
|
190
|
+
}
|
|
191
|
+
if (activityId) {
|
|
192
|
+
keys.push(activityId);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return [...new Set(keys)];
|
|
196
|
+
}
|
|
197
|
+
|
|
45
198
|
/**
|
|
46
199
|
* Hook that manages the SSE message stream for an agent conversation.
|
|
47
200
|
*
|
|
@@ -60,6 +213,8 @@ export interface UseAgentStreamResult {
|
|
|
60
213
|
export function useAgentStream(client: VertesiaClient, agentRunId: string): UseAgentStreamResult {
|
|
61
214
|
const [messages, setMessages] = useState<AgentMessage[]>([]);
|
|
62
215
|
const [isCompleted, setIsCompleted] = useState(false);
|
|
216
|
+
const [initialHistoryStatus, setInitialHistoryStatus] =
|
|
217
|
+
useState<UseAgentStreamResult['initialHistoryStatus']>('loading');
|
|
63
218
|
const [agentRunStatus, setAgentRunStatus] = useState<string | null>(null);
|
|
64
219
|
const [workflowRunId, setWorkflowRunId] = useState<string | null>(null);
|
|
65
220
|
|
|
@@ -118,6 +273,19 @@ export function useAgentStream(client: VertesiaClient, agentRunId: string): UseA
|
|
|
118
273
|
setIsCompleted(!isInProgress(messages));
|
|
119
274
|
}, [messages]);
|
|
120
275
|
|
|
276
|
+
useEffect(() => {
|
|
277
|
+
debugAgentChat('stream state', {
|
|
278
|
+
agentRunId,
|
|
279
|
+
messageCount: messages.length,
|
|
280
|
+
streamingCount: streamingMessages.size,
|
|
281
|
+
initialHistoryStatus,
|
|
282
|
+
isCompleted,
|
|
283
|
+
lastDeliveredTs: lastDeliveredTsRef.current,
|
|
284
|
+
first: summarizeMessage(messages[0]),
|
|
285
|
+
last: summarizeMessage(messages[messages.length - 1]),
|
|
286
|
+
});
|
|
287
|
+
}, [agentRunId, initialHistoryStatus, isCompleted, messages, streamingMessages.size]);
|
|
288
|
+
|
|
121
289
|
// Stream messages from the agent
|
|
122
290
|
useEffect(() => {
|
|
123
291
|
// A nonce bump reconnects the current conversation without clearing the timeline.
|
|
@@ -132,6 +300,7 @@ export function useAgentStream(client: VertesiaClient, agentRunId: string): UseA
|
|
|
132
300
|
|
|
133
301
|
if (isNewConversation) {
|
|
134
302
|
setMessages([]);
|
|
303
|
+
setInitialHistoryStatus('loading');
|
|
135
304
|
setAgentRunStatus(null);
|
|
136
305
|
setWorkflowRunId(null);
|
|
137
306
|
setStreamingMessages(new Map());
|
|
@@ -144,12 +313,23 @@ export function useAgentStream(client: VertesiaClient, agentRunId: string): UseA
|
|
|
144
313
|
// new conversation. The cursor is exclusive server-side (ts > since), so the prior
|
|
145
314
|
// run's terminal message is skipped on reconnect.
|
|
146
315
|
const since = isNewConversation ? undefined : lastDeliveredTsRef.current || undefined;
|
|
316
|
+
debugAgentChat('stream start', {
|
|
317
|
+
agentRunId,
|
|
318
|
+
isNewConversation,
|
|
319
|
+
since,
|
|
320
|
+
streamNonce,
|
|
321
|
+
});
|
|
147
322
|
|
|
148
323
|
// Check agent run status
|
|
149
324
|
client.agents
|
|
150
325
|
.getInternals(agentRunId)
|
|
151
326
|
.then((agentRun) => {
|
|
152
327
|
if (!abortController.signal.aborted) {
|
|
328
|
+
debugAgentChat('internals loaded', {
|
|
329
|
+
agentRunId,
|
|
330
|
+
status: agentRun.status,
|
|
331
|
+
first_workflow_run_id: agentRun.first_workflow_run_id,
|
|
332
|
+
});
|
|
153
333
|
setAgentRunStatus(agentRun.status?.toUpperCase() ?? null);
|
|
154
334
|
setWorkflowRunId(agentRun.first_workflow_run_id ?? null);
|
|
155
335
|
}
|
|
@@ -166,6 +346,16 @@ export function useAgentStream(client: VertesiaClient, agentRunId: string): UseA
|
|
|
166
346
|
(message) => {
|
|
167
347
|
if (abortController.signal.aborted) return;
|
|
168
348
|
|
|
349
|
+
debugAgentChat('stream message', {
|
|
350
|
+
agentRunId,
|
|
351
|
+
type: message.type,
|
|
352
|
+
timestamp: message.timestamp,
|
|
353
|
+
workstream_id: message.workstream_id,
|
|
354
|
+
hasMessage: Boolean(message.message),
|
|
355
|
+
display_role: message.details?.display_role,
|
|
356
|
+
source: message.details?.source,
|
|
357
|
+
});
|
|
358
|
+
|
|
169
359
|
// Advance the reconnect cursor past every delivered message.
|
|
170
360
|
if (message.timestamp && message.timestamp > lastDeliveredTsRef.current) {
|
|
171
361
|
lastDeliveredTsRef.current = message.timestamp;
|
|
@@ -175,7 +365,7 @@ export function useAgentStream(client: VertesiaClient, agentRunId: string): UseA
|
|
|
175
365
|
// PERFORMANCE: Batch updates using RAF instead of immediate state updates
|
|
176
366
|
if (message.type === AgentMessageType.STREAMING_CHUNK) {
|
|
177
367
|
const details = message.details as Common.StreamingChunkDetails;
|
|
178
|
-
const streamKey =
|
|
368
|
+
const streamKey = getStreamingChunkKey(message);
|
|
179
369
|
if (!streamKey) return;
|
|
180
370
|
|
|
181
371
|
// Accumulate chunks in the ref (no state update yet)
|
|
@@ -184,6 +374,7 @@ export function useAgentStream(client: VertesiaClient, agentRunId: string): UseA
|
|
|
184
374
|
workstreamId: message.workstream_id,
|
|
185
375
|
startTimestamp: Date.now(),
|
|
186
376
|
activityId: details?.activity_id,
|
|
377
|
+
streamingId: details?.streaming_id,
|
|
187
378
|
};
|
|
188
379
|
const newText = current.text + (message.message || '');
|
|
189
380
|
|
|
@@ -193,6 +384,7 @@ export function useAgentStream(client: VertesiaClient, agentRunId: string): UseA
|
|
|
193
384
|
isComplete: details.is_final,
|
|
194
385
|
startTimestamp: current.startTimestamp,
|
|
195
386
|
activityId: details?.activity_id,
|
|
387
|
+
streamingId: details?.streaming_id,
|
|
196
388
|
});
|
|
197
389
|
|
|
198
390
|
// Schedule a flush if not already scheduled (~60 updates/sec max)
|
|
@@ -223,21 +415,22 @@ export function useAgentStream(client: VertesiaClient, agentRunId: string): UseA
|
|
|
223
415
|
// Other SYSTEM messages fall through to normal handling
|
|
224
416
|
}
|
|
225
417
|
|
|
226
|
-
// When THOUGHT or ANSWER arrives
|
|
227
|
-
if (
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
pendingStreamingChunks.current.delete(activityId);
|
|
233
|
-
setStreamingMessages((prev) => {
|
|
234
|
-
if (prev.has(activityId)) {
|
|
235
|
-
const next = new Map(prev);
|
|
236
|
-
next.delete(activityId);
|
|
237
|
-
return next;
|
|
418
|
+
// When THOUGHT or ANSWER arrives, remove matching live streaming content.
|
|
419
|
+
if (message.type === AgentMessageType.THOUGHT || message.type === AgentMessageType.ANSWER) {
|
|
420
|
+
const replacementKeys = getStreamingReplacementKeys(message);
|
|
421
|
+
if (replacementKeys.length > 0) {
|
|
422
|
+
for (const key of replacementKeys) {
|
|
423
|
+
pendingStreamingChunks.current.delete(key);
|
|
238
424
|
}
|
|
239
|
-
|
|
240
|
-
|
|
425
|
+
setStreamingMessages((prev) => {
|
|
426
|
+
const next = new Map(prev);
|
|
427
|
+
let changed = false;
|
|
428
|
+
for (const key of replacementKeys) {
|
|
429
|
+
changed = next.delete(key) || changed;
|
|
430
|
+
}
|
|
431
|
+
return changed ? next : prev;
|
|
432
|
+
});
|
|
433
|
+
}
|
|
241
434
|
}
|
|
242
435
|
|
|
243
436
|
// On COMPLETE or IDLE, flush any pending chunks
|
|
@@ -247,37 +440,45 @@ export function useAgentStream(client: VertesiaClient, agentRunId: string): UseA
|
|
|
247
440
|
}
|
|
248
441
|
}
|
|
249
442
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
AgentMessageType.COMPLETE,
|
|
253
|
-
AgentMessageType.IDLE,
|
|
254
|
-
AgentMessageType.TERMINATED,
|
|
255
|
-
AgentMessageType.REQUEST_INPUT,
|
|
256
|
-
].includes(message.type);
|
|
257
|
-
|
|
258
|
-
if (hasContent || isStateMessage) {
|
|
259
|
-
setMessages((prev) => {
|
|
260
|
-
// Check for duplicate by timestamp
|
|
261
|
-
if (prev.find((m) => m.timestamp === message.timestamp)) {
|
|
262
|
-
return prev;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// For QUESTION messages from server, replace any optimistic version
|
|
266
|
-
if (message.type === AgentMessageType.QUESTION && !message.details?._optimistic) {
|
|
267
|
-
const withoutOptimistic = prev.filter(
|
|
268
|
-
(m) => !(m.type === AgentMessageType.QUESTION && m.details?._optimistic),
|
|
269
|
-
);
|
|
270
|
-
insertMessageInTimeline(withoutOptimistic, message);
|
|
271
|
-
return [...withoutOptimistic];
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
insertMessageInTimeline(prev, message);
|
|
275
|
-
return [...prev];
|
|
276
|
-
});
|
|
443
|
+
if (shouldStoreTimelineMessage(message)) {
|
|
444
|
+
setMessages((prev) => insertTimelineMessage(prev, message));
|
|
277
445
|
}
|
|
278
446
|
},
|
|
279
447
|
since,
|
|
280
448
|
abortController.signal,
|
|
449
|
+
{
|
|
450
|
+
onHistoryLoaded: (historical) => {
|
|
451
|
+
if (abortController.signal.aborted) return;
|
|
452
|
+
const timelineMessages = historical.filter(shouldStoreTimelineMessage);
|
|
453
|
+
debugAgentChat('history loaded', {
|
|
454
|
+
agentRunId,
|
|
455
|
+
count: historical.length,
|
|
456
|
+
timelineCount: timelineMessages.length,
|
|
457
|
+
since,
|
|
458
|
+
first: summarizeMessage(historical[0]),
|
|
459
|
+
last: summarizeMessage(historical[historical.length - 1]),
|
|
460
|
+
});
|
|
461
|
+
setInitialHistoryStatus(historical.length > 0 ? 'has_messages' : 'empty');
|
|
462
|
+
if (timelineMessages.length > 0) {
|
|
463
|
+
setMessages((prev) =>
|
|
464
|
+
timelineMessages.reduce((next, message) => {
|
|
465
|
+
if (message.timestamp && message.timestamp > lastDeliveredTsRef.current) {
|
|
466
|
+
lastDeliveredTsRef.current = message.timestamp;
|
|
467
|
+
}
|
|
468
|
+
return insertTimelineMessage(next, message);
|
|
469
|
+
}, prev),
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
onHistoryError: (error) => {
|
|
474
|
+
if (abortController.signal.aborted) return;
|
|
475
|
+
debugAgentChat('history error', {
|
|
476
|
+
agentRunId,
|
|
477
|
+
error: error instanceof Error ? error.message : String(error),
|
|
478
|
+
});
|
|
479
|
+
setInitialHistoryStatus('error');
|
|
480
|
+
},
|
|
481
|
+
},
|
|
281
482
|
)
|
|
282
483
|
.then(() => {
|
|
283
484
|
// The stream resolves when the run reaches a terminal state. The status was
|
|
@@ -285,10 +486,15 @@ export function useAgentStream(client: VertesiaClient, agentRunId: string): UseA
|
|
|
285
486
|
// authoritative status now — otherwise a run that FAILS while the panel is
|
|
286
487
|
// open never surfaces the failed UI until the conversation is remounted.
|
|
287
488
|
if (abortController.signal.aborted) return undefined;
|
|
489
|
+
debugAgentChat('stream resolved', { agentRunId });
|
|
288
490
|
return client.agents
|
|
289
491
|
.getInternals(agentRunId)
|
|
290
492
|
.then((agentRun) => {
|
|
291
493
|
if (!abortController.signal.aborted) {
|
|
494
|
+
debugAgentChat('internals refreshed after stream end', {
|
|
495
|
+
agentRunId,
|
|
496
|
+
status: agentRun.status,
|
|
497
|
+
});
|
|
292
498
|
setAgentRunStatus(agentRun.status?.toUpperCase() ?? null);
|
|
293
499
|
}
|
|
294
500
|
})
|
|
@@ -300,11 +506,16 @@ export function useAgentStream(client: VertesiaClient, agentRunId: string): UseA
|
|
|
300
506
|
})
|
|
301
507
|
.catch((error) => {
|
|
302
508
|
if (!abortController.signal.aborted) {
|
|
509
|
+
debugAgentChat('stream failed', {
|
|
510
|
+
agentRunId,
|
|
511
|
+
error: error instanceof Error ? error.message : String(error),
|
|
512
|
+
});
|
|
303
513
|
console.error('Failed to stream agent messages:', error);
|
|
304
514
|
}
|
|
305
515
|
});
|
|
306
516
|
|
|
307
517
|
return () => {
|
|
518
|
+
debugAgentChat('stream cleanup', { agentRunId, streamNonce });
|
|
308
519
|
abortController.abort();
|
|
309
520
|
// Note: messages are intentionally NOT cleared here. Switching conversations
|
|
310
521
|
// resets them at effect start (isNewConversation); a reconnect must preserve
|
|
@@ -346,6 +557,20 @@ export function useAgentStream(client: VertesiaClient, agentRunId: string): UseA
|
|
|
346
557
|
});
|
|
347
558
|
}, []);
|
|
348
559
|
|
|
560
|
+
const updateOptimisticMessageStatus = useCallback(
|
|
561
|
+
(messageId: string, status: NonNullable<Common.AgentMessageDetails['_deliveryStatus']>) => {
|
|
562
|
+
setMessages((prev) =>
|
|
563
|
+
prev.map((message) => {
|
|
564
|
+
if (message.details?._optimistic && getClientMessageId(message) === messageId) {
|
|
565
|
+
return withDeliveryStatus(message, status);
|
|
566
|
+
}
|
|
567
|
+
return message;
|
|
568
|
+
}),
|
|
569
|
+
);
|
|
570
|
+
},
|
|
571
|
+
[],
|
|
572
|
+
);
|
|
573
|
+
|
|
349
574
|
// Remove optimistic messages matching a predicate
|
|
350
575
|
const removeOptimisticMessages = useCallback((predicate: (msg: AgentMessage) => boolean) => {
|
|
351
576
|
setMessages((prev) => prev.filter((m) => !predicate(m)));
|
|
@@ -355,8 +580,10 @@ export function useAgentStream(client: VertesiaClient, agentRunId: string): UseA
|
|
|
355
580
|
messages,
|
|
356
581
|
streamingMessages,
|
|
357
582
|
isCompleted,
|
|
583
|
+
initialHistoryStatus,
|
|
358
584
|
debugChunkFlash,
|
|
359
585
|
addOptimisticMessage,
|
|
586
|
+
updateOptimisticMessageStatus,
|
|
360
587
|
removeOptimisticMessages,
|
|
361
588
|
reconnect,
|
|
362
589
|
agentRunStatus,
|
|
@@ -15,31 +15,14 @@ export interface ArtifactTreeNode {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// ---------------------------------------------------------------------------
|
|
18
|
-
//
|
|
19
|
-
// conversation snapshots, process state, archives). Hidden by default and
|
|
20
|
-
// revealed via the "Show system files" toggle.
|
|
18
|
+
// Internal files we never show to the user
|
|
21
19
|
// ---------------------------------------------------------------------------
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const SYSTEM_PROCESS_PATTERN = /(^|\/)process\/(history|state)(\/|$)/;
|
|
27
|
-
|
|
28
|
-
// Matched against the file basename.
|
|
29
|
-
const SYSTEM_BASENAME_PATTERNS = [
|
|
30
|
-
/conversation\.json$/, // conversation.json, <id>-conversation.json
|
|
31
|
-
/^conversation-checkpoint-\d+\.json$/,
|
|
32
|
-
/^tools\.json$/,
|
|
33
|
-
/^tool-input-refs\.json$/,
|
|
34
|
-
/^toolu[_-]/i, // per-tool-use input/result hydration payloads
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
export function isSystemArtifact(relativePath: string): boolean {
|
|
38
|
-
if (SYSTEM_DIR_PATTERN.test(relativePath) || SYSTEM_PROCESS_PATTERN.test(relativePath)) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
21
|
+
const INTERNAL_FILE_PATTERNS = [/conversation\.json$/, /-conversation\.json$/, /^tools\.json$/];
|
|
22
|
+
|
|
23
|
+
function isInternalFile(relativePath: string): boolean {
|
|
41
24
|
const basename = relativePath.split('/').pop() ?? relativePath;
|
|
42
|
-
return
|
|
25
|
+
return INTERNAL_FILE_PATTERNS.some((re) => re.test(basename));
|
|
43
26
|
}
|
|
44
27
|
|
|
45
28
|
// ---------------------------------------------------------------------------
|
|
@@ -105,26 +88,15 @@ function stripToRelativePath(fullPath: string, runId: string): string {
|
|
|
105
88
|
// ---------------------------------------------------------------------------
|
|
106
89
|
|
|
107
90
|
export interface UseArtifactsResult {
|
|
108
|
-
/** Tree of the currently visible files (respects `showSystem`). */
|
|
109
91
|
tree: ArtifactTreeNode[];
|
|
110
|
-
/** Currently visible files (respects `showSystem`). */
|
|
111
92
|
flatFiles: string[];
|
|
112
|
-
/** Total number of artifacts in the run, including system files. */
|
|
113
|
-
totalCount: number;
|
|
114
|
-
/** Number of system files currently hidden (0 when `showSystem` is true). */
|
|
115
|
-
systemHiddenCount: number;
|
|
116
93
|
isLoading: boolean;
|
|
117
94
|
error: string | null;
|
|
118
95
|
refresh: () => void;
|
|
119
96
|
}
|
|
120
97
|
|
|
121
|
-
export function useArtifacts(
|
|
122
|
-
|
|
123
|
-
runId: string | undefined,
|
|
124
|
-
refreshKey = 0,
|
|
125
|
-
showSystem = false,
|
|
126
|
-
): UseArtifactsResult {
|
|
127
|
-
const [allFiles, setAllFiles] = useState<string[]>([]);
|
|
98
|
+
export function useArtifacts(client: VertesiaClient, runId: string | undefined, refreshKey = 0): UseArtifactsResult {
|
|
99
|
+
const [flatFiles, setFlatFiles] = useState<string[]>([]);
|
|
128
100
|
const [isLoading, setIsLoading] = useState(false);
|
|
129
101
|
const [error, setError] = useState<string | null>(null);
|
|
130
102
|
const [manualRefreshKey, setManualRefreshKey] = useState(0);
|
|
@@ -141,13 +113,13 @@ export function useArtifacts(
|
|
|
141
113
|
const paths = await client.files.listArtifacts(runId);
|
|
142
114
|
if (fetchId !== fetchIdRef.current) return; // stale
|
|
143
115
|
|
|
144
|
-
const relatives = paths.map((p) => stripToRelativePath(p, runId)).filter((p) =>
|
|
116
|
+
const relatives = paths.map((p) => stripToRelativePath(p, runId)).filter((p) => p && !isInternalFile(p));
|
|
145
117
|
|
|
146
|
-
|
|
118
|
+
setFlatFiles(relatives);
|
|
147
119
|
} catch (err) {
|
|
148
120
|
if (fetchId !== fetchIdRef.current) return;
|
|
149
121
|
setError(err instanceof Error ? err.message : 'Failed to list artifacts');
|
|
150
|
-
|
|
122
|
+
setFlatFiles([]);
|
|
151
123
|
} finally {
|
|
152
124
|
if (fetchId === fetchIdRef.current) {
|
|
153
125
|
setIsLoading(false);
|
|
@@ -161,16 +133,11 @@ export function useArtifacts(
|
|
|
161
133
|
void fetchArtifacts();
|
|
162
134
|
}, [fetchArtifacts, refreshKey, manualRefreshKey]);
|
|
163
135
|
|
|
164
|
-
const flatFiles = useMemo(
|
|
165
|
-
() => (showSystem ? allFiles : allFiles.filter((p) => !isSystemArtifact(p))),
|
|
166
|
-
[allFiles, showSystem],
|
|
167
|
-
);
|
|
168
136
|
const tree = useMemo(() => buildTree(flatFiles), [flatFiles]);
|
|
169
|
-
const systemHiddenCount = allFiles.length - flatFiles.length;
|
|
170
137
|
|
|
171
138
|
const refresh = useCallback(() => {
|
|
172
139
|
setManualRefreshKey((k) => k + 1);
|
|
173
140
|
}, []);
|
|
174
141
|
|
|
175
|
-
return { tree, flatFiles,
|
|
142
|
+
return { tree, flatFiles, isLoading, error, refresh };
|
|
176
143
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export {
|
|
2
|
+
AgentApprovalModeSelector,
|
|
3
|
+
type AgentApprovalModeSelectorProps,
|
|
4
|
+
} from './AgentApprovalModeSelector';
|
|
1
5
|
export {
|
|
2
6
|
AgentChart,
|
|
3
7
|
type AgentChartSpec,
|
|
@@ -24,7 +28,12 @@ export {
|
|
|
24
28
|
type ConfirmationWidgetProps,
|
|
25
29
|
} from './AskUserWidget';
|
|
26
30
|
export * from './JumpingDots';
|
|
27
|
-
export {
|
|
31
|
+
export {
|
|
32
|
+
ModernAgentConversation,
|
|
33
|
+
type ModernAgentConversationProps,
|
|
34
|
+
type StartWorkflowFn,
|
|
35
|
+
type StartWorkflowOptions,
|
|
36
|
+
} from './ModernAgentConversation';
|
|
28
37
|
// AgentConversationViewMode type for external use
|
|
29
38
|
export type {
|
|
30
39
|
AgentConversationViewMode,
|
|
@@ -180,3 +180,45 @@ export function getWorkstreamLaunchDetails(message: AgentMessage): WorkstreamLau
|
|
|
180
180
|
typeof details.child_workflow_run_id === 'string' ? details.child_workflow_run_id : undefined,
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
|
+
|
|
184
|
+
export function getWorkstreamActivityDetails(message: AgentMessage): WorkstreamLaunchDetails | null {
|
|
185
|
+
const details = message.details as
|
|
186
|
+
| {
|
|
187
|
+
event_class?: unknown;
|
|
188
|
+
workstream_event?: unknown;
|
|
189
|
+
workstream_id?: unknown;
|
|
190
|
+
launch_id?: unknown;
|
|
191
|
+
kind?: unknown;
|
|
192
|
+
interaction?: unknown;
|
|
193
|
+
child_workflow_id?: unknown;
|
|
194
|
+
child_workflow_run_id?: unknown;
|
|
195
|
+
}
|
|
196
|
+
| undefined;
|
|
197
|
+
|
|
198
|
+
if (details?.event_class !== 'activity') return null;
|
|
199
|
+
if (details.workstream_event !== undefined) return null;
|
|
200
|
+
if (message.type === AgentMessageType.ERROR) return null;
|
|
201
|
+
|
|
202
|
+
const childWorkflowId = typeof details.child_workflow_id === 'string' ? details.child_workflow_id : undefined;
|
|
203
|
+
const childWorkflowRunId =
|
|
204
|
+
typeof details.child_workflow_run_id === 'string' ? details.child_workflow_run_id : undefined;
|
|
205
|
+
if (!childWorkflowId && !childWorkflowRunId) return null;
|
|
206
|
+
|
|
207
|
+
const workstreamId =
|
|
208
|
+
typeof details.workstream_id === 'string' && details.workstream_id.trim()
|
|
209
|
+
? details.workstream_id
|
|
210
|
+
: typeof message.workstream_id === 'string'
|
|
211
|
+
? message.workstream_id
|
|
212
|
+
: '';
|
|
213
|
+
|
|
214
|
+
if (!isNonMainWorkstreamId(workstreamId)) return null;
|
|
215
|
+
|
|
216
|
+
return {
|
|
217
|
+
workstreamId,
|
|
218
|
+
launchId: typeof details.launch_id === 'string' ? details.launch_id : undefined,
|
|
219
|
+
kind: typeof details.kind === 'string' ? details.kind : undefined,
|
|
220
|
+
interaction: typeof details.interaction === 'string' ? details.interaction : undefined,
|
|
221
|
+
childWorkflowId,
|
|
222
|
+
childWorkflowRunId,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
@@ -25,6 +25,15 @@ interface AgentRunnerFacetsNavProps {
|
|
|
25
25
|
search: SearchInterface;
|
|
26
26
|
actions?: React.ReactNode[];
|
|
27
27
|
selectionCount?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Optional controlled filter state. When provided, the parent owns the filter list so other
|
|
30
|
+
* surfaces — e.g. per-row "quick filter" buttons in the table — can add filters that show up in
|
|
31
|
+
* the filter bar. The filter→query translation still happens inside this component, so the parent
|
|
32
|
+
* only needs a plain state setter. When omitted, the component manages its own filter state.
|
|
33
|
+
*/
|
|
34
|
+
filters?: BaseFilter[];
|
|
35
|
+
setFilters?: React.Dispatch<React.SetStateAction<BaseFilter[]>>;
|
|
36
|
+
filterGroups?: FilterGroup[];
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
// Hook to create filter groups for agent runners
|
|
@@ -98,13 +107,24 @@ export function createAgentRunnerFilterHandler(search: SearchInterface) {
|
|
|
98
107
|
}
|
|
99
108
|
|
|
100
109
|
// Legacy component for backward compatibility
|
|
101
|
-
export function AgentRunnerFacetsNav({
|
|
102
|
-
|
|
110
|
+
export function AgentRunnerFacetsNav({
|
|
111
|
+
facets,
|
|
112
|
+
search,
|
|
113
|
+
selectionCount,
|
|
114
|
+
actions,
|
|
115
|
+
filters: controlledFilters,
|
|
116
|
+
setFilters: controlledSetFilters,
|
|
117
|
+
filterGroups: controlledFilterGroups,
|
|
118
|
+
}: AgentRunnerFacetsNavProps) {
|
|
119
|
+
const [internalFilters, setInternalFilters] = useState<BaseFilter[]>([]);
|
|
120
|
+
const filters = controlledFilters ?? internalFilters;
|
|
121
|
+
const setFilters = controlledSetFilters ?? setInternalFilters;
|
|
103
122
|
const didMountRef = useRef(false);
|
|
104
123
|
const skipNextSearchRef = useRef(
|
|
105
124
|
typeof window !== 'undefined' && Boolean(new URLSearchParams(window.location.search).get('filters')),
|
|
106
125
|
);
|
|
107
|
-
const
|
|
126
|
+
const internalFilterGroups = useAgentRunnerFilterGroups(facets);
|
|
127
|
+
const filterGroups = controlledFilterGroups ?? internalFilterGroups;
|
|
108
128
|
const handleFilterLogic = useMemo(() => createAgentRunnerFilterHandler(search), [search]);
|
|
109
129
|
|
|
110
130
|
useEffect(() => {
|