dexto 1.6.1 → 1.6.3
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/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 +142 -39
- 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/cli/utils/scaffolding-utils.d.ts.map +1 -1
- package/dist/cli/utils/scaffolding-utils.js +38 -4
- package/dist/index-main.js +78 -11
- package/dist/index.js +12 -0
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +18 -11
- package/dist/webui/assets/index-d6c-yJNn.js +2059 -0
- package/dist/webui/assets/index-yKdFLN1k.css +1 -0
- package/dist/webui/assets/react-vendor-l0sNRNKZ.js +1 -0
- package/dist/webui/assets/tanstack-BjCuxfF-.js +41 -0
- package/dist/webui/index.html +3 -4
- package/package.json +13 -23
- package/dist/cli/assets/sounds/SOURCES.md +0 -35
- package/dist/cli/assets/sounds/boot.wav +0 -0
- package/dist/cli/assets/sounds/chime.wav +0 -0
- package/dist/cli/assets/sounds/coin.wav +0 -0
- package/dist/cli/assets/sounds/confirm.wav +0 -0
- package/dist/cli/assets/sounds/levelup.wav +0 -0
- package/dist/cli/assets/sounds/ping.wav +0 -0
- package/dist/cli/assets/sounds/powerup.wav +0 -0
- package/dist/cli/assets/sounds/startup.wav +0 -0
- package/dist/cli/assets/sounds/success.wav +0 -0
- package/dist/cli/assets/sounds/treasure.wav +0 -0
- package/dist/cli/assets/sounds/win.wav +0 -0
- 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/exit-handler.d.ts +0 -12
- package/dist/cli/commands/interactive-commands/exit-handler.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/exit-handler.js +0 -20
- package/dist/cli/commands/interactive-commands/exit-stats.d.ts +0 -24
- package/dist/cli/commands/interactive-commands/exit-stats.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/exit-stats.js +0 -17
- 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 -508
- 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 -284
- 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 -65
- 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 -6
- 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 -188
- 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 -231
- 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 -323
- 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 -24
- package/dist/cli/ink-cli/components/ElicitationForm.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/ElicitationForm.js +0 -592
- 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 -385
- 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 -412
- 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 -116
- 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 -37
- package/dist/cli/ink-cli/components/base/BaseSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/base/BaseSelector.js +0 -128
- 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 -182
- 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 -36
- 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 -182
- 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 -114
- 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/CommandOutputOverlay.d.ts +0 -13
- package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.js +0 -60
- 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 -743
- 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 -143
- 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/SoundsSelector.d.ts +0 -21
- package/dist/cli/ink-cli/components/overlays/SoundsSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/SoundsSelector.js +0 -566
- 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 -697
- 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 -604
- 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 -67
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts +0 -21
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/FileRenderer.js +0 -37
- 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 -15
- 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/FocusOverlayFrame.d.ts +0 -7
- package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.js +0 -8
- package/dist/cli/ink-cli/components/shared/HintBar.d.ts +0 -6
- package/dist/cli/ink-cli/components/shared/HintBar.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/shared/HintBar.js +0 -6
- 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/spinnerFrames.d.ts +0 -2
- package/dist/cli/ink-cli/constants/spinnerFrames.d.ts.map +0 -1
- package/dist/cli/ink-cli/constants/spinnerFrames.js +0 -1
- 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 -58
- 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 -643
- 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 -1840
- 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/useAnimationTick.d.ts +0 -11
- package/dist/cli/ink-cli/hooks/useAnimationTick.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useAnimationTick.js +0 -54
- 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 -224
- 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 -951
- 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 -58
- 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 -378
- 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 -85
- 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/elicitationSchema.d.ts +0 -11
- package/dist/cli/ink-cli/utils/elicitationSchema.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/elicitationSchema.js +0 -80
- 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 -125
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/messageFormatting.js +0 -485
- 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/overlayPresentation.d.ts +0 -19
- package/dist/cli/ink-cli/utils/overlayPresentation.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/overlayPresentation.js +0 -33
- package/dist/cli/ink-cli/utils/overlaySizing.d.ts +0 -19
- package/dist/cli/ink-cli/utils/overlaySizing.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/overlaySizing.js +0 -11
- package/dist/cli/ink-cli/utils/soundNotification.d.ts +0 -77
- package/dist/cli/ink-cli/utils/soundNotification.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/soundNotification.js +0 -226
- 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-CKhumsZA.js +0 -2059
- package/dist/webui/assets/react-vendor-gH-7aFTg.js +0 -17
- package/dist/webui/assets/tanstack-Br79RQ-n.js +0 -25
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* ContextStatsOverlay Component
|
|
4
|
-
* Interactive overlay for viewing context window usage statistics
|
|
5
|
-
* Features:
|
|
6
|
-
* - Stacked colored progress bar showing breakdown
|
|
7
|
-
* - Navigate with arrow keys to highlight items
|
|
8
|
-
* - Press Enter to expand/collapse sections (e.g., Tools)
|
|
9
|
-
*/
|
|
10
|
-
import { useState, useEffect, forwardRef, useImperativeHandle } from 'react';
|
|
11
|
-
import { Box, Text } from 'ink';
|
|
12
|
-
const BREAKDOWN_ITEMS = [
|
|
13
|
-
'systemPrompt',
|
|
14
|
-
'tools',
|
|
15
|
-
'messages',
|
|
16
|
-
'freeSpace',
|
|
17
|
-
'autoCompactBuffer',
|
|
18
|
-
];
|
|
19
|
-
// Colors for each breakdown category
|
|
20
|
-
const ITEM_COLORS = {
|
|
21
|
-
systemPrompt: 'cyan',
|
|
22
|
-
tools: 'yellow',
|
|
23
|
-
messages: 'blue',
|
|
24
|
-
freeSpace: 'gray',
|
|
25
|
-
autoCompactBuffer: 'magenta',
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Format token count for display (e.g., 1500 -> "1.5k")
|
|
29
|
-
*/
|
|
30
|
-
function formatTokens(tokens) {
|
|
31
|
-
if (tokens >= 1000) {
|
|
32
|
-
return `${(tokens / 1000).toFixed(1)}k`;
|
|
33
|
-
}
|
|
34
|
-
return tokens.toLocaleString();
|
|
35
|
-
}
|
|
36
|
-
function createStackedBar(breakdown, maxContextTokens, thresholdPercent, totalWidth = 40) {
|
|
37
|
-
const segments = [];
|
|
38
|
-
// Calculate auto compact buffer (the reserved margin for early compaction)
|
|
39
|
-
// maxContextTokens already has thresholdPercent applied, so derive buffer as:
|
|
40
|
-
// buffer = maxContextTokens * (1 - thresholdPercent) / thresholdPercent
|
|
41
|
-
const autoCompactBuffer = thresholdPercent > 0 && thresholdPercent < 1.0
|
|
42
|
-
? Math.floor((maxContextTokens * (1 - thresholdPercent)) / thresholdPercent)
|
|
43
|
-
: 0;
|
|
44
|
-
// Total space = effective limit + buffer
|
|
45
|
-
const totalTokenSpace = maxContextTokens + autoCompactBuffer;
|
|
46
|
-
// Calculate widths for each segment (proportional to token count)
|
|
47
|
-
const usedTokens = breakdown.systemPrompt + breakdown.tools.total + breakdown.messages;
|
|
48
|
-
const freeTokens = Math.max(0, maxContextTokens - usedTokens);
|
|
49
|
-
// Helper to calculate width (minimum 1 char if tokens > 0, proportional otherwise)
|
|
50
|
-
const getWidth = (tokens) => {
|
|
51
|
-
if (tokens <= 0)
|
|
52
|
-
return 0;
|
|
53
|
-
const proportional = Math.round((tokens / totalTokenSpace) * totalWidth);
|
|
54
|
-
return Math.max(1, proportional);
|
|
55
|
-
};
|
|
56
|
-
// Add used segments
|
|
57
|
-
const sysWidth = getWidth(breakdown.systemPrompt);
|
|
58
|
-
const toolsWidth = getWidth(breakdown.tools.total);
|
|
59
|
-
const msgsWidth = getWidth(breakdown.messages);
|
|
60
|
-
const freeWidth = getWidth(freeTokens);
|
|
61
|
-
const reservedWidth = getWidth(autoCompactBuffer);
|
|
62
|
-
// Adjust to fit total width (take from free space)
|
|
63
|
-
const totalUsed = sysWidth + toolsWidth + msgsWidth + freeWidth + reservedWidth;
|
|
64
|
-
const adjustment = totalUsed - totalWidth;
|
|
65
|
-
// Apply adjustment to free space (it's the most flexible)
|
|
66
|
-
const adjustedFreeWidth = Math.max(0, freeWidth - adjustment);
|
|
67
|
-
if (sysWidth > 0) {
|
|
68
|
-
segments.push({
|
|
69
|
-
char: '█',
|
|
70
|
-
color: ITEM_COLORS.systemPrompt,
|
|
71
|
-
width: sysWidth,
|
|
72
|
-
item: 'systemPrompt',
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
if (toolsWidth > 0) {
|
|
76
|
-
segments.push({ char: '█', color: ITEM_COLORS.tools, width: toolsWidth, item: 'tools' });
|
|
77
|
-
}
|
|
78
|
-
if (msgsWidth > 0) {
|
|
79
|
-
segments.push({
|
|
80
|
-
char: '█',
|
|
81
|
-
color: ITEM_COLORS.messages,
|
|
82
|
-
width: msgsWidth,
|
|
83
|
-
item: 'messages',
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
if (adjustedFreeWidth > 0) {
|
|
87
|
-
segments.push({ char: '░', color: 'gray', width: adjustedFreeWidth, item: 'freeSpace' });
|
|
88
|
-
}
|
|
89
|
-
if (reservedWidth > 0) {
|
|
90
|
-
segments.push({
|
|
91
|
-
char: '▒',
|
|
92
|
-
color: ITEM_COLORS.autoCompactBuffer,
|
|
93
|
-
width: reservedWidth,
|
|
94
|
-
item: 'autoCompactBuffer',
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
return segments;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Context stats overlay with selectable breakdown items
|
|
101
|
-
*/
|
|
102
|
-
const ContextStatsOverlay = forwardRef(function ContextStatsOverlay({ isVisible, onClose, agent, sessionId }, ref) {
|
|
103
|
-
const [stats, setStats] = useState(null);
|
|
104
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
105
|
-
const [error, setError] = useState(null);
|
|
106
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
107
|
-
const [expandedSections, setExpandedSections] = useState(new Set());
|
|
108
|
-
// Fetch stats when overlay becomes visible
|
|
109
|
-
useEffect(() => {
|
|
110
|
-
if (!isVisible) {
|
|
111
|
-
setStats(null);
|
|
112
|
-
setError(null);
|
|
113
|
-
setSelectedIndex(0);
|
|
114
|
-
setExpandedSections(new Set());
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
let cancelled = false;
|
|
118
|
-
setIsLoading(true);
|
|
119
|
-
const fetchStats = async () => {
|
|
120
|
-
try {
|
|
121
|
-
const contextStats = await agent.getContextStats(sessionId);
|
|
122
|
-
if (!cancelled) {
|
|
123
|
-
setStats(contextStats);
|
|
124
|
-
setIsLoading(false);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
catch (err) {
|
|
128
|
-
if (!cancelled) {
|
|
129
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
130
|
-
setIsLoading(false);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
fetchStats();
|
|
135
|
-
return () => {
|
|
136
|
-
cancelled = true;
|
|
137
|
-
};
|
|
138
|
-
}, [isVisible, agent, sessionId]);
|
|
139
|
-
// Handle keyboard input
|
|
140
|
-
useImperativeHandle(ref, () => ({
|
|
141
|
-
handleInput: (_input, key) => {
|
|
142
|
-
if (!isVisible)
|
|
143
|
-
return false;
|
|
144
|
-
// Escape or 'q' to close
|
|
145
|
-
if (key.escape || _input === 'q') {
|
|
146
|
-
onClose();
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
// Arrow keys for navigation
|
|
150
|
-
if (key.upArrow) {
|
|
151
|
-
setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
152
|
-
return true;
|
|
153
|
-
}
|
|
154
|
-
if (key.downArrow) {
|
|
155
|
-
setSelectedIndex((prev) => Math.min(BREAKDOWN_ITEMS.length - 1, prev + 1));
|
|
156
|
-
return true;
|
|
157
|
-
}
|
|
158
|
-
// Enter to expand/collapse
|
|
159
|
-
if (key.return) {
|
|
160
|
-
const item = BREAKDOWN_ITEMS[selectedIndex];
|
|
161
|
-
// Only tools is expandable for now
|
|
162
|
-
if (item === 'tools') {
|
|
163
|
-
setExpandedSections((prev) => {
|
|
164
|
-
const next = new Set(prev);
|
|
165
|
-
if (next.has(item)) {
|
|
166
|
-
next.delete(item);
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
next.add(item);
|
|
170
|
-
}
|
|
171
|
-
return next;
|
|
172
|
-
});
|
|
173
|
-
return true;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return false;
|
|
177
|
-
},
|
|
178
|
-
}), [isVisible, onClose, selectedIndex]);
|
|
179
|
-
if (!isVisible)
|
|
180
|
-
return null;
|
|
181
|
-
// Loading state
|
|
182
|
-
if (isLoading) {
|
|
183
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, children: [_jsx(Text, { color: "cyan", bold: true, children: "\uD83D\uDCCA Context Usage" }), _jsx(Text, { color: "gray", children: "Loading..." })] }));
|
|
184
|
-
}
|
|
185
|
-
// Error state
|
|
186
|
-
if (error) {
|
|
187
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1, children: [_jsx(Text, { color: "red", bold: true, children: "Error" }), _jsx(Text, { color: "gray", children: error }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", dimColor: true, children: "Press Esc to close" }) })] }));
|
|
188
|
-
}
|
|
189
|
-
if (!stats)
|
|
190
|
-
return null;
|
|
191
|
-
// Calculate auto compact buffer early so it's available for pct()
|
|
192
|
-
// maxContextTokens already has thresholdPercent applied, so we need to derive
|
|
193
|
-
// the buffer as: maxContextTokens * (1 - thresholdPercent) / thresholdPercent
|
|
194
|
-
const autoCompactBuffer = stats.thresholdPercent > 0 && stats.thresholdPercent < 1.0
|
|
195
|
-
? Math.floor((stats.maxContextTokens * (1 - stats.thresholdPercent)) /
|
|
196
|
-
stats.thresholdPercent)
|
|
197
|
-
: 0;
|
|
198
|
-
// Total token space = effective limit + buffer (matches the visual bar)
|
|
199
|
-
const totalTokenSpace = stats.maxContextTokens + autoCompactBuffer;
|
|
200
|
-
// Calculate percentage helper (relative to total token space for bar consistency)
|
|
201
|
-
const pct = (tokens) => {
|
|
202
|
-
const percent = totalTokenSpace > 0 ? ((tokens / totalTokenSpace) * 100).toFixed(1) : '0.0';
|
|
203
|
-
return `${percent}%`;
|
|
204
|
-
};
|
|
205
|
-
const usedTokens = stats.estimatedTokens + autoCompactBuffer;
|
|
206
|
-
const tokenDisplay = `~${formatTokens(usedTokens)}`;
|
|
207
|
-
const isToolsExpanded = expandedSections.has('tools');
|
|
208
|
-
// Create stacked bar segments
|
|
209
|
-
// Uses maxContextTokens (effective limit) + autoCompactBuffer as the full bar
|
|
210
|
-
const barSegments = createStackedBar(stats.breakdown, stats.maxContextTokens, stats.thresholdPercent);
|
|
211
|
-
// Helper to render a breakdown row with colored indicator
|
|
212
|
-
const renderRow = (index, item, label, tokens, isLast, expandable) => {
|
|
213
|
-
const isSelected = selectedIndex === index;
|
|
214
|
-
const prefix = isLast ? '└─' : '├─';
|
|
215
|
-
const expandIcon = expandable ? (isToolsExpanded ? '▼' : '▶') : ' ';
|
|
216
|
-
const itemColor = ITEM_COLORS[item];
|
|
217
|
-
// Use different characters for different types
|
|
218
|
-
const indicator = item === 'freeSpace' ? '░' : item === 'autoCompactBuffer' ? '▒' : '█';
|
|
219
|
-
return (_jsxs(Box, { children: [_jsxs(Text, { color: isSelected ? 'white' : 'gray', children: [prefix, " "] }), _jsx(Text, { color: itemColor, bold: isSelected, children: indicator }), _jsxs(Text, { color: isSelected ? 'white' : 'gray', bold: isSelected, children: [' ', expandIcon, " ", label, ": ", formatTokens(tokens), " (", pct(tokens), ")"] }), isSelected && expandable && (_jsxs(Text, { color: "gray", dimColor: true, children: [' ', "(Enter to ", isToolsExpanded ? 'collapse' : 'expand', ")"] }))] }, item));
|
|
220
|
-
};
|
|
221
|
-
// Calculate free space using the actual/estimated tokens
|
|
222
|
-
// maxContextTokens is already the effective limit (with threshold applied)
|
|
223
|
-
const freeTokens = Math.max(0, stats.maxContextTokens - stats.estimatedTokens);
|
|
224
|
-
// Buffer percent for display (autoCompactBuffer already calculated above)
|
|
225
|
-
const bufferPercent = Math.round((1 - stats.thresholdPercent) * 100);
|
|
226
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: "cyan", bold: true, children: "\uD83D\uDCCA Context Usage" }), _jsxs(Text, { color: "gray", children: [" - ", stats.modelDisplayName] })] }), _jsx(Box, { children: barSegments.map((segment, idx) => {
|
|
227
|
-
const isHighlighted = BREAKDOWN_ITEMS[selectedIndex] === segment.item;
|
|
228
|
-
return (_jsx(Text, { color: "white", children: isHighlighted
|
|
229
|
-
? '▼'.repeat(segment.width)
|
|
230
|
-
: ' '.repeat(segment.width) }, idx));
|
|
231
|
-
}) }), _jsx(Box, { children: barSegments.map((segment, idx) => (_jsx(Text, { color: segment.color, children: segment.char.repeat(segment.width) }, idx))) }), _jsxs(Box, { marginBottom: 1, children: [_jsxs(Text, { color: "gray", children: [tokenDisplay, " / ", formatTokens(totalTokenSpace), " tokens"] }), _jsx(Text, { color: "gray", children: " \u2022 " }), _jsxs(Text, { color: stats.usagePercent > 80
|
|
232
|
-
? 'red'
|
|
233
|
-
: stats.usagePercent > 60
|
|
234
|
-
? 'yellow'
|
|
235
|
-
: 'green', children: [stats.usagePercent, "% used"] })] }), _jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "white", children: "Breakdown:" }), renderRow(0, 'systemPrompt', 'System prompt', stats.breakdown.systemPrompt, false), renderRow(1, 'tools', `Tools (${stats.breakdown.tools.perTool.length})`, stats.breakdown.tools.total, false, true), isToolsExpanded && (_jsx(Box, { flexDirection: "column", marginLeft: 4, children: stats.breakdown.tools.perTool.length === 0 ? (_jsx(Text, { color: "gray", dimColor: true, children: "No tools registered" })) : ([...stats.breakdown.tools.perTool]
|
|
236
|
-
.sort((a, b) => b.tokens - a.tokens)
|
|
237
|
-
.map((tool, idx, arr) => (_jsxs(Text, { color: "gray", dimColor: true, children: [idx === arr.length - 1 ? '└─' : '├─', ' ', _jsx(Text, { color: "yellow", dimColor: true, children: tool.name }), ": ", formatTokens(tool.tokens), " (", pct(tool.tokens), ")"] }, tool.name)))) })), renderRow(2, 'messages', 'Messages', stats.breakdown.messages, false), renderRow(3, 'freeSpace', 'Free space', freeTokens, false), renderRow(4, 'autoCompactBuffer', bufferPercent > 0
|
|
238
|
-
? `Auto compact buffer (${bufferPercent}%)`
|
|
239
|
-
: 'Auto compact buffer', autoCompactBuffer, true)] }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Text, { color: "gray", children: ["Messages: ", stats.filteredMessageCount, " visible (", stats.messageCount, " total)"] }), stats.prunedToolCount > 0 && (_jsxs(Text, { color: "yellow", children: ["\uD83D\uDDD1\uFE0F ", stats.prunedToolCount, " tool output(s) pruned"] })), stats.hasSummary && (_jsx(Text, { color: "blue", children: "\uD83D\uDCE6 Context has been compacted (summary present)" })), stats.usagePercent > 100 && (_jsx(Text, { color: "yellow", children: "\uD83D\uDCA1 Use /compact to manually compact, or send a message to trigger auto-compaction" }))] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", dimColor: true, children: "\u2191\u2193: navigate | Enter: expand/collapse | Esc: close" }) })] }));
|
|
240
|
-
});
|
|
241
|
-
export default ContextStatsOverlay;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CustomModelWizard Component
|
|
3
|
-
* Multi-step wizard for adding custom models (openai-compatible, openrouter, litellm, glama, bedrock)
|
|
4
|
-
*
|
|
5
|
-
* Architecture:
|
|
6
|
-
* - Provider configs centralized in ./custom-model-wizard/provider-config.ts
|
|
7
|
-
* - Shared UI components in ./custom-model-wizard/shared/
|
|
8
|
-
* - This file is the orchestrator - handles state, navigation, and keyboard input
|
|
9
|
-
*/
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import type { Key } from '../../hooks/useInputOrchestrator.js';
|
|
12
|
-
import { type CustomModel } from '@dexto/agent-management';
|
|
13
|
-
interface CustomModelWizardProps {
|
|
14
|
-
isVisible: boolean;
|
|
15
|
-
onComplete: (model: CustomModel) => void;
|
|
16
|
-
onClose: () => void;
|
|
17
|
-
/** Optional model to edit - if provided, form will be pre-populated */
|
|
18
|
-
initialModel?: CustomModel | null;
|
|
19
|
-
}
|
|
20
|
-
export interface CustomModelWizardHandle {
|
|
21
|
-
handleInput: (input: string, key: Key) => boolean;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Multi-step wizard for custom model configuration.
|
|
25
|
-
* Uses data-driven provider configs instead of scattered conditionals.
|
|
26
|
-
*/
|
|
27
|
-
declare const CustomModelWizard: React.ForwardRefExoticComponent<CustomModelWizardProps & React.RefAttributes<CustomModelWizardHandle>>;
|
|
28
|
-
export default CustomModelWizard;
|
|
29
|
-
//# sourceMappingURL=CustomModelWizard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomModelWizard.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/overlays/CustomModelWizard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAGH,KAAK,WAAW,EAMnB,MAAM,yBAAyB,CAAC;AAoBjC,UAAU,sBAAsB;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,uEAAuE;IACvE,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,uBAAuB;IACpC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED;;;GAGG;AACH,QAAA,MAAM,iBAAiB,wGA4YtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* CustomModelWizard Component
|
|
4
|
-
* Multi-step wizard for adding custom models (openai-compatible, openrouter, litellm, glama, bedrock)
|
|
5
|
-
*
|
|
6
|
-
* Architecture:
|
|
7
|
-
* - Provider configs centralized in ./custom-model-wizard/provider-config.ts
|
|
8
|
-
* - Shared UI components in ./custom-model-wizard/shared/
|
|
9
|
-
* - This file is the orchestrator - handles state, navigation, and keyboard input
|
|
10
|
-
*/
|
|
11
|
-
import { useState, useEffect, forwardRef, useImperativeHandle, useCallback, useRef, } from 'react';
|
|
12
|
-
import { Box, Text } from 'ink';
|
|
13
|
-
import { saveCustomModel, deleteCustomModel, saveProviderApiKey, getProviderKeyStatus, resolveApiKeyForProvider, determineApiKeyStorage, } from '@dexto/agent-management';
|
|
14
|
-
import { logger } from '@dexto/core';
|
|
15
|
-
// Import from new modular architecture
|
|
16
|
-
import { getProviderConfig, getAvailableProviders, getProviderByMenuIndex, runAsyncValidation, } from './custom-model-wizard/provider-config.js';
|
|
17
|
-
import { ProviderSelector, WizardStepInput, SetupInfoBanner, ApiKeyStep, } from './custom-model-wizard/shared/index.js';
|
|
18
|
-
import LocalModelWizard from './custom-model-wizard/LocalModelWizard.js';
|
|
19
|
-
/**
|
|
20
|
-
* Multi-step wizard for custom model configuration.
|
|
21
|
-
* Uses data-driven provider configs instead of scattered conditionals.
|
|
22
|
-
*/
|
|
23
|
-
const CustomModelWizard = forwardRef(function CustomModelWizard({ isVisible, onComplete, onClose, initialModel }, ref) {
|
|
24
|
-
// Provider selection (step 0) then wizard steps
|
|
25
|
-
const [selectedProvider, setSelectedProvider] = useState(null);
|
|
26
|
-
const [providerIndex, setProviderIndex] = useState(0);
|
|
27
|
-
const [currentStep, setCurrentStep] = useState(0);
|
|
28
|
-
const [values, setValues] = useState({});
|
|
29
|
-
const [currentInput, setCurrentInput] = useState('');
|
|
30
|
-
const [error, setError] = useState(null);
|
|
31
|
-
const [isSaving, setIsSaving] = useState(false);
|
|
32
|
-
const [isValidating, setIsValidating] = useState(false);
|
|
33
|
-
// Track original name when editing (to handle renames)
|
|
34
|
-
const [originalName, setOriginalName] = useState(null);
|
|
35
|
-
const isEditing = initialModel !== null && initialModel !== undefined;
|
|
36
|
-
// Ref for LocalModelWizard (specialized wizard for 'local' provider)
|
|
37
|
-
const localModelWizardRef = useRef(null);
|
|
38
|
-
// Get provider config (data-driven, no conditionals)
|
|
39
|
-
const providerConfig = selectedProvider ? getProviderConfig(selectedProvider) : null;
|
|
40
|
-
const allWizardSteps = providerConfig?.steps ?? [];
|
|
41
|
-
/**
|
|
42
|
-
* Get visible steps based on current values.
|
|
43
|
-
* Steps with a condition function are only shown if the condition returns true.
|
|
44
|
-
*/
|
|
45
|
-
const getVisibleSteps = useCallback((currentValues) => {
|
|
46
|
-
return allWizardSteps.filter((step) => !step.condition || step.condition(currentValues));
|
|
47
|
-
}, [allWizardSteps]);
|
|
48
|
-
// Current visible steps based on accumulated values
|
|
49
|
-
const visibleSteps = getVisibleSteps(values);
|
|
50
|
-
const currentStepConfig = visibleSteps[currentStep];
|
|
51
|
-
// Reset when becoming visible
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
if (isVisible) {
|
|
54
|
-
if (initialModel) {
|
|
55
|
-
// Editing mode - pre-populate from initialModel
|
|
56
|
-
const provider = initialModel.provider ?? 'openai-compatible';
|
|
57
|
-
const providers = getAvailableProviders();
|
|
58
|
-
setSelectedProvider(provider);
|
|
59
|
-
setOriginalName(initialModel.name);
|
|
60
|
-
setValues({
|
|
61
|
-
name: initialModel.name,
|
|
62
|
-
baseURL: initialModel.baseURL ?? '',
|
|
63
|
-
displayName: initialModel.displayName ?? '',
|
|
64
|
-
maxInputTokens: initialModel.maxInputTokens?.toString() ?? '',
|
|
65
|
-
reasoningEffort: initialModel.reasoningEffort ?? '',
|
|
66
|
-
apiKey: initialModel.apiKey ?? '',
|
|
67
|
-
filePath: initialModel.filePath ?? '',
|
|
68
|
-
});
|
|
69
|
-
setCurrentStep(0);
|
|
70
|
-
setCurrentInput(initialModel.name);
|
|
71
|
-
const idx = providers.indexOf(provider);
|
|
72
|
-
setProviderIndex(idx >= 0 ? idx : 0);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
// Adding mode - reset everything
|
|
76
|
-
setSelectedProvider(null);
|
|
77
|
-
setOriginalName(null);
|
|
78
|
-
setProviderIndex(0);
|
|
79
|
-
setCurrentStep(0);
|
|
80
|
-
setValues({});
|
|
81
|
-
setCurrentInput('');
|
|
82
|
-
}
|
|
83
|
-
setError(null);
|
|
84
|
-
setIsSaving(false);
|
|
85
|
-
setIsValidating(false);
|
|
86
|
-
}
|
|
87
|
-
}, [isVisible, initialModel]);
|
|
88
|
-
const handleProviderSelect = useCallback(() => {
|
|
89
|
-
const provider = getProviderByMenuIndex(providerIndex);
|
|
90
|
-
if (provider) {
|
|
91
|
-
setSelectedProvider(provider);
|
|
92
|
-
setCurrentStep(0);
|
|
93
|
-
setCurrentInput('');
|
|
94
|
-
setError(null);
|
|
95
|
-
}
|
|
96
|
-
}, [providerIndex]);
|
|
97
|
-
const handleNext = useCallback(async () => {
|
|
98
|
-
if (!currentStepConfig || !selectedProvider || isSaving || isValidating)
|
|
99
|
-
return;
|
|
100
|
-
const value = currentInput.trim();
|
|
101
|
-
// Sync validation
|
|
102
|
-
if (currentStepConfig.validate) {
|
|
103
|
-
const validationError = currentStepConfig.validate(value);
|
|
104
|
-
if (validationError) {
|
|
105
|
-
setError(validationError);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
else if (currentStepConfig.required && !value) {
|
|
110
|
-
setError(`${currentStepConfig.label} is required`);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
// Async validation (data-driven - no provider-specific conditionals)
|
|
114
|
-
const asyncError = await (async () => {
|
|
115
|
-
setIsValidating(true);
|
|
116
|
-
setError(null);
|
|
117
|
-
try {
|
|
118
|
-
return await runAsyncValidation(selectedProvider, currentStepConfig.field, value);
|
|
119
|
-
}
|
|
120
|
-
finally {
|
|
121
|
-
setIsValidating(false);
|
|
122
|
-
}
|
|
123
|
-
})();
|
|
124
|
-
if (asyncError) {
|
|
125
|
-
setError(asyncError);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
// Save value
|
|
129
|
-
const newValues = { ...values, [currentStepConfig.field]: value };
|
|
130
|
-
setValues(newValues);
|
|
131
|
-
setError(null);
|
|
132
|
-
setCurrentInput('');
|
|
133
|
-
// Get updated visible steps with new values
|
|
134
|
-
const updatedVisibleSteps = getVisibleSteps(newValues);
|
|
135
|
-
// Check if we're done
|
|
136
|
-
if (currentStep >= updatedVisibleSteps.length - 1) {
|
|
137
|
-
await saveModel(newValues);
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
const nextStep = currentStep + 1;
|
|
141
|
-
setCurrentStep(nextStep);
|
|
142
|
-
// Pre-populate next step from stored values (for edit mode)
|
|
143
|
-
const nextStepConfig = updatedVisibleSteps[nextStep];
|
|
144
|
-
const nextValue = nextStepConfig ? newValues[nextStepConfig.field] : undefined;
|
|
145
|
-
setCurrentInput(nextValue ?? '');
|
|
146
|
-
}
|
|
147
|
-
}, [
|
|
148
|
-
currentInput,
|
|
149
|
-
currentStep,
|
|
150
|
-
currentStepConfig,
|
|
151
|
-
getVisibleSteps,
|
|
152
|
-
isSaving,
|
|
153
|
-
isValidating,
|
|
154
|
-
selectedProvider,
|
|
155
|
-
values,
|
|
156
|
-
]);
|
|
157
|
-
/**
|
|
158
|
-
* Build and save the model using provider config's buildModel function.
|
|
159
|
-
*/
|
|
160
|
-
const saveModel = useCallback(async (finalValues) => {
|
|
161
|
-
if (!selectedProvider || !providerConfig)
|
|
162
|
-
return;
|
|
163
|
-
// Build model using provider config (no conditionals!)
|
|
164
|
-
const model = providerConfig.buildModel(finalValues, selectedProvider);
|
|
165
|
-
// Handle API key storage
|
|
166
|
-
const userEnteredKey = finalValues.apiKey?.trim();
|
|
167
|
-
const providerKeyStatus = getProviderKeyStatus(selectedProvider);
|
|
168
|
-
const existingProviderKey = resolveApiKeyForProvider(selectedProvider);
|
|
169
|
-
const keyStorage = determineApiKeyStorage(selectedProvider, userEnteredKey, providerKeyStatus.hasApiKey, existingProviderKey);
|
|
170
|
-
if (keyStorage.saveToProviderEnvVar && userEnteredKey) {
|
|
171
|
-
try {
|
|
172
|
-
await saveProviderApiKey(selectedProvider, userEnteredKey, process.cwd());
|
|
173
|
-
}
|
|
174
|
-
catch (err) {
|
|
175
|
-
logger.warn(`Failed to save provider API key: ${err instanceof Error ? err.message : 'Unknown error'}`);
|
|
176
|
-
// Fall back to per-model storage
|
|
177
|
-
keyStorage.saveAsPerModel = true;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
if (keyStorage.saveAsPerModel && userEnteredKey) {
|
|
181
|
-
model.apiKey = userEnteredKey;
|
|
182
|
-
}
|
|
183
|
-
// Save to storage
|
|
184
|
-
setIsSaving(true);
|
|
185
|
-
try {
|
|
186
|
-
// If editing and name changed, delete the old model first
|
|
187
|
-
if (originalName && originalName !== model.name) {
|
|
188
|
-
try {
|
|
189
|
-
await deleteCustomModel(originalName);
|
|
190
|
-
}
|
|
191
|
-
catch (err) {
|
|
192
|
-
// Log but continue - old model might already be deleted
|
|
193
|
-
logger.warn(`Failed to delete old model "${originalName}" during rename: ${err instanceof Error ? err.message : String(err)}`);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
await saveCustomModel(model);
|
|
197
|
-
onComplete(model);
|
|
198
|
-
}
|
|
199
|
-
catch (err) {
|
|
200
|
-
logger.error(`Failed to save custom model: ${err instanceof Error ? err.message : 'Unknown error'}`);
|
|
201
|
-
setError(`Failed to save: ${err instanceof Error ? err.message : 'Unknown error'}`);
|
|
202
|
-
setIsSaving(false);
|
|
203
|
-
}
|
|
204
|
-
}, [selectedProvider, providerConfig, originalName, onComplete]);
|
|
205
|
-
const handleBack = useCallback(() => {
|
|
206
|
-
if (currentStep > 0) {
|
|
207
|
-
setCurrentStep(currentStep - 1);
|
|
208
|
-
// Restore previous value
|
|
209
|
-
const prevStep = visibleSteps[currentStep - 1];
|
|
210
|
-
if (prevStep) {
|
|
211
|
-
setCurrentInput(values[prevStep.field] || '');
|
|
212
|
-
}
|
|
213
|
-
setError(null);
|
|
214
|
-
}
|
|
215
|
-
else if (selectedProvider) {
|
|
216
|
-
// Go back to provider selection
|
|
217
|
-
setSelectedProvider(null);
|
|
218
|
-
setError(null);
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
onClose();
|
|
222
|
-
}
|
|
223
|
-
}, [currentStep, onClose, selectedProvider, values, visibleSteps]);
|
|
224
|
-
// Handle keyboard input
|
|
225
|
-
useImperativeHandle(ref, () => ({
|
|
226
|
-
handleInput: (input, key) => {
|
|
227
|
-
if (!isVisible || isSaving || isValidating)
|
|
228
|
-
return false;
|
|
229
|
-
// Delegate to LocalModelWizard when local provider is selected
|
|
230
|
-
if (selectedProvider === 'local' && localModelWizardRef.current) {
|
|
231
|
-
return localModelWizardRef.current.handleInput(input, key);
|
|
232
|
-
}
|
|
233
|
-
// Escape to go back/close
|
|
234
|
-
if (key.escape) {
|
|
235
|
-
handleBack();
|
|
236
|
-
return true;
|
|
237
|
-
}
|
|
238
|
-
// Provider selection mode
|
|
239
|
-
if (!selectedProvider) {
|
|
240
|
-
const providers = getAvailableProviders();
|
|
241
|
-
if (key.upArrow) {
|
|
242
|
-
setProviderIndex((prev) => prev > 0 ? prev - 1 : providers.length - 1);
|
|
243
|
-
return true;
|
|
244
|
-
}
|
|
245
|
-
if (key.downArrow) {
|
|
246
|
-
setProviderIndex((prev) => prev < providers.length - 1 ? prev + 1 : 0);
|
|
247
|
-
return true;
|
|
248
|
-
}
|
|
249
|
-
if (key.return) {
|
|
250
|
-
handleProviderSelect();
|
|
251
|
-
return true;
|
|
252
|
-
}
|
|
253
|
-
return true; // Consume all input during provider selection
|
|
254
|
-
}
|
|
255
|
-
// Wizard step mode
|
|
256
|
-
if (key.return) {
|
|
257
|
-
void handleNext();
|
|
258
|
-
return true;
|
|
259
|
-
}
|
|
260
|
-
// Backspace
|
|
261
|
-
if (key.backspace || key.delete) {
|
|
262
|
-
setCurrentInput((prev) => prev.slice(0, -1));
|
|
263
|
-
setError(null);
|
|
264
|
-
return true;
|
|
265
|
-
}
|
|
266
|
-
// Regular character input
|
|
267
|
-
if (input && !key.ctrl && !key.meta) {
|
|
268
|
-
setCurrentInput((prev) => prev + input);
|
|
269
|
-
setError(null);
|
|
270
|
-
return true;
|
|
271
|
-
}
|
|
272
|
-
return false;
|
|
273
|
-
},
|
|
274
|
-
}), [
|
|
275
|
-
isVisible,
|
|
276
|
-
isSaving,
|
|
277
|
-
isValidating,
|
|
278
|
-
handleBack,
|
|
279
|
-
handleNext,
|
|
280
|
-
handleProviderSelect,
|
|
281
|
-
selectedProvider,
|
|
282
|
-
]);
|
|
283
|
-
if (!isVisible)
|
|
284
|
-
return null;
|
|
285
|
-
// Provider selection screen (using shared component)
|
|
286
|
-
if (!selectedProvider) {
|
|
287
|
-
return _jsx(ProviderSelector, { selectedIndex: providerIndex, isEditing: isEditing });
|
|
288
|
-
}
|
|
289
|
-
// Local provider uses specialized wizard with download support
|
|
290
|
-
if (selectedProvider === 'local') {
|
|
291
|
-
return (_jsx(LocalModelWizard, { ref: localModelWizardRef, isVisible: isVisible, onComplete: onComplete, onClose: () => {
|
|
292
|
-
// Go back to provider selection instead of closing completely
|
|
293
|
-
setSelectedProvider(null);
|
|
294
|
-
} }));
|
|
295
|
-
}
|
|
296
|
-
// Wizard steps screen for other providers
|
|
297
|
-
if (!currentStepConfig || !providerConfig)
|
|
298
|
-
return null;
|
|
299
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "green", paddingX: 1, marginTop: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { bold: true, color: "green", children: isEditing ? 'Edit Custom Model' : 'Add Custom Model' }), _jsxs(Text, { color: "gray", children: [' ', "(", providerConfig.displayName, ") Step ", currentStep + 1, "/", visibleSteps.length] })] }), providerConfig.setupInfo && currentStep === 0 && (_jsx(SetupInfoBanner, { title: providerConfig.setupInfo.title, description: providerConfig.setupInfo.description, docsUrl: providerConfig.setupInfo.docsUrl })), _jsx(WizardStepInput, { step: currentStepConfig, currentInput: currentInput, error: error, isValidating: isValidating, isSaving: isSaving, additionalContent: currentStepConfig.field === 'apiKey' ? (_jsx(ApiKeyStep, { provider: selectedProvider })) : undefined }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: "gray", children: ["Enter to continue \u2022 Esc to", ' ', currentStep > 0 ? 'go back' : 'back to provider'] }) })] }));
|
|
300
|
-
});
|
|
301
|
-
export default CustomModelWizard;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ExportWizard Component
|
|
3
|
-
* Interactive wizard for exporting conversation to markdown or JSON
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import type { Key } from '../../hooks/useInputOrchestrator.js';
|
|
7
|
-
import type { DextoAgent } from '@dexto/core';
|
|
8
|
-
interface ExportWizardProps {
|
|
9
|
-
isVisible: boolean;
|
|
10
|
-
agent: DextoAgent;
|
|
11
|
-
sessionId: string | null;
|
|
12
|
-
onClose: () => void;
|
|
13
|
-
}
|
|
14
|
-
export interface ExportWizardHandle {
|
|
15
|
-
handleInput: (input: string, key: Key) => boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Interactive wizard for exporting conversation
|
|
19
|
-
*/
|
|
20
|
-
declare const ExportWizard: React.ForwardRefExoticComponent<ExportWizardProps & React.RefAttributes<ExportWizardHandle>>;
|
|
21
|
-
export default ExportWizard;
|
|
22
|
-
//# sourceMappingURL=ExportWizard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExportWizard.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/overlays/ExportWizard.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAA4E,MAAM,OAAO,CAAC;AAIjG,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAY9C,UAAU,iBAAiB;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IAC/B,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AA4JD;;GAEG;AACH,QAAA,MAAM,YAAY,8FA+UhB,CAAC;AAEH,eAAe,YAAY,CAAC"}
|