@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,393 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import os from "os";
|
|
3
|
+
import { isTextPart, isAssistantMessage, isToolMessage } from "@dexto/core";
|
|
4
|
+
const HIDDEN_TOOL_NAMES = /* @__PURE__ */ new Set(["wait_for"]);
|
|
5
|
+
function normalizeToolName(toolName) {
|
|
6
|
+
if (toolName.startsWith("mcp--")) {
|
|
7
|
+
const trimmed = toolName.substring("mcp--".length);
|
|
8
|
+
const parts = trimmed.split("--");
|
|
9
|
+
return parts.length >= 2 ? parts.slice(1).join("--") : trimmed;
|
|
10
|
+
}
|
|
11
|
+
return toolName;
|
|
12
|
+
}
|
|
13
|
+
function shouldHideTool(toolName) {
|
|
14
|
+
if (!toolName) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return HIDDEN_TOOL_NAMES.has(normalizeToolName(toolName));
|
|
18
|
+
}
|
|
19
|
+
const backgroundCompletionRegex = /<background-task-completion>[\s\S]*?<\/background-task-completion>/g;
|
|
20
|
+
const stripBackgroundCompletion = (text) => text.replace(backgroundCompletionRegex, "").replace("<background-task-completion>", "").trim();
|
|
21
|
+
import { generateMessageId } from "./idGenerator.js";
|
|
22
|
+
const SKILL_INVOCATION_REGEX = /<skill-invocation>[\s\S]*?skill:\s*"(?:config:)?([^"]+)"[\s\S]*?<\/skill-invocation>/;
|
|
23
|
+
const AUTOMATION_TRIGGER_REGEX = /<scheduled_automation_trigger>[\s\S]*?<\/scheduled_automation_trigger>/;
|
|
24
|
+
function formatSkillInvocationMessage(content) {
|
|
25
|
+
const match = content.match(SKILL_INVOCATION_REGEX);
|
|
26
|
+
if (match) {
|
|
27
|
+
const skillName = match[1];
|
|
28
|
+
const contextMatch = content.match(/Task context:\s*(.+?)(?:\n|$)/);
|
|
29
|
+
if (contextMatch) {
|
|
30
|
+
return `/${skillName} ${contextMatch[1]}`;
|
|
31
|
+
}
|
|
32
|
+
return `/${skillName}`;
|
|
33
|
+
}
|
|
34
|
+
return content;
|
|
35
|
+
}
|
|
36
|
+
function isSkillInvocationMessage(content) {
|
|
37
|
+
return SKILL_INVOCATION_REGEX.test(content);
|
|
38
|
+
}
|
|
39
|
+
function extractAutomationTriggerInfo(content) {
|
|
40
|
+
const match = content.match(AUTOMATION_TRIGGER_REGEX);
|
|
41
|
+
if (!match) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const block = match[0];
|
|
45
|
+
const taskMatch = block.match(/Task:\s*(.+)/i);
|
|
46
|
+
const triggeredMatch = block.match(/Triggered at:\s*(.+)/i);
|
|
47
|
+
const taskName = taskMatch?.[1]?.trim();
|
|
48
|
+
const triggeredAt = triggeredMatch?.[1]?.trim() ?? null;
|
|
49
|
+
return {
|
|
50
|
+
label: taskName ? `\u23F0 Scheduled Task: ${taskName}` : "\u23F0 Scheduled Task",
|
|
51
|
+
timestamp: triggeredAt,
|
|
52
|
+
source: "scheduler"
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function stripAutomationTriggerTags(content) {
|
|
56
|
+
const stripped = content.replace(
|
|
57
|
+
/<scheduled_automation_trigger>[\s\S]*?<\/scheduled_automation_trigger>\s*/g,
|
|
58
|
+
""
|
|
59
|
+
);
|
|
60
|
+
return stripped === content ? content : stripped.trim();
|
|
61
|
+
}
|
|
62
|
+
function makeRelativePath(absolutePath, cwd = process.cwd()) {
|
|
63
|
+
const normalizedPath = path.normalize(absolutePath);
|
|
64
|
+
const normalizedCwd = path.normalize(cwd);
|
|
65
|
+
const homeDir = os.homedir();
|
|
66
|
+
if (normalizedPath.startsWith(normalizedCwd + path.sep) || normalizedPath === normalizedCwd) {
|
|
67
|
+
const relative = path.relative(normalizedCwd, normalizedPath);
|
|
68
|
+
return relative || ".";
|
|
69
|
+
}
|
|
70
|
+
if (normalizedPath.startsWith(homeDir + path.sep) || normalizedPath === homeDir) {
|
|
71
|
+
return "~" + normalizedPath.slice(homeDir.length);
|
|
72
|
+
}
|
|
73
|
+
return absolutePath;
|
|
74
|
+
}
|
|
75
|
+
function formatPathForDisplay(absolutePath, maxWidth = 60, cwd = process.cwd()) {
|
|
76
|
+
const relativePath = makeRelativePath(absolutePath, cwd);
|
|
77
|
+
if (relativePath.length <= maxWidth) {
|
|
78
|
+
return relativePath;
|
|
79
|
+
}
|
|
80
|
+
return centerTruncatePath(relativePath, maxWidth);
|
|
81
|
+
}
|
|
82
|
+
function centerTruncatePath(filePath, maxWidth) {
|
|
83
|
+
if (filePath.length <= maxWidth) {
|
|
84
|
+
return filePath;
|
|
85
|
+
}
|
|
86
|
+
const sep = path.sep;
|
|
87
|
+
const segments = filePath.split(sep).filter(Boolean);
|
|
88
|
+
if (segments.length <= 3) {
|
|
89
|
+
return filePath.slice(0, maxWidth - 1) + "\u2026";
|
|
90
|
+
}
|
|
91
|
+
const first = filePath.startsWith(sep) ? sep + segments[0] : segments[0];
|
|
92
|
+
const lastTwo = segments.slice(-2).join(sep);
|
|
93
|
+
const truncated = `${first}${sep}\u2026${sep}${lastTwo}`;
|
|
94
|
+
if (truncated.length <= maxWidth) {
|
|
95
|
+
return truncated;
|
|
96
|
+
}
|
|
97
|
+
const filename = segments[segments.length - 1] || "";
|
|
98
|
+
const withJustFilename = `\u2026${sep}${filename}`;
|
|
99
|
+
if (withJustFilename.length <= maxWidth) {
|
|
100
|
+
return withJustFilename;
|
|
101
|
+
}
|
|
102
|
+
return filename.slice(0, maxWidth - 1) + "\u2026";
|
|
103
|
+
}
|
|
104
|
+
function toTitleCase(name) {
|
|
105
|
+
return name.replace(/[_-]+/g, " ").split(" ").filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
106
|
+
}
|
|
107
|
+
function getToolDisplayName(toolName) {
|
|
108
|
+
if (toolName.startsWith("mcp--")) {
|
|
109
|
+
const parts = toolName.split("--");
|
|
110
|
+
if (parts.length >= 3) {
|
|
111
|
+
return toTitleCase(parts.slice(2).join("--"));
|
|
112
|
+
}
|
|
113
|
+
return toTitleCase(toolName.substring(5));
|
|
114
|
+
}
|
|
115
|
+
return toTitleCase(toolName);
|
|
116
|
+
}
|
|
117
|
+
function getToolTypeBadge(toolName) {
|
|
118
|
+
if (toolName.startsWith("mcp--")) {
|
|
119
|
+
const parts = toolName.split("--");
|
|
120
|
+
if (parts.length >= 3 && parts[1]) {
|
|
121
|
+
return `MCP: ${parts[1]}`;
|
|
122
|
+
}
|
|
123
|
+
return "MCP";
|
|
124
|
+
}
|
|
125
|
+
return "local";
|
|
126
|
+
}
|
|
127
|
+
function formatToolHeader(options) {
|
|
128
|
+
const { toolName, args, presentationSnapshot } = options;
|
|
129
|
+
const snapshotHeader = presentationSnapshot?.header;
|
|
130
|
+
const displayName = snapshotHeader?.title ?? getToolDisplayName(toolName);
|
|
131
|
+
const argsFormatted = snapshotHeader?.argsText ?? formatArgsFallback(args);
|
|
132
|
+
const badge = getToolTypeBadge(toolName);
|
|
133
|
+
const isMcpTool = badge.startsWith("MCP");
|
|
134
|
+
const badgeSuffix = isMcpTool ? ` [${badge}]` : "";
|
|
135
|
+
const header = argsFormatted ? `${displayName}(${argsFormatted})${badgeSuffix}` : `${displayName}()${badgeSuffix}`;
|
|
136
|
+
return {
|
|
137
|
+
displayName,
|
|
138
|
+
argsFormatted,
|
|
139
|
+
badge,
|
|
140
|
+
header
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function formatArgsFallback(args) {
|
|
144
|
+
const entries = Object.entries(args).filter(([k]) => !["__meta", "description"].includes(k)).slice(0, 4);
|
|
145
|
+
const str = entries.map(([k, v]) => {
|
|
146
|
+
const val = typeof v === "string" ? v : JSON.stringify(v);
|
|
147
|
+
return val.length > 50 ? `${k}=${val.slice(0, 47)}...` : `${k}=${val}`;
|
|
148
|
+
}).join(", ");
|
|
149
|
+
return str.length > 150 ? str.slice(0, 147) + "..." : str;
|
|
150
|
+
}
|
|
151
|
+
function createUserMessage(content) {
|
|
152
|
+
return {
|
|
153
|
+
id: generateMessageId("user"),
|
|
154
|
+
role: "user",
|
|
155
|
+
content,
|
|
156
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function createQueuedUserMessage(content, queuePosition) {
|
|
160
|
+
return {
|
|
161
|
+
id: generateMessageId("user-queued"),
|
|
162
|
+
role: "user",
|
|
163
|
+
content,
|
|
164
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
165
|
+
isQueued: true,
|
|
166
|
+
queuePosition
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function createSystemMessage(content) {
|
|
170
|
+
return {
|
|
171
|
+
id: generateMessageId("system"),
|
|
172
|
+
role: "system",
|
|
173
|
+
content,
|
|
174
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function createErrorMessage(error) {
|
|
178
|
+
const content = error instanceof Error ? error.message : error;
|
|
179
|
+
return {
|
|
180
|
+
id: generateMessageId("error"),
|
|
181
|
+
role: "system",
|
|
182
|
+
content: `Error: ${content}`,
|
|
183
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
function createToolMessage(toolName) {
|
|
187
|
+
return {
|
|
188
|
+
id: generateMessageId("tool"),
|
|
189
|
+
role: "tool",
|
|
190
|
+
content: `\u{1F527} Calling tool: ${toolName}`,
|
|
191
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
function createStreamingMessage() {
|
|
195
|
+
return {
|
|
196
|
+
id: generateMessageId("assistant"),
|
|
197
|
+
role: "assistant",
|
|
198
|
+
content: "",
|
|
199
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
200
|
+
isStreaming: true
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function extractTextContent(content) {
|
|
204
|
+
if (!content) {
|
|
205
|
+
return "";
|
|
206
|
+
}
|
|
207
|
+
return content.filter(isTextPart).map((part) => part.text).join("\n");
|
|
208
|
+
}
|
|
209
|
+
function formatToolResultPreview(result) {
|
|
210
|
+
try {
|
|
211
|
+
const parsed = JSON.parse(result);
|
|
212
|
+
if (parsed.status === "running" && parsed.taskId) {
|
|
213
|
+
return `Background task started (id: ${parsed.taskId})`;
|
|
214
|
+
}
|
|
215
|
+
if (parsed.found !== void 0 && parsed.taskId) {
|
|
216
|
+
return parsed.found ? `Task ${parsed.taskId} status: ${parsed.status ?? "unknown"}` : `Task ${parsed.taskId} not found`;
|
|
217
|
+
}
|
|
218
|
+
if (Array.isArray(parsed.tasks) && typeof parsed.count === "number") {
|
|
219
|
+
const running = parsed.tasks.filter((task) => task.status === "running").length;
|
|
220
|
+
return `Tasks: ${parsed.count} total${running > 0 ? ` \u2022 ${running} running` : ""}`;
|
|
221
|
+
}
|
|
222
|
+
} catch {
|
|
223
|
+
}
|
|
224
|
+
const maxChars = 200;
|
|
225
|
+
if (result.length <= maxChars) {
|
|
226
|
+
return result;
|
|
227
|
+
}
|
|
228
|
+
return result.slice(0, maxChars) + "\u2026";
|
|
229
|
+
}
|
|
230
|
+
function generateToolResultPreview(content) {
|
|
231
|
+
const textContent = extractTextContent(content);
|
|
232
|
+
if (!textContent) return "";
|
|
233
|
+
try {
|
|
234
|
+
const parsed = JSON.parse(textContent);
|
|
235
|
+
if (parsed.status === "running" && parsed.taskId) {
|
|
236
|
+
return `Background task started (id: ${parsed.taskId})`;
|
|
237
|
+
}
|
|
238
|
+
if (Array.isArray(parsed.tasks) && typeof parsed.count === "number") {
|
|
239
|
+
const running = parsed.tasks.filter((task) => task.status === "running").length;
|
|
240
|
+
return `Tasks: ${parsed.count} total${running > 0 ? ` \u2022 ${running} running` : ""}`;
|
|
241
|
+
}
|
|
242
|
+
if (parsed.found !== void 0 && parsed.taskId) {
|
|
243
|
+
return parsed.found ? `Task ${parsed.taskId} status: ${parsed.status ?? "unknown"}` : `Task ${parsed.taskId} not found`;
|
|
244
|
+
}
|
|
245
|
+
} catch {
|
|
246
|
+
}
|
|
247
|
+
const lines = textContent.split("\n");
|
|
248
|
+
const previewLines = lines.slice(0, 5);
|
|
249
|
+
let preview = previewLines.join("\n");
|
|
250
|
+
if (preview.length > 400) {
|
|
251
|
+
preview = preview.slice(0, 397) + "...";
|
|
252
|
+
} else if (lines.length > 5) {
|
|
253
|
+
preview += "\n...";
|
|
254
|
+
}
|
|
255
|
+
return preview;
|
|
256
|
+
}
|
|
257
|
+
function convertHistoryToUIMessages(history, sessionId) {
|
|
258
|
+
const uiMessages = [];
|
|
259
|
+
const toolCallMap = /* @__PURE__ */ new Map();
|
|
260
|
+
for (const msg of history) {
|
|
261
|
+
if (isAssistantMessage(msg) && msg.toolCalls) {
|
|
262
|
+
for (const toolCall of msg.toolCalls) {
|
|
263
|
+
toolCallMap.set(toolCall.id, toolCall);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
history.forEach((msg, index) => {
|
|
268
|
+
const timestamp = new Date(msg.timestamp ?? Date.now() - (history.length - index) * 1e3);
|
|
269
|
+
if (isToolMessage(msg)) {
|
|
270
|
+
if (shouldHideTool(msg.name)) {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
const toolCall = toolCallMap.get(msg.toolCallId);
|
|
274
|
+
const displayName = msg.presentationSnapshot?.header?.title ?? getToolDisplayName(msg.name);
|
|
275
|
+
let toolContent = displayName;
|
|
276
|
+
const snapshotArgsText = msg.presentationSnapshot?.header?.argsText;
|
|
277
|
+
if (typeof snapshotArgsText === "string" && snapshotArgsText.length > 0) {
|
|
278
|
+
toolContent = `${displayName}(${snapshotArgsText})`;
|
|
279
|
+
}
|
|
280
|
+
if (!snapshotArgsText && toolCall) {
|
|
281
|
+
try {
|
|
282
|
+
const args = JSON.parse(toolCall.function.arguments || "{}");
|
|
283
|
+
const argsFormatted = formatArgsFallback(args);
|
|
284
|
+
if (argsFormatted) {
|
|
285
|
+
toolContent = `${displayName}(${argsFormatted})`;
|
|
286
|
+
}
|
|
287
|
+
} catch {
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
const badge = getToolTypeBadge(msg.name);
|
|
291
|
+
if (badge.startsWith("MCP")) {
|
|
292
|
+
toolContent = `${toolContent} [${badge}]`;
|
|
293
|
+
}
|
|
294
|
+
const resultPreview = generateToolResultPreview(msg.content);
|
|
295
|
+
uiMessages.push({
|
|
296
|
+
id: `session-${sessionId}-${index}`,
|
|
297
|
+
role: "tool",
|
|
298
|
+
content: toolContent,
|
|
299
|
+
timestamp,
|
|
300
|
+
toolStatus: "finished",
|
|
301
|
+
toolResult: resultPreview,
|
|
302
|
+
isError: msg.success === false,
|
|
303
|
+
// Store content parts for potential rich rendering
|
|
304
|
+
toolContent: msg.content,
|
|
305
|
+
// Restore structured display data for rich rendering (diffs, shell output, etc.)
|
|
306
|
+
...msg.displayData !== void 0 && {
|
|
307
|
+
toolDisplayData: msg.displayData
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
if (isAssistantMessage(msg)) {
|
|
313
|
+
let textContent2 = extractTextContent(msg.content);
|
|
314
|
+
textContent2 = stripBackgroundCompletion(textContent2);
|
|
315
|
+
if (!textContent2) return;
|
|
316
|
+
uiMessages.push({
|
|
317
|
+
id: `session-${sessionId}-${index}`,
|
|
318
|
+
role: "assistant",
|
|
319
|
+
content: textContent2,
|
|
320
|
+
timestamp
|
|
321
|
+
});
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
let textContent = extractTextContent(msg.content);
|
|
325
|
+
textContent = stripBackgroundCompletion(textContent);
|
|
326
|
+
if (!textContent) return;
|
|
327
|
+
const automationTrigger = msg.role === "user" ? extractAutomationTriggerInfo(textContent) : null;
|
|
328
|
+
if (automationTrigger) {
|
|
329
|
+
uiMessages.push({
|
|
330
|
+
id: `session-${sessionId}-${index}-trigger`,
|
|
331
|
+
role: "system",
|
|
332
|
+
content: automationTrigger.label,
|
|
333
|
+
timestamp,
|
|
334
|
+
styledType: "external-trigger",
|
|
335
|
+
styledData: {
|
|
336
|
+
label: automationTrigger.label,
|
|
337
|
+
source: automationTrigger.source,
|
|
338
|
+
timestamp: automationTrigger.timestamp ?? timestamp
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
textContent = stripAutomationTriggerTags(textContent);
|
|
342
|
+
}
|
|
343
|
+
if (msg.role === "user") {
|
|
344
|
+
textContent = formatSkillInvocationMessage(textContent);
|
|
345
|
+
}
|
|
346
|
+
uiMessages.push({
|
|
347
|
+
id: `session-${sessionId}-${index}`,
|
|
348
|
+
role: msg.role,
|
|
349
|
+
content: textContent,
|
|
350
|
+
timestamp
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
return uiMessages;
|
|
354
|
+
}
|
|
355
|
+
async function getStartupInfo(agent, sessionId) {
|
|
356
|
+
const connectedServers = agent.mcpManager.getClients();
|
|
357
|
+
const failedConnections = agent.mcpManager.getFailedConnections();
|
|
358
|
+
const tools = await agent.getAllTools();
|
|
359
|
+
const toolCount = Object.keys(tools).length;
|
|
360
|
+
const logFile = sessionId ? (await agent.getSession(sessionId))?.logger.getLogFilePath() ?? null : null;
|
|
361
|
+
return {
|
|
362
|
+
connectedServers: {
|
|
363
|
+
count: connectedServers.size,
|
|
364
|
+
names: Array.from(connectedServers.keys())
|
|
365
|
+
},
|
|
366
|
+
failedConnections: Object.keys(failedConnections),
|
|
367
|
+
toolCount,
|
|
368
|
+
logFile
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
export {
|
|
372
|
+
centerTruncatePath,
|
|
373
|
+
convertHistoryToUIMessages,
|
|
374
|
+
createErrorMessage,
|
|
375
|
+
createQueuedUserMessage,
|
|
376
|
+
createStreamingMessage,
|
|
377
|
+
createSystemMessage,
|
|
378
|
+
createToolMessage,
|
|
379
|
+
createUserMessage,
|
|
380
|
+
extractAutomationTriggerInfo,
|
|
381
|
+
formatPathForDisplay,
|
|
382
|
+
formatSkillInvocationMessage,
|
|
383
|
+
formatToolHeader,
|
|
384
|
+
formatToolResultPreview,
|
|
385
|
+
getStartupInfo,
|
|
386
|
+
getToolDisplayName,
|
|
387
|
+
getToolTypeBadge,
|
|
388
|
+
isSkillInvocationMessage,
|
|
389
|
+
makeRelativePath,
|
|
390
|
+
normalizeToolName,
|
|
391
|
+
shouldHideTool,
|
|
392
|
+
stripAutomationTriggerTags
|
|
393
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var import_vitest = require("vitest");
|
|
3
|
+
var import_messageFormatting = require("./messageFormatting.js");
|
|
4
|
+
(0, import_vitest.describe)("formatToolHeader fallback args", () => {
|
|
5
|
+
(0, import_vitest.it)("truncates from the start (not mid-string)", () => {
|
|
6
|
+
const long = "with base path set to packages/server (or absolute if needed). Summarize key directories and notable config/source files.";
|
|
7
|
+
const { header } = (0, import_messageFormatting.formatToolHeader)({
|
|
8
|
+
toolName: "spawn_agent",
|
|
9
|
+
args: {
|
|
10
|
+
instructions: long + " ".repeat(10) + "X".repeat(500)
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
(0, import_vitest.expect)(header).toContain("instructions=with base path set to packages/server");
|
|
14
|
+
(0, import_vitest.expect)(header).toContain("...");
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageFormatting.test.d.ts","sourceRoot":"","sources":["../../src/utils/messageFormatting.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { formatToolHeader } from "./messageFormatting.js";
|
|
3
|
+
describe("formatToolHeader fallback args", () => {
|
|
4
|
+
it("truncates from the start (not mid-string)", () => {
|
|
5
|
+
const long = "with base path set to packages/server (or absolute if needed). Summarize key directories and notable config/source files.";
|
|
6
|
+
const { header } = formatToolHeader({
|
|
7
|
+
toolName: "spawn_agent",
|
|
8
|
+
args: {
|
|
9
|
+
instructions: long + " ".repeat(10) + "X".repeat(500)
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
expect(header).toContain("instructions=with base path set to packages/server");
|
|
13
|
+
expect(header).toContain("...");
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var mouse_exports = {};
|
|
20
|
+
__export(mouse_exports, {
|
|
21
|
+
ESC: () => import_input.ESC,
|
|
22
|
+
disableMouseEvents: () => disableMouseEvents,
|
|
23
|
+
enableMouseEvents: () => enableMouseEvents,
|
|
24
|
+
getMouseEventName: () => getMouseEventName,
|
|
25
|
+
isIncompleteMouseSequence: () => isIncompleteMouseSequence,
|
|
26
|
+
parseMouseEvent: () => parseMouseEvent,
|
|
27
|
+
parseSGRMouseEvent: () => parseSGRMouseEvent,
|
|
28
|
+
parseX11MouseEvent: () => parseX11MouseEvent
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(mouse_exports);
|
|
31
|
+
var import_input = require("./input.js");
|
|
32
|
+
function enableMouseEvents() {
|
|
33
|
+
process.stdout.write("\x1B[?1002h\x1B[?1006h");
|
|
34
|
+
}
|
|
35
|
+
function disableMouseEvents() {
|
|
36
|
+
process.stdout.write("\x1B[?1006l\x1B[?1002l");
|
|
37
|
+
}
|
|
38
|
+
function getMouseEventName(buttonCode, isRelease) {
|
|
39
|
+
const isMove = (buttonCode & 32) !== 0;
|
|
40
|
+
if (buttonCode === 66) {
|
|
41
|
+
return "scroll-left";
|
|
42
|
+
} else if (buttonCode === 67) {
|
|
43
|
+
return "scroll-right";
|
|
44
|
+
}
|
|
45
|
+
if ((buttonCode & 64) === 64) {
|
|
46
|
+
if ((buttonCode & 1) === 0) {
|
|
47
|
+
return "scroll-up";
|
|
48
|
+
} else {
|
|
49
|
+
return "scroll-down";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (isMove) {
|
|
53
|
+
return "move";
|
|
54
|
+
}
|
|
55
|
+
const button = buttonCode & 3;
|
|
56
|
+
const type = isRelease ? "release" : "press";
|
|
57
|
+
switch (button) {
|
|
58
|
+
case 0:
|
|
59
|
+
return `left-${type}`;
|
|
60
|
+
case 1:
|
|
61
|
+
return `middle-${type}`;
|
|
62
|
+
case 2:
|
|
63
|
+
return `right-${type}`;
|
|
64
|
+
default:
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function getButtonFromCode(code) {
|
|
69
|
+
const button = code & 3;
|
|
70
|
+
switch (button) {
|
|
71
|
+
case 0:
|
|
72
|
+
return "left";
|
|
73
|
+
case 1:
|
|
74
|
+
return "middle";
|
|
75
|
+
case 2:
|
|
76
|
+
return "right";
|
|
77
|
+
default:
|
|
78
|
+
return "none";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function parseSGRMouseEvent(buffer) {
|
|
82
|
+
const match = buffer.match(import_input.SGR_MOUSE_REGEX);
|
|
83
|
+
if (match) {
|
|
84
|
+
const buttonCode = parseInt(match[1], 10);
|
|
85
|
+
const col = parseInt(match[2], 10);
|
|
86
|
+
const row = parseInt(match[3], 10);
|
|
87
|
+
const action = match[4];
|
|
88
|
+
const isRelease = action === "m";
|
|
89
|
+
const shift = (buttonCode & 4) !== 0;
|
|
90
|
+
const meta = (buttonCode & 8) !== 0;
|
|
91
|
+
const ctrl = (buttonCode & 16) !== 0;
|
|
92
|
+
const name = getMouseEventName(buttonCode, isRelease);
|
|
93
|
+
if (name) {
|
|
94
|
+
return {
|
|
95
|
+
event: {
|
|
96
|
+
name,
|
|
97
|
+
ctrl,
|
|
98
|
+
meta,
|
|
99
|
+
shift,
|
|
100
|
+
col,
|
|
101
|
+
row,
|
|
102
|
+
button: getButtonFromCode(buttonCode)
|
|
103
|
+
},
|
|
104
|
+
length: match[0].length
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
function parseX11MouseEvent(buffer) {
|
|
111
|
+
const match = buffer.match(import_input.X11_MOUSE_REGEX);
|
|
112
|
+
if (!match) return null;
|
|
113
|
+
const b = match[1].charCodeAt(0) - 32;
|
|
114
|
+
const col = match[1].charCodeAt(1) - 32;
|
|
115
|
+
const row = match[1].charCodeAt(2) - 32;
|
|
116
|
+
const shift = (b & 4) !== 0;
|
|
117
|
+
const meta = (b & 8) !== 0;
|
|
118
|
+
const ctrl = (b & 16) !== 0;
|
|
119
|
+
const isMove = (b & 32) !== 0;
|
|
120
|
+
const isWheel = (b & 64) !== 0;
|
|
121
|
+
let name = null;
|
|
122
|
+
if (isWheel) {
|
|
123
|
+
const button = b & 3;
|
|
124
|
+
switch (button) {
|
|
125
|
+
case 0:
|
|
126
|
+
name = "scroll-up";
|
|
127
|
+
break;
|
|
128
|
+
case 1:
|
|
129
|
+
name = "scroll-down";
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
} else if (isMove) {
|
|
133
|
+
name = "move";
|
|
134
|
+
} else {
|
|
135
|
+
const button = b & 3;
|
|
136
|
+
if (button === 3) {
|
|
137
|
+
name = "left-release";
|
|
138
|
+
} else {
|
|
139
|
+
switch (button) {
|
|
140
|
+
case 0:
|
|
141
|
+
name = "left-press";
|
|
142
|
+
break;
|
|
143
|
+
case 1:
|
|
144
|
+
name = "middle-press";
|
|
145
|
+
break;
|
|
146
|
+
case 2:
|
|
147
|
+
name = "right-press";
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (name) {
|
|
153
|
+
let button = getButtonFromCode(b);
|
|
154
|
+
if (name === "left-release" && button === "none") {
|
|
155
|
+
button = "left";
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
event: {
|
|
159
|
+
name,
|
|
160
|
+
ctrl,
|
|
161
|
+
meta,
|
|
162
|
+
shift,
|
|
163
|
+
col,
|
|
164
|
+
row,
|
|
165
|
+
button
|
|
166
|
+
},
|
|
167
|
+
length: match[0].length
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
function parseMouseEvent(buffer) {
|
|
173
|
+
return parseSGRMouseEvent(buffer) || parseX11MouseEvent(buffer);
|
|
174
|
+
}
|
|
175
|
+
function isIncompleteMouseSequence(buffer) {
|
|
176
|
+
if (!(0, import_input.couldBeMouseSequence)(buffer)) return false;
|
|
177
|
+
if (parseMouseEvent(buffer)) return false;
|
|
178
|
+
if (buffer.startsWith(import_input.X11_EVENT_PREFIX)) {
|
|
179
|
+
return buffer.length < import_input.X11_EVENT_PREFIX.length + 3;
|
|
180
|
+
}
|
|
181
|
+
if (buffer.startsWith(import_input.SGR_EVENT_PREFIX)) {
|
|
182
|
+
return !/[mM]/.test(buffer) && buffer.length < 50;
|
|
183
|
+
}
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
187
|
+
0 && (module.exports = {
|
|
188
|
+
ESC,
|
|
189
|
+
disableMouseEvents,
|
|
190
|
+
enableMouseEvents,
|
|
191
|
+
getMouseEventName,
|
|
192
|
+
isIncompleteMouseSequence,
|
|
193
|
+
parseMouseEvent,
|
|
194
|
+
parseSGRMouseEvent,
|
|
195
|
+
parseX11MouseEvent
|
|
196
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mouse Event Utilities
|
|
3
|
+
* Provides trackpad/mouse scroll support.
|
|
4
|
+
*/
|
|
5
|
+
import { ESC } from './input.js';
|
|
6
|
+
export type MouseEventName = 'scroll-up' | 'scroll-down' | 'scroll-left' | 'scroll-right' | 'left-press' | 'left-release' | 'right-press' | 'right-release' | 'middle-press' | 'middle-release' | 'move';
|
|
7
|
+
export interface MouseEvent {
|
|
8
|
+
name: MouseEventName;
|
|
9
|
+
col: number;
|
|
10
|
+
row: number;
|
|
11
|
+
shift: boolean;
|
|
12
|
+
meta: boolean;
|
|
13
|
+
ctrl: boolean;
|
|
14
|
+
button: 'left' | 'middle' | 'right' | 'none';
|
|
15
|
+
}
|
|
16
|
+
export type MouseHandler = (event: MouseEvent) => void | boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Enable mouse events in the terminal.
|
|
19
|
+
* Uses SGR extended mouse mode for better coordinate handling.
|
|
20
|
+
*/
|
|
21
|
+
export declare function enableMouseEvents(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Disable mouse events in the terminal.
|
|
24
|
+
*/
|
|
25
|
+
export declare function disableMouseEvents(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Get mouse event name from button code
|
|
28
|
+
*
|
|
29
|
+
* NOTE: X11 mouse protocol limitation - all button releases report the same code (3),
|
|
30
|
+
* so we cannot distinguish between left-release, middle-release, and right-release.
|
|
31
|
+
* This function returns 'left-release' for all releases in X11 mode.
|
|
32
|
+
* Consumers needing accurate release identification should track press state themselves.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getMouseEventName(buttonCode: number, isRelease: boolean): MouseEventName | null;
|
|
35
|
+
/**
|
|
36
|
+
* Parse SGR format mouse event
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseSGRMouseEvent(buffer: string): {
|
|
39
|
+
event: MouseEvent;
|
|
40
|
+
length: number;
|
|
41
|
+
} | null;
|
|
42
|
+
/**
|
|
43
|
+
* Parse X11 format mouse event
|
|
44
|
+
*/
|
|
45
|
+
export declare function parseX11MouseEvent(buffer: string): {
|
|
46
|
+
event: MouseEvent;
|
|
47
|
+
length: number;
|
|
48
|
+
} | null;
|
|
49
|
+
/**
|
|
50
|
+
* Parse mouse event from buffer (tries both SGR and X11 formats)
|
|
51
|
+
*/
|
|
52
|
+
export declare function parseMouseEvent(buffer: string): {
|
|
53
|
+
event: MouseEvent;
|
|
54
|
+
length: number;
|
|
55
|
+
} | null;
|
|
56
|
+
/**
|
|
57
|
+
* Check if buffer could be an incomplete mouse sequence
|
|
58
|
+
*/
|
|
59
|
+
export declare function isIncompleteMouseSequence(buffer: string): boolean;
|
|
60
|
+
export { ESC };
|
|
61
|
+
//# sourceMappingURL=mouse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mouse.d.ts","sourceRoot":"","sources":["../../src/utils/mouse.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,GAAG,EAMN,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,cAAc,GACpB,WAAW,GACX,aAAa,GACb,aAAa,GACb,cAAc,GACd,YAAY,GACZ,cAAc,GACd,aAAa,GACb,eAAe,GACf,cAAc,GACd,gBAAgB,GAChB,MAAM,CAAC;AAEb,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;CAChD;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAAC;AAEjE;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAIxC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAmC/F;AAmBD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAiC/F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAoE/F;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAE5F;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAmBjE;AAGD,OAAO,EAAE,GAAG,EAAE,CAAC"}
|