@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type AgentChatMessage, type AgentDetails } from "../services/agentService";
|
|
2
|
-
import type {
|
|
2
|
+
import type { EditorSocketDiagnostics } from "../client/socketDiagnostics";
|
|
3
|
+
import { type AgentTerminalRunDiagnosticsSnapshot } from "./agentDiagnostics";
|
|
3
4
|
export type ContextWindowStatus = {
|
|
4
5
|
contextWindowTokens: number;
|
|
5
6
|
estimatedInputTokens: number;
|
|
@@ -15,6 +16,7 @@ export type LiveTotals = {
|
|
|
15
16
|
outputCost: number;
|
|
16
17
|
cachedCost: number;
|
|
17
18
|
cacheWriteCost?: number;
|
|
19
|
+
imageCost: number;
|
|
18
20
|
totalCost: number;
|
|
19
21
|
currency?: string;
|
|
20
22
|
} | null;
|
|
@@ -28,16 +30,19 @@ export type TotalTokensForDisplay = {
|
|
|
28
30
|
outputCost: number;
|
|
29
31
|
cachedCost: number;
|
|
30
32
|
cacheWriteCost: number;
|
|
33
|
+
imageCost: number;
|
|
31
34
|
};
|
|
32
35
|
export interface AgentTerminalStatusBarProps {
|
|
33
36
|
agent: AgentDetails | undefined;
|
|
34
37
|
contextWindowStatus: ContextWindowStatus;
|
|
38
|
+
effectiveModelName?: string;
|
|
39
|
+
socketDiagnostics: EditorSocketDiagnostics;
|
|
40
|
+
runDiagnosticsSnapshot: AgentTerminalRunDiagnosticsSnapshot;
|
|
35
41
|
liveTotals: LiveTotals;
|
|
36
42
|
totalTokens: TotalTokensForDisplay;
|
|
37
43
|
effectiveCostLimit: number | undefined;
|
|
38
44
|
messages: AgentChatMessage[];
|
|
39
|
-
activeProfile: AiProfile | undefined;
|
|
40
45
|
showCompressionPopover: boolean;
|
|
41
46
|
setShowCompressionPopover: (v: boolean) => void;
|
|
42
47
|
}
|
|
43
|
-
export declare function AgentTerminalStatusBar({ agent, contextWindowStatus, liveTotals, totalTokens, effectiveCostLimit, messages,
|
|
48
|
+
export declare function AgentTerminalStatusBar({ agent, contextWindowStatus, effectiveModelName, socketDiagnostics, runDiagnosticsSnapshot, liveTotals, totalTokens, effectiveCostLimit, messages, showCompressionPopover, setShowCompressionPopover, }: AgentTerminalStatusBarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,420 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { Bug } from "lucide-react";
|
|
4
4
|
import { Popover, PopoverContent, PopoverTrigger, } from "../../components/ui/popover";
|
|
5
5
|
import { Tooltip, TooltipContent, TooltipTrigger, } from "../../components/ui/tooltip";
|
|
6
|
-
import {
|
|
7
|
-
import { getLastPayload, } from "../services/agentService";
|
|
6
|
+
import { getAgentDiagnostics, getLastPayload, } from "../services/agentService";
|
|
8
7
|
import { AgentCostDisplay } from "./AgentCostDisplay";
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import { ContentInspectorPopover, } from "./ContentInspectorPopover";
|
|
9
|
+
import { formatAgentDiagnosticsEvent, interpretAgentRunDiagnostics, } from "./agentDiagnostics";
|
|
10
|
+
function formatDiagnosticTime(value) {
|
|
11
|
+
if (!value)
|
|
12
|
+
return "—";
|
|
13
|
+
const parsed = new Date(value);
|
|
14
|
+
return Number.isNaN(parsed.getTime()) ? value : parsed.toLocaleString();
|
|
15
|
+
}
|
|
16
|
+
function yesNo(value) {
|
|
17
|
+
return value ? "Yes" : "No";
|
|
18
|
+
}
|
|
19
|
+
function lines(values) {
|
|
20
|
+
return values.filter(Boolean).join("\n");
|
|
21
|
+
}
|
|
22
|
+
function normalizeInspectorText(value) {
|
|
23
|
+
if (typeof value !== "string")
|
|
24
|
+
return null;
|
|
25
|
+
const normalized = value.replace(/\r\n/g, "\n").trim();
|
|
26
|
+
return normalized.length > 0 ? normalized : null;
|
|
27
|
+
}
|
|
28
|
+
function extractTextFromUnknown(value, depth = 0) {
|
|
29
|
+
if (depth > 5 || value == null)
|
|
30
|
+
return [];
|
|
31
|
+
if (typeof value === "string") {
|
|
32
|
+
const normalized = normalizeInspectorText(value);
|
|
33
|
+
return normalized ? [normalized] : [];
|
|
34
|
+
}
|
|
35
|
+
if (Array.isArray(value)) {
|
|
36
|
+
return value.flatMap((entry) => extractTextFromUnknown(entry, depth + 1));
|
|
37
|
+
}
|
|
38
|
+
if (typeof value !== "object") {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
const record = value;
|
|
42
|
+
if (typeof record.text === "string") {
|
|
43
|
+
return extractTextFromUnknown(record.text, depth + 1);
|
|
44
|
+
}
|
|
45
|
+
if (typeof record.content === "string") {
|
|
46
|
+
return extractTextFromUnknown(record.content, depth + 1);
|
|
47
|
+
}
|
|
48
|
+
const candidates = [
|
|
49
|
+
record.content,
|
|
50
|
+
record.parts,
|
|
51
|
+
record.messages,
|
|
52
|
+
record.message,
|
|
53
|
+
record.input,
|
|
54
|
+
record.output,
|
|
55
|
+
record.prompt,
|
|
56
|
+
record.response,
|
|
57
|
+
record.arguments,
|
|
58
|
+
];
|
|
59
|
+
for (const candidate of candidates) {
|
|
60
|
+
const extracted = extractTextFromUnknown(candidate, depth + 1);
|
|
61
|
+
if (extracted.length > 0)
|
|
62
|
+
return extracted;
|
|
63
|
+
}
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
function joinExtractedText(value) {
|
|
67
|
+
const text = extractTextFromUnknown(value)
|
|
68
|
+
.join("\n")
|
|
69
|
+
.trim();
|
|
70
|
+
return text.length > 0 ? text : null;
|
|
71
|
+
}
|
|
72
|
+
function extractLastPromptFromPayload(payload) {
|
|
73
|
+
const normalizedPayload = normalizeInspectorText(payload);
|
|
74
|
+
if (!normalizedPayload)
|
|
75
|
+
return null;
|
|
76
|
+
try {
|
|
77
|
+
const parsed = JSON.parse(normalizedPayload);
|
|
78
|
+
const messages = Array.isArray(parsed.messages)
|
|
79
|
+
? parsed.messages
|
|
80
|
+
: Array.isArray(parsed.input)
|
|
81
|
+
? parsed.input
|
|
82
|
+
: [];
|
|
83
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
84
|
+
const message = messages[i];
|
|
85
|
+
const role = String(message?.role || "").toLowerCase();
|
|
86
|
+
if (role !== "user")
|
|
87
|
+
continue;
|
|
88
|
+
const extracted = joinExtractedText(message?.content ?? message);
|
|
89
|
+
if (extracted)
|
|
90
|
+
return extracted;
|
|
91
|
+
}
|
|
92
|
+
return joinExtractedText(parsed.prompt ?? parsed.input ?? parsed.messages);
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function extractLastResponseFromRawResponse(rawResponse) {
|
|
99
|
+
const normalizedResponse = normalizeInspectorText(rawResponse);
|
|
100
|
+
if (!normalizedResponse)
|
|
101
|
+
return null;
|
|
102
|
+
const parseJsonResponse = (jsonText) => {
|
|
103
|
+
try {
|
|
104
|
+
const parsed = JSON.parse(jsonText);
|
|
105
|
+
const choices = Array.isArray(parsed.choices) ? parsed.choices : [];
|
|
106
|
+
const chunks = [];
|
|
107
|
+
for (const choice of choices) {
|
|
108
|
+
const record = choice;
|
|
109
|
+
const content = joinExtractedText(record.message) ||
|
|
110
|
+
joinExtractedText(record.delta) ||
|
|
111
|
+
joinExtractedText(record.text);
|
|
112
|
+
if (content) {
|
|
113
|
+
chunks.push(content);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (chunks.length > 0) {
|
|
117
|
+
return chunks.join("");
|
|
118
|
+
}
|
|
119
|
+
return joinExtractedText(parsed.response ?? parsed.output ?? parsed.message);
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const direct = parseJsonResponse(normalizedResponse);
|
|
126
|
+
if (direct)
|
|
127
|
+
return direct;
|
|
128
|
+
const sseChunks = [];
|
|
129
|
+
for (const line of normalizedResponse.split("\n")) {
|
|
130
|
+
const trimmed = line.trim();
|
|
131
|
+
if (!trimmed.startsWith("data:"))
|
|
132
|
+
continue;
|
|
133
|
+
const data = trimmed.slice(5).trim();
|
|
134
|
+
if (!data || data === "[DONE]")
|
|
135
|
+
continue;
|
|
136
|
+
const chunk = parseJsonResponse(data);
|
|
137
|
+
if (chunk) {
|
|
138
|
+
sseChunks.push(chunk);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (sseChunks.length > 0) {
|
|
142
|
+
return sseChunks.join("").trim() || null;
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
function extractLastMessageByRole(messages, role) {
|
|
147
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
148
|
+
const message = messages[i];
|
|
149
|
+
if (message?.role !== role)
|
|
150
|
+
continue;
|
|
151
|
+
const content = normalizeInspectorText(message.content);
|
|
152
|
+
if (content)
|
|
153
|
+
return content;
|
|
154
|
+
}
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
function toSingleLine(value, maxLength = 140) {
|
|
158
|
+
const normalized = normalizeInspectorText(value);
|
|
159
|
+
if (!normalized)
|
|
160
|
+
return null;
|
|
161
|
+
const singleLine = normalized.replace(/\s+/g, " ").trim();
|
|
162
|
+
if (!singleLine)
|
|
163
|
+
return null;
|
|
164
|
+
return singleLine.length > maxLength
|
|
165
|
+
? `${singleLine.slice(0, maxLength)}...`
|
|
166
|
+
: singleLine;
|
|
167
|
+
}
|
|
168
|
+
function getPersistentLogDetailSummary(log) {
|
|
169
|
+
const details = [
|
|
170
|
+
toSingleLine(log.summary, 180),
|
|
171
|
+
log.error ? `Error: ${toSingleLine(log.error, 120)}` : null,
|
|
172
|
+
log.payloadPreview ? `Payload: ${toSingleLine(log.payloadPreview, 90)}` : null,
|
|
173
|
+
log.resultPreview ? `Result: ${toSingleLine(log.resultPreview, 90)}` : null,
|
|
174
|
+
log.metadataJson ? `Metadata: ${toSingleLine(log.metadataJson, 90)}` : null,
|
|
175
|
+
]
|
|
176
|
+
.filter(Boolean)
|
|
177
|
+
.join(" | ");
|
|
178
|
+
return details || null;
|
|
179
|
+
}
|
|
180
|
+
function formatPersistentLogEntry(log) {
|
|
181
|
+
const heading = [
|
|
182
|
+
`[${formatDiagnosticTime(log.createdAt)}]`,
|
|
183
|
+
log.eventType || "event",
|
|
184
|
+
log.stage ? `(${log.stage})` : null,
|
|
185
|
+
log.status ? `- ${log.status}` : null,
|
|
186
|
+
]
|
|
187
|
+
.filter(Boolean)
|
|
188
|
+
.join(" ");
|
|
189
|
+
const details = [
|
|
190
|
+
log.source,
|
|
191
|
+
log.seq != null ? `seq ${log.seq}` : null,
|
|
192
|
+
log.durationMs != null ? `${log.durationMs} ms` : null,
|
|
193
|
+
log.success != null ? (log.success ? "success" : "failed") : null,
|
|
194
|
+
getPersistentLogDetailSummary(log),
|
|
195
|
+
]
|
|
196
|
+
.filter(Boolean)
|
|
197
|
+
.join(" | ");
|
|
198
|
+
return details ? `${heading} | ${details}` : heading;
|
|
199
|
+
}
|
|
200
|
+
function renderPersistentLogsTable(persistentLogs) {
|
|
201
|
+
return (_jsx("div", { className: "min-h-0 flex-1 overflow-x-auto overflow-y-auto rounded border border-slate-200 bg-white", children: _jsxs("table", { className: "min-w-[1100px] border-collapse text-[11px] text-slate-700", children: [_jsx("thead", { className: "sticky top-0 z-10 bg-slate-50", children: _jsxs("tr", { className: "border-b border-slate-200 text-left text-[10px] font-semibold tracking-wider text-slate-500 uppercase", children: [_jsx("th", { className: "px-2 py-2", children: "Time" }), _jsx("th", { className: "px-2 py-2", children: "Event" }), _jsx("th", { className: "px-2 py-2", children: "Stage" }), _jsx("th", { className: "px-2 py-2", children: "Status" }), _jsx("th", { className: "px-2 py-2", children: "Source" }), _jsx("th", { className: "px-2 py-2", children: "Details" })] }) }), _jsx("tbody", { children: persistentLogs.map((log) => {
|
|
202
|
+
const detailSummary = getPersistentLogDetailSummary(log) ?? "—";
|
|
203
|
+
return (_jsxs("tr", { className: "border-b border-slate-100 align-top last:border-b-0", children: [_jsx("td", { className: "max-w-32 px-2 py-1.5 whitespace-nowrap text-slate-500", children: _jsx("span", { className: "block truncate", title: formatDiagnosticTime(log.createdAt), children: formatDiagnosticTime(log.createdAt) }) }), _jsx("td", { className: "max-w-28 px-2 py-1.5 whitespace-nowrap font-medium text-slate-800", children: _jsx("span", { className: "block truncate", title: log.eventType || "event", children: log.eventType || "event" }) }), _jsx("td", { className: "max-w-24 px-2 py-1.5 whitespace-nowrap", children: _jsx("span", { className: "block truncate", title: log.stage || "—", children: log.stage || "—" }) }), _jsx("td", { className: "max-w-24 px-2 py-1.5 whitespace-nowrap", children: _jsx("span", { className: "block truncate", title: log.status || "—", children: log.status || "—" }) }), _jsx("td", { className: "max-w-28 px-2 py-1.5 whitespace-nowrap", children: _jsx("span", { className: "block truncate", title: log.source || "—", children: log.source || "—" }) }), _jsx("td", { className: "min-w-md px-2 py-1.5 whitespace-nowrap", children: _jsx("span", { className: "block truncate", title: detailSummary, children: detailSummary }) })] }, log.logId));
|
|
204
|
+
}) })] }) }));
|
|
205
|
+
}
|
|
206
|
+
function buildPersistentLogsSection(persistentLogs) {
|
|
207
|
+
return {
|
|
208
|
+
title: persistentLogs.length > 0
|
|
209
|
+
? `Agent logs (${persistentLogs.length})`
|
|
210
|
+
: "Agent logs",
|
|
211
|
+
content: persistentLogs.length > 0
|
|
212
|
+
? persistentLogs
|
|
213
|
+
.map((log) => formatPersistentLogEntry(log))
|
|
214
|
+
.join("\n")
|
|
215
|
+
: "No persistent agent logs were recorded for this agent yet.",
|
|
216
|
+
contentNode: persistentLogs.length > 0
|
|
217
|
+
? renderPersistentLogsTable(persistentLogs)
|
|
218
|
+
: undefined,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function buildDiagnosticsSections(params) {
|
|
222
|
+
const { socketDiagnostics, runDiagnosticsSnapshot, serverDiagnostics, messages, payload, rawResponse, } = params;
|
|
223
|
+
const summary = interpretAgentRunDiagnostics({
|
|
224
|
+
socketDiagnostics,
|
|
225
|
+
localSnapshot: runDiagnosticsSnapshot,
|
|
226
|
+
serverDiagnostics,
|
|
227
|
+
});
|
|
228
|
+
const lastPrompt = extractLastPromptFromPayload(payload) ||
|
|
229
|
+
extractLastMessageByRole(messages, "user");
|
|
230
|
+
const lastResponse = extractLastResponseFromRawResponse(rawResponse) ||
|
|
231
|
+
extractLastMessageByRole(messages, "assistant");
|
|
232
|
+
const sections = [
|
|
233
|
+
{
|
|
234
|
+
title: "Summary",
|
|
235
|
+
content: lines([
|
|
236
|
+
`Diagnosis: ${summary.title}`,
|
|
237
|
+
summary.detail,
|
|
238
|
+
`Socket: ${socketDiagnostics.readyStateLabel}`,
|
|
239
|
+
`Session connected: ${yesNo(serverDiagnostics.currentSession.isConnected)}`,
|
|
240
|
+
`Session subscribed: ${yesNo(serverDiagnostics.currentSession.isSubscribed)}`,
|
|
241
|
+
`Server status: ${serverDiagnostics.execution.status || "unknown"}`,
|
|
242
|
+
`Last seq: ${serverDiagnostics.transport.lastSeq ?? runDiagnosticsSnapshot.lastSeq ?? "—"}`,
|
|
243
|
+
]),
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
title: "Client connection",
|
|
247
|
+
content: lines([
|
|
248
|
+
`Session ID: ${socketDiagnostics.sessionId || "—"}`,
|
|
249
|
+
`Socket state: ${socketDiagnostics.readyStateLabel}`,
|
|
250
|
+
`Reconnect count: ${socketDiagnostics.reconnectCount}`,
|
|
251
|
+
`Last socket event: ${socketDiagnostics.lastEventType} @ ${formatDiagnosticTime(socketDiagnostics.lastEventAt)}`,
|
|
252
|
+
`Last open: ${formatDiagnosticTime(socketDiagnostics.lastOpenAt)}`,
|
|
253
|
+
`Last message: ${formatDiagnosticTime(socketDiagnostics.lastMessageAt)}`,
|
|
254
|
+
`Last close: ${formatDiagnosticTime(socketDiagnostics.lastCloseAt)}`,
|
|
255
|
+
socketDiagnostics.lastCloseCode != null
|
|
256
|
+
? `Last close code: ${socketDiagnostics.lastCloseCode}`
|
|
257
|
+
: null,
|
|
258
|
+
socketDiagnostics.lastCloseReason
|
|
259
|
+
? `Last close reason: ${socketDiagnostics.lastCloseReason}`
|
|
260
|
+
: null,
|
|
261
|
+
`Last error: ${formatDiagnosticTime(socketDiagnostics.lastErrorAt)}`,
|
|
262
|
+
socketDiagnostics.lastErrorMessage
|
|
263
|
+
? `Last error message: ${socketDiagnostics.lastErrorMessage}`
|
|
264
|
+
: null,
|
|
265
|
+
]),
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
title: "Agent stream",
|
|
269
|
+
content: lines([
|
|
270
|
+
`Submitting: ${yesNo(runDiagnosticsSnapshot.isSubmitting)}`,
|
|
271
|
+
`Connecting: ${yesNo(runDiagnosticsSnapshot.isConnecting)}`,
|
|
272
|
+
`Waiting for response: ${yesNo(runDiagnosticsSnapshot.isWaitingForResponse)}`,
|
|
273
|
+
`Agent thinking: ${yesNo(runDiagnosticsSnapshot.isAgentThinking)}`,
|
|
274
|
+
`Executing: ${yesNo(runDiagnosticsSnapshot.isExecuting)}`,
|
|
275
|
+
`Active streaming message: ${yesNo(runDiagnosticsSnapshot.hasActiveStreaming)}`,
|
|
276
|
+
`Terminal subscribed: ${yesNo(runDiagnosticsSnapshot.isSubscribed)}`,
|
|
277
|
+
`Last local seq: ${runDiagnosticsSnapshot.lastSeq || "—"}`,
|
|
278
|
+
`Last local event: ${runDiagnosticsSnapshot.lastEventType || "—"} @ ${formatDiagnosticTime(runDiagnosticsSnapshot.lastEventAt)}`,
|
|
279
|
+
]),
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
title: "Tool UI state",
|
|
283
|
+
content: lines([
|
|
284
|
+
`Assistant messages: ${runDiagnosticsSnapshot.assistantMessageCount}`,
|
|
285
|
+
`Assistant groups: ${runDiagnosticsSnapshot.assistantGroupCount}`,
|
|
286
|
+
`Groups with renderable tool calls: ${runDiagnosticsSnapshot.assistantGroupsWithRenderableToolCalls}`,
|
|
287
|
+
`Messages with tool calls: ${runDiagnosticsSnapshot.messagesWithToolCalls}`,
|
|
288
|
+
`Total tool calls in local state: ${runDiagnosticsSnapshot.totalToolCallCount}`,
|
|
289
|
+
`Incomplete tool calls in local state: ${runDiagnosticsSnapshot.incompleteToolCallCount}`,
|
|
290
|
+
]),
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
title: "Server execution",
|
|
294
|
+
content: lines([
|
|
295
|
+
`Status: ${serverDiagnostics.execution.status || "unknown"}`,
|
|
296
|
+
`In-memory execution: ${yesNo(serverDiagnostics.execution.isInMemoryExecution)}`,
|
|
297
|
+
`Started: ${formatDiagnosticTime(serverDiagnostics.execution.startedAt)}`,
|
|
298
|
+
`Completed: ${formatDiagnosticTime(serverDiagnostics.execution.completedAt)}`,
|
|
299
|
+
serverDiagnostics.execution.error
|
|
300
|
+
? `Error: ${serverDiagnostics.execution.error}`
|
|
301
|
+
: null,
|
|
302
|
+
`Last message type: ${serverDiagnostics.transport.lastMessageType || "—"}`,
|
|
303
|
+
`Last delta type: ${serverDiagnostics.transport.lastDeltaType || "—"}`,
|
|
304
|
+
`Last status state: ${serverDiagnostics.transport.lastStatusState || "—"}`,
|
|
305
|
+
`Last lifecycle event: ${serverDiagnostics.transport.lastLifecycleEventType || "—"}`,
|
|
306
|
+
`Last produced: ${formatDiagnosticTime(serverDiagnostics.transport.lastProducedAt)}`,
|
|
307
|
+
`Last broadcast: ${formatDiagnosticTime(serverDiagnostics.transport.lastBroadcastAt)}`,
|
|
308
|
+
`Target sessions: ${serverDiagnostics.transport.targetSessionCount}`,
|
|
309
|
+
`Successful sends: ${serverDiagnostics.transport.successfulSessionCount}`,
|
|
310
|
+
`Failed sends: ${serverDiagnostics.transport.failedSessionCount}`,
|
|
311
|
+
`Connected subscribers: ${serverDiagnostics.transport.connectedSubscriberCount}`,
|
|
312
|
+
serverDiagnostics.transport.lastFailure
|
|
313
|
+
? `Last transport failure: ${serverDiagnostics.transport.lastFailure}`
|
|
314
|
+
: null,
|
|
315
|
+
]),
|
|
316
|
+
},
|
|
317
|
+
buildPersistentLogsSection(serverDiagnostics.persistentLogs ?? []),
|
|
318
|
+
{
|
|
319
|
+
title: "Run telemetry",
|
|
320
|
+
content: lines([
|
|
321
|
+
`Run requested: ${formatDiagnosticTime(serverDiagnostics.lastRunRequest?.requestedAt)}`,
|
|
322
|
+
`Run source: ${serverDiagnostics.lastRunRequest?.source || "—"}`,
|
|
323
|
+
serverDiagnostics.lastRunRequest?.detail
|
|
324
|
+
? `Run detail: ${serverDiagnostics.lastRunRequest.detail}`
|
|
325
|
+
: null,
|
|
326
|
+
`Cancel requested: ${formatDiagnosticTime(serverDiagnostics.lastCancellation?.requestedAt)}`,
|
|
327
|
+
`Cancel source: ${serverDiagnostics.lastCancellation?.source || "—"}`,
|
|
328
|
+
serverDiagnostics.lastCancellation?.requestedBy
|
|
329
|
+
? `Cancel requested by: ${serverDiagnostics.lastCancellation.requestedBy}`
|
|
330
|
+
: null,
|
|
331
|
+
serverDiagnostics.lastCancellation?.reason
|
|
332
|
+
? `Cancel reason: ${serverDiagnostics.lastCancellation.reason}`
|
|
333
|
+
: null,
|
|
334
|
+
serverDiagnostics.lastCancellation?.detail
|
|
335
|
+
? `Cancel detail: ${serverDiagnostics.lastCancellation.detail}`
|
|
336
|
+
: null,
|
|
337
|
+
`Cancellation observed: ${formatDiagnosticTime(serverDiagnostics.lastCancellation?.observedAt)}`,
|
|
338
|
+
`Observed by: ${serverDiagnostics.lastCancellation?.observedSource || "—"}`,
|
|
339
|
+
serverDiagnostics.lastCancellation?.observedDetail
|
|
340
|
+
? `Observed detail: ${serverDiagnostics.lastCancellation.observedDetail}`
|
|
341
|
+
: null,
|
|
342
|
+
]),
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
title: "Current session",
|
|
346
|
+
content: lines([
|
|
347
|
+
`Session found: ${yesNo(serverDiagnostics.currentSession.sessionFound)}`,
|
|
348
|
+
`Browser matched: ${yesNo(serverDiagnostics.currentSession.browserMatched)}`,
|
|
349
|
+
`Connected: ${yesNo(serverDiagnostics.currentSession.isConnected)}`,
|
|
350
|
+
`Subscribed: ${yesNo(serverDiagnostics.currentSession.isSubscribed)}`,
|
|
351
|
+
`Connected at: ${formatDiagnosticTime(serverDiagnostics.currentSession.connectedAt)}`,
|
|
352
|
+
`Last delivery attempt: ${formatDiagnosticTime(serverDiagnostics.currentSession.lastDelivery?.lastAttemptAt)}`,
|
|
353
|
+
`Last delivery success: ${formatDiagnosticTime(serverDiagnostics.currentSession.lastDelivery?.lastSuccessAt)}`,
|
|
354
|
+
`Last delivery failure: ${formatDiagnosticTime(serverDiagnostics.currentSession.lastDelivery?.lastFailureAt)}`,
|
|
355
|
+
serverDiagnostics.currentSession.lastDelivery?.lastFailureReason
|
|
356
|
+
? `Failure reason: ${serverDiagnostics.currentSession.lastDelivery.lastFailureReason}`
|
|
357
|
+
: null,
|
|
358
|
+
serverDiagnostics.currentSession.lastDelivery?.lastMessageType
|
|
359
|
+
? `Last delivered message: ${serverDiagnostics.currentSession.lastDelivery.lastMessageType}`
|
|
360
|
+
: null,
|
|
361
|
+
serverDiagnostics.currentSession.lastDelivery?.lastSeq != null
|
|
362
|
+
? `Last delivered seq: ${serverDiagnostics.currentSession.lastDelivery.lastSeq}`
|
|
363
|
+
: null,
|
|
364
|
+
]),
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
title: "Recent client events",
|
|
368
|
+
content: runDiagnosticsSnapshot.recentEvents.length > 0
|
|
369
|
+
? runDiagnosticsSnapshot.recentEvents
|
|
370
|
+
.slice()
|
|
371
|
+
.reverse()
|
|
372
|
+
.map((event) => formatAgentDiagnosticsEvent(event))
|
|
373
|
+
.join("\n")
|
|
374
|
+
: "No recent client-side agent stream events were captured for this terminal.",
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
title: "Recent tool UI events",
|
|
378
|
+
content: runDiagnosticsSnapshot.recentToolUiEvents.length > 0
|
|
379
|
+
? runDiagnosticsSnapshot.recentToolUiEvents
|
|
380
|
+
.slice()
|
|
381
|
+
.reverse()
|
|
382
|
+
.map((event) => formatAgentDiagnosticsEvent(event))
|
|
383
|
+
.join("\n")
|
|
384
|
+
: "No recent tool-specific UI events were captured for this terminal.",
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
title: "Recent server events",
|
|
388
|
+
content: serverDiagnostics.transport.recentEvents.length > 0
|
|
389
|
+
? serverDiagnostics.transport.recentEvents
|
|
390
|
+
.map((event) => formatAgentDiagnosticsEvent(event))
|
|
391
|
+
.join("\n")
|
|
392
|
+
: "No recent server-side agent transport events were recorded.",
|
|
393
|
+
},
|
|
394
|
+
];
|
|
395
|
+
if (payload) {
|
|
396
|
+
sections.splice(1, 0, {
|
|
397
|
+
title: "Raw full prompt",
|
|
398
|
+
content: payload,
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
if (rawResponse) {
|
|
402
|
+
sections.splice(payload ? 2 : 1, 0, {
|
|
403
|
+
title: "Raw response",
|
|
404
|
+
content: rawResponse,
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
sections.push({
|
|
408
|
+
title: "Last prompt",
|
|
409
|
+
content: lastPrompt ?? "No prompt was captured for this agent run yet.",
|
|
410
|
+
});
|
|
411
|
+
sections.push({
|
|
412
|
+
title: "Last response",
|
|
413
|
+
content: lastResponse ?? "No assistant response was captured for this agent run yet.",
|
|
414
|
+
});
|
|
415
|
+
return sections;
|
|
416
|
+
}
|
|
417
|
+
export function AgentTerminalStatusBar({ agent, contextWindowStatus, effectiveModelName, socketDiagnostics, runDiagnosticsSnapshot, liveTotals, totalTokens, effectiveCostLimit, messages, showCompressionPopover, setShowCompressionPopover, }) {
|
|
11
418
|
const hasData = !!contextWindowStatus?.contextWindowTokens;
|
|
12
419
|
const percentValue = hasData
|
|
13
420
|
? typeof contextWindowStatus?.contextUsedPercent === "number"
|
|
@@ -15,6 +422,13 @@ export function AgentTerminalStatusBar({ agent, contextWindowStatus, liveTotals,
|
|
|
15
422
|
: 0
|
|
16
423
|
: 0;
|
|
17
424
|
const pct = hasData ? `${percentValue.toFixed(1)}%` : "—";
|
|
425
|
+
const resolvedModelName = (contextWindowStatus?.model ||
|
|
426
|
+
effectiveModelName ||
|
|
427
|
+
"").trim();
|
|
428
|
+
const localSummary = useMemo(() => interpretAgentRunDiagnostics({
|
|
429
|
+
socketDiagnostics,
|
|
430
|
+
localSnapshot: runDiagnosticsSnapshot,
|
|
431
|
+
}), [runDiagnosticsSnapshot, socketDiagnostics]);
|
|
18
432
|
const getContextColor = (percent) => {
|
|
19
433
|
if (percent < 50)
|
|
20
434
|
return "#22c55e";
|
|
@@ -32,10 +446,36 @@ export function AgentTerminalStatusBar({ agent, contextWindowStatus, liveTotals,
|
|
|
32
446
|
}
|
|
33
447
|
return tokens.toString();
|
|
34
448
|
};
|
|
35
|
-
|
|
449
|
+
const [hasDebugPayload, setHasDebugPayload] = useState(false);
|
|
450
|
+
const hasAssistantMessages = messages.some((m) => m.role === "assistant");
|
|
451
|
+
const canOpenDiagnostics = Boolean(agent?.id) && agent?.status !== "new";
|
|
452
|
+
useEffect(() => {
|
|
453
|
+
let cancelled = false;
|
|
454
|
+
if (!agent?.id || agent.status === "new") {
|
|
455
|
+
setHasDebugPayload(false);
|
|
456
|
+
return () => {
|
|
457
|
+
cancelled = true;
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
getLastPayload(agent.id)
|
|
461
|
+
.then(({ payload, rawResponse }) => {
|
|
462
|
+
if (!cancelled) {
|
|
463
|
+
setHasDebugPayload(Boolean(payload || rawResponse));
|
|
464
|
+
}
|
|
465
|
+
})
|
|
466
|
+
.catch(() => {
|
|
467
|
+
if (!cancelled) {
|
|
468
|
+
setHasDebugPayload(false);
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
return () => {
|
|
472
|
+
cancelled = true;
|
|
473
|
+
};
|
|
474
|
+
}, [agent?.id, agent?.status, agent?.lastMessageDate, agent?.updatedDate]);
|
|
475
|
+
return (_jsxs("div", { className: "mt-1 flex items-center gap-2 text-[11px] text-gray-500", children: [agent?.id && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("div", { className: "flex cursor-help items-center justify-center", children: _jsxs("svg", { className: "h-3 w-3 shrink-0", viewBox: "0 0 36 36", "aria-hidden": "true", children: [_jsx("circle", { cx: "18", cy: "18", r: radius, fill: "none", stroke: "#e5e7eb", strokeWidth: "4" }), hasData && (_jsx("circle", { cx: "18", cy: "18", r: radius, fill: "none", stroke: contextColor, strokeWidth: "4", strokeDasharray: `${percentValue} 100`, strokeLinecap: "round", style: {
|
|
36
476
|
transformOrigin: "center",
|
|
37
477
|
transform: "rotate(-90deg)",
|
|
38
|
-
} })), !hasData && (_jsx("circle", { cx: "18", cy: "18", r: radius, fill: "none", stroke: contextColor, strokeWidth: "4", strokeDasharray: "0 100", strokeLinecap: "round", opacity: 0.5 }))] }) }) }), _jsx(TooltipContent, { side: "top", sideOffset: 6, children: hasData && contextWindowStatus ? (_jsxs("div", { className: "max-w-[320px] space-y-1 text-[11px]", children: [
|
|
478
|
+
} })), !hasData && (_jsx("circle", { cx: "18", cy: "18", r: radius, fill: "none", stroke: contextColor, strokeWidth: "4", strokeDasharray: "0 100", strokeLinecap: "round", opacity: 0.5 }))] }) }) }), _jsx(TooltipContent, { side: "top", sideOffset: 6, children: hasData && contextWindowStatus ? (_jsxs("div", { className: "max-w-[320px] space-y-1 text-[11px]", children: [resolvedModelName && (_jsxs("div", { children: [_jsx("span", { className: "font-semibold", children: "Model:" }), " ", resolvedModelName] })), _jsxs("div", { children: [_jsx("span", { className: "font-semibold", children: "Context window:" }), " ", formatTokens(contextWindowStatus.estimatedInputTokens || 0), " ", "/", " ", formatTokens(contextWindowStatus.contextWindowTokens), " ", "tokens"] }), _jsxs("div", { children: [_jsx("span", { className: "font-semibold", children: "Used:" }), " ", pct] })] })) : (_jsxs("div", { className: "max-w-[320px] space-y-1 text-[11px]", children: [resolvedModelName && (_jsxs("div", { children: [_jsx("span", { className: "font-semibold", children: "Model:" }), " ", resolvedModelName] })), _jsx("div", { children: "Context window usage will appear here when the agent starts processing." })] })) })] })), agent?.compressionMarkerIndex != null && (_jsxs(Popover, { open: showCompressionPopover, onOpenChange: setShowCompressionPopover, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "border-theme-secondary/20 bg-theme-secondary-light/50 text-theme-secondary hover:bg-theme-secondary-light flex cursor-pointer items-center rounded border px-2 py-0.5 text-[11px] transition-colors", onClick: () => setShowCompressionPopover(!showCompressionPopover), children: "Compressed" }) }), _jsx(PopoverContent, { className: "w-96 p-4", align: "start", side: "top", children: _jsxs("div", { className: "space-y-3", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-[10px] font-semibold text-gray-900", children: "Conversation Compressed" }), _jsxs("p", { className: "mt-1 text-[11px] text-gray-600", children: ["First ", agent.compressionMarkerIndex, " messages have been summarized to reduce context usage."] })] }), agent.compressedSummary && (_jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "text-[11px] font-medium text-gray-700", children: "Summary:" }), _jsx("div", { className: "max-h-64 overflow-y-auto rounded border border-gray-200 bg-gray-50 p-3 text-[11px] whitespace-pre-wrap text-gray-700", children: agent.compressedSummary })] }))] }) })] })), _jsx(AgentCostDisplay, { totalTokens: liveTotals
|
|
39
479
|
? {
|
|
40
480
|
input: liveTotals.input,
|
|
41
481
|
output: liveTotals.output,
|
|
@@ -45,55 +485,40 @@ export function AgentTerminalStatusBar({ agent, contextWindowStatus, liveTotals,
|
|
|
45
485
|
outputCost: liveTotals.outputCost,
|
|
46
486
|
cachedCost: liveTotals.cachedCost,
|
|
47
487
|
cacheWriteCost: liveTotals.cacheWriteCost ?? 0,
|
|
488
|
+
imageCost: liveTotals.imageCost ?? 0,
|
|
48
489
|
totalCost: liveTotals.totalCost,
|
|
49
490
|
}
|
|
50
|
-
: totalTokens, costLimit: effectiveCostLimit }), agent?.id && (_jsxs(Tooltip, { children: [_jsx(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
duration: 3000,
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}, children: _jsx(Bug, { className: "h-3 w-3", strokeWidth: 1.5 }) }) }), _jsx(TooltipContent, { side: "top", sideOffset: 6, children: !messages.some((m) => m.role === "assistant")
|
|
86
|
-
? "Available after first response"
|
|
87
|
-
: "Copy last API payload and AI response to clipboard" })] })), activeProfile && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: "flex items-center gap-1 text-[10px] text-gray-400 hover:text-gray-600", "aria-label": "Open profile settings", onClick: async () => {
|
|
88
|
-
if (!editContext || !activeProfile?.id)
|
|
89
|
-
return;
|
|
90
|
-
const lang = editContext?.currentItemDescriptor?.language || "en";
|
|
91
|
-
await editContext.loadItem({
|
|
92
|
-
id: activeProfile.id,
|
|
93
|
-
language: lang,
|
|
94
|
-
version: 0,
|
|
95
|
-
});
|
|
96
|
-
editContext.switchWorkspace("editor");
|
|
97
|
-
}, children: [_jsx("span", { className: "max-w-[100px] truncate", children: activeProfile.name }), _jsx(ExternalLink, { className: "h-2.5 w-2.5 shrink-0", strokeWidth: 1.5 })] }) }), _jsx(TooltipContent, { side: "top", sideOffset: 6, children: "Open profile settings" })] }))] }));
|
|
491
|
+
: totalTokens, costLimit: effectiveCostLimit }), agent?.id && (_jsxs(Tooltip, { children: [_jsx(ContentInspectorPopover, { title: "Run diagnostics", emptyMessage: "No diagnostics are available for this agent yet.", downloadFileName: `agent-${agent.id}-diagnostics.txt`, loadSections: async () => {
|
|
492
|
+
if (!agent?.id)
|
|
493
|
+
return [];
|
|
494
|
+
const [diagnosticsResult, payloadResult] = await Promise.allSettled([
|
|
495
|
+
getAgentDiagnostics(agent.id, socketDiagnostics.sessionId),
|
|
496
|
+
getLastPayload(agent.id),
|
|
497
|
+
]);
|
|
498
|
+
if (diagnosticsResult.status !== "fulfilled") {
|
|
499
|
+
throw diagnosticsResult.reason;
|
|
500
|
+
}
|
|
501
|
+
const payload = payloadResult.status === "fulfilled"
|
|
502
|
+
? payloadResult.value.payload
|
|
503
|
+
: "";
|
|
504
|
+
const rawResponse = payloadResult.status === "fulfilled"
|
|
505
|
+
? payloadResult.value.rawResponse
|
|
506
|
+
: "";
|
|
507
|
+
return buildDiagnosticsSections({
|
|
508
|
+
agentId: agent.id,
|
|
509
|
+
socketDiagnostics,
|
|
510
|
+
runDiagnosticsSnapshot,
|
|
511
|
+
serverDiagnostics: diagnosticsResult.value,
|
|
512
|
+
messages,
|
|
513
|
+
payload,
|
|
514
|
+
rawResponse,
|
|
515
|
+
});
|
|
516
|
+
}, trigger: _jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", "data-testid": "agent-diagnostics-button", disabled: !canOpenDiagnostics, className: "flex items-center text-[10px] text-gray-400 hover:text-gray-600 disabled:cursor-not-allowed disabled:opacity-30", children: _jsx(Bug, { className: "h-3 w-3", strokeWidth: 1.5 }) }) }) }), _jsx(TooltipContent, { side: "top", sideOffset: 6, children: !canOpenDiagnostics
|
|
517
|
+
? "Available after the agent starts"
|
|
518
|
+
: hasAssistantMessages
|
|
519
|
+
? `${localSummary.title}: open diagnostics`
|
|
520
|
+
: hasDebugPayload
|
|
521
|
+
? "Inspect socket, stream, server, and provider diagnostics"
|
|
522
|
+
: "Inspect socket, stream, and server diagnostics" })] }))] }));
|
|
98
523
|
}
|
|
99
524
|
//# sourceMappingURL=AgentTerminalStatusBar.js.map
|