@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,57 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from '../ui.js';
|
|
3
|
+
/** Maximum todo rows shown before the overflow line. */
|
|
4
|
+
const MAX_TODOS = 8;
|
|
5
|
+
const PHASE_LABEL = {
|
|
6
|
+
active: '● active',
|
|
7
|
+
paused: '⏸ paused',
|
|
8
|
+
blocked: '⛔ blocked',
|
|
9
|
+
complete: '✓ complete',
|
|
10
|
+
};
|
|
11
|
+
function PhaseBadge({ phase, roundsStarted, maxGoalRounds, }) {
|
|
12
|
+
const color = phase === 'active'
|
|
13
|
+
? 'success'
|
|
14
|
+
: phase === 'paused'
|
|
15
|
+
? 'warning'
|
|
16
|
+
: phase === 'blocked'
|
|
17
|
+
? 'error'
|
|
18
|
+
: undefined;
|
|
19
|
+
return (_jsxs(Text, { color: color, dimColor: phase === 'complete', children: [PHASE_LABEL[phase], " \u00B7 ", roundsStarted, "/", maxGoalRounds] }));
|
|
20
|
+
}
|
|
21
|
+
function TodoGlyph({ status }) {
|
|
22
|
+
switch (status) {
|
|
23
|
+
case 'in_progress':
|
|
24
|
+
return _jsx(Text, { color: "suggestion", children: "\u25CF " });
|
|
25
|
+
case 'completed':
|
|
26
|
+
return _jsx(Text, { dimColor: true, children: "\u2713 " });
|
|
27
|
+
default:
|
|
28
|
+
return _jsx(Text, { dimColor: true, children: "\u25CB " });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Mind-map style branch prefix: `├─` for every row but the last, which
|
|
33
|
+
* closes with `└─`. The whole panel reads as one tree — the goal is the
|
|
34
|
+
* root and each todo hangs off it.
|
|
35
|
+
*/
|
|
36
|
+
function BranchPrefix({ last }) {
|
|
37
|
+
return _jsx(Text, { dimColor: true, children: last ? '└─ ' : '├─ ' });
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Live goal + todo panel above the prompt input. Data rides on the channel:
|
|
41
|
+
* `channel.goal` is folded from `goal/change` context events and
|
|
42
|
+
* `channel.todos` from `todo/write` whole-list snapshots, so every model
|
|
43
|
+
* update re-renders this panel in real time (no polling). Renders nothing
|
|
44
|
+
* while both slots are empty.
|
|
45
|
+
*/
|
|
46
|
+
export function GoalTodoPanel({ channel }) {
|
|
47
|
+
const goal = channel.goal;
|
|
48
|
+
const todos = channel.todos ?? [];
|
|
49
|
+
if (goal === undefined && todos.length === 0)
|
|
50
|
+
return null;
|
|
51
|
+
const visible = todos.slice(0, MAX_TODOS);
|
|
52
|
+
const hidden = todos.length - visible.length;
|
|
53
|
+
return (_jsxs(Box, { flexDirection: "column", paddingLeft: 2, paddingRight: 2, paddingTop: 1, children: [goal !== undefined && (_jsxs(Box, { flexDirection: "column", marginBottom: todos.length > 0 ? 1 : 0, children: [_jsxs(Box, { flexDirection: "row", width: "100%", children: [_jsx(Text, { color: "suggestion", children: "\uD83C\uDFAF " }), _jsx(Box, { flexGrow: 1, flexShrink: 1, children: _jsx(Text, { bold: true, wrap: "truncate", children: goal.objective }) }), _jsx(Box, { flexShrink: 0, marginLeft: 1, children: _jsx(PhaseBadge, { phase: goal.phase, roundsStarted: goal.roundsStarted, maxGoalRounds: goal.maxGoalRounds }) })] }), goal.phase === 'blocked' && goal.blockedReason !== undefined && (_jsxs(Box, { flexDirection: "row", marginTop: 1, children: [_jsx(Text, { dimColor: true, children: "\u2502 " }), _jsx(Text, { color: "error", wrap: "truncate", children: goal.blockedReason.message })] }))] })), todos.length > 0 && (_jsxs(Box, { flexDirection: "column", children: [visible.map((todo, index) => {
|
|
54
|
+
const last = index === visible.length - 1 && hidden === 0;
|
|
55
|
+
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(BranchPrefix, { last: last }), _jsx(TodoGlyph, { status: todo.status }), _jsx(Text, { wrap: "truncate", dimColor: todo.status === 'completed', children: todo.content })] }, index));
|
|
56
|
+
}), hidden > 0 && (_jsxs(Box, { flexDirection: "row", children: [_jsx(BranchPrefix, { last: true }), _jsxs(Text, { dimColor: true, children: ["\u2026 ", hidden, " more"] })] }))] }))] }));
|
|
57
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { LocalCommand } from '../commands.js';
|
|
3
|
+
/**
|
|
4
|
+
* The `?` help menu, ported from the leak's `PromptInputHelpMenu.tsx`
|
|
5
|
+
* (three-column shortcut layout, trimmed to the keys dsh-tui actually binds).
|
|
6
|
+
* The command column lists the merged slash-command surface: built-in
|
|
7
|
+
* commands plus plugin-registered ones from the DSH registry (plan/goal/…).
|
|
8
|
+
*/
|
|
9
|
+
export declare function HelpMenu({ commands, }: {
|
|
10
|
+
commands: readonly LocalCommand[];
|
|
11
|
+
}): React.ReactNode;
|
|
12
|
+
//# sourceMappingURL=HelpMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpMenu.d.ts","sourceRoot":"","sources":["../../../src/components/HelpMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAA;CAClC,GAAG,KAAK,CAAC,SAAS,CA6DlB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, 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
|
+
* The `?` help menu, ported from the leak's `PromptInputHelpMenu.tsx`
|
|
6
|
+
* (three-column shortcut layout, trimmed to the keys dsh-tui actually binds).
|
|
7
|
+
* The command column lists the merged slash-command surface: built-in
|
|
8
|
+
* commands plus plugin-registered ones from the DSH registry (plan/goal/…).
|
|
9
|
+
*/
|
|
10
|
+
export function HelpMenu({ commands, }) {
|
|
11
|
+
return (_jsxs(Box, { paddingX: 2, flexDirection: "row", gap: 4, children: [_jsxs(Box, { flexDirection: "column", width: 26, flexShrink: 0, children: [_jsx(Box, { children: _jsx(Text, { dimColor: true, children: "/ for commands" }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "? for this help" }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "ctrl+o for verbose output" }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "ctrl+t to toggle context" }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "ctrl+r to search history" }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "ctrl+c to interrupt" }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "ctrl+d to exit" }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "ctrl+l to redraw" }) })] }), _jsxs(Box, { flexDirection: "column", width: 24, flexShrink: 0, children: [_jsx(Box, { children: _jsx(Text, { dimColor: true, children: "esc to clear input" }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "\u2191/\u2193 for history" }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "\u2190/\u2192 to move cursor" }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "ctrl+\u2190/\u2192 for word jumps" }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "tab to complete command" }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "shift+tab to cycle effort" }) })] }), _jsxs(Box, { flexDirection: "column", flexShrink: 1, children: [_jsx(Text, { dimColor: true, children: "commands:" }), commands.map(command => (_jsx(Box, { children: _jsxs(Text, { dimColor: true, wrap: "truncate-end", children: ["/", command.name, " \u2014 ", command.description] }) }, command.name)))] })] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type HistoryEntry } from '../history.js';
|
|
3
|
+
/**
|
|
4
|
+
* The ctrl+r history search dialog, in the shape of the leak's
|
|
5
|
+
* HistorySearchDialog/FuzzyPicker: a permission-colored Pane with a bold
|
|
6
|
+
* title, the ⌕ SearchBox, the filtered history as ListItem rows (newest
|
|
7
|
+
* first), and the ↑/↓ · Enter · Esc hint line. Keyboard handling lives in
|
|
8
|
+
* the caller (Chat).
|
|
9
|
+
*/
|
|
10
|
+
export declare function HistorySearchDialog({ query, cursorOffset, matches, focusIndex, }: {
|
|
11
|
+
query: string;
|
|
12
|
+
cursorOffset: number;
|
|
13
|
+
matches: readonly HistoryEntry[];
|
|
14
|
+
focusIndex: number;
|
|
15
|
+
}): React.ReactNode;
|
|
16
|
+
//# sourceMappingURL=HistorySearchDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HistorySearchDialog.d.ts","sourceRoot":"","sources":["../../../src/components/HistorySearchDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjE;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,YAAY,EACZ,OAAO,EACP,UAAU,GACX,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;IAChC,UAAU,EAAE,MAAM,CAAA;CACnB,GAAG,KAAK,CAAC,SAAS,CAsClB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from '../ui.js';
|
|
3
|
+
import { useTerminalFocus } from '../ink/hooks/use-terminal-focus.js';
|
|
4
|
+
import { Pane } from './design-system/Pane.js';
|
|
5
|
+
import { ListItem } from './design-system/ListItem.js';
|
|
6
|
+
import { Byline } from './design-system/Byline.js';
|
|
7
|
+
import { KeyboardShortcutHint } from './design-system/KeyboardShortcutHint.js';
|
|
8
|
+
import { SearchBox } from './SearchBox.js';
|
|
9
|
+
import { historyEntryId } from '../history.js';
|
|
10
|
+
/**
|
|
11
|
+
* The ctrl+r history search dialog, in the shape of the leak's
|
|
12
|
+
* HistorySearchDialog/FuzzyPicker: a permission-colored Pane with a bold
|
|
13
|
+
* title, the ⌕ SearchBox, the filtered history as ListItem rows (newest
|
|
14
|
+
* first), and the ↑/↓ · Enter · Esc hint line. Keyboard handling lives in
|
|
15
|
+
* the caller (Chat).
|
|
16
|
+
*/
|
|
17
|
+
export function HistorySearchDialog({ query, cursorOffset, matches, focusIndex, }) {
|
|
18
|
+
const isTerminalFocused = useTerminalFocus();
|
|
19
|
+
return (_jsx(Pane, { color: "permission", children: _jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Text, { bold: true, color: "permission", children: "Search history" }), _jsx(SearchBox, { query: query, cursorOffset: cursorOffset, isFocused: true, isTerminalFocused: isTerminalFocused, placeholder: "Type to search\u2026" }), matches.length === 0 ? (_jsx(Text, { dimColor: true, children: "No matching commands" })) : (matches.map((entry, index) => (_jsx(ListItem, { isFocused: index === focusIndex, description: formatRelativeAge(entry.ts), children: entry.text }, historyEntryId(entry))))), _jsx(Text, { dimColor: true, italic: true, children: _jsxs(Byline, { children: [_jsx(KeyboardShortcutHint, { shortcut: "\u2191/\u2193", action: "navigate" }), _jsx(KeyboardShortcutHint, { shortcut: "Enter", action: "select", bold: true }), _jsx(KeyboardShortcutHint, { shortcut: "Esc", action: "cancel" })] }) })] }) }));
|
|
20
|
+
}
|
|
21
|
+
/** "now", "5m ago", "2h ago", "3d ago" — like CC's formatRelativeTimeAgo. */
|
|
22
|
+
function formatRelativeAge(ts) {
|
|
23
|
+
const elapsed = Date.now() - ts;
|
|
24
|
+
if (elapsed < 60_000)
|
|
25
|
+
return 'now';
|
|
26
|
+
if (elapsed < 3_600_000)
|
|
27
|
+
return `${Math.floor(elapsed / 60_000)}m ago`;
|
|
28
|
+
if (elapsed < 86_400_000)
|
|
29
|
+
return `${Math.floor(elapsed / 3_600_000)}h ago`;
|
|
30
|
+
return `${Math.floor(elapsed / 86_400_000)}d ago`;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InterruptedByUser.d.ts","sourceRoot":"","sources":["../../../src/components/InterruptedByUser.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,KAAK,CAAC,SAAS,CAOnD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from '../ui.js';
|
|
3
|
+
/**
|
|
4
|
+
* The dim "interrupted" row shown when the user stops a turn, ported from
|
|
5
|
+
* the leak's `InterruptedByUser.tsx`.
|
|
6
|
+
*/
|
|
7
|
+
export function InterruptedByUser() {
|
|
8
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { dimColor: true, children: "Interrupted " }), _jsx(Text, { dimColor: true, children: "\u00B7 What should DeepSeek do instead?" })] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { LoadedContext } from '../channel.js';
|
|
3
|
+
/**
|
|
4
|
+
* The startup context panel: a collapsed one-line summary of what a
|
|
5
|
+
* fresh conversation will load for the current agent (system prompt
|
|
6
|
+
* sections, workspace instruction files, dynamic context, skill catalog,
|
|
7
|
+
* tools). Toggle with Ctrl+T (see HelpMenu; the ported ink core has no
|
|
8
|
+
* mouse-click handling, so the header is not clickable); the panel renders
|
|
9
|
+
* only while the transcript is still empty — the first message's rows take
|
|
10
|
+
* over. Renders nothing for an empty snapshot.
|
|
11
|
+
* @param context - the channel's loaded-context snapshot.
|
|
12
|
+
* @param open - whether the grouped details are shown.
|
|
13
|
+
* @param onToggle - flips `open`; fired by the Ctrl+T keybinding.
|
|
14
|
+
*/
|
|
15
|
+
export declare function LoadedContextPanel({ context, open, onToggle, }: {
|
|
16
|
+
context: LoadedContext;
|
|
17
|
+
open: boolean;
|
|
18
|
+
onToggle: () => void;
|
|
19
|
+
}): React.ReactNode;
|
|
20
|
+
//# sourceMappingURL=LoadedContextPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadedContextPanel.d.ts","sourceRoot":"","sources":["../../../src/components/LoadedContextPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,aAAa,EAAsB,MAAM,eAAe,CAAA;AA+BtE;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,aAAa,CAAA;IACtB,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,GAAG,KAAK,CAAC,SAAS,CAkElB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t } from '../i18n.js';
|
|
3
|
+
import { Box, Text } from '../ui.js';
|
|
4
|
+
import { summarizeLoadedContext, truncateContextText } from '../utils/loaded-context.js';
|
|
5
|
+
/** One named entry (section or dynamic context) with its full text. */
|
|
6
|
+
function Entry({ entry }) {
|
|
7
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, dimColor: true, children: entry.name }), _jsx(Text, { dimColor: true, wrap: "wrap", children: truncateContextText(entry.text) })] }));
|
|
8
|
+
}
|
|
9
|
+
/** A titled group of rows inside the expanded panel. */
|
|
10
|
+
function Group({ title, children }) {
|
|
11
|
+
return (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { bold: true, color: "subtle", children: title }), _jsx(Box, { flexDirection: "column", paddingLeft: 2, children: children })] }));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The startup context panel: a collapsed one-line summary of what a
|
|
15
|
+
* fresh conversation will load for the current agent (system prompt
|
|
16
|
+
* sections, workspace instruction files, dynamic context, skill catalog,
|
|
17
|
+
* tools). Toggle with Ctrl+T (see HelpMenu; the ported ink core has no
|
|
18
|
+
* mouse-click handling, so the header is not clickable); the panel renders
|
|
19
|
+
* only while the transcript is still empty — the first message's rows take
|
|
20
|
+
* over. Renders nothing for an empty snapshot.
|
|
21
|
+
* @param context - the channel's loaded-context snapshot.
|
|
22
|
+
* @param open - whether the grouped details are shown.
|
|
23
|
+
* @param onToggle - flips `open`; fired by the Ctrl+T keybinding.
|
|
24
|
+
*/
|
|
25
|
+
export function LoadedContextPanel({ context, open, onToggle, }) {
|
|
26
|
+
const summary = summarizeLoadedContext(context);
|
|
27
|
+
if (summary === '')
|
|
28
|
+
return null;
|
|
29
|
+
return (_jsxs(Box, { flexDirection: "column", marginTop: 1, marginBottom: 1, children: [_jsxs(Box, { paddingX: 1, backgroundColor: open ? 'userMessageBackground' : undefined, children: [_jsxs(Text, { bold: open, children: [open ? '▼' : '▶', " ", t('context-loaded'), " \u00B7 ", summary] }), _jsxs(Text, { dimColor: true, children: [" \uFF08Ctrl+T", open ? t('context-panel-collapse') : t('context-panel-expand'), "\uFF09"] })] }), open && (_jsxs(Box, { flexDirection: "column", paddingX: 1, paddingTop: 1, children: [context.sections.length > 0 && (_jsx(Group, { title: t('context-panel-sections', { n: context.sections.length }), children: context.sections.map(section => (_jsx(Entry, { entry: section }, section.name))) })), context.files.length > 0 && (_jsx(Group, { title: t('context-panel-files', { n: context.files.length }), children: context.files.map(file => (_jsx(Text, { dimColor: true, children: file.displayPath }, file.displayPath))) })), context.contexts.length > 0 && (_jsx(Group, { title: t('context-panel-runtime', { n: context.contexts.length }), children: context.contexts.map(entry => (_jsx(Entry, { entry: entry }, entry.name))) })), context.skills.length > 0 && (_jsx(Group, { title: t('context-panel-skills', { n: context.skills.length }), children: context.skills.map(skill => (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, dimColor: true, children: skill.name }), _jsx(Text, { dimColor: true, wrap: "wrap", children: skill.description })] }, skill.name))) })), context.tools.length > 0 && (_jsx(Group, { title: t('context-panel-tools', { n: context.tools.length }), children: context.tools.map(tool => (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, dimColor: true, children: tool.name }), _jsx(Text, { dimColor: true, wrap: "wrap", children: truncateContextText(tool.description, 160) })] }, tool.name))) }))] }))] }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The header splash: one layout, two phases. The **opening** (~3.4s, once)
|
|
4
|
+
* plays the hand-drawn whale animation (blink → water-spout bloom → tail
|
|
5
|
+
* wag) and runs the shimmer sweeps; the **settled** header is the same
|
|
6
|
+
* tree frozen at t=0 — whale on the standard pose, sweep highlights parked
|
|
7
|
+
* off-screen, clock unsubscribed, zero timers.
|
|
8
|
+
*
|
|
9
|
+
* Layout: the 13-row pixel whale beside a text column of matching height —
|
|
10
|
+
* the `✦ dsh-TUI` wordmark with version, the `DEEPSEEK`/`HARNESS` tagline in
|
|
11
|
+
* the 5-row block font (brand-blue → ice gradient), the model/effort and
|
|
12
|
+
* cwd in plain text (no brand-color highlight), the startup tip, and below
|
|
13
|
+
* the whale the welcome tagline, centered under the art, in ice
|
|
14
|
+
* blue. Narrow terminals drop the whale and keep the text column.
|
|
15
|
+
*/
|
|
16
|
+
export declare function LogoV2({ model, effort, cwd, skipIntro, }: {
|
|
17
|
+
model: string;
|
|
18
|
+
effort?: string | undefined;
|
|
19
|
+
cwd: string;
|
|
20
|
+
/** Test seam: mount straight into the settled header (probes skip the intro). */
|
|
21
|
+
skipIntro?: boolean;
|
|
22
|
+
}): React.ReactNode;
|
|
23
|
+
//# sourceMappingURL=LogoV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogoV2.d.ts","sourceRoot":"","sources":["../../../src/components/LogoV2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAoDzB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,MAAM,EACN,GAAG,EACH,SAAiB,GAClB,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,iFAAiF;IACjF,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,KAAK,CAAC,SAAS,CA+ElB"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { t as tr } from '../i18n.js';
|
|
4
|
+
import { readFileSync } from 'node:fs';
|
|
5
|
+
import { dirname, join } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import { Box, Text, useAnimationFrame, useTerminalSize } from '../ui.js';
|
|
8
|
+
import { getTheme } from '../theme.js';
|
|
9
|
+
import { useTheme } from './design-system/ThemeProvider.js';
|
|
10
|
+
import { parseRGB } from './Spinner/spinnerUtils.js';
|
|
11
|
+
import { renderBigText } from './bigfont.js';
|
|
12
|
+
import { BRAND, FLASH, ICE, PALE, sweep } from './shimmer.js';
|
|
13
|
+
import { STANDARD_FRAME_INDEX, WhaleArt } from './Whale.js';
|
|
14
|
+
import { OPENING_SEQUENCE } from './whaleFrames.js';
|
|
15
|
+
/**
|
|
16
|
+
* Header badge version, read from the installed package.json so the display
|
|
17
|
+
* never drifts from the published version. Falls back to a literal when the
|
|
18
|
+
* package metadata is unreadable (unusual layouts).
|
|
19
|
+
*/
|
|
20
|
+
const VERSION = (() => {
|
|
21
|
+
try {
|
|
22
|
+
const pkgPath = join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..', 'package.json');
|
|
23
|
+
return JSON.parse(readFileSync(pkgPath, 'utf8')).version ?? '0.1.0';
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return '0.1.0';
|
|
27
|
+
}
|
|
28
|
+
})();
|
|
29
|
+
/** Below this width the whale hides and the header goes text-only. */
|
|
30
|
+
const WHALE_MIN_COLUMNS = 64;
|
|
31
|
+
/**
|
|
32
|
+
* Fixed whale box width: the tail-wag frames reach 4 columns further right
|
|
33
|
+
* than the standard pose, and a pinned width keeps the text column from
|
|
34
|
+
* shifting sideways during the opening animation.
|
|
35
|
+
*/
|
|
36
|
+
const FULL_WHALE_WIDTH = 40;
|
|
37
|
+
/**
|
|
38
|
+
* Leading spaces that center the welcome line under the drawn whale: the
|
|
39
|
+
* art's bounding box spans sprite columns 3..34 (center 18.5) of the
|
|
40
|
+
* 40-wide box, and the tagline measure 14
|
|
41
|
+
* columns — 18.5 − 7 = 11.5 → 12. Centered on the full 40-column box
|
|
42
|
+
* instead would need 13, which reads one column right of the whale body.
|
|
43
|
+
*/
|
|
44
|
+
const WELCOME_PAD = 12;
|
|
45
|
+
/** `max` → `Max` (effort levels arrive lower-case from the adapter). */
|
|
46
|
+
function capitalize(text) {
|
|
47
|
+
return text.length === 0 ? text : text[0].toUpperCase() + text.slice(1);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The header splash: one layout, two phases. The **opening** (~3.4s, once)
|
|
51
|
+
* plays the hand-drawn whale animation (blink → water-spout bloom → tail
|
|
52
|
+
* wag) and runs the shimmer sweeps; the **settled** header is the same
|
|
53
|
+
* tree frozen at t=0 — whale on the standard pose, sweep highlights parked
|
|
54
|
+
* off-screen, clock unsubscribed, zero timers.
|
|
55
|
+
*
|
|
56
|
+
* Layout: the 13-row pixel whale beside a text column of matching height —
|
|
57
|
+
* the `✦ dsh-TUI` wordmark with version, the `DEEPSEEK`/`HARNESS` tagline in
|
|
58
|
+
* the 5-row block font (brand-blue → ice gradient), the model/effort and
|
|
59
|
+
* cwd in plain text (no brand-color highlight), the startup tip, and below
|
|
60
|
+
* the whale the welcome tagline, centered under the art, in ice
|
|
61
|
+
* blue. Narrow terminals drop the whale and keep the text column.
|
|
62
|
+
*/
|
|
63
|
+
export function LogoV2({ model, effort, cwd, skipIntro = false, }) {
|
|
64
|
+
const [step, setStep] = React.useState(skipIntro ? OPENING_SEQUENCE.length : 0);
|
|
65
|
+
const settled = step >= OPENING_SEQUENCE.length;
|
|
66
|
+
// Opening clock: drives the shimmer sweep and big-text highlight only
|
|
67
|
+
// while the intro plays; `null` afterwards unsubscribes so the settled
|
|
68
|
+
// header never repaints. 60ms frames keep the sweep lively.
|
|
69
|
+
const [ref, time] = useAnimationFrame(settled ? null : 60);
|
|
70
|
+
// Frame chain: dwell per OPENING_SEQUENCE entry, then settle for good.
|
|
71
|
+
React.useEffect(() => {
|
|
72
|
+
if (settled)
|
|
73
|
+
return;
|
|
74
|
+
const timer = setTimeout(() => {
|
|
75
|
+
setStep(s => s + 1);
|
|
76
|
+
}, OPENING_SEQUENCE[step].ms);
|
|
77
|
+
return () => {
|
|
78
|
+
clearTimeout(timer);
|
|
79
|
+
};
|
|
80
|
+
}, [step, settled]);
|
|
81
|
+
const [themeName] = useTheme();
|
|
82
|
+
const theme = getTheme(themeName);
|
|
83
|
+
const { columns } = useTerminalSize();
|
|
84
|
+
const wordmarkRGB = parseRGB(theme.claude) ?? BRAND;
|
|
85
|
+
const wordmarkShimmerRGB = parseRGB(theme.claudeShimmer) ?? ICE;
|
|
86
|
+
const taglineRGB = parseRGB(theme.claudeBlue_FOR_SYSTEM_SPINNER) ?? ICE;
|
|
87
|
+
const showWhale = columns >= WHALE_MIN_COLUMNS;
|
|
88
|
+
const frameIndex = settled ? STANDARD_FRAME_INDEX : OPENING_SEQUENCE[step].frame;
|
|
89
|
+
// Frozen clock for the settled header: t=0 parks every sweep highlight
|
|
90
|
+
// off-screen, leaving the static gradient behind.
|
|
91
|
+
const t = settled ? 0 : time;
|
|
92
|
+
const bigDeepSeek = renderBigText('DEEPSEEK', t, wordmarkRGB, taglineRGB, FLASH, 60);
|
|
93
|
+
const bigHarness = renderBigText('HARNESS', t, taglineRGB, PALE, FLASH, 60);
|
|
94
|
+
return (_jsxs(Box, { ref: ref, flexDirection: "column", marginTop: 1, children: [_jsxs(Box, { flexDirection: "row", gap: 2, width: "100%", alignItems: "center", children: [showWhale && _jsx(WhaleArt, { frameIndex: frameIndex, width: FULL_WHALE_WIDTH }), _jsxs(Box, { flexDirection: "column", flexShrink: 1, children: [_jsxs(Text, { wrap: "truncate-end", children: [sweep('✦ dsh-TUI', t, wordmarkRGB, wordmarkShimmerRGB, 60), _jsx(Text, { dimColor: true, children: ' v' + VERSION })] }), bigDeepSeek.map((row, index) => (_jsx(Text, { wrap: "truncate-end", children: row }, `ds-${index}`))), bigHarness.map((row, index) => (_jsx(Text, { wrap: "truncate-end", children: row }, `h-${index}`))), _jsxs(Text, { wrap: "truncate-end", children: [model, effort !== undefined && _jsx(Text, { dimColor: true, children: ' · ' + capitalize(effort) + ' effort' })] }), _jsx(Text, { dimColor: true, wrap: "truncate-end", children: cwd }), _jsxs(Text, { wrap: "truncate-end", children: [_jsx(Text, { dimColor: true, children: "Tip: " }), "/model", _jsxs(Text, { dimColor: true, children: [" ", tr('logo-tip-model'), " \u00B7 "] }), "/help", _jsxs(Text, { dimColor: true, children: [" ", tr('logo-tip-help'), " \u00B7 "] }), "Tab", _jsxs(Text, { dimColor: true, children: [" ", tr('logo-tip-tab')] })] })] })] }), _jsx(Box, { marginTop: 1, paddingLeft: showWhale ? WELCOME_PAD : 2, children: _jsx(Text, { children: sweep(tr('logo-tagline'), t, taglineRGB, FLASH, 60) }) })] }));
|
|
95
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Markdown renderer ported from Claude Code (the leak's `Markdown.tsx`):
|
|
4
|
+
* marked lexer + ANSI formatter, tables rendered as flexbox-style bordered
|
|
5
|
+
* components, async syntax highlighting via cli-highlight. The ANSI strings
|
|
6
|
+
* render inside raw `Text` (the ported Ink core preserves ANSI in children;
|
|
7
|
+
* the fork's `Ansi` span parser drops SGR 1 bold).
|
|
8
|
+
*/
|
|
9
|
+
type Props = {
|
|
10
|
+
children: string;
|
|
11
|
+
/** When true, render all text content as dim */
|
|
12
|
+
dimColor?: boolean;
|
|
13
|
+
/** False for the streaming tail (its content changes every chunk, so a
|
|
14
|
+
* cache entry would never hit and would only pollute the token cache). */
|
|
15
|
+
cacheTokens?: boolean;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Renders markdown content using a hybrid approach:
|
|
19
|
+
* - Tables are rendered as bordered flexbox components
|
|
20
|
+
* - Other content is rendered as ANSI strings via formatToken
|
|
21
|
+
*/
|
|
22
|
+
export declare function Markdown({ children, dimColor, cacheTokens }: Props): React.ReactNode;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=Markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB;;;;;;GAMG;AAEH,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;+EAC2E;IAC3E,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AA8DD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,QAAgB,EAAE,WAAkB,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CAuDnG"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { marked } from 'marked';
|
|
4
|
+
import { Box, Text } from '../ui.js';
|
|
5
|
+
import { configureMarked, formatToken, stripPromptXMLTags } from '../cc/markdown.js';
|
|
6
|
+
import { getCliHighlightPromise } from '../cc/cliHighlight.js';
|
|
7
|
+
import { MarkdownTable } from './MarkdownTable.js';
|
|
8
|
+
// Module-level token cache — marked.lexer is the hot cost on remounts.
|
|
9
|
+
// Messages are immutable; same content → same tokens.
|
|
10
|
+
//
|
|
11
|
+
// Bounds: entry count alone was not enough. Token.raw/text values are
|
|
12
|
+
// slices of the lexed input, so each entry pins its entire input string;
|
|
13
|
+
// during streaming the input grows every frame, and the LRU kept 500
|
|
14
|
+
// near-final snapshots ≈ 500 × message size resident (~500MB for a 1MB
|
|
15
|
+
// message). A character budget caps retained bytes; oversized contents
|
|
16
|
+
// skip the cache entirely (they are re-lexed on remount — rare, and
|
|
17
|
+
// cheaper than the retention).
|
|
18
|
+
const TOKEN_CACHE_MAX = 200;
|
|
19
|
+
const TOKEN_CACHE_MAX_CHARS = 200_000;
|
|
20
|
+
const TOKEN_CACHE_MAX_CONTENT = 20_000;
|
|
21
|
+
const tokenCache = new Map();
|
|
22
|
+
let tokenCacheChars = 0;
|
|
23
|
+
// Characters that indicate markdown syntax. If none are present, skip the
|
|
24
|
+
// ~3ms marked.lexer call entirely — render as a single paragraph.
|
|
25
|
+
const MD_SYNTAX_RE = /[#*`|[>\-_~]|\n\n|^\d+\. |\n\d+\. /;
|
|
26
|
+
function hasMarkdownSyntax(s) {
|
|
27
|
+
return MD_SYNTAX_RE.test(s.length > 500 ? s.slice(0, 500) : s);
|
|
28
|
+
}
|
|
29
|
+
function cachedLexer(content, cache) {
|
|
30
|
+
// Fast path: plain text with no markdown syntax → single paragraph token.
|
|
31
|
+
if (!hasMarkdownSyntax(content)) {
|
|
32
|
+
return [
|
|
33
|
+
{
|
|
34
|
+
type: 'paragraph',
|
|
35
|
+
raw: content,
|
|
36
|
+
text: content,
|
|
37
|
+
tokens: [{ type: 'text', raw: content, text: content }],
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
if (!cache)
|
|
42
|
+
return marked.lexer(content);
|
|
43
|
+
// The content string itself is the key: V8 caches the string hash in the
|
|
44
|
+
// string header, so Map lookup is hash-free after the first insert, and
|
|
45
|
+
// unlike sha256 there is no per-call digest allocation or collision risk.
|
|
46
|
+
const hit = tokenCache.get(content);
|
|
47
|
+
if (hit) {
|
|
48
|
+
// Promote to MRU
|
|
49
|
+
tokenCache.delete(content);
|
|
50
|
+
tokenCache.set(content, hit);
|
|
51
|
+
return hit;
|
|
52
|
+
}
|
|
53
|
+
const tokens = marked.lexer(content);
|
|
54
|
+
if (content.length > TOKEN_CACHE_MAX_CONTENT)
|
|
55
|
+
return tokens;
|
|
56
|
+
if (tokenCache.size >= TOKEN_CACHE_MAX ||
|
|
57
|
+
tokenCacheChars + content.length > TOKEN_CACHE_MAX_CHARS) {
|
|
58
|
+
tokenCache.clear();
|
|
59
|
+
tokenCacheChars = 0;
|
|
60
|
+
}
|
|
61
|
+
tokenCache.set(content, tokens);
|
|
62
|
+
tokenCacheChars += content.length;
|
|
63
|
+
return tokens;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Renders markdown content using a hybrid approach:
|
|
67
|
+
* - Tables are rendered as bordered flexbox components
|
|
68
|
+
* - Other content is rendered as ANSI strings via formatToken
|
|
69
|
+
*/
|
|
70
|
+
export function Markdown({ children, dimColor = false, cacheTokens = true }) {
|
|
71
|
+
const [highlight, setHighlight] = React.useState(null);
|
|
72
|
+
React.useEffect(() => {
|
|
73
|
+
let alive = true;
|
|
74
|
+
void getCliHighlightPromise().then((loaded) => {
|
|
75
|
+
if (alive)
|
|
76
|
+
setHighlight(loaded);
|
|
77
|
+
});
|
|
78
|
+
return () => {
|
|
79
|
+
alive = false;
|
|
80
|
+
};
|
|
81
|
+
}, []);
|
|
82
|
+
configureMarked();
|
|
83
|
+
const elements = React.useMemo(() => {
|
|
84
|
+
const tokens = cachedLexer(stripPromptXMLTags(children), cacheTokens);
|
|
85
|
+
const elements = [];
|
|
86
|
+
let nonTableContent = '';
|
|
87
|
+
function flushNonTableContent() {
|
|
88
|
+
if (nonTableContent) {
|
|
89
|
+
elements.push(_jsx(Text, { dimColor: dimColor, children: nonTableContent.trim() }, elements.length));
|
|
90
|
+
nonTableContent = '';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
for (const token of tokens) {
|
|
94
|
+
if (token.type === 'table') {
|
|
95
|
+
flushNonTableContent();
|
|
96
|
+
elements.push(_jsx(MarkdownTable, { token: token, highlight: highlight }, elements.length));
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
nonTableContent += formatToken(token, 0, null, null, highlight);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
flushNonTableContent();
|
|
103
|
+
return elements;
|
|
104
|
+
}, [children, dimColor, highlight, cacheTokens]);
|
|
105
|
+
return (_jsx(Box, { flexDirection: "column", gap: 1, children: elements }));
|
|
106
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Tokens } from 'marked';
|
|
3
|
+
import type { CliHighlight } from '../cc/cliHighlight.js';
|
|
4
|
+
type Props = {
|
|
5
|
+
token: Tokens.Table;
|
|
6
|
+
highlight: CliHighlight | null;
|
|
7
|
+
/** Override terminal width (useful for testing) */
|
|
8
|
+
forceWidth?: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Renders a markdown table with proper column sizing, cell wrapping and box
|
|
12
|
+
* borders (ported from the leak's `MarkdownTable.tsx`). Falls back to a
|
|
13
|
+
* vertical key-value format on narrow terminals.
|
|
14
|
+
*/
|
|
15
|
+
export declare function MarkdownTable({ token, highlight, forceWidth, }: Props): React.ReactNode;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=MarkdownTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownTable.d.ts","sourceRoot":"","sources":["../../../src/components/MarkdownTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAA;AAO3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAiBzD,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC,KAAK,CAAA;IACnB,SAAS,EAAE,YAAY,GAAG,IAAI,CAAA;IAC9B,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AA2BD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,SAAS,EACT,UAAU,GACX,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CAmRzB"}
|