@parhelia/core 0.1.12554 → 0.1.12556
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 +4 -6
- package/dist/agents-view/AgentCard.js +24 -143
- package/dist/agents-view/AgentCard.js.map +1 -1
- package/dist/agents-view/AgentsInbox.d.ts +1 -1
- package/dist/agents-view/AgentsInbox.js +92 -7
- package/dist/agents-view/AgentsInbox.js.map +1 -1
- package/dist/agents-view/AgentsTitlebar.js +2 -3
- package/dist/agents-view/AgentsTitlebar.js.map +1 -1
- package/dist/agents-view/AgentsView.d.ts +7 -6
- package/dist/agents-view/AgentsView.js +98 -187
- package/dist/agents-view/AgentsView.js.map +1 -1
- package/dist/agents-view/AgentsWorkspaceView.d.ts +6 -2
- package/dist/agents-view/AgentsWorkspaceView.js +113 -266
- package/dist/agents-view/AgentsWorkspaceView.js.map +1 -1
- package/dist/agents-view/ProfileAgentsGroup.d.ts +1 -2
- package/dist/agents-view/ProfileAgentsGroup.js +3 -4
- 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 +4 -2
- 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 +10 -6
- 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 +1 -4
- 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 +4 -12
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/copy-button.d.ts +1 -2
- 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 +126 -21
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.js +3 -5
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/paste-button.d.ts +1 -2
- 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 +9 -1
- 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 +11 -4
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/config/config.d.ts +2 -4
- package/dist/config/config.js +70 -250
- package/dist/config/config.js.map +1 -1
- package/dist/config/types/workspace.d.ts +0 -6
- package/dist/config/types.d.ts +12 -63
- package/dist/config/types.js.map +1 -1
- package/dist/editor/ComponentInfo.d.ts +4 -0
- package/dist/editor/ComponentInfo.js +41 -0
- package/dist/editor/ComponentInfo.js.map +1 -0
- package/dist/editor/ConfirmationDialog.js +4 -20
- package/dist/editor/ConfirmationDialog.js.map +1 -1
- package/dist/editor/ContentTree.d.ts +1 -2
- package/dist/editor/ContentTree.js +32 -93
- package/dist/editor/ContentTree.js.map +1 -1
- package/dist/editor/Editor.js +22 -87
- package/dist/editor/Editor.js.map +1 -1
- package/dist/editor/FieldHistory.js +36 -84
- package/dist/editor/FieldHistory.js.map +1 -1
- package/dist/editor/FieldListField.js +9 -21
- package/dist/editor/FieldListField.js.map +1 -1
- package/dist/editor/FieldListFieldWithFallbacks.js +2 -23
- package/dist/editor/FieldListFieldWithFallbacks.js.map +1 -1
- package/dist/editor/GlobalMenuBar.js +2 -29
- package/dist/editor/GlobalMenuBar.js.map +1 -1
- package/dist/editor/ImageEditor.js +2 -5
- package/dist/editor/ImageEditor.js.map +1 -1
- package/dist/editor/ItemInfo.js +1 -36
- package/dist/editor/ItemInfo.js.map +1 -1
- package/dist/editor/LinkEditorDialog.js +0 -3
- package/dist/editor/LinkEditorDialog.js.map +1 -1
- package/dist/editor/MainLayout.d.ts +2 -0
- package/dist/editor/MainLayout.js +8 -65
- package/dist/editor/MainLayout.js.map +1 -1
- package/dist/editor/MigrationsView.js +5 -29
- package/dist/editor/MigrationsView.js.map +1 -1
- package/dist/editor/MobileLayout.js +12 -37
- package/dist/editor/MobileLayout.js.map +1 -1
- package/dist/editor/PictureCropper.js +45 -54
- package/dist/editor/PictureCropper.js.map +1 -1
- package/dist/editor/PictureEditor.js +15 -17
- 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 +12 -52
- package/dist/editor/SetupWizard.js.map +1 -1
- package/dist/editor/Titlebar.js +2 -7
- package/dist/editor/Titlebar.js.map +1 -1
- package/dist/editor/ai/AgentCostDisplay.d.ts +0 -1
- package/dist/editor/ai/AgentCostDisplay.js +1 -1
- package/dist/editor/ai/AgentCostDisplay.js.map +1 -1
- package/dist/editor/ai/AgentDocumentList.js +14 -32
- package/dist/editor/ai/AgentDocumentList.js.map +1 -1
- package/dist/editor/ai/AgentGreeting.js +2 -3
- package/dist/editor/ai/AgentGreeting.js.map +1 -1
- package/dist/editor/ai/AgentProfileSelector.js +1 -2
- package/dist/editor/ai/AgentProfileSelector.js.map +1 -1
- package/dist/editor/ai/AgentStatusBadge.d.ts +5 -0
- package/dist/editor/ai/AgentStatusBadge.js +65 -67
- package/dist/editor/ai/AgentStatusBadge.js.map +1 -1
- package/dist/editor/ai/AgentTerminal.d.ts +2 -14
- package/dist/editor/ai/AgentTerminal.js +483 -2377
- package/dist/editor/ai/AgentTerminal.js.map +1 -1
- package/dist/editor/ai/AgentTerminalStatusBar.d.ts +3 -8
- package/dist/editor/ai/AgentTerminalStatusBar.js +56 -460
- package/dist/editor/ai/AgentTerminalStatusBar.js.map +1 -1
- package/dist/editor/ai/Agents.js +113 -150
- package/dist/editor/ai/Agents.js.map +1 -1
- package/dist/editor/ai/AiResponseMessage.d.ts +1 -10
- package/dist/editor/ai/AiResponseMessage.js +23 -238
- package/dist/editor/ai/AiResponseMessage.js.map +1 -1
- package/dist/editor/ai/ContextInfoBar.d.ts +3 -2
- package/dist/editor/ai/ContextInfoBar.js +7 -64
- package/dist/editor/ai/ContextInfoBar.js.map +1 -1
- package/dist/editor/ai/GuidanceOverlay.js +11 -17
- package/dist/editor/ai/GuidanceOverlay.js.map +1 -1
- package/dist/editor/ai/HelpTerminal.d.ts +5 -0
- package/dist/editor/ai/HelpTerminal.js +166 -0
- package/dist/editor/ai/HelpTerminal.js.map +1 -0
- package/dist/editor/ai/InlineAiDialog.d.ts +1 -1
- package/dist/editor/ai/InlineAiDialog.js +192 -514
- package/dist/editor/ai/InlineAiDialog.js.map +1 -1
- package/dist/editor/ai/InlineAiTrigger.js +12 -115
- package/dist/editor/ai/InlineAiTrigger.js.map +1 -1
- package/dist/editor/ai/MediaImage.js +8 -40
- package/dist/editor/ai/MediaImage.js.map +1 -1
- package/dist/editor/ai/SpawnedAgentsPanel.js +12 -10
- package/dist/editor/ai/SpawnedAgentsPanel.js.map +1 -1
- package/dist/editor/ai/ToolCallDisplay.d.ts +2 -22
- package/dist/editor/ai/ToolCallDisplay.js +147 -518
- package/dist/editor/ai/ToolCallDisplay.js.map +1 -1
- package/dist/editor/ai/dialogs/AgentDialogHandler.d.ts +8 -1
- package/dist/editor/ai/dialogs/AgentDialogHandler.js +42 -379
- package/dist/editor/ai/dialogs/AgentDialogHandler.js.map +1 -1
- package/dist/editor/ai/dialogs/QuestionnaireInline.d.ts +1 -5
- package/dist/editor/ai/dialogs/QuestionnaireInline.js +60 -628
- package/dist/editor/ai/dialogs/QuestionnaireInline.js.map +1 -1
- package/dist/editor/ai/dialogs/agentDialogTypes.d.ts +0 -115
- package/dist/editor/ai/dialogs/agentDialogTypes.js +0 -2
- package/dist/editor/ai/dialogs/agentDialogTypes.js.map +1 -1
- package/dist/editor/ai/types.d.ts +1 -3
- package/dist/editor/ai/useAgentStatus.d.ts +1 -2
- package/dist/editor/ai/useAgentStatus.js +99 -86
- package/dist/editor/ai/useAgentStatus.js.map +1 -1
- package/dist/editor/ai/useInlineAiPosition.js +5 -45
- package/dist/editor/ai/useInlineAiPosition.js.map +1 -1
- package/dist/editor/client/AboutDialog.js +2 -4
- package/dist/editor/client/AboutDialog.js.map +1 -1
- package/dist/editor/client/EditorShell.d.ts +1 -4
- package/dist/editor/client/EditorShell.js +230 -730
- package/dist/editor/client/EditorShell.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +19 -33
- package/dist/editor/client/editContext.js.map +1 -1
- package/dist/editor/client/helpers.js +0 -6
- package/dist/editor/client/helpers.js.map +1 -1
- package/dist/editor/client/hooks/useEditorUrlSync.js +2 -1
- package/dist/editor/client/hooks/useEditorUrlSync.js.map +1 -1
- package/dist/editor/client/hooks/useEditorWebSocket.d.ts +0 -10
- package/dist/editor/client/hooks/useEditorWebSocket.js +14 -209
- package/dist/editor/client/hooks/useEditorWebSocket.js.map +1 -1
- package/dist/editor/client/hooks/useQuota.d.ts +0 -8
- package/dist/editor/client/hooks/useQuota.js.map +1 -1
- package/dist/editor/client/hooks/useSocketMessageHandler.js +7 -68
- package/dist/editor/client/hooks/useSocketMessageHandler.js.map +1 -1
- package/dist/editor/client/itemsRepository.js +6 -10
- package/dist/editor/client/itemsRepository.js.map +1 -1
- package/dist/editor/client/operations.d.ts +3 -6
- package/dist/editor/client/operations.js +30 -208
- package/dist/editor/client/operations.js.map +1 -1
- package/dist/editor/client/pageModelBuilder.js +31 -4
- 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 +6 -0
- package/dist/editor/client/ui/EditorChrome.js +72 -55
- package/dist/editor/client/ui/EditorChrome.js.map +1 -1
- package/dist/editor/client/ui/FullscreenControls.js +3 -5
- package/dist/editor/client/ui/FullscreenControls.js.map +1 -1
- package/dist/editor/commands/commands.d.ts +1 -11
- package/dist/editor/commands/commands.js +1 -12
- package/dist/editor/commands/commands.js.map +1 -1
- package/dist/editor/commands/componentCommands.js +55 -109
- package/dist/editor/commands/componentCommands.js.map +1 -1
- package/dist/editor/commands/customCommandConverter.d.ts +1 -8
- package/dist/editor/commands/customCommandConverter.js +5 -35
- package/dist/editor/commands/customCommandConverter.js.map +1 -1
- package/dist/editor/commands/handlers/agentHandler.js +1 -2
- package/dist/editor/commands/handlers/agentHandler.js.map +1 -1
- package/dist/editor/commands/itemCommands.d.ts +0 -3
- package/dist/editor/commands/itemCommands.js +10 -93
- package/dist/editor/commands/itemCommands.js.map +1 -1
- package/dist/editor/commands/undo.d.ts +15 -9
- package/dist/editor/commands/undo.js +0 -24
- package/dist/editor/commands/undo.js.map +1 -1
- package/dist/editor/context-menu/InsertMenu.js +39 -83
- 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/ReactQuill.d.ts +125 -0
- package/dist/editor/field-types/ReactQuill.js +385 -0
- package/dist/editor/field-types/ReactQuill.js.map +1 -0
- package/dist/editor/field-types/RichTextEditor.js +5 -13
- package/dist/editor/field-types/RichTextEditor.js.map +1 -1
- package/dist/editor/field-types/RichTextEditorComponent.js +3 -37
- 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 +2 -3
- package/dist/editor/field-types/TreeListEditor.js.map +1 -1
- package/dist/editor/field-types/richtext/components/ReactSlate.css +5 -23
- package/dist/editor/field-types/richtext/components/ReactSlate.d.ts +0 -2
- package/dist/editor/field-types/richtext/components/ReactSlate.js +4 -28
- package/dist/editor/field-types/richtext/components/ReactSlate.js.map +1 -1
- package/dist/editor/field-types/richtext/components/ToolbarButton.js +2 -4
- package/dist/editor/field-types/richtext/components/ToolbarButton.js.map +1 -1
- package/dist/editor/field-types/richtext/contextMenuFactory.d.ts +0 -13
- package/dist/editor/field-types/richtext/contextMenuFactory.js +24 -181
- package/dist/editor/field-types/richtext/contextMenuFactory.js.map +1 -1
- package/dist/editor/field-types/richtext/types.d.ts +0 -2
- package/dist/editor/field-types/richtext/types.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/plugins.js +0 -4
- package/dist/editor/field-types/richtext/utils/plugins.js.map +1 -1
- package/dist/editor/field-types/textContextMenuFactory.js +2 -3
- package/dist/editor/field-types/textContextMenuFactory.js.map +1 -1
- package/dist/editor/media-selector/AiImageSearchPrompt.js +2 -4
- 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 +1 -7
- package/dist/editor/media-selector/MediaSelector.js.map +1 -1
- package/dist/editor/media-selector/TreeSelector.js +35 -40
- 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 +2 -4
- 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 +147 -26
- package/dist/editor/menubar/PageSelector.js.map +1 -1
- package/dist/editor/menubar/Separator.js +1 -1
- package/dist/editor/menubar/VersionSelector.js +4 -2
- package/dist/editor/menubar/VersionSelector.js.map +1 -1
- package/dist/editor/menubar/WorkflowButton.js +12 -39
- package/dist/editor/menubar/WorkflowButton.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/CustomCommandsToolbar.js +38 -16
- 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 +0 -1
- package/dist/editor/menubar/toolbar-sections/HelpButton.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.d.ts +10 -6
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.js +220 -597
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js +2 -13
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js.map +1 -1
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +1 -42
- 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 +48 -97
- package/dist/editor/page-editor-chrome/InlineEditor.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +17 -38
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +11 -17
- 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 +11 -69
- package/dist/editor/page-viewer/EditorForm.js.map +1 -1
- package/dist/editor/page-viewer/MiniMap.d.ts +4 -2
- package/dist/editor/page-viewer/MiniMap.js +28 -91
- package/dist/editor/page-viewer/MiniMap.js.map +1 -1
- package/dist/editor/page-viewer/PageViewer.d.ts +1 -3
- package/dist/editor/page-viewer/PageViewer.js +19 -92
- package/dist/editor/page-viewer/PageViewer.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +1 -2
- package/dist/editor/page-viewer/PageViewerFrame.js +115 -348
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js +49 -114
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js.map +1 -1
- package/dist/editor/page-viewer/pageViewContext.d.ts +0 -1
- package/dist/editor/page-viewer/pageViewContext.js +14 -51
- package/dist/editor/page-viewer/pageViewContext.js.map +1 -1
- package/dist/editor/pageModel.d.ts +1 -14
- package/dist/editor/reviews/Comment.js +12 -26
- package/dist/editor/reviews/Comment.js.map +1 -1
- package/dist/editor/reviews/CommentDisplayPopover.js +5 -7
- package/dist/editor/reviews/CommentDisplayPopover.js.map +1 -1
- package/dist/editor/reviews/CommentView.js +4 -19
- package/dist/editor/reviews/CommentView.js.map +1 -1
- package/dist/editor/reviews/Comments.js +72 -89
- package/dist/editor/reviews/Comments.js.map +1 -1
- package/dist/editor/reviews/CreateReviewDialog.js +177 -281
- package/dist/editor/reviews/CreateReviewDialog.js.map +1 -1
- package/dist/editor/reviews/DecisionsMatrix.js +25 -96
- package/dist/editor/reviews/DecisionsMatrix.js.map +1 -1
- package/dist/editor/reviews/DiffView.js +14 -7
- package/dist/editor/reviews/DiffView.js.map +1 -1
- package/dist/editor/reviews/EditReviewSettingsDialog.js +4 -6
- package/dist/editor/reviews/EditReviewSettingsDialog.js.map +1 -1
- package/dist/editor/reviews/MultiReviewManager.js +3 -25
- package/dist/editor/reviews/MultiReviewManager.js.map +1 -1
- package/dist/editor/reviews/PagesPanel.js +15 -31
- package/dist/editor/reviews/PagesPanel.js.map +1 -1
- package/dist/editor/reviews/PreviewInfo.js +4 -1
- package/dist/editor/reviews/PreviewInfo.js.map +1 -1
- package/dist/editor/reviews/ReviewCard.js +7 -13
- package/dist/editor/reviews/ReviewCard.js.map +1 -1
- package/dist/editor/reviews/ReviewDetail.js +2 -3
- package/dist/editor/reviews/ReviewDetail.js.map +1 -1
- package/dist/editor/reviews/ReviewsList.js +3 -7
- package/dist/editor/reviews/ReviewsList.js.map +1 -1
- package/dist/editor/reviews/SuggestedEdit.js +3 -34
- package/dist/editor/reviews/SuggestedEdit.js.map +1 -1
- package/dist/editor/reviews/SuggestionDisplayPopover.js +5 -31
- package/dist/editor/reviews/SuggestionDisplayPopover.js.map +1 -1
- package/dist/editor/reviews/commentAi.js +6 -25
- package/dist/editor/reviews/commentAi.js.map +1 -1
- package/dist/editor/reviews/reviewCommands.js +1 -4
- 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 +30 -12
- package/dist/editor/reviews/useReviews.js.map +1 -1
- package/dist/editor/services/agentService.d.ts +5 -229
- package/dist/editor/services/agentService.js +39 -292
- package/dist/editor/services/agentService.js.map +1 -1
- package/dist/editor/services/aiService.d.ts +1 -57
- package/dist/editor/services/aiService.js +6 -79
- package/dist/editor/services/aiService.js.map +1 -1
- package/dist/editor/services/contentService.d.ts +3 -6
- package/dist/editor/services/contentService.js +12 -13
- package/dist/editor/services/contentService.js.map +1 -1
- package/dist/editor/services/editService.d.ts +1 -52
- package/dist/editor/services/editService.js +2 -94
- 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 +6 -3
- package/dist/editor/services/reviewsService.js +11 -2
- package/dist/editor/services/reviewsService.js.map +1 -1
- package/dist/editor/services/serviceHelper.d.ts +1 -2
- package/dist/editor/services/serviceHelper.js +20 -112
- package/dist/editor/services/serviceHelper.js.map +1 -1
- package/dist/editor/services/systemService.d.ts +1 -2
- package/dist/editor/services/systemService.js +0 -3
- package/dist/editor/services/systemService.js.map +1 -1
- package/dist/editor/services-server/api.d.ts +2 -1
- package/dist/editor/services-server/api.js +6 -11
- package/dist/editor/services-server/api.js.map +1 -1
- package/dist/editor/services-server/graphQL.d.ts +29 -0
- package/dist/editor/services-server/graphQL.js +53 -0
- package/dist/editor/services-server/graphQL.js.map +1 -0
- package/dist/editor/settings/About.js +3 -317
- package/dist/editor/settings/About.js.map +1 -1
- package/dist/editor/settings/AllAgentsPanel.d.ts +5 -0
- package/dist/editor/settings/AllAgentsPanel.js +139 -0
- package/dist/editor/settings/AllAgentsPanel.js.map +1 -0
- package/dist/editor/settings/LatestFeedback.d.ts +1 -0
- package/dist/editor/settings/LatestFeedback.js +136 -0
- package/dist/editor/settings/LatestFeedback.js.map +1 -0
- package/dist/editor/settings/QuotaInfo.js +4 -210
- package/dist/editor/settings/QuotaInfo.js.map +1 -1
- package/dist/editor/settings/SettingsView.js +23 -25
- package/dist/editor/settings/SettingsView.js.map +1 -1
- package/dist/editor/settings/Setup.d.ts +1 -0
- package/dist/editor/settings/Setup.js +211 -0
- package/dist/editor/settings/Setup.js.map +1 -0
- package/dist/editor/settings/Status.js +6 -7
- package/dist/editor/settings/Status.js.map +1 -1
- package/dist/editor/settings/index/useIndexStatus.js +22 -20
- package/dist/editor/settings/index/useIndexStatus.js.map +1 -1
- package/dist/editor/settings/panels/AgentsPanel.d.ts +4 -0
- package/dist/editor/settings/panels/AgentsPanel.js +121 -95
- package/dist/editor/settings/panels/AgentsPanel.js.map +1 -1
- package/dist/editor/settings/panels/DatabasePanel.d.ts +6 -0
- package/dist/editor/settings/panels/DatabasePanel.js +50 -0
- package/dist/editor/settings/panels/DatabasePanel.js.map +1 -0
- package/dist/editor/settings/panels/ModelsPanel.js +108 -329
- 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 +59 -86
- 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 +2 -3
- package/dist/editor/settings/panels/index.js +2 -3
- package/dist/editor/settings/panels/index.js.map +1 -1
- package/dist/editor/settings/setup-steps/AiSetupStep/EmbeddingsModelSection.d.ts +2 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/EmbeddingsModelSection.js +195 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/EmbeddingsModelSection.js.map +1 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/index.d.ts +2 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/index.js +21 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/index.js.map +1 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/provider/ProviderSection.d.ts +1 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/provider/ProviderSection.js +233 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/provider/ProviderSection.js.map +1 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersList.d.ts +15 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersList.js +14 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersList.js.map +1 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.d.ts +1 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.js +94 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.js.map +1 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/types.d.ts +1 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/types.js +2 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/types.js.map +1 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/utils.d.ts +5 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/utils.js +44 -0
- package/dist/editor/settings/setup-steps/AiSetupStep/utils.js.map +1 -0
- package/dist/editor/settings/setup-steps/IndexSetupStep.d.ts +2 -0
- package/dist/editor/settings/setup-steps/IndexSetupStep.js +36 -0
- package/dist/editor/settings/setup-steps/IndexSetupStep.js.map +1 -0
- package/dist/editor/settings/setup-steps/SettingsSetupStep.d.ts +2 -0
- package/dist/editor/settings/setup-steps/SettingsSetupStep.js +111 -0
- package/dist/editor/settings/setup-steps/SettingsSetupStep.js.map +1 -0
- package/dist/editor/settings/setup-steps/SetupOverview.d.ts +14 -0
- package/dist/editor/settings/setup-steps/SetupOverview.js +38 -0
- package/dist/editor/settings/setup-steps/SetupOverview.js.map +1 -0
- package/dist/editor/settings/status/coreStatusChecks.js +19 -124
- package/dist/editor/settings/status/coreStatusChecks.js.map +1 -1
- package/dist/editor/settings/status/useStartupChecks.d.ts +1 -3
- package/dist/editor/settings/status/useStartupChecks.js +5 -9
- package/dist/editor/settings/status/useStartupChecks.js.map +1 -1
- package/dist/editor/setup-wizard/steps/CompleteStep.d.ts +1 -2
- package/dist/editor/setup-wizard/steps/CompleteStep.js +1 -2
- package/dist/editor/setup-wizard/steps/CompleteStep.js.map +1 -1
- package/dist/editor/sidebar/ComponentPalette.js +1 -2
- package/dist/editor/sidebar/ComponentPalette.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.d.ts +1 -8
- package/dist/editor/sidebar/ComponentTree.js +69 -216
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/sidebar/Debug.d.ts +1 -0
- package/dist/editor/sidebar/Debug.js +70 -0
- package/dist/editor/sidebar/Debug.js.map +1 -0
- package/dist/editor/sidebar/EditHistory.js +46 -22
- package/dist/editor/sidebar/EditHistory.js.map +1 -1
- package/dist/editor/sidebar/Favorites.js +8 -4
- package/dist/editor/sidebar/Favorites.js.map +1 -1
- package/dist/editor/sidebar/GraphQL.d.ts +2 -0
- package/dist/editor/sidebar/GraphQL.js +234 -0
- package/dist/editor/sidebar/GraphQL.js.map +1 -0
- package/dist/editor/sidebar/LeftToolbar.d.ts +1 -0
- package/dist/editor/sidebar/LeftToolbar.js +12 -0
- package/dist/editor/sidebar/LeftToolbar.js.map +1 -0
- package/dist/editor/sidebar/MainContentTree.js +3 -4
- package/dist/editor/sidebar/MainContentTree.js.map +1 -1
- package/dist/editor/sidebar/NavigationSidebar.d.ts +4 -0
- package/dist/editor/sidebar/NavigationSidebar.js +254 -0
- package/dist/editor/sidebar/NavigationSidebar.js.map +1 -0
- package/dist/editor/sidebar/OperationItem.js +7 -21
- package/dist/editor/sidebar/OperationItem.js.map +1 -1
- package/dist/editor/sidebar/SidebarPanel.d.ts +1 -3
- package/dist/editor/sidebar/SidebarPanel.js +12 -44
- package/dist/editor/sidebar/SidebarPanel.js.map +1 -1
- package/dist/editor/sidebar/SidebarStack.d.ts +1 -2
- package/dist/editor/sidebar/SidebarStack.js +3 -4
- package/dist/editor/sidebar/SidebarStack.js.map +1 -1
- package/dist/editor/sidebar/Validation.js +12 -22
- package/dist/editor/sidebar/Validation.js.map +1 -1
- package/dist/editor/sidebar/Workbox.js +3 -53
- package/dist/editor/sidebar/Workbox.js.map +1 -1
- package/dist/editor/sidebar/WorkspaceRail.d.ts +1 -0
- package/dist/editor/sidebar/WorkspaceRail.js +167 -56
- package/dist/editor/sidebar/WorkspaceRail.js.map +1 -1
- package/dist/editor/tree-indicators/GutterColumns.d.ts +1 -3
- package/dist/editor/tree-indicators/GutterColumns.js +5 -26
- package/dist/editor/tree-indicators/GutterColumns.js.map +1 -1
- package/dist/editor/tree-indicators/GutterContext.d.ts +0 -4
- package/dist/editor/tree-indicators/GutterContext.js +0 -23
- package/dist/editor/tree-indicators/GutterContext.js.map +1 -1
- package/dist/editor/tree-indicators/GutterSelector.d.ts +5 -0
- package/dist/editor/tree-indicators/GutterSelector.js +91 -0
- package/dist/editor/tree-indicators/GutterSelector.js.map +1 -0
- package/dist/editor/tree-indicators/index.d.ts +1 -0
- package/dist/editor/tree-indicators/index.js +1 -0
- package/dist/editor/tree-indicators/index.js.map +1 -1
- package/dist/editor/tree-indicators/types.d.ts +1 -12
- 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 +0 -2
- package/dist/editor/ui/ItemNameDialogNew.js +17 -33
- package/dist/editor/ui/ItemNameDialogNew.js.map +1 -1
- package/dist/editor/ui/ItemSearch.js +11 -7
- 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 +0 -1
- package/dist/editor/ui/SimpleTabs.js +25 -45
- package/dist/editor/ui/SimpleTabs.js.map +1 -1
- package/dist/editor/ui/Splitter.d.ts +0 -1
- package/dist/editor/ui/Splitter.js +86 -102
- 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 +1 -6
- package/dist/editor/ui/TreeListSelector.js +2 -2
- package/dist/editor/ui/TreeListSelector.js.map +1 -1
- package/dist/editor/utils/keyboardNavigation.d.ts +20 -6
- package/dist/editor/utils/keyboardNavigation.js +140 -48
- package/dist/editor/utils/keyboardNavigation.js.map +1 -1
- package/dist/editor/utils.js +9 -19
- package/dist/editor/utils.js.map +1 -1
- package/dist/editor/views/CompareView.d.ts +1 -3
- package/dist/editor/views/CompareView.js +5 -7
- 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 +34 -27
- package/dist/editor/views/EditorSlot.js.map +1 -1
- package/dist/editor/views/ItemEditor.js +3 -7
- 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 +6 -5
- package/dist/editor/views/ParheliaView.js.map +1 -1
- package/dist/editor/views/SingleEditView.d.ts +1 -2
- package/dist/editor/views/SingleEditView.js +8 -10
- package/dist/editor/views/SingleEditView.js.map +1 -1
- package/dist/editor/views/editorSlotContext.js +6 -35
- package/dist/editor/views/editorSlotContext.js.map +1 -1
- package/dist/index.d.ts +2 -16
- package/dist/index.js +0 -11
- 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 +13 -40
- package/dist/setup/services/setupWizardService.js +17 -32
- package/dist/setup/services/setupWizardService.js.map +1 -1
- package/dist/setup/wizard/steps/AddModelDialog.js +3 -12
- package/dist/setup/wizard/steps/AddModelDialog.js.map +1 -1
- package/dist/setup/wizard/steps/ImportModelDialog.js +22 -39
- package/dist/setup/wizard/steps/ImportModelDialog.js.map +1 -1
- package/dist/splash-screen/ModernSplashScreen.js +32 -112
- package/dist/splash-screen/ModernSplashScreen.js.map +1 -1
- package/dist/splash-screen/NewPage.js +50 -33
- package/dist/splash-screen/NewPage.js.map +1 -1
- package/dist/splash-screen/OpenPage.js +6 -2
- package/dist/splash-screen/OpenPage.js.map +1 -1
- package/dist/splash-screen/ParheliaAssistantChat.js +29 -12
- package/dist/splash-screen/ParheliaAssistantChat.js.map +1 -1
- package/dist/splash-screen/ParheliaLogo.js +37 -87
- 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 +1 -2
- package/dist/tour/Tour.js +75 -256
- package/dist/tour/Tour.js.map +1 -1
- package/dist/tour/default-tour.js +96 -222
- package/dist/tour/default-tour.js.map +1 -1
- package/dist/types.d.ts +29 -63
- package/package.json +15 -19
- package/styles.css +10 -14
|
@@ -1,193 +1,62 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
-
import { useState, useEffect, useMemo
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useMemo } from "react";
|
|
3
3
|
import { Button } from "../../../components/ui/button";
|
|
4
|
-
import { Input } from "../../../components/ui/input";
|
|
5
|
-
import { Select } from "../../../components/ui/select";
|
|
6
|
-
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "../../../components/ui/dialog";
|
|
7
4
|
import { setupWizardService, } from "../../../setup/services/setupWizardService";
|
|
8
|
-
import { AlertCircle, RefreshCw, Upload, Plus, ArrowRight,
|
|
9
|
-
import { useSearchParams } from "../../client/navigation";
|
|
5
|
+
import { CheckCircle, AlertCircle, RefreshCw, Upload, Plus, ArrowRight, Settings, Cloud, Trash2, } from "lucide-react";
|
|
10
6
|
import { AddModelDialog } from "../../../setup/wizard/steps/AddModelDialog";
|
|
11
7
|
import { ImportModelDialog } from "../../../setup/wizard/steps/ImportModelDialog";
|
|
12
8
|
import { Splitter } from "../../ui/Splitter";
|
|
13
|
-
import {
|
|
9
|
+
import { ItemConfigPanel } from "./ItemConfigPanel";
|
|
14
10
|
import { useEditContext } from "../../client/editContext";
|
|
15
11
|
import { FilterInput } from "../../../components/FilterInput";
|
|
16
|
-
const SELECTED_MODEL_QUERY_PARAM = "modelId";
|
|
17
|
-
/**
|
|
18
|
-
* True when a numeric price is present (including 0). Used for display and
|
|
19
|
-
* "missing pricing" detection; provider import leaves fields empty instead of "0".
|
|
20
|
-
*/
|
|
21
|
-
const hasDefinedPricingValue = (value) => value !== undefined && value !== null;
|
|
22
|
-
const hasUsableImagePricing = (model) => hasDefinedPricingValue(model.pricing?.requestCost) ||
|
|
23
|
-
hasDefinedPricingValue(model.pricing?.imageCost) ||
|
|
24
|
-
hasDefinedPricingValue(model.pricing?.imageOutputCost) ||
|
|
25
|
-
hasDefinedPricingValue(model.pricing?.imageTokenCost) ||
|
|
26
|
-
hasDefinedPricingValue(model.pricing?.inputTextTokenCostPerMillion) ||
|
|
27
|
-
hasDefinedPricingValue(model.pricing?.inputImageTokenCostPerMillion) ||
|
|
28
|
-
hasDefinedPricingValue(model.pricing?.outputImageTokenCostPerMillion);
|
|
29
|
-
/**
|
|
30
|
-
* True when the model row has nothing to show on the pricing line (no usable
|
|
31
|
-
* token/image figures). This is the same condition used to decide whether to
|
|
32
|
-
* show the warning — avoids blank rows when field-level "missing" logic drifts.
|
|
33
|
-
*/
|
|
34
|
-
const isPricingLineEmpty = (model) => !hasVisiblePricingSummary(model);
|
|
35
|
-
const getPricingWarningMessage = (model) => {
|
|
36
|
-
const template = model.templateType || "Ai Chat Model";
|
|
37
|
-
if (template === "Ai Image Model") {
|
|
38
|
-
return "Pricing information is missing. Configure at least one image pricing field.";
|
|
39
|
-
}
|
|
40
|
-
if (template === "Ai Embeddings Model") {
|
|
41
|
-
return "Pricing information is missing. Set Input Cost Per Million Tokens.";
|
|
42
|
-
}
|
|
43
|
-
const missingFields = [];
|
|
44
|
-
if (!hasDefinedPricingValue(model.pricing?.inputCostPerMillionTokens)) {
|
|
45
|
-
missingFields.push("Input Cost Per Million Tokens");
|
|
46
|
-
}
|
|
47
|
-
if (!hasDefinedPricingValue(model.pricing?.outputCostPerMillionTokens)) {
|
|
48
|
-
missingFields.push("Output Cost Per Million Tokens");
|
|
49
|
-
}
|
|
50
|
-
if (missingFields.length === 0) {
|
|
51
|
-
return "Pricing information is missing.";
|
|
52
|
-
}
|
|
53
|
-
return `Pricing information is missing. Set ${missingFields.join(" and ")}.`;
|
|
54
|
-
};
|
|
55
|
-
const hasVisiblePricingSummary = (model) => {
|
|
56
|
-
if (!model.pricing) {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
if (model.templateType === "Ai Image Model") {
|
|
60
|
-
return hasUsableImagePricing(model);
|
|
61
|
-
}
|
|
62
|
-
return (hasDefinedPricingValue(model.pricing.inputCostPerMillionTokens) ||
|
|
63
|
-
hasDefinedPricingValue(model.pricing.outputCostPerMillionTokens) ||
|
|
64
|
-
hasDefinedPricingValue(model.pricing.cachedInputCostPerMillionTokens));
|
|
65
|
-
};
|
|
66
|
-
/** Sitecore item name for lists and dialogs; falls back to API model id / key. */
|
|
67
|
-
function getModelListLabel(model) {
|
|
68
|
-
return model.itemName?.trim() || model.name || model.key || "";
|
|
69
|
-
}
|
|
70
|
-
function normalizeModelId(id) {
|
|
71
|
-
return (id || "").replace(/[{}]/g, "").toLowerCase();
|
|
72
|
-
}
|
|
73
|
-
function getModelTypeLabel(templateType) {
|
|
74
|
-
switch (templateType) {
|
|
75
|
-
case "Ai Chat Model":
|
|
76
|
-
return "Chat";
|
|
77
|
-
case "Ai Embeddings Model":
|
|
78
|
-
return "Embeddings";
|
|
79
|
-
case "Ai Image Model":
|
|
80
|
-
return "Image";
|
|
81
|
-
default:
|
|
82
|
-
return templateType;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
12
|
/**
|
|
86
13
|
* Settings panel for AI Models configuration.
|
|
87
14
|
* Install and configure AI models for chat and other tasks.
|
|
88
15
|
*/
|
|
89
16
|
export function ModelsPanel() {
|
|
90
17
|
const editContext = useEditContext();
|
|
91
|
-
const searchParams = useSearchParams();
|
|
92
18
|
const [state, setState] = useState("loading");
|
|
93
19
|
const [installedModels, setInstalledModels] = useState([]);
|
|
94
20
|
const [providers, setProviders] = useState([]);
|
|
95
|
-
const [settingsExists, setSettingsExists] = useState(false);
|
|
96
|
-
const [defaultChatModelId, setDefaultChatModelId] = useState("");
|
|
97
|
-
const [defaultImageModelId, setDefaultImageModelId] = useState("");
|
|
98
|
-
const [savingDefaults, setSavingDefaults] = useState(false);
|
|
99
21
|
const [error, setError] = useState(null);
|
|
100
22
|
const [updating, setUpdating] = useState(null);
|
|
101
23
|
// Dialog states
|
|
102
24
|
const [showAddDialog, setShowAddDialog] = useState(false);
|
|
103
25
|
const [showImportDialog, setShowImportDialog] = useState(false);
|
|
104
|
-
//
|
|
105
|
-
const [urlSelectedModelId, setUrlSelectedModelId] = useState(searchParams.get(SELECTED_MODEL_QUERY_PARAM) ||
|
|
106
|
-
(typeof window !== "undefined"
|
|
107
|
-
? new URLSearchParams(window.location.search).get(SELECTED_MODEL_QUERY_PARAM)
|
|
108
|
-
: null));
|
|
26
|
+
// Sidebar editor state
|
|
109
27
|
const [selectedModel, setSelectedModel] = useState(null);
|
|
110
28
|
// Bulk pricing update state
|
|
111
29
|
const [updatingAllPricing, setUpdatingAllPricing] = useState(false);
|
|
30
|
+
const [updatingModelPricing, setUpdatingModelPricing] = useState(null);
|
|
112
31
|
// Delete state
|
|
113
32
|
const [deleting, setDeleting] = useState(null);
|
|
114
|
-
// Duplicate state
|
|
115
|
-
const [duplicatingId, setDuplicatingId] = useState(null);
|
|
116
|
-
const [duplicateDialogModel, setDuplicateDialogModel] = useState(null);
|
|
117
|
-
const [duplicateItemName, setDuplicateItemName] = useState("");
|
|
118
33
|
// Provider types (discovered from backend)
|
|
119
34
|
const [providerTypes, setProviderTypes] = useState([]);
|
|
120
35
|
// Filter state
|
|
121
36
|
const [filterText, setFilterText] = useState("");
|
|
122
|
-
useEffect(() => {
|
|
123
|
-
const key = searchParams.get(SELECTED_MODEL_QUERY_PARAM) ||
|
|
124
|
-
(typeof window !== "undefined"
|
|
125
|
-
? new URLSearchParams(window.location.search).get(SELECTED_MODEL_QUERY_PARAM)
|
|
126
|
-
: null);
|
|
127
|
-
setUrlSelectedModelId(key);
|
|
128
|
-
}, [searchParams]);
|
|
129
|
-
useEffect(() => {
|
|
130
|
-
if (typeof window === "undefined")
|
|
131
|
-
return;
|
|
132
|
-
const handlePopState = () => {
|
|
133
|
-
setUrlSelectedModelId(new URLSearchParams(window.location.search).get(SELECTED_MODEL_QUERY_PARAM));
|
|
134
|
-
};
|
|
135
|
-
window.addEventListener("popstate", handlePopState);
|
|
136
|
-
return () => window.removeEventListener("popstate", handlePopState);
|
|
137
|
-
}, []);
|
|
138
|
-
useEffect(() => {
|
|
139
|
-
if (!urlSelectedModelId) {
|
|
140
|
-
if (selectedModel)
|
|
141
|
-
setSelectedModel(null);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
const match = installedModels.find((m) => m.id === urlSelectedModelId);
|
|
145
|
-
if (match && match !== selectedModel) {
|
|
146
|
-
setSelectedModel(match);
|
|
147
|
-
}
|
|
148
|
-
}, [installedModels, urlSelectedModelId, selectedModel]);
|
|
149
|
-
const updateSelectedModelUrl = useCallback((modelId) => {
|
|
150
|
-
editContext?.updateUrl({
|
|
151
|
-
[SELECTED_MODEL_QUERY_PARAM]: modelId || undefined,
|
|
152
|
-
});
|
|
153
|
-
setUrlSelectedModelId(modelId || null);
|
|
154
|
-
}, [editContext]);
|
|
155
37
|
const handleOpenConfig = (model) => {
|
|
156
38
|
setSelectedModel(model);
|
|
157
|
-
updateSelectedModelUrl(model.id);
|
|
158
39
|
};
|
|
159
40
|
const handleCloseConfig = () => {
|
|
160
41
|
setSelectedModel(null);
|
|
161
|
-
updateSelectedModelUrl(null);
|
|
162
42
|
};
|
|
163
43
|
const loadData = async () => {
|
|
164
44
|
try {
|
|
165
45
|
setState("loading");
|
|
166
46
|
setError(null);
|
|
167
|
-
const [installed, providersData, providerTypesData
|
|
47
|
+
const [installed, providersData, providerTypesData] = await Promise.all([
|
|
168
48
|
setupWizardService.getInstalledModels(),
|
|
169
49
|
setupWizardService.getProviders(),
|
|
170
50
|
setupWizardService.getProviderTypes(),
|
|
171
|
-
setupWizardService.getDefaultModels(),
|
|
172
|
-
setupWizardService.getSettingsExists(),
|
|
173
51
|
]);
|
|
174
52
|
setInstalledModels(installed);
|
|
175
53
|
setProviders(providersData);
|
|
176
54
|
setProviderTypes(providerTypesData);
|
|
177
|
-
setSettingsExists(hasSettings);
|
|
178
|
-
const resolvedChatModel = installed.find((model) => normalizeModelId(model.id) ===
|
|
179
|
-
normalizeModelId(defaultModels.chatModelId));
|
|
180
|
-
const resolvedImageModel = installed.find((model) => normalizeModelId(model.id) ===
|
|
181
|
-
normalizeModelId(defaultModels.imageModelId));
|
|
182
|
-
setDefaultChatModelId(resolvedChatModel?.id || defaultModels.chatModelId || "");
|
|
183
|
-
setDefaultImageModelId(resolvedImageModel?.id || defaultModels.imageModelId || "");
|
|
184
55
|
setState("success");
|
|
185
|
-
return installed;
|
|
186
56
|
}
|
|
187
57
|
catch (e) {
|
|
188
58
|
setState("error");
|
|
189
59
|
setError(e?.message || "Failed to load models");
|
|
190
|
-
return undefined;
|
|
191
60
|
}
|
|
192
61
|
};
|
|
193
62
|
// Get providers that support model import (any provider with a registered provider type)
|
|
@@ -251,131 +120,88 @@ export function ModelsPanel() {
|
|
|
251
120
|
setUpdatingAllPricing(false);
|
|
252
121
|
}
|
|
253
122
|
};
|
|
254
|
-
|
|
255
|
-
|
|
123
|
+
// Update pricing for a single model
|
|
124
|
+
const handleUpdateSingleModelPricing = async (model) => {
|
|
125
|
+
if (!model.providerId || !model.name) {
|
|
126
|
+
setError("Model provider or name is missing");
|
|
256
127
|
return;
|
|
128
|
+
}
|
|
257
129
|
try {
|
|
258
|
-
|
|
130
|
+
setUpdatingModelPricing(model.id);
|
|
259
131
|
setError(null);
|
|
260
|
-
await setupWizardService.
|
|
261
|
-
|
|
262
|
-
|
|
132
|
+
const result = await setupWizardService.upsertProviderModels({
|
|
133
|
+
providerId: model.providerId,
|
|
134
|
+
selectedModelIds: [model.name],
|
|
135
|
+
mode: "updatePricing",
|
|
263
136
|
});
|
|
264
137
|
await loadData();
|
|
138
|
+
if (result.errors.length > 0) {
|
|
139
|
+
setError(`Errors: ${result.errors.join(", ")}`);
|
|
140
|
+
}
|
|
265
141
|
}
|
|
266
142
|
catch (e) {
|
|
267
|
-
setError(e?.message || "Failed to update
|
|
143
|
+
setError(e?.message || "Failed to update pricing");
|
|
268
144
|
}
|
|
269
145
|
finally {
|
|
270
|
-
|
|
146
|
+
setUpdatingModelPricing(null);
|
|
271
147
|
}
|
|
272
148
|
};
|
|
273
|
-
const
|
|
274
|
-
if (!
|
|
275
|
-
setError("Parhelia settings item not found");
|
|
149
|
+
const handleUpdate = async (model) => {
|
|
150
|
+
if (!model.id || !model.key)
|
|
276
151
|
return;
|
|
277
|
-
}
|
|
278
|
-
const previousChatModelId = defaultChatModelId;
|
|
279
|
-
const previousImageModelId = defaultImageModelId;
|
|
280
|
-
setDefaultChatModelId(nextChatModelId);
|
|
281
|
-
setDefaultImageModelId(nextImageModelId);
|
|
282
152
|
try {
|
|
283
|
-
|
|
153
|
+
setUpdating(model.id);
|
|
284
154
|
setError(null);
|
|
285
|
-
await setupWizardService.
|
|
286
|
-
|
|
287
|
-
|
|
155
|
+
await setupWizardService.updateModel({
|
|
156
|
+
modelId: model.id,
|
|
157
|
+
sourceModelKey: model.key,
|
|
288
158
|
});
|
|
159
|
+
await loadData();
|
|
289
160
|
}
|
|
290
161
|
catch (e) {
|
|
291
|
-
|
|
292
|
-
setDefaultImageModelId(previousImageModelId);
|
|
293
|
-
setError(e?.message || "Failed to save default models");
|
|
162
|
+
setError(e?.message || "Failed to update model");
|
|
294
163
|
}
|
|
295
164
|
finally {
|
|
296
|
-
|
|
165
|
+
setUpdating(null);
|
|
297
166
|
}
|
|
298
167
|
};
|
|
299
|
-
const handleDelete =
|
|
168
|
+
const handleDelete = (model) => {
|
|
300
169
|
if (!editContext || !model.id)
|
|
301
170
|
return;
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
171
|
+
editContext.confirm({
|
|
172
|
+
header: "Delete Model",
|
|
173
|
+
message: `Are you sure you want to delete "${model.name || model.key}"?`,
|
|
174
|
+
acceptLabel: "Delete",
|
|
175
|
+
showCancel: true,
|
|
176
|
+
accept: async () => {
|
|
177
|
+
try {
|
|
178
|
+
setDeleting(model.id);
|
|
179
|
+
setError(null);
|
|
180
|
+
// If this model is currently selected, close the config panel
|
|
181
|
+
if (selectedModel?.id === model.id) {
|
|
182
|
+
setSelectedModel(null);
|
|
183
|
+
}
|
|
184
|
+
// Delete the model item
|
|
185
|
+
await editContext.operations.deleteItems([
|
|
186
|
+
{
|
|
187
|
+
id: model.id,
|
|
188
|
+
language: editContext.item?.language ??
|
|
189
|
+
editContext.currentItemDescriptor?.language ??
|
|
190
|
+
"en",
|
|
191
|
+
version: 0,
|
|
192
|
+
},
|
|
193
|
+
]);
|
|
194
|
+
// Reload the models list
|
|
195
|
+
await loadData();
|
|
318
196
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}
|
|
322
|
-
catch (e) {
|
|
323
|
-
setError(e?.message || "Failed to delete model");
|
|
324
|
-
}
|
|
325
|
-
finally {
|
|
326
|
-
setDeleting(null);
|
|
327
|
-
}
|
|
328
|
-
};
|
|
329
|
-
const openDuplicateDialog = (model) => {
|
|
330
|
-
const segment = model.itemName?.trim() ||
|
|
331
|
-
(model.key.includes("/") && model.key.split("/").length > 0
|
|
332
|
-
? model.key.split("/").pop()
|
|
333
|
-
: model.name || model.key);
|
|
334
|
-
setDuplicateItemName(`Copy of ${segment}`);
|
|
335
|
-
setDuplicateDialogModel(model);
|
|
336
|
-
};
|
|
337
|
-
const handleConfirmDuplicate = async () => {
|
|
338
|
-
if (!editContext || !duplicateDialogModel?.id) {
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
const parentId = duplicateDialogModel.parentId;
|
|
342
|
-
if (!parentId) {
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
const name = duplicateItemName.trim();
|
|
346
|
-
if (!name) {
|
|
347
|
-
setError("Enter a name for the duplicate item");
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
const model = duplicateDialogModel;
|
|
351
|
-
const lang = editContext.item?.language ??
|
|
352
|
-
editContext.currentItemDescriptor?.language ??
|
|
353
|
-
"en";
|
|
354
|
-
try {
|
|
355
|
-
setDuplicatingId(model.id);
|
|
356
|
-
setError(null);
|
|
357
|
-
const created = await editContext.operations.duplicateItem({ id: model.id, language: lang, version: 0 }, { id: parentId, language: lang, version: 0 }, name);
|
|
358
|
-
if (!created) {
|
|
359
|
-
setDuplicatingId(null);
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
setDuplicateDialogModel(null);
|
|
363
|
-
const list = await loadData();
|
|
364
|
-
if (list) {
|
|
365
|
-
const createdId = String(created.id).replace(/[{}]/g, "").toLowerCase();
|
|
366
|
-
const next = list.find((m) => m.id.replace(/[{}]/g, "").toLowerCase() === createdId);
|
|
367
|
-
if (next) {
|
|
368
|
-
setSelectedModel(next);
|
|
369
|
-
updateSelectedModelUrl(next.id);
|
|
197
|
+
catch (e) {
|
|
198
|
+
setError(e?.message || "Failed to delete model");
|
|
370
199
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
finally {
|
|
377
|
-
setDuplicatingId(null);
|
|
378
|
-
}
|
|
200
|
+
finally {
|
|
201
|
+
setDeleting(null);
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
});
|
|
379
205
|
};
|
|
380
206
|
useEffect(() => {
|
|
381
207
|
loadData();
|
|
@@ -385,50 +211,25 @@ export function ModelsPanel() {
|
|
|
385
211
|
window.location.hash = "#providers";
|
|
386
212
|
}
|
|
387
213
|
};
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
.
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
if (defaultChatModelId && !chatDefaultConfiguredModel) {
|
|
406
|
-
options.push({
|
|
407
|
-
value: defaultChatModelId,
|
|
408
|
-
label: "Configured model not found",
|
|
409
|
-
description: defaultChatModelId,
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
return options;
|
|
413
|
-
}, [chatModels, defaultChatModelId, chatDefaultConfiguredModel]);
|
|
414
|
-
const imageModelOptions = useMemo(() => {
|
|
415
|
-
const options = [
|
|
416
|
-
{ value: "", label: "Not set" },
|
|
417
|
-
...imageModels.map((model) => ({
|
|
418
|
-
value: model.id,
|
|
419
|
-
label: getModelListLabel(model),
|
|
420
|
-
description: model.providerName || undefined,
|
|
421
|
-
})),
|
|
422
|
-
];
|
|
423
|
-
if (defaultImageModelId && !imageDefaultConfiguredModel) {
|
|
424
|
-
options.push({
|
|
425
|
-
value: defaultImageModelId,
|
|
426
|
-
label: "Configured model not found",
|
|
427
|
-
description: defaultImageModelId,
|
|
428
|
-
});
|
|
214
|
+
// Check if model uses an importable provider (OpenRouter or Novita)
|
|
215
|
+
const isImportableModel = (model) => {
|
|
216
|
+
if (!model.providerId)
|
|
217
|
+
return false;
|
|
218
|
+
return importableProviders.some((p) => p.id === model.providerId);
|
|
219
|
+
};
|
|
220
|
+
// Helper to get model type display label
|
|
221
|
+
const getModelTypeLabel = (templateType) => {
|
|
222
|
+
switch (templateType) {
|
|
223
|
+
case "Ai Chat Model":
|
|
224
|
+
return "Chat";
|
|
225
|
+
case "Ai Embeddings Model":
|
|
226
|
+
return "Embeddings";
|
|
227
|
+
case "Ai Image Model":
|
|
228
|
+
return "Image";
|
|
229
|
+
default:
|
|
230
|
+
return templateType;
|
|
429
231
|
}
|
|
430
|
-
|
|
431
|
-
}, [imageModels, defaultImageModelId, imageDefaultConfiguredModel]);
|
|
232
|
+
};
|
|
432
233
|
// Filter models based on filter text
|
|
433
234
|
const filteredModels = useMemo(() => {
|
|
434
235
|
if (!filterText.trim()) {
|
|
@@ -436,20 +237,18 @@ export function ModelsPanel() {
|
|
|
436
237
|
}
|
|
437
238
|
const searchTerm = filterText.toLowerCase().trim();
|
|
438
239
|
return installedModels.filter((model) => {
|
|
439
|
-
const listLabel = getModelListLabel(model).toLowerCase();
|
|
440
240
|
const modelName = (model.name || model.key || "").toLowerCase();
|
|
441
241
|
const providerName = (model.providerName || "").toLowerCase();
|
|
442
242
|
const templateType = (model.templateType || "").toLowerCase();
|
|
443
243
|
const modelTypeLabel = getModelTypeLabel(model.templateType || "Ai Chat Model").toLowerCase();
|
|
444
|
-
return (
|
|
445
|
-
modelName.includes(searchTerm) ||
|
|
244
|
+
return (modelName.includes(searchTerm) ||
|
|
446
245
|
providerName.includes(searchTerm) ||
|
|
447
246
|
templateType.includes(searchTerm) ||
|
|
448
247
|
modelTypeLabel.includes(searchTerm));
|
|
449
248
|
});
|
|
450
|
-
}, [installedModels, filterText]);
|
|
249
|
+
}, [installedModels, filterText, getModelTypeLabel]);
|
|
451
250
|
// Group models by provider for display
|
|
452
|
-
const groupModelsByProvider =
|
|
251
|
+
const groupModelsByProvider = (models) => {
|
|
453
252
|
const groups = {};
|
|
454
253
|
models.forEach((model) => {
|
|
455
254
|
const providerId = model.providerId || "unknown";
|
|
@@ -466,60 +265,42 @@ export function ModelsPanel() {
|
|
|
466
265
|
const typeOrder = (a.templateType || "").localeCompare(b.templateType || "");
|
|
467
266
|
if (typeOrder !== 0)
|
|
468
267
|
return typeOrder;
|
|
469
|
-
return
|
|
268
|
+
return (a.name || a.key || "").localeCompare(b.name || b.key || "");
|
|
470
269
|
});
|
|
471
270
|
});
|
|
472
271
|
return groups;
|
|
473
|
-
}
|
|
474
|
-
const modelsByProvider = useMemo(() => groupModelsByProvider(filteredModels), [filteredModels,
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
|
|
272
|
+
};
|
|
273
|
+
const modelsByProvider = useMemo(() => groupModelsByProvider(filteredModels), [filteredModels, providers]);
|
|
274
|
+
const statusIcon = (currentState) => {
|
|
275
|
+
if (currentState === "success")
|
|
276
|
+
return _jsx(CheckCircle, { className: "h-4 w-4 text-green-600", strokeWidth: 1 });
|
|
277
|
+
if (currentState === "error")
|
|
278
|
+
return _jsx(AlertCircle, { className: "h-4 w-4 text-red-600", strokeWidth: 1 });
|
|
279
|
+
return (_jsx(RefreshCw, { className: "h-4 w-4 animate-spin text-amber-600", strokeWidth: 1 }));
|
|
280
|
+
};
|
|
478
281
|
// Build the models list content
|
|
479
|
-
const modelsListContent = (_jsx("div", { className: "flex h-full flex-col p-4", children: _jsx("div", { className: "mx-auto flex w-full flex-1 flex-col overflow-hidden", children: _jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [_jsxs("div", { className: "
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
setError(null);
|
|
487
|
-
}, children: [_jsx(Plus, { strokeWidth: 1, className: "mr-1 h-4 w-4" }), "Add Manually"] })] })), error && (_jsx("div", { className: "rounded border border-red-200 bg-red-50 p-2 text-xs whitespace-pre-wrap text-red-700", children: error })), _jsx(FilterInput, { value: filterText, onChange: setFilterText, placeholder: "Filter models by name, provider, or type...", className: "mb-4 w-full" })] })] }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto rounded-b-lg bg-white px-4 pb-4", children: filterText && filteredModels.length === 0 ? (_jsxs("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: ["No models found matching ", `"${filterText}"`] })) : (_jsx("div", { className: "space-y-4", children: Object.entries(modelsByProvider).map(([providerId, { providerName, models }]) => {
|
|
282
|
+
const modelsListContent = (_jsx("div", { className: "flex h-full flex-col p-4", children: _jsx("div", { className: "mx-auto flex w-full flex-1 flex-col overflow-hidden", children: _jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [_jsxs("div", { className: "shrink-0 space-y-4 pb-4", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [statusIcon(state), _jsxs("span", { className: "text-sm text-gray-700", children: [installedModels.length, " model", installedModels.length !== 1 ? "s" : "", " installed"] })] }), importableInstalledModels.length > 0 && (_jsxs(Button, { size: "sm", variant: "outline", onClick: handleUpdateAllPricing, disabled: updatingAllPricing, title: "Update pricing for all models from their provider APIs", children: [updatingAllPricing ? (_jsx(RefreshCw, { className: "mr-1 h-4 w-4 animate-spin" })) : (_jsx(RefreshCw, { className: "mr-1 h-4 w-4" })), "Update All Pricing"] }))] }), state !== "loading" && providers.length === 0 && (_jsx("div", { className: "rounded border border-yellow-200 bg-yellow-50 p-4", children: _jsxs("div", { className: "flex items-start gap-3", children: [_jsx(AlertCircle, { className: "mt-0.5 h-5 w-5 shrink-0 text-yellow-600" }), _jsxs("div", { className: "flex-1", children: [_jsx("p", { className: "mb-1 text-sm font-medium text-yellow-800", children: "No providers configured" }), _jsx("p", { className: "mb-3 text-xs text-yellow-700", children: "You need to configure at least one provider before you can add models." }), _jsxs(Button, { size: "sm", variant: "outline", onClick: handleNavigateToProviders, className: "text-xs", children: ["Go to Providers", _jsx(ArrowRight, { className: "ml-1 h-3 w-3" })] })] })] }) })), providers.length > 0 && (_jsxs("div", { className: "flex gap-2", children: [importableProviders.length > 0 && (_jsxs(Button, { size: "sm", variant: "outline", onClick: () => {
|
|
283
|
+
setShowImportDialog(true);
|
|
284
|
+
setError(null);
|
|
285
|
+
}, children: [_jsx(Cloud, { strokeWidth: 1, className: "mr-1 h-4 w-4" }), "Import from Provider"] })), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => {
|
|
286
|
+
setShowAddDialog(true);
|
|
287
|
+
setError(null);
|
|
288
|
+
}, children: [_jsx(Plus, { strokeWidth: 1, className: "mr-1 h-4 w-4" }), "Add Manually"] })] })), error && (_jsx("div", { className: "rounded border border-red-200 bg-red-50 p-2 text-xs whitespace-pre-wrap text-red-700", children: error })), _jsx(FilterInput, { value: filterText, onChange: setFilterText, placeholder: "Filter models by name, provider, or type...", className: "w-full" })] }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: filterText && filteredModels.length === 0 ? (_jsxs("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: ["No models found matching \"", filterText, "\""] })) : (_jsx("div", { className: "space-y-4", children: Object.entries(modelsByProvider).map(([providerId, { providerName, models }]) => {
|
|
488
289
|
if (models.length === 0)
|
|
489
290
|
return null;
|
|
490
291
|
return (_jsxs("div", { className: "space-y-2", children: [_jsxs("label", { className: "block text-sm font-medium text-gray-700", children: [providerName, _jsxs("span", { className: "ml-2 text-xs font-normal text-gray-500", children: ["(", models.length, " model", models.length !== 1 ? "s" : "", ")"] })] }), _jsx("div", { className: "space-y-2", children: models.map((model) => {
|
|
491
292
|
const status = model.status;
|
|
492
293
|
const isSelected = selectedModel?.id === model.id;
|
|
493
|
-
const showPricingLine = hasVisiblePricingSummary(model);
|
|
494
294
|
return (_jsxs("div", { className: `flex flex-wrap items-center gap-2 rounded border p-3 text-sm transition-shadow hover:shadow-sm ${isSelected
|
|
495
295
|
? "border-blue-400 bg-blue-50"
|
|
496
|
-
: "border-gray-200 bg-white"}`, children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "truncate font-medium", children:
|
|
497
|
-
|
|
498
|
-
normalizeModelId(defaultImageModelId) && (_jsx("span", { className: "shrink-0 rounded bg-green-100 px-1.5 py-0.5 text-xs text-green-700", children: "Default image" })), status === "Outdated" && (_jsx("span", { className: "shrink-0 rounded bg-amber-100 px-1.5 py-0.5 text-xs text-amber-700", children: "Update available" })), !showPricingLine && (_jsx("span", { className: "shrink-0 rounded bg-yellow-100 px-1.5 py-0.5 text-xs text-yellow-800", children: "Pricing missing" }))] }), showPricingLine && model.pricing ? (_jsx("div", { className: "mt-1 text-xs text-gray-500", children: model.templateType ===
|
|
499
|
-
"Ai Image Model" &&
|
|
500
|
-
hasUsableImagePricing(model) ? (_jsxs(_Fragment, { children: [hasDefinedPricingValue(model.pricing.inputTextTokenCostPerMillion) && (_jsxs("span", { children: ["Input Text: $", model.pricing.inputTextTokenCostPerMillion.toFixed(2), "/M"] })), hasDefinedPricingValue(model.pricing.inputImageTokenCostPerMillion) && (_jsxs("span", { className: "ml-2", children: ["Input Image: $", model.pricing.inputImageTokenCostPerMillion.toFixed(2), "/M"] })), hasDefinedPricingValue(model.pricing.outputImageTokenCostPerMillion) && (_jsxs("span", { className: "ml-2", children: ["Output Image: $", model.pricing.outputImageTokenCostPerMillion.toFixed(2), "/M"] })), hasDefinedPricingValue(model.pricing.imageTokenCost) &&
|
|
501
|
-
!hasDefinedPricingValue(model.pricing.outputImageTokenCostPerMillion) && (_jsxs("span", { className: "ml-2", children: ["Image Tokens: $", model.pricing.imageTokenCost.toFixed(2), "/M"] }))] })) : (_jsxs(_Fragment, { children: [hasDefinedPricingValue(model.pricing
|
|
502
|
-
.inputCostPerMillionTokens) && (_jsxs("span", { children: ["Input: $", model.pricing.inputCostPerMillionTokens.toFixed(2), "/M"] })), hasDefinedPricingValue(model.pricing
|
|
503
|
-
.outputCostPerMillionTokens) && (_jsxs("span", { className: "ml-2", children: ["Output: $", model.pricing.outputCostPerMillionTokens.toFixed(2), "/M"] })), hasDefinedPricingValue(model.pricing
|
|
504
|
-
.cachedInputCostPerMillionTokens) && (_jsxs("span", { className: "ml-2", children: ["Cached: $", model.pricing.cachedInputCostPerMillionTokens.toFixed(2), "/M"] }))] })) })) : (_jsxs("div", { className: "mt-1 flex items-start gap-2 rounded border border-yellow-200 bg-yellow-50 px-2 py-1.5 text-xs text-yellow-800", children: [_jsx(AlertCircle, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }), _jsx("span", { children: getPricingWarningMessage(model) })] })), (model.maxContextWindowTokens ||
|
|
296
|
+
: "border-gray-200 bg-white"}`, children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "truncate font-medium", children: model.name || model.key }), _jsx("span", { className: "shrink-0 rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-600", children: getModelTypeLabel(model.templateType || "Ai Chat Model") }), status === "Outdated" && (_jsx("span", { className: "shrink-0 rounded bg-amber-100 px-1.5 py-0.5 text-xs text-amber-700", children: "Update available" }))] }), model.pricing && (_jsxs("div", { className: "mt-1 text-xs text-gray-500", children: ["Input: $", model.pricing.inputCostPerMillionTokens?.toFixed(2) || "0.00", "/M, Output: $", model.pricing.outputCostPerMillionTokens?.toFixed(2) || "0.00", "/M", model.pricing
|
|
297
|
+
.cachedInputCostPerMillionTokens && (_jsxs("span", { className: "ml-2", children: ["Cached: $", model.pricing.cachedInputCostPerMillionTokens.toFixed(2), "/M"] }))] })), (model.maxContextWindowTokens ||
|
|
505
298
|
model.maxResponseTokens) && (_jsxs("div", { className: "mt-1 text-xs text-gray-500", children: [model.maxContextWindowTokens && (_jsxs("span", { children: ["Context:", " ", model.maxContextWindowTokens.toLocaleString(), " ", "tokens"] })), model.maxContextWindowTokens &&
|
|
506
299
|
model.maxResponseTokens &&
|
|
507
|
-
" • ", model.maxResponseTokens && (_jsxs("span", { children: ["Max Response:", " ", model.maxResponseTokens.toLocaleString(), " ", "tokens"] }))] }))] }), _jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [status === "Outdated" && (_jsxs(Button, { size: "sm", variant: "outline", onClick: () => handleUpdate(model), disabled: updating === model.id, title: "Update model", children: [updating === model.id ? (_jsx(RefreshCw, { strokeWidth: 1, className: "h-3 w-3 animate-spin" })) : (_jsx(Upload, { strokeWidth: 1, className: "h-3 w-3" })), _jsx("span", { className: "ml-1 hidden sm:inline", children: "Update" })] })),
|
|
508
|
-
|
|
509
|
-
duplicatingId === model.id, title: "Duplicate model", children: [duplicatingId === model.id ? (_jsx(RefreshCw, { strokeWidth: 1, className: "h-3 w-3 animate-spin" })) : (_jsx(Copy, { strokeWidth: 1, className: "h-3 w-3" })), _jsx("span", { className: "ml-1 hidden sm:inline", children: "Duplicate" })] }), _jsx(Button, { size: "sm", variant: "ghost", onClick: () => handleDelete(model), disabled: deleting === model.id, title: "Delete model", className: "text-red-600 hover:bg-red-50 hover:text-red-700", children: deleting === model.id ? (_jsx(RefreshCw, { strokeWidth: 1, className: "h-3 w-3 animate-spin" })) : (_jsx(Trash2, { strokeWidth: 1, className: "h-3 w-3" })) })] })] }, model.id));
|
|
300
|
+
" • ", model.maxResponseTokens && (_jsxs("span", { children: ["Max Response:", " ", model.maxResponseTokens.toLocaleString(), " ", "tokens"] }))] }))] }), _jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [status === "Outdated" && (_jsxs(Button, { size: "sm", variant: "outline", onClick: () => handleUpdate(model), disabled: updating === model.id, title: "Update model", children: [updating === model.id ? (_jsx(RefreshCw, { strokeWidth: 1, className: "h-3 w-3 animate-spin" })) : (_jsx(Upload, { strokeWidth: 1, className: "h-3 w-3" })), _jsx("span", { className: "ml-1 hidden sm:inline", children: "Update" })] })), isImportableModel(model) && (_jsx(Button, { size: "sm", variant: "ghost", onClick: () => handleUpdateSingleModelPricing(model), disabled: updatingModelPricing === model.id ||
|
|
301
|
+
updatingAllPricing, title: "Update pricing from provider API", children: updatingModelPricing === model.id ? (_jsx(RefreshCw, { strokeWidth: 1, className: "h-3 w-3 animate-spin" })) : (_jsx(RefreshCw, { strokeWidth: 1, className: "h-3 w-3" })) })), _jsxs(Button, { size: "sm", variant: isSelected ? "default" : "ghost", onClick: () => handleOpenConfig(model), title: "Configure model", children: [_jsx(Settings, { className: "h-4 w-4", strokeWidth: 1.5 }), _jsx("span", { className: "ml-1 hidden sm:inline", children: "Configure" })] }), _jsx(Button, { size: "sm", variant: "ghost", onClick: () => handleDelete(model), disabled: deleting === model.id, title: "Delete model", className: "text-red-600 hover:bg-red-50 hover:text-red-700", children: deleting === model.id ? (_jsx(RefreshCw, { strokeWidth: 1, className: "h-3 w-3 animate-spin" })) : (_jsx(Trash2, { strokeWidth: 1, className: "h-3 w-3" })) })] })] }, model.id));
|
|
510
302
|
}) })] }, providerId));
|
|
511
|
-
}) })) }), _jsx(AddModelDialog, { open: showAddDialog, onOpenChange: setShowAddDialog, onSuccess: loadData, providers: providers, installedModels: installedModels }), _jsx(ImportModelDialog, { open: showImportDialog, onOpenChange: setShowImportDialog, onSuccess: loadData, importableProviders: importableProviders, providerTypes: providerTypes })
|
|
512
|
-
if (!open)
|
|
513
|
-
setDuplicateDialogModel(null);
|
|
514
|
-
}, children: _jsxs(DialogContent, { className: "max-w-md", children: [_jsxs(DialogHeader, { className: "pr-14", children: [_jsx(DialogTitle, { children: "Duplicate model" }), _jsx(DialogDescription, { children: "New Sitecore item name. Field values (including model name and reasoning) are copied; adjust them in Configure after duplicating." })] }), _jsxs("div", { className: "space-y-2 px-8 pb-6", children: [_jsx("label", { htmlFor: "duplicate-model-item-name", className: "block text-sm font-medium text-gray-700", children: "Item name" }), _jsx(Input, { id: "duplicate-model-item-name", value: duplicateItemName, onChange: (e) => setDuplicateItemName(e.target.value), onKeyDown: (e) => {
|
|
515
|
-
if (e.key === "Enter") {
|
|
516
|
-
e.preventDefault();
|
|
517
|
-
void handleConfirmDuplicate();
|
|
518
|
-
}
|
|
519
|
-
}, autoFocus: true })] }), _jsxs(DialogFooter, { className: "border-t border-gray-100 pt-4", children: [_jsx(Button, { type: "button", variant: "outline", className: "min-h-9 min-w-22", onClick: () => setDuplicateDialogModel(null), children: "Cancel" }), _jsx(Button, { type: "button", className: "min-h-9 min-w-22", onClick: () => void handleConfirmDuplicate(), disabled: !duplicateItemName.trim() ||
|
|
520
|
-
(duplicateDialogModel != null &&
|
|
521
|
-
duplicatingId === duplicateDialogModel.id), children: duplicateDialogModel != null &&
|
|
522
|
-
duplicatingId === duplicateDialogModel.id ? (_jsxs(_Fragment, { children: [_jsx(RefreshCw, { className: "mr-1 h-4 w-4 animate-spin" }), "Duplicating\u2026"] })) : ("Duplicate") })] })] }) })] }) }) }));
|
|
303
|
+
}) })) }), _jsx(AddModelDialog, { open: showAddDialog, onOpenChange: setShowAddDialog, onSuccess: loadData, providers: providers, installedModels: installedModels }), _jsx(ImportModelDialog, { open: showImportDialog, onOpenChange: setShowImportDialog, onSuccess: loadData, importableProviders: importableProviders, providerTypes: providerTypes })] }) }) }));
|
|
523
304
|
// Build splitter panels - only show config panel when a model is selected
|
|
524
305
|
const panels = selectedModel?.id
|
|
525
306
|
? [
|
|
@@ -532,9 +313,7 @@ export function ModelsPanel() {
|
|
|
532
313
|
{
|
|
533
314
|
name: "model-config",
|
|
534
315
|
defaultSize: 400,
|
|
535
|
-
content: (_jsx(
|
|
536
|
-
await loadData();
|
|
537
|
-
} }, selectedModel.id)),
|
|
316
|
+
content: (_jsx(ItemConfigPanel, { itemId: selectedModel.id, title: `Configure: ${selectedModel.name || selectedModel.key || "Model"}`, onClose: handleCloseConfig }, selectedModel.id)),
|
|
538
317
|
className: "overflow-hidden",
|
|
539
318
|
},
|
|
540
319
|
]
|