@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,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spinner animation utilities, ported from the leaked Claude Code source
|
|
3
|
+
* (`src/components/Spinner/utils.ts`).
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The platform-appropriate default spinner character set.
|
|
7
|
+
* @returns The spinner frame characters for the current terminal/platform.
|
|
8
|
+
*/
|
|
9
|
+
export function getDefaultCharacters() {
|
|
10
|
+
if (process.env.TERM === 'xterm-ghostty') {
|
|
11
|
+
return ['·', '✢', '✳', '✶', '✻', '*'];
|
|
12
|
+
}
|
|
13
|
+
return process.platform === 'darwin'
|
|
14
|
+
? ['·', '✢', '✳', '✶', '✻', '✽']
|
|
15
|
+
: ['·', '✢', '*', '✶', '✻', '✽'];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Interpolate between two RGB colors.
|
|
19
|
+
* @param color1 - Start color.
|
|
20
|
+
* @param color2 - End color.
|
|
21
|
+
* @param t - Interpolation factor, 0 to 1.
|
|
22
|
+
* @returns The interpolated color, components rounded to integers.
|
|
23
|
+
*/
|
|
24
|
+
export function interpolateColor(color1, color2, t) {
|
|
25
|
+
return {
|
|
26
|
+
r: Math.round(color1.r + (color2.r - color1.r) * t),
|
|
27
|
+
g: Math.round(color1.g + (color2.g - color1.g) * t),
|
|
28
|
+
b: Math.round(color1.b + (color2.b - color1.b) * t),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Convert an RGB object to an `rgb()` color string for the Text component.
|
|
33
|
+
* @param color - The RGB color to format.
|
|
34
|
+
* @returns The `rgb(r,g,b)` string.
|
|
35
|
+
*/
|
|
36
|
+
export function toRGBColor(color) {
|
|
37
|
+
return `rgb(${color.r},${color.g},${color.b})`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Convert an HSL hue to RGB, using voice-mode waveform parameters (s=0.7, l=0.6).
|
|
41
|
+
* @param hue - Hue in degrees (0–360; wrapped into range).
|
|
42
|
+
* @returns The RGB color for the hue.
|
|
43
|
+
*/
|
|
44
|
+
export function hueToRgb(hue) {
|
|
45
|
+
const h = ((hue % 360) + 360) % 360;
|
|
46
|
+
const s = 0.7;
|
|
47
|
+
const l = 0.6;
|
|
48
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
49
|
+
const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
|
|
50
|
+
const m = l - c / 2;
|
|
51
|
+
let r = 0;
|
|
52
|
+
let g = 0;
|
|
53
|
+
let b = 0;
|
|
54
|
+
if (h < 60) {
|
|
55
|
+
r = c;
|
|
56
|
+
g = x;
|
|
57
|
+
}
|
|
58
|
+
else if (h < 120) {
|
|
59
|
+
r = x;
|
|
60
|
+
g = c;
|
|
61
|
+
}
|
|
62
|
+
else if (h < 180) {
|
|
63
|
+
g = c;
|
|
64
|
+
b = x;
|
|
65
|
+
}
|
|
66
|
+
else if (h < 240) {
|
|
67
|
+
g = x;
|
|
68
|
+
b = c;
|
|
69
|
+
}
|
|
70
|
+
else if (h < 300) {
|
|
71
|
+
r = x;
|
|
72
|
+
b = c;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
r = c;
|
|
76
|
+
b = x;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
r: Math.round((r + m) * 255),
|
|
80
|
+
g: Math.round((g + m) * 255),
|
|
81
|
+
b: Math.round((b + m) * 255),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const RGB_CACHE = new Map();
|
|
85
|
+
/**
|
|
86
|
+
* Parse an `rgb(r,g,b)` color string, memoized per input.
|
|
87
|
+
* @param colorStr - The color string to parse.
|
|
88
|
+
* @returns The parsed RGB color, or null when the string is not `rgb(r,g,b)`.
|
|
89
|
+
*/
|
|
90
|
+
export function parseRGB(colorStr) {
|
|
91
|
+
const cached = RGB_CACHE.get(colorStr);
|
|
92
|
+
if (cached !== undefined)
|
|
93
|
+
return cached;
|
|
94
|
+
const match = colorStr.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);
|
|
95
|
+
const result = match
|
|
96
|
+
? {
|
|
97
|
+
r: parseInt(match[1], 10),
|
|
98
|
+
g: parseInt(match[2], 10),
|
|
99
|
+
b: parseInt(match[3], 10),
|
|
100
|
+
}
|
|
101
|
+
: null;
|
|
102
|
+
RGB_CACHE.set(colorStr, result);
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks the transition to red when tokens stop flowing (ported from the
|
|
3
|
+
* leak's `Spinner/useStalledAnimation.ts`). Driven by the parent's animation
|
|
4
|
+
* clock time instead of independent intervals, so it slows down when the
|
|
5
|
+
* terminal is blurred.
|
|
6
|
+
* @param time - Parent animation clock time in ms.
|
|
7
|
+
* @param currentResponseLength - Chars streamed this turn; growth resets the stall timer.
|
|
8
|
+
* @param hasActiveTools - True while tools are running; tool activity never stalls.
|
|
9
|
+
* @param reducedMotion - True to apply intensity changes instantly instead of smoothing.
|
|
10
|
+
* @returns Whether the response is stalled, plus the 0–1 stalled intensity.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useStalledAnimation(time: number, currentResponseLength: number, hasActiveTools?: boolean, reducedMotion?: boolean): {
|
|
13
|
+
isStalled: boolean;
|
|
14
|
+
stalledIntensity: number;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useStalledAnimation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStalledAnimation.d.ts","sourceRoot":"","sources":["../../../../src/components/Spinner/useStalledAnimation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,qBAAqB,EAAE,MAAM,EAC7B,cAAc,UAAQ,EACtB,aAAa,UAAQ,GACpB;IACD,SAAS,EAAE,OAAO,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CA6DA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Tracks the transition to red when tokens stop flowing (ported from the
|
|
4
|
+
* leak's `Spinner/useStalledAnimation.ts`). Driven by the parent's animation
|
|
5
|
+
* clock time instead of independent intervals, so it slows down when the
|
|
6
|
+
* terminal is blurred.
|
|
7
|
+
* @param time - Parent animation clock time in ms.
|
|
8
|
+
* @param currentResponseLength - Chars streamed this turn; growth resets the stall timer.
|
|
9
|
+
* @param hasActiveTools - True while tools are running; tool activity never stalls.
|
|
10
|
+
* @param reducedMotion - True to apply intensity changes instantly instead of smoothing.
|
|
11
|
+
* @returns Whether the response is stalled, plus the 0–1 stalled intensity.
|
|
12
|
+
*/
|
|
13
|
+
export function useStalledAnimation(time, currentResponseLength, hasActiveTools = false, reducedMotion = false) {
|
|
14
|
+
const lastTokenTime = useRef(time);
|
|
15
|
+
const lastResponseLength = useRef(currentResponseLength);
|
|
16
|
+
const mountTime = useRef(time);
|
|
17
|
+
const stalledIntensityRef = useRef(0);
|
|
18
|
+
const lastSmoothTime = useRef(time);
|
|
19
|
+
// Reset timer when new tokens arrive (check actual length change)
|
|
20
|
+
if (currentResponseLength > lastResponseLength.current) {
|
|
21
|
+
lastTokenTime.current = time;
|
|
22
|
+
lastResponseLength.current = currentResponseLength;
|
|
23
|
+
stalledIntensityRef.current = 0;
|
|
24
|
+
lastSmoothTime.current = time;
|
|
25
|
+
}
|
|
26
|
+
// Derive time since last token from animation clock
|
|
27
|
+
let timeSinceLastToken;
|
|
28
|
+
if (hasActiveTools) {
|
|
29
|
+
timeSinceLastToken = 0;
|
|
30
|
+
lastTokenTime.current = time;
|
|
31
|
+
}
|
|
32
|
+
else if (currentResponseLength > 0) {
|
|
33
|
+
timeSinceLastToken = time - lastTokenTime.current;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
timeSinceLastToken = time - mountTime.current;
|
|
37
|
+
}
|
|
38
|
+
// Calculate stalled intensity based on time since last token
|
|
39
|
+
// Start showing red after 3 seconds of no new tokens (only when no tools are active)
|
|
40
|
+
const isStalled = timeSinceLastToken > 3000 && !hasActiveTools;
|
|
41
|
+
const intensity = isStalled
|
|
42
|
+
? Math.min((timeSinceLastToken - 3000) / 2000, 1) // Fade over 2 seconds
|
|
43
|
+
: 0;
|
|
44
|
+
// Smooth intensity transition driven by animation frame ticks
|
|
45
|
+
if (!reducedMotion && (intensity > 0 || stalledIntensityRef.current > 0)) {
|
|
46
|
+
const dt = time - lastSmoothTime.current;
|
|
47
|
+
if (dt >= 50) {
|
|
48
|
+
const steps = Math.floor(dt / 50);
|
|
49
|
+
let current = stalledIntensityRef.current;
|
|
50
|
+
for (let i = 0; i < steps; i++) {
|
|
51
|
+
const diff = intensity - current;
|
|
52
|
+
if (Math.abs(diff) < 0.01) {
|
|
53
|
+
current = intensity;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
current += diff * 0.1;
|
|
57
|
+
}
|
|
58
|
+
stalledIntensityRef.current = current;
|
|
59
|
+
lastSmoothTime.current = time;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
stalledIntensityRef.current = intensity;
|
|
64
|
+
lastSmoothTime.current = time;
|
|
65
|
+
}
|
|
66
|
+
// When reducedMotion is enabled, use instant intensity change
|
|
67
|
+
const effectiveIntensity = reducedMotion
|
|
68
|
+
? intensity
|
|
69
|
+
: stalledIntensityRef.current;
|
|
70
|
+
return { isStalled, stalledIntensity: effectiveIntensity };
|
|
71
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Renders markdown during streaming by splitting at the last top-level block
|
|
4
|
+
* boundary: everything before is stable (memoized, never re-parsed), only the
|
|
5
|
+
* final block is re-parsed per delta (ported from the leak's
|
|
6
|
+
* `StreamingMarkdown.tsx`). marked.lexer() correctly handles unclosed code
|
|
7
|
+
* fences as a single token, so block boundaries are always safe.
|
|
8
|
+
*/
|
|
9
|
+
export declare function StreamingMarkdown({ children, }: {
|
|
10
|
+
children: string;
|
|
11
|
+
}): React.ReactNode;
|
|
12
|
+
//# sourceMappingURL=StreamingMarkdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreamingMarkdown.d.ts","sourceRoot":"","sources":["../../../src/components/StreamingMarkdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAA;CACjB,GAAG,KAAK,CAAC,SAAS,CAoClB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { marked } from 'marked';
|
|
4
|
+
import Box from '../ink/components/Box.js';
|
|
5
|
+
import { stripPromptXMLTags } from '../cc/markdown.js';
|
|
6
|
+
import { Markdown } from './Markdown.js';
|
|
7
|
+
/**
|
|
8
|
+
* Renders markdown during streaming by splitting at the last top-level block
|
|
9
|
+
* boundary: everything before is stable (memoized, never re-parsed), only the
|
|
10
|
+
* final block is re-parsed per delta (ported from the leak's
|
|
11
|
+
* `StreamingMarkdown.tsx`). marked.lexer() correctly handles unclosed code
|
|
12
|
+
* fences as a single token, so block boundaries are always safe.
|
|
13
|
+
*/
|
|
14
|
+
export function StreamingMarkdown({ children, }) {
|
|
15
|
+
const stablePrefixRef = React.useRef('');
|
|
16
|
+
const stripped = stripPromptXMLTags(children);
|
|
17
|
+
// Reset if text was replaced (defensive; normally unmount handles this)
|
|
18
|
+
if (!stripped.startsWith(stablePrefixRef.current)) {
|
|
19
|
+
stablePrefixRef.current = '';
|
|
20
|
+
}
|
|
21
|
+
// Lex only from current boundary — O(unstable length), not O(full text)
|
|
22
|
+
const boundary = stablePrefixRef.current.length;
|
|
23
|
+
const tokens = marked.lexer(stripped.substring(boundary));
|
|
24
|
+
// Last non-space token is the growing block; everything before is final
|
|
25
|
+
let lastContentIdx = tokens.length - 1;
|
|
26
|
+
while (lastContentIdx >= 0 && tokens[lastContentIdx].type === 'space') {
|
|
27
|
+
lastContentIdx--;
|
|
28
|
+
}
|
|
29
|
+
let advance = 0;
|
|
30
|
+
for (let i = 0; i < lastContentIdx; i++) {
|
|
31
|
+
advance += tokens[i].raw.length;
|
|
32
|
+
}
|
|
33
|
+
if (advance > 0) {
|
|
34
|
+
stablePrefixRef.current = stripped.substring(0, boundary + advance);
|
|
35
|
+
}
|
|
36
|
+
const stablePrefix = stablePrefixRef.current;
|
|
37
|
+
const unstableSuffix = stripped.substring(stablePrefix.length);
|
|
38
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [stablePrefix && _jsx(Markdown, { children: stablePrefix }), unstableSuffix && _jsx(Markdown, { cacheTokens: false, children: unstableSuffix })] }));
|
|
39
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SelectOption } from './Select.js';
|
|
3
|
+
/**
|
|
4
|
+
* The full selectable theme list: the three built-in palettes (display
|
|
5
|
+
* order) followed by discovered user themes from ~/.dsh-cc/themes (sorted
|
|
6
|
+
* by file name). Shared by ThemePicker (render) and the /theme command
|
|
7
|
+
* (focus index), so both always see the same ordering.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getThemeOptions(): SelectOption[];
|
|
10
|
+
/**
|
|
11
|
+
* Color-theme picker in the ActivityPicker style: a permission-colored Pane
|
|
12
|
+
* listing the built-in palettes first, then every user theme found in
|
|
13
|
+
* ~/.dsh-cc/themes — each row shows the display name, its base and three
|
|
14
|
+
* key color swatches; `❯` marks focus, `✓` the active theme. Enter applies
|
|
15
|
+
* through the ThemeProvider setter (persists to ~/.dsh-cc/theme.json and
|
|
16
|
+
* hot swaps), Esc cancels.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ThemePicker({ focusIndex, currentTheme, }: {
|
|
19
|
+
focusIndex: number;
|
|
20
|
+
currentTheme: string | undefined;
|
|
21
|
+
}): React.ReactNode;
|
|
22
|
+
//# sourceMappingURL=ThemePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemePicker.d.ts","sourceRoot":"","sources":["../../../src/components/ThemePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAwCvD;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,YAAY,EAAE,CAchD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,UAAU,EACV,YAAY,GACb,EAAE;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC,GAAG,KAAK,CAAC,SAAS,CAyBlB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { t } from '../i18n.js';
|
|
4
|
+
import { Box, Text } from '../ui.js';
|
|
5
|
+
import { Pane } from './design-system/Pane.js';
|
|
6
|
+
import { Select } from './Select.js';
|
|
7
|
+
import { Byline } from './design-system/Byline.js';
|
|
8
|
+
import { KeyboardShortcutHint } from './design-system/KeyboardShortcutHint.js';
|
|
9
|
+
import { getTheme, THEME_NAMES } from '../theme.js';
|
|
10
|
+
import { buildTheme, listCustomThemes } from '../customTheme.js';
|
|
11
|
+
/** One double-block swatch character per preview key, in a row. */
|
|
12
|
+
const SWATCH = '██';
|
|
13
|
+
/** Theme keys previewed in the picker, chosen for visual contrast. */
|
|
14
|
+
const SWATCH_KEYS = ['claude', 'text', 'success'];
|
|
15
|
+
function swatches(theme) {
|
|
16
|
+
return (_jsx(_Fragment, { children: SWATCH_KEYS.map(key => (_jsx(Text, { color: theme[key], children: SWATCH }, key))) }));
|
|
17
|
+
}
|
|
18
|
+
/** A picker row: display name + color swatches. */
|
|
19
|
+
function optionFor(name, displayName, theme, description) {
|
|
20
|
+
return {
|
|
21
|
+
value: name,
|
|
22
|
+
label: (_jsxs(_Fragment, { children: [displayName, ' ', swatches(theme)] })),
|
|
23
|
+
description,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The full selectable theme list: the three built-in palettes (display
|
|
28
|
+
* order) followed by discovered user themes from ~/.dsh-cc/themes (sorted
|
|
29
|
+
* by file name). Shared by ThemePicker (render) and the /theme command
|
|
30
|
+
* (focus index), so both always see the same ordering.
|
|
31
|
+
*/
|
|
32
|
+
export function getThemeOptions() {
|
|
33
|
+
const builtins = THEME_NAMES.map(name => {
|
|
34
|
+
const theme = getTheme(name);
|
|
35
|
+
return optionFor(name, name, theme, t('theme-builtin-base', { name }));
|
|
36
|
+
});
|
|
37
|
+
const custom = listCustomThemes().map(spec => optionFor(spec.name, spec.displayName, buildTheme(spec), t('theme-user-base', { base: spec.base, name: spec.name })));
|
|
38
|
+
return [...builtins, ...custom];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Color-theme picker in the ActivityPicker style: a permission-colored Pane
|
|
42
|
+
* listing the built-in palettes first, then every user theme found in
|
|
43
|
+
* ~/.dsh-cc/themes — each row shows the display name, its base and three
|
|
44
|
+
* key color swatches; `❯` marks focus, `✓` the active theme. Enter applies
|
|
45
|
+
* through the ThemeProvider setter (persists to ~/.dsh-cc/theme.json and
|
|
46
|
+
* hot swaps), Esc cancels.
|
|
47
|
+
*/
|
|
48
|
+
export function ThemePicker({ focusIndex, currentTheme, }) {
|
|
49
|
+
const options = React.useMemo(() => getThemeOptions(), []);
|
|
50
|
+
return (_jsx(Pane, { color: "permission", children: _jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: "Color theme" }) }), _jsx(Select, { options: options, focusIndex: focusIndex, selectedValue: currentTheme, visibleOptionCount: 6 }), _jsx(Text, { dimColor: true, italic: true, children: _jsxs(Byline, { children: [_jsx(KeyboardShortcutHint, { shortcut: "Enter", action: "confirm", bold: true }), _jsx(KeyboardShortcutHint, { shortcut: "Esc", action: "exit" })] }) })] }) }));
|
|
51
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The `/thinking` dialog, ported from the leak's ThinkingToggle.tsx: a
|
|
4
|
+
* permission-colored Pane with a bold title, the Enabled/Disabled select
|
|
5
|
+
* (with CC's option descriptions), and the Enter/Esc hint line.
|
|
6
|
+
*
|
|
7
|
+
* When `confirmationPending` is set (mid-conversation toggle), the select is
|
|
8
|
+
* replaced by CC's yellow warning block and the hint line becomes
|
|
9
|
+
* Enter confirm / Esc cancel; keyboard handling lives in the caller (Chat).
|
|
10
|
+
*/
|
|
11
|
+
export declare function ThinkingToggle({ currentValue, focusIndex, confirmationPending, }: {
|
|
12
|
+
currentValue: boolean;
|
|
13
|
+
focusIndex: number;
|
|
14
|
+
/** Set while a mid-conversation toggle awaits Enter confirmation. */
|
|
15
|
+
confirmationPending: boolean | null;
|
|
16
|
+
}): React.ReactNode;
|
|
17
|
+
//# sourceMappingURL=ThinkingToggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThinkingToggle.d.ts","sourceRoot":"","sources":["../../../src/components/ThinkingToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,UAAU,EACV,mBAAmB,GACpB,EAAE;IACD,YAAY,EAAE,OAAO,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,qEAAqE;IACrE,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAAA;CACpC,GAAG,KAAK,CAAC,SAAS,CAuDlB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from '../ui.js';
|
|
3
|
+
import { Pane } from './design-system/Pane.js';
|
|
4
|
+
import { Select } from './Select.js';
|
|
5
|
+
import { Byline } from './design-system/Byline.js';
|
|
6
|
+
import { KeyboardShortcutHint } from './design-system/KeyboardShortcutHint.js';
|
|
7
|
+
/**
|
|
8
|
+
* The `/thinking` dialog, ported from the leak's ThinkingToggle.tsx: a
|
|
9
|
+
* permission-colored Pane with a bold title, the Enabled/Disabled select
|
|
10
|
+
* (with CC's option descriptions), and the Enter/Esc hint line.
|
|
11
|
+
*
|
|
12
|
+
* When `confirmationPending` is set (mid-conversation toggle), the select is
|
|
13
|
+
* replaced by CC's yellow warning block and the hint line becomes
|
|
14
|
+
* Enter confirm / Esc cancel; keyboard handling lives in the caller (Chat).
|
|
15
|
+
*/
|
|
16
|
+
export function ThinkingToggle({ currentValue, focusIndex, confirmationPending, }) {
|
|
17
|
+
const options = [
|
|
18
|
+
{
|
|
19
|
+
value: 'true',
|
|
20
|
+
label: 'Enabled',
|
|
21
|
+
description: 'DeepSeek will think before responding',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
value: 'false',
|
|
25
|
+
label: 'Disabled',
|
|
26
|
+
description: 'DeepSeek will respond without extended thinking',
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { marginBottom: 1, flexDirection: "column", children: [_jsx(Text, { color: "remember", bold: true, children: "Toggle thinking mode" }), _jsx(Text, { dimColor: true, children: "Enable or disable thinking for this session." })] }), confirmationPending !== null ? (_jsxs(Box, { flexDirection: "column", marginBottom: 1, gap: 1, children: [_jsx(Text, { color: "warning", children: "Changing thinking mode mid-conversation will increase latency and may reduce quality. For best results, set this at the start of a session." }), _jsx(Text, { color: "warning", children: "Do you want to proceed?" })] })) : (_jsx(Box, { flexDirection: "column", marginBottom: 1, children: _jsx(Select, { options: options, focusIndex: focusIndex, selectedValue: currentValue ? 'true' : 'false', visibleOptionCount: 2 }) }))] }), _jsx(Text, { dimColor: true, italic: true, children: _jsxs(Byline, { children: [_jsx(KeyboardShortcutHint, { shortcut: "Enter", action: "confirm", bold: true }), _jsx(KeyboardShortcutHint, { shortcut: "Esc", action: confirmationPending !== null ? 'cancel' : 'exit' })] }) })] }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
isError: boolean;
|
|
4
|
+
isUnresolved: boolean;
|
|
5
|
+
shouldAnimate: boolean;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The status dot on tool-call rows (ported from the leak's ToolUseLoader):
|
|
9
|
+
* blinking `●` while running, green on success, red on error, dim when queued.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ToolUseLoader({ isError, isUnresolved, shouldAnimate, }: Props): React.ReactNode;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=ToolUseLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolUseLoader.d.ts","sourceRoot":"","sources":["../../../src/components/ToolUseLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa,EAAE,OAAO,CAAA;CACvB,CAAA;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,YAAY,EACZ,aAAa,GACd,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CAezB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Box from '../ink/components/Box.js';
|
|
3
|
+
import Text from '../ink/components/Text.js';
|
|
4
|
+
import { useBlink } from '../hooks/useBlink.js';
|
|
5
|
+
import { BLACK_CIRCLE } from '../cc/figures.js';
|
|
6
|
+
/**
|
|
7
|
+
* The status dot on tool-call rows (ported from the leak's ToolUseLoader):
|
|
8
|
+
* blinking `●` while running, green on success, red on error, dim when queued.
|
|
9
|
+
*/
|
|
10
|
+
export function ToolUseLoader({ isError, isUnresolved, shouldAnimate, }) {
|
|
11
|
+
const [ref, isBlinking] = useBlink(shouldAnimate);
|
|
12
|
+
const color = isUnresolved ? undefined : isError ? 'error' : 'success';
|
|
13
|
+
const char = !shouldAnimate || isBlinking || isError || !isUnresolved
|
|
14
|
+
? BLACK_CIRCLE
|
|
15
|
+
: ' ';
|
|
16
|
+
return (_jsx(Box, { ref: ref, minWidth: 2, children: _jsx(Text, { color: color, dimColor: isUnresolved, children: char }) }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type WhaleFrame } from './whaleFrames.js';
|
|
3
|
+
/**
|
|
4
|
+
* Render a frame to 13 ANSI rows (one per sprite row pair). Consecutive
|
|
5
|
+
* cells sharing one style are run-length encoded; trailing transparent
|
|
6
|
+
* cells are dropped so the rows measure exactly the whale's bounding box.
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderWhaleRows(frame: WhaleFrame): string[];
|
|
9
|
+
/** Index of the `standard` frame — the settled header's static pose. */
|
|
10
|
+
export declare const STANDARD_FRAME_INDEX = 0;
|
|
11
|
+
/**
|
|
12
|
+
* One whale pose as an Ink component: 13 rows × 40 columns, never
|
|
13
|
+
* shrinking. Pass `frameIndex` from OPENING_SEQUENCE while animating, or
|
|
14
|
+
* STANDARD_FRAME_INDEX for the static header whale. `width` pins the box
|
|
15
|
+
* width so the neighbouring text column never shifts when frames widen
|
|
16
|
+
* (the tail-wag frames reach 4 columns further right than standard).
|
|
17
|
+
*/
|
|
18
|
+
export declare function WhaleArt({ frameIndex, width, }: {
|
|
19
|
+
frameIndex?: number;
|
|
20
|
+
width?: number;
|
|
21
|
+
}): React.ReactNode;
|
|
22
|
+
//# sourceMappingURL=Whale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Whale.d.ts","sourceRoot":"","sources":["../../../src/components/Whale.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAyBhE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,CAwC3D;AAKD,wEAAwE;AACxE,eAAO,MAAM,oBAAoB,IAAI,CAAA;AAErC;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACvB,UAAiC,EACjC,KAAK,GACN,EAAE;IACD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,KAAK,CAAC,SAAS,CAWlB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from '../ui.js';
|
|
3
|
+
import { WHALE_FRAMES } from './whaleFrames.js';
|
|
4
|
+
/** Sprite palette: D outline · B body · L belly · W mouth · `.` transparent. */
|
|
5
|
+
const PALETTE = {
|
|
6
|
+
D: [20, 38, 96],
|
|
7
|
+
B: [78, 111, 255],
|
|
8
|
+
L: [190, 225, 255],
|
|
9
|
+
W: [255, 255, 255],
|
|
10
|
+
};
|
|
11
|
+
const fg = (rgb) => `\x1b[38;2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
12
|
+
const bg = (rgb) => `\x1b[48;2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
13
|
+
const RESET = '\x1b[0m';
|
|
14
|
+
/**
|
|
15
|
+
* Render a frame to 13 ANSI rows (one per sprite row pair). Consecutive
|
|
16
|
+
* cells sharing one style are run-length encoded; trailing transparent
|
|
17
|
+
* cells are dropped so the rows measure exactly the whale's bounding box.
|
|
18
|
+
*/
|
|
19
|
+
export function renderWhaleRows(frame) {
|
|
20
|
+
const sprite = frame.rows;
|
|
21
|
+
const rows = [];
|
|
22
|
+
for (let r = 0; r < sprite.length; r += 2) {
|
|
23
|
+
const upper = sprite[r];
|
|
24
|
+
const lower = sprite[r + 1] ?? '';
|
|
25
|
+
let out = '';
|
|
26
|
+
let current = '';
|
|
27
|
+
for (let x = 0; x < upper.length; x++) {
|
|
28
|
+
const up = PALETTE[upper[x]];
|
|
29
|
+
const lo = PALETTE[lower[x]];
|
|
30
|
+
let seq;
|
|
31
|
+
let ch;
|
|
32
|
+
if (up !== undefined && lo !== undefined) {
|
|
33
|
+
seq = fg(up) + bg(lo);
|
|
34
|
+
ch = '▀';
|
|
35
|
+
}
|
|
36
|
+
else if (up !== undefined) {
|
|
37
|
+
seq = fg(up);
|
|
38
|
+
ch = '▀';
|
|
39
|
+
}
|
|
40
|
+
else if (lo !== undefined) {
|
|
41
|
+
seq = fg(lo);
|
|
42
|
+
ch = '▄';
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
seq = '';
|
|
46
|
+
ch = ' ';
|
|
47
|
+
}
|
|
48
|
+
if (seq !== current) {
|
|
49
|
+
out += seq === '' ? RESET : seq;
|
|
50
|
+
current = seq;
|
|
51
|
+
}
|
|
52
|
+
out += ch;
|
|
53
|
+
}
|
|
54
|
+
// Drop the transparent tail (plain spaces paint nothing), then always
|
|
55
|
+
// close the row's style — a row ending on a colored cell would
|
|
56
|
+
// otherwise leak its SGR into the line's remaining padding.
|
|
57
|
+
let row = out.replace(/[ ]+$/, '');
|
|
58
|
+
if (!row.endsWith(RESET))
|
|
59
|
+
row += RESET;
|
|
60
|
+
rows.push(row);
|
|
61
|
+
}
|
|
62
|
+
return rows;
|
|
63
|
+
}
|
|
64
|
+
/** Pre-rendered ANSI rows for every frame, computed once at module load. */
|
|
65
|
+
const RENDERED = WHALE_FRAMES.map(renderWhaleRows);
|
|
66
|
+
/** Index of the `standard` frame — the settled header's static pose. */
|
|
67
|
+
export const STANDARD_FRAME_INDEX = 0;
|
|
68
|
+
/**
|
|
69
|
+
* One whale pose as an Ink component: 13 rows × 40 columns, never
|
|
70
|
+
* shrinking. Pass `frameIndex` from OPENING_SEQUENCE while animating, or
|
|
71
|
+
* STANDARD_FRAME_INDEX for the static header whale. `width` pins the box
|
|
72
|
+
* width so the neighbouring text column never shifts when frames widen
|
|
73
|
+
* (the tail-wag frames reach 4 columns further right than standard).
|
|
74
|
+
*/
|
|
75
|
+
export function WhaleArt({ frameIndex = STANDARD_FRAME_INDEX, width, }) {
|
|
76
|
+
const rows = RENDERED[frameIndex] ?? RENDERED[STANDARD_FRAME_INDEX];
|
|
77
|
+
return (_jsx(Box, { flexDirection: "column", flexShrink: 0, width: width, children: rows.map((row, index) => (_jsx(Text, { wrap: "truncate-end", children: row }, index))) }));
|
|
78
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SpinnerMode } from './Spinner/spinnerMode.js';
|
|
3
|
+
/**
|
|
4
|
+
* The working spinner block shown between the transcript and the prompt
|
|
5
|
+
* input while a turn is in flight. Ported from the leak's `Spinner.tsx`
|
|
6
|
+
* (SpinnerWithVerb path) with the swarm/teammate/effort/tips branches
|
|
7
|
+
* removed; the channel feeds the mode, token count and thinking status.
|
|
8
|
+
*
|
|
9
|
+
* Random verb is picked once per turn (per mount of the spinner).
|
|
10
|
+
*/
|
|
11
|
+
export declare function WorkingSpinner({ mode, hasActiveTools, responseLengthRef, loadingStartTimeRef, totalPausedMsRef, pauseStartTimeRef, thinkingStatus, }: {
|
|
12
|
+
mode: SpinnerMode;
|
|
13
|
+
hasActiveTools: boolean;
|
|
14
|
+
responseLengthRef: React.RefObject<number>;
|
|
15
|
+
loadingStartTimeRef: React.RefObject<number>;
|
|
16
|
+
totalPausedMsRef: React.RefObject<number>;
|
|
17
|
+
pauseStartTimeRef: React.RefObject<number | null>;
|
|
18
|
+
thinkingStatus: 'thinking' | number | null;
|
|
19
|
+
}): React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Tracks thinking status: 'thinking' while the model is streaming reasoning,
|
|
22
|
+
* then the duration in ms for a minimum 2s display (avoids UI jank). Ported
|
|
23
|
+
* from the leak's SpinnerWithVerb effect.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useThinkingStatus(isThinking: boolean): 'thinking' | number | null;
|
|
26
|
+
//# sourceMappingURL=WorkingSpinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkingSpinner.d.ts","sourceRoot":"","sources":["../../../src/components/WorkingSpinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAG1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAK3D;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,GACf,EAAE;IACD,IAAI,EAAE,WAAW,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;IACvB,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IAC1C,mBAAmB,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IAC5C,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IACzC,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IACjD,cAAc,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAAA;CAC3C,GAAG,KAAK,CAAC,SAAS,CA2BlB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,OAAO,GAClB,UAAU,GAAG,MAAM,GAAG,IAAI,CA6C5B"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { useTerminalSize } from '../ink/hooks/use-terminal-size.js';
|
|
4
|
+
import { Box } from '../ui.js';
|
|
5
|
+
import { SpinnerAnimationRow } from './Spinner/SpinnerAnimationRow.js';
|
|
6
|
+
import { SPINNER_VERBS } from '../cc/spinnerVerbs.js';
|
|
7
|
+
import { sample } from 'lodash-es';
|
|
8
|
+
/**
|
|
9
|
+
* The working spinner block shown between the transcript and the prompt
|
|
10
|
+
* input while a turn is in flight. Ported from the leak's `Spinner.tsx`
|
|
11
|
+
* (SpinnerWithVerb path) with the swarm/teammate/effort/tips branches
|
|
12
|
+
* removed; the channel feeds the mode, token count and thinking status.
|
|
13
|
+
*
|
|
14
|
+
* Random verb is picked once per turn (per mount of the spinner).
|
|
15
|
+
*/
|
|
16
|
+
export function WorkingSpinner({ mode, hasActiveTools, responseLengthRef, loadingStartTimeRef, totalPausedMsRef, pauseStartTimeRef, thinkingStatus, }) {
|
|
17
|
+
const { columns } = useTerminalSize();
|
|
18
|
+
// Pick a random verb once per spinner mount (per turn).
|
|
19
|
+
const [randomVerb] = useState(() => sample(SPINNER_VERBS) ?? 'Working');
|
|
20
|
+
const message = `${randomVerb}…`;
|
|
21
|
+
return (_jsx(Box, { flexDirection: "column", width: "100%", alignItems: "flex-start", children: _jsx(SpinnerAnimationRow, { mode: mode, reducedMotion: false, hasActiveTools: hasActiveTools, responseLengthRef: responseLengthRef, message: message, messageColor: "claude", shimmerColor: "claudeShimmer", loadingStartTimeRef: loadingStartTimeRef, totalPausedMsRef: totalPausedMsRef, pauseStartTimeRef: pauseStartTimeRef, spinnerSuffix: null, verbose: true, columns: columns, thinkingStatus: thinkingStatus }) }));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Tracks thinking status: 'thinking' while the model is streaming reasoning,
|
|
25
|
+
* then the duration in ms for a minimum 2s display (avoids UI jank). Ported
|
|
26
|
+
* from the leak's SpinnerWithVerb effect.
|
|
27
|
+
*/
|
|
28
|
+
export function useThinkingStatus(isThinking) {
|
|
29
|
+
const [thinkingStatus, setThinkingStatus] = useState(null);
|
|
30
|
+
const thinkingStartRef = useRef(null);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
let showDurationTimer = null;
|
|
33
|
+
let clearStatusTimer = null;
|
|
34
|
+
if (isThinking) {
|
|
35
|
+
// Started thinking
|
|
36
|
+
if (thinkingStartRef.current === null) {
|
|
37
|
+
thinkingStartRef.current = Date.now();
|
|
38
|
+
setThinkingStatus('thinking');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else if (thinkingStartRef.current !== null) {
|
|
42
|
+
// Stopped thinking - calculate duration and ensure 2s minimum display
|
|
43
|
+
const duration = Date.now() - thinkingStartRef.current;
|
|
44
|
+
const elapsed = Date.now() - thinkingStartRef.current;
|
|
45
|
+
const remainingThinkingTime = Math.max(0, 2000 - elapsed);
|
|
46
|
+
thinkingStartRef.current = null;
|
|
47
|
+
// Show "thinking..." for remaining time if < 2s elapsed, then show duration
|
|
48
|
+
const showDuration = () => {
|
|
49
|
+
setThinkingStatus(duration);
|
|
50
|
+
// Clear after 2s
|
|
51
|
+
clearStatusTimer = setTimeout(() => setThinkingStatus(null), 2000);
|
|
52
|
+
};
|
|
53
|
+
if (remainingThinkingTime > 0) {
|
|
54
|
+
showDurationTimer = setTimeout(showDuration, remainingThinkingTime);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
showDuration();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return () => {
|
|
61
|
+
if (showDurationTimer)
|
|
62
|
+
clearTimeout(showDurationTimer);
|
|
63
|
+
if (clearStatusTimer)
|
|
64
|
+
clearTimeout(clearStatusTimer);
|
|
65
|
+
};
|
|
66
|
+
}, [isThinking]);
|
|
67
|
+
return thinkingStatus;
|
|
68
|
+
}
|