@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,344 @@
|
|
|
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 ResourceAutocomplete_exports = {};
|
|
30
|
+
__export(ResourceAutocomplete_exports, {
|
|
31
|
+
default: () => ResourceAutocomplete_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(ResourceAutocomplete_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_path = __toESM(require("path"), 1);
|
|
38
|
+
var import_messageFormatting = require("../utils/messageFormatting.js");
|
|
39
|
+
var import_useTerminalSize = require("../hooks/useTerminalSize.js");
|
|
40
|
+
var import_overlaySizing = require("../utils/overlaySizing.js");
|
|
41
|
+
function getResourceMatchScore(resource, query) {
|
|
42
|
+
if (!query) return 3;
|
|
43
|
+
const lowerQuery = query.toLowerCase();
|
|
44
|
+
const name = (resource.name || "").toLowerCase();
|
|
45
|
+
const uri = resource.uri.toLowerCase();
|
|
46
|
+
const uriFilename = uri.split(/[\\/]/).pop()?.toLowerCase() || "";
|
|
47
|
+
const description = (resource.description || "").toLowerCase();
|
|
48
|
+
if (name.startsWith(lowerQuery)) {
|
|
49
|
+
return 4;
|
|
50
|
+
}
|
|
51
|
+
if (name.includes(lowerQuery)) {
|
|
52
|
+
return 3;
|
|
53
|
+
}
|
|
54
|
+
if (uriFilename.startsWith(lowerQuery)) {
|
|
55
|
+
return 2;
|
|
56
|
+
}
|
|
57
|
+
if (uriFilename.includes(lowerQuery)) {
|
|
58
|
+
return 2;
|
|
59
|
+
}
|
|
60
|
+
if (uri.includes(lowerQuery)) {
|
|
61
|
+
return 1;
|
|
62
|
+
}
|
|
63
|
+
if (description.includes(lowerQuery)) {
|
|
64
|
+
return 1;
|
|
65
|
+
}
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
function matchesQuery(resource, query) {
|
|
69
|
+
return getResourceMatchScore(resource, query) > 0;
|
|
70
|
+
}
|
|
71
|
+
function sortResources(resources, query) {
|
|
72
|
+
if (!query) return resources;
|
|
73
|
+
const lowerQuery = query.toLowerCase();
|
|
74
|
+
return [...resources].sort((a, b) => {
|
|
75
|
+
const scoreA = getResourceMatchScore(a, lowerQuery);
|
|
76
|
+
const scoreB = getResourceMatchScore(b, lowerQuery);
|
|
77
|
+
if (scoreA !== scoreB) {
|
|
78
|
+
return scoreB - scoreA;
|
|
79
|
+
}
|
|
80
|
+
const aName = (a.name || "").toLowerCase();
|
|
81
|
+
const bName = (b.name || "").toLowerCase();
|
|
82
|
+
return aName.localeCompare(bName);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const ResourceAutocompleteInner = (0, import_react.forwardRef)(
|
|
86
|
+
function ResourceAutocomplete({ isVisible, searchQuery, onSelectResource, onLoadIntoInput, onClose, agent }, ref) {
|
|
87
|
+
const [resources, setResources] = (0, import_react.useState)([]);
|
|
88
|
+
const [isLoading, setIsLoading] = (0, import_react.useState)(false);
|
|
89
|
+
const { columns: terminalWidth, rows: terminalRows } = (0, import_useTerminalSize.useTerminalSize)();
|
|
90
|
+
const maxVisibleItems = (0, import_react.useMemo)(() => {
|
|
91
|
+
return (0, import_overlaySizing.getMaxVisibleItemsForTerminalRows)({
|
|
92
|
+
rows: terminalRows,
|
|
93
|
+
hardCap: 15,
|
|
94
|
+
reservedRows: 6
|
|
95
|
+
});
|
|
96
|
+
}, [terminalRows]);
|
|
97
|
+
const [selection, setSelection] = (0, import_react.useState)({ index: 0, offset: 0 });
|
|
98
|
+
const selectedIndexRef = (0, import_react.useRef)(0);
|
|
99
|
+
const updateSelection = (0, import_react.useCallback)(
|
|
100
|
+
(indexUpdater) => {
|
|
101
|
+
setSelection((prev) => {
|
|
102
|
+
const newIndex = typeof indexUpdater === "function" ? indexUpdater(prev.index) : indexUpdater;
|
|
103
|
+
selectedIndexRef.current = newIndex;
|
|
104
|
+
let newOffset = prev.offset;
|
|
105
|
+
if (newIndex < prev.offset) {
|
|
106
|
+
newOffset = newIndex;
|
|
107
|
+
} else if (newIndex >= prev.offset + maxVisibleItems) {
|
|
108
|
+
newOffset = Math.max(0, newIndex - maxVisibleItems + 1);
|
|
109
|
+
}
|
|
110
|
+
return { index: newIndex, offset: newOffset };
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
[maxVisibleItems]
|
|
114
|
+
);
|
|
115
|
+
(0, import_react.useEffect)(() => {
|
|
116
|
+
if (!isVisible) return;
|
|
117
|
+
let cancelled = false;
|
|
118
|
+
setIsLoading(true);
|
|
119
|
+
const fetchResources = async () => {
|
|
120
|
+
try {
|
|
121
|
+
const resourceSet = await agent.listResources();
|
|
122
|
+
const resourceList = Object.values(resourceSet);
|
|
123
|
+
if (!cancelled) {
|
|
124
|
+
setResources(resourceList);
|
|
125
|
+
setIsLoading(false);
|
|
126
|
+
}
|
|
127
|
+
} catch {
|
|
128
|
+
if (!cancelled) {
|
|
129
|
+
setResources([]);
|
|
130
|
+
setIsLoading(false);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
void fetchResources();
|
|
135
|
+
return () => {
|
|
136
|
+
cancelled = true;
|
|
137
|
+
};
|
|
138
|
+
}, [isVisible, agent]);
|
|
139
|
+
const mentionQuery = (0, import_react.useMemo)(() => {
|
|
140
|
+
const atIndex = searchQuery.lastIndexOf("@");
|
|
141
|
+
if (atIndex === -1) return "";
|
|
142
|
+
const prevChar = searchQuery[atIndex - 1];
|
|
143
|
+
if (atIndex === 0 || prevChar && /\s/.test(prevChar)) {
|
|
144
|
+
return searchQuery.slice(atIndex + 1).trim();
|
|
145
|
+
}
|
|
146
|
+
return "";
|
|
147
|
+
}, [searchQuery]);
|
|
148
|
+
const displayItems = (0, import_react.useMemo)(() => {
|
|
149
|
+
const items = [];
|
|
150
|
+
const directories = /* @__PURE__ */ new Set();
|
|
151
|
+
resources.forEach((resource) => {
|
|
152
|
+
let relativePath = resource.uri;
|
|
153
|
+
const rawUri = relativePath.replace(/^(fs|file):\/\//, "");
|
|
154
|
+
if (import_path.default.isAbsolute(rawUri)) {
|
|
155
|
+
try {
|
|
156
|
+
const relPath = import_path.default.relative(process.cwd(), rawUri);
|
|
157
|
+
if (relPath && !relPath.startsWith("..")) {
|
|
158
|
+
relativePath = relPath;
|
|
159
|
+
} else {
|
|
160
|
+
const uriParts = resource.uri.split(/[\\/]/);
|
|
161
|
+
relativePath = resource.name || uriParts[uriParts.length - 1] || resource.uri;
|
|
162
|
+
}
|
|
163
|
+
} catch {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
items.push({
|
|
168
|
+
path: relativePath,
|
|
169
|
+
isDirectory: false,
|
|
170
|
+
resource
|
|
171
|
+
});
|
|
172
|
+
const segments = relativePath.split(import_path.default.sep).filter(Boolean);
|
|
173
|
+
for (let i = 0; i < Math.min(segments.length - 1, 2); i++) {
|
|
174
|
+
const dirPath = segments.slice(0, i + 1).join(import_path.default.sep) + import_path.default.sep;
|
|
175
|
+
directories.add(dirPath);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
directories.forEach((dirPath) => {
|
|
179
|
+
items.push({
|
|
180
|
+
path: dirPath,
|
|
181
|
+
isDirectory: true
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
const filtered = items.filter((item) => {
|
|
185
|
+
if (!mentionQuery) return true;
|
|
186
|
+
const lowerQuery = mentionQuery.toLowerCase();
|
|
187
|
+
const lowerPath = item.path.toLowerCase();
|
|
188
|
+
const pathParts = item.path.split(import_path.default.sep).filter(Boolean);
|
|
189
|
+
const lastSegment = pathParts[pathParts.length - 1]?.toLowerCase() || "";
|
|
190
|
+
if (lastSegment.includes(lowerQuery) || lowerPath.includes(lowerQuery)) {
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
if (item.resource) {
|
|
194
|
+
const lowerName = (item.resource.name || "").toLowerCase();
|
|
195
|
+
const lowerDescription = (item.resource.description || "").toLowerCase();
|
|
196
|
+
if (lowerName.includes(lowerQuery) || lowerDescription.includes(lowerQuery)) {
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return false;
|
|
201
|
+
});
|
|
202
|
+
return filtered.sort((a, b) => {
|
|
203
|
+
if (!mentionQuery) {
|
|
204
|
+
if (a.isDirectory !== b.isDirectory) {
|
|
205
|
+
return a.isDirectory ? -1 : 1;
|
|
206
|
+
}
|
|
207
|
+
return a.path.localeCompare(b.path);
|
|
208
|
+
}
|
|
209
|
+
const lowerQuery = mentionQuery.toLowerCase();
|
|
210
|
+
const aPathParts = a.path.split(import_path.default.sep).filter(Boolean);
|
|
211
|
+
const bPathParts = b.path.split(import_path.default.sep).filter(Boolean);
|
|
212
|
+
const aLastSegment = aPathParts[aPathParts.length - 1]?.toLowerCase() || "";
|
|
213
|
+
const bLastSegment = bPathParts[bPathParts.length - 1]?.toLowerCase() || "";
|
|
214
|
+
const aStartsWith = aLastSegment.startsWith(lowerQuery);
|
|
215
|
+
const bStartsWith = bLastSegment.startsWith(lowerQuery);
|
|
216
|
+
const aIncludes = aLastSegment.includes(lowerQuery);
|
|
217
|
+
const bIncludes = bLastSegment.includes(lowerQuery);
|
|
218
|
+
if (aStartsWith && !bStartsWith) return -1;
|
|
219
|
+
if (!aStartsWith && bStartsWith) return 1;
|
|
220
|
+
if (aIncludes && !bIncludes) return -1;
|
|
221
|
+
if (!aIncludes && bIncludes) return 1;
|
|
222
|
+
const depthDiff = aPathParts.length - bPathParts.length;
|
|
223
|
+
if (depthDiff !== 0) return depthDiff;
|
|
224
|
+
return a.path.localeCompare(b.path);
|
|
225
|
+
});
|
|
226
|
+
}, [resources, mentionQuery]);
|
|
227
|
+
const prevItemsLengthRef = (0, import_react.useRef)(displayItems.length);
|
|
228
|
+
const itemsChanged = displayItems.length !== prevItemsLengthRef.current;
|
|
229
|
+
const selectedIndex = itemsChanged ? 0 : Math.min(selection.index, Math.max(0, displayItems.length - 1));
|
|
230
|
+
const scrollOffset = itemsChanged ? 0 : Math.min(selection.offset, Math.max(0, displayItems.length - maxVisibleItems));
|
|
231
|
+
(0, import_react.useEffect)(() => {
|
|
232
|
+
if (itemsChanged) {
|
|
233
|
+
prevItemsLengthRef.current = displayItems.length;
|
|
234
|
+
if (selection.index !== 0 || selection.offset !== 0) {
|
|
235
|
+
selectedIndexRef.current = 0;
|
|
236
|
+
setSelection({ index: 0, offset: 0 });
|
|
237
|
+
} else {
|
|
238
|
+
selectedIndexRef.current = 0;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}, [itemsChanged, displayItems.length, selection.index, selection.offset]);
|
|
242
|
+
const visibleResources = (0, import_react.useMemo)(() => {
|
|
243
|
+
return displayItems.slice(scrollOffset, scrollOffset + maxVisibleItems);
|
|
244
|
+
}, [displayItems, scrollOffset, maxVisibleItems]);
|
|
245
|
+
(0, import_react.useImperativeHandle)(
|
|
246
|
+
ref,
|
|
247
|
+
() => ({
|
|
248
|
+
handleInput: (_input, key) => {
|
|
249
|
+
if (!isVisible) return false;
|
|
250
|
+
if (key.escape) {
|
|
251
|
+
onClose();
|
|
252
|
+
return true;
|
|
253
|
+
}
|
|
254
|
+
const itemsLength = displayItems.length;
|
|
255
|
+
if (itemsLength === 0) return false;
|
|
256
|
+
if (key.upArrow) {
|
|
257
|
+
updateSelection((prev) => (prev - 1 + itemsLength) % itemsLength);
|
|
258
|
+
return true;
|
|
259
|
+
}
|
|
260
|
+
if (key.downArrow) {
|
|
261
|
+
updateSelection((prev) => (prev + 1) % itemsLength);
|
|
262
|
+
return true;
|
|
263
|
+
}
|
|
264
|
+
if (key.tab) {
|
|
265
|
+
const item = displayItems[selectedIndexRef.current];
|
|
266
|
+
if (!item) return false;
|
|
267
|
+
const atIndex = searchQuery.lastIndexOf("@");
|
|
268
|
+
const reference = item.path;
|
|
269
|
+
if (atIndex >= 0) {
|
|
270
|
+
const before = searchQuery.slice(0, atIndex + 1);
|
|
271
|
+
onLoadIntoInput?.(`${before}${reference}`);
|
|
272
|
+
} else {
|
|
273
|
+
onLoadIntoInput?.(`${searchQuery}@${reference}`);
|
|
274
|
+
}
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
if (key.return) {
|
|
278
|
+
const item = displayItems[selectedIndexRef.current];
|
|
279
|
+
if (!item) return false;
|
|
280
|
+
if (item.isDirectory) {
|
|
281
|
+
const atIndex = searchQuery.lastIndexOf("@");
|
|
282
|
+
if (atIndex >= 0) {
|
|
283
|
+
const before = searchQuery.slice(0, atIndex + 1);
|
|
284
|
+
onLoadIntoInput?.(`${before}${item.path}`);
|
|
285
|
+
} else {
|
|
286
|
+
onLoadIntoInput?.(`${searchQuery}@${item.path}`);
|
|
287
|
+
}
|
|
288
|
+
} else if (item.resource) {
|
|
289
|
+
onSelectResource(item.resource);
|
|
290
|
+
}
|
|
291
|
+
return true;
|
|
292
|
+
}
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
}),
|
|
296
|
+
[
|
|
297
|
+
isVisible,
|
|
298
|
+
displayItems,
|
|
299
|
+
selectedIndexRef,
|
|
300
|
+
searchQuery,
|
|
301
|
+
onClose,
|
|
302
|
+
onLoadIntoInput,
|
|
303
|
+
onSelectResource,
|
|
304
|
+
updateSelection
|
|
305
|
+
]
|
|
306
|
+
);
|
|
307
|
+
if (!isVisible) return null;
|
|
308
|
+
if (isLoading) {
|
|
309
|
+
return /* @__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: "Loading resources..." }) });
|
|
310
|
+
}
|
|
311
|
+
if (displayItems.length === 0) {
|
|
312
|
+
return /* @__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: mentionQuery ? `No resources match "${mentionQuery}"` : "No resources available. Connect an MCP server or enable internal resources." }) });
|
|
313
|
+
}
|
|
314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", width: terminalWidth, paddingLeft: 2, children: visibleResources.map((item, visibleIndex) => {
|
|
315
|
+
const actualIndex = scrollOffset + visibleIndex;
|
|
316
|
+
const isSelected = actualIndex === selectedIndex;
|
|
317
|
+
const displayPath = (0, import_messageFormatting.centerTruncatePath)(
|
|
318
|
+
item.path,
|
|
319
|
+
Math.max(20, terminalWidth - 16)
|
|
320
|
+
);
|
|
321
|
+
const isImage = item.resource?.mimeType?.startsWith("image/");
|
|
322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { children: [
|
|
323
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: isSelected ? "cyan" : "gray", children: isSelected ? "\u276F " : " " }),
|
|
324
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
325
|
+
import_ink.Text,
|
|
326
|
+
{
|
|
327
|
+
wrap: "truncate-end",
|
|
328
|
+
color: isSelected ? "cyan" : "white",
|
|
329
|
+
bold: isSelected,
|
|
330
|
+
children: [
|
|
331
|
+
isImage && "\u{1F5BC}\uFE0F ",
|
|
332
|
+
displayPath,
|
|
333
|
+
item.resource?.serverName && ` [${item.resource.serverName}]`
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
)
|
|
337
|
+
] }, item.path);
|
|
338
|
+
}) });
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
const ResourceAutocomplete2 = import_react.default.memo(
|
|
342
|
+
ResourceAutocompleteInner
|
|
343
|
+
);
|
|
344
|
+
var ResourceAutocomplete_default = ResourceAutocomplete2;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Key } from '../hooks/useInputOrchestrator.js';
|
|
3
|
+
import type { ResourceMetadata } from '@dexto/core';
|
|
4
|
+
import type { DextoAgent } from '@dexto/core';
|
|
5
|
+
export interface ResourceAutocompleteHandle {
|
|
6
|
+
handleInput: (input: string, key: Key) => boolean;
|
|
7
|
+
}
|
|
8
|
+
interface ResourceAutocompleteProps {
|
|
9
|
+
isVisible: boolean;
|
|
10
|
+
searchQuery: string;
|
|
11
|
+
onSelectResource: (resource: ResourceMetadata) => void;
|
|
12
|
+
onLoadIntoInput?: (text: string) => void;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
agent: DextoAgent;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Inner component - wrapped with React.memo below
|
|
18
|
+
*/
|
|
19
|
+
declare const ResourceAutocompleteInner: React.ForwardRefExoticComponent<ResourceAutocompleteProps & React.RefAttributes<ResourceAutocompleteHandle>>;
|
|
20
|
+
/**
|
|
21
|
+
* Export with React.memo to prevent unnecessary re-renders from parent
|
|
22
|
+
* Only re-renders when props actually change (shallow comparison)
|
|
23
|
+
*/
|
|
24
|
+
declare const ResourceAutocomplete: typeof ResourceAutocompleteInner;
|
|
25
|
+
export default ResourceAutocomplete;
|
|
26
|
+
//# sourceMappingURL=ResourceAutocomplete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceAutocomplete.d.ts","sourceRoot":"","sources":["../../src/components/ResourceAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,MAAM,WAAW,0BAA0B;IACvC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED,UAAU,yBAAyB;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACvD,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC;CACrB;AAsFD;;GAEG;AACH,QAAA,MAAM,yBAAyB,8GA4X9B,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,oBAAoB,EAErB,OAAO,yBAAyB,CAAC;AAEtC,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, {
|
|
3
|
+
useState,
|
|
4
|
+
useEffect,
|
|
5
|
+
useRef,
|
|
6
|
+
useMemo,
|
|
7
|
+
useCallback,
|
|
8
|
+
forwardRef,
|
|
9
|
+
useImperativeHandle
|
|
10
|
+
} from "react";
|
|
11
|
+
import { Box, Text } from "ink";
|
|
12
|
+
import path from "path";
|
|
13
|
+
import { centerTruncatePath } from "../utils/messageFormatting.js";
|
|
14
|
+
import { useTerminalSize } from "../hooks/useTerminalSize.js";
|
|
15
|
+
import { getMaxVisibleItemsForTerminalRows } from "../utils/overlaySizing.js";
|
|
16
|
+
function getResourceMatchScore(resource, query) {
|
|
17
|
+
if (!query) return 3;
|
|
18
|
+
const lowerQuery = query.toLowerCase();
|
|
19
|
+
const name = (resource.name || "").toLowerCase();
|
|
20
|
+
const uri = resource.uri.toLowerCase();
|
|
21
|
+
const uriFilename = uri.split(/[\\/]/).pop()?.toLowerCase() || "";
|
|
22
|
+
const description = (resource.description || "").toLowerCase();
|
|
23
|
+
if (name.startsWith(lowerQuery)) {
|
|
24
|
+
return 4;
|
|
25
|
+
}
|
|
26
|
+
if (name.includes(lowerQuery)) {
|
|
27
|
+
return 3;
|
|
28
|
+
}
|
|
29
|
+
if (uriFilename.startsWith(lowerQuery)) {
|
|
30
|
+
return 2;
|
|
31
|
+
}
|
|
32
|
+
if (uriFilename.includes(lowerQuery)) {
|
|
33
|
+
return 2;
|
|
34
|
+
}
|
|
35
|
+
if (uri.includes(lowerQuery)) {
|
|
36
|
+
return 1;
|
|
37
|
+
}
|
|
38
|
+
if (description.includes(lowerQuery)) {
|
|
39
|
+
return 1;
|
|
40
|
+
}
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
function matchesQuery(resource, query) {
|
|
44
|
+
return getResourceMatchScore(resource, query) > 0;
|
|
45
|
+
}
|
|
46
|
+
function sortResources(resources, query) {
|
|
47
|
+
if (!query) return resources;
|
|
48
|
+
const lowerQuery = query.toLowerCase();
|
|
49
|
+
return [...resources].sort((a, b) => {
|
|
50
|
+
const scoreA = getResourceMatchScore(a, lowerQuery);
|
|
51
|
+
const scoreB = getResourceMatchScore(b, lowerQuery);
|
|
52
|
+
if (scoreA !== scoreB) {
|
|
53
|
+
return scoreB - scoreA;
|
|
54
|
+
}
|
|
55
|
+
const aName = (a.name || "").toLowerCase();
|
|
56
|
+
const bName = (b.name || "").toLowerCase();
|
|
57
|
+
return aName.localeCompare(bName);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
const ResourceAutocompleteInner = forwardRef(
|
|
61
|
+
function ResourceAutocomplete({ isVisible, searchQuery, onSelectResource, onLoadIntoInput, onClose, agent }, ref) {
|
|
62
|
+
const [resources, setResources] = useState([]);
|
|
63
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
64
|
+
const { columns: terminalWidth, rows: terminalRows } = useTerminalSize();
|
|
65
|
+
const maxVisibleItems = useMemo(() => {
|
|
66
|
+
return getMaxVisibleItemsForTerminalRows({
|
|
67
|
+
rows: terminalRows,
|
|
68
|
+
hardCap: 15,
|
|
69
|
+
reservedRows: 6
|
|
70
|
+
});
|
|
71
|
+
}, [terminalRows]);
|
|
72
|
+
const [selection, setSelection] = useState({ index: 0, offset: 0 });
|
|
73
|
+
const selectedIndexRef = useRef(0);
|
|
74
|
+
const updateSelection = useCallback(
|
|
75
|
+
(indexUpdater) => {
|
|
76
|
+
setSelection((prev) => {
|
|
77
|
+
const newIndex = typeof indexUpdater === "function" ? indexUpdater(prev.index) : indexUpdater;
|
|
78
|
+
selectedIndexRef.current = newIndex;
|
|
79
|
+
let newOffset = prev.offset;
|
|
80
|
+
if (newIndex < prev.offset) {
|
|
81
|
+
newOffset = newIndex;
|
|
82
|
+
} else if (newIndex >= prev.offset + maxVisibleItems) {
|
|
83
|
+
newOffset = Math.max(0, newIndex - maxVisibleItems + 1);
|
|
84
|
+
}
|
|
85
|
+
return { index: newIndex, offset: newOffset };
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
[maxVisibleItems]
|
|
89
|
+
);
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (!isVisible) return;
|
|
92
|
+
let cancelled = false;
|
|
93
|
+
setIsLoading(true);
|
|
94
|
+
const fetchResources = async () => {
|
|
95
|
+
try {
|
|
96
|
+
const resourceSet = await agent.listResources();
|
|
97
|
+
const resourceList = Object.values(resourceSet);
|
|
98
|
+
if (!cancelled) {
|
|
99
|
+
setResources(resourceList);
|
|
100
|
+
setIsLoading(false);
|
|
101
|
+
}
|
|
102
|
+
} catch {
|
|
103
|
+
if (!cancelled) {
|
|
104
|
+
setResources([]);
|
|
105
|
+
setIsLoading(false);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
void fetchResources();
|
|
110
|
+
return () => {
|
|
111
|
+
cancelled = true;
|
|
112
|
+
};
|
|
113
|
+
}, [isVisible, agent]);
|
|
114
|
+
const mentionQuery = useMemo(() => {
|
|
115
|
+
const atIndex = searchQuery.lastIndexOf("@");
|
|
116
|
+
if (atIndex === -1) return "";
|
|
117
|
+
const prevChar = searchQuery[atIndex - 1];
|
|
118
|
+
if (atIndex === 0 || prevChar && /\s/.test(prevChar)) {
|
|
119
|
+
return searchQuery.slice(atIndex + 1).trim();
|
|
120
|
+
}
|
|
121
|
+
return "";
|
|
122
|
+
}, [searchQuery]);
|
|
123
|
+
const displayItems = useMemo(() => {
|
|
124
|
+
const items = [];
|
|
125
|
+
const directories = /* @__PURE__ */ new Set();
|
|
126
|
+
resources.forEach((resource) => {
|
|
127
|
+
let relativePath = resource.uri;
|
|
128
|
+
const rawUri = relativePath.replace(/^(fs|file):\/\//, "");
|
|
129
|
+
if (path.isAbsolute(rawUri)) {
|
|
130
|
+
try {
|
|
131
|
+
const relPath = path.relative(process.cwd(), rawUri);
|
|
132
|
+
if (relPath && !relPath.startsWith("..")) {
|
|
133
|
+
relativePath = relPath;
|
|
134
|
+
} else {
|
|
135
|
+
const uriParts = resource.uri.split(/[\\/]/);
|
|
136
|
+
relativePath = resource.name || uriParts[uriParts.length - 1] || resource.uri;
|
|
137
|
+
}
|
|
138
|
+
} catch {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
items.push({
|
|
143
|
+
path: relativePath,
|
|
144
|
+
isDirectory: false,
|
|
145
|
+
resource
|
|
146
|
+
});
|
|
147
|
+
const segments = relativePath.split(path.sep).filter(Boolean);
|
|
148
|
+
for (let i = 0; i < Math.min(segments.length - 1, 2); i++) {
|
|
149
|
+
const dirPath = segments.slice(0, i + 1).join(path.sep) + path.sep;
|
|
150
|
+
directories.add(dirPath);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
directories.forEach((dirPath) => {
|
|
154
|
+
items.push({
|
|
155
|
+
path: dirPath,
|
|
156
|
+
isDirectory: true
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
const filtered = items.filter((item) => {
|
|
160
|
+
if (!mentionQuery) return true;
|
|
161
|
+
const lowerQuery = mentionQuery.toLowerCase();
|
|
162
|
+
const lowerPath = item.path.toLowerCase();
|
|
163
|
+
const pathParts = item.path.split(path.sep).filter(Boolean);
|
|
164
|
+
const lastSegment = pathParts[pathParts.length - 1]?.toLowerCase() || "";
|
|
165
|
+
if (lastSegment.includes(lowerQuery) || lowerPath.includes(lowerQuery)) {
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
if (item.resource) {
|
|
169
|
+
const lowerName = (item.resource.name || "").toLowerCase();
|
|
170
|
+
const lowerDescription = (item.resource.description || "").toLowerCase();
|
|
171
|
+
if (lowerName.includes(lowerQuery) || lowerDescription.includes(lowerQuery)) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
});
|
|
177
|
+
return filtered.sort((a, b) => {
|
|
178
|
+
if (!mentionQuery) {
|
|
179
|
+
if (a.isDirectory !== b.isDirectory) {
|
|
180
|
+
return a.isDirectory ? -1 : 1;
|
|
181
|
+
}
|
|
182
|
+
return a.path.localeCompare(b.path);
|
|
183
|
+
}
|
|
184
|
+
const lowerQuery = mentionQuery.toLowerCase();
|
|
185
|
+
const aPathParts = a.path.split(path.sep).filter(Boolean);
|
|
186
|
+
const bPathParts = b.path.split(path.sep).filter(Boolean);
|
|
187
|
+
const aLastSegment = aPathParts[aPathParts.length - 1]?.toLowerCase() || "";
|
|
188
|
+
const bLastSegment = bPathParts[bPathParts.length - 1]?.toLowerCase() || "";
|
|
189
|
+
const aStartsWith = aLastSegment.startsWith(lowerQuery);
|
|
190
|
+
const bStartsWith = bLastSegment.startsWith(lowerQuery);
|
|
191
|
+
const aIncludes = aLastSegment.includes(lowerQuery);
|
|
192
|
+
const bIncludes = bLastSegment.includes(lowerQuery);
|
|
193
|
+
if (aStartsWith && !bStartsWith) return -1;
|
|
194
|
+
if (!aStartsWith && bStartsWith) return 1;
|
|
195
|
+
if (aIncludes && !bIncludes) return -1;
|
|
196
|
+
if (!aIncludes && bIncludes) return 1;
|
|
197
|
+
const depthDiff = aPathParts.length - bPathParts.length;
|
|
198
|
+
if (depthDiff !== 0) return depthDiff;
|
|
199
|
+
return a.path.localeCompare(b.path);
|
|
200
|
+
});
|
|
201
|
+
}, [resources, mentionQuery]);
|
|
202
|
+
const prevItemsLengthRef = useRef(displayItems.length);
|
|
203
|
+
const itemsChanged = displayItems.length !== prevItemsLengthRef.current;
|
|
204
|
+
const selectedIndex = itemsChanged ? 0 : Math.min(selection.index, Math.max(0, displayItems.length - 1));
|
|
205
|
+
const scrollOffset = itemsChanged ? 0 : Math.min(selection.offset, Math.max(0, displayItems.length - maxVisibleItems));
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
if (itemsChanged) {
|
|
208
|
+
prevItemsLengthRef.current = displayItems.length;
|
|
209
|
+
if (selection.index !== 0 || selection.offset !== 0) {
|
|
210
|
+
selectedIndexRef.current = 0;
|
|
211
|
+
setSelection({ index: 0, offset: 0 });
|
|
212
|
+
} else {
|
|
213
|
+
selectedIndexRef.current = 0;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}, [itemsChanged, displayItems.length, selection.index, selection.offset]);
|
|
217
|
+
const visibleResources = useMemo(() => {
|
|
218
|
+
return displayItems.slice(scrollOffset, scrollOffset + maxVisibleItems);
|
|
219
|
+
}, [displayItems, scrollOffset, maxVisibleItems]);
|
|
220
|
+
useImperativeHandle(
|
|
221
|
+
ref,
|
|
222
|
+
() => ({
|
|
223
|
+
handleInput: (_input, key) => {
|
|
224
|
+
if (!isVisible) return false;
|
|
225
|
+
if (key.escape) {
|
|
226
|
+
onClose();
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
const itemsLength = displayItems.length;
|
|
230
|
+
if (itemsLength === 0) return false;
|
|
231
|
+
if (key.upArrow) {
|
|
232
|
+
updateSelection((prev) => (prev - 1 + itemsLength) % itemsLength);
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
235
|
+
if (key.downArrow) {
|
|
236
|
+
updateSelection((prev) => (prev + 1) % itemsLength);
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
if (key.tab) {
|
|
240
|
+
const item = displayItems[selectedIndexRef.current];
|
|
241
|
+
if (!item) return false;
|
|
242
|
+
const atIndex = searchQuery.lastIndexOf("@");
|
|
243
|
+
const reference = item.path;
|
|
244
|
+
if (atIndex >= 0) {
|
|
245
|
+
const before = searchQuery.slice(0, atIndex + 1);
|
|
246
|
+
onLoadIntoInput?.(`${before}${reference}`);
|
|
247
|
+
} else {
|
|
248
|
+
onLoadIntoInput?.(`${searchQuery}@${reference}`);
|
|
249
|
+
}
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
if (key.return) {
|
|
253
|
+
const item = displayItems[selectedIndexRef.current];
|
|
254
|
+
if (!item) return false;
|
|
255
|
+
if (item.isDirectory) {
|
|
256
|
+
const atIndex = searchQuery.lastIndexOf("@");
|
|
257
|
+
if (atIndex >= 0) {
|
|
258
|
+
const before = searchQuery.slice(0, atIndex + 1);
|
|
259
|
+
onLoadIntoInput?.(`${before}${item.path}`);
|
|
260
|
+
} else {
|
|
261
|
+
onLoadIntoInput?.(`${searchQuery}@${item.path}`);
|
|
262
|
+
}
|
|
263
|
+
} else if (item.resource) {
|
|
264
|
+
onSelectResource(item.resource);
|
|
265
|
+
}
|
|
266
|
+
return true;
|
|
267
|
+
}
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
}),
|
|
271
|
+
[
|
|
272
|
+
isVisible,
|
|
273
|
+
displayItems,
|
|
274
|
+
selectedIndexRef,
|
|
275
|
+
searchQuery,
|
|
276
|
+
onClose,
|
|
277
|
+
onLoadIntoInput,
|
|
278
|
+
onSelectResource,
|
|
279
|
+
updateSelection
|
|
280
|
+
]
|
|
281
|
+
);
|
|
282
|
+
if (!isVisible) return null;
|
|
283
|
+
if (isLoading) {
|
|
284
|
+
return /* @__PURE__ */ jsx(Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ jsx(Text, { color: "gray", children: "Loading resources..." }) });
|
|
285
|
+
}
|
|
286
|
+
if (displayItems.length === 0) {
|
|
287
|
+
return /* @__PURE__ */ jsx(Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ jsx(Text, { color: "gray", children: mentionQuery ? `No resources match "${mentionQuery}"` : "No resources available. Connect an MCP server or enable internal resources." }) });
|
|
288
|
+
}
|
|
289
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", width: terminalWidth, paddingLeft: 2, children: visibleResources.map((item, visibleIndex) => {
|
|
290
|
+
const actualIndex = scrollOffset + visibleIndex;
|
|
291
|
+
const isSelected = actualIndex === selectedIndex;
|
|
292
|
+
const displayPath = centerTruncatePath(
|
|
293
|
+
item.path,
|
|
294
|
+
Math.max(20, terminalWidth - 16)
|
|
295
|
+
);
|
|
296
|
+
const isImage = item.resource?.mimeType?.startsWith("image/");
|
|
297
|
+
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
298
|
+
/* @__PURE__ */ jsx(Text, { color: isSelected ? "cyan" : "gray", children: isSelected ? "\u276F " : " " }),
|
|
299
|
+
/* @__PURE__ */ jsxs(
|
|
300
|
+
Text,
|
|
301
|
+
{
|
|
302
|
+
wrap: "truncate-end",
|
|
303
|
+
color: isSelected ? "cyan" : "white",
|
|
304
|
+
bold: isSelected,
|
|
305
|
+
children: [
|
|
306
|
+
isImage && "\u{1F5BC}\uFE0F ",
|
|
307
|
+
displayPath,
|
|
308
|
+
item.resource?.serverName && ` [${item.resource.serverName}]`
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
)
|
|
312
|
+
] }, item.path);
|
|
313
|
+
}) });
|
|
314
|
+
}
|
|
315
|
+
);
|
|
316
|
+
const ResourceAutocomplete2 = React.memo(
|
|
317
|
+
ResourceAutocompleteInner
|
|
318
|
+
);
|
|
319
|
+
var ResourceAutocomplete_default = ResourceAutocomplete2;
|
|
320
|
+
export {
|
|
321
|
+
ResourceAutocomplete_default as default
|
|
322
|
+
};
|