@deepseek-harness-tui/dsh-tui 0.6.0 → 0.7.0
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/README.md +74 -21
- package/bin/dsh-tui.js +115 -25
- package/cordis.patch.yml +69 -17
- package/cordis.yml +50 -12
- package/lib/types/activityPrefs.d.ts +1 -1
- package/lib/types/activityPrefs.js +3 -3
- package/lib/types/cc/figures.d.ts +27 -20
- package/lib/types/cc/figures.d.ts.map +1 -1
- package/lib/types/cc/figures.js +43 -34
- package/lib/types/cc/format.d.ts +18 -9
- package/lib/types/cc/format.d.ts.map +1 -1
- package/lib/types/cc/format.js +26 -18
- package/lib/types/cc/markdown.d.ts +31 -16
- package/lib/types/cc/markdown.d.ts.map +1 -1
- package/lib/types/cc/markdown.js +283 -260
- package/lib/types/cc/terminal.d.ts +10 -7
- package/lib/types/cc/terminal.d.ts.map +1 -1
- package/lib/types/cc/terminal.js +62 -50
- package/lib/types/command-trees.d.ts +3 -0
- package/lib/types/command-trees.d.ts.map +1 -0
- package/lib/types/command-trees.js +4 -0
- package/lib/types/commands.d.ts +37 -1
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +68 -3
- package/lib/types/components/ActivityLine.d.ts +1 -1
- package/lib/types/components/ActivityLine.d.ts.map +1 -1
- package/lib/types/components/ActivityPicker.d.ts.map +1 -1
- package/lib/types/components/ActivityPicker.js +3 -4
- package/lib/types/components/BtwPanel.d.ts +16 -0
- package/lib/types/components/BtwPanel.d.ts.map +1 -0
- package/lib/types/components/BtwPanel.js +47 -0
- package/lib/types/components/CommandSuggestions.d.ts +4 -2
- package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
- package/lib/types/components/CommandSuggestions.js +2 -2
- package/lib/types/components/EffortSlider.d.ts +15 -0
- package/lib/types/components/EffortSlider.d.ts.map +1 -0
- package/lib/types/components/EffortSlider.js +17 -0
- package/lib/types/components/GoalTodoPanel.d.ts +1 -1
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/HelpMenu.d.ts +5 -2
- package/lib/types/components/HelpMenu.d.ts.map +1 -1
- package/lib/types/components/HelpMenu.js +8 -3
- package/lib/types/components/HistorySearchDialog.d.ts +1 -1
- package/lib/types/components/HistorySearchDialog.d.ts.map +1 -1
- package/lib/types/components/HistorySearchDialog.js +21 -10
- package/lib/types/components/InterruptedByUser.d.ts +2 -2
- package/lib/types/components/InterruptedByUser.d.ts.map +1 -1
- package/lib/types/components/InterruptedByUser.js +4 -3
- package/lib/types/components/LoadedContextPanel.d.ts +1 -1
- package/lib/types/components/LoadedContextPanel.d.ts.map +1 -1
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +2 -1
- package/lib/types/components/Markdown.d.ts +11 -11
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +63 -57
- package/lib/types/components/MarkdownTable.d.ts +1 -1
- package/lib/types/components/MarkdownTable.js +2 -2
- package/lib/types/components/MessageList.d.ts +10 -2
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +17 -10
- package/lib/types/components/ModelPicker.d.ts +4 -1
- package/lib/types/components/ModelPicker.d.ts.map +1 -1
- package/lib/types/components/ModelPicker.js +16 -4
- package/lib/types/components/OverlayAbove.d.ts +20 -0
- package/lib/types/components/OverlayAbove.d.ts.map +1 -0
- package/lib/types/components/OverlayAbove.js +18 -0
- package/lib/types/components/PresetPicker.d.ts +1 -1
- package/lib/types/components/PresetPicker.d.ts.map +1 -1
- package/lib/types/components/PresetPicker.js +2 -3
- package/lib/types/components/PromptInput.d.ts +5 -4
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +186 -39
- package/lib/types/components/ResumePicker.d.ts +15 -4
- package/lib/types/components/ResumePicker.d.ts.map +1 -1
- package/lib/types/components/ResumePicker.js +25 -9
- package/lib/types/components/RewindPicker.d.ts +1 -1
- package/lib/types/components/RewindPicker.d.ts.map +1 -1
- package/lib/types/components/RewindPicker.js +14 -5
- package/lib/types/components/SearchBox.d.ts +1 -1
- package/lib/types/components/SearchBox.js +1 -1
- package/lib/types/components/Spinner/GlimmerMessage.d.ts +1 -2
- package/lib/types/components/Spinner/GlimmerMessage.d.ts.map +1 -1
- package/lib/types/components/Spinner/GlimmerMessage.js +1 -2
- package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +1 -1
- package/lib/types/components/Spinner/SpinnerAnimationRow.js +2 -2
- package/lib/types/components/Spinner/SpinnerGlyph.d.ts +1 -1
- package/lib/types/components/Spinner/SpinnerGlyph.js +1 -1
- package/lib/types/components/Spinner/spinnerUtils.d.ts +13 -18
- package/lib/types/components/Spinner/spinnerUtils.d.ts.map +1 -1
- package/lib/types/components/Spinner/spinnerUtils.js +67 -71
- package/lib/types/components/Spinner/useStalledAnimation.d.ts +1 -2
- package/lib/types/components/Spinner/useStalledAnimation.d.ts.map +1 -1
- package/lib/types/components/Spinner/useStalledAnimation.js +1 -2
- package/lib/types/components/StreamingMarkdown.d.ts +1 -1
- package/lib/types/components/StreamingMarkdown.js +1 -1
- package/lib/types/components/ThemePicker.d.ts +13 -9
- package/lib/types/components/ThemePicker.d.ts.map +1 -1
- package/lib/types/components/ThemePicker.js +21 -15
- package/lib/types/components/ThinkingToggle.d.ts +1 -1
- package/lib/types/components/ThinkingToggle.d.ts.map +1 -1
- package/lib/types/components/ThinkingToggle.js +8 -8
- package/lib/types/components/ToolUseLoader.d.ts +1 -1
- package/lib/types/components/ToolUseLoader.js +1 -1
- package/lib/types/components/WorkingSpinner.d.ts +2 -2
- package/lib/types/components/WorkingSpinner.js +2 -2
- package/lib/types/components/WorkspaceFlowPicker.d.ts +15 -0
- package/lib/types/components/WorkspaceFlowPicker.d.ts.map +1 -0
- package/lib/types/components/WorkspaceFlowPicker.js +19 -0
- package/lib/types/components/WorkspacePicker.d.ts +9 -0
- package/lib/types/components/WorkspacePicker.d.ts.map +1 -0
- package/lib/types/components/WorkspacePicker.js +13 -0
- package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
- package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
- package/lib/types/components/approvals/ApprovalPanel.js +2 -1
- package/lib/types/components/design-system/Byline.d.ts +1 -1
- package/lib/types/components/design-system/Byline.js +1 -1
- package/lib/types/components/design-system/Divider.d.ts +1 -1
- package/lib/types/components/design-system/Divider.js +1 -1
- package/lib/types/components/design-system/HintLine.d.ts +12 -0
- package/lib/types/components/design-system/HintLine.d.ts.map +1 -0
- package/lib/types/components/design-system/HintLine.js +15 -0
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts +1 -1
- package/lib/types/components/design-system/KeyboardShortcutHint.js +1 -1
- package/lib/types/components/design-system/ListItem.d.ts +2 -2
- package/lib/types/components/design-system/ListItem.d.ts.map +1 -1
- package/lib/types/components/design-system/ListItem.js +35 -3
- package/lib/types/components/design-system/LoadingState.d.ts +1 -2
- package/lib/types/components/design-system/LoadingState.d.ts.map +1 -1
- package/lib/types/components/design-system/LoadingState.js +1 -2
- package/lib/types/components/design-system/Pane.d.ts +2 -2
- package/lib/types/components/design-system/Pane.js +2 -2
- package/lib/types/components/design-system/ProgressBar.d.ts +1 -2
- package/lib/types/components/design-system/ProgressBar.d.ts.map +1 -1
- package/lib/types/components/design-system/ProgressBar.js +1 -2
- package/lib/types/components/design-system/StatusIcon.d.ts +2 -2
- package/lib/types/components/design-system/StatusIcon.js +2 -2
- package/lib/types/components/design-system/ThemeProvider.d.ts +1 -1
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +87 -26
- package/lib/types/components/design-system/ThemedBox.d.ts +1 -1
- package/lib/types/components/design-system/ThemedBox.js +1 -1
- package/lib/types/components/design-system/ThemedText.d.ts +2 -2
- package/lib/types/components/design-system/ThemedText.js +2 -2
- package/lib/types/components/listWindow.d.ts +26 -0
- package/lib/types/components/listWindow.d.ts.map +1 -0
- package/lib/types/components/listWindow.js +47 -0
- package/lib/types/components/messages/AssistantTextMessage.d.ts +1 -2
- package/lib/types/components/messages/AssistantTextMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantTextMessage.js +1 -2
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +2 -2
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +6 -6
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +12 -4
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +9 -5
- package/lib/types/components/messages/MessageMetadata.d.ts +1 -1
- package/lib/types/components/messages/MessageMetadata.js +1 -1
- package/lib/types/components/messages/UserPromptMessage.d.ts +1 -1
- package/lib/types/components/messages/UserPromptMessage.js +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +5 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +11 -9
- package/lib/types/components/questions/PlanReviewPanel.d.ts +1 -1
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +3 -2
- package/lib/types/components/trajectory/HotspotView.d.ts +14 -0
- package/lib/types/components/trajectory/HotspotView.d.ts.map +1 -0
- package/lib/types/components/trajectory/HotspotView.js +83 -0
- package/lib/types/components/trajectory/Inspector.d.ts +31 -0
- package/lib/types/components/trajectory/Inspector.d.ts.map +1 -0
- package/lib/types/components/trajectory/Inspector.js +67 -0
- package/lib/types/components/trajectory/Ledger.d.ts +20 -0
- package/lib/types/components/trajectory/Ledger.d.ts.map +1 -0
- package/lib/types/components/trajectory/Ledger.js +112 -0
- package/lib/types/components/trajectory/MiniWake.d.ts +24 -0
- package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -0
- package/lib/types/components/trajectory/MiniWake.js +99 -0
- package/lib/types/components/trajectory/WaveBand.d.ts +33 -0
- package/lib/types/components/trajectory/WaveBand.d.ts.map +1 -0
- package/lib/types/components/trajectory/WaveBand.js +145 -0
- package/lib/types/customTheme.d.ts +6 -6
- package/lib/types/customTheme.d.ts.map +1 -1
- package/lib/types/customTheme.js +15 -12
- package/lib/types/dsh-adapter/approvals.d.ts.map +1 -0
- package/lib/types/{channel.d.ts → dsh-adapter/channel.d.ts} +184 -43
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -0
- package/lib/types/{channel.js → dsh-adapter/channel.js} +972 -201
- package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -0
- package/lib/types/{childStderr.js → dsh-adapter/childStderr.js} +1 -1
- package/lib/types/dsh-adapter/command-trees.d.ts +27 -0
- package/lib/types/dsh-adapter/command-trees.d.ts.map +1 -0
- package/lib/types/dsh-adapter/command-trees.js +42 -0
- package/lib/types/dsh-adapter/compat/index.d.ts +22 -0
- package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -0
- package/lib/types/{compat → dsh-adapter/compat}/index.js +7 -4
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +86 -0
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/sessionLog.js +347 -0
- package/lib/types/dsh-adapter/contract.d.ts +20 -0
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -0
- package/lib/types/dsh-adapter/contract.js +109 -0
- package/lib/types/dsh-adapter/index.d.ts +80 -0
- package/lib/types/dsh-adapter/index.d.ts.map +1 -0
- package/lib/types/dsh-adapter/index.js +45 -0
- package/lib/types/dsh-adapter/invariant.d.ts.map +1 -0
- package/lib/types/dsh-adapter/packaged-skills.d.ts.map +1 -0
- package/lib/types/{plugin.d.ts → dsh-adapter/plugin.d.ts} +17 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -0
- package/lib/types/{plugin.js → dsh-adapter/plugin.js} +280 -80
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts +91 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -0
- package/lib/types/dsh-adapter/providerWizard.js +332 -0
- package/lib/types/{questions.d.ts → dsh-adapter/questions.d.ts} +7 -2
- package/lib/types/dsh-adapter/questions.d.ts.map +1 -0
- package/lib/types/{questions.js → dsh-adapter/questions.js} +15 -7
- package/lib/types/dsh-adapter/sideQuestion.d.ts +38 -0
- package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sideQuestion.js +69 -0
- package/lib/types/dsh-adapter/trajectory/aggregate.d.ts +46 -0
- package/lib/types/dsh-adapter/trajectory/aggregate.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/aggregate.js +207 -0
- package/lib/types/dsh-adapter/trajectory/guards.d.ts +177 -0
- package/lib/types/dsh-adapter/trajectory/guards.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/guards.js +235 -0
- package/lib/types/dsh-adapter/trajectory/index.d.ts +16 -0
- package/lib/types/dsh-adapter/trajectory/index.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/index.js +15 -0
- package/lib/types/dsh-adapter/trajectory/inspect.d.ts +40 -0
- package/lib/types/dsh-adapter/trajectory/inspect.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/inspect.js +160 -0
- package/lib/types/dsh-adapter/trajectory/projection.d.ts +128 -0
- package/lib/types/dsh-adapter/trajectory/projection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/projection.js +653 -0
- package/lib/types/dsh-adapter/trajectory/types.d.ts +232 -0
- package/lib/types/dsh-adapter/trajectory/types.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/types.js +70 -0
- package/lib/types/dsh-adapter/trajectory/wave.d.ts +45 -0
- package/lib/types/dsh-adapter/trajectory/wave.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/wave.js +210 -0
- package/lib/types/dsh-adapter/types.d.ts +23 -0
- package/lib/types/dsh-adapter/types.d.ts.map +1 -0
- package/lib/types/dsh-adapter/types.js +1 -0
- package/lib/types/dsh-adapter/workspace.d.ts +22 -0
- package/lib/types/dsh-adapter/workspace.d.ts.map +1 -0
- package/lib/types/dsh-adapter/workspace.js +16 -0
- package/lib/types/dsh-adapter/workspaces.d.ts +118 -0
- package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -0
- package/lib/types/dsh-adapter/workspaces.js +290 -0
- package/lib/types/effortPrefs.d.ts +1 -1
- package/lib/types/effortPrefs.js +3 -3
- package/lib/types/history.js +2 -2
- package/lib/types/hooks/useBlink.d.ts +1 -1
- package/lib/types/hooks/useBlink.js +1 -1
- package/lib/types/i18n.d.ts +977 -36
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +307 -30
- package/lib/types/index.d.ts +1 -69
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +3 -31
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +33 -19
- package/lib/types/ink/dom.d.ts +15 -0
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/dom.js +32 -0
- package/lib/types/ink/hooks/use-input.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-input.js +8 -0
- package/lib/types/ink/hooks/use-terminal-size.d.ts +1 -1
- package/lib/types/ink/hooks/use-terminal-size.js +1 -1
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +109 -28
- package/lib/types/ink/input-suppression.d.ts +20 -0
- package/lib/types/ink/input-suppression.d.ts.map +1 -0
- package/lib/types/ink/input-suppression.js +26 -0
- package/lib/types/ink/log-update.js +21 -6
- package/lib/types/ink/parse-keypress.d.ts +31 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +442 -8
- package/lib/types/ink/terminal-querier.d.ts +5 -1
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +27 -3
- package/lib/types/ink/terminal.d.ts +18 -0
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +32 -4
- package/lib/types/ink/termio/csi.d.ts +10 -0
- package/lib/types/ink/termio/csi.d.ts.map +1 -1
- package/lib/types/ink/termio/csi.js +20 -0
- package/lib/types/ink/termio/tokenize.js +10 -0
- package/lib/types/modelPrefs.d.ts +1 -1
- package/lib/types/modelPrefs.js +3 -3
- package/lib/types/presetPrefs.d.ts +1 -1
- package/lib/types/presetPrefs.js +3 -3
- package/lib/types/screens/Chat.d.ts +20 -4
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +655 -55
- package/lib/types/screens/StatusLine.d.ts +17 -2
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +12 -4
- package/lib/types/screens/TrajectoryScene.d.ts +16 -0
- package/lib/types/screens/TrajectoryScene.d.ts.map +1 -0
- package/lib/types/screens/TrajectoryScene.js +305 -0
- package/lib/types/sessionHistory.d.ts +9 -1
- package/lib/types/sessionHistory.d.ts.map +1 -1
- package/lib/types/sessionHistory.js +56 -16
- package/lib/types/sessionModes.d.ts +29 -0
- package/lib/types/sessionModes.d.ts.map +1 -0
- package/lib/types/sessionModes.js +45 -0
- package/lib/types/theme.d.ts +27 -3
- package/lib/types/theme.d.ts.map +1 -1
- package/lib/types/theme.js +48 -4
- package/lib/types/themePrefs.d.ts +3 -3
- package/lib/types/themePrefs.js +5 -5
- package/lib/types/trajectory/format.d.ts +100 -0
- package/lib/types/trajectory/format.d.ts.map +1 -0
- package/lib/types/trajectory/format.js +213 -0
- package/lib/types/trajectory/motion.d.ts +99 -0
- package/lib/types/trajectory/motion.d.ts.map +1 -0
- package/lib/types/trajectory/motion.js +143 -0
- package/lib/types/trajectory/query.d.ts +83 -0
- package/lib/types/trajectory/query.d.ts.map +1 -0
- package/lib/types/trajectory/query.js +187 -0
- package/lib/types/trajectoryPrefs.d.ts +36 -0
- package/lib/types/trajectoryPrefs.d.ts.map +1 -0
- package/lib/types/trajectoryPrefs.js +65 -0
- package/lib/types/update.d.ts +3 -3
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +18 -7
- package/lib/types/utils/clipboard.d.ts +101 -29
- package/lib/types/utils/clipboard.d.ts.map +1 -1
- package/lib/types/utils/clipboard.js +533 -55
- package/lib/types/utils/debug.d.ts +1 -1
- package/lib/types/utils/debug.js +2 -2
- package/lib/types/utils/execFileNoThrow.d.ts.map +1 -1
- package/lib/types/utils/execFileNoThrow.js +16 -6
- package/lib/types/utils/externalEditor.d.ts +115 -0
- package/lib/types/utils/externalEditor.d.ts.map +1 -0
- package/lib/types/utils/externalEditor.js +270 -0
- package/lib/types/utils/fullscreen.d.ts +2 -2
- package/lib/types/utils/fullscreen.js +3 -3
- package/lib/types/utils/loaded-context.d.ts +1 -1
- package/lib/types/utils/loaded-context.d.ts.map +1 -1
- package/lib/types/utils/modifiers.d.ts +24 -0
- package/lib/types/utils/modifiers.d.ts.map +1 -1
- package/lib/types/utils/modifiers.js +27 -0
- package/lib/types/utils/paths.d.ts +45 -0
- package/lib/types/utils/paths.d.ts.map +1 -0
- package/lib/types/utils/paths.js +69 -0
- package/lib/types/utils/shellQuote.d.ts +14 -0
- package/lib/types/utils/shellQuote.d.ts.map +1 -0
- package/lib/types/utils/shellQuote.js +39 -0
- package/lib/types/utils/workspaceRoot.d.ts +21 -0
- package/lib/types/utils/workspaceRoot.d.ts.map +1 -0
- package/lib/types/utils/workspaceRoot.js +47 -0
- package/lib/types/workspaces.d.ts +3 -0
- package/lib/types/workspaces.d.ts.map +1 -0
- package/lib/types/workspaces.js +4 -0
- package/package.json +26 -8
- package/lib/types/approvals.d.ts.map +0 -1
- package/lib/types/channel.d.ts.map +0 -1
- package/lib/types/childStderr.d.ts.map +0 -1
- package/lib/types/compat/index.d.ts +0 -20
- package/lib/types/compat/index.d.ts.map +0 -1
- package/lib/types/compat/sessionLog.d.ts +0 -40
- package/lib/types/compat/sessionLog.d.ts.map +0 -1
- package/lib/types/compat/sessionLog.js +0 -226
- package/lib/types/invariant.d.ts.map +0 -1
- package/lib/types/packaged-skills.d.ts.map +0 -1
- package/lib/types/plugin.d.ts.map +0 -1
- package/lib/types/presets.d.ts.map +0 -1
- package/lib/types/questions.d.ts.map +0 -1
- /package/lib/types/{approvals.d.ts → dsh-adapter/approvals.d.ts} +0 -0
- /package/lib/types/{approvals.js → dsh-adapter/approvals.js} +0 -0
- /package/lib/types/{childStderr.d.ts → dsh-adapter/childStderr.d.ts} +0 -0
- /package/lib/types/{invariant.d.ts → dsh-adapter/invariant.d.ts} +0 -0
- /package/lib/types/{invariant.js → dsh-adapter/invariant.js} +0 -0
- /package/lib/types/{packaged-skills.d.ts → dsh-adapter/packaged-skills.d.ts} +0 -0
- /package/lib/types/{packaged-skills.js → dsh-adapter/packaged-skills.js} +0 -0
- /package/lib/types/{presets.d.ts → dsh-adapter/presets.d.ts} +0 -0
- /package/lib/types/{presets.js → dsh-adapter/presets.js} +0 -0
|
@@ -7,7 +7,7 @@ import { SPINNER_VERBS } from '../cc/spinnerVerbs.js';
|
|
|
7
7
|
import { sample } from 'lodash-es';
|
|
8
8
|
/**
|
|
9
9
|
* The working spinner block shown between the transcript and the prompt
|
|
10
|
-
* input while a turn is in flight.
|
|
10
|
+
* input while a turn is in flight. Mirrors Claude Code's `Spinner.tsx`
|
|
11
11
|
* (SpinnerWithVerb path) with the swarm/teammate/effort/tips branches
|
|
12
12
|
* removed; the channel feeds the mode, token count and thinking status.
|
|
13
13
|
*
|
|
@@ -23,7 +23,7 @@ export function WorkingSpinner({ mode, hasActiveTools, responseLengthRef, loadin
|
|
|
23
23
|
/**
|
|
24
24
|
* Tracks thinking status: 'thinking' while the model is streaming reasoning,
|
|
25
25
|
* then the duration in ms for a minimum 2s display (avoids UI jank). Ported
|
|
26
|
-
* from
|
|
26
|
+
* from Claude Code's SpinnerWithVerb effect.
|
|
27
27
|
*/
|
|
28
28
|
export function useThinkingStatus(isThinking) {
|
|
29
29
|
const [thinkingStatus, setThinkingStatus] = useState(null);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TuiWorkspaceChoice } from '../workspaces.js';
|
|
3
|
+
/** Generic nested choice surface returned by a workspace provider command. */
|
|
4
|
+
export declare function WorkspaceFlowPicker({ title, choices, focusIndex, busy, input, }: {
|
|
5
|
+
title: string;
|
|
6
|
+
choices: readonly TuiWorkspaceChoice[];
|
|
7
|
+
focusIndex: number;
|
|
8
|
+
busy?: boolean;
|
|
9
|
+
input?: {
|
|
10
|
+
value: string;
|
|
11
|
+
cursor: number;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
} | null;
|
|
14
|
+
}): React.ReactNode;
|
|
15
|
+
//# sourceMappingURL=WorkspaceFlowPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceFlowPicker.d.ts","sourceRoot":"","sources":["../../../src/components/WorkspaceFlowPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAO1D,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,OAAO,EACP,UAAU,EACV,IAAY,EACZ,KAAY,GACb,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CACvE,GAAG,KAAK,CAAC,SAAS,CAoDlB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from '../ui.js';
|
|
3
|
+
import { t } from '../i18n.js';
|
|
4
|
+
import { Pane } from './design-system/Pane.js';
|
|
5
|
+
import { ListItem } from './design-system/ListItem.js';
|
|
6
|
+
import { HintLine } from './design-system/HintLine.js';
|
|
7
|
+
const WINDOW = 8;
|
|
8
|
+
/** Generic nested choice surface returned by a workspace provider command. */
|
|
9
|
+
export function WorkspaceFlowPicker({ title, choices, focusIndex, busy = false, input = null, }) {
|
|
10
|
+
const start = Math.max(0, Math.min(focusIndex - Math.floor(WINDOW / 2), choices.length - WINDOW));
|
|
11
|
+
const visible = choices.slice(start, start + WINDOW);
|
|
12
|
+
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: title }) }), visible.map((choice, index) => (_jsxs(ListItem, { isFocused: start + index === focusIndex, isSelected: false, description: choice.description, showScrollUp: index === 0 && start > 0, showScrollDown: index === visible.length - 1 && start + visible.length < choices.length, children: [choice.badge ? `${choice.badge} · ` : '', choice.label] }, choice.id))), input !== null && (_jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: "remember", children: "\u276F " }), input.value.length === 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { inverse: true, children: " " }), _jsx(Text, { dimColor: true, children: input.placeholder ?? '' })] })) : (_jsxs(_Fragment, { children: [_jsx(Text, { children: input.value.slice(0, input.cursor) }), _jsx(Text, { inverse: true, children: input.value[input.cursor] ?? ' ' }), _jsx(Text, { children: input.value.slice(input.cursor + 1) })] }))] }))] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: busy
|
|
13
|
+
? t('workspace-flow-loading')
|
|
14
|
+
: input !== null
|
|
15
|
+
? t('workspace-flow-input-hint')
|
|
16
|
+
: choices[focusIndex]?.input !== undefined
|
|
17
|
+
? t('workspace-flow-edit-hint')
|
|
18
|
+
: t('workspace-flow-hint') }) })] }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TuiWorkspaceTarget } from '../workspaces.js';
|
|
3
|
+
/** `/workspace` target picker contributed by local and optional providers. */
|
|
4
|
+
export declare function WorkspacePicker({ targets, focusIndex, currentCwd, }: {
|
|
5
|
+
targets: readonly TuiWorkspaceTarget[];
|
|
6
|
+
focusIndex: number;
|
|
7
|
+
currentCwd: string;
|
|
8
|
+
}): React.ReactNode;
|
|
9
|
+
//# sourceMappingURL=WorkspacePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspacePicker.d.ts","sourceRoot":"","sources":["../../../src/components/WorkspacePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAO1D,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,UAAU,EACV,UAAU,GACX,EAAE;IACD,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB,GAAG,KAAK,CAAC,SAAS,CAyBlB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from '../ui.js';
|
|
3
|
+
import { t } from '../i18n.js';
|
|
4
|
+
import { Pane } from './design-system/Pane.js';
|
|
5
|
+
import { ListItem } from './design-system/ListItem.js';
|
|
6
|
+
import { HintLine } from './design-system/HintLine.js';
|
|
7
|
+
const WINDOW = 8;
|
|
8
|
+
/** `/workspace` target picker contributed by local and optional providers. */
|
|
9
|
+
export function WorkspacePicker({ targets, focusIndex, currentCwd, }) {
|
|
10
|
+
const start = Math.max(0, Math.min(focusIndex - Math.floor(WINDOW / 2), targets.length - WINDOW));
|
|
11
|
+
const visible = targets.slice(start, start + WINDOW);
|
|
12
|
+
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: t('workspace-picker-title') }) }), visible.map((target, index) => (_jsxs(ListItem, { isFocused: start + index === focusIndex, isSelected: target.cwd === currentCwd, description: target.description ?? target.uri, showScrollUp: index === 0 && start > 0, showScrollDown: index === visible.length - 1 && start + visible.length < targets.length, children: [target.badge, " \u00B7 ", target.label] }, target.uri)))] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('workspace-picker-hint') }) })] }));
|
|
13
|
+
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* (fail closed, CC's "Esc to cancel" semantics).
|
|
12
12
|
*/
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import type { ApprovalSnapshot } from '../../approvals.js';
|
|
14
|
+
import type { ApprovalSnapshot } from '../../dsh-adapter/approvals.js';
|
|
15
15
|
export type ApprovalPanelProps = {
|
|
16
16
|
/** The approval to render (from the ApprovalStore snapshot). */
|
|
17
17
|
readonly approval: ApprovalSnapshot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovalPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/approvals/ApprovalPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ApprovalPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/approvals/ApprovalPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEtE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAA;IACnC,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,UAAU,KAAK,IAAI,CAAA;CAClE,CAAA;AAID,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,kBAAkB,GAAG,KAAK,CAAC,SAAS,CAmEzF"}
|
|
@@ -14,6 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { t } from '../../i18n.js';
|
|
16
16
|
import { Box, Text, useInput } from '../../ui.js';
|
|
17
|
+
import { isPlainReturnInput } from '../../utils/modifiers.js';
|
|
17
18
|
import { Divider } from '../design-system/Divider.js';
|
|
18
19
|
import { POINTER } from '../../cc/figures.js';
|
|
19
20
|
const OUTCOMES = ['allowed-once', 'rejected'];
|
|
@@ -36,7 +37,7 @@ export function ApprovalPanel({ approval, onDecide }) {
|
|
|
36
37
|
onDecide(OUTCOMES[Number(input) - 1]);
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
|
-
if (key
|
|
40
|
+
if (isPlainReturnInput(input, key)) {
|
|
40
41
|
onDecide(OUTCOMES[focusIndex]);
|
|
41
42
|
}
|
|
42
43
|
}, { isActive: true });
|
|
@@ -5,7 +5,7 @@ type Props = {
|
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* Joins children with a middot separator (" · ") for inline metadata display
|
|
8
|
-
* (
|
|
8
|
+
* (in the Claude Code visual language). Automatically filters out
|
|
9
9
|
* null/undefined/false children and only renders separators between valid
|
|
10
10
|
* elements.
|
|
11
11
|
*/
|
|
@@ -3,7 +3,7 @@ import React, { Children, isValidElement } from 'react';
|
|
|
3
3
|
import Text from '../../ink/components/Text.js';
|
|
4
4
|
/**
|
|
5
5
|
* Joins children with a middot separator (" · ") for inline metadata display
|
|
6
|
-
* (
|
|
6
|
+
* (in the Claude Code visual language). Automatically filters out
|
|
7
7
|
* null/undefined/false children and only renders separators between valid
|
|
8
8
|
* elements.
|
|
9
9
|
*/
|
|
@@ -4,7 +4,7 @@ import { stringWidth } from '../../ink/stringWidth.js';
|
|
|
4
4
|
import { useTerminalSize } from '../../ink/hooks/use-terminal-size.js';
|
|
5
5
|
/**
|
|
6
6
|
* A horizontal divider line, optionally with a title in the middle
|
|
7
|
-
* (
|
|
7
|
+
* (in the Claude Code visual language).
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* // ─────────── Title ───────────
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Localized shortcut-hint line: renders a `t('hint-*')` string, with the
|
|
4
|
+
* `**primary shortcut**` segment (the main action's key, wrapped in `**` in
|
|
5
|
+
* the dict) in bold — the visual hierarchy KeyboardShortcutHint's `bold`
|
|
6
|
+
* prop used to give. Wrap in `<Text dimColor italic>` for the common dim
|
|
7
|
+
* styling, like the Byline it replaces.
|
|
8
|
+
*/
|
|
9
|
+
export declare function HintLine({ text }: {
|
|
10
|
+
text: string;
|
|
11
|
+
}): React.ReactNode;
|
|
12
|
+
//# sourceMappingURL=HintLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HintLine.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/HintLine.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CAUpE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Text from '../../ink/components/Text.js';
|
|
3
|
+
/**
|
|
4
|
+
* Localized shortcut-hint line: renders a `t('hint-*')` string, with the
|
|
5
|
+
* `**primary shortcut**` segment (the main action's key, wrapped in `**` in
|
|
6
|
+
* the dict) in bold — the visual hierarchy KeyboardShortcutHint's `bold`
|
|
7
|
+
* prop used to give. Wrap in `<Text dimColor italic>` for the common dim
|
|
8
|
+
* styling, like the Byline it replaces.
|
|
9
|
+
*/
|
|
10
|
+
export function HintLine({ text }) {
|
|
11
|
+
const parts = text.split('**');
|
|
12
|
+
if (parts.length < 3)
|
|
13
|
+
return _jsx(_Fragment, { children: text });
|
|
14
|
+
return (_jsx(_Fragment, { children: parts.map((part, index) => index % 2 === 1 ? _jsx(Text, { bold: true, children: part }, index) : part) }));
|
|
15
|
+
}
|
|
@@ -11,7 +11,7 @@ type Props = {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Renders a keyboard shortcut hint like "ctrl+o to expand" or "(tab to toggle)"
|
|
14
|
-
* (
|
|
14
|
+
* (in the Claude Code visual language). Wrap in `<Text dimColor>` for the
|
|
15
15
|
* common dim styling.
|
|
16
16
|
*/
|
|
17
17
|
export declare function KeyboardShortcutHint({ shortcut, action, parens, bold, }: Props): React.ReactNode;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import Text from '../../ink/components/Text.js';
|
|
3
3
|
/**
|
|
4
4
|
* Renders a keyboard shortcut hint like "ctrl+o to expand" or "(tab to toggle)"
|
|
5
|
-
* (
|
|
5
|
+
* (in the Claude Code visual language). Wrap in `<Text dimColor>` for the
|
|
6
6
|
* common dim styling.
|
|
7
7
|
*/
|
|
8
8
|
export function KeyboardShortcutHint({ shortcut, action, parens = false, bold = false, }) {
|
|
@@ -26,8 +26,8 @@ export type ListItemProps = {
|
|
|
26
26
|
declareCursor?: boolean;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
* A list item for selection UIs
|
|
30
|
-
* design-system/ListItem.tsx
|
|
29
|
+
* A list item for selection UIs, mirroring Claude Code's
|
|
30
|
+
* design-system/ListItem.tsx: `❯` pointer for the focused row, `✓`
|
|
31
31
|
* checkmark for the selected row, description on an indented second line,
|
|
32
32
|
* and CC's color states (focused = suggestion blue, selected = success
|
|
33
33
|
* green).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAK7C,MAAM,MAAM,aAAa,GAAG;IAC1B;qDACiD;IACjD,SAAS,EAAE,OAAO,CAAA;IAClB;uDACmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,4CAA4C;IAC5C,QAAQ,EAAE,SAAS,CAAA;IACnB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,oEAAoE;IACpE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,UAAkB,EAClB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,YAAY,EACZ,MAAa,EACb,QAAgB,EAChB,aAAa,GACd,EAAE,aAAa,GAAG,KAAK,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAK7C,MAAM,MAAM,aAAa,GAAG;IAC1B;qDACiD;IACjD,SAAS,EAAE,OAAO,CAAA;IAClB;uDACmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,4CAA4C;IAC5C,QAAQ,EAAE,SAAS,CAAA;IACnB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,oEAAoE;IACpE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,UAAkB,EAClB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,YAAY,EACZ,MAAa,EACb,QAAgB,EAChB,aAAa,GACd,EAAE,aAAa,GAAG,KAAK,CAAC,SAAS,CAkEjC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { Box, Text } from '../../ui.js';
|
|
3
4
|
import { useDeclaredCursor } from '../../ink/hooks/use-declared-cursor.js';
|
|
4
5
|
import { POINTER, DOWN_ARROW, UP_ARROW, TICK } from '../../cc/figures.js';
|
|
5
6
|
/**
|
|
6
|
-
* A list item for selection UIs
|
|
7
|
-
* design-system/ListItem.tsx
|
|
7
|
+
* A list item for selection UIs, mirroring Claude Code's
|
|
8
|
+
* design-system/ListItem.tsx: `❯` pointer for the focused row, `✓`
|
|
8
9
|
* checkmark for the selected row, description on an indented second line,
|
|
9
10
|
* and CC's color states (focused = suggestion blue, selected = success
|
|
10
11
|
* green).
|
|
@@ -44,5 +45,36 @@ export function ListItem({ isFocused, isSelected = false, children, description,
|
|
|
44
45
|
return 'suggestion';
|
|
45
46
|
return undefined;
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
// 窗口化列表(ModelPicker/History/Rewind/Select)按固定行高切片:字符串
|
|
49
|
+
// 内容必须恒占一行——压平内嵌换行(历史命令可能带 \n),超宽 truncate
|
|
50
|
+
// 而非换行,否则一项实际占多行会把焦点行裁出浮层(二次审查实证)。
|
|
51
|
+
// 压平必须递归穿透 Fragment/数组:ThemePicker 的 label 就是包着用户
|
|
52
|
+
// displayName 的 Fragment,而 customTheme 允许 displayName 保留内部
|
|
53
|
+
// 换行(三轮审查实证:不递归则 Fragment 里的 'Foo\nBar' 仍渲染两行)。
|
|
54
|
+
// 非 Fragment 的 element(如调用方自己的 <Text>)保留原样——其子树高度
|
|
55
|
+
// 由调用方负责。
|
|
56
|
+
const flatChildren = flattenDeep(children);
|
|
57
|
+
return (_jsxs(Box, { ref: cursorRef, flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", gap: 1, children: [renderIndicator(), styled ? (_jsx(Text, { color: getTextColor(), dimColor: disabled, wrap: "truncate", children: flatChildren })) : (flatChildren), isSelected && !disabled && _jsx(Text, { color: "success", children: TICK })] }), description && (_jsx(Box, { paddingLeft: 2, children: _jsx(Text, { color: "inactive", wrap: "truncate", children: flattenLine(description) }) }))] }));
|
|
58
|
+
}
|
|
59
|
+
/** 单行化:内嵌换行折叠为空格(行尾/行首换行随之消除)。 */
|
|
60
|
+
function flattenLine(s) {
|
|
61
|
+
return s.replace(/[\r\n]+/g, ' ');
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 递归单行化:字符串直接压平;数组逐元素递归;Fragment 是透明结构包装,
|
|
65
|
+
* 递归进其 children(保留 key/props)。其他 element 原样保留。
|
|
66
|
+
* 数组必须走 React.Children.map 而非原生 map:后者把静态 JSX children
|
|
67
|
+
* 变成无 key 的动态数组,/theme(label 含 Fragment)会稳定触发 React
|
|
68
|
+
* key warning(四次审查实证)。
|
|
69
|
+
*/
|
|
70
|
+
function flattenDeep(node) {
|
|
71
|
+
if (typeof node === 'string')
|
|
72
|
+
return flattenLine(node);
|
|
73
|
+
if (Array.isArray(node))
|
|
74
|
+
return React.Children.map(node, flattenDeep);
|
|
75
|
+
if (React.isValidElement(node) && node.type === React.Fragment) {
|
|
76
|
+
const frag = node;
|
|
77
|
+
return React.cloneElement(frag, undefined, flattenDeep(frag.props.children));
|
|
78
|
+
}
|
|
79
|
+
return node;
|
|
48
80
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* A spinner with a loading message for async operations,
|
|
4
|
-
* leak's design-system/LoadingState.tsx (using the small animated glyph).
|
|
3
|
+
* A spinner with a loading message for async operations, mirroring Claude Code's design-system/LoadingState.tsx (using the small animated glyph).
|
|
5
4
|
*
|
|
6
5
|
* @example
|
|
7
6
|
* <LoadingState message="Loading models" bold subtitle="Querying the provider…" />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingState.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/LoadingState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB
|
|
1
|
+
{"version":3,"file":"LoadingState.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/LoadingState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,IAAY,EACZ,QAAgB,EAChB,QAAQ,GACT,EAAE;IACD,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAA;IACf,kDAAkD;IAClD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,KAAK,CAAC,SAAS,CAelB"}
|
|
@@ -9,8 +9,7 @@ const SPINNER_FRAMES = [
|
|
|
9
9
|
...[...getDefaultCharacters()].reverse(),
|
|
10
10
|
];
|
|
11
11
|
/**
|
|
12
|
-
* A spinner with a loading message for async operations,
|
|
13
|
-
* leak's design-system/LoadingState.tsx (using the small animated glyph).
|
|
12
|
+
* A spinner with a loading message for async operations, mirroring Claude Code's design-system/LoadingState.tsx (using the small animated glyph).
|
|
14
13
|
*
|
|
15
14
|
* @example
|
|
16
15
|
* <LoadingState message="Loading models" bold subtitle="Querying the provider…" />
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import type { Theme } from '../../theme.js';
|
|
3
3
|
/**
|
|
4
4
|
* A pane — a region below the prompt bounded by a colored top line with a
|
|
5
|
-
* one-row gap above and horizontal padding
|
|
6
|
-
* design-system/Pane.tsx
|
|
5
|
+
* one-row gap above and horizontal padding, mirroring Claude Code's
|
|
6
|
+
* design-system/Pane.tsx. Used by the slash-command dialogs (/thinking,
|
|
7
7
|
* /model, /resume).
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
@@ -3,8 +3,8 @@ import Box from '../../ink/components/Box.js';
|
|
|
3
3
|
import { Divider } from './Divider.js';
|
|
4
4
|
/**
|
|
5
5
|
* A pane — a region below the prompt bounded by a colored top line with a
|
|
6
|
-
* one-row gap above and horizontal padding
|
|
7
|
-
* design-system/Pane.tsx
|
|
6
|
+
* one-row gap above and horizontal padding, mirroring Claude Code's
|
|
7
|
+
* design-system/Pane.tsx. Used by the slash-command dialogs (/thinking,
|
|
8
8
|
* /model, /resume).
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Theme } from '../../theme.js';
|
|
3
3
|
/**
|
|
4
|
-
* A proportional progress bar drawn with block glyphs,
|
|
5
|
-
* leak's design-system/ProgressBar.tsx: `█` fills whole cells, the partial
|
|
4
|
+
* A proportional progress bar drawn with block glyphs, mirroring Claude Code's design-system/ProgressBar.tsx: `█` fills whole cells, the partial
|
|
6
5
|
* cell uses the `▏▎▍▌▋▊▉` ladder for sub-cell precision, and the empty
|
|
7
6
|
* remainder is spaces with the empty color as background.
|
|
8
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C
|
|
1
|
+
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EAAE,UAAU,EACjB,KAAK,EACL,SAAS,EACT,UAAU,GACX,EAAE;IACD,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAA;IACb,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,KAAK,CAAA;IACvB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,KAAK,CAAA;CACzB,GAAG,KAAK,CAAC,SAAS,CAkBlB"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Text from '../../ink/components/Text.js';
|
|
3
3
|
/**
|
|
4
|
-
* A proportional progress bar drawn with block glyphs,
|
|
5
|
-
* leak's design-system/ProgressBar.tsx: `█` fills whole cells, the partial
|
|
4
|
+
* A proportional progress bar drawn with block glyphs, mirroring Claude Code's design-system/ProgressBar.tsx: `█` fills whole cells, the partial
|
|
6
5
|
* cell uses the `▏▎▍▌▋▊▉` ladder for sub-cell precision, and the empty
|
|
7
6
|
* remainder is spaces with the empty color as background.
|
|
8
7
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type Status = 'success' | 'error' | 'warning' | 'info' | 'pending' | 'loading';
|
|
3
3
|
/**
|
|
4
|
-
* A status indicator icon with the CC color mapping
|
|
5
|
-
* design-system/StatusIcon.tsx
|
|
4
|
+
* A status indicator icon with the CC color mapping, mirroring Claude Code's
|
|
5
|
+
* design-system/StatusIcon.tsx: ✓ green / ✗ red / ⚠ amber / ℹ blue /
|
|
6
6
|
* ○ dim / … dim.
|
|
7
7
|
*/
|
|
8
8
|
export declare function StatusIcon({ status, withSpace, }: {
|
|
@@ -10,8 +10,8 @@ const STATUS_CONFIG = {
|
|
|
10
10
|
loading: { icon: '…', color: undefined },
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
* A status indicator icon with the CC color mapping
|
|
14
|
-
* design-system/StatusIcon.tsx
|
|
13
|
+
* A status indicator icon with the CC color mapping, mirroring Claude Code's
|
|
14
|
+
* design-system/StatusIcon.tsx: ✓ green / ✗ red / ⚠ amber / ℹ blue /
|
|
15
15
|
* ○ dim / … dim.
|
|
16
16
|
*/
|
|
17
17
|
export function StatusIcon({ status, withSpace = false, }) {
|
|
@@ -5,7 +5,7 @@ export declare function ThemeProvider({ children, theme, }: {
|
|
|
5
5
|
}): React.ReactNode;
|
|
6
6
|
/**
|
|
7
7
|
* Resolves the active theme name and the runtime setter. Returns
|
|
8
|
-
* `[themeName, setTheme]` — the first element matches
|
|
8
|
+
* `[themeName, setTheme]` — the first element matches Claude Code's shape.
|
|
9
9
|
*/
|
|
10
10
|
export declare function useTheme(): [string, (name: string) => boolean];
|
|
11
11
|
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAA;AA4F7E,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,KAAK,CAAC,SAAS,CAuIlB;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAG9D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React, { createContext, useContext, useEffect, useState } from 'react';
|
|
3
|
-
import { registerCustomThemeResolver, setActiveThemeName } from '../../theme.js';
|
|
3
|
+
import { registerCustomThemeResolver, setActiveThemeName, setAutoThemeBase, getAutoThemeBase, AUTO_THEME_NAME, } from '../../theme.js';
|
|
4
4
|
import { isThemeAvailable, resolveCustomTheme } from '../../customTheme.js';
|
|
5
5
|
import { readThemePref, writeThemePref } from '../../themePrefs.js';
|
|
6
6
|
import useStdin from '../../ink/hooks/use-stdin.js';
|
|
@@ -9,11 +9,11 @@ import { parseOscColor } from '../../ink/termio/osc.js';
|
|
|
9
9
|
import { logForDebugging } from '../../utils/debug.js';
|
|
10
10
|
/**
|
|
11
11
|
* Theme provider with terminal-background auto-detection. With no explicit
|
|
12
|
-
* `theme` prop, no
|
|
13
|
-
* (~/.dsh-
|
|
12
|
+
* `theme` prop, no DSH_TUI_THEME override and no persisted choice
|
|
13
|
+
* (~/.dsh-tui/theme.json), it queries the terminal's background color
|
|
14
14
|
* (OSC 11) before first paint and picks the Gentle Mist Blue `light` palette
|
|
15
15
|
* on light backgrounds, `dark` otherwise. Priority: explicit `theme` prop >
|
|
16
|
-
*
|
|
16
|
+
* DSH_TUI_THEME (built-in or user theme name) > persisted `/theme` choice >
|
|
17
17
|
* OSC 11 detection. An invalid forced name is warned and skipped, so
|
|
18
18
|
* detection still runs. Children render only after the theme settles, so
|
|
19
19
|
* the first frame already carries the final palette — no dark→light flash.
|
|
@@ -21,25 +21,35 @@ import { logForDebugging } from '../../utils/debug.js';
|
|
|
21
21
|
* stall) falls back to `dark`. The resolved name is mirrored via
|
|
22
22
|
* setActiveThemeName() for non-React rendering (markdown inline code).
|
|
23
23
|
*
|
|
24
|
+
* The `auto` pseudo-theme turns that one-shot startup detection into a
|
|
25
|
+
* standing choice: `auto` is valid everywhere a theme name is (DSH_TUI_THEME,
|
|
26
|
+
* theme.json, /theme), defers first paint until detection settles like the
|
|
27
|
+
* unforced path, and re-queries OSC 11 on every runtime switch to `auto` —
|
|
28
|
+
* the detected base (light/dark) is mirrored via setAutoThemeBase() so
|
|
29
|
+
* getTheme('auto') resolves it for every consumer. OSC 11 tracks the system
|
|
30
|
+
* theme in terminals that follow it, so `auto` effectively follows the
|
|
31
|
+
* system light/dark mode.
|
|
32
|
+
*
|
|
24
33
|
* The context also exposes setTheme() for the runtime `/theme` picker: it
|
|
25
|
-
* validates the name, persists the choice to ~/.dsh-
|
|
34
|
+
* validates the name, persists the choice to ~/.dsh-tui/theme.json and hot
|
|
26
35
|
* swaps the palette (and the module-level mirror) immediately.
|
|
27
36
|
*/
|
|
28
|
-
// User themes (~/.dsh-
|
|
37
|
+
// User themes (~/.dsh-tui/themes/<name>.json) resolve through this registry,
|
|
29
38
|
// so getTheme() serves them to every themed component and to non-React
|
|
30
39
|
// rendering (markdown inline code) without a context.
|
|
31
40
|
registerCustomThemeResolver(resolveCustomTheme);
|
|
32
41
|
const ThemeContext = createContext({
|
|
33
42
|
theme: 'dark',
|
|
43
|
+
autoBase: 'dark',
|
|
34
44
|
setTheme: () => false,
|
|
35
45
|
});
|
|
36
46
|
/**
|
|
37
|
-
*
|
|
38
|
-
* built-in name (light|dark|dark-ansi) or a user theme name; invalid
|
|
39
|
-
* are warned and ignored by the caller, falling back to detection.
|
|
47
|
+
* DSH_TUI_THEME skips terminal detection (tests, debugging). Accepts a
|
|
48
|
+
* built-in name (auto|light|dark|dark-ansi) or a user theme name; invalid
|
|
49
|
+
* values are warned and ignored by the caller, falling back to detection.
|
|
40
50
|
*/
|
|
41
51
|
function envThemeOverride() {
|
|
42
|
-
const v = process.env.
|
|
52
|
+
const v = process.env.DSH_TUI_THEME;
|
|
43
53
|
return v === undefined || v === '' ? undefined : v;
|
|
44
54
|
}
|
|
45
55
|
/** Detection round-trip is normally ~10ms locally; this only bounds pathological stalls. */
|
|
@@ -61,20 +71,43 @@ export function ThemeProvider({ children, theme, }) {
|
|
|
61
71
|
return false;
|
|
62
72
|
if (isThemeAvailable(forced))
|
|
63
73
|
return true;
|
|
64
|
-
console.warn(`[dsh-tui] theme "${forced}" not found (built-ins: light, dark, dark-ansi; user themes: ~/.dsh-
|
|
74
|
+
console.warn(`[dsh-tui] theme "${forced}" not found (built-ins: auto, light, dark, dark-ansi; user themes: ~/.dsh-tui/themes/*.json); falling back to auto-detection`);
|
|
65
75
|
return false;
|
|
66
76
|
});
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
// `auto` (like the unforced path) stays null until detection settles, so
|
|
78
|
+
// the first frame already carries the detected palette.
|
|
79
|
+
const [active, setActive] = useState(forcedValid && forced !== AUTO_THEME_NAME ? forced ?? null : null);
|
|
80
|
+
const { internal_querier, isRawModeSupported } = useStdin();
|
|
81
|
+
/**
|
|
82
|
+
* The palette `auto` resolves to, as React state so a flip re-renders
|
|
83
|
+
* consumers through the context value. Kept in sync with the module-level
|
|
84
|
+
* mirror in theme.ts (non-React rendering reads that one).
|
|
85
|
+
*/
|
|
86
|
+
const [autoBase, setAutoBase] = useState(() => getAutoThemeBase());
|
|
87
|
+
const applyAutoBase = React.useCallback((base) => {
|
|
88
|
+
setAutoThemeBase(base);
|
|
89
|
+
setAutoBase(base);
|
|
90
|
+
}, []);
|
|
69
91
|
useEffect(() => {
|
|
70
|
-
if (forcedValid)
|
|
92
|
+
if (forcedValid && forced !== AUTO_THEME_NAME)
|
|
71
93
|
return;
|
|
72
94
|
const querier = internal_querier;
|
|
95
|
+
// Settle on the detected base: a concrete forced/unforced name activates
|
|
96
|
+
// directly; `auto` records the base and activates as `auto`.
|
|
97
|
+
const settle = (name, why) => {
|
|
98
|
+
logForDebugging(`theme: ${name} (${why})`);
|
|
99
|
+
if (forced === AUTO_THEME_NAME) {
|
|
100
|
+
applyAutoBase(name);
|
|
101
|
+
setActive(AUTO_THEME_NAME);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
setActive(name);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
73
107
|
// Stdin responses only flow while raw mode holds the readable listener;
|
|
74
108
|
// without a querier (or raw-mode support) detection is impossible.
|
|
75
109
|
if (querier === null || !isRawModeSupported) {
|
|
76
|
-
|
|
77
|
-
setActive('dark');
|
|
110
|
+
settle('dark', 'detection unavailable (no querier/raw mode)');
|
|
78
111
|
return;
|
|
79
112
|
}
|
|
80
113
|
let settled = false;
|
|
@@ -83,12 +116,11 @@ export function ThemeProvider({ children, theme, }) {
|
|
|
83
116
|
return;
|
|
84
117
|
settled = true;
|
|
85
118
|
clearTimeout(timer);
|
|
86
|
-
|
|
87
|
-
logForDebugging(`theme: ${name} (${why})`);
|
|
88
|
-
setActive(name);
|
|
119
|
+
settle(name, why);
|
|
89
120
|
};
|
|
90
|
-
const timer = setTimeout(() => {
|
|
91
|
-
|
|
121
|
+
const timer = setTimeout(() => {
|
|
122
|
+
finish('dark', 'detection timeout');
|
|
123
|
+
}, DETECT_TIMEOUT_MS);
|
|
92
124
|
void Promise.all([querier.send(oscColor(11)), querier.flush()]).then(([r]) => {
|
|
93
125
|
const color = r ? parseOscColor(r.data) : null;
|
|
94
126
|
if (color === null || color.type !== 'rgb') {
|
|
@@ -98,11 +130,38 @@ export function ThemeProvider({ children, theme, }) {
|
|
|
98
130
|
finish(isLightBackground(color.r, color.g, color.b) ? 'light' : 'dark', `OSC 11 bg rgb(${color.r},${color.g},${color.b})`);
|
|
99
131
|
}
|
|
100
132
|
});
|
|
133
|
+
return () => {
|
|
134
|
+
settled = true;
|
|
135
|
+
clearTimeout(timer);
|
|
136
|
+
};
|
|
101
137
|
}, []);
|
|
138
|
+
/**
|
|
139
|
+
* Re-query the terminal background while the app is running (runtime
|
|
140
|
+
* switch to `auto`). Stdin is already in raw mode here — unlike the
|
|
141
|
+
* startup path above — so no raw-mode toggling. Best effort: a terminal
|
|
142
|
+
* that doesn't answer just keeps the current base.
|
|
143
|
+
*/
|
|
144
|
+
const redetectAutoBase = React.useCallback(() => {
|
|
145
|
+
const querier = internal_querier;
|
|
146
|
+
if (querier === null || !isRawModeSupported) {
|
|
147
|
+
logForDebugging('theme: auto re-detection unavailable, keeping current base');
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
void Promise.all([querier.send(oscColor(11)), querier.flush()]).then(([r]) => {
|
|
151
|
+
const color = r ? parseOscColor(r.data) : null;
|
|
152
|
+
if (color === null || color.type !== 'rgb')
|
|
153
|
+
return;
|
|
154
|
+
const base = isLightBackground(color.r, color.g, color.b) ? 'light' : 'dark';
|
|
155
|
+
logForDebugging(`theme: auto base ${base} (OSC 11 bg rgb(${color.r},${color.g},${color.b}))`);
|
|
156
|
+
applyAutoBase(base);
|
|
157
|
+
});
|
|
158
|
+
}, [internal_querier, isRawModeSupported, applyAutoBase]);
|
|
102
159
|
/**
|
|
103
160
|
* Runtime theme switch (/theme picker or direct command). Validates the
|
|
104
161
|
* name, persists first (a choice that cannot be saved never silently
|
|
105
|
-
* disappears), then hot swaps the palette.
|
|
162
|
+
* disappears), then hot swaps the palette. Switching to `auto` applies
|
|
163
|
+
* the last detected base immediately and re-queries OSC 11 in the
|
|
164
|
+
* background, so a theme change since launch is picked up.
|
|
106
165
|
*/
|
|
107
166
|
const setTheme = React.useCallback((name) => {
|
|
108
167
|
if (!isThemeAvailable(name)) {
|
|
@@ -110,13 +169,15 @@ export function ThemeProvider({ children, theme, }) {
|
|
|
110
169
|
return false;
|
|
111
170
|
}
|
|
112
171
|
if (!writeThemePref(name)) {
|
|
113
|
-
console.warn('[dsh-tui] failed to write ~/.dsh-
|
|
172
|
+
console.warn('[dsh-tui] failed to write ~/.dsh-tui/theme.json');
|
|
114
173
|
return false;
|
|
115
174
|
}
|
|
116
175
|
setActive(name);
|
|
176
|
+
if (name === AUTO_THEME_NAME)
|
|
177
|
+
redetectAutoBase();
|
|
117
178
|
return true;
|
|
118
|
-
}, []);
|
|
119
|
-
const value = React.useMemo(() => ({ theme: active ?? 'dark', setTheme }), [active, setTheme]);
|
|
179
|
+
}, [redetectAutoBase]);
|
|
180
|
+
const value = React.useMemo(() => ({ theme: active ?? 'dark', autoBase, setTheme }), [active, autoBase, setTheme]);
|
|
120
181
|
useEffect(() => {
|
|
121
182
|
if (active !== null)
|
|
122
183
|
setActiveThemeName(active);
|
|
@@ -127,7 +188,7 @@ export function ThemeProvider({ children, theme, }) {
|
|
|
127
188
|
}
|
|
128
189
|
/**
|
|
129
190
|
* Resolves the active theme name and the runtime setter. Returns
|
|
130
|
-
* `[themeName, setTheme]` — the first element matches
|
|
191
|
+
* `[themeName, setTheme]` — the first element matches Claude Code's shape.
|
|
131
192
|
*/
|
|
132
193
|
export function useTheme() {
|
|
133
194
|
const { theme, setTheme } = useContext(ThemeContext);
|