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,490 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* TextBufferInput Component
|
|
4
|
-
*
|
|
5
|
-
* Buffer is passed as prop from parent.
|
|
6
|
-
* Uses direct useKeypress for input handling (no ref chain).
|
|
7
|
-
* Parent owns the buffer and can read values directly.
|
|
8
|
-
*/
|
|
9
|
-
import { useCallback, useRef, useEffect } from 'react';
|
|
10
|
-
import { Box, Text, useStdout } from 'ink';
|
|
11
|
-
import { useKeypress } from '../hooks/useKeypress.js';
|
|
12
|
-
import { readClipboardImage } from '../utils/clipboardUtils.js';
|
|
13
|
-
/** Threshold for collapsing pasted content */
|
|
14
|
-
const PASTE_COLLAPSE_LINE_THRESHOLD = 3;
|
|
15
|
-
const PASTE_COLLAPSE_CHAR_THRESHOLD = 150;
|
|
16
|
-
/** Platform-aware keyboard shortcut labels */
|
|
17
|
-
const isMac = process.platform === 'darwin';
|
|
18
|
-
const KEY_LABELS = {
|
|
19
|
-
ctrlT: isMac ? '⌃T' : 'Ctrl+T',
|
|
20
|
-
altUp: isMac ? '⌥↑' : 'Alt+Up',
|
|
21
|
-
altDown: isMac ? '⌥↓' : 'Alt+Down',
|
|
22
|
-
};
|
|
23
|
-
function isBackspaceKey(key) {
|
|
24
|
-
return key.name === 'backspace' || key.sequence === '\x7f' || key.sequence === '\x08';
|
|
25
|
-
}
|
|
26
|
-
function isForwardDeleteKey(key) {
|
|
27
|
-
return key.name === 'delete';
|
|
28
|
-
}
|
|
29
|
-
/** Renders text with optional query highlighting in green */
|
|
30
|
-
function HighlightedText({ text, query }) {
|
|
31
|
-
if (!query || !text) {
|
|
32
|
-
return _jsx(Text, { children: text });
|
|
33
|
-
}
|
|
34
|
-
const lowerText = text.toLowerCase();
|
|
35
|
-
const lowerQuery = query.toLowerCase();
|
|
36
|
-
const matchIndex = lowerText.indexOf(lowerQuery);
|
|
37
|
-
if (matchIndex === -1) {
|
|
38
|
-
return _jsx(Text, { children: text });
|
|
39
|
-
}
|
|
40
|
-
const before = text.slice(0, matchIndex);
|
|
41
|
-
const match = text.slice(matchIndex, matchIndex + query.length);
|
|
42
|
-
const after = text.slice(matchIndex + query.length);
|
|
43
|
-
return (_jsxs(Text, { children: [before, _jsx(Text, { color: "green", bold: true, children: match }), after] }));
|
|
44
|
-
}
|
|
45
|
-
export function TextBufferInput({ buffer, onSubmit, placeholder, isDisabled = false, onHistoryNavigate, onTriggerOverlay, maxViewportLines = 10, isActive, onKeyboardScroll, imageCount = 0, onImagePaste, images = [], onImageRemove, pastedBlocks = [], onPasteBlock, onPasteBlockUpdate, onPasteBlockRemove, highlightQuery, }) {
|
|
46
|
-
const { stdout } = useStdout();
|
|
47
|
-
const terminalWidth = stdout?.columns || 80;
|
|
48
|
-
// Use ref to track imageCount to avoid stale closure in async paste handler
|
|
49
|
-
const imageCountRef = useRef(imageCount);
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
imageCountRef.current = imageCount;
|
|
52
|
-
}, [imageCount]);
|
|
53
|
-
// Use ref to track paste number for generating sequential IDs
|
|
54
|
-
const pasteCounterRef = useRef(pastedBlocks.length);
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
// Update counter to be at least the current number of blocks
|
|
57
|
-
pasteCounterRef.current = Math.max(pasteCounterRef.current, pastedBlocks.length);
|
|
58
|
-
}, [pastedBlocks.length]);
|
|
59
|
-
// Check for removed image placeholders after text changes
|
|
60
|
-
const checkRemovedImages = useCallback(() => {
|
|
61
|
-
if (!onImageRemove || images.length === 0)
|
|
62
|
-
return;
|
|
63
|
-
const currentText = buffer.text;
|
|
64
|
-
for (const img of images) {
|
|
65
|
-
if (!currentText.includes(img.placeholder)) {
|
|
66
|
-
onImageRemove(img.id);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}, [buffer, images, onImageRemove]);
|
|
70
|
-
// Check for removed paste block placeholders after text changes
|
|
71
|
-
const checkRemovedPasteBlocks = useCallback(() => {
|
|
72
|
-
if (!onPasteBlockRemove || pastedBlocks.length === 0)
|
|
73
|
-
return;
|
|
74
|
-
const currentText = buffer.text;
|
|
75
|
-
for (const block of pastedBlocks) {
|
|
76
|
-
// Check if either the placeholder or the full text (when expanded) is present
|
|
77
|
-
const textToFind = block.isCollapsed ? block.placeholder : block.fullText;
|
|
78
|
-
if (!currentText.includes(textToFind)) {
|
|
79
|
-
onPasteBlockRemove(block.id);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}, [buffer, pastedBlocks, onPasteBlockRemove]);
|
|
83
|
-
// Find the currently expanded paste block (only one can be expanded at a time)
|
|
84
|
-
const findExpandedBlock = useCallback(() => {
|
|
85
|
-
return pastedBlocks.find((block) => !block.isCollapsed) || null;
|
|
86
|
-
}, [pastedBlocks]);
|
|
87
|
-
// Find which collapsed paste block the cursor is on (by placeholder)
|
|
88
|
-
const findCollapsedBlockAtCursor = useCallback(() => {
|
|
89
|
-
if (pastedBlocks.length === 0)
|
|
90
|
-
return null;
|
|
91
|
-
const currentText = buffer.text;
|
|
92
|
-
const [cursorRow, cursorCol] = buffer.cursor;
|
|
93
|
-
const cursorOffset = getCursorPosition(buffer.lines, cursorRow, cursorCol);
|
|
94
|
-
for (const block of pastedBlocks) {
|
|
95
|
-
if (!block.isCollapsed)
|
|
96
|
-
continue; // Skip expanded blocks
|
|
97
|
-
const startIdx = currentText.indexOf(block.placeholder);
|
|
98
|
-
if (startIdx === -1)
|
|
99
|
-
continue;
|
|
100
|
-
const endIdx = startIdx + block.placeholder.length;
|
|
101
|
-
if (cursorOffset >= startIdx && cursorOffset <= endIdx) {
|
|
102
|
-
return block;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return null;
|
|
106
|
-
}, [buffer, pastedBlocks]);
|
|
107
|
-
// Handle Ctrl+T toggle:
|
|
108
|
-
// - If something is expanded: collapse it
|
|
109
|
-
// - If cursor is on a collapsed paste: expand it
|
|
110
|
-
const handlePasteToggle = useCallback(() => {
|
|
111
|
-
if (!onPasteBlockUpdate)
|
|
112
|
-
return;
|
|
113
|
-
const expandedBlock = findExpandedBlock();
|
|
114
|
-
const currentText = buffer.text;
|
|
115
|
-
// If something is expanded, collapse it
|
|
116
|
-
if (expandedBlock) {
|
|
117
|
-
// Normalize for comparison (buffer might have different line endings)
|
|
118
|
-
const normalizedCurrent = currentText.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
119
|
-
const normalizedFullText = expandedBlock.fullText
|
|
120
|
-
.replace(/\r\n/g, '\n')
|
|
121
|
-
.replace(/\r/g, '\n');
|
|
122
|
-
const startIdx = normalizedCurrent.indexOf(normalizedFullText);
|
|
123
|
-
if (startIdx === -1) {
|
|
124
|
-
// Fallback: just mark as collapsed without text replacement
|
|
125
|
-
// This handles edge cases where text was modified
|
|
126
|
-
onPasteBlockUpdate(expandedBlock.id, { isCollapsed: true });
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
// Replace full text with placeholder
|
|
130
|
-
const before = currentText.slice(0, startIdx);
|
|
131
|
-
const after = currentText.slice(startIdx + normalizedFullText.length);
|
|
132
|
-
const newText = before + expandedBlock.placeholder + after;
|
|
133
|
-
// Adjust cursor
|
|
134
|
-
const [cursorRow, cursorCol] = buffer.cursor;
|
|
135
|
-
const cursorOffset = getCursorPosition(buffer.lines, cursorRow, cursorCol);
|
|
136
|
-
let newCursorOffset = cursorOffset;
|
|
137
|
-
if (cursorOffset > startIdx) {
|
|
138
|
-
// Cursor is after the start of expanded block - adjust
|
|
139
|
-
const lengthDiff = expandedBlock.placeholder.length - normalizedFullText.length;
|
|
140
|
-
newCursorOffset = Math.max(startIdx, cursorOffset + lengthDiff);
|
|
141
|
-
}
|
|
142
|
-
buffer.setText(newText);
|
|
143
|
-
buffer.moveToOffset(Math.min(newCursorOffset, newText.length));
|
|
144
|
-
onPasteBlockUpdate(expandedBlock.id, { isCollapsed: true });
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
// Otherwise, check if cursor is on a collapsed paste to expand
|
|
148
|
-
const collapsedBlock = findCollapsedBlockAtCursor();
|
|
149
|
-
if (collapsedBlock) {
|
|
150
|
-
const startIdx = currentText.indexOf(collapsedBlock.placeholder);
|
|
151
|
-
if (startIdx === -1)
|
|
152
|
-
return;
|
|
153
|
-
// Replace placeholder with full text
|
|
154
|
-
const before = currentText.slice(0, startIdx);
|
|
155
|
-
const after = currentText.slice(startIdx + collapsedBlock.placeholder.length);
|
|
156
|
-
const newText = before + collapsedBlock.fullText + after;
|
|
157
|
-
buffer.setText(newText);
|
|
158
|
-
// Move cursor to start of expanded content
|
|
159
|
-
buffer.moveToOffset(startIdx);
|
|
160
|
-
onPasteBlockUpdate(collapsedBlock.id, { isCollapsed: false });
|
|
161
|
-
}
|
|
162
|
-
}, [buffer, findExpandedBlock, findCollapsedBlockAtCursor, onPasteBlockUpdate]);
|
|
163
|
-
// Handle keyboard input directly - reads buffer state fresh each time
|
|
164
|
-
const handleKeypress = useCallback((key) => {
|
|
165
|
-
if (isDisabled)
|
|
166
|
-
return;
|
|
167
|
-
// Read buffer state directly - always fresh, no stale closures
|
|
168
|
-
const currentText = buffer.text;
|
|
169
|
-
const cursorVisualRow = buffer.visualCursor[0];
|
|
170
|
-
const visualLines = buffer.allVisualLines;
|
|
171
|
-
// === KEYBOARD SCROLL (PageUp/PageDown, Shift+arrows) ===
|
|
172
|
-
if (onKeyboardScroll) {
|
|
173
|
-
if (key.name === 'pageup' || (key.shift && key.name === 'up')) {
|
|
174
|
-
onKeyboardScroll('up');
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
if (key.name === 'pagedown' || (key.shift && key.name === 'down')) {
|
|
178
|
-
onKeyboardScroll('down');
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
// === IMAGE PASTE (Ctrl+V) ===
|
|
183
|
-
// Check clipboard for image before letting normal paste through
|
|
184
|
-
if (key.ctrl && key.name === 'v' && onImagePaste) {
|
|
185
|
-
// Async clipboard check - fire and forget, don't block input
|
|
186
|
-
void (async () => {
|
|
187
|
-
try {
|
|
188
|
-
const clipboardImage = await readClipboardImage();
|
|
189
|
-
if (clipboardImage) {
|
|
190
|
-
// Use ref to get current count (avoids stale closure issue)
|
|
191
|
-
const currentCount = imageCountRef.current;
|
|
192
|
-
const imageNumber = currentCount + 1;
|
|
193
|
-
// Immediately increment ref to handle rapid pastes
|
|
194
|
-
imageCountRef.current = imageNumber;
|
|
195
|
-
const placeholder = `[Image ${imageNumber}]`;
|
|
196
|
-
const pendingImage = {
|
|
197
|
-
id: `img-${Date.now()}-${imageNumber}`,
|
|
198
|
-
data: clipboardImage.data,
|
|
199
|
-
mimeType: clipboardImage.mimeType,
|
|
200
|
-
placeholder,
|
|
201
|
-
};
|
|
202
|
-
onImagePaste(pendingImage);
|
|
203
|
-
buffer.insert(placeholder);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
catch {
|
|
207
|
-
// Clipboard read failed, ignore
|
|
208
|
-
}
|
|
209
|
-
})();
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
// === NEWLINE DETECTION ===
|
|
213
|
-
const isCtrlJ = key.sequence === '\n';
|
|
214
|
-
const isShiftEnter = key.sequence === '\\\r' ||
|
|
215
|
-
(key.name === 'return' && key.shift) ||
|
|
216
|
-
key.sequence === '\x1b[13;2u' ||
|
|
217
|
-
key.sequence === '\x1bOM';
|
|
218
|
-
const isPasteReturn = key.name === 'return' && key.paste;
|
|
219
|
-
const wantsNewline = isCtrlJ || isShiftEnter || (key.name === 'return' && key.meta) || isPasteReturn;
|
|
220
|
-
if (wantsNewline) {
|
|
221
|
-
buffer.newline();
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
// === SUBMIT (Enter) ===
|
|
225
|
-
if (key.name === 'return' && !key.paste) {
|
|
226
|
-
if (currentText.trim()) {
|
|
227
|
-
onSubmit(currentText);
|
|
228
|
-
}
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
// === UNDO/REDO ===
|
|
232
|
-
if (key.ctrl && key.name === 'z' && !key.shift) {
|
|
233
|
-
buffer.undo();
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
if ((key.ctrl && key.name === 'y') || (key.ctrl && key.shift && key.name === 'z')) {
|
|
237
|
-
buffer.redo();
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
// === PASTE BLOCK TOGGLE (Ctrl+T) ===
|
|
241
|
-
if (key.ctrl && key.name === 't') {
|
|
242
|
-
handlePasteToggle();
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
// === BACKSPACE ===
|
|
246
|
-
if (isBackspaceKey(key) && !key.meta) {
|
|
247
|
-
const prevText = buffer.text;
|
|
248
|
-
const [cursorRow, cursorCol] = buffer.cursor;
|
|
249
|
-
const cursorPos = getCursorPosition(buffer.lines, cursorRow, cursorCol);
|
|
250
|
-
buffer.backspace();
|
|
251
|
-
checkRemovedImages();
|
|
252
|
-
checkRemovedPasteBlocks();
|
|
253
|
-
// Check if we should close overlay after backspace
|
|
254
|
-
// NOTE: buffer.text is memoized and won't update until next render,
|
|
255
|
-
// so we calculate the expected new text ourselves
|
|
256
|
-
if (onTriggerOverlay && cursorPos > 0) {
|
|
257
|
-
const deletedChar = prevText[cursorPos - 1];
|
|
258
|
-
// Calculate what the text will be after backspace
|
|
259
|
-
const expectedNewText = prevText.slice(0, cursorPos - 1) + prevText.slice(cursorPos);
|
|
260
|
-
if (deletedChar === '/' && cursorPos === 1) {
|
|
261
|
-
onTriggerOverlay('close');
|
|
262
|
-
}
|
|
263
|
-
else if (deletedChar === '@') {
|
|
264
|
-
// Close if no valid @ mention remains
|
|
265
|
-
// A valid @ is at start of text or after whitespace
|
|
266
|
-
const hasValidAt = /(^|[\s])@/.test(expectedNewText);
|
|
267
|
-
if (!hasValidAt) {
|
|
268
|
-
onTriggerOverlay('close');
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
// === FORWARD DELETE ===
|
|
275
|
-
if (isForwardDeleteKey(key)) {
|
|
276
|
-
buffer.del();
|
|
277
|
-
checkRemovedImages();
|
|
278
|
-
checkRemovedPasteBlocks();
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
// === WORD DELETE ===
|
|
282
|
-
if (key.ctrl && key.name === 'w') {
|
|
283
|
-
buffer.deleteWordLeft();
|
|
284
|
-
checkRemovedImages();
|
|
285
|
-
checkRemovedPasteBlocks();
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
if (key.meta && isBackspaceKey(key)) {
|
|
289
|
-
buffer.deleteWordLeft();
|
|
290
|
-
checkRemovedImages();
|
|
291
|
-
checkRemovedPasteBlocks();
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
// === ARROW NAVIGATION ===
|
|
295
|
-
if (key.name === 'left') {
|
|
296
|
-
buffer.move(key.meta || key.ctrl ? 'wordLeft' : 'left');
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
if (key.name === 'right') {
|
|
300
|
-
buffer.move(key.meta || key.ctrl ? 'wordRight' : 'right');
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
// Cmd+Up: Move to start of input
|
|
304
|
-
if (key.meta && key.name === 'up') {
|
|
305
|
-
buffer.moveToOffset(0);
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
// Cmd+Down: Move to end of input
|
|
309
|
-
if (key.meta && key.name === 'down') {
|
|
310
|
-
buffer.moveToOffset(currentText.length);
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
if (key.name === 'up') {
|
|
314
|
-
// Only trigger history navigation when at top visual line
|
|
315
|
-
if (cursorVisualRow === 0 && onHistoryNavigate) {
|
|
316
|
-
onHistoryNavigate('up');
|
|
317
|
-
}
|
|
318
|
-
else {
|
|
319
|
-
buffer.move('up');
|
|
320
|
-
}
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
if (key.name === 'down') {
|
|
324
|
-
// Only trigger history navigation when at bottom visual line
|
|
325
|
-
if (cursorVisualRow >= visualLines.length - 1 && onHistoryNavigate) {
|
|
326
|
-
onHistoryNavigate('down');
|
|
327
|
-
}
|
|
328
|
-
else {
|
|
329
|
-
buffer.move('down');
|
|
330
|
-
}
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
// === LINE NAVIGATION ===
|
|
334
|
-
if (key.ctrl && key.name === 'a') {
|
|
335
|
-
buffer.move('home');
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
if (key.ctrl && key.name === 'e') {
|
|
339
|
-
buffer.move('end');
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
if (key.ctrl && key.name === 'k') {
|
|
343
|
-
buffer.killLineRight();
|
|
344
|
-
checkRemovedImages();
|
|
345
|
-
checkRemovedPasteBlocks();
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
if (key.ctrl && key.name === 'u') {
|
|
349
|
-
buffer.killLineLeft();
|
|
350
|
-
checkRemovedImages();
|
|
351
|
-
checkRemovedPasteBlocks();
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
// === WORD NAVIGATION ===
|
|
355
|
-
if (key.meta && key.name === 'b') {
|
|
356
|
-
buffer.move('wordLeft');
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
if (key.meta && key.name === 'f') {
|
|
360
|
-
buffer.move('wordRight');
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
// === CHARACTER INPUT ===
|
|
364
|
-
if (key.insertable && !key.ctrl && !key.meta) {
|
|
365
|
-
const [cursorRow, cursorCol] = buffer.cursor;
|
|
366
|
-
const cursorPos = getCursorPosition(buffer.lines, cursorRow, cursorCol);
|
|
367
|
-
// Check if this is a large paste that should be collapsed
|
|
368
|
-
if (key.paste && onPasteBlock) {
|
|
369
|
-
// Normalize line endings to \n for consistent handling
|
|
370
|
-
const pastedText = key.sequence.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
371
|
-
const lineCount = (pastedText.match(/\n/g)?.length ?? 0) + 1;
|
|
372
|
-
if (lineCount >= PASTE_COLLAPSE_LINE_THRESHOLD ||
|
|
373
|
-
pastedText.length > PASTE_COLLAPSE_CHAR_THRESHOLD) {
|
|
374
|
-
// Create collapsed paste block
|
|
375
|
-
pasteCounterRef.current += 1;
|
|
376
|
-
const pasteNumber = pasteCounterRef.current;
|
|
377
|
-
const placeholder = `[Paste ${pasteNumber}: ~${lineCount} lines]`;
|
|
378
|
-
const pasteBlock = {
|
|
379
|
-
id: `paste-${Date.now()}-${pasteNumber}`,
|
|
380
|
-
number: pasteNumber,
|
|
381
|
-
fullText: pastedText,
|
|
382
|
-
lineCount,
|
|
383
|
-
isCollapsed: true,
|
|
384
|
-
placeholder,
|
|
385
|
-
};
|
|
386
|
-
// Insert placeholder instead of full text
|
|
387
|
-
buffer.insert(placeholder);
|
|
388
|
-
onPasteBlock(pasteBlock);
|
|
389
|
-
return;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
buffer.insert(key.sequence, { paste: key.paste });
|
|
393
|
-
if (onTriggerOverlay) {
|
|
394
|
-
if (key.sequence === '/' && cursorPos === 0) {
|
|
395
|
-
onTriggerOverlay('slash-autocomplete');
|
|
396
|
-
}
|
|
397
|
-
else if (key.sequence === '@') {
|
|
398
|
-
onTriggerOverlay('resource-autocomplete');
|
|
399
|
-
}
|
|
400
|
-
else if (/\s/.test(key.sequence)) {
|
|
401
|
-
// Close resource autocomplete when user types whitespace
|
|
402
|
-
// Whitespace means user is done with the mention (either selected or abandoned)
|
|
403
|
-
onTriggerOverlay('close');
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
}, [
|
|
408
|
-
buffer,
|
|
409
|
-
isDisabled,
|
|
410
|
-
onSubmit,
|
|
411
|
-
onHistoryNavigate,
|
|
412
|
-
onTriggerOverlay,
|
|
413
|
-
onKeyboardScroll,
|
|
414
|
-
// imageCount intentionally omitted - callback uses imageCountRef which is synced via useEffect
|
|
415
|
-
onImagePaste,
|
|
416
|
-
checkRemovedImages,
|
|
417
|
-
checkRemovedPasteBlocks,
|
|
418
|
-
handlePasteToggle,
|
|
419
|
-
onPasteBlock,
|
|
420
|
-
]);
|
|
421
|
-
// Subscribe to keypress events when active
|
|
422
|
-
useKeypress(handleKeypress, { isActive: isActive && !isDisabled });
|
|
423
|
-
// === RENDERING ===
|
|
424
|
-
// Read buffer state for rendering
|
|
425
|
-
const bufferText = buffer.text;
|
|
426
|
-
const visualCursor = buffer.visualCursor;
|
|
427
|
-
const visualLines = buffer.allVisualLines;
|
|
428
|
-
const cursorVisualRow = visualCursor[0];
|
|
429
|
-
const cursorVisualCol = visualCursor[1];
|
|
430
|
-
const separator = '─'.repeat(terminalWidth);
|
|
431
|
-
const totalLines = visualLines.length;
|
|
432
|
-
// Detect shell command mode (input starts with "!")
|
|
433
|
-
const isShellMode = bufferText.startsWith('!');
|
|
434
|
-
const promptPrefix = isShellMode ? '$ ' : '> ';
|
|
435
|
-
const promptColor = isShellMode ? 'yellow' : 'green';
|
|
436
|
-
const separatorColor = isShellMode ? 'yellow' : 'gray';
|
|
437
|
-
// Calculate visible window
|
|
438
|
-
let startLine = 0;
|
|
439
|
-
let endLine = totalLines;
|
|
440
|
-
if (totalLines > maxViewportLines) {
|
|
441
|
-
const halfViewport = Math.floor(maxViewportLines / 2);
|
|
442
|
-
startLine = Math.max(0, cursorVisualRow - halfViewport);
|
|
443
|
-
endLine = Math.min(totalLines, startLine + maxViewportLines);
|
|
444
|
-
if (endLine === totalLines) {
|
|
445
|
-
startLine = Math.max(0, totalLines - maxViewportLines);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
const visibleLines = visualLines.slice(startLine, endLine);
|
|
449
|
-
// Empty state
|
|
450
|
-
if (bufferText === '') {
|
|
451
|
-
return (_jsxs(Box, { flexDirection: "column", width: terminalWidth, children: [_jsx(Text, { color: "gray", children: separator }), _jsxs(Box, { width: terminalWidth, children: [_jsx(Text, { color: "green", bold: true, children: '> ' }), _jsx(Text, { inverse: true, children: " " }), placeholder && _jsx(Text, { color: "gray", children: placeholder }), _jsx(Text, { children: ' '.repeat(Math.max(0, terminalWidth - 3 - (placeholder?.length || 0))) })] }), _jsx(Text, { color: "gray", children: separator })] }));
|
|
452
|
-
}
|
|
453
|
-
return (_jsxs(Box, { flexDirection: "column", width: terminalWidth, children: [_jsx(Text, { color: separatorColor, children: separator }), startLine > 0 && (_jsxs(Text, { color: "gray", children: [' ', "\u2191 ", startLine, " more line", startLine > 1 ? 's' : '', " above (", KEY_LABELS.altUp, " to jump)"] })), visibleLines.map((line, idx) => {
|
|
454
|
-
const absoluteRow = startLine + idx;
|
|
455
|
-
const isFirst = absoluteRow === 0;
|
|
456
|
-
const prefix = isFirst ? promptPrefix : ' ';
|
|
457
|
-
const isCursorLine = absoluteRow === cursorVisualRow;
|
|
458
|
-
if (!isCursorLine) {
|
|
459
|
-
return (_jsxs(Box, { width: terminalWidth, children: [_jsx(Text, { color: promptColor, bold: isFirst, children: prefix }), _jsx(HighlightedText, { text: line, query: highlightQuery }), _jsx(Text, { children: ' '.repeat(Math.max(0, terminalWidth - prefix.length - line.length)) })] }, absoluteRow));
|
|
460
|
-
}
|
|
461
|
-
const before = line.slice(0, cursorVisualCol);
|
|
462
|
-
const atCursor = line.charAt(cursorVisualCol) || ' ';
|
|
463
|
-
const after = line.slice(cursorVisualCol + 1);
|
|
464
|
-
return (_jsxs(Box, { width: terminalWidth, children: [_jsx(Text, { color: promptColor, bold: isFirst, children: prefix }), _jsx(HighlightedText, { text: before, query: highlightQuery }), _jsx(Text, { inverse: true, children: atCursor }), _jsx(HighlightedText, { text: after, query: highlightQuery }), _jsx(Text, { children: ' '.repeat(Math.max(0, terminalWidth - prefix.length - before.length - 1 - after.length)) })] }, absoluteRow));
|
|
465
|
-
}), endLine < totalLines && (_jsxs(Text, { color: "gray", children: [' ', "\u2193 ", totalLines - endLine, " more line", totalLines - endLine > 1 ? 's' : '', ' ', "below (", KEY_LABELS.altDown, " to jump)"] })), pastedBlocks.length > 0 && (_jsx(PasteBlockHint, { pastedBlocks: pastedBlocks, expandedBlock: findExpandedBlock(), cursorOnCollapsed: findCollapsedBlockAtCursor() })), _jsx(Text, { color: separatorColor, children: separator })] }));
|
|
466
|
-
}
|
|
467
|
-
/** Hint component for paste blocks */
|
|
468
|
-
function PasteBlockHint({ pastedBlocks, expandedBlock, cursorOnCollapsed, }) {
|
|
469
|
-
const collapsedCount = pastedBlocks.filter((b) => b.isCollapsed).length;
|
|
470
|
-
// If something is expanded, always show collapse hint
|
|
471
|
-
if (expandedBlock) {
|
|
472
|
-
return (_jsxs(Text, { color: "cyan", children: [' ', KEY_LABELS.ctrlT, " to collapse expanded paste"] }));
|
|
473
|
-
}
|
|
474
|
-
// If cursor is on a collapsed paste, show expand hint
|
|
475
|
-
if (cursorOnCollapsed) {
|
|
476
|
-
return (_jsxs(Text, { color: "cyan", children: [' ', KEY_LABELS.ctrlT, " to expand paste"] }));
|
|
477
|
-
}
|
|
478
|
-
// Otherwise show count of collapsed pastes
|
|
479
|
-
if (collapsedCount > 0) {
|
|
480
|
-
return (_jsxs(Text, { color: "gray", children: [' ', collapsedCount, " collapsed paste", collapsedCount > 1 ? 's' : '', " (", KEY_LABELS.ctrlT, ' ', "on placeholder to expand)"] }));
|
|
481
|
-
}
|
|
482
|
-
return null;
|
|
483
|
-
}
|
|
484
|
-
function getCursorPosition(lines, cursorRow, cursorCol) {
|
|
485
|
-
let pos = 0;
|
|
486
|
-
for (let i = 0; i < cursorRow; i++) {
|
|
487
|
-
pos += (lines[i]?.length ?? 0) + 1;
|
|
488
|
-
}
|
|
489
|
-
return pos + cursorCol;
|
|
490
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TodoPanel Component
|
|
3
|
-
*
|
|
4
|
-
* Displays the current todo list for workflow tracking.
|
|
5
|
-
* Shows todos with their status indicators (pending, in progress, completed).
|
|
6
|
-
*
|
|
7
|
-
* Display modes:
|
|
8
|
-
* - Processing + Collapsed: Shows "Next:" with the next pending/in-progress task
|
|
9
|
-
* - Processing + Expanded: Shows simple checklist with ☐/☑ indicators below status bar
|
|
10
|
-
* - Idle + Expanded: Shows boxed format with header
|
|
11
|
-
* - Idle + Collapsed: Hidden
|
|
12
|
-
*/
|
|
13
|
-
import type { TodoItem } from '../state/types.js';
|
|
14
|
-
interface TodoPanelProps {
|
|
15
|
-
todos: TodoItem[];
|
|
16
|
-
/** Whether to show the full list or just the next task */
|
|
17
|
-
isExpanded: boolean;
|
|
18
|
-
/** Whether the agent is currently processing (affects display style) */
|
|
19
|
-
isProcessing?: boolean;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* TodoPanel - Shows current todos for workflow tracking
|
|
23
|
-
*/
|
|
24
|
-
export declare function TodoPanel({ todos, isExpanded, isProcessing }: TodoPanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
25
|
-
export {};
|
|
26
|
-
//# sourceMappingURL=TodoPanel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TodoPanel.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/TodoPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,mBAAmB,CAAC;AAE9D,UAAU,cAAc;IACpB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,0DAA0D;IAC1D,UAAU,EAAE,OAAO,CAAC;IACpB,wEAAwE;IACxE,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAiBD;;GAEG;AACH,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,YAAoB,EAAE,EAAE,cAAc,kDAkHpF"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
/**
|
|
4
|
-
* Get status indicator for a todo item (used in boxed mode)
|
|
5
|
-
*/
|
|
6
|
-
function getStatusIndicator(status) {
|
|
7
|
-
switch (status) {
|
|
8
|
-
case 'completed':
|
|
9
|
-
return { icon: '✓', color: 'green' };
|
|
10
|
-
case 'in_progress':
|
|
11
|
-
return { icon: '●', color: 'yellow' };
|
|
12
|
-
case 'pending':
|
|
13
|
-
default:
|
|
14
|
-
return { icon: '○', color: 'gray' };
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* TodoPanel - Shows current todos for workflow tracking
|
|
19
|
-
*/
|
|
20
|
-
export function TodoPanel({ todos, isExpanded, isProcessing = false }) {
|
|
21
|
-
if (todos.length === 0) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
// Sort todos by position
|
|
25
|
-
const sortedTodos = [...todos].sort((a, b) => a.position - b.position);
|
|
26
|
-
// Find the next task to work on (in_progress first, then first pending)
|
|
27
|
-
const currentTask = sortedTodos.find((t) => t.status === 'in_progress');
|
|
28
|
-
const nextPendingTask = sortedTodos.find((t) => t.status === 'pending');
|
|
29
|
-
const nextTask = currentTask || nextPendingTask;
|
|
30
|
-
// When idle (not processing)
|
|
31
|
-
if (!isProcessing) {
|
|
32
|
-
// Collapsed + idle = hidden
|
|
33
|
-
if (!isExpanded) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
// Expanded + idle = boxed format
|
|
37
|
-
const completedCount = todos.filter((t) => t.status === 'completed').length;
|
|
38
|
-
const totalCount = todos.length;
|
|
39
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 1, marginX: 1, marginBottom: 1, children: [_jsxs(Box, { children: [_jsxs(Text, { bold: true, color: "cyan", children: ["\uD83D\uDCCB Todo", ' '] }), _jsxs(Text, { color: "gray", children: ["(", completedCount, "/", totalCount, ")"] }), _jsxs(Text, { color: "gray", dimColor: true, children: [' ', "\u00B7 ctrl+t to hide todo list"] })] }), _jsx(Box, { flexDirection: "column", children: sortedTodos.map((todo) => {
|
|
40
|
-
const { icon, color } = getStatusIndicator(todo.status);
|
|
41
|
-
const isCompleted = todo.status === 'completed';
|
|
42
|
-
const isInProgress = todo.status === 'in_progress';
|
|
43
|
-
return (_jsxs(Box, { children: [_jsxs(Text, { color: color, children: [icon, " "] }), _jsx(Text, { color: isCompleted ? 'gray' : isInProgress ? 'white' : 'gray', strikethrough: isCompleted, dimColor: !isInProgress && !isCompleted, children: isInProgress ? todo.activeForm : todo.content })] }, todo.id));
|
|
44
|
-
}) })] }));
|
|
45
|
-
}
|
|
46
|
-
// When processing - use minimal style
|
|
47
|
-
// Collapsed: show current task being worked on
|
|
48
|
-
if (!isExpanded) {
|
|
49
|
-
if (!currentTask) {
|
|
50
|
-
return null; // No active task
|
|
51
|
-
}
|
|
52
|
-
return (_jsx(Box, { paddingX: 1, marginBottom: 1, children: _jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { color: "gray", children: "\u23BF " }), _jsx(Text, { color: "gray", children: currentTask.activeForm })] }) }));
|
|
53
|
-
}
|
|
54
|
-
// Expanded: show simple checklist
|
|
55
|
-
return (_jsx(Box, { flexDirection: "column", paddingX: 1, marginBottom: 1, children: sortedTodos.map((todo, index) => {
|
|
56
|
-
const isFirst = index === 0;
|
|
57
|
-
const isCompleted = todo.status === 'completed';
|
|
58
|
-
const isInProgress = todo.status === 'in_progress';
|
|
59
|
-
const checkbox = isCompleted ? '☑' : '☐';
|
|
60
|
-
return (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { color: "gray", children: isFirst ? '⎿ ' : ' ' }), _jsxs(Text, { color: isCompleted ? 'green' : isInProgress ? 'yellow' : 'white', children: [checkbox, ' '] }), _jsx(Text, { color: isCompleted ? 'gray' : 'white', dimColor: isCompleted, children: todo.content })] }, todo.id));
|
|
61
|
-
}) }));
|
|
62
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base Autocomplete Component
|
|
3
|
-
* Reusable autocomplete with filtering, scoring, and keyboard navigation
|
|
4
|
-
* Used by SlashCommandAutocomplete and ResourceAutocomplete
|
|
5
|
-
*/
|
|
6
|
-
import { type ReactNode } from 'react';
|
|
7
|
-
export interface BaseAutocompleteProps<T> {
|
|
8
|
-
items: T[];
|
|
9
|
-
query: string;
|
|
10
|
-
isVisible: boolean;
|
|
11
|
-
isLoading?: boolean;
|
|
12
|
-
onSelect: (item: T) => void;
|
|
13
|
-
onLoadIntoInput?: (text: string) => void;
|
|
14
|
-
onClose: () => void;
|
|
15
|
-
filterFn: (item: T, query: string) => boolean;
|
|
16
|
-
scoreFn: (item: T, query: string) => number;
|
|
17
|
-
formatItem: (item: T, isSelected: boolean) => ReactNode;
|
|
18
|
-
formatLoadText?: (item: T) => string;
|
|
19
|
-
title: string;
|
|
20
|
-
maxVisibleItems?: number;
|
|
21
|
-
loadingMessage?: string;
|
|
22
|
-
emptyMessage?: string;
|
|
23
|
-
borderColor?: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Generic autocomplete component with filtering, scoring, and keyboard navigation
|
|
27
|
-
*/
|
|
28
|
-
export declare function BaseAutocomplete<T>({ items, query, isVisible, isLoading, onSelect, onLoadIntoInput, onClose, filterFn, scoreFn, formatItem, formatLoadText, title, maxVisibleItems, loadingMessage, emptyMessage, borderColor, }: BaseAutocompleteProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
29
|
-
//# sourceMappingURL=BaseAutocomplete.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAutocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/base/BaseAutocomplete.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAc,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGpF,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACpC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,OAAO,KAAK,SAAS,CAAC;IACxD,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,EAChC,KAAK,EACL,KAAK,EACL,SAAS,EACT,SAAiB,EACjB,QAAQ,EACR,eAAe,EACf,OAAO,EACP,QAAQ,EACR,OAAO,EACP,UAAU,EACV,cAAc,EACd,KAAK,EACL,eAAoB,EACpB,cAA6B,EAC7B,YAAiC,EACjC,WAAoB,GACvB,EAAE,qBAAqB,CAAC,CAAC,CAAC,kDA8I1B"}
|