@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
|
@@ -18,7 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var ApprovalPrompt_exports = {};
|
|
20
20
|
__export(ApprovalPrompt_exports, {
|
|
21
|
-
ApprovalPrompt: () => ApprovalPrompt
|
|
21
|
+
ApprovalPrompt: () => ApprovalPrompt,
|
|
22
|
+
approvalGateTitle: () => approvalGateTitle
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(ApprovalPrompt_exports);
|
|
24
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -27,13 +28,36 @@ var import_ink = require("ink");
|
|
|
27
28
|
var import_core = require("@dexto/core");
|
|
28
29
|
var import_ElicitationForm = require("./ElicitationForm.js");
|
|
29
30
|
var import_renderers = require("./renderers/index.js");
|
|
31
|
+
var import_SignalDiff = require("./renderers/SignalDiff.js");
|
|
30
32
|
var import_toolUtils = require("../utils/toolUtils.js");
|
|
31
33
|
var import_approvalScope = require("../utils/approvalScope.js");
|
|
32
34
|
var import_messageFormatting = require("../utils/messageFormatting.js");
|
|
35
|
+
var import_diff_shared = require("./renderers/diff-shared.js");
|
|
36
|
+
var import_signal = require("../signal/index.js");
|
|
37
|
+
const OPTION_KEYS = {
|
|
38
|
+
yes: "y",
|
|
39
|
+
"yes-session": "a",
|
|
40
|
+
"yes-accept-edits": "e",
|
|
41
|
+
no: "n"
|
|
42
|
+
};
|
|
43
|
+
function approvalGateTitle(type, toolName) {
|
|
44
|
+
if (type === import_core.ApprovalType.COMMAND_APPROVAL || toolName === "bash_exec") {
|
|
45
|
+
return "NEEDS YOU \xB7 RUN A COMMAND";
|
|
46
|
+
}
|
|
47
|
+
if (toolName === "plan_review") return "NEEDS YOU \xB7 REVIEW THE PLAN";
|
|
48
|
+
if (toolName === "edit_file") return "NEEDS YOU \xB7 EDIT A FILE";
|
|
49
|
+
if (toolName === "write_file") return "NEEDS YOU \xB7 WRITE A FILE";
|
|
50
|
+
return "NEEDS YOU \xB7 USE A TOOL";
|
|
51
|
+
}
|
|
52
|
+
const GATE_INSET = 4;
|
|
33
53
|
const ApprovalPrompt = (0, import_react.forwardRef)(
|
|
34
54
|
({ approval, onApprove, onDeny, onCancel }, ref) => {
|
|
35
55
|
const isCommandApproval = approval.type === import_core.ApprovalType.COMMAND_APPROVAL;
|
|
36
56
|
const isElicitation = approval.type === "elicitation";
|
|
57
|
+
const { palette, glyphs } = (0, import_signal.useCaps)();
|
|
58
|
+
const signal = palette === "signal";
|
|
59
|
+
const { stdout } = (0, import_ink.useStdout)();
|
|
60
|
+
const columns = stdout?.columns ?? 80;
|
|
37
61
|
const toolName = approval.metadata.toolName;
|
|
38
62
|
const toolArgs = approval.metadata.args || {};
|
|
39
63
|
const approvalKey = typeof approval.metadata.approvalKey === "string" ? approval.metadata.approvalKey : void 0;
|
|
@@ -71,6 +95,13 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
|
|
|
71
95
|
const elicitationFormRef = (0, import_react.useRef)(null);
|
|
72
96
|
const selectedIndexRef = (0, import_react.useRef)(0);
|
|
73
97
|
const options = [];
|
|
98
|
+
const chooseOption = (id) => {
|
|
99
|
+
if (id === "plan-approve" || id === "yes") onApprove({});
|
|
100
|
+
else if (id === "yes-session") onApprove({ rememberChoice: true });
|
|
101
|
+
else if (id === "plan-approve-accept-edits" || id === "yes-accept-edits") {
|
|
102
|
+
onApprove({ enableAcceptEditsMode: true });
|
|
103
|
+
} else if (id === "no") onDeny();
|
|
104
|
+
};
|
|
74
105
|
if (isPlanReview) {
|
|
75
106
|
options.push({ id: "plan-approve", label: "Approve" });
|
|
76
107
|
options.push({ id: "plan-approve-accept-edits", label: "Approve + Accept All Edits" });
|
|
@@ -122,12 +153,12 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
|
|
|
122
153
|
}
|
|
123
154
|
return true;
|
|
124
155
|
}
|
|
125
|
-
if (key.upArrow) {
|
|
156
|
+
if (key.upArrow || signal && !isPlanReview && key.leftArrow) {
|
|
126
157
|
setSelectedIndex(
|
|
127
158
|
(current) => current === 0 ? totalOptions - 1 : current - 1
|
|
128
159
|
);
|
|
129
160
|
return true;
|
|
130
|
-
} else if (key.downArrow) {
|
|
161
|
+
} else if (key.downArrow || signal && !isPlanReview && key.rightArrow) {
|
|
131
162
|
setSelectedIndex(
|
|
132
163
|
(current) => current === totalOptions - 1 ? 0 : current + 1
|
|
133
164
|
);
|
|
@@ -135,19 +166,7 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
|
|
|
135
166
|
} else if (key.return) {
|
|
136
167
|
const option = getCurrentOption();
|
|
137
168
|
if (!option) return false;
|
|
138
|
-
|
|
139
|
-
onApprove({});
|
|
140
|
-
} else if (option.id === "plan-approve-accept-edits") {
|
|
141
|
-
onApprove({ enableAcceptEditsMode: true });
|
|
142
|
-
} else if (option.id === "yes") {
|
|
143
|
-
onApprove({});
|
|
144
|
-
} else if (option.id === "yes-session") {
|
|
145
|
-
onApprove({ rememberChoice: true });
|
|
146
|
-
} else if (option.id === "yes-accept-edits") {
|
|
147
|
-
onApprove({ enableAcceptEditsMode: true });
|
|
148
|
-
} else if (option.id === "no") {
|
|
149
|
-
onDeny();
|
|
150
|
-
}
|
|
169
|
+
chooseOption(option.id);
|
|
151
170
|
return true;
|
|
152
171
|
} else if (key.shift && key.tab && canAcceptEdits) {
|
|
153
172
|
onApprove({ enableAcceptEditsMode: true });
|
|
@@ -156,10 +175,20 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
|
|
|
156
175
|
onCancel();
|
|
157
176
|
return true;
|
|
158
177
|
}
|
|
178
|
+
if (signal && !isPlanReview && !key.ctrl && !key.meta) {
|
|
179
|
+
const shortcut = options.find(
|
|
180
|
+
(option) => OPTION_KEYS[option.id] === input.toLowerCase()
|
|
181
|
+
);
|
|
182
|
+
if (shortcut) {
|
|
183
|
+
chooseOption(shortcut.id);
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
159
187
|
return false;
|
|
160
188
|
}
|
|
161
189
|
}),
|
|
162
190
|
[
|
|
191
|
+
signal,
|
|
163
192
|
isElicitation,
|
|
164
193
|
canAcceptEdits,
|
|
165
194
|
isPlanReview,
|
|
@@ -191,30 +220,30 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
|
|
|
191
220
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_renderers.DiffPreview, { data: displayPreview });
|
|
192
221
|
case "shell":
|
|
193
222
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
194
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginBottom: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
223
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginBottom: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("teal"), bold: true, children: displayPreview.title ?? "Bash" }) }),
|
|
195
224
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
196
225
|
import_ink.Box,
|
|
197
226
|
{
|
|
198
227
|
flexDirection: "column",
|
|
199
228
|
borderStyle: "round",
|
|
200
|
-
borderColor: "
|
|
229
|
+
borderColor: (0, import_signal.tone)("dim"),
|
|
201
230
|
paddingX: 1,
|
|
202
231
|
children: [
|
|
203
|
-
displayPreview.command.split("\n").map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "
|
|
232
|
+
displayPreview.command.split("\n").map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("amber"), wrap: "wrap", children: [
|
|
204
233
|
i === 0 ? "$ " : " ",
|
|
205
234
|
line
|
|
206
235
|
] }, i)),
|
|
207
|
-
displayPreview.isBackground && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
236
|
+
displayPreview.isBackground && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: "(background)" })
|
|
208
237
|
]
|
|
209
238
|
}
|
|
210
239
|
),
|
|
211
|
-
callDescription && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
240
|
+
callDescription && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: callDescription }) })
|
|
212
241
|
] });
|
|
213
242
|
case "file":
|
|
214
243
|
if (displayPreview.content) {
|
|
215
244
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_renderers.CreateFilePreview, { data: displayPreview });
|
|
216
245
|
}
|
|
217
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "
|
|
246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: [
|
|
218
247
|
displayPreview.operation === "read" && `Read ${displayPreview.lineCount ?? "file"} lines`,
|
|
219
248
|
displayPreview.operation === "write" && `Write to ${displayPreview.path}`,
|
|
220
249
|
displayPreview.operation === "delete" && `Delete ${displayPreview.path}`
|
|
@@ -224,9 +253,66 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
|
|
|
224
253
|
}
|
|
225
254
|
};
|
|
226
255
|
const showHeaderBlock = isCommandApproval || !displayPreview;
|
|
227
|
-
|
|
256
|
+
if (signal && !isPlanReview) {
|
|
257
|
+
const shellCommand = displayPreview?.type === "shell" ? displayPreview.command : command ?? null;
|
|
258
|
+
const preview = displayPreview?.type === "shell" ? null : displayPreview?.type === "diff" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
259
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { bold: true, color: (0, import_signal.tone)("hi"), children: [
|
|
260
|
+
(0, import_messageFormatting.makeRelativePath)(displayPreview.filename),
|
|
261
|
+
" ",
|
|
262
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("add"), children: [
|
|
263
|
+
"+",
|
|
264
|
+
displayPreview.additions
|
|
265
|
+
] }),
|
|
266
|
+
" ",
|
|
267
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("del"), children: (0, import_signal.glyphText)(`\u2212${displayPreview.deletions}`, glyphs) })
|
|
268
|
+
] }),
|
|
269
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SignalDiff.SignalDiff, { data: displayPreview, width: columns - GATE_INSET })
|
|
270
|
+
] }) : renderPreview();
|
|
271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_diff_shared.DiffInsetContext.Provider, { value: GATE_INSET, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
272
|
+
import_signal.GateFrame,
|
|
273
|
+
{
|
|
274
|
+
title: approvalGateTitle(approval.type, toolName),
|
|
275
|
+
hint: "\u2190\u2192 choose \xB7 \u23CE confirm \xB7 esc cancel",
|
|
276
|
+
children: [
|
|
277
|
+
shellCommand !== null ? shellCommand.split("\n").map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { bold: true, color: (0, import_signal.tone)("hi"), children: [
|
|
278
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("amber"), children: i === 0 ? "$ " : " " }),
|
|
279
|
+
line
|
|
280
|
+
] }, i)) : preview === null && formattedTool ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("hi"), children: formattedTool.header }) : preview,
|
|
281
|
+
displayPreview?.type === "shell" && displayPreview.isBackground && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: "(background)" }),
|
|
282
|
+
callDescription && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: callDescription }),
|
|
283
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexWrap: "wrap", columnGap: 3, children: options.map((option, index) => {
|
|
284
|
+
const selected = index === selectedIndex;
|
|
285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { children: [
|
|
286
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { children: [
|
|
287
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { bold: true, color: (0, import_signal.tone)("amber"), children: selected ? (0, import_signal.glyphText)("\u203A ", glyphs) : " " }),
|
|
288
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
289
|
+
import_ink.Text,
|
|
290
|
+
{
|
|
291
|
+
bold: true,
|
|
292
|
+
color: (0, import_signal.tone)("amber"),
|
|
293
|
+
backgroundColor: (0, import_signal.tone)("s2"),
|
|
294
|
+
children: ` ${OPTION_KEYS[option.id] ?? ""} `
|
|
295
|
+
}
|
|
296
|
+
),
|
|
297
|
+
" "
|
|
298
|
+
] }) }),
|
|
299
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexShrink: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
300
|
+
import_ink.Text,
|
|
301
|
+
{
|
|
302
|
+
bold: selected,
|
|
303
|
+
color: (0, import_signal.tone)(selected ? "hi" : "fg"),
|
|
304
|
+
children: option.label
|
|
305
|
+
}
|
|
306
|
+
) })
|
|
307
|
+
] }, option.id);
|
|
308
|
+
}) })
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
) });
|
|
312
|
+
}
|
|
313
|
+
const prompt = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { paddingX: 0, paddingY: 0, flexDirection: "column", children: [
|
|
228
314
|
showHeaderBlock && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", marginBottom: 0, children: isCommandApproval ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
229
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "
|
|
315
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("amber"), bold: true, children: [
|
|
230
316
|
"Confirm command:",
|
|
231
317
|
" "
|
|
232
318
|
] }) }),
|
|
@@ -235,22 +321,22 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
|
|
|
235
321
|
{
|
|
236
322
|
flexDirection: "column",
|
|
237
323
|
borderStyle: "round",
|
|
238
|
-
borderColor: "
|
|
324
|
+
borderColor: (0, import_signal.tone)("dim"),
|
|
239
325
|
paddingX: 1,
|
|
240
|
-
children: command.split("\n").map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "red", wrap: "wrap", children: line }, i))
|
|
326
|
+
children: command.split("\n").map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("red"), wrap: "wrap", children: line }, i))
|
|
241
327
|
}
|
|
242
328
|
) })
|
|
243
329
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
244
330
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "row", children: [
|
|
245
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "
|
|
331
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("amber"), bold: true, children: [
|
|
246
332
|
"Confirm:",
|
|
247
333
|
" "
|
|
248
334
|
] }),
|
|
249
|
-
formattedTool && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
335
|
+
formattedTool && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("teal"), children: formattedTool.header })
|
|
250
336
|
] }),
|
|
251
337
|
callDescription && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "row", marginTop: 0, children: [
|
|
252
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
253
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
338
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: " " }),
|
|
339
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: callDescription })
|
|
254
340
|
] })
|
|
255
341
|
] }) }),
|
|
256
342
|
renderPreview(),
|
|
@@ -258,10 +344,10 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
|
|
|
258
344
|
options.map((option, index) => {
|
|
259
345
|
const isSelected = index === selectedIndex;
|
|
260
346
|
const isNo = option.id === "no";
|
|
261
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { children: isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: isNo ? "red" : "
|
|
347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { children: isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: isNo ? (0, import_signal.tone)("red") : (0, import_signal.tone)("add"), bold: true, children: [
|
|
262
348
|
" \u25B6 ",
|
|
263
349
|
option.label
|
|
264
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "
|
|
350
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: [
|
|
265
351
|
" ",
|
|
266
352
|
option.label
|
|
267
353
|
] }) }, option.id);
|
|
@@ -269,32 +355,34 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
|
|
|
269
355
|
isPlanReview && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { children: selectedIndex === options.length ? (
|
|
270
356
|
// Selected - show editable input
|
|
271
357
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "row", children: [
|
|
272
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "red", bold: true, children: " \u25B6 " }),
|
|
273
|
-
feedbackText ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "
|
|
358
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("red"), bold: true, children: " \u25B6 " }),
|
|
359
|
+
feedbackText ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("hi"), children: [
|
|
274
360
|
feedbackText,
|
|
275
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
276
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "
|
|
361
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("teal"), children: "\u258B" })
|
|
362
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: [
|
|
277
363
|
"What changes would you like?",
|
|
278
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
364
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("teal"), children: "\u258B" })
|
|
279
365
|
] })
|
|
280
366
|
] })
|
|
281
367
|
) : (
|
|
282
368
|
// Not selected - show placeholder
|
|
283
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "
|
|
369
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: [
|
|
284
370
|
" ",
|
|
285
371
|
feedbackText || "What changes would you like?"
|
|
286
372
|
] })
|
|
287
373
|
) })
|
|
288
374
|
] }),
|
|
289
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "
|
|
375
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: [
|
|
290
376
|
" ",
|
|
291
377
|
"\u2191\u2193 to select \u2022 Enter to confirm \u2022 Esc to cancel"
|
|
292
378
|
] }) })
|
|
293
379
|
] });
|
|
380
|
+
return signal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_diff_shared.DiffInsetContext.Provider, { value: GATE_INSET, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_signal.GateFrame, { title: approvalGateTitle(approval.type, toolName), children: prompt }) }) : prompt;
|
|
294
381
|
}
|
|
295
382
|
);
|
|
296
383
|
ApprovalPrompt.displayName = "ApprovalPrompt";
|
|
297
384
|
// Annotate the CommonJS export names for ESM import in node:
|
|
298
385
|
0 && (module.exports = {
|
|
299
|
-
ApprovalPrompt
|
|
386
|
+
ApprovalPrompt,
|
|
387
|
+
approvalGateTitle
|
|
300
388
|
});
|
|
@@ -31,6 +31,8 @@ interface ApprovalPromptProps {
|
|
|
31
31
|
onDeny: (feedback?: string) => void;
|
|
32
32
|
onCancel: () => void;
|
|
33
33
|
}
|
|
34
|
+
/** The gate's title: what the agent is waiting to do. */
|
|
35
|
+
export declare function approvalGateTitle(type: string, toolName: string | undefined): string;
|
|
34
36
|
/**
|
|
35
37
|
* Compact approval prompt component that displays above the input area
|
|
36
38
|
* Shows options based on approval type:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../src/components/ApprovalPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EACR,kBAAkB,EAGlB,0BAA0B,EAC7B,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../src/components/ApprovalPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EACR,kBAAkB,EAGlB,0BAA0B,EAC7B,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAU5D,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,0BAA0B,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,mDAAmD;IACnD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,UAAU,mBAAmB;IACzB,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC9C,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAUD,yDAAyD;AACzD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQpF;AAeD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,kGAke1B,CAAC"}
|
|
@@ -7,17 +7,40 @@ import {
|
|
|
7
7
|
useEffect,
|
|
8
8
|
useMemo
|
|
9
9
|
} from "react";
|
|
10
|
-
import { Box, Text } from "ink";
|
|
10
|
+
import { Box, Text, useStdout } from "ink";
|
|
11
11
|
import { ApprovalType, isToolPresentationSnapshotV1 } from "@dexto/core";
|
|
12
12
|
import { ElicitationForm } from "./ElicitationForm.js";
|
|
13
13
|
import { DiffPreview, CreateFilePreview } from "./renderers/index.js";
|
|
14
|
+
import { SignalDiff } from "./renderers/SignalDiff.js";
|
|
14
15
|
import { isEditWriteTool } from "../utils/toolUtils.js";
|
|
15
16
|
import { formatApprovalScope } from "../utils/approvalScope.js";
|
|
16
|
-
import { formatToolHeader } from "../utils/messageFormatting.js";
|
|
17
|
+
import { formatToolHeader, makeRelativePath } from "../utils/messageFormatting.js";
|
|
18
|
+
import { DiffInsetContext } from "./renderers/diff-shared.js";
|
|
19
|
+
import { GateFrame, glyphText, tone, useCaps } from "../signal/index.js";
|
|
20
|
+
const OPTION_KEYS = {
|
|
21
|
+
yes: "y",
|
|
22
|
+
"yes-session": "a",
|
|
23
|
+
"yes-accept-edits": "e",
|
|
24
|
+
no: "n"
|
|
25
|
+
};
|
|
26
|
+
function approvalGateTitle(type, toolName) {
|
|
27
|
+
if (type === ApprovalType.COMMAND_APPROVAL || toolName === "bash_exec") {
|
|
28
|
+
return "NEEDS YOU \xB7 RUN A COMMAND";
|
|
29
|
+
}
|
|
30
|
+
if (toolName === "plan_review") return "NEEDS YOU \xB7 REVIEW THE PLAN";
|
|
31
|
+
if (toolName === "edit_file") return "NEEDS YOU \xB7 EDIT A FILE";
|
|
32
|
+
if (toolName === "write_file") return "NEEDS YOU \xB7 WRITE A FILE";
|
|
33
|
+
return "NEEDS YOU \xB7 USE A TOOL";
|
|
34
|
+
}
|
|
35
|
+
const GATE_INSET = 4;
|
|
17
36
|
const ApprovalPrompt = forwardRef(
|
|
18
37
|
({ approval, onApprove, onDeny, onCancel }, ref) => {
|
|
19
38
|
const isCommandApproval = approval.type === ApprovalType.COMMAND_APPROVAL;
|
|
20
39
|
const isElicitation = approval.type === "elicitation";
|
|
40
|
+
const { palette, glyphs } = useCaps();
|
|
41
|
+
const signal = palette === "signal";
|
|
42
|
+
const { stdout } = useStdout();
|
|
43
|
+
const columns = stdout?.columns ?? 80;
|
|
21
44
|
const toolName = approval.metadata.toolName;
|
|
22
45
|
const toolArgs = approval.metadata.args || {};
|
|
23
46
|
const approvalKey = typeof approval.metadata.approvalKey === "string" ? approval.metadata.approvalKey : void 0;
|
|
@@ -55,6 +78,13 @@ const ApprovalPrompt = forwardRef(
|
|
|
55
78
|
const elicitationFormRef = useRef(null);
|
|
56
79
|
const selectedIndexRef = useRef(0);
|
|
57
80
|
const options = [];
|
|
81
|
+
const chooseOption = (id) => {
|
|
82
|
+
if (id === "plan-approve" || id === "yes") onApprove({});
|
|
83
|
+
else if (id === "yes-session") onApprove({ rememberChoice: true });
|
|
84
|
+
else if (id === "plan-approve-accept-edits" || id === "yes-accept-edits") {
|
|
85
|
+
onApprove({ enableAcceptEditsMode: true });
|
|
86
|
+
} else if (id === "no") onDeny();
|
|
87
|
+
};
|
|
58
88
|
if (isPlanReview) {
|
|
59
89
|
options.push({ id: "plan-approve", label: "Approve" });
|
|
60
90
|
options.push({ id: "plan-approve-accept-edits", label: "Approve + Accept All Edits" });
|
|
@@ -106,12 +136,12 @@ const ApprovalPrompt = forwardRef(
|
|
|
106
136
|
}
|
|
107
137
|
return true;
|
|
108
138
|
}
|
|
109
|
-
if (key.upArrow) {
|
|
139
|
+
if (key.upArrow || signal && !isPlanReview && key.leftArrow) {
|
|
110
140
|
setSelectedIndex(
|
|
111
141
|
(current) => current === 0 ? totalOptions - 1 : current - 1
|
|
112
142
|
);
|
|
113
143
|
return true;
|
|
114
|
-
} else if (key.downArrow) {
|
|
144
|
+
} else if (key.downArrow || signal && !isPlanReview && key.rightArrow) {
|
|
115
145
|
setSelectedIndex(
|
|
116
146
|
(current) => current === totalOptions - 1 ? 0 : current + 1
|
|
117
147
|
);
|
|
@@ -119,19 +149,7 @@ const ApprovalPrompt = forwardRef(
|
|
|
119
149
|
} else if (key.return) {
|
|
120
150
|
const option = getCurrentOption();
|
|
121
151
|
if (!option) return false;
|
|
122
|
-
|
|
123
|
-
onApprove({});
|
|
124
|
-
} else if (option.id === "plan-approve-accept-edits") {
|
|
125
|
-
onApprove({ enableAcceptEditsMode: true });
|
|
126
|
-
} else if (option.id === "yes") {
|
|
127
|
-
onApprove({});
|
|
128
|
-
} else if (option.id === "yes-session") {
|
|
129
|
-
onApprove({ rememberChoice: true });
|
|
130
|
-
} else if (option.id === "yes-accept-edits") {
|
|
131
|
-
onApprove({ enableAcceptEditsMode: true });
|
|
132
|
-
} else if (option.id === "no") {
|
|
133
|
-
onDeny();
|
|
134
|
-
}
|
|
152
|
+
chooseOption(option.id);
|
|
135
153
|
return true;
|
|
136
154
|
} else if (key.shift && key.tab && canAcceptEdits) {
|
|
137
155
|
onApprove({ enableAcceptEditsMode: true });
|
|
@@ -140,10 +158,20 @@ const ApprovalPrompt = forwardRef(
|
|
|
140
158
|
onCancel();
|
|
141
159
|
return true;
|
|
142
160
|
}
|
|
161
|
+
if (signal && !isPlanReview && !key.ctrl && !key.meta) {
|
|
162
|
+
const shortcut = options.find(
|
|
163
|
+
(option) => OPTION_KEYS[option.id] === input.toLowerCase()
|
|
164
|
+
);
|
|
165
|
+
if (shortcut) {
|
|
166
|
+
chooseOption(shortcut.id);
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
143
170
|
return false;
|
|
144
171
|
}
|
|
145
172
|
}),
|
|
146
173
|
[
|
|
174
|
+
signal,
|
|
147
175
|
isElicitation,
|
|
148
176
|
canAcceptEdits,
|
|
149
177
|
isPlanReview,
|
|
@@ -175,30 +203,30 @@ const ApprovalPrompt = forwardRef(
|
|
|
175
203
|
return /* @__PURE__ */ jsx(DiffPreview, { data: displayPreview });
|
|
176
204
|
case "shell":
|
|
177
205
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
178
|
-
/* @__PURE__ */ jsx(Box, { marginBottom: 0, children: /* @__PURE__ */ jsx(Text, { color: "
|
|
206
|
+
/* @__PURE__ */ jsx(Box, { marginBottom: 0, children: /* @__PURE__ */ jsx(Text, { color: tone("teal"), bold: true, children: displayPreview.title ?? "Bash" }) }),
|
|
179
207
|
/* @__PURE__ */ jsxs(
|
|
180
208
|
Box,
|
|
181
209
|
{
|
|
182
210
|
flexDirection: "column",
|
|
183
211
|
borderStyle: "round",
|
|
184
|
-
borderColor: "
|
|
212
|
+
borderColor: tone("dim"),
|
|
185
213
|
paddingX: 1,
|
|
186
214
|
children: [
|
|
187
|
-
displayPreview.command.split("\n").map((line, i) => /* @__PURE__ */ jsxs(Text, { color: "
|
|
215
|
+
displayPreview.command.split("\n").map((line, i) => /* @__PURE__ */ jsxs(Text, { color: tone("amber"), wrap: "wrap", children: [
|
|
188
216
|
i === 0 ? "$ " : " ",
|
|
189
217
|
line
|
|
190
218
|
] }, i)),
|
|
191
|
-
displayPreview.isBackground && /* @__PURE__ */ jsx(Text, { color: "
|
|
219
|
+
displayPreview.isBackground && /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: "(background)" })
|
|
192
220
|
]
|
|
193
221
|
}
|
|
194
222
|
),
|
|
195
|
-
callDescription && /* @__PURE__ */ jsx(Box, { marginTop: 0, children: /* @__PURE__ */ jsx(Text, { color: "
|
|
223
|
+
callDescription && /* @__PURE__ */ jsx(Box, { marginTop: 0, children: /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: callDescription }) })
|
|
196
224
|
] });
|
|
197
225
|
case "file":
|
|
198
226
|
if (displayPreview.content) {
|
|
199
227
|
return /* @__PURE__ */ jsx(CreateFilePreview, { data: displayPreview });
|
|
200
228
|
}
|
|
201
|
-
return /* @__PURE__ */ jsx(Box, { marginBottom: 1, children: /* @__PURE__ */ jsxs(Text, { color: "
|
|
229
|
+
return /* @__PURE__ */ jsx(Box, { marginBottom: 1, children: /* @__PURE__ */ jsxs(Text, { color: tone("dim"), children: [
|
|
202
230
|
displayPreview.operation === "read" && `Read ${displayPreview.lineCount ?? "file"} lines`,
|
|
203
231
|
displayPreview.operation === "write" && `Write to ${displayPreview.path}`,
|
|
204
232
|
displayPreview.operation === "delete" && `Delete ${displayPreview.path}`
|
|
@@ -208,9 +236,66 @@ const ApprovalPrompt = forwardRef(
|
|
|
208
236
|
}
|
|
209
237
|
};
|
|
210
238
|
const showHeaderBlock = isCommandApproval || !displayPreview;
|
|
211
|
-
|
|
239
|
+
if (signal && !isPlanReview) {
|
|
240
|
+
const shellCommand = displayPreview?.type === "shell" ? displayPreview.command : command ?? null;
|
|
241
|
+
const preview = displayPreview?.type === "shell" ? null : displayPreview?.type === "diff" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
242
|
+
/* @__PURE__ */ jsxs(Text, { bold: true, color: tone("hi"), children: [
|
|
243
|
+
makeRelativePath(displayPreview.filename),
|
|
244
|
+
" ",
|
|
245
|
+
/* @__PURE__ */ jsxs(Text, { color: tone("add"), children: [
|
|
246
|
+
"+",
|
|
247
|
+
displayPreview.additions
|
|
248
|
+
] }),
|
|
249
|
+
" ",
|
|
250
|
+
/* @__PURE__ */ jsx(Text, { color: tone("del"), children: glyphText(`\u2212${displayPreview.deletions}`, glyphs) })
|
|
251
|
+
] }),
|
|
252
|
+
/* @__PURE__ */ jsx(SignalDiff, { data: displayPreview, width: columns - GATE_INSET })
|
|
253
|
+
] }) : renderPreview();
|
|
254
|
+
return /* @__PURE__ */ jsx(DiffInsetContext.Provider, { value: GATE_INSET, children: /* @__PURE__ */ jsxs(
|
|
255
|
+
GateFrame,
|
|
256
|
+
{
|
|
257
|
+
title: approvalGateTitle(approval.type, toolName),
|
|
258
|
+
hint: "\u2190\u2192 choose \xB7 \u23CE confirm \xB7 esc cancel",
|
|
259
|
+
children: [
|
|
260
|
+
shellCommand !== null ? shellCommand.split("\n").map((line, i) => /* @__PURE__ */ jsxs(Text, { bold: true, color: tone("hi"), children: [
|
|
261
|
+
/* @__PURE__ */ jsx(Text, { color: tone("amber"), children: i === 0 ? "$ " : " " }),
|
|
262
|
+
line
|
|
263
|
+
] }, i)) : preview === null && formattedTool ? /* @__PURE__ */ jsx(Text, { color: tone("hi"), children: formattedTool.header }) : preview,
|
|
264
|
+
displayPreview?.type === "shell" && displayPreview.isBackground && /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: "(background)" }),
|
|
265
|
+
callDescription && /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: callDescription }),
|
|
266
|
+
/* @__PURE__ */ jsx(Box, { flexWrap: "wrap", columnGap: 3, children: options.map((option, index) => {
|
|
267
|
+
const selected = index === selectedIndex;
|
|
268
|
+
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
269
|
+
/* @__PURE__ */ jsx(Box, { flexShrink: 0, children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
270
|
+
/* @__PURE__ */ jsx(Text, { bold: true, color: tone("amber"), children: selected ? glyphText("\u203A ", glyphs) : " " }),
|
|
271
|
+
/* @__PURE__ */ jsx(
|
|
272
|
+
Text,
|
|
273
|
+
{
|
|
274
|
+
bold: true,
|
|
275
|
+
color: tone("amber"),
|
|
276
|
+
backgroundColor: tone("s2"),
|
|
277
|
+
children: ` ${OPTION_KEYS[option.id] ?? ""} `
|
|
278
|
+
}
|
|
279
|
+
),
|
|
280
|
+
" "
|
|
281
|
+
] }) }),
|
|
282
|
+
/* @__PURE__ */ jsx(Box, { flexShrink: 1, children: /* @__PURE__ */ jsx(
|
|
283
|
+
Text,
|
|
284
|
+
{
|
|
285
|
+
bold: selected,
|
|
286
|
+
color: tone(selected ? "hi" : "fg"),
|
|
287
|
+
children: option.label
|
|
288
|
+
}
|
|
289
|
+
) })
|
|
290
|
+
] }, option.id);
|
|
291
|
+
}) })
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
) });
|
|
295
|
+
}
|
|
296
|
+
const prompt = /* @__PURE__ */ jsxs(Box, { paddingX: 0, paddingY: 0, flexDirection: "column", children: [
|
|
212
297
|
showHeaderBlock && /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginBottom: 0, children: isCommandApproval ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
213
|
-
/* @__PURE__ */ jsx(Box, { flexDirection: "row", children: /* @__PURE__ */ jsxs(Text, { color: "
|
|
298
|
+
/* @__PURE__ */ jsx(Box, { flexDirection: "row", children: /* @__PURE__ */ jsxs(Text, { color: tone("amber"), bold: true, children: [
|
|
214
299
|
"Confirm command:",
|
|
215
300
|
" "
|
|
216
301
|
] }) }),
|
|
@@ -219,22 +304,22 @@ const ApprovalPrompt = forwardRef(
|
|
|
219
304
|
{
|
|
220
305
|
flexDirection: "column",
|
|
221
306
|
borderStyle: "round",
|
|
222
|
-
borderColor: "
|
|
307
|
+
borderColor: tone("dim"),
|
|
223
308
|
paddingX: 1,
|
|
224
|
-
children: command.split("\n").map((line, i) => /* @__PURE__ */ jsx(Text, { color: "red", wrap: "wrap", children: line }, i))
|
|
309
|
+
children: command.split("\n").map((line, i) => /* @__PURE__ */ jsx(Text, { color: tone("red"), wrap: "wrap", children: line }, i))
|
|
225
310
|
}
|
|
226
311
|
) })
|
|
227
312
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
228
313
|
/* @__PURE__ */ jsxs(Box, { flexDirection: "row", children: [
|
|
229
|
-
/* @__PURE__ */ jsxs(Text, { color: "
|
|
314
|
+
/* @__PURE__ */ jsxs(Text, { color: tone("amber"), bold: true, children: [
|
|
230
315
|
"Confirm:",
|
|
231
316
|
" "
|
|
232
317
|
] }),
|
|
233
|
-
formattedTool && /* @__PURE__ */ jsx(Text, { color: "
|
|
318
|
+
formattedTool && /* @__PURE__ */ jsx(Text, { color: tone("teal"), children: formattedTool.header })
|
|
234
319
|
] }),
|
|
235
320
|
callDescription && /* @__PURE__ */ jsxs(Box, { flexDirection: "row", marginTop: 0, children: [
|
|
236
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
237
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
321
|
+
/* @__PURE__ */ jsx(Text, { color: tone("dim"), children: " " }),
|
|
322
|
+
/* @__PURE__ */ jsx(Text, { color: tone("dim"), children: callDescription })
|
|
238
323
|
] })
|
|
239
324
|
] }) }),
|
|
240
325
|
renderPreview(),
|
|
@@ -242,10 +327,10 @@ const ApprovalPrompt = forwardRef(
|
|
|
242
327
|
options.map((option, index) => {
|
|
243
328
|
const isSelected = index === selectedIndex;
|
|
244
329
|
const isNo = option.id === "no";
|
|
245
|
-
return /* @__PURE__ */ jsx(Box, { children: isSelected ? /* @__PURE__ */ jsxs(Text, { color: isNo ? "red" : "
|
|
330
|
+
return /* @__PURE__ */ jsx(Box, { children: isSelected ? /* @__PURE__ */ jsxs(Text, { color: isNo ? tone("red") : tone("add"), bold: true, children: [
|
|
246
331
|
" \u25B6 ",
|
|
247
332
|
option.label
|
|
248
|
-
] }) : /* @__PURE__ */ jsxs(Text, { color: "
|
|
333
|
+
] }) : /* @__PURE__ */ jsxs(Text, { color: tone("dim"), children: [
|
|
249
334
|
" ",
|
|
250
335
|
option.label
|
|
251
336
|
] }) }, option.id);
|
|
@@ -253,31 +338,33 @@ const ApprovalPrompt = forwardRef(
|
|
|
253
338
|
isPlanReview && /* @__PURE__ */ jsx(Box, { children: selectedIndex === options.length ? (
|
|
254
339
|
// Selected - show editable input
|
|
255
340
|
/* @__PURE__ */ jsxs(Box, { flexDirection: "row", children: [
|
|
256
|
-
/* @__PURE__ */ jsx(Text, { color: "red", bold: true, children: " \u25B6 " }),
|
|
257
|
-
feedbackText ? /* @__PURE__ */ jsxs(Text, { color: "
|
|
341
|
+
/* @__PURE__ */ jsx(Text, { color: tone("red"), bold: true, children: " \u25B6 " }),
|
|
342
|
+
feedbackText ? /* @__PURE__ */ jsxs(Text, { color: tone("hi"), children: [
|
|
258
343
|
feedbackText,
|
|
259
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
260
|
-
] }) : /* @__PURE__ */ jsxs(Text, { color: "
|
|
344
|
+
/* @__PURE__ */ jsx(Text, { color: tone("teal"), children: "\u258B" })
|
|
345
|
+
] }) : /* @__PURE__ */ jsxs(Text, { color: tone("dim"), children: [
|
|
261
346
|
"What changes would you like?",
|
|
262
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
347
|
+
/* @__PURE__ */ jsx(Text, { color: tone("teal"), children: "\u258B" })
|
|
263
348
|
] })
|
|
264
349
|
] })
|
|
265
350
|
) : (
|
|
266
351
|
// Not selected - show placeholder
|
|
267
|
-
/* @__PURE__ */ jsxs(Text, { color: "
|
|
352
|
+
/* @__PURE__ */ jsxs(Text, { color: tone("dim"), children: [
|
|
268
353
|
" ",
|
|
269
354
|
feedbackText || "What changes would you like?"
|
|
270
355
|
] })
|
|
271
356
|
) })
|
|
272
357
|
] }),
|
|
273
|
-
/* @__PURE__ */ jsx(Box, { marginTop: 0, children: /* @__PURE__ */ jsxs(Text, { color: "
|
|
358
|
+
/* @__PURE__ */ jsx(Box, { marginTop: 0, children: /* @__PURE__ */ jsxs(Text, { color: tone("dim"), children: [
|
|
274
359
|
" ",
|
|
275
360
|
"\u2191\u2193 to select \u2022 Enter to confirm \u2022 Esc to cancel"
|
|
276
361
|
] }) })
|
|
277
362
|
] });
|
|
363
|
+
return signal ? /* @__PURE__ */ jsx(DiffInsetContext.Provider, { value: GATE_INSET, children: /* @__PURE__ */ jsx(GateFrame, { title: approvalGateTitle(approval.type, toolName), children: prompt }) }) : prompt;
|
|
278
364
|
}
|
|
279
365
|
);
|
|
280
366
|
ApprovalPrompt.displayName = "ApprovalPrompt";
|
|
281
367
|
export {
|
|
282
|
-
ApprovalPrompt
|
|
368
|
+
ApprovalPrompt,
|
|
369
|
+
approvalGateTitle
|
|
283
370
|
};
|