@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
|
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(MultiLineInput_exports);
|
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
var import_ink = require("ink");
|
|
27
|
+
var import_signal = require("../signal/index.js");
|
|
27
28
|
function MultiLineInput({ value, placeholder, prompt = "> " }) {
|
|
28
29
|
const lines = (0, import_react.useMemo)(() => {
|
|
29
30
|
if (!value) return [];
|
|
@@ -32,14 +33,14 @@ function MultiLineInput({ value, placeholder, prompt = "> " }) {
|
|
|
32
33
|
const lineCount = lines.length;
|
|
33
34
|
if (!value && placeholder) {
|
|
34
35
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "row", children: [
|
|
35
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
36
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("add"), bold: true, children: prompt }),
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: placeholder })
|
|
37
38
|
] });
|
|
38
39
|
}
|
|
39
40
|
const visibleLines = lineCount > 10 ? lines.slice(-10) : lines;
|
|
40
41
|
const startOffset = lineCount > 10 ? lineCount - 10 : 0;
|
|
41
42
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", children: [
|
|
42
|
-
startOffset > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "
|
|
43
|
+
startOffset > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: [
|
|
43
44
|
"... (",
|
|
44
45
|
startOffset,
|
|
45
46
|
" more lines above)"
|
|
@@ -47,8 +48,8 @@ function MultiLineInput({ value, placeholder, prompt = "> " }) {
|
|
|
47
48
|
visibleLines.map((line, index) => {
|
|
48
49
|
const actualIndex = startOffset + index;
|
|
49
50
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "row", children: [
|
|
50
|
-
index === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
51
|
-
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
51
|
+
index === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("add"), bold: true, children: prompt }),
|
|
52
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("add"), children: " ".repeat(prompt.length) }),
|
|
52
53
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { wrap: "wrap", children: line || " " })
|
|
53
54
|
] }, actualIndex);
|
|
54
55
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiLineInput.d.ts","sourceRoot":"","sources":["../../src/components/MultiLineInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MultiLineInput.d.ts","sourceRoot":"","sources":["../../src/components/MultiLineInput.tsx"],"names":[],"mappings":"AAIA,UAAU,mBAAmB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,MAAa,EAAE,EAAE,mBAAmB,2CAgDhG"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { Box, Text } from "ink";
|
|
4
|
+
import { tone } from "../signal/index.js";
|
|
4
5
|
function MultiLineInput({ value, placeholder, prompt = "> " }) {
|
|
5
6
|
const lines = useMemo(() => {
|
|
6
7
|
if (!value) return [];
|
|
@@ -9,14 +10,14 @@ function MultiLineInput({ value, placeholder, prompt = "> " }) {
|
|
|
9
10
|
const lineCount = lines.length;
|
|
10
11
|
if (!value && placeholder) {
|
|
11
12
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "row", children: [
|
|
12
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
13
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
13
|
+
/* @__PURE__ */ jsx(Text, { color: tone("add"), bold: true, children: prompt }),
|
|
14
|
+
/* @__PURE__ */ jsx(Text, { color: tone("dim"), children: placeholder })
|
|
14
15
|
] });
|
|
15
16
|
}
|
|
16
17
|
const visibleLines = lineCount > 10 ? lines.slice(-10) : lines;
|
|
17
18
|
const startOffset = lineCount > 10 ? lineCount - 10 : 0;
|
|
18
19
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
19
|
-
startOffset > 0 && /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text, { color: "
|
|
20
|
+
startOffset > 0 && /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text, { color: tone("dim"), children: [
|
|
20
21
|
"... (",
|
|
21
22
|
startOffset,
|
|
22
23
|
" more lines above)"
|
|
@@ -24,8 +25,8 @@ function MultiLineInput({ value, placeholder, prompt = "> " }) {
|
|
|
24
25
|
visibleLines.map((line, index) => {
|
|
25
26
|
const actualIndex = startOffset + index;
|
|
26
27
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "row", children: [
|
|
27
|
-
index === 0 && /* @__PURE__ */ jsx(Text, { color: "
|
|
28
|
-
index > 0 && /* @__PURE__ */ jsx(Text, { color: "
|
|
28
|
+
index === 0 && /* @__PURE__ */ jsx(Text, { color: tone("add"), bold: true, children: prompt }),
|
|
29
|
+
index > 0 && /* @__PURE__ */ jsx(Text, { color: tone("add"), children: " ".repeat(prompt.length) }),
|
|
29
30
|
/* @__PURE__ */ jsx(Text, { wrap: "wrap", children: line || " " })
|
|
30
31
|
] }, actualIndex);
|
|
31
32
|
})
|
|
@@ -39,6 +39,7 @@ var import_messageFormatting = require("../utils/messageFormatting.js");
|
|
|
39
39
|
var import_useTerminalSize = require("../hooks/useTerminalSize.js");
|
|
40
40
|
var import_overlaySizing = require("../utils/overlaySizing.js");
|
|
41
41
|
var import_agent_backend = require("../agent-backend.js");
|
|
42
|
+
var import_signal = require("../signal/index.js");
|
|
42
43
|
function getResourceMatchScore(resource, query) {
|
|
43
44
|
if (!query) return 3;
|
|
44
45
|
const lowerQuery = query.toLowerCase();
|
|
@@ -314,10 +315,10 @@ const ResourceAutocompleteInner = (0, import_react.forwardRef)(
|
|
|
314
315
|
);
|
|
315
316
|
if (!isVisible) return null;
|
|
316
317
|
if (isLoading) {
|
|
317
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: "Loading resources..." }) });
|
|
318
319
|
}
|
|
319
320
|
if (displayItems.length === 0) {
|
|
320
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: mentionQuery ? `No resources match "${mentionQuery}"` : "No resources available. Connect an MCP server or enable internal resources." }) });
|
|
321
322
|
}
|
|
322
323
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", width: terminalWidth, paddingLeft: 2, children: visibleResources.map((item, visibleIndex) => {
|
|
323
324
|
const actualIndex = scrollOffset + visibleIndex;
|
|
@@ -328,12 +329,12 @@ const ResourceAutocompleteInner = (0, import_react.forwardRef)(
|
|
|
328
329
|
);
|
|
329
330
|
const isImage = item.resource?.mimeType?.startsWith("image/");
|
|
330
331
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { children: [
|
|
331
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: isSelected ? "
|
|
332
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: isSelected ? (0, import_signal.tone)("teal") : (0, import_signal.tone)("dim"), children: isSelected ? "\u276F " : " " }),
|
|
332
333
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
333
334
|
import_ink.Text,
|
|
334
335
|
{
|
|
335
336
|
wrap: "truncate-end",
|
|
336
|
-
color: isSelected ? "
|
|
337
|
+
color: isSelected ? (0, import_signal.tone)("teal") : (0, import_signal.tone)("hi"),
|
|
337
338
|
bold: isSelected,
|
|
338
339
|
children: [
|
|
339
340
|
isImage && "\u{1F5BC}\uFE0F ",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceAutocomplete.d.ts","sourceRoot":"","sources":["../../src/components/ResourceAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ResourceAutocomplete.d.ts","sourceRoot":"","sources":["../../src/components/ResourceAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG9E,MAAM,WAAW,0BAA0B;IACvC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED,UAAU,yBAAyB;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACvD,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,eAAe,CAAC;CAC1B;AAsFD;;GAEG;AACH,QAAA,MAAM,yBAAyB,8GAmY9B,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,oBAAoB,EAErB,OAAO,yBAAyB,CAAC;AAEtC,eAAe,oBAAoB,CAAC"}
|
|
@@ -14,6 +14,7 @@ import { centerTruncatePath } from "../utils/messageFormatting.js";
|
|
|
14
14
|
import { useTerminalSize } from "../hooks/useTerminalSize.js";
|
|
15
15
|
import { getMaxVisibleItemsForTerminalRows } from "../utils/overlaySizing.js";
|
|
16
16
|
import { supportsResources } from "../agent-backend.js";
|
|
17
|
+
import { tone } from "../signal/index.js";
|
|
17
18
|
function getResourceMatchScore(resource, query) {
|
|
18
19
|
if (!query) return 3;
|
|
19
20
|
const lowerQuery = query.toLowerCase();
|
|
@@ -289,10 +290,10 @@ const ResourceAutocompleteInner = forwardRef(
|
|
|
289
290
|
);
|
|
290
291
|
if (!isVisible) return null;
|
|
291
292
|
if (isLoading) {
|
|
292
|
-
return /* @__PURE__ */ jsx(Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ jsx(Text, { color: "
|
|
293
|
+
return /* @__PURE__ */ jsx(Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: "Loading resources..." }) });
|
|
293
294
|
}
|
|
294
295
|
if (displayItems.length === 0) {
|
|
295
|
-
return /* @__PURE__ */ jsx(Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ jsx(Text, { color: "
|
|
296
|
+
return /* @__PURE__ */ jsx(Box, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: mentionQuery ? `No resources match "${mentionQuery}"` : "No resources available. Connect an MCP server or enable internal resources." }) });
|
|
296
297
|
}
|
|
297
298
|
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", width: terminalWidth, paddingLeft: 2, children: visibleResources.map((item, visibleIndex) => {
|
|
298
299
|
const actualIndex = scrollOffset + visibleIndex;
|
|
@@ -303,12 +304,12 @@ const ResourceAutocompleteInner = forwardRef(
|
|
|
303
304
|
);
|
|
304
305
|
const isImage = item.resource?.mimeType?.startsWith("image/");
|
|
305
306
|
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
306
|
-
/* @__PURE__ */ jsx(Text, { color: isSelected ? "
|
|
307
|
+
/* @__PURE__ */ jsx(Text, { color: isSelected ? tone("teal") : tone("dim"), children: isSelected ? "\u276F " : " " }),
|
|
307
308
|
/* @__PURE__ */ jsxs(
|
|
308
309
|
Text,
|
|
309
310
|
{
|
|
310
311
|
wrap: "truncate-end",
|
|
311
|
-
color: isSelected ? "
|
|
312
|
+
color: isSelected ? tone("teal") : tone("hi"),
|
|
312
313
|
bold: isSelected,
|
|
313
314
|
children: [
|
|
314
315
|
isImage && "\u{1F5BC}\uFE0F ",
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var import_react = require("react");
|
|
3
|
+
var import_core = require("@dexto/core");
|
|
4
|
+
var import_vitest = require("vitest");
|
|
5
|
+
var import_signal = require("../signal/index.js");
|
|
6
|
+
var import_harness = require("../signal/harness.js");
|
|
7
|
+
var import_ink = require("ink");
|
|
8
|
+
var import_node_stream = require("node:stream");
|
|
9
|
+
var import_ApprovalPrompt = require("./ApprovalPrompt.js");
|
|
10
|
+
const TEXT_ONLY = { columns: 100, terminal: "no-color" };
|
|
11
|
+
function request(overrides) {
|
|
12
|
+
return {
|
|
13
|
+
approvalId: "a1",
|
|
14
|
+
type: import_core.ApprovalType.TOOL_APPROVAL,
|
|
15
|
+
sessionId: "s1",
|
|
16
|
+
timestamp: /* @__PURE__ */ new Date(0),
|
|
17
|
+
metadata: {},
|
|
18
|
+
...overrides
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const SHELL = request({
|
|
22
|
+
metadata: {
|
|
23
|
+
toolName: "bash_exec",
|
|
24
|
+
args: { command: "make migrate" },
|
|
25
|
+
description: "Applies the pending migration",
|
|
26
|
+
displayPreview: { type: "shell", command: "make migrate", exitCode: 0, duration: 0 }
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
function prompt(approval) {
|
|
30
|
+
return (0, import_react.createElement)(import_ApprovalPrompt.ApprovalPrompt, {
|
|
31
|
+
approval,
|
|
32
|
+
onApprove: () => {
|
|
33
|
+
},
|
|
34
|
+
onDeny: () => {
|
|
35
|
+
},
|
|
36
|
+
onCancel: () => {
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const QUESTION = request({
|
|
41
|
+
type: "elicitation",
|
|
42
|
+
metadata: {
|
|
43
|
+
schema: {
|
|
44
|
+
type: "object",
|
|
45
|
+
properties: {
|
|
46
|
+
how_long: {
|
|
47
|
+
type: "string",
|
|
48
|
+
enum: ["One release", "Two releases"],
|
|
49
|
+
title: "How long?"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
required: ["how_long"]
|
|
53
|
+
},
|
|
54
|
+
prompt: "Pick one"
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
(0, import_vitest.describe)("approvalGateTitle", () => {
|
|
58
|
+
import_vitest.it.each([
|
|
59
|
+
["bash_exec", "NEEDS YOU \xB7 RUN A COMMAND"],
|
|
60
|
+
["edit_file", "NEEDS YOU \xB7 EDIT A FILE"],
|
|
61
|
+
["write_file", "NEEDS YOU \xB7 WRITE A FILE"],
|
|
62
|
+
["plan_review", "NEEDS YOU \xB7 REVIEW THE PLAN"],
|
|
63
|
+
["mcp--github--merge", "NEEDS YOU \xB7 USE A TOOL"]
|
|
64
|
+
])("names %s", (toolName, title) => {
|
|
65
|
+
(0, import_vitest.expect)((0, import_ApprovalPrompt.approvalGateTitle)(import_core.ApprovalType.TOOL_APPROVAL, toolName)).toBe(title);
|
|
66
|
+
});
|
|
67
|
+
(0, import_vitest.it)("treats a command approval as a command, whatever the tool", () => {
|
|
68
|
+
(0, import_vitest.expect)((0, import_ApprovalPrompt.approvalGateTitle)(import_core.ApprovalType.COMMAND_APPROVAL, void 0)).toBe(
|
|
69
|
+
"NEEDS YOU \xB7 RUN A COMMAND"
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
(0, import_vitest.describe)("Signal approval gate", () => {
|
|
74
|
+
(0, import_vitest.it)("frames the command, why, and the keys to answer with", () => {
|
|
75
|
+
const frame = (0, import_harness.renderFrame)(prompt(SHELL), TEXT_ONLY);
|
|
76
|
+
(0, import_vitest.expect)(frame).toContain("NEEDS YOU \xB7 RUN A COMMAND");
|
|
77
|
+
(0, import_vitest.expect)(frame).toContain("$ make migrate");
|
|
78
|
+
(0, import_vitest.expect)(frame).toContain("Applies the pending migration");
|
|
79
|
+
(0, import_vitest.expect)(frame).toMatch(/› {2}y {2}Allow once/);
|
|
80
|
+
(0, import_vitest.expect)(frame).toMatch(/ a {2}Allow .* for this session/);
|
|
81
|
+
(0, import_vitest.expect)(frame).toMatch(/ n {2}Reject/);
|
|
82
|
+
});
|
|
83
|
+
(0, import_vitest.it)("answers on the option keys", () => {
|
|
84
|
+
const saved = (0, import_signal.getCaps)();
|
|
85
|
+
(0, import_signal.setCaps)({ ...saved, palette: "signal" });
|
|
86
|
+
const onApprove = import_vitest.vi.fn();
|
|
87
|
+
const onDeny = import_vitest.vi.fn();
|
|
88
|
+
const ref = (0, import_react.createRef)();
|
|
89
|
+
const stdout = Object.assign(new import_node_stream.PassThrough(), { columns: 100, rows: 40 });
|
|
90
|
+
const view = (0, import_ink.render)(
|
|
91
|
+
(0, import_react.createElement)(import_ApprovalPrompt.ApprovalPrompt, {
|
|
92
|
+
ref,
|
|
93
|
+
approval: SHELL,
|
|
94
|
+
onApprove,
|
|
95
|
+
onDeny,
|
|
96
|
+
onCancel: () => {
|
|
97
|
+
}
|
|
98
|
+
}),
|
|
99
|
+
{ stdout, debug: true, patchConsole: false }
|
|
100
|
+
);
|
|
101
|
+
const noKey = {};
|
|
102
|
+
try {
|
|
103
|
+
(0, import_vitest.expect)(ref.current?.handleInput("y", noKey)).toBe(true);
|
|
104
|
+
(0, import_vitest.expect)(onApprove).toHaveBeenLastCalledWith({});
|
|
105
|
+
(0, import_vitest.expect)(ref.current?.handleInput("a", noKey)).toBe(true);
|
|
106
|
+
(0, import_vitest.expect)(onApprove).toHaveBeenLastCalledWith({ rememberChoice: true });
|
|
107
|
+
(0, import_vitest.expect)(ref.current?.handleInput("n", noKey)).toBe(true);
|
|
108
|
+
(0, import_vitest.expect)(onDeny).toHaveBeenCalledTimes(1);
|
|
109
|
+
(0, import_vitest.expect)(ref.current?.handleInput("x", noKey)).toBe(false);
|
|
110
|
+
} finally {
|
|
111
|
+
view.unmount();
|
|
112
|
+
(0, import_signal.setCaps)(saved);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
(0, import_vitest.it)("asks a question inside the gate, with numbered options and no padding rows", () => {
|
|
116
|
+
const frame = (0, import_harness.renderFrame)(prompt(QUESTION), TEXT_ONLY);
|
|
117
|
+
(0, import_vitest.expect)(frame).toContain("QUESTION \xB7 ");
|
|
118
|
+
(0, import_vitest.expect)(frame).toMatch(/› 1 {2}One release/);
|
|
119
|
+
(0, import_vitest.expect)(frame).toMatch(/ {2}2 {2}Two releases/);
|
|
120
|
+
(0, import_vitest.expect)(frame).not.toMatch(/│ +│/);
|
|
121
|
+
});
|
|
122
|
+
(0, import_vitest.it)("marks the selected option without relying on colour", () => {
|
|
123
|
+
const frame = (0, import_harness.renderFrame)(prompt(SHELL), TEXT_ONLY);
|
|
124
|
+
(0, import_vitest.expect)(frame.match(/›/g)).toHaveLength(1);
|
|
125
|
+
});
|
|
126
|
+
(0, import_vitest.it)("keeps long question help to two rows", () => {
|
|
127
|
+
const help = "word ".repeat(200).trim();
|
|
128
|
+
const properties = {
|
|
129
|
+
how_long: { type: "string", enum: ["One"], title: "How long?", description: help }
|
|
130
|
+
};
|
|
131
|
+
const metadata = { ...QUESTION.metadata, schema: { type: "object", properties } };
|
|
132
|
+
const frame = (0, import_harness.renderFrame)(prompt({ ...QUESTION, metadata }), TEXT_ONLY);
|
|
133
|
+
(0, import_vitest.expect)(frame.split("\n").filter((line) => line.includes("word")).length).toBeLessThan(3);
|
|
134
|
+
});
|
|
135
|
+
(0, import_vitest.it)("fits an edit preview inside the frame", () => {
|
|
136
|
+
const unified = `@@ -1 +1 @@
|
|
137
|
+
+${"x ".repeat(200)}`;
|
|
138
|
+
const frame = (0, import_harness.renderFrame)(
|
|
139
|
+
prompt(
|
|
140
|
+
request({
|
|
141
|
+
metadata: {
|
|
142
|
+
toolName: "edit_file",
|
|
143
|
+
args: {},
|
|
144
|
+
displayPreview: {
|
|
145
|
+
type: "diff",
|
|
146
|
+
unified,
|
|
147
|
+
filename: "a.ts",
|
|
148
|
+
additions: 1,
|
|
149
|
+
deletions: 0
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
),
|
|
154
|
+
TEXT_ONLY
|
|
155
|
+
);
|
|
156
|
+
for (const line of frame.split("\n")) {
|
|
157
|
+
if (line.includes("x x")) (0, import_vitest.expect)(line.trimEnd().endsWith("\u2502")).toBe(true);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
(0, import_vitest.it)("says a command will run in the background", () => {
|
|
161
|
+
const preview = { type: "shell", command: "x", exitCode: 0, duration: 0 };
|
|
162
|
+
const metadata = {
|
|
163
|
+
toolName: "bash_exec",
|
|
164
|
+
args: {},
|
|
165
|
+
displayPreview: { ...preview, isBackground: true }
|
|
166
|
+
};
|
|
167
|
+
(0, import_vitest.expect)((0, import_harness.renderFrame)(prompt(request({ metadata })), TEXT_ONLY)).toContain("(background)");
|
|
168
|
+
});
|
|
169
|
+
(0, import_vitest.it)("wraps question help to the width inside the gate, losing nothing mid-text", () => {
|
|
170
|
+
const help = "word ".repeat(20).trim();
|
|
171
|
+
const properties = {
|
|
172
|
+
how_long: { type: "string", enum: ["One"], title: "How long?", description: help }
|
|
173
|
+
};
|
|
174
|
+
const metadata = { ...QUESTION.metadata, schema: { type: "object", properties } };
|
|
175
|
+
const frame = (0, import_harness.renderFrame)(prompt({ ...QUESTION, metadata }), {
|
|
176
|
+
columns: 80,
|
|
177
|
+
terminal: "no-color"
|
|
178
|
+
});
|
|
179
|
+
const rows = frame.split("\n").filter((line) => line.includes("word"));
|
|
180
|
+
(0, import_vitest.expect)(rows.join(" ").match(/word/g)).toHaveLength(20);
|
|
181
|
+
});
|
|
182
|
+
(0, import_vitest.it)("names the file an edit approval would change", () => {
|
|
183
|
+
const metadata = {
|
|
184
|
+
toolName: "edit_file",
|
|
185
|
+
args: {},
|
|
186
|
+
displayPreview: {
|
|
187
|
+
type: "diff",
|
|
188
|
+
unified: "@@ -1 +1 @@\n-a\n+b",
|
|
189
|
+
filename: `${process.cwd()}/src/token.ts`,
|
|
190
|
+
additions: 1,
|
|
191
|
+
deletions: 1
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
(0, import_vitest.expect)((0, import_harness.renderFrame)(prompt(request({ metadata })), TEXT_ONLY)).toContain(
|
|
195
|
+
"src/token.ts +1 \u22121"
|
|
196
|
+
);
|
|
197
|
+
});
|
|
198
|
+
(0, import_vitest.it)("words a directory approval and keeps a wrapped option under its label", () => {
|
|
199
|
+
const metadata = {
|
|
200
|
+
toolName: "edit_file",
|
|
201
|
+
args: {},
|
|
202
|
+
approvalKey: `directory:/tmp/${"long/".repeat(14)}outside:operation:edit`
|
|
203
|
+
};
|
|
204
|
+
const frame = (0, import_harness.renderFrame)(prompt(request({ metadata })), {
|
|
205
|
+
columns: 60,
|
|
206
|
+
terminal: "no-color"
|
|
207
|
+
});
|
|
208
|
+
(0, import_vitest.expect)(frame).not.toContain("directory:");
|
|
209
|
+
(0, import_vitest.expect)(frame).not.toContain(":operation:");
|
|
210
|
+
const label = frame.split("\n").findIndex((line) => line.includes("Allow edits in"));
|
|
211
|
+
(0, import_vitest.expect)(label).toBeGreaterThan(-1);
|
|
212
|
+
const start = (frame.split("\n")[label] ?? "").indexOf("Allow edits in");
|
|
213
|
+
(0, import_vitest.expect)((frame.split("\n")[label + 1] ?? "").slice(0, start).replace(/[│ ]/g, "")).toBe("");
|
|
214
|
+
});
|
|
215
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignalGates.test.d.ts","sourceRoot":"","sources":["../../src/components/SignalGates.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { createElement, createRef } from "react";
|
|
2
|
+
import { ApprovalType } from "@dexto/core";
|
|
3
|
+
import { describe, expect, it, vi } from "vitest";
|
|
4
|
+
import { getCaps, setCaps } from "../signal/index.js";
|
|
5
|
+
import { renderFrame } from "../signal/harness.js";
|
|
6
|
+
import { render } from "ink";
|
|
7
|
+
import { PassThrough } from "node:stream";
|
|
8
|
+
import {
|
|
9
|
+
ApprovalPrompt,
|
|
10
|
+
approvalGateTitle
|
|
11
|
+
} from "./ApprovalPrompt.js";
|
|
12
|
+
const TEXT_ONLY = { columns: 100, terminal: "no-color" };
|
|
13
|
+
function request(overrides) {
|
|
14
|
+
return {
|
|
15
|
+
approvalId: "a1",
|
|
16
|
+
type: ApprovalType.TOOL_APPROVAL,
|
|
17
|
+
sessionId: "s1",
|
|
18
|
+
timestamp: /* @__PURE__ */ new Date(0),
|
|
19
|
+
metadata: {},
|
|
20
|
+
...overrides
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const SHELL = request({
|
|
24
|
+
metadata: {
|
|
25
|
+
toolName: "bash_exec",
|
|
26
|
+
args: { command: "make migrate" },
|
|
27
|
+
description: "Applies the pending migration",
|
|
28
|
+
displayPreview: { type: "shell", command: "make migrate", exitCode: 0, duration: 0 }
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
function prompt(approval) {
|
|
32
|
+
return createElement(ApprovalPrompt, {
|
|
33
|
+
approval,
|
|
34
|
+
onApprove: () => {
|
|
35
|
+
},
|
|
36
|
+
onDeny: () => {
|
|
37
|
+
},
|
|
38
|
+
onCancel: () => {
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const QUESTION = request({
|
|
43
|
+
type: "elicitation",
|
|
44
|
+
metadata: {
|
|
45
|
+
schema: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
how_long: {
|
|
49
|
+
type: "string",
|
|
50
|
+
enum: ["One release", "Two releases"],
|
|
51
|
+
title: "How long?"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
required: ["how_long"]
|
|
55
|
+
},
|
|
56
|
+
prompt: "Pick one"
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
describe("approvalGateTitle", () => {
|
|
60
|
+
it.each([
|
|
61
|
+
["bash_exec", "NEEDS YOU \xB7 RUN A COMMAND"],
|
|
62
|
+
["edit_file", "NEEDS YOU \xB7 EDIT A FILE"],
|
|
63
|
+
["write_file", "NEEDS YOU \xB7 WRITE A FILE"],
|
|
64
|
+
["plan_review", "NEEDS YOU \xB7 REVIEW THE PLAN"],
|
|
65
|
+
["mcp--github--merge", "NEEDS YOU \xB7 USE A TOOL"]
|
|
66
|
+
])("names %s", (toolName, title) => {
|
|
67
|
+
expect(approvalGateTitle(ApprovalType.TOOL_APPROVAL, toolName)).toBe(title);
|
|
68
|
+
});
|
|
69
|
+
it("treats a command approval as a command, whatever the tool", () => {
|
|
70
|
+
expect(approvalGateTitle(ApprovalType.COMMAND_APPROVAL, void 0)).toBe(
|
|
71
|
+
"NEEDS YOU \xB7 RUN A COMMAND"
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
describe("Signal approval gate", () => {
|
|
76
|
+
it("frames the command, why, and the keys to answer with", () => {
|
|
77
|
+
const frame = renderFrame(prompt(SHELL), TEXT_ONLY);
|
|
78
|
+
expect(frame).toContain("NEEDS YOU \xB7 RUN A COMMAND");
|
|
79
|
+
expect(frame).toContain("$ make migrate");
|
|
80
|
+
expect(frame).toContain("Applies the pending migration");
|
|
81
|
+
expect(frame).toMatch(/› {2}y {2}Allow once/);
|
|
82
|
+
expect(frame).toMatch(/ a {2}Allow .* for this session/);
|
|
83
|
+
expect(frame).toMatch(/ n {2}Reject/);
|
|
84
|
+
});
|
|
85
|
+
it("answers on the option keys", () => {
|
|
86
|
+
const saved = getCaps();
|
|
87
|
+
setCaps({ ...saved, palette: "signal" });
|
|
88
|
+
const onApprove = vi.fn();
|
|
89
|
+
const onDeny = vi.fn();
|
|
90
|
+
const ref = createRef();
|
|
91
|
+
const stdout = Object.assign(new PassThrough(), { columns: 100, rows: 40 });
|
|
92
|
+
const view = render(
|
|
93
|
+
createElement(ApprovalPrompt, {
|
|
94
|
+
ref,
|
|
95
|
+
approval: SHELL,
|
|
96
|
+
onApprove,
|
|
97
|
+
onDeny,
|
|
98
|
+
onCancel: () => {
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
{ stdout, debug: true, patchConsole: false }
|
|
102
|
+
);
|
|
103
|
+
const noKey = {};
|
|
104
|
+
try {
|
|
105
|
+
expect(ref.current?.handleInput("y", noKey)).toBe(true);
|
|
106
|
+
expect(onApprove).toHaveBeenLastCalledWith({});
|
|
107
|
+
expect(ref.current?.handleInput("a", noKey)).toBe(true);
|
|
108
|
+
expect(onApprove).toHaveBeenLastCalledWith({ rememberChoice: true });
|
|
109
|
+
expect(ref.current?.handleInput("n", noKey)).toBe(true);
|
|
110
|
+
expect(onDeny).toHaveBeenCalledTimes(1);
|
|
111
|
+
expect(ref.current?.handleInput("x", noKey)).toBe(false);
|
|
112
|
+
} finally {
|
|
113
|
+
view.unmount();
|
|
114
|
+
setCaps(saved);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
it("asks a question inside the gate, with numbered options and no padding rows", () => {
|
|
118
|
+
const frame = renderFrame(prompt(QUESTION), TEXT_ONLY);
|
|
119
|
+
expect(frame).toContain("QUESTION \xB7 ");
|
|
120
|
+
expect(frame).toMatch(/› 1 {2}One release/);
|
|
121
|
+
expect(frame).toMatch(/ {2}2 {2}Two releases/);
|
|
122
|
+
expect(frame).not.toMatch(/│ +│/);
|
|
123
|
+
});
|
|
124
|
+
it("marks the selected option without relying on colour", () => {
|
|
125
|
+
const frame = renderFrame(prompt(SHELL), TEXT_ONLY);
|
|
126
|
+
expect(frame.match(/›/g)).toHaveLength(1);
|
|
127
|
+
});
|
|
128
|
+
it("keeps long question help to two rows", () => {
|
|
129
|
+
const help = "word ".repeat(200).trim();
|
|
130
|
+
const properties = {
|
|
131
|
+
how_long: { type: "string", enum: ["One"], title: "How long?", description: help }
|
|
132
|
+
};
|
|
133
|
+
const metadata = { ...QUESTION.metadata, schema: { type: "object", properties } };
|
|
134
|
+
const frame = renderFrame(prompt({ ...QUESTION, metadata }), TEXT_ONLY);
|
|
135
|
+
expect(frame.split("\n").filter((line) => line.includes("word")).length).toBeLessThan(3);
|
|
136
|
+
});
|
|
137
|
+
it("fits an edit preview inside the frame", () => {
|
|
138
|
+
const unified = `@@ -1 +1 @@
|
|
139
|
+
+${"x ".repeat(200)}`;
|
|
140
|
+
const frame = renderFrame(
|
|
141
|
+
prompt(
|
|
142
|
+
request({
|
|
143
|
+
metadata: {
|
|
144
|
+
toolName: "edit_file",
|
|
145
|
+
args: {},
|
|
146
|
+
displayPreview: {
|
|
147
|
+
type: "diff",
|
|
148
|
+
unified,
|
|
149
|
+
filename: "a.ts",
|
|
150
|
+
additions: 1,
|
|
151
|
+
deletions: 0
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
})
|
|
155
|
+
),
|
|
156
|
+
TEXT_ONLY
|
|
157
|
+
);
|
|
158
|
+
for (const line of frame.split("\n")) {
|
|
159
|
+
if (line.includes("x x")) expect(line.trimEnd().endsWith("\u2502")).toBe(true);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
it("says a command will run in the background", () => {
|
|
163
|
+
const preview = { type: "shell", command: "x", exitCode: 0, duration: 0 };
|
|
164
|
+
const metadata = {
|
|
165
|
+
toolName: "bash_exec",
|
|
166
|
+
args: {},
|
|
167
|
+
displayPreview: { ...preview, isBackground: true }
|
|
168
|
+
};
|
|
169
|
+
expect(renderFrame(prompt(request({ metadata })), TEXT_ONLY)).toContain("(background)");
|
|
170
|
+
});
|
|
171
|
+
it("wraps question help to the width inside the gate, losing nothing mid-text", () => {
|
|
172
|
+
const help = "word ".repeat(20).trim();
|
|
173
|
+
const properties = {
|
|
174
|
+
how_long: { type: "string", enum: ["One"], title: "How long?", description: help }
|
|
175
|
+
};
|
|
176
|
+
const metadata = { ...QUESTION.metadata, schema: { type: "object", properties } };
|
|
177
|
+
const frame = renderFrame(prompt({ ...QUESTION, metadata }), {
|
|
178
|
+
columns: 80,
|
|
179
|
+
terminal: "no-color"
|
|
180
|
+
});
|
|
181
|
+
const rows = frame.split("\n").filter((line) => line.includes("word"));
|
|
182
|
+
expect(rows.join(" ").match(/word/g)).toHaveLength(20);
|
|
183
|
+
});
|
|
184
|
+
it("names the file an edit approval would change", () => {
|
|
185
|
+
const metadata = {
|
|
186
|
+
toolName: "edit_file",
|
|
187
|
+
args: {},
|
|
188
|
+
displayPreview: {
|
|
189
|
+
type: "diff",
|
|
190
|
+
unified: "@@ -1 +1 @@\n-a\n+b",
|
|
191
|
+
filename: `${process.cwd()}/src/token.ts`,
|
|
192
|
+
additions: 1,
|
|
193
|
+
deletions: 1
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
expect(renderFrame(prompt(request({ metadata })), TEXT_ONLY)).toContain(
|
|
197
|
+
"src/token.ts +1 \u22121"
|
|
198
|
+
);
|
|
199
|
+
});
|
|
200
|
+
it("words a directory approval and keeps a wrapped option under its label", () => {
|
|
201
|
+
const metadata = {
|
|
202
|
+
toolName: "edit_file",
|
|
203
|
+
args: {},
|
|
204
|
+
approvalKey: `directory:/tmp/${"long/".repeat(14)}outside:operation:edit`
|
|
205
|
+
};
|
|
206
|
+
const frame = renderFrame(prompt(request({ metadata })), {
|
|
207
|
+
columns: 60,
|
|
208
|
+
terminal: "no-color"
|
|
209
|
+
});
|
|
210
|
+
expect(frame).not.toContain("directory:");
|
|
211
|
+
expect(frame).not.toContain(":operation:");
|
|
212
|
+
const label = frame.split("\n").findIndex((line) => line.includes("Allow edits in"));
|
|
213
|
+
expect(label).toBeGreaterThan(-1);
|
|
214
|
+
const start = (frame.split("\n")[label] ?? "").indexOf("Allow edits in");
|
|
215
|
+
expect((frame.split("\n")[label + 1] ?? "").slice(0, start).replace(/[│ ]/g, "")).toBe("");
|
|
216
|
+
});
|
|
217
|
+
});
|
|
@@ -38,6 +38,7 @@ var import_commands = require("../interactive-commands/commands.js");
|
|
|
38
38
|
var import_useTerminalSize = require("../hooks/useTerminalSize.js");
|
|
39
39
|
var import_overlaySizing = require("../utils/overlaySizing.js");
|
|
40
40
|
var import_agent_backend = require("../agent-backend.js");
|
|
41
|
+
var import_signal = require("../signal/index.js");
|
|
41
42
|
function getPromptMatchScore(prompt, query) {
|
|
42
43
|
if (!query) return 3;
|
|
43
44
|
const lowerQuery = query.toLowerCase();
|
|
@@ -325,14 +326,14 @@ const SlashCommandAutocompleteInner = (0, import_react.forwardRef)(function Slas
|
|
|
325
326
|
);
|
|
326
327
|
if (!isVisible) return null;
|
|
327
328
|
if (isLoading) {
|
|
328
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { width: terminalWidth, paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { width: terminalWidth, paddingX: 0, paddingY: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: "Loading commands..." }) });
|
|
329
330
|
}
|
|
330
331
|
if (combinedItems.length === 0) {
|
|
331
332
|
return null;
|
|
332
333
|
}
|
|
333
334
|
const nameColumnWidth = Math.max(16, Math.min(28, Math.floor(terminalWidth * 0.32)));
|
|
334
|
-
const descriptionColor = (isSelected) => isSelected ? "
|
|
335
|
-
const commandColor = (isSelected) => isSelected ? "
|
|
335
|
+
const descriptionColor = (isSelected) => isSelected ? (0, import_signal.tone)("hi") : (0, import_signal.tone)("dim");
|
|
336
|
+
const commandColor = (isSelected) => isSelected ? (0, import_signal.tone)("teal") : (0, import_signal.tone)("dim");
|
|
336
337
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", width: terminalWidth, children: visibleItems.map((item, visibleIndex) => {
|
|
337
338
|
const actualIndex = scrollOffset + visibleIndex;
|
|
338
339
|
const isSelected = actualIndex === selectedIndex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlashCommandAutocomplete.d.ts","sourceRoot":"","sources":["../../src/components/SlashCommandAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"SlashCommandAutocomplete.d.ts","sourceRoot":"","sources":["../../src/components/SlashCommandAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG5E,MAAM,WAAW,8BAA8B;IAC3C,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED,UAAU,6BAA6B;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IAC7C,qBAAqB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,WAAW,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IACnE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,eAAe,CAAC;CAC1B;AAmGD;;GAEG;AACH,QAAA,MAAM,6BAA6B,sHA6bjC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAEhC,OAAO,6BAA6B,CAAC"}
|