@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,30 @@
|
|
|
1
|
+
const WIDE_COLUMNS = 100;
|
|
2
|
+
const MID_READOUT_COLUMNS = 24;
|
|
3
|
+
function deckLayout(columns, wordmarkColumns) {
|
|
4
|
+
if (columns >= WIDE_COLUMNS) {
|
|
5
|
+
return {
|
|
6
|
+
band: "wide",
|
|
7
|
+
bandRows: 3,
|
|
8
|
+
statusRow: false,
|
|
9
|
+
blockWidth: Math.min(36, Math.max(30, Math.floor(columns * 0.26)))
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
if (columns >= wordmarkColumns + MID_READOUT_COLUMNS) {
|
|
13
|
+
return { band: "mid", bandRows: 3, statusRow: true, blockWidth: 0 };
|
|
14
|
+
}
|
|
15
|
+
return { band: "bare", bandRows: 2, statusRow: true, blockWidth: 0 };
|
|
16
|
+
}
|
|
17
|
+
function formatTokens(tokens) {
|
|
18
|
+
if (tokens >= 1e6) return `${trimZero((tokens / 1e6).toFixed(1))}M`;
|
|
19
|
+
if (tokens >= 1e3) return `${Math.round(tokens / 1e3)}k`;
|
|
20
|
+
return String(tokens);
|
|
21
|
+
}
|
|
22
|
+
function trimZero(value) {
|
|
23
|
+
return value.endsWith(".0") ? value.slice(0, -2) : value;
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
MID_READOUT_COLUMNS,
|
|
27
|
+
WIDE_COLUMNS,
|
|
28
|
+
deckLayout,
|
|
29
|
+
formatTokens
|
|
30
|
+
};
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var deck_parts_exports = {};
|
|
30
|
+
__export(deck_parts_exports, {
|
|
31
|
+
StatusBlock: () => StatusBlock,
|
|
32
|
+
StatusRow: () => StatusRow,
|
|
33
|
+
TraceView: () => TraceView,
|
|
34
|
+
laneParts: () => laneParts,
|
|
35
|
+
statusRowFit: () => statusRowFit
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(deck_parts_exports);
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var import_ink = require("ink");
|
|
40
|
+
var import_string_width = __toESM(require("string-width"), 1);
|
|
41
|
+
var import_caps = require("./caps.js");
|
|
42
|
+
var import_glyphs = require("./glyphs.js");
|
|
43
|
+
var import_tone = require("./tone.js");
|
|
44
|
+
var import_trace = require("./trace.js");
|
|
45
|
+
var import_deck_layout = require("./deck-layout.js");
|
|
46
|
+
function runs(cells2, color) {
|
|
47
|
+
const out = [];
|
|
48
|
+
for (const cell of cells2) {
|
|
49
|
+
const c = color(cell);
|
|
50
|
+
const prev = out[out.length - 1];
|
|
51
|
+
if (prev && prev.color === c && prev.inverse === cell.inverse) prev.text += cell.ch;
|
|
52
|
+
else out.push({ text: cell.ch, color: c, inverse: cell.inverse });
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
function TraceView({ history, width, height }) {
|
|
57
|
+
const tone = (0, import_tone.useTone)();
|
|
58
|
+
const { glyphs } = (0, import_caps.useCaps)();
|
|
59
|
+
const background = tone("bg");
|
|
60
|
+
const rows = (0, import_trace.traceRows)(history, Math.max(0, width), height);
|
|
61
|
+
const color = (cell) => (0, import_trace.fadeColor)(tone(import_trace.TRACE_ROLE[cell.kind]), background, Math.round(cell.fade * 10) / 10);
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", flexShrink: 0, width: Math.max(0, width), children: rows.map((row, r) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { wrap: "truncate-end", children: runs(row, color).map(
|
|
63
|
+
(run, i) => glyphs === "ascii" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: run.color, children: (0, import_glyphs.glyphText)(run.inverse ? asciiLower(run.text) : run.text, glyphs) }, i) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: run.color, inverse: run.inverse, children: run.text }, i)
|
|
64
|
+
) }, r)) });
|
|
65
|
+
}
|
|
66
|
+
function asciiLower(text) {
|
|
67
|
+
return text.replace(/[▁▂▃▄]/g, "=").replace(/[▅▆▇]/g, "-");
|
|
68
|
+
}
|
|
69
|
+
function ModelName({ model }) {
|
|
70
|
+
const tone = (0, import_tone.useTone)();
|
|
71
|
+
const slash = model.indexOf("/");
|
|
72
|
+
if (slash < 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("fg"), children: model });
|
|
73
|
+
const provider = model.slice(0, slash);
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { children: [
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: tone(provider === "dexto" ? "cloud" : "dim"), children: [
|
|
76
|
+
provider,
|
|
77
|
+
"/"
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("fg"), children: model.slice(slash + 1) })
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
function Where({ where }) {
|
|
83
|
+
const tone = (0, import_tone.useTone)();
|
|
84
|
+
const { glyphs } = (0, import_caps.useCaps)();
|
|
85
|
+
if (where.kind === "computer") {
|
|
86
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("cloud"), children: (0, import_glyphs.glyphText)(`\u25C6 ${where.name}`, glyphs) });
|
|
87
|
+
}
|
|
88
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("teal"), children: (0, import_glyphs.glyphText)("\u25C7 local", glyphs) });
|
|
89
|
+
}
|
|
90
|
+
function formatUsd(value) {
|
|
91
|
+
return `$${value.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
92
|
+
}
|
|
93
|
+
function Credits({ credits, showSpend }) {
|
|
94
|
+
const tone = (0, import_tone.useTone)();
|
|
95
|
+
const { glyphs } = (0, import_caps.useCaps)();
|
|
96
|
+
const dot = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("faint"), children: (0, import_glyphs.glyphText)(" \xB7 ", glyphs) });
|
|
97
|
+
switch (credits.kind) {
|
|
98
|
+
case "signed-out":
|
|
99
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
100
|
+
dot,
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("dim"), children: "cloud off" })
|
|
102
|
+
] });
|
|
103
|
+
case "signed-in":
|
|
104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
105
|
+
dot,
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("cloud"), children: (0, import_glyphs.glyphText)("\u25C6", glyphs) })
|
|
107
|
+
] });
|
|
108
|
+
case "out":
|
|
109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
110
|
+
dot,
|
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("cloud"), children: (0, import_glyphs.glyphText)("\u25C6 ", glyphs) }),
|
|
112
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("red"), children: "out of credits" })
|
|
113
|
+
] });
|
|
114
|
+
case "balance":
|
|
115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
116
|
+
dot,
|
|
117
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("cloud"), children: (0, import_glyphs.glyphText)("\u25C6 ", glyphs) }),
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("fg"), children: formatUsd(credits.balance) }),
|
|
119
|
+
showSpend && credits.spend !== null && credits.spend > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("cloud"), children: (0, import_glyphs.glyphText)(` \u2212${formatUsd(credits.spend)}`, glyphs) })
|
|
120
|
+
] });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function cells(text) {
|
|
124
|
+
return (0, import_string_width.default)(text);
|
|
125
|
+
}
|
|
126
|
+
function whereText(where) {
|
|
127
|
+
return where.kind === "computer" ? `\u25C6 ${where.name}` : "\u25C7 local";
|
|
128
|
+
}
|
|
129
|
+
function spendText(credits) {
|
|
130
|
+
return credits.kind === "balance" && credits.spend !== null && credits.spend > 0 ? ` \u2212${formatUsd(credits.spend)}` : "";
|
|
131
|
+
}
|
|
132
|
+
function creditsText(credits) {
|
|
133
|
+
switch (credits.kind) {
|
|
134
|
+
case "signed-out":
|
|
135
|
+
return " \xB7 cloud off";
|
|
136
|
+
case "signed-in":
|
|
137
|
+
return " \xB7 \u25C6";
|
|
138
|
+
case "out":
|
|
139
|
+
return " \xB7 \u25C6 out of credits";
|
|
140
|
+
case "balance":
|
|
141
|
+
return ` \xB7 \u25C6 ${formatUsd(credits.balance)}`;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function laneParts(status, width) {
|
|
145
|
+
const base = cells(whereText(status.where)) + cells(creditsText(status.credits));
|
|
146
|
+
const spend = cells(spendText(status.credits));
|
|
147
|
+
const branch = status.branch === null ? 0 : cells(` \u2387 ${status.branch}`);
|
|
148
|
+
const dirty = status.dirtyFiles > 0 ? cells(` \xB1${status.dirtyFiles}`) : 0;
|
|
149
|
+
if (base + spend + branch + dirty <= width) {
|
|
150
|
+
return { branch: branch > 0, dirty: dirty > 0, spend: spend > 0 };
|
|
151
|
+
}
|
|
152
|
+
if (base + spend + branch <= width)
|
|
153
|
+
return { branch: branch > 0, dirty: false, spend: spend > 0 };
|
|
154
|
+
if (base + spend <= width) return { branch: false, dirty: false, spend: spend > 0 };
|
|
155
|
+
return { branch: false, dirty: false, spend: false };
|
|
156
|
+
}
|
|
157
|
+
function Lane({ status, width }) {
|
|
158
|
+
const tone = (0, import_tone.useTone)();
|
|
159
|
+
const { glyphs } = (0, import_caps.useCaps)();
|
|
160
|
+
const show = laneParts(status, width);
|
|
161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { wrap: "truncate-end", children: [
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Where, { where: status.where }),
|
|
163
|
+
show.branch && status.branch !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("dim"), children: (0, import_glyphs.glyphText)(` \u2387 ${status.branch}`, glyphs) }),
|
|
164
|
+
show.dirty && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("amberDim"), children: (0, import_glyphs.glyphText)(` \xB1${status.dirtyFiles}`, glyphs) }),
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Credits, { credits: status.credits, showSpend: show.spend })
|
|
166
|
+
] });
|
|
167
|
+
}
|
|
168
|
+
function ModelAndContext({
|
|
169
|
+
model,
|
|
170
|
+
context,
|
|
171
|
+
width
|
|
172
|
+
}) {
|
|
173
|
+
const tone = (0, import_tone.useTone)();
|
|
174
|
+
const contextCells = context === null ? 0 : cells(context) + 2;
|
|
175
|
+
const modelWidth = Math.min(cells(model), width - contextCells);
|
|
176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { width, flexShrink: 0, children: [
|
|
177
|
+
modelWidth >= 4 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { width: modelWidth, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { wrap: "truncate-end", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModelName, { model }) }) }),
|
|
178
|
+
context !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("dim"), children: modelWidth >= 4 ? ` ${context}` : context })
|
|
179
|
+
] });
|
|
180
|
+
}
|
|
181
|
+
function contextText(status, withMax) {
|
|
182
|
+
if (status.contextUsedTokens === null) return null;
|
|
183
|
+
const used = (0, import_deck_layout.formatTokens)(status.contextUsedTokens);
|
|
184
|
+
if (!withMax || status.contextMaxTokens === null) return used;
|
|
185
|
+
return `${used}/${(0, import_deck_layout.formatTokens)(status.contextMaxTokens)}`;
|
|
186
|
+
}
|
|
187
|
+
function StatusBlock({
|
|
188
|
+
label,
|
|
189
|
+
labelColor,
|
|
190
|
+
readout,
|
|
191
|
+
status,
|
|
192
|
+
width
|
|
193
|
+
}) {
|
|
194
|
+
const tone = (0, import_tone.useTone)();
|
|
195
|
+
const { glyphs } = (0, import_caps.useCaps)();
|
|
196
|
+
const context = contextText(status, true);
|
|
197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
198
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { wrap: "truncate-end", children: [
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { bold: true, color: labelColor, children: label }),
|
|
200
|
+
readout !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: tone("dim"), children: (0, import_glyphs.glyphText)(` \xB7 ${readout}`, glyphs) })
|
|
201
|
+
] }),
|
|
202
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModelAndContext, { model: status.model, context, width }),
|
|
203
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Lane, { status, width })
|
|
204
|
+
] });
|
|
205
|
+
}
|
|
206
|
+
function statusRowFit(status, width, noticeWidth) {
|
|
207
|
+
const context = contextText(status, false);
|
|
208
|
+
const natural = cells(status.model) + (context === null ? 0 : cells(context) + 2);
|
|
209
|
+
const laneMin = cells(whereText(status.where)) + cells(creditsText(status.credits));
|
|
210
|
+
const noticeRoom = Math.min(noticeWidth, width - laneMin - 2);
|
|
211
|
+
const notice = noticeRoom >= 4 ? noticeRoom : 0;
|
|
212
|
+
const noticeCells = notice > 0 ? notice + 2 : 0;
|
|
213
|
+
const room = width - noticeCells - laneMin - 2;
|
|
214
|
+
const model = room >= 4 ? Math.min(natural, room) : 0;
|
|
215
|
+
return {
|
|
216
|
+
notice,
|
|
217
|
+
model,
|
|
218
|
+
lane: Math.max(0, width - noticeCells - (model > 0 ? model + 2 : 0))
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function StatusRow({
|
|
222
|
+
status,
|
|
223
|
+
width,
|
|
224
|
+
notice
|
|
225
|
+
}) {
|
|
226
|
+
const { glyphs } = (0, import_caps.useCaps)();
|
|
227
|
+
const context = contextText(status, false);
|
|
228
|
+
const noticeText = notice === null ? "" : (0, import_glyphs.glyphText)(notice.text, glyphs);
|
|
229
|
+
const fit = statusRowFit(status, width, cells(noticeText));
|
|
230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { width, children: [
|
|
231
|
+
notice !== null && fit.notice > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { width: fit.notice, marginRight: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: notice.color, wrap: "truncate-end", children: noticeText }) }),
|
|
232
|
+
fit.model > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginRight: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModelAndContext, { model: status.model, context, width: fit.model }) }),
|
|
233
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { width: fit.lane, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Lane, { status, width: fit.lane }) })
|
|
234
|
+
] });
|
|
235
|
+
}
|
|
236
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
237
|
+
0 && (module.exports = {
|
|
238
|
+
StatusBlock,
|
|
239
|
+
StatusRow,
|
|
240
|
+
TraceView,
|
|
241
|
+
laneParts,
|
|
242
|
+
statusRowFit
|
|
243
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type TraceSample } from './trace.js';
|
|
2
|
+
import type { DeckStatus } from './components.js';
|
|
3
|
+
interface TraceViewProps {
|
|
4
|
+
history: readonly TraceSample[];
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function TraceView({ history, width, height }: TraceViewProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export interface LaneParts {
|
|
10
|
+
branch: boolean;
|
|
11
|
+
dirty: boolean;
|
|
12
|
+
spend: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* What fits beside where and credits in `width` columns. Dropped in order: the dirty count,
|
|
16
|
+
* the branch, then this turn's spend. Where the agent runs and the balance always stay.
|
|
17
|
+
*/
|
|
18
|
+
export declare function laneParts(status: DeckStatus, width: number): LaneParts;
|
|
19
|
+
/** Mode · readout, model and context, lane: three rows beside the trace. */
|
|
20
|
+
export declare function StatusBlock({ label, labelColor, readout, status, width, }: {
|
|
21
|
+
label: string;
|
|
22
|
+
labelColor: string;
|
|
23
|
+
readout: string | null;
|
|
24
|
+
status: DeckStatus;
|
|
25
|
+
width: number;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
/** How the compact status row shares its width. */
|
|
28
|
+
export interface StatusRowFit {
|
|
29
|
+
/** Columns for the notice, without its gap; 0 hides it. */
|
|
30
|
+
notice: number;
|
|
31
|
+
/** Columns for model and context; 0 hides them. */
|
|
32
|
+
model: number;
|
|
33
|
+
/** Columns for the lane. */
|
|
34
|
+
lane: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Where the agent runs and the balance always fit, then the notice, which truncates to what
|
|
38
|
+
* they leave; model and context take the rest and truncate first. Notice and model disappear
|
|
39
|
+
* below four columns. `noticeWidth` is the notice's natural width, without its gap.
|
|
40
|
+
*/
|
|
41
|
+
export declare function statusRowFit(status: DeckStatus, width: number, noticeWidth: number): StatusRowFit;
|
|
42
|
+
/**
|
|
43
|
+
* Model, context and lane in one row under the input. `notice` leads the row when the band
|
|
44
|
+
* has no room for the readout, so the permission mode stays on screen.
|
|
45
|
+
*/
|
|
46
|
+
export declare function StatusRow({ status, width, notice, }: {
|
|
47
|
+
status: DeckStatus;
|
|
48
|
+
width: number;
|
|
49
|
+
notice: {
|
|
50
|
+
text: string;
|
|
51
|
+
color: string;
|
|
52
|
+
} | null;
|
|
53
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=deck-parts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deck-parts.d.ts","sourceRoot":"","sources":["../../src/signal/deck-parts.tsx"],"names":[],"mappings":"AASA,OAAO,EAAoD,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAEhG,OAAO,KAAK,EAAe,UAAU,EAAa,MAAM,iBAAiB,CAAC;AAI1E,UAAU,cAAc;IACpB,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAClB;AAoBD,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,cAAc,2CA2BnE;AA4GD,MAAM,WAAW,SAAS;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAYtE;AA4DD,4EAA4E;AAC5E,wBAAgB,WAAW,CAAC,EACxB,KAAK,EACL,UAAU,EACV,OAAO,EACP,MAAM,EACN,KAAK,GACR,EAAE;IACC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACjB,2CAkBA;AAED,mDAAmD;AACnD,MAAM,WAAW,YAAY;IACzB,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,YAAY,CAcjG;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACtB,MAAM,EACN,KAAK,EACL,MAAM,GACT,EAAE;IACC,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAClD,2CAwBA"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import stringWidth from "string-width";
|
|
4
|
+
import { useCaps } from "./caps.js";
|
|
5
|
+
import { glyphText } from "./glyphs.js";
|
|
6
|
+
import { useTone } from "./tone.js";
|
|
7
|
+
import { TRACE_ROLE, fadeColor, traceRows } from "./trace.js";
|
|
8
|
+
import { formatTokens } from "./deck-layout.js";
|
|
9
|
+
function runs(cells2, color) {
|
|
10
|
+
const out = [];
|
|
11
|
+
for (const cell of cells2) {
|
|
12
|
+
const c = color(cell);
|
|
13
|
+
const prev = out[out.length - 1];
|
|
14
|
+
if (prev && prev.color === c && prev.inverse === cell.inverse) prev.text += cell.ch;
|
|
15
|
+
else out.push({ text: cell.ch, color: c, inverse: cell.inverse });
|
|
16
|
+
}
|
|
17
|
+
return out;
|
|
18
|
+
}
|
|
19
|
+
function TraceView({ history, width, height }) {
|
|
20
|
+
const tone = useTone();
|
|
21
|
+
const { glyphs } = useCaps();
|
|
22
|
+
const background = tone("bg");
|
|
23
|
+
const rows = traceRows(history, Math.max(0, width), height);
|
|
24
|
+
const color = (cell) => fadeColor(tone(TRACE_ROLE[cell.kind]), background, Math.round(cell.fade * 10) / 10);
|
|
25
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", flexShrink: 0, width: Math.max(0, width), children: rows.map((row, r) => /* @__PURE__ */ jsx(Text, { wrap: "truncate-end", children: runs(row, color).map(
|
|
26
|
+
(run, i) => glyphs === "ascii" ? /* @__PURE__ */ jsx(Text, { color: run.color, children: glyphText(run.inverse ? asciiLower(run.text) : run.text, glyphs) }, i) : /* @__PURE__ */ jsx(Text, { color: run.color, inverse: run.inverse, children: run.text }, i)
|
|
27
|
+
) }, r)) });
|
|
28
|
+
}
|
|
29
|
+
function asciiLower(text) {
|
|
30
|
+
return text.replace(/[▁▂▃▄]/g, "=").replace(/[▅▆▇]/g, "-");
|
|
31
|
+
}
|
|
32
|
+
function ModelName({ model }) {
|
|
33
|
+
const tone = useTone();
|
|
34
|
+
const slash = model.indexOf("/");
|
|
35
|
+
if (slash < 0) return /* @__PURE__ */ jsx(Text, { color: tone("fg"), children: model });
|
|
36
|
+
const provider = model.slice(0, slash);
|
|
37
|
+
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
38
|
+
/* @__PURE__ */ jsxs(Text, { color: tone(provider === "dexto" ? "cloud" : "dim"), children: [
|
|
39
|
+
provider,
|
|
40
|
+
"/"
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ jsx(Text, { color: tone("fg"), children: model.slice(slash + 1) })
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
function Where({ where }) {
|
|
46
|
+
const tone = useTone();
|
|
47
|
+
const { glyphs } = useCaps();
|
|
48
|
+
if (where.kind === "computer") {
|
|
49
|
+
return /* @__PURE__ */ jsx(Text, { color: tone("cloud"), children: glyphText(`\u25C6 ${where.name}`, glyphs) });
|
|
50
|
+
}
|
|
51
|
+
return /* @__PURE__ */ jsx(Text, { color: tone("teal"), children: glyphText("\u25C7 local", glyphs) });
|
|
52
|
+
}
|
|
53
|
+
function formatUsd(value) {
|
|
54
|
+
return `$${value.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
55
|
+
}
|
|
56
|
+
function Credits({ credits, showSpend }) {
|
|
57
|
+
const tone = useTone();
|
|
58
|
+
const { glyphs } = useCaps();
|
|
59
|
+
const dot = /* @__PURE__ */ jsx(Text, { color: tone("faint"), children: glyphText(" \xB7 ", glyphs) });
|
|
60
|
+
switch (credits.kind) {
|
|
61
|
+
case "signed-out":
|
|
62
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
63
|
+
dot,
|
|
64
|
+
/* @__PURE__ */ jsx(Text, { color: tone("dim"), children: "cloud off" })
|
|
65
|
+
] });
|
|
66
|
+
case "signed-in":
|
|
67
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
dot,
|
|
69
|
+
/* @__PURE__ */ jsx(Text, { color: tone("cloud"), children: glyphText("\u25C6", glyphs) })
|
|
70
|
+
] });
|
|
71
|
+
case "out":
|
|
72
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73
|
+
dot,
|
|
74
|
+
/* @__PURE__ */ jsx(Text, { color: tone("cloud"), children: glyphText("\u25C6 ", glyphs) }),
|
|
75
|
+
/* @__PURE__ */ jsx(Text, { color: tone("red"), children: "out of credits" })
|
|
76
|
+
] });
|
|
77
|
+
case "balance":
|
|
78
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
79
|
+
dot,
|
|
80
|
+
/* @__PURE__ */ jsx(Text, { color: tone("cloud"), children: glyphText("\u25C6 ", glyphs) }),
|
|
81
|
+
/* @__PURE__ */ jsx(Text, { color: tone("fg"), children: formatUsd(credits.balance) }),
|
|
82
|
+
showSpend && credits.spend !== null && credits.spend > 0 && /* @__PURE__ */ jsx(Text, { color: tone("cloud"), children: glyphText(` \u2212${formatUsd(credits.spend)}`, glyphs) })
|
|
83
|
+
] });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function cells(text) {
|
|
87
|
+
return stringWidth(text);
|
|
88
|
+
}
|
|
89
|
+
function whereText(where) {
|
|
90
|
+
return where.kind === "computer" ? `\u25C6 ${where.name}` : "\u25C7 local";
|
|
91
|
+
}
|
|
92
|
+
function spendText(credits) {
|
|
93
|
+
return credits.kind === "balance" && credits.spend !== null && credits.spend > 0 ? ` \u2212${formatUsd(credits.spend)}` : "";
|
|
94
|
+
}
|
|
95
|
+
function creditsText(credits) {
|
|
96
|
+
switch (credits.kind) {
|
|
97
|
+
case "signed-out":
|
|
98
|
+
return " \xB7 cloud off";
|
|
99
|
+
case "signed-in":
|
|
100
|
+
return " \xB7 \u25C6";
|
|
101
|
+
case "out":
|
|
102
|
+
return " \xB7 \u25C6 out of credits";
|
|
103
|
+
case "balance":
|
|
104
|
+
return ` \xB7 \u25C6 ${formatUsd(credits.balance)}`;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function laneParts(status, width) {
|
|
108
|
+
const base = cells(whereText(status.where)) + cells(creditsText(status.credits));
|
|
109
|
+
const spend = cells(spendText(status.credits));
|
|
110
|
+
const branch = status.branch === null ? 0 : cells(` \u2387 ${status.branch}`);
|
|
111
|
+
const dirty = status.dirtyFiles > 0 ? cells(` \xB1${status.dirtyFiles}`) : 0;
|
|
112
|
+
if (base + spend + branch + dirty <= width) {
|
|
113
|
+
return { branch: branch > 0, dirty: dirty > 0, spend: spend > 0 };
|
|
114
|
+
}
|
|
115
|
+
if (base + spend + branch <= width)
|
|
116
|
+
return { branch: branch > 0, dirty: false, spend: spend > 0 };
|
|
117
|
+
if (base + spend <= width) return { branch: false, dirty: false, spend: spend > 0 };
|
|
118
|
+
return { branch: false, dirty: false, spend: false };
|
|
119
|
+
}
|
|
120
|
+
function Lane({ status, width }) {
|
|
121
|
+
const tone = useTone();
|
|
122
|
+
const { glyphs } = useCaps();
|
|
123
|
+
const show = laneParts(status, width);
|
|
124
|
+
return /* @__PURE__ */ jsxs(Text, { wrap: "truncate-end", children: [
|
|
125
|
+
/* @__PURE__ */ jsx(Where, { where: status.where }),
|
|
126
|
+
show.branch && status.branch !== null && /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: glyphText(` \u2387 ${status.branch}`, glyphs) }),
|
|
127
|
+
show.dirty && /* @__PURE__ */ jsx(Text, { color: tone("amberDim"), children: glyphText(` \xB1${status.dirtyFiles}`, glyphs) }),
|
|
128
|
+
/* @__PURE__ */ jsx(Credits, { credits: status.credits, showSpend: show.spend })
|
|
129
|
+
] });
|
|
130
|
+
}
|
|
131
|
+
function ModelAndContext({
|
|
132
|
+
model,
|
|
133
|
+
context,
|
|
134
|
+
width
|
|
135
|
+
}) {
|
|
136
|
+
const tone = useTone();
|
|
137
|
+
const contextCells = context === null ? 0 : cells(context) + 2;
|
|
138
|
+
const modelWidth = Math.min(cells(model), width - contextCells);
|
|
139
|
+
return /* @__PURE__ */ jsxs(Box, { width, flexShrink: 0, children: [
|
|
140
|
+
modelWidth >= 4 && /* @__PURE__ */ jsx(Box, { width: modelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { wrap: "truncate-end", children: /* @__PURE__ */ jsx(ModelName, { model }) }) }),
|
|
141
|
+
context !== null && /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: modelWidth >= 4 ? ` ${context}` : context })
|
|
142
|
+
] });
|
|
143
|
+
}
|
|
144
|
+
function contextText(status, withMax) {
|
|
145
|
+
if (status.contextUsedTokens === null) return null;
|
|
146
|
+
const used = formatTokens(status.contextUsedTokens);
|
|
147
|
+
if (!withMax || status.contextMaxTokens === null) return used;
|
|
148
|
+
return `${used}/${formatTokens(status.contextMaxTokens)}`;
|
|
149
|
+
}
|
|
150
|
+
function StatusBlock({
|
|
151
|
+
label,
|
|
152
|
+
labelColor,
|
|
153
|
+
readout,
|
|
154
|
+
status,
|
|
155
|
+
width
|
|
156
|
+
}) {
|
|
157
|
+
const tone = useTone();
|
|
158
|
+
const { glyphs } = useCaps();
|
|
159
|
+
const context = contextText(status, true);
|
|
160
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
161
|
+
/* @__PURE__ */ jsxs(Text, { wrap: "truncate-end", children: [
|
|
162
|
+
/* @__PURE__ */ jsx(Text, { bold: true, color: labelColor, children: label }),
|
|
163
|
+
readout !== null && /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: glyphText(` \xB7 ${readout}`, glyphs) })
|
|
164
|
+
] }),
|
|
165
|
+
/* @__PURE__ */ jsx(ModelAndContext, { model: status.model, context, width }),
|
|
166
|
+
/* @__PURE__ */ jsx(Lane, { status, width })
|
|
167
|
+
] });
|
|
168
|
+
}
|
|
169
|
+
function statusRowFit(status, width, noticeWidth) {
|
|
170
|
+
const context = contextText(status, false);
|
|
171
|
+
const natural = cells(status.model) + (context === null ? 0 : cells(context) + 2);
|
|
172
|
+
const laneMin = cells(whereText(status.where)) + cells(creditsText(status.credits));
|
|
173
|
+
const noticeRoom = Math.min(noticeWidth, width - laneMin - 2);
|
|
174
|
+
const notice = noticeRoom >= 4 ? noticeRoom : 0;
|
|
175
|
+
const noticeCells = notice > 0 ? notice + 2 : 0;
|
|
176
|
+
const room = width - noticeCells - laneMin - 2;
|
|
177
|
+
const model = room >= 4 ? Math.min(natural, room) : 0;
|
|
178
|
+
return {
|
|
179
|
+
notice,
|
|
180
|
+
model,
|
|
181
|
+
lane: Math.max(0, width - noticeCells - (model > 0 ? model + 2 : 0))
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function StatusRow({
|
|
185
|
+
status,
|
|
186
|
+
width,
|
|
187
|
+
notice
|
|
188
|
+
}) {
|
|
189
|
+
const { glyphs } = useCaps();
|
|
190
|
+
const context = contextText(status, false);
|
|
191
|
+
const noticeText = notice === null ? "" : glyphText(notice.text, glyphs);
|
|
192
|
+
const fit = statusRowFit(status, width, cells(noticeText));
|
|
193
|
+
return /* @__PURE__ */ jsxs(Box, { width, children: [
|
|
194
|
+
notice !== null && fit.notice > 0 && /* @__PURE__ */ jsx(Box, { width: fit.notice, marginRight: 2, flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { color: notice.color, wrap: "truncate-end", children: noticeText }) }),
|
|
195
|
+
fit.model > 0 && /* @__PURE__ */ jsx(Box, { marginRight: 2, flexShrink: 0, children: /* @__PURE__ */ jsx(ModelAndContext, { model: status.model, context, width: fit.model }) }),
|
|
196
|
+
/* @__PURE__ */ jsx(Box, { width: fit.lane, flexShrink: 0, children: /* @__PURE__ */ jsx(Lane, { status, width: fit.lane }) })
|
|
197
|
+
] });
|
|
198
|
+
}
|
|
199
|
+
export {
|
|
200
|
+
StatusBlock,
|
|
201
|
+
StatusRow,
|
|
202
|
+
TraceView,
|
|
203
|
+
laneParts,
|
|
204
|
+
statusRowFit
|
|
205
|
+
};
|