@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
|
+
import type { SessionRecord } from '../sessionHistory.js';
|
|
3
|
+
/**
|
|
4
|
+
* `/resume` session picker in the CC ModelPicker style: a Pane with the
|
|
5
|
+
* recent sessions as Select rows (title + time description, ✓ on the
|
|
6
|
+
* current session), plus the Enter/Esc hint line. Only WINDOW rows render;
|
|
7
|
+
* the window follows the focused row, with `↑ N more` / `↓ N more` markers
|
|
8
|
+
* at the edges.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ResumePicker({ sessions, focusIndex, currentSessionId, }: {
|
|
11
|
+
sessions: readonly SessionRecord[];
|
|
12
|
+
focusIndex: number;
|
|
13
|
+
currentSessionId: string;
|
|
14
|
+
}): React.ReactNode;
|
|
15
|
+
//# sourceMappingURL=ResumePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResumePicker.d.ts","sourceRoot":"","sources":["../../../src/components/ResumePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAsBzD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,UAAU,EACV,gBAAgB,GACjB,EAAE;IACD,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAA;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;CACzB,GAAG,KAAK,CAAC,SAAS,CA8ClB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { ListItem } from './design-system/ListItem.js';
|
|
5
|
+
import { Byline } from './design-system/Byline.js';
|
|
6
|
+
import { KeyboardShortcutHint } from './design-system/KeyboardShortcutHint.js';
|
|
7
|
+
/** Compact timestamp like `Jan 2, 03:04` for the resume list. */
|
|
8
|
+
function formatTimestamp(ms) {
|
|
9
|
+
const date = new Date(ms);
|
|
10
|
+
return date.toLocaleString('en-US', {
|
|
11
|
+
month: 'short',
|
|
12
|
+
day: 'numeric',
|
|
13
|
+
hour: '2-digit',
|
|
14
|
+
minute: '2-digit',
|
|
15
|
+
hour12: false,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/** Visible list window: the picker scrolls instead of dumping every session
|
|
19
|
+
* (long histories would fill the whole screen otherwise). */
|
|
20
|
+
const WINDOW = 8;
|
|
21
|
+
/**
|
|
22
|
+
* `/resume` session picker in the CC ModelPicker style: a Pane with the
|
|
23
|
+
* recent sessions as Select rows (title + time description, ✓ on the
|
|
24
|
+
* current session), plus the Enter/Esc hint line. Only WINDOW rows render;
|
|
25
|
+
* the window follows the focused row, with `↑ N more` / `↓ N more` markers
|
|
26
|
+
* at the edges.
|
|
27
|
+
*/
|
|
28
|
+
export function ResumePicker({ sessions, focusIndex, currentSessionId, }) {
|
|
29
|
+
const start = Math.max(0, Math.min(focusIndex - Math.floor(WINDOW / 2), sessions.length - WINDOW));
|
|
30
|
+
const visible = sessions.slice(start, start + WINDOW);
|
|
31
|
+
const above = start;
|
|
32
|
+
const below = Math.max(0, sessions.length - (start + WINDOW));
|
|
33
|
+
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: "Resume" }) }), above > 0 && (_jsxs(Text, { dimColor: true, italic: true, children: ["\u2191 ", above, " more"] })), visible.map(session => (_jsx(ListItem, { isFocused: session.id === sessions[focusIndex]?.id, isSelected: session.id === currentSessionId, description: formatTimestamp(session.updatedAt), children: session.title || session.id }, session.id))), below > 0 && (_jsxs(Text, { dimColor: true, italic: true, children: ["\u2193 ", below, " more"] }))] }), _jsx(Text, { dimColor: true, italic: true, children: _jsxs(Byline, { children: [_jsx(KeyboardShortcutHint, { shortcut: "Enter", action: "confirm", bold: true }), _jsx(KeyboardShortcutHint, { shortcut: "Esc", action: "exit" })] }) })] }));
|
|
34
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ChatRow } from '../channel.js';
|
|
3
|
+
/**
|
|
4
|
+
* Double-Esc rewind picker (CC's "Double-tap esc to rewind the code and/or
|
|
5
|
+
* conversation to a previous point in time"): lists the user's past messages
|
|
6
|
+
* newest-first; selecting one and confirming rewinds the conversation to
|
|
7
|
+
* that point (the message comes back into the input for re-editing).
|
|
8
|
+
*/
|
|
9
|
+
export declare function RewindPicker({ rows, focusIndex, confirmRow, }: {
|
|
10
|
+
rows: readonly ChatRow[];
|
|
11
|
+
focusIndex: number;
|
|
12
|
+
confirmRow: ChatRow | null;
|
|
13
|
+
}): React.ReactNode;
|
|
14
|
+
//# sourceMappingURL=RewindPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RewindPicker.d.ts","sourceRoot":"","sources":["../../../src/components/RewindPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAM5C;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,UAAU,EACV,UAAU,GACX,EAAE;IACD,IAAI,EAAE,SAAS,OAAO,EAAE,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,OAAO,GAAG,IAAI,CAAA;CAC3B,GAAG,KAAK,CAAC,SAAS,CAuDlB"}
|
|
@@ -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 { Pane } from './design-system/Pane.js';
|
|
4
|
+
import { ListItem } from './design-system/ListItem.js';
|
|
5
|
+
import { Byline } from './design-system/Byline.js';
|
|
6
|
+
import { KeyboardShortcutHint } from './design-system/KeyboardShortcutHint.js';
|
|
7
|
+
/**
|
|
8
|
+
* Double-Esc rewind picker (CC's "Double-tap esc to rewind the code and/or
|
|
9
|
+
* conversation to a previous point in time"): lists the user's past messages
|
|
10
|
+
* newest-first; selecting one and confirming rewinds the conversation to
|
|
11
|
+
* that point (the message comes back into the input for re-editing).
|
|
12
|
+
*/
|
|
13
|
+
export function RewindPicker({ rows, focusIndex, confirmRow, }) {
|
|
14
|
+
if (confirmRow !== null) {
|
|
15
|
+
return (_jsx(Pane, { color: "permission", children: _jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: "Rewind conversation to this message?" }) }), _jsx(ListItem, { isFocused: false, description: "conversation restarts here", children: preview(confirmRow.text) }), _jsx(Text, { dimColor: true, italic: true, children: _jsxs(Byline, { children: [_jsx(KeyboardShortcutHint, { shortcut: "Enter", action: "rewind", bold: true }), _jsx(KeyboardShortcutHint, { shortcut: "Esc", action: "back" })] }) })] }) }));
|
|
16
|
+
}
|
|
17
|
+
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: "remember", bold: true, children: "Rewind" }), _jsx(Text, { dimColor: true, children: "Pick a message to rewind the conversation to" })] }), rows.length === 0 ? (_jsx(ListItem, { isFocused: false, children: "No messages to rewind to" })) : (rows.map((row, index) => (_jsx(ListItem, { isFocused: index === focusIndex, description: index === 0 ? 'last message' : undefined, children: preview(row.text) }, row.id))))] }), _jsx(Text, { dimColor: true, italic: true, children: _jsxs(Byline, { children: [_jsx(KeyboardShortcutHint, { shortcut: "Enter", action: "select", bold: true }), _jsx(KeyboardShortcutHint, { shortcut: "Esc", action: "exit" })] }) })] }));
|
|
18
|
+
}
|
|
19
|
+
/** One-line preview of a message (newlines flattened, capped). */
|
|
20
|
+
function preview(text) {
|
|
21
|
+
const flat = text.replace(/\s+/g, ' ').trim();
|
|
22
|
+
return flat.length <= 80 ? flat : `${flat.slice(0, 80)}…`;
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A single-line search input in the round-bordered box of the leak's
|
|
4
|
+
* SearchBox: `⌕ ` prefix, block cursor at `cursorOffset` (inverse cell).
|
|
5
|
+
* When empty and focused, a solid block caret sits at the start and the
|
|
6
|
+
* placeholder is right-aligned (dimmed) — kept off the caret's cell so the
|
|
7
|
+
* terminal-painted IME preedit (pinyin) can never be overlaid on it during
|
|
8
|
+
* CJK composition.
|
|
9
|
+
*/
|
|
10
|
+
export declare function SearchBox({ query, placeholder, isFocused, isTerminalFocused, prefix, width, cursorOffset, borderless, }: {
|
|
11
|
+
query: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
isFocused: boolean;
|
|
14
|
+
isTerminalFocused: boolean;
|
|
15
|
+
prefix?: string;
|
|
16
|
+
width?: number | string;
|
|
17
|
+
cursorOffset?: number;
|
|
18
|
+
borderless?: boolean;
|
|
19
|
+
}): React.ReactNode;
|
|
20
|
+
//# sourceMappingURL=SearchBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchBox.d.ts","sourceRoot":"","sources":["../../../src/components/SearchBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,WAAuB,EACvB,SAAS,EACT,iBAAiB,EACjB,MAAY,EACZ,KAAK,EACL,YAAY,EACZ,UAAkB,GACnB,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,OAAO,CAAA;IAClB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,GAAG,KAAK,CAAC,SAAS,CAqDlB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Box from '../ink/components/Box.js';
|
|
3
|
+
import Text from '../ink/components/Text.js';
|
|
4
|
+
/**
|
|
5
|
+
* A single-line search input in the round-bordered box of the leak's
|
|
6
|
+
* SearchBox: `⌕ ` prefix, block cursor at `cursorOffset` (inverse cell).
|
|
7
|
+
* When empty and focused, a solid block caret sits at the start and the
|
|
8
|
+
* placeholder is right-aligned (dimmed) — kept off the caret's cell so the
|
|
9
|
+
* terminal-painted IME preedit (pinyin) can never be overlaid on it during
|
|
10
|
+
* CJK composition.
|
|
11
|
+
*/
|
|
12
|
+
export function SearchBox({ query, placeholder = 'Search…', isFocused, isTerminalFocused, prefix = '⌕', width, cursorOffset, borderless = false, }) {
|
|
13
|
+
const offset = cursorOffset ?? query.length;
|
|
14
|
+
const borderStyle = borderless ? undefined : 'round';
|
|
15
|
+
const borderColor = isFocused ? 'suggestion' : undefined;
|
|
16
|
+
const borderDimColor = !isFocused;
|
|
17
|
+
// Focused + empty + terminal focused: inline caret row (block caret at the
|
|
18
|
+
// start, placeholder right-aligned) instead of the inline placeholder.
|
|
19
|
+
const inlineCaret = isFocused && query === '' && isTerminalFocused;
|
|
20
|
+
let content;
|
|
21
|
+
if (isFocused) {
|
|
22
|
+
if (query) {
|
|
23
|
+
content = isTerminalFocused ? (_jsxs(_Fragment, { children: [_jsx(Text, { children: query.slice(0, offset) }), _jsx(Text, { inverse: true, children: offset < query.length ? query[offset] : ' ' }), offset < query.length && _jsx(Text, { children: query.slice(offset + 1) })] })) : (_jsx(Text, { children: query }));
|
|
24
|
+
}
|
|
25
|
+
else if (!isTerminalFocused) {
|
|
26
|
+
content = _jsx(Text, { dimColor: true, children: placeholder });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
content = query ? _jsx(Text, { children: query }) : _jsx(Text, { children: placeholder });
|
|
31
|
+
}
|
|
32
|
+
return (_jsx(Box, { flexShrink: 0, borderStyle: borderStyle, borderColor: borderColor, borderDimColor: borderDimColor, paddingX: borderless ? 0 : 1, width: width, children: inlineCaret ? (_jsxs(Box, { flexDirection: "row", width: "100%", children: [_jsxs(Text, { children: [prefix, " "] }), _jsx(Text, { inverse: true, children: " " }), _jsx(Box, { flexGrow: 1 }), _jsx(Text, { dimColor: true, wrap: "truncate", children: placeholder })] })) : (_jsxs(Text, { dimColor: !isFocused, children: [prefix, " ", content] })) }));
|
|
33
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type SelectOption = {
|
|
3
|
+
value: string;
|
|
4
|
+
/** Row content; plain strings render inline, richer rows may carry color swatches. */
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
description?: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A single-choice select list in the CC CustomSelect style (ported visual:
|
|
10
|
+
* ListItem rows with ❯ focus pointer, ✓ selected checkmark, descriptions,
|
|
11
|
+
* scroll arrows). Keyboard navigation is owned by the parent dialog, which
|
|
12
|
+
* passes focus/selection indices back in.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Select({ options, focusIndex, selectedValue, visibleOptionCount, }: {
|
|
15
|
+
options: readonly SelectOption[];
|
|
16
|
+
/** Index of the keyboard-focused row (shows the ❯ pointer). */
|
|
17
|
+
focusIndex: number;
|
|
18
|
+
/** Value of the chosen row (shows the ✓ checkmark). */
|
|
19
|
+
selectedValue: string | undefined;
|
|
20
|
+
visibleOptionCount?: number;
|
|
21
|
+
}): React.ReactNode;
|
|
22
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,sFAAsF;IACtF,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,UAAU,EACV,aAAa,EACb,kBAAsB,GACvB,EAAE;IACD,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;IAChC,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,aAAa,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B,GAAG,KAAK,CAAC,SAAS,CAiClB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Box from '../ink/components/Box.js';
|
|
3
|
+
import { ListItem } from './design-system/ListItem.js';
|
|
4
|
+
/**
|
|
5
|
+
* A single-choice select list in the CC CustomSelect style (ported visual:
|
|
6
|
+
* ListItem rows with ❯ focus pointer, ✓ selected checkmark, descriptions,
|
|
7
|
+
* scroll arrows). Keyboard navigation is owned by the parent dialog, which
|
|
8
|
+
* passes focus/selection indices back in.
|
|
9
|
+
*/
|
|
10
|
+
export function Select({ options, focusIndex, selectedValue, visibleOptionCount = 5, }) {
|
|
11
|
+
// Window around the focus row, with scroll hints at the edges (CC style).
|
|
12
|
+
const startIndex = Math.max(0, Math.min(focusIndex - Math.floor(visibleOptionCount / 2), options.length - visibleOptionCount));
|
|
13
|
+
const endIndex = Math.min(startIndex + visibleOptionCount, options.length);
|
|
14
|
+
const visible = options.slice(startIndex, endIndex);
|
|
15
|
+
return (_jsx(Box, { flexDirection: "column", children: visible.map((option, index) => {
|
|
16
|
+
const absoluteIndex = startIndex + index;
|
|
17
|
+
return (_jsx(ListItem, { isFocused: absoluteIndex === focusIndex, isSelected: option.value === selectedValue, description: option.description, showScrollUp: absoluteIndex === startIndex && startIndex > 0, showScrollDown: absoluteIndex === endIndex - 1 && endIndex < options.length, children: option.label }, option.value));
|
|
18
|
+
}) }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Theme } from '../../theme.js';
|
|
3
|
+
import type { SpinnerMode } from './spinnerMode.js';
|
|
4
|
+
type Props = {
|
|
5
|
+
message: string;
|
|
6
|
+
mode: SpinnerMode;
|
|
7
|
+
messageColor: keyof Theme;
|
|
8
|
+
glimmerIndex: number;
|
|
9
|
+
flashOpacity: number;
|
|
10
|
+
shimmerColor: keyof Theme;
|
|
11
|
+
stalledIntensity?: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The shimmering verb message next to the spinner glyph, ported from the
|
|
15
|
+
* leak's `Spinner/GlimmerMessage.tsx`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function GlimmerMessage({ message, mode, messageColor, glimmerIndex, flashOpacity, shimmerColor, stalledIntensity, }: Props): React.ReactNode;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=GlimmerMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlimmerMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/Spinner/GlimmerMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAInD,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,WAAW,CAAA;IACjB,YAAY,EAAE,MAAM,KAAK,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,KAAK,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAID;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,gBAAoB,GACrB,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CA8GzB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Text from '../../ink/components/Text.js';
|
|
4
|
+
import { stringWidth } from '../../ink/stringWidth.js';
|
|
5
|
+
import { getGraphemeSegmenter } from '../../utils/intl.js';
|
|
6
|
+
import { getTheme } from '../../theme.js';
|
|
7
|
+
import { interpolateColor, parseRGB, toRGBColor } from './spinnerUtils.js';
|
|
8
|
+
import { useTheme } from '../design-system/ThemeProvider.js';
|
|
9
|
+
const ERROR_RED = { r: 171, g: 43, b: 63 };
|
|
10
|
+
/**
|
|
11
|
+
* The shimmering verb message next to the spinner glyph, ported from the
|
|
12
|
+
* leak's `Spinner/GlimmerMessage.tsx`.
|
|
13
|
+
*/
|
|
14
|
+
export function GlimmerMessage({ message, mode, messageColor, glimmerIndex, flashOpacity, shimmerColor, stalledIntensity = 0, }) {
|
|
15
|
+
const [themeName] = useTheme();
|
|
16
|
+
const theme = getTheme(themeName);
|
|
17
|
+
// Precompute grapheme segmentation + widths once per message instead of
|
|
18
|
+
// per animation frame (the original component re-renders at ~20fps).
|
|
19
|
+
const { segments } = React.useMemo(() => {
|
|
20
|
+
const segs = [];
|
|
21
|
+
for (const { segment } of getGraphemeSegmenter().segment(message)) {
|
|
22
|
+
segs.push({ segment, width: stringWidth(segment) });
|
|
23
|
+
}
|
|
24
|
+
return { segments: segs };
|
|
25
|
+
}, [message]);
|
|
26
|
+
if (!message)
|
|
27
|
+
return null;
|
|
28
|
+
// When stalled, show text that smoothly transitions to red
|
|
29
|
+
if (stalledIntensity > 0) {
|
|
30
|
+
const baseColorStr = theme[messageColor];
|
|
31
|
+
const baseRGB = baseColorStr ? parseRGB(baseColorStr) : null;
|
|
32
|
+
if (baseRGB) {
|
|
33
|
+
const interpolated = interpolateColor(baseRGB, ERROR_RED, stalledIntensity);
|
|
34
|
+
const color = toRGBColor(interpolated);
|
|
35
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { color: color, children: message }), _jsx(Text, { color: color, children: " " })] }));
|
|
36
|
+
}
|
|
37
|
+
// Fallback for ANSI themes: use messageColor until fully stalled, then error
|
|
38
|
+
const color = stalledIntensity > 0.5 ? 'error' : messageColor;
|
|
39
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { color: color, children: message }), _jsx(Text, { color: color, children: " " })] }));
|
|
40
|
+
}
|
|
41
|
+
// tool-use mode: all chars flash with the same opacity, so render as a
|
|
42
|
+
// single <Text> instead of N individual FlashingChar components.
|
|
43
|
+
if (mode === 'tool-use') {
|
|
44
|
+
const baseColorStr = theme[messageColor];
|
|
45
|
+
const shimmerColorStr = theme[shimmerColor];
|
|
46
|
+
const baseRGB = baseColorStr ? parseRGB(baseColorStr) : null;
|
|
47
|
+
const shimmerRGB = shimmerColorStr ? parseRGB(shimmerColorStr) : null;
|
|
48
|
+
if (baseRGB && shimmerRGB) {
|
|
49
|
+
const interpolated = interpolateColor(baseRGB, shimmerRGB, flashOpacity);
|
|
50
|
+
const color = toRGBColor(interpolated);
|
|
51
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { color: color, children: message }), _jsx(Text, { color: color, children: " " })] }));
|
|
52
|
+
}
|
|
53
|
+
// Fallback for ANSI themes: render without flash animation
|
|
54
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { color: messageColor, children: message }), _jsx(Text, { color: messageColor, children: " " })] }));
|
|
55
|
+
}
|
|
56
|
+
// Shimmer: a highlight sweeps across the message text
|
|
57
|
+
const baseColorStr = theme[messageColor];
|
|
58
|
+
const shimmerColorStr = theme[shimmerColor];
|
|
59
|
+
const baseRGB = baseColorStr ? parseRGB(baseColorStr) : null;
|
|
60
|
+
const shimmerRGB = shimmerColorStr ? parseRGB(shimmerColorStr) : null;
|
|
61
|
+
if (!baseRGB || !shimmerRGB) {
|
|
62
|
+
// Fallback for ANSI themes: render without shimmer animation
|
|
63
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { color: messageColor, children: message }), _jsx(Text, { color: messageColor, children: " " })] }));
|
|
64
|
+
}
|
|
65
|
+
return (_jsxs(_Fragment, { children: [segments.map(({ segment, width }, index) => {
|
|
66
|
+
let charStart = 0;
|
|
67
|
+
for (let i = 0; i < index; i++)
|
|
68
|
+
charStart += segments[i].width;
|
|
69
|
+
// Character is highlighted if it falls within the glimmer window
|
|
70
|
+
const isHighlighted = glimmerIndex >= 0 &&
|
|
71
|
+
charStart >= glimmerIndex &&
|
|
72
|
+
charStart + width <= glimmerIndex + 4;
|
|
73
|
+
const color = isHighlighted
|
|
74
|
+
? toRGBColor(interpolateColor(baseRGB, shimmerRGB, flashOpacity))
|
|
75
|
+
: messageColor;
|
|
76
|
+
return (_jsx(Text, { color: color, children: segment }, index));
|
|
77
|
+
}), _jsx(Text, { color: messageColor, children: " " })] }));
|
|
78
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Theme } from '../../theme.js';
|
|
3
|
+
import type { SpinnerMode } from './spinnerMode.js';
|
|
4
|
+
export type SpinnerAnimationRowProps = {
|
|
5
|
+
mode: SpinnerMode;
|
|
6
|
+
reducedMotion: boolean;
|
|
7
|
+
hasActiveTools: boolean;
|
|
8
|
+
/** Raw response length (chars) — feeds the animated token counter. */
|
|
9
|
+
responseLengthRef: React.RefObject<number>;
|
|
10
|
+
/** Stable within a turn. */
|
|
11
|
+
message: string;
|
|
12
|
+
messageColor: keyof Theme;
|
|
13
|
+
shimmerColor: keyof Theme;
|
|
14
|
+
loadingStartTimeRef: React.RefObject<number>;
|
|
15
|
+
totalPausedMsRef: React.RefObject<number>;
|
|
16
|
+
pauseStartTimeRef: React.RefObject<number | null>;
|
|
17
|
+
spinnerSuffix?: string | null;
|
|
18
|
+
verbose: boolean;
|
|
19
|
+
columns: number;
|
|
20
|
+
/** 'thinking' while reasoning streams; number = duration (ms) after it ends. */
|
|
21
|
+
thinkingStatus: 'thinking' | number | null;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The 50ms-animated portion of the working spinner, ported from the leak's
|
|
25
|
+
* `Spinner/SpinnerAnimationRow.tsx` with the swarm/teammate/effort branches
|
|
26
|
+
* removed. Owns `useAnimationFrame(50)` and all values derived from the
|
|
27
|
+
* animation clock (frame, glimmer, token counter animation, elapsed time,
|
|
28
|
+
* stalled intensity, thinking shimmer).
|
|
29
|
+
*/
|
|
30
|
+
export declare function SpinnerAnimationRow({ mode, reducedMotion, hasActiveTools, responseLengthRef, message, messageColor, shimmerColor, loadingStartTimeRef, totalPausedMsRef, pauseStartTimeRef, spinnerSuffix, verbose, columns, thinkingStatus, }: SpinnerAnimationRowProps): React.ReactNode;
|
|
31
|
+
//# sourceMappingURL=SpinnerAnimationRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpinnerAnimationRow.d.ts","sourceRoot":"","sources":["../../../../src/components/Spinner/SpinnerAnimationRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0B,MAAM,OAAO,CAAA;AAM9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAI3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAcnD,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,WAAW,CAAA;IACjB,aAAa,EAAE,OAAO,CAAA;IACtB,cAAc,EAAE,OAAO,CAAA;IACvB,sEAAsE;IACtE,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IAC1C,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,KAAK,CAAA;IACzB,YAAY,EAAE,MAAM,KAAK,CAAA;IACzB,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,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,gFAAgF;IAChF,cAAc,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAAA;CAC3C,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,OAAO,EACP,OAAO,EACP,cAAc,GACf,EAAE,wBAAwB,GAAG,KAAK,CAAC,SAAS,CAwM5C"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import figures from 'figures';
|
|
3
|
+
import { useMemo, useRef } from 'react';
|
|
4
|
+
import { useAnimationFrame } from '../../ink/hooks/use-animation-frame.js';
|
|
5
|
+
import Box from '../../ink/components/Box.js';
|
|
6
|
+
import Text from '../../ink/components/Text.js';
|
|
7
|
+
import { stringWidth } from '../../ink/stringWidth.js';
|
|
8
|
+
import { formatDuration, formatNumber } from '../../cc/format.js';
|
|
9
|
+
import { Byline } from '../design-system/Byline.js';
|
|
10
|
+
import { GlimmerMessage } from './GlimmerMessage.js';
|
|
11
|
+
import { SpinnerGlyph } from './SpinnerGlyph.js';
|
|
12
|
+
import { useStalledAnimation } from './useStalledAnimation.js';
|
|
13
|
+
import { interpolateColor, toRGBColor } from './spinnerUtils.js';
|
|
14
|
+
const SEP_WIDTH = stringWidth(' · ');
|
|
15
|
+
const THINKING_BARE_WIDTH = stringWidth('thinking');
|
|
16
|
+
const SHOW_TOKENS_AFTER_MS = 30_000;
|
|
17
|
+
// Thinking shimmer constants (same as the leak).
|
|
18
|
+
const THINKING_INACTIVE = { r: 153, g: 153, b: 153 };
|
|
19
|
+
const THINKING_INACTIVE_SHIMMER = { r: 185, g: 185, b: 185 };
|
|
20
|
+
const THINKING_DELAY_MS = 3000;
|
|
21
|
+
const THINKING_GLOW_PERIOD_S = 2;
|
|
22
|
+
/**
|
|
23
|
+
* The 50ms-animated portion of the working spinner, ported from the leak's
|
|
24
|
+
* `Spinner/SpinnerAnimationRow.tsx` with the swarm/teammate/effort branches
|
|
25
|
+
* removed. Owns `useAnimationFrame(50)` and all values derived from the
|
|
26
|
+
* animation clock (frame, glimmer, token counter animation, elapsed time,
|
|
27
|
+
* stalled intensity, thinking shimmer).
|
|
28
|
+
*/
|
|
29
|
+
export function SpinnerAnimationRow({ mode, reducedMotion, hasActiveTools, responseLengthRef, message, messageColor, shimmerColor, loadingStartTimeRef, totalPausedMsRef, pauseStartTimeRef, spinnerSuffix, verbose, columns, thinkingStatus, }) {
|
|
30
|
+
const [viewportRef, time] = useAnimationFrame(reducedMotion ? null : 50);
|
|
31
|
+
// === Elapsed time (wall-clock, derived from refs each frame) ===
|
|
32
|
+
const now = Date.now();
|
|
33
|
+
const elapsedTimeMs = pauseStartTimeRef.current !== null
|
|
34
|
+
? pauseStartTimeRef.current -
|
|
35
|
+
loadingStartTimeRef.current -
|
|
36
|
+
totalPausedMsRef.current
|
|
37
|
+
: now - loadingStartTimeRef.current - totalPausedMsRef.current;
|
|
38
|
+
// === Animation derivations from `time` ===
|
|
39
|
+
const currentResponseLength = responseLengthRef.current;
|
|
40
|
+
const { isStalled, stalledIntensity } = useStalledAnimation(time, currentResponseLength, hasActiveTools, reducedMotion);
|
|
41
|
+
const frame = reducedMotion ? 0 : Math.floor(time / 120);
|
|
42
|
+
const glimmerSpeed = mode === 'requesting' ? 50 : 200;
|
|
43
|
+
const glimmerMessageWidth = useMemo(() => stringWidth(message), [message]);
|
|
44
|
+
const cycleLength = glimmerMessageWidth + 20;
|
|
45
|
+
const cyclePosition = Math.floor(time / glimmerSpeed);
|
|
46
|
+
const glimmerIndex = reducedMotion
|
|
47
|
+
? -100
|
|
48
|
+
: isStalled
|
|
49
|
+
? -100
|
|
50
|
+
: mode === 'requesting'
|
|
51
|
+
? (cyclePosition % cycleLength) - 10
|
|
52
|
+
: glimmerMessageWidth + 10 - (cyclePosition % cycleLength);
|
|
53
|
+
const flashOpacity = reducedMotion
|
|
54
|
+
? 0
|
|
55
|
+
: mode === 'tool-use'
|
|
56
|
+
? (Math.sin((time / 1000) * Math.PI) + 1) / 2
|
|
57
|
+
: 0;
|
|
58
|
+
// === Token counter animation (smooth increment, driven by 50ms clock) ===
|
|
59
|
+
const tokenCounterRef = useRef(currentResponseLength);
|
|
60
|
+
if (reducedMotion) {
|
|
61
|
+
tokenCounterRef.current = currentResponseLength;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
const gap = currentResponseLength - tokenCounterRef.current;
|
|
65
|
+
if (gap > 0) {
|
|
66
|
+
let increment;
|
|
67
|
+
if (gap < 70) {
|
|
68
|
+
increment = 3;
|
|
69
|
+
}
|
|
70
|
+
else if (gap < 200) {
|
|
71
|
+
increment = Math.max(8, Math.ceil(gap * 0.15));
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
increment = 50;
|
|
75
|
+
}
|
|
76
|
+
tokenCounterRef.current = Math.min(tokenCounterRef.current + increment, currentResponseLength);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const displayedResponseLength = tokenCounterRef.current;
|
|
80
|
+
const leaderTokens = Math.round(displayedResponseLength / 4);
|
|
81
|
+
const timerText = formatDuration(elapsedTimeMs);
|
|
82
|
+
const timerWidth = stringWidth(timerText);
|
|
83
|
+
const tokenCount = formatNumber(leaderTokens);
|
|
84
|
+
const tokensText = `${figures.arrowDown} ${tokenCount} tokens`;
|
|
85
|
+
const tokensWidth = stringWidth(tokensText);
|
|
86
|
+
// === Thinking text (may shrink to fit) ===
|
|
87
|
+
let thinkingText = thinkingStatus === 'thinking'
|
|
88
|
+
? 'thinking'
|
|
89
|
+
: typeof thinkingStatus === 'number'
|
|
90
|
+
? `thought for ${Math.max(1, Math.round(thinkingStatus / 1000))}s`
|
|
91
|
+
: null;
|
|
92
|
+
let thinkingWidthValue = thinkingText ? stringWidth(thinkingText) : 0;
|
|
93
|
+
// === Progressive width gating ===
|
|
94
|
+
const messageWidth = glimmerMessageWidth + 2;
|
|
95
|
+
const sep = SEP_WIDTH;
|
|
96
|
+
const wantsThinking = thinkingStatus !== null;
|
|
97
|
+
const wantsTimerAndTokens = verbose || elapsedTimeMs > SHOW_TOKENS_AFTER_MS;
|
|
98
|
+
const availableSpace = columns - messageWidth - 5;
|
|
99
|
+
let showThinking = wantsThinking && availableSpace > thinkingWidthValue;
|
|
100
|
+
if (!showThinking && wantsThinking && thinkingStatus === 'thinking') {
|
|
101
|
+
if (availableSpace > THINKING_BARE_WIDTH) {
|
|
102
|
+
thinkingText = 'thinking';
|
|
103
|
+
thinkingWidthValue = THINKING_BARE_WIDTH;
|
|
104
|
+
showThinking = true;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const usedAfterThinking = showThinking ? thinkingWidthValue + sep : 0;
|
|
108
|
+
const showTimer = wantsTimerAndTokens && availableSpace > usedAfterThinking + timerWidth;
|
|
109
|
+
const usedAfterTimer = usedAfterThinking + (showTimer ? timerWidth + sep : 0);
|
|
110
|
+
const showTokens = wantsTimerAndTokens &&
|
|
111
|
+
leaderTokens > 0 &&
|
|
112
|
+
availableSpace > usedAfterTimer + tokensWidth;
|
|
113
|
+
const thinkingOnly = showThinking &&
|
|
114
|
+
thinkingStatus === 'thinking' &&
|
|
115
|
+
!spinnerSuffix &&
|
|
116
|
+
!showTimer &&
|
|
117
|
+
!showTokens;
|
|
118
|
+
// === Thinking shimmer color ===
|
|
119
|
+
const thinkingElapsedSec = (time - THINKING_DELAY_MS) / 1000;
|
|
120
|
+
const thinkingOpacity = time < THINKING_DELAY_MS
|
|
121
|
+
? 0
|
|
122
|
+
: (Math.sin((thinkingElapsedSec * Math.PI * 2) / THINKING_GLOW_PERIOD_S) +
|
|
123
|
+
1) /
|
|
124
|
+
2;
|
|
125
|
+
const thinkingShimmerColor = toRGBColor(interpolateColor(THINKING_INACTIVE, THINKING_INACTIVE_SHIMMER, thinkingOpacity));
|
|
126
|
+
// === Build status parts ===
|
|
127
|
+
const parts = [
|
|
128
|
+
...(spinnerSuffix
|
|
129
|
+
? [
|
|
130
|
+
_jsx(Text, { dimColor: true, children: spinnerSuffix }, "suffix"),
|
|
131
|
+
]
|
|
132
|
+
: []),
|
|
133
|
+
...(showTimer
|
|
134
|
+
? [
|
|
135
|
+
_jsx(Text, { dimColor: true, children: timerText }, "elapsedTime"),
|
|
136
|
+
]
|
|
137
|
+
: []),
|
|
138
|
+
...(showTokens
|
|
139
|
+
? [
|
|
140
|
+
_jsxs(Box, { flexDirection: "row", children: [_jsx(SpinnerModeGlyph, { mode: mode }), _jsxs(Text, { dimColor: true, children: [tokenCount, " tokens"] })] }, "tokens"),
|
|
141
|
+
]
|
|
142
|
+
: []),
|
|
143
|
+
...(showThinking && thinkingText
|
|
144
|
+
? [
|
|
145
|
+
thinkingStatus === 'thinking' && !reducedMotion ? (_jsx(Text, { color: thinkingShimmerColor, children: thinkingOnly ? `(${thinkingText})` : thinkingText }, "thinking")) : (_jsx(Text, { dimColor: true, children: thinkingText }, "thinking")),
|
|
146
|
+
]
|
|
147
|
+
: []),
|
|
148
|
+
];
|
|
149
|
+
const status = parts.length > 0 ? (thinkingOnly ? (_jsx(Byline, { children: parts })) : (_jsxs(_Fragment, { children: [_jsx(Text, { dimColor: true, children: "(" }), _jsx(Byline, { children: parts }), _jsx(Text, { dimColor: true, children: ")" })] }))) : null;
|
|
150
|
+
return (_jsxs(Box, { ref: viewportRef, flexDirection: "row", flexWrap: "wrap", marginTop: 1, width: "100%", children: [_jsx(SpinnerGlyph, { frame: frame, messageColor: messageColor, stalledIntensity: stalledIntensity, reducedMotion: reducedMotion, time: time }), _jsx(GlimmerMessage, { message: message, mode: mode, messageColor: messageColor, glimmerIndex: glimmerIndex, flashOpacity: flashOpacity, shimmerColor: shimmerColor, stalledIntensity: stalledIntensity }), status] }));
|
|
151
|
+
}
|
|
152
|
+
function SpinnerModeGlyph({ mode }) {
|
|
153
|
+
switch (mode) {
|
|
154
|
+
case 'tool-input':
|
|
155
|
+
case 'tool-use':
|
|
156
|
+
case 'responding':
|
|
157
|
+
case 'thinking':
|
|
158
|
+
return (_jsx(Box, { width: 2, children: _jsx(Text, { dimColor: true, children: figures.arrowDown }) }));
|
|
159
|
+
case 'requesting':
|
|
160
|
+
return (_jsx(Box, { width: 2, children: _jsx(Text, { dimColor: true, children: figures.arrowUp }) }));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Theme } from '../../theme.js';
|
|
3
|
+
type Props = {
|
|
4
|
+
frame: number;
|
|
5
|
+
messageColor: keyof Theme;
|
|
6
|
+
stalledIntensity?: number;
|
|
7
|
+
reducedMotion?: boolean;
|
|
8
|
+
time?: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The animated spinner glyph (·✢*✶✻✽ cycle), ported from the leak's
|
|
12
|
+
* `Spinner/SpinnerGlyph.tsx`. Interpolates toward red when stalled.
|
|
13
|
+
*/
|
|
14
|
+
export declare function SpinnerGlyph({ frame, messageColor, stalledIntensity, reducedMotion, time, }: Props): React.ReactNode;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=SpinnerGlyph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpinnerGlyph.d.ts","sourceRoot":"","sources":["../../../../src/components/Spinner/SpinnerGlyph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAUrD,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,KAAK,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,YAAY,EACZ,gBAAoB,EACpB,aAAqB,EACrB,IAAQ,GACT,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CA2CzB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 { getTheme } from '../../theme.js';
|
|
5
|
+
import { useTheme } from '../design-system/ThemeProvider.js';
|
|
6
|
+
import { getDefaultCharacters, interpolateColor, parseRGB, toRGBColor } from './spinnerUtils.js';
|
|
7
|
+
const DEFAULT_CHARACTERS = getDefaultCharacters();
|
|
8
|
+
const SPINNER_FRAMES = [...DEFAULT_CHARACTERS, ...[...DEFAULT_CHARACTERS].reverse()];
|
|
9
|
+
const REDUCED_MOTION_DOT = '●';
|
|
10
|
+
const REDUCED_MOTION_CYCLE_MS = 2000; // 2-second cycle: 1s visible, 1s dim
|
|
11
|
+
const ERROR_RED = { r: 171, g: 43, b: 63 };
|
|
12
|
+
/**
|
|
13
|
+
* The animated spinner glyph (·✢*✶✻✽ cycle), ported from the leak's
|
|
14
|
+
* `Spinner/SpinnerGlyph.tsx`. Interpolates toward red when stalled.
|
|
15
|
+
*/
|
|
16
|
+
export function SpinnerGlyph({ frame, messageColor, stalledIntensity = 0, reducedMotion = false, time = 0, }) {
|
|
17
|
+
const [themeName] = useTheme();
|
|
18
|
+
const theme = getTheme(themeName);
|
|
19
|
+
if (reducedMotion) {
|
|
20
|
+
const isDim = Math.floor(time / (REDUCED_MOTION_CYCLE_MS / 2)) % 2 === 1;
|
|
21
|
+
return (_jsx(Box, { flexWrap: "wrap", height: 1, width: 2, children: _jsx(Text, { color: messageColor, dimColor: isDim, children: REDUCED_MOTION_DOT }) }));
|
|
22
|
+
}
|
|
23
|
+
const spinnerChar = SPINNER_FRAMES[frame % SPINNER_FRAMES.length];
|
|
24
|
+
if (stalledIntensity > 0) {
|
|
25
|
+
const baseColorStr = theme[messageColor];
|
|
26
|
+
const baseRGB = baseColorStr ? parseRGB(baseColorStr) : null;
|
|
27
|
+
if (baseRGB) {
|
|
28
|
+
const interpolated = interpolateColor(baseRGB, ERROR_RED, stalledIntensity);
|
|
29
|
+
return (_jsx(Box, { flexWrap: "wrap", height: 1, width: 2, children: _jsx(Text, { color: toRGBColor(interpolated), children: spinnerChar }) }));
|
|
30
|
+
}
|
|
31
|
+
// Fallback for ANSI themes: use messageColor until fully stalled, then error
|
|
32
|
+
const color = stalledIntensity > 0.5 ? 'error' : messageColor;
|
|
33
|
+
return (_jsx(Box, { flexWrap: "wrap", height: 1, width: 2, children: _jsx(Text, { color: color, children: spinnerChar }) }));
|
|
34
|
+
}
|
|
35
|
+
return (_jsx(Box, { flexWrap: "wrap", height: 1, width: 2, children: _jsx(Text, { color: messageColor, children: spinnerChar }) }));
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinnerMode.d.ts","sourceRoot":"","sources":["../../../../src/components/Spinner/spinnerMode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,WAAW,GACnB,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,UAAU,GACV,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spinner animation utilities, ported from the leaked Claude Code source
|
|
3
|
+
* (`src/components/Spinner/utils.ts`).
|
|
4
|
+
*/
|
|
5
|
+
export type RGBColor = {
|
|
6
|
+
r: number;
|
|
7
|
+
g: number;
|
|
8
|
+
b: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The platform-appropriate default spinner character set.
|
|
12
|
+
* @returns The spinner frame characters for the current terminal/platform.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getDefaultCharacters(): string[];
|
|
15
|
+
/**
|
|
16
|
+
* Interpolate between two RGB colors.
|
|
17
|
+
* @param color1 - Start color.
|
|
18
|
+
* @param color2 - End color.
|
|
19
|
+
* @param t - Interpolation factor, 0 to 1.
|
|
20
|
+
* @returns The interpolated color, components rounded to integers.
|
|
21
|
+
*/
|
|
22
|
+
export declare function interpolateColor(color1: RGBColor, color2: RGBColor, t: number): RGBColor;
|
|
23
|
+
/**
|
|
24
|
+
* Convert an RGB object to an `rgb()` color string for the Text component.
|
|
25
|
+
* @param color - The RGB color to format.
|
|
26
|
+
* @returns The `rgb(r,g,b)` string.
|
|
27
|
+
*/
|
|
28
|
+
export declare function toRGBColor(color: RGBColor): string;
|
|
29
|
+
/**
|
|
30
|
+
* Convert an HSL hue to RGB, using voice-mode waveform parameters (s=0.7, l=0.6).
|
|
31
|
+
* @param hue - Hue in degrees (0–360; wrapped into range).
|
|
32
|
+
* @returns The RGB color for the hue.
|
|
33
|
+
*/
|
|
34
|
+
export declare function hueToRgb(hue: number): RGBColor;
|
|
35
|
+
/**
|
|
36
|
+
* Parse an `rgb(r,g,b)` color string, memoized per input.
|
|
37
|
+
* @param colorStr - The color string to parse.
|
|
38
|
+
* @returns The parsed RGB color, or null when the string is not `rgb(r,g,b)`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseRGB(colorStr: string): RGBColor | null;
|
|
41
|
+
//# sourceMappingURL=spinnerUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinnerUtils.d.ts","sourceRoot":"","sources":["../../../../src/components/Spinner/spinnerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,QAAQ,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAE1D;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAO/C;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,QAAQ,EAChB,CAAC,EAAE,MAAM,GACR,QAAQ,CAMV;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAElD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAkC9C;AAID;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAc1D"}
|