dexto 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/coding-agent/coding-agent.yml +3 -1
- package/dist/analytics/wrapper.js +1 -1
- package/dist/cli/auth/dexto-api-key.d.ts +34 -0
- package/dist/cli/auth/dexto-api-key.d.ts.map +1 -0
- package/dist/cli/auth/dexto-api-key.js +161 -0
- package/dist/cli/auth/index.d.ts +2 -1
- package/dist/cli/auth/index.d.ts.map +1 -1
- package/dist/cli/auth/index.js +2 -1
- package/dist/cli/auth/oauth.d.ts +10 -0
- package/dist/cli/auth/oauth.d.ts.map +1 -1
- package/dist/cli/auth/oauth.js +113 -36
- package/dist/cli/auth/service.d.ts +1 -0
- package/dist/cli/auth/service.d.ts.map +1 -1
- package/dist/cli/auth/service.js +1 -0
- package/dist/cli/commands/auth/login.d.ts.map +1 -1
- package/dist/cli/commands/auth/login.js +40 -105
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +157 -120
- package/dist/cli/utils/config-validation.js +3 -3
- package/dist/cli/utils/options.d.ts.map +1 -1
- package/dist/cli/utils/options.js +6 -0
- package/dist/index-main.js +36 -2
- package/dist/utils/session-logger-factory.d.ts.map +1 -1
- package/dist/utils/session-logger-factory.js +17 -2
- package/dist/webui/assets/index-BPlk2Wbt.css +1 -0
- package/dist/webui/assets/index-BZvrpxyh.js +2059 -0
- package/dist/webui/index.html +2 -2
- package/package.json +13 -23
- package/dist/cli/commands/interactive-commands/auth/index.d.ts +0 -12
- package/dist/cli/commands/interactive-commands/auth/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/auth/index.js +0 -20
- package/dist/cli/commands/interactive-commands/command-parser.d.ts +0 -56
- package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/command-parser.js +0 -173
- package/dist/cli/commands/interactive-commands/commands.d.ts +0 -52
- package/dist/cli/commands/interactive-commands/commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/commands.js +0 -142
- package/dist/cli/commands/interactive-commands/documentation-commands.d.ts +0 -15
- package/dist/cli/commands/interactive-commands/documentation-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/documentation-commands.js +0 -39
- package/dist/cli/commands/interactive-commands/export/index.d.ts +0 -13
- package/dist/cli/commands/interactive-commands/export/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/export/index.js +0 -21
- package/dist/cli/commands/interactive-commands/general-commands.d.ts +0 -22
- package/dist/cli/commands/interactive-commands/general-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/general-commands.js +0 -458
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts +0 -13
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/mcp/index.js +0 -18
- package/dist/cli/commands/interactive-commands/model/index.d.ts +0 -13
- package/dist/cli/commands/interactive-commands/model/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/model/index.js +0 -19
- package/dist/cli/commands/interactive-commands/plugin/index.d.ts +0 -13
- package/dist/cli/commands/interactive-commands/plugin/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/plugin/index.js +0 -18
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts +0 -25
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/prompt-commands.js +0 -339
- package/dist/cli/commands/interactive-commands/session/index.d.ts +0 -16
- package/dist/cli/commands/interactive-commands/session/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/session/index.js +0 -15
- package/dist/cli/commands/interactive-commands/session/session-commands.d.ts +0 -32
- package/dist/cli/commands/interactive-commands/session/session-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/session/session-commands.js +0 -67
- package/dist/cli/commands/interactive-commands/system/index.d.ts +0 -13
- package/dist/cli/commands/interactive-commands/system/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/system/index.js +0 -12
- package/dist/cli/commands/interactive-commands/system/system-commands.d.ts +0 -18
- package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/system/system-commands.js +0 -197
- package/dist/cli/commands/interactive-commands/tool-commands.d.ts +0 -15
- package/dist/cli/commands/interactive-commands/tool-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/tool-commands.js +0 -24
- package/dist/cli/commands/interactive-commands/utils/arg-parser.d.ts +0 -57
- package/dist/cli/commands/interactive-commands/utils/arg-parser.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/utils/arg-parser.js +0 -81
- package/dist/cli/commands/interactive-commands/utils/command-output.d.ts +0 -40
- package/dist/cli/commands/interactive-commands/utils/command-output.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/utils/command-output.js +0 -56
- package/dist/cli/commands/interactive-commands/utils/format-output.d.ts +0 -14
- package/dist/cli/commands/interactive-commands/utils/format-output.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/utils/format-output.js +0 -18
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts +0 -52
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +0 -1
- package/dist/cli/ink-cli/InkCLIRefactored.js +0 -120
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +0 -44
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.js +0 -269
- package/dist/cli/ink-cli/components/BackgroundTasksPanel.d.ts +0 -18
- package/dist/cli/ink-cli/components/BackgroundTasksPanel.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/BackgroundTasksPanel.js +0 -48
- package/dist/cli/ink-cli/components/CustomInput.d.ts +0 -17
- package/dist/cli/ink-cli/components/CustomInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/CustomInput.js +0 -51
- package/dist/cli/ink-cli/components/CustomTextInput.d.ts +0 -16
- package/dist/cli/ink-cli/components/CustomTextInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/CustomTextInput.js +0 -36
- package/dist/cli/ink-cli/components/EditableMultiLineInput.d.ts +0 -19
- package/dist/cli/ink-cli/components/EditableMultiLineInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/EditableMultiLineInput.js +0 -120
- package/dist/cli/ink-cli/components/ElicitationForm.d.ts +0 -22
- package/dist/cli/ink-cli/components/ElicitationForm.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/ElicitationForm.js +0 -358
- package/dist/cli/ink-cli/components/ErrorBoundary.d.ts +0 -20
- package/dist/cli/ink-cli/components/ErrorBoundary.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/ErrorBoundary.js +0 -29
- package/dist/cli/ink-cli/components/Footer.d.ts +0 -22
- package/dist/cli/ink-cli/components/Footer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/Footer.js +0 -76
- package/dist/cli/ink-cli/components/HistorySearchBar.d.ts +0 -17
- package/dist/cli/ink-cli/components/HistorySearchBar.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/HistorySearchBar.js +0 -8
- package/dist/cli/ink-cli/components/MultiLineInput.d.ts +0 -12
- package/dist/cli/ink-cli/components/MultiLineInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/MultiLineInput.js +0 -27
- package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts +0 -26
- package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/ResourceAutocomplete.js +0 -376
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts +0 -28
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +0 -432
- package/dist/cli/ink-cli/components/StatusBar.d.ts +0 -41
- package/dist/cli/ink-cli/components/StatusBar.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/StatusBar.js +0 -110
- package/dist/cli/ink-cli/components/TextBufferInput.d.ts +0 -52
- package/dist/cli/ink-cli/components/TextBufferInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/TextBufferInput.js +0 -490
- package/dist/cli/ink-cli/components/TodoPanel.d.ts +0 -26
- package/dist/cli/ink-cli/components/TodoPanel.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/TodoPanel.js +0 -62
- package/dist/cli/ink-cli/components/base/BaseAutocomplete.d.ts +0 -29
- package/dist/cli/ink-cli/components/base/BaseAutocomplete.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/base/BaseAutocomplete.js +0 -98
- package/dist/cli/ink-cli/components/base/BaseSelector.d.ts +0 -36
- package/dist/cli/ink-cli/components/base/BaseSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/base/BaseSelector.js +0 -118
- package/dist/cli/ink-cli/components/base/index.d.ts +0 -6
- package/dist/cli/ink-cli/components/base/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/base/index.js +0 -5
- package/dist/cli/ink-cli/components/chat/ChatView.d.ts +0 -19
- package/dist/cli/ink-cli/components/chat/ChatView.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/ChatView.js +0 -11
- package/dist/cli/ink-cli/components/chat/Footer.d.ts +0 -9
- package/dist/cli/ink-cli/components/chat/Footer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/Footer.js +0 -8
- package/dist/cli/ink-cli/components/chat/Header.d.ts +0 -18
- package/dist/cli/ink-cli/components/chat/Header.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/Header.js +0 -16
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts +0 -21
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/MessageItem.js +0 -180
- package/dist/cli/ink-cli/components/chat/MessageList.d.ts +0 -16
- package/dist/cli/ink-cli/components/chat/MessageList.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/MessageList.js +0 -20
- package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts +0 -16
- package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.js +0 -27
- package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts +0 -18
- package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/ToolIcon.js +0 -46
- package/dist/cli/ink-cli/components/chat/index.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/index.js +0 -9
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.js +0 -6
- package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.js +0 -15
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.js +0 -9
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.js +0 -37
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.js +0 -9
- package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.js +0 -6
- package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.js +0 -29
- package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts +0 -45
- package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.js +0 -38
- package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts +0 -10
- package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.js +0 -6
- package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts +0 -13
- package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/index.js +0 -12
- package/dist/cli/ink-cli/components/input/InputArea.d.ts +0 -46
- package/dist/cli/ink-cli/components/input/InputArea.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/input/InputArea.js +0 -6
- package/dist/cli/ink-cli/components/input/index.d.ts +0 -5
- package/dist/cli/ink-cli/components/input/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/input/index.js +0 -4
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts +0 -27
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +0 -180
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts +0 -29
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.js +0 -107
- package/dist/cli/ink-cli/components/modes/index.d.ts +0 -10
- package/dist/cli/ink-cli/components/modes/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/modes/index.js +0 -9
- package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts +0 -26
- package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/ApiKeyInput.js +0 -92
- package/dist/cli/ink-cli/components/overlays/ContextStatsOverlay.d.ts +0 -26
- package/dist/cli/ink-cli/components/overlays/ContextStatsOverlay.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/ContextStatsOverlay.js +0 -241
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts +0 -29
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.js +0 -301
- package/dist/cli/ink-cli/components/overlays/ExportWizard.d.ts +0 -22
- package/dist/cli/ink-cli/components/overlays/ExportWizard.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/ExportWizard.js +0 -308
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts +0 -23
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +0 -70
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.d.ts +0 -20
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.js +0 -81
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.d.ts +0 -31
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.js +0 -297
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts +0 -22
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.js +0 -59
- package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts +0 -26
- package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpAddSelector.js +0 -73
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts +0 -21
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.js +0 -51
- package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts +0 -29
- package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpCustomWizard.js +0 -215
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts +0 -22
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.js +0 -80
- package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts +0 -21
- package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpSelector.js +0 -52
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts +0 -28
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpServerActions.js +0 -93
- package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts +0 -29
- package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/McpServerList.js +0 -116
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts +0 -28
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +0 -630
- package/dist/cli/ink-cli/components/overlays/PluginActions.d.ts +0 -27
- package/dist/cli/ink-cli/components/overlays/PluginActions.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PluginActions.js +0 -66
- package/dist/cli/ink-cli/components/overlays/PluginList.d.ts +0 -21
- package/dist/cli/ink-cli/components/overlays/PluginList.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PluginList.js +0 -70
- package/dist/cli/ink-cli/components/overlays/PluginManager.d.ts +0 -21
- package/dist/cli/ink-cli/components/overlays/PluginManager.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PluginManager.js +0 -63
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts +0 -22
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.js +0 -52
- package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts +0 -29
- package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PromptAddWizard.js +0 -166
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts +0 -27
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.js +0 -119
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts +0 -33
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/PromptList.js +0 -147
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts +0 -23
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.js +0 -189
- package/dist/cli/ink-cli/components/overlays/SessionRenameOverlay.d.ts +0 -21
- package/dist/cli/ink-cli/components/overlays/SessionRenameOverlay.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/SessionRenameOverlay.js +0 -63
- package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts +0 -26
- package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.js +0 -126
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts +0 -21
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.js +0 -42
- package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts +0 -20
- package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/StreamSelector.js +0 -58
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts +0 -26
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +0 -642
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.d.ts +0 -25
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.js +0 -609
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/index.d.ts +0 -15
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/index.js +0 -14
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts +0 -42
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.js +0 -547
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ApiKeyStep.d.ts +0 -25
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ApiKeyStep.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ApiKeyStep.js +0 -29
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ProviderSelector.d.ts +0 -17
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ProviderSelector.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ProviderSelector.js +0 -11
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/SetupInfoBanner.d.ts +0 -20
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/SetupInfoBanner.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/SetupInfoBanner.js +0 -10
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/WizardStepInput.d.ts +0 -30
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/WizardStepInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/WizardStepInput.js +0 -13
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/index.d.ts +0 -8
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/index.js +0 -7
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/types.d.ts +0 -85
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/types.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/types.js +0 -38
- package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts +0 -21
- package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/DiffRenderer.js +0 -65
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +0 -30
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +0 -66
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts +0 -19
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/FileRenderer.js +0 -26
- package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts +0 -21
- package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/GenericRenderer.js +0 -26
- package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts +0 -20
- package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/SearchRenderer.js +0 -26
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts +0 -21
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.js +0 -25
- package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts +0 -61
- package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/diff-shared.js +0 -158
- package/dist/cli/ink-cli/components/renderers/index.d.ts +0 -28
- package/dist/cli/ink-cli/components/renderers/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/renderers/index.js +0 -36
- package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts +0 -38
- package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/shared/MarkdownText.js +0 -389
- package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts +0 -44
- package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/shared/VirtualizedList.js +0 -300
- package/dist/cli/ink-cli/components/shared/text-buffer.d.ts +0 -185
- package/dist/cli/ink-cli/components/shared/text-buffer.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/shared/text-buffer.js +0 -1338
- package/dist/cli/ink-cli/constants/processingPhrases.d.ts +0 -10
- package/dist/cli/ink-cli/constants/processingPhrases.d.ts.map +0 -1
- package/dist/cli/ink-cli/constants/processingPhrases.js +0 -92
- package/dist/cli/ink-cli/constants/tips.d.ts +0 -15
- package/dist/cli/ink-cli/constants/tips.d.ts.map +0 -1
- package/dist/cli/ink-cli/constants/tips.js +0 -57
- package/dist/cli/ink-cli/containers/InputContainer.d.ts +0 -62
- package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +0 -1
- package/dist/cli/ink-cli/containers/InputContainer.js +0 -639
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts +0 -42
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +0 -1
- package/dist/cli/ink-cli/containers/OverlayContainer.js +0 -1824
- package/dist/cli/ink-cli/containers/index.d.ts +0 -6
- package/dist/cli/ink-cli/containers/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/containers/index.js +0 -5
- package/dist/cli/ink-cli/contexts/KeypressContext.d.ts +0 -36
- package/dist/cli/ink-cli/contexts/KeypressContext.d.ts.map +0 -1
- package/dist/cli/ink-cli/contexts/KeypressContext.js +0 -461
- package/dist/cli/ink-cli/contexts/MouseContext.d.ts +0 -27
- package/dist/cli/ink-cli/contexts/MouseContext.d.ts.map +0 -1
- package/dist/cli/ink-cli/contexts/MouseContext.js +0 -102
- package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts +0 -33
- package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts.map +0 -1
- package/dist/cli/ink-cli/contexts/ScrollProvider.js +0 -170
- package/dist/cli/ink-cli/contexts/SoundContext.d.ts +0 -23
- package/dist/cli/ink-cli/contexts/SoundContext.d.ts.map +0 -1
- package/dist/cli/ink-cli/contexts/SoundContext.js +0 -22
- package/dist/cli/ink-cli/contexts/index.d.ts +0 -8
- package/dist/cli/ink-cli/contexts/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/contexts/index.js +0 -7
- package/dist/cli/ink-cli/hooks/index.d.ts +0 -12
- package/dist/cli/ink-cli/hooks/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/index.js +0 -14
- package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts +0 -49
- package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useAgentEvents.js +0 -369
- package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts +0 -14
- package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useBatchedScroll.js +0 -25
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts +0 -52
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useCLIState.js +0 -223
- package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts +0 -24
- package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useElapsedTime.js +0 -69
- package/dist/cli/ink-cli/hooks/useGitBranch.d.ts +0 -13
- package/dist/cli/ink-cli/hooks/useGitBranch.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useGitBranch.js +0 -35
- package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts +0 -61
- package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useHistorySearch.js +0 -210
- package/dist/cli/ink-cli/hooks/useInputHistory.d.ts +0 -18
- package/dist/cli/ink-cli/hooks/useInputHistory.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useInputHistory.js +0 -26
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts +0 -136
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.js +0 -715
- package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.d.ts +0 -21
- package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.js +0 -80
- package/dist/cli/ink-cli/hooks/useKeypress.d.ts +0 -18
- package/dist/cli/ink-cli/hooks/useKeypress.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useKeypress.js +0 -26
- package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts +0 -30
- package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/usePhraseCycler.js +0 -68
- package/dist/cli/ink-cli/hooks/useStreaming.d.ts +0 -19
- package/dist/cli/ink-cli/hooks/useStreaming.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useStreaming.js +0 -26
- package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts +0 -14
- package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useTerminalSize.js +0 -31
- package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts +0 -46
- package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts.map +0 -1
- package/dist/cli/ink-cli/hooks/useTokenCounter.js +0 -122
- package/dist/cli/ink-cli/services/CommandService.d.ts +0 -58
- package/dist/cli/ink-cli/services/CommandService.d.ts.map +0 -1
- package/dist/cli/ink-cli/services/CommandService.js +0 -64
- package/dist/cli/ink-cli/services/InputService.d.ts +0 -40
- package/dist/cli/ink-cli/services/InputService.d.ts.map +0 -1
- package/dist/cli/ink-cli/services/InputService.js +0 -87
- package/dist/cli/ink-cli/services/MessageService.d.ts +0 -35
- package/dist/cli/ink-cli/services/MessageService.d.ts.map +0 -1
- package/dist/cli/ink-cli/services/MessageService.js +0 -49
- package/dist/cli/ink-cli/services/index.d.ts +0 -8
- package/dist/cli/ink-cli/services/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/services/index.js +0 -7
- package/dist/cli/ink-cli/services/processStream.d.ts +0 -75
- package/dist/cli/ink-cli/services/processStream.d.ts.map +0 -1
- package/dist/cli/ink-cli/services/processStream.js +0 -942
- package/dist/cli/ink-cli/state/actions.d.ts +0 -124
- package/dist/cli/ink-cli/state/actions.d.ts.map +0 -1
- package/dist/cli/ink-cli/state/actions.js +0 -8
- package/dist/cli/ink-cli/state/index.d.ts +0 -10
- package/dist/cli/ink-cli/state/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/state/index.js +0 -8
- package/dist/cli/ink-cli/state/initialState.d.ts +0 -12
- package/dist/cli/ink-cli/state/initialState.d.ts.map +0 -1
- package/dist/cli/ink-cli/state/initialState.js +0 -57
- package/dist/cli/ink-cli/state/reducer.d.ts +0 -15
- package/dist/cli/ink-cli/state/reducer.d.ts.map +0 -1
- package/dist/cli/ink-cli/state/reducer.js +0 -341
- package/dist/cli/ink-cli/state/streaming-state.d.ts +0 -27
- package/dist/cli/ink-cli/state/streaming-state.d.ts.map +0 -1
- package/dist/cli/ink-cli/state/streaming-state.js +0 -39
- package/dist/cli/ink-cli/state/types.d.ts +0 -366
- package/dist/cli/ink-cli/state/types.d.ts.map +0 -1
- package/dist/cli/ink-cli/state/types.js +0 -5
- package/dist/cli/ink-cli/utils/bracketedPaste.d.ts +0 -22
- package/dist/cli/ink-cli/utils/bracketedPaste.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/bracketedPaste.js +0 -27
- package/dist/cli/ink-cli/utils/clipboardUtils.d.ts +0 -49
- package/dist/cli/ink-cli/utils/clipboardUtils.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/clipboardUtils.js +0 -356
- package/dist/cli/ink-cli/utils/commandOverlays.d.ts +0 -33
- package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/commandOverlays.js +0 -84
- package/dist/cli/ink-cli/utils/debugLog.d.ts +0 -38
- package/dist/cli/ink-cli/utils/debugLog.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/debugLog.js +0 -66
- package/dist/cli/ink-cli/utils/idGenerator.d.ts +0 -10
- package/dist/cli/ink-cli/utils/idGenerator.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/idGenerator.js +0 -12
- package/dist/cli/ink-cli/utils/index.d.ts +0 -9
- package/dist/cli/ink-cli/utils/index.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/index.js +0 -13
- package/dist/cli/ink-cli/utils/input.d.ts +0 -25
- package/dist/cli/ink-cli/utils/input.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/input.js +0 -56
- package/dist/cli/ink-cli/utils/inputParsing.d.ts +0 -31
- package/dist/cli/ink-cli/utils/inputParsing.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/inputParsing.js +0 -70
- package/dist/cli/ink-cli/utils/llm-provider-display.d.ts +0 -3
- package/dist/cli/ink-cli/utils/llm-provider-display.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/llm-provider-display.js +0 -22
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts +0 -140
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/messageFormatting.js +0 -591
- package/dist/cli/ink-cli/utils/mouse.d.ts +0 -61
- package/dist/cli/ink-cli/utils/mouse.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/mouse.js +0 -209
- package/dist/cli/ink-cli/utils/soundNotification.d.ts +0 -71
- package/dist/cli/ink-cli/utils/soundNotification.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/soundNotification.js +0 -203
- package/dist/cli/ink-cli/utils/streamSplitter.d.ts +0 -44
- package/dist/cli/ink-cli/utils/streamSplitter.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/streamSplitter.js +0 -154
- package/dist/cli/ink-cli/utils/textUtils.d.ts +0 -63
- package/dist/cli/ink-cli/utils/textUtils.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/textUtils.js +0 -248
- package/dist/cli/ink-cli/utils/toolUtils.d.ts +0 -20
- package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +0 -1
- package/dist/cli/ink-cli/utils/toolUtils.js +0 -25
- package/dist/webui/assets/index-C9JXwpvo.css +0 -1
- package/dist/webui/assets/index-DwtueA8l.js +0 -2059
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/containers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* KeypressContext
|
|
3
|
-
*
|
|
4
|
-
* Provides keyboard input handling by reading stdin directly.
|
|
5
|
-
* Filters out mouse events before broadcasting to subscribers.
|
|
6
|
-
*
|
|
7
|
-
* This replaces Ink's useInput hook with a custom implementation that:
|
|
8
|
-
* 1. Reads stdin directly for full control over escape sequence parsing
|
|
9
|
-
* 2. Filters out mouse events so they don't interfere with keyboard handlers
|
|
10
|
-
* 3. Handles paste buffering and backslash+enter detection
|
|
11
|
-
*/
|
|
12
|
-
import type React from 'react';
|
|
13
|
-
export declare const BACKSLASH_ENTER_TIMEOUT = 5;
|
|
14
|
-
export declare const ESC_TIMEOUT = 50;
|
|
15
|
-
export declare const PASTE_TIMEOUT = 30000;
|
|
16
|
-
export interface Key {
|
|
17
|
-
name: string;
|
|
18
|
-
ctrl: boolean;
|
|
19
|
-
meta: boolean;
|
|
20
|
-
shift: boolean;
|
|
21
|
-
paste: boolean;
|
|
22
|
-
insertable: boolean;
|
|
23
|
-
sequence: string;
|
|
24
|
-
}
|
|
25
|
-
export type KeypressHandler = (key: Key) => void;
|
|
26
|
-
interface KeypressContextValue {
|
|
27
|
-
subscribe: (handler: KeypressHandler) => void;
|
|
28
|
-
unsubscribe: (handler: KeypressHandler) => void;
|
|
29
|
-
}
|
|
30
|
-
export declare function useKeypressContext(): KeypressContextValue;
|
|
31
|
-
export interface KeypressProviderProps {
|
|
32
|
-
children: React.ReactNode;
|
|
33
|
-
}
|
|
34
|
-
export declare function KeypressProvider({ children }: KeypressProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=KeypressContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KeypressContext.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/contexts/KeypressContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,aAAa,QAAS,CAAC;AAmGpC,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;AAEjD,UAAU,oBAAoB;IAC1B,SAAS,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC9C,WAAW,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;CACnD;AAID,wBAAgB,kBAAkB,yBAMjC;AAqUD,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,2CA+CnE"}
|
|
@@ -1,461 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* KeypressContext
|
|
4
|
-
*
|
|
5
|
-
* Provides keyboard input handling by reading stdin directly.
|
|
6
|
-
* Filters out mouse events before broadcasting to subscribers.
|
|
7
|
-
*
|
|
8
|
-
* This replaces Ink's useInput hook with a custom implementation that:
|
|
9
|
-
* 1. Reads stdin directly for full control over escape sequence parsing
|
|
10
|
-
* 2. Filters out mouse events so they don't interfere with keyboard handlers
|
|
11
|
-
* 3. Handles paste buffering and backslash+enter detection
|
|
12
|
-
*/
|
|
13
|
-
import { useStdin } from 'ink';
|
|
14
|
-
import { createContext, useCallback, useContext, useEffect, useRef } from 'react';
|
|
15
|
-
import { ESC, FOCUS_IN, FOCUS_OUT } from '../utils/input.js';
|
|
16
|
-
import { parseMouseEvent } from '../utils/mouse.js';
|
|
17
|
-
export const BACKSLASH_ENTER_TIMEOUT = 5;
|
|
18
|
-
export const ESC_TIMEOUT = 50;
|
|
19
|
-
export const PASTE_TIMEOUT = 30_000;
|
|
20
|
-
// Key name mapping for escape sequences
|
|
21
|
-
const KEY_INFO_MAP = {
|
|
22
|
-
'[200~': { name: 'paste-start' },
|
|
23
|
-
'[201~': { name: 'paste-end' },
|
|
24
|
-
'[[A': { name: 'f1' },
|
|
25
|
-
'[[B': { name: 'f2' },
|
|
26
|
-
'[[C': { name: 'f3' },
|
|
27
|
-
'[[D': { name: 'f4' },
|
|
28
|
-
'[[E': { name: 'f5' },
|
|
29
|
-
'[1~': { name: 'home' },
|
|
30
|
-
'[2~': { name: 'insert' },
|
|
31
|
-
'[3~': { name: 'delete' },
|
|
32
|
-
'[4~': { name: 'end' },
|
|
33
|
-
'[5~': { name: 'pageup' },
|
|
34
|
-
'[6~': { name: 'pagedown' },
|
|
35
|
-
'[7~': { name: 'home' },
|
|
36
|
-
'[8~': { name: 'end' },
|
|
37
|
-
'[11~': { name: 'f1' },
|
|
38
|
-
'[12~': { name: 'f2' },
|
|
39
|
-
'[13~': { name: 'f3' },
|
|
40
|
-
'[14~': { name: 'f4' },
|
|
41
|
-
'[15~': { name: 'f5' },
|
|
42
|
-
'[17~': { name: 'f6' },
|
|
43
|
-
'[18~': { name: 'f7' },
|
|
44
|
-
'[19~': { name: 'f8' },
|
|
45
|
-
'[20~': { name: 'f9' },
|
|
46
|
-
'[21~': { name: 'f10' },
|
|
47
|
-
'[23~': { name: 'f11' },
|
|
48
|
-
'[24~': { name: 'f12' },
|
|
49
|
-
'[A': { name: 'up' },
|
|
50
|
-
'[B': { name: 'down' },
|
|
51
|
-
'[C': { name: 'right' },
|
|
52
|
-
'[D': { name: 'left' },
|
|
53
|
-
'[E': { name: 'clear' },
|
|
54
|
-
'[F': { name: 'end' },
|
|
55
|
-
'[H': { name: 'home' },
|
|
56
|
-
'[P': { name: 'f1' },
|
|
57
|
-
'[Q': { name: 'f2' },
|
|
58
|
-
'[R': { name: 'f3' },
|
|
59
|
-
'[S': { name: 'f4' },
|
|
60
|
-
OA: { name: 'up' },
|
|
61
|
-
OB: { name: 'down' },
|
|
62
|
-
OC: { name: 'right' },
|
|
63
|
-
OD: { name: 'left' },
|
|
64
|
-
OE: { name: 'clear' },
|
|
65
|
-
OF: { name: 'end' },
|
|
66
|
-
OH: { name: 'home' },
|
|
67
|
-
OP: { name: 'f1' },
|
|
68
|
-
OQ: { name: 'f2' },
|
|
69
|
-
OR: { name: 'f3' },
|
|
70
|
-
OS: { name: 'f4' },
|
|
71
|
-
'[[5~': { name: 'pageup' },
|
|
72
|
-
'[[6~': { name: 'pagedown' },
|
|
73
|
-
'[9u': { name: 'tab' },
|
|
74
|
-
'[13u': { name: 'return' },
|
|
75
|
-
'[27u': { name: 'escape' },
|
|
76
|
-
'[127u': { name: 'backspace' },
|
|
77
|
-
'[57414u': { name: 'return' }, // Numpad Enter
|
|
78
|
-
'[a': { name: 'up', shift: true },
|
|
79
|
-
'[b': { name: 'down', shift: true },
|
|
80
|
-
'[c': { name: 'right', shift: true },
|
|
81
|
-
'[d': { name: 'left', shift: true },
|
|
82
|
-
'[e': { name: 'clear', shift: true },
|
|
83
|
-
'[2$': { name: 'insert', shift: true },
|
|
84
|
-
'[3$': { name: 'delete', shift: true },
|
|
85
|
-
'[5$': { name: 'pageup', shift: true },
|
|
86
|
-
'[6$': { name: 'pagedown', shift: true },
|
|
87
|
-
'[7$': { name: 'home', shift: true },
|
|
88
|
-
'[8$': { name: 'end', shift: true },
|
|
89
|
-
'[Z': { name: 'tab', shift: true },
|
|
90
|
-
Oa: { name: 'up', ctrl: true },
|
|
91
|
-
Ob: { name: 'down', ctrl: true },
|
|
92
|
-
Oc: { name: 'right', ctrl: true },
|
|
93
|
-
Od: { name: 'left', ctrl: true },
|
|
94
|
-
Oe: { name: 'clear', ctrl: true },
|
|
95
|
-
'[2^': { name: 'insert', ctrl: true },
|
|
96
|
-
'[3^': { name: 'delete', ctrl: true },
|
|
97
|
-
'[5^': { name: 'pageup', ctrl: true },
|
|
98
|
-
'[6^': { name: 'pagedown', ctrl: true },
|
|
99
|
-
'[7^': { name: 'home', ctrl: true },
|
|
100
|
-
'[8^': { name: 'end', ctrl: true },
|
|
101
|
-
};
|
|
102
|
-
// Mac Alt key character mapping
|
|
103
|
-
const MAC_ALT_KEY_CHARACTER_MAP = {
|
|
104
|
-
'\u222B': 'b', // "∫" back one word
|
|
105
|
-
'\u0192': 'f', // "ƒ" forward one word
|
|
106
|
-
'\u00B5': 'm', // "µ" toggle markup view
|
|
107
|
-
};
|
|
108
|
-
const kUTF16SurrogateThreshold = 0x10000;
|
|
109
|
-
function charLengthAt(str, i) {
|
|
110
|
-
if (str.length <= i)
|
|
111
|
-
return 1;
|
|
112
|
-
const code = str.codePointAt(i);
|
|
113
|
-
return code !== undefined && code >= kUTF16SurrogateThreshold ? 2 : 1;
|
|
114
|
-
}
|
|
115
|
-
const KeypressContext = createContext(undefined);
|
|
116
|
-
export function useKeypressContext() {
|
|
117
|
-
const context = useContext(KeypressContext);
|
|
118
|
-
if (!context) {
|
|
119
|
-
throw new Error('useKeypressContext must be used within a KeypressProvider');
|
|
120
|
-
}
|
|
121
|
-
return context;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Filter out non-keyboard events (mouse, focus) before passing to handler
|
|
125
|
-
*/
|
|
126
|
-
function nonKeyboardEventFilter(keypressHandler) {
|
|
127
|
-
return (key) => {
|
|
128
|
-
if (!parseMouseEvent(key.sequence) &&
|
|
129
|
-
key.sequence !== FOCUS_IN &&
|
|
130
|
-
key.sequence !== FOCUS_OUT) {
|
|
131
|
-
keypressHandler(key);
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Buffer backslash followed by enter as shift+enter (newline)
|
|
137
|
-
*/
|
|
138
|
-
function bufferBackslashEnter(keypressHandler) {
|
|
139
|
-
const bufferer = (function* () {
|
|
140
|
-
while (true) {
|
|
141
|
-
const key = yield;
|
|
142
|
-
if (key == null) {
|
|
143
|
-
continue;
|
|
144
|
-
}
|
|
145
|
-
else if (key.sequence !== '\\') {
|
|
146
|
-
keypressHandler(key);
|
|
147
|
-
continue;
|
|
148
|
-
}
|
|
149
|
-
const timeoutId = setTimeout(() => bufferer.next(null), BACKSLASH_ENTER_TIMEOUT);
|
|
150
|
-
const nextKey = yield;
|
|
151
|
-
clearTimeout(timeoutId);
|
|
152
|
-
if (nextKey === null) {
|
|
153
|
-
keypressHandler(key);
|
|
154
|
-
}
|
|
155
|
-
else if (nextKey.name === 'return') {
|
|
156
|
-
keypressHandler({
|
|
157
|
-
...nextKey,
|
|
158
|
-
shift: true,
|
|
159
|
-
sequence: '\r',
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
keypressHandler(key);
|
|
164
|
-
keypressHandler(nextKey);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
})();
|
|
168
|
-
bufferer.next(); // Prime the generator
|
|
169
|
-
return (key) => bufferer.next(key);
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Buffer paste events between paste-start and paste-end sequences
|
|
173
|
-
*/
|
|
174
|
-
function bufferPaste(keypressHandler) {
|
|
175
|
-
const bufferer = (function* () {
|
|
176
|
-
while (true) {
|
|
177
|
-
let key = yield;
|
|
178
|
-
if (key === null) {
|
|
179
|
-
continue;
|
|
180
|
-
}
|
|
181
|
-
else if (key.name !== 'paste-start') {
|
|
182
|
-
keypressHandler(key);
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
let buffer = '';
|
|
186
|
-
while (true) {
|
|
187
|
-
const timeoutId = setTimeout(() => bufferer.next(null), PASTE_TIMEOUT);
|
|
188
|
-
key = yield;
|
|
189
|
-
clearTimeout(timeoutId);
|
|
190
|
-
if (key === null) {
|
|
191
|
-
// Paste timeout - emit what we have
|
|
192
|
-
break;
|
|
193
|
-
}
|
|
194
|
-
if (key.name === 'paste-end') {
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
buffer += key.sequence;
|
|
198
|
-
}
|
|
199
|
-
if (buffer.length > 0) {
|
|
200
|
-
keypressHandler({
|
|
201
|
-
name: '',
|
|
202
|
-
ctrl: false,
|
|
203
|
-
meta: false,
|
|
204
|
-
shift: false,
|
|
205
|
-
paste: true,
|
|
206
|
-
insertable: true,
|
|
207
|
-
sequence: buffer,
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
})();
|
|
212
|
-
bufferer.next(); // Prime the generator
|
|
213
|
-
return (key) => bufferer.next(key);
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Create a data listener that parses raw stdin into keypress events
|
|
217
|
-
*/
|
|
218
|
-
function createDataListener(keypressHandler) {
|
|
219
|
-
const parser = emitKeys(keypressHandler);
|
|
220
|
-
parser.next(); // Prime the generator
|
|
221
|
-
let timeoutId;
|
|
222
|
-
return (data) => {
|
|
223
|
-
clearTimeout(timeoutId);
|
|
224
|
-
for (const char of data) {
|
|
225
|
-
parser.next(char);
|
|
226
|
-
}
|
|
227
|
-
if (data.length !== 0) {
|
|
228
|
-
timeoutId = setTimeout(() => parser.next(''), ESC_TIMEOUT);
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Generator that translates raw keypress characters into key events.
|
|
234
|
-
* Buffers escape sequences until complete or timeout.
|
|
235
|
-
*/
|
|
236
|
-
function* emitKeys(keypressHandler) {
|
|
237
|
-
while (true) {
|
|
238
|
-
let ch = yield;
|
|
239
|
-
let sequence = ch;
|
|
240
|
-
let escaped = false;
|
|
241
|
-
let name = undefined;
|
|
242
|
-
let ctrl = false;
|
|
243
|
-
let meta = false;
|
|
244
|
-
let shift = false;
|
|
245
|
-
let code = undefined;
|
|
246
|
-
let insertable = false;
|
|
247
|
-
if (ch === ESC) {
|
|
248
|
-
escaped = true;
|
|
249
|
-
ch = yield;
|
|
250
|
-
sequence += ch;
|
|
251
|
-
if (ch === ESC) {
|
|
252
|
-
ch = yield;
|
|
253
|
-
sequence += ch;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
if (escaped && (ch === 'O' || ch === '[')) {
|
|
257
|
-
// ANSI escape sequence
|
|
258
|
-
code = ch;
|
|
259
|
-
let modifier = 0;
|
|
260
|
-
if (ch === 'O') {
|
|
261
|
-
// ESC O letter or ESC O modifier letter
|
|
262
|
-
ch = yield;
|
|
263
|
-
sequence += ch;
|
|
264
|
-
if (ch >= '0' && ch <= '9') {
|
|
265
|
-
modifier = parseInt(ch, 10) - 1;
|
|
266
|
-
ch = yield;
|
|
267
|
-
sequence += ch;
|
|
268
|
-
}
|
|
269
|
-
code += ch;
|
|
270
|
-
}
|
|
271
|
-
else if (ch === '[') {
|
|
272
|
-
// ESC [ sequences
|
|
273
|
-
ch = yield;
|
|
274
|
-
sequence += ch;
|
|
275
|
-
if (ch === '[') {
|
|
276
|
-
code += ch;
|
|
277
|
-
ch = yield;
|
|
278
|
-
sequence += ch;
|
|
279
|
-
}
|
|
280
|
-
const cmdStart = sequence.length - 1;
|
|
281
|
-
// Collect digits
|
|
282
|
-
while (ch >= '0' && ch <= '9') {
|
|
283
|
-
ch = yield;
|
|
284
|
-
sequence += ch;
|
|
285
|
-
}
|
|
286
|
-
// Handle modifiers
|
|
287
|
-
if (ch === ';') {
|
|
288
|
-
while (ch === ';') {
|
|
289
|
-
ch = yield;
|
|
290
|
-
sequence += ch;
|
|
291
|
-
while (ch >= '0' && ch <= '9') {
|
|
292
|
-
ch = yield;
|
|
293
|
-
sequence += ch;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
else if (ch === '<') {
|
|
298
|
-
// SGR mouse mode - consume until m/M
|
|
299
|
-
ch = yield;
|
|
300
|
-
sequence += ch;
|
|
301
|
-
while (ch === '' || ch === ';' || (ch >= '0' && ch <= '9')) {
|
|
302
|
-
ch = yield;
|
|
303
|
-
sequence += ch;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
else if (ch === 'M') {
|
|
307
|
-
// X11 mouse mode - 3 bytes after M
|
|
308
|
-
ch = yield;
|
|
309
|
-
sequence += ch;
|
|
310
|
-
ch = yield;
|
|
311
|
-
sequence += ch;
|
|
312
|
-
ch = yield;
|
|
313
|
-
sequence += ch;
|
|
314
|
-
}
|
|
315
|
-
const cmd = sequence.slice(cmdStart);
|
|
316
|
-
let match;
|
|
317
|
-
if ((match = /^(\d+)(?:;(\d+))?(?:;(\d+))?([~^$u])$/.exec(cmd))) {
|
|
318
|
-
if (match[1] === '27' && match[3] && match[4] === '~') {
|
|
319
|
-
// modifyOtherKeys format
|
|
320
|
-
code += match[3] + 'u';
|
|
321
|
-
modifier = parseInt(match[2] ?? '1', 10) - 1;
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
code += (match[1] ?? '') + (match[4] ?? '');
|
|
325
|
-
modifier = parseInt(match[2] ?? '1', 10) - 1;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
else if ((match = /^(\d+)?(?:;(\d+))?([A-Za-z])$/.exec(cmd))) {
|
|
329
|
-
code += match[3] ?? '';
|
|
330
|
-
modifier = parseInt(match[2] ?? match[1] ?? '1', 10) - 1;
|
|
331
|
-
}
|
|
332
|
-
else {
|
|
333
|
-
code += cmd;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
// Parse modifiers (xterm encoding: shift=1, meta/alt=2, ctrl=4)
|
|
337
|
-
ctrl = !!(modifier & 4);
|
|
338
|
-
meta = !!(modifier & 2);
|
|
339
|
-
shift = !!(modifier & 1);
|
|
340
|
-
const keyInfo = KEY_INFO_MAP[code];
|
|
341
|
-
if (keyInfo) {
|
|
342
|
-
name = keyInfo.name;
|
|
343
|
-
if (keyInfo.shift)
|
|
344
|
-
shift = true;
|
|
345
|
-
if (keyInfo.ctrl)
|
|
346
|
-
ctrl = true;
|
|
347
|
-
}
|
|
348
|
-
else {
|
|
349
|
-
name = 'undefined';
|
|
350
|
-
if ((ctrl || meta) && (code.endsWith('u') || code.endsWith('~'))) {
|
|
351
|
-
const codeNumber = parseInt(code.slice(1, -1), 10);
|
|
352
|
-
if (codeNumber >= 'a'.charCodeAt(0) && codeNumber <= 'z'.charCodeAt(0)) {
|
|
353
|
-
name = String.fromCharCode(codeNumber);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
else if (ch === '\r') {
|
|
359
|
-
name = 'return';
|
|
360
|
-
meta = escaped;
|
|
361
|
-
}
|
|
362
|
-
else if (ch === '\n') {
|
|
363
|
-
name = 'enter';
|
|
364
|
-
meta = escaped;
|
|
365
|
-
}
|
|
366
|
-
else if (ch === '\t') {
|
|
367
|
-
name = 'tab';
|
|
368
|
-
meta = escaped;
|
|
369
|
-
}
|
|
370
|
-
else if (ch === '\b' || ch === '\x7f') {
|
|
371
|
-
name = 'backspace';
|
|
372
|
-
meta = escaped;
|
|
373
|
-
}
|
|
374
|
-
else if (ch === ESC) {
|
|
375
|
-
name = 'escape';
|
|
376
|
-
meta = escaped;
|
|
377
|
-
}
|
|
378
|
-
else if (ch === ' ') {
|
|
379
|
-
name = 'space';
|
|
380
|
-
meta = escaped;
|
|
381
|
-
insertable = true;
|
|
382
|
-
}
|
|
383
|
-
else if (!escaped && ch <= '\x1a') {
|
|
384
|
-
// ctrl+letter
|
|
385
|
-
name = String.fromCharCode(ch.charCodeAt(0) + 'a'.charCodeAt(0) - 1);
|
|
386
|
-
ctrl = true;
|
|
387
|
-
}
|
|
388
|
-
else if (/^[0-9A-Za-z]$/.exec(ch) !== null) {
|
|
389
|
-
name = ch.toLowerCase();
|
|
390
|
-
shift = /^[A-Z]$/.exec(ch) !== null;
|
|
391
|
-
meta = escaped;
|
|
392
|
-
insertable = true;
|
|
393
|
-
}
|
|
394
|
-
else if (MAC_ALT_KEY_CHARACTER_MAP[ch] && process.platform === 'darwin') {
|
|
395
|
-
name = MAC_ALT_KEY_CHARACTER_MAP[ch];
|
|
396
|
-
meta = true;
|
|
397
|
-
}
|
|
398
|
-
else if (sequence === `${ESC}${ESC}`) {
|
|
399
|
-
name = 'escape';
|
|
400
|
-
meta = true;
|
|
401
|
-
// Emit first escape key
|
|
402
|
-
keypressHandler({
|
|
403
|
-
name: 'escape',
|
|
404
|
-
ctrl,
|
|
405
|
-
meta,
|
|
406
|
-
shift,
|
|
407
|
-
paste: false,
|
|
408
|
-
insertable: false,
|
|
409
|
-
sequence: ESC,
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
else if (escaped) {
|
|
413
|
-
name = ch.length ? undefined : 'escape';
|
|
414
|
-
meta = true;
|
|
415
|
-
}
|
|
416
|
-
else {
|
|
417
|
-
// Any other character is printable
|
|
418
|
-
insertable = true;
|
|
419
|
-
}
|
|
420
|
-
if ((sequence.length !== 0 && (name !== undefined || escaped)) ||
|
|
421
|
-
charLengthAt(sequence, 0) === sequence.length) {
|
|
422
|
-
keypressHandler({
|
|
423
|
-
name: name || '',
|
|
424
|
-
ctrl,
|
|
425
|
-
meta,
|
|
426
|
-
shift,
|
|
427
|
-
paste: false,
|
|
428
|
-
insertable,
|
|
429
|
-
sequence,
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
export function KeypressProvider({ children }) {
|
|
435
|
-
const { stdin, setRawMode } = useStdin();
|
|
436
|
-
const subscribers = useRef(new Set()).current;
|
|
437
|
-
const subscribe = useCallback((handler) => subscribers.add(handler), [subscribers]);
|
|
438
|
-
const unsubscribe = useCallback((handler) => subscribers.delete(handler), [subscribers]);
|
|
439
|
-
const broadcast = useCallback((key) => subscribers.forEach((handler) => handler(key)), [subscribers]);
|
|
440
|
-
useEffect(() => {
|
|
441
|
-
const wasRaw = stdin.isRaw;
|
|
442
|
-
if (wasRaw === false) {
|
|
443
|
-
setRawMode(true);
|
|
444
|
-
}
|
|
445
|
-
process.stdin.setEncoding('utf8');
|
|
446
|
-
// Build the processing pipeline:
|
|
447
|
-
// dataListener -> pasteBufferer -> backslashBufferer -> mouseFilterer -> broadcast
|
|
448
|
-
const mouseFilterer = nonKeyboardEventFilter(broadcast);
|
|
449
|
-
const backslashBufferer = bufferBackslashEnter(mouseFilterer);
|
|
450
|
-
const pasteBufferer = bufferPaste(backslashBufferer);
|
|
451
|
-
const dataListener = createDataListener(pasteBufferer);
|
|
452
|
-
stdin.on('data', dataListener);
|
|
453
|
-
return () => {
|
|
454
|
-
stdin.removeListener('data', dataListener);
|
|
455
|
-
if (wasRaw === false) {
|
|
456
|
-
setRawMode(false);
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
}, [stdin, setRawMode, broadcast]);
|
|
460
|
-
return (_jsx(KeypressContext.Provider, { value: { subscribe, unsubscribe }, children: children }));
|
|
461
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MouseContext
|
|
3
|
-
*
|
|
4
|
-
* Provides mouse event handling by reading stdin directly.
|
|
5
|
-
* Runs in parallel with KeypressProvider - each reads stdin independently.
|
|
6
|
-
*/
|
|
7
|
-
import type React from 'react';
|
|
8
|
-
import { type MouseEvent, type MouseEventName, type MouseHandler } from '../utils/mouse.js';
|
|
9
|
-
export type { MouseEvent, MouseEventName, MouseHandler };
|
|
10
|
-
interface MouseContextValue {
|
|
11
|
-
subscribe: (handler: MouseHandler) => void;
|
|
12
|
-
unsubscribe: (handler: MouseHandler) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare function useMouseContext(): MouseContextValue;
|
|
15
|
-
/**
|
|
16
|
-
* Hook to subscribe to mouse events
|
|
17
|
-
*/
|
|
18
|
-
export declare function useMouse(handler: MouseHandler, { isActive }?: {
|
|
19
|
-
isActive?: boolean | undefined;
|
|
20
|
-
}): void;
|
|
21
|
-
export interface MouseProviderProps {
|
|
22
|
-
children: React.ReactNode;
|
|
23
|
-
/** Whether mouse events are enabled (sends terminal escape codes) */
|
|
24
|
-
mouseEventsEnabled?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export declare function MouseProvider({ children, mouseEventsEnabled }: MouseProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
//# sourceMappingURL=MouseContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MouseContext.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/contexts/MouseContext.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAKH,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,YAAY,EACpB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC;AAIzD,UAAU,iBAAiB;IACvB,SAAS,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IAC3C,WAAW,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;CAChD;AAID,wBAAgB,eAAe,sBAM9B;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,QAAe,EAAE;;CAAK,QAWvE;AAED,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,qEAAqE;IACrE,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,kBAAyB,EAAE,EAAE,kBAAkB,2CA2FxF"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* MouseContext
|
|
4
|
-
*
|
|
5
|
-
* Provides mouse event handling by reading stdin directly.
|
|
6
|
-
* Runs in parallel with KeypressProvider - each reads stdin independently.
|
|
7
|
-
*/
|
|
8
|
-
import { useStdin } from 'ink';
|
|
9
|
-
import { createContext, useCallback, useContext, useEffect, useRef } from 'react';
|
|
10
|
-
import { ESC } from '../utils/input.js';
|
|
11
|
-
import { parseMouseEvent, isIncompleteMouseSequence, enableMouseEvents, disableMouseEvents, } from '../utils/mouse.js';
|
|
12
|
-
const MAX_MOUSE_BUFFER_SIZE = 4096;
|
|
13
|
-
const MouseContext = createContext(undefined);
|
|
14
|
-
export function useMouseContext() {
|
|
15
|
-
const context = useContext(MouseContext);
|
|
16
|
-
if (!context) {
|
|
17
|
-
throw new Error('useMouseContext must be used within a MouseProvider');
|
|
18
|
-
}
|
|
19
|
-
return context;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Hook to subscribe to mouse events
|
|
23
|
-
*/
|
|
24
|
-
export function useMouse(handler, { isActive = true } = {}) {
|
|
25
|
-
const { subscribe, unsubscribe } = useMouseContext();
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
if (!isActive) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
subscribe(handler);
|
|
31
|
-
return () => unsubscribe(handler);
|
|
32
|
-
}, [isActive, handler, subscribe, unsubscribe]);
|
|
33
|
-
}
|
|
34
|
-
export function MouseProvider({ children, mouseEventsEnabled = true }) {
|
|
35
|
-
const { stdin } = useStdin();
|
|
36
|
-
const subscribers = useRef(new Set()).current;
|
|
37
|
-
const subscribe = useCallback((handler) => {
|
|
38
|
-
subscribers.add(handler);
|
|
39
|
-
}, [subscribers]);
|
|
40
|
-
const unsubscribe = useCallback((handler) => {
|
|
41
|
-
subscribers.delete(handler);
|
|
42
|
-
}, [subscribers]);
|
|
43
|
-
// Enable/disable mouse events in terminal
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (!mouseEventsEnabled) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
enableMouseEvents();
|
|
49
|
-
return () => {
|
|
50
|
-
disableMouseEvents();
|
|
51
|
-
};
|
|
52
|
-
}, [mouseEventsEnabled]);
|
|
53
|
-
// Listen to stdin for mouse events
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (!mouseEventsEnabled) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
let mouseBuffer = '';
|
|
59
|
-
const broadcast = (event) => {
|
|
60
|
-
for (const handler of subscribers) {
|
|
61
|
-
// Handler can return true to indicate it handled the event
|
|
62
|
-
if (handler(event) === true) {
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
const handleData = (data) => {
|
|
68
|
-
mouseBuffer += typeof data === 'string' ? data : data.toString('utf-8');
|
|
69
|
-
// Safety cap to prevent infinite buffer growth
|
|
70
|
-
if (mouseBuffer.length > MAX_MOUSE_BUFFER_SIZE) {
|
|
71
|
-
mouseBuffer = mouseBuffer.slice(-MAX_MOUSE_BUFFER_SIZE);
|
|
72
|
-
}
|
|
73
|
-
while (mouseBuffer.length > 0) {
|
|
74
|
-
const parsed = parseMouseEvent(mouseBuffer);
|
|
75
|
-
if (parsed) {
|
|
76
|
-
broadcast(parsed.event);
|
|
77
|
-
mouseBuffer = mouseBuffer.slice(parsed.length);
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
if (isIncompleteMouseSequence(mouseBuffer)) {
|
|
81
|
-
break; // Wait for more data
|
|
82
|
-
}
|
|
83
|
-
// Not a valid sequence at start, and not waiting for more data.
|
|
84
|
-
// Discard garbage until next possible sequence start.
|
|
85
|
-
const nextEsc = mouseBuffer.indexOf(ESC, 1);
|
|
86
|
-
if (nextEsc !== -1) {
|
|
87
|
-
mouseBuffer = mouseBuffer.slice(nextEsc);
|
|
88
|
-
// Loop continues to try parsing at new location
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
mouseBuffer = '';
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
stdin.on('data', handleData);
|
|
97
|
-
return () => {
|
|
98
|
-
stdin.removeListener('data', handleData);
|
|
99
|
-
};
|
|
100
|
-
}, [stdin, mouseEventsEnabled, subscribers]);
|
|
101
|
-
return (_jsx(MouseContext.Provider, { value: { subscribe, unsubscribe }, children: children }));
|
|
102
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ScrollProvider
|
|
3
|
-
*
|
|
4
|
-
* Manages scrollable components and handles mouse scroll events.
|
|
5
|
-
* Components register themselves as scrollable, and the provider
|
|
6
|
-
* routes scroll events to the appropriate component.
|
|
7
|
-
*/
|
|
8
|
-
import type React from 'react';
|
|
9
|
-
import { type DOMElement } from 'ink';
|
|
10
|
-
export interface ScrollState {
|
|
11
|
-
scrollTop: number;
|
|
12
|
-
scrollHeight: number;
|
|
13
|
-
innerHeight: number;
|
|
14
|
-
}
|
|
15
|
-
export interface ScrollableEntry {
|
|
16
|
-
id: string;
|
|
17
|
-
ref: React.RefObject<DOMElement | null>;
|
|
18
|
-
getScrollState: () => ScrollState;
|
|
19
|
-
scrollBy: (delta: number) => void;
|
|
20
|
-
scrollTo?: (scrollTop: number, duration?: number) => void;
|
|
21
|
-
hasFocus: () => boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface ScrollProviderProps {
|
|
24
|
-
children: React.ReactNode;
|
|
25
|
-
/** Callback when user attempts to select text (drag without Option key) */
|
|
26
|
-
onSelectionAttempt?: () => void;
|
|
27
|
-
}
|
|
28
|
-
export declare const ScrollProvider: React.FC<ScrollProviderProps>;
|
|
29
|
-
/**
|
|
30
|
-
* Hook to register a component as scrollable
|
|
31
|
-
*/
|
|
32
|
-
export declare const useScrollable: (entry: Omit<ScrollableEntry, "id">, isActive: boolean) => void;
|
|
33
|
-
//# sourceMappingURL=ScrollProvider.d.ts.map
|