@dexto/tui 1.15.0-beta.0 → 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 +37 -113
- package/dist/components/Footer.d.ts +2 -2
- package/dist/components/Footer.d.ts.map +1 -1
- package/dist/components/Footer.js +40 -119
- 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 +8 -7
- package/dist/components/overlays/InsufficientCreditsOverlay.d.ts.map +1 -1
- package/dist/components/overlays/InsufficientCreditsOverlay.js +8 -7
- 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 +7 -6
- package/dist/components/overlays/LoginOverlay.d.ts.map +1 -1
- package/dist/components/overlays/LoginOverlay.js +7 -6
- package/dist/components/overlays/LogoutOverlay.cjs +10 -9
- package/dist/components/overlays/LogoutOverlay.d.ts.map +1 -1
- package/dist/components/overlays/LogoutOverlay.js +10 -9
- 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/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 +2 -4
- package/dist/containers/OverlayContainer.d.ts.map +1 -1
- package/dist/containers/OverlayContainer.js +2 -4
- 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/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 +31 -19
- package/dist/services/processStream.d.ts.map +1 -1
- package/dist/services/processStream.js +32 -20
- package/dist/services/processStream.test.cjs +51 -3
- package/dist/services/processStream.test.js +51 -3
- 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/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 +7 -3
- 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
|
@@ -23,6 +23,7 @@ __export(CustomInput_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(CustomInput_exports);
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_ink = require("ink");
|
|
26
|
+
var import_signal = require("../signal/index.js");
|
|
26
27
|
function CustomInput({
|
|
27
28
|
value,
|
|
28
29
|
onChange,
|
|
@@ -66,12 +67,12 @@ function CustomInput({
|
|
|
66
67
|
const firstChar = placeholder[0] || " ";
|
|
67
68
|
const rest = placeholder.slice(1);
|
|
68
69
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { children: [
|
|
69
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
70
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("bg"), backgroundColor: (0, import_signal.tone)("add"), children: firstChar }),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: rest })
|
|
71
72
|
] });
|
|
72
73
|
}
|
|
73
74
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { children: [
|
|
74
75
|
value,
|
|
75
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("bg"), backgroundColor: (0, import_signal.tone)("add"), children: " " })
|
|
76
77
|
] });
|
|
77
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomInput.d.ts","sourceRoot":"","sources":["../../src/components/CustomInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CustomInput.d.ts","sourceRoot":"","sources":["../../src/components/CustomInput.tsx"],"names":[],"mappings":"AAGA,UAAU,gBAAgB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,YAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,iBAAiB,GACpB,EAAE,gBAAgB,2CAoElB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useInput, Text } from "ink";
|
|
3
|
+
import { tone } from "../signal/index.js";
|
|
3
4
|
function CustomInput({
|
|
4
5
|
value,
|
|
5
6
|
onChange,
|
|
@@ -43,13 +44,13 @@ function CustomInput({
|
|
|
43
44
|
const firstChar = placeholder[0] || " ";
|
|
44
45
|
const rest = placeholder.slice(1);
|
|
45
46
|
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
46
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
47
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
47
|
+
/* @__PURE__ */ jsx(Text, { color: tone("bg"), backgroundColor: tone("add"), children: firstChar }),
|
|
48
|
+
/* @__PURE__ */ jsx(Text, { color: tone("dim"), children: rest })
|
|
48
49
|
] });
|
|
49
50
|
}
|
|
50
51
|
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
51
52
|
value,
|
|
52
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
53
|
+
/* @__PURE__ */ jsx(Text, { color: tone("bg"), backgroundColor: tone("add"), children: " " })
|
|
53
54
|
] });
|
|
54
55
|
}
|
|
55
56
|
export {
|
|
@@ -0,0 +1,43 @@
|
|
|
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 DeckArea_exports = {};
|
|
20
|
+
__export(DeckArea_exports, {
|
|
21
|
+
DeckArea: () => DeckArea
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(DeckArea_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_signal = require("../signal/index.js");
|
|
26
|
+
var import_useDeckState = require("../hooks/useDeckState.js");
|
|
27
|
+
var import_deck_state = require("../utils/deck-state.js");
|
|
28
|
+
function DeckArea({ children, ...input }) {
|
|
29
|
+
const state = (0, import_useDeckState.useDeckState)(input);
|
|
30
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
31
|
+
import_signal.Deck,
|
|
32
|
+
{
|
|
33
|
+
state,
|
|
34
|
+
collapsed: (0, import_deck_state.deckCollapsed)(input.ui.activeOverlay),
|
|
35
|
+
paused: input.ui.copyModeEnabled,
|
|
36
|
+
children
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
DeckArea
|
|
43
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Signal deck wired to the CLI: the band (wordmark, trace, status) above the input.
|
|
3
|
+
* Mounted only on the Signal palette, so the legacy screens don't pay for its git and credit
|
|
4
|
+
* lookups. Focused overlays budget for the whole screen, so the band collapses under them
|
|
5
|
+
* while the Deck stays mounted, which keeps the input in place in the tree. It stays up during
|
|
6
|
+
* an approval, where its mode says the agent is waiting.
|
|
7
|
+
*/
|
|
8
|
+
import type { ReactNode } from 'react';
|
|
9
|
+
import { type DeckStateInput } from '../hooks/useDeckState.js';
|
|
10
|
+
export interface DeckAreaProps extends DeckStateInput {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function DeckArea({ children, ...input }: DeckAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=DeckArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeckArea.d.ts","sourceRoot":"","sources":["../../src/components/DeckArea.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG7E,MAAM,WAAW,aAAc,SAAQ,cAAc;IACjD,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CAW7D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Deck } from "../signal/index.js";
|
|
3
|
+
import { useDeckState } from "../hooks/useDeckState.js";
|
|
4
|
+
import { deckCollapsed } from "../utils/deck-state.js";
|
|
5
|
+
function DeckArea({ children, ...input }) {
|
|
6
|
+
const state = useDeckState(input);
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
Deck,
|
|
9
|
+
{
|
|
10
|
+
state,
|
|
11
|
+
collapsed: deckCollapsed(input.ui.activeOverlay),
|
|
12
|
+
paused: input.ui.copyModeEnabled,
|
|
13
|
+
children
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
DeckArea
|
|
19
|
+
};
|
|
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(EditableMultiLineInput_exports);
|
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
var import_ink = require("ink");
|
|
27
|
+
var import_signal = require("../signal/index.js");
|
|
27
28
|
function EditableMultiLineInput({
|
|
28
29
|
value,
|
|
29
30
|
onChange,
|
|
@@ -117,7 +118,7 @@ function EditableMultiLineInput({
|
|
|
117
118
|
const prefix = lineIdx === 0 ? "\xBB " : " ";
|
|
118
119
|
if (cursorCol < 0) {
|
|
119
120
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { children: [
|
|
120
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
121
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("teal"), children: prefix }),
|
|
121
122
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { children: line || " " })
|
|
122
123
|
] }, lineIdx);
|
|
123
124
|
}
|
|
@@ -125,27 +126,27 @@ function EditableMultiLineInput({
|
|
|
125
126
|
const atCursor = line.charAt(cursorCol) || " ";
|
|
126
127
|
const after = line.slice(cursorCol + 1);
|
|
127
128
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { children: [
|
|
128
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("teal"), children: prefix }),
|
|
129
130
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { children: before }),
|
|
130
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { backgroundColor: "
|
|
131
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { backgroundColor: (0, import_signal.tone)("add"), color: (0, import_signal.tone)("bg"), children: atCursor }),
|
|
131
132
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { children: after })
|
|
132
133
|
] }, lineIdx);
|
|
133
134
|
};
|
|
134
135
|
if (!value && placeholder) {
|
|
135
136
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", children: [
|
|
136
137
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { children: [
|
|
137
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
138
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { backgroundColor: "
|
|
139
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "
|
|
138
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("teal"), children: "\xBB " }),
|
|
139
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { backgroundColor: (0, import_signal.tone)("add"), color: (0, import_signal.tone)("bg"), children: " " }),
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: [
|
|
140
141
|
" ",
|
|
141
142
|
placeholder
|
|
142
143
|
] })
|
|
143
144
|
] }),
|
|
144
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
145
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: "Multi-line mode \u2022 Cmd/Ctrl+Enter to submit \u2022 Shift+Enter for single-line" })
|
|
145
146
|
] });
|
|
146
147
|
}
|
|
147
148
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", children: [
|
|
148
149
|
lines.map((line, idx) => renderLine(line, idx)),
|
|
149
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
150
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: "Multi-line mode \u2022 Cmd/Ctrl+Enter to submit \u2022 Shift+Enter for single-line" })
|
|
150
151
|
] });
|
|
151
152
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableMultiLineInput.d.ts","sourceRoot":"","sources":["../../src/components/EditableMultiLineInput.tsx"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"EditableMultiLineInput.d.ts","sourceRoot":"","sources":["../../src/components/EditableMultiLineInput.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,UAAU,2BAA2B;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC3C,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,YAAoB,EACpB,kBAAkB,GACrB,EAAE,2BAA2B,2CAoK7B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect, useMemo } from "react";
|
|
3
3
|
import { Box, Text, useInput } from "ink";
|
|
4
|
+
import { tone } from "../signal/index.js";
|
|
4
5
|
function EditableMultiLineInput({
|
|
5
6
|
value,
|
|
6
7
|
onChange,
|
|
@@ -94,7 +95,7 @@ function EditableMultiLineInput({
|
|
|
94
95
|
const prefix = lineIdx === 0 ? "\xBB " : " ";
|
|
95
96
|
if (cursorCol < 0) {
|
|
96
97
|
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
97
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
98
|
+
/* @__PURE__ */ jsx(Text, { color: tone("teal"), children: prefix }),
|
|
98
99
|
/* @__PURE__ */ jsx(Text, { children: line || " " })
|
|
99
100
|
] }, lineIdx);
|
|
100
101
|
}
|
|
@@ -102,28 +103,28 @@ function EditableMultiLineInput({
|
|
|
102
103
|
const atCursor = line.charAt(cursorCol) || " ";
|
|
103
104
|
const after = line.slice(cursorCol + 1);
|
|
104
105
|
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
105
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
106
|
+
/* @__PURE__ */ jsx(Text, { color: tone("teal"), children: prefix }),
|
|
106
107
|
/* @__PURE__ */ jsx(Text, { children: before }),
|
|
107
|
-
/* @__PURE__ */ jsx(Text, { backgroundColor: "
|
|
108
|
+
/* @__PURE__ */ jsx(Text, { backgroundColor: tone("add"), color: tone("bg"), children: atCursor }),
|
|
108
109
|
/* @__PURE__ */ jsx(Text, { children: after })
|
|
109
110
|
] }, lineIdx);
|
|
110
111
|
};
|
|
111
112
|
if (!value && placeholder) {
|
|
112
113
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
113
114
|
/* @__PURE__ */ jsxs(Text, { children: [
|
|
114
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
115
|
-
/* @__PURE__ */ jsx(Text, { backgroundColor: "
|
|
116
|
-
/* @__PURE__ */ jsxs(Text, { color: "
|
|
115
|
+
/* @__PURE__ */ jsx(Text, { color: tone("teal"), children: "\xBB " }),
|
|
116
|
+
/* @__PURE__ */ jsx(Text, { backgroundColor: tone("add"), color: tone("bg"), children: " " }),
|
|
117
|
+
/* @__PURE__ */ jsxs(Text, { color: tone("dim"), children: [
|
|
117
118
|
" ",
|
|
118
119
|
placeholder
|
|
119
120
|
] })
|
|
120
121
|
] }),
|
|
121
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
122
|
+
/* @__PURE__ */ jsx(Text, { color: tone("dim"), children: "Multi-line mode \u2022 Cmd/Ctrl+Enter to submit \u2022 Shift+Enter for single-line" })
|
|
122
123
|
] });
|
|
123
124
|
}
|
|
124
125
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
125
126
|
lines.map((line, idx) => renderLine(line, idx)),
|
|
126
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
127
|
+
/* @__PURE__ */ jsx(Text, { color: tone("dim"), children: "Multi-line mode \u2022 Cmd/Ctrl+Enter to submit \u2022 Shift+Enter for single-line" })
|
|
127
128
|
] });
|
|
128
129
|
}
|
|
129
130
|
export {
|
|
@@ -37,6 +37,7 @@ var import_ink = require("ink");
|
|
|
37
37
|
var import_wrap_ansi = __toESM(require("wrap-ansi"), 1);
|
|
38
38
|
var import_useTerminalSize = require("../hooks/useTerminalSize.js");
|
|
39
39
|
var import_elicitationSchema = require("../utils/elicitationSchema.js");
|
|
40
|
+
var import_signal = require("../signal/index.js");
|
|
40
41
|
function hasOwn(obj, key) {
|
|
41
42
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
42
43
|
}
|
|
@@ -71,7 +72,9 @@ const ElicitationForm = (0, import_react.forwardRef)(
|
|
|
71
72
|
const desired = Math.max(minViewportHeight, Math.floor(terminalRows * 0.6));
|
|
72
73
|
return Math.min(maxHeight, desired);
|
|
73
74
|
}, [footerHeight, maxHeaderHeight, minContentHeight, terminalRows]);
|
|
74
|
-
const
|
|
75
|
+
const { palette, glyphs } = (0, import_signal.useCaps)();
|
|
76
|
+
const signal = palette === "signal";
|
|
77
|
+
const availableWidth = Math.max(20, terminalColumns - (signal ? 6 : 2));
|
|
75
78
|
const fields = (0, import_react.useMemo)(() => {
|
|
76
79
|
return (0, import_elicitationSchema.parseElicitationSchema)(metadata.schema);
|
|
77
80
|
}, [metadata.schema]);
|
|
@@ -348,6 +351,10 @@ const ElicitationForm = (0, import_react.forwardRef)(
|
|
|
348
351
|
}
|
|
349
352
|
return true;
|
|
350
353
|
}
|
|
354
|
+
if (signal && /^[1-9]$/.test(input) && Number(input) <= values.length) {
|
|
355
|
+
setEnumIndex(Number(input) - 1);
|
|
356
|
+
return true;
|
|
357
|
+
}
|
|
351
358
|
break;
|
|
352
359
|
}
|
|
353
360
|
case "array-enum": {
|
|
@@ -439,6 +446,7 @@ const ElicitationForm = (0, import_react.forwardRef)(
|
|
|
439
446
|
}
|
|
440
447
|
}),
|
|
441
448
|
[
|
|
449
|
+
signal,
|
|
442
450
|
activeField,
|
|
443
451
|
activeFieldIndex,
|
|
444
452
|
arraySelections,
|
|
@@ -460,7 +468,7 @@ const ElicitationForm = (0, import_react.forwardRef)(
|
|
|
460
468
|
]
|
|
461
469
|
);
|
|
462
470
|
if (fields.length === 0) {
|
|
463
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "red", children: "Invalid form schema" }) });
|
|
471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("red"), children: "Invalid form schema" }) });
|
|
464
472
|
}
|
|
465
473
|
const isAnswered = (field) => {
|
|
466
474
|
if (field.type === "boolean") return hasOwn(formData, field.name);
|
|
@@ -475,7 +483,7 @@ const ElicitationForm = (0, import_react.forwardRef)(
|
|
|
475
483
|
return value2 !== void 0 && value2 !== null && value2 !== "";
|
|
476
484
|
};
|
|
477
485
|
if (!isReviewing && !activeField) {
|
|
478
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "red", children: "Invalid form state" }) });
|
|
486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("red"), children: "Invalid form state" }) });
|
|
479
487
|
}
|
|
480
488
|
const value = activeField ? formData[activeField.name] : void 0;
|
|
481
489
|
const currentInput = activeField && hasOwn(draftInputs, activeField.name) ? draftInputs[activeField.name] ?? "" : value === void 0 || value === null ? "" : String(value);
|
|
@@ -488,7 +496,7 @@ const ElicitationForm = (0, import_react.forwardRef)(
|
|
|
488
496
|
overflowY: "scroll",
|
|
489
497
|
overflowX: "hidden",
|
|
490
498
|
scrollTop: reviewScrollTop,
|
|
491
|
-
scrollbarThumbColor: "
|
|
499
|
+
scrollbarThumbColor: (0, import_signal.tone)("dim"),
|
|
492
500
|
flexDirection: "column",
|
|
493
501
|
height: contentHeight,
|
|
494
502
|
paddingRight: 1,
|
|
@@ -502,10 +510,10 @@ const ElicitationForm = (0, import_react.forwardRef)(
|
|
|
502
510
|
}
|
|
503
511
|
if (!activeField) return null;
|
|
504
512
|
if (activeField.type === "string" || activeField.type === "number") {
|
|
505
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { height: contentHeight, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { wrap: "truncate-end", children: [
|
|
506
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
507
|
-
currentInput || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
508
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { height: signal ? 1 : contentHeight, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { wrap: "truncate-end", children: [
|
|
514
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("teal"), children: "> " }),
|
|
515
|
+
currentInput || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: "Type your answer\u2026" }),
|
|
516
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("teal"), children: "\u258B" })
|
|
509
517
|
] }) });
|
|
510
518
|
}
|
|
511
519
|
const options = [];
|
|
@@ -550,18 +558,37 @@ const ElicitationForm = (0, import_react.forwardRef)(
|
|
|
550
558
|
{
|
|
551
559
|
overflowY: "scroll",
|
|
552
560
|
overflowX: "hidden",
|
|
553
|
-
scrollbarThumbColor: "
|
|
554
|
-
height: contentHeight,
|
|
561
|
+
scrollbarThumbColor: (0, import_signal.tone)("dim"),
|
|
562
|
+
height: signal ? Math.min(contentHeight, options.length) : contentHeight,
|
|
555
563
|
scrollTop: targetScrollTop,
|
|
556
564
|
flexDirection: "column",
|
|
557
565
|
paddingRight: 1,
|
|
558
|
-
children: options.map((opt) => {
|
|
566
|
+
children: options.map((opt, index) => {
|
|
567
|
+
if (signal) {
|
|
568
|
+
const check = activeField.type === "array-enum" ? opt.isSelected ? "[\u2713] " : "[ ] " : "";
|
|
569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
570
|
+
import_ink.Text,
|
|
571
|
+
{
|
|
572
|
+
bold: opt.isFocused,
|
|
573
|
+
color: (0, import_signal.tone)(opt.isFocused ? "hi" : "fg"),
|
|
574
|
+
...opt.isFocused && { backgroundColor: (0, import_signal.tone)("sel") },
|
|
575
|
+
wrap: "truncate-end",
|
|
576
|
+
children: [
|
|
577
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { bold: true, color: (0, import_signal.tone)("amber"), children: opt.isFocused ? (0, import_signal.glyphText)("\u203A ", glyphs) : " " }),
|
|
578
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { bold: true, color: (0, import_signal.tone)(opt.isFocused ? "amber" : "dim"), children: activeField.type === "enum" && index < 9 ? `${index + 1} ` : "" }),
|
|
579
|
+
(0, import_signal.glyphText)(check, glyphs),
|
|
580
|
+
opt.label
|
|
581
|
+
]
|
|
582
|
+
},
|
|
583
|
+
opt.key
|
|
584
|
+
);
|
|
585
|
+
}
|
|
559
586
|
const prefix = opt.isFocused ? "\u25B6 " : " ";
|
|
560
587
|
const mark = activeField.type === "array-enum" ? opt.isSelected ? "[\u2713] " : "[ ] " : "";
|
|
561
588
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
562
589
|
import_ink.Text,
|
|
563
590
|
{
|
|
564
|
-
color: opt.isFocused ? "
|
|
591
|
+
color: opt.isFocused ? (0, import_signal.tone)("teal") : (0, import_signal.tone)("dim"),
|
|
565
592
|
wrap: "truncate-end",
|
|
566
593
|
children: [
|
|
567
594
|
prefix,
|
|
@@ -603,15 +630,48 @@ const ElicitationForm = (0, import_react.forwardRef)(
|
|
|
603
630
|
const questionLines = wrapClampedLines(questionText, questionLineCount);
|
|
604
631
|
const helpLines = wrapClampedLines(helpText, helpLineCount);
|
|
605
632
|
const errorLines = wrapClampedLines(errorLineText, errorLineCount);
|
|
633
|
+
if (signal) {
|
|
634
|
+
const position = fields.length > 1 ? ` \xB7 ${activeFieldIndex + 1} of ${fields.length}` : "";
|
|
635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
636
|
+
import_signal.GateFrame,
|
|
637
|
+
{
|
|
638
|
+
title: isReviewing ? "QUESTION \xB7 Review your answers" : `QUESTION${position} \xB7 ${questionLines.filter(Boolean).join(" ")}`,
|
|
639
|
+
hint: hintLine.replaceAll(" \u2022 ", " \xB7 "),
|
|
640
|
+
children: [
|
|
641
|
+
helpLines.filter(Boolean).map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), wrap: "truncate-end", children: line }, `help-${index}`)),
|
|
642
|
+
errorLines.filter(Boolean).map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("red"), wrap: "truncate-end", children: line }, `error-${index}`)),
|
|
643
|
+
renderContent()
|
|
644
|
+
]
|
|
645
|
+
}
|
|
646
|
+
);
|
|
647
|
+
}
|
|
606
648
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", paddingX: 0, height: viewportHeight, children: [
|
|
607
|
-
headerLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
608
|
-
!isReviewing && stepLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
649
|
+
headerLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("amber"), bold: true, wrap: "truncate-end", children: line || " " }, `header-${index}`)),
|
|
650
|
+
!isReviewing && stepLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
651
|
+
import_ink.Text,
|
|
652
|
+
{
|
|
653
|
+
color: (0, import_signal.tone)("dim"),
|
|
654
|
+
dimColor: true,
|
|
655
|
+
wrap: "truncate-end",
|
|
656
|
+
children: line || " "
|
|
657
|
+
},
|
|
658
|
+
`step-${index}`
|
|
659
|
+
)),
|
|
609
660
|
Array.from({ length: spacerAfterStepLineCount }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { wrap: "truncate-end", children: " " }, `spacer-step-${index}`)),
|
|
610
|
-
!isReviewing && questionLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
611
|
-
!isReviewing && helpLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
612
|
-
|
|
661
|
+
!isReviewing && questionLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("hi"), bold: true, wrap: "truncate-end", children: line || " " }, `question-${index}`)),
|
|
662
|
+
!isReviewing && helpLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
663
|
+
import_ink.Text,
|
|
664
|
+
{
|
|
665
|
+
color: (0, import_signal.tone)("dim"),
|
|
666
|
+
dimColor: true,
|
|
667
|
+
wrap: "truncate-end",
|
|
668
|
+
children: line || " "
|
|
669
|
+
},
|
|
670
|
+
`help-${index}`
|
|
671
|
+
)),
|
|
672
|
+
!isReviewing && errorLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("red"), wrap: "truncate-end", children: line || " " }, `error-${index}`)),
|
|
613
673
|
renderContent(),
|
|
614
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "
|
|
674
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), dimColor: true, wrap: "truncate-end", children: hintLine })
|
|
615
675
|
] });
|
|
616
676
|
}
|
|
617
677
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElicitationForm.d.ts","sourceRoot":"","sources":["../../src/components/ElicitationForm.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAA0E,MAAM,OAAO,CAAC;AAG/F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"ElicitationForm.d.ts","sourceRoot":"","sources":["../../src/components/ElicitationForm.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAA0E,MAAM,OAAO,CAAC;AAG/F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAK5D,MAAM,WAAW,qBAAqB;IAClC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED,UAAU,oBAAoB;IAC1B,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACtD,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAkBD;;GAEG;AACH,eAAO,MAAM,eAAe,oGAuzB3B,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { Box, Text } from "ink";
|
|
|
4
4
|
import wrapAnsi from "wrap-ansi";
|
|
5
5
|
import { useTerminalSize } from "../hooks/useTerminalSize.js";
|
|
6
6
|
import { parseElicitationSchema } from "../utils/elicitationSchema.js";
|
|
7
|
+
import { GateFrame, glyphText, tone, useCaps } from "../signal/index.js";
|
|
7
8
|
function hasOwn(obj, key) {
|
|
8
9
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
9
10
|
}
|
|
@@ -38,7 +39,9 @@ const ElicitationForm = forwardRef(
|
|
|
38
39
|
const desired = Math.max(minViewportHeight, Math.floor(terminalRows * 0.6));
|
|
39
40
|
return Math.min(maxHeight, desired);
|
|
40
41
|
}, [footerHeight, maxHeaderHeight, minContentHeight, terminalRows]);
|
|
41
|
-
const
|
|
42
|
+
const { palette, glyphs } = useCaps();
|
|
43
|
+
const signal = palette === "signal";
|
|
44
|
+
const availableWidth = Math.max(20, terminalColumns - (signal ? 6 : 2));
|
|
42
45
|
const fields = useMemo(() => {
|
|
43
46
|
return parseElicitationSchema(metadata.schema);
|
|
44
47
|
}, [metadata.schema]);
|
|
@@ -315,6 +318,10 @@ const ElicitationForm = forwardRef(
|
|
|
315
318
|
}
|
|
316
319
|
return true;
|
|
317
320
|
}
|
|
321
|
+
if (signal && /^[1-9]$/.test(input) && Number(input) <= values.length) {
|
|
322
|
+
setEnumIndex(Number(input) - 1);
|
|
323
|
+
return true;
|
|
324
|
+
}
|
|
318
325
|
break;
|
|
319
326
|
}
|
|
320
327
|
case "array-enum": {
|
|
@@ -406,6 +413,7 @@ const ElicitationForm = forwardRef(
|
|
|
406
413
|
}
|
|
407
414
|
}),
|
|
408
415
|
[
|
|
416
|
+
signal,
|
|
409
417
|
activeField,
|
|
410
418
|
activeFieldIndex,
|
|
411
419
|
arraySelections,
|
|
@@ -427,7 +435,7 @@ const ElicitationForm = forwardRef(
|
|
|
427
435
|
]
|
|
428
436
|
);
|
|
429
437
|
if (fields.length === 0) {
|
|
430
|
-
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ jsx(Text, { color: "red", children: "Invalid form schema" }) });
|
|
438
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ jsx(Text, { color: tone("red"), children: "Invalid form schema" }) });
|
|
431
439
|
}
|
|
432
440
|
const isAnswered = (field) => {
|
|
433
441
|
if (field.type === "boolean") return hasOwn(formData, field.name);
|
|
@@ -442,7 +450,7 @@ const ElicitationForm = forwardRef(
|
|
|
442
450
|
return value2 !== void 0 && value2 !== null && value2 !== "";
|
|
443
451
|
};
|
|
444
452
|
if (!isReviewing && !activeField) {
|
|
445
|
-
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ jsx(Text, { color: "red", children: "Invalid form state" }) });
|
|
453
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ jsx(Text, { color: tone("red"), children: "Invalid form state" }) });
|
|
446
454
|
}
|
|
447
455
|
const value = activeField ? formData[activeField.name] : void 0;
|
|
448
456
|
const currentInput = activeField && hasOwn(draftInputs, activeField.name) ? draftInputs[activeField.name] ?? "" : value === void 0 || value === null ? "" : String(value);
|
|
@@ -455,7 +463,7 @@ const ElicitationForm = forwardRef(
|
|
|
455
463
|
overflowY: "scroll",
|
|
456
464
|
overflowX: "hidden",
|
|
457
465
|
scrollTop: reviewScrollTop,
|
|
458
|
-
scrollbarThumbColor: "
|
|
466
|
+
scrollbarThumbColor: tone("dim"),
|
|
459
467
|
flexDirection: "column",
|
|
460
468
|
height: contentHeight,
|
|
461
469
|
paddingRight: 1,
|
|
@@ -469,10 +477,10 @@ const ElicitationForm = forwardRef(
|
|
|
469
477
|
}
|
|
470
478
|
if (!activeField) return null;
|
|
471
479
|
if (activeField.type === "string" || activeField.type === "number") {
|
|
472
|
-
return /* @__PURE__ */ jsx(Box, { height: contentHeight, children: /* @__PURE__ */ jsxs(Text, { wrap: "truncate-end", children: [
|
|
473
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
474
|
-
currentInput || /* @__PURE__ */ jsx(Text, { color: "
|
|
475
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
480
|
+
return /* @__PURE__ */ jsx(Box, { height: signal ? 1 : contentHeight, children: /* @__PURE__ */ jsxs(Text, { wrap: "truncate-end", children: [
|
|
481
|
+
/* @__PURE__ */ jsx(Text, { color: tone("teal"), children: "> " }),
|
|
482
|
+
currentInput || /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: "Type your answer\u2026" }),
|
|
483
|
+
/* @__PURE__ */ jsx(Text, { color: tone("teal"), children: "\u258B" })
|
|
476
484
|
] }) });
|
|
477
485
|
}
|
|
478
486
|
const options = [];
|
|
@@ -517,18 +525,37 @@ const ElicitationForm = forwardRef(
|
|
|
517
525
|
{
|
|
518
526
|
overflowY: "scroll",
|
|
519
527
|
overflowX: "hidden",
|
|
520
|
-
scrollbarThumbColor: "
|
|
521
|
-
height: contentHeight,
|
|
528
|
+
scrollbarThumbColor: tone("dim"),
|
|
529
|
+
height: signal ? Math.min(contentHeight, options.length) : contentHeight,
|
|
522
530
|
scrollTop: targetScrollTop,
|
|
523
531
|
flexDirection: "column",
|
|
524
532
|
paddingRight: 1,
|
|
525
|
-
children: options.map((opt) => {
|
|
533
|
+
children: options.map((opt, index) => {
|
|
534
|
+
if (signal) {
|
|
535
|
+
const check = activeField.type === "array-enum" ? opt.isSelected ? "[\u2713] " : "[ ] " : "";
|
|
536
|
+
return /* @__PURE__ */ jsxs(
|
|
537
|
+
Text,
|
|
538
|
+
{
|
|
539
|
+
bold: opt.isFocused,
|
|
540
|
+
color: tone(opt.isFocused ? "hi" : "fg"),
|
|
541
|
+
...opt.isFocused && { backgroundColor: tone("sel") },
|
|
542
|
+
wrap: "truncate-end",
|
|
543
|
+
children: [
|
|
544
|
+
/* @__PURE__ */ jsx(Text, { bold: true, color: tone("amber"), children: opt.isFocused ? glyphText("\u203A ", glyphs) : " " }),
|
|
545
|
+
/* @__PURE__ */ jsx(Text, { bold: true, color: tone(opt.isFocused ? "amber" : "dim"), children: activeField.type === "enum" && index < 9 ? `${index + 1} ` : "" }),
|
|
546
|
+
glyphText(check, glyphs),
|
|
547
|
+
opt.label
|
|
548
|
+
]
|
|
549
|
+
},
|
|
550
|
+
opt.key
|
|
551
|
+
);
|
|
552
|
+
}
|
|
526
553
|
const prefix = opt.isFocused ? "\u25B6 " : " ";
|
|
527
554
|
const mark = activeField.type === "array-enum" ? opt.isSelected ? "[\u2713] " : "[ ] " : "";
|
|
528
555
|
return /* @__PURE__ */ jsxs(
|
|
529
556
|
Text,
|
|
530
557
|
{
|
|
531
|
-
color: opt.isFocused ? "
|
|
558
|
+
color: opt.isFocused ? tone("teal") : tone("dim"),
|
|
532
559
|
wrap: "truncate-end",
|
|
533
560
|
children: [
|
|
534
561
|
prefix,
|
|
@@ -570,15 +597,48 @@ const ElicitationForm = forwardRef(
|
|
|
570
597
|
const questionLines = wrapClampedLines(questionText, questionLineCount);
|
|
571
598
|
const helpLines = wrapClampedLines(helpText, helpLineCount);
|
|
572
599
|
const errorLines = wrapClampedLines(errorLineText, errorLineCount);
|
|
600
|
+
if (signal) {
|
|
601
|
+
const position = fields.length > 1 ? ` \xB7 ${activeFieldIndex + 1} of ${fields.length}` : "";
|
|
602
|
+
return /* @__PURE__ */ jsxs(
|
|
603
|
+
GateFrame,
|
|
604
|
+
{
|
|
605
|
+
title: isReviewing ? "QUESTION \xB7 Review your answers" : `QUESTION${position} \xB7 ${questionLines.filter(Boolean).join(" ")}`,
|
|
606
|
+
hint: hintLine.replaceAll(" \u2022 ", " \xB7 "),
|
|
607
|
+
children: [
|
|
608
|
+
helpLines.filter(Boolean).map((line, index) => /* @__PURE__ */ jsx(Text, { color: tone("dim"), wrap: "truncate-end", children: line }, `help-${index}`)),
|
|
609
|
+
errorLines.filter(Boolean).map((line, index) => /* @__PURE__ */ jsx(Text, { color: tone("red"), wrap: "truncate-end", children: line }, `error-${index}`)),
|
|
610
|
+
renderContent()
|
|
611
|
+
]
|
|
612
|
+
}
|
|
613
|
+
);
|
|
614
|
+
}
|
|
573
615
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 0, height: viewportHeight, children: [
|
|
574
|
-
headerLines.map((line, index) => /* @__PURE__ */ jsx(Text, { color: "
|
|
575
|
-
!isReviewing && stepLines.map((line, index) => /* @__PURE__ */ jsx(
|
|
616
|
+
headerLines.map((line, index) => /* @__PURE__ */ jsx(Text, { color: tone("amber"), bold: true, wrap: "truncate-end", children: line || " " }, `header-${index}`)),
|
|
617
|
+
!isReviewing && stepLines.map((line, index) => /* @__PURE__ */ jsx(
|
|
618
|
+
Text,
|
|
619
|
+
{
|
|
620
|
+
color: tone("dim"),
|
|
621
|
+
dimColor: true,
|
|
622
|
+
wrap: "truncate-end",
|
|
623
|
+
children: line || " "
|
|
624
|
+
},
|
|
625
|
+
`step-${index}`
|
|
626
|
+
)),
|
|
576
627
|
Array.from({ length: spacerAfterStepLineCount }, (_, index) => /* @__PURE__ */ jsx(Text, { wrap: "truncate-end", children: " " }, `spacer-step-${index}`)),
|
|
577
|
-
!isReviewing && questionLines.map((line, index) => /* @__PURE__ */ jsx(Text, { color: "
|
|
578
|
-
!isReviewing && helpLines.map((line, index) => /* @__PURE__ */ jsx(
|
|
579
|
-
|
|
628
|
+
!isReviewing && questionLines.map((line, index) => /* @__PURE__ */ jsx(Text, { color: tone("hi"), bold: true, wrap: "truncate-end", children: line || " " }, `question-${index}`)),
|
|
629
|
+
!isReviewing && helpLines.map((line, index) => /* @__PURE__ */ jsx(
|
|
630
|
+
Text,
|
|
631
|
+
{
|
|
632
|
+
color: tone("dim"),
|
|
633
|
+
dimColor: true,
|
|
634
|
+
wrap: "truncate-end",
|
|
635
|
+
children: line || " "
|
|
636
|
+
},
|
|
637
|
+
`help-${index}`
|
|
638
|
+
)),
|
|
639
|
+
!isReviewing && errorLines.map((line, index) => /* @__PURE__ */ jsx(Text, { color: tone("red"), wrap: "truncate-end", children: line || " " }, `error-${index}`)),
|
|
580
640
|
renderContent(),
|
|
581
|
-
/* @__PURE__ */ jsx(Text, { color: "
|
|
641
|
+
/* @__PURE__ */ jsx(Text, { color: tone("dim"), dimColor: true, wrap: "truncate-end", children: hintLine })
|
|
582
642
|
] });
|
|
583
643
|
}
|
|
584
644
|
);
|