dexto 1.6.0 → 1.6.2
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/coding-agent/coding-agent.yml +3 -1
- package/dist/analytics/wrapper.js +1 -1
- package/dist/cli/auth/dexto-api-key.d.ts +34 -0
- package/dist/cli/auth/dexto-api-key.d.ts.map +1 -0
- package/dist/cli/auth/dexto-api-key.js +161 -0
- package/dist/cli/auth/index.d.ts +2 -1
- package/dist/cli/auth/index.d.ts.map +1 -1
- package/dist/cli/auth/index.js +2 -1
- package/dist/cli/auth/oauth.d.ts +10 -0
- package/dist/cli/auth/oauth.d.ts.map +1 -1
- package/dist/cli/auth/oauth.js +113 -36
- package/dist/cli/auth/service.d.ts +1 -0
- package/dist/cli/auth/service.d.ts.map +1 -1
- package/dist/cli/auth/service.js +1 -0
- package/dist/cli/commands/auth/login.d.ts.map +1 -1
- package/dist/cli/commands/auth/login.js +40 -105
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +157 -120
- package/dist/cli/utils/config-validation.js +3 -3
- package/dist/cli/utils/options.d.ts.map +1 -1
- package/dist/cli/utils/options.js +6 -0
- package/dist/index-main.js +36 -2
- package/dist/utils/session-logger-factory.d.ts.map +1 -1
- package/dist/utils/session-logger-factory.js +17 -2
- package/dist/webui/assets/index-BPlk2Wbt.css +1 -0
- package/dist/webui/assets/index-BZvrpxyh.js +2059 -0
- package/dist/webui/index.html +2 -2
- package/package.json +13 -23
- package/dist/cli/commands/interactive-commands/auth/index.d.ts +0 -12
- package/dist/cli/commands/interactive-commands/auth/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/auth/index.js +0 -20
- package/dist/cli/commands/interactive-commands/command-parser.d.ts +0 -56
- package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/command-parser.js +0 -173
- package/dist/cli/commands/interactive-commands/commands.d.ts +0 -52
- package/dist/cli/commands/interactive-commands/commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/commands.js +0 -142
- package/dist/cli/commands/interactive-commands/documentation-commands.d.ts +0 -15
- package/dist/cli/commands/interactive-commands/documentation-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/documentation-commands.js +0 -39
- package/dist/cli/commands/interactive-commands/export/index.d.ts +0 -13
- package/dist/cli/commands/interactive-commands/export/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/export/index.js +0 -21
- package/dist/cli/commands/interactive-commands/general-commands.d.ts +0 -22
- package/dist/cli/commands/interactive-commands/general-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/general-commands.js +0 -458
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts +0 -13
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/mcp/index.js +0 -18
- package/dist/cli/commands/interactive-commands/model/index.d.ts +0 -13
- package/dist/cli/commands/interactive-commands/model/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/model/index.js +0 -19
- package/dist/cli/commands/interactive-commands/plugin/index.d.ts +0 -13
- package/dist/cli/commands/interactive-commands/plugin/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/plugin/index.js +0 -18
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts +0 -25
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/prompt-commands.js +0 -339
- package/dist/cli/commands/interactive-commands/session/index.d.ts +0 -16
- package/dist/cli/commands/interactive-commands/session/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/session/index.js +0 -15
- package/dist/cli/commands/interactive-commands/session/session-commands.d.ts +0 -32
- package/dist/cli/commands/interactive-commands/session/session-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/session/session-commands.js +0 -67
- package/dist/cli/commands/interactive-commands/system/index.d.ts +0 -13
- package/dist/cli/commands/interactive-commands/system/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/system/index.js +0 -12
- package/dist/cli/commands/interactive-commands/system/system-commands.d.ts +0 -18
- package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/system/system-commands.js +0 -197
- package/dist/cli/commands/interactive-commands/tool-commands.d.ts +0 -15
- package/dist/cli/commands/interactive-commands/tool-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/tool-commands.js +0 -24
- package/dist/cli/commands/interactive-commands/utils/arg-parser.d.ts +0 -57
- package/dist/cli/commands/interactive-commands/utils/arg-parser.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/utils/arg-parser.js +0 -81
- package/dist/cli/commands/interactive-commands/utils/command-output.d.ts +0 -40
- package/dist/cli/commands/interactive-commands/utils/command-output.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/utils/command-output.js +0 -56
- package/dist/cli/commands/interactive-commands/utils/format-output.d.ts +0 -14
- package/dist/cli/commands/interactive-commands/utils/format-output.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/utils/format-output.js +0 -18
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts +0 -52
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +0 -1
- package/dist/cli/ink-cli/InkCLIRefactored.js +0 -120
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +0 -44
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.js +0 -269
- package/dist/cli/ink-cli/components/BackgroundTasksPanel.d.ts +0 -18
- package/dist/cli/ink-cli/components/BackgroundTasksPanel.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/BackgroundTasksPanel.js +0 -48
- package/dist/cli/ink-cli/components/CustomInput.d.ts +0 -17
- package/dist/cli/ink-cli/components/CustomInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/CustomInput.js +0 -51
- package/dist/cli/ink-cli/components/CustomTextInput.d.ts +0 -16
- package/dist/cli/ink-cli/components/CustomTextInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/CustomTextInput.js +0 -36
- package/dist/cli/ink-cli/components/EditableMultiLineInput.d.ts +0 -19
- package/dist/cli/ink-cli/components/EditableMultiLineInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/EditableMultiLineInput.js +0 -120
- package/dist/cli/ink-cli/components/ElicitationForm.d.ts +0 -22
- package/dist/cli/ink-cli/components/ElicitationForm.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/ElicitationForm.js +0 -358
- package/dist/cli/ink-cli/components/ErrorBoundary.d.ts +0 -20
- package/dist/cli/ink-cli/components/ErrorBoundary.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/ErrorBoundary.js +0 -29
- package/dist/cli/ink-cli/components/Footer.d.ts +0 -22
- package/dist/cli/ink-cli/components/Footer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/Footer.js +0 -76
- package/dist/cli/ink-cli/components/HistorySearchBar.d.ts +0 -17
- package/dist/cli/ink-cli/components/HistorySearchBar.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/HistorySearchBar.js +0 -8
- package/dist/cli/ink-cli/components/MultiLineInput.d.ts +0 -12
- package/dist/cli/ink-cli/components/MultiLineInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/MultiLineInput.js +0 -27
- package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts +0 -26
- package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/ResourceAutocomplete.js +0 -376
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts +0 -28
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +0 -432
- package/dist/cli/ink-cli/components/StatusBar.d.ts +0 -41
- package/dist/cli/ink-cli/components/StatusBar.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/StatusBar.js +0 -110
- package/dist/cli/ink-cli/components/TextBufferInput.d.ts +0 -52
- package/dist/cli/ink-cli/components/TextBufferInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/TextBufferInput.js +0 -490
- package/dist/cli/ink-cli/components/TodoPanel.d.ts +0 -26
- package/dist/cli/ink-cli/components/TodoPanel.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/TodoPanel.js +0 -62
- package/dist/cli/ink-cli/components/base/BaseAutocomplete.d.ts +0 -29
- package/dist/cli/ink-cli/components/base/BaseAutocomplete.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/base/BaseAutocomplete.js +0 -98
- package/dist/cli/ink-cli/components/base/BaseSelector.d.ts +0 -36
- package/dist/cli/ink-cli/components/base/BaseSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/base/BaseSelector.js +0 -118
- package/dist/cli/ink-cli/components/base/index.d.ts +0 -6
- package/dist/cli/ink-cli/components/base/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/base/index.js +0 -5
- package/dist/cli/ink-cli/components/chat/ChatView.d.ts +0 -19
- package/dist/cli/ink-cli/components/chat/ChatView.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/ChatView.js +0 -11
- package/dist/cli/ink-cli/components/chat/Footer.d.ts +0 -9
- package/dist/cli/ink-cli/components/chat/Footer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/Footer.js +0 -8
- package/dist/cli/ink-cli/components/chat/Header.d.ts +0 -18
- package/dist/cli/ink-cli/components/chat/Header.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/Header.js +0 -16
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts +0 -21
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/MessageItem.js +0 -180
- package/dist/cli/ink-cli/components/chat/MessageList.d.ts +0 -16
- package/dist/cli/ink-cli/components/chat/MessageList.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/MessageList.js +0 -20
- package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts +0 -16
- package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.js +0 -27
- package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts +0 -18
- package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/ToolIcon.js +0 -46
- package/dist/cli/ink-cli/components/chat/index.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/index.js +0 -9
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.js +0 -6
- package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.js +0 -15
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.js +0 -9
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.js +0 -37
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.js +0 -9
- package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.js +0 -6
- package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.js +0 -29
- package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts +0 -45
- package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.js +0 -38
- package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.js +0 -6
- package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts +0 -13
- package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/index.js +0 -12
- package/dist/cli/ink-cli/components/input/InputArea.d.ts +0 -46
- package/dist/cli/ink-cli/components/input/InputArea.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/input/InputArea.js +0 -6
- package/dist/cli/ink-cli/components/input/index.d.ts +0 -5
- package/dist/cli/ink-cli/components/input/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/input/index.js +0 -4
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts +0 -27
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +0 -180
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts +0 -29
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.js +0 -107
- package/dist/cli/ink-cli/components/modes/index.d.ts +0 -10
- package/dist/cli/ink-cli/components/modes/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/modes/index.js +0 -9
- package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts +0 -26
- package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/ApiKeyInput.js +0 -92
- package/dist/cli/ink-cli/components/overlays/ContextStatsOverlay.d.ts +0 -26
- package/dist/cli/ink-cli/components/overlays/ContextStatsOverlay.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/ContextStatsOverlay.js +0 -241
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts +0 -29
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.js +0 -301
- package/dist/cli/ink-cli/components/overlays/ExportWizard.d.ts +0 -22
- package/dist/cli/ink-cli/components/overlays/ExportWizard.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/ExportWizard.js +0 -308
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts +0 -23
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +0 -70
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.d.ts +0 -20
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.js +0 -81
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.d.ts +0 -31
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.js +0 -297
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts +0 -22
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.js +0 -59
- package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts +0 -26
- package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpAddSelector.js +0 -73
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts +0 -21
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.js +0 -51
- package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts +0 -29
- package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpCustomWizard.js +0 -215
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts +0 -22
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.js +0 -80
- package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts +0 -21
- package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpSelector.js +0 -52
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts +0 -28
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpServerActions.js +0 -93
- package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts +0 -29
- package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpServerList.js +0 -116
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts +0 -28
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +0 -630
- package/dist/cli/ink-cli/components/overlays/PluginActions.d.ts +0 -27
- package/dist/cli/ink-cli/components/overlays/PluginActions.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PluginActions.js +0 -66
- package/dist/cli/ink-cli/components/overlays/PluginList.d.ts +0 -21
- package/dist/cli/ink-cli/components/overlays/PluginList.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PluginList.js +0 -70
- package/dist/cli/ink-cli/components/overlays/PluginManager.d.ts +0 -21
- package/dist/cli/ink-cli/components/overlays/PluginManager.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PluginManager.js +0 -63
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts +0 -22
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.js +0 -52
- package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts +0 -29
- package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PromptAddWizard.js +0 -166
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts +0 -27
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.js +0 -119
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts +0 -33
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PromptList.js +0 -147
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts +0 -23
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.js +0 -189
- package/dist/cli/ink-cli/components/overlays/SessionRenameOverlay.d.ts +0 -21
- package/dist/cli/ink-cli/components/overlays/SessionRenameOverlay.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/SessionRenameOverlay.js +0 -63
- package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts +0 -26
- package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.js +0 -126
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts +0 -21
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.js +0 -42
- package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts +0 -20
- package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/StreamSelector.js +0 -58
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts +0 -26
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +0 -642
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.d.ts +0 -25
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.js +0 -609
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/index.d.ts +0 -15
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/index.js +0 -14
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts +0 -42
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.js +0 -547
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ApiKeyStep.d.ts +0 -25
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ApiKeyStep.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ApiKeyStep.js +0 -29
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ProviderSelector.d.ts +0 -17
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ProviderSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ProviderSelector.js +0 -11
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/SetupInfoBanner.d.ts +0 -20
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/SetupInfoBanner.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/SetupInfoBanner.js +0 -10
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/WizardStepInput.d.ts +0 -30
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/WizardStepInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/WizardStepInput.js +0 -13
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/index.d.ts +0 -8
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/index.js +0 -7
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/types.d.ts +0 -85
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/types.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/types.js +0 -38
- package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts +0 -21
- package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/DiffRenderer.js +0 -65
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +0 -30
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +0 -66
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts +0 -19
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/FileRenderer.js +0 -26
- package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts +0 -21
- package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/GenericRenderer.js +0 -26
- package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts +0 -20
- package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/SearchRenderer.js +0 -26
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts +0 -21
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.js +0 -25
- package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts +0 -61
- package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/diff-shared.js +0 -158
- package/dist/cli/ink-cli/components/renderers/index.d.ts +0 -28
- package/dist/cli/ink-cli/components/renderers/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/index.js +0 -36
- package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts +0 -38
- package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/shared/MarkdownText.js +0 -389
- package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts +0 -44
- package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/shared/VirtualizedList.js +0 -300
- package/dist/cli/ink-cli/components/shared/text-buffer.d.ts +0 -185
- package/dist/cli/ink-cli/components/shared/text-buffer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/shared/text-buffer.js +0 -1338
- package/dist/cli/ink-cli/constants/processingPhrases.d.ts +0 -10
- package/dist/cli/ink-cli/constants/processingPhrases.d.ts.map +0 -1
- package/dist/cli/ink-cli/constants/processingPhrases.js +0 -92
- package/dist/cli/ink-cli/constants/tips.d.ts +0 -15
- package/dist/cli/ink-cli/constants/tips.d.ts.map +0 -1
- package/dist/cli/ink-cli/constants/tips.js +0 -57
- package/dist/cli/ink-cli/containers/InputContainer.d.ts +0 -62
- package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +0 -1
- package/dist/cli/ink-cli/containers/InputContainer.js +0 -639
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts +0 -42
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +0 -1
- package/dist/cli/ink-cli/containers/OverlayContainer.js +0 -1824
- package/dist/cli/ink-cli/containers/index.d.ts +0 -6
- package/dist/cli/ink-cli/containers/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/containers/index.js +0 -5
- package/dist/cli/ink-cli/contexts/KeypressContext.d.ts +0 -36
- package/dist/cli/ink-cli/contexts/KeypressContext.d.ts.map +0 -1
- package/dist/cli/ink-cli/contexts/KeypressContext.js +0 -461
- package/dist/cli/ink-cli/contexts/MouseContext.d.ts +0 -27
- package/dist/cli/ink-cli/contexts/MouseContext.d.ts.map +0 -1
- package/dist/cli/ink-cli/contexts/MouseContext.js +0 -102
- package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts +0 -33
- package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts.map +0 -1
- package/dist/cli/ink-cli/contexts/ScrollProvider.js +0 -170
- package/dist/cli/ink-cli/contexts/SoundContext.d.ts +0 -23
- package/dist/cli/ink-cli/contexts/SoundContext.d.ts.map +0 -1
- package/dist/cli/ink-cli/contexts/SoundContext.js +0 -22
- package/dist/cli/ink-cli/contexts/index.d.ts +0 -8
- package/dist/cli/ink-cli/contexts/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/contexts/index.js +0 -7
- package/dist/cli/ink-cli/hooks/index.d.ts +0 -12
- package/dist/cli/ink-cli/hooks/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/index.js +0 -14
- package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts +0 -49
- package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useAgentEvents.js +0 -369
- package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts +0 -14
- package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useBatchedScroll.js +0 -25
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts +0 -52
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useCLIState.js +0 -223
- package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts +0 -24
- package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useElapsedTime.js +0 -69
- package/dist/cli/ink-cli/hooks/useGitBranch.d.ts +0 -13
- package/dist/cli/ink-cli/hooks/useGitBranch.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useGitBranch.js +0 -35
- package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts +0 -61
- package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useHistorySearch.js +0 -210
- package/dist/cli/ink-cli/hooks/useInputHistory.d.ts +0 -18
- package/dist/cli/ink-cli/hooks/useInputHistory.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useInputHistory.js +0 -26
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts +0 -136
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.js +0 -715
- package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.d.ts +0 -21
- package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.js +0 -80
- package/dist/cli/ink-cli/hooks/useKeypress.d.ts +0 -18
- package/dist/cli/ink-cli/hooks/useKeypress.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useKeypress.js +0 -26
- package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts +0 -30
- package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/usePhraseCycler.js +0 -68
- package/dist/cli/ink-cli/hooks/useStreaming.d.ts +0 -19
- package/dist/cli/ink-cli/hooks/useStreaming.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useStreaming.js +0 -26
- package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts +0 -14
- package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useTerminalSize.js +0 -31
- package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts +0 -46
- package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useTokenCounter.js +0 -122
- package/dist/cli/ink-cli/services/CommandService.d.ts +0 -58
- package/dist/cli/ink-cli/services/CommandService.d.ts.map +0 -1
- package/dist/cli/ink-cli/services/CommandService.js +0 -64
- package/dist/cli/ink-cli/services/InputService.d.ts +0 -40
- package/dist/cli/ink-cli/services/InputService.d.ts.map +0 -1
- package/dist/cli/ink-cli/services/InputService.js +0 -87
- package/dist/cli/ink-cli/services/MessageService.d.ts +0 -35
- package/dist/cli/ink-cli/services/MessageService.d.ts.map +0 -1
- package/dist/cli/ink-cli/services/MessageService.js +0 -49
- package/dist/cli/ink-cli/services/index.d.ts +0 -8
- package/dist/cli/ink-cli/services/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/services/index.js +0 -7
- package/dist/cli/ink-cli/services/processStream.d.ts +0 -75
- package/dist/cli/ink-cli/services/processStream.d.ts.map +0 -1
- package/dist/cli/ink-cli/services/processStream.js +0 -942
- package/dist/cli/ink-cli/state/actions.d.ts +0 -124
- package/dist/cli/ink-cli/state/actions.d.ts.map +0 -1
- package/dist/cli/ink-cli/state/actions.js +0 -8
- package/dist/cli/ink-cli/state/index.d.ts +0 -10
- package/dist/cli/ink-cli/state/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/state/index.js +0 -8
- package/dist/cli/ink-cli/state/initialState.d.ts +0 -12
- package/dist/cli/ink-cli/state/initialState.d.ts.map +0 -1
- package/dist/cli/ink-cli/state/initialState.js +0 -57
- package/dist/cli/ink-cli/state/reducer.d.ts +0 -15
- package/dist/cli/ink-cli/state/reducer.d.ts.map +0 -1
- package/dist/cli/ink-cli/state/reducer.js +0 -341
- package/dist/cli/ink-cli/state/streaming-state.d.ts +0 -27
- package/dist/cli/ink-cli/state/streaming-state.d.ts.map +0 -1
- package/dist/cli/ink-cli/state/streaming-state.js +0 -39
- package/dist/cli/ink-cli/state/types.d.ts +0 -366
- package/dist/cli/ink-cli/state/types.d.ts.map +0 -1
- package/dist/cli/ink-cli/state/types.js +0 -5
- package/dist/cli/ink-cli/utils/bracketedPaste.d.ts +0 -22
- package/dist/cli/ink-cli/utils/bracketedPaste.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/bracketedPaste.js +0 -27
- package/dist/cli/ink-cli/utils/clipboardUtils.d.ts +0 -49
- package/dist/cli/ink-cli/utils/clipboardUtils.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/clipboardUtils.js +0 -356
- package/dist/cli/ink-cli/utils/commandOverlays.d.ts +0 -33
- package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/commandOverlays.js +0 -84
- package/dist/cli/ink-cli/utils/debugLog.d.ts +0 -38
- package/dist/cli/ink-cli/utils/debugLog.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/debugLog.js +0 -66
- package/dist/cli/ink-cli/utils/idGenerator.d.ts +0 -10
- package/dist/cli/ink-cli/utils/idGenerator.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/idGenerator.js +0 -12
- package/dist/cli/ink-cli/utils/index.d.ts +0 -9
- package/dist/cli/ink-cli/utils/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/index.js +0 -13
- package/dist/cli/ink-cli/utils/input.d.ts +0 -25
- package/dist/cli/ink-cli/utils/input.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/input.js +0 -56
- package/dist/cli/ink-cli/utils/inputParsing.d.ts +0 -31
- package/dist/cli/ink-cli/utils/inputParsing.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/inputParsing.js +0 -70
- package/dist/cli/ink-cli/utils/llm-provider-display.d.ts +0 -3
- package/dist/cli/ink-cli/utils/llm-provider-display.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/llm-provider-display.js +0 -22
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts +0 -140
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/messageFormatting.js +0 -591
- package/dist/cli/ink-cli/utils/mouse.d.ts +0 -61
- package/dist/cli/ink-cli/utils/mouse.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/mouse.js +0 -209
- package/dist/cli/ink-cli/utils/soundNotification.d.ts +0 -71
- package/dist/cli/ink-cli/utils/soundNotification.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/soundNotification.js +0 -203
- package/dist/cli/ink-cli/utils/streamSplitter.d.ts +0 -44
- package/dist/cli/ink-cli/utils/streamSplitter.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/streamSplitter.js +0 -154
- package/dist/cli/ink-cli/utils/textUtils.d.ts +0 -63
- package/dist/cli/ink-cli/utils/textUtils.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/textUtils.js +0 -248
- package/dist/cli/ink-cli/utils/toolUtils.d.ts +0 -20
- package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/toolUtils.js +0 -25
- package/dist/webui/assets/index-C9JXwpvo.css +0 -1
- package/dist/webui/assets/index-DwtueA8l.js +0 -2059
|
@@ -1,630 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* ModelSelector Component (Refactored)
|
|
4
|
-
* Features:
|
|
5
|
-
* - Search filtering
|
|
6
|
-
* - Custom models support (add/edit/delete via arrow navigation)
|
|
7
|
-
*/
|
|
8
|
-
import { useState, useEffect, forwardRef, useRef, useImperativeHandle, useMemo, useCallback, } from 'react';
|
|
9
|
-
import { Box, Text } from 'ink';
|
|
10
|
-
import { listOllamaModels, DEFAULT_OLLAMA_URL, getLocalModelById, isReasoningCapableModel, } from '@dexto/core';
|
|
11
|
-
import { loadCustomModels, deleteCustomModel, getAllInstalledModels, loadGlobalPreferences, isDextoAuthEnabled, } from '@dexto/agent-management';
|
|
12
|
-
import { getLLMProviderDisplayName } from '../../utils/llm-provider-display.js';
|
|
13
|
-
function isAddCustomOption(item) {
|
|
14
|
-
return 'type' in item && item.type === 'add-custom';
|
|
15
|
-
}
|
|
16
|
-
const MAX_VISIBLE_ITEMS = 10;
|
|
17
|
-
// Reasoning effort options - defined at module scope to avoid recreation on each render
|
|
18
|
-
const REASONING_EFFORT_OPTIONS = [
|
|
19
|
-
{
|
|
20
|
-
value: 'auto',
|
|
21
|
-
label: 'Auto',
|
|
22
|
-
description: 'Let the model decide (recommended for most tasks)',
|
|
23
|
-
},
|
|
24
|
-
{ value: 'none', label: 'None', description: 'No reasoning, fastest responses' },
|
|
25
|
-
{ value: 'minimal', label: 'Minimal', description: 'Barely any reasoning, very fast' },
|
|
26
|
-
{ value: 'low', label: 'Low', description: 'Light reasoning, fast responses' },
|
|
27
|
-
{
|
|
28
|
-
value: 'medium',
|
|
29
|
-
label: 'Medium',
|
|
30
|
-
description: 'Balanced reasoning (OpenAI recommended)',
|
|
31
|
-
},
|
|
32
|
-
{ value: 'high', label: 'High', description: 'Thorough reasoning for complex tasks' },
|
|
33
|
-
{ value: 'xhigh', label: 'Extra High', description: 'Maximum quality, slower/costlier' },
|
|
34
|
-
];
|
|
35
|
-
/**
|
|
36
|
-
* Model selector with search and custom model support
|
|
37
|
-
*/
|
|
38
|
-
const ModelSelector = forwardRef(function ModelSelector({ isVisible, onSelectModel, onSetDefaultModel, onClose, onAddCustomModel, onEditCustomModel, agent, }, ref) {
|
|
39
|
-
const [models, setModels] = useState([]);
|
|
40
|
-
const [customModels, setCustomModels] = useState([]);
|
|
41
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
42
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
43
|
-
const [searchQuery, setSearchQuery] = useState('');
|
|
44
|
-
const [scrollOffset, setScrollOffset] = useState(0);
|
|
45
|
-
const [customModelAction, setCustomModelAction] = useState(null);
|
|
46
|
-
const [pendingDeleteConfirm, setPendingDeleteConfirm] = useState(false);
|
|
47
|
-
const selectedIndexRef = useRef(selectedIndex);
|
|
48
|
-
const deleteTimeoutRef = useRef(null);
|
|
49
|
-
// Reasoning effort sub-step state
|
|
50
|
-
const [pendingReasoningModel, setPendingReasoningModel] = useState(null);
|
|
51
|
-
const [reasoningEffortIndex, setReasoningEffortIndex] = useState(0); // Default to 'Auto' (index 0)
|
|
52
|
-
const [isSettingDefault, setIsSettingDefault] = useState(false); // Track if setting as default vs normal selection
|
|
53
|
-
const [refreshVersion, setRefreshVersion] = useState(0);
|
|
54
|
-
// Keep ref in sync
|
|
55
|
-
selectedIndexRef.current = selectedIndex;
|
|
56
|
-
// Clear delete confirmation timeout on unmount
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
return () => {
|
|
59
|
-
if (deleteTimeoutRef.current) {
|
|
60
|
-
clearTimeout(deleteTimeoutRef.current);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}, []);
|
|
64
|
-
// Fetch models from agent and load custom models
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
if (!isVisible)
|
|
67
|
-
return;
|
|
68
|
-
let cancelled = false;
|
|
69
|
-
setIsLoading(true);
|
|
70
|
-
setSearchQuery('');
|
|
71
|
-
setSelectedIndex(0);
|
|
72
|
-
setScrollOffset(0);
|
|
73
|
-
setCustomModelAction(null);
|
|
74
|
-
setPendingDeleteConfirm(false);
|
|
75
|
-
setPendingReasoningModel(null);
|
|
76
|
-
setIsSettingDefault(false);
|
|
77
|
-
setReasoningEffortIndex(0); // Default to 'Auto'
|
|
78
|
-
if (deleteTimeoutRef.current) {
|
|
79
|
-
clearTimeout(deleteTimeoutRef.current);
|
|
80
|
-
deleteTimeoutRef.current = null;
|
|
81
|
-
}
|
|
82
|
-
const fetchModels = async () => {
|
|
83
|
-
try {
|
|
84
|
-
const [allModels, providers, currentConfig, loadedCustomModels, preferences] = await Promise.all([
|
|
85
|
-
Promise.resolve(agent.getSupportedModels()),
|
|
86
|
-
Promise.resolve(agent.getSupportedProviders()),
|
|
87
|
-
Promise.resolve(agent.getCurrentLLMConfig()),
|
|
88
|
-
loadCustomModels(),
|
|
89
|
-
loadGlobalPreferences().catch(() => null),
|
|
90
|
-
]);
|
|
91
|
-
const modelList = [];
|
|
92
|
-
const defaultProvider = preferences?.llm.provider;
|
|
93
|
-
const defaultModel = preferences?.llm.model;
|
|
94
|
-
const defaultBaseURL = preferences?.llm.baseURL;
|
|
95
|
-
const defaultReasoningEffort = preferences?.llm.reasoningEffort;
|
|
96
|
-
// Fetch dynamic models for local providers
|
|
97
|
-
let ollamaModels = [];
|
|
98
|
-
let localModels = [];
|
|
99
|
-
try {
|
|
100
|
-
ollamaModels = await listOllamaModels(DEFAULT_OLLAMA_URL);
|
|
101
|
-
}
|
|
102
|
-
catch (error) {
|
|
103
|
-
// Ollama not available, skip
|
|
104
|
-
agent.logger.debug('Ollama not available for model listing');
|
|
105
|
-
}
|
|
106
|
-
try {
|
|
107
|
-
localModels = await getAllInstalledModels();
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
// Local models not available, skip
|
|
111
|
-
agent.logger.debug('Local models not available for listing');
|
|
112
|
-
}
|
|
113
|
-
// Add custom models first
|
|
114
|
-
for (const custom of loadedCustomModels) {
|
|
115
|
-
// Use provider from custom model, default to openai-compatible for legacy models
|
|
116
|
-
const customProvider = (custom.provider ?? 'openai-compatible');
|
|
117
|
-
const modelOption = {
|
|
118
|
-
provider: customProvider,
|
|
119
|
-
name: custom.name,
|
|
120
|
-
displayName: custom.displayName || custom.name,
|
|
121
|
-
maxInputTokens: custom.maxInputTokens ?? 128000,
|
|
122
|
-
isDefault: customProvider === defaultProvider && custom.name === defaultModel,
|
|
123
|
-
isCurrent: currentConfig.provider === customProvider &&
|
|
124
|
-
currentConfig.model === custom.name,
|
|
125
|
-
isCustom: true,
|
|
126
|
-
};
|
|
127
|
-
if (custom.baseURL) {
|
|
128
|
-
modelOption.baseURL = custom.baseURL;
|
|
129
|
-
}
|
|
130
|
-
if (custom.reasoningEffort) {
|
|
131
|
-
modelOption.reasoningEffort = custom.reasoningEffort;
|
|
132
|
-
}
|
|
133
|
-
modelList.push(modelOption);
|
|
134
|
-
}
|
|
135
|
-
// Add registry models
|
|
136
|
-
for (const provider of providers) {
|
|
137
|
-
// Skip custom-only providers that don't have a static model list
|
|
138
|
-
// These are only accessible via the "Add custom model" wizard
|
|
139
|
-
if (provider === 'openai-compatible' ||
|
|
140
|
-
provider === 'openrouter' ||
|
|
141
|
-
provider === 'litellm' ||
|
|
142
|
-
provider === 'glama' ||
|
|
143
|
-
provider === 'bedrock')
|
|
144
|
-
continue;
|
|
145
|
-
// Skip ollama, local, and vertex - they'll be added dynamically below
|
|
146
|
-
if (provider === 'ollama' || provider === 'local' || provider === 'vertex') {
|
|
147
|
-
continue;
|
|
148
|
-
}
|
|
149
|
-
// Skip dexto-nova provider when feature is not enabled
|
|
150
|
-
if (provider === 'dexto-nova' && !isDextoAuthEnabled()) {
|
|
151
|
-
continue;
|
|
152
|
-
}
|
|
153
|
-
const providerModels = allModels[provider];
|
|
154
|
-
for (const model of providerModels) {
|
|
155
|
-
// For dexto-nova provider, models have originalProvider field
|
|
156
|
-
// showing which provider the model originally came from
|
|
157
|
-
const originalProvider = 'originalProvider' in model ? model.originalProvider : undefined;
|
|
158
|
-
modelList.push({
|
|
159
|
-
provider,
|
|
160
|
-
name: model.name,
|
|
161
|
-
displayName: model.displayName,
|
|
162
|
-
maxInputTokens: model.maxInputTokens,
|
|
163
|
-
isDefault: provider === defaultProvider && model.name === defaultModel,
|
|
164
|
-
isCurrent: provider === currentConfig.provider &&
|
|
165
|
-
model.name === currentConfig.model,
|
|
166
|
-
isCustom: false,
|
|
167
|
-
...(defaultReasoningEffort &&
|
|
168
|
-
provider === defaultProvider &&
|
|
169
|
-
model.name === defaultModel
|
|
170
|
-
? { reasoningEffort: defaultReasoningEffort }
|
|
171
|
-
: {}),
|
|
172
|
-
...(defaultBaseURL &&
|
|
173
|
-
provider === defaultProvider &&
|
|
174
|
-
model.name === defaultModel
|
|
175
|
-
? { baseURL: defaultBaseURL }
|
|
176
|
-
: {}),
|
|
177
|
-
// Store original provider for display purposes
|
|
178
|
-
...(originalProvider && { originalProvider }),
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
// Add Ollama models dynamically
|
|
183
|
-
for (const ollamaModel of ollamaModels) {
|
|
184
|
-
modelList.push({
|
|
185
|
-
provider: 'ollama',
|
|
186
|
-
name: ollamaModel.name,
|
|
187
|
-
displayName: ollamaModel.name,
|
|
188
|
-
maxInputTokens: 128000, // Default, actual varies by model
|
|
189
|
-
isDefault: defaultProvider === 'ollama' && defaultModel === ollamaModel.name,
|
|
190
|
-
isCurrent: currentConfig.provider === 'ollama' &&
|
|
191
|
-
currentConfig.model === ollamaModel.name,
|
|
192
|
-
isCustom: false,
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
// Add local models dynamically
|
|
196
|
-
for (const localModel of localModels) {
|
|
197
|
-
// Get display name from registry if available
|
|
198
|
-
const modelInfo = getLocalModelById(localModel.id);
|
|
199
|
-
const displayName = modelInfo?.name || localModel.id;
|
|
200
|
-
const maxInputTokens = modelInfo?.contextLength || 128000;
|
|
201
|
-
modelList.push({
|
|
202
|
-
provider: 'local',
|
|
203
|
-
name: localModel.id,
|
|
204
|
-
displayName,
|
|
205
|
-
maxInputTokens,
|
|
206
|
-
isDefault: defaultProvider === 'local' && defaultModel === localModel.id,
|
|
207
|
-
isCurrent: currentConfig.provider === 'local' &&
|
|
208
|
-
currentConfig.model === localModel.id,
|
|
209
|
-
isCustom: false,
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
// Add Vertex AI models from registry
|
|
213
|
-
const vertexModels = allModels['vertex'];
|
|
214
|
-
if (vertexModels) {
|
|
215
|
-
for (const model of vertexModels) {
|
|
216
|
-
modelList.push({
|
|
217
|
-
provider: 'vertex',
|
|
218
|
-
name: model.name,
|
|
219
|
-
displayName: model.displayName,
|
|
220
|
-
maxInputTokens: model.maxInputTokens,
|
|
221
|
-
isDefault: defaultProvider === 'vertex' && defaultModel === model.name,
|
|
222
|
-
isCurrent: currentConfig.provider === 'vertex' &&
|
|
223
|
-
currentConfig.model === model.name,
|
|
224
|
-
isCustom: false,
|
|
225
|
-
...(defaultReasoningEffort &&
|
|
226
|
-
defaultProvider === 'vertex' &&
|
|
227
|
-
defaultModel === model.name
|
|
228
|
-
? { reasoningEffort: defaultReasoningEffort }
|
|
229
|
-
: {}),
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
if (!cancelled) {
|
|
234
|
-
setModels(modelList);
|
|
235
|
-
setCustomModels(loadedCustomModels);
|
|
236
|
-
setIsLoading(false);
|
|
237
|
-
// Set initial selection to current model (offset by 1 for "Add custom" option)
|
|
238
|
-
const currentIndex = modelList.findIndex((m) => m.isCurrent);
|
|
239
|
-
if (currentIndex >= 0) {
|
|
240
|
-
setSelectedIndex(currentIndex + 1); // +1 for "Add custom" at top
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
catch (error) {
|
|
245
|
-
if (!cancelled) {
|
|
246
|
-
agent.logger.error(`Failed to fetch models: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
247
|
-
setModels([]);
|
|
248
|
-
setIsLoading(false);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
void fetchModels();
|
|
253
|
-
return () => {
|
|
254
|
-
cancelled = true;
|
|
255
|
-
};
|
|
256
|
-
}, [isVisible, agent, refreshVersion]);
|
|
257
|
-
// Filter models based on search query
|
|
258
|
-
const filteredItems = useMemo(() => {
|
|
259
|
-
const addCustomOption = { type: 'add-custom' };
|
|
260
|
-
if (!searchQuery.trim()) {
|
|
261
|
-
return [addCustomOption, ...models];
|
|
262
|
-
}
|
|
263
|
-
const query = searchQuery.toLowerCase();
|
|
264
|
-
const filtered = models.filter((model) => {
|
|
265
|
-
const name = model.name.toLowerCase();
|
|
266
|
-
const displayName = (model.displayName || '').toLowerCase();
|
|
267
|
-
const provider = model.provider.toLowerCase();
|
|
268
|
-
return name.includes(query) || displayName.includes(query) || provider.includes(query);
|
|
269
|
-
});
|
|
270
|
-
// Always show "Add custom" when searching (user might want to add what they're searching for)
|
|
271
|
-
return [addCustomOption, ...filtered];
|
|
272
|
-
}, [models, searchQuery]);
|
|
273
|
-
// Adjust selected index when filter changes
|
|
274
|
-
useEffect(() => {
|
|
275
|
-
if (selectedIndex >= filteredItems.length) {
|
|
276
|
-
setSelectedIndex(Math.max(0, filteredItems.length - 1));
|
|
277
|
-
}
|
|
278
|
-
}, [filteredItems.length, selectedIndex]);
|
|
279
|
-
// Calculate scroll offset
|
|
280
|
-
useEffect(() => {
|
|
281
|
-
if (selectedIndex < scrollOffset) {
|
|
282
|
-
setScrollOffset(selectedIndex);
|
|
283
|
-
}
|
|
284
|
-
else if (selectedIndex >= scrollOffset + MAX_VISIBLE_ITEMS) {
|
|
285
|
-
setScrollOffset(selectedIndex - MAX_VISIBLE_ITEMS + 1);
|
|
286
|
-
}
|
|
287
|
-
}, [selectedIndex, scrollOffset]);
|
|
288
|
-
// Handle delete custom model
|
|
289
|
-
const handleDeleteCustomModel = useCallback(async (model) => {
|
|
290
|
-
if (!model.isCustom)
|
|
291
|
-
return;
|
|
292
|
-
try {
|
|
293
|
-
await deleteCustomModel(model.name);
|
|
294
|
-
// Refresh the list
|
|
295
|
-
const updated = await loadCustomModels();
|
|
296
|
-
setCustomModels(updated);
|
|
297
|
-
// Update models list
|
|
298
|
-
setModels((prev) => prev.filter((m) => !(m.isCustom && m.name === model.name)));
|
|
299
|
-
}
|
|
300
|
-
catch (error) {
|
|
301
|
-
agent.logger.error(`Failed to delete custom model: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
302
|
-
}
|
|
303
|
-
}, [agent]);
|
|
304
|
-
// Helper to clear action state
|
|
305
|
-
const clearActionState = () => {
|
|
306
|
-
setCustomModelAction(null);
|
|
307
|
-
setPendingDeleteConfirm(false);
|
|
308
|
-
if (deleteTimeoutRef.current) {
|
|
309
|
-
clearTimeout(deleteTimeoutRef.current);
|
|
310
|
-
deleteTimeoutRef.current = null;
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
// Expose handleInput method via ref
|
|
314
|
-
useImperativeHandle(ref, () => ({
|
|
315
|
-
handleInput: (input, key) => {
|
|
316
|
-
if (!isVisible)
|
|
317
|
-
return false;
|
|
318
|
-
// Handle reasoning effort sub-step
|
|
319
|
-
if (pendingReasoningModel) {
|
|
320
|
-
if (key.escape) {
|
|
321
|
-
// Go back to model selection
|
|
322
|
-
setPendingReasoningModel(null);
|
|
323
|
-
setIsSettingDefault(false);
|
|
324
|
-
return true;
|
|
325
|
-
}
|
|
326
|
-
if (key.upArrow) {
|
|
327
|
-
setReasoningEffortIndex((prev) => prev > 0 ? prev - 1 : REASONING_EFFORT_OPTIONS.length - 1);
|
|
328
|
-
return true;
|
|
329
|
-
}
|
|
330
|
-
if (key.downArrow) {
|
|
331
|
-
setReasoningEffortIndex((prev) => prev < REASONING_EFFORT_OPTIONS.length - 1 ? prev + 1 : 0);
|
|
332
|
-
return true;
|
|
333
|
-
}
|
|
334
|
-
if (key.return) {
|
|
335
|
-
const selectedOption = REASONING_EFFORT_OPTIONS[reasoningEffortIndex];
|
|
336
|
-
const reasoningEffort = selectedOption?.value === 'auto' ? undefined : selectedOption?.value;
|
|
337
|
-
if (isSettingDefault) {
|
|
338
|
-
// Setting as default model
|
|
339
|
-
clearActionState();
|
|
340
|
-
void (async () => {
|
|
341
|
-
await onSetDefaultModel(pendingReasoningModel.provider, pendingReasoningModel.name, pendingReasoningModel.displayName, pendingReasoningModel.baseURL, reasoningEffort);
|
|
342
|
-
setRefreshVersion((prev) => prev + 1);
|
|
343
|
-
onClose(); // Close overlay after setting default
|
|
344
|
-
})();
|
|
345
|
-
}
|
|
346
|
-
else {
|
|
347
|
-
// Normal model selection
|
|
348
|
-
onSelectModel(pendingReasoningModel.provider, pendingReasoningModel.name, pendingReasoningModel.displayName, pendingReasoningModel.baseURL, reasoningEffort);
|
|
349
|
-
}
|
|
350
|
-
setPendingReasoningModel(null);
|
|
351
|
-
setIsSettingDefault(false);
|
|
352
|
-
return true;
|
|
353
|
-
}
|
|
354
|
-
return true; // Consume all input in reasoning effort mode
|
|
355
|
-
}
|
|
356
|
-
// Escape always works
|
|
357
|
-
if (key.escape) {
|
|
358
|
-
// If in action mode, just clear it first
|
|
359
|
-
if (customModelAction) {
|
|
360
|
-
clearActionState();
|
|
361
|
-
return true;
|
|
362
|
-
}
|
|
363
|
-
onClose();
|
|
364
|
-
return true;
|
|
365
|
-
}
|
|
366
|
-
const itemsLength = filteredItems.length;
|
|
367
|
-
const currentItem = filteredItems[selectedIndexRef.current];
|
|
368
|
-
const isCustomActionItem = currentItem && !isAddCustomOption(currentItem) && currentItem.isCustom;
|
|
369
|
-
const isSelectableItem = currentItem && !isAddCustomOption(currentItem);
|
|
370
|
-
const isOnActionItem = isCustomActionItem || isSelectableItem;
|
|
371
|
-
// Right arrow - enter/advance action mode for custom or selectable models
|
|
372
|
-
if (key.rightArrow) {
|
|
373
|
-
if (!isOnActionItem)
|
|
374
|
-
return false;
|
|
375
|
-
if (customModelAction === null) {
|
|
376
|
-
if (isCustomActionItem) {
|
|
377
|
-
setCustomModelAction('edit');
|
|
378
|
-
}
|
|
379
|
-
else {
|
|
380
|
-
setCustomModelAction('default');
|
|
381
|
-
}
|
|
382
|
-
return true;
|
|
383
|
-
}
|
|
384
|
-
if (customModelAction === 'edit') {
|
|
385
|
-
setCustomModelAction('default');
|
|
386
|
-
return true;
|
|
387
|
-
}
|
|
388
|
-
if (customModelAction === 'default') {
|
|
389
|
-
if (isCustomActionItem) {
|
|
390
|
-
setCustomModelAction('delete');
|
|
391
|
-
setPendingDeleteConfirm(false);
|
|
392
|
-
return true;
|
|
393
|
-
}
|
|
394
|
-
const actionItem = currentItem;
|
|
395
|
-
// Check if reasoning-capable, show reasoning effort selection
|
|
396
|
-
if (isReasoningCapableModel(actionItem.name)) {
|
|
397
|
-
setPendingReasoningModel(actionItem);
|
|
398
|
-
setIsSettingDefault(true);
|
|
399
|
-
setReasoningEffortIndex(0); // Default to 'Auto'
|
|
400
|
-
return true;
|
|
401
|
-
}
|
|
402
|
-
clearActionState();
|
|
403
|
-
void (async () => {
|
|
404
|
-
await onSetDefaultModel(actionItem.provider, actionItem.name, actionItem.displayName, actionItem.baseURL, actionItem.reasoningEffort);
|
|
405
|
-
setRefreshVersion((prev) => prev + 1);
|
|
406
|
-
onClose(); // Close overlay after setting default
|
|
407
|
-
})();
|
|
408
|
-
return true;
|
|
409
|
-
}
|
|
410
|
-
if (customModelAction === 'delete') {
|
|
411
|
-
if (pendingDeleteConfirm) {
|
|
412
|
-
if (deleteTimeoutRef.current) {
|
|
413
|
-
clearTimeout(deleteTimeoutRef.current);
|
|
414
|
-
deleteTimeoutRef.current = null;
|
|
415
|
-
}
|
|
416
|
-
clearActionState();
|
|
417
|
-
void handleDeleteCustomModel(currentItem);
|
|
418
|
-
}
|
|
419
|
-
else {
|
|
420
|
-
setPendingDeleteConfirm(true);
|
|
421
|
-
if (deleteTimeoutRef.current) {
|
|
422
|
-
clearTimeout(deleteTimeoutRef.current);
|
|
423
|
-
}
|
|
424
|
-
deleteTimeoutRef.current = setTimeout(() => {
|
|
425
|
-
setPendingDeleteConfirm(false);
|
|
426
|
-
deleteTimeoutRef.current = null;
|
|
427
|
-
}, 3000);
|
|
428
|
-
}
|
|
429
|
-
return true;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
// Left arrow - go back in action mode
|
|
433
|
-
if (key.leftArrow) {
|
|
434
|
-
if (customModelAction === 'delete') {
|
|
435
|
-
setCustomModelAction('default');
|
|
436
|
-
setPendingDeleteConfirm(false);
|
|
437
|
-
if (deleteTimeoutRef.current) {
|
|
438
|
-
clearTimeout(deleteTimeoutRef.current);
|
|
439
|
-
deleteTimeoutRef.current = null;
|
|
440
|
-
}
|
|
441
|
-
return true;
|
|
442
|
-
}
|
|
443
|
-
if (customModelAction === 'default') {
|
|
444
|
-
if (isCustomActionItem) {
|
|
445
|
-
setCustomModelAction('edit');
|
|
446
|
-
}
|
|
447
|
-
else {
|
|
448
|
-
setCustomModelAction(null);
|
|
449
|
-
}
|
|
450
|
-
return true;
|
|
451
|
-
}
|
|
452
|
-
if (customModelAction === 'edit') {
|
|
453
|
-
setCustomModelAction(null);
|
|
454
|
-
return true;
|
|
455
|
-
}
|
|
456
|
-
return false;
|
|
457
|
-
}
|
|
458
|
-
// Handle character input for search
|
|
459
|
-
if (input && !key.return && !key.upArrow && !key.downArrow && !key.tab) {
|
|
460
|
-
// Any character input clears action state and adds to search
|
|
461
|
-
if (customModelAction) {
|
|
462
|
-
clearActionState();
|
|
463
|
-
}
|
|
464
|
-
// Backspace
|
|
465
|
-
if (key.backspace || key.delete) {
|
|
466
|
-
setSearchQuery((prev) => prev.slice(0, -1));
|
|
467
|
-
return true;
|
|
468
|
-
}
|
|
469
|
-
// Regular character - add to search
|
|
470
|
-
if (input.length === 1 && input.charCodeAt(0) >= 32) {
|
|
471
|
-
setSearchQuery((prev) => prev + input);
|
|
472
|
-
setSelectedIndex(0);
|
|
473
|
-
setScrollOffset(0);
|
|
474
|
-
return true;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
// Backspace when no other input
|
|
478
|
-
if (key.backspace || key.delete) {
|
|
479
|
-
setSearchQuery((prev) => prev.slice(0, -1));
|
|
480
|
-
return true;
|
|
481
|
-
}
|
|
482
|
-
if (itemsLength === 0)
|
|
483
|
-
return false;
|
|
484
|
-
if (key.upArrow) {
|
|
485
|
-
// Clear action state on vertical navigation
|
|
486
|
-
if (customModelAction) {
|
|
487
|
-
clearActionState();
|
|
488
|
-
}
|
|
489
|
-
const nextIndex = (selectedIndexRef.current - 1 + itemsLength) % itemsLength;
|
|
490
|
-
setSelectedIndex(nextIndex);
|
|
491
|
-
selectedIndexRef.current = nextIndex;
|
|
492
|
-
return true;
|
|
493
|
-
}
|
|
494
|
-
if (key.downArrow) {
|
|
495
|
-
// Clear action state on vertical navigation
|
|
496
|
-
if (customModelAction) {
|
|
497
|
-
clearActionState();
|
|
498
|
-
}
|
|
499
|
-
const nextIndex = (selectedIndexRef.current + 1) % itemsLength;
|
|
500
|
-
setSelectedIndex(nextIndex);
|
|
501
|
-
selectedIndexRef.current = nextIndex;
|
|
502
|
-
return true;
|
|
503
|
-
}
|
|
504
|
-
if (key.return && itemsLength > 0) {
|
|
505
|
-
const item = filteredItems[selectedIndexRef.current];
|
|
506
|
-
if (item) {
|
|
507
|
-
if (isAddCustomOption(item)) {
|
|
508
|
-
onAddCustomModel();
|
|
509
|
-
return true;
|
|
510
|
-
}
|
|
511
|
-
// Handle action mode confirmations
|
|
512
|
-
if (customModelAction === 'edit' && item.isCustom) {
|
|
513
|
-
// Find the full custom model data
|
|
514
|
-
const customModel = customModels.find((cm) => cm.name === item.name &&
|
|
515
|
-
(cm.provider ?? 'openai-compatible') === item.provider);
|
|
516
|
-
if (customModel) {
|
|
517
|
-
onEditCustomModel(customModel);
|
|
518
|
-
}
|
|
519
|
-
return true;
|
|
520
|
-
}
|
|
521
|
-
if (customModelAction === 'default') {
|
|
522
|
-
// Check if reasoning-capable, show reasoning effort selection
|
|
523
|
-
if (isReasoningCapableModel(item.name)) {
|
|
524
|
-
setPendingReasoningModel(item);
|
|
525
|
-
setIsSettingDefault(true);
|
|
526
|
-
setReasoningEffortIndex(0); // Default to 'Auto'
|
|
527
|
-
return true;
|
|
528
|
-
}
|
|
529
|
-
clearActionState();
|
|
530
|
-
void (async () => {
|
|
531
|
-
await onSetDefaultModel(item.provider, item.name, item.displayName, item.baseURL, item.reasoningEffort);
|
|
532
|
-
setRefreshVersion((prev) => prev + 1);
|
|
533
|
-
onClose(); // Close overlay after setting default
|
|
534
|
-
})();
|
|
535
|
-
return true;
|
|
536
|
-
}
|
|
537
|
-
if (customModelAction === 'delete' && item.isCustom) {
|
|
538
|
-
if (pendingDeleteConfirm) {
|
|
539
|
-
// Already confirmed, delete
|
|
540
|
-
clearActionState();
|
|
541
|
-
void handleDeleteCustomModel(item);
|
|
542
|
-
}
|
|
543
|
-
else {
|
|
544
|
-
// Set pending confirmation
|
|
545
|
-
setPendingDeleteConfirm(true);
|
|
546
|
-
if (deleteTimeoutRef.current) {
|
|
547
|
-
clearTimeout(deleteTimeoutRef.current);
|
|
548
|
-
}
|
|
549
|
-
deleteTimeoutRef.current = setTimeout(() => {
|
|
550
|
-
setPendingDeleteConfirm(false);
|
|
551
|
-
deleteTimeoutRef.current = null;
|
|
552
|
-
}, 3000);
|
|
553
|
-
}
|
|
554
|
-
return true;
|
|
555
|
-
}
|
|
556
|
-
// Normal selection - check if reasoning-capable
|
|
557
|
-
if (isReasoningCapableModel(item.name)) {
|
|
558
|
-
// Show reasoning effort sub-step
|
|
559
|
-
setPendingReasoningModel(item);
|
|
560
|
-
setReasoningEffortIndex(0); // Default to 'Auto'
|
|
561
|
-
return true;
|
|
562
|
-
}
|
|
563
|
-
onSelectModel(item.provider, item.name, item.displayName, item.baseURL);
|
|
564
|
-
return true;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
return false;
|
|
568
|
-
},
|
|
569
|
-
}), [
|
|
570
|
-
isVisible,
|
|
571
|
-
filteredItems,
|
|
572
|
-
onClose,
|
|
573
|
-
onSelectModel,
|
|
574
|
-
onSetDefaultModel,
|
|
575
|
-
onAddCustomModel,
|
|
576
|
-
onEditCustomModel,
|
|
577
|
-
customModelAction,
|
|
578
|
-
pendingDeleteConfirm,
|
|
579
|
-
customModels,
|
|
580
|
-
handleDeleteCustomModel,
|
|
581
|
-
pendingReasoningModel,
|
|
582
|
-
reasoningEffortIndex,
|
|
583
|
-
isSettingDefault,
|
|
584
|
-
]);
|
|
585
|
-
if (!isVisible)
|
|
586
|
-
return null;
|
|
587
|
-
if (isLoading) {
|
|
588
|
-
return (_jsx(Box, { paddingX: 0, paddingY: 0, children: _jsx(Text, { color: "gray", children: "Loading models..." }) }));
|
|
589
|
-
}
|
|
590
|
-
// Reasoning effort sub-step UI
|
|
591
|
-
if (pendingReasoningModel) {
|
|
592
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { paddingX: 0, paddingY: 0, children: _jsxs(Text, { color: "cyan", bold: true, children: ["Configure Reasoning Effort", isSettingDefault && _jsx(Text, { color: "gray", children: " (Setting as Default)" })] }) }), _jsx(Box, { paddingX: 0, paddingY: 0, children: _jsxs(Text, { color: "gray", children: ["for ", pendingReasoningModel.displayName || pendingReasoningModel.name] }) }), _jsx(Box, { paddingX: 0, paddingY: 0, children: _jsx(Text, { color: "gray", children: "\u2191\u2193 navigate, Enter select, Esc back" }) }), _jsx(Box, { paddingX: 0, paddingY: 0, children: _jsx(Text, { color: "gray", children: '─'.repeat(50) }) }), REASONING_EFFORT_OPTIONS.map((option, index) => {
|
|
593
|
-
const isSelected = index === reasoningEffortIndex;
|
|
594
|
-
return (_jsxs(Box, { paddingX: 0, paddingY: 0, children: [_jsxs(Text, { color: isSelected ? 'cyan' : 'gray', bold: isSelected, children: [isSelected ? '› ' : ' ', option.label] }), _jsxs(Text, { color: isSelected ? 'white' : 'gray', children: [' ', "- ", option.description] })] }, option.value));
|
|
595
|
-
})] }));
|
|
596
|
-
}
|
|
597
|
-
const visibleItems = filteredItems.slice(scrollOffset, scrollOffset + MAX_VISIBLE_ITEMS);
|
|
598
|
-
const hasCustomModels = customModels.length > 0;
|
|
599
|
-
const hasActionableItems = filteredItems.some((item) => !isAddCustomOption(item));
|
|
600
|
-
const selectedItem = filteredItems[selectedIndex];
|
|
601
|
-
const isSelectedCustom = selectedItem && !isAddCustomOption(selectedItem) && selectedItem.isCustom;
|
|
602
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { paddingX: 0, paddingY: 0, children: _jsxs(Text, { color: "cyan", bold: true, children: ["Select Model (", selectedIndex + 1, "/", filteredItems.length, ")"] }) }), _jsxs(Box, { paddingX: 0, paddingY: 0, children: [_jsx(Text, { color: "gray", children: "\u2191\u2193 navigate, Enter select, Esc close" }), hasActionableItems && _jsx(Text, { color: "gray", children: ", \u2192\u2190 for actions" })] }), _jsxs(Box, { paddingX: 0, paddingY: 0, children: [_jsx(Text, { color: "gray", children: "\uD83D\uDD0D " }), _jsx(Text, { color: searchQuery ? 'white' : 'gray', children: searchQuery || 'Type to search...' }), _jsx(Text, { color: "cyan", children: "\u258C" })] }), _jsx(Box, { paddingX: 0, paddingY: 0, children: _jsx(Text, { color: "gray", children: '─'.repeat(50) }) }), visibleItems.map((item, visibleIndex) => {
|
|
603
|
-
const actualIndex = scrollOffset + visibleIndex;
|
|
604
|
-
const isSelected = actualIndex === selectedIndex;
|
|
605
|
-
if (isAddCustomOption(item)) {
|
|
606
|
-
return (_jsx(Box, { paddingX: 0, paddingY: 0, children: _jsx(Text, { color: isSelected ? 'green' : 'gray', bold: isSelected, children: "\u2795 Add custom model..." }) }, "add-custom"));
|
|
607
|
-
}
|
|
608
|
-
// Show action buttons for selected custom models
|
|
609
|
-
const showActions = isSelected && !isAddCustomOption(item);
|
|
610
|
-
// Keep the UI label simple: show the actual provider being selected.
|
|
611
|
-
// Gateway routing details are intentionally hidden from the main picker.
|
|
612
|
-
const providerDisplay = getLLMProviderDisplayName(item.provider);
|
|
613
|
-
return (_jsxs(Box, { paddingX: 0, paddingY: 0, children: [item.isCustom && _jsx(Text, { color: isSelected ? 'orange' : 'gray', children: "\u2605 " }), _jsx(Text, { color: isSelected ? 'cyan' : 'gray', bold: isSelected, children: item.displayName || item.name }), _jsxs(Text, { color: isSelected ? 'white' : 'gray', children: [" (", providerDisplay, ")"] }), _jsxs(Text, { color: isSelected ? 'white' : 'gray', children: [' ', "\u2022 ", item.maxInputTokens.toLocaleString(), " tokens"] }), item.isDefault && (_jsx(Text, { color: isSelected ? 'white' : 'gray', children: " [DEFAULT]" })), item.isCurrent && !showActions && (_jsxs(Text, { color: isSelected ? 'cyan' : 'gray', bold: isSelected, children: [' ', "\u2190 Current"] })), showActions && (_jsxs(_Fragment, { children: [item.isCustom && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsxs(Text, { color: customModelAction === 'edit' ? 'green' : 'gray', bold: customModelAction === 'edit', inverse: customModelAction === 'edit', children: [' ', "Edit", ' '] })] })), _jsx(Text, { children: " " }), _jsxs(Text, { color: customModelAction === 'default' ? 'cyan' : 'gray', bold: customModelAction === 'default', inverse: customModelAction === 'default', children: [' ', "Set as Default", ' '] }), item.isCustom && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsxs(Text, { color: customModelAction === 'delete' ? 'red' : 'gray', bold: customModelAction === 'delete', inverse: customModelAction === 'delete', children: [' ', "Delete", ' '] })] }))] }))] }, `${item.provider}-${item.name}-${item.isCustom ? 'custom' : 'registry'}`));
|
|
614
|
-
}), filteredItems.length > MAX_VISIBLE_ITEMS && (_jsx(Box, { paddingX: 0, paddingY: 0, children: _jsxs(Text, { color: "gray", wrap: "truncate", children: [scrollOffset > 0 ? '↑ more above' : '', scrollOffset > 0 && scrollOffset + MAX_VISIBLE_ITEMS < filteredItems.length
|
|
615
|
-
? ' • '
|
|
616
|
-
: '', scrollOffset + MAX_VISIBLE_ITEMS < filteredItems.length
|
|
617
|
-
? '↓ more below'
|
|
618
|
-
: ''] }) })), customModelAction === 'delete' && pendingDeleteConfirm && (_jsx(Box, { paddingX: 0, paddingY: 0, marginTop: 1, children: _jsx(Text, { color: "yellowBright", children: "\u26A0\uFE0F Press \u2192 or Enter again to confirm delete" }) })), customModelAction && !pendingDeleteConfirm && (_jsx(Box, { paddingX: 0, paddingY: 0, marginTop: 1, children: _jsxs(Text, { color: "gray", children: ["\u2190", ' ', customModelAction === 'edit'
|
|
619
|
-
? 'deselect'
|
|
620
|
-
: isSelectedCustom
|
|
621
|
-
? 'edit'
|
|
622
|
-
: 'deselect', ' ', "| \u2192", ' ', customModelAction === 'edit'
|
|
623
|
-
? 'default'
|
|
624
|
-
: customModelAction === 'default'
|
|
625
|
-
? isSelectedCustom
|
|
626
|
-
? 'delete'
|
|
627
|
-
: 'confirm'
|
|
628
|
-
: 'confirm', ' ', "| Enter ", customModelAction] }) }))] }));
|
|
629
|
-
});
|
|
630
|
-
export default ModelSelector;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PluginActions Component
|
|
3
|
-
* Clean action menu for a selected plugin
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import type { Key } from '../../hooks/useInputOrchestrator.js';
|
|
7
|
-
import type { ListedPlugin } from '@dexto/agent-management';
|
|
8
|
-
export type PluginActionType = 'uninstall' | 'back';
|
|
9
|
-
export interface PluginActionResult {
|
|
10
|
-
type: PluginActionType;
|
|
11
|
-
plugin: ListedPlugin;
|
|
12
|
-
}
|
|
13
|
-
interface PluginActionsProps {
|
|
14
|
-
isVisible: boolean;
|
|
15
|
-
plugin: ListedPlugin | null;
|
|
16
|
-
onAction: (action: PluginActionResult) => void;
|
|
17
|
-
onClose: () => void;
|
|
18
|
-
}
|
|
19
|
-
export interface PluginActionsHandle {
|
|
20
|
-
handleInput: (input: string, key: Key) => boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Plugin Actions - action menu for a specific plugin
|
|
24
|
-
*/
|
|
25
|
-
declare const PluginActions: React.ForwardRefExoticComponent<PluginActionsProps & React.RefAttributes<PluginActionsHandle>>;
|
|
26
|
-
export default PluginActions;
|
|
27
|
-
//# sourceMappingURL=PluginActions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginActions.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/overlays/PluginActions.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5D,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,MAAM,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,YAAY,CAAC;CACxB;AAED,UAAU,kBAAkB;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAChC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAUD;;GAEG;AACH,QAAA,MAAM,aAAa,gGA+FjB,CAAC;AAEH,eAAe,aAAa,CAAC"}
|