@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,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Child-process stderr guard (issue #17).
|
|
3
|
+
*
|
|
4
|
+
* MCP servers spawned through `@deepseek-ai/dsh-mcp-client` run under the MCP
|
|
5
|
+
* SDK's `StdioClientTransport`, whose stderr defaults to `'inherit'`
|
|
6
|
+
* (`stdio: ['pipe', 'pipe', server.stderr ?? 'inherit']`). An inherited fd 2
|
|
7
|
+
* is written by the CHILD process straight to the terminal device — those
|
|
8
|
+
* bytes never pass through this process's patched `process.stderr.write`
|
|
9
|
+
* (see `ink.tsx` patchStderr), so they land at the parked cursor, scroll the
|
|
10
|
+
* alt-screen, and interleave with the diff renderer's absolute-coordinate
|
|
11
|
+
* writes. A server in a reconnect loop (e.g. a proxy repeatedly printing
|
|
12
|
+
* `Error: Non-HTTPS URLs ...` + its usage line) turns that into the
|
|
13
|
+
* overlapping garbage shown in the issue screenshot.
|
|
14
|
+
*
|
|
15
|
+
* The guard patches `child_process.spawn` and rewrites requests whose stderr
|
|
16
|
+
* would be inherited (`'inherit'` as the whole-stdio string, stdio array slot
|
|
17
|
+
* 2, or raw fd 2) to a pipe, then drains the pipe line by line into a sink.
|
|
18
|
+
* Only fd 2 is touched; stdin/stdout keep their requested modes, so MCP's
|
|
19
|
+
* JSON-RPC stdio channel is unaffected.
|
|
20
|
+
*
|
|
21
|
+
* Reachability note: the MCP SDK spawns via `cross-spawn`, which reads
|
|
22
|
+
* `child_process.spawn` off the CJS exports object at call time, so this
|
|
23
|
+
* patch covers it (verified by scripts/verify-child-stderr.tsx). A consumer
|
|
24
|
+
* holding a snapshotted ESM named import (`import { spawn } from
|
|
25
|
+
* 'node:child_process'`) would bypass the patch — no known consumer in the
|
|
26
|
+
* dependency tree does that.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Take over inherited child stderr for the TUI's lifetime: any `spawn` whose
|
|
30
|
+
* stderr would hit the terminal directly is piped and drained into `sink`
|
|
31
|
+
* instead. Returns a restore function that reverts the patch; in-flight
|
|
32
|
+
* children keep their (already piped) streams.
|
|
33
|
+
*/
|
|
34
|
+
export declare function installChildStderrGuard(sink: (line: string) => void): () => void;
|
|
35
|
+
/** Notification callback signature — structurally `Channel['notify']`. */
|
|
36
|
+
export interface ChildStderrNotify {
|
|
37
|
+
(text: string, options?: {
|
|
38
|
+
color?: 'error' | 'warning' | 'success';
|
|
39
|
+
timeoutMs?: number;
|
|
40
|
+
}): void;
|
|
41
|
+
}
|
|
42
|
+
export interface ChildStderrReporterOptions {
|
|
43
|
+
/** Quiet window that batches a burst of repeats into one notice (default 1500ms). */
|
|
44
|
+
debounceMs?: number;
|
|
45
|
+
/** After a notice, the same line stays silent for this long (default 30s). */
|
|
46
|
+
cooldownMs?: number;
|
|
47
|
+
/** Single-line length cap; longer lines are truncated with an ellipsis (default 200). */
|
|
48
|
+
maxLineLength?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface ChildStderrReporter {
|
|
51
|
+
/** Feed one raw stderr line. */
|
|
52
|
+
push(line: string): void;
|
|
53
|
+
/** Cancel pending debounce timers (teardown). */
|
|
54
|
+
dispose(): void;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Turn a raw child-stderr line stream into bounded, deduplicated
|
|
58
|
+
* notifications: identical lines inside a short debounce window collapse into
|
|
59
|
+
* one "(重复 N 次)" notice, and a line that was just shown stays silent for
|
|
60
|
+
* a cooldown so a failing reconnect loop can't spam the status area.
|
|
61
|
+
*/
|
|
62
|
+
export declare function createChildStderrReporter(notify: ChildStderrNotify, options?: ChildStderrReporterOptions): ChildStderrReporter;
|
|
63
|
+
//# sourceMappingURL=childStderr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"childStderr.d.ts","sourceRoot":"","sources":["../../src/childStderr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAsDH;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI,CA8BhF;AAED,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IAChC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAChG;AAED,MAAM,WAAW,0BAA0B;IACzC,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,gCAAgC;IAChC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,iDAAiD;IACjD,OAAO,IAAI,IAAI,CAAA;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,iBAAiB,EACzB,OAAO,GAAE,0BAA+B,GACvC,mBAAmB,CA4CrB"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Child-process stderr guard (issue #17).
|
|
3
|
+
*
|
|
4
|
+
* MCP servers spawned through `@deepseek-ai/dsh-mcp-client` run under the MCP
|
|
5
|
+
* SDK's `StdioClientTransport`, whose stderr defaults to `'inherit'`
|
|
6
|
+
* (`stdio: ['pipe', 'pipe', server.stderr ?? 'inherit']`). An inherited fd 2
|
|
7
|
+
* is written by the CHILD process straight to the terminal device — those
|
|
8
|
+
* bytes never pass through this process's patched `process.stderr.write`
|
|
9
|
+
* (see `ink.tsx` patchStderr), so they land at the parked cursor, scroll the
|
|
10
|
+
* alt-screen, and interleave with the diff renderer's absolute-coordinate
|
|
11
|
+
* writes. A server in a reconnect loop (e.g. a proxy repeatedly printing
|
|
12
|
+
* `Error: Non-HTTPS URLs ...` + its usage line) turns that into the
|
|
13
|
+
* overlapping garbage shown in the issue screenshot.
|
|
14
|
+
*
|
|
15
|
+
* The guard patches `child_process.spawn` and rewrites requests whose stderr
|
|
16
|
+
* would be inherited (`'inherit'` as the whole-stdio string, stdio array slot
|
|
17
|
+
* 2, or raw fd 2) to a pipe, then drains the pipe line by line into a sink.
|
|
18
|
+
* Only fd 2 is touched; stdin/stdout keep their requested modes, so MCP's
|
|
19
|
+
* JSON-RPC stdio channel is unaffected.
|
|
20
|
+
*
|
|
21
|
+
* Reachability note: the MCP SDK spawns via `cross-spawn`, which reads
|
|
22
|
+
* `child_process.spawn` off the CJS exports object at call time, so this
|
|
23
|
+
* patch covers it (verified by scripts/verify-child-stderr.tsx). A consumer
|
|
24
|
+
* holding a snapshotted ESM named import (`import { spawn } from
|
|
25
|
+
* 'node:child_process'`) would bypass the patch — no known consumer in the
|
|
26
|
+
* dependency tree does that.
|
|
27
|
+
*/
|
|
28
|
+
import childProcess from 'node:child_process';
|
|
29
|
+
import { t } from './i18n.js';
|
|
30
|
+
/** Strip ANSI escape sequences (CSI/OSC) so raw child output can't inject
|
|
31
|
+
* cursor moves or colors into the notification area. */
|
|
32
|
+
// eslint-disable-next-line no-control-regex -- intentional: matching terminal escape sequences
|
|
33
|
+
const ANSI_PATTERN = /[\u001b\u009b][[\]()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><~]|\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)/g;
|
|
34
|
+
/**
|
|
35
|
+
* Rewrite spawn options so an inherited stderr (fd 2) becomes a pipe.
|
|
36
|
+
* Returns the adjusted options, or undefined when stderr is not inherited
|
|
37
|
+
* (default/'pipe'/'ignore'/explicit stream) and the spawn needs no takeover.
|
|
38
|
+
*/
|
|
39
|
+
function redirectInheritedStderr(options) {
|
|
40
|
+
const stdio = options.stdio;
|
|
41
|
+
if (stdio === undefined || stdio === null)
|
|
42
|
+
return undefined;
|
|
43
|
+
if (typeof stdio === 'string') {
|
|
44
|
+
// The string form applies to all three fds; keep stdin/stdout inherited.
|
|
45
|
+
if (stdio !== 'inherit')
|
|
46
|
+
return undefined;
|
|
47
|
+
return { ...options, stdio: ['inherit', 'inherit', 'pipe'] };
|
|
48
|
+
}
|
|
49
|
+
if (Array.isArray(stdio)) {
|
|
50
|
+
// A short array leaves fd 2 at the 'pipe' default — already safe.
|
|
51
|
+
const stderr = stdio[2];
|
|
52
|
+
if (stderr !== 'inherit' && stderr !== 2)
|
|
53
|
+
return undefined;
|
|
54
|
+
const next = [...stdio];
|
|
55
|
+
next[2] = 'pipe';
|
|
56
|
+
return { ...options, stdio: next };
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
/** Drain a piped stderr stream, forwarding complete lines (and the unterminated tail) to the sink. */
|
|
61
|
+
function drainLines(stream, sink) {
|
|
62
|
+
let pending = '';
|
|
63
|
+
stream.on('data', (chunk) => {
|
|
64
|
+
pending += chunk.toString();
|
|
65
|
+
let newline = pending.indexOf('\n');
|
|
66
|
+
while (newline >= 0) {
|
|
67
|
+
sink(pending.slice(0, newline));
|
|
68
|
+
pending = pending.slice(newline + 1);
|
|
69
|
+
newline = pending.indexOf('\n');
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
stream.on('end', () => {
|
|
73
|
+
if (pending.length > 0)
|
|
74
|
+
sink(pending);
|
|
75
|
+
});
|
|
76
|
+
stream.on('error', () => {
|
|
77
|
+
// A broken stderr pipe must never take the TUI down.
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Take over inherited child stderr for the TUI's lifetime: any `spawn` whose
|
|
82
|
+
* stderr would hit the terminal directly is piped and drained into `sink`
|
|
83
|
+
* instead. Returns a restore function that reverts the patch; in-flight
|
|
84
|
+
* children keep their (already piped) streams.
|
|
85
|
+
*/
|
|
86
|
+
export function installChildStderrGuard(sink) {
|
|
87
|
+
const original = childProcess.spawn;
|
|
88
|
+
const patched = function (command, argsOrOptions, maybeOptions) {
|
|
89
|
+
let args;
|
|
90
|
+
let options;
|
|
91
|
+
if (Array.isArray(argsOrOptions)) {
|
|
92
|
+
args = argsOrOptions;
|
|
93
|
+
options = maybeOptions ?? {};
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
args = [];
|
|
97
|
+
// Array.isArray doesn't exclude `readonly string[]` in the else branch.
|
|
98
|
+
options = argsOrOptions ?? maybeOptions ?? {};
|
|
99
|
+
}
|
|
100
|
+
const redirected = redirectInheritedStderr(options);
|
|
101
|
+
const child = original.call(childProcess, command, args, redirected ?? options);
|
|
102
|
+
if (redirected !== undefined && child.stderr !== null) {
|
|
103
|
+
drainLines(child.stderr, sink);
|
|
104
|
+
}
|
|
105
|
+
return child;
|
|
106
|
+
};
|
|
107
|
+
childProcess.spawn = patched;
|
|
108
|
+
return () => {
|
|
109
|
+
if (childProcess.spawn === patched) {
|
|
110
|
+
childProcess.spawn = original;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Turn a raw child-stderr line stream into bounded, deduplicated
|
|
116
|
+
* notifications: identical lines inside a short debounce window collapse into
|
|
117
|
+
* one "(重复 N 次)" notice, and a line that was just shown stays silent for
|
|
118
|
+
* a cooldown so a failing reconnect loop can't spam the status area.
|
|
119
|
+
*/
|
|
120
|
+
export function createChildStderrReporter(notify, options = {}) {
|
|
121
|
+
const debounceMs = options.debounceMs ?? 1500;
|
|
122
|
+
const cooldownMs = options.cooldownMs ?? 30_000;
|
|
123
|
+
const maxLineLength = options.maxLineLength ?? 200;
|
|
124
|
+
const groups = new Map();
|
|
125
|
+
const mutedUntil = new Map();
|
|
126
|
+
return {
|
|
127
|
+
push(raw) {
|
|
128
|
+
const cleaned = raw.replace(ANSI_PATTERN, '').trim();
|
|
129
|
+
if (cleaned.length === 0)
|
|
130
|
+
return;
|
|
131
|
+
const line = cleaned.length > maxLineLength ? `${cleaned.slice(0, maxLineLength)}…` : cleaned;
|
|
132
|
+
const existing = groups.get(line);
|
|
133
|
+
if (existing !== undefined) {
|
|
134
|
+
existing.count += 1;
|
|
135
|
+
clearTimeout(existing.timer);
|
|
136
|
+
existing.timer = setTimeout(flush, debounceMs);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
groups.set(line, { count: 1, timer: setTimeout(flush, debounceMs) });
|
|
140
|
+
function flush() {
|
|
141
|
+
const group = groups.get(line);
|
|
142
|
+
if (group === undefined)
|
|
143
|
+
return;
|
|
144
|
+
groups.delete(line);
|
|
145
|
+
// A burst inside the cooldown window is counted but stays silent.
|
|
146
|
+
if ((mutedUntil.get(line) ?? 0) > Date.now())
|
|
147
|
+
return;
|
|
148
|
+
mutedUntil.set(line, Date.now() + cooldownMs);
|
|
149
|
+
const text = group.count > 1
|
|
150
|
+
? t('child-stderr-line-repeat', { line, count: group.count })
|
|
151
|
+
: t('child-stderr-line', { line });
|
|
152
|
+
notify(text, { color: 'error', timeoutMs: 8000 });
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
dispose() {
|
|
156
|
+
for (const group of groups.values())
|
|
157
|
+
clearTimeout(group.timer);
|
|
158
|
+
groups.clear();
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local slash commands for the dsh-tui TUI. Claude Code's command system is
|
|
3
|
+
* deeply wired into its engine; dsh-tui ships a small built-in set with the
|
|
4
|
+
* same `/name — description` suggestion chrome, and merges plugin-registered
|
|
5
|
+
* commands (plan/goal/…) from the DSH command registry (`dsh-commands`) —
|
|
6
|
+
* `runCommand` in the Chat screen dispatches either kind, with the registry
|
|
7
|
+
* handler winning for names both sides declare.
|
|
8
|
+
*/
|
|
9
|
+
export interface LocalCommand {
|
|
10
|
+
/** The command name without the slash, e.g. `clear`. */
|
|
11
|
+
name: string;
|
|
12
|
+
/** One-line description shown in the suggestion overlay. */
|
|
13
|
+
description: string;
|
|
14
|
+
/** Optional bracket tag shown between name and description. */
|
|
15
|
+
tag?: string;
|
|
16
|
+
/** True when a DSH plugin registered this command (not built in). */
|
|
17
|
+
external?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The built-in slash commands (name + description pairs). Plugin-registered
|
|
21
|
+
* commands merge in at runtime; locals win on name collisions.
|
|
22
|
+
*/
|
|
23
|
+
export declare const LOCAL_COMMANDS: LocalCommand[];
|
|
24
|
+
/**
|
|
25
|
+
* Parse a slash-command line into its name and the verbatim input following
|
|
26
|
+
* the name (separator whitespace included) — the same split the DSH command
|
|
27
|
+
* registry uses, so `/plan off` dispatches `plan` with ` off`.
|
|
28
|
+
*
|
|
29
|
+
* @param line - Complete candidate command line.
|
|
30
|
+
* @returns The parsed name and raw input, or `undefined` when the line is
|
|
31
|
+
* not a command.
|
|
32
|
+
*/
|
|
33
|
+
export declare function parseCommandName(line: string): {
|
|
34
|
+
name: string;
|
|
35
|
+
rawInput: string;
|
|
36
|
+
} | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the input names a local command. Local commands must never be sent
|
|
39
|
+
* to the model when typed alone; trailing whitespace is legal.
|
|
40
|
+
* @param input - Candidate command line (slash optional).
|
|
41
|
+
* @param list - Command list to match against; defaults to LOCAL_COMMANDS.
|
|
42
|
+
* @returns True when the trimmed input names a command in `list`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isLocalCommandName(input: string, list?: readonly LocalCommand[]): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Filter commands by a `/…` input prefix (matches the CC overlay behavior).
|
|
47
|
+
* The prefix is the whole input after the slash, so `/plan off` matches
|
|
48
|
+
* nothing and the overlay stays closed — Enter still dispatches through
|
|
49
|
+
* `parseCommandName`.
|
|
50
|
+
* @param input - Slash-command input; the prefix is the whole text after the slash.
|
|
51
|
+
* @param list - Command list to filter; defaults to LOCAL_COMMANDS.
|
|
52
|
+
* @returns Commands whose name starts with the prefix, in list order.
|
|
53
|
+
*/
|
|
54
|
+
export declare function filterCommands(input: string, list?: readonly LocalCommand[]): LocalCommand[];
|
|
55
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;IACZ,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAA;IACnB,+DAA+D;IAC/D,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,YAAY,EA+CxC,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,GACX;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAIhD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,SAAS,YAAY,EAAmB,GAC7C,OAAO,CAKT;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,SAAS,YAAY,EAAmB,GAC7C,YAAY,EAAE,CAKhB"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local slash commands for the dsh-tui TUI. Claude Code's command system is
|
|
3
|
+
* deeply wired into its engine; dsh-tui ships a small built-in set with the
|
|
4
|
+
* same `/name — description` suggestion chrome, and merges plugin-registered
|
|
5
|
+
* commands (plan/goal/…) from the DSH command registry (`dsh-commands`) —
|
|
6
|
+
* `runCommand` in the Chat screen dispatches either kind, with the registry
|
|
7
|
+
* handler winning for names both sides declare.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The built-in slash commands (name + description pairs). Plugin-registered
|
|
11
|
+
* commands merge in at runtime; locals win on name collisions.
|
|
12
|
+
*/
|
|
13
|
+
export const LOCAL_COMMANDS = [
|
|
14
|
+
// Conversation
|
|
15
|
+
{ name: 'new', description: 'Start a new conversation' },
|
|
16
|
+
{ name: 'clear', description: 'Clear the conversation' },
|
|
17
|
+
{ name: 'compact', description: 'Compact the conversation history' },
|
|
18
|
+
{ name: 'resume', description: 'Resume a previous session' },
|
|
19
|
+
{ name: 'rewind', description: 'Rewind the conversation to a previous message' },
|
|
20
|
+
{ name: 'export', description: 'Export the conversation to a markdown file' },
|
|
21
|
+
// Session / environment
|
|
22
|
+
{ name: 'status', description: 'Show session status' },
|
|
23
|
+
{ name: 'cost', description: 'Show session token usage' },
|
|
24
|
+
{ name: 'config', description: 'Show the dsh-tui configuration source' },
|
|
25
|
+
{ name: 'doctor', description: 'Run environment checks' },
|
|
26
|
+
{ name: 'init', description: 'Create AGENTS.md in the working directory' },
|
|
27
|
+
{ name: 'agents', description: 'Show subagents of this session' },
|
|
28
|
+
// Model / display
|
|
29
|
+
{ name: 'activity', description: 'Switch the working-activity indicator preset' },
|
|
30
|
+
{ name: 'preset', description: 'Switch the agent preset (standard/code/minimal/cordis)' },
|
|
31
|
+
{ name: 'theme', description: 'Switch the color theme (built-in or custom)' },
|
|
32
|
+
{ name: 'lang', description: 'Switch the UI language (en / zh)' },
|
|
33
|
+
{ name: 'model', description: 'Show the active model' },
|
|
34
|
+
{ name: 'thinking', description: 'Toggle extended thinking display' },
|
|
35
|
+
{ name: 'tokens', description: 'Show session token usage' },
|
|
36
|
+
// Account / policy
|
|
37
|
+
{ name: 'login', description: 'Show API credential status' },
|
|
38
|
+
{ name: 'logout', description: 'Clear the API credential' },
|
|
39
|
+
{ name: 'permissions', description: 'Show permission policy status' },
|
|
40
|
+
{ name: 'add-dir', description: 'Show the filesystem policy scope' },
|
|
41
|
+
{ name: 'hooks', description: 'Show hooks status' },
|
|
42
|
+
{ name: 'mcp', description: 'Show MCP status' },
|
|
43
|
+
{ name: 'memory', description: 'Show memory status' },
|
|
44
|
+
{ name: 'update', description: 'Update dsh-tui and restart' },
|
|
45
|
+
// Built-in skills (CC's skill commands, driven through DSH skills)
|
|
46
|
+
{ name: 'audit', description: 'Run a comprehensive code audit on this project' },
|
|
47
|
+
{ name: 'bug', description: 'Capture a bug report' },
|
|
48
|
+
{ name: 'practice', description: 'Practice programming with dsh-tui' },
|
|
49
|
+
{ name: 'review', description: 'Run a comprehensive code review on this project' },
|
|
50
|
+
{ name: 'pr_comments', description: 'Review pull request comments' },
|
|
51
|
+
{ name: 'release-notes', description: 'Generate release notes' },
|
|
52
|
+
{ name: 'vuln-check', description: 'Run a security vulnerability check' },
|
|
53
|
+
// Misc / not applicable on this leaf
|
|
54
|
+
{ name: 'vim', description: 'Toggle vim mode' },
|
|
55
|
+
{ name: 'terminal-setup', description: 'Show terminal setup instructions' },
|
|
56
|
+
{ name: 'connect', description: 'Connect to a remote machine' },
|
|
57
|
+
// Help / exit
|
|
58
|
+
{ name: 'help', description: 'Show shortcuts and commands' },
|
|
59
|
+
{ name: 'exit', description: 'Exit dsh-tui' },
|
|
60
|
+
];
|
|
61
|
+
/**
|
|
62
|
+
* Parse a slash-command line into its name and the verbatim input following
|
|
63
|
+
* the name (separator whitespace included) — the same split the DSH command
|
|
64
|
+
* registry uses, so `/plan off` dispatches `plan` with ` off`.
|
|
65
|
+
*
|
|
66
|
+
* @param line - Complete candidate command line.
|
|
67
|
+
* @returns The parsed name and raw input, or `undefined` when the line is
|
|
68
|
+
* not a command.
|
|
69
|
+
*/
|
|
70
|
+
export function parseCommandName(line) {
|
|
71
|
+
const match = /^\/([a-z][a-z0-9_-]*)(?=$|[\t\n\r ])/.exec(line);
|
|
72
|
+
if (match === null)
|
|
73
|
+
return undefined;
|
|
74
|
+
return { name: match[1], rawInput: line.slice(match[0].length) };
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Whether the input names a local command. Local commands must never be sent
|
|
78
|
+
* to the model when typed alone; trailing whitespace is legal.
|
|
79
|
+
* @param input - Candidate command line (slash optional).
|
|
80
|
+
* @param list - Command list to match against; defaults to LOCAL_COMMANDS.
|
|
81
|
+
* @returns True when the trimmed input names a command in `list`.
|
|
82
|
+
*/
|
|
83
|
+
export function isLocalCommandName(input, list = LOCAL_COMMANDS) {
|
|
84
|
+
// Trailing whitespace is legal (Tab completion leaves a space after the
|
|
85
|
+
// name so the user can type arguments).
|
|
86
|
+
const name = input.replace(/^\//, '').trim();
|
|
87
|
+
return list.some(command => command.name === name);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Filter commands by a `/…` input prefix (matches the CC overlay behavior).
|
|
91
|
+
* The prefix is the whole input after the slash, so `/plan off` matches
|
|
92
|
+
* nothing and the overlay stays closed — Enter still dispatches through
|
|
93
|
+
* `parseCommandName`.
|
|
94
|
+
* @param input - Slash-command input; the prefix is the whole text after the slash.
|
|
95
|
+
* @param list - Command list to filter; defaults to LOCAL_COMMANDS.
|
|
96
|
+
* @returns Commands whose name starts with the prefix, in list order.
|
|
97
|
+
*/
|
|
98
|
+
export function filterCommands(input, list = LOCAL_COMMANDS) {
|
|
99
|
+
const prefix = input.replace(/^\//, '').trim().toLowerCase();
|
|
100
|
+
return list.filter(command => command.name.toLowerCase().startsWith(prefix));
|
|
101
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ActivityStatus } from '../channel.js';
|
|
3
|
+
/**
|
|
4
|
+
* Context-pressure percentage (0–100) from the last usage snapshot, or
|
|
5
|
+
* undefined when unknown — shared by the spinner-line and status-line
|
|
6
|
+
* placements of the working-activity line (pi working-activity style:
|
|
7
|
+
* amber ≥ 80%, red ≥ 95%).
|
|
8
|
+
*/
|
|
9
|
+
export declare function contextPressurePct(usage: {
|
|
10
|
+
input: number;
|
|
11
|
+
cacheRead: number;
|
|
12
|
+
cacheWrite: number;
|
|
13
|
+
} | undefined, contextWindow: number | undefined): number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* The working-activity line, rendered either in the spinner slot (while a
|
|
16
|
+
* turn runs — replacing the CC random-verb spinner) or on the status bar
|
|
17
|
+
* (the turn-summary card once idle). pi working-activity style: an animated
|
|
18
|
+
* indicator frame, an ice-blue shimmer sweep over the line, an amber/red
|
|
19
|
+
* `⚠ ctx N%` pressure prefix, and a trailing token suffix for the spinner
|
|
20
|
+
* placement. Done summaries render statically in the brand mist blue.
|
|
21
|
+
*/
|
|
22
|
+
export declare function ActivityLine({ activity, activityFrames, warnPct, warnDanger, suffix, }: {
|
|
23
|
+
activity: ActivityStatus;
|
|
24
|
+
activityFrames: string | undefined;
|
|
25
|
+
warnPct?: number;
|
|
26
|
+
warnDanger?: boolean;
|
|
27
|
+
suffix?: string;
|
|
28
|
+
}): React.ReactNode;
|
|
29
|
+
//# sourceMappingURL=ActivityLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityLine.d.ts","sourceRoot":"","sources":["../../../src/components/ActivityLine.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,EAC3E,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,MAAM,GAAG,SAAS,CAMpB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,cAAc,EACd,OAAO,EACP,UAAU,EACV,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,cAAc,CAAA;IACxB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,GAAG,KAAK,CAAC,SAAS,CAuClB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { t } from '../i18n.js';
|
|
4
|
+
import { Text, useAnimationFrame } from '../ui.js';
|
|
5
|
+
import { resolvePreset } from './activityFrames.js';
|
|
6
|
+
import { BRAND, FLASH, ICE, sweep } from './shimmer.js';
|
|
7
|
+
import { getTheme } from '../theme.js';
|
|
8
|
+
import { useTheme } from './design-system/ThemeProvider.js';
|
|
9
|
+
import { parseRGB } from './Spinner/spinnerUtils.js';
|
|
10
|
+
/**
|
|
11
|
+
* Context-pressure percentage (0–100) from the last usage snapshot, or
|
|
12
|
+
* undefined when unknown — shared by the spinner-line and status-line
|
|
13
|
+
* placements of the working-activity line (pi working-activity style:
|
|
14
|
+
* amber ≥ 80%, red ≥ 95%).
|
|
15
|
+
*/
|
|
16
|
+
export function contextPressurePct(usage, contextWindow) {
|
|
17
|
+
if (usage === undefined || contextWindow === undefined || contextWindow <= 0) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
const occupied = usage.input + usage.cacheRead + usage.cacheWrite;
|
|
21
|
+
return Math.round((occupied / contextWindow) * 100);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The working-activity line, rendered either in the spinner slot (while a
|
|
25
|
+
* turn runs — replacing the CC random-verb spinner) or on the status bar
|
|
26
|
+
* (the turn-summary card once idle). pi working-activity style: an animated
|
|
27
|
+
* indicator frame, an ice-blue shimmer sweep over the line, an amber/red
|
|
28
|
+
* `⚠ ctx N%` pressure prefix, and a trailing token suffix for the spinner
|
|
29
|
+
* placement. Done summaries render statically in the brand mist blue.
|
|
30
|
+
*/
|
|
31
|
+
export function ActivityLine({ activity, activityFrames, warnPct, warnDanger, suffix, }) {
|
|
32
|
+
// 60ms frames: the shimmer sweep advances one column per frame (3.3× the
|
|
33
|
+
// ported 200ms cadence — the slow crawl read as lag).
|
|
34
|
+
const [, time] = useAnimationFrame(60);
|
|
35
|
+
const [themeName] = useTheme();
|
|
36
|
+
const theme = getTheme(themeName);
|
|
37
|
+
const preset = React.useMemo(() => resolvePreset(activityFrames), [activityFrames]);
|
|
38
|
+
const frameIndex = Math.floor(time / preset.intervalMs) % preset.frames.length;
|
|
39
|
+
const frame = preset.frames[frameIndex] ?? '·';
|
|
40
|
+
const color = activity.phase === 'done' || activity.phase === 'tool'
|
|
41
|
+
? 'claude'
|
|
42
|
+
: 'claudeBlue_FOR_SYSTEM_SPINNER';
|
|
43
|
+
const baseRGB = activity.phase === 'tool'
|
|
44
|
+
? (parseRGB(theme.claude) ?? BRAND)
|
|
45
|
+
: (parseRGB(theme.claudeBlue_FOR_SYSTEM_SPINNER) ?? ICE);
|
|
46
|
+
return (_jsxs(Text, { wrap: "truncate", children: [activity.phase !== 'done' && (_jsxs(Text, { color: color, children: [frame, " "] })), warnPct !== undefined && warnPct >= 80 && (_jsxs(Text, { color: warnDanger ? 'error' : 'warning', children: [t('activity-ctx-warn'), warnPct, "% \u00B7", ' '] })), activity.phase === 'done' ? (_jsx(Text, { color: color, children: activity.line })) : (_jsx(Text, { children: sweep(activity.line, time, baseRGB, FLASH, 60) })), suffix !== undefined && _jsx(Text, { dimColor: true, children: suffix })] }));
|
|
47
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Working-activity indicator picker in the CC ModelPicker style (ported
|
|
4
|
+
* from the pi extension's `/activity` interactive select): a
|
|
5
|
+
* permission-colored Pane listing every preset (random first) with its
|
|
6
|
+
* frame preview, `❯` focus pointer and `✓` on the active preset. Enter
|
|
7
|
+
* applies through `channel.setActivityFrames`, Esc cancels.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ActivityPicker({ focusIndex, currentPreset, }: {
|
|
10
|
+
focusIndex: number;
|
|
11
|
+
currentPreset: string | undefined;
|
|
12
|
+
}): React.ReactNode;
|
|
13
|
+
//# sourceMappingURL=ActivityPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ActivityPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,aAAa,GACd,EAAE;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAA;CAClC,GAAG,KAAK,CAAC,SAAS,CA6BlB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { Pane } from './design-system/Pane.js';
|
|
5
|
+
import { Select } from './Select.js';
|
|
6
|
+
import { Byline } from './design-system/Byline.js';
|
|
7
|
+
import { KeyboardShortcutHint } from './design-system/KeyboardShortcutHint.js';
|
|
8
|
+
import { FRAME_PRESETS, PRESET_NAMES } from './activityFrames.js';
|
|
9
|
+
/**
|
|
10
|
+
* Working-activity indicator picker in the CC ModelPicker style (ported
|
|
11
|
+
* from the pi extension's `/activity` interactive select): a
|
|
12
|
+
* permission-colored Pane listing every preset (random first) with its
|
|
13
|
+
* frame preview, `❯` focus pointer and `✓` on the active preset. Enter
|
|
14
|
+
* applies through `channel.setActivityFrames`, Esc cancels.
|
|
15
|
+
*/
|
|
16
|
+
export function ActivityPicker({ focusIndex, currentPreset, }) {
|
|
17
|
+
return (_jsx(Pane, { color: "permission", children: _jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: "Indicator preset" }) }), _jsx(Select, { options: PRESET_NAMES.map(name => ({
|
|
18
|
+
value: name,
|
|
19
|
+
label: name,
|
|
20
|
+
description: name === 'random'
|
|
21
|
+
? t('activity-random-each-preset')
|
|
22
|
+
: FRAME_PRESETS[name].frames.slice(0, 5).join(' '),
|
|
23
|
+
})), focusIndex: focusIndex, selectedValue: currentPreset }), _jsx(Text, { dimColor: true, italic: true, children: _jsxs(Byline, { children: [_jsx(KeyboardShortcutHint, { shortcut: "Enter", action: "confirm", bold: true }), _jsx(KeyboardShortcutHint, { shortcut: "Esc", action: "exit" })] }) })] }) }));
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { LocalCommand } from '../commands.js';
|
|
3
|
+
/**
|
|
4
|
+
* The slash-command suggestion overlay, ported from the leak's
|
|
5
|
+
* `PromptInputFooterSuggestions.tsx` (command layout only): a name column
|
|
6
|
+
* padded to a fixed width, optional `[tag]`, then a truncated description.
|
|
7
|
+
* The selected row renders in the theme's `suggestion` color, others dim.
|
|
8
|
+
*/
|
|
9
|
+
export declare function CommandSuggestions({ commands, selectedIndex, columns, }: {
|
|
10
|
+
commands: readonly LocalCommand[];
|
|
11
|
+
selectedIndex: number;
|
|
12
|
+
columns: number;
|
|
13
|
+
}): React.ReactNode;
|
|
14
|
+
//# sourceMappingURL=CommandSuggestions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandSuggestions.d.ts","sourceRoot":"","sources":["../../../src/components/CommandSuggestions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,aAAa,EACb,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAA;IACjC,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;CAChB,GAAG,KAAK,CAAC,SAAS,CAoDlB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from '../ui.js';
|
|
3
|
+
import { stringWidth } from '../ink/stringWidth.js';
|
|
4
|
+
import { truncateToWidth } from '../ink/truncateToWidth.js';
|
|
5
|
+
/**
|
|
6
|
+
* The slash-command suggestion overlay, ported from the leak's
|
|
7
|
+
* `PromptInputFooterSuggestions.tsx` (command layout only): a name column
|
|
8
|
+
* padded to a fixed width, optional `[tag]`, then a truncated description.
|
|
9
|
+
* The selected row renders in the theme's `suggestion` color, others dim.
|
|
10
|
+
*/
|
|
11
|
+
export function CommandSuggestions({ commands, selectedIndex, columns, }) {
|
|
12
|
+
if (commands.length === 0)
|
|
13
|
+
return null;
|
|
14
|
+
// Cap the command name column at 40% of terminal width to ensure the
|
|
15
|
+
// description has space (same as the leak).
|
|
16
|
+
const maxNameWidth = Math.floor(columns * 0.4);
|
|
17
|
+
const nameWidth = Math.min(Math.max(...commands.map(c => stringWidth(c.name))) + 5, maxNameWidth);
|
|
18
|
+
const maxVisible = 5;
|
|
19
|
+
const startIndex = Math.max(0, Math.min(selectedIndex - Math.floor(maxVisible / 2), commands.length - maxVisible));
|
|
20
|
+
const visible = commands.slice(startIndex, startIndex + maxVisible);
|
|
21
|
+
return (_jsx(Box, { flexDirection: "column", children: visible.map(command => {
|
|
22
|
+
const isSelected = command.name === commands[selectedIndex]?.name;
|
|
23
|
+
const padded = command.name +
|
|
24
|
+
' '.repeat(Math.max(0, nameWidth - stringWidth(command.name)));
|
|
25
|
+
const tagText = command.tag ? `[${command.tag}] ` : '';
|
|
26
|
+
const tagWidth = stringWidth(tagText);
|
|
27
|
+
const descriptionWidth = Math.max(0, columns - nameWidth - tagWidth - 4);
|
|
28
|
+
const description = stringWidth(command.description) > descriptionWidth
|
|
29
|
+
? truncateToWidth(command.description, descriptionWidth - 1) + '…'
|
|
30
|
+
: command.description;
|
|
31
|
+
return (_jsxs(Text, { wrap: "truncate", children: [_jsx(Text, { color: isSelected ? 'suggestion' : undefined, dimColor: !isSelected, children: padded }), tagText ? _jsx(Text, { dimColor: true, children: tagText }) : null, _jsx(Text, { color: isSelected ? 'suggestion' : undefined, dimColor: !isSelected, children: description })] }, command.name));
|
|
32
|
+
}) }));
|
|
33
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The `@` file-completion overlay in CC's suggestion style: `+` icon prefix
|
|
4
|
+
* (CC's file suggestions) + name column + description. The selected row
|
|
5
|
+
* renders in the theme's `suggestion` color, others dim.
|
|
6
|
+
*/
|
|
7
|
+
export declare function FileSuggestions({ files, selectedIndex, columns, }: {
|
|
8
|
+
files: readonly string[];
|
|
9
|
+
selectedIndex: number;
|
|
10
|
+
columns: number;
|
|
11
|
+
}): React.ReactNode;
|
|
12
|
+
//# sourceMappingURL=FileSuggestions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileSuggestions.d.ts","sourceRoot":"","sources":["../../../src/components/FileSuggestions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,aAAa,EACb,OAAO,GACR,EAAE;IACD,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;CAChB,GAAG,KAAK,CAAC,SAAS,CAqClB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from '../ui.js';
|
|
3
|
+
import { stringWidth } from '../ink/stringWidth.js';
|
|
4
|
+
import { truncateToWidth } from '../ink/truncateToWidth.js';
|
|
5
|
+
/**
|
|
6
|
+
* The `@` file-completion overlay in CC's suggestion style: `+` icon prefix
|
|
7
|
+
* (CC's file suggestions) + name column + description. The selected row
|
|
8
|
+
* renders in the theme's `suggestion` color, others dim.
|
|
9
|
+
*/
|
|
10
|
+
export function FileSuggestions({ files, selectedIndex, columns, }) {
|
|
11
|
+
if (files.length === 0)
|
|
12
|
+
return null;
|
|
13
|
+
const maxVisible = 6;
|
|
14
|
+
const startIndex = Math.max(0, Math.min(selectedIndex - Math.floor(maxVisible / 2), files.length - maxVisible));
|
|
15
|
+
const visible = files.slice(startIndex, startIndex + maxVisible);
|
|
16
|
+
return (_jsx(Box, { flexDirection: "column", children: visible.map(file => {
|
|
17
|
+
const isSelected = file === files[selectedIndex];
|
|
18
|
+
const isDir = file.endsWith('/');
|
|
19
|
+
const name = isDir ? file.slice(0, -1) : file;
|
|
20
|
+
const descriptionWidth = Math.max(0, columns - 24);
|
|
21
|
+
const description = isDir ? 'directory' : 'file';
|
|
22
|
+
return (_jsxs(Text, { wrap: "truncate", children: [_jsxs(Text, { color: isSelected ? 'suggestion' : undefined, dimColor: !isSelected, children: ["+ ", name] }), _jsxs(Text, { color: isSelected ? 'suggestion' : undefined, dimColor: !isSelected, children: [' '.repeat(Math.max(1, 20 - stringWidth(name))), stringWidth(description) > descriptionWidth
|
|
23
|
+
? truncateToWidth(description, descriptionWidth - 1) + '…'
|
|
24
|
+
: description] })] }, file));
|
|
25
|
+
}) }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Channel } from '../channel.js';
|
|
3
|
+
/**
|
|
4
|
+
* Live goal + todo panel above the prompt input. Data rides on the channel:
|
|
5
|
+
* `channel.goal` is folded from `goal/change` context events and
|
|
6
|
+
* `channel.todos` from `todo/write` whole-list snapshots, so every model
|
|
7
|
+
* update re-renders this panel in real time (no polling). Renders nothing
|
|
8
|
+
* while both slots are empty.
|
|
9
|
+
*/
|
|
10
|
+
export declare function GoalTodoPanel({ channel }: {
|
|
11
|
+
channel: Channel;
|
|
12
|
+
}): React.ReactNode;
|
|
13
|
+
//# sourceMappingURL=GoalTodoPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoalTodoPanel.d.ts","sourceRoot":"","sources":["../../../src/components/GoalTodoPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,OAAO,EAA8B,MAAM,eAAe,CAAA;AAwDxE;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CA2DhF"}
|