@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,854 @@
|
|
|
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 ToolBrowser_exports = {};
|
|
30
|
+
__export(ToolBrowser_exports, {
|
|
31
|
+
default: () => ToolBrowser_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(ToolBrowser_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_ink = require("ink");
|
|
37
|
+
var import_useTerminalSize = require("../../hooks/useTerminalSize.js");
|
|
38
|
+
var import_clipboardUtils = require("../../utils/clipboardUtils.js");
|
|
39
|
+
var import_overlaySizing = require("../../utils/overlaySizing.js");
|
|
40
|
+
var import_HintBar = require("../shared/HintBar.js");
|
|
41
|
+
const LIST_ACTIONS = ["view", "config", "back"];
|
|
42
|
+
const ToolBrowser = (0, import_react.forwardRef)(function ToolBrowser2({ isVisible, onClose, agent, sessionId }, ref) {
|
|
43
|
+
const { columns, rows } = (0, import_useTerminalSize.useTerminalSize)();
|
|
44
|
+
const maxVisibleTools = (0, import_react.useMemo)(() => {
|
|
45
|
+
return (0, import_overlaySizing.getMaxVisibleItemsForTerminalRows)({
|
|
46
|
+
rows,
|
|
47
|
+
hardCap: 10,
|
|
48
|
+
reservedRows: 16
|
|
49
|
+
});
|
|
50
|
+
}, [rows]);
|
|
51
|
+
const [tools, setTools] = (0, import_react.useState)([]);
|
|
52
|
+
const [isLoading, setIsLoading] = (0, import_react.useState)(false);
|
|
53
|
+
const [loadError, setLoadError] = (0, import_react.useState)(null);
|
|
54
|
+
const [selection, setSelection] = (0, import_react.useState)({ index: 0, offset: 0 });
|
|
55
|
+
const [searchQuery, setSearchQuery] = (0, import_react.useState)("");
|
|
56
|
+
const [viewMode, setViewMode] = (0, import_react.useState)("list");
|
|
57
|
+
const [selectedTool, setSelectedTool] = (0, import_react.useState)(null);
|
|
58
|
+
const [detailScrollOffset, setDetailScrollOffset] = (0, import_react.useState)(0);
|
|
59
|
+
const [copyFeedback, setCopyFeedback] = (0, import_react.useState)(null);
|
|
60
|
+
const [listActionsIndex, setListActionsIndex] = (0, import_react.useState)(0);
|
|
61
|
+
const [configIndex, setConfigIndex] = (0, import_react.useState)(0);
|
|
62
|
+
const [scopeToolName, setScopeToolName] = (0, import_react.useState)(null);
|
|
63
|
+
const [scopeNextEnabled, setScopeNextEnabled] = (0, import_react.useState)(true);
|
|
64
|
+
const [scopeTarget, setScopeTarget] = (0, import_react.useState)("session");
|
|
65
|
+
const selectedIndexRef = (0, import_react.useRef)(0);
|
|
66
|
+
const viewModeRef = (0, import_react.useRef)(viewMode);
|
|
67
|
+
const detailScrollOffsetRef = (0, import_react.useRef)(detailScrollOffset);
|
|
68
|
+
const detailMaxScrollOffsetRef = (0, import_react.useRef)(0);
|
|
69
|
+
const selectedToolRef = (0, import_react.useRef)(null);
|
|
70
|
+
const toolsRef = (0, import_react.useRef)([]);
|
|
71
|
+
const listActionsIndexRef = (0, import_react.useRef)(listActionsIndex);
|
|
72
|
+
const configIndexRef = (0, import_react.useRef)(configIndex);
|
|
73
|
+
const scopeTargetRef = (0, import_react.useRef)(scopeTarget);
|
|
74
|
+
const scopeNextEnabledRef = (0, import_react.useRef)(scopeNextEnabled);
|
|
75
|
+
const scopeToolNameRef = (0, import_react.useRef)(scopeToolName);
|
|
76
|
+
selectedIndexRef.current = selection.index;
|
|
77
|
+
viewModeRef.current = viewMode;
|
|
78
|
+
detailScrollOffsetRef.current = detailScrollOffset;
|
|
79
|
+
selectedToolRef.current = selectedTool;
|
|
80
|
+
toolsRef.current = tools;
|
|
81
|
+
listActionsIndexRef.current = listActionsIndex;
|
|
82
|
+
configIndexRef.current = configIndex;
|
|
83
|
+
scopeTargetRef.current = scopeTarget;
|
|
84
|
+
scopeNextEnabledRef.current = scopeNextEnabled;
|
|
85
|
+
scopeToolNameRef.current = scopeToolName;
|
|
86
|
+
(0, import_react.useEffect)(() => {
|
|
87
|
+
if (!isVisible) return;
|
|
88
|
+
let cancelled = false;
|
|
89
|
+
setIsLoading(true);
|
|
90
|
+
setSearchQuery("");
|
|
91
|
+
setSelection({ index: 0, offset: 0 });
|
|
92
|
+
setViewMode("list");
|
|
93
|
+
setSelectedTool(null);
|
|
94
|
+
setListActionsIndex(0);
|
|
95
|
+
setConfigIndex(0);
|
|
96
|
+
setLoadError(null);
|
|
97
|
+
const fetchTools = async () => {
|
|
98
|
+
try {
|
|
99
|
+
const [allTools, mcpTools, enabledTools, autoApprovedTools] = await Promise.all([
|
|
100
|
+
agent.getAllTools(),
|
|
101
|
+
agent.getAllMcpTools(),
|
|
102
|
+
agent.getEnabledTools(sessionId || void 0),
|
|
103
|
+
sessionId ? agent.getSessionAutoApproveTools(sessionId) : Promise.resolve([])
|
|
104
|
+
]);
|
|
105
|
+
const toolList = [];
|
|
106
|
+
const mcpToolNames = new Set(Object.keys(mcpTools));
|
|
107
|
+
const enabledToolNames = new Set(Object.keys(enabledTools));
|
|
108
|
+
const autoApprovedToolNames = new Set(autoApprovedTools ?? []);
|
|
109
|
+
for (const [toolName, toolInfo] of Object.entries(allTools)) {
|
|
110
|
+
const isMcpTool = mcpToolNames.has(toolName) || toolName.startsWith("mcp--");
|
|
111
|
+
let serverName;
|
|
112
|
+
if (toolName.startsWith("mcp--")) {
|
|
113
|
+
const parts = toolName.split("--");
|
|
114
|
+
if (parts.length >= 2) {
|
|
115
|
+
serverName = parts[1];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
toolList.push({
|
|
119
|
+
name: toolName,
|
|
120
|
+
description: toolInfo.description || "No description available",
|
|
121
|
+
source: isMcpTool ? "mcp" : "local",
|
|
122
|
+
serverName,
|
|
123
|
+
inputSchema: toolInfo.parameters,
|
|
124
|
+
isEnabled: enabledToolNames.has(toolName),
|
|
125
|
+
isAutoApproved: autoApprovedToolNames.has(toolName)
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
toolList.sort((a, b) => {
|
|
129
|
+
if (a.source !== b.source) {
|
|
130
|
+
return a.source === "local" ? -1 : 1;
|
|
131
|
+
}
|
|
132
|
+
return a.name.localeCompare(b.name);
|
|
133
|
+
});
|
|
134
|
+
if (!cancelled) {
|
|
135
|
+
setTools(toolList);
|
|
136
|
+
setIsLoading(false);
|
|
137
|
+
setLoadError(null);
|
|
138
|
+
}
|
|
139
|
+
} catch (error) {
|
|
140
|
+
if (!cancelled) {
|
|
141
|
+
const message = error instanceof Error ? error.message : "Unknown error";
|
|
142
|
+
setTools([]);
|
|
143
|
+
setIsLoading(false);
|
|
144
|
+
setLoadError(`Failed to load tools: ${message}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
void fetchTools();
|
|
149
|
+
return () => {
|
|
150
|
+
cancelled = true;
|
|
151
|
+
};
|
|
152
|
+
}, [isVisible, agent, sessionId]);
|
|
153
|
+
const filteredTools = (0, import_react.useMemo)(() => {
|
|
154
|
+
if (!searchQuery.trim()) {
|
|
155
|
+
return tools;
|
|
156
|
+
}
|
|
157
|
+
const query = searchQuery.toLowerCase();
|
|
158
|
+
return tools.filter((tool) => {
|
|
159
|
+
const name = tool.name.toLowerCase();
|
|
160
|
+
const desc = tool.description.toLowerCase();
|
|
161
|
+
const server = (tool.serverName || "").toLowerCase();
|
|
162
|
+
return name.includes(query) || desc.includes(query) || server.includes(query);
|
|
163
|
+
});
|
|
164
|
+
}, [tools, searchQuery]);
|
|
165
|
+
(0, import_react.useEffect)(() => {
|
|
166
|
+
setSelection((prev) => {
|
|
167
|
+
const maxIndex = Math.max(0, filteredTools.length - 1);
|
|
168
|
+
const nextIndex = Math.min(prev.index, maxIndex);
|
|
169
|
+
let nextOffset = prev.offset;
|
|
170
|
+
if (nextIndex < nextOffset) {
|
|
171
|
+
nextOffset = nextIndex;
|
|
172
|
+
} else if (nextIndex >= nextOffset + maxVisibleTools) {
|
|
173
|
+
nextOffset = Math.max(0, nextIndex - maxVisibleTools + 1);
|
|
174
|
+
}
|
|
175
|
+
const maxOffset = Math.max(0, filteredTools.length - maxVisibleTools);
|
|
176
|
+
nextOffset = Math.min(maxOffset, Math.max(0, nextOffset));
|
|
177
|
+
if (nextIndex === prev.index && nextOffset === prev.offset) {
|
|
178
|
+
return prev;
|
|
179
|
+
}
|
|
180
|
+
selectedIndexRef.current = nextIndex;
|
|
181
|
+
return { index: nextIndex, offset: nextOffset };
|
|
182
|
+
});
|
|
183
|
+
}, [filteredTools.length, maxVisibleTools]);
|
|
184
|
+
const openListActions = (tool) => {
|
|
185
|
+
setSelectedTool(tool);
|
|
186
|
+
setListActionsIndex(0);
|
|
187
|
+
setViewMode("list-actions");
|
|
188
|
+
};
|
|
189
|
+
const openToolDetails = (tool) => {
|
|
190
|
+
setSelectedTool(tool);
|
|
191
|
+
setViewMode("detail");
|
|
192
|
+
setDetailScrollOffset(0);
|
|
193
|
+
};
|
|
194
|
+
const openConfigMenu = (tool) => {
|
|
195
|
+
setSelectedTool(tool);
|
|
196
|
+
setConfigIndex(0);
|
|
197
|
+
setViewMode("config");
|
|
198
|
+
};
|
|
199
|
+
const openScopePrompt = (tool) => {
|
|
200
|
+
const nextEnabled = !tool.isEnabled;
|
|
201
|
+
const nextScope = sessionId ? "session" : "global";
|
|
202
|
+
setSelectedTool(tool);
|
|
203
|
+
setScopeToolName(tool.name);
|
|
204
|
+
setScopeNextEnabled(nextEnabled);
|
|
205
|
+
setScopeTarget(nextScope);
|
|
206
|
+
setViewMode("scope");
|
|
207
|
+
scopeToolNameRef.current = tool.name;
|
|
208
|
+
scopeNextEnabledRef.current = nextEnabled;
|
|
209
|
+
scopeTargetRef.current = nextScope;
|
|
210
|
+
};
|
|
211
|
+
const closeScopePrompt = () => {
|
|
212
|
+
setViewMode("config");
|
|
213
|
+
setScopeToolName(null);
|
|
214
|
+
};
|
|
215
|
+
const applyToolToggle = async (overrideTarget) => {
|
|
216
|
+
const targetToolName = scopeToolNameRef.current ?? scopeToolName ?? selectedToolRef.current?.name;
|
|
217
|
+
if (!targetToolName) return;
|
|
218
|
+
const effectiveTarget = overrideTarget ?? scopeTargetRef.current;
|
|
219
|
+
const nextEnabled = scopeNextEnabledRef.current;
|
|
220
|
+
const previousTools = toolsRef.current;
|
|
221
|
+
const updatedTools = previousTools.map((tool) => {
|
|
222
|
+
if (tool.name !== targetToolName) {
|
|
223
|
+
return tool;
|
|
224
|
+
}
|
|
225
|
+
const updatedTool = { ...tool, isEnabled: nextEnabled };
|
|
226
|
+
if (!nextEnabled && tool.isAutoApproved) {
|
|
227
|
+
updatedTool.isAutoApproved = false;
|
|
228
|
+
}
|
|
229
|
+
return updatedTool;
|
|
230
|
+
});
|
|
231
|
+
setTools(updatedTools);
|
|
232
|
+
const updatedSelected = updatedTools.find((tool) => tool.name === targetToolName) ?? null;
|
|
233
|
+
setSelectedTool(updatedSelected);
|
|
234
|
+
const autoApprovedTools = updatedTools.filter((tool) => tool.isAutoApproved).map((tool) => tool.name);
|
|
235
|
+
if (sessionId) {
|
|
236
|
+
agent.setSessionAutoApproveTools(sessionId, autoApprovedTools);
|
|
237
|
+
}
|
|
238
|
+
const disabledTools = updatedTools.filter((tool) => !tool.isEnabled).map((tool) => tool.name);
|
|
239
|
+
if (effectiveTarget === "session" && sessionId) {
|
|
240
|
+
agent.setSessionDisabledTools(sessionId, disabledTools);
|
|
241
|
+
} else if (effectiveTarget === "global") {
|
|
242
|
+
try {
|
|
243
|
+
const { updateAgentPreferences, saveAgentPreferences, agentPreferencesExist } = await import("@dexto/agent-management");
|
|
244
|
+
if (agentPreferencesExist(agent.config.agentId)) {
|
|
245
|
+
await updateAgentPreferences(agent.config.agentId, {
|
|
246
|
+
tools: { disabled: disabledTools }
|
|
247
|
+
});
|
|
248
|
+
} else {
|
|
249
|
+
await saveAgentPreferences(agent.config.agentId, {
|
|
250
|
+
tools: { disabled: disabledTools }
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
agent.setGlobalDisabledTools(disabledTools);
|
|
254
|
+
} catch (_error) {
|
|
255
|
+
if (sessionId) {
|
|
256
|
+
agent.setSessionDisabledTools(sessionId, disabledTools);
|
|
257
|
+
} else {
|
|
258
|
+
setTools(previousTools);
|
|
259
|
+
setSelectedTool(
|
|
260
|
+
previousTools.find((tool) => tool.name === targetToolName) ?? null
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
closeScopePrompt();
|
|
266
|
+
};
|
|
267
|
+
const toggleAutoApprove = () => {
|
|
268
|
+
if (!sessionId) return;
|
|
269
|
+
const updatedTools = toolsRef.current.map(
|
|
270
|
+
(tool) => tool.name === selectedToolRef.current?.name ? { ...tool, isAutoApproved: !tool.isAutoApproved } : tool
|
|
271
|
+
);
|
|
272
|
+
const updatedSelected = updatedTools.find(
|
|
273
|
+
(tool) => tool.name === selectedToolRef.current?.name
|
|
274
|
+
);
|
|
275
|
+
setTools(updatedTools);
|
|
276
|
+
setSelectedTool(updatedSelected ?? null);
|
|
277
|
+
const autoApprovedTools = updatedTools.filter((tool) => tool.isAutoApproved).map((tool) => tool.name);
|
|
278
|
+
agent.setSessionAutoApproveTools(sessionId, autoApprovedTools);
|
|
279
|
+
};
|
|
280
|
+
const closeConfigMenu = () => {
|
|
281
|
+
setViewMode("list-actions");
|
|
282
|
+
};
|
|
283
|
+
const closeDetailView = () => {
|
|
284
|
+
setViewMode("list-actions");
|
|
285
|
+
};
|
|
286
|
+
const closeListActions = () => {
|
|
287
|
+
setViewMode("list");
|
|
288
|
+
setSelectedTool(null);
|
|
289
|
+
};
|
|
290
|
+
(0, import_react.useImperativeHandle)(
|
|
291
|
+
ref,
|
|
292
|
+
() => ({
|
|
293
|
+
handleInput: (input, key) => {
|
|
294
|
+
if (!isVisible) return false;
|
|
295
|
+
if (isLoading) {
|
|
296
|
+
if (key.escape) {
|
|
297
|
+
onClose();
|
|
298
|
+
}
|
|
299
|
+
return true;
|
|
300
|
+
}
|
|
301
|
+
if (viewModeRef.current === "scope") {
|
|
302
|
+
if (key.escape || key.backspace || key.delete) {
|
|
303
|
+
closeScopePrompt();
|
|
304
|
+
return true;
|
|
305
|
+
}
|
|
306
|
+
if (key.upArrow || key.downArrow) {
|
|
307
|
+
setScopeTarget((prev) => prev === "session" ? "global" : "session");
|
|
308
|
+
return true;
|
|
309
|
+
}
|
|
310
|
+
if (key.return) {
|
|
311
|
+
if (scopeTargetRef.current === "session" && !sessionId) {
|
|
312
|
+
setScopeTarget("global");
|
|
313
|
+
scopeTargetRef.current = "global";
|
|
314
|
+
void applyToolToggle("global");
|
|
315
|
+
return true;
|
|
316
|
+
}
|
|
317
|
+
void applyToolToggle();
|
|
318
|
+
return true;
|
|
319
|
+
}
|
|
320
|
+
return true;
|
|
321
|
+
}
|
|
322
|
+
if (viewModeRef.current === "config") {
|
|
323
|
+
if (key.escape || key.backspace || key.delete) {
|
|
324
|
+
closeConfigMenu();
|
|
325
|
+
return true;
|
|
326
|
+
}
|
|
327
|
+
if (key.upArrow) {
|
|
328
|
+
const nextIndex = (configIndexRef.current - 1 + 3) % 3;
|
|
329
|
+
setConfigIndex(nextIndex);
|
|
330
|
+
return true;
|
|
331
|
+
}
|
|
332
|
+
if (key.downArrow) {
|
|
333
|
+
const nextIndex = (configIndexRef.current + 1) % 3;
|
|
334
|
+
setConfigIndex(nextIndex);
|
|
335
|
+
return true;
|
|
336
|
+
}
|
|
337
|
+
if (key.return) {
|
|
338
|
+
const tool = selectedToolRef.current;
|
|
339
|
+
if (tool) {
|
|
340
|
+
if (configIndexRef.current === 0) {
|
|
341
|
+
openScopePrompt(tool);
|
|
342
|
+
} else if (configIndexRef.current === 1) {
|
|
343
|
+
if (sessionId && tool.isEnabled) {
|
|
344
|
+
toggleAutoApprove();
|
|
345
|
+
}
|
|
346
|
+
} else {
|
|
347
|
+
closeConfigMenu();
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return true;
|
|
351
|
+
}
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
354
|
+
if (viewModeRef.current === "detail") {
|
|
355
|
+
if (key.escape || key.backspace || key.delete) {
|
|
356
|
+
closeDetailView();
|
|
357
|
+
return true;
|
|
358
|
+
}
|
|
359
|
+
if (key.upArrow) {
|
|
360
|
+
if (detailScrollOffsetRef.current > 0) {
|
|
361
|
+
setDetailScrollOffset((prev) => prev - 1);
|
|
362
|
+
}
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
if (key.downArrow) {
|
|
366
|
+
if (detailScrollOffsetRef.current < detailMaxScrollOffsetRef.current) {
|
|
367
|
+
setDetailScrollOffset((prev) => prev + 1);
|
|
368
|
+
}
|
|
369
|
+
return true;
|
|
370
|
+
}
|
|
371
|
+
if (input === "c" || input === "C") {
|
|
372
|
+
const tool = selectedToolRef.current;
|
|
373
|
+
if (tool) {
|
|
374
|
+
const schema = {
|
|
375
|
+
type: "function",
|
|
376
|
+
name: tool.name,
|
|
377
|
+
description: tool.description,
|
|
378
|
+
parameters: tool.inputSchema || {}
|
|
379
|
+
};
|
|
380
|
+
void (0, import_clipboardUtils.writeToClipboard)(JSON.stringify(schema, null, 2)).then(
|
|
381
|
+
(success) => {
|
|
382
|
+
setCopyFeedback(success ? "Copied!" : "Copy failed");
|
|
383
|
+
setTimeout(() => setCopyFeedback(null), 1500);
|
|
384
|
+
}
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
return true;
|
|
388
|
+
}
|
|
389
|
+
if (key.return) {
|
|
390
|
+
const tool = selectedToolRef.current;
|
|
391
|
+
if (tool) {
|
|
392
|
+
openConfigMenu(tool);
|
|
393
|
+
}
|
|
394
|
+
return true;
|
|
395
|
+
}
|
|
396
|
+
return true;
|
|
397
|
+
}
|
|
398
|
+
if (viewModeRef.current === "list-actions") {
|
|
399
|
+
if (key.escape || key.backspace || key.delete) {
|
|
400
|
+
closeListActions();
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
if (key.upArrow) {
|
|
404
|
+
const nextIndex = (listActionsIndexRef.current - 1 + LIST_ACTIONS.length) % LIST_ACTIONS.length;
|
|
405
|
+
setListActionsIndex(nextIndex);
|
|
406
|
+
return true;
|
|
407
|
+
}
|
|
408
|
+
if (key.downArrow) {
|
|
409
|
+
const nextIndex = (listActionsIndexRef.current + 1) % LIST_ACTIONS.length;
|
|
410
|
+
setListActionsIndex(nextIndex);
|
|
411
|
+
return true;
|
|
412
|
+
}
|
|
413
|
+
if (key.return) {
|
|
414
|
+
const tool = selectedToolRef.current;
|
|
415
|
+
const action = LIST_ACTIONS[listActionsIndexRef.current];
|
|
416
|
+
if (!tool) {
|
|
417
|
+
closeListActions();
|
|
418
|
+
return true;
|
|
419
|
+
}
|
|
420
|
+
if (action === "view") {
|
|
421
|
+
openToolDetails(tool);
|
|
422
|
+
} else if (action === "config") {
|
|
423
|
+
openConfigMenu(tool);
|
|
424
|
+
} else {
|
|
425
|
+
closeListActions();
|
|
426
|
+
}
|
|
427
|
+
return true;
|
|
428
|
+
}
|
|
429
|
+
return true;
|
|
430
|
+
}
|
|
431
|
+
if (key.escape) {
|
|
432
|
+
onClose();
|
|
433
|
+
return true;
|
|
434
|
+
}
|
|
435
|
+
if (input && !key.return && !key.upArrow && !key.downArrow && !key.tab) {
|
|
436
|
+
if (key.backspace || key.delete) {
|
|
437
|
+
setSearchQuery((prev) => prev.slice(0, -1));
|
|
438
|
+
return true;
|
|
439
|
+
}
|
|
440
|
+
if (input.length === 1 && input.charCodeAt(0) >= 32) {
|
|
441
|
+
setSearchQuery((prev) => prev + input);
|
|
442
|
+
selectedIndexRef.current = 0;
|
|
443
|
+
setSelection({ index: 0, offset: 0 });
|
|
444
|
+
return true;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
if (key.backspace || key.delete) {
|
|
448
|
+
setSearchQuery((prev) => prev.slice(0, -1));
|
|
449
|
+
return true;
|
|
450
|
+
}
|
|
451
|
+
const itemsLength = filteredTools.length;
|
|
452
|
+
if (itemsLength === 0) return false;
|
|
453
|
+
if (key.upArrow) {
|
|
454
|
+
const nextIndex = (selectedIndexRef.current - 1 + itemsLength) % itemsLength;
|
|
455
|
+
selectedIndexRef.current = nextIndex;
|
|
456
|
+
setSelection((prev) => {
|
|
457
|
+
let nextOffset = prev.offset;
|
|
458
|
+
if (nextIndex < prev.offset) {
|
|
459
|
+
nextOffset = nextIndex;
|
|
460
|
+
} else if (nextIndex >= prev.offset + maxVisibleTools) {
|
|
461
|
+
nextOffset = Math.max(0, nextIndex - maxVisibleTools + 1);
|
|
462
|
+
}
|
|
463
|
+
const maxOffset = Math.max(0, itemsLength - maxVisibleTools);
|
|
464
|
+
nextOffset = Math.min(maxOffset, Math.max(0, nextOffset));
|
|
465
|
+
return { index: nextIndex, offset: nextOffset };
|
|
466
|
+
});
|
|
467
|
+
return true;
|
|
468
|
+
}
|
|
469
|
+
if (key.downArrow) {
|
|
470
|
+
const nextIndex = (selectedIndexRef.current + 1) % itemsLength;
|
|
471
|
+
selectedIndexRef.current = nextIndex;
|
|
472
|
+
setSelection((prev) => {
|
|
473
|
+
let nextOffset = prev.offset;
|
|
474
|
+
if (nextIndex < prev.offset) {
|
|
475
|
+
nextOffset = nextIndex;
|
|
476
|
+
} else if (nextIndex >= prev.offset + maxVisibleTools) {
|
|
477
|
+
nextOffset = Math.max(0, nextIndex - maxVisibleTools + 1);
|
|
478
|
+
}
|
|
479
|
+
const maxOffset = Math.max(0, itemsLength - maxVisibleTools);
|
|
480
|
+
nextOffset = Math.min(maxOffset, Math.max(0, nextOffset));
|
|
481
|
+
return { index: nextIndex, offset: nextOffset };
|
|
482
|
+
});
|
|
483
|
+
return true;
|
|
484
|
+
}
|
|
485
|
+
if (key.return && itemsLength > 0) {
|
|
486
|
+
const tool = filteredTools[selectedIndexRef.current];
|
|
487
|
+
if (tool) {
|
|
488
|
+
openListActions(tool);
|
|
489
|
+
return true;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return false;
|
|
493
|
+
}
|
|
494
|
+
}),
|
|
495
|
+
[isVisible, isLoading, filteredTools, maxVisibleTools, onClose, sessionId]
|
|
496
|
+
);
|
|
497
|
+
if (!isVisible) return null;
|
|
498
|
+
if (viewMode === "list-actions" && selectedTool) {
|
|
499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
500
|
+
ToolActionsMenu,
|
|
501
|
+
{
|
|
502
|
+
tool: selectedTool,
|
|
503
|
+
columns,
|
|
504
|
+
listActionsIndex
|
|
505
|
+
}
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
if (viewMode === "detail" && selectedTool) {
|
|
509
|
+
const maxVisibleLines = Math.min(18, Math.max(5, rows - 6));
|
|
510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
511
|
+
ToolDetailView,
|
|
512
|
+
{
|
|
513
|
+
tool: selectedTool,
|
|
514
|
+
columns,
|
|
515
|
+
scrollOffset: detailScrollOffset,
|
|
516
|
+
maxVisibleLines,
|
|
517
|
+
maxScrollOffsetRef: detailMaxScrollOffsetRef,
|
|
518
|
+
copyFeedback
|
|
519
|
+
}
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
if (viewMode === "config" && selectedTool) {
|
|
523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
524
|
+
ToolSettingsView,
|
|
525
|
+
{
|
|
526
|
+
tool: selectedTool,
|
|
527
|
+
columns,
|
|
528
|
+
configIndex,
|
|
529
|
+
sessionAvailable: Boolean(sessionId)
|
|
530
|
+
}
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
if (viewMode === "scope" && selectedTool) {
|
|
534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
535
|
+
ToolScopeView,
|
|
536
|
+
{
|
|
537
|
+
tool: selectedTool,
|
|
538
|
+
columns,
|
|
539
|
+
scopeTarget,
|
|
540
|
+
scopeNextEnabled,
|
|
541
|
+
sessionAvailable: Boolean(sessionId)
|
|
542
|
+
}
|
|
543
|
+
);
|
|
544
|
+
}
|
|
545
|
+
const selectedIndex = selection.index;
|
|
546
|
+
const scrollOffset = selection.offset;
|
|
547
|
+
const visibleTools = filteredTools.slice(scrollOffset, scrollOffset + maxVisibleTools);
|
|
548
|
+
const filteredLocalCount = filteredTools.filter((t) => t.source === "local").length;
|
|
549
|
+
const filteredMcpCount = filteredTools.filter((t) => t.source === "mcp").length;
|
|
550
|
+
const selectedToolInList = filteredTools[selectedIndex];
|
|
551
|
+
let detailLine = "";
|
|
552
|
+
if (isLoading) {
|
|
553
|
+
detailLine = "Loading tools\u2026";
|
|
554
|
+
} else if (loadError) {
|
|
555
|
+
detailLine = loadError;
|
|
556
|
+
} else if (searchQuery.trim() && filteredTools.length === 0) {
|
|
557
|
+
detailLine = "No tools match your search";
|
|
558
|
+
} else if (selectedToolInList) {
|
|
559
|
+
detailLine = selectedToolInList.description;
|
|
560
|
+
}
|
|
561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", width: columns, children: [
|
|
562
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { paddingX: 0, paddingY: 0, children: [
|
|
563
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "cyan", bold: true, children: "Tools" }),
|
|
564
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", children: [
|
|
565
|
+
" ",
|
|
566
|
+
"(",
|
|
567
|
+
filteredTools.length,
|
|
568
|
+
" tools: ",
|
|
569
|
+
filteredLocalCount,
|
|
570
|
+
" local, ",
|
|
571
|
+
filteredMcpCount,
|
|
572
|
+
" ",
|
|
573
|
+
"MCP)"
|
|
574
|
+
] })
|
|
575
|
+
] }),
|
|
576
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { paddingX: 0, paddingY: 0, marginTop: 1, children: [
|
|
577
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: "Search: " }),
|
|
578
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: searchQuery ? "white" : "gray", wrap: "truncate-end", children: searchQuery || "Type to filter tools\u2026" })
|
|
579
|
+
] }),
|
|
580
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", height: maxVisibleTools, marginTop: 1, children: isLoading || filteredTools.length === 0 ? Array.from({ length: maxVisibleTools }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { children: " " }) }, `tool-empty-${index}`)) : Array.from({ length: maxVisibleTools }, (_, rowIndex) => {
|
|
581
|
+
const tool = visibleTools[rowIndex];
|
|
582
|
+
if (!tool) {
|
|
583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { children: " " }) }, `tool-empty-${rowIndex}`);
|
|
584
|
+
}
|
|
585
|
+
const actualIndex = scrollOffset + rowIndex;
|
|
586
|
+
const isSelected = actualIndex === selectedIndex;
|
|
587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { paddingX: 0, paddingY: 0, children: [
|
|
588
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: isSelected ? "cyan" : "white", children: isSelected ? "\u25B6 " : " " }),
|
|
589
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: isSelected ? "cyan" : "white", bold: isSelected, children: truncateText(tool.name, 35) }),
|
|
590
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: tool.source === "local" ? "magenta" : "blue", children: [
|
|
591
|
+
" ",
|
|
592
|
+
"[",
|
|
593
|
+
tool.source === "local" ? "Local" : "MCP",
|
|
594
|
+
"]"
|
|
595
|
+
] }),
|
|
596
|
+
tool.serverName && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", children: [
|
|
597
|
+
" (",
|
|
598
|
+
tool.serverName,
|
|
599
|
+
")"
|
|
600
|
+
] }),
|
|
601
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: tool.isEnabled ? "green" : "red", children: [
|
|
602
|
+
" ",
|
|
603
|
+
tool.isEnabled ? "Enabled" : "Disabled"
|
|
604
|
+
] }),
|
|
605
|
+
tool.isAutoApproved && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "yellow", children: " [auto-approved]" })
|
|
606
|
+
] }, tool.name);
|
|
607
|
+
}) }),
|
|
608
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: loadError ? "red" : "gray", wrap: "truncate-end", children: detailLine }) }),
|
|
609
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_HintBar.HintBar, { hints: ["\u2191\u2193 navigate", "Enter options", "Esc close"] }) })
|
|
610
|
+
] });
|
|
611
|
+
});
|
|
612
|
+
function buildDetailLineData(tool, maxWidth) {
|
|
613
|
+
const lines = [];
|
|
614
|
+
lines.push({ type: "title", text: tool.name });
|
|
615
|
+
lines.push({ type: "source", source: tool.source, serverName: tool.serverName });
|
|
616
|
+
lines.push({ type: "empty" });
|
|
617
|
+
lines.push({ type: "header", text: "Description:" });
|
|
618
|
+
const descriptionLines = wrapText(tool.description, maxWidth - 2).split("\n");
|
|
619
|
+
for (const descLine of descriptionLines) {
|
|
620
|
+
lines.push({ type: "description", text: descLine });
|
|
621
|
+
}
|
|
622
|
+
if (tool.inputSchema) {
|
|
623
|
+
const properties = tool.inputSchema.properties;
|
|
624
|
+
const required = tool.inputSchema.required || [];
|
|
625
|
+
if (properties && Object.keys(properties).length > 0) {
|
|
626
|
+
lines.push({ type: "empty" });
|
|
627
|
+
lines.push({ type: "header", text: "Parameters:" });
|
|
628
|
+
for (const [propName, propSchema] of Object.entries(properties)) {
|
|
629
|
+
const paramType = propSchema.type || "any";
|
|
630
|
+
const description = propSchema.description;
|
|
631
|
+
const isRequired = required.includes(propName);
|
|
632
|
+
const enumValues = propSchema.enum;
|
|
633
|
+
lines.push({
|
|
634
|
+
type: "param-name",
|
|
635
|
+
name: propName,
|
|
636
|
+
paramType,
|
|
637
|
+
required: isRequired
|
|
638
|
+
});
|
|
639
|
+
if (description) {
|
|
640
|
+
const descLines = wrapText(description, maxWidth - 2).split("\n");
|
|
641
|
+
for (const descLine of descLines) {
|
|
642
|
+
lines.push({ type: "param-desc", text: descLine });
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
if (enumValues && enumValues.length > 0) {
|
|
646
|
+
lines.push({ type: "param-enum", values: enumValues });
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
return lines;
|
|
652
|
+
}
|
|
653
|
+
function renderDetailLine(line, _index) {
|
|
654
|
+
switch (line.type) {
|
|
655
|
+
case "title":
|
|
656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "cyan", bold: true, children: line.text });
|
|
657
|
+
case "source":
|
|
658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: line.source === "local" ? "magenta" : "blue", children: [
|
|
659
|
+
line.source === "local" ? "Local Tool" : "MCP Tool",
|
|
660
|
+
line.serverName ? ` (${line.serverName})` : ""
|
|
661
|
+
] });
|
|
662
|
+
case "empty":
|
|
663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { children: " " });
|
|
664
|
+
case "header":
|
|
665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: line.text });
|
|
666
|
+
case "description":
|
|
667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
668
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { children: " " }),
|
|
669
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { children: line.text })
|
|
670
|
+
] });
|
|
671
|
+
case "param-name":
|
|
672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
673
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { children: " " }),
|
|
674
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "cyan", children: line.name }),
|
|
675
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", children: [
|
|
676
|
+
" (",
|
|
677
|
+
line.paramType,
|
|
678
|
+
")"
|
|
679
|
+
] }),
|
|
680
|
+
line.required && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "red", children: " *required" })
|
|
681
|
+
] });
|
|
682
|
+
case "param-desc":
|
|
683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
684
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { children: " " }),
|
|
685
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: line.text })
|
|
686
|
+
] });
|
|
687
|
+
case "param-enum":
|
|
688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
689
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { children: " " }),
|
|
690
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", children: [
|
|
691
|
+
"Allowed: ",
|
|
692
|
+
line.values.join(" | ")
|
|
693
|
+
] })
|
|
694
|
+
] });
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
function ToolActionsMenu({
|
|
698
|
+
tool,
|
|
699
|
+
columns,
|
|
700
|
+
listActionsIndex
|
|
701
|
+
}) {
|
|
702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", width: columns, children: [
|
|
703
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { paddingX: 0, paddingY: 0, children: [
|
|
704
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "cyan", bold: true, children: "Tool Options" }),
|
|
705
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", children: [
|
|
706
|
+
" ",
|
|
707
|
+
tool.name
|
|
708
|
+
] })
|
|
709
|
+
] }),
|
|
710
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: listActionsIndex === 0 ? "cyan" : "gray", children: [
|
|
711
|
+
listActionsIndex === 0 ? "\u25B6 " : " ",
|
|
712
|
+
"View details"
|
|
713
|
+
] }) }),
|
|
714
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: listActionsIndex === 1 ? "cyan" : "gray", children: [
|
|
715
|
+
listActionsIndex === 1 ? "\u25B6 " : " ",
|
|
716
|
+
"Edit tool settings"
|
|
717
|
+
] }) }),
|
|
718
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: listActionsIndex === 2 ? "cyan" : "gray", children: [
|
|
719
|
+
listActionsIndex === 2 ? "\u25B6 " : " ",
|
|
720
|
+
"Back"
|
|
721
|
+
] }) }),
|
|
722
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: "\u2191\u2193 select \xB7 Enter confirm \xB7 Esc back" }) })
|
|
723
|
+
] });
|
|
724
|
+
}
|
|
725
|
+
function ToolDetailView({
|
|
726
|
+
tool,
|
|
727
|
+
columns,
|
|
728
|
+
scrollOffset,
|
|
729
|
+
maxVisibleLines,
|
|
730
|
+
maxScrollOffsetRef,
|
|
731
|
+
copyFeedback
|
|
732
|
+
}) {
|
|
733
|
+
const maxWidth = Math.min(80, columns - 4);
|
|
734
|
+
const lineData = (0, import_react.useMemo)(() => buildDetailLineData(tool, maxWidth), [tool, maxWidth]);
|
|
735
|
+
const totalLines = lineData.length;
|
|
736
|
+
const maxScrollOffset = Math.max(0, totalLines - maxVisibleLines);
|
|
737
|
+
maxScrollOffsetRef.current = maxScrollOffset;
|
|
738
|
+
const clampedOffset = Math.min(scrollOffset, maxScrollOffset);
|
|
739
|
+
const hasMoreAbove = clampedOffset > 0;
|
|
740
|
+
const hasMoreBelow = clampedOffset + maxVisibleLines < totalLines;
|
|
741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", width: columns, children: [
|
|
742
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { paddingX: 0, paddingY: 0, children: [
|
|
743
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "cyan", bold: true, children: "Tool Details" }),
|
|
744
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: " - \u2191\u2193 scroll, c copy schema, Enter settings, Esc back" }),
|
|
745
|
+
copyFeedback && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "green", bold: true, children: [
|
|
746
|
+
" ",
|
|
747
|
+
copyFeedback
|
|
748
|
+
] })
|
|
749
|
+
] }),
|
|
750
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: "\u2500".repeat(Math.min(60, columns - 2)) }) }),
|
|
751
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: hasMoreAbove ? `\u2191 ${clampedOffset} more above` : " " }) }),
|
|
752
|
+
Array.from({ length: maxVisibleLines }, (_, i) => {
|
|
753
|
+
const absoluteIndex = clampedOffset + i;
|
|
754
|
+
const line = lineData[absoluteIndex];
|
|
755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: line ? renderDetailLine(line, absoluteIndex) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { children: " " }) }, i);
|
|
756
|
+
}),
|
|
757
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: hasMoreBelow ? `\u2193 ${totalLines - clampedOffset - maxVisibleLines} more below` : " " }) })
|
|
758
|
+
] });
|
|
759
|
+
}
|
|
760
|
+
function ToolSettingsView({
|
|
761
|
+
tool,
|
|
762
|
+
columns,
|
|
763
|
+
configIndex,
|
|
764
|
+
sessionAvailable
|
|
765
|
+
}) {
|
|
766
|
+
const autoApproveDisabled = !tool.isEnabled;
|
|
767
|
+
const autoApproveUnavailable = !sessionAvailable || autoApproveDisabled;
|
|
768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", width: columns, children: [
|
|
769
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { paddingX: 0, paddingY: 0, children: [
|
|
770
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "cyan", bold: true, children: "Tool Settings" }),
|
|
771
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", children: [
|
|
772
|
+
" ",
|
|
773
|
+
tool.name
|
|
774
|
+
] })
|
|
775
|
+
] }),
|
|
776
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { paddingX: 0, paddingY: 0, children: [
|
|
777
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: "Status: " }),
|
|
778
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tool.isEnabled ? "green" : "red", children: tool.isEnabled ? "Enabled" : "Disabled" }),
|
|
779
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: " \xB7 Auto-approve: " }),
|
|
780
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tool.isAutoApproved ? "green" : "red", children: tool.isAutoApproved ? "On" : "Off" }),
|
|
781
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: " (session)" })
|
|
782
|
+
] }),
|
|
783
|
+
autoApproveDisabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "yellow", children: "Enable the tool to allow auto-approve." }) }),
|
|
784
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: configIndex === 0 ? "cyan" : "gray", children: [
|
|
785
|
+
configIndex === 0 ? "\u25B6 " : " ",
|
|
786
|
+
tool.isEnabled ? "Disable tool" : "Enable tool"
|
|
787
|
+
] }) }),
|
|
788
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
789
|
+
import_ink.Text,
|
|
790
|
+
{
|
|
791
|
+
color: configIndex === 1 ? autoApproveUnavailable ? "yellow" : "cyan" : "gray",
|
|
792
|
+
children: [
|
|
793
|
+
configIndex === 1 ? "\u25B6 " : " ",
|
|
794
|
+
tool.isAutoApproved ? "Disable auto-approve (session)" : "Enable auto-approve (session)"
|
|
795
|
+
]
|
|
796
|
+
}
|
|
797
|
+
) }),
|
|
798
|
+
!sessionAvailable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "yellow", children: "Auto-approve requires an active session." }) }),
|
|
799
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: configIndex === 2 ? "cyan" : "gray", children: [
|
|
800
|
+
configIndex === 2 ? "\u25B6 " : " ",
|
|
801
|
+
"Back"
|
|
802
|
+
] }) }),
|
|
803
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: "\u2191\u2193 select \xB7 Enter confirm \xB7 Esc back" }) })
|
|
804
|
+
] });
|
|
805
|
+
}
|
|
806
|
+
function ToolScopeView({
|
|
807
|
+
tool,
|
|
808
|
+
columns,
|
|
809
|
+
scopeTarget,
|
|
810
|
+
scopeNextEnabled,
|
|
811
|
+
sessionAvailable
|
|
812
|
+
}) {
|
|
813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", width: columns, children: [
|
|
814
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { paddingX: 0, paddingY: 0, children: [
|
|
815
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "cyan", bold: true, children: scopeNextEnabled ? "Enable Tool" : "Disable Tool" }),
|
|
816
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", children: [
|
|
817
|
+
" ",
|
|
818
|
+
tool.name
|
|
819
|
+
] })
|
|
820
|
+
] }),
|
|
821
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: "Apply to:" }) }),
|
|
822
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: scopeTarget === "session" ? "cyan" : "gray", children: [
|
|
823
|
+
scopeTarget === "session" ? "\u25B6 " : " ",
|
|
824
|
+
"Session (default)"
|
|
825
|
+
] }) }),
|
|
826
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: scopeTarget === "global" ? "cyan" : "gray", children: [
|
|
827
|
+
scopeTarget === "global" ? "\u25B6 " : " ",
|
|
828
|
+
"Global (persisted)"
|
|
829
|
+
] }) }),
|
|
830
|
+
!sessionAvailable && scopeTarget === "session" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "yellow", children: "No active session; switching to global." }) }),
|
|
831
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: "\u2191\u2193 choose scope \xB7 Enter confirm \xB7 Esc back" }) })
|
|
832
|
+
] });
|
|
833
|
+
}
|
|
834
|
+
function truncateText(text, maxLength) {
|
|
835
|
+
if (text.length <= maxLength) return text;
|
|
836
|
+
return text.slice(0, maxLength - 1) + "\u2026";
|
|
837
|
+
}
|
|
838
|
+
function wrapText(text, maxWidth) {
|
|
839
|
+
if (text.length <= maxWidth) return text;
|
|
840
|
+
const words = text.split(" ");
|
|
841
|
+
const lines = [];
|
|
842
|
+
let currentLine = "";
|
|
843
|
+
for (const word of words) {
|
|
844
|
+
if (currentLine.length + word.length + 1 <= maxWidth) {
|
|
845
|
+
currentLine += (currentLine ? " " : "") + word;
|
|
846
|
+
} else {
|
|
847
|
+
if (currentLine) lines.push(currentLine);
|
|
848
|
+
currentLine = word;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
if (currentLine) lines.push(currentLine);
|
|
852
|
+
return lines.join("\n");
|
|
853
|
+
}
|
|
854
|
+
var ToolBrowser_default = ToolBrowser;
|