@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
|
@@ -0,0 +1,257 @@
|
|
|
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 components_exports = {};
|
|
20
|
+
__export(components_exports, {
|
|
21
|
+
ActorRow: () => ActorRow,
|
|
22
|
+
CutText: () => CutText,
|
|
23
|
+
DECK_MODES: () => DECK_MODES,
|
|
24
|
+
Deck: () => Deck,
|
|
25
|
+
GateFrame: () => GateFrame,
|
|
26
|
+
StepRow: () => StepRow,
|
|
27
|
+
Wordmark: () => Wordmark,
|
|
28
|
+
actorMarginWidth: () => actorMarginWidth
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(components_exports);
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
var import_react = require("react");
|
|
33
|
+
var import_ink = require("ink");
|
|
34
|
+
var import_useAnimationTick = require("../hooks/useAnimationTick.js");
|
|
35
|
+
var import_caps = require("./caps.js");
|
|
36
|
+
var import_glyphs = require("./glyphs.js");
|
|
37
|
+
var import_cut = require("./cut.js");
|
|
38
|
+
var import_tone = require("./tone.js");
|
|
39
|
+
var import_deck_layout = require("./deck-layout.js");
|
|
40
|
+
var import_deck_parts = require("./deck-parts.js");
|
|
41
|
+
var import_trace = require("./trace.js");
|
|
42
|
+
var import_use_trace = require("./use-trace.js");
|
|
43
|
+
var import_wordmark = require("./wordmark.js");
|
|
44
|
+
const WORDMARK_INK = { m: "teal", f: "tealDim", w: "hi" };
|
|
45
|
+
const PULSE_CYCLE_TICKS = 15;
|
|
46
|
+
function inkRuns(text, ink) {
|
|
47
|
+
const glyphs = Array.from(text);
|
|
48
|
+
const runs = [];
|
|
49
|
+
glyphs.forEach((glyph, c) => {
|
|
50
|
+
const letter = ink[c] ?? " ";
|
|
51
|
+
const last = runs[runs.length - 1];
|
|
52
|
+
if (last !== void 0 && last.ink === letter) last.text += glyph;
|
|
53
|
+
else runs.push({ ink: letter, text: glyph });
|
|
54
|
+
});
|
|
55
|
+
return runs;
|
|
56
|
+
}
|
|
57
|
+
function Wordmark({ rows, pulse = false }) {
|
|
58
|
+
const tone = (0, import_tone.useTone)();
|
|
59
|
+
const caps = (0, import_caps.useCaps)();
|
|
60
|
+
const art = (0, import_wordmark.pickWordmark)((0, import_wordmark.wordmarkTier)(caps), Math.max(1, rows));
|
|
61
|
+
const animate = pulse && caps.motion === "full";
|
|
62
|
+
const tick = (0, import_useAnimationTick.useAnimationTick)({ enabled: animate, intervalMs: 80 });
|
|
63
|
+
const ink = animate ? (0, import_wordmark.pulseInk)(art, tick / PULSE_CYCLE_TICKS) : art.ink;
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", flexShrink: 0, children: art.text.map((line, r) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { wrap: "truncate-end", children: inkRuns(line, ink[r] ?? "").map((run, i) => {
|
|
65
|
+
const role = WORDMARK_INK[run.ink];
|
|
66
|
+
return role === void 0 ? run.text : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone(role), children: run.text }, i);
|
|
67
|
+
}) }, r)) });
|
|
68
|
+
}
|
|
69
|
+
function CutText({ text, role = "hi" }) {
|
|
70
|
+
const tone = (0, import_tone.useTone)();
|
|
71
|
+
const caps = (0, import_caps.useCaps)();
|
|
72
|
+
if (caps.glyphs === "ascii") {
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { height: 3, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { bold: true, color: tone(role), children: text.toUpperCase() }) });
|
|
74
|
+
}
|
|
75
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", flexShrink: 0, children: (0, import_cut.cutLines)(text).map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone(role), children: line }, i)) });
|
|
76
|
+
}
|
|
77
|
+
const DECK_MODES = {
|
|
78
|
+
idle: { label: "READY", role: "tealDim" },
|
|
79
|
+
think: { label: "THINKING", role: "teal" },
|
|
80
|
+
stream: { label: "STREAMING", role: "teal" },
|
|
81
|
+
tool: { label: "WORKING", role: "teal" },
|
|
82
|
+
cloud: { label: "CLOUD", role: "cloud" },
|
|
83
|
+
wait: { label: "NEEDS YOU", role: "amber" },
|
|
84
|
+
fault: { label: "FAULT", role: "red" },
|
|
85
|
+
stop: { label: "STOPPED", role: "dim" },
|
|
86
|
+
steer: { label: "STEERING", role: "amber" },
|
|
87
|
+
offline: { label: "LOCAL ONLY", role: "dim" },
|
|
88
|
+
handoff: { label: "HANDING OFF", role: "cloud" },
|
|
89
|
+
attached: { label: "ATTACHED", role: "cloud" },
|
|
90
|
+
done: { label: "DONE", role: "tealDim" }
|
|
91
|
+
};
|
|
92
|
+
function Deck({ state, gate, collapsed, paused, children }) {
|
|
93
|
+
const tone = (0, import_tone.useTone)();
|
|
94
|
+
const caps = (0, import_caps.useCaps)();
|
|
95
|
+
const { stdout } = (0, import_ink.useStdout)();
|
|
96
|
+
const [columns, setColumns] = (0, import_react.useState)(stdout.columns || 80);
|
|
97
|
+
(0, import_react.useEffect)(() => {
|
|
98
|
+
const onResize = () => setColumns(stdout.columns || 80);
|
|
99
|
+
stdout.on("resize", onResize);
|
|
100
|
+
return () => {
|
|
101
|
+
stdout.off("resize", onResize);
|
|
102
|
+
};
|
|
103
|
+
}, [stdout]);
|
|
104
|
+
const wordmarkColumns = (0, import_wordmark.pickWordmark)((0, import_wordmark.wordmarkTier)(caps), 3).cols + 3;
|
|
105
|
+
const layout = (0, import_deck_layout.deckLayout)(columns, wordmarkColumns);
|
|
106
|
+
const bare = layout.band === "bare";
|
|
107
|
+
const mode = DECK_MODES[state.mode];
|
|
108
|
+
const kind = (0, import_trace.traceKind)(state.mode);
|
|
109
|
+
const traceRef = (0, import_react.useRef)(null);
|
|
110
|
+
const [measured, setMeasured] = (0, import_react.useState)(null);
|
|
111
|
+
(0, import_react.useEffect)(() => {
|
|
112
|
+
if (traceRef.current === null) return;
|
|
113
|
+
const { width } = (0, import_ink.measureElement)(traceRef.current);
|
|
114
|
+
if (width !== measured) setMeasured(width);
|
|
115
|
+
});
|
|
116
|
+
const estimate = columns - (bare ? 0 : wordmarkColumns) - (layout.blockWidth > 0 ? layout.blockWidth + 4 : 0);
|
|
117
|
+
const traceWidth = measured ?? Math.max(4, estimate);
|
|
118
|
+
const history = (0, import_use_trace.useTrace)(kind, traceWidth, paused);
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", flexShrink: 0, children: [
|
|
120
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { height: collapsed ? 0 : layout.bandRows, flexShrink: 0, overflow: "hidden", children: [
|
|
121
|
+
!bare && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginLeft: 1, marginRight: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Wordmark, { rows: 3, pulse: state.mode === "think" && !paused }) }),
|
|
122
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
123
|
+
import_ink.Box,
|
|
124
|
+
{
|
|
125
|
+
ref: traceRef,
|
|
126
|
+
flexDirection: "column",
|
|
127
|
+
flexGrow: 1,
|
|
128
|
+
flexShrink: 1,
|
|
129
|
+
overflow: "hidden",
|
|
130
|
+
children: [
|
|
131
|
+
layout.band === "mid" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { justifyContent: "flex-end", height: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { wrap: "truncate-end", children: [
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { bold: true, color: tone(mode.role), children: mode.label }),
|
|
133
|
+
state.readout !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("dim"), children: (0, import_glyphs.glyphText)(` \xB7 ${state.readout}`, caps.glyphs) })
|
|
134
|
+
] }) }),
|
|
135
|
+
layout.band === "wide" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { height: 1 }),
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_deck_parts.TraceView, { history, width: traceWidth, height: 2 })
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
layout.band === "wide" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginLeft: 3, marginRight: 1, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
|
+
import_deck_parts.StatusBlock,
|
|
142
|
+
{
|
|
143
|
+
label: mode.label,
|
|
144
|
+
labelColor: tone(mode.role),
|
|
145
|
+
readout: state.readout,
|
|
146
|
+
status: state.status,
|
|
147
|
+
width: layout.blockWidth
|
|
148
|
+
}
|
|
149
|
+
) })
|
|
150
|
+
] }),
|
|
151
|
+
gate,
|
|
152
|
+
children,
|
|
153
|
+
layout.statusRow && !collapsed && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
154
|
+
import_deck_parts.StatusRow,
|
|
155
|
+
{
|
|
156
|
+
status: state.status,
|
|
157
|
+
width: columns,
|
|
158
|
+
notice: bare && state.readout !== null ? { text: state.readout, color: tone(mode.role) } : null
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
] });
|
|
162
|
+
}
|
|
163
|
+
const ACTOR_ROLE = { you: "hi", agent: "teal", cloud: "cloud" };
|
|
164
|
+
const ACTOR_LABEL = {
|
|
165
|
+
you: "YOU",
|
|
166
|
+
agent: "AGENT",
|
|
167
|
+
cloud: "CLOUD"
|
|
168
|
+
};
|
|
169
|
+
function actorMarginWidth(columns) {
|
|
170
|
+
return columns >= 64 ? 8 : 2;
|
|
171
|
+
}
|
|
172
|
+
function ActorRow({ actor, label, children }) {
|
|
173
|
+
const tone = (0, import_tone.useTone)();
|
|
174
|
+
const { glyphs } = (0, import_caps.useCaps)();
|
|
175
|
+
const { stdout } = (0, import_ink.useStdout)();
|
|
176
|
+
const margin = actorMarginWidth(stdout.columns || 80);
|
|
177
|
+
const role = ACTOR_ROLE[actor];
|
|
178
|
+
const head = margin >= 8 ? label ?? ACTOR_LABEL[actor] : actor === "you" ? "\u203A" : "\u25AA";
|
|
179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { children: [
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { width: margin, flexShrink: 0, paddingRight: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { bold: true, color: tone(role), wrap: "truncate-end", children: (0, import_glyphs.glyphText)(margin >= 8 ? ` ${head}` : head, glyphs) }) }),
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", flexGrow: 1, children })
|
|
182
|
+
] });
|
|
183
|
+
}
|
|
184
|
+
const STEP_WORD = {
|
|
185
|
+
fail: "FAIL",
|
|
186
|
+
deny: "DENIED",
|
|
187
|
+
wait: "NEEDS YOU",
|
|
188
|
+
ask: "ASKING",
|
|
189
|
+
skip: "SKIPPED",
|
|
190
|
+
queue: "QUEUED",
|
|
191
|
+
stop: "STOPPED"
|
|
192
|
+
};
|
|
193
|
+
function stepRole(step) {
|
|
194
|
+
if (step.state === "fail") return "red";
|
|
195
|
+
if (step.state === "deny" || step.state === "wait" || step.state === "ask") return "amber";
|
|
196
|
+
if (step.cloud) return "cloud";
|
|
197
|
+
if (step.state === "queue" || step.state === "skip") return "faint";
|
|
198
|
+
return "teal";
|
|
199
|
+
}
|
|
200
|
+
function stepGlyph(step) {
|
|
201
|
+
if (step.cloud) return "\u25C6";
|
|
202
|
+
if (step.state === "run" || step.state === "wait" || step.state === "ask") return "\u25B8";
|
|
203
|
+
if (step.state === "skip" || step.state === "queue") return "\u25AB";
|
|
204
|
+
return "\u25AA";
|
|
205
|
+
}
|
|
206
|
+
function DetailText({ detail }) {
|
|
207
|
+
const tone = (0, import_tone.useTone)();
|
|
208
|
+
const { glyphs } = (0, import_caps.useCaps)();
|
|
209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: detail.split(/(\+\d+|−\d+)/).map((part, i) => {
|
|
210
|
+
const role = /^\+\d/.test(part) ? "add" : /^−\d/.test(part) ? "del" : "dim";
|
|
211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone(role), children: (0, import_glyphs.glyphText)(part, glyphs) }, i);
|
|
212
|
+
}) });
|
|
213
|
+
}
|
|
214
|
+
function StepRow({ step }) {
|
|
215
|
+
const tone = (0, import_tone.useTone)();
|
|
216
|
+
const role = stepRole(step);
|
|
217
|
+
const quiet = step.state === "queue" || step.state === "skip";
|
|
218
|
+
const word = STEP_WORD[step.state];
|
|
219
|
+
const { glyphs } = (0, import_caps.useCaps)();
|
|
220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { children: [
|
|
221
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { width: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone(role), children: (0, import_glyphs.glyphText)(stepGlyph(step), glyphs) }) }),
|
|
222
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { width: 8, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { bold: true, color: tone(quiet ? "dim" : step.cloud ? "cloud" : "hi"), children: step.verb }) }),
|
|
223
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexGrow: 1, flexShrink: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone(quiet ? "dim" : "fg"), wrap: "truncate-end", children: (0, import_glyphs.glyphText)(step.target, glyphs) }) }),
|
|
224
|
+
step.detail !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexShrink: 2, marginLeft: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { wrap: "truncate-end", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DetailText, { detail: step.detail }) }) }),
|
|
225
|
+
step.time !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexShrink: 0, marginLeft: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("faint"), children: (0, import_glyphs.glyphText)(step.time, glyphs) }) }),
|
|
226
|
+
word !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexShrink: 0, marginLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { bold: true, color: tone(role), children: word }) })
|
|
227
|
+
] });
|
|
228
|
+
}
|
|
229
|
+
function GateFrame({ title, role = "amber", hint, children }) {
|
|
230
|
+
const tone = (0, import_tone.useTone)();
|
|
231
|
+
const { glyphs } = (0, import_caps.useCaps)();
|
|
232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
233
|
+
import_ink.Box,
|
|
234
|
+
{
|
|
235
|
+
flexDirection: "column",
|
|
236
|
+
borderStyle: glyphs === "ascii" ? "classic" : "round",
|
|
237
|
+
borderColor: tone(role),
|
|
238
|
+
paddingX: 1,
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { bold: true, color: tone(role), children: (0, import_glyphs.glyphText)(title, glyphs) }),
|
|
241
|
+
children,
|
|
242
|
+
hint !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("dim"), children: (0, import_glyphs.glyphText)(hint, glyphs) })
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
248
|
+
0 && (module.exports = {
|
|
249
|
+
ActorRow,
|
|
250
|
+
CutText,
|
|
251
|
+
DECK_MODES,
|
|
252
|
+
Deck,
|
|
253
|
+
GateFrame,
|
|
254
|
+
StepRow,
|
|
255
|
+
Wordmark,
|
|
256
|
+
actorMarginWidth
|
|
257
|
+
});
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signal kit parts. The prop types here are the contract the deck, transcript and view owners
|
|
3
|
+
* build against; the bodies are first cuts that later work replaces in place.
|
|
4
|
+
*/
|
|
5
|
+
import { type ReactNode } from 'react';
|
|
6
|
+
import { type Role } from './tone.js';
|
|
7
|
+
export interface WordmarkProps {
|
|
8
|
+
/** Height in rows. The wordmark picks the largest drawing that fits. */
|
|
9
|
+
rows: number;
|
|
10
|
+
/** Light the mark in travelling rings (the agent is thinking). */
|
|
11
|
+
pulse?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** The Dexto logo: the mark in teal (thin arcs dimmer), the word in the reading colour. */
|
|
14
|
+
export declare function Wordmark({ rows, pulse }: WordmarkProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export interface CutTextProps {
|
|
16
|
+
text: string;
|
|
17
|
+
role?: Role;
|
|
18
|
+
}
|
|
19
|
+
/** A title in cut type, 3 rows tall. ASCII terminals get the plain word. */
|
|
20
|
+
export declare function CutText({ text, role }: CutTextProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export type DeckMode = 'idle' | 'think' | 'stream' | 'tool' | 'cloud' | 'wait' | 'fault' | 'stop' | 'steer' | 'offline' | 'handoff' | 'attached' | 'done';
|
|
22
|
+
/** The word the deck shows for each mode, and its role. */
|
|
23
|
+
export declare const DECK_MODES: Readonly<Record<DeckMode, {
|
|
24
|
+
label: string;
|
|
25
|
+
role: Role;
|
|
26
|
+
}>>;
|
|
27
|
+
/** Where the agent runs: this machine, or a named Dexto cloud computer. */
|
|
28
|
+
export type DeckWhere = {
|
|
29
|
+
kind: 'local';
|
|
30
|
+
} | {
|
|
31
|
+
kind: 'computer';
|
|
32
|
+
name: string;
|
|
33
|
+
};
|
|
34
|
+
/** Dexto credits as the status line shows them. */
|
|
35
|
+
export type DeckCredits = {
|
|
36
|
+
kind: 'signed-out';
|
|
37
|
+
}
|
|
38
|
+
/** Signed in; balance not known yet (loading, or the request failed). */
|
|
39
|
+
| {
|
|
40
|
+
kind: 'signed-in';
|
|
41
|
+
} | {
|
|
42
|
+
kind: 'balance';
|
|
43
|
+
balance: number;
|
|
44
|
+
spend: number | null;
|
|
45
|
+
} | {
|
|
46
|
+
kind: 'out';
|
|
47
|
+
};
|
|
48
|
+
export interface DeckStatus {
|
|
49
|
+
/** Model id as the user picked it, e.g. "dexto/sonnet-5.5" or "anthropic/claude-…". */
|
|
50
|
+
model: string;
|
|
51
|
+
contextUsedTokens: number | null;
|
|
52
|
+
contextMaxTokens: number | null;
|
|
53
|
+
where: DeckWhere;
|
|
54
|
+
branch: string | null;
|
|
55
|
+
dirtyFiles: number;
|
|
56
|
+
credits: DeckCredits;
|
|
57
|
+
}
|
|
58
|
+
export interface DeckState {
|
|
59
|
+
mode: DeckMode;
|
|
60
|
+
/** Short live readout beside the mode, e.g. "paused 0:14" or "diff · 2 files". */
|
|
61
|
+
readout: string | null;
|
|
62
|
+
status: DeckStatus;
|
|
63
|
+
}
|
|
64
|
+
export interface DeckProps {
|
|
65
|
+
state: DeckState;
|
|
66
|
+
/** An approval or question, drawn between the band and the input. */
|
|
67
|
+
gate?: ReactNode;
|
|
68
|
+
/** Draw only the gate and input, for overlays that budget for the whole screen. */
|
|
69
|
+
collapsed: boolean;
|
|
70
|
+
/** Hold the animations still, so text in the live region can be selected. */
|
|
71
|
+
paused: boolean;
|
|
72
|
+
/** The input row. */
|
|
73
|
+
children: ReactNode;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The slim band under the transcript: wordmark, live trace, status; then gate and input.
|
|
77
|
+
* It steps down with width (see `deckLayout`): 4 rows wide, 5 in the middle, 4 when bare.
|
|
78
|
+
*/
|
|
79
|
+
export declare function Deck({ state, gate, collapsed, paused, children }: DeckProps): import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
export type ActorKind = 'you' | 'agent' | 'cloud';
|
|
81
|
+
/** Margin width: an 8-column ship's-log margin at 64 columns and up, a glyph below that. */
|
|
82
|
+
export declare function actorMarginWidth(columns: number): number;
|
|
83
|
+
export interface ActorRowProps {
|
|
84
|
+
actor: ActorKind;
|
|
85
|
+
/** Overrides the actor's default label (a teammate's name, a cloud agent's name). Six cells show. */
|
|
86
|
+
label?: string;
|
|
87
|
+
children: ReactNode;
|
|
88
|
+
}
|
|
89
|
+
/** A transcript block with the actor in the left margin. */
|
|
90
|
+
export declare function ActorRow({ actor, label, children }: ActorRowProps): import("react/jsx-runtime").JSX.Element;
|
|
91
|
+
export type StepState = 'ok' | 'run' | 'fail' | 'deny' | 'skip' | 'queue' | 'stop' | 'wait' | 'ask';
|
|
92
|
+
export interface Step {
|
|
93
|
+
state: StepState;
|
|
94
|
+
/** Upper-case verb, up to 7 cells: READ, EDIT, RUN, SEARCH… */
|
|
95
|
+
verb: string;
|
|
96
|
+
target: string;
|
|
97
|
+
/** "+12 −3", "staging database"; +N and −N are coloured. */
|
|
98
|
+
detail: string | null;
|
|
99
|
+
/** Elapsed time, already formatted ("0.4s"). */
|
|
100
|
+
time: string | null;
|
|
101
|
+
/** Ran on Dexto cloud. */
|
|
102
|
+
cloud: boolean;
|
|
103
|
+
}
|
|
104
|
+
export interface StepRowProps {
|
|
105
|
+
step: Step;
|
|
106
|
+
}
|
|
107
|
+
/** One tool call as one fixed-column row: glyph · VERB · target · detail · time · state word. */
|
|
108
|
+
export declare function StepRow({ step }: StepRowProps): import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
export interface GateFrameProps {
|
|
110
|
+
/** e.g. "NEEDS YOU · RUN A COMMAND" or "QUESTION · How long…". */
|
|
111
|
+
title: string;
|
|
112
|
+
/** amber: waiting on you. red: a fault you must act on. */
|
|
113
|
+
role?: 'amber' | 'red';
|
|
114
|
+
/** Key hints for the bottom edge, "⏎ answer · esc let it decide". */
|
|
115
|
+
hint?: string;
|
|
116
|
+
children: ReactNode;
|
|
117
|
+
}
|
|
118
|
+
/** The frame around anything that waits on the user: approvals, questions, steer. */
|
|
119
|
+
export declare function GateFrame({ title, role, hint, children }: GateFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
120
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/signal/components.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { Box, Text, measureElement, useStdout } from "ink";
|
|
4
|
+
import { useAnimationTick } from "../hooks/useAnimationTick.js";
|
|
5
|
+
import { useCaps } from "./caps.js";
|
|
6
|
+
import { glyphText } from "./glyphs.js";
|
|
7
|
+
import { cutLines } from "./cut.js";
|
|
8
|
+
import { useTone } from "./tone.js";
|
|
9
|
+
import { deckLayout } from "./deck-layout.js";
|
|
10
|
+
import { StatusBlock, StatusRow, TraceView } from "./deck-parts.js";
|
|
11
|
+
import { traceKind } from "./trace.js";
|
|
12
|
+
import { useTrace } from "./use-trace.js";
|
|
13
|
+
import { pickWordmark, pulseInk, wordmarkTier } from "./wordmark.js";
|
|
14
|
+
const WORDMARK_INK = { m: "teal", f: "tealDim", w: "hi" };
|
|
15
|
+
const PULSE_CYCLE_TICKS = 15;
|
|
16
|
+
function inkRuns(text, ink) {
|
|
17
|
+
const glyphs = Array.from(text);
|
|
18
|
+
const runs = [];
|
|
19
|
+
glyphs.forEach((glyph, c) => {
|
|
20
|
+
const letter = ink[c] ?? " ";
|
|
21
|
+
const last = runs[runs.length - 1];
|
|
22
|
+
if (last !== void 0 && last.ink === letter) last.text += glyph;
|
|
23
|
+
else runs.push({ ink: letter, text: glyph });
|
|
24
|
+
});
|
|
25
|
+
return runs;
|
|
26
|
+
}
|
|
27
|
+
function Wordmark({ rows, pulse = false }) {
|
|
28
|
+
const tone = useTone();
|
|
29
|
+
const caps = useCaps();
|
|
30
|
+
const art = pickWordmark(wordmarkTier(caps), Math.max(1, rows));
|
|
31
|
+
const animate = pulse && caps.motion === "full";
|
|
32
|
+
const tick = useAnimationTick({ enabled: animate, intervalMs: 80 });
|
|
33
|
+
const ink = animate ? pulseInk(art, tick / PULSE_CYCLE_TICKS) : art.ink;
|
|
34
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", flexShrink: 0, children: art.text.map((line, r) => /* @__PURE__ */ jsx(Text, { wrap: "truncate-end", children: inkRuns(line, ink[r] ?? "").map((run, i) => {
|
|
35
|
+
const role = WORDMARK_INK[run.ink];
|
|
36
|
+
return role === void 0 ? run.text : /* @__PURE__ */ jsx(Text, { color: tone(role), children: run.text }, i);
|
|
37
|
+
}) }, r)) });
|
|
38
|
+
}
|
|
39
|
+
function CutText({ text, role = "hi" }) {
|
|
40
|
+
const tone = useTone();
|
|
41
|
+
const caps = useCaps();
|
|
42
|
+
if (caps.glyphs === "ascii") {
|
|
43
|
+
return /* @__PURE__ */ jsx(Box, { height: 3, flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { bold: true, color: tone(role), children: text.toUpperCase() }) });
|
|
44
|
+
}
|
|
45
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", flexShrink: 0, children: cutLines(text).map((line, i) => /* @__PURE__ */ jsx(Text, { color: tone(role), children: line }, i)) });
|
|
46
|
+
}
|
|
47
|
+
const DECK_MODES = {
|
|
48
|
+
idle: { label: "READY", role: "tealDim" },
|
|
49
|
+
think: { label: "THINKING", role: "teal" },
|
|
50
|
+
stream: { label: "STREAMING", role: "teal" },
|
|
51
|
+
tool: { label: "WORKING", role: "teal" },
|
|
52
|
+
cloud: { label: "CLOUD", role: "cloud" },
|
|
53
|
+
wait: { label: "NEEDS YOU", role: "amber" },
|
|
54
|
+
fault: { label: "FAULT", role: "red" },
|
|
55
|
+
stop: { label: "STOPPED", role: "dim" },
|
|
56
|
+
steer: { label: "STEERING", role: "amber" },
|
|
57
|
+
offline: { label: "LOCAL ONLY", role: "dim" },
|
|
58
|
+
handoff: { label: "HANDING OFF", role: "cloud" },
|
|
59
|
+
attached: { label: "ATTACHED", role: "cloud" },
|
|
60
|
+
done: { label: "DONE", role: "tealDim" }
|
|
61
|
+
};
|
|
62
|
+
function Deck({ state, gate, collapsed, paused, children }) {
|
|
63
|
+
const tone = useTone();
|
|
64
|
+
const caps = useCaps();
|
|
65
|
+
const { stdout } = useStdout();
|
|
66
|
+
const [columns, setColumns] = useState(stdout.columns || 80);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
const onResize = () => setColumns(stdout.columns || 80);
|
|
69
|
+
stdout.on("resize", onResize);
|
|
70
|
+
return () => {
|
|
71
|
+
stdout.off("resize", onResize);
|
|
72
|
+
};
|
|
73
|
+
}, [stdout]);
|
|
74
|
+
const wordmarkColumns = pickWordmark(wordmarkTier(caps), 3).cols + 3;
|
|
75
|
+
const layout = deckLayout(columns, wordmarkColumns);
|
|
76
|
+
const bare = layout.band === "bare";
|
|
77
|
+
const mode = DECK_MODES[state.mode];
|
|
78
|
+
const kind = traceKind(state.mode);
|
|
79
|
+
const traceRef = useRef(null);
|
|
80
|
+
const [measured, setMeasured] = useState(null);
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (traceRef.current === null) return;
|
|
83
|
+
const { width } = measureElement(traceRef.current);
|
|
84
|
+
if (width !== measured) setMeasured(width);
|
|
85
|
+
});
|
|
86
|
+
const estimate = columns - (bare ? 0 : wordmarkColumns) - (layout.blockWidth > 0 ? layout.blockWidth + 4 : 0);
|
|
87
|
+
const traceWidth = measured ?? Math.max(4, estimate);
|
|
88
|
+
const history = useTrace(kind, traceWidth, paused);
|
|
89
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", flexShrink: 0, children: [
|
|
90
|
+
/* @__PURE__ */ jsxs(Box, { height: collapsed ? 0 : layout.bandRows, flexShrink: 0, overflow: "hidden", children: [
|
|
91
|
+
!bare && /* @__PURE__ */ jsx(Box, { marginLeft: 1, marginRight: 2, flexShrink: 0, children: /* @__PURE__ */ jsx(Wordmark, { rows: 3, pulse: state.mode === "think" && !paused }) }),
|
|
92
|
+
/* @__PURE__ */ jsxs(
|
|
93
|
+
Box,
|
|
94
|
+
{
|
|
95
|
+
ref: traceRef,
|
|
96
|
+
flexDirection: "column",
|
|
97
|
+
flexGrow: 1,
|
|
98
|
+
flexShrink: 1,
|
|
99
|
+
overflow: "hidden",
|
|
100
|
+
children: [
|
|
101
|
+
layout.band === "mid" && /* @__PURE__ */ jsx(Box, { justifyContent: "flex-end", height: 1, children: /* @__PURE__ */ jsxs(Text, { wrap: "truncate-end", children: [
|
|
102
|
+
/* @__PURE__ */ jsx(Text, { bold: true, color: tone(mode.role), children: mode.label }),
|
|
103
|
+
state.readout !== null && /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: glyphText(` \xB7 ${state.readout}`, caps.glyphs) })
|
|
104
|
+
] }) }),
|
|
105
|
+
layout.band === "wide" && /* @__PURE__ */ jsx(Box, { height: 1 }),
|
|
106
|
+
/* @__PURE__ */ jsx(TraceView, { history, width: traceWidth, height: 2 })
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
layout.band === "wide" && /* @__PURE__ */ jsx(Box, { marginLeft: 3, marginRight: 1, flexShrink: 0, children: /* @__PURE__ */ jsx(
|
|
111
|
+
StatusBlock,
|
|
112
|
+
{
|
|
113
|
+
label: mode.label,
|
|
114
|
+
labelColor: tone(mode.role),
|
|
115
|
+
readout: state.readout,
|
|
116
|
+
status: state.status,
|
|
117
|
+
width: layout.blockWidth
|
|
118
|
+
}
|
|
119
|
+
) })
|
|
120
|
+
] }),
|
|
121
|
+
gate,
|
|
122
|
+
children,
|
|
123
|
+
layout.statusRow && !collapsed && /* @__PURE__ */ jsx(
|
|
124
|
+
StatusRow,
|
|
125
|
+
{
|
|
126
|
+
status: state.status,
|
|
127
|
+
width: columns,
|
|
128
|
+
notice: bare && state.readout !== null ? { text: state.readout, color: tone(mode.role) } : null
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
] });
|
|
132
|
+
}
|
|
133
|
+
const ACTOR_ROLE = { you: "hi", agent: "teal", cloud: "cloud" };
|
|
134
|
+
const ACTOR_LABEL = {
|
|
135
|
+
you: "YOU",
|
|
136
|
+
agent: "AGENT",
|
|
137
|
+
cloud: "CLOUD"
|
|
138
|
+
};
|
|
139
|
+
function actorMarginWidth(columns) {
|
|
140
|
+
return columns >= 64 ? 8 : 2;
|
|
141
|
+
}
|
|
142
|
+
function ActorRow({ actor, label, children }) {
|
|
143
|
+
const tone = useTone();
|
|
144
|
+
const { glyphs } = useCaps();
|
|
145
|
+
const { stdout } = useStdout();
|
|
146
|
+
const margin = actorMarginWidth(stdout.columns || 80);
|
|
147
|
+
const role = ACTOR_ROLE[actor];
|
|
148
|
+
const head = margin >= 8 ? label ?? ACTOR_LABEL[actor] : actor === "you" ? "\u203A" : "\u25AA";
|
|
149
|
+
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
150
|
+
/* @__PURE__ */ jsx(Box, { width: margin, flexShrink: 0, paddingRight: 1, children: /* @__PURE__ */ jsx(Text, { bold: true, color: tone(role), wrap: "truncate-end", children: glyphText(margin >= 8 ? ` ${head}` : head, glyphs) }) }),
|
|
151
|
+
/* @__PURE__ */ jsx(Box, { flexDirection: "column", flexGrow: 1, children })
|
|
152
|
+
] });
|
|
153
|
+
}
|
|
154
|
+
const STEP_WORD = {
|
|
155
|
+
fail: "FAIL",
|
|
156
|
+
deny: "DENIED",
|
|
157
|
+
wait: "NEEDS YOU",
|
|
158
|
+
ask: "ASKING",
|
|
159
|
+
skip: "SKIPPED",
|
|
160
|
+
queue: "QUEUED",
|
|
161
|
+
stop: "STOPPED"
|
|
162
|
+
};
|
|
163
|
+
function stepRole(step) {
|
|
164
|
+
if (step.state === "fail") return "red";
|
|
165
|
+
if (step.state === "deny" || step.state === "wait" || step.state === "ask") return "amber";
|
|
166
|
+
if (step.cloud) return "cloud";
|
|
167
|
+
if (step.state === "queue" || step.state === "skip") return "faint";
|
|
168
|
+
return "teal";
|
|
169
|
+
}
|
|
170
|
+
function stepGlyph(step) {
|
|
171
|
+
if (step.cloud) return "\u25C6";
|
|
172
|
+
if (step.state === "run" || step.state === "wait" || step.state === "ask") return "\u25B8";
|
|
173
|
+
if (step.state === "skip" || step.state === "queue") return "\u25AB";
|
|
174
|
+
return "\u25AA";
|
|
175
|
+
}
|
|
176
|
+
function DetailText({ detail }) {
|
|
177
|
+
const tone = useTone();
|
|
178
|
+
const { glyphs } = useCaps();
|
|
179
|
+
return /* @__PURE__ */ jsx(Fragment, { children: detail.split(/(\+\d+|−\d+)/).map((part, i) => {
|
|
180
|
+
const role = /^\+\d/.test(part) ? "add" : /^−\d/.test(part) ? "del" : "dim";
|
|
181
|
+
return /* @__PURE__ */ jsx(Text, { color: tone(role), children: glyphText(part, glyphs) }, i);
|
|
182
|
+
}) });
|
|
183
|
+
}
|
|
184
|
+
function StepRow({ step }) {
|
|
185
|
+
const tone = useTone();
|
|
186
|
+
const role = stepRole(step);
|
|
187
|
+
const quiet = step.state === "queue" || step.state === "skip";
|
|
188
|
+
const word = STEP_WORD[step.state];
|
|
189
|
+
const { glyphs } = useCaps();
|
|
190
|
+
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
191
|
+
/* @__PURE__ */ jsx(Box, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { color: tone(role), children: glyphText(stepGlyph(step), glyphs) }) }),
|
|
192
|
+
/* @__PURE__ */ jsx(Box, { width: 8, flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { bold: true, color: tone(quiet ? "dim" : step.cloud ? "cloud" : "hi"), children: step.verb }) }),
|
|
193
|
+
/* @__PURE__ */ jsx(Box, { flexGrow: 1, flexShrink: 1, children: /* @__PURE__ */ jsx(Text, { color: tone(quiet ? "dim" : "fg"), wrap: "truncate-end", children: glyphText(step.target, glyphs) }) }),
|
|
194
|
+
step.detail !== null && /* @__PURE__ */ jsx(Box, { flexShrink: 2, marginLeft: 1, children: /* @__PURE__ */ jsx(Text, { wrap: "truncate-end", children: /* @__PURE__ */ jsx(DetailText, { detail: step.detail }) }) }),
|
|
195
|
+
step.time !== null && /* @__PURE__ */ jsx(Box, { flexShrink: 0, marginLeft: 1, children: /* @__PURE__ */ jsx(Text, { color: tone("faint"), children: glyphText(step.time, glyphs) }) }),
|
|
196
|
+
word !== void 0 && /* @__PURE__ */ jsx(Box, { flexShrink: 0, marginLeft: 2, children: /* @__PURE__ */ jsx(Text, { bold: true, color: tone(role), children: word }) })
|
|
197
|
+
] });
|
|
198
|
+
}
|
|
199
|
+
function GateFrame({ title, role = "amber", hint, children }) {
|
|
200
|
+
const tone = useTone();
|
|
201
|
+
const { glyphs } = useCaps();
|
|
202
|
+
return /* @__PURE__ */ jsxs(
|
|
203
|
+
Box,
|
|
204
|
+
{
|
|
205
|
+
flexDirection: "column",
|
|
206
|
+
borderStyle: glyphs === "ascii" ? "classic" : "round",
|
|
207
|
+
borderColor: tone(role),
|
|
208
|
+
paddingX: 1,
|
|
209
|
+
children: [
|
|
210
|
+
/* @__PURE__ */ jsx(Text, { bold: true, color: tone(role), children: glyphText(title, glyphs) }),
|
|
211
|
+
children,
|
|
212
|
+
hint !== void 0 && /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: glyphText(hint, glyphs) })
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
export {
|
|
218
|
+
ActorRow,
|
|
219
|
+
CutText,
|
|
220
|
+
DECK_MODES,
|
|
221
|
+
Deck,
|
|
222
|
+
GateFrame,
|
|
223
|
+
StepRow,
|
|
224
|
+
Wordmark,
|
|
225
|
+
actorMarginWidth
|
|
226
|
+
};
|