@dexto/tui 1.14.6 → 1.15.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/InkCLIRefactored.cjs +30 -24
- package/dist/InkCLIRefactored.d.ts.map +1 -1
- package/dist/InkCLIRefactored.js +30 -24
- package/dist/components/ApprovalPrompt.cjs +128 -40
- package/dist/components/ApprovalPrompt.d.ts +2 -0
- package/dist/components/ApprovalPrompt.d.ts.map +1 -1
- package/dist/components/ApprovalPrompt.js +128 -41
- package/dist/components/CustomInput.cjs +4 -3
- package/dist/components/CustomInput.d.ts.map +1 -1
- package/dist/components/CustomInput.js +4 -3
- package/dist/components/DeckArea.cjs +43 -0
- package/dist/components/DeckArea.d.ts +14 -0
- package/dist/components/DeckArea.d.ts.map +1 -0
- package/dist/components/DeckArea.js +19 -0
- package/dist/components/EditableMultiLineInput.cjs +9 -8
- package/dist/components/EditableMultiLineInput.d.ts.map +1 -1
- package/dist/components/EditableMultiLineInput.js +9 -8
- package/dist/components/ElicitationForm.cjs +78 -18
- package/dist/components/ElicitationForm.d.ts.map +1 -1
- package/dist/components/ElicitationForm.js +78 -18
- package/dist/components/ErrorBoundary.cjs +15 -5
- package/dist/components/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/ErrorBoundary.js +15 -5
- package/dist/components/Footer.cjs +41 -86
- package/dist/components/Footer.d.ts +2 -2
- package/dist/components/Footer.d.ts.map +1 -1
- package/dist/components/Footer.js +44 -92
- package/dist/components/Footer.test.cjs +44 -0
- package/dist/components/Footer.test.js +44 -0
- package/dist/components/HistorySearchBar.cjs +6 -5
- package/dist/components/HistorySearchBar.d.ts.map +1 -1
- package/dist/components/HistorySearchBar.js +6 -5
- package/dist/components/MultiLineInput.cjs +6 -5
- package/dist/components/MultiLineInput.d.ts.map +1 -1
- package/dist/components/MultiLineInput.js +6 -5
- package/dist/components/ResourceAutocomplete.cjs +5 -4
- package/dist/components/ResourceAutocomplete.d.ts.map +1 -1
- package/dist/components/ResourceAutocomplete.js +5 -4
- package/dist/components/SignalGates.test.cjs +215 -0
- package/dist/components/SignalGates.test.d.ts +2 -0
- package/dist/components/SignalGates.test.d.ts.map +1 -0
- package/dist/components/SignalGates.test.js +217 -0
- package/dist/components/SlashCommandAutocomplete.cjs +4 -3
- package/dist/components/SlashCommandAutocomplete.d.ts.map +1 -1
- package/dist/components/SlashCommandAutocomplete.js +4 -3
- package/dist/components/StatusBar.cjs +13 -30
- package/dist/components/StatusBar.d.ts +1 -3
- package/dist/components/StatusBar.d.ts.map +1 -1
- package/dist/components/StatusBar.js +13 -30
- package/dist/components/TextBufferInput.cjs +13 -12
- package/dist/components/TextBufferInput.d.ts.map +1 -1
- package/dist/components/TextBufferInput.js +13 -12
- package/dist/components/TodoPanel.cjs +23 -16
- package/dist/components/TodoPanel.d.ts.map +1 -1
- package/dist/components/TodoPanel.js +23 -16
- package/dist/components/base/BaseAutocomplete.cjs +7 -6
- package/dist/components/base/BaseAutocomplete.d.ts.map +1 -1
- package/dist/components/base/BaseAutocomplete.js +7 -6
- package/dist/components/base/BaseSelector.cjs +5 -4
- package/dist/components/base/BaseSelector.d.ts.map +1 -1
- package/dist/components/base/BaseSelector.js +5 -4
- package/dist/components/chat/Footer.cjs +2 -1
- package/dist/components/chat/Footer.d.ts.map +1 -1
- package/dist/components/chat/Footer.js +2 -1
- package/dist/components/chat/Header.cjs +20 -16
- package/dist/components/chat/Header.d.ts.map +1 -1
- package/dist/components/chat/Header.js +20 -16
- package/dist/components/chat/MessageItem.cjs +47 -30
- package/dist/components/chat/MessageItem.d.ts.map +1 -1
- package/dist/components/chat/MessageItem.js +52 -29
- package/dist/components/chat/MessageList.cjs +3 -2
- package/dist/components/chat/MessageList.d.ts.map +1 -1
- package/dist/components/chat/MessageList.js +3 -2
- package/dist/components/chat/QueuedMessagesDisplay.cjs +17 -5
- package/dist/components/chat/QueuedMessagesDisplay.d.ts.map +1 -1
- package/dist/components/chat/QueuedMessagesDisplay.js +18 -6
- package/dist/components/chat/SignalMessage.cjs +116 -0
- package/dist/components/chat/SignalMessage.d.ts +18 -0
- package/dist/components/chat/SignalMessage.d.ts.map +1 -0
- package/dist/components/chat/SignalMessage.js +96 -0
- package/dist/components/chat/SignalMessage.test.cjs +112 -0
- package/dist/components/chat/SignalMessage.test.d.ts +2 -0
- package/dist/components/chat/SignalMessage.test.d.ts.map +1 -0
- package/dist/components/chat/SignalMessage.test.js +116 -0
- package/dist/components/chat/ToolIcon.cjs +6 -5
- package/dist/components/chat/ToolIcon.d.ts.map +1 -1
- package/dist/components/chat/ToolIcon.js +6 -5
- package/dist/components/chat/styled-boxes/ConfigBox.cjs +8 -7
- package/dist/components/chat/styled-boxes/ConfigBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/ConfigBox.js +8 -7
- package/dist/components/chat/styled-boxes/HelpBox.cjs +4 -3
- package/dist/components/chat/styled-boxes/HelpBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/HelpBox.js +4 -3
- package/dist/components/chat/styled-boxes/LogConfigBox.cjs +11 -3
- package/dist/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/LogConfigBox.js +11 -3
- package/dist/components/chat/styled-boxes/SessionHistoryBox.cjs +8 -7
- package/dist/components/chat/styled-boxes/SessionHistoryBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/SessionHistoryBox.js +8 -7
- package/dist/components/chat/styled-boxes/SessionListBox.cjs +19 -11
- package/dist/components/chat/styled-boxes/SessionListBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/SessionListBox.js +19 -11
- package/dist/components/chat/styled-boxes/ShortcutsBox.cjs +4 -3
- package/dist/components/chat/styled-boxes/ShortcutsBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/ShortcutsBox.js +4 -3
- package/dist/components/chat/styled-boxes/StatsBox.cjs +13 -5
- package/dist/components/chat/styled-boxes/StatsBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/StatsBox.js +13 -5
- package/dist/components/chat/styled-boxes/StyledBox.cjs +7 -6
- package/dist/components/chat/styled-boxes/StyledBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/StyledBox.js +7 -6
- package/dist/components/chat/styled-boxes/SyspromptBox.cjs +2 -1
- package/dist/components/chat/styled-boxes/SyspromptBox.d.ts.map +1 -1
- package/dist/components/chat/styled-boxes/SyspromptBox.js +2 -1
- package/dist/components/modes/AlternateBufferCLI.cjs +53 -43
- package/dist/components/modes/AlternateBufferCLI.d.ts.map +1 -1
- package/dist/components/modes/AlternateBufferCLI.js +53 -43
- package/dist/components/modes/StaticCLI.cjs +53 -42
- package/dist/components/modes/StaticCLI.d.ts.map +1 -1
- package/dist/components/modes/StaticCLI.js +53 -42
- package/dist/components/overlays/ApiKeyInput.cjs +12 -11
- package/dist/components/overlays/ApiKeyInput.d.ts.map +1 -1
- package/dist/components/overlays/ApiKeyInput.js +12 -11
- package/dist/components/overlays/ChatGPTUsageCapOverlay.cjs +7 -6
- package/dist/components/overlays/ChatGPTUsageCapOverlay.d.ts.map +1 -1
- package/dist/components/overlays/ChatGPTUsageCapOverlay.js +7 -6
- package/dist/components/overlays/CommandOutputOverlay.cjs +2 -1
- package/dist/components/overlays/CommandOutputOverlay.d.ts.map +1 -1
- package/dist/components/overlays/CommandOutputOverlay.js +2 -1
- package/dist/components/overlays/ConnectOverlay.cjs +10 -9
- package/dist/components/overlays/ConnectOverlay.d.ts.map +1 -1
- package/dist/components/overlays/ConnectOverlay.js +10 -9
- package/dist/components/overlays/ContextStatsOverlay.cjs +48 -37
- package/dist/components/overlays/ContextStatsOverlay.d.ts.map +1 -1
- package/dist/components/overlays/ContextStatsOverlay.js +48 -37
- package/dist/components/overlays/CustomModelWizard.cjs +5 -4
- package/dist/components/overlays/CustomModelWizard.d.ts.map +1 -1
- package/dist/components/overlays/CustomModelWizard.js +5 -4
- package/dist/components/overlays/ExportWizard.cjs +28 -27
- package/dist/components/overlays/ExportWizard.d.ts.map +1 -1
- package/dist/components/overlays/ExportWizard.js +28 -27
- package/dist/components/overlays/InsufficientCreditsOverlay.cjs +25 -9
- package/dist/components/overlays/InsufficientCreditsOverlay.d.ts +2 -0
- package/dist/components/overlays/InsufficientCreditsOverlay.d.ts.map +1 -1
- package/dist/components/overlays/InsufficientCreditsOverlay.js +25 -9
- package/dist/components/overlays/LogLevelSelector.cjs +6 -5
- package/dist/components/overlays/LogLevelSelector.d.ts.map +1 -1
- package/dist/components/overlays/LogLevelSelector.js +6 -5
- package/dist/components/overlays/LoginOverlay.cjs +31 -66
- package/dist/components/overlays/LoginOverlay.d.ts +1 -3
- package/dist/components/overlays/LoginOverlay.d.ts.map +1 -1
- package/dist/components/overlays/LoginOverlay.js +32 -71
- package/dist/components/overlays/LogoutOverlay.cjs +16 -24
- package/dist/components/overlays/LogoutOverlay.d.ts +1 -0
- package/dist/components/overlays/LogoutOverlay.d.ts.map +1 -1
- package/dist/components/overlays/LogoutOverlay.js +18 -38
- package/dist/components/overlays/MarketplaceAddPrompt.cjs +12 -11
- package/dist/components/overlays/MarketplaceAddPrompt.d.ts.map +1 -1
- package/dist/components/overlays/MarketplaceAddPrompt.js +12 -11
- package/dist/components/overlays/MarketplaceBrowser.cjs +27 -26
- package/dist/components/overlays/MarketplaceBrowser.d.ts.map +1 -1
- package/dist/components/overlays/MarketplaceBrowser.js +27 -26
- package/dist/components/overlays/McpAddChoice.cjs +4 -3
- package/dist/components/overlays/McpAddChoice.d.ts.map +1 -1
- package/dist/components/overlays/McpAddChoice.js +4 -3
- package/dist/components/overlays/McpAddSelector.cjs +4 -3
- package/dist/components/overlays/McpAddSelector.d.ts.map +1 -1
- package/dist/components/overlays/McpAddSelector.js +4 -3
- package/dist/components/overlays/McpCustomTypeSelector.cjs +4 -3
- package/dist/components/overlays/McpCustomTypeSelector.d.ts.map +1 -1
- package/dist/components/overlays/McpCustomTypeSelector.js +4 -3
- package/dist/components/overlays/McpCustomWizard.cjs +9 -8
- package/dist/components/overlays/McpCustomWizard.d.ts.map +1 -1
- package/dist/components/overlays/McpCustomWizard.js +9 -8
- package/dist/components/overlays/McpRemoveSelector.cjs +5 -4
- package/dist/components/overlays/McpRemoveSelector.d.ts.map +1 -1
- package/dist/components/overlays/McpRemoveSelector.js +5 -4
- package/dist/components/overlays/McpSelector.cjs +4 -3
- package/dist/components/overlays/McpSelector.d.ts.map +1 -1
- package/dist/components/overlays/McpSelector.js +4 -3
- package/dist/components/overlays/McpServerActions.cjs +7 -6
- package/dist/components/overlays/McpServerActions.d.ts.map +1 -1
- package/dist/components/overlays/McpServerActions.js +7 -6
- package/dist/components/overlays/McpServerList.cjs +6 -5
- package/dist/components/overlays/McpServerList.d.ts.map +1 -1
- package/dist/components/overlays/McpServerList.js +6 -5
- package/dist/components/overlays/ModelSelectorRefactored.cjs +32 -17
- package/dist/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
- package/dist/components/overlays/ModelSelectorRefactored.js +32 -17
- package/dist/components/overlays/PermissionsSelector.cjs +6 -5
- package/dist/components/overlays/PermissionsSelector.d.ts.map +1 -1
- package/dist/components/overlays/PermissionsSelector.js +6 -5
- package/dist/components/overlays/PluginActions.cjs +7 -6
- package/dist/components/overlays/PluginActions.d.ts.map +1 -1
- package/dist/components/overlays/PluginActions.js +7 -6
- package/dist/components/overlays/PluginList.cjs +12 -11
- package/dist/components/overlays/PluginList.d.ts.map +1 -1
- package/dist/components/overlays/PluginList.js +12 -11
- package/dist/components/overlays/PluginManager.cjs +13 -5
- package/dist/components/overlays/PluginManager.d.ts.map +1 -1
- package/dist/components/overlays/PluginManager.js +13 -5
- package/dist/components/overlays/PromptAddChoice.cjs +5 -4
- package/dist/components/overlays/PromptAddChoice.d.ts.map +1 -1
- package/dist/components/overlays/PromptAddChoice.js +5 -4
- package/dist/components/overlays/PromptAddWizard.cjs +10 -9
- package/dist/components/overlays/PromptAddWizard.d.ts.map +1 -1
- package/dist/components/overlays/PromptAddWizard.js +10 -9
- package/dist/components/overlays/PromptDeleteSelector.cjs +6 -5
- package/dist/components/overlays/PromptDeleteSelector.d.ts.map +1 -1
- package/dist/components/overlays/PromptDeleteSelector.js +6 -5
- package/dist/components/overlays/PromptList.cjs +10 -9
- package/dist/components/overlays/PromptList.d.ts.map +1 -1
- package/dist/components/overlays/PromptList.js +10 -9
- package/dist/components/overlays/ReasoningOverlay.cjs +30 -23
- package/dist/components/overlays/ReasoningOverlay.d.ts.map +1 -1
- package/dist/components/overlays/ReasoningOverlay.js +30 -23
- package/dist/components/overlays/SearchOverlay.cjs +15 -14
- package/dist/components/overlays/SearchOverlay.d.ts.map +1 -1
- package/dist/components/overlays/SearchOverlay.js +15 -14
- package/dist/components/overlays/SessionRenameOverlay.cjs +9 -8
- package/dist/components/overlays/SessionRenameOverlay.d.ts.map +1 -1
- package/dist/components/overlays/SessionRenameOverlay.js +9 -8
- package/dist/components/overlays/SessionSelectorRefactored.cjs +4 -3
- package/dist/components/overlays/SessionSelectorRefactored.d.ts.map +1 -1
- package/dist/components/overlays/SessionSelectorRefactored.js +4 -3
- package/dist/components/overlays/SessionSubcommandSelector.cjs +4 -3
- package/dist/components/overlays/SessionSubcommandSelector.d.ts.map +1 -1
- package/dist/components/overlays/SessionSubcommandSelector.js +4 -3
- package/dist/components/overlays/SoundsSelector.cjs +15 -7
- package/dist/components/overlays/SoundsSelector.d.ts.map +1 -1
- package/dist/components/overlays/SoundsSelector.js +15 -7
- package/dist/components/overlays/StreamSelector.cjs +5 -4
- package/dist/components/overlays/StreamSelector.d.ts.map +1 -1
- package/dist/components/overlays/StreamSelector.js +5 -4
- package/dist/components/overlays/ToolBrowser.cjs +73 -56
- package/dist/components/overlays/ToolBrowser.d.ts.map +1 -1
- package/dist/components/overlays/ToolBrowser.js +73 -56
- package/dist/components/overlays/custom-model-wizard/LocalModelWizard.cjs +103 -69
- package/dist/components/overlays/custom-model-wizard/LocalModelWizard.d.ts.map +1 -1
- package/dist/components/overlays/custom-model-wizard/LocalModelWizard.js +103 -69
- package/dist/components/overlays/custom-model-wizard/provider-config.cjs +4 -4
- package/dist/components/overlays/custom-model-wizard/provider-config.js +4 -4
- package/dist/components/overlays/custom-model-wizard/shared/ApiKeyStep.cjs +3 -2
- package/dist/components/overlays/custom-model-wizard/shared/ApiKeyStep.d.ts.map +1 -1
- package/dist/components/overlays/custom-model-wizard/shared/ApiKeyStep.js +3 -2
- package/dist/components/overlays/custom-model-wizard/shared/ProviderSelector.cjs +5 -4
- package/dist/components/overlays/custom-model-wizard/shared/ProviderSelector.d.ts.map +1 -1
- package/dist/components/overlays/custom-model-wizard/shared/ProviderSelector.js +5 -4
- package/dist/components/overlays/custom-model-wizard/shared/SetupInfoBanner.cjs +4 -3
- package/dist/components/overlays/custom-model-wizard/shared/SetupInfoBanner.d.ts.map +1 -1
- package/dist/components/overlays/custom-model-wizard/shared/SetupInfoBanner.js +4 -3
- package/dist/components/overlays/custom-model-wizard/shared/WizardStepInput.cjs +7 -6
- package/dist/components/overlays/custom-model-wizard/shared/WizardStepInput.d.ts.map +1 -1
- package/dist/components/overlays/custom-model-wizard/shared/WizardStepInput.js +7 -6
- package/dist/components/renderers/DiffRenderer.cjs +5 -4
- package/dist/components/renderers/DiffRenderer.d.ts.map +1 -1
- package/dist/components/renderers/DiffRenderer.js +5 -4
- package/dist/components/renderers/FilePreviewRenderer.cjs +23 -13
- package/dist/components/renderers/FilePreviewRenderer.d.ts.map +1 -1
- package/dist/components/renderers/FilePreviewRenderer.js +23 -13
- package/dist/components/renderers/FileRenderer.cjs +9 -8
- package/dist/components/renderers/FileRenderer.d.ts.map +1 -1
- package/dist/components/renderers/FileRenderer.js +9 -8
- package/dist/components/renderers/GenericRenderer.cjs +5 -4
- package/dist/components/renderers/GenericRenderer.d.ts.map +1 -1
- package/dist/components/renderers/GenericRenderer.js +5 -4
- package/dist/components/renderers/SearchRenderer.cjs +4 -3
- package/dist/components/renderers/SearchRenderer.d.ts.map +1 -1
- package/dist/components/renderers/SearchRenderer.js +4 -3
- package/dist/components/renderers/ShellRenderer.cjs +6 -5
- package/dist/components/renderers/ShellRenderer.d.ts.map +1 -1
- package/dist/components/renderers/ShellRenderer.js +6 -5
- package/dist/components/renderers/SignalDiff.cjs +139 -0
- package/dist/components/renderers/SignalDiff.d.ts +21 -0
- package/dist/components/renderers/SignalDiff.d.ts.map +1 -0
- package/dist/components/renderers/SignalDiff.js +106 -0
- package/dist/components/renderers/SignalDiff.test.cjs +78 -0
- package/dist/components/renderers/SignalDiff.test.d.ts +2 -0
- package/dist/components/renderers/SignalDiff.test.d.ts.map +1 -0
- package/dist/components/renderers/SignalDiff.test.js +77 -0
- package/dist/components/renderers/diff-shared.cjs +13 -7
- package/dist/components/renderers/diff-shared.d.ts +5 -0
- package/dist/components/renderers/diff-shared.d.ts.map +1 -1
- package/dist/components/renderers/diff-shared.js +12 -7
- package/dist/components/shared/FocusOverlayFrame.cjs +3 -2
- package/dist/components/shared/FocusOverlayFrame.d.ts.map +1 -1
- package/dist/components/shared/FocusOverlayFrame.js +3 -2
- package/dist/components/shared/HintBar.cjs +2 -1
- package/dist/components/shared/HintBar.d.ts.map +1 -1
- package/dist/components/shared/HintBar.js +2 -1
- package/dist/components/shared/MarkdownText.cjs +36 -53
- package/dist/components/shared/MarkdownText.d.ts +2 -0
- package/dist/components/shared/MarkdownText.d.ts.map +1 -1
- package/dist/components/shared/MarkdownText.js +36 -54
- package/dist/components/shared/VirtualizedList.cjs +2 -1
- package/dist/components/shared/VirtualizedList.d.ts.map +1 -1
- package/dist/components/shared/VirtualizedList.js +2 -1
- package/dist/containers/OverlayContainer.cjs +32 -44
- package/dist/containers/OverlayContainer.d.ts.map +1 -1
- package/dist/containers/OverlayContainer.js +32 -44
- package/dist/contexts/KeypressContext.cjs +7 -1
- package/dist/contexts/KeypressContext.d.ts.map +1 -1
- package/dist/contexts/KeypressContext.js +7 -1
- package/dist/contexts/KeypressContext.test.cjs +82 -0
- package/dist/contexts/KeypressContext.test.d.ts +2 -0
- package/dist/contexts/KeypressContext.test.d.ts.map +1 -0
- package/dist/contexts/KeypressContext.test.js +81 -0
- package/dist/hooks/useAgentEvents.cjs +1 -74
- package/dist/hooks/useAgentEvents.d.ts.map +1 -1
- package/dist/hooks/useAgentEvents.js +1 -74
- package/dist/hooks/useCLIState.cjs +0 -3
- package/dist/hooks/useCLIState.d.ts.map +1 -1
- package/dist/hooks/useCLIState.js +0 -3
- package/dist/hooks/useContextStats.cjs +91 -0
- package/dist/hooks/useContextStats.d.ts +13 -0
- package/dist/hooks/useContextStats.d.ts.map +1 -0
- package/dist/hooks/useContextStats.js +67 -0
- package/dist/hooks/useDeckState.cjs +140 -0
- package/dist/hooks/useDeckState.d.ts +20 -0
- package/dist/hooks/useDeckState.d.ts.map +1 -0
- package/dist/hooks/useDeckState.js +123 -0
- package/dist/hooks/useDextoCredits.cjs +81 -0
- package/dist/hooks/useDextoCredits.d.ts +14 -0
- package/dist/hooks/useDextoCredits.d.ts.map +1 -0
- package/dist/hooks/useDextoCredits.js +56 -0
- package/dist/hooks/useDextoCredits.test.cjs +73 -0
- package/dist/hooks/useDextoCredits.test.d.ts +2 -0
- package/dist/hooks/useDextoCredits.test.d.ts.map +1 -0
- package/dist/hooks/useDextoCredits.test.js +72 -0
- package/dist/hooks/useElapsedTime.cjs +13 -24
- package/dist/hooks/useElapsedTime.d.ts +3 -1
- package/dist/hooks/useElapsedTime.d.ts.map +1 -1
- package/dist/hooks/useElapsedTime.js +13 -24
- package/dist/hooks/useElapsedTime.test.cjs +35 -0
- package/dist/hooks/useElapsedTime.test.d.ts +2 -0
- package/dist/hooks/useElapsedTime.test.d.ts.map +1 -0
- package/dist/hooks/useElapsedTime.test.js +34 -0
- package/dist/hooks/useGitDirtyFiles.cjs +59 -0
- package/dist/hooks/useGitDirtyFiles.d.ts +5 -0
- package/dist/hooks/useGitDirtyFiles.d.ts.map +1 -0
- package/dist/hooks/useGitDirtyFiles.js +34 -0
- package/dist/hooks/useGitDirtyFiles.test.cjs +9 -0
- package/dist/hooks/useGitDirtyFiles.test.d.ts +2 -0
- package/dist/hooks/useGitDirtyFiles.test.d.ts.map +1 -0
- package/dist/hooks/useGitDirtyFiles.test.js +8 -0
- package/dist/hooks/useHeldValue.cjs +33 -0
- package/dist/hooks/useHeldValue.d.ts +3 -0
- package/dist/hooks/useHeldValue.d.ts.map +1 -0
- package/dist/hooks/useHeldValue.js +9 -0
- package/dist/hooks/useHeldValue.test.cjs +31 -0
- package/dist/hooks/useHeldValue.test.d.ts +2 -0
- package/dist/hooks/useHeldValue.test.d.ts.map +1 -0
- package/dist/hooks/useHeldValue.test.js +30 -0
- package/dist/hooks/useInputOrchestrator.cjs +22 -30
- package/dist/hooks/useInputOrchestrator.d.ts +2 -0
- package/dist/hooks/useInputOrchestrator.d.ts.map +1 -1
- package/dist/hooks/useInputOrchestrator.js +21 -30
- package/dist/hooks/useInputOrchestrator.test.cjs +24 -0
- package/dist/hooks/useInputOrchestrator.test.d.ts +2 -0
- package/dist/hooks/useInputOrchestrator.test.d.ts.map +1 -0
- package/dist/hooks/useInputOrchestrator.test.js +23 -0
- package/dist/host/index.cjs +22 -49
- package/dist/host/index.d.ts +18 -72
- package/dist/host/index.d.ts.map +1 -1
- package/dist/host/index.js +18 -42
- package/dist/host/index.test.cjs +21 -35
- package/dist/host/index.test.js +22 -40
- package/dist/index.d.cts +13 -52
- package/dist/interactive-commands/command-parser.cjs +13 -21
- package/dist/interactive-commands/command-parser.d.ts.map +1 -1
- package/dist/interactive-commands/command-parser.js +13 -11
- package/dist/interactive-commands/general-commands.cjs +8 -7
- package/dist/interactive-commands/general-commands.d.ts.map +1 -1
- package/dist/interactive-commands/general-commands.js +8 -7
- package/dist/services/processStream.cjs +33 -21
- package/dist/services/processStream.d.ts.map +1 -1
- package/dist/services/processStream.js +34 -22
- package/dist/services/processStream.test.cjs +52 -4
- package/dist/services/processStream.test.js +52 -4
- package/dist/signal/background.cjs +154 -0
- package/dist/signal/background.d.ts +43 -0
- package/dist/signal/background.d.ts.map +1 -0
- package/dist/signal/background.js +124 -0
- package/dist/signal/background.test.cjs +186 -0
- package/dist/signal/background.test.d.ts +2 -0
- package/dist/signal/background.test.d.ts.map +1 -0
- package/dist/signal/background.test.js +192 -0
- package/dist/signal/caps.cjs +100 -0
- package/dist/signal/caps.d.ts +23 -0
- package/dist/signal/caps.d.ts.map +1 -0
- package/dist/signal/caps.js +73 -0
- package/dist/signal/caps.test.cjs +56 -0
- package/dist/signal/caps.test.d.ts +2 -0
- package/dist/signal/caps.test.d.ts.map +1 -0
- package/dist/signal/caps.test.js +55 -0
- package/dist/signal/components.cjs +257 -0
- package/dist/signal/components.d.ts +120 -0
- package/dist/signal/components.d.ts.map +1 -0
- package/dist/signal/components.js +226 -0
- package/dist/signal/components.test.cjs +156 -0
- package/dist/signal/components.test.d.ts +2 -0
- package/dist/signal/components.test.d.ts.map +1 -0
- package/dist/signal/components.test.js +133 -0
- package/dist/signal/cut.cjs +103 -0
- package/dist/signal/cut.d.ts +11 -0
- package/dist/signal/cut.d.ts.map +1 -0
- package/dist/signal/cut.js +77 -0
- package/dist/signal/cut.test.cjs +20 -0
- package/dist/signal/cut.test.d.ts +2 -0
- package/dist/signal/cut.test.d.ts.map +1 -0
- package/dist/signal/cut.test.js +19 -0
- package/dist/signal/deck-layout.cjs +57 -0
- package/dist/signal/deck-layout.d.ts +29 -0
- package/dist/signal/deck-layout.d.ts.map +1 -0
- package/dist/signal/deck-layout.js +30 -0
- package/dist/signal/deck-parts.cjs +243 -0
- package/dist/signal/deck-parts.d.ts +55 -0
- package/dist/signal/deck-parts.d.ts.map +1 -0
- package/dist/signal/deck-parts.js +205 -0
- package/dist/signal/deck.test.cjs +311 -0
- package/dist/signal/deck.test.d.ts +2 -0
- package/dist/signal/deck.test.d.ts.map +1 -0
- package/dist/signal/deck.test.js +288 -0
- package/dist/signal/glyphs.cjs +195 -0
- package/dist/signal/glyphs.d.ts +8 -0
- package/dist/signal/glyphs.d.ts.map +1 -0
- package/dist/signal/glyphs.js +171 -0
- package/dist/signal/glyphs.test.cjs +17 -0
- package/dist/signal/glyphs.test.d.ts +2 -0
- package/dist/signal/glyphs.test.d.ts.map +1 -0
- package/dist/signal/glyphs.test.js +16 -0
- package/dist/signal/harness.cjs +103 -0
- package/dist/signal/harness.d.ts +70 -0
- package/dist/signal/harness.d.ts.map +1 -0
- package/dist/signal/harness.js +67 -0
- package/dist/signal/harness.test.cjs +84 -0
- package/dist/signal/harness.test.d.ts +2 -0
- package/dist/signal/harness.test.d.ts.map +1 -0
- package/dist/signal/harness.test.js +61 -0
- package/dist/signal/index.cjs +76 -0
- package/dist/signal/index.d.ts +8 -0
- package/dist/signal/index.d.ts.map +1 -0
- package/dist/signal/index.js +45 -0
- package/dist/signal/kit.snapshot.test.cjs +56 -0
- package/dist/signal/kit.snapshot.test.d.ts +2 -0
- package/dist/signal/kit.snapshot.test.d.ts.map +1 -0
- package/dist/signal/kit.snapshot.test.js +55 -0
- package/dist/signal/no-raw-colours.test.cjs +32 -0
- package/dist/signal/no-raw-colours.test.d.ts +2 -0
- package/dist/signal/no-raw-colours.test.d.ts.map +1 -0
- package/dist/signal/no-raw-colours.test.js +30 -0
- package/dist/signal/paint.cjs +76 -0
- package/dist/signal/paint.d.ts +15 -0
- package/dist/signal/paint.d.ts.map +1 -0
- package/dist/signal/paint.js +41 -0
- package/dist/signal/paint.test.cjs +98 -0
- package/dist/signal/paint.test.d.ts +2 -0
- package/dist/signal/paint.test.d.ts.map +1 -0
- package/dist/signal/paint.test.js +75 -0
- package/dist/signal/tone.cjs +109 -0
- package/dist/signal/tone.d.ts +17 -0
- package/dist/signal/tone.d.ts.map +1 -0
- package/dist/signal/tone.js +83 -0
- package/dist/signal/tone.test.cjs +70 -0
- package/dist/signal/tone.test.d.ts +2 -0
- package/dist/signal/tone.test.d.ts.map +1 -0
- package/dist/signal/tone.test.js +69 -0
- package/dist/signal/trace.cjs +142 -0
- package/dist/signal/trace.d.ts +41 -0
- package/dist/signal/trace.d.ts.map +1 -0
- package/dist/signal/trace.js +113 -0
- package/dist/signal/trace.test.cjs +50 -0
- package/dist/signal/trace.test.d.ts +2 -0
- package/dist/signal/trace.test.d.ts.map +1 -0
- package/dist/signal/trace.test.js +49 -0
- package/dist/signal/use-trace.cjs +73 -0
- package/dist/signal/use-trace.d.ts +5 -0
- package/dist/signal/use-trace.d.ts.map +1 -0
- package/dist/signal/use-trace.js +48 -0
- package/dist/signal/wordmark-art.generated.cjs +375 -0
- package/dist/signal/wordmark-art.generated.d.ts +3 -0
- package/dist/signal/wordmark-art.generated.d.ts.map +1 -0
- package/dist/signal/wordmark-art.generated.js +351 -0
- package/dist/signal/wordmark.cjs +60 -0
- package/dist/signal/wordmark.d.ts +23 -0
- package/dist/signal/wordmark.d.ts.map +1 -0
- package/dist/signal/wordmark.js +34 -0
- package/dist/signal/wordmark.test.cjs +71 -0
- package/dist/signal/wordmark.test.d.ts +2 -0
- package/dist/signal/wordmark.test.d.ts.map +1 -0
- package/dist/signal/wordmark.test.js +70 -0
- package/dist/state/initialState.cjs +0 -3
- package/dist/state/initialState.d.ts.map +1 -1
- package/dist/state/initialState.js +0 -3
- package/dist/state/types.d.ts +13 -7
- package/dist/state/types.d.ts.map +1 -1
- package/dist/utils/approval-response.cjs +45 -0
- package/dist/utils/approval-response.d.ts +14 -0
- package/dist/utils/approval-response.d.ts.map +1 -0
- package/dist/utils/approval-response.js +21 -0
- package/dist/utils/approval-response.test.cjs +49 -0
- package/dist/utils/approval-response.test.d.ts +2 -0
- package/dist/utils/approval-response.test.d.ts.map +1 -0
- package/dist/utils/approval-response.test.js +55 -0
- package/dist/utils/approvalScope.cjs +12 -0
- package/dist/utils/approvalScope.d.ts.map +1 -1
- package/dist/utils/approvalScope.js +12 -0
- package/dist/utils/approvalScope.test.cjs +23 -0
- package/dist/utils/approvalScope.test.d.ts +2 -0
- package/dist/utils/approvalScope.test.d.ts.map +1 -0
- package/dist/utils/approvalScope.test.js +22 -0
- package/dist/utils/background-failure.cjs +51 -0
- package/dist/utils/background-failure.d.ts +12 -0
- package/dist/utils/background-failure.d.ts.map +1 -0
- package/dist/utils/background-failure.js +26 -0
- package/dist/utils/chatgpt-rate-limit.cjs +10 -0
- package/dist/utils/chatgpt-rate-limit.d.ts +9 -0
- package/dist/utils/chatgpt-rate-limit.d.ts.map +1 -1
- package/dist/utils/chatgpt-rate-limit.js +9 -0
- package/dist/utils/chatgpt-rate-limit.test.cjs +10 -0
- package/dist/utils/chatgpt-rate-limit.test.js +11 -0
- package/dist/utils/deck-state.cjs +107 -0
- package/dist/utils/deck-state.d.ts +79 -0
- package/dist/utils/deck-state.d.ts.map +1 -0
- package/dist/utils/deck-state.js +76 -0
- package/dist/utils/deck-state.test.cjs +208 -0
- package/dist/utils/deck-state.test.d.ts +2 -0
- package/dist/utils/deck-state.test.d.ts.map +1 -0
- package/dist/utils/deck-state.test.js +216 -0
- package/dist/utils/fault-block.cjs +37 -0
- package/dist/utils/fault-block.d.ts +13 -0
- package/dist/utils/fault-block.d.ts.map +1 -0
- package/dist/utils/fault-block.js +13 -0
- package/dist/utils/fault-block.test.cjs +23 -0
- package/dist/utils/fault-block.test.d.ts +2 -0
- package/dist/utils/fault-block.test.d.ts.map +1 -0
- package/dist/utils/fault-block.test.js +22 -0
- package/dist/utils/llm-provider-display.cjs +1 -1
- package/dist/utils/llm-provider-display.js +1 -1
- package/dist/utils/messageFormatting.cjs +26 -23
- package/dist/utils/messageFormatting.d.ts +5 -2
- package/dist/utils/messageFormatting.d.ts.map +1 -1
- package/dist/utils/messageFormatting.js +25 -21
- package/dist/utils/messageFormatting.test.cjs +34 -0
- package/dist/utils/messageFormatting.test.js +35 -1
- package/dist/utils/reasoning-variant.cjs +35 -0
- package/dist/utils/reasoning-variant.d.ts +13 -0
- package/dist/utils/reasoning-variant.d.ts.map +1 -0
- package/dist/utils/reasoning-variant.js +11 -0
- package/dist/utils/resize-reflow.cjs +119 -0
- package/dist/utils/resize-reflow.d.ts +18 -0
- package/dist/utils/resize-reflow.d.ts.map +1 -0
- package/dist/utils/resize-reflow.js +83 -0
- package/dist/utils/resize-reflow.test.cjs +100 -0
- package/dist/utils/resize-reflow.test.d.ts +2 -0
- package/dist/utils/resize-reflow.test.d.ts.map +1 -0
- package/dist/utils/resize-reflow.test.js +99 -0
- package/dist/utils/tool-step.cjs +183 -0
- package/dist/utils/tool-step.d.ts +28 -0
- package/dist/utils/tool-step.d.ts.map +1 -0
- package/dist/utils/tool-step.js +156 -0
- package/dist/utils/tool-step.test.cjs +263 -0
- package/dist/utils/tool-step.test.d.ts +2 -0
- package/dist/utils/tool-step.test.d.ts.map +1 -0
- package/dist/utils/tool-step.test.js +262 -0
- package/package.json +9 -5
- package/dist/components/BackgroundTasksPanel.cjs +0 -117
- package/dist/components/BackgroundTasksPanel.d.ts +0 -18
- package/dist/components/BackgroundTasksPanel.d.ts.map +0 -1
- package/dist/components/BackgroundTasksPanel.js +0 -93
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var import_react = require("react");
|
|
25
|
+
var import_ink = require("ink");
|
|
26
|
+
var import_chalk = __toESM(require("chalk"), 1);
|
|
27
|
+
var import_vitest = require("vitest");
|
|
28
|
+
var import_caps = require("./caps.js");
|
|
29
|
+
var import_harness = require("./harness.js");
|
|
30
|
+
var import_tone = require("./tone.js");
|
|
31
|
+
function Teal() {
|
|
32
|
+
const tone = (0, import_tone.useTone)();
|
|
33
|
+
return (0, import_react.createElement)(import_ink.Text, { color: tone("teal") }, "hi");
|
|
34
|
+
}
|
|
35
|
+
(0, import_vitest.describe)("renderFrame", () => {
|
|
36
|
+
(0, import_vitest.it)("returns the frame as plain text on a terminal without colour", () => {
|
|
37
|
+
(0, import_vitest.expect)((0, import_harness.renderFrame)((0, import_react.createElement)(Teal), { columns: 40, terminal: "no-color" })).toBe("hi");
|
|
38
|
+
});
|
|
39
|
+
(0, import_vitest.it)("draws each terminal with its own palette, with escapes made visible", () => {
|
|
40
|
+
const frame = (terminal) => (0, import_harness.renderFrame)((0, import_react.createElement)(Teal), { columns: 40, terminal });
|
|
41
|
+
(0, import_vitest.expect)(frame("truecolor-dark")).toBe("\u241B[38;2;78;201;176mhi\u241B[39m");
|
|
42
|
+
(0, import_vitest.expect)(frame("truecolor-light")).toBe("\u241B[38;2;11;122;104mhi\u241B[39m");
|
|
43
|
+
(0, import_vitest.expect)(frame("256-dark")).toBe("\u241B[38;5;115mhi\u241B[39m");
|
|
44
|
+
(0, import_vitest.expect)(frame("16-dark")).toBe("\u241B[36mhi\u241B[39m");
|
|
45
|
+
});
|
|
46
|
+
(0, import_vitest.it)("wraps at the given width", () => {
|
|
47
|
+
const long = (0, import_react.createElement)(import_ink.Text, null, "aaaa bbbb");
|
|
48
|
+
(0, import_vitest.expect)((0, import_harness.renderFrame)(long, { columns: 5, terminal: "no-color" })).toBe("aaaa\nbbbb");
|
|
49
|
+
});
|
|
50
|
+
(0, import_vitest.it)("draws only the settled frame after an update on mount", () => {
|
|
51
|
+
function Settles() {
|
|
52
|
+
const [word, setWord] = (0, import_react.useState)("first");
|
|
53
|
+
(0, import_react.useLayoutEffect)(() => setWord("settled"), []);
|
|
54
|
+
return (0, import_react.createElement)(import_ink.Text, null, word);
|
|
55
|
+
}
|
|
56
|
+
(0, import_vitest.expect)((0, import_harness.renderFrame)((0, import_react.createElement)(Settles), { columns: 40, terminal: "no-color" })).toBe(
|
|
57
|
+
"settled"
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
(0, import_vitest.it)("returns an empty frame when an update on mount clears the screen", () => {
|
|
61
|
+
function Clears() {
|
|
62
|
+
const [shown, setShown] = (0, import_react.useState)(true);
|
|
63
|
+
(0, import_react.useLayoutEffect)(() => setShown(false), []);
|
|
64
|
+
return shown ? (0, import_react.createElement)(import_ink.Text, null, "first") : null;
|
|
65
|
+
}
|
|
66
|
+
(0, import_vitest.expect)((0, import_harness.renderFrame)((0, import_react.createElement)(Clears), { columns: 40, terminal: "no-color" })).toBe("");
|
|
67
|
+
});
|
|
68
|
+
(0, import_vitest.it)("puts the process-wide caps and chalk level back, even when rendering throws", () => {
|
|
69
|
+
const caps = (0, import_caps.getCaps)();
|
|
70
|
+
const level = import_chalk.default.level;
|
|
71
|
+
(0, import_harness.renderFrame)((0, import_react.createElement)(Teal), { columns: 40, terminal: "truecolor-light" });
|
|
72
|
+
(0, import_vitest.expect)((0, import_caps.getCaps)()).toBe(caps);
|
|
73
|
+
(0, import_vitest.expect)(import_chalk.default.level).toBe(level);
|
|
74
|
+
function Throws() {
|
|
75
|
+
throw new Error("boom");
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
(0, import_harness.renderFrame)((0, import_react.createElement)(Throws), { columns: 40, terminal: "truecolor-light" });
|
|
79
|
+
} catch {
|
|
80
|
+
}
|
|
81
|
+
(0, import_vitest.expect)((0, import_caps.getCaps)()).toBe(caps);
|
|
82
|
+
(0, import_vitest.expect)(import_chalk.default.level).toBe(level);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness.test.d.ts","sourceRoot":"","sources":["../../src/signal/harness.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createElement, useLayoutEffect, useState } from "react";
|
|
2
|
+
import { Text } from "ink";
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import { getCaps } from "./caps.js";
|
|
6
|
+
import { renderFrame } from "./harness.js";
|
|
7
|
+
import { useTone } from "./tone.js";
|
|
8
|
+
function Teal() {
|
|
9
|
+
const tone = useTone();
|
|
10
|
+
return createElement(Text, { color: tone("teal") }, "hi");
|
|
11
|
+
}
|
|
12
|
+
describe("renderFrame", () => {
|
|
13
|
+
it("returns the frame as plain text on a terminal without colour", () => {
|
|
14
|
+
expect(renderFrame(createElement(Teal), { columns: 40, terminal: "no-color" })).toBe("hi");
|
|
15
|
+
});
|
|
16
|
+
it("draws each terminal with its own palette, with escapes made visible", () => {
|
|
17
|
+
const frame = (terminal) => renderFrame(createElement(Teal), { columns: 40, terminal });
|
|
18
|
+
expect(frame("truecolor-dark")).toBe("\u241B[38;2;78;201;176mhi\u241B[39m");
|
|
19
|
+
expect(frame("truecolor-light")).toBe("\u241B[38;2;11;122;104mhi\u241B[39m");
|
|
20
|
+
expect(frame("256-dark")).toBe("\u241B[38;5;115mhi\u241B[39m");
|
|
21
|
+
expect(frame("16-dark")).toBe("\u241B[36mhi\u241B[39m");
|
|
22
|
+
});
|
|
23
|
+
it("wraps at the given width", () => {
|
|
24
|
+
const long = createElement(Text, null, "aaaa bbbb");
|
|
25
|
+
expect(renderFrame(long, { columns: 5, terminal: "no-color" })).toBe("aaaa\nbbbb");
|
|
26
|
+
});
|
|
27
|
+
it("draws only the settled frame after an update on mount", () => {
|
|
28
|
+
function Settles() {
|
|
29
|
+
const [word, setWord] = useState("first");
|
|
30
|
+
useLayoutEffect(() => setWord("settled"), []);
|
|
31
|
+
return createElement(Text, null, word);
|
|
32
|
+
}
|
|
33
|
+
expect(renderFrame(createElement(Settles), { columns: 40, terminal: "no-color" })).toBe(
|
|
34
|
+
"settled"
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
it("returns an empty frame when an update on mount clears the screen", () => {
|
|
38
|
+
function Clears() {
|
|
39
|
+
const [shown, setShown] = useState(true);
|
|
40
|
+
useLayoutEffect(() => setShown(false), []);
|
|
41
|
+
return shown ? createElement(Text, null, "first") : null;
|
|
42
|
+
}
|
|
43
|
+
expect(renderFrame(createElement(Clears), { columns: 40, terminal: "no-color" })).toBe("");
|
|
44
|
+
});
|
|
45
|
+
it("puts the process-wide caps and chalk level back, even when rendering throws", () => {
|
|
46
|
+
const caps = getCaps();
|
|
47
|
+
const level = chalk.level;
|
|
48
|
+
renderFrame(createElement(Teal), { columns: 40, terminal: "truecolor-light" });
|
|
49
|
+
expect(getCaps()).toBe(caps);
|
|
50
|
+
expect(chalk.level).toBe(level);
|
|
51
|
+
function Throws() {
|
|
52
|
+
throw new Error("boom");
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
renderFrame(createElement(Throws), { columns: 40, terminal: "truecolor-light" });
|
|
56
|
+
} catch {
|
|
57
|
+
}
|
|
58
|
+
expect(getCaps()).toBe(caps);
|
|
59
|
+
expect(chalk.level).toBe(level);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var signal_exports = {};
|
|
20
|
+
__export(signal_exports, {
|
|
21
|
+
ActorRow: () => import_components.ActorRow,
|
|
22
|
+
CUT_ROWS: () => import_cut.CUT_ROWS,
|
|
23
|
+
CutText: () => import_components.CutText,
|
|
24
|
+
DECK_MODES: () => import_components.DECK_MODES,
|
|
25
|
+
Deck: () => import_components.Deck,
|
|
26
|
+
GateFrame: () => import_components.GateFrame,
|
|
27
|
+
StepRow: () => import_components.StepRow,
|
|
28
|
+
Wordmark: () => import_components.Wordmark,
|
|
29
|
+
actorMarginWidth: () => import_components.actorMarginWidth,
|
|
30
|
+
cutLines: () => import_cut.cutLines,
|
|
31
|
+
cutWidth: () => import_cut.cutWidth,
|
|
32
|
+
detectBackgroundTheme: () => import_background.detectBackgroundTheme,
|
|
33
|
+
detectCaps: () => import_caps.detectCaps,
|
|
34
|
+
getCaps: () => import_caps.getCaps,
|
|
35
|
+
glyphText: () => import_glyphs.glyphText,
|
|
36
|
+
markdownChalk: () => import_paint.markdownChalk,
|
|
37
|
+
paint: () => import_paint.paint,
|
|
38
|
+
resolveTone: () => import_tone.resolveTone,
|
|
39
|
+
setCaps: () => import_caps.setCaps,
|
|
40
|
+
tone: () => import_tone.tone,
|
|
41
|
+
useCaps: () => import_caps.useCaps,
|
|
42
|
+
useTone: () => import_tone.useTone
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(signal_exports);
|
|
45
|
+
var import_caps = require("./caps.js");
|
|
46
|
+
var import_background = require("./background.js");
|
|
47
|
+
var import_tone = require("./tone.js");
|
|
48
|
+
var import_paint = require("./paint.js");
|
|
49
|
+
var import_glyphs = require("./glyphs.js");
|
|
50
|
+
var import_cut = require("./cut.js");
|
|
51
|
+
var import_components = require("./components.js");
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
ActorRow,
|
|
55
|
+
CUT_ROWS,
|
|
56
|
+
CutText,
|
|
57
|
+
DECK_MODES,
|
|
58
|
+
Deck,
|
|
59
|
+
GateFrame,
|
|
60
|
+
StepRow,
|
|
61
|
+
Wordmark,
|
|
62
|
+
actorMarginWidth,
|
|
63
|
+
cutLines,
|
|
64
|
+
cutWidth,
|
|
65
|
+
detectBackgroundTheme,
|
|
66
|
+
detectCaps,
|
|
67
|
+
getCaps,
|
|
68
|
+
glyphText,
|
|
69
|
+
markdownChalk,
|
|
70
|
+
paint,
|
|
71
|
+
resolveTone,
|
|
72
|
+
setCaps,
|
|
73
|
+
tone,
|
|
74
|
+
useCaps,
|
|
75
|
+
useTone
|
|
76
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { detectCaps, getCaps, setCaps, useCaps, type Caps, type ColorTier, type GlyphTier, type LogoTier, type Motion, type Palette, type ThemeName, } from './caps.js';
|
|
2
|
+
export { detectBackgroundTheme } from './background.js';
|
|
3
|
+
export { resolveTone, tone, useTone, type Role } from './tone.js';
|
|
4
|
+
export { markdownChalk, paint } from './paint.js';
|
|
5
|
+
export { glyphText } from './glyphs.js';
|
|
6
|
+
export { CUT_ROWS, cutLines, cutWidth } from './cut.js';
|
|
7
|
+
export { ActorRow, CutText, DECK_MODES, Deck, GateFrame, StepRow, Wordmark, actorMarginWidth, type ActorKind, type ActorRowProps, type CutTextProps, type DeckCredits, type DeckMode, type DeckProps, type DeckState, type DeckStatus, type DeckWhere, type GateFrameProps, type Step, type StepRowProps, type StepState, type WordmarkProps, } from './components.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EACV,OAAO,EACP,OAAO,EACP,OAAO,EACP,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,OAAO,EACZ,KAAK,SAAS,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EACH,QAAQ,EACR,OAAO,EACP,UAAU,EACV,IAAI,EACJ,SAAS,EACT,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,GACrB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
detectCaps,
|
|
3
|
+
getCaps,
|
|
4
|
+
setCaps,
|
|
5
|
+
useCaps
|
|
6
|
+
} from "./caps.js";
|
|
7
|
+
import { detectBackgroundTheme } from "./background.js";
|
|
8
|
+
import { resolveTone, tone, useTone } from "./tone.js";
|
|
9
|
+
import { markdownChalk, paint } from "./paint.js";
|
|
10
|
+
import { glyphText } from "./glyphs.js";
|
|
11
|
+
import { CUT_ROWS, cutLines, cutWidth } from "./cut.js";
|
|
12
|
+
import {
|
|
13
|
+
ActorRow,
|
|
14
|
+
CutText,
|
|
15
|
+
DECK_MODES,
|
|
16
|
+
Deck,
|
|
17
|
+
GateFrame,
|
|
18
|
+
StepRow,
|
|
19
|
+
Wordmark,
|
|
20
|
+
actorMarginWidth
|
|
21
|
+
} from "./components.js";
|
|
22
|
+
export {
|
|
23
|
+
ActorRow,
|
|
24
|
+
CUT_ROWS,
|
|
25
|
+
CutText,
|
|
26
|
+
DECK_MODES,
|
|
27
|
+
Deck,
|
|
28
|
+
GateFrame,
|
|
29
|
+
StepRow,
|
|
30
|
+
Wordmark,
|
|
31
|
+
actorMarginWidth,
|
|
32
|
+
cutLines,
|
|
33
|
+
cutWidth,
|
|
34
|
+
detectBackgroundTheme,
|
|
35
|
+
detectCaps,
|
|
36
|
+
getCaps,
|
|
37
|
+
glyphText,
|
|
38
|
+
markdownChalk,
|
|
39
|
+
paint,
|
|
40
|
+
resolveTone,
|
|
41
|
+
setCaps,
|
|
42
|
+
tone,
|
|
43
|
+
useCaps,
|
|
44
|
+
useTone
|
|
45
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var import_react = require("react");
|
|
3
|
+
var import_ink = require("ink");
|
|
4
|
+
var import_vitest = require("vitest");
|
|
5
|
+
var import_components = require("./components.js");
|
|
6
|
+
var import_harness = require("./harness.js");
|
|
7
|
+
const STEP = {
|
|
8
|
+
state: "ok",
|
|
9
|
+
verb: "EDIT",
|
|
10
|
+
target: "packages/tui/src/signal/tone.ts",
|
|
11
|
+
detail: "+12 \u22123",
|
|
12
|
+
time: "0.4s",
|
|
13
|
+
cloud: false
|
|
14
|
+
};
|
|
15
|
+
const PARTS = {
|
|
16
|
+
"Wordmark rows=1": (0, import_react.createElement)(import_components.Wordmark, { rows: 1 }),
|
|
17
|
+
"Wordmark rows=4": (0, import_react.createElement)(import_components.Wordmark, { rows: 4 }),
|
|
18
|
+
CutText: (0, import_react.createElement)(import_components.CutText, { text: "usage" }),
|
|
19
|
+
"ActorRow agent": (0, import_react.createElement)(import_components.ActorRow, {
|
|
20
|
+
actor: "agent",
|
|
21
|
+
children: (0, import_react.createElement)(import_ink.Text, null, "Fixed the auth tests.")
|
|
22
|
+
}),
|
|
23
|
+
"ActorRow cloud": (0, import_react.createElement)(import_components.ActorRow, {
|
|
24
|
+
actor: "cloud",
|
|
25
|
+
label: "nightly",
|
|
26
|
+
children: (0, import_react.createElement)(import_ink.Text, null, "Running on a Dexto computer.")
|
|
27
|
+
}),
|
|
28
|
+
"StepRow ok": (0, import_react.createElement)(import_components.StepRow, { step: STEP }),
|
|
29
|
+
"StepRow fail": (0, import_react.createElement)(import_components.StepRow, { step: { ...STEP, state: "fail", detail: null } }),
|
|
30
|
+
"StepRow wait": (0, import_react.createElement)(import_components.StepRow, { step: { ...STEP, state: "wait", time: null } }),
|
|
31
|
+
"StepRow cloud": (0, import_react.createElement)(import_components.StepRow, { step: { ...STEP, cloud: true } }),
|
|
32
|
+
GateFrame: (0, import_react.createElement)(import_components.GateFrame, {
|
|
33
|
+
title: "NEEDS YOU \xB7 RUN A COMMAND",
|
|
34
|
+
hint: "\u23CE approve \xB7 esc deny",
|
|
35
|
+
children: (0, import_react.createElement)(import_ink.Text, null, "pnpm db:migrate --env staging")
|
|
36
|
+
})
|
|
37
|
+
};
|
|
38
|
+
(0, import_vitest.describe)("ActorRow margin", () => {
|
|
39
|
+
(0, import_vitest.it)("keeps a gap between a label that fills the margin and the text", () => {
|
|
40
|
+
const row = (0, import_react.createElement)(import_components.ActorRow, {
|
|
41
|
+
actor: "cloud",
|
|
42
|
+
label: "nightly",
|
|
43
|
+
children: (0, import_react.createElement)(import_ink.Text, null, "Running")
|
|
44
|
+
});
|
|
45
|
+
const out = (0, import_harness.renderFrame)(row, { columns: 100, terminal: "no-color" });
|
|
46
|
+
(0, import_vitest.expect)(out).toMatch(/^ \S+ Running$/);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
import_vitest.describe.each(import_harness.TERMINAL_NAMES)("Signal kit on %s", (terminal) => {
|
|
50
|
+
import_vitest.describe.each([100, 40])("at %i columns", (columns) => {
|
|
51
|
+
import_vitest.it.each(Object.keys(PARTS))("%s", (name) => {
|
|
52
|
+
const part = PARTS[name];
|
|
53
|
+
(0, import_vitest.expect)((0, import_harness.renderFrame)(part, { columns, terminal })).toMatchSnapshot();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kit.snapshot.test.d.ts","sourceRoot":"","sources":["../../src/signal/kit.snapshot.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
import { Text } from "ink";
|
|
3
|
+
import { describe, expect, it } from "vitest";
|
|
4
|
+
import { ActorRow, CutText, GateFrame, StepRow, Wordmark } from "./components.js";
|
|
5
|
+
import { TERMINAL_NAMES, renderFrame } from "./harness.js";
|
|
6
|
+
const STEP = {
|
|
7
|
+
state: "ok",
|
|
8
|
+
verb: "EDIT",
|
|
9
|
+
target: "packages/tui/src/signal/tone.ts",
|
|
10
|
+
detail: "+12 \u22123",
|
|
11
|
+
time: "0.4s",
|
|
12
|
+
cloud: false
|
|
13
|
+
};
|
|
14
|
+
const PARTS = {
|
|
15
|
+
"Wordmark rows=1": createElement(Wordmark, { rows: 1 }),
|
|
16
|
+
"Wordmark rows=4": createElement(Wordmark, { rows: 4 }),
|
|
17
|
+
CutText: createElement(CutText, { text: "usage" }),
|
|
18
|
+
"ActorRow agent": createElement(ActorRow, {
|
|
19
|
+
actor: "agent",
|
|
20
|
+
children: createElement(Text, null, "Fixed the auth tests.")
|
|
21
|
+
}),
|
|
22
|
+
"ActorRow cloud": createElement(ActorRow, {
|
|
23
|
+
actor: "cloud",
|
|
24
|
+
label: "nightly",
|
|
25
|
+
children: createElement(Text, null, "Running on a Dexto computer.")
|
|
26
|
+
}),
|
|
27
|
+
"StepRow ok": createElement(StepRow, { step: STEP }),
|
|
28
|
+
"StepRow fail": createElement(StepRow, { step: { ...STEP, state: "fail", detail: null } }),
|
|
29
|
+
"StepRow wait": createElement(StepRow, { step: { ...STEP, state: "wait", time: null } }),
|
|
30
|
+
"StepRow cloud": createElement(StepRow, { step: { ...STEP, cloud: true } }),
|
|
31
|
+
GateFrame: createElement(GateFrame, {
|
|
32
|
+
title: "NEEDS YOU \xB7 RUN A COMMAND",
|
|
33
|
+
hint: "\u23CE approve \xB7 esc deny",
|
|
34
|
+
children: createElement(Text, null, "pnpm db:migrate --env staging")
|
|
35
|
+
})
|
|
36
|
+
};
|
|
37
|
+
describe("ActorRow margin", () => {
|
|
38
|
+
it("keeps a gap between a label that fills the margin and the text", () => {
|
|
39
|
+
const row = createElement(ActorRow, {
|
|
40
|
+
actor: "cloud",
|
|
41
|
+
label: "nightly",
|
|
42
|
+
children: createElement(Text, null, "Running")
|
|
43
|
+
});
|
|
44
|
+
const out = renderFrame(row, { columns: 100, terminal: "no-color" });
|
|
45
|
+
expect(out).toMatch(/^ \S+ Running$/);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe.each(TERMINAL_NAMES)("Signal kit on %s", (terminal) => {
|
|
49
|
+
describe.each([100, 40])("at %i columns", (columns) => {
|
|
50
|
+
it.each(Object.keys(PARTS))("%s", (name) => {
|
|
51
|
+
const part = PARTS[name];
|
|
52
|
+
expect(renderFrame(part, { columns, terminal })).toMatchSnapshot();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var import_node_fs = require("node:fs");
|
|
3
|
+
var import_node_path = require("node:path");
|
|
4
|
+
var import_node_url = require("node:url");
|
|
5
|
+
var import_vitest = require("vitest");
|
|
6
|
+
const import_meta = {};
|
|
7
|
+
const SRC = (0, import_node_path.join)((0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url)), "..");
|
|
8
|
+
const NAMES = "black|red|green|yellow|blue|magenta|cyan|white|gray|grey|blackBright|redBright|greenBright|yellowBright|blueBright|magentaBright|cyanBright|whiteBright";
|
|
9
|
+
const RAW_PROP = new RegExp(`\\b\\w*[cC]olor=(["'])(${NAMES}|#[0-9a-fA-F]{3,8})\\1`);
|
|
10
|
+
const RAW_VALUE = new RegExp(`(["'])(${NAMES}|#[0-9a-fA-F]{6})\\1`);
|
|
11
|
+
const RAW_CHALK = new RegExp(`\\bchalk(\\.\\w+)*\\.(${NAMES}|rgb|hex|bgRgb|bgHex|ansi256)\\b`);
|
|
12
|
+
function sourceFiles(dir) {
|
|
13
|
+
return (0, import_node_fs.readdirSync)(dir, { withFileTypes: true }).flatMap((entry) => {
|
|
14
|
+
const path = (0, import_node_path.join)(dir, entry.name);
|
|
15
|
+
if (entry.isDirectory()) return entry.name === "signal" ? [] : sourceFiles(path);
|
|
16
|
+
return /\.tsx?$/.test(entry.name) && !/\.test\.tsx?$/.test(entry.name) ? [path] : [];
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
(0, import_vitest.describe)("TUI colours", () => {
|
|
20
|
+
(0, import_vitest.it)("come from tone(role), not raw colour names or hex", () => {
|
|
21
|
+
const offenders = [];
|
|
22
|
+
for (const file of sourceFiles(SRC)) {
|
|
23
|
+
(0, import_node_fs.readFileSync)(file, "utf8").split("\n").forEach((line, i) => {
|
|
24
|
+
if (/^\s*(\/\/|\*)/.test(line)) return;
|
|
25
|
+
if (RAW_CHALK.test(line) || RAW_PROP.test(line) || RAW_VALUE.test(line.replace(/(tone|paint)\('\w+'\)/g, ""))) {
|
|
26
|
+
offenders.push(`${(0, import_node_path.relative)(SRC, file)}:${i + 1}: ${line.trim()}`);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
(0, import_vitest.expect)(offenders).toEqual([]);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-raw-colours.test.d.ts","sourceRoot":"","sources":["../../src/signal/no-raw-colours.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { readdirSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join, relative } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
const SRC = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
6
|
+
const NAMES = "black|red|green|yellow|blue|magenta|cyan|white|gray|grey|blackBright|redBright|greenBright|yellowBright|blueBright|magentaBright|cyanBright|whiteBright";
|
|
7
|
+
const RAW_PROP = new RegExp(`\\b\\w*[cC]olor=(["'])(${NAMES}|#[0-9a-fA-F]{3,8})\\1`);
|
|
8
|
+
const RAW_VALUE = new RegExp(`(["'])(${NAMES}|#[0-9a-fA-F]{6})\\1`);
|
|
9
|
+
const RAW_CHALK = new RegExp(`\\bchalk(\\.\\w+)*\\.(${NAMES}|rgb|hex|bgRgb|bgHex|ansi256)\\b`);
|
|
10
|
+
function sourceFiles(dir) {
|
|
11
|
+
return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
|
|
12
|
+
const path = join(dir, entry.name);
|
|
13
|
+
if (entry.isDirectory()) return entry.name === "signal" ? [] : sourceFiles(path);
|
|
14
|
+
return /\.tsx?$/.test(entry.name) && !/\.test\.tsx?$/.test(entry.name) ? [path] : [];
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
describe("TUI colours", () => {
|
|
18
|
+
it("come from tone(role), not raw colour names or hex", () => {
|
|
19
|
+
const offenders = [];
|
|
20
|
+
for (const file of sourceFiles(SRC)) {
|
|
21
|
+
readFileSync(file, "utf8").split("\n").forEach((line, i) => {
|
|
22
|
+
if (/^\s*(\/\/|\*)/.test(line)) return;
|
|
23
|
+
if (RAW_CHALK.test(line) || RAW_PROP.test(line) || RAW_VALUE.test(line.replace(/(tone|paint)\('\w+'\)/g, ""))) {
|
|
24
|
+
offenders.push(`${relative(SRC, file)}:${i + 1}: ${line.trim()}`);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
expect(offenders).toEqual([]);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var paint_exports = {};
|
|
30
|
+
__export(paint_exports, {
|
|
31
|
+
markdownChalk: () => markdownChalk,
|
|
32
|
+
paint: () => paint
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(paint_exports);
|
|
35
|
+
var import_chalk = __toESM(require("chalk"), 1);
|
|
36
|
+
var import_caps = require("./caps.js");
|
|
37
|
+
var import_tone = require("./tone.js");
|
|
38
|
+
function isColorName(color) {
|
|
39
|
+
return import_chalk.foregroundColorNames.includes(color);
|
|
40
|
+
}
|
|
41
|
+
function chalkForTone(color) {
|
|
42
|
+
if (color.startsWith("#")) return import_chalk.default.hex(color);
|
|
43
|
+
return isColorName(color) ? import_chalk.default[color] : import_chalk.default;
|
|
44
|
+
}
|
|
45
|
+
function paint(role) {
|
|
46
|
+
return chalkForTone((0, import_tone.tone)(role));
|
|
47
|
+
}
|
|
48
|
+
function markdownChalk(color) {
|
|
49
|
+
if ((0, import_caps.getCaps)().palette === "signal" || color === "" || color.startsWith("#")) {
|
|
50
|
+
return chalkForTone(color);
|
|
51
|
+
}
|
|
52
|
+
switch (color) {
|
|
53
|
+
case "gray":
|
|
54
|
+
return import_chalk.default.gray;
|
|
55
|
+
case "blue":
|
|
56
|
+
return import_chalk.default.blue;
|
|
57
|
+
case "cyan":
|
|
58
|
+
return import_chalk.default.cyan;
|
|
59
|
+
case "green":
|
|
60
|
+
return import_chalk.default.green;
|
|
61
|
+
case "yellow":
|
|
62
|
+
case "orange":
|
|
63
|
+
return import_chalk.default.rgb(255, 165, 0);
|
|
64
|
+
case "red":
|
|
65
|
+
return import_chalk.default.red;
|
|
66
|
+
case "magenta":
|
|
67
|
+
return import_chalk.default.green;
|
|
68
|
+
default:
|
|
69
|
+
return import_chalk.default.white;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
73
|
+
0 && (module.exports = {
|
|
74
|
+
markdownChalk,
|
|
75
|
+
paint
|
|
76
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `tone(role)` for text coloured with chalk rather than an Ink prop: the exit summary written
|
|
3
|
+
* straight to stdout, /help, and wrapped markdown.
|
|
4
|
+
*/
|
|
5
|
+
import { type ChalkInstance } from 'chalk';
|
|
6
|
+
import { type Role } from './tone.js';
|
|
7
|
+
/** The chalk for a role in this terminal. Reads caps on each call, so call it at draw time. */
|
|
8
|
+
export declare function paint(role: Role): ChalkInstance;
|
|
9
|
+
/**
|
|
10
|
+
* The chalk for wrapped markdown, given the Ink colour the same text has when unwrapped.
|
|
11
|
+
* Markdown has its own name mapping on the legacy palette, kept so nothing there changes.
|
|
12
|
+
* Removed when the Signal palette becomes the default.
|
|
13
|
+
*/
|
|
14
|
+
export declare function markdownChalk(color: string): ChalkInstance;
|
|
15
|
+
//# sourceMappingURL=paint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paint.d.ts","sourceRoot":"","sources":["../../src/signal/paint.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAc,EAAwB,KAAK,aAAa,EAA4B,MAAM,OAAO,CAAC;AAElG,OAAO,EAAQ,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAY5C,+FAA+F;AAC/F,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,aAAa,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAuB1D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import chalk, { foregroundColorNames } from "chalk";
|
|
2
|
+
import { getCaps } from "./caps.js";
|
|
3
|
+
import { tone } from "./tone.js";
|
|
4
|
+
function isColorName(color) {
|
|
5
|
+
return foregroundColorNames.includes(color);
|
|
6
|
+
}
|
|
7
|
+
function chalkForTone(color) {
|
|
8
|
+
if (color.startsWith("#")) return chalk.hex(color);
|
|
9
|
+
return isColorName(color) ? chalk[color] : chalk;
|
|
10
|
+
}
|
|
11
|
+
function paint(role) {
|
|
12
|
+
return chalkForTone(tone(role));
|
|
13
|
+
}
|
|
14
|
+
function markdownChalk(color) {
|
|
15
|
+
if (getCaps().palette === "signal" || color === "" || color.startsWith("#")) {
|
|
16
|
+
return chalkForTone(color);
|
|
17
|
+
}
|
|
18
|
+
switch (color) {
|
|
19
|
+
case "gray":
|
|
20
|
+
return chalk.gray;
|
|
21
|
+
case "blue":
|
|
22
|
+
return chalk.blue;
|
|
23
|
+
case "cyan":
|
|
24
|
+
return chalk.cyan;
|
|
25
|
+
case "green":
|
|
26
|
+
return chalk.green;
|
|
27
|
+
case "yellow":
|
|
28
|
+
case "orange":
|
|
29
|
+
return chalk.rgb(255, 165, 0);
|
|
30
|
+
case "red":
|
|
31
|
+
return chalk.red;
|
|
32
|
+
case "magenta":
|
|
33
|
+
return chalk.green;
|
|
34
|
+
default:
|
|
35
|
+
return chalk.white;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
markdownChalk,
|
|
40
|
+
paint
|
|
41
|
+
};
|