@dexto/tui 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/LICENSE +44 -0
- package/dist/InkCLIRefactored.cjs +319 -0
- package/dist/InkCLIRefactored.d.ts +55 -0
- package/dist/InkCLIRefactored.d.ts.map +1 -0
- package/dist/InkCLIRefactored.js +289 -0
- package/dist/assets/sounds/SOURCES.md +35 -0
- package/dist/assets/sounds/boot.wav +0 -0
- package/dist/assets/sounds/chime.wav +0 -0
- package/dist/assets/sounds/coin.wav +0 -0
- package/dist/assets/sounds/confirm.wav +0 -0
- package/dist/assets/sounds/levelup.wav +0 -0
- package/dist/assets/sounds/ping.wav +0 -0
- package/dist/assets/sounds/powerup.wav +0 -0
- package/dist/assets/sounds/startup.wav +0 -0
- package/dist/assets/sounds/success.wav +0 -0
- package/dist/assets/sounds/treasure.wav +0 -0
- package/dist/assets/sounds/win.wav +0 -0
- package/dist/components/ApprovalPrompt.cjs +353 -0
- package/dist/components/ApprovalPrompt.d.ts +44 -0
- package/dist/components/ApprovalPrompt.d.ts.map +1 -0
- package/dist/components/ApprovalPrompt.js +336 -0
- package/dist/components/BackgroundTasksPanel.cjs +117 -0
- package/dist/components/BackgroundTasksPanel.d.ts +18 -0
- package/dist/components/BackgroundTasksPanel.d.ts.map +1 -0
- package/dist/components/BackgroundTasksPanel.js +93 -0
- package/dist/components/CustomInput.cjs +77 -0
- package/dist/components/CustomInput.d.ts +17 -0
- package/dist/components/CustomInput.d.ts.map +1 -0
- package/dist/components/CustomInput.js +57 -0
- package/dist/components/CustomTextInput.cjs +76 -0
- package/dist/components/CustomTextInput.d.ts +16 -0
- package/dist/components/CustomTextInput.d.ts.map +1 -0
- package/dist/components/CustomTextInput.js +46 -0
- package/dist/components/EditableMultiLineInput.cjs +151 -0
- package/dist/components/EditableMultiLineInput.d.ts +19 -0
- package/dist/components/EditableMultiLineInput.d.ts.map +1 -0
- package/dist/components/EditableMultiLineInput.js +131 -0
- package/dist/components/ElicitationForm.cjs +622 -0
- package/dist/components/ElicitationForm.d.ts +24 -0
- package/dist/components/ElicitationForm.d.ts.map +1 -0
- package/dist/components/ElicitationForm.js +588 -0
- package/dist/components/ErrorBoundary.cjs +66 -0
- package/dist/components/ErrorBoundary.d.ts +20 -0
- package/dist/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/ErrorBoundary.js +32 -0
- package/dist/components/Footer.cjs +165 -0
- package/dist/components/Footer.d.ts +23 -0
- package/dist/components/Footer.d.ts.map +1 -0
- package/dist/components/Footer.js +131 -0
- package/dist/components/HistorySearchBar.cjs +40 -0
- package/dist/components/HistorySearchBar.d.ts +17 -0
- package/dist/components/HistorySearchBar.d.ts.map +1 -0
- package/dist/components/HistorySearchBar.js +16 -0
- package/dist/components/MultiLineInput.cjs +56 -0
- package/dist/components/MultiLineInput.d.ts +12 -0
- package/dist/components/MultiLineInput.d.ts.map +1 -0
- package/dist/components/MultiLineInput.js +36 -0
- package/dist/components/ResourceAutocomplete.cjs +344 -0
- package/dist/components/ResourceAutocomplete.d.ts +26 -0
- package/dist/components/ResourceAutocomplete.d.ts.map +1 -0
- package/dist/components/ResourceAutocomplete.js +322 -0
- package/dist/components/SlashCommandAutocomplete.cjs +389 -0
- package/dist/components/SlashCommandAutocomplete.d.ts +28 -0
- package/dist/components/SlashCommandAutocomplete.d.ts.map +1 -0
- package/dist/components/SlashCommandAutocomplete.js +363 -0
- package/dist/components/StatusBar.cjs +142 -0
- package/dist/components/StatusBar.d.ts +41 -0
- package/dist/components/StatusBar.d.ts.map +1 -0
- package/dist/components/StatusBar.js +118 -0
- package/dist/components/TextBufferInput.cjs +531 -0
- package/dist/components/TextBufferInput.d.ts +54 -0
- package/dist/components/TextBufferInput.d.ts.map +1 -0
- package/dist/components/TextBufferInput.js +507 -0
- package/dist/components/TodoPanel.cjs +129 -0
- package/dist/components/TodoPanel.d.ts +26 -0
- package/dist/components/TodoPanel.d.ts.map +1 -0
- package/dist/components/TodoPanel.js +105 -0
- package/dist/components/base/BaseAutocomplete.cjs +153 -0
- package/dist/components/base/BaseAutocomplete.d.ts +29 -0
- package/dist/components/base/BaseAutocomplete.d.ts.map +1 -0
- package/dist/components/base/BaseAutocomplete.js +129 -0
- package/dist/components/base/BaseSelector.cjs +167 -0
- package/dist/components/base/BaseSelector.d.ts +37 -0
- package/dist/components/base/BaseSelector.d.ts.map +1 -0
- package/dist/components/base/BaseSelector.js +151 -0
- package/dist/components/base/index.cjs +31 -0
- package/dist/components/base/index.d.ts +6 -0
- package/dist/components/base/index.d.ts.map +1 -0
- package/dist/components/base/index.js +6 -0
- package/dist/components/chat/ChatView.cjs +51 -0
- package/dist/components/chat/ChatView.d.ts +19 -0
- package/dist/components/chat/ChatView.d.ts.map +1 -0
- package/dist/components/chat/ChatView.js +27 -0
- package/dist/components/chat/Footer.cjs +32 -0
- package/dist/components/chat/Footer.d.ts +9 -0
- package/dist/components/chat/Footer.d.ts.map +1 -0
- package/dist/components/chat/Footer.js +8 -0
- package/dist/components/chat/Header.cjs +86 -0
- package/dist/components/chat/Header.d.ts +18 -0
- package/dist/components/chat/Header.d.ts.map +1 -0
- package/dist/components/chat/Header.js +62 -0
- package/dist/components/chat/MessageItem.cjs +269 -0
- package/dist/components/chat/MessageItem.d.ts +23 -0
- package/dist/components/chat/MessageItem.d.ts.map +1 -0
- package/dist/components/chat/MessageItem.js +247 -0
- package/dist/components/chat/MessageList.cjs +46 -0
- package/dist/components/chat/MessageList.d.ts +16 -0
- package/dist/components/chat/MessageList.d.ts.map +1 -0
- package/dist/components/chat/MessageList.js +22 -0
- package/dist/components/chat/QueuedMessagesDisplay.cjs +59 -0
- package/dist/components/chat/QueuedMessagesDisplay.d.ts +16 -0
- package/dist/components/chat/QueuedMessagesDisplay.d.ts.map +1 -0
- package/dist/components/chat/QueuedMessagesDisplay.js +35 -0
- package/dist/components/chat/ToolIcon.cjs +60 -0
- package/dist/components/chat/ToolIcon.d.ts +18 -0
- package/dist/components/chat/ToolIcon.d.ts.map +1 -0
- package/dist/components/chat/ToolIcon.js +36 -0
- package/dist/components/chat/index.cjs +43 -0
- package/dist/components/chat/index.d.ts +10 -0
- package/dist/components/chat/index.d.ts.map +1 -0
- package/dist/components/chat/index.js +14 -0
- package/dist/components/chat/styled-boxes/ConfigBox.cjs +56 -0
- package/dist/components/chat/styled-boxes/ConfigBox.d.ts +10 -0
- package/dist/components/chat/styled-boxes/ConfigBox.d.ts.map +1 -0
- package/dist/components/chat/styled-boxes/ConfigBox.js +32 -0
- package/dist/components/chat/styled-boxes/HelpBox.cjs +53 -0
- package/dist/components/chat/styled-boxes/HelpBox.d.ts +10 -0
- package/dist/components/chat/styled-boxes/HelpBox.d.ts.map +1 -0
- package/dist/components/chat/styled-boxes/HelpBox.js +29 -0
- package/dist/components/chat/styled-boxes/LogConfigBox.cjs +54 -0
- package/dist/components/chat/styled-boxes/LogConfigBox.d.ts +10 -0
- package/dist/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -0
- package/dist/components/chat/styled-boxes/LogConfigBox.js +30 -0
- package/dist/components/chat/styled-boxes/SessionHistoryBox.cjs +81 -0
- package/dist/components/chat/styled-boxes/SessionHistoryBox.d.ts +10 -0
- package/dist/components/chat/styled-boxes/SessionHistoryBox.d.ts.map +1 -0
- package/dist/components/chat/styled-boxes/SessionHistoryBox.js +57 -0
- package/dist/components/chat/styled-boxes/SessionListBox.cjs +58 -0
- package/dist/components/chat/styled-boxes/SessionListBox.d.ts +10 -0
- package/dist/components/chat/styled-boxes/SessionListBox.d.ts.map +1 -0
- package/dist/components/chat/styled-boxes/SessionListBox.js +34 -0
- package/dist/components/chat/styled-boxes/ShortcutsBox.cjs +39 -0
- package/dist/components/chat/styled-boxes/ShortcutsBox.d.ts +10 -0
- package/dist/components/chat/styled-boxes/ShortcutsBox.d.ts.map +1 -0
- package/dist/components/chat/styled-boxes/ShortcutsBox.js +15 -0
- package/dist/components/chat/styled-boxes/StatsBox.cjs +123 -0
- package/dist/components/chat/styled-boxes/StatsBox.d.ts +10 -0
- package/dist/components/chat/styled-boxes/StatsBox.d.ts.map +1 -0
- package/dist/components/chat/styled-boxes/StatsBox.js +99 -0
- package/dist/components/chat/styled-boxes/StyledBox.cjs +88 -0
- package/dist/components/chat/styled-boxes/StyledBox.d.ts +45 -0
- package/dist/components/chat/styled-boxes/StyledBox.d.ts.map +1 -0
- package/dist/components/chat/styled-boxes/StyledBox.js +61 -0
- package/dist/components/chat/styled-boxes/SyspromptBox.cjs +33 -0
- package/dist/components/chat/styled-boxes/SyspromptBox.d.ts +10 -0
- package/dist/components/chat/styled-boxes/SyspromptBox.d.ts.map +1 -0
- package/dist/components/chat/styled-boxes/SyspromptBox.js +9 -0
- package/dist/components/chat/styled-boxes/index.cjs +58 -0
- package/dist/components/chat/styled-boxes/index.d.ts +13 -0
- package/dist/components/chat/styled-boxes/index.d.ts.map +1 -0
- package/dist/components/chat/styled-boxes/index.js +23 -0
- package/dist/components/input/InputArea.cjs +74 -0
- package/dist/components/input/InputArea.d.ts +48 -0
- package/dist/components/input/InputArea.d.ts.map +1 -0
- package/dist/components/input/InputArea.js +50 -0
- package/dist/components/input/index.cjs +28 -0
- package/dist/components/input/index.d.ts +5 -0
- package/dist/components/input/index.d.ts.map +1 -0
- package/dist/components/input/index.js +4 -0
- package/dist/components/modes/AlternateBufferCLI.cjs +360 -0
- package/dist/components/modes/AlternateBufferCLI.d.ts +28 -0
- package/dist/components/modes/AlternateBufferCLI.d.ts.map +1 -0
- package/dist/components/modes/AlternateBufferCLI.js +339 -0
- package/dist/components/modes/StaticCLI.cjs +303 -0
- package/dist/components/modes/StaticCLI.d.ts +30 -0
- package/dist/components/modes/StaticCLI.d.ts.map +1 -0
- package/dist/components/modes/StaticCLI.js +279 -0
- package/dist/components/modes/index.cjs +31 -0
- package/dist/components/modes/index.d.ts +10 -0
- package/dist/components/modes/index.d.ts.map +1 -0
- package/dist/components/modes/index.js +6 -0
- package/dist/components/overlays/ApiKeyInput.cjs +131 -0
- package/dist/components/overlays/ApiKeyInput.d.ts +26 -0
- package/dist/components/overlays/ApiKeyInput.d.ts.map +1 -0
- package/dist/components/overlays/ApiKeyInput.js +115 -0
- package/dist/components/overlays/CommandOutputOverlay.cjs +103 -0
- package/dist/components/overlays/CommandOutputOverlay.d.ts +13 -0
- package/dist/components/overlays/CommandOutputOverlay.d.ts.map +1 -0
- package/dist/components/overlays/CommandOutputOverlay.js +69 -0
- package/dist/components/overlays/ContextStatsOverlay.cjs +354 -0
- package/dist/components/overlays/ContextStatsOverlay.d.ts +26 -0
- package/dist/components/overlays/ContextStatsOverlay.d.ts.map +1 -0
- package/dist/components/overlays/ContextStatsOverlay.js +334 -0
- package/dist/components/overlays/CustomModelWizard.cjs +362 -0
- package/dist/components/overlays/CustomModelWizard.d.ts +29 -0
- package/dist/components/overlays/CustomModelWizard.d.ts.map +1 -0
- package/dist/components/overlays/CustomModelWizard.js +356 -0
- package/dist/components/overlays/ExportWizard.cjs +382 -0
- package/dist/components/overlays/ExportWizard.d.ts +22 -0
- package/dist/components/overlays/ExportWizard.d.ts.map +1 -0
- package/dist/components/overlays/ExportWizard.js +352 -0
- package/dist/components/overlays/LogLevelSelector.cjs +120 -0
- package/dist/components/overlays/LogLevelSelector.d.ts +23 -0
- package/dist/components/overlays/LogLevelSelector.d.ts.map +1 -0
- package/dist/components/overlays/LogLevelSelector.js +100 -0
- package/dist/components/overlays/LoginOverlay.cjs +211 -0
- package/dist/components/overlays/LoginOverlay.d.ts +22 -0
- package/dist/components/overlays/LoginOverlay.d.ts.map +1 -0
- package/dist/components/overlays/LoginOverlay.js +194 -0
- package/dist/components/overlays/LogoutOverlay.cjs +138 -0
- package/dist/components/overlays/LogoutOverlay.d.ts +20 -0
- package/dist/components/overlays/LogoutOverlay.d.ts.map +1 -0
- package/dist/components/overlays/LogoutOverlay.js +130 -0
- package/dist/components/overlays/MarketplaceAddPrompt.cjs +119 -0
- package/dist/components/overlays/MarketplaceAddPrompt.d.ts +20 -0
- package/dist/components/overlays/MarketplaceAddPrompt.d.ts.map +1 -0
- package/dist/components/overlays/MarketplaceAddPrompt.js +99 -0
- package/dist/components/overlays/MarketplaceBrowser.cjs +364 -0
- package/dist/components/overlays/MarketplaceBrowser.d.ts +31 -0
- package/dist/components/overlays/MarketplaceBrowser.d.ts.map +1 -0
- package/dist/components/overlays/MarketplaceBrowser.js +358 -0
- package/dist/components/overlays/McpAddChoice.cjs +100 -0
- package/dist/components/overlays/McpAddChoice.d.ts +22 -0
- package/dist/components/overlays/McpAddChoice.d.ts.map +1 -0
- package/dist/components/overlays/McpAddChoice.js +80 -0
- package/dist/components/overlays/McpAddSelector.cjs +113 -0
- package/dist/components/overlays/McpAddSelector.d.ts +26 -0
- package/dist/components/overlays/McpAddSelector.d.ts.map +1 -0
- package/dist/components/overlays/McpAddSelector.js +93 -0
- package/dist/components/overlays/McpCustomTypeSelector.cjs +99 -0
- package/dist/components/overlays/McpCustomTypeSelector.d.ts +21 -0
- package/dist/components/overlays/McpCustomTypeSelector.d.ts.map +1 -0
- package/dist/components/overlays/McpCustomTypeSelector.js +79 -0
- package/dist/components/overlays/McpCustomWizard.cjs +258 -0
- package/dist/components/overlays/McpCustomWizard.d.ts +29 -0
- package/dist/components/overlays/McpCustomWizard.d.ts.map +1 -0
- package/dist/components/overlays/McpCustomWizard.js +238 -0
- package/dist/components/overlays/McpRemoveSelector.cjs +127 -0
- package/dist/components/overlays/McpRemoveSelector.d.ts +22 -0
- package/dist/components/overlays/McpRemoveSelector.d.ts.map +1 -0
- package/dist/components/overlays/McpRemoveSelector.js +107 -0
- package/dist/components/overlays/McpSelector.cjs +94 -0
- package/dist/components/overlays/McpSelector.d.ts +21 -0
- package/dist/components/overlays/McpSelector.d.ts.map +1 -0
- package/dist/components/overlays/McpSelector.js +74 -0
- package/dist/components/overlays/McpServerActions.cjs +124 -0
- package/dist/components/overlays/McpServerActions.d.ts +28 -0
- package/dist/components/overlays/McpServerActions.d.ts.map +1 -0
- package/dist/components/overlays/McpServerActions.js +111 -0
- package/dist/components/overlays/McpServerList.cjs +152 -0
- package/dist/components/overlays/McpServerList.d.ts +29 -0
- package/dist/components/overlays/McpServerList.d.ts.map +1 -0
- package/dist/components/overlays/McpServerList.js +139 -0
- package/dist/components/overlays/ModelSelectorRefactored.cjs +869 -0
- package/dist/components/overlays/ModelSelectorRefactored.d.ts +27 -0
- package/dist/components/overlays/ModelSelectorRefactored.d.ts.map +1 -0
- package/dist/components/overlays/ModelSelectorRefactored.js +870 -0
- package/dist/components/overlays/PluginActions.cjs +108 -0
- package/dist/components/overlays/PluginActions.d.ts +27 -0
- package/dist/components/overlays/PluginActions.d.ts.map +1 -0
- package/dist/components/overlays/PluginActions.js +95 -0
- package/dist/components/overlays/PluginList.cjs +115 -0
- package/dist/components/overlays/PluginList.d.ts +21 -0
- package/dist/components/overlays/PluginList.d.ts.map +1 -0
- package/dist/components/overlays/PluginList.js +102 -0
- package/dist/components/overlays/PluginManager.cjs +106 -0
- package/dist/components/overlays/PluginManager.d.ts +21 -0
- package/dist/components/overlays/PluginManager.d.ts.map +1 -0
- package/dist/components/overlays/PluginManager.js +86 -0
- package/dist/components/overlays/PromptAddChoice.cjs +92 -0
- package/dist/components/overlays/PromptAddChoice.d.ts +22 -0
- package/dist/components/overlays/PromptAddChoice.d.ts.map +1 -0
- package/dist/components/overlays/PromptAddChoice.js +72 -0
- package/dist/components/overlays/PromptAddWizard.cjs +215 -0
- package/dist/components/overlays/PromptAddWizard.d.ts +29 -0
- package/dist/components/overlays/PromptAddWizard.d.ts.map +1 -0
- package/dist/components/overlays/PromptAddWizard.js +195 -0
- package/dist/components/overlays/PromptDeleteSelector.cjs +148 -0
- package/dist/components/overlays/PromptDeleteSelector.d.ts +27 -0
- package/dist/components/overlays/PromptDeleteSelector.d.ts.map +1 -0
- package/dist/components/overlays/PromptDeleteSelector.js +135 -0
- package/dist/components/overlays/PromptList.cjs +169 -0
- package/dist/components/overlays/PromptList.d.ts +33 -0
- package/dist/components/overlays/PromptList.d.ts.map +1 -0
- package/dist/components/overlays/PromptList.js +157 -0
- package/dist/components/overlays/ReasoningOverlay.cjs +305 -0
- package/dist/components/overlays/ReasoningOverlay.d.ts +28 -0
- package/dist/components/overlays/ReasoningOverlay.d.ts.map +1 -0
- package/dist/components/overlays/ReasoningOverlay.js +278 -0
- package/dist/components/overlays/SearchOverlay.cjs +249 -0
- package/dist/components/overlays/SearchOverlay.d.ts +23 -0
- package/dist/components/overlays/SearchOverlay.d.ts.map +1 -0
- package/dist/components/overlays/SearchOverlay.js +236 -0
- package/dist/components/overlays/SessionRenameOverlay.cjs +101 -0
- package/dist/components/overlays/SessionRenameOverlay.d.ts +21 -0
- package/dist/components/overlays/SessionRenameOverlay.d.ts.map +1 -0
- package/dist/components/overlays/SessionRenameOverlay.js +81 -0
- package/dist/components/overlays/SessionSelectorRefactored.cjs +153 -0
- package/dist/components/overlays/SessionSelectorRefactored.d.ts +26 -0
- package/dist/components/overlays/SessionSelectorRefactored.d.ts.map +1 -0
- package/dist/components/overlays/SessionSelectorRefactored.js +133 -0
- package/dist/components/overlays/SessionSubcommandSelector.cjs +84 -0
- package/dist/components/overlays/SessionSubcommandSelector.d.ts +21 -0
- package/dist/components/overlays/SessionSubcommandSelector.d.ts.map +1 -0
- package/dist/components/overlays/SessionSubcommandSelector.js +64 -0
- package/dist/components/overlays/SoundsSelector.cjs +632 -0
- package/dist/components/overlays/SoundsSelector.d.ts +21 -0
- package/dist/components/overlays/SoundsSelector.d.ts.map +1 -0
- package/dist/components/overlays/SoundsSelector.js +619 -0
- package/dist/components/overlays/StreamSelector.cjs +104 -0
- package/dist/components/overlays/StreamSelector.d.ts +20 -0
- package/dist/components/overlays/StreamSelector.d.ts.map +1 -0
- package/dist/components/overlays/StreamSelector.js +84 -0
- package/dist/components/overlays/ToolBrowser.cjs +854 -0
- package/dist/components/overlays/ToolBrowser.d.ts +26 -0
- package/dist/components/overlays/ToolBrowser.d.ts.map +1 -0
- package/dist/components/overlays/ToolBrowser.js +831 -0
- package/dist/components/overlays/custom-model-wizard/LocalModelWizard.cjs +784 -0
- package/dist/components/overlays/custom-model-wizard/LocalModelWizard.d.ts +25 -0
- package/dist/components/overlays/custom-model-wizard/LocalModelWizard.d.ts.map +1 -0
- package/dist/components/overlays/custom-model-wizard/LocalModelWizard.js +768 -0
- package/dist/components/overlays/custom-model-wizard/index.cjs +26 -0
- package/dist/components/overlays/custom-model-wizard/index.d.ts +15 -0
- package/dist/components/overlays/custom-model-wizard/index.d.ts.map +1 -0
- package/dist/components/overlays/custom-model-wizard/index.js +3 -0
- package/dist/components/overlays/custom-model-wizard/provider-config.cjs +549 -0
- package/dist/components/overlays/custom-model-wizard/provider-config.d.ts +42 -0
- package/dist/components/overlays/custom-model-wizard/provider-config.d.ts.map +1 -0
- package/dist/components/overlays/custom-model-wizard/provider-config.js +516 -0
- package/dist/components/overlays/custom-model-wizard/provider-config.test.cjs +31 -0
- package/dist/components/overlays/custom-model-wizard/provider-config.test.d.ts +2 -0
- package/dist/components/overlays/custom-model-wizard/provider-config.test.d.ts.map +1 -0
- package/dist/components/overlays/custom-model-wizard/provider-config.test.js +30 -0
- package/dist/components/overlays/custom-model-wizard/shared/ApiKeyStep.cjs +59 -0
- package/dist/components/overlays/custom-model-wizard/shared/ApiKeyStep.d.ts +25 -0
- package/dist/components/overlays/custom-model-wizard/shared/ApiKeyStep.d.ts.map +1 -0
- package/dist/components/overlays/custom-model-wizard/shared/ApiKeyStep.js +33 -0
- package/dist/components/overlays/custom-model-wizard/shared/ProviderSelector.cjs +64 -0
- package/dist/components/overlays/custom-model-wizard/shared/ProviderSelector.d.ts +17 -0
- package/dist/components/overlays/custom-model-wizard/shared/ProviderSelector.d.ts.map +1 -0
- package/dist/components/overlays/custom-model-wizard/shared/ProviderSelector.js +40 -0
- package/dist/components/overlays/custom-model-wizard/shared/SetupInfoBanner.cjs +48 -0
- package/dist/components/overlays/custom-model-wizard/shared/SetupInfoBanner.d.ts +20 -0
- package/dist/components/overlays/custom-model-wizard/shared/SetupInfoBanner.d.ts.map +1 -0
- package/dist/components/overlays/custom-model-wizard/shared/SetupInfoBanner.js +24 -0
- package/dist/components/overlays/custom-model-wizard/shared/WizardStepInput.cjs +58 -0
- package/dist/components/overlays/custom-model-wizard/shared/WizardStepInput.d.ts +30 -0
- package/dist/components/overlays/custom-model-wizard/shared/WizardStepInput.d.ts.map +1 -0
- package/dist/components/overlays/custom-model-wizard/shared/WizardStepInput.js +34 -0
- package/dist/components/overlays/custom-model-wizard/shared/index.cjs +41 -0
- package/dist/components/overlays/custom-model-wizard/shared/index.d.ts +8 -0
- package/dist/components/overlays/custom-model-wizard/shared/index.d.ts.map +1 -0
- package/dist/components/overlays/custom-model-wizard/shared/index.js +12 -0
- package/dist/components/overlays/custom-model-wizard/types.cjs +53 -0
- package/dist/components/overlays/custom-model-wizard/types.d.ts +85 -0
- package/dist/components/overlays/custom-model-wizard/types.d.ts.map +1 -0
- package/dist/components/overlays/custom-model-wizard/types.js +29 -0
- package/dist/components/renderers/DiffRenderer.cjs +145 -0
- package/dist/components/renderers/DiffRenderer.d.ts +21 -0
- package/dist/components/renderers/DiffRenderer.d.ts.map +1 -0
- package/dist/components/renderers/DiffRenderer.js +118 -0
- package/dist/components/renderers/FilePreviewRenderer.cjs +146 -0
- package/dist/components/renderers/FilePreviewRenderer.d.ts +30 -0
- package/dist/components/renderers/FilePreviewRenderer.d.ts.map +1 -0
- package/dist/components/renderers/FilePreviewRenderer.js +119 -0
- package/dist/components/renderers/FileRenderer.cjs +95 -0
- package/dist/components/renderers/FileRenderer.d.ts +21 -0
- package/dist/components/renderers/FileRenderer.d.ts.map +1 -0
- package/dist/components/renderers/FileRenderer.js +71 -0
- package/dist/components/renderers/GenericRenderer.cjs +63 -0
- package/dist/components/renderers/GenericRenderer.d.ts +21 -0
- package/dist/components/renderers/GenericRenderer.d.ts.map +1 -0
- package/dist/components/renderers/GenericRenderer.js +39 -0
- package/dist/components/renderers/SearchRenderer.cjs +77 -0
- package/dist/components/renderers/SearchRenderer.d.ts +20 -0
- package/dist/components/renderers/SearchRenderer.d.ts.map +1 -0
- package/dist/components/renderers/SearchRenderer.js +43 -0
- package/dist/components/renderers/ShellRenderer.cjs +61 -0
- package/dist/components/renderers/ShellRenderer.d.ts +21 -0
- package/dist/components/renderers/ShellRenderer.d.ts.map +1 -0
- package/dist/components/renderers/ShellRenderer.js +37 -0
- package/dist/components/renderers/diff-shared.cjs +172 -0
- package/dist/components/renderers/diff-shared.d.ts +61 -0
- package/dist/components/renderers/diff-shared.d.ts.map +1 -0
- package/dist/components/renderers/diff-shared.js +142 -0
- package/dist/components/renderers/index.cjs +75 -0
- package/dist/components/renderers/index.d.ts +28 -0
- package/dist/components/renderers/index.d.ts.map +1 -0
- package/dist/components/renderers/index.js +44 -0
- package/dist/components/shared/FocusOverlayFrame.cjs +39 -0
- package/dist/components/shared/FocusOverlayFrame.d.ts +7 -0
- package/dist/components/shared/FocusOverlayFrame.d.ts.map +1 -0
- package/dist/components/shared/FocusOverlayFrame.js +15 -0
- package/dist/components/shared/HintBar.cjs +33 -0
- package/dist/components/shared/HintBar.d.ts +6 -0
- package/dist/components/shared/HintBar.d.ts.map +1 -0
- package/dist/components/shared/HintBar.js +9 -0
- package/dist/components/shared/MarkdownText.cjs +409 -0
- package/dist/components/shared/MarkdownText.d.ts +38 -0
- package/dist/components/shared/MarkdownText.d.ts.map +1 -0
- package/dist/components/shared/MarkdownText.js +373 -0
- package/dist/components/shared/VirtualizedList.cjs +365 -0
- package/dist/components/shared/VirtualizedList.d.ts +44 -0
- package/dist/components/shared/VirtualizedList.d.ts.map +1 -0
- package/dist/components/shared/VirtualizedList.js +349 -0
- package/dist/components/shared/text-buffer.cjs +1220 -0
- package/dist/components/shared/text-buffer.d.ts +185 -0
- package/dist/components/shared/text-buffer.d.ts.map +1 -0
- package/dist/components/shared/text-buffer.js +1194 -0
- package/dist/constants/processingPhrases.cjs +114 -0
- package/dist/constants/processingPhrases.d.ts +10 -0
- package/dist/constants/processingPhrases.d.ts.map +1 -0
- package/dist/constants/processingPhrases.js +89 -0
- package/dist/constants/spinnerFrames.cjs +28 -0
- package/dist/constants/spinnerFrames.d.ts +2 -0
- package/dist/constants/spinnerFrames.d.ts.map +1 -0
- package/dist/constants/spinnerFrames.js +4 -0
- package/dist/constants/tips.cjs +76 -0
- package/dist/constants/tips.d.ts +15 -0
- package/dist/constants/tips.d.ts.map +1 -0
- package/dist/constants/tips.js +51 -0
- package/dist/containers/InputContainer.cjs +706 -0
- package/dist/containers/InputContainer.d.ts +62 -0
- package/dist/containers/InputContainer.d.ts.map +1 -0
- package/dist/containers/InputContainer.js +672 -0
- package/dist/containers/OverlayContainer.cjs +2372 -0
- package/dist/containers/OverlayContainer.d.ts +42 -0
- package/dist/containers/OverlayContainer.d.ts.map +1 -0
- package/dist/containers/OverlayContainer.js +2356 -0
- package/dist/containers/index.cjs +31 -0
- package/dist/containers/index.d.ts +6 -0
- package/dist/containers/index.d.ts.map +1 -0
- package/dist/containers/index.js +6 -0
- package/dist/contexts/KeypressContext.cjs +436 -0
- package/dist/contexts/KeypressContext.d.ts +36 -0
- package/dist/contexts/KeypressContext.d.ts.map +1 -0
- package/dist/contexts/KeypressContext.js +408 -0
- package/dist/contexts/MouseContext.cjs +122 -0
- package/dist/contexts/MouseContext.d.ts +27 -0
- package/dist/contexts/MouseContext.d.ts.map +1 -0
- package/dist/contexts/MouseContext.js +101 -0
- package/dist/contexts/ScrollProvider.cjs +180 -0
- package/dist/contexts/ScrollProvider.d.ts +33 -0
- package/dist/contexts/ScrollProvider.d.ts.map +1 -0
- package/dist/contexts/ScrollProvider.js +163 -0
- package/dist/contexts/SoundContext.cjs +38 -0
- package/dist/contexts/SoundContext.d.ts +23 -0
- package/dist/contexts/SoundContext.d.ts.map +1 -0
- package/dist/contexts/SoundContext.js +13 -0
- package/dist/contexts/index.cjs +47 -0
- package/dist/contexts/index.d.ts +8 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/contexts/index.js +25 -0
- package/dist/hooks/index.cjs +54 -0
- package/dist/hooks/index.d.ts +12 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +28 -0
- package/dist/hooks/useAgentEvents.cjs +382 -0
- package/dist/hooks/useAgentEvents.d.ts +49 -0
- package/dist/hooks/useAgentEvents.d.ts.map +1 -0
- package/dist/hooks/useAgentEvents.js +360 -0
- package/dist/hooks/useAnimationTick.cjs +71 -0
- package/dist/hooks/useAnimationTick.d.ts +11 -0
- package/dist/hooks/useAnimationTick.d.ts.map +1 -0
- package/dist/hooks/useAnimationTick.js +47 -0
- package/dist/hooks/useBatchedScroll.cjs +44 -0
- package/dist/hooks/useBatchedScroll.d.ts +14 -0
- package/dist/hooks/useBatchedScroll.d.ts.map +1 -0
- package/dist/hooks/useBatchedScroll.js +20 -0
- package/dist/hooks/useCLIState.cjs +222 -0
- package/dist/hooks/useCLIState.d.ts +53 -0
- package/dist/hooks/useCLIState.d.ts.map +1 -0
- package/dist/hooks/useCLIState.js +201 -0
- package/dist/hooks/useElapsedTime.cjs +79 -0
- package/dist/hooks/useElapsedTime.d.ts +24 -0
- package/dist/hooks/useElapsedTime.d.ts.map +1 -0
- package/dist/hooks/useElapsedTime.js +55 -0
- package/dist/hooks/useGitBranch.cjs +47 -0
- package/dist/hooks/useGitBranch.d.ts +13 -0
- package/dist/hooks/useGitBranch.d.ts.map +1 -0
- package/dist/hooks/useGitBranch.js +23 -0
- package/dist/hooks/useHistorySearch.cjs +219 -0
- package/dist/hooks/useHistorySearch.d.ts +61 -0
- package/dist/hooks/useHistorySearch.d.ts.map +1 -0
- package/dist/hooks/useHistorySearch.js +195 -0
- package/dist/hooks/useInputHistory.cjs +47 -0
- package/dist/hooks/useInputHistory.d.ts +18 -0
- package/dist/hooks/useInputHistory.d.ts.map +1 -0
- package/dist/hooks/useInputHistory.js +23 -0
- package/dist/hooks/useInputOrchestrator.cjs +663 -0
- package/dist/hooks/useInputOrchestrator.d.ts +136 -0
- package/dist/hooks/useInputOrchestrator.d.ts.map +1 -0
- package/dist/hooks/useInputOrchestrator.js +635 -0
- package/dist/hooks/useKeyboardShortcuts.cjs +87 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts +21 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/hooks/useKeyboardShortcuts.js +63 -0
- package/dist/hooks/useKeypress.cjs +41 -0
- package/dist/hooks/useKeypress.d.ts +18 -0
- package/dist/hooks/useKeypress.d.ts.map +1 -0
- package/dist/hooks/useKeypress.js +17 -0
- package/dist/hooks/usePhraseCycler.cjs +74 -0
- package/dist/hooks/usePhraseCycler.d.ts +30 -0
- package/dist/hooks/usePhraseCycler.d.ts.map +1 -0
- package/dist/hooks/usePhraseCycler.js +50 -0
- package/dist/hooks/useStreaming.cjs +43 -0
- package/dist/hooks/useStreaming.d.ts +19 -0
- package/dist/hooks/useStreaming.d.ts.map +1 -0
- package/dist/hooks/useStreaming.js +24 -0
- package/dist/hooks/useTerminalSize.cjs +48 -0
- package/dist/hooks/useTerminalSize.d.ts +14 -0
- package/dist/hooks/useTerminalSize.d.ts.map +1 -0
- package/dist/hooks/useTerminalSize.js +24 -0
- package/dist/hooks/useTokenCounter.cjs +105 -0
- package/dist/hooks/useTokenCounter.d.ts +46 -0
- package/dist/hooks/useTokenCounter.d.ts.map +1 -0
- package/dist/hooks/useTokenCounter.js +81 -0
- package/dist/host/index.cjs +144 -0
- package/dist/host/index.d.ts +108 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +104 -0
- package/dist/index.cjs +33 -0
- package/dist/index.d.cts +195 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/interactive-commands/auth/index.cjs +44 -0
- package/dist/interactive-commands/auth/index.d.ts +13 -0
- package/dist/interactive-commands/auth/index.d.ts.map +1 -0
- package/dist/interactive-commands/auth/index.js +19 -0
- package/dist/interactive-commands/command-parser.cjs +184 -0
- package/dist/interactive-commands/command-parser.d.ts +56 -0
- package/dist/interactive-commands/command-parser.d.ts.map +1 -0
- package/dist/interactive-commands/command-parser.js +146 -0
- package/dist/interactive-commands/commands.cjs +135 -0
- package/dist/interactive-commands/commands.d.ts +52 -0
- package/dist/interactive-commands/commands.d.ts.map +1 -0
- package/dist/interactive-commands/commands.js +99 -0
- package/dist/interactive-commands/documentation-commands.cjs +61 -0
- package/dist/interactive-commands/documentation-commands.d.ts +15 -0
- package/dist/interactive-commands/documentation-commands.d.ts.map +1 -0
- package/dist/interactive-commands/documentation-commands.js +27 -0
- package/dist/interactive-commands/exit-handler.cjs +40 -0
- package/dist/interactive-commands/exit-handler.d.ts +12 -0
- package/dist/interactive-commands/exit-handler.d.ts.map +1 -0
- package/dist/interactive-commands/exit-handler.js +15 -0
- package/dist/interactive-commands/exit-stats.cjs +41 -0
- package/dist/interactive-commands/exit-stats.d.ts +24 -0
- package/dist/interactive-commands/exit-stats.d.ts.map +1 -0
- package/dist/interactive-commands/exit-stats.js +15 -0
- package/dist/interactive-commands/export/index.cjs +36 -0
- package/dist/interactive-commands/export/index.d.ts +13 -0
- package/dist/interactive-commands/export/index.d.ts.map +1 -0
- package/dist/interactive-commands/export/index.js +12 -0
- package/dist/interactive-commands/general-commands.cjs +478 -0
- package/dist/interactive-commands/general-commands.d.ts +22 -0
- package/dist/interactive-commands/general-commands.d.ts.map +1 -0
- package/dist/interactive-commands/general-commands.js +443 -0
- package/dist/interactive-commands/mcp/index.cjs +35 -0
- package/dist/interactive-commands/mcp/index.d.ts +13 -0
- package/dist/interactive-commands/mcp/index.d.ts.map +1 -0
- package/dist/interactive-commands/mcp/index.js +11 -0
- package/dist/interactive-commands/model/index.cjs +36 -0
- package/dist/interactive-commands/model/index.d.ts +13 -0
- package/dist/interactive-commands/model/index.d.ts.map +1 -0
- package/dist/interactive-commands/model/index.js +12 -0
- package/dist/interactive-commands/plugin/index.cjs +35 -0
- package/dist/interactive-commands/plugin/index.d.ts +13 -0
- package/dist/interactive-commands/plugin/index.d.ts.map +1 -0
- package/dist/interactive-commands/plugin/index.js +11 -0
- package/dist/interactive-commands/prompt-commands.cjs +269 -0
- package/dist/interactive-commands/prompt-commands.d.ts +25 -0
- package/dist/interactive-commands/prompt-commands.d.ts.map +1 -0
- package/dist/interactive-commands/prompt-commands.js +244 -0
- package/dist/interactive-commands/session/index.cjs +32 -0
- package/dist/interactive-commands/session/index.d.ts +16 -0
- package/dist/interactive-commands/session/index.d.ts.map +1 -0
- package/dist/interactive-commands/session/index.js +6 -0
- package/dist/interactive-commands/session/session-commands.cjs +64 -0
- package/dist/interactive-commands/session/session-commands.d.ts +32 -0
- package/dist/interactive-commands/session/session-commands.d.ts.map +1 -0
- package/dist/interactive-commands/session/session-commands.js +38 -0
- package/dist/interactive-commands/system/index.cjs +28 -0
- package/dist/interactive-commands/system/index.d.ts +13 -0
- package/dist/interactive-commands/system/index.d.ts.map +1 -0
- package/dist/interactive-commands/system/index.js +4 -0
- package/dist/interactive-commands/system/system-commands.cjs +217 -0
- package/dist/interactive-commands/system/system-commands.d.ts +6 -0
- package/dist/interactive-commands/system/system-commands.d.ts.map +1 -0
- package/dist/interactive-commands/system/system-commands.js +195 -0
- package/dist/interactive-commands/tool-commands.cjs +38 -0
- package/dist/interactive-commands/tool-commands.d.ts +15 -0
- package/dist/interactive-commands/tool-commands.d.ts.map +1 -0
- package/dist/interactive-commands/tool-commands.js +14 -0
- package/dist/interactive-commands/utils/arg-parser.cjs +59 -0
- package/dist/interactive-commands/utils/arg-parser.d.ts +57 -0
- package/dist/interactive-commands/utils/arg-parser.d.ts.map +1 -0
- package/dist/interactive-commands/utils/arg-parser.js +34 -0
- package/dist/interactive-commands/utils/command-output.cjs +75 -0
- package/dist/interactive-commands/utils/command-output.d.ts +40 -0
- package/dist/interactive-commands/utils/command-output.d.ts.map +1 -0
- package/dist/interactive-commands/utils/command-output.js +51 -0
- package/dist/interactive-commands/utils/format-output.cjs +36 -0
- package/dist/interactive-commands/utils/format-output.d.ts +14 -0
- package/dist/interactive-commands/utils/format-output.d.ts.map +1 -0
- package/dist/interactive-commands/utils/format-output.js +11 -0
- package/dist/services/CommandService.cjs +68 -0
- package/dist/services/CommandService.d.ts +58 -0
- package/dist/services/CommandService.d.ts.map +1 -0
- package/dist/services/CommandService.js +41 -0
- package/dist/services/InputService.cjs +97 -0
- package/dist/services/InputService.d.ts +40 -0
- package/dist/services/InputService.d.ts.map +1 -0
- package/dist/services/InputService.js +78 -0
- package/dist/services/MessageService.cjs +69 -0
- package/dist/services/MessageService.d.ts +35 -0
- package/dist/services/MessageService.d.ts.map +1 -0
- package/dist/services/MessageService.js +51 -0
- package/dist/services/index.cjs +39 -0
- package/dist/services/index.d.ts +8 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +16 -0
- package/dist/services/processStream.cjs +877 -0
- package/dist/services/processStream.d.ts +79 -0
- package/dist/services/processStream.d.ts.map +1 -0
- package/dist/services/processStream.js +843 -0
- package/dist/services/processStream.test.cjs +255 -0
- package/dist/services/processStream.test.d.ts +2 -0
- package/dist/services/processStream.test.d.ts.map +1 -0
- package/dist/services/processStream.test.js +254 -0
- package/dist/state/actions.cjs +16 -0
- package/dist/state/actions.d.ts +124 -0
- package/dist/state/actions.d.ts.map +1 -0
- package/dist/state/actions.js +0 -0
- package/dist/state/index.cjs +28 -0
- package/dist/state/index.d.ts +10 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +4 -0
- package/dist/state/initialState.cjs +78 -0
- package/dist/state/initialState.d.ts +12 -0
- package/dist/state/initialState.d.ts.map +1 -0
- package/dist/state/initialState.js +54 -0
- package/dist/state/reducer.cjs +340 -0
- package/dist/state/reducer.d.ts +15 -0
- package/dist/state/reducer.d.ts.map +1 -0
- package/dist/state/reducer.js +316 -0
- package/dist/state/streaming-state.cjs +52 -0
- package/dist/state/streaming-state.d.ts +27 -0
- package/dist/state/streaming-state.d.ts.map +1 -0
- package/dist/state/streaming-state.js +25 -0
- package/dist/state/types.cjs +16 -0
- package/dist/state/types.d.ts +388 -0
- package/dist/state/types.d.ts.map +1 -0
- package/dist/state/types.js +0 -0
- package/dist/utils/bracketedPaste.cjs +37 -0
- package/dist/utils/bracketedPaste.d.ts +22 -0
- package/dist/utils/bracketedPaste.d.ts.map +1 -0
- package/dist/utils/bracketedPaste.js +12 -0
- package/dist/utils/clipboardUtils.cjs +297 -0
- package/dist/utils/clipboardUtils.d.ts +49 -0
- package/dist/utils/clipboardUtils.d.ts.map +1 -0
- package/dist/utils/clipboardUtils.js +261 -0
- package/dist/utils/commandOverlays.cjs +69 -0
- package/dist/utils/commandOverlays.d.ts +22 -0
- package/dist/utils/commandOverlays.d.ts.map +1 -0
- package/dist/utils/commandOverlays.js +44 -0
- package/dist/utils/debugLog.cjs +63 -0
- package/dist/utils/debugLog.d.ts +38 -0
- package/dist/utils/debugLog.d.ts.map +1 -0
- package/dist/utils/debugLog.js +39 -0
- package/dist/utils/elicitationSchema.cjs +85 -0
- package/dist/utils/elicitationSchema.d.ts +11 -0
- package/dist/utils/elicitationSchema.d.ts.map +1 -0
- package/dist/utils/elicitationSchema.js +61 -0
- package/dist/utils/elicitationSchema.test.cjs +78 -0
- package/dist/utils/elicitationSchema.test.d.ts +2 -0
- package/dist/utils/elicitationSchema.test.d.ts.map +1 -0
- package/dist/utils/elicitationSchema.test.js +77 -0
- package/dist/utils/idGenerator.cjs +31 -0
- package/dist/utils/idGenerator.d.ts +10 -0
- package/dist/utils/idGenerator.d.ts.map +1 -0
- package/dist/utils/idGenerator.js +7 -0
- package/dist/utils/index.cjs +62 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +39 -0
- package/dist/utils/input.cjs +72 -0
- package/dist/utils/input.d.ts +25 -0
- package/dist/utils/input.d.ts.map +1 -0
- package/dist/utils/input.js +39 -0
- package/dist/utils/inputParsing.cjs +76 -0
- package/dist/utils/inputParsing.d.ts +31 -0
- package/dist/utils/inputParsing.d.ts.map +1 -0
- package/dist/utils/inputParsing.js +48 -0
- package/dist/utils/llm-provider-display.cjs +49 -0
- package/dist/utils/llm-provider-display.d.ts +3 -0
- package/dist/utils/llm-provider-display.d.ts.map +1 -0
- package/dist/utils/llm-provider-display.js +25 -0
- package/dist/utils/messageFormatting.cjs +447 -0
- package/dist/utils/messageFormatting.d.ts +131 -0
- package/dist/utils/messageFormatting.d.ts.map +1 -0
- package/dist/utils/messageFormatting.js +393 -0
- package/dist/utils/messageFormatting.test.cjs +16 -0
- package/dist/utils/messageFormatting.test.d.ts +2 -0
- package/dist/utils/messageFormatting.test.d.ts.map +1 -0
- package/dist/utils/messageFormatting.test.js +15 -0
- package/dist/utils/mouse.cjs +196 -0
- package/dist/utils/mouse.d.ts +61 -0
- package/dist/utils/mouse.d.ts.map +1 -0
- package/dist/utils/mouse.js +172 -0
- package/dist/utils/overlayPresentation.cjs +48 -0
- package/dist/utils/overlayPresentation.d.ts +19 -0
- package/dist/utils/overlayPresentation.d.ts.map +1 -0
- package/dist/utils/overlayPresentation.js +22 -0
- package/dist/utils/overlaySizing.cjs +39 -0
- package/dist/utils/overlaySizing.d.ts +19 -0
- package/dist/utils/overlaySizing.d.ts.map +1 -0
- package/dist/utils/overlaySizing.js +15 -0
- package/dist/utils/soundNotification.cjs +217 -0
- package/dist/utils/soundNotification.d.ts +77 -0
- package/dist/utils/soundNotification.d.ts.map +1 -0
- package/dist/utils/soundNotification.js +188 -0
- package/dist/utils/soundNotification.test.cjs +126 -0
- package/dist/utils/soundNotification.test.d.ts +2 -0
- package/dist/utils/soundNotification.test.d.ts.map +1 -0
- package/dist/utils/soundNotification.test.js +125 -0
- package/dist/utils/streamSplitter.cjs +126 -0
- package/dist/utils/streamSplitter.d.ts +44 -0
- package/dist/utils/streamSplitter.d.ts.map +1 -0
- package/dist/utils/streamSplitter.js +100 -0
- package/dist/utils/textUtils.cjs +223 -0
- package/dist/utils/textUtils.d.ts +63 -0
- package/dist/utils/textUtils.d.ts.map +1 -0
- package/dist/utils/textUtils.js +174 -0
- package/dist/utils/toolUtils.cjs +40 -0
- package/dist/utils/toolUtils.d.ts +20 -0
- package/dist/utils/toolUtils.d.ts.map +1 -0
- package/dist/utils/toolUtils.js +14 -0
- package/package.json +51 -0
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, forwardRef, useImperativeHandle, useCallback, useMemo } from "react";
|
|
3
|
+
import { Box, Text } from "ink";
|
|
4
|
+
import wrapAnsi from "wrap-ansi";
|
|
5
|
+
import { useTerminalSize } from "../hooks/useTerminalSize.js";
|
|
6
|
+
import { parseElicitationSchema } from "../utils/elicitationSchema.js";
|
|
7
|
+
function hasOwn(obj, key) {
|
|
8
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
9
|
+
}
|
|
10
|
+
function getDisplayValue(value) {
|
|
11
|
+
if (value === void 0 || value === null || value === "") return "\u2014";
|
|
12
|
+
if (Array.isArray(value)) return value.length > 0 ? value.join(", ") : "\u2014";
|
|
13
|
+
if (value === true) return "Yes";
|
|
14
|
+
if (value === false) return "No";
|
|
15
|
+
return String(value ?? "");
|
|
16
|
+
}
|
|
17
|
+
function clamp(value, min, max) {
|
|
18
|
+
return Math.max(min, Math.min(max, value));
|
|
19
|
+
}
|
|
20
|
+
const ElicitationForm = forwardRef(
|
|
21
|
+
({ metadata, onSubmit, onCancel }, ref) => {
|
|
22
|
+
const { rows: terminalRows, columns: terminalColumns } = useTerminalSize();
|
|
23
|
+
const headerLineCount = 1;
|
|
24
|
+
const stepHeaderLineCount = 2;
|
|
25
|
+
const spacerAfterStepLineCount = 1;
|
|
26
|
+
const questionLineCount = 2;
|
|
27
|
+
const helpLineCount = 2;
|
|
28
|
+
const errorLineCount = 1;
|
|
29
|
+
const questionHeaderHeight = headerLineCount + stepHeaderLineCount + spacerAfterStepLineCount + questionLineCount + helpLineCount + errorLineCount;
|
|
30
|
+
const reviewHeaderHeight = headerLineCount + spacerAfterStepLineCount;
|
|
31
|
+
const maxHeaderHeight = Math.max(questionHeaderHeight, reviewHeaderHeight);
|
|
32
|
+
const footerHeight = 1;
|
|
33
|
+
const minContentHeight = 4;
|
|
34
|
+
const viewportHeight = useMemo(() => {
|
|
35
|
+
const reservedRows = 8;
|
|
36
|
+
const minViewportHeight = maxHeaderHeight + footerHeight + minContentHeight;
|
|
37
|
+
const maxHeight = Math.max(minViewportHeight, terminalRows - reservedRows);
|
|
38
|
+
const desired = Math.max(minViewportHeight, Math.floor(terminalRows * 0.6));
|
|
39
|
+
return Math.min(maxHeight, desired);
|
|
40
|
+
}, [footerHeight, maxHeaderHeight, minContentHeight, terminalRows]);
|
|
41
|
+
const availableWidth = Math.max(20, terminalColumns - 2);
|
|
42
|
+
const fields = useMemo(() => {
|
|
43
|
+
return parseElicitationSchema(metadata.schema);
|
|
44
|
+
}, [metadata.schema]);
|
|
45
|
+
const wrapClampedLines = useCallback(
|
|
46
|
+
(text, maxLines) => {
|
|
47
|
+
if (maxLines <= 0) return [];
|
|
48
|
+
const wrapped = wrapAnsi(text, availableWidth, {
|
|
49
|
+
hard: true,
|
|
50
|
+
wordWrap: true,
|
|
51
|
+
trim: false
|
|
52
|
+
});
|
|
53
|
+
const rawLines = wrapped.length > 0 ? wrapped.split("\n") : [""];
|
|
54
|
+
const didTruncate = rawLines.length > maxLines;
|
|
55
|
+
const lines = rawLines.slice(0, maxLines);
|
|
56
|
+
if (didTruncate && lines.length > 0) {
|
|
57
|
+
const lastIndex = lines.length - 1;
|
|
58
|
+
const lastLine = (lines[lastIndex] ?? "").replace(/\s+$/, "");
|
|
59
|
+
const safe = lastLine.length > 0 ? `${lastLine.slice(0, Math.max(0, lastLine.length - 1))}\u2026` : "\u2026";
|
|
60
|
+
lines[lastIndex] = safe;
|
|
61
|
+
}
|
|
62
|
+
while (lines.length < maxLines) {
|
|
63
|
+
lines.push("");
|
|
64
|
+
}
|
|
65
|
+
return lines;
|
|
66
|
+
},
|
|
67
|
+
[availableWidth]
|
|
68
|
+
);
|
|
69
|
+
const [activeFieldIndex, setActiveFieldIndex] = useState(0);
|
|
70
|
+
const [formData, setFormData] = useState({});
|
|
71
|
+
const [draftInputs, setDraftInputs] = useState({});
|
|
72
|
+
const [enumIndex, setEnumIndex] = useState(0);
|
|
73
|
+
const [arraySelections, setArraySelections] = useState(/* @__PURE__ */ new Set());
|
|
74
|
+
const [errors, setErrors] = useState({});
|
|
75
|
+
const [isReviewing, setIsReviewing] = useState(false);
|
|
76
|
+
const [reviewScrollTop, setReviewScrollTop] = useState(0);
|
|
77
|
+
const activeField = fields[activeFieldIndex];
|
|
78
|
+
const contentHeight = useMemo(() => {
|
|
79
|
+
const activeHeaderHeight = isReviewing ? reviewHeaderHeight : questionHeaderHeight;
|
|
80
|
+
return Math.max(1, viewportHeight - activeHeaderHeight - footerHeight);
|
|
81
|
+
}, [footerHeight, isReviewing, questionHeaderHeight, reviewHeaderHeight, viewportHeight]);
|
|
82
|
+
const updateField = useCallback((name, value2) => {
|
|
83
|
+
setFormData((prev) => ({ ...prev, [name]: value2 }));
|
|
84
|
+
setErrors((prev) => {
|
|
85
|
+
if (!hasOwn(prev, name)) return prev;
|
|
86
|
+
const next = { ...prev };
|
|
87
|
+
delete next[name];
|
|
88
|
+
return next;
|
|
89
|
+
});
|
|
90
|
+
}, []);
|
|
91
|
+
const goToFieldIndex = useCallback(
|
|
92
|
+
(index, data = formData) => {
|
|
93
|
+
if (index < 0 || index >= fields.length) return;
|
|
94
|
+
setActiveFieldIndex(index);
|
|
95
|
+
const field = fields[index];
|
|
96
|
+
if (!field) return;
|
|
97
|
+
if (field.type === "boolean") {
|
|
98
|
+
const currentValue = data[field.name];
|
|
99
|
+
setEnumIndex(currentValue === false ? 1 : 0);
|
|
100
|
+
setArraySelections(/* @__PURE__ */ new Set());
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (field.type === "enum") {
|
|
104
|
+
const values = field.enumValues ?? [];
|
|
105
|
+
const currentValue = data[field.name];
|
|
106
|
+
const currentIndex = values.findIndex((v) => v === currentValue);
|
|
107
|
+
setEnumIndex(currentIndex >= 0 ? currentIndex : 0);
|
|
108
|
+
setArraySelections(/* @__PURE__ */ new Set());
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (field.type === "array-enum") {
|
|
112
|
+
const values = field.enumValues ?? [];
|
|
113
|
+
const currentValue = data[field.name];
|
|
114
|
+
const currentValues = Array.isArray(currentValue) ? currentValue : [];
|
|
115
|
+
const selections = /* @__PURE__ */ new Set();
|
|
116
|
+
for (const selectedValue of currentValues) {
|
|
117
|
+
const selectedIndex = values.findIndex((v) => v === selectedValue);
|
|
118
|
+
if (selectedIndex >= 0) selections.add(selectedIndex);
|
|
119
|
+
}
|
|
120
|
+
setArraySelections(selections);
|
|
121
|
+
const firstSelected = selections.values().next().value;
|
|
122
|
+
const maxIndex = Math.max(0, values.length - 1);
|
|
123
|
+
setEnumIndex(Math.min(firstSelected ?? 0, maxIndex));
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
setEnumIndex(0);
|
|
127
|
+
setArraySelections(/* @__PURE__ */ new Set());
|
|
128
|
+
},
|
|
129
|
+
[fields, formData]
|
|
130
|
+
);
|
|
131
|
+
const nextField = useCallback(() => {
|
|
132
|
+
if (activeFieldIndex < fields.length - 1) {
|
|
133
|
+
goToFieldIndex(activeFieldIndex + 1);
|
|
134
|
+
}
|
|
135
|
+
}, [activeFieldIndex, fields.length, goToFieldIndex]);
|
|
136
|
+
const prevField = useCallback(() => {
|
|
137
|
+
if (activeFieldIndex > 0) {
|
|
138
|
+
goToFieldIndex(activeFieldIndex - 1);
|
|
139
|
+
}
|
|
140
|
+
}, [activeFieldIndex, goToFieldIndex]);
|
|
141
|
+
const handleSubmit = useCallback(
|
|
142
|
+
(currentFieldValue) => {
|
|
143
|
+
const newErrors = {};
|
|
144
|
+
const finalFormData = currentFieldValue ? { ...formData, [currentFieldValue.name]: currentFieldValue.value } : { ...formData };
|
|
145
|
+
for (const field of fields) {
|
|
146
|
+
if (!hasOwn(draftInputs, field.name)) continue;
|
|
147
|
+
const rawDraft = draftInputs[field.name] ?? "";
|
|
148
|
+
if (field.type === "number") {
|
|
149
|
+
const trimmed = rawDraft.trim();
|
|
150
|
+
if (trimmed === "") {
|
|
151
|
+
finalFormData[field.name] = "";
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const parsed = Number(trimmed);
|
|
155
|
+
if (Number.isNaN(parsed)) {
|
|
156
|
+
newErrors[field.name] = "Invalid number";
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
finalFormData[field.name] = parsed;
|
|
160
|
+
}
|
|
161
|
+
if (field.type === "string") {
|
|
162
|
+
finalFormData[field.name] = rawDraft;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
for (const field of fields) {
|
|
166
|
+
if (!field.required) continue;
|
|
167
|
+
const value2 = finalFormData[field.name];
|
|
168
|
+
if (field.type === "array-enum") {
|
|
169
|
+
if (!Array.isArray(value2) || value2.length === 0) {
|
|
170
|
+
newErrors[field.name] = "Required";
|
|
171
|
+
}
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
if (value2 === void 0 || value2 === null || value2 === "") {
|
|
175
|
+
newErrors[field.name] = "Required";
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (Object.keys(newErrors).length > 0) {
|
|
179
|
+
setErrors(newErrors);
|
|
180
|
+
const firstErrorField = fields.findIndex((f) => newErrors[f.name]);
|
|
181
|
+
if (firstErrorField >= 0) {
|
|
182
|
+
goToFieldIndex(firstErrorField, finalFormData);
|
|
183
|
+
}
|
|
184
|
+
setIsReviewing(false);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
setFormData(finalFormData);
|
|
188
|
+
setReviewScrollTop(0);
|
|
189
|
+
setIsReviewing(true);
|
|
190
|
+
},
|
|
191
|
+
[draftInputs, fields, formData, goToFieldIndex]
|
|
192
|
+
);
|
|
193
|
+
const confirmSubmit = useCallback(() => {
|
|
194
|
+
onSubmit(formData);
|
|
195
|
+
}, [formData, onSubmit]);
|
|
196
|
+
useImperativeHandle(
|
|
197
|
+
ref,
|
|
198
|
+
() => ({
|
|
199
|
+
handleInput: (input, key) => {
|
|
200
|
+
if (isReviewing) {
|
|
201
|
+
const maxScrollTop = Math.max(0, fields.length - contentHeight);
|
|
202
|
+
if (key.return) {
|
|
203
|
+
confirmSubmit();
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
if (key.backspace || key.delete) {
|
|
207
|
+
setIsReviewing(false);
|
|
208
|
+
goToFieldIndex(Math.max(0, fields.length - 1));
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
211
|
+
if (key.leftArrow || key.tab && key.shift) {
|
|
212
|
+
setIsReviewing(false);
|
|
213
|
+
goToFieldIndex(Math.max(0, fields.length - 1));
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
if (key.upArrow) {
|
|
217
|
+
setReviewScrollTop((prev) => Math.max(0, prev - 1));
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
if (key.downArrow) {
|
|
221
|
+
setReviewScrollTop((prev) => Math.min(maxScrollTop, prev + 1));
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
if (key.pageUp) {
|
|
225
|
+
setReviewScrollTop((prev) => Math.max(0, prev - 5));
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
if (key.pageDown) {
|
|
229
|
+
setReviewScrollTop((prev) => Math.min(maxScrollTop, prev + 5));
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
if (key.escape) {
|
|
233
|
+
onCancel();
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
if (key.escape) {
|
|
239
|
+
onCancel();
|
|
240
|
+
return true;
|
|
241
|
+
}
|
|
242
|
+
if (!activeField) return false;
|
|
243
|
+
if (key.leftArrow || key.tab && key.shift) {
|
|
244
|
+
prevField();
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
if (key.rightArrow || key.tab && !key.shift) {
|
|
248
|
+
if (activeFieldIndex === fields.length - 1) {
|
|
249
|
+
handleSubmit();
|
|
250
|
+
} else {
|
|
251
|
+
nextField();
|
|
252
|
+
}
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
const setDraftValue = (updater) => {
|
|
256
|
+
const hadError = hasOwn(errors, activeField.name);
|
|
257
|
+
setDraftInputs((prev) => {
|
|
258
|
+
const current = hasOwn(prev, activeField.name) ? prev[activeField.name] ?? "" : (() => {
|
|
259
|
+
const existing = formData[activeField.name];
|
|
260
|
+
return existing === void 0 || existing === null ? "" : String(existing);
|
|
261
|
+
})();
|
|
262
|
+
return { ...prev, [activeField.name]: updater(current) };
|
|
263
|
+
});
|
|
264
|
+
if (hadError) {
|
|
265
|
+
setErrors((prevErrors) => {
|
|
266
|
+
const nextErrors = { ...prevErrors };
|
|
267
|
+
delete nextErrors[activeField.name];
|
|
268
|
+
return nextErrors;
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
switch (activeField.type) {
|
|
273
|
+
case "boolean": {
|
|
274
|
+
if (key.upArrow) {
|
|
275
|
+
setEnumIndex((prev) => clamp(prev - 1, 0, 1));
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
if (key.downArrow) {
|
|
279
|
+
setEnumIndex((prev) => clamp(prev + 1, 0, 1));
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
if (input === " ") {
|
|
283
|
+
setEnumIndex((prev) => prev === 0 ? 1 : 0);
|
|
284
|
+
return true;
|
|
285
|
+
}
|
|
286
|
+
if (key.return) {
|
|
287
|
+
const nextValue = enumIndex === 0;
|
|
288
|
+
updateField(activeField.name, nextValue);
|
|
289
|
+
if (activeFieldIndex === fields.length - 1) {
|
|
290
|
+
handleSubmit({ name: activeField.name, value: nextValue });
|
|
291
|
+
} else {
|
|
292
|
+
nextField();
|
|
293
|
+
}
|
|
294
|
+
return true;
|
|
295
|
+
}
|
|
296
|
+
break;
|
|
297
|
+
}
|
|
298
|
+
case "enum": {
|
|
299
|
+
const values = activeField.enumValues || [];
|
|
300
|
+
if (key.upArrow) {
|
|
301
|
+
setEnumIndex((prev) => prev > 0 ? prev - 1 : values.length - 1);
|
|
302
|
+
return true;
|
|
303
|
+
}
|
|
304
|
+
if (key.downArrow) {
|
|
305
|
+
setEnumIndex((prev) => prev < values.length - 1 ? prev + 1 : 0);
|
|
306
|
+
return true;
|
|
307
|
+
}
|
|
308
|
+
if (key.return) {
|
|
309
|
+
const selectedValue = values[enumIndex];
|
|
310
|
+
updateField(activeField.name, selectedValue);
|
|
311
|
+
if (activeFieldIndex === fields.length - 1) {
|
|
312
|
+
handleSubmit({ name: activeField.name, value: selectedValue });
|
|
313
|
+
} else {
|
|
314
|
+
nextField();
|
|
315
|
+
}
|
|
316
|
+
return true;
|
|
317
|
+
}
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
case "array-enum": {
|
|
321
|
+
const values = activeField.enumValues || [];
|
|
322
|
+
if (key.upArrow) {
|
|
323
|
+
setEnumIndex((prev) => prev > 0 ? prev - 1 : values.length - 1);
|
|
324
|
+
return true;
|
|
325
|
+
}
|
|
326
|
+
if (key.downArrow) {
|
|
327
|
+
setEnumIndex((prev) => prev < values.length - 1 ? prev + 1 : 0);
|
|
328
|
+
return true;
|
|
329
|
+
}
|
|
330
|
+
if (input === " ") {
|
|
331
|
+
const nextSelections = new Set(arraySelections);
|
|
332
|
+
if (nextSelections.has(enumIndex)) nextSelections.delete(enumIndex);
|
|
333
|
+
else nextSelections.add(enumIndex);
|
|
334
|
+
setArraySelections(nextSelections);
|
|
335
|
+
const selected = Array.from(nextSelections).map((i) => values[i]);
|
|
336
|
+
updateField(activeField.name, selected);
|
|
337
|
+
return true;
|
|
338
|
+
}
|
|
339
|
+
if (key.return) {
|
|
340
|
+
const selected = Array.from(arraySelections).map((i) => values[i]);
|
|
341
|
+
if (activeFieldIndex === fields.length - 1) {
|
|
342
|
+
handleSubmit({ name: activeField.name, value: selected });
|
|
343
|
+
} else {
|
|
344
|
+
nextField();
|
|
345
|
+
}
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
break;
|
|
349
|
+
}
|
|
350
|
+
case "string":
|
|
351
|
+
case "number": {
|
|
352
|
+
const hasDraft = hasOwn(draftInputs, activeField.name);
|
|
353
|
+
const rawInput = hasDraft ? draftInputs[activeField.name] ?? "" : (() => {
|
|
354
|
+
const existing = formData[activeField.name];
|
|
355
|
+
return existing === void 0 || existing === null ? "" : String(existing);
|
|
356
|
+
})();
|
|
357
|
+
if (key.return) {
|
|
358
|
+
let value2 = hasDraft ? rawInput : formData[activeField.name];
|
|
359
|
+
if (activeField.type === "number" && hasDraft) {
|
|
360
|
+
const trimmed = rawInput.trim();
|
|
361
|
+
if (trimmed === "") {
|
|
362
|
+
value2 = "";
|
|
363
|
+
} else {
|
|
364
|
+
const parsed = Number(trimmed);
|
|
365
|
+
if (Number.isNaN(parsed)) {
|
|
366
|
+
setErrors((prev) => ({
|
|
367
|
+
...prev,
|
|
368
|
+
[activeField.name]: "Invalid number"
|
|
369
|
+
}));
|
|
370
|
+
return true;
|
|
371
|
+
}
|
|
372
|
+
value2 = parsed;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (hasDraft) {
|
|
376
|
+
updateField(activeField.name, value2);
|
|
377
|
+
}
|
|
378
|
+
if (activeFieldIndex === fields.length - 1) {
|
|
379
|
+
handleSubmit(
|
|
380
|
+
value2 !== void 0 ? { name: activeField.name, value: value2 } : void 0
|
|
381
|
+
);
|
|
382
|
+
} else {
|
|
383
|
+
nextField();
|
|
384
|
+
}
|
|
385
|
+
return true;
|
|
386
|
+
}
|
|
387
|
+
if (key.backspace || key.delete) {
|
|
388
|
+
setDraftValue((prev) => prev.slice(0, -1));
|
|
389
|
+
return true;
|
|
390
|
+
}
|
|
391
|
+
if (input && !key.ctrl && !key.meta) {
|
|
392
|
+
if (activeField.type === "number") {
|
|
393
|
+
const filtered = input.replace(/[^\d.-]/g, "");
|
|
394
|
+
if (filtered.length > 0) {
|
|
395
|
+
setDraftValue((prev) => prev + filtered);
|
|
396
|
+
}
|
|
397
|
+
} else {
|
|
398
|
+
setDraftValue((prev) => prev + input);
|
|
399
|
+
}
|
|
400
|
+
return true;
|
|
401
|
+
}
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
return false;
|
|
406
|
+
}
|
|
407
|
+
}),
|
|
408
|
+
[
|
|
409
|
+
activeField,
|
|
410
|
+
activeFieldIndex,
|
|
411
|
+
arraySelections,
|
|
412
|
+
contentHeight,
|
|
413
|
+
confirmSubmit,
|
|
414
|
+
draftInputs,
|
|
415
|
+
enumIndex,
|
|
416
|
+
errors,
|
|
417
|
+
fields,
|
|
418
|
+
formData,
|
|
419
|
+
handleSubmit,
|
|
420
|
+
isReviewing,
|
|
421
|
+
goToFieldIndex,
|
|
422
|
+
nextField,
|
|
423
|
+
onCancel,
|
|
424
|
+
prevField,
|
|
425
|
+
reviewScrollTop,
|
|
426
|
+
updateField
|
|
427
|
+
]
|
|
428
|
+
);
|
|
429
|
+
if (fields.length === 0) {
|
|
430
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ jsx(Text, { color: "red", children: "Invalid form schema" }) });
|
|
431
|
+
}
|
|
432
|
+
const isAnswered = (field) => {
|
|
433
|
+
if (field.type === "boolean") return hasOwn(formData, field.name);
|
|
434
|
+
if (field.type === "enum") return hasOwn(formData, field.name);
|
|
435
|
+
if (field.type === "array-enum") {
|
|
436
|
+
const value3 = formData[field.name];
|
|
437
|
+
return Array.isArray(value3) && value3.length > 0;
|
|
438
|
+
}
|
|
439
|
+
const draft = draftInputs[field.name];
|
|
440
|
+
if (typeof draft === "string" && draft.trim() !== "") return true;
|
|
441
|
+
const value2 = formData[field.name];
|
|
442
|
+
return value2 !== void 0 && value2 !== null && value2 !== "";
|
|
443
|
+
};
|
|
444
|
+
if (!isReviewing && !activeField) {
|
|
445
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ jsx(Text, { color: "red", children: "Invalid form state" }) });
|
|
446
|
+
}
|
|
447
|
+
const value = activeField ? formData[activeField.name] : void 0;
|
|
448
|
+
const currentInput = activeField && hasOwn(draftInputs, activeField.name) ? draftInputs[activeField.name] ?? "" : value === void 0 || value === null ? "" : String(value);
|
|
449
|
+
const errorText = activeField ? errors[activeField.name] ?? "" : "";
|
|
450
|
+
const renderContent = () => {
|
|
451
|
+
if (isReviewing) {
|
|
452
|
+
return /* @__PURE__ */ jsx(
|
|
453
|
+
Box,
|
|
454
|
+
{
|
|
455
|
+
overflowY: "scroll",
|
|
456
|
+
overflowX: "hidden",
|
|
457
|
+
scrollTop: reviewScrollTop,
|
|
458
|
+
scrollbarThumbColor: "gray",
|
|
459
|
+
flexDirection: "column",
|
|
460
|
+
height: contentHeight,
|
|
461
|
+
paddingRight: 1,
|
|
462
|
+
children: fields.map((field) => /* @__PURE__ */ jsxs(Text, { wrap: "truncate-end", children: [
|
|
463
|
+
field.question,
|
|
464
|
+
": ",
|
|
465
|
+
getDisplayValue(formData[field.name])
|
|
466
|
+
] }, field.name))
|
|
467
|
+
}
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
if (!activeField) return null;
|
|
471
|
+
if (activeField.type === "string" || activeField.type === "number") {
|
|
472
|
+
return /* @__PURE__ */ jsx(Box, { height: contentHeight, children: /* @__PURE__ */ jsxs(Text, { wrap: "truncate-end", children: [
|
|
473
|
+
/* @__PURE__ */ jsx(Text, { color: "cyan", children: "> " }),
|
|
474
|
+
currentInput || /* @__PURE__ */ jsx(Text, { color: "gray", children: "Type your answer\u2026" }),
|
|
475
|
+
/* @__PURE__ */ jsx(Text, { color: "cyan", children: "\u258B" })
|
|
476
|
+
] }) });
|
|
477
|
+
}
|
|
478
|
+
const options = [];
|
|
479
|
+
if (activeField.type === "boolean") {
|
|
480
|
+
options.push({
|
|
481
|
+
key: "yes",
|
|
482
|
+
label: "Yes",
|
|
483
|
+
isFocused: enumIndex === 0,
|
|
484
|
+
isSelected: false
|
|
485
|
+
});
|
|
486
|
+
options.push({
|
|
487
|
+
key: "no",
|
|
488
|
+
label: "No",
|
|
489
|
+
isFocused: enumIndex === 1,
|
|
490
|
+
isSelected: false
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
if ((activeField.type === "enum" || activeField.type === "array-enum") && activeField.enumValues) {
|
|
494
|
+
activeField.enumValues.forEach((opt, i) => {
|
|
495
|
+
const isFocused = i === enumIndex;
|
|
496
|
+
const isSelected = activeField.type === "enum" ? false : arraySelections.has(i);
|
|
497
|
+
options.push({
|
|
498
|
+
key: `${String(opt)}-${i}`,
|
|
499
|
+
label: String(opt),
|
|
500
|
+
isFocused,
|
|
501
|
+
isSelected
|
|
502
|
+
});
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
const focusedIndex = Math.max(
|
|
506
|
+
0,
|
|
507
|
+
options.findIndex((o) => o.isFocused)
|
|
508
|
+
);
|
|
509
|
+
const maxScrollTop = Math.max(0, options.length - contentHeight);
|
|
510
|
+
const targetScrollTop = clamp(
|
|
511
|
+
focusedIndex - Math.floor(contentHeight / 2),
|
|
512
|
+
0,
|
|
513
|
+
maxScrollTop
|
|
514
|
+
);
|
|
515
|
+
return /* @__PURE__ */ jsx(
|
|
516
|
+
Box,
|
|
517
|
+
{
|
|
518
|
+
overflowY: "scroll",
|
|
519
|
+
overflowX: "hidden",
|
|
520
|
+
scrollbarThumbColor: "gray",
|
|
521
|
+
height: contentHeight,
|
|
522
|
+
scrollTop: targetScrollTop,
|
|
523
|
+
flexDirection: "column",
|
|
524
|
+
paddingRight: 1,
|
|
525
|
+
children: options.map((opt) => {
|
|
526
|
+
const prefix = opt.isFocused ? "\u25B6 " : " ";
|
|
527
|
+
const mark = activeField.type === "array-enum" ? opt.isSelected ? "[\u2713] " : "[ ] " : "";
|
|
528
|
+
return /* @__PURE__ */ jsxs(
|
|
529
|
+
Text,
|
|
530
|
+
{
|
|
531
|
+
color: opt.isFocused ? "cyan" : "gray",
|
|
532
|
+
wrap: "truncate-end",
|
|
533
|
+
children: [
|
|
534
|
+
prefix,
|
|
535
|
+
mark,
|
|
536
|
+
opt.label
|
|
537
|
+
]
|
|
538
|
+
},
|
|
539
|
+
opt.key
|
|
540
|
+
);
|
|
541
|
+
})
|
|
542
|
+
}
|
|
543
|
+
);
|
|
544
|
+
};
|
|
545
|
+
const hintLine = (() => {
|
|
546
|
+
if (isReviewing) return "Enter submit \u2022 Backspace/\u2190 edit \u2022 \u2191\u2193 scroll \u2022 Esc cancel";
|
|
547
|
+
switch (activeField?.type) {
|
|
548
|
+
case "string":
|
|
549
|
+
case "number":
|
|
550
|
+
return "Type to answer \u2022 Enter next \u2022 \u2190/\u2192 question \u2022 Esc cancel";
|
|
551
|
+
case "array-enum":
|
|
552
|
+
return "\u2191/\u2193 option \u2022 Space toggle \u2022 Enter next \u2022 \u2190/\u2192 question \u2022 Esc cancel";
|
|
553
|
+
default:
|
|
554
|
+
return "\u2191/\u2193 option \u2022 Enter select \u2022 \u2190/\u2192 question \u2022 Esc cancel";
|
|
555
|
+
}
|
|
556
|
+
})();
|
|
557
|
+
const headerText = isReviewing ? "\u{1F4DD} Review your answers" : `\u{1F4DD} Please answer ${fields.length === 1 ? "this" : "these"} ${fields.length} ${fields.length === 1 ? "question" : "questions"}.`;
|
|
558
|
+
const stepText = (() => {
|
|
559
|
+
if (isReviewing) {
|
|
560
|
+
return "";
|
|
561
|
+
}
|
|
562
|
+
if (!activeField) return "";
|
|
563
|
+
return `Question ${activeFieldIndex + 1}/${fields.length}: ${activeField.stepLabel}`;
|
|
564
|
+
})();
|
|
565
|
+
const questionText = !isReviewing && activeField ? `${activeField.question}${activeField.required ? "*" : ""}` : "";
|
|
566
|
+
const helpText = !isReviewing && activeField?.helpText ? activeField.helpText : "";
|
|
567
|
+
const errorLineText = !isReviewing ? errorText : "";
|
|
568
|
+
const headerLines = wrapClampedLines(headerText, headerLineCount);
|
|
569
|
+
const stepLines = wrapClampedLines(stepText, stepHeaderLineCount);
|
|
570
|
+
const questionLines = wrapClampedLines(questionText, questionLineCount);
|
|
571
|
+
const helpLines = wrapClampedLines(helpText, helpLineCount);
|
|
572
|
+
const errorLines = wrapClampedLines(errorLineText, errorLineCount);
|
|
573
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 0, height: viewportHeight, children: [
|
|
574
|
+
headerLines.map((line, index) => /* @__PURE__ */ jsx(Text, { color: "yellowBright", bold: true, wrap: "truncate-end", children: line || " " }, `header-${index}`)),
|
|
575
|
+
!isReviewing && stepLines.map((line, index) => /* @__PURE__ */ jsx(Text, { color: "gray", dimColor: true, wrap: "truncate-end", children: line || " " }, `step-${index}`)),
|
|
576
|
+
Array.from({ length: spacerAfterStepLineCount }, (_, index) => /* @__PURE__ */ jsx(Text, { wrap: "truncate-end", children: " " }, `spacer-step-${index}`)),
|
|
577
|
+
!isReviewing && questionLines.map((line, index) => /* @__PURE__ */ jsx(Text, { color: "white", bold: true, wrap: "truncate-end", children: line || " " }, `question-${index}`)),
|
|
578
|
+
!isReviewing && helpLines.map((line, index) => /* @__PURE__ */ jsx(Text, { color: "gray", dimColor: true, wrap: "truncate-end", children: line || " " }, `help-${index}`)),
|
|
579
|
+
!isReviewing && errorLines.map((line, index) => /* @__PURE__ */ jsx(Text, { color: "red", wrap: "truncate-end", children: line || " " }, `error-${index}`)),
|
|
580
|
+
renderContent(),
|
|
581
|
+
/* @__PURE__ */ jsx(Text, { color: "gray", dimColor: true, wrap: "truncate-end", children: hintLine })
|
|
582
|
+
] });
|
|
583
|
+
}
|
|
584
|
+
);
|
|
585
|
+
ElicitationForm.displayName = "ElicitationForm";
|
|
586
|
+
export {
|
|
587
|
+
ElicitationForm
|
|
588
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var ErrorBoundary_exports = {};
|
|
30
|
+
__export(ErrorBoundary_exports, {
|
|
31
|
+
ErrorBoundary: () => ErrorBoundary
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(ErrorBoundary_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_react = __toESM(require("react"), 1);
|
|
36
|
+
var import_ink = require("ink");
|
|
37
|
+
var import_core = require("@dexto/core");
|
|
38
|
+
class ErrorBoundary extends import_react.default.Component {
|
|
39
|
+
constructor(props) {
|
|
40
|
+
super(props);
|
|
41
|
+
this.state = { hasError: false, error: null };
|
|
42
|
+
}
|
|
43
|
+
static getDerivedStateFromError(error) {
|
|
44
|
+
return { hasError: true, error };
|
|
45
|
+
}
|
|
46
|
+
componentDidCatch(error, errorInfo) {
|
|
47
|
+
import_core.logger.error(`Error in ErrorBoundary: ${error.message}`, {
|
|
48
|
+
error,
|
|
49
|
+
componentStack: errorInfo.componentStack
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
render() {
|
|
53
|
+
if (this.state.hasError) {
|
|
54
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "red", children: [
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "red", bold: true, children: "CLI Error" }),
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "red", children: this.state.error?.message || "Unknown error" }),
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "yellowBright", children: "Press Ctrl+C to exit" })
|
|
58
|
+
] });
|
|
59
|
+
}
|
|
60
|
+
return this.props.children;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
+
0 && (module.exports = {
|
|
65
|
+
ErrorBoundary
|
|
66
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/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"}
|