@dexto/tui 1.14.6 → 1.15.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/InkCLIRefactored.cjs +30 -24
- package/dist/InkCLIRefactored.d.ts.map +1 -1
- package/dist/InkCLIRefactored.js +30 -24
- package/dist/components/ApprovalPrompt.cjs +128 -40
- package/dist/components/ApprovalPrompt.d.ts +2 -0
- package/dist/components/ApprovalPrompt.d.ts.map +1 -1
- package/dist/components/ApprovalPrompt.js +128 -41
- package/dist/components/CustomInput.cjs +4 -3
- package/dist/components/CustomInput.d.ts.map +1 -1
- package/dist/components/CustomInput.js +4 -3
- package/dist/components/DeckArea.cjs +43 -0
- package/dist/components/DeckArea.d.ts +14 -0
- package/dist/components/DeckArea.d.ts.map +1 -0
- package/dist/components/DeckArea.js +19 -0
- package/dist/components/EditableMultiLineInput.cjs +9 -8
- package/dist/components/EditableMultiLineInput.d.ts.map +1 -1
- package/dist/components/EditableMultiLineInput.js +9 -8
- package/dist/components/ElicitationForm.cjs +78 -18
- package/dist/components/ElicitationForm.d.ts.map +1 -1
- package/dist/components/ElicitationForm.js +78 -18
- package/dist/components/ErrorBoundary.cjs +15 -5
- package/dist/components/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/ErrorBoundary.js +15 -5
- package/dist/components/Footer.cjs +41 -86
- package/dist/components/Footer.d.ts +2 -2
- package/dist/components/Footer.d.ts.map +1 -1
- package/dist/components/Footer.js +44 -92
- package/dist/components/Footer.test.cjs +44 -0
- package/dist/components/Footer.test.js +44 -0
- package/dist/components/HistorySearchBar.cjs +6 -5
- package/dist/components/HistorySearchBar.d.ts.map +1 -1
- package/dist/components/HistorySearchBar.js +6 -5
- package/dist/components/MultiLineInput.cjs +6 -5
- package/dist/components/MultiLineInput.d.ts.map +1 -1
- package/dist/components/MultiLineInput.js +6 -5
- package/dist/components/ResourceAutocomplete.cjs +5 -4
- package/dist/components/ResourceAutocomplete.d.ts.map +1 -1
- package/dist/components/ResourceAutocomplete.js +5 -4
- package/dist/components/SignalGates.test.cjs +215 -0
- package/dist/components/SignalGates.test.d.ts +2 -0
- package/dist/components/SignalGates.test.d.ts.map +1 -0
- package/dist/components/SignalGates.test.js +217 -0
- package/dist/components/SlashCommandAutocomplete.cjs +4 -3
- package/dist/components/SlashCommandAutocomplete.d.ts.map +1 -1
- package/dist/components/SlashCommandAutocomplete.js +4 -3
- package/dist/components/StatusBar.cjs +13 -30
- package/dist/components/StatusBar.d.ts +1 -3
- package/dist/components/StatusBar.d.ts.map +1 -1
- package/dist/components/StatusBar.js +13 -30
- package/dist/components/TextBufferInput.cjs +13 -12
- package/dist/components/TextBufferInput.d.ts.map +1 -1
- package/dist/components/TextBufferInput.js +13 -12
- package/dist/components/TodoPanel.cjs +23 -16
- package/dist/components/TodoPanel.d.ts.map +1 -1
- package/dist/components/TodoPanel.js +23 -16
- package/dist/components/base/BaseAutocomplete.cjs +7 -6
- package/dist/components/base/BaseAutocomplete.d.ts.map +1 -1
- package/dist/components/base/BaseAutocomplete.js +7 -6
- package/dist/components/base/BaseSelector.cjs +5 -4
- package/dist/components/base/BaseSelector.d.ts.map +1 -1
- package/dist/components/base/BaseSelector.js +5 -4
- package/dist/components/chat/Footer.cjs +2 -1
- package/dist/components/chat/Footer.d.ts.map +1 -1
- package/dist/components/chat/Footer.js +2 -1
- package/dist/components/chat/Header.cjs +20 -16
- package/dist/components/chat/Header.d.ts.map +1 -1
- package/dist/components/chat/Header.js +20 -16
- package/dist/components/chat/MessageItem.cjs +47 -30
- package/dist/components/chat/MessageItem.d.ts.map +1 -1
- package/dist/components/chat/MessageItem.js +52 -29
- package/dist/components/chat/MessageList.cjs +3 -2
- package/dist/components/chat/MessageList.d.ts.map +1 -1
- package/dist/components/chat/MessageList.js +3 -2
- package/dist/components/chat/QueuedMessagesDisplay.cjs +17 -5
- package/dist/components/chat/QueuedMessagesDisplay.d.ts.map +1 -1
- package/dist/components/chat/QueuedMessagesDisplay.js +18 -6
- package/dist/components/chat/SignalMessage.cjs +116 -0
- package/dist/components/chat/SignalMessage.d.ts +18 -0
- package/dist/components/chat/SignalMessage.d.ts.map +1 -0
- package/dist/components/chat/SignalMessage.js +96 -0
- package/dist/components/chat/SignalMessage.test.cjs +112 -0
- package/dist/components/chat/SignalMessage.test.d.ts +2 -0
- package/dist/components/chat/SignalMessage.test.d.ts.map +1 -0
- package/dist/components/chat/SignalMessage.test.js +116 -0
- package/dist/components/chat/ToolIcon.cjs +6 -5
- package/dist/components/chat/ToolIcon.d.ts.map +1 -1
- package/dist/components/chat/ToolIcon.js +6 -5
- package/dist/components/chat/styled-boxes/ConfigBox.cjs +8 -7
- package/dist/components/chat/styled-boxes/ConfigBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/ConfigBox.js +8 -7
- package/dist/components/chat/styled-boxes/HelpBox.cjs +4 -3
- package/dist/components/chat/styled-boxes/HelpBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/HelpBox.js +4 -3
- package/dist/components/chat/styled-boxes/LogConfigBox.cjs +11 -3
- package/dist/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/LogConfigBox.js +11 -3
- package/dist/components/chat/styled-boxes/SessionHistoryBox.cjs +8 -7
- package/dist/components/chat/styled-boxes/SessionHistoryBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/SessionHistoryBox.js +8 -7
- package/dist/components/chat/styled-boxes/SessionListBox.cjs +19 -11
- package/dist/components/chat/styled-boxes/SessionListBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/SessionListBox.js +19 -11
- package/dist/components/chat/styled-boxes/ShortcutsBox.cjs +4 -3
- package/dist/components/chat/styled-boxes/ShortcutsBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/ShortcutsBox.js +4 -3
- package/dist/components/chat/styled-boxes/StatsBox.cjs +13 -5
- package/dist/components/chat/styled-boxes/StatsBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/StatsBox.js +13 -5
- package/dist/components/chat/styled-boxes/StyledBox.cjs +7 -6
- package/dist/components/chat/styled-boxes/StyledBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/StyledBox.js +7 -6
- package/dist/components/chat/styled-boxes/SyspromptBox.cjs +2 -1
- package/dist/components/chat/styled-boxes/SyspromptBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/SyspromptBox.js +2 -1
- package/dist/components/modes/AlternateBufferCLI.cjs +53 -43
- package/dist/components/modes/AlternateBufferCLI.d.ts.map +1 -1
- package/dist/components/modes/AlternateBufferCLI.js +53 -43
- package/dist/components/modes/StaticCLI.cjs +53 -42
- package/dist/components/modes/StaticCLI.d.ts.map +1 -1
- package/dist/components/modes/StaticCLI.js +53 -42
- package/dist/components/overlays/ApiKeyInput.cjs +12 -11
- package/dist/components/overlays/ApiKeyInput.d.ts.map +1 -1
- package/dist/components/overlays/ApiKeyInput.js +12 -11
- package/dist/components/overlays/ChatGPTUsageCapOverlay.cjs +7 -6
- package/dist/components/overlays/ChatGPTUsageCapOverlay.d.ts.map +1 -1
- package/dist/components/overlays/ChatGPTUsageCapOverlay.js +7 -6
- package/dist/components/overlays/CommandOutputOverlay.cjs +2 -1
- package/dist/components/overlays/CommandOutputOverlay.d.ts.map +1 -1
- package/dist/components/overlays/CommandOutputOverlay.js +2 -1
- package/dist/components/overlays/ConnectOverlay.cjs +10 -9
- package/dist/components/overlays/ConnectOverlay.d.ts.map +1 -1
- package/dist/components/overlays/ConnectOverlay.js +10 -9
- package/dist/components/overlays/ContextStatsOverlay.cjs +48 -37
- package/dist/components/overlays/ContextStatsOverlay.d.ts.map +1 -1
- package/dist/components/overlays/ContextStatsOverlay.js +48 -37
- package/dist/components/overlays/CustomModelWizard.cjs +5 -4
- package/dist/components/overlays/CustomModelWizard.d.ts.map +1 -1
- package/dist/components/overlays/CustomModelWizard.js +5 -4
- package/dist/components/overlays/ExportWizard.cjs +28 -27
- package/dist/components/overlays/ExportWizard.d.ts.map +1 -1
- package/dist/components/overlays/ExportWizard.js +28 -27
- package/dist/components/overlays/InsufficientCreditsOverlay.cjs +25 -9
- package/dist/components/overlays/InsufficientCreditsOverlay.d.ts +2 -0
- package/dist/components/overlays/InsufficientCreditsOverlay.d.ts.map +1 -1
- package/dist/components/overlays/InsufficientCreditsOverlay.js +25 -9
- package/dist/components/overlays/LogLevelSelector.cjs +6 -5
- package/dist/components/overlays/LogLevelSelector.d.ts.map +1 -1
- package/dist/components/overlays/LogLevelSelector.js +6 -5
- package/dist/components/overlays/LoginOverlay.cjs +31 -66
- package/dist/components/overlays/LoginOverlay.d.ts +1 -3
- package/dist/components/overlays/LoginOverlay.d.ts.map +1 -1
- package/dist/components/overlays/LoginOverlay.js +32 -71
- package/dist/components/overlays/LogoutOverlay.cjs +16 -24
- package/dist/components/overlays/LogoutOverlay.d.ts +1 -0
- package/dist/components/overlays/LogoutOverlay.d.ts.map +1 -1
- package/dist/components/overlays/LogoutOverlay.js +18 -38
- package/dist/components/overlays/MarketplaceAddPrompt.cjs +12 -11
- package/dist/components/overlays/MarketplaceAddPrompt.d.ts.map +1 -1
- package/dist/components/overlays/MarketplaceAddPrompt.js +12 -11
- package/dist/components/overlays/MarketplaceBrowser.cjs +27 -26
- package/dist/components/overlays/MarketplaceBrowser.d.ts.map +1 -1
- package/dist/components/overlays/MarketplaceBrowser.js +27 -26
- package/dist/components/overlays/McpAddChoice.cjs +4 -3
- package/dist/components/overlays/McpAddChoice.d.ts.map +1 -1
- package/dist/components/overlays/McpAddChoice.js +4 -3
- package/dist/components/overlays/McpAddSelector.cjs +4 -3
- package/dist/components/overlays/McpAddSelector.d.ts.map +1 -1
- package/dist/components/overlays/McpAddSelector.js +4 -3
- package/dist/components/overlays/McpCustomTypeSelector.cjs +4 -3
- package/dist/components/overlays/McpCustomTypeSelector.d.ts.map +1 -1
- package/dist/components/overlays/McpCustomTypeSelector.js +4 -3
- package/dist/components/overlays/McpCustomWizard.cjs +9 -8
- package/dist/components/overlays/McpCustomWizard.d.ts.map +1 -1
- package/dist/components/overlays/McpCustomWizard.js +9 -8
- package/dist/components/overlays/McpRemoveSelector.cjs +5 -4
- package/dist/components/overlays/McpRemoveSelector.d.ts.map +1 -1
- package/dist/components/overlays/McpRemoveSelector.js +5 -4
- package/dist/components/overlays/McpSelector.cjs +4 -3
- package/dist/components/overlays/McpSelector.d.ts.map +1 -1
- package/dist/components/overlays/McpSelector.js +4 -3
- package/dist/components/overlays/McpServerActions.cjs +7 -6
- package/dist/components/overlays/McpServerActions.d.ts.map +1 -1
- package/dist/components/overlays/McpServerActions.js +7 -6
- package/dist/components/overlays/McpServerList.cjs +6 -5
- package/dist/components/overlays/McpServerList.d.ts.map +1 -1
- package/dist/components/overlays/McpServerList.js +6 -5
- package/dist/components/overlays/ModelSelectorRefactored.cjs +32 -17
- package/dist/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
- package/dist/components/overlays/ModelSelectorRefactored.js +32 -17
- package/dist/components/overlays/PermissionsSelector.cjs +6 -5
- package/dist/components/overlays/PermissionsSelector.d.ts.map +1 -1
- package/dist/components/overlays/PermissionsSelector.js +6 -5
- package/dist/components/overlays/PluginActions.cjs +7 -6
- package/dist/components/overlays/PluginActions.d.ts.map +1 -1
- package/dist/components/overlays/PluginActions.js +7 -6
- package/dist/components/overlays/PluginList.cjs +12 -11
- package/dist/components/overlays/PluginList.d.ts.map +1 -1
- package/dist/components/overlays/PluginList.js +12 -11
- package/dist/components/overlays/PluginManager.cjs +13 -5
- package/dist/components/overlays/PluginManager.d.ts.map +1 -1
- package/dist/components/overlays/PluginManager.js +13 -5
- package/dist/components/overlays/PromptAddChoice.cjs +5 -4
- package/dist/components/overlays/PromptAddChoice.d.ts.map +1 -1
- package/dist/components/overlays/PromptAddChoice.js +5 -4
- package/dist/components/overlays/PromptAddWizard.cjs +10 -9
- package/dist/components/overlays/PromptAddWizard.d.ts.map +1 -1
- package/dist/components/overlays/PromptAddWizard.js +10 -9
- package/dist/components/overlays/PromptDeleteSelector.cjs +6 -5
- package/dist/components/overlays/PromptDeleteSelector.d.ts.map +1 -1
- package/dist/components/overlays/PromptDeleteSelector.js +6 -5
- package/dist/components/overlays/PromptList.cjs +10 -9
- package/dist/components/overlays/PromptList.d.ts.map +1 -1
- package/dist/components/overlays/PromptList.js +10 -9
- package/dist/components/overlays/ReasoningOverlay.cjs +30 -23
- package/dist/components/overlays/ReasoningOverlay.d.ts.map +1 -1
- package/dist/components/overlays/ReasoningOverlay.js +30 -23
- package/dist/components/overlays/SearchOverlay.cjs +15 -14
- package/dist/components/overlays/SearchOverlay.d.ts.map +1 -1
- package/dist/components/overlays/SearchOverlay.js +15 -14
- package/dist/components/overlays/SessionRenameOverlay.cjs +9 -8
- package/dist/components/overlays/SessionRenameOverlay.d.ts.map +1 -1
- package/dist/components/overlays/SessionRenameOverlay.js +9 -8
- package/dist/components/overlays/SessionSelectorRefactored.cjs +4 -3
- package/dist/components/overlays/SessionSelectorRefactored.d.ts.map +1 -1
- package/dist/components/overlays/SessionSelectorRefactored.js +4 -3
- package/dist/components/overlays/SessionSubcommandSelector.cjs +4 -3
- package/dist/components/overlays/SessionSubcommandSelector.d.ts.map +1 -1
- package/dist/components/overlays/SessionSubcommandSelector.js +4 -3
- package/dist/components/overlays/SoundsSelector.cjs +15 -7
- package/dist/components/overlays/SoundsSelector.d.ts.map +1 -1
- package/dist/components/overlays/SoundsSelector.js +15 -7
- package/dist/components/overlays/StreamSelector.cjs +5 -4
- package/dist/components/overlays/StreamSelector.d.ts.map +1 -1
- package/dist/components/overlays/StreamSelector.js +5 -4
- package/dist/components/overlays/ToolBrowser.cjs +73 -56
- package/dist/components/overlays/ToolBrowser.d.ts.map +1 -1
- package/dist/components/overlays/ToolBrowser.js +73 -56
- package/dist/components/overlays/custom-model-wizard/LocalModelWizard.cjs +103 -69
- package/dist/components/overlays/custom-model-wizard/LocalModelWizard.d.ts.map +1 -1
- package/dist/components/overlays/custom-model-wizard/LocalModelWizard.js +103 -69
- package/dist/components/overlays/custom-model-wizard/provider-config.cjs +4 -4
- package/dist/components/overlays/custom-model-wizard/provider-config.js +4 -4
- package/dist/components/overlays/custom-model-wizard/shared/ApiKeyStep.cjs +3 -2
- package/dist/components/overlays/custom-model-wizard/shared/ApiKeyStep.d.ts.map +1 -1
- package/dist/components/overlays/custom-model-wizard/shared/ApiKeyStep.js +3 -2
- package/dist/components/overlays/custom-model-wizard/shared/ProviderSelector.cjs +5 -4
- package/dist/components/overlays/custom-model-wizard/shared/ProviderSelector.d.ts.map +1 -1
- package/dist/components/overlays/custom-model-wizard/shared/ProviderSelector.js +5 -4
- package/dist/components/overlays/custom-model-wizard/shared/SetupInfoBanner.cjs +4 -3
- package/dist/components/overlays/custom-model-wizard/shared/SetupInfoBanner.d.ts.map +1 -1
- package/dist/components/overlays/custom-model-wizard/shared/SetupInfoBanner.js +4 -3
- package/dist/components/overlays/custom-model-wizard/shared/WizardStepInput.cjs +7 -6
- package/dist/components/overlays/custom-model-wizard/shared/WizardStepInput.d.ts.map +1 -1
- package/dist/components/overlays/custom-model-wizard/shared/WizardStepInput.js +7 -6
- package/dist/components/renderers/DiffRenderer.cjs +5 -4
- package/dist/components/renderers/DiffRenderer.d.ts.map +1 -1
- package/dist/components/renderers/DiffRenderer.js +5 -4
- package/dist/components/renderers/FilePreviewRenderer.cjs +23 -13
- package/dist/components/renderers/FilePreviewRenderer.d.ts.map +1 -1
- package/dist/components/renderers/FilePreviewRenderer.js +23 -13
- package/dist/components/renderers/FileRenderer.cjs +9 -8
- package/dist/components/renderers/FileRenderer.d.ts.map +1 -1
- package/dist/components/renderers/FileRenderer.js +9 -8
- package/dist/components/renderers/GenericRenderer.cjs +5 -4
- package/dist/components/renderers/GenericRenderer.d.ts.map +1 -1
- package/dist/components/renderers/GenericRenderer.js +5 -4
- package/dist/components/renderers/SearchRenderer.cjs +4 -3
- package/dist/components/renderers/SearchRenderer.d.ts.map +1 -1
- package/dist/components/renderers/SearchRenderer.js +4 -3
- package/dist/components/renderers/ShellRenderer.cjs +6 -5
- package/dist/components/renderers/ShellRenderer.d.ts.map +1 -1
- package/dist/components/renderers/ShellRenderer.js +6 -5
- package/dist/components/renderers/SignalDiff.cjs +139 -0
- package/dist/components/renderers/SignalDiff.d.ts +21 -0
- package/dist/components/renderers/SignalDiff.d.ts.map +1 -0
- package/dist/components/renderers/SignalDiff.js +106 -0
- package/dist/components/renderers/SignalDiff.test.cjs +78 -0
- package/dist/components/renderers/SignalDiff.test.d.ts +2 -0
- package/dist/components/renderers/SignalDiff.test.d.ts.map +1 -0
- package/dist/components/renderers/SignalDiff.test.js +77 -0
- package/dist/components/renderers/diff-shared.cjs +13 -7
- package/dist/components/renderers/diff-shared.d.ts +5 -0
- package/dist/components/renderers/diff-shared.d.ts.map +1 -1
- package/dist/components/renderers/diff-shared.js +12 -7
- package/dist/components/shared/FocusOverlayFrame.cjs +3 -2
- package/dist/components/shared/FocusOverlayFrame.d.ts.map +1 -1
- package/dist/components/shared/FocusOverlayFrame.js +3 -2
- package/dist/components/shared/HintBar.cjs +2 -1
- package/dist/components/shared/HintBar.d.ts.map +1 -1
- package/dist/components/shared/HintBar.js +2 -1
- package/dist/components/shared/MarkdownText.cjs +36 -53
- package/dist/components/shared/MarkdownText.d.ts +2 -0
- package/dist/components/shared/MarkdownText.d.ts.map +1 -1
- package/dist/components/shared/MarkdownText.js +36 -54
- package/dist/components/shared/VirtualizedList.cjs +2 -1
- package/dist/components/shared/VirtualizedList.d.ts.map +1 -1
- package/dist/components/shared/VirtualizedList.js +2 -1
- package/dist/containers/OverlayContainer.cjs +32 -44
- package/dist/containers/OverlayContainer.d.ts.map +1 -1
- package/dist/containers/OverlayContainer.js +32 -44
- package/dist/contexts/KeypressContext.cjs +7 -1
- package/dist/contexts/KeypressContext.d.ts.map +1 -1
- package/dist/contexts/KeypressContext.js +7 -1
- package/dist/contexts/KeypressContext.test.cjs +82 -0
- package/dist/contexts/KeypressContext.test.d.ts +2 -0
- package/dist/contexts/KeypressContext.test.d.ts.map +1 -0
- package/dist/contexts/KeypressContext.test.js +81 -0
- package/dist/hooks/useAgentEvents.cjs +1 -74
- package/dist/hooks/useAgentEvents.d.ts.map +1 -1
- package/dist/hooks/useAgentEvents.js +1 -74
- package/dist/hooks/useCLIState.cjs +0 -3
- package/dist/hooks/useCLIState.d.ts.map +1 -1
- package/dist/hooks/useCLIState.js +0 -3
- package/dist/hooks/useContextStats.cjs +91 -0
- package/dist/hooks/useContextStats.d.ts +13 -0
- package/dist/hooks/useContextStats.d.ts.map +1 -0
- package/dist/hooks/useContextStats.js +67 -0
- package/dist/hooks/useDeckState.cjs +140 -0
- package/dist/hooks/useDeckState.d.ts +20 -0
- package/dist/hooks/useDeckState.d.ts.map +1 -0
- package/dist/hooks/useDeckState.js +123 -0
- package/dist/hooks/useDextoCredits.cjs +81 -0
- package/dist/hooks/useDextoCredits.d.ts +14 -0
- package/dist/hooks/useDextoCredits.d.ts.map +1 -0
- package/dist/hooks/useDextoCredits.js +56 -0
- package/dist/hooks/useDextoCredits.test.cjs +73 -0
- package/dist/hooks/useDextoCredits.test.d.ts +2 -0
- package/dist/hooks/useDextoCredits.test.d.ts.map +1 -0
- package/dist/hooks/useDextoCredits.test.js +72 -0
- package/dist/hooks/useElapsedTime.cjs +13 -24
- package/dist/hooks/useElapsedTime.d.ts +3 -1
- package/dist/hooks/useElapsedTime.d.ts.map +1 -1
- package/dist/hooks/useElapsedTime.js +13 -24
- package/dist/hooks/useElapsedTime.test.cjs +35 -0
- package/dist/hooks/useElapsedTime.test.d.ts +2 -0
- package/dist/hooks/useElapsedTime.test.d.ts.map +1 -0
- package/dist/hooks/useElapsedTime.test.js +34 -0
- package/dist/hooks/useGitDirtyFiles.cjs +59 -0
- package/dist/hooks/useGitDirtyFiles.d.ts +5 -0
- package/dist/hooks/useGitDirtyFiles.d.ts.map +1 -0
- package/dist/hooks/useGitDirtyFiles.js +34 -0
- package/dist/hooks/useGitDirtyFiles.test.cjs +9 -0
- package/dist/hooks/useGitDirtyFiles.test.d.ts +2 -0
- package/dist/hooks/useGitDirtyFiles.test.d.ts.map +1 -0
- package/dist/hooks/useGitDirtyFiles.test.js +8 -0
- package/dist/hooks/useHeldValue.cjs +33 -0
- package/dist/hooks/useHeldValue.d.ts +3 -0
- package/dist/hooks/useHeldValue.d.ts.map +1 -0
- package/dist/hooks/useHeldValue.js +9 -0
- package/dist/hooks/useHeldValue.test.cjs +31 -0
- package/dist/hooks/useHeldValue.test.d.ts +2 -0
- package/dist/hooks/useHeldValue.test.d.ts.map +1 -0
- package/dist/hooks/useHeldValue.test.js +30 -0
- package/dist/hooks/useInputOrchestrator.cjs +22 -30
- package/dist/hooks/useInputOrchestrator.d.ts +2 -0
- package/dist/hooks/useInputOrchestrator.d.ts.map +1 -1
- package/dist/hooks/useInputOrchestrator.js +21 -30
- package/dist/hooks/useInputOrchestrator.test.cjs +24 -0
- package/dist/hooks/useInputOrchestrator.test.d.ts +2 -0
- package/dist/hooks/useInputOrchestrator.test.d.ts.map +1 -0
- package/dist/hooks/useInputOrchestrator.test.js +23 -0
- package/dist/host/index.cjs +22 -49
- package/dist/host/index.d.ts +18 -72
- package/dist/host/index.d.ts.map +1 -1
- package/dist/host/index.js +18 -42
- package/dist/host/index.test.cjs +21 -35
- package/dist/host/index.test.js +22 -40
- package/dist/index.d.cts +13 -52
- package/dist/interactive-commands/command-parser.cjs +13 -21
- package/dist/interactive-commands/command-parser.d.ts.map +1 -1
- package/dist/interactive-commands/command-parser.js +13 -11
- package/dist/interactive-commands/general-commands.cjs +8 -7
- package/dist/interactive-commands/general-commands.d.ts.map +1 -1
- package/dist/interactive-commands/general-commands.js +8 -7
- package/dist/services/processStream.cjs +33 -21
- package/dist/services/processStream.d.ts.map +1 -1
- package/dist/services/processStream.js +34 -22
- package/dist/services/processStream.test.cjs +52 -4
- package/dist/services/processStream.test.js +52 -4
- package/dist/signal/background.cjs +154 -0
- package/dist/signal/background.d.ts +43 -0
- package/dist/signal/background.d.ts.map +1 -0
- package/dist/signal/background.js +124 -0
- package/dist/signal/background.test.cjs +186 -0
- package/dist/signal/background.test.d.ts +2 -0
- package/dist/signal/background.test.d.ts.map +1 -0
- package/dist/signal/background.test.js +192 -0
- package/dist/signal/caps.cjs +100 -0
- package/dist/signal/caps.d.ts +23 -0
- package/dist/signal/caps.d.ts.map +1 -0
- package/dist/signal/caps.js +73 -0
- package/dist/signal/caps.test.cjs +56 -0
- package/dist/signal/caps.test.d.ts +2 -0
- package/dist/signal/caps.test.d.ts.map +1 -0
- package/dist/signal/caps.test.js +55 -0
- package/dist/signal/components.cjs +257 -0
- package/dist/signal/components.d.ts +120 -0
- package/dist/signal/components.d.ts.map +1 -0
- package/dist/signal/components.js +226 -0
- package/dist/signal/components.test.cjs +156 -0
- package/dist/signal/components.test.d.ts +2 -0
- package/dist/signal/components.test.d.ts.map +1 -0
- package/dist/signal/components.test.js +133 -0
- package/dist/signal/cut.cjs +103 -0
- package/dist/signal/cut.d.ts +11 -0
- package/dist/signal/cut.d.ts.map +1 -0
- package/dist/signal/cut.js +77 -0
- package/dist/signal/cut.test.cjs +20 -0
- package/dist/signal/cut.test.d.ts +2 -0
- package/dist/signal/cut.test.d.ts.map +1 -0
- package/dist/signal/cut.test.js +19 -0
- package/dist/signal/deck-layout.cjs +57 -0
- package/dist/signal/deck-layout.d.ts +29 -0
- package/dist/signal/deck-layout.d.ts.map +1 -0
- package/dist/signal/deck-layout.js +30 -0
- package/dist/signal/deck-parts.cjs +243 -0
- package/dist/signal/deck-parts.d.ts +55 -0
- package/dist/signal/deck-parts.d.ts.map +1 -0
- package/dist/signal/deck-parts.js +205 -0
- package/dist/signal/deck.test.cjs +311 -0
- package/dist/signal/deck.test.d.ts +2 -0
- package/dist/signal/deck.test.d.ts.map +1 -0
- package/dist/signal/deck.test.js +288 -0
- package/dist/signal/glyphs.cjs +195 -0
- package/dist/signal/glyphs.d.ts +8 -0
- package/dist/signal/glyphs.d.ts.map +1 -0
- package/dist/signal/glyphs.js +171 -0
- package/dist/signal/glyphs.test.cjs +17 -0
- package/dist/signal/glyphs.test.d.ts +2 -0
- package/dist/signal/glyphs.test.d.ts.map +1 -0
- package/dist/signal/glyphs.test.js +16 -0
- package/dist/signal/harness.cjs +103 -0
- package/dist/signal/harness.d.ts +70 -0
- package/dist/signal/harness.d.ts.map +1 -0
- package/dist/signal/harness.js +67 -0
- package/dist/signal/harness.test.cjs +84 -0
- package/dist/signal/harness.test.d.ts +2 -0
- package/dist/signal/harness.test.d.ts.map +1 -0
- package/dist/signal/harness.test.js +61 -0
- package/dist/signal/index.cjs +76 -0
- package/dist/signal/index.d.ts +8 -0
- package/dist/signal/index.d.ts.map +1 -0
- package/dist/signal/index.js +45 -0
- package/dist/signal/kit.snapshot.test.cjs +56 -0
- package/dist/signal/kit.snapshot.test.d.ts +2 -0
- package/dist/signal/kit.snapshot.test.d.ts.map +1 -0
- package/dist/signal/kit.snapshot.test.js +55 -0
- package/dist/signal/no-raw-colours.test.cjs +32 -0
- package/dist/signal/no-raw-colours.test.d.ts +2 -0
- package/dist/signal/no-raw-colours.test.d.ts.map +1 -0
- package/dist/signal/no-raw-colours.test.js +30 -0
- package/dist/signal/paint.cjs +76 -0
- package/dist/signal/paint.d.ts +15 -0
- package/dist/signal/paint.d.ts.map +1 -0
- package/dist/signal/paint.js +41 -0
- package/dist/signal/paint.test.cjs +98 -0
- package/dist/signal/paint.test.d.ts +2 -0
- package/dist/signal/paint.test.d.ts.map +1 -0
- package/dist/signal/paint.test.js +75 -0
- package/dist/signal/tone.cjs +109 -0
- package/dist/signal/tone.d.ts +17 -0
- package/dist/signal/tone.d.ts.map +1 -0
- package/dist/signal/tone.js +83 -0
- package/dist/signal/tone.test.cjs +70 -0
- package/dist/signal/tone.test.d.ts +2 -0
- package/dist/signal/tone.test.d.ts.map +1 -0
- package/dist/signal/tone.test.js +69 -0
- package/dist/signal/trace.cjs +142 -0
- package/dist/signal/trace.d.ts +41 -0
- package/dist/signal/trace.d.ts.map +1 -0
- package/dist/signal/trace.js +113 -0
- package/dist/signal/trace.test.cjs +50 -0
- package/dist/signal/trace.test.d.ts +2 -0
- package/dist/signal/trace.test.d.ts.map +1 -0
- package/dist/signal/trace.test.js +49 -0
- package/dist/signal/use-trace.cjs +73 -0
- package/dist/signal/use-trace.d.ts +5 -0
- package/dist/signal/use-trace.d.ts.map +1 -0
- package/dist/signal/use-trace.js +48 -0
- package/dist/signal/wordmark-art.generated.cjs +375 -0
- package/dist/signal/wordmark-art.generated.d.ts +3 -0
- package/dist/signal/wordmark-art.generated.d.ts.map +1 -0
- package/dist/signal/wordmark-art.generated.js +351 -0
- package/dist/signal/wordmark.cjs +60 -0
- package/dist/signal/wordmark.d.ts +23 -0
- package/dist/signal/wordmark.d.ts.map +1 -0
- package/dist/signal/wordmark.js +34 -0
- package/dist/signal/wordmark.test.cjs +71 -0
- package/dist/signal/wordmark.test.d.ts +2 -0
- package/dist/signal/wordmark.test.d.ts.map +1 -0
- package/dist/signal/wordmark.test.js +70 -0
- package/dist/state/initialState.cjs +0 -3
- package/dist/state/initialState.d.ts.map +1 -1
- package/dist/state/initialState.js +0 -3
- package/dist/state/types.d.ts +13 -7
- package/dist/state/types.d.ts.map +1 -1
- package/dist/utils/approval-response.cjs +45 -0
- package/dist/utils/approval-response.d.ts +14 -0
- package/dist/utils/approval-response.d.ts.map +1 -0
- package/dist/utils/approval-response.js +21 -0
- package/dist/utils/approval-response.test.cjs +49 -0
- package/dist/utils/approval-response.test.d.ts +2 -0
- package/dist/utils/approval-response.test.d.ts.map +1 -0
- package/dist/utils/approval-response.test.js +55 -0
- package/dist/utils/approvalScope.cjs +12 -0
- package/dist/utils/approvalScope.d.ts.map +1 -1
- package/dist/utils/approvalScope.js +12 -0
- package/dist/utils/approvalScope.test.cjs +23 -0
- package/dist/utils/approvalScope.test.d.ts +2 -0
- package/dist/utils/approvalScope.test.d.ts.map +1 -0
- package/dist/utils/approvalScope.test.js +22 -0
- package/dist/utils/background-failure.cjs +51 -0
- package/dist/utils/background-failure.d.ts +12 -0
- package/dist/utils/background-failure.d.ts.map +1 -0
- package/dist/utils/background-failure.js +26 -0
- package/dist/utils/chatgpt-rate-limit.cjs +10 -0
- package/dist/utils/chatgpt-rate-limit.d.ts +9 -0
- package/dist/utils/chatgpt-rate-limit.d.ts.map +1 -1
- package/dist/utils/chatgpt-rate-limit.js +9 -0
- package/dist/utils/chatgpt-rate-limit.test.cjs +10 -0
- package/dist/utils/chatgpt-rate-limit.test.js +11 -0
- package/dist/utils/deck-state.cjs +107 -0
- package/dist/utils/deck-state.d.ts +79 -0
- package/dist/utils/deck-state.d.ts.map +1 -0
- package/dist/utils/deck-state.js +76 -0
- package/dist/utils/deck-state.test.cjs +208 -0
- package/dist/utils/deck-state.test.d.ts +2 -0
- package/dist/utils/deck-state.test.d.ts.map +1 -0
- package/dist/utils/deck-state.test.js +216 -0
- package/dist/utils/fault-block.cjs +37 -0
- package/dist/utils/fault-block.d.ts +13 -0
- package/dist/utils/fault-block.d.ts.map +1 -0
- package/dist/utils/fault-block.js +13 -0
- package/dist/utils/fault-block.test.cjs +23 -0
- package/dist/utils/fault-block.test.d.ts +2 -0
- package/dist/utils/fault-block.test.d.ts.map +1 -0
- package/dist/utils/fault-block.test.js +22 -0
- package/dist/utils/llm-provider-display.cjs +1 -1
- package/dist/utils/llm-provider-display.js +1 -1
- package/dist/utils/messageFormatting.cjs +26 -23
- package/dist/utils/messageFormatting.d.ts +5 -2
- package/dist/utils/messageFormatting.d.ts.map +1 -1
- package/dist/utils/messageFormatting.js +25 -21
- package/dist/utils/messageFormatting.test.cjs +34 -0
- package/dist/utils/messageFormatting.test.js +35 -1
- package/dist/utils/reasoning-variant.cjs +35 -0
- package/dist/utils/reasoning-variant.d.ts +13 -0
- package/dist/utils/reasoning-variant.d.ts.map +1 -0
- package/dist/utils/reasoning-variant.js +11 -0
- package/dist/utils/resize-reflow.cjs +119 -0
- package/dist/utils/resize-reflow.d.ts +18 -0
- package/dist/utils/resize-reflow.d.ts.map +1 -0
- package/dist/utils/resize-reflow.js +83 -0
- package/dist/utils/resize-reflow.test.cjs +100 -0
- package/dist/utils/resize-reflow.test.d.ts +2 -0
- package/dist/utils/resize-reflow.test.d.ts.map +1 -0
- package/dist/utils/resize-reflow.test.js +99 -0
- package/dist/utils/tool-step.cjs +183 -0
- package/dist/utils/tool-step.d.ts +28 -0
- package/dist/utils/tool-step.d.ts.map +1 -0
- package/dist/utils/tool-step.js +156 -0
- package/dist/utils/tool-step.test.cjs +263 -0
- package/dist/utils/tool-step.test.d.ts +2 -0
- package/dist/utils/tool-step.test.d.ts.map +1 -0
- package/dist/utils/tool-step.test.js +262 -0
- package/package.json +9 -5
- package/dist/components/BackgroundTasksPanel.cjs +0 -117
- package/dist/components/BackgroundTasksPanel.d.ts +0 -18
- package/dist/components/BackgroundTasksPanel.d.ts.map +0 -1
- package/dist/components/BackgroundTasksPanel.js +0 -93
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { backgroundFailure, finishedToolStep, toolOutput, toolStep } from "./tool-step.js";
|
|
3
|
+
function tool(overrides) {
|
|
4
|
+
return {
|
|
5
|
+
id: "tool-1",
|
|
6
|
+
role: "tool",
|
|
7
|
+
content: "Read(src/a.ts)",
|
|
8
|
+
timestamp: /* @__PURE__ */ new Date(0),
|
|
9
|
+
toolName: "read_file",
|
|
10
|
+
toolStatus: "finished",
|
|
11
|
+
...overrides
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
describe("toolStep", () => {
|
|
15
|
+
it.each([
|
|
16
|
+
["pending", "queue"],
|
|
17
|
+
["pending_approval", "wait"],
|
|
18
|
+
["running", "run"],
|
|
19
|
+
["finished", "ok"]
|
|
20
|
+
])("maps tool status %s to step state %s", (toolStatus, state) => {
|
|
21
|
+
expect(toolStep(tool({ toolStatus })).state).toBe(state);
|
|
22
|
+
});
|
|
23
|
+
it("marks a failed, a denied and a stopped call", () => {
|
|
24
|
+
expect(toolStep(tool({ isError: true })).state).toBe("fail");
|
|
25
|
+
expect(toolStep(tool({ isError: true, toolOutcome: "denied" })).state).toBe("deny");
|
|
26
|
+
expect(toolStep(tool({ isError: true, toolOutcome: "cancelled" })).state).toBe("stop");
|
|
27
|
+
});
|
|
28
|
+
it.each([
|
|
29
|
+
["read_file", "READ"],
|
|
30
|
+
["write_file", "WRITE"],
|
|
31
|
+
["edit_file", "EDIT"],
|
|
32
|
+
["bash_exec", "RUN"],
|
|
33
|
+
["grep_content", "SEARCH"],
|
|
34
|
+
["glob_files", "GLOB"],
|
|
35
|
+
["spawn_agent", "TASK"],
|
|
36
|
+
["mcp--github--create_pull_request", "MCP"]
|
|
37
|
+
])("names %s as %s", (toolName, verb) => {
|
|
38
|
+
expect(toolStep(tool({ toolName })).verb).toBe(verb);
|
|
39
|
+
});
|
|
40
|
+
it("falls back to the first word of an unknown tool, at most 7 cells", () => {
|
|
41
|
+
expect(toolStep(tool({ toolName: "summarize_everything" })).verb).toBe("SUMMARI");
|
|
42
|
+
});
|
|
43
|
+
it("names an MCP target by server and tool, then its arguments", () => {
|
|
44
|
+
const step = toolStep(
|
|
45
|
+
tool({
|
|
46
|
+
toolName: "mcp--github--create_pull_request",
|
|
47
|
+
content: "Create Pull Request(title=x) [MCP: github]\nOpening the PR",
|
|
48
|
+
toolArgs: "title=x"
|
|
49
|
+
})
|
|
50
|
+
);
|
|
51
|
+
expect(step.target).toBe("github.create_pull_request title=x");
|
|
52
|
+
});
|
|
53
|
+
it("shows file paths relative to the working directory", () => {
|
|
54
|
+
const step = toolStep(tool({ toolArgs: `${process.cwd()}/src/a.ts` }));
|
|
55
|
+
expect(step.target).toBe("src/a.ts");
|
|
56
|
+
});
|
|
57
|
+
it("reads a multi-line command on one row", () => {
|
|
58
|
+
const step = toolStep(tool({ toolName: "bash_exec", toolArgs: "echo a\n echo $(b)" }));
|
|
59
|
+
expect(step.target).toBe("echo a echo $(b)");
|
|
60
|
+
});
|
|
61
|
+
it("sums up an edit, with hunks when there are several", () => {
|
|
62
|
+
const toolDisplayData = {
|
|
63
|
+
type: "diff",
|
|
64
|
+
unified: "@@ -1 +1 @@\n-a\n+b\n@@ -9 +9 @@\n-c\n+d",
|
|
65
|
+
filename: "a.ts",
|
|
66
|
+
additions: 31,
|
|
67
|
+
deletions: 12
|
|
68
|
+
};
|
|
69
|
+
expect(toolStep(tool({ toolDisplayData })).detail).toBe("+31 \u221212 \xB7 2 hunks");
|
|
70
|
+
});
|
|
71
|
+
it("sums up a shell run by lines of output and by exit code", () => {
|
|
72
|
+
const shell = { type: "shell", command: "x", duration: 5, stdout: "a\nb\n" };
|
|
73
|
+
expect(toolStep(tool({ toolDisplayData: { ...shell, exitCode: 0 } })).detail).toBe(
|
|
74
|
+
"2 lines"
|
|
75
|
+
);
|
|
76
|
+
expect(
|
|
77
|
+
toolStep(tool({ isError: true, toolDisplayData: { ...shell, exitCode: 3 } })).detail
|
|
78
|
+
).toBe("exit 3");
|
|
79
|
+
});
|
|
80
|
+
it("sums up a search by hits and files", () => {
|
|
81
|
+
const match = { line: 1, content: "x" };
|
|
82
|
+
const toolDisplayData = {
|
|
83
|
+
type: "search",
|
|
84
|
+
pattern: "x",
|
|
85
|
+
matches: [
|
|
86
|
+
{ ...match, file: "a" },
|
|
87
|
+
{ ...match, file: "a" },
|
|
88
|
+
{ ...match, file: "b" }
|
|
89
|
+
],
|
|
90
|
+
totalMatches: 3,
|
|
91
|
+
truncated: false
|
|
92
|
+
};
|
|
93
|
+
expect(toolStep(tool({ toolDisplayData })).detail).toBe("3 hits \xB7 2 files");
|
|
94
|
+
});
|
|
95
|
+
it("says when a capped search has more than it counted", () => {
|
|
96
|
+
const toolDisplayData = {
|
|
97
|
+
type: "search",
|
|
98
|
+
pattern: "x",
|
|
99
|
+
matches: [{ file: "a", line: 1, content: "x" }],
|
|
100
|
+
totalMatches: 1,
|
|
101
|
+
truncated: true
|
|
102
|
+
};
|
|
103
|
+
expect(toolStep(tool({ toolDisplayData })).detail).toBe("1+ hits \xB7 1+ files");
|
|
104
|
+
});
|
|
105
|
+
it("sums up a file read and a created file", () => {
|
|
106
|
+
const file = { type: "file", path: "a", lineCount: 88 };
|
|
107
|
+
expect(toolStep(tool({ toolDisplayData: { ...file, operation: "read" } })).detail).toBe(
|
|
108
|
+
"88 lines"
|
|
109
|
+
);
|
|
110
|
+
expect(toolStep(tool({ toolDisplayData: { ...file, operation: "create" } })).detail).toBe(
|
|
111
|
+
"new \xB7 88 lines"
|
|
112
|
+
);
|
|
113
|
+
});
|
|
114
|
+
it("says a denied call was denied and counts a sub-agent while it runs", () => {
|
|
115
|
+
expect(toolStep(tool({ isError: true, toolOutcome: "denied" })).detail).toBe("you denied");
|
|
116
|
+
const subAgentProgress = {
|
|
117
|
+
task: "t",
|
|
118
|
+
agentId: "a",
|
|
119
|
+
toolsCalled: 3,
|
|
120
|
+
currentTool: "read_file"
|
|
121
|
+
};
|
|
122
|
+
expect(toolStep(tool({ toolStatus: "running", subAgentProgress })).detail).toBe(
|
|
123
|
+
"3 tools so far"
|
|
124
|
+
);
|
|
125
|
+
});
|
|
126
|
+
it("counts a command that exited nonzero as failed", () => {
|
|
127
|
+
const toolDisplayData = {
|
|
128
|
+
type: "shell",
|
|
129
|
+
command: "x",
|
|
130
|
+
duration: 5,
|
|
131
|
+
exitCode: 2
|
|
132
|
+
};
|
|
133
|
+
expect(toolStep(tool({ toolDisplayData })).state).toBe("fail");
|
|
134
|
+
});
|
|
135
|
+
it("times a shell run from its own duration, and no other tool", () => {
|
|
136
|
+
const toolDisplayData = {
|
|
137
|
+
type: "shell",
|
|
138
|
+
command: "x",
|
|
139
|
+
duration: 4200,
|
|
140
|
+
exitCode: 0
|
|
141
|
+
};
|
|
142
|
+
expect(toolStep(tool({ toolDisplayData })).time).toBe("4.2s");
|
|
143
|
+
expect(toolStep(tool({})).time).toBeNull();
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
describe("toolOutput", () => {
|
|
147
|
+
it("shows nothing for a call that worked", () => {
|
|
148
|
+
expect(toolOutput(tool({ toolResult: "all fine" }))).toEqual([]);
|
|
149
|
+
});
|
|
150
|
+
it("shows the last lines of a failed shell run, stderr first", () => {
|
|
151
|
+
const stderr = Array.from({ length: 9 }, (_, i) => `line ${i}`).join("\n");
|
|
152
|
+
const lines = toolOutput(
|
|
153
|
+
tool({
|
|
154
|
+
isError: true,
|
|
155
|
+
toolDisplayData: {
|
|
156
|
+
type: "shell",
|
|
157
|
+
command: "x",
|
|
158
|
+
exitCode: 1,
|
|
159
|
+
duration: 1,
|
|
160
|
+
stdout: "out",
|
|
161
|
+
stderr
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
);
|
|
165
|
+
expect(lines).toEqual(["line 4", "line 5", "line 6", "line 7", "line 8"]);
|
|
166
|
+
});
|
|
167
|
+
it("keeps the output of a command that exited nonzero", () => {
|
|
168
|
+
const lines = toolOutput(
|
|
169
|
+
tool({
|
|
170
|
+
toolDisplayData: {
|
|
171
|
+
type: "shell",
|
|
172
|
+
command: "x",
|
|
173
|
+
exitCode: 1,
|
|
174
|
+
duration: 1,
|
|
175
|
+
stdout: "expected 1, got 2"
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
);
|
|
179
|
+
expect(lines).toEqual(["expected 1, got 2"]);
|
|
180
|
+
});
|
|
181
|
+
it("shows the error text of any other failed call", () => {
|
|
182
|
+
expect(toolOutput(tool({ isError: true, toolResult: "ENOENT: a.ts\n" }))).toEqual([
|
|
183
|
+
"ENOENT: a.ts"
|
|
184
|
+
]);
|
|
185
|
+
});
|
|
186
|
+
it('reads the message out of a stored {"error":\u2026} result', () => {
|
|
187
|
+
const toolResult = JSON.stringify({ error: "Command failed: exit 3\n" });
|
|
188
|
+
expect(toolOutput(tool({ isError: true, toolResult }))).toEqual(["Command failed: exit 3"]);
|
|
189
|
+
});
|
|
190
|
+
it("prefers the failure text from the live event", () => {
|
|
191
|
+
const message = tool({
|
|
192
|
+
isError: true,
|
|
193
|
+
toolResult: '{"error":"cut off',
|
|
194
|
+
toolFailureText: "Command failed: exit 3"
|
|
195
|
+
});
|
|
196
|
+
expect(toolOutput(message)).toEqual(["Command failed: exit 3"]);
|
|
197
|
+
});
|
|
198
|
+
it("stays quiet for a denied or stopped call", () => {
|
|
199
|
+
const cancelled = { isError: true, toolResult: "Cancelled" };
|
|
200
|
+
expect(toolOutput(tool({ ...cancelled, toolOutcome: "denied" }))).toEqual([]);
|
|
201
|
+
expect(toolOutput(tool({ ...cancelled, toolOutcome: "cancelled" }))).toEqual([]);
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
describe("backgroundFailure", () => {
|
|
205
|
+
it("reads a failed bash_output as a failed row with its output", () => {
|
|
206
|
+
const failure = backgroundFailure("bash_output", {
|
|
207
|
+
status: "failed",
|
|
208
|
+
stderr: "boom",
|
|
209
|
+
stdout: "out",
|
|
210
|
+
exit_code: 2
|
|
211
|
+
});
|
|
212
|
+
expect(failure).toEqual({ toolOutcome: "failed", toolFailureText: "boom" });
|
|
213
|
+
const message = tool({ toolName: "bash_output", ...failure });
|
|
214
|
+
expect(toolStep(message).state).toBe("fail");
|
|
215
|
+
expect(toolOutput(message)).toEqual(["boom"]);
|
|
216
|
+
});
|
|
217
|
+
it("falls back to the exit code when there is no output", () => {
|
|
218
|
+
expect(
|
|
219
|
+
backgroundFailure("bash_output", { status: "failed", stderr: "", exit_code: 2 })
|
|
220
|
+
).toEqual({ toolOutcome: "failed", toolFailureText: "exit 2" });
|
|
221
|
+
});
|
|
222
|
+
it("ignores a running or completed process and any other tool", () => {
|
|
223
|
+
expect(backgroundFailure("bash_output", { status: "completed" })).toEqual({});
|
|
224
|
+
expect(backgroundFailure("read_file", { status: "failed" })).toEqual({});
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
describe("finishedToolStep", () => {
|
|
228
|
+
it("builds the row from the call itself", () => {
|
|
229
|
+
const { step, output } = finishedToolStep({
|
|
230
|
+
toolName: "bash_exec",
|
|
231
|
+
args: { command: "make" },
|
|
232
|
+
presentationSnapshot: {
|
|
233
|
+
version: 1,
|
|
234
|
+
source: { type: "local" },
|
|
235
|
+
header: { title: "Bash", argsText: "make" }
|
|
236
|
+
},
|
|
237
|
+
success: true
|
|
238
|
+
});
|
|
239
|
+
expect(step.verb).toBe("RUN");
|
|
240
|
+
expect(step.target).toBe("make");
|
|
241
|
+
expect(step.state).toBe("ok");
|
|
242
|
+
expect(output).toEqual([]);
|
|
243
|
+
});
|
|
244
|
+
it("carries why a call failed, including a failed background readback", () => {
|
|
245
|
+
const failed = finishedToolStep({
|
|
246
|
+
toolName: "read_file",
|
|
247
|
+
args: {},
|
|
248
|
+
success: false,
|
|
249
|
+
error: "ENOENT"
|
|
250
|
+
});
|
|
251
|
+
expect(failed.step.state).toBe("fail");
|
|
252
|
+
expect(failed.output).toEqual(["ENOENT"]);
|
|
253
|
+
const readback = finishedToolStep({
|
|
254
|
+
toolName: "bash_output",
|
|
255
|
+
args: {},
|
|
256
|
+
success: true,
|
|
257
|
+
rawResult: { status: "failed", stderr: "boom" }
|
|
258
|
+
});
|
|
259
|
+
expect(readback.step.state).toBe("fail");
|
|
260
|
+
expect(readback.output).toEqual(["boom"]);
|
|
261
|
+
});
|
|
262
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexto/tui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0-beta.1",
|
|
4
4
|
"description": "Interactive terminal UI for Dexto CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./tool-step": {
|
|
14
|
+
"types": "./dist/utils/tool-step.d.ts",
|
|
15
|
+
"import": "./dist/utils/tool-step.js"
|
|
12
16
|
}
|
|
13
17
|
},
|
|
14
18
|
"files": [
|
|
@@ -28,10 +32,10 @@
|
|
|
28
32
|
"string-width": "^8.1.0",
|
|
29
33
|
"strip-ansi": "^7.1.2",
|
|
30
34
|
"wrap-ansi": "^9.0.2",
|
|
31
|
-
"@dexto/agent-management": "1.
|
|
32
|
-
"@dexto/core": "1.14.
|
|
33
|
-
"@dexto/llm": "1.14.
|
|
34
|
-
"@dexto/registry": "1.14.
|
|
35
|
+
"@dexto/agent-management": "1.15.0-beta.1",
|
|
36
|
+
"@dexto/core": "1.14.4",
|
|
37
|
+
"@dexto/llm": "1.14.4",
|
|
38
|
+
"@dexto/registry": "1.14.4"
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
41
|
"@types/react": "^19.0.0",
|
|
@@ -1,117 +0,0 @@
|
|
|
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 BackgroundTasksPanel_exports = {};
|
|
20
|
-
__export(BackgroundTasksPanel_exports, {
|
|
21
|
-
BackgroundTasksPanel: () => BackgroundTasksPanel
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(BackgroundTasksPanel_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
-
var import_ink = require("ink");
|
|
26
|
-
function padText(value, width) {
|
|
27
|
-
if (value.length >= width) return value.slice(0, width - 1) + "\u2026";
|
|
28
|
-
return value.padEnd(width, " ");
|
|
29
|
-
}
|
|
30
|
-
function formatStatus(status) {
|
|
31
|
-
switch (status) {
|
|
32
|
-
case "running":
|
|
33
|
-
return "running";
|
|
34
|
-
case "completed":
|
|
35
|
-
return "done";
|
|
36
|
-
case "failed":
|
|
37
|
-
return "failed";
|
|
38
|
-
case "cancelled":
|
|
39
|
-
return "cancelled";
|
|
40
|
-
default:
|
|
41
|
-
return status;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function BackgroundTasksPanel({
|
|
45
|
-
tasks,
|
|
46
|
-
isExpanded,
|
|
47
|
-
isProcessing = false
|
|
48
|
-
}) {
|
|
49
|
-
if (!isExpanded) return null;
|
|
50
|
-
const sortedTasks = [...tasks].sort((a, b) => {
|
|
51
|
-
if (a.status === b.status) return 0;
|
|
52
|
-
if (a.status === "running") return -1;
|
|
53
|
-
if (b.status === "running") return 1;
|
|
54
|
-
return a.status.localeCompare(b.status);
|
|
55
|
-
});
|
|
56
|
-
const runningCount = tasks.filter((task) => task.status === "running").length;
|
|
57
|
-
const totalCount = tasks.length;
|
|
58
|
-
const headerText = `\u{1F9F5} Background Tasks (${runningCount}/${totalCount} running)`;
|
|
59
|
-
if (totalCount === 0) {
|
|
60
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
61
|
-
import_ink.Box,
|
|
62
|
-
{
|
|
63
|
-
flexDirection: "column",
|
|
64
|
-
borderStyle: isProcessing ? void 0 : "round",
|
|
65
|
-
borderColor: "gray",
|
|
66
|
-
paddingX: 1,
|
|
67
|
-
marginX: 1,
|
|
68
|
-
marginBottom: 1,
|
|
69
|
-
children: [
|
|
70
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { bold: true, color: "cyan", children: headerText }),
|
|
71
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", dimColor: true, children: "No background tasks" })
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
const statusWidth = 10;
|
|
77
|
-
const idWidth = 14;
|
|
78
|
-
const descWidth = 48;
|
|
79
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
80
|
-
import_ink.Box,
|
|
81
|
-
{
|
|
82
|
-
flexDirection: "column",
|
|
83
|
-
borderStyle: isProcessing ? void 0 : "round",
|
|
84
|
-
borderColor: "gray",
|
|
85
|
-
paddingX: 1,
|
|
86
|
-
marginX: 1,
|
|
87
|
-
marginBottom: 1,
|
|
88
|
-
children: [
|
|
89
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { children: [
|
|
90
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { bold: true, color: "cyan", children: headerText }),
|
|
91
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", dimColor: true, children: [
|
|
92
|
-
" ",
|
|
93
|
-
"\xB7 ctrl+b to hide bg tasks"
|
|
94
|
-
] })
|
|
95
|
-
] }),
|
|
96
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", children: [
|
|
97
|
-
padText("status", statusWidth),
|
|
98
|
-
padText("task id", idWidth),
|
|
99
|
-
padText("description", descWidth)
|
|
100
|
-
] }) }),
|
|
101
|
-
sortedTasks.map((task) => {
|
|
102
|
-
const status = formatStatus(task.status);
|
|
103
|
-
const desc = task.description ?? "";
|
|
104
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: task.status === "running" ? "yellow" : "gray", children: [
|
|
105
|
-
padText(status, statusWidth),
|
|
106
|
-
padText(task.taskId, idWidth),
|
|
107
|
-
padText(desc, descWidth)
|
|
108
|
-
] }) }, task.taskId);
|
|
109
|
-
})
|
|
110
|
-
]
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
115
|
-
0 && (module.exports = {
|
|
116
|
-
BackgroundTasksPanel
|
|
117
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BackgroundTasksPanel Component
|
|
3
|
-
*
|
|
4
|
-
* Displays background task status in a compact table.
|
|
5
|
-
*/
|
|
6
|
-
interface BackgroundTaskItem {
|
|
7
|
-
taskId: string;
|
|
8
|
-
status: 'running' | 'completed' | 'failed' | 'cancelled';
|
|
9
|
-
description?: string;
|
|
10
|
-
}
|
|
11
|
-
interface BackgroundTasksPanelProps {
|
|
12
|
-
tasks: BackgroundTaskItem[];
|
|
13
|
-
isExpanded: boolean;
|
|
14
|
-
isProcessing?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare function BackgroundTasksPanel({ tasks, isExpanded, isProcessing, }: BackgroundTasksPanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=BackgroundTasksPanel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundTasksPanel.d.ts","sourceRoot":"","sources":["../../src/components/BackgroundTasksPanel.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,UAAU,kBAAkB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,yBAAyB;IAC/B,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAsBD,wBAAgB,oBAAoB,CAAC,EACjC,KAAK,EACL,UAAU,EACV,YAAoB,GACvB,EAAE,yBAAyB,kDA+E3B"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
function padText(value, width) {
|
|
4
|
-
if (value.length >= width) return value.slice(0, width - 1) + "\u2026";
|
|
5
|
-
return value.padEnd(width, " ");
|
|
6
|
-
}
|
|
7
|
-
function formatStatus(status) {
|
|
8
|
-
switch (status) {
|
|
9
|
-
case "running":
|
|
10
|
-
return "running";
|
|
11
|
-
case "completed":
|
|
12
|
-
return "done";
|
|
13
|
-
case "failed":
|
|
14
|
-
return "failed";
|
|
15
|
-
case "cancelled":
|
|
16
|
-
return "cancelled";
|
|
17
|
-
default:
|
|
18
|
-
return status;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function BackgroundTasksPanel({
|
|
22
|
-
tasks,
|
|
23
|
-
isExpanded,
|
|
24
|
-
isProcessing = false
|
|
25
|
-
}) {
|
|
26
|
-
if (!isExpanded) return null;
|
|
27
|
-
const sortedTasks = [...tasks].sort((a, b) => {
|
|
28
|
-
if (a.status === b.status) return 0;
|
|
29
|
-
if (a.status === "running") return -1;
|
|
30
|
-
if (b.status === "running") return 1;
|
|
31
|
-
return a.status.localeCompare(b.status);
|
|
32
|
-
});
|
|
33
|
-
const runningCount = tasks.filter((task) => task.status === "running").length;
|
|
34
|
-
const totalCount = tasks.length;
|
|
35
|
-
const headerText = `\u{1F9F5} Background Tasks (${runningCount}/${totalCount} running)`;
|
|
36
|
-
if (totalCount === 0) {
|
|
37
|
-
return /* @__PURE__ */ jsxs(
|
|
38
|
-
Box,
|
|
39
|
-
{
|
|
40
|
-
flexDirection: "column",
|
|
41
|
-
borderStyle: isProcessing ? void 0 : "round",
|
|
42
|
-
borderColor: "gray",
|
|
43
|
-
paddingX: 1,
|
|
44
|
-
marginX: 1,
|
|
45
|
-
marginBottom: 1,
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ jsx(Text, { bold: true, color: "cyan", children: headerText }),
|
|
48
|
-
/* @__PURE__ */ jsx(Text, { color: "gray", dimColor: true, children: "No background tasks" })
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
const statusWidth = 10;
|
|
54
|
-
const idWidth = 14;
|
|
55
|
-
const descWidth = 48;
|
|
56
|
-
return /* @__PURE__ */ jsxs(
|
|
57
|
-
Box,
|
|
58
|
-
{
|
|
59
|
-
flexDirection: "column",
|
|
60
|
-
borderStyle: isProcessing ? void 0 : "round",
|
|
61
|
-
borderColor: "gray",
|
|
62
|
-
paddingX: 1,
|
|
63
|
-
marginX: 1,
|
|
64
|
-
marginBottom: 1,
|
|
65
|
-
children: [
|
|
66
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
67
|
-
/* @__PURE__ */ jsx(Text, { bold: true, color: "cyan", children: headerText }),
|
|
68
|
-
/* @__PURE__ */ jsxs(Text, { color: "gray", dimColor: true, children: [
|
|
69
|
-
" ",
|
|
70
|
-
"\xB7 ctrl+b to hide bg tasks"
|
|
71
|
-
] })
|
|
72
|
-
] }),
|
|
73
|
-
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text, { color: "gray", children: [
|
|
74
|
-
padText("status", statusWidth),
|
|
75
|
-
padText("task id", idWidth),
|
|
76
|
-
padText("description", descWidth)
|
|
77
|
-
] }) }),
|
|
78
|
-
sortedTasks.map((task) => {
|
|
79
|
-
const status = formatStatus(task.status);
|
|
80
|
-
const desc = task.description ?? "";
|
|
81
|
-
return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text, { color: task.status === "running" ? "yellow" : "gray", children: [
|
|
82
|
-
padText(status, statusWidth),
|
|
83
|
-
padText(task.taskId, idWidth),
|
|
84
|
-
padText(desc, descWidth)
|
|
85
|
-
] }) }, task.taskId);
|
|
86
|
-
})
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
export {
|
|
92
|
-
BackgroundTasksPanel
|
|
93
|
-
};
|