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,592 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* ElicitationForm Component
|
|
4
|
-
* Renders a form for ask_user/elicitation requests in the CLI.
|
|
5
|
-
*
|
|
6
|
-
* Uses a wizard flow (one question at a time) to avoid huge modals and improve
|
|
7
|
-
* usability on small terminals.
|
|
8
|
-
*/
|
|
9
|
-
import { useState, forwardRef, useImperativeHandle, useCallback, useMemo } from 'react';
|
|
10
|
-
import { Box, Text } from 'ink';
|
|
11
|
-
import wrapAnsi from 'wrap-ansi';
|
|
12
|
-
import { useTerminalSize } from '../hooks/useTerminalSize.js';
|
|
13
|
-
import { parseElicitationSchema } from '../utils/elicitationSchema.js';
|
|
14
|
-
function hasOwn(obj, key) {
|
|
15
|
-
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
16
|
-
}
|
|
17
|
-
function getDisplayValue(value) {
|
|
18
|
-
if (value === undefined || value === null || value === '')
|
|
19
|
-
return '—';
|
|
20
|
-
if (Array.isArray(value))
|
|
21
|
-
return value.length > 0 ? value.join(', ') : '—';
|
|
22
|
-
if (value === true)
|
|
23
|
-
return 'Yes';
|
|
24
|
-
if (value === false)
|
|
25
|
-
return 'No';
|
|
26
|
-
return String(value ?? '');
|
|
27
|
-
}
|
|
28
|
-
function clamp(value, min, max) {
|
|
29
|
-
return Math.max(min, Math.min(max, value));
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Form component for elicitation/ask_user requests
|
|
33
|
-
*/
|
|
34
|
-
export const ElicitationForm = forwardRef(({ metadata, onSubmit, onCancel }, ref) => {
|
|
35
|
-
const { rows: terminalRows, columns: terminalColumns } = useTerminalSize();
|
|
36
|
-
const headerLineCount = 1;
|
|
37
|
-
const stepHeaderLineCount = 2; // hard cap: 2 lines
|
|
38
|
-
const spacerAfterStepLineCount = 1;
|
|
39
|
-
const questionLineCount = 2;
|
|
40
|
-
const helpLineCount = 2;
|
|
41
|
-
const errorLineCount = 1;
|
|
42
|
-
const questionHeaderHeight = headerLineCount +
|
|
43
|
-
stepHeaderLineCount +
|
|
44
|
-
spacerAfterStepLineCount +
|
|
45
|
-
questionLineCount +
|
|
46
|
-
helpLineCount +
|
|
47
|
-
errorLineCount;
|
|
48
|
-
const reviewHeaderHeight = headerLineCount + spacerAfterStepLineCount;
|
|
49
|
-
const maxHeaderHeight = Math.max(questionHeaderHeight, reviewHeaderHeight);
|
|
50
|
-
const footerHeight = 1; // key hints
|
|
51
|
-
const minContentHeight = 4;
|
|
52
|
-
const viewportHeight = useMemo(() => {
|
|
53
|
-
// Ink clears + redraws when dynamic output height >= terminal rows, which looks like flicker.
|
|
54
|
-
// Keep the elicitation UI small and scroll internally to stay under that threshold.
|
|
55
|
-
// Leave slack so Ink doesn't hit the "clear + redraw everything" path.
|
|
56
|
-
// (Ink clears when dynamic output height >= terminal rows.)
|
|
57
|
-
const reservedRows = 8;
|
|
58
|
-
const minViewportHeight = maxHeaderHeight + footerHeight + minContentHeight;
|
|
59
|
-
const maxHeight = Math.max(minViewportHeight, terminalRows - reservedRows);
|
|
60
|
-
const desired = Math.max(minViewportHeight, Math.floor(terminalRows * 0.6));
|
|
61
|
-
return Math.min(maxHeight, desired);
|
|
62
|
-
}, [footerHeight, maxHeaderHeight, minContentHeight, terminalRows]);
|
|
63
|
-
const availableWidth = Math.max(20, terminalColumns - 2);
|
|
64
|
-
const fields = useMemo(() => {
|
|
65
|
-
return parseElicitationSchema(metadata.schema);
|
|
66
|
-
}, [metadata.schema]);
|
|
67
|
-
const wrapClampedLines = useCallback((text, maxLines) => {
|
|
68
|
-
if (maxLines <= 0)
|
|
69
|
-
return [];
|
|
70
|
-
const wrapped = wrapAnsi(text, availableWidth, {
|
|
71
|
-
hard: true,
|
|
72
|
-
wordWrap: true,
|
|
73
|
-
trim: false,
|
|
74
|
-
});
|
|
75
|
-
const rawLines = wrapped.length > 0 ? wrapped.split('\n') : [''];
|
|
76
|
-
const didTruncate = rawLines.length > maxLines;
|
|
77
|
-
const lines = rawLines.slice(0, maxLines);
|
|
78
|
-
if (didTruncate && lines.length > 0) {
|
|
79
|
-
const lastIndex = lines.length - 1;
|
|
80
|
-
const lastLine = (lines[lastIndex] ?? '').replace(/\s+$/, '');
|
|
81
|
-
const safe = lastLine.length > 0
|
|
82
|
-
? `${lastLine.slice(0, Math.max(0, lastLine.length - 1))}…`
|
|
83
|
-
: '…';
|
|
84
|
-
lines[lastIndex] = safe;
|
|
85
|
-
}
|
|
86
|
-
while (lines.length < maxLines) {
|
|
87
|
-
lines.push('');
|
|
88
|
-
}
|
|
89
|
-
return lines;
|
|
90
|
-
}, [availableWidth]);
|
|
91
|
-
// Form state
|
|
92
|
-
const [activeFieldIndex, setActiveFieldIndex] = useState(0);
|
|
93
|
-
const [formData, setFormData] = useState({});
|
|
94
|
-
const [draftInputs, setDraftInputs] = useState({});
|
|
95
|
-
const [enumIndex, setEnumIndex] = useState(0); // For enum/array-enum focus
|
|
96
|
-
const [arraySelections, setArraySelections] = useState(new Set()); // array-enum
|
|
97
|
-
const [errors, setErrors] = useState({});
|
|
98
|
-
const [isReviewing, setIsReviewing] = useState(false);
|
|
99
|
-
const [reviewScrollTop, setReviewScrollTop] = useState(0);
|
|
100
|
-
const activeField = fields[activeFieldIndex];
|
|
101
|
-
const contentHeight = useMemo(() => {
|
|
102
|
-
const activeHeaderHeight = isReviewing ? reviewHeaderHeight : questionHeaderHeight;
|
|
103
|
-
return Math.max(1, viewportHeight - activeHeaderHeight - footerHeight);
|
|
104
|
-
}, [footerHeight, isReviewing, questionHeaderHeight, reviewHeaderHeight, viewportHeight]);
|
|
105
|
-
const updateField = useCallback((name, value) => {
|
|
106
|
-
setFormData((prev) => ({ ...prev, [name]: value }));
|
|
107
|
-
setErrors((prev) => {
|
|
108
|
-
if (!hasOwn(prev, name))
|
|
109
|
-
return prev;
|
|
110
|
-
const next = { ...prev };
|
|
111
|
-
delete next[name];
|
|
112
|
-
return next;
|
|
113
|
-
});
|
|
114
|
-
}, []);
|
|
115
|
-
const goToFieldIndex = useCallback((index, data = formData) => {
|
|
116
|
-
if (index < 0 || index >= fields.length)
|
|
117
|
-
return;
|
|
118
|
-
setActiveFieldIndex(index);
|
|
119
|
-
const field = fields[index];
|
|
120
|
-
if (!field)
|
|
121
|
-
return;
|
|
122
|
-
if (field.type === 'boolean') {
|
|
123
|
-
const currentValue = data[field.name];
|
|
124
|
-
setEnumIndex(currentValue === false ? 1 : 0);
|
|
125
|
-
setArraySelections(new Set());
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
if (field.type === 'enum') {
|
|
129
|
-
const values = field.enumValues ?? [];
|
|
130
|
-
const currentValue = data[field.name];
|
|
131
|
-
const currentIndex = values.findIndex((v) => v === currentValue);
|
|
132
|
-
setEnumIndex(currentIndex >= 0 ? currentIndex : 0);
|
|
133
|
-
setArraySelections(new Set());
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
if (field.type === 'array-enum') {
|
|
137
|
-
const values = field.enumValues ?? [];
|
|
138
|
-
const currentValue = data[field.name];
|
|
139
|
-
const currentValues = Array.isArray(currentValue) ? currentValue : [];
|
|
140
|
-
const selections = new Set();
|
|
141
|
-
for (const selectedValue of currentValues) {
|
|
142
|
-
const selectedIndex = values.findIndex((v) => v === selectedValue);
|
|
143
|
-
if (selectedIndex >= 0)
|
|
144
|
-
selections.add(selectedIndex);
|
|
145
|
-
}
|
|
146
|
-
setArraySelections(selections);
|
|
147
|
-
const firstSelected = selections.values().next().value;
|
|
148
|
-
const maxIndex = Math.max(0, values.length - 1);
|
|
149
|
-
setEnumIndex(Math.min(firstSelected ?? 0, maxIndex));
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
setEnumIndex(0);
|
|
153
|
-
setArraySelections(new Set());
|
|
154
|
-
}, [fields, formData]);
|
|
155
|
-
const nextField = useCallback(() => {
|
|
156
|
-
if (activeFieldIndex < fields.length - 1) {
|
|
157
|
-
goToFieldIndex(activeFieldIndex + 1);
|
|
158
|
-
}
|
|
159
|
-
}, [activeFieldIndex, fields.length, goToFieldIndex]);
|
|
160
|
-
const prevField = useCallback(() => {
|
|
161
|
-
if (activeFieldIndex > 0) {
|
|
162
|
-
goToFieldIndex(activeFieldIndex - 1);
|
|
163
|
-
}
|
|
164
|
-
}, [activeFieldIndex, goToFieldIndex]);
|
|
165
|
-
const handleSubmit = useCallback((currentFieldValue) => {
|
|
166
|
-
const newErrors = {};
|
|
167
|
-
const finalFormData = currentFieldValue
|
|
168
|
-
? { ...formData, [currentFieldValue.name]: currentFieldValue.value }
|
|
169
|
-
: { ...formData };
|
|
170
|
-
// Incorporate draft inputs (wizard UX is forgiving if you navigate without pressing Enter).
|
|
171
|
-
for (const field of fields) {
|
|
172
|
-
if (!hasOwn(draftInputs, field.name))
|
|
173
|
-
continue;
|
|
174
|
-
const rawDraft = draftInputs[field.name] ?? '';
|
|
175
|
-
if (field.type === 'number') {
|
|
176
|
-
const trimmed = rawDraft.trim();
|
|
177
|
-
if (trimmed === '') {
|
|
178
|
-
finalFormData[field.name] = '';
|
|
179
|
-
continue;
|
|
180
|
-
}
|
|
181
|
-
const parsed = Number(trimmed);
|
|
182
|
-
if (Number.isNaN(parsed)) {
|
|
183
|
-
newErrors[field.name] = 'Invalid number';
|
|
184
|
-
continue;
|
|
185
|
-
}
|
|
186
|
-
finalFormData[field.name] = parsed;
|
|
187
|
-
}
|
|
188
|
-
if (field.type === 'string') {
|
|
189
|
-
finalFormData[field.name] = rawDraft;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
// Ensure boolean fields are always present in submitted data.
|
|
193
|
-
for (const field of fields) {
|
|
194
|
-
if (!field.required)
|
|
195
|
-
continue;
|
|
196
|
-
const value = finalFormData[field.name];
|
|
197
|
-
if (field.type === 'array-enum') {
|
|
198
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
199
|
-
newErrors[field.name] = 'Required';
|
|
200
|
-
}
|
|
201
|
-
continue;
|
|
202
|
-
}
|
|
203
|
-
if (value === undefined || value === null || value === '') {
|
|
204
|
-
newErrors[field.name] = 'Required';
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
if (Object.keys(newErrors).length > 0) {
|
|
208
|
-
setErrors(newErrors);
|
|
209
|
-
const firstErrorField = fields.findIndex((f) => newErrors[f.name]);
|
|
210
|
-
if (firstErrorField >= 0) {
|
|
211
|
-
goToFieldIndex(firstErrorField, finalFormData);
|
|
212
|
-
}
|
|
213
|
-
setIsReviewing(false);
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
setFormData(finalFormData);
|
|
217
|
-
setReviewScrollTop(0);
|
|
218
|
-
setIsReviewing(true);
|
|
219
|
-
}, [draftInputs, fields, formData, goToFieldIndex]);
|
|
220
|
-
const confirmSubmit = useCallback(() => {
|
|
221
|
-
onSubmit(formData);
|
|
222
|
-
}, [formData, onSubmit]);
|
|
223
|
-
useImperativeHandle(ref, () => ({
|
|
224
|
-
handleInput: (input, key) => {
|
|
225
|
-
if (isReviewing) {
|
|
226
|
-
const maxScrollTop = Math.max(0, fields.length - contentHeight);
|
|
227
|
-
if (key.return) {
|
|
228
|
-
confirmSubmit();
|
|
229
|
-
return true;
|
|
230
|
-
}
|
|
231
|
-
if (key.backspace || key.delete) {
|
|
232
|
-
setIsReviewing(false);
|
|
233
|
-
goToFieldIndex(Math.max(0, fields.length - 1));
|
|
234
|
-
return true;
|
|
235
|
-
}
|
|
236
|
-
if (key.leftArrow || (key.tab && key.shift)) {
|
|
237
|
-
setIsReviewing(false);
|
|
238
|
-
goToFieldIndex(Math.max(0, fields.length - 1));
|
|
239
|
-
return true;
|
|
240
|
-
}
|
|
241
|
-
if (key.upArrow) {
|
|
242
|
-
setReviewScrollTop((prev) => Math.max(0, prev - 1));
|
|
243
|
-
return true;
|
|
244
|
-
}
|
|
245
|
-
if (key.downArrow) {
|
|
246
|
-
setReviewScrollTop((prev) => Math.min(maxScrollTop, prev + 1));
|
|
247
|
-
return true;
|
|
248
|
-
}
|
|
249
|
-
if (key.pageUp) {
|
|
250
|
-
setReviewScrollTop((prev) => Math.max(0, prev - 5));
|
|
251
|
-
return true;
|
|
252
|
-
}
|
|
253
|
-
if (key.pageDown) {
|
|
254
|
-
setReviewScrollTop((prev) => Math.min(maxScrollTop, prev + 5));
|
|
255
|
-
return true;
|
|
256
|
-
}
|
|
257
|
-
if (key.escape) {
|
|
258
|
-
onCancel();
|
|
259
|
-
return true;
|
|
260
|
-
}
|
|
261
|
-
return false;
|
|
262
|
-
}
|
|
263
|
-
if (key.escape) {
|
|
264
|
-
onCancel();
|
|
265
|
-
return true;
|
|
266
|
-
}
|
|
267
|
-
if (!activeField)
|
|
268
|
-
return false;
|
|
269
|
-
// Wizard navigation: Left/Right (or Shift+Tab/Tab) changes the question.
|
|
270
|
-
if (key.leftArrow || (key.tab && key.shift)) {
|
|
271
|
-
prevField();
|
|
272
|
-
return true;
|
|
273
|
-
}
|
|
274
|
-
if (key.rightArrow || (key.tab && !key.shift)) {
|
|
275
|
-
if (activeFieldIndex === fields.length - 1) {
|
|
276
|
-
handleSubmit();
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
nextField();
|
|
280
|
-
}
|
|
281
|
-
return true;
|
|
282
|
-
}
|
|
283
|
-
const setDraftValue = (updater) => {
|
|
284
|
-
const hadError = hasOwn(errors, activeField.name);
|
|
285
|
-
setDraftInputs((prev) => {
|
|
286
|
-
const current = hasOwn(prev, activeField.name)
|
|
287
|
-
? (prev[activeField.name] ?? '')
|
|
288
|
-
: (() => {
|
|
289
|
-
const existing = formData[activeField.name];
|
|
290
|
-
return existing === undefined || existing === null
|
|
291
|
-
? ''
|
|
292
|
-
: String(existing);
|
|
293
|
-
})();
|
|
294
|
-
return { ...prev, [activeField.name]: updater(current) };
|
|
295
|
-
});
|
|
296
|
-
if (hadError) {
|
|
297
|
-
setErrors((prevErrors) => {
|
|
298
|
-
const nextErrors = { ...prevErrors };
|
|
299
|
-
delete nextErrors[activeField.name];
|
|
300
|
-
return nextErrors;
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
switch (activeField.type) {
|
|
305
|
-
case 'boolean': {
|
|
306
|
-
if (key.upArrow) {
|
|
307
|
-
setEnumIndex((prev) => clamp(prev - 1, 0, 1));
|
|
308
|
-
return true;
|
|
309
|
-
}
|
|
310
|
-
if (key.downArrow) {
|
|
311
|
-
setEnumIndex((prev) => clamp(prev + 1, 0, 1));
|
|
312
|
-
return true;
|
|
313
|
-
}
|
|
314
|
-
if (input === ' ') {
|
|
315
|
-
setEnumIndex((prev) => (prev === 0 ? 1 : 0));
|
|
316
|
-
return true;
|
|
317
|
-
}
|
|
318
|
-
if (key.return) {
|
|
319
|
-
const nextValue = enumIndex === 0;
|
|
320
|
-
updateField(activeField.name, nextValue);
|
|
321
|
-
if (activeFieldIndex === fields.length - 1) {
|
|
322
|
-
handleSubmit({ name: activeField.name, value: nextValue });
|
|
323
|
-
}
|
|
324
|
-
else {
|
|
325
|
-
nextField();
|
|
326
|
-
}
|
|
327
|
-
return true;
|
|
328
|
-
}
|
|
329
|
-
break;
|
|
330
|
-
}
|
|
331
|
-
case 'enum': {
|
|
332
|
-
const values = activeField.enumValues || [];
|
|
333
|
-
if (key.upArrow) {
|
|
334
|
-
setEnumIndex((prev) => (prev > 0 ? prev - 1 : values.length - 1));
|
|
335
|
-
return true;
|
|
336
|
-
}
|
|
337
|
-
if (key.downArrow) {
|
|
338
|
-
setEnumIndex((prev) => (prev < values.length - 1 ? prev + 1 : 0));
|
|
339
|
-
return true;
|
|
340
|
-
}
|
|
341
|
-
if (key.return) {
|
|
342
|
-
const selectedValue = values[enumIndex];
|
|
343
|
-
updateField(activeField.name, selectedValue);
|
|
344
|
-
if (activeFieldIndex === fields.length - 1) {
|
|
345
|
-
handleSubmit({ name: activeField.name, value: selectedValue });
|
|
346
|
-
}
|
|
347
|
-
else {
|
|
348
|
-
nextField();
|
|
349
|
-
}
|
|
350
|
-
return true;
|
|
351
|
-
}
|
|
352
|
-
break;
|
|
353
|
-
}
|
|
354
|
-
case 'array-enum': {
|
|
355
|
-
const values = activeField.enumValues || [];
|
|
356
|
-
if (key.upArrow) {
|
|
357
|
-
setEnumIndex((prev) => (prev > 0 ? prev - 1 : values.length - 1));
|
|
358
|
-
return true;
|
|
359
|
-
}
|
|
360
|
-
if (key.downArrow) {
|
|
361
|
-
setEnumIndex((prev) => (prev < values.length - 1 ? prev + 1 : 0));
|
|
362
|
-
return true;
|
|
363
|
-
}
|
|
364
|
-
if (input === ' ') {
|
|
365
|
-
const nextSelections = new Set(arraySelections);
|
|
366
|
-
if (nextSelections.has(enumIndex))
|
|
367
|
-
nextSelections.delete(enumIndex);
|
|
368
|
-
else
|
|
369
|
-
nextSelections.add(enumIndex);
|
|
370
|
-
setArraySelections(nextSelections);
|
|
371
|
-
const selected = Array.from(nextSelections).map((i) => values[i]);
|
|
372
|
-
updateField(activeField.name, selected);
|
|
373
|
-
return true;
|
|
374
|
-
}
|
|
375
|
-
if (key.return) {
|
|
376
|
-
const selected = Array.from(arraySelections).map((i) => values[i]);
|
|
377
|
-
if (activeFieldIndex === fields.length - 1) {
|
|
378
|
-
handleSubmit({ name: activeField.name, value: selected });
|
|
379
|
-
}
|
|
380
|
-
else {
|
|
381
|
-
nextField();
|
|
382
|
-
}
|
|
383
|
-
return true;
|
|
384
|
-
}
|
|
385
|
-
break;
|
|
386
|
-
}
|
|
387
|
-
case 'string':
|
|
388
|
-
case 'number': {
|
|
389
|
-
const hasDraft = hasOwn(draftInputs, activeField.name);
|
|
390
|
-
const rawInput = hasDraft
|
|
391
|
-
? (draftInputs[activeField.name] ?? '')
|
|
392
|
-
: (() => {
|
|
393
|
-
const existing = formData[activeField.name];
|
|
394
|
-
return existing === undefined || existing === null
|
|
395
|
-
? ''
|
|
396
|
-
: String(existing);
|
|
397
|
-
})();
|
|
398
|
-
if (key.return) {
|
|
399
|
-
let value = hasDraft
|
|
400
|
-
? rawInput
|
|
401
|
-
: formData[activeField.name];
|
|
402
|
-
if (activeField.type === 'number' && hasDraft) {
|
|
403
|
-
const trimmed = rawInput.trim();
|
|
404
|
-
if (trimmed === '') {
|
|
405
|
-
value = '';
|
|
406
|
-
}
|
|
407
|
-
else {
|
|
408
|
-
const parsed = Number(trimmed);
|
|
409
|
-
if (Number.isNaN(parsed)) {
|
|
410
|
-
setErrors((prev) => ({
|
|
411
|
-
...prev,
|
|
412
|
-
[activeField.name]: 'Invalid number',
|
|
413
|
-
}));
|
|
414
|
-
return true;
|
|
415
|
-
}
|
|
416
|
-
value = parsed;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
if (hasDraft) {
|
|
420
|
-
updateField(activeField.name, value);
|
|
421
|
-
}
|
|
422
|
-
if (activeFieldIndex === fields.length - 1) {
|
|
423
|
-
handleSubmit(value !== undefined
|
|
424
|
-
? { name: activeField.name, value }
|
|
425
|
-
: undefined);
|
|
426
|
-
}
|
|
427
|
-
else {
|
|
428
|
-
nextField();
|
|
429
|
-
}
|
|
430
|
-
return true;
|
|
431
|
-
}
|
|
432
|
-
if (key.backspace || key.delete) {
|
|
433
|
-
setDraftValue((prev) => prev.slice(0, -1));
|
|
434
|
-
return true;
|
|
435
|
-
}
|
|
436
|
-
if (input && !key.ctrl && !key.meta) {
|
|
437
|
-
if (activeField.type === 'number') {
|
|
438
|
-
// Accept either single-key entry or paste: filter to allowed chars.
|
|
439
|
-
const filtered = input.replace(/[^\d.-]/g, '');
|
|
440
|
-
if (filtered.length > 0) {
|
|
441
|
-
setDraftValue((prev) => prev + filtered);
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
else {
|
|
445
|
-
setDraftValue((prev) => prev + input);
|
|
446
|
-
}
|
|
447
|
-
return true;
|
|
448
|
-
}
|
|
449
|
-
break;
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
return false;
|
|
453
|
-
},
|
|
454
|
-
}), [
|
|
455
|
-
activeField,
|
|
456
|
-
activeFieldIndex,
|
|
457
|
-
arraySelections,
|
|
458
|
-
contentHeight,
|
|
459
|
-
confirmSubmit,
|
|
460
|
-
draftInputs,
|
|
461
|
-
enumIndex,
|
|
462
|
-
errors,
|
|
463
|
-
fields,
|
|
464
|
-
formData,
|
|
465
|
-
handleSubmit,
|
|
466
|
-
isReviewing,
|
|
467
|
-
goToFieldIndex,
|
|
468
|
-
nextField,
|
|
469
|
-
onCancel,
|
|
470
|
-
prevField,
|
|
471
|
-
reviewScrollTop,
|
|
472
|
-
updateField,
|
|
473
|
-
]);
|
|
474
|
-
if (fields.length === 0) {
|
|
475
|
-
return (_jsx(Box, { flexDirection: "column", paddingX: 1, children: _jsx(Text, { color: "red", children: "Invalid form schema" }) }));
|
|
476
|
-
}
|
|
477
|
-
const isAnswered = (field) => {
|
|
478
|
-
if (field.type === 'boolean')
|
|
479
|
-
return hasOwn(formData, field.name);
|
|
480
|
-
if (field.type === 'enum')
|
|
481
|
-
return hasOwn(formData, field.name);
|
|
482
|
-
if (field.type === 'array-enum') {
|
|
483
|
-
const value = formData[field.name];
|
|
484
|
-
return Array.isArray(value) && value.length > 0;
|
|
485
|
-
}
|
|
486
|
-
const draft = draftInputs[field.name];
|
|
487
|
-
if (typeof draft === 'string' && draft.trim() !== '')
|
|
488
|
-
return true;
|
|
489
|
-
const value = formData[field.name];
|
|
490
|
-
return value !== undefined && value !== null && value !== '';
|
|
491
|
-
};
|
|
492
|
-
if (!isReviewing && !activeField) {
|
|
493
|
-
return (_jsx(Box, { flexDirection: "column", paddingX: 1, children: _jsx(Text, { color: "red", children: "Invalid form state" }) }));
|
|
494
|
-
}
|
|
495
|
-
const value = activeField ? formData[activeField.name] : undefined;
|
|
496
|
-
const currentInput = activeField && hasOwn(draftInputs, activeField.name)
|
|
497
|
-
? (draftInputs[activeField.name] ?? '')
|
|
498
|
-
: value === undefined || value === null
|
|
499
|
-
? ''
|
|
500
|
-
: String(value);
|
|
501
|
-
const errorText = activeField ? (errors[activeField.name] ?? '') : '';
|
|
502
|
-
const renderContent = () => {
|
|
503
|
-
if (isReviewing) {
|
|
504
|
-
return (_jsx(Box, { overflowY: "scroll", overflowX: "hidden", scrollTop: reviewScrollTop, scrollbarThumbColor: "gray", flexDirection: "column", height: contentHeight, paddingRight: 1, children: fields.map((field) => (_jsxs(Text, { wrap: "truncate-end", children: [field.question, ": ", getDisplayValue(formData[field.name])] }, field.name))) }));
|
|
505
|
-
}
|
|
506
|
-
if (!activeField)
|
|
507
|
-
return null;
|
|
508
|
-
if (activeField.type === 'string' || activeField.type === 'number') {
|
|
509
|
-
return (_jsx(Box, { height: contentHeight, children: _jsxs(Text, { wrap: "truncate-end", children: [_jsx(Text, { color: "cyan", children: "> " }), currentInput || _jsx(Text, { color: "gray", children: "Type your answer\u2026" }), _jsx(Text, { color: "cyan", children: "\u258B" })] }) }));
|
|
510
|
-
}
|
|
511
|
-
const options = [];
|
|
512
|
-
if (activeField.type === 'boolean') {
|
|
513
|
-
options.push({
|
|
514
|
-
key: 'yes',
|
|
515
|
-
label: 'Yes',
|
|
516
|
-
isFocused: enumIndex === 0,
|
|
517
|
-
isSelected: false,
|
|
518
|
-
});
|
|
519
|
-
options.push({
|
|
520
|
-
key: 'no',
|
|
521
|
-
label: 'No',
|
|
522
|
-
isFocused: enumIndex === 1,
|
|
523
|
-
isSelected: false,
|
|
524
|
-
});
|
|
525
|
-
}
|
|
526
|
-
if ((activeField.type === 'enum' || activeField.type === 'array-enum') &&
|
|
527
|
-
activeField.enumValues) {
|
|
528
|
-
activeField.enumValues.forEach((opt, i) => {
|
|
529
|
-
const isFocused = i === enumIndex;
|
|
530
|
-
const isSelected = activeField.type === 'enum' ? false : arraySelections.has(i);
|
|
531
|
-
options.push({
|
|
532
|
-
key: `${String(opt)}-${i}`,
|
|
533
|
-
label: String(opt),
|
|
534
|
-
isFocused,
|
|
535
|
-
isSelected,
|
|
536
|
-
});
|
|
537
|
-
});
|
|
538
|
-
}
|
|
539
|
-
const focusedIndex = Math.max(0, options.findIndex((o) => o.isFocused));
|
|
540
|
-
const maxScrollTop = Math.max(0, options.length - contentHeight);
|
|
541
|
-
const targetScrollTop = clamp(focusedIndex - Math.floor(contentHeight / 2), 0, maxScrollTop);
|
|
542
|
-
return (_jsx(Box, { overflowY: "scroll", overflowX: "hidden", scrollbarThumbColor: "gray", height: contentHeight, scrollTop: targetScrollTop, flexDirection: "column", paddingRight: 1, children: options.map((opt) => {
|
|
543
|
-
const prefix = opt.isFocused ? '▶ ' : ' ';
|
|
544
|
-
const mark = activeField.type === 'array-enum'
|
|
545
|
-
? opt.isSelected
|
|
546
|
-
? '[✓] '
|
|
547
|
-
: '[ ] '
|
|
548
|
-
: '';
|
|
549
|
-
return (_jsxs(Text, { color: opt.isFocused ? 'cyan' : 'gray', wrap: "truncate-end", children: [prefix, mark, opt.label] }, opt.key));
|
|
550
|
-
}) }));
|
|
551
|
-
};
|
|
552
|
-
const hintLine = (() => {
|
|
553
|
-
if (isReviewing)
|
|
554
|
-
return 'Enter submit • Backspace/← edit • ↑↓ scroll • Esc cancel';
|
|
555
|
-
switch (activeField?.type) {
|
|
556
|
-
case 'string':
|
|
557
|
-
case 'number':
|
|
558
|
-
return 'Type to answer • Enter next • ←/→ question • Esc cancel';
|
|
559
|
-
case 'array-enum':
|
|
560
|
-
return '↑/↓ option • Space toggle • Enter next • ←/→ question • Esc cancel';
|
|
561
|
-
default:
|
|
562
|
-
return '↑/↓ option • Enter select • ←/→ question • Esc cancel';
|
|
563
|
-
}
|
|
564
|
-
})();
|
|
565
|
-
const headerText = isReviewing
|
|
566
|
-
? '📝 Review your answers'
|
|
567
|
-
: `📝 Please answer ${fields.length === 1 ? 'this' : 'these'} ${fields.length} ${fields.length === 1 ? 'question' : 'questions'}.`;
|
|
568
|
-
const stepText = (() => {
|
|
569
|
-
if (isReviewing) {
|
|
570
|
-
return '';
|
|
571
|
-
}
|
|
572
|
-
if (!activeField)
|
|
573
|
-
return '';
|
|
574
|
-
return `Question ${activeFieldIndex + 1}/${fields.length}: ${activeField.stepLabel}`;
|
|
575
|
-
})();
|
|
576
|
-
const questionText = !isReviewing && activeField
|
|
577
|
-
? `${activeField.question}${activeField.required ? '*' : ''}`
|
|
578
|
-
: '';
|
|
579
|
-
const helpText = !isReviewing && activeField?.helpText ? activeField.helpText : '';
|
|
580
|
-
const errorLineText = !isReviewing ? errorText : '';
|
|
581
|
-
const headerLines = wrapClampedLines(headerText, headerLineCount);
|
|
582
|
-
const stepLines = wrapClampedLines(stepText, stepHeaderLineCount);
|
|
583
|
-
const questionLines = wrapClampedLines(questionText, questionLineCount);
|
|
584
|
-
const helpLines = wrapClampedLines(helpText, helpLineCount);
|
|
585
|
-
const errorLines = wrapClampedLines(errorLineText, errorLineCount);
|
|
586
|
-
return (_jsxs(Box, { flexDirection: "column", paddingX: 0, height: viewportHeight, children: [headerLines.map((line, index) => (_jsx(Text, { color: "yellowBright", bold: true, wrap: "truncate-end", children: line || ' ' }, `header-${index}`))), !isReviewing &&
|
|
587
|
-
stepLines.map((line, index) => (_jsx(Text, { color: "gray", dimColor: true, wrap: "truncate-end", children: line || ' ' }, `step-${index}`))), Array.from({ length: spacerAfterStepLineCount }, (_, index) => (_jsx(Text, { wrap: "truncate-end", children: ' ' }, `spacer-step-${index}`))), !isReviewing &&
|
|
588
|
-
questionLines.map((line, index) => (_jsx(Text, { color: "white", bold: true, wrap: "truncate-end", children: line || ' ' }, `question-${index}`))), !isReviewing &&
|
|
589
|
-
helpLines.map((line, index) => (_jsx(Text, { color: "gray", dimColor: true, wrap: "truncate-end", children: line || ' ' }, `help-${index}`))), !isReviewing &&
|
|
590
|
-
errorLines.map((line, index) => (_jsx(Text, { color: "red", wrap: "truncate-end", children: line || ' ' }, `error-${index}`))), renderContent(), _jsx(Text, { color: "gray", dimColor: true, wrap: "truncate-end", children: hintLine })] }));
|
|
591
|
-
});
|
|
592
|
-
ElicitationForm.displayName = 'ElicitationForm';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error Boundary Component
|
|
3
|
-
* Catches and displays errors in the component tree
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
interface ErrorBoundaryProps {
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
}
|
|
9
|
-
interface ErrorBoundaryState {
|
|
10
|
-
hasError: boolean;
|
|
11
|
-
error: Error | null;
|
|
12
|
-
}
|
|
13
|
-
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
14
|
-
constructor(props: ErrorBoundaryProps);
|
|
15
|
-
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
16
|
-
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
17
|
-
render(): React.ReactNode;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=ErrorBoundary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,kBAAkB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,UAAU,kBAAkB;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACvB;AAED,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;gBAC1E,KAAK,EAAE,kBAAkB;IAKrC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,kBAAkB;IAIxD,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI;IAOjE,MAAM,IAAI,KAAK,CAAC,SAAS;CAerC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Error Boundary Component
|
|
4
|
-
* Catches and displays errors in the component tree
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { Box, Text } from 'ink';
|
|
8
|
-
import { logger } from '@dexto/core';
|
|
9
|
-
export class ErrorBoundary extends React.Component {
|
|
10
|
-
constructor(props) {
|
|
11
|
-
super(props);
|
|
12
|
-
this.state = { hasError: false, error: null };
|
|
13
|
-
}
|
|
14
|
-
static getDerivedStateFromError(error) {
|
|
15
|
-
return { hasError: true, error };
|
|
16
|
-
}
|
|
17
|
-
componentDidCatch(error, errorInfo) {
|
|
18
|
-
logger.error(`Error in ErrorBoundary: ${error.message}`, {
|
|
19
|
-
error,
|
|
20
|
-
componentStack: errorInfo.componentStack,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
render() {
|
|
24
|
-
if (this.state.hasError) {
|
|
25
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "red", children: [_jsx(Text, { color: "red", bold: true, children: "CLI Error" }), _jsx(Text, { color: "red", children: this.state.error?.message || 'Unknown error' }), _jsx(Text, { color: "yellowBright", children: "Press Ctrl+C to exit" })] }));
|
|
26
|
-
}
|
|
27
|
-
return this.props.children;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Footer Component
|
|
3
|
-
* Status line at the bottom showing CWD, branch, and model info.
|
|
4
|
-
*/
|
|
5
|
-
import { type DextoAgent } from '@dexto/core';
|
|
6
|
-
interface FooterProps {
|
|
7
|
-
agent: DextoAgent;
|
|
8
|
-
sessionId: string | null;
|
|
9
|
-
modelName: string;
|
|
10
|
-
cwd?: string;
|
|
11
|
-
branchName?: string;
|
|
12
|
-
autoApproveEdits?: boolean;
|
|
13
|
-
planModeActive?: boolean;
|
|
14
|
-
/** Whether user is in shell command mode (input starts with !) */
|
|
15
|
-
isShellMode?: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Pure presentational component for footer status line
|
|
19
|
-
*/
|
|
20
|
-
export declare function Footer({ agent, sessionId, modelName, cwd, branchName, autoApproveEdits, planModeActive, isShellMode, }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=Footer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/Footer.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAGnE,UAAU,WAAW;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kEAAkE;IAClE,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAOD;;GAEG;AACH,wBAAgB,MAAM,CAAC,EACnB,KAAK,EACL,SAAS,EACT,SAAS,EACT,GAAG,EACH,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,WAAW,GACd,EAAE,WAAW,2CAgHb"}
|