@deepseek-harness-tui/dsh-tui 0.5.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/LICENSE +21 -0
- package/README.md +235 -0
- package/bin/dsh-tui.js +95 -0
- package/cordis.patch.yml +218 -0
- package/cordis.yml +185 -0
- package/lib/invariant.js +28 -0
- package/lib/types/activityPrefs.d.ts +29 -0
- package/lib/types/activityPrefs.d.ts.map +1 -0
- package/lib/types/activityPrefs.js +60 -0
- package/lib/types/bootstrap/state.d.ts +13 -0
- package/lib/types/bootstrap/state.d.ts.map +1 -0
- package/lib/types/bootstrap/state.js +12 -0
- package/lib/types/cc/cliHighlight.d.ts +20 -0
- package/lib/types/cc/cliHighlight.d.ts.map +1 -0
- package/lib/types/cc/cliHighlight.js +53 -0
- package/lib/types/cc/figures.d.ts +59 -0
- package/lib/types/cc/figures.d.ts.map +1 -0
- package/lib/types/cc/figures.js +69 -0
- package/lib/types/cc/format.d.ts +26 -0
- package/lib/types/cc/format.d.ts.map +1 -0
- package/lib/types/cc/format.js +55 -0
- package/lib/types/cc/hash.d.ts +25 -0
- package/lib/types/cc/hash.d.ts.map +1 -0
- package/lib/types/cc/hash.js +41 -0
- package/lib/types/cc/hyperlink.d.ts +21 -0
- package/lib/types/cc/hyperlink.d.ts.map +1 -0
- package/lib/types/cc/hyperlink.js +31 -0
- package/lib/types/cc/markdown.d.ts +43 -0
- package/lib/types/cc/markdown.d.ts.map +1 -0
- package/lib/types/cc/markdown.js +345 -0
- package/lib/types/cc/spinnerVerbs.d.ts +3 -0
- package/lib/types/cc/spinnerVerbs.d.ts.map +1 -0
- package/lib/types/cc/spinnerVerbs.js +190 -0
- package/lib/types/cc/terminal.d.ts +15 -0
- package/lib/types/cc/terminal.d.ts.map +1 -0
- package/lib/types/cc/terminal.js +84 -0
- package/lib/types/channel.d.ts +672 -0
- package/lib/types/channel.d.ts.map +1 -0
- package/lib/types/channel.js +2427 -0
- package/lib/types/childStderr.d.ts +63 -0
- package/lib/types/childStderr.d.ts.map +1 -0
- package/lib/types/childStderr.js +161 -0
- package/lib/types/commands.d.ts +55 -0
- package/lib/types/commands.d.ts.map +1 -0
- package/lib/types/commands.js +101 -0
- package/lib/types/components/ActivityLine.d.ts +29 -0
- package/lib/types/components/ActivityLine.d.ts.map +1 -0
- package/lib/types/components/ActivityLine.js +47 -0
- package/lib/types/components/ActivityPicker.d.ts +13 -0
- package/lib/types/components/ActivityPicker.d.ts.map +1 -0
- package/lib/types/components/ActivityPicker.js +24 -0
- package/lib/types/components/CommandSuggestions.d.ts +14 -0
- package/lib/types/components/CommandSuggestions.d.ts.map +1 -0
- package/lib/types/components/CommandSuggestions.js +33 -0
- package/lib/types/components/FileSuggestions.d.ts +12 -0
- package/lib/types/components/FileSuggestions.d.ts.map +1 -0
- package/lib/types/components/FileSuggestions.js +26 -0
- package/lib/types/components/GoalTodoPanel.d.ts +13 -0
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -0
- package/lib/types/components/GoalTodoPanel.js +57 -0
- package/lib/types/components/HelpMenu.d.ts +12 -0
- package/lib/types/components/HelpMenu.d.ts.map +1 -0
- package/lib/types/components/HelpMenu.js +12 -0
- package/lib/types/components/HistorySearchDialog.d.ts +16 -0
- package/lib/types/components/HistorySearchDialog.d.ts.map +1 -0
- package/lib/types/components/HistorySearchDialog.js +31 -0
- package/lib/types/components/InterruptedByUser.d.ts +7 -0
- package/lib/types/components/InterruptedByUser.d.ts.map +1 -0
- package/lib/types/components/InterruptedByUser.js +9 -0
- package/lib/types/components/LoadedContextPanel.d.ts +20 -0
- package/lib/types/components/LoadedContextPanel.d.ts.map +1 -0
- package/lib/types/components/LoadedContextPanel.js +30 -0
- package/lib/types/components/LogoV2.d.ts +23 -0
- package/lib/types/components/LogoV2.d.ts.map +1 -0
- package/lib/types/components/LogoV2.js +95 -0
- package/lib/types/components/Markdown.d.ts +24 -0
- package/lib/types/components/Markdown.d.ts.map +1 -0
- package/lib/types/components/Markdown.js +106 -0
- package/lib/types/components/MarkdownTable.d.ts +17 -0
- package/lib/types/components/MarkdownTable.d.ts.map +1 -0
- package/lib/types/components/MarkdownTable.js +272 -0
- package/lib/types/components/MessageList.d.ts +41 -0
- package/lib/types/components/MessageList.d.ts.map +1 -0
- package/lib/types/components/MessageList.js +303 -0
- package/lib/types/components/ModelPicker.d.ts +14 -0
- package/lib/types/components/ModelPicker.d.ts.map +1 -0
- package/lib/types/components/ModelPicker.js +15 -0
- package/lib/types/components/PresetPicker.d.ts +17 -0
- package/lib/types/components/PresetPicker.d.ts.map +1 -0
- package/lib/types/components/PresetPicker.js +25 -0
- package/lib/types/components/PromptInput.d.ts +67 -0
- package/lib/types/components/PromptInput.d.ts.map +1 -0
- package/lib/types/components/PromptInput.js +778 -0
- package/lib/types/components/ResumePicker.d.ts +15 -0
- package/lib/types/components/ResumePicker.d.ts.map +1 -0
- package/lib/types/components/ResumePicker.js +34 -0
- package/lib/types/components/RewindPicker.d.ts +14 -0
- package/lib/types/components/RewindPicker.d.ts.map +1 -0
- package/lib/types/components/RewindPicker.js +23 -0
- package/lib/types/components/SearchBox.d.ts +20 -0
- package/lib/types/components/SearchBox.d.ts.map +1 -0
- package/lib/types/components/SearchBox.js +33 -0
- package/lib/types/components/Select.d.ts +22 -0
- package/lib/types/components/Select.d.ts.map +1 -0
- package/lib/types/components/Select.js +19 -0
- package/lib/types/components/Spinner/GlimmerMessage.d.ts +19 -0
- package/lib/types/components/Spinner/GlimmerMessage.d.ts.map +1 -0
- package/lib/types/components/Spinner/GlimmerMessage.js +78 -0
- package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +31 -0
- package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts.map +1 -0
- package/lib/types/components/Spinner/SpinnerAnimationRow.js +162 -0
- package/lib/types/components/Spinner/SpinnerGlyph.d.ts +16 -0
- package/lib/types/components/Spinner/SpinnerGlyph.d.ts.map +1 -0
- package/lib/types/components/Spinner/SpinnerGlyph.js +36 -0
- package/lib/types/components/Spinner/spinnerMode.d.ts +6 -0
- package/lib/types/components/Spinner/spinnerMode.d.ts.map +1 -0
- package/lib/types/components/Spinner/spinnerMode.js +1 -0
- package/lib/types/components/Spinner/spinnerUtils.d.ts +41 -0
- package/lib/types/components/Spinner/spinnerUtils.d.ts.map +1 -0
- package/lib/types/components/Spinner/spinnerUtils.js +104 -0
- package/lib/types/components/Spinner/useStalledAnimation.d.ts +16 -0
- package/lib/types/components/Spinner/useStalledAnimation.d.ts.map +1 -0
- package/lib/types/components/Spinner/useStalledAnimation.js +71 -0
- package/lib/types/components/StreamingMarkdown.d.ts +12 -0
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -0
- package/lib/types/components/StreamingMarkdown.js +39 -0
- package/lib/types/components/ThemePicker.d.ts +22 -0
- package/lib/types/components/ThemePicker.d.ts.map +1 -0
- package/lib/types/components/ThemePicker.js +51 -0
- package/lib/types/components/ThinkingToggle.d.ts +17 -0
- package/lib/types/components/ThinkingToggle.d.ts.map +1 -0
- package/lib/types/components/ThinkingToggle.js +30 -0
- package/lib/types/components/ToolUseLoader.d.ts +13 -0
- package/lib/types/components/ToolUseLoader.d.ts.map +1 -0
- package/lib/types/components/ToolUseLoader.js +17 -0
- package/lib/types/components/Whale.d.ts +22 -0
- package/lib/types/components/Whale.d.ts.map +1 -0
- package/lib/types/components/Whale.js +78 -0
- package/lib/types/components/WorkingSpinner.d.ts +26 -0
- package/lib/types/components/WorkingSpinner.d.ts.map +1 -0
- package/lib/types/components/WorkingSpinner.js +68 -0
- package/lib/types/components/activityFrames.d.ts +31 -0
- package/lib/types/components/activityFrames.d.ts.map +1 -0
- package/lib/types/components/activityFrames.js +83 -0
- package/lib/types/components/bigfont.d.ts +28 -0
- package/lib/types/components/bigfont.d.ts.map +1 -0
- package/lib/types/components/bigfont.js +91 -0
- package/lib/types/components/design-system/Byline.d.ts +14 -0
- package/lib/types/components/design-system/Byline.d.ts.map +1 -0
- package/lib/types/components/design-system/Byline.js +17 -0
- package/lib/types/components/design-system/Divider.d.ts +40 -0
- package/lib/types/components/design-system/Divider.d.ts.map +1 -0
- package/lib/types/components/design-system/Divider.js +24 -0
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts +19 -0
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts.map +1 -0
- package/lib/types/components/design-system/KeyboardShortcutHint.js +14 -0
- package/lib/types/components/design-system/ListItem.d.ts +36 -0
- package/lib/types/components/design-system/ListItem.d.ts.map +1 -0
- package/lib/types/components/design-system/ListItem.js +48 -0
- package/lib/types/components/design-system/LoadingState.d.ts +19 -0
- package/lib/types/components/design-system/LoadingState.d.ts.map +1 -0
- package/lib/types/components/design-system/LoadingState.js +22 -0
- package/lib/types/components/design-system/Pane.d.ts +17 -0
- package/lib/types/components/design-system/Pane.d.ts.map +1 -0
- package/lib/types/components/design-system/Pane.js +15 -0
- package/lib/types/components/design-system/ProgressBar.d.ts +22 -0
- package/lib/types/components/design-system/ProgressBar.d.ts.map +1 -0
- package/lib/types/components/design-system/ProgressBar.js +27 -0
- package/lib/types/components/design-system/StatusIcon.d.ts +15 -0
- package/lib/types/components/design-system/StatusIcon.d.ts.map +1 -0
- package/lib/types/components/design-system/StatusIcon.js +20 -0
- package/lib/types/components/design-system/ThemeProvider.d.ts +11 -0
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -0
- package/lib/types/components/design-system/ThemeProvider.js +135 -0
- package/lib/types/components/design-system/ThemedBox.d.ts +37 -0
- package/lib/types/components/design-system/ThemedBox.d.ts.map +1 -0
- package/lib/types/components/design-system/ThemedBox.js +26 -0
- package/lib/types/components/design-system/ThemedText.d.ts +56 -0
- package/lib/types/components/design-system/ThemedText.d.ts.map +1 -0
- package/lib/types/components/design-system/ThemedText.js +45 -0
- package/lib/types/components/messages/AssistantTextMessage.d.ts +18 -0
- package/lib/types/components/messages/AssistantTextMessage.d.ts.map +1 -0
- package/lib/types/components/messages/AssistantTextMessage.js +15 -0
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +23 -0
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -0
- package/lib/types/components/messages/AssistantThinkingMessage.js +23 -0
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +23 -0
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -0
- package/lib/types/components/messages/AssistantToolUseMessage.js +220 -0
- package/lib/types/components/messages/MessageMetadata.d.ts +15 -0
- package/lib/types/components/messages/MessageMetadata.d.ts.map +1 -0
- package/lib/types/components/messages/MessageMetadata.js +20 -0
- package/lib/types/components/messages/UserPromptMessage.d.ts +19 -0
- package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -0
- package/lib/types/components/messages/UserPromptMessage.js +15 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +39 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -0
- package/lib/types/components/questions/AskUserQuestionPanel.js +228 -0
- package/lib/types/components/shimmer.d.ts +35 -0
- package/lib/types/components/shimmer.d.ts.map +1 -0
- package/lib/types/components/shimmer.js +43 -0
- package/lib/types/components/whaleFrames.d.ts +25 -0
- package/lib/types/components/whaleFrames.d.ts.map +1 -0
- package/lib/types/components/whaleFrames.js +419 -0
- package/lib/types/customTheme.d.ts +104 -0
- package/lib/types/customTheme.d.ts.map +1 -0
- package/lib/types/customTheme.js +268 -0
- package/lib/types/effortPrefs.d.ts +22 -0
- package/lib/types/effortPrefs.d.ts.map +1 -0
- package/lib/types/effortPrefs.js +45 -0
- package/lib/types/history.d.ts +24 -0
- package/lib/types/history.d.ts.map +1 -0
- package/lib/types/history.js +75 -0
- package/lib/types/hooks/useBlink.d.ts +11 -0
- package/lib/types/hooks/useBlink.d.ts.map +1 -0
- package/lib/types/hooks/useBlink.js +20 -0
- package/lib/types/i18n.d.ts +926 -0
- package/lib/types/i18n.d.ts.map +1 -0
- package/lib/types/i18n.js +356 -0
- package/lib/types/index.d.ts +70 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +31 -0
- package/lib/types/ink/Ansi.d.ts +11 -0
- package/lib/types/ink/Ansi.d.ts.map +1 -0
- package/lib/types/ink/Ansi.js +269 -0
- package/lib/types/ink/bidi.d.ts +18 -0
- package/lib/types/ink/bidi.d.ts.map +1 -0
- package/lib/types/ink/bidi.js +119 -0
- package/lib/types/ink/clearTerminal.d.ts +22 -0
- package/lib/types/ink/clearTerminal.d.ts.map +1 -0
- package/lib/types/ink/clearTerminal.js +72 -0
- package/lib/types/ink/colorize.d.ts +33 -0
- package/lib/types/ink/colorize.d.ts.map +1 -0
- package/lib/types/ink/colorize.js +213 -0
- package/lib/types/ink/components/AlternateScreen.d.ts +22 -0
- package/lib/types/ink/components/AlternateScreen.d.ts.map +1 -0
- package/lib/types/ink/components/AlternateScreen.js +74 -0
- package/lib/types/ink/components/App.d.ts +73 -0
- package/lib/types/ink/components/App.d.ts.map +1 -0
- package/lib/types/ink/components/App.js +597 -0
- package/lib/types/ink/components/AppContext.d.ts +15 -0
- package/lib/types/ink/components/AppContext.d.ts.map +1 -0
- package/lib/types/ink/components/AppContext.js +11 -0
- package/lib/types/ink/components/Box.d.ts +49 -0
- package/lib/types/ink/components/Box.d.ts.map +1 -0
- package/lib/types/ink/components/Box.js +153 -0
- package/lib/types/ink/components/Button.d.ts +37 -0
- package/lib/types/ink/components/Button.d.ts.map +1 -0
- package/lib/types/ink/components/Button.js +166 -0
- package/lib/types/ink/components/ClockContext.d.ts +10 -0
- package/lib/types/ink/components/ClockContext.d.ts.map +1 -0
- package/lib/types/ink/components/ClockContext.js +108 -0
- package/lib/types/ink/components/CursorDeclarationContext.d.ts +30 -0
- package/lib/types/ink/components/CursorDeclarationContext.d.ts.map +1 -0
- package/lib/types/ink/components/CursorDeclarationContext.js +6 -0
- package/lib/types/ink/components/ErrorOverview.d.ts +7 -0
- package/lib/types/ink/components/ErrorOverview.d.ts.map +1 -0
- package/lib/types/ink/components/ErrorOverview.js +49 -0
- package/lib/types/ink/components/Link.d.ts +8 -0
- package/lib/types/ink/components/Link.d.ts.map +1 -0
- package/lib/types/ink/components/Link.js +33 -0
- package/lib/types/ink/components/Newline.d.ts +13 -0
- package/lib/types/ink/components/Newline.d.ts.map +1 -0
- package/lib/types/ink/components/Newline.js +29 -0
- package/lib/types/ink/components/NoSelect.d.ts +20 -0
- package/lib/types/ink/components/NoSelect.d.ts.map +1 -0
- package/lib/types/ink/components/NoSelect.js +56 -0
- package/lib/types/ink/components/RawAnsi.d.ts +17 -0
- package/lib/types/ink/components/RawAnsi.d.ts.map +1 -0
- package/lib/types/ink/components/RawAnsi.js +45 -0
- package/lib/types/ink/components/ScrollBox.d.ts +78 -0
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -0
- package/lib/types/ink/components/ScrollBox.js +174 -0
- package/lib/types/ink/components/Spacer.d.ts +6 -0
- package/lib/types/ink/components/Spacer.d.ts.map +1 -0
- package/lib/types/ink/components/Spacer.js +19 -0
- package/lib/types/ink/components/StdinContext.d.ts +32 -0
- package/lib/types/ink/components/StdinContext.d.ts.map +1 -0
- package/lib/types/ink/components/StdinContext.js +16 -0
- package/lib/types/ink/components/TerminalFocusContext.d.ts +11 -0
- package/lib/types/ink/components/TerminalFocusContext.d.ts.map +1 -0
- package/lib/types/ink/components/TerminalFocusContext.js +45 -0
- package/lib/types/ink/components/TerminalSizeContext.d.ts +6 -0
- package/lib/types/ink/components/TerminalSizeContext.d.ts.map +1 -0
- package/lib/types/ink/components/TerminalSizeContext.js +3 -0
- package/lib/types/ink/components/Text.d.ts +56 -0
- package/lib/types/ink/components/Text.d.ts.map +1 -0
- package/lib/types/ink/components/Text.js +194 -0
- package/lib/types/ink/constants.d.ts +3 -0
- package/lib/types/ink/constants.d.ts.map +1 -0
- package/lib/types/ink/constants.js +2 -0
- package/lib/types/ink/cursor.d.ts +11 -0
- package/lib/types/ink/cursor.d.ts.map +1 -0
- package/lib/types/ink/cursor.js +1 -0
- package/lib/types/ink/devtools.d.ts +7 -0
- package/lib/types/ink/devtools.d.ts.map +1 -0
- package/lib/types/ink/devtools.js +1 -0
- package/lib/types/ink/dom.d.ts +178 -0
- package/lib/types/ink/dom.d.ts.map +1 -0
- package/lib/types/ink/dom.js +424 -0
- package/lib/types/ink/events/click-event.d.ts +32 -0
- package/lib/types/ink/events/click-event.d.ts.map +1 -0
- package/lib/types/ink/events/click-event.js +36 -0
- package/lib/types/ink/events/dispatcher.d.ts +63 -0
- package/lib/types/ink/events/dispatcher.d.ts.map +1 -0
- package/lib/types/ink/events/dispatcher.js +194 -0
- package/lib/types/ink/events/emitter.d.ts +20 -0
- package/lib/types/ink/events/emitter.d.ts.map +1 -0
- package/lib/types/ink/events/emitter.js +43 -0
- package/lib/types/ink/events/event-handlers.d.ts +47 -0
- package/lib/types/ink/events/event-handlers.d.ts.map +1 -0
- package/lib/types/ink/events/event-handlers.js +30 -0
- package/lib/types/ink/events/event.d.ts +19 -0
- package/lib/types/ink/events/event.d.ts.map +1 -0
- package/lib/types/ink/events/event.js +22 -0
- package/lib/types/ink/events/focus-event.d.ts +19 -0
- package/lib/types/ink/events/focus-event.d.ts.map +1 -0
- package/lib/types/ink/events/focus-event.js +21 -0
- package/lib/types/ink/events/input-event.d.ts +53 -0
- package/lib/types/ink/events/input-event.d.ts.map +1 -0
- package/lib/types/ink/events/input-event.js +180 -0
- package/lib/types/ink/events/keyboard-event.d.ts +40 -0
- package/lib/types/ink/events/keyboard-event.d.ts.map +1 -0
- package/lib/types/ink/events/keyboard-event.js +65 -0
- package/lib/types/ink/events/paste-event.d.ts +11 -0
- package/lib/types/ink/events/paste-event.d.ts.map +1 -0
- package/lib/types/ink/events/paste-event.js +13 -0
- package/lib/types/ink/events/resize-event.d.ts +13 -0
- package/lib/types/ink/events/resize-event.d.ts.map +1 -0
- package/lib/types/ink/events/resize-event.js +16 -0
- package/lib/types/ink/events/terminal-event.d.ts +112 -0
- package/lib/types/ink/events/terminal-event.d.ts.map +1 -0
- package/lib/types/ink/events/terminal-event.js +131 -0
- package/lib/types/ink/events/terminal-focus-event.d.ts +21 -0
- package/lib/types/ink/events/terminal-focus-event.d.ts.map +1 -0
- package/lib/types/ink/events/terminal-focus-event.js +18 -0
- package/lib/types/ink/focus.d.ts +74 -0
- package/lib/types/ink/focus.d.ts.map +1 -0
- package/lib/types/ink/focus.js +188 -0
- package/lib/types/ink/frame.d.ts +119 -0
- package/lib/types/ink/frame.d.ts.map +1 -0
- package/lib/types/ink/frame.js +43 -0
- package/lib/types/ink/get-max-width.d.ts +20 -0
- package/lib/types/ink/get-max-width.d.ts.map +1 -0
- package/lib/types/ink/get-max-width.js +25 -0
- package/lib/types/ink/hit-test.d.ts +47 -0
- package/lib/types/ink/hit-test.d.ts.map +1 -0
- package/lib/types/ink/hit-test.js +126 -0
- package/lib/types/ink/hooks/use-animation-frame.d.ts +27 -0
- package/lib/types/ink/hooks/use-animation-frame.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-animation-frame.js +48 -0
- package/lib/types/ink/hooks/use-app.d.ts +8 -0
- package/lib/types/ink/hooks/use-app.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-app.js +8 -0
- package/lib/types/ink/hooks/use-copy-on-select.d.ts +22 -0
- package/lib/types/ink/hooks/use-copy-on-select.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-copy-on-select.js +40 -0
- package/lib/types/ink/hooks/use-declared-cursor.d.ts +31 -0
- package/lib/types/ink/hooks/use-declared-cursor.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-declared-cursor.js +65 -0
- package/lib/types/ink/hooks/use-input.d.ts +41 -0
- package/lib/types/ink/hooks/use-input.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-input.js +73 -0
- package/lib/types/ink/hooks/use-interval.d.ts +23 -0
- package/lib/types/ink/hooks/use-interval.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-interval.js +58 -0
- package/lib/types/ink/hooks/use-search-highlight.d.ts +34 -0
- package/lib/types/ink/hooks/use-search-highlight.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-search-highlight.js +35 -0
- package/lib/types/ink/hooks/use-selection.d.ts +44 -0
- package/lib/types/ink/hooks/use-selection.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-selection.js +64 -0
- package/lib/types/ink/hooks/use-stdin.d.ts +8 -0
- package/lib/types/ink/hooks/use-stdin.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-stdin.js +8 -0
- package/lib/types/ink/hooks/use-tab-status.d.ts +18 -0
- package/lib/types/ink/hooks/use-tab-status.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-tab-status.js +58 -0
- package/lib/types/ink/hooks/use-terminal-focus.d.ts +11 -0
- package/lib/types/ink/hooks/use-terminal-focus.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-terminal-focus.js +15 -0
- package/lib/types/ink/hooks/use-terminal-size.d.ts +6 -0
- package/lib/types/ink/hooks/use-terminal-size.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-terminal-size.js +12 -0
- package/lib/types/ink/hooks/use-terminal-title.d.ts +14 -0
- package/lib/types/ink/hooks/use-terminal-title.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-terminal-title.js +30 -0
- package/lib/types/ink/hooks/use-terminal-viewport.d.ts +32 -0
- package/lib/types/ink/hooks/use-terminal-viewport.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-terminal-viewport.js +79 -0
- package/lib/types/ink/ink.d.ts +370 -0
- package/lib/types/ink/ink.d.ts.map +1 -0
- package/lib/types/ink/ink.js +1665 -0
- package/lib/types/ink/instances.d.ts +10 -0
- package/lib/types/ink/instances.d.ts.map +1 -0
- package/lib/types/ink/instances.js +13 -0
- package/lib/types/ink/layout/engine.d.ts +7 -0
- package/lib/types/ink/layout/engine.d.ts.map +1 -0
- package/lib/types/ink/layout/engine.js +8 -0
- package/lib/types/ink/layout/geometry.d.ts +86 -0
- package/lib/types/ink/layout/geometry.d.ts.map +1 -0
- package/lib/types/ink/layout/geometry.js +95 -0
- package/lib/types/ink/layout/node.d.ts +151 -0
- package/lib/types/ink/layout/node.d.ts.map +1 -0
- package/lib/types/ink/layout/node.js +72 -0
- package/lib/types/ink/layout/yoga.d.ts +69 -0
- package/lib/types/ink/layout/yoga.d.ts.map +1 -0
- package/lib/types/ink/layout/yoga.js +249 -0
- package/lib/types/ink/line-width-cache.d.ts +9 -0
- package/lib/types/ink/line-width-cache.d.ts.map +1 -0
- package/lib/types/ink/line-width-cache.js +45 -0
- package/lib/types/ink/log-update.d.ts +57 -0
- package/lib/types/ink/log-update.d.ts.map +1 -0
- package/lib/types/ink/log-update.js +710 -0
- package/lib/types/ink/measure-element.d.ts +19 -0
- package/lib/types/ink/measure-element.d.ts.map +1 -0
- package/lib/types/ink/measure-element.js +10 -0
- package/lib/types/ink/measure-text.d.ts +13 -0
- package/lib/types/ink/measure-text.d.ts.map +1 -0
- package/lib/types/ink/measure-text.js +38 -0
- package/lib/types/ink/node-cache.d.ts +33 -0
- package/lib/types/ink/node-cache.d.ts.map +1 -0
- package/lib/types/ink/node-cache.js +42 -0
- package/lib/types/ink/optimizer.d.ts +18 -0
- package/lib/types/ink/optimizer.d.ts.map +1 -0
- package/lib/types/ink/optimizer.js +83 -0
- package/lib/types/ink/output.d.ts +200 -0
- package/lib/types/ink/output.d.ts.map +1 -0
- package/lib/types/ink/output.js +663 -0
- package/lib/types/ink/parse-keypress.d.ts +132 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -0
- package/lib/types/ink/parse-keypress.js +707 -0
- package/lib/types/ink/reconciler.d.ts +43 -0
- package/lib/types/ink/reconciler.d.ts.map +1 -0
- package/lib/types/ink/reconciler.js +413 -0
- package/lib/types/ink/render-border.d.ts +36 -0
- package/lib/types/ink/render-border.d.ts.map +1 -0
- package/lib/types/ink/render-border.js +143 -0
- package/lib/types/ink/render-node-to-output.d.ts +93 -0
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -0
- package/lib/types/ink/render-node-to-output.js +1290 -0
- package/lib/types/ink/render-to-screen.d.ts +65 -0
- package/lib/types/ink/render-to-screen.d.ts.map +1 -0
- package/lib/types/ink/render-to-screen.js +189 -0
- package/lib/types/ink/renderer.d.ts +24 -0
- package/lib/types/ink/renderer.d.ts.map +1 -0
- package/lib/types/ink/renderer.js +136 -0
- package/lib/types/ink/root.d.ts +91 -0
- package/lib/types/ink/root.d.ts.map +1 -0
- package/lib/types/ink/root.js +93 -0
- package/lib/types/ink/screen.d.ts +443 -0
- package/lib/types/ink/screen.d.ts.map +1 -0
- package/lib/types/ink/screen.js +1295 -0
- package/lib/types/ink/searchHighlight.d.ts +25 -0
- package/lib/types/ink/searchHighlight.d.ts.map +1 -0
- package/lib/types/ink/searchHighlight.js +82 -0
- package/lib/types/ink/selection.d.ts +323 -0
- package/lib/types/ink/selection.d.ts.map +1 -0
- package/lib/types/ink/selection.js +881 -0
- package/lib/types/ink/squash-text-nodes.d.ts +30 -0
- package/lib/types/ink/squash-text-nodes.d.ts.map +1 -0
- package/lib/types/ink/squash-text-nodes.js +63 -0
- package/lib/types/ink/stringWidth.d.ts +11 -0
- package/lib/types/ink/stringWidth.d.ts.map +1 -0
- package/lib/types/ink/stringWidth.js +209 -0
- package/lib/types/ink/styles.d.ts +324 -0
- package/lib/types/ink/styles.d.ts.map +1 -0
- package/lib/types/ink/styles.js +307 -0
- package/lib/types/ink/supports-hyperlinks.d.ts +20 -0
- package/lib/types/ink/supports-hyperlinks.d.ts.map +1 -0
- package/lib/types/ink/supports-hyperlinks.js +44 -0
- package/lib/types/ink/tabstops.d.ts +9 -0
- package/lib/types/ink/tabstops.d.ts.map +1 -0
- package/lib/types/ink/tabstops.js +46 -0
- package/lib/types/ink/terminal-focus-state.d.ts +35 -0
- package/lib/types/ink/terminal-focus-state.d.ts.map +1 -0
- package/lib/types/ink/terminal-focus-state.js +57 -0
- package/lib/types/ink/terminal-querier.d.ts +161 -0
- package/lib/types/ink/terminal-querier.d.ts.map +1 -0
- package/lib/types/ink/terminal-querier.js +204 -0
- package/lib/types/ink/terminal.d.ts +80 -0
- package/lib/types/ink/terminal.d.ts.map +1 -0
- package/lib/types/ink/terminal.js +268 -0
- package/lib/types/ink/termio/ansi.d.ts +75 -0
- package/lib/types/ink/termio/ansi.d.ts.map +1 -0
- package/lib/types/ink/termio/ansi.js +79 -0
- package/lib/types/ink/termio/csi.d.ts +253 -0
- package/lib/types/ink/termio/csi.d.ts.map +1 -0
- package/lib/types/ink/termio/csi.js +347 -0
- package/lib/types/ink/termio/dec.d.ts +61 -0
- package/lib/types/ink/termio/dec.d.ts.map +1 -0
- package/lib/types/ink/termio/dec.js +76 -0
- package/lib/types/ink/termio/esc.d.ts +15 -0
- package/lib/types/ink/termio/esc.d.ts.map +1 -0
- package/lib/types/ink/termio/esc.js +57 -0
- package/lib/types/ink/termio/osc.d.ts +208 -0
- package/lib/types/ink/termio/osc.d.ts.map +1 -0
- package/lib/types/ink/termio/osc.js +466 -0
- package/lib/types/ink/termio/parser.d.ts +46 -0
- package/lib/types/ink/termio/parser.d.ts.map +1 -0
- package/lib/types/ink/termio/parser.js +366 -0
- package/lib/types/ink/termio/sgr.d.ts +17 -0
- package/lib/types/ink/termio/sgr.d.ts.map +1 -0
- package/lib/types/ink/termio/sgr.js +300 -0
- package/lib/types/ink/termio/tokenize.d.ts +50 -0
- package/lib/types/ink/termio/tokenize.d.ts.map +1 -0
- package/lib/types/ink/termio/tokenize.js +266 -0
- package/lib/types/ink/termio/types.d.ts +211 -0
- package/lib/types/ink/termio/types.d.ts.map +1 -0
- package/lib/types/ink/termio/types.js +68 -0
- package/lib/types/ink/termio.d.ts +25 -0
- package/lib/types/ink/termio.d.ts.map +1 -0
- package/lib/types/ink/termio.js +24 -0
- package/lib/types/ink/truncateToWidth.d.ts +7 -0
- package/lib/types/ink/truncateToWidth.d.ts.map +1 -0
- package/lib/types/ink/truncateToWidth.js +18 -0
- package/lib/types/ink/useTerminalNotification.d.ts +45 -0
- package/lib/types/ink/useTerminalNotification.d.ts.map +1 -0
- package/lib/types/ink/useTerminalNotification.js +70 -0
- package/lib/types/ink/warn.d.ts +7 -0
- package/lib/types/ink/warn.d.ts.map +1 -0
- package/lib/types/ink/warn.js +15 -0
- package/lib/types/ink/widest-line.d.ts +7 -0
- package/lib/types/ink/widest-line.d.ts.map +1 -0
- package/lib/types/ink/widest-line.js +19 -0
- package/lib/types/ink/wrap-text.d.ts +10 -0
- package/lib/types/ink/wrap-text.d.ts.map +1 -0
- package/lib/types/ink/wrap-text.js +61 -0
- package/lib/types/ink/wrapAnsi.d.ts +18 -0
- package/lib/types/ink/wrapAnsi.d.ts.map +1 -0
- package/lib/types/ink/wrapAnsi.js +16 -0
- package/lib/types/invariant.d.ts +20 -0
- package/lib/types/invariant.d.ts.map +1 -0
- package/lib/types/invariant.js +26 -0
- package/lib/types/modelPrefs.d.ts +37 -0
- package/lib/types/modelPrefs.d.ts.map +1 -0
- package/lib/types/modelPrefs.js +66 -0
- package/lib/types/modelRoute.d.ts +79 -0
- package/lib/types/modelRoute.d.ts.map +1 -0
- package/lib/types/modelRoute.js +96 -0
- package/lib/types/native-ts/yoga-layout/enums.d.ts +183 -0
- package/lib/types/native-ts/yoga-layout/enums.d.ts.map +1 -0
- package/lib/types/native-ts/yoga-layout/enums.js +150 -0
- package/lib/types/native-ts/yoga-layout/index.d.ts +788 -0
- package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -0
- package/lib/types/native-ts/yoga-layout/index.js +2571 -0
- package/lib/types/packaged-skills.d.ts +10 -0
- package/lib/types/packaged-skills.d.ts.map +1 -0
- package/lib/types/packaged-skills.js +63 -0
- package/lib/types/plugin.d.ts +33 -0
- package/lib/types/plugin.d.ts.map +1 -0
- package/lib/types/plugin.js +454 -0
- package/lib/types/presetPrefs.d.ts +29 -0
- package/lib/types/presetPrefs.d.ts.map +1 -0
- package/lib/types/presetPrefs.js +61 -0
- package/lib/types/presets.d.ts +110 -0
- package/lib/types/presets.d.ts.map +1 -0
- package/lib/types/presets.js +114 -0
- package/lib/types/questions.d.ts +97 -0
- package/lib/types/questions.d.ts.map +1 -0
- package/lib/types/questions.js +201 -0
- package/lib/types/screens/Chat.d.ts +23 -0
- package/lib/types/screens/Chat.d.ts.map +1 -0
- package/lib/types/screens/Chat.js +1263 -0
- package/lib/types/screens/StatusLine.d.ts +16 -0
- package/lib/types/screens/StatusLine.d.ts.map +1 -0
- package/lib/types/screens/StatusLine.js +105 -0
- package/lib/types/screens/StatusMetrics.d.ts +87 -0
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -0
- package/lib/types/screens/StatusMetrics.js +252 -0
- package/lib/types/sessionHistory.d.ts +32 -0
- package/lib/types/sessionHistory.d.ts.map +1 -0
- package/lib/types/sessionHistory.js +87 -0
- package/lib/types/theme.d.ts +115 -0
- package/lib/types/theme.d.ts.map +1 -0
- package/lib/types/theme.js +300 -0
- package/lib/types/themePrefs.d.ts +28 -0
- package/lib/types/themePrefs.d.ts.map +1 -0
- package/lib/types/themePrefs.js +59 -0
- package/lib/types/ui.d.ts +28 -0
- package/lib/types/ui.d.ts.map +1 -0
- package/lib/types/ui.js +25 -0
- package/lib/types/update.d.ts +76 -0
- package/lib/types/update.d.ts.map +1 -0
- package/lib/types/update.js +203 -0
- package/lib/types/utils/clipboard.d.ts +43 -0
- package/lib/types/utils/clipboard.d.ts.map +1 -0
- package/lib/types/utils/clipboard.js +82 -0
- package/lib/types/utils/debug.d.ts +8 -0
- package/lib/types/utils/debug.d.ts.map +1 -0
- package/lib/types/utils/debug.js +12 -0
- package/lib/types/utils/earlyInput.d.ts +7 -0
- package/lib/types/utils/earlyInput.d.ts.map +1 -0
- package/lib/types/utils/earlyInput.js +6 -0
- package/lib/types/utils/env.d.ts +10 -0
- package/lib/types/utils/env.d.ts.map +1 -0
- package/lib/types/utils/env.js +9 -0
- package/lib/types/utils/envUtils.d.ts +8 -0
- package/lib/types/utils/envUtils.d.ts.map +1 -0
- package/lib/types/utils/envUtils.js +13 -0
- package/lib/types/utils/execFileNoThrow.d.ts +34 -0
- package/lib/types/utils/execFileNoThrow.d.ts.map +1 -0
- package/lib/types/utils/execFileNoThrow.js +31 -0
- package/lib/types/utils/fullscreen.d.ts +8 -0
- package/lib/types/utils/fullscreen.d.ts.map +1 -0
- package/lib/types/utils/fullscreen.js +10 -0
- package/lib/types/utils/intl.d.ts +7 -0
- package/lib/types/utils/intl.d.ts.map +1 -0
- package/lib/types/utils/intl.js +9 -0
- package/lib/types/utils/loaded-context.d.ts +20 -0
- package/lib/types/utils/loaded-context.d.ts.map +1 -0
- package/lib/types/utils/loaded-context.js +36 -0
- package/lib/types/utils/log.d.ts +7 -0
- package/lib/types/utils/log.d.ts.map +1 -0
- package/lib/types/utils/log.js +9 -0
- package/lib/types/utils/mentions.d.ts +30 -0
- package/lib/types/utils/mentions.d.ts.map +1 -0
- package/lib/types/utils/mentions.js +72 -0
- package/lib/types/utils/narration.d.ts +11 -0
- package/lib/types/utils/narration.d.ts.map +1 -0
- package/lib/types/utils/narration.js +16 -0
- package/lib/types/utils/semver.d.ts +9 -0
- package/lib/types/utils/semver.d.ts.map +1 -0
- package/lib/types/utils/semver.js +24 -0
- package/lib/types/utils/sliceAnsi.d.ts +12 -0
- package/lib/types/utils/sliceAnsi.d.ts.map +1 -0
- package/lib/types/utils/sliceAnsi.js +79 -0
- package/lib/types/working-activity.d.ts +19 -0
- package/lib/types/working-activity.d.ts.map +1 -0
- package/lib/types/working-activity.js +18 -0
- package/package.json +141 -0
- package/skills/audit/SKILL.md +24 -0
- package/skills/bug/SKILL.md +27 -0
- package/skills/pr-comments/SKILL.md +20 -0
- package/skills/practice/SKILL.md +22 -0
- package/skills/release-notes/SKILL.md +25 -0
- package/skills/review/SKILL.md +25 -0
- package/skills/vuln-check/SKILL.md +25 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Status = 'success' | 'error' | 'warning' | 'info' | 'pending' | 'loading';
|
|
3
|
+
/**
|
|
4
|
+
* A status indicator icon with the CC color mapping (ported from the leak's
|
|
5
|
+
* design-system/StatusIcon.tsx): ✓ green / ✗ red / ⚠ amber / ℹ blue /
|
|
6
|
+
* ○ dim / … dim.
|
|
7
|
+
*/
|
|
8
|
+
export declare function StatusIcon({ status, withSpace, }: {
|
|
9
|
+
/** The status to display; determines both the icon and color. */
|
|
10
|
+
status: Status;
|
|
11
|
+
/** Include a trailing space after the icon. Useful when followed by text. */
|
|
12
|
+
withSpace?: boolean;
|
|
13
|
+
}): React.ReactNode;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=StatusIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/StatusIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,KAAK,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;AAc9E;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,SAAiB,GAClB,EAAE;IACD,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAA;IACd,6EAA6E;IAC7E,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,KAAK,CAAC,SAAS,CAQlB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import figures from 'figures';
|
|
3
|
+
import Text from '../../ink/components/Text.js';
|
|
4
|
+
const STATUS_CONFIG = {
|
|
5
|
+
success: { icon: figures.tick, color: 'success' },
|
|
6
|
+
error: { icon: figures.cross, color: 'error' },
|
|
7
|
+
warning: { icon: figures.warning, color: 'warning' },
|
|
8
|
+
info: { icon: figures.info, color: 'suggestion' },
|
|
9
|
+
pending: { icon: figures.circle, color: undefined },
|
|
10
|
+
loading: { icon: '…', color: undefined },
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A status indicator icon with the CC color mapping (ported from the leak's
|
|
14
|
+
* design-system/StatusIcon.tsx): ✓ green / ✗ red / ⚠ amber / ℹ blue /
|
|
15
|
+
* ○ dim / … dim.
|
|
16
|
+
*/
|
|
17
|
+
export function StatusIcon({ status, withSpace = false, }) {
|
|
18
|
+
const config = STATUS_CONFIG[status];
|
|
19
|
+
return (_jsxs(Text, { color: config.color, children: [config.icon, withSpace ? ' ' : ''] }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function ThemeProvider({ children, theme, }: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
theme?: string;
|
|
5
|
+
}): React.ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the active theme name and the runtime setter. Returns
|
|
8
|
+
* `[themeName, setTheme]` — the first element matches the leak's shape.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useTheme(): [string, (name: string) => boolean];
|
|
11
|
+
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAA;AAsE7E,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,CAgFlB;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAG9D"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { createContext, useContext, useEffect, useState } from 'react';
|
|
3
|
+
import { registerCustomThemeResolver, setActiveThemeName } from '../../theme.js';
|
|
4
|
+
import { isThemeAvailable, resolveCustomTheme } from '../../customTheme.js';
|
|
5
|
+
import { readThemePref, writeThemePref } from '../../themePrefs.js';
|
|
6
|
+
import useStdin from '../../ink/hooks/use-stdin.js';
|
|
7
|
+
import { oscColor } from '../../ink/terminal-querier.js';
|
|
8
|
+
import { parseOscColor } from '../../ink/termio/osc.js';
|
|
9
|
+
import { logForDebugging } from '../../utils/debug.js';
|
|
10
|
+
/**
|
|
11
|
+
* Theme provider with terminal-background auto-detection. With no explicit
|
|
12
|
+
* `theme` prop, no CC_TUI_THEME override and no persisted choice
|
|
13
|
+
* (~/.dsh-cc/theme.json), it queries the terminal's background color
|
|
14
|
+
* (OSC 11) before first paint and picks the Gentle Mist Blue `light` palette
|
|
15
|
+
* on light backgrounds, `dark` otherwise. Priority: explicit `theme` prop >
|
|
16
|
+
* CC_TUI_THEME (built-in or user theme name) > persisted `/theme` choice >
|
|
17
|
+
* OSC 11 detection. An invalid forced name is warned and skipped, so
|
|
18
|
+
* detection still runs. Children render only after the theme settles, so
|
|
19
|
+
* the first frame already carries the final palette — no dark→light flash.
|
|
20
|
+
* Detection never blocks boot: a terminal that ignores OSC 11 (or a 400ms
|
|
21
|
+
* stall) falls back to `dark`. The resolved name is mirrored via
|
|
22
|
+
* setActiveThemeName() for non-React rendering (markdown inline code).
|
|
23
|
+
*
|
|
24
|
+
* The context also exposes setTheme() for the runtime `/theme` picker: it
|
|
25
|
+
* validates the name, persists the choice to ~/.dsh-cc/theme.json and hot
|
|
26
|
+
* swaps the palette (and the module-level mirror) immediately.
|
|
27
|
+
*/
|
|
28
|
+
// User themes (~/.dsh-cc/themes/<name>.json) resolve through this registry,
|
|
29
|
+
// so getTheme() serves them to every themed component and to non-React
|
|
30
|
+
// rendering (markdown inline code) without a context.
|
|
31
|
+
registerCustomThemeResolver(resolveCustomTheme);
|
|
32
|
+
const ThemeContext = createContext({
|
|
33
|
+
theme: 'dark',
|
|
34
|
+
setTheme: () => false,
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* CC_TUI_THEME skips terminal detection (tests, debugging). Accepts a
|
|
38
|
+
* built-in name (light|dark|dark-ansi) or a user theme name; invalid values
|
|
39
|
+
* are warned and ignored by the caller, falling back to detection.
|
|
40
|
+
*/
|
|
41
|
+
function envThemeOverride() {
|
|
42
|
+
const v = process.env.CC_TUI_THEME;
|
|
43
|
+
return v === undefined || v === '' ? undefined : v;
|
|
44
|
+
}
|
|
45
|
+
/** Detection round-trip is normally ~10ms locally; this only bounds pathological stalls. */
|
|
46
|
+
const DETECT_TIMEOUT_MS = 400;
|
|
47
|
+
/**
|
|
48
|
+
* sRGB luma (Rec. 601). The threshold biases dark: a light palette on a
|
|
49
|
+
* dark terminal is far less readable than the reverse, and the dark
|
|
50
|
+
* palette is the pre-detection status quo.
|
|
51
|
+
*/
|
|
52
|
+
function isLightBackground(r, g, b) {
|
|
53
|
+
return 0.299 * r + 0.587 * g + 0.114 * b > 140;
|
|
54
|
+
}
|
|
55
|
+
export function ThemeProvider({ children, theme, }) {
|
|
56
|
+
// Resolution happens once on mount: the forced chain (prop > env >
|
|
57
|
+
// persisted) or null, which arms OSC 11 detection.
|
|
58
|
+
const [forced] = useState(() => theme ?? envThemeOverride() ?? readThemePref());
|
|
59
|
+
const [forcedValid] = useState(() => {
|
|
60
|
+
if (forced === undefined)
|
|
61
|
+
return false;
|
|
62
|
+
if (isThemeAvailable(forced))
|
|
63
|
+
return true;
|
|
64
|
+
console.warn(`[dsh-tui] theme "${forced}" not found (built-ins: light, dark, dark-ansi; user themes: ~/.dsh-cc/themes/*.json); falling back to auto-detection`);
|
|
65
|
+
return false;
|
|
66
|
+
});
|
|
67
|
+
const [active, setActive] = useState(forcedValid ? forced ?? null : null);
|
|
68
|
+
const { internal_querier, setRawMode, isRawModeSupported } = useStdin();
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (forcedValid)
|
|
71
|
+
return;
|
|
72
|
+
const querier = internal_querier;
|
|
73
|
+
// Stdin responses only flow while raw mode holds the readable listener;
|
|
74
|
+
// without a querier (or raw-mode support) detection is impossible.
|
|
75
|
+
if (querier === null || !isRawModeSupported) {
|
|
76
|
+
logForDebugging('theme: detection unavailable (no querier/raw mode), using dark');
|
|
77
|
+
setActive('dark');
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
let settled = false;
|
|
81
|
+
const finish = (name, why) => {
|
|
82
|
+
if (settled)
|
|
83
|
+
return;
|
|
84
|
+
settled = true;
|
|
85
|
+
clearTimeout(timer);
|
|
86
|
+
setRawMode(false);
|
|
87
|
+
logForDebugging(`theme: ${name} (${why})`);
|
|
88
|
+
setActive(name);
|
|
89
|
+
};
|
|
90
|
+
const timer = setTimeout(() => { finish('dark', 'detection timeout'); }, DETECT_TIMEOUT_MS);
|
|
91
|
+
setRawMode(true);
|
|
92
|
+
void Promise.all([querier.send(oscColor(11)), querier.flush()]).then(([r]) => {
|
|
93
|
+
const color = r ? parseOscColor(r.data) : null;
|
|
94
|
+
if (color === null || color.type !== 'rgb') {
|
|
95
|
+
finish('dark', 'no OSC 11 reply');
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
finish(isLightBackground(color.r, color.g, color.b) ? 'light' : 'dark', `OSC 11 bg rgb(${color.r},${color.g},${color.b})`);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}, []);
|
|
102
|
+
/**
|
|
103
|
+
* Runtime theme switch (/theme picker or direct command). Validates the
|
|
104
|
+
* name, persists first (a choice that cannot be saved never silently
|
|
105
|
+
* disappears), then hot swaps the palette.
|
|
106
|
+
*/
|
|
107
|
+
const setTheme = React.useCallback((name) => {
|
|
108
|
+
if (!isThemeAvailable(name)) {
|
|
109
|
+
console.warn(`[dsh-tui] theme "${name}" not found`);
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (!writeThemePref(name)) {
|
|
113
|
+
console.warn('[dsh-tui] failed to write ~/.dsh-cc/theme.json');
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
setActive(name);
|
|
117
|
+
return true;
|
|
118
|
+
}, []);
|
|
119
|
+
const value = React.useMemo(() => ({ theme: active ?? 'dark', setTheme }), [active, setTheme]);
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (active !== null)
|
|
122
|
+
setActiveThemeName(active);
|
|
123
|
+
}, [active]);
|
|
124
|
+
if (active === null)
|
|
125
|
+
return null;
|
|
126
|
+
return _jsx(ThemeContext.Provider, { value: value, children: children });
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Resolves the active theme name and the runtime setter. Returns
|
|
130
|
+
* `[themeName, setTheme]` — the first element matches the leak's shape.
|
|
131
|
+
*/
|
|
132
|
+
export function useTheme() {
|
|
133
|
+
const { theme, setTheme } = useContext(ThemeContext);
|
|
134
|
+
return [theme, setTheme];
|
|
135
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { type PropsWithChildren, type Ref } from 'react';
|
|
2
|
+
import type { DOMElement } from '../../ink/dom.js';
|
|
3
|
+
import type { ClickEvent } from '../../ink/events/click-event.js';
|
|
4
|
+
import type { FocusEvent } from '../../ink/events/focus-event.js';
|
|
5
|
+
import type { KeyboardEvent } from '../../ink/events/keyboard-event.js';
|
|
6
|
+
import type { Color, Styles } from '../../ink/styles.js';
|
|
7
|
+
import { type Theme } from '../../theme.js';
|
|
8
|
+
type ThemedColorProps = {
|
|
9
|
+
readonly borderColor?: keyof Theme | Color;
|
|
10
|
+
readonly borderTopColor?: keyof Theme | Color;
|
|
11
|
+
readonly borderBottomColor?: keyof Theme | Color;
|
|
12
|
+
readonly borderLeftColor?: keyof Theme | Color;
|
|
13
|
+
readonly borderRightColor?: keyof Theme | Color;
|
|
14
|
+
readonly backgroundColor?: keyof Theme | Color;
|
|
15
|
+
};
|
|
16
|
+
type BaseStylesWithoutColors = Omit<Styles, 'textWrap' | 'borderColor' | 'borderTopColor' | 'borderBottomColor' | 'borderLeftColor' | 'borderRightColor' | 'backgroundColor'>;
|
|
17
|
+
export type Props = BaseStylesWithoutColors & ThemedColorProps & {
|
|
18
|
+
ref?: Ref<DOMElement>;
|
|
19
|
+
tabIndex?: number;
|
|
20
|
+
autoFocus?: boolean;
|
|
21
|
+
onClick?: (event: ClickEvent) => void;
|
|
22
|
+
onFocus?: (event: FocusEvent) => void;
|
|
23
|
+
onFocusCapture?: (event: FocusEvent) => void;
|
|
24
|
+
onBlur?: (event: FocusEvent) => void;
|
|
25
|
+
onBlurCapture?: (event: FocusEvent) => void;
|
|
26
|
+
onKeyDown?: (event: KeyboardEvent) => void;
|
|
27
|
+
onKeyDownCapture?: (event: KeyboardEvent) => void;
|
|
28
|
+
onMouseEnter?: () => void;
|
|
29
|
+
onMouseLeave?: () => void;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Theme-aware Box component that resolves theme color keys to raw colors
|
|
33
|
+
* (ported from the leak's design-system).
|
|
34
|
+
*/
|
|
35
|
+
declare function ThemedBox({ borderColor, borderTopColor, borderBottomColor, borderLeftColor, borderRightColor, backgroundColor, ...rest }: PropsWithChildren<Props>): React.ReactNode;
|
|
36
|
+
export default ThemedBox;
|
|
37
|
+
//# sourceMappingURL=ThemedBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemedBox.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ThemedBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAA;AAE/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AACvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAIrD,KAAK,gBAAgB,GAAG;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,GAAG,KAAK,CAAA;IAC1C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,KAAK,GAAG,KAAK,CAAA;IAC7C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,KAAK,GAAG,KAAK,CAAA;IAChD,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,KAAK,GAAG,KAAK,CAAA;IAC9C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,KAAK,GAAG,KAAK,CAAA;IAC/C,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,KAAK,GAAG,KAAK,CAAA;CAC/C,CAAA;AAGD,KAAK,uBAAuB,GAAG,IAAI,CACjC,MAAM,EACJ,UAAU,GACV,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,CACpB,CAAA;AAED,MAAM,MAAM,KAAK,GAAG,uBAAuB,GACzC,gBAAgB,GAAG;IACjB,GAAG,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IACrC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IACrC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IAC5C,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IACpC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IAC3C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IAC1C,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IACjD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;IACzB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;CAC1B,CAAA;AAmBH;;;GAGG;AACH,iBAAS,SAAS,CAAC,EACjB,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,GAAG,IAAI,EACR,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,SAAS,CAc5C;AACD,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Box from '../../ink/components/Box.js';
|
|
3
|
+
import { getTheme } from '../../theme.js';
|
|
4
|
+
import { useTheme } from './ThemeProvider.js';
|
|
5
|
+
/** Resolves a color value that may be a theme key to a raw Color. */
|
|
6
|
+
function resolveColor(color, theme) {
|
|
7
|
+
if (!color)
|
|
8
|
+
return undefined;
|
|
9
|
+
if (color.startsWith('rgb(') ||
|
|
10
|
+
color.startsWith('#') ||
|
|
11
|
+
color.startsWith('ansi256(') ||
|
|
12
|
+
color.startsWith('ansi:')) {
|
|
13
|
+
return color;
|
|
14
|
+
}
|
|
15
|
+
return theme[color];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Theme-aware Box component that resolves theme color keys to raw colors
|
|
19
|
+
* (ported from the leak's design-system).
|
|
20
|
+
*/
|
|
21
|
+
function ThemedBox({ borderColor, borderTopColor, borderBottomColor, borderLeftColor, borderRightColor, backgroundColor, ...rest }) {
|
|
22
|
+
const [themeName] = useTheme();
|
|
23
|
+
const theme = getTheme(themeName);
|
|
24
|
+
return (_jsx(Box, { ...rest, borderColor: resolveColor(borderColor, theme), borderTopColor: resolveColor(borderTopColor, theme), borderBottomColor: resolveColor(borderBottomColor, theme), borderLeftColor: resolveColor(borderLeftColor, theme), borderRightColor: resolveColor(borderRightColor, theme), backgroundColor: resolveColor(backgroundColor, theme) }));
|
|
25
|
+
}
|
|
26
|
+
export default ThemedBox;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Color, Styles } from '../../ink/styles.js';
|
|
3
|
+
import { type Theme } from '../../theme.js';
|
|
4
|
+
/**
|
|
5
|
+
* Colors uncolored ThemedText in the subtree. Precedence: explicit `color` >
|
|
6
|
+
* this > dimColor (ported from the leak's design-system, where message rows
|
|
7
|
+
* set it to `text` on hover).
|
|
8
|
+
*/
|
|
9
|
+
export declare const TextHoverColorContext: React.Context<keyof Theme | undefined>;
|
|
10
|
+
export type Props = {
|
|
11
|
+
/**
|
|
12
|
+
* Change text color. Accepts a theme key or raw color value.
|
|
13
|
+
*/
|
|
14
|
+
readonly color?: keyof Theme | Color;
|
|
15
|
+
/**
|
|
16
|
+
* Same as `color`, but for background. Must be a theme key.
|
|
17
|
+
*/
|
|
18
|
+
readonly backgroundColor?: keyof Theme;
|
|
19
|
+
/**
|
|
20
|
+
* Dim the color using the theme's inactive color.
|
|
21
|
+
* This is compatible with bold (unlike ANSI dim).
|
|
22
|
+
*/
|
|
23
|
+
readonly dimColor?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Make the text bold.
|
|
26
|
+
*/
|
|
27
|
+
readonly bold?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Make the text italic.
|
|
30
|
+
*/
|
|
31
|
+
readonly italic?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Make the text underlined.
|
|
34
|
+
*/
|
|
35
|
+
readonly underline?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Make the text crossed with a line.
|
|
38
|
+
*/
|
|
39
|
+
readonly strikethrough?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Inverse background and foreground colors.
|
|
42
|
+
*/
|
|
43
|
+
readonly inverse?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* This property tells Ink to wrap or truncate text if its width is larger than container.
|
|
46
|
+
*/
|
|
47
|
+
readonly wrap?: Styles['textWrap'];
|
|
48
|
+
readonly children?: React.ReactNode;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Theme-aware Text component that resolves theme color keys to raw colors
|
|
52
|
+
* (ported from the leak's design-system). This is what lets every ported CC
|
|
53
|
+
* component use `color="subtle"`-style theme keys unchanged.
|
|
54
|
+
*/
|
|
55
|
+
export default function ThemedText({ color, backgroundColor, dimColor, bold, italic, underline, strikethrough, inverse, wrap, children, }: Props): React.ReactNode;
|
|
56
|
+
//# sourceMappingURL=ThemedText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemedText.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ThemedText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAGrD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,wCAEtB,CAAA;AAqBZ,MAAM,MAAM,KAAK,GAAG;IAClB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,GAAG,KAAK,CAAA;IAEpC;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,KAAK,CAAA;IAEtC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAE3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;IAEvB;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IAEzB;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAE5B;;OAEG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;IAEhC;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAE1B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAElC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACpC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,eAAe,EACf,QAAgB,EAChB,IAAY,EACZ,MAAc,EACd,SAAiB,EACjB,aAAqB,EACrB,OAAe,EACf,IAAa,EACb,QAAQ,GACT,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CA8BzB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Text from '../../ink/components/Text.js';
|
|
4
|
+
import { getTheme } from '../../theme.js';
|
|
5
|
+
import { useTheme } from './ThemeProvider.js';
|
|
6
|
+
/**
|
|
7
|
+
* Colors uncolored ThemedText in the subtree. Precedence: explicit `color` >
|
|
8
|
+
* this > dimColor (ported from the leak's design-system, where message rows
|
|
9
|
+
* set it to `text` on hover).
|
|
10
|
+
*/
|
|
11
|
+
export const TextHoverColorContext = React.createContext(undefined);
|
|
12
|
+
/** Resolves a color value that may be a theme key to a raw Color. */
|
|
13
|
+
function resolveColor(color, theme) {
|
|
14
|
+
if (!color)
|
|
15
|
+
return undefined;
|
|
16
|
+
// Check if it's a raw color (starts with rgb(, #, ansi256(, or ansi:)
|
|
17
|
+
if (color.startsWith('rgb(') ||
|
|
18
|
+
color.startsWith('#') ||
|
|
19
|
+
color.startsWith('ansi256(') ||
|
|
20
|
+
color.startsWith('ansi:')) {
|
|
21
|
+
return color;
|
|
22
|
+
}
|
|
23
|
+
// It's a theme key - resolve it
|
|
24
|
+
return theme[color];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Theme-aware Text component that resolves theme color keys to raw colors
|
|
28
|
+
* (ported from the leak's design-system). This is what lets every ported CC
|
|
29
|
+
* component use `color="subtle"`-style theme keys unchanged.
|
|
30
|
+
*/
|
|
31
|
+
export default function ThemedText({ color, backgroundColor, dimColor = false, bold = false, italic = false, underline = false, strikethrough = false, inverse = false, wrap = 'wrap', children, }) {
|
|
32
|
+
const [themeName] = useTheme();
|
|
33
|
+
const theme = getTheme(themeName);
|
|
34
|
+
const hoverColor = React.useContext(TextHoverColorContext);
|
|
35
|
+
// Resolve theme keys to raw colors
|
|
36
|
+
const resolvedColor = !color && hoverColor
|
|
37
|
+
? theme[hoverColor]
|
|
38
|
+
: dimColor
|
|
39
|
+
? theme.inactive
|
|
40
|
+
: resolveColor(color, theme);
|
|
41
|
+
const resolvedBackgroundColor = backgroundColor
|
|
42
|
+
? theme[backgroundColor]
|
|
43
|
+
: undefined;
|
|
44
|
+
return (_jsx(Text, { color: resolvedColor, backgroundColor: resolvedBackgroundColor, bold: bold, italic: italic, underline: underline, strikethrough: strikethrough, inverse: inverse, wrap: wrap, children: children }));
|
|
45
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
text: string;
|
|
4
|
+
/** Adds the top margin between messages (CC: addMargin). */
|
|
5
|
+
addMargin: boolean;
|
|
6
|
+
/** Message-selection mode highlight. */
|
|
7
|
+
isSelected?: boolean;
|
|
8
|
+
/** Row expanded on its own (persistent hover-grey background, CC). */
|
|
9
|
+
isExpanded?: boolean;
|
|
10
|
+
onClick?(): void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Assistant text message: bullet + markdown body (ported from the
|
|
14
|
+
* leak's default branch).
|
|
15
|
+
*/
|
|
16
|
+
export declare function AssistantTextMessage({ text, addMargin, isSelected, isExpanded, onClick, }: Props): React.ReactNode;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=AssistantTextMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssistantTextMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/AssistantTextMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,4DAA4D;IAC5D,SAAS,EAAE,OAAO,CAAA;IAClB,wCAAwC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,sEAAsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,IAAI,IAAI,CAAA;CACjB,CAAA;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,SAAS,EACT,UAAkB,EAClB,UAAkB,EAClB,OAAO,GACR,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CA2BzB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, NoSelect, Text } from '../../ui.js';
|
|
3
|
+
import { BLACK_CIRCLE } from '../../cc/figures.js';
|
|
4
|
+
import { Markdown } from '../Markdown.js';
|
|
5
|
+
/**
|
|
6
|
+
* Assistant text message: bullet + markdown body (ported from the
|
|
7
|
+
* leak's default branch).
|
|
8
|
+
*/
|
|
9
|
+
export function AssistantTextMessage({ text, addMargin, isSelected = false, isExpanded = false, onClick, }) {
|
|
10
|
+
return (_jsx(Box, { alignItems: "flex-start", flexDirection: "row", justifyContent: "space-between", marginTop: addMargin ? 1 : 0, width: "100%", backgroundColor: isSelected
|
|
11
|
+
? 'messageActionsBackground'
|
|
12
|
+
: isExpanded
|
|
13
|
+
? 'userMessageBackgroundHover'
|
|
14
|
+
: undefined, onClick: onClick, children: _jsxs(Box, { flexDirection: "row", children: [_jsx(NoSelect, { fromLeftEdge: true, minWidth: 2, children: _jsx(Text, { color: isSelected ? 'suggestion' : 'text', children: BLACK_CIRCLE }) }), _jsx(Box, { flexDirection: "column", children: _jsx(Markdown, { children: text }) })] }) }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
thinking: string;
|
|
4
|
+
/** Adds the top margin between messages (CC: addMargin). */
|
|
5
|
+
addMargin: boolean;
|
|
6
|
+
/** True when Ctrl+O transcript/verbose mode is on — show the full text. */
|
|
7
|
+
verbose: boolean;
|
|
8
|
+
/** Thinking wall-clock duration once the reasoning block settled (ms). */
|
|
9
|
+
durationMs?: number;
|
|
10
|
+
/** Message-selection mode highlight. */
|
|
11
|
+
isSelected?: boolean;
|
|
12
|
+
onClick?(): void;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Thinking block: folded `∴ Thinking (ctrl+o to expand)`, expanded shows the
|
|
16
|
+
* full reasoning text indented under `∴ Thinking…` (ported from the leak's
|
|
17
|
+
* `messages/AssistantThinkingMessage.tsx`). When the channel records the
|
|
18
|
+
* reasoning duration, the label carries it (`∴ Thinking · 12s …`) — dsh-tui's
|
|
19
|
+
* take on making thinking time visible in the transcript.
|
|
20
|
+
*/
|
|
21
|
+
export declare function AssistantThinkingMessage({ thinking, addMargin, verbose, durationMs, isSelected, onClick, }: Props): React.ReactNode;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=AssistantThinkingMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssistantThinkingMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/AssistantThinkingMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,4DAA4D;IAC5D,SAAS,EAAE,OAAO,CAAA;IAClB,2EAA2E;IAC3E,OAAO,EAAE,OAAO,CAAA;IAChB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,wCAAwC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,IAAI,IAAI,CAAA;CACjB,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,UAAkB,EAClB,OAAO,GACR,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CA0CzB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from '../../ui.js';
|
|
3
|
+
import { KeyboardShortcutHint } from '../design-system/KeyboardShortcutHint.js';
|
|
4
|
+
import { Markdown } from '../Markdown.js';
|
|
5
|
+
import { formatDuration } from '../../cc/format.js';
|
|
6
|
+
/**
|
|
7
|
+
* Thinking block: folded `∴ Thinking (ctrl+o to expand)`, expanded shows the
|
|
8
|
+
* full reasoning text indented under `∴ Thinking…` (ported from the leak's
|
|
9
|
+
* `messages/AssistantThinkingMessage.tsx`). When the channel records the
|
|
10
|
+
* reasoning duration, the label carries it (`∴ Thinking · 12s …`) — dsh-tui's
|
|
11
|
+
* take on making thinking time visible in the transcript.
|
|
12
|
+
*/
|
|
13
|
+
export function AssistantThinkingMessage({ thinking, addMargin, verbose, durationMs, isSelected = false, onClick, }) {
|
|
14
|
+
if (!thinking)
|
|
15
|
+
return null;
|
|
16
|
+
const duration = durationMs !== undefined && durationMs >= 1000
|
|
17
|
+
? ` · ${formatDuration(durationMs)}`
|
|
18
|
+
: '';
|
|
19
|
+
if (!verbose) {
|
|
20
|
+
return (_jsx(Box, { marginTop: addMargin ? 1 : 0, backgroundColor: isSelected ? 'messageActionsBackground' : undefined, onClick: onClick, children: _jsxs(Text, { dimColor: true, italic: true, children: ["\u2234 Thinking", duration, ' ', _jsx(Text, { dimColor: true, children: _jsx(KeyboardShortcutHint, { shortcut: "ctrl+o", action: "expand", parens: true }) })] }) }));
|
|
21
|
+
}
|
|
22
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 1, marginTop: addMargin ? 1 : 0, width: "100%", backgroundColor: isSelected ? 'messageActionsBackground' : undefined, onClick: onClick, children: [_jsxs(Text, { dimColor: true, italic: true, children: ["\u2234 Thinking", duration, "\u2026"] }), _jsx(Box, { paddingLeft: 2, children: _jsx(Markdown, { dimColor: true, children: thinking }) })] }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ToolRow } from '../../channel.js';
|
|
3
|
+
type Props = {
|
|
4
|
+
tool: ToolRow;
|
|
5
|
+
/** Adds the top margin between messages (CC: addMargin). */
|
|
6
|
+
addMargin: boolean;
|
|
7
|
+
/** Ctrl+O verbose: show full args/result instead of previews. */
|
|
8
|
+
verbose: boolean;
|
|
9
|
+
/** Message-selection mode highlight. */
|
|
10
|
+
isSelected?: boolean;
|
|
11
|
+
/** Row expanded on its own (persistent hover-grey background, CC). */
|
|
12
|
+
isExpanded?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Tool-call card: `● Edit /path` header with a blinking status dot, then the
|
|
16
|
+
* structured body under a ` ⎿ ` gutter — diff hunks in red/green, terminal
|
|
17
|
+
* output, read content — instead of the raw result dump (ported from the
|
|
18
|
+
* leak's `AssistantToolUseMessage.tsx` + the dsh-tools presentation views the
|
|
19
|
+
* channel captures per call).
|
|
20
|
+
*/
|
|
21
|
+
export declare function AssistantToolUseMessage({ tool, addMargin, verbose, isSelected, isExpanded, }: Props): React.ReactNode;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=AssistantToolUseMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssistantToolUseMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/AssistantToolUseMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAA8C,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAI3F,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,OAAO,CAAA;IACb,4DAA4D;IAC5D,SAAS,EAAE,OAAO,CAAA;IAClB,iEAAiE;IACjE,OAAO,EAAE,OAAO,CAAA;IAChB,wCAAwC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,sEAAsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAqMD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,SAAS,EACT,OAAO,EACP,UAAkB,EAClB,UAAkB,GACnB,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CAkGzB"}
|