@parhelia/core 0.1.12556 → 0.1.12565
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/dist/agents-view/AgentCard.d.ts +6 -4
- package/dist/agents-view/AgentCard.js +143 -24
- package/dist/agents-view/AgentCard.js.map +1 -1
- package/dist/agents-view/AgentsInbox.d.ts +1 -1
- package/dist/agents-view/AgentsInbox.js +7 -92
- package/dist/agents-view/AgentsInbox.js.map +1 -1
- package/dist/agents-view/AgentsTitlebar.js +3 -2
- package/dist/agents-view/AgentsTitlebar.js.map +1 -1
- package/dist/agents-view/AgentsView.d.ts +6 -7
- package/dist/agents-view/AgentsView.js +191 -99
- package/dist/agents-view/AgentsView.js.map +1 -1
- package/dist/agents-view/AgentsWorkspaceView.d.ts +2 -6
- package/dist/agents-view/AgentsWorkspaceView.js +266 -113
- package/dist/agents-view/AgentsWorkspaceView.js.map +1 -1
- package/dist/agents-view/ProfileAgentsGroup.d.ts +2 -1
- package/dist/agents-view/ProfileAgentsGroup.js +4 -3
- package/dist/agents-view/ProfileAgentsGroup.js.map +1 -1
- package/dist/components/ActionButton.d.ts +1 -1
- package/dist/components/ActionButton.js.map +1 -1
- package/dist/components/FilterInput.d.ts +1 -1
- package/dist/components/FilterInput.js +1 -1
- package/dist/components/FilterInput.js.map +1 -1
- package/dist/components/ui/LanguageSelector.js +2 -4
- package/dist/components/ui/LanguageSelector.js.map +1 -1
- package/dist/components/ui/PlaceholderInput.js +3 -3
- package/dist/components/ui/PlaceholderInput.js.map +1 -1
- package/dist/components/ui/PlaceholderInputTypes.js +1 -1
- package/dist/components/ui/PlaceholderInputTypes.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +1 -1
- package/dist/components/ui/alert-dialog.js +6 -10
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/button.d.ts +4 -4
- package/dist/components/ui/button.js +4 -1
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +1 -1
- package/dist/components/ui/context-menu.js +12 -4
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/copy-button.d.ts +2 -1
- package/dist/components/ui/copy-button.js +2 -2
- package/dist/components/ui/copy-button.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +1 -1
- package/dist/components/ui/dialog.js +21 -126
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.js +5 -3
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/paste-button.d.ts +2 -1
- package/dist/components/ui/paste-button.js +2 -2
- package/dist/components/ui/paste-button.js.map +1 -1
- package/dist/components/ui/popover.js +1 -9
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/styled-dialog-title.js +1 -1
- package/dist/components/ui/styled-dialog-title.js.map +1 -1
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/components/ui/tabs.js +4 -11
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/config/config.d.ts +4 -2
- package/dist/config/config.js +250 -70
- package/dist/config/config.js.map +1 -1
- package/dist/config/notificationRoutes.js +14 -0
- package/dist/config/notificationRoutes.js.map +1 -1
- package/dist/config/types/workspace.d.ts +6 -0
- package/dist/config/types.d.ts +63 -12
- package/dist/config/types.js.map +1 -1
- package/dist/editor/ConfirmationDialog.js +20 -4
- package/dist/editor/ConfirmationDialog.js.map +1 -1
- package/dist/editor/ContentTree.d.ts +2 -1
- package/dist/editor/ContentTree.js +93 -32
- package/dist/editor/ContentTree.js.map +1 -1
- package/dist/editor/Editor.js +87 -22
- package/dist/editor/Editor.js.map +1 -1
- package/dist/editor/FieldHistory.js +84 -36
- package/dist/editor/FieldHistory.js.map +1 -1
- package/dist/editor/FieldListField.js +21 -9
- package/dist/editor/FieldListField.js.map +1 -1
- package/dist/editor/FieldListFieldWithFallbacks.js +23 -2
- package/dist/editor/FieldListFieldWithFallbacks.js.map +1 -1
- package/dist/editor/GlobalMenuBar.js +29 -2
- package/dist/editor/GlobalMenuBar.js.map +1 -1
- package/dist/editor/ImageEditor.js +5 -2
- package/dist/editor/ImageEditor.js.map +1 -1
- package/dist/editor/ItemInfo.js +36 -1
- package/dist/editor/ItemInfo.js.map +1 -1
- package/dist/editor/LinkEditorDialog.js +3 -0
- package/dist/editor/LinkEditorDialog.js.map +1 -1
- package/dist/editor/MainLayout.d.ts +0 -2
- package/dist/editor/MainLayout.js +65 -8
- package/dist/editor/MainLayout.js.map +1 -1
- package/dist/editor/MigrationsView.js +29 -5
- package/dist/editor/MigrationsView.js.map +1 -1
- package/dist/editor/MobileLayout.js +37 -12
- package/dist/editor/MobileLayout.js.map +1 -1
- package/dist/editor/PictureCropper.js +54 -45
- package/dist/editor/PictureCropper.js.map +1 -1
- package/dist/editor/PictureEditor.js +17 -15
- package/dist/editor/PictureEditor.js.map +1 -1
- package/dist/editor/QuickItemSwitcher.js +21 -21
- package/dist/editor/QuickItemSwitcher.js.map +1 -1
- package/dist/editor/SetupWizard.js +52 -12
- package/dist/editor/SetupWizard.js.map +1 -1
- package/dist/editor/Titlebar.js +7 -2
- package/dist/editor/Titlebar.js.map +1 -1
- package/dist/editor/ai/AgentCostDisplay.d.ts +1 -0
- package/dist/editor/ai/AgentCostDisplay.js +1 -1
- package/dist/editor/ai/AgentCostDisplay.js.map +1 -1
- package/dist/editor/ai/AgentDocumentList.js +32 -14
- package/dist/editor/ai/AgentDocumentList.js.map +1 -1
- package/dist/editor/ai/AgentGreeting.js +3 -2
- package/dist/editor/ai/AgentGreeting.js.map +1 -1
- package/dist/editor/ai/AgentProfileSelector.js +2 -1
- package/dist/editor/ai/AgentProfileSelector.js.map +1 -1
- package/dist/editor/ai/AgentStatusBadge.d.ts +0 -5
- package/dist/editor/ai/AgentStatusBadge.js +67 -65
- package/dist/editor/ai/AgentStatusBadge.js.map +1 -1
- package/dist/editor/ai/AgentTerminal.d.ts +14 -2
- package/dist/editor/ai/AgentTerminal.js +2406 -496
- package/dist/editor/ai/AgentTerminal.js.map +1 -1
- package/dist/editor/ai/AgentTerminalStatusBar.d.ts +8 -3
- package/dist/editor/ai/AgentTerminalStatusBar.js +481 -56
- package/dist/editor/ai/AgentTerminalStatusBar.js.map +1 -1
- package/dist/editor/ai/Agents.js +161 -113
- package/dist/editor/ai/Agents.js.map +1 -1
- package/dist/editor/ai/AiResponseMessage.d.ts +10 -1
- package/dist/editor/ai/AiResponseMessage.js +267 -26
- package/dist/editor/ai/AiResponseMessage.js.map +1 -1
- package/dist/editor/ai/ContextInfoBar.d.ts +2 -3
- package/dist/editor/ai/ContextInfoBar.js +64 -7
- package/dist/editor/ai/ContextInfoBar.js.map +1 -1
- package/dist/editor/ai/GuidanceOverlay.js +17 -11
- package/dist/editor/ai/GuidanceOverlay.js.map +1 -1
- package/dist/editor/ai/InlineAiDialog.d.ts +1 -1
- package/dist/editor/ai/InlineAiDialog.js +514 -192
- package/dist/editor/ai/InlineAiDialog.js.map +1 -1
- package/dist/editor/ai/InlineAiTrigger.js +115 -12
- package/dist/editor/ai/InlineAiTrigger.js.map +1 -1
- package/dist/editor/ai/MediaImage.js +40 -8
- package/dist/editor/ai/MediaImage.js.map +1 -1
- package/dist/editor/ai/SpawnedAgentsPanel.js +10 -12
- package/dist/editor/ai/SpawnedAgentsPanel.js.map +1 -1
- package/dist/editor/ai/ToolCallDisplay.d.ts +22 -2
- package/dist/editor/ai/ToolCallDisplay.js +542 -150
- package/dist/editor/ai/ToolCallDisplay.js.map +1 -1
- package/dist/editor/ai/agentDiagnostics.d.ts +7 -0
- package/dist/editor/ai/agentDiagnostics.js.map +1 -1
- package/dist/editor/ai/dialogs/AgentDialogHandler.d.ts +1 -8
- package/dist/editor/ai/dialogs/AgentDialogHandler.js +379 -42
- package/dist/editor/ai/dialogs/AgentDialogHandler.js.map +1 -1
- package/dist/editor/ai/dialogs/QuestionnaireInline.d.ts +5 -1
- package/dist/editor/ai/dialogs/QuestionnaireInline.js +628 -60
- package/dist/editor/ai/dialogs/QuestionnaireInline.js.map +1 -1
- package/dist/editor/ai/dialogs/agentDialogTypes.d.ts +115 -0
- package/dist/editor/ai/dialogs/agentDialogTypes.js +2 -0
- package/dist/editor/ai/dialogs/agentDialogTypes.js.map +1 -1
- package/dist/editor/ai/types.d.ts +3 -1
- package/dist/editor/ai/useAgentStatus.d.ts +2 -1
- package/dist/editor/ai/useAgentStatus.js +90 -100
- package/dist/editor/ai/useAgentStatus.js.map +1 -1
- package/dist/editor/ai/useInlineAiPosition.js +45 -5
- package/dist/editor/ai/useInlineAiPosition.js.map +1 -1
- package/dist/editor/client/AboutDialog.js +4 -2
- package/dist/editor/client/AboutDialog.js.map +1 -1
- package/dist/editor/client/EditorShell.d.ts +4 -1
- package/dist/editor/client/EditorShell.js +770 -237
- package/dist/editor/client/EditorShell.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +33 -19
- package/dist/editor/client/editContext.js.map +1 -1
- package/dist/editor/client/helpers.js +6 -0
- package/dist/editor/client/helpers.js.map +1 -1
- package/dist/editor/client/hooks/useEditorUrlSync.js +1 -2
- package/dist/editor/client/hooks/useEditorUrlSync.js.map +1 -1
- package/dist/editor/client/hooks/useEditorWebSocket.d.ts +10 -0
- package/dist/editor/client/hooks/useEditorWebSocket.js +209 -14
- package/dist/editor/client/hooks/useEditorWebSocket.js.map +1 -1
- package/dist/editor/client/hooks/useQuota.d.ts +8 -0
- package/dist/editor/client/hooks/useQuota.js.map +1 -1
- package/dist/editor/client/hooks/useSocketMessageHandler.js +73 -15
- package/dist/editor/client/hooks/useSocketMessageHandler.js.map +1 -1
- package/dist/editor/client/itemsRepository.js +10 -6
- package/dist/editor/client/itemsRepository.js.map +1 -1
- package/dist/editor/client/navigation.js +35 -3
- package/dist/editor/client/navigation.js.map +1 -1
- package/dist/editor/client/operations.d.ts +6 -3
- package/dist/editor/client/operations.js +208 -30
- package/dist/editor/client/operations.js.map +1 -1
- package/dist/editor/client/pageModelBuilder.js +4 -31
- package/dist/editor/client/pageModelBuilder.js.map +1 -1
- package/dist/editor/client/ui/DevModeIndicator.js +2 -2
- package/dist/editor/client/ui/DevModeIndicator.js.map +1 -1
- package/dist/editor/client/ui/EditorChrome.d.ts +0 -6
- package/dist/editor/client/ui/EditorChrome.js +55 -72
- package/dist/editor/client/ui/EditorChrome.js.map +1 -1
- package/dist/editor/client/ui/FullscreenControls.js +5 -3
- package/dist/editor/client/ui/FullscreenControls.js.map +1 -1
- package/dist/editor/commands/commands.d.ts +11 -1
- package/dist/editor/commands/commands.js +12 -1
- package/dist/editor/commands/commands.js.map +1 -1
- package/dist/editor/commands/componentCommands.js +109 -55
- package/dist/editor/commands/componentCommands.js.map +1 -1
- package/dist/editor/commands/customCommandConverter.d.ts +8 -1
- package/dist/editor/commands/customCommandConverter.js +35 -5
- package/dist/editor/commands/customCommandConverter.js.map +1 -1
- package/dist/editor/commands/handlers/agentHandler.js +2 -1
- package/dist/editor/commands/handlers/agentHandler.js.map +1 -1
- package/dist/editor/commands/itemCommands.d.ts +3 -0
- package/dist/editor/commands/itemCommands.js +93 -10
- package/dist/editor/commands/itemCommands.js.map +1 -1
- package/dist/editor/commands/undo.d.ts +9 -15
- package/dist/editor/commands/undo.js +24 -0
- package/dist/editor/commands/undo.js.map +1 -1
- package/dist/editor/context-menu/InsertMenu.js +83 -39
- package/dist/editor/context-menu/InsertMenu.js.map +1 -1
- package/dist/editor/field-types/MultiLineText.js +1 -1
- package/dist/editor/field-types/MultiLineText.js.map +1 -1
- package/dist/editor/field-types/RawEditor.js +1 -1
- package/dist/editor/field-types/RichTextEditor.js +13 -5
- package/dist/editor/field-types/RichTextEditor.js.map +1 -1
- package/dist/editor/field-types/RichTextEditorComponent.js +37 -3
- package/dist/editor/field-types/RichTextEditorComponent.js.map +1 -1
- package/dist/editor/field-types/SingleLineText.js +1 -1
- package/dist/editor/field-types/TreeListEditor.js +3 -2
- package/dist/editor/field-types/TreeListEditor.js.map +1 -1
- package/dist/editor/field-types/richtext/components/ReactSlate.css +23 -5
- package/dist/editor/field-types/richtext/components/ReactSlate.d.ts +2 -0
- package/dist/editor/field-types/richtext/components/ReactSlate.js +28 -4
- package/dist/editor/field-types/richtext/components/ReactSlate.js.map +1 -1
- package/dist/editor/field-types/richtext/components/ToolbarButton.js +4 -2
- package/dist/editor/field-types/richtext/components/ToolbarButton.js.map +1 -1
- package/dist/editor/field-types/richtext/contextMenuFactory.d.ts +13 -0
- package/dist/editor/field-types/richtext/contextMenuFactory.js +181 -24
- package/dist/editor/field-types/richtext/contextMenuFactory.js.map +1 -1
- package/dist/editor/field-types/richtext/types.d.ts +2 -0
- package/dist/editor/field-types/richtext/types.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/plugins.js +4 -0
- package/dist/editor/field-types/richtext/utils/plugins.js.map +1 -1
- package/dist/editor/field-types/textContextMenuFactory.js +3 -2
- package/dist/editor/field-types/textContextMenuFactory.js.map +1 -1
- package/dist/editor/media-selector/AiImageSearchPrompt.js +4 -2
- package/dist/editor/media-selector/AiImageSearchPrompt.js.map +1 -1
- package/dist/editor/media-selector/MediaFolderBrowser.js +1 -1
- package/dist/editor/media-selector/MediaFolderBrowser.js.map +1 -1
- package/dist/editor/media-selector/MediaSelector.js +7 -1
- package/dist/editor/media-selector/MediaSelector.js.map +1 -1
- package/dist/editor/media-selector/TreeSelector.js +40 -35
- package/dist/editor/media-selector/TreeSelector.js.map +1 -1
- package/dist/editor/menubar/ActiveUsers.js +1 -1
- package/dist/editor/menubar/ActiveUsers.js.map +1 -1
- package/dist/editor/menubar/GenericToolbar.js +4 -2
- package/dist/editor/menubar/GenericToolbar.js.map +1 -1
- package/dist/editor/menubar/ItemLanguageVersion.js +2 -2
- package/dist/editor/menubar/ItemLanguageVersion.js.map +1 -1
- package/dist/editor/menubar/PageSelector.js +26 -147
- package/dist/editor/menubar/PageSelector.js.map +1 -1
- package/dist/editor/menubar/Separator.js +1 -1
- package/dist/editor/menubar/VersionSelector.js +2 -4
- package/dist/editor/menubar/VersionSelector.js.map +1 -1
- package/dist/editor/menubar/WorkflowButton.js +39 -12
- package/dist/editor/menubar/WorkflowButton.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/CustomCommandsToolbar.js +16 -38
- package/dist/editor/menubar/toolbar-sections/CustomCommandsToolbar.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/EditControls.js +3 -3
- package/dist/editor/menubar/toolbar-sections/EditControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/HelpButton.js +1 -0
- package/dist/editor/menubar/toolbar-sections/HelpButton.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.d.ts +6 -10
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.js +597 -220
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js +13 -2
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js.map +1 -1
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +42 -1
- package/dist/editor/page-editor-chrome/CommentHighlighting.js.map +1 -1
- package/dist/editor/page-editor-chrome/FrameMenu.js +1 -1
- package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -1
- package/dist/editor/page-editor-chrome/InlineEditor.js +97 -48
- package/dist/editor/page-editor-chrome/InlineEditor.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +38 -17
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +17 -11
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js.map +1 -1
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js +301 -301
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js.map +1 -1
- package/dist/editor/page-viewer/DeviceToolbar.js +1 -1
- package/dist/editor/page-viewer/DeviceToolbar.js.map +1 -1
- package/dist/editor/page-viewer/EditorForm.js +69 -11
- package/dist/editor/page-viewer/EditorForm.js.map +1 -1
- package/dist/editor/page-viewer/MiniMap.d.ts +2 -4
- package/dist/editor/page-viewer/MiniMap.js +91 -28
- package/dist/editor/page-viewer/MiniMap.js.map +1 -1
- package/dist/editor/page-viewer/PageViewer.d.ts +3 -1
- package/dist/editor/page-viewer/PageViewer.js +92 -19
- package/dist/editor/page-viewer/PageViewer.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +2 -1
- package/dist/editor/page-viewer/PageViewerFrame.js +348 -115
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js +114 -49
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js.map +1 -1
- package/dist/editor/page-viewer/pageViewContext.d.ts +1 -0
- package/dist/editor/page-viewer/pageViewContext.js +51 -14
- package/dist/editor/page-viewer/pageViewContext.js.map +1 -1
- package/dist/editor/pageModel.d.ts +14 -1
- package/dist/editor/reviews/Comment.js +26 -12
- package/dist/editor/reviews/Comment.js.map +1 -1
- package/dist/editor/reviews/CommentDisplayPopover.js +7 -5
- package/dist/editor/reviews/CommentDisplayPopover.js.map +1 -1
- package/dist/editor/reviews/CommentView.js +19 -4
- package/dist/editor/reviews/CommentView.js.map +1 -1
- package/dist/editor/reviews/Comments.js +89 -72
- package/dist/editor/reviews/Comments.js.map +1 -1
- package/dist/editor/reviews/CreateReviewDialog.js +281 -177
- package/dist/editor/reviews/CreateReviewDialog.js.map +1 -1
- package/dist/editor/reviews/DecisionsMatrix.js +96 -25
- package/dist/editor/reviews/DecisionsMatrix.js.map +1 -1
- package/dist/editor/reviews/DiffView.js +7 -14
- package/dist/editor/reviews/DiffView.js.map +1 -1
- package/dist/editor/reviews/EditReviewSettingsDialog.js +6 -4
- package/dist/editor/reviews/EditReviewSettingsDialog.js.map +1 -1
- package/dist/editor/reviews/MultiReviewManager.js +25 -3
- package/dist/editor/reviews/MultiReviewManager.js.map +1 -1
- package/dist/editor/reviews/PagesPanel.js +31 -15
- package/dist/editor/reviews/PagesPanel.js.map +1 -1
- package/dist/editor/reviews/PreviewInfo.js +1 -4
- package/dist/editor/reviews/PreviewInfo.js.map +1 -1
- package/dist/editor/reviews/ReviewCard.js +13 -7
- package/dist/editor/reviews/ReviewCard.js.map +1 -1
- package/dist/editor/reviews/ReviewDetail.js +3 -2
- package/dist/editor/reviews/ReviewDetail.js.map +1 -1
- package/dist/editor/reviews/ReviewsList.js +7 -3
- package/dist/editor/reviews/ReviewsList.js.map +1 -1
- package/dist/editor/reviews/SuggestedEdit.js +34 -3
- package/dist/editor/reviews/SuggestedEdit.js.map +1 -1
- package/dist/editor/reviews/SuggestionDisplayPopover.js +31 -5
- package/dist/editor/reviews/SuggestionDisplayPopover.js.map +1 -1
- package/dist/editor/reviews/commentAi.js +25 -6
- package/dist/editor/reviews/commentAi.js.map +1 -1
- package/dist/editor/reviews/reviewCommands.js +4 -1
- package/dist/editor/reviews/reviewCommands.js.map +1 -1
- package/dist/editor/reviews/useMultiReview.js +2 -2
- package/dist/editor/reviews/useMultiReview.js.map +1 -1
- package/dist/editor/reviews/useReviews.d.ts +2 -2
- package/dist/editor/reviews/useReviews.js +12 -30
- package/dist/editor/reviews/useReviews.js.map +1 -1
- package/dist/editor/services/agentErrorMessage.d.ts +1 -0
- package/dist/editor/services/agentErrorMessage.js +91 -0
- package/dist/editor/services/agentErrorMessage.js.map +1 -0
- package/dist/editor/services/agentService.d.ts +229 -5
- package/dist/editor/services/agentService.js +292 -39
- package/dist/editor/services/agentService.js.map +1 -1
- package/dist/editor/services/agentStatus.d.ts +1 -0
- package/dist/editor/services/agentStatus.js +19 -0
- package/dist/editor/services/agentStatus.js.map +1 -1
- package/dist/editor/services/aiService.d.ts +57 -1
- package/dist/editor/services/aiService.js +79 -6
- package/dist/editor/services/aiService.js.map +1 -1
- package/dist/editor/services/contentService.d.ts +6 -3
- package/dist/editor/services/contentService.js +13 -12
- package/dist/editor/services/contentService.js.map +1 -1
- package/dist/editor/services/editService.d.ts +52 -1
- package/dist/editor/services/editService.js +94 -2
- package/dist/editor/services/editService.js.map +1 -1
- package/dist/editor/services/indexService.js +1 -1
- package/dist/editor/services/indexService.js.map +1 -1
- package/dist/editor/services/reviewsService.d.ts +3 -6
- package/dist/editor/services/reviewsService.js +2 -11
- package/dist/editor/services/reviewsService.js.map +1 -1
- package/dist/editor/services/serviceHelper.d.ts +2 -1
- package/dist/editor/services/serviceHelper.js +112 -20
- package/dist/editor/services/serviceHelper.js.map +1 -1
- package/dist/editor/services/systemService.d.ts +2 -1
- package/dist/editor/services/systemService.js +3 -0
- package/dist/editor/services/systemService.js.map +1 -1
- package/dist/editor/services-server/api.d.ts +1 -2
- package/dist/editor/services-server/api.js +11 -6
- package/dist/editor/services-server/api.js.map +1 -1
- package/dist/editor/settings/About.js +317 -3
- package/dist/editor/settings/About.js.map +1 -1
- package/dist/editor/settings/QuotaInfo.js +210 -4
- package/dist/editor/settings/QuotaInfo.js.map +1 -1
- package/dist/editor/settings/SettingsView.js +25 -23
- package/dist/editor/settings/SettingsView.js.map +1 -1
- package/dist/editor/settings/Status.js +7 -6
- package/dist/editor/settings/Status.js.map +1 -1
- package/dist/editor/settings/index/useIndexStatus.js +20 -22
- package/dist/editor/settings/index/useIndexStatus.js.map +1 -1
- package/dist/editor/settings/panels/AgentsPanel.d.ts +0 -4
- package/dist/editor/settings/panels/AgentsPanel.js +95 -121
- package/dist/editor/settings/panels/AgentsPanel.js.map +1 -1
- package/dist/editor/settings/panels/ModelsPanel.js +329 -108
- package/dist/editor/settings/panels/ModelsPanel.js.map +1 -1
- package/dist/editor/settings/panels/ProvidersPanel.d.ts +1 -1
- package/dist/editor/settings/panels/ProvidersPanel.js +86 -59
- package/dist/editor/settings/panels/ProvidersPanel.js.map +1 -1
- package/dist/editor/settings/panels/SearchConfigPanel.js +4 -4
- package/dist/editor/settings/panels/SearchConfigPanel.js.map +1 -1
- package/dist/editor/settings/panels/index.d.ts +3 -2
- package/dist/editor/settings/panels/index.js +3 -2
- package/dist/editor/settings/panels/index.js.map +1 -1
- package/dist/editor/settings/status/coreStatusChecks.js +124 -19
- package/dist/editor/settings/status/coreStatusChecks.js.map +1 -1
- package/dist/editor/settings/status/useStartupChecks.d.ts +3 -1
- package/dist/editor/settings/status/useStartupChecks.js +9 -5
- package/dist/editor/settings/status/useStartupChecks.js.map +1 -1
- package/dist/editor/setup-wizard/steps/CompleteStep.d.ts +2 -1
- package/dist/editor/setup-wizard/steps/CompleteStep.js +2 -1
- package/dist/editor/setup-wizard/steps/CompleteStep.js.map +1 -1
- package/dist/editor/sidebar/ComponentPalette.js +2 -1
- package/dist/editor/sidebar/ComponentPalette.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.d.ts +8 -1
- package/dist/editor/sidebar/ComponentTree.js +216 -69
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/sidebar/EditHistory.js +22 -46
- package/dist/editor/sidebar/EditHistory.js.map +1 -1
- package/dist/editor/sidebar/Favorites.js +4 -8
- package/dist/editor/sidebar/Favorites.js.map +1 -1
- package/dist/editor/sidebar/MainContentTree.js +4 -3
- package/dist/editor/sidebar/MainContentTree.js.map +1 -1
- package/dist/editor/sidebar/OperationItem.js +21 -7
- package/dist/editor/sidebar/OperationItem.js.map +1 -1
- package/dist/editor/sidebar/SidebarPanel.d.ts +3 -1
- package/dist/editor/sidebar/SidebarPanel.js +44 -12
- package/dist/editor/sidebar/SidebarPanel.js.map +1 -1
- package/dist/editor/sidebar/SidebarStack.d.ts +2 -1
- package/dist/editor/sidebar/SidebarStack.js +4 -3
- package/dist/editor/sidebar/SidebarStack.js.map +1 -1
- package/dist/editor/sidebar/Validation.js +24 -12
- package/dist/editor/sidebar/Validation.js.map +1 -1
- package/dist/editor/sidebar/Workbox.js +53 -3
- package/dist/editor/sidebar/Workbox.js.map +1 -1
- package/dist/editor/sidebar/WorkspaceRail.d.ts +0 -1
- package/dist/editor/sidebar/WorkspaceRail.js +56 -167
- package/dist/editor/sidebar/WorkspaceRail.js.map +1 -1
- package/dist/editor/tree-indicators/GutterColumns.d.ts +3 -1
- package/dist/editor/tree-indicators/GutterColumns.js +26 -5
- package/dist/editor/tree-indicators/GutterColumns.js.map +1 -1
- package/dist/editor/tree-indicators/GutterContext.d.ts +4 -0
- package/dist/editor/tree-indicators/GutterContext.js +23 -0
- package/dist/editor/tree-indicators/GutterContext.js.map +1 -1
- package/dist/editor/tree-indicators/index.d.ts +0 -1
- package/dist/editor/tree-indicators/index.js +0 -1
- package/dist/editor/tree-indicators/index.js.map +1 -1
- package/dist/editor/tree-indicators/types.d.ts +12 -1
- package/dist/editor/ui/CopyMoveTargetSelectorDialog.js +1 -1
- package/dist/editor/ui/CopyMoveTargetSelectorDialog.js.map +1 -1
- package/dist/editor/ui/Icons.js +1 -1
- package/dist/editor/ui/Icons.js.map +1 -1
- package/dist/editor/ui/ItemNameDialogNew.d.ts +2 -0
- package/dist/editor/ui/ItemNameDialogNew.js +33 -17
- package/dist/editor/ui/ItemNameDialogNew.js.map +1 -1
- package/dist/editor/ui/ItemSearch.js +7 -11
- package/dist/editor/ui/ItemSearch.js.map +1 -1
- package/dist/editor/ui/SimpleIconButton.js +1 -1
- package/dist/editor/ui/SimpleIconButton.js.map +1 -1
- package/dist/editor/ui/SimpleTabs.d.ts +1 -0
- package/dist/editor/ui/SimpleTabs.js +45 -25
- package/dist/editor/ui/SimpleTabs.js.map +1 -1
- package/dist/editor/ui/Splitter.d.ts +1 -0
- package/dist/editor/ui/Splitter.js +102 -86
- package/dist/editor/ui/Splitter.js.map +1 -1
- package/dist/editor/ui/TemplateSelectorDialog.js +4 -4
- package/dist/editor/ui/TemplateSelectorDialog.js.map +1 -1
- package/dist/editor/ui/TreeListSelector.d.ts +6 -1
- package/dist/editor/ui/TreeListSelector.js +2 -2
- package/dist/editor/ui/TreeListSelector.js.map +1 -1
- package/dist/editor/utils/keyboardNavigation.d.ts +6 -20
- package/dist/editor/utils/keyboardNavigation.js +48 -140
- package/dist/editor/utils/keyboardNavigation.js.map +1 -1
- package/dist/editor/utils.js +19 -9
- package/dist/editor/utils.js.map +1 -1
- package/dist/editor/views/CompareView.d.ts +3 -1
- package/dist/editor/views/CompareView.js +7 -5
- package/dist/editor/views/CompareView.js.map +1 -1
- package/dist/editor/views/EditView.js +1 -1
- package/dist/editor/views/EditView.js.map +1 -1
- package/dist/editor/views/EditorSlot.js +27 -34
- package/dist/editor/views/EditorSlot.js.map +1 -1
- package/dist/editor/views/ItemEditor.js +7 -3
- package/dist/editor/views/ItemEditor.js.map +1 -1
- package/dist/editor/views/MediaFolderEditView.js +1 -1
- package/dist/editor/views/MediaFolderEditView.js.map +1 -1
- package/dist/editor/views/ParheliaView.js +5 -6
- package/dist/editor/views/ParheliaView.js.map +1 -1
- package/dist/editor/views/SingleEditView.d.ts +2 -1
- package/dist/editor/views/SingleEditView.js +10 -8
- package/dist/editor/views/SingleEditView.js.map +1 -1
- package/dist/editor/views/editorSlotContext.js +35 -6
- package/dist/editor/views/editorSlotContext.js.map +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/setup/services/setupWizardService.d.ts +40 -13
- package/dist/setup/services/setupWizardService.js +32 -17
- package/dist/setup/services/setupWizardService.js.map +1 -1
- package/dist/setup/wizard/steps/AddModelDialog.js +12 -3
- package/dist/setup/wizard/steps/AddModelDialog.js.map +1 -1
- package/dist/setup/wizard/steps/ImportModelDialog.js +39 -22
- package/dist/setup/wizard/steps/ImportModelDialog.js.map +1 -1
- package/dist/splash-screen/ModernSplashScreen.js +112 -32
- package/dist/splash-screen/ModernSplashScreen.js.map +1 -1
- package/dist/splash-screen/NewPage.js +33 -50
- package/dist/splash-screen/NewPage.js.map +1 -1
- package/dist/splash-screen/OpenPage.js +2 -6
- package/dist/splash-screen/OpenPage.js.map +1 -1
- package/dist/splash-screen/ParheliaAssistantChat.js +12 -29
- package/dist/splash-screen/ParheliaAssistantChat.js.map +1 -1
- package/dist/splash-screen/ParheliaLogo.js +87 -37
- package/dist/splash-screen/ParheliaLogo.js.map +1 -1
- package/dist/splash-screen/RecentPages.js +3 -3
- package/dist/splash-screen/RecentPages.js.map +1 -1
- package/dist/tour/Tour.d.ts +2 -1
- package/dist/tour/Tour.js +256 -75
- package/dist/tour/Tour.js.map +1 -1
- package/dist/tour/default-tour.js +222 -96
- package/dist/tour/default-tour.js.map +1 -1
- package/dist/types.d.ts +63 -29
- package/package.json +19 -15
- package/styles.css +39 -10
- package/dist/editor/ComponentInfo.d.ts +0 -4
- package/dist/editor/ComponentInfo.js +0 -41
- package/dist/editor/ComponentInfo.js.map +0 -1
- package/dist/editor/ai/HelpTerminal.d.ts +0 -5
- package/dist/editor/ai/HelpTerminal.js +0 -166
- package/dist/editor/ai/HelpTerminal.js.map +0 -1
- package/dist/editor/field-types/ReactQuill.d.ts +0 -125
- package/dist/editor/field-types/ReactQuill.js +0 -385
- package/dist/editor/field-types/ReactQuill.js.map +0 -1
- package/dist/editor/services-server/graphQL.d.ts +0 -29
- package/dist/editor/services-server/graphQL.js +0 -53
- package/dist/editor/services-server/graphQL.js.map +0 -1
- package/dist/editor/settings/AllAgentsPanel.d.ts +0 -5
- package/dist/editor/settings/AllAgentsPanel.js +0 -139
- package/dist/editor/settings/AllAgentsPanel.js.map +0 -1
- package/dist/editor/settings/LatestFeedback.d.ts +0 -1
- package/dist/editor/settings/LatestFeedback.js +0 -136
- package/dist/editor/settings/LatestFeedback.js.map +0 -1
- package/dist/editor/settings/Setup.d.ts +0 -1
- package/dist/editor/settings/Setup.js +0 -211
- package/dist/editor/settings/Setup.js.map +0 -1
- package/dist/editor/settings/panels/DatabasePanel.d.ts +0 -6
- package/dist/editor/settings/panels/DatabasePanel.js +0 -50
- package/dist/editor/settings/panels/DatabasePanel.js.map +0 -1
- package/dist/editor/settings/setup-steps/AiSetupStep/EmbeddingsModelSection.d.ts +0 -2
- package/dist/editor/settings/setup-steps/AiSetupStep/EmbeddingsModelSection.js +0 -195
- package/dist/editor/settings/setup-steps/AiSetupStep/EmbeddingsModelSection.js.map +0 -1
- package/dist/editor/settings/setup-steps/AiSetupStep/index.d.ts +0 -2
- package/dist/editor/settings/setup-steps/AiSetupStep/index.js +0 -21
- package/dist/editor/settings/setup-steps/AiSetupStep/index.js.map +0 -1
- package/dist/editor/settings/setup-steps/AiSetupStep/provider/ProviderSection.d.ts +0 -1
- package/dist/editor/settings/setup-steps/AiSetupStep/provider/ProviderSection.js +0 -233
- package/dist/editor/settings/setup-steps/AiSetupStep/provider/ProviderSection.js.map +0 -1
- package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersList.d.ts +0 -15
- package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersList.js +0 -14
- package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersList.js.map +0 -1
- package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.d.ts +0 -1
- package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.js +0 -94
- package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.js.map +0 -1
- package/dist/editor/settings/setup-steps/AiSetupStep/types.d.ts +0 -1
- package/dist/editor/settings/setup-steps/AiSetupStep/types.js +0 -2
- package/dist/editor/settings/setup-steps/AiSetupStep/types.js.map +0 -1
- package/dist/editor/settings/setup-steps/AiSetupStep/utils.d.ts +0 -5
- package/dist/editor/settings/setup-steps/AiSetupStep/utils.js +0 -44
- package/dist/editor/settings/setup-steps/AiSetupStep/utils.js.map +0 -1
- package/dist/editor/settings/setup-steps/IndexSetupStep.d.ts +0 -2
- package/dist/editor/settings/setup-steps/IndexSetupStep.js +0 -36
- package/dist/editor/settings/setup-steps/IndexSetupStep.js.map +0 -1
- package/dist/editor/settings/setup-steps/SettingsSetupStep.d.ts +0 -2
- package/dist/editor/settings/setup-steps/SettingsSetupStep.js +0 -111
- package/dist/editor/settings/setup-steps/SettingsSetupStep.js.map +0 -1
- package/dist/editor/settings/setup-steps/SetupOverview.d.ts +0 -14
- package/dist/editor/settings/setup-steps/SetupOverview.js +0 -38
- package/dist/editor/settings/setup-steps/SetupOverview.js.map +0 -1
- package/dist/editor/sidebar/Debug.d.ts +0 -1
- package/dist/editor/sidebar/Debug.js +0 -70
- package/dist/editor/sidebar/Debug.js.map +0 -1
- package/dist/editor/sidebar/GraphQL.d.ts +0 -2
- package/dist/editor/sidebar/GraphQL.js +0 -234
- package/dist/editor/sidebar/GraphQL.js.map +0 -1
- package/dist/editor/sidebar/LeftToolbar.d.ts +0 -1
- package/dist/editor/sidebar/LeftToolbar.js +0 -12
- package/dist/editor/sidebar/LeftToolbar.js.map +0 -1
- package/dist/editor/sidebar/NavigationSidebar.d.ts +0 -4
- package/dist/editor/sidebar/NavigationSidebar.js +0 -254
- package/dist/editor/sidebar/NavigationSidebar.js.map +0 -1
- package/dist/editor/tree-indicators/GutterSelector.d.ts +0 -5
- package/dist/editor/tree-indicators/GutterSelector.js +0 -91
- package/dist/editor/tree-indicators/GutterSelector.js.map +0 -1
package/dist/editor/ai/Agents.js
CHANGED
|
@@ -3,9 +3,12 @@ import React, { useState, useRef, useEffect, useMemo } from "react";
|
|
|
3
3
|
import { SimpleIconButton } from "../ui/SimpleIconButton";
|
|
4
4
|
import { Plus, X, MoreVertical } from "lucide-react";
|
|
5
5
|
import { cn } from "../../lib/utils";
|
|
6
|
+
import { sanitizeSvg } from "../../lib/sanitize";
|
|
6
7
|
import { getAgentStatusConfig } from "./AgentStatusBadge";
|
|
7
8
|
import { Popover, PopoverContent, PopoverTrigger, } from "../../components/ui/popover";
|
|
8
9
|
import { getActiveAgents, closeAgent as closeAgentService, } from "../services/agentService";
|
|
10
|
+
import { isExecutingAgentStatus, isRunningAgentStatus, parseAgentStatus, shouldIgnoreReplayRunStart, } from "../services/agentStatus";
|
|
11
|
+
import { toUserFacingAgentErrorMessage } from "../services/agentErrorMessage";
|
|
9
12
|
import { AgentTerminal } from "./AgentTerminal";
|
|
10
13
|
import { useEditContext } from "../client/editContext";
|
|
11
14
|
import { Tooltip, TooltipContent, TooltipTrigger, } from "../../components/ui/tooltip";
|
|
@@ -17,6 +20,8 @@ import { AgentsView } from "../../agents-view/AgentsView";
|
|
|
17
20
|
import { agentNeedsAttention } from "../../agents-view/AgentsInbox";
|
|
18
21
|
import { SecretAgentIcon } from "../ui/Icons";
|
|
19
22
|
import { Spinner } from "../ui/Spinner";
|
|
23
|
+
import { localStorageService } from "../services/localStorageService";
|
|
24
|
+
import { LicenseFeatures, useFeature } from "../../licensing";
|
|
20
25
|
// function convertAgentMessagesToTerminalMessages(
|
|
21
26
|
// agentMessages: AgentChatMessage[],
|
|
22
27
|
// ): Message[] {
|
|
@@ -41,6 +46,20 @@ import { Spinner } from "../ui/Spinner";
|
|
|
41
46
|
// }));
|
|
42
47
|
// }
|
|
43
48
|
const ACTIVE_AGENT_STORAGE_KEY = "editor.activeAgentId";
|
|
49
|
+
const TASKBOARD_PROJECT_QUERY_KEY = "tbProjectId";
|
|
50
|
+
const TASKBOARD_TASK_QUERY_KEY = "tbTaskId";
|
|
51
|
+
function readTaskboardLinkageFromUrl() {
|
|
52
|
+
if (typeof window === "undefined") {
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
const params = new URLSearchParams(window.location.search);
|
|
56
|
+
const projectId = params.get(TASKBOARD_PROJECT_QUERY_KEY)?.trim() || "";
|
|
57
|
+
const taskId = params.get(TASKBOARD_TASK_QUERY_KEY)?.trim() || "";
|
|
58
|
+
return {
|
|
59
|
+
projectId: projectId || undefined,
|
|
60
|
+
taskId: taskId || undefined,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
44
63
|
export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
45
64
|
const [agents, setAgents] = useState([]);
|
|
46
65
|
const [activeAgentId, setActiveAgentId] = useState(""); // "" = show profile selector, null = show overview, string = agent ID
|
|
@@ -55,6 +74,7 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
55
74
|
const [selectedProfileId, setSelectedProfileId] = useState("");
|
|
56
75
|
const [loadingProfiles, setLoadingProfiles] = useState(false);
|
|
57
76
|
const editContext = useEditContext();
|
|
77
|
+
const canUseAi = useFeature(LicenseFeatures.AI);
|
|
58
78
|
// Group agents by profile for profile-based tabs
|
|
59
79
|
const agentsGroupedByProfile = useMemo(() => {
|
|
60
80
|
const profileMap = new Map();
|
|
@@ -133,14 +153,17 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
133
153
|
setActiveAgentId(agentId);
|
|
134
154
|
activeAgentIdRef.current = agentId;
|
|
135
155
|
if (agentId) {
|
|
136
|
-
|
|
156
|
+
localStorageService.setString(ACTIVE_AGENT_STORAGE_KEY, agentId);
|
|
137
157
|
}
|
|
138
158
|
else {
|
|
139
|
-
|
|
159
|
+
localStorageService.removeItem(ACTIVE_AGENT_STORAGE_KEY);
|
|
140
160
|
}
|
|
141
161
|
};
|
|
142
162
|
// Open an agent from history (or switch to it if already open)
|
|
143
163
|
const openAgentFromHistory = React.useCallback(async (agent) => {
|
|
164
|
+
if (!canUseAi) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
144
167
|
// Check if this agent is already open as a terminal
|
|
145
168
|
// Use functional check pattern to get latest agents state
|
|
146
169
|
let alreadyOpen = false;
|
|
@@ -195,11 +218,23 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
195
218
|
};
|
|
196
219
|
setAgents((prev) => [...prev, reopenedAgent]);
|
|
197
220
|
setActiveAgentIdWithStorage(reopenedAgent.id);
|
|
198
|
-
}, []);
|
|
221
|
+
}, [canUseAi]);
|
|
199
222
|
// Load agents from backend on mount
|
|
200
223
|
useEffect(() => {
|
|
224
|
+
if (!canUseAi) {
|
|
225
|
+
setAgents([]);
|
|
226
|
+
setInactiveAgents([]);
|
|
227
|
+
setAvailableProfiles([]);
|
|
228
|
+
setActiveAgentId(null);
|
|
229
|
+
activeAgentIdRef.current = null;
|
|
230
|
+
setSelectedProfileId("");
|
|
231
|
+
setLoadingAgents(false);
|
|
232
|
+
setLoadingProfiles(false);
|
|
233
|
+
localStorageService.removeItem(ACTIVE_AGENT_STORAGE_KEY);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
201
236
|
loadAgentsFromBackend();
|
|
202
|
-
}, []);
|
|
237
|
+
}, [canUseAi]);
|
|
203
238
|
// When no agents are present (empty state) or when switching to the profile selector,
|
|
204
239
|
// keep selection state consistent without triggering extra fetches.
|
|
205
240
|
useEffect(() => {
|
|
@@ -214,6 +249,11 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
214
249
|
}, [activeAgentId, agents.length]);
|
|
215
250
|
// Function to reload profiles
|
|
216
251
|
const reloadProfiles = React.useCallback(async () => {
|
|
252
|
+
if (!canUseAi) {
|
|
253
|
+
setAvailableProfiles([]);
|
|
254
|
+
setLoadingProfiles(false);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
217
257
|
try {
|
|
218
258
|
setLoadingProfiles(true);
|
|
219
259
|
const profiles = await loadAiProfiles(editContext?.currentItemDescriptor);
|
|
@@ -225,10 +265,15 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
225
265
|
finally {
|
|
226
266
|
setLoadingProfiles(false);
|
|
227
267
|
}
|
|
228
|
-
}, [editContext?.currentItemDescriptor]);
|
|
268
|
+
}, [canUseAi, editContext?.currentItemDescriptor]);
|
|
229
269
|
// Ensure profiles are loaded once for terminals (centralized load)
|
|
230
270
|
// Only load on mount - profiles are cached and will be reloaded via websocket when changed
|
|
231
271
|
useEffect(() => {
|
|
272
|
+
if (!canUseAi) {
|
|
273
|
+
setAvailableProfiles([]);
|
|
274
|
+
setLoadingProfiles(false);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
232
277
|
let cancelled = false;
|
|
233
278
|
(async () => {
|
|
234
279
|
try {
|
|
@@ -250,10 +295,10 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
250
295
|
cancelled = true;
|
|
251
296
|
};
|
|
252
297
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
253
|
-
}, []); // Only run on mount - profiles reload via websocket when changed
|
|
298
|
+
}, [canUseAi]); // Only run on mount - profiles reload via websocket when changed
|
|
254
299
|
// Listen for agent profile changes via websocket (when profiles are updated in Sitecore)
|
|
255
300
|
useEffect(() => {
|
|
256
|
-
if (!editContext?.addSocketMessageListener)
|
|
301
|
+
if (!canUseAi || !editContext?.addSocketMessageListener)
|
|
257
302
|
return;
|
|
258
303
|
const removeListener = editContext.addSocketMessageListener((message) => {
|
|
259
304
|
if (message.type === "agent-profiles-changed") {
|
|
@@ -263,9 +308,11 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
263
308
|
return () => {
|
|
264
309
|
removeListener();
|
|
265
310
|
};
|
|
266
|
-
}, [editContext?.addSocketMessageListener, reloadProfiles]);
|
|
311
|
+
}, [canUseAi, editContext?.addSocketMessageListener, reloadProfiles]);
|
|
267
312
|
// Listen for external requests to add a new agent (e.g., AI command)
|
|
268
313
|
useEffect(() => {
|
|
314
|
+
if (!canUseAi)
|
|
315
|
+
return;
|
|
269
316
|
const handleAddNewAgent = (ev) => {
|
|
270
317
|
let initialMetadata = undefined;
|
|
271
318
|
try {
|
|
@@ -284,9 +331,11 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
284
331
|
};
|
|
285
332
|
window.addEventListener("editor:addNewAgent", handleAddNewAgent);
|
|
286
333
|
return () => window.removeEventListener("editor:addNewAgent", handleAddNewAgent);
|
|
287
|
-
}, []);
|
|
334
|
+
}, [canUseAi]);
|
|
288
335
|
// Listen for external requests to select an existing open agent without switching views
|
|
289
336
|
useEffect(() => {
|
|
337
|
+
if (!canUseAi)
|
|
338
|
+
return;
|
|
290
339
|
const handleSelectAgent = (ev) => {
|
|
291
340
|
try {
|
|
292
341
|
const ce = ev;
|
|
@@ -302,9 +351,11 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
302
351
|
};
|
|
303
352
|
window.addEventListener("editor:selectAgent", handleSelectAgent);
|
|
304
353
|
return () => window.removeEventListener("editor:selectAgent", handleSelectAgent);
|
|
305
|
-
}, [agents]);
|
|
354
|
+
}, [canUseAi, agents]);
|
|
306
355
|
// Listen for external requests to open an existing agent
|
|
307
356
|
useEffect(() => {
|
|
357
|
+
if (!canUseAi)
|
|
358
|
+
return;
|
|
308
359
|
const handleOpenAgent = (ev) => {
|
|
309
360
|
try {
|
|
310
361
|
const ce = ev;
|
|
@@ -321,9 +372,11 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
321
372
|
};
|
|
322
373
|
window.addEventListener("editor:openAgent", handleOpenAgent);
|
|
323
374
|
return () => window.removeEventListener("editor:openAgent", handleOpenAgent);
|
|
324
|
-
}, [openAgentFromHistory]);
|
|
375
|
+
}, [canUseAi, openAgentFromHistory]);
|
|
325
376
|
// Listen for external requests to create a new agent with a specific profile
|
|
326
377
|
useEffect(() => {
|
|
378
|
+
if (!canUseAi)
|
|
379
|
+
return;
|
|
327
380
|
const handleCreateAgentWithProfile = (ev) => {
|
|
328
381
|
try {
|
|
329
382
|
const ce = ev;
|
|
@@ -336,17 +389,16 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
336
389
|
profileName: profile.name,
|
|
337
390
|
};
|
|
338
391
|
// Add preconfigured todos as todoList if the profile has them
|
|
339
|
-
|
|
340
|
-
const preconfiguredTodos = profile.preconfiguredTodos || profile.PreconfiguredTodos;
|
|
392
|
+
const preconfiguredTodos = profile.preconfiguredTodos;
|
|
341
393
|
if (preconfiguredTodos && preconfiguredTodos.length > 0) {
|
|
342
394
|
additionalData.todoList = {
|
|
343
395
|
title: "Preconfigured Tasks",
|
|
344
396
|
items: preconfiguredTodos.map((todo) => ({
|
|
345
|
-
id: todo.id ||
|
|
346
|
-
title: todo.title
|
|
397
|
+
id: todo.id || crypto.randomUUID(),
|
|
398
|
+
title: todo.title,
|
|
347
399
|
status: "pending",
|
|
348
|
-
instructions: todo.instructions
|
|
349
|
-
agentProfileId: todo.agentProfileId
|
|
400
|
+
instructions: todo.instructions,
|
|
401
|
+
agentProfileId: todo.agentProfileId,
|
|
350
402
|
})),
|
|
351
403
|
};
|
|
352
404
|
}
|
|
@@ -383,10 +435,10 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
383
435
|
};
|
|
384
436
|
window.addEventListener("editor:createAgentWithProfile", handleCreateAgentWithProfile);
|
|
385
437
|
return () => window.removeEventListener("editor:createAgentWithProfile", handleCreateAgentWithProfile);
|
|
386
|
-
}, []);
|
|
438
|
+
}, [canUseAi]);
|
|
387
439
|
// Subscribe to websocket messages for agent events
|
|
388
440
|
useEffect(() => {
|
|
389
|
-
if (!editContext?.addSocketMessageListener)
|
|
441
|
+
if (!canUseAi || !editContext?.addSocketMessageListener)
|
|
390
442
|
return;
|
|
391
443
|
const unsubscribe = editContext.addSocketMessageListener((message) => {
|
|
392
444
|
// In single-agent mode, ignore events that would add or remove agents,
|
|
@@ -399,11 +451,12 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
399
451
|
}
|
|
400
452
|
if (message.type === "agent:run:start") {
|
|
401
453
|
const payload = message.payload || {};
|
|
402
|
-
const agentId = payload.agentId
|
|
403
|
-
const agentName = payload.agentName
|
|
404
|
-
const autoSelect = payload.autoSelect
|
|
405
|
-
const profileId = payload.profileId
|
|
406
|
-
const profileName = payload.profileName
|
|
454
|
+
const agentId = payload.agentId;
|
|
455
|
+
const agentName = payload.agentName;
|
|
456
|
+
const autoSelect = payload.autoSelect;
|
|
457
|
+
const profileId = payload.profileId;
|
|
458
|
+
const profileName = payload.profileName;
|
|
459
|
+
const timestamp = payload.timestamp;
|
|
407
460
|
if (!agentId || !agentName) {
|
|
408
461
|
console.warn("Invalid agent:run:start message payload:", message.payload);
|
|
409
462
|
return;
|
|
@@ -415,6 +468,9 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
415
468
|
// Update existing agent name and profile info
|
|
416
469
|
const updatedAgents = [...prevAgents];
|
|
417
470
|
const existingAgent = updatedAgents[existingAgentIndex];
|
|
471
|
+
if (shouldIgnoreReplayRunStart(existingAgent.status, existingAgent.updatedDate, typeof timestamp === "string" ? timestamp : undefined)) {
|
|
472
|
+
return prevAgents;
|
|
473
|
+
}
|
|
418
474
|
updatedAgents[existingAgentIndex] = {
|
|
419
475
|
...existingAgent,
|
|
420
476
|
name: agentName,
|
|
@@ -446,9 +502,9 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
446
502
|
}
|
|
447
503
|
else if (message.type === "agent:info:updated") {
|
|
448
504
|
const payload = message.payload || {};
|
|
449
|
-
const agentId = payload.agentId
|
|
450
|
-
const agentName = payload.agentName
|
|
451
|
-
const agentDescription = payload.agentDescription
|
|
505
|
+
const agentId = payload.agentId;
|
|
506
|
+
const agentName = payload.agentName;
|
|
507
|
+
const agentDescription = payload.agentDescription;
|
|
452
508
|
if (!agentId)
|
|
453
509
|
return;
|
|
454
510
|
// Update the agent name and/or description in the tabs list
|
|
@@ -472,56 +528,11 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
472
528
|
else if (message.type === "agent:run:status") {
|
|
473
529
|
// Unified status updates (state only)
|
|
474
530
|
const payload = message.payload || {};
|
|
475
|
-
const agentId = payload.agentId
|
|
476
|
-
const data = payload.data
|
|
531
|
+
const agentId = payload.agentId;
|
|
532
|
+
const data = payload.data;
|
|
477
533
|
if (!agentId)
|
|
478
534
|
return;
|
|
479
|
-
const
|
|
480
|
-
const status = (() => {
|
|
481
|
-
if (!rawState)
|
|
482
|
-
return undefined;
|
|
483
|
-
switch (rawState) {
|
|
484
|
-
case "Running":
|
|
485
|
-
return "running";
|
|
486
|
-
case "WaitingForApproval":
|
|
487
|
-
return "waitingForApproval";
|
|
488
|
-
case "Completed":
|
|
489
|
-
return "completed";
|
|
490
|
-
case "Closed":
|
|
491
|
-
return "closed";
|
|
492
|
-
case "Error":
|
|
493
|
-
return "error";
|
|
494
|
-
case "Idle":
|
|
495
|
-
return "idle";
|
|
496
|
-
case "CostLimitReached":
|
|
497
|
-
return "costLimitReached";
|
|
498
|
-
// Transient notification states - not actual agent statuses
|
|
499
|
-
case "toolApprovalGranted":
|
|
500
|
-
case "toolApprovalRejected":
|
|
501
|
-
case "toolApprovalsRequired":
|
|
502
|
-
case "executingToolCalls":
|
|
503
|
-
case "tokenUsage":
|
|
504
|
-
case "streamOpen":
|
|
505
|
-
case "contextChanged":
|
|
506
|
-
case "queued":
|
|
507
|
-
return undefined; // ignore transient states
|
|
508
|
-
default:
|
|
509
|
-
// allow already-lowercased strings that are valid statuses
|
|
510
|
-
if ([
|
|
511
|
-
"new",
|
|
512
|
-
"running",
|
|
513
|
-
"waitingForApproval",
|
|
514
|
-
"completed",
|
|
515
|
-
"closed",
|
|
516
|
-
"error",
|
|
517
|
-
"idle",
|
|
518
|
-
"costLimitReached",
|
|
519
|
-
].includes(rawState)) {
|
|
520
|
-
return rawState;
|
|
521
|
-
}
|
|
522
|
-
return undefined; // ignore unknown states
|
|
523
|
-
}
|
|
524
|
-
})();
|
|
535
|
+
const status = parseAgentStatus(data?.state);
|
|
525
536
|
if (!status)
|
|
526
537
|
return;
|
|
527
538
|
setAgents((prevAgents) => {
|
|
@@ -575,7 +586,7 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
575
586
|
// No agents left, show profile selector
|
|
576
587
|
setActiveAgentId("");
|
|
577
588
|
activeAgentIdRef.current = "";
|
|
578
|
-
|
|
589
|
+
localStorageService.removeItem(ACTIVE_AGENT_STORAGE_KEY);
|
|
579
590
|
}
|
|
580
591
|
}
|
|
581
592
|
// If no agents remain, reset profile selection to placeholder
|
|
@@ -588,9 +599,9 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
588
599
|
else if (message.type === "agent:profile:switched") {
|
|
589
600
|
// Handle profile switch initiated by the agent (via switch-profile function)
|
|
590
601
|
const payload = message.payload || {};
|
|
591
|
-
const agentId = payload.agentId
|
|
592
|
-
const newProfileId = payload.newProfileId
|
|
593
|
-
const newProfileName = payload.newProfileName
|
|
602
|
+
const agentId = payload.agentId;
|
|
603
|
+
const newProfileId = payload.newProfileId;
|
|
604
|
+
const newProfileName = payload.newProfileName;
|
|
594
605
|
if (!agentId || !newProfileId)
|
|
595
606
|
return;
|
|
596
607
|
// Find the profile's icon from available profiles
|
|
@@ -613,9 +624,15 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
613
624
|
}
|
|
614
625
|
});
|
|
615
626
|
return unsubscribe;
|
|
616
|
-
}, [editContext?.addSocketMessageListener, availableProfiles]);
|
|
627
|
+
}, [canUseAi, editContext?.addSocketMessageListener, availableProfiles]);
|
|
617
628
|
const loadAgentsFromBackend = async () => {
|
|
618
629
|
try {
|
|
630
|
+
if (!canUseAi) {
|
|
631
|
+
setAgents([]);
|
|
632
|
+
setInactiveAgents([]);
|
|
633
|
+
setLoadingAgents(false);
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
619
636
|
// In single-agent mode, skip loading any pre-existing/open agents or history
|
|
620
637
|
if (singleAgentModeRef.current) {
|
|
621
638
|
setAgents([]);
|
|
@@ -636,11 +653,18 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
636
653
|
excludeClosed: true, // Exclude closed and cancelled agents
|
|
637
654
|
});
|
|
638
655
|
const activeAgentsResult = activeAgentsResponse.agents;
|
|
639
|
-
|
|
656
|
+
// Merge the backend agents with any locally added "new" agents that haven't been saved yet
|
|
657
|
+
setAgents((prev) => {
|
|
658
|
+
const newAgents = prev.filter((a) => a.status === "new");
|
|
659
|
+
// Avoid duplicates if any new agents were already saved and returned in activeAgentsResult
|
|
660
|
+
const backendIds = new Set(activeAgentsResult.map((a) => a.id));
|
|
661
|
+
const filteredNewAgents = newAgents.filter((a) => !backendIds.has(a.id));
|
|
662
|
+
return [...activeAgentsResult, ...filteredNewAgents];
|
|
663
|
+
});
|
|
640
664
|
// Try to restore the previously active agent from localStorage if one exists
|
|
641
665
|
let selectedAgentId = null;
|
|
642
666
|
if (activeAgentsResult.length > 0) {
|
|
643
|
-
const storedAgentId =
|
|
667
|
+
const storedAgentId = localStorageService.getString(ACTIVE_AGENT_STORAGE_KEY);
|
|
644
668
|
const storedAgent = activeAgentsResult.find((agent) => agent.id === storedAgentId);
|
|
645
669
|
if (storedAgent) {
|
|
646
670
|
selectedAgentId = storedAgent.id;
|
|
@@ -653,13 +677,28 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
653
677
|
}
|
|
654
678
|
// If there are no active agents after load, set to empty string to show profile selector
|
|
655
679
|
if (activeAgentsResult.length === 0) {
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
680
|
+
// Only if no new agent was added in the meantime
|
|
681
|
+
setAgents((prev) => {
|
|
682
|
+
if (prev.length === 0) {
|
|
683
|
+
setActiveAgentId("");
|
|
684
|
+
activeAgentIdRef.current = "";
|
|
685
|
+
localStorage.removeItem(ACTIVE_AGENT_STORAGE_KEY);
|
|
686
|
+
setSelectedProfileId("");
|
|
687
|
+
}
|
|
688
|
+
return prev;
|
|
689
|
+
});
|
|
660
690
|
}
|
|
661
691
|
else {
|
|
662
|
-
|
|
692
|
+
// Only restore from backend/storage if no new agent is currently active
|
|
693
|
+
// This prevents overwriting a newly created agent from a comment (especially on mobile)
|
|
694
|
+
const currentActiveId = activeAgentIdRef.current;
|
|
695
|
+
setAgents((prev) => {
|
|
696
|
+
const isNewAgentActive = prev.some((a) => a.id === currentActiveId && a.status === "new");
|
|
697
|
+
if (!isNewAgentActive) {
|
|
698
|
+
setActiveAgentIdWithStorage(selectedAgentId);
|
|
699
|
+
}
|
|
700
|
+
return prev;
|
|
701
|
+
});
|
|
663
702
|
}
|
|
664
703
|
// Load closed agents for history
|
|
665
704
|
const response = await getActiveAgents({
|
|
@@ -668,7 +707,7 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
668
707
|
includeOwned: true,
|
|
669
708
|
});
|
|
670
709
|
// Filter to only closed agents on the client side
|
|
671
|
-
const closedAgents = response.agents.filter((agent) => agent.status === "closed"
|
|
710
|
+
const closedAgents = response.agents.filter((agent) => agent.status === "closed");
|
|
672
711
|
// Deduplicate agents by ID in case the backend returns duplicates
|
|
673
712
|
const uniqueClosedAgents = closedAgents.filter((agent, index, self) => index === self.findIndex((a) => a.id === agent.id));
|
|
674
713
|
setInactiveAgents(uniqueClosedAgents);
|
|
@@ -694,6 +733,9 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
694
733
|
// return null;
|
|
695
734
|
// };
|
|
696
735
|
const addAgent = (metadata) => {
|
|
736
|
+
if (!canUseAi) {
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
697
739
|
const newAgent = {
|
|
698
740
|
status: "new",
|
|
699
741
|
id: crypto.randomUUID(),
|
|
@@ -719,24 +761,29 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
719
761
|
};
|
|
720
762
|
const createAgentWithSelectedProfile = (profileId) => {
|
|
721
763
|
const selected = availableProfiles.find((p) => p.id === profileId);
|
|
764
|
+
const taskboardLinkage = readTaskboardLinkageFromUrl();
|
|
722
765
|
// Build additionalData with preconfigured todos if available
|
|
723
766
|
// Backend uses [PreserveNames] so check both camelCase and PascalCase
|
|
724
767
|
const additionalData = selected
|
|
725
768
|
? {
|
|
726
769
|
profileId: selected.id,
|
|
727
770
|
profileName: selected.name,
|
|
771
|
+
...(taskboardLinkage.projectId
|
|
772
|
+
? { projectId: taskboardLinkage.projectId }
|
|
773
|
+
: {}),
|
|
774
|
+
...(taskboardLinkage.taskId ? { taskId: taskboardLinkage.taskId } : {}),
|
|
728
775
|
}
|
|
729
776
|
: {};
|
|
730
|
-
const preconfiguredTodos = selected?.preconfiguredTodos
|
|
777
|
+
const preconfiguredTodos = selected?.preconfiguredTodos;
|
|
731
778
|
if (preconfiguredTodos && preconfiguredTodos.length > 0) {
|
|
732
779
|
additionalData.todoList = {
|
|
733
780
|
title: "Preconfigured Tasks",
|
|
734
781
|
items: preconfiguredTodos.map((todo) => ({
|
|
735
|
-
id: todo.id ||
|
|
736
|
-
title: todo.title
|
|
782
|
+
id: todo.id || crypto.randomUUID(),
|
|
783
|
+
title: todo.title,
|
|
737
784
|
status: "pending",
|
|
738
|
-
instructions: todo.instructions
|
|
739
|
-
agentProfileId: todo.agentProfileId
|
|
785
|
+
instructions: todo.instructions,
|
|
786
|
+
agentProfileId: todo.agentProfileId,
|
|
740
787
|
})),
|
|
741
788
|
};
|
|
742
789
|
}
|
|
@@ -748,6 +795,9 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
748
795
|
: undefined;
|
|
749
796
|
addAgent(metadata);
|
|
750
797
|
};
|
|
798
|
+
const handleAgentUpdate = React.useCallback((agentId, updates) => {
|
|
799
|
+
setAgents((prev) => prev.map((agent) => agent.id === agentId ? { ...agent, ...updates } : agent));
|
|
800
|
+
}, []);
|
|
751
801
|
const closeAgent = async (agentId) => {
|
|
752
802
|
try {
|
|
753
803
|
// Permanently close the agent in the backend
|
|
@@ -808,13 +858,8 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
808
858
|
closeAgent(agentId);
|
|
809
859
|
return;
|
|
810
860
|
}
|
|
811
|
-
// Check if agent is in an active state (running or waiting for approval)
|
|
812
|
-
// Handle both string and numeric status values
|
|
813
|
-
// Enum: New=0, Running=1, WaitingForApproval=2, Completed=3, Error=4, Closed=5
|
|
814
861
|
const isActivelyRunning = agent.status === "running" ||
|
|
815
|
-
agent.status === "waitingForApproval"
|
|
816
|
-
agent.status === 1 ||
|
|
817
|
-
agent.status === 2;
|
|
862
|
+
agent.status === "waitingForApproval";
|
|
818
863
|
// If agent is actively running, show confirmation dialog
|
|
819
864
|
if (isActivelyRunning) {
|
|
820
865
|
if (editContext?.confirm) {
|
|
@@ -837,15 +882,12 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
837
882
|
const handleCloseProfileAgents = async (profileAgents, profileName, e) => {
|
|
838
883
|
e.stopPropagation();
|
|
839
884
|
const agentCount = profileAgents.length;
|
|
840
|
-
const hasActiveAgents = profileAgents.some((agent) => agent.status
|
|
841
|
-
agent.status === "waitingForApproval" ||
|
|
842
|
-
agent.status === 1 ||
|
|
843
|
-
agent.status === 2);
|
|
885
|
+
const hasActiveAgents = profileAgents.some((agent) => isExecutingAgentStatus(agent.status));
|
|
844
886
|
if (editContext?.confirm) {
|
|
845
887
|
editContext.confirm({
|
|
846
888
|
header: `Close ${agentCount} Agent${agentCount > 1 ? "s" : ""}`,
|
|
847
889
|
message: hasActiveAgents
|
|
848
|
-
? `This will close all ${agentCount} ${profileName} agent${agentCount > 1 ? "s" : ""}, including ${profileAgents.filter((a) => a.status
|
|
890
|
+
? `This will close all ${agentCount} ${profileName} agent${agentCount > 1 ? "s" : ""}, including ${profileAgents.filter((a) => isRunningAgentStatus(a.status)).length} running agent(s). Are you sure?`
|
|
849
891
|
: `Are you sure you want to close all ${agentCount} ${profileName} agent${agentCount > 1 ? "s" : ""}?`,
|
|
850
892
|
acceptLabel: `Close ${agentCount > 1 ? "All" : "Agent"}`,
|
|
851
893
|
accept: async () => {
|
|
@@ -879,7 +921,7 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
879
921
|
// No agents left, show profile selector
|
|
880
922
|
setActiveAgentId("");
|
|
881
923
|
activeAgentIdRef.current = "";
|
|
882
|
-
|
|
924
|
+
localStorageService.removeItem(ACTIVE_AGENT_STORAGE_KEY);
|
|
883
925
|
}
|
|
884
926
|
}
|
|
885
927
|
// Reset profile selection if no agents remain
|
|
@@ -939,6 +981,9 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
939
981
|
},
|
|
940
982
|
];
|
|
941
983
|
};
|
|
984
|
+
if (!canUseAi) {
|
|
985
|
+
return (_jsx("div", { className: "flex h-full items-center justify-center p-4 text-center text-sm text-gray-500", children: "AI features are unavailable with the current license." }));
|
|
986
|
+
}
|
|
942
987
|
if (loadingAgents) {
|
|
943
988
|
return (_jsxs("div", { className: "flex h-full items-center justify-center gap-2", children: [_jsx(Spinner, { size: "sm" }), _jsx("div", { className: "text-xs text-gray-500", children: "Loading agents..." })] }));
|
|
944
989
|
}
|
|
@@ -951,7 +996,7 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
951
996
|
console.log("[Agents Empty State] Overview tab clicked, toggling back to profile selector", e);
|
|
952
997
|
setActiveAgentId("");
|
|
953
998
|
activeAgentIdRef.current = "";
|
|
954
|
-
|
|
999
|
+
localStorageService.removeItem(ACTIVE_AGENT_STORAGE_KEY);
|
|
955
1000
|
}, className: cn("flex h-8 min-w-0 cursor-pointer items-center gap-2 border-r border-gray-200 px-2 text-xs", "border-b-white bg-white hover:bg-gray-50"), children: [_jsxs("div", { className: "relative", children: [_jsx(List, { className: "size-4 flex-shrink-0 text-gray-600", strokeWidth: 1 }), inboxCount > 0 && (_jsx("span", { className: "absolute -top-1.5 -right-1.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-amber-500 px-1 text-[9px] font-bold text-white", children: inboxCount > 9 ? "9+" : inboxCount }))] }), _jsx("span", { className: "truncate font-medium", children: "Overview" })] }) })) : (
|
|
956
1001
|
/* Show Overview as a button when displaying profile selector */
|
|
957
1002
|
_jsx("div", { className: "flex items-center px-1", children: _jsx(SimpleIconButton, { onClick: (e) => {
|
|
@@ -983,6 +1028,10 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
983
1028
|
const statusConfig = getAgentStatusConfig({
|
|
984
1029
|
status: highestStatus,
|
|
985
1030
|
});
|
|
1031
|
+
const singleAgentErrorMessage = toUserFacingAgentErrorMessage(singleAgent?.statusMessage) ||
|
|
1032
|
+
singleAgent?.statusMessage;
|
|
1033
|
+
const activeAgentErrorMessage = toUserFacingAgentErrorMessage(activeAgent?.statusMessage) ||
|
|
1034
|
+
activeAgent?.statusMessage;
|
|
986
1035
|
// Use agent name if: single agent OR active agent from this profile
|
|
987
1036
|
const displayName = activeAgent
|
|
988
1037
|
? activeAgent.name
|
|
@@ -1008,21 +1057,20 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
1008
1057
|
}
|
|
1009
1058
|
// Multiple agents: popover will open via PopoverTrigger
|
|
1010
1059
|
}, children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 overflow-hidden", children: [_jsx("div", { className: "flex-shrink-0", children: displayIcon ? (_jsx("div", { className: "flex h-[18px] w-[18px] items-center justify-center text-gray-500 [&>svg]:h-full [&>svg]:w-full", dangerouslySetInnerHTML: {
|
|
1011
|
-
__html: displayIcon,
|
|
1012
|
-
} })) : (_jsx(SecretAgentIcon, { size: 18, strokeWidth: 1, className: "text-gray-500" })) }), _jsx("span", { className: "min-w-0 flex-1 truncate font-medium", children: displayName }), agentCount > 1 && (_jsx("div", { className: "flex-shrink-0 rounded-full bg-gray-200 px-1.5 py-0.5 text-[10px] leading-none font-medium text-gray-700", children: agentCount })), _jsxs(Tooltip, { delayDuration: 1000, children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("div", { className: cn("h-1.5 w-1.5 flex-shrink-0 rounded-full", statusConfig.color, statusConfig.shouldPulse && "animate-pulse"), title: statusConfig.label }) }), _jsx(TooltipContent, { children: _jsxs("div", { children: [_jsx("div", { children: statusConfig.label }), singleAgent?.status === "error"
|
|
1013
|
-
singleAgent?.status === 4 ? (singleAgent?.statusMessage ? (_jsx("div", { className: "mt-1 text-xs text-red-600", children: singleAgent.statusMessage })) : null) : activeAgent?.status === "error" ||
|
|
1014
|
-
activeAgent?.status === 4 ? (activeAgent?.statusMessage ? (_jsx("div", { className: "mt-1 text-xs text-red-600", children: activeAgent.statusMessage })) : null) : null] }) })] }), agentCount > 1 && (_jsx(ChevronDown, { className: "size-3 flex-shrink-0 text-gray-500", strokeWidth: 1 }))] }), _jsx(SimpleIconButton, { onClick: (e) => singleAgent
|
|
1060
|
+
__html: sanitizeSvg(displayIcon),
|
|
1061
|
+
} })) : (_jsx(SecretAgentIcon, { size: 18, strokeWidth: 1, className: "text-gray-500" })) }), _jsx("span", { className: "min-w-0 flex-1 truncate font-medium", children: displayName }), agentCount > 1 && (_jsx("div", { className: "flex-shrink-0 rounded-full bg-gray-200 px-1.5 py-0.5 text-[10px] leading-none font-medium text-gray-700", children: agentCount })), _jsxs(Tooltip, { delayDuration: 1000, children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("div", { className: cn("h-1.5 w-1.5 flex-shrink-0 rounded-full", statusConfig.color, statusConfig.shouldPulse && "animate-pulse"), title: statusConfig.label }) }), _jsx(TooltipContent, { children: _jsxs("div", { children: [_jsx("div", { children: statusConfig.label }), singleAgent?.status === "error" ? (singleAgentErrorMessage ? (_jsx("div", { className: "mt-1 text-xs text-red-600", children: singleAgentErrorMessage })) : null) : activeAgent?.status === "error" ? (activeAgentErrorMessage ? (_jsx("div", { className: "mt-1 text-xs text-red-600", children: activeAgentErrorMessage })) : null) : null] }) })] }), agentCount > 1 && (_jsx(ChevronDown, { className: "size-3 flex-shrink-0 text-gray-500", strokeWidth: 1 }))] }), _jsx(SimpleIconButton, { onClick: (e) => singleAgent
|
|
1015
1062
|
? handleCloseAgent(singleAgent.id, e)
|
|
1016
1063
|
: handleCloseProfileAgents(profileGroup.agents, profileGroup.profileName, e), icon: _jsx(X, { className: "size-3", strokeWidth: 1 }), label: agentCount > 1
|
|
1017
1064
|
? `Close all ${agentCount} agents`
|
|
1018
1065
|
: "Close", className: "flex-shrink-0 opacity-60 hover:opacity-100", showTooltip: false })] }) }), agentCount > 1 && (_jsxs(PopoverContent, { className: "w-80 p-0", align: "start", children: [_jsxs("div", { className: "border-b border-gray-100 px-3 py-2 text-xs font-medium text-gray-500", children: [profileGroup.profileName, " Agents"] }), _jsx("div", { className: "max-h-64 overflow-y-auto", children: profileGroup.agents.map((agent) => {
|
|
1019
1066
|
const agentStatusConfig = getAgentStatusConfig(agent);
|
|
1067
|
+
const agentErrorMessage = toUserFacingAgentErrorMessage(agent.statusMessage) ||
|
|
1068
|
+
agent.statusMessage;
|
|
1020
1069
|
return (_jsx("div", { "data-agent-id": agent.id, className: cn("cursor-pointer border-b border-gray-50 px-3 py-2 hover:bg-gray-50", activeAgentId === agent.id && "bg-theme-secondary-light/50"), onClick: () => {
|
|
1021
1070
|
setActiveAgentIdWithStorage(agent.id);
|
|
1022
1071
|
setProfileTabDropdownOpen(null);
|
|
1023
1072
|
}, children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: cn("h-2 w-2 flex-shrink-0 rounded-full", agentStatusConfig.color, agentStatusConfig.shouldPulse &&
|
|
1024
|
-
"animate-pulse"), title: agentStatusConfig.label }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-xs font-medium text-gray-900", children: agent.name }), _jsx("div", { className: "text-[9px] font-mono text-gray-400", children: agent.id }), agent.status === "error"
|
|
1025
|
-
agent.status === 4 ? (agent.statusMessage ? (_jsx("div", { className: "truncate text-[11px] leading-tight text-red-600", children: agent.statusMessage })) : (agent.description && (_jsx("div", { className: "truncate text-[11px] leading-tight text-gray-400", children: agent.description })))) : (agent.description && (_jsx("div", { className: "truncate text-[11px] leading-tight text-gray-400", children: agent.description })))] }), _jsx(SimpleIconButton, { onClick: (e) => handleCloseAgent(agent.id, e), icon: _jsx(X, { className: "size-3", strokeWidth: 1 }), label: "Close", className: "opacity-60 hover:opacity-100" })] }) }, agent.id));
|
|
1073
|
+
"animate-pulse"), title: agentStatusConfig.label }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-xs font-medium text-gray-900", children: agent.name }), _jsx("div", { className: "text-[9px] font-mono text-gray-400", children: agent.id }), agent.status === "error" ? (agentErrorMessage ? (_jsx("div", { className: "truncate text-[11px] leading-tight text-red-600", children: agentErrorMessage })) : (agent.description && (_jsx("div", { className: "truncate text-[11px] leading-tight text-gray-400", children: agent.description })))) : (agent.description && (_jsx("div", { className: "truncate text-[11px] leading-tight text-gray-400", children: agent.description })))] }), _jsx(SimpleIconButton, { onClick: (e) => handleCloseAgent(agent.id, e), icon: _jsx(X, { className: "size-3", strokeWidth: 1 }), label: "Close", className: "opacity-60 hover:opacity-100" })] }) }, agent.id));
|
|
1026
1074
|
}) })] }))] }) }, profileKey));
|
|
1027
1075
|
})] }), activeAgentId !== null && (_jsx("div", { className: "flex items-center px-1", children: _jsx(SimpleIconButton, { onClick: () => setActiveAgentIdWithStorage(null), icon: _jsxs("div", { className: "relative", children: [_jsx(List, { className: "size-4", strokeWidth: 1 }), inboxCount > 0 && (_jsx("span", { className: "absolute -top-1.5 -right-1.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-amber-500 px-1 text-[9px] font-bold text-white", children: inboxCount > 9 ? "9+" : inboxCount }))] }), label: `Agent Overview${inboxCount > 0 ? ` (${inboxCount} need attention)` : ""}`, className: "text-gray-600 hover:text-gray-800" }) })), activeAgentId === null && (_jsx("div", { className: "flex items-center px-1", children: _jsxs("div", { className: cn("flex min-w-0 cursor-default items-center gap-2 border-r border-gray-200 p-2 text-xs", "border-b-white bg-white"), children: [_jsxs("div", { className: "relative", children: [_jsx(List, { className: "size-4 flex-shrink-0 text-gray-600", strokeWidth: 1 }), inboxCount > 0 && (_jsx("span", { className: "absolute -top-1.5 -right-1.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-amber-500 px-1 text-[9px] font-bold text-white", children: inboxCount > 9 ? "9+" : inboxCount }))] }), _jsx("span", { className: "truncate font-medium", children: "Overview" })] }) })), agents.length > 0 && (_jsx("div", { className: "flex items-center px-1", children: _jsxs(Popover, { open: menuPopoverOpen, onOpenChange: (open) => {
|
|
1028
1076
|
setMenuPopoverOpen(open);
|
|
@@ -1052,7 +1100,7 @@ export const Agents = React.memo(function Agents({ closeButton, }) {
|
|
|
1052
1100
|
const activeAgent = agents.find((a) => a.id === activeAgentId);
|
|
1053
1101
|
if (!activeAgent)
|
|
1054
1102
|
return null;
|
|
1055
|
-
return (_jsx("div", { className: "absolute inset-0", children: _jsx(AgentTerminal, { agentStub: activeAgent, initialMetadata: initialMetadataMap[activeAgent.id], profiles: availableProfiles, isActive: true }) }, activeAgent.id));
|
|
1103
|
+
return (_jsx("div", { className: "absolute inset-0", children: _jsx(AgentTerminal, { agentStub: activeAgent, initialMetadata: initialMetadataMap[activeAgent.id], profiles: availableProfiles, isActive: true, onAgentUpdate: (updates) => handleAgentUpdate(activeAgent.id, updates) }) }, activeAgent.id));
|
|
1056
1104
|
})()) })] }));
|
|
1057
1105
|
});
|
|
1058
1106
|
//# sourceMappingURL=Agents.js.map
|