@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,268 @@
|
|
|
1
|
+
import { coerce } from 'semver';
|
|
2
|
+
import { appendFileSync } from 'node:fs';
|
|
3
|
+
import { env } from '../utils/env.js';
|
|
4
|
+
import { gte } from '../utils/semver.js';
|
|
5
|
+
import { getClearTerminalSequence } from './clearTerminal.js';
|
|
6
|
+
import { cursorMove, cursorTo, eraseLines, SGR_RESET } from './termio/csi.js';
|
|
7
|
+
import { BSU, ESU, HIDE_CURSOR, SHOW_CURSOR } from './termio/dec.js';
|
|
8
|
+
import { link } from './termio/osc.js';
|
|
9
|
+
/**
|
|
10
|
+
* Checks if the terminal supports OSC 9;4 progress reporting.
|
|
11
|
+
* Supported terminals:
|
|
12
|
+
* - ConEmu (Windows) - all versions
|
|
13
|
+
* - Ghostty 1.2.0+
|
|
14
|
+
* - iTerm2 3.6.6+
|
|
15
|
+
*
|
|
16
|
+
* Note: Windows Terminal interprets OSC 9;4 as notifications, not progress.
|
|
17
|
+
* @returns true when the terminal supports OSC 9;4 progress reporting.
|
|
18
|
+
*/
|
|
19
|
+
export function isProgressReportingAvailable() {
|
|
20
|
+
// Only available if we have a TTY (not piped)
|
|
21
|
+
if (!process.stdout.isTTY) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
// Explicitly exclude Windows Terminal, which interprets OSC 9;4 as
|
|
25
|
+
// notifications rather than progress indicators
|
|
26
|
+
if (process.env.WT_SESSION) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
// ConEmu supports OSC 9;4 for progress (all versions)
|
|
30
|
+
if (process.env.ConEmuANSI ||
|
|
31
|
+
process.env.ConEmuPID ||
|
|
32
|
+
process.env.ConEmuTask) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
const version = coerce(process.env.TERM_PROGRAM_VERSION);
|
|
36
|
+
if (!version) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
// Ghostty 1.2.0+ supports OSC 9;4 for progress
|
|
40
|
+
// https://ghostty.org/docs/install/release-notes/1-2-0
|
|
41
|
+
if (process.env.TERM_PROGRAM === 'ghostty') {
|
|
42
|
+
return gte(version.version, '1.2.0');
|
|
43
|
+
}
|
|
44
|
+
// iTerm2 3.6.6+ supports OSC 9;4 for progress
|
|
45
|
+
// https://iterm2.com/downloads.html
|
|
46
|
+
if (process.env.TERM_PROGRAM === 'iTerm.app') {
|
|
47
|
+
return gte(version.version, '3.6.6');
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Checks if the terminal supports DEC mode 2026 (synchronized output).
|
|
53
|
+
* When supported, BSU/ESU sequences prevent visible flicker during redraws.
|
|
54
|
+
* @returns true when the terminal supports DEC 2026.
|
|
55
|
+
*/
|
|
56
|
+
export function isSynchronizedOutputSupported() {
|
|
57
|
+
// tmux parses and proxies every byte but doesn't implement DEC 2026.
|
|
58
|
+
// BSU/ESU pass through to the outer terminal but tmux has already
|
|
59
|
+
// broken atomicity by chunking. Skip to save 16 bytes/frame + parser work.
|
|
60
|
+
if (process.env.TMUX)
|
|
61
|
+
return false;
|
|
62
|
+
const termProgram = process.env.TERM_PROGRAM;
|
|
63
|
+
const term = process.env.TERM;
|
|
64
|
+
// Modern terminals with known DEC 2026 support
|
|
65
|
+
if (termProgram === 'iTerm.app' ||
|
|
66
|
+
termProgram === 'WezTerm' ||
|
|
67
|
+
termProgram === 'WarpTerminal' ||
|
|
68
|
+
termProgram === 'ghostty' ||
|
|
69
|
+
termProgram === 'contour' ||
|
|
70
|
+
termProgram === 'vscode' ||
|
|
71
|
+
termProgram === 'alacritty') {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
// kitty sets TERM=xterm-kitty or KITTY_WINDOW_ID
|
|
75
|
+
if (term?.includes('kitty') || process.env.KITTY_WINDOW_ID)
|
|
76
|
+
return true;
|
|
77
|
+
// Ghostty may set TERM=xterm-ghostty without TERM_PROGRAM
|
|
78
|
+
if (term === 'xterm-ghostty')
|
|
79
|
+
return true;
|
|
80
|
+
// foot sets TERM=foot or TERM=foot-extra
|
|
81
|
+
if (term?.startsWith('foot'))
|
|
82
|
+
return true;
|
|
83
|
+
// Alacritty may set TERM containing 'alacritty'
|
|
84
|
+
if (term?.includes('alacritty'))
|
|
85
|
+
return true;
|
|
86
|
+
// Zed uses the alacritty_terminal crate which supports DEC 2026
|
|
87
|
+
if (process.env.ZED_TERM)
|
|
88
|
+
return true;
|
|
89
|
+
// Windows Terminal
|
|
90
|
+
if (process.env.WT_SESSION)
|
|
91
|
+
return true;
|
|
92
|
+
// VTE-based terminals (GNOME Terminal, Tilix, etc.) since VTE 0.68
|
|
93
|
+
const vteVersion = process.env.VTE_VERSION;
|
|
94
|
+
if (vteVersion) {
|
|
95
|
+
const version = parseInt(vteVersion, 10);
|
|
96
|
+
if (version >= 6800)
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
// -- XTVERSION-detected terminal name (populated async at startup) --
|
|
102
|
+
//
|
|
103
|
+
// TERM_PROGRAM is not forwarded over SSH by default, so env-based detection
|
|
104
|
+
// fails when claude runs remotely inside a VS Code integrated terminal.
|
|
105
|
+
// XTVERSION (CSI > 0 q → DCS > | name ST) goes through the pty — the query
|
|
106
|
+
// reaches the *client* terminal and the reply comes back through stdin.
|
|
107
|
+
// App.tsx fires the query when raw mode enables; setXtversionName() is called
|
|
108
|
+
// from the response handler. Readers should treat undefined as "not yet known"
|
|
109
|
+
// and fall back to env-var detection.
|
|
110
|
+
let xtversionName;
|
|
111
|
+
/**
|
|
112
|
+
* Record the XTVERSION response. Called once from App.tsx when the reply
|
|
113
|
+
* arrives on stdin. No-op if already set (defend against re-probe).
|
|
114
|
+
* @param name - the terminal name reported by the XTVERSION reply.
|
|
115
|
+
*/
|
|
116
|
+
export function setXtversionName(name) {
|
|
117
|
+
if (xtversionName === undefined)
|
|
118
|
+
xtversionName = name;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* True if running in an xterm.js-based terminal (VS Code, Cursor, Windsurf
|
|
122
|
+
* integrated terminals). Combines TERM_PROGRAM env check (fast, sync, but
|
|
123
|
+
* not forwarded over SSH) with the XTVERSION probe result (async, survives
|
|
124
|
+
* SSH — query/reply goes through the pty). Early calls may miss the probe
|
|
125
|
+
* reply — call lazily (e.g. in an event handler) if SSH detection matters.
|
|
126
|
+
* @returns true when the terminal is xterm.js-based.
|
|
127
|
+
*/
|
|
128
|
+
export function isXtermJs() {
|
|
129
|
+
if (process.env.TERM_PROGRAM === 'vscode')
|
|
130
|
+
return true;
|
|
131
|
+
return xtversionName?.startsWith('xterm.js') ?? false;
|
|
132
|
+
}
|
|
133
|
+
// Terminals known to correctly implement the Kitty keyboard protocol
|
|
134
|
+
// (CSI >1u) and/or xterm modifyOtherKeys (CSI >4;2m) for ctrl+shift+<letter>
|
|
135
|
+
// disambiguation. We previously enabled unconditionally (#23350), assuming
|
|
136
|
+
// terminals silently ignore unknown CSI — but some terminals honor the enable
|
|
137
|
+
// and emit codepoints our input parser doesn't handle (notably over SSH and
|
|
138
|
+
// in xterm.js-based terminals like VS Code). tmux is allowlisted because it
|
|
139
|
+
// accepts modifyOtherKeys and doesn't forward the kitty sequence to the outer
|
|
140
|
+
// terminal.
|
|
141
|
+
const EXTENDED_KEYS_TERMINALS = [
|
|
142
|
+
'iTerm.app',
|
|
143
|
+
'kitty',
|
|
144
|
+
'WezTerm',
|
|
145
|
+
'ghostty',
|
|
146
|
+
'tmux',
|
|
147
|
+
'windows-terminal',
|
|
148
|
+
];
|
|
149
|
+
/**
|
|
150
|
+
* True if this terminal correctly handles extended key reporting
|
|
151
|
+
* (Kitty keyboard protocol + xterm modifyOtherKeys).
|
|
152
|
+
* @returns true when the terminal is on the extended-keys allowlist.
|
|
153
|
+
*/
|
|
154
|
+
export function supportsExtendedKeys() {
|
|
155
|
+
return EXTENDED_KEYS_TERMINALS.includes(env.terminal ?? '');
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* True if the terminal scrolls the viewport when it receives cursor-up
|
|
159
|
+
* sequences that reach above the visible area. On Windows, conhost's
|
|
160
|
+
* SetConsoleCursorPosition follows the cursor into scrollback
|
|
161
|
+
* (microsoft/terminal#14774), yanking users to the top of their buffer
|
|
162
|
+
* mid-stream. WT_SESSION catches WSL-in-Windows-Terminal where platform
|
|
163
|
+
* is linux but output still routes through conhost.
|
|
164
|
+
* @returns true when the cursor-up viewport-yank bug applies.
|
|
165
|
+
*/
|
|
166
|
+
export function hasCursorUpViewportYankBug() {
|
|
167
|
+
return process.platform === 'win32' || !!process.env.WT_SESSION;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Whether synchronized output (DEC 2026) is available, computed once at
|
|
171
|
+
* module load — terminal capabilities don't change mid-session. Exported
|
|
172
|
+
* so callers can pass a sync-skip hint gated to specific modes.
|
|
173
|
+
*/
|
|
174
|
+
export const SYNC_OUTPUT_SUPPORTED = isSynchronizedOutputSupported();
|
|
175
|
+
/**
|
|
176
|
+
* Render forensics: when DSH_CC_RENDER_LOG names a file path, every painted
|
|
177
|
+
* frame's raw ANSI bytes append to it (one JSON-escaped line per frame,
|
|
178
|
+
* prefixed with a timestamp header). Real-terminal rendering corruption
|
|
179
|
+
* (missing rows, stale attributes) cannot be reproduced in headless xterm
|
|
180
|
+
* harnesses — this captures the exact byte stream the terminal received so
|
|
181
|
+
* the corrupt frame can be diffed against the expected screen. Opt-in and
|
|
182
|
+
* zero-cost when unset: the env read happens once at module load.
|
|
183
|
+
*/
|
|
184
|
+
const RENDER_LOG_PATH = process.env.DSH_CC_RENDER_LOG ?? '';
|
|
185
|
+
function dumpFrame(buffer) {
|
|
186
|
+
if (RENDER_LOG_PATH === '')
|
|
187
|
+
return;
|
|
188
|
+
try {
|
|
189
|
+
appendFileSync(RENDER_LOG_PATH, `\n===== frame ${new Date().toISOString()} (${buffer.length} bytes) =====\n${JSON.stringify(buffer)}\n`);
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
// Forensics must never break rendering: an unwritable log path (bad
|
|
193
|
+
// directory, permissions) drops the dump, not the frame.
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Write a frame diff to the terminal as a single buffered write. Wraps
|
|
198
|
+
* the output in BSU/ESU synchronized-update markers unless skipSyncMarkers
|
|
199
|
+
* is set. No-op when the diff contains no patches.
|
|
200
|
+
* @param terminal - the terminal to write to.
|
|
201
|
+
* @param diff - the frame diff patches to render.
|
|
202
|
+
* @param skipSyncMarkers - when true, omit the BSU/ESU wrapping.
|
|
203
|
+
*/
|
|
204
|
+
export function writeDiffToTerminal(terminal, diff, skipSyncMarkers = false) {
|
|
205
|
+
// No output if there are no patches
|
|
206
|
+
if (diff.length === 0) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
// BSU/ESU wrapping is opt-out to keep main-screen behavior unchanged.
|
|
210
|
+
// Callers pass skipSyncMarkers=true when the terminal doesn't support
|
|
211
|
+
// DEC 2026 (e.g. tmux) AND the cost matters (high-frequency alt-screen).
|
|
212
|
+
const useSync = !skipSyncMarkers;
|
|
213
|
+
// Buffer all writes into a single string to avoid multiple write calls.
|
|
214
|
+
// SGR_RESET + link('') head every frame: the diff engine computes style
|
|
215
|
+
// and hyperlink transitions from a frame-start baseline of none — normally
|
|
216
|
+
// guaranteed by the previous frame's tail resets, but a truncated frame
|
|
217
|
+
// (interrupted write, dropped PTY bytes) leaves the terminal stuck with a
|
|
218
|
+
// colored SGR / an open hyperlink. Every erase, hardware scroll, and LF
|
|
219
|
+
// scroll fills blank cells with the CURRENT background (BCE), so one stuck
|
|
220
|
+
// red background floods whole regions (issue #10). ~12 bytes per frame
|
|
221
|
+
// turn the baseline assumption into a per-frame guarantee; on healthy
|
|
222
|
+
// frames both sequences are idempotent no-ops.
|
|
223
|
+
let buffer = (useSync ? BSU : '') + SGR_RESET + link('');
|
|
224
|
+
for (const patch of diff) {
|
|
225
|
+
switch (patch.type) {
|
|
226
|
+
case 'stdout':
|
|
227
|
+
buffer += patch.content;
|
|
228
|
+
break;
|
|
229
|
+
case 'clear':
|
|
230
|
+
if (patch.count > 0) {
|
|
231
|
+
buffer += eraseLines(patch.count);
|
|
232
|
+
}
|
|
233
|
+
break;
|
|
234
|
+
case 'clearTerminal':
|
|
235
|
+
// Pass the live row count: the blank only needs one viewport worth
|
|
236
|
+
// of scroll (see getClearTerminalSequence on why overshooting
|
|
237
|
+
// evicts the user's real scrollback).
|
|
238
|
+
buffer += getClearTerminalSequence(terminal.stdout.rows);
|
|
239
|
+
break;
|
|
240
|
+
case 'cursorHide':
|
|
241
|
+
buffer += HIDE_CURSOR;
|
|
242
|
+
break;
|
|
243
|
+
case 'cursorShow':
|
|
244
|
+
buffer += SHOW_CURSOR;
|
|
245
|
+
break;
|
|
246
|
+
case 'cursorMove':
|
|
247
|
+
buffer += cursorMove(patch.x, patch.y);
|
|
248
|
+
break;
|
|
249
|
+
case 'cursorTo':
|
|
250
|
+
buffer += cursorTo(patch.col);
|
|
251
|
+
break;
|
|
252
|
+
case 'carriageReturn':
|
|
253
|
+
buffer += '\r';
|
|
254
|
+
break;
|
|
255
|
+
case 'hyperlink':
|
|
256
|
+
buffer += link(patch.uri);
|
|
257
|
+
break;
|
|
258
|
+
case 'styleStr':
|
|
259
|
+
buffer += patch.str;
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// Add synchronized update end and flush buffer
|
|
264
|
+
if (useSync)
|
|
265
|
+
buffer += ESU;
|
|
266
|
+
dumpFrame(buffer);
|
|
267
|
+
terminal.stdout.write(buffer);
|
|
268
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI Control Characters and Escape Sequence Introducers
|
|
3
|
+
*
|
|
4
|
+
* Based on ECMA-48 / ANSI X3.64 standards.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* C0 (7-bit) control characters
|
|
8
|
+
*/
|
|
9
|
+
export declare const C0: {
|
|
10
|
+
readonly NUL: 0;
|
|
11
|
+
readonly SOH: 1;
|
|
12
|
+
readonly STX: 2;
|
|
13
|
+
readonly ETX: 3;
|
|
14
|
+
readonly EOT: 4;
|
|
15
|
+
readonly ENQ: 5;
|
|
16
|
+
readonly ACK: 6;
|
|
17
|
+
readonly BEL: 7;
|
|
18
|
+
readonly BS: 8;
|
|
19
|
+
readonly HT: 9;
|
|
20
|
+
readonly LF: 10;
|
|
21
|
+
readonly VT: 11;
|
|
22
|
+
readonly FF: 12;
|
|
23
|
+
readonly CR: 13;
|
|
24
|
+
readonly SO: 14;
|
|
25
|
+
readonly SI: 15;
|
|
26
|
+
readonly DLE: 16;
|
|
27
|
+
readonly DC1: 17;
|
|
28
|
+
readonly DC2: 18;
|
|
29
|
+
readonly DC3: 19;
|
|
30
|
+
readonly DC4: 20;
|
|
31
|
+
readonly NAK: 21;
|
|
32
|
+
readonly SYN: 22;
|
|
33
|
+
readonly ETB: 23;
|
|
34
|
+
readonly CAN: 24;
|
|
35
|
+
readonly EM: 25;
|
|
36
|
+
readonly SUB: 26;
|
|
37
|
+
readonly ESC: 27;
|
|
38
|
+
readonly FS: 28;
|
|
39
|
+
readonly GS: 29;
|
|
40
|
+
readonly RS: 30;
|
|
41
|
+
readonly US: 31;
|
|
42
|
+
readonly DEL: 127;
|
|
43
|
+
};
|
|
44
|
+
/** ESC control character (0x1B), the introducer of every escape sequence. */
|
|
45
|
+
export declare const ESC = "\u001B";
|
|
46
|
+
/** BEL control character (0x07), the common OSC sequence terminator. */
|
|
47
|
+
export declare const BEL = "\u0007";
|
|
48
|
+
/** Parameter separator used inside CSI and OSC sequences. */
|
|
49
|
+
export declare const SEP = ";";
|
|
50
|
+
/**
|
|
51
|
+
* Escape sequence type introducers (byte after ESC)
|
|
52
|
+
*/
|
|
53
|
+
export declare const ESC_TYPE: {
|
|
54
|
+
readonly CSI: 91;
|
|
55
|
+
readonly OSC: 93;
|
|
56
|
+
readonly DCS: 80;
|
|
57
|
+
readonly APC: 95;
|
|
58
|
+
readonly PM: 94;
|
|
59
|
+
readonly SOS: 88;
|
|
60
|
+
readonly ST: 92;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Check if a byte is a C0 control character.
|
|
64
|
+
* @param byte - the byte value to check.
|
|
65
|
+
* @returns true when the byte is in the C0 range (0x00-0x1F) or is DEL (0x7F).
|
|
66
|
+
*/
|
|
67
|
+
export declare function isC0(byte: number): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Check if a byte is an ESC sequence final byte (0-9, :, ;, <, =, >, ?, @ through ~).
|
|
70
|
+
* ESC sequences have a wider final byte range than CSI.
|
|
71
|
+
* @param byte - the byte value to check.
|
|
72
|
+
* @returns true when the byte is in the final-byte range (0x30-0x7E).
|
|
73
|
+
*/
|
|
74
|
+
export declare function isEscFinal(byte: number): boolean;
|
|
75
|
+
//# sourceMappingURL=ansi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ansi.d.ts","sourceRoot":"","sources":["../../../../src/ink/termio/ansi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCL,CAAA;AAIV,6EAA6E;AAC7E,eAAO,MAAM,GAAG,WAAS,CAAA;AAEzB,wEAAwE;AACxE,eAAO,MAAM,GAAG,WAAS,CAAA;AAEzB,6DAA6D;AAC7D,eAAO,MAAM,GAAG,MAAM,CAAA;AAEtB;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;CAQX,CAAA;AAEV;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI Control Characters and Escape Sequence Introducers
|
|
3
|
+
*
|
|
4
|
+
* Based on ECMA-48 / ANSI X3.64 standards.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* C0 (7-bit) control characters
|
|
8
|
+
*/
|
|
9
|
+
export const C0 = {
|
|
10
|
+
NUL: 0x00,
|
|
11
|
+
SOH: 0x01,
|
|
12
|
+
STX: 0x02,
|
|
13
|
+
ETX: 0x03,
|
|
14
|
+
EOT: 0x04,
|
|
15
|
+
ENQ: 0x05,
|
|
16
|
+
ACK: 0x06,
|
|
17
|
+
BEL: 0x07,
|
|
18
|
+
BS: 0x08,
|
|
19
|
+
HT: 0x09,
|
|
20
|
+
LF: 0x0a,
|
|
21
|
+
VT: 0x0b,
|
|
22
|
+
FF: 0x0c,
|
|
23
|
+
CR: 0x0d,
|
|
24
|
+
SO: 0x0e,
|
|
25
|
+
SI: 0x0f,
|
|
26
|
+
DLE: 0x10,
|
|
27
|
+
DC1: 0x11,
|
|
28
|
+
DC2: 0x12,
|
|
29
|
+
DC3: 0x13,
|
|
30
|
+
DC4: 0x14,
|
|
31
|
+
NAK: 0x15,
|
|
32
|
+
SYN: 0x16,
|
|
33
|
+
ETB: 0x17,
|
|
34
|
+
CAN: 0x18,
|
|
35
|
+
EM: 0x19,
|
|
36
|
+
SUB: 0x1a,
|
|
37
|
+
ESC: 0x1b,
|
|
38
|
+
FS: 0x1c,
|
|
39
|
+
GS: 0x1d,
|
|
40
|
+
RS: 0x1e,
|
|
41
|
+
US: 0x1f,
|
|
42
|
+
DEL: 0x7f,
|
|
43
|
+
};
|
|
44
|
+
// String constants for output generation
|
|
45
|
+
/** ESC control character (0x1B), the introducer of every escape sequence. */
|
|
46
|
+
export const ESC = '\x1b';
|
|
47
|
+
/** BEL control character (0x07), the common OSC sequence terminator. */
|
|
48
|
+
export const BEL = '\x07';
|
|
49
|
+
/** Parameter separator used inside CSI and OSC sequences. */
|
|
50
|
+
export const SEP = ';';
|
|
51
|
+
/**
|
|
52
|
+
* Escape sequence type introducers (byte after ESC)
|
|
53
|
+
*/
|
|
54
|
+
export const ESC_TYPE = {
|
|
55
|
+
CSI: 0x5b, // [ - Control Sequence Introducer
|
|
56
|
+
OSC: 0x5d, // ] - Operating System Command
|
|
57
|
+
DCS: 0x50, // P - Device Control String
|
|
58
|
+
APC: 0x5f, // _ - Application Program Command
|
|
59
|
+
PM: 0x5e, // ^ - Privacy Message
|
|
60
|
+
SOS: 0x58, // X - Start of String
|
|
61
|
+
ST: 0x5c, // \ - String Terminator
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Check if a byte is a C0 control character.
|
|
65
|
+
* @param byte - the byte value to check.
|
|
66
|
+
* @returns true when the byte is in the C0 range (0x00-0x1F) or is DEL (0x7F).
|
|
67
|
+
*/
|
|
68
|
+
export function isC0(byte) {
|
|
69
|
+
return byte < 0x20 || byte === 0x7f;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Check if a byte is an ESC sequence final byte (0-9, :, ;, <, =, >, ?, @ through ~).
|
|
73
|
+
* ESC sequences have a wider final byte range than CSI.
|
|
74
|
+
* @param byte - the byte value to check.
|
|
75
|
+
* @returns true when the byte is in the final-byte range (0x30-0x7E).
|
|
76
|
+
*/
|
|
77
|
+
export function isEscFinal(byte) {
|
|
78
|
+
return byte >= 0x30 && byte <= 0x7e;
|
|
79
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSI (Control Sequence Introducer) Types
|
|
3
|
+
*
|
|
4
|
+
* Enums and types for CSI command parameters.
|
|
5
|
+
*/
|
|
6
|
+
/** CSI introducer prefix: ESC followed by `[`. */
|
|
7
|
+
export declare const CSI_PREFIX: string;
|
|
8
|
+
/**
|
|
9
|
+
* CSI parameter byte ranges
|
|
10
|
+
*/
|
|
11
|
+
export declare const CSI_RANGE: {
|
|
12
|
+
readonly PARAM_START: 48;
|
|
13
|
+
readonly PARAM_END: 63;
|
|
14
|
+
readonly INTERMEDIATE_START: 32;
|
|
15
|
+
readonly INTERMEDIATE_END: 47;
|
|
16
|
+
readonly FINAL_START: 64;
|
|
17
|
+
readonly FINAL_END: 126;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Check if a byte is a CSI parameter byte.
|
|
21
|
+
* @param byte - the byte value to check.
|
|
22
|
+
* @returns true when the byte is in the parameter range (0x30-0x3F).
|
|
23
|
+
*/
|
|
24
|
+
export declare function isCSIParam(byte: number): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Check if a byte is a CSI intermediate byte.
|
|
27
|
+
* @param byte - the byte value to check.
|
|
28
|
+
* @returns true when the byte is in the intermediate range (0x20-0x2F).
|
|
29
|
+
*/
|
|
30
|
+
export declare function isCSIIntermediate(byte: number): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Check if a byte is a CSI final byte (@ through ~).
|
|
33
|
+
* @param byte - the byte value to check.
|
|
34
|
+
* @returns true when the byte is in the final range (0x40-0x7E).
|
|
35
|
+
*/
|
|
36
|
+
export declare function isCSIFinal(byte: number): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Generate a CSI sequence: ESC [ p1;p2;...;pN final.
|
|
39
|
+
* With a single argument it is treated as the raw body; with multiple
|
|
40
|
+
* arguments the last is the final byte and the rest are parameters joined
|
|
41
|
+
* by semicolons.
|
|
42
|
+
* @param args - the sequence parts.
|
|
43
|
+
* @returns the complete CSI sequence string.
|
|
44
|
+
*/
|
|
45
|
+
export declare function csi(...args: (string | number)[]): string;
|
|
46
|
+
/**
|
|
47
|
+
* CSI final bytes - the command identifier
|
|
48
|
+
*/
|
|
49
|
+
export declare const CSI: {
|
|
50
|
+
readonly CUU: 65;
|
|
51
|
+
readonly CUD: 66;
|
|
52
|
+
readonly CUF: 67;
|
|
53
|
+
readonly CUB: 68;
|
|
54
|
+
readonly CNL: 69;
|
|
55
|
+
readonly CPL: 70;
|
|
56
|
+
readonly CHA: 71;
|
|
57
|
+
readonly CUP: 72;
|
|
58
|
+
readonly CHT: 73;
|
|
59
|
+
readonly VPA: 100;
|
|
60
|
+
readonly HVP: 102;
|
|
61
|
+
readonly ED: 74;
|
|
62
|
+
readonly EL: 75;
|
|
63
|
+
readonly ECH: 88;
|
|
64
|
+
readonly IL: 76;
|
|
65
|
+
readonly DL: 77;
|
|
66
|
+
readonly ICH: 64;
|
|
67
|
+
readonly DCH: 80;
|
|
68
|
+
readonly SU: 83;
|
|
69
|
+
readonly SD: 84;
|
|
70
|
+
readonly SM: 104;
|
|
71
|
+
readonly RM: 108;
|
|
72
|
+
readonly SGR: 109;
|
|
73
|
+
readonly DSR: 110;
|
|
74
|
+
readonly DECSCUSR: 113;
|
|
75
|
+
readonly DECSTBM: 114;
|
|
76
|
+
readonly SCOSC: 115;
|
|
77
|
+
readonly SCORC: 117;
|
|
78
|
+
readonly CBT: 90;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Erase in Display regions (ED command parameter)
|
|
82
|
+
*/
|
|
83
|
+
export declare const ERASE_DISPLAY: readonly ["toEnd", "toStart", "all", "scrollback"];
|
|
84
|
+
/**
|
|
85
|
+
* Erase in Line regions (EL command parameter)
|
|
86
|
+
*/
|
|
87
|
+
export declare const ERASE_LINE_REGION: readonly ["toEnd", "toStart", "all"];
|
|
88
|
+
/**
|
|
89
|
+
* Cursor styles (DECSCUSR)
|
|
90
|
+
*/
|
|
91
|
+
export type CursorStyle = 'block' | 'underline' | 'bar';
|
|
92
|
+
/**
|
|
93
|
+
* Cursor style lookup table for DECSCUSR parameter 0-6, pairing each cursor
|
|
94
|
+
* shape with its blinking flag.
|
|
95
|
+
*/
|
|
96
|
+
export declare const CURSOR_STYLES: Array<{
|
|
97
|
+
style: CursorStyle;
|
|
98
|
+
blinking: boolean;
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Move cursor up n lines (CSI n A).
|
|
102
|
+
* @param n - number of lines to move; defaults to 1.
|
|
103
|
+
* @returns the CSI sequence, or an empty string when n is 0.
|
|
104
|
+
*/
|
|
105
|
+
export declare function cursorUp(n?: number): string;
|
|
106
|
+
/**
|
|
107
|
+
* Move cursor down n lines (CSI n B).
|
|
108
|
+
* @param n - number of lines to move; defaults to 1.
|
|
109
|
+
* @returns the CSI sequence, or an empty string when n is 0.
|
|
110
|
+
*/
|
|
111
|
+
export declare function cursorDown(n?: number): string;
|
|
112
|
+
/**
|
|
113
|
+
* Move cursor forward n columns (CSI n C).
|
|
114
|
+
* @param n - number of columns to move; defaults to 1.
|
|
115
|
+
* @returns the CSI sequence, or an empty string when n is 0.
|
|
116
|
+
*/
|
|
117
|
+
export declare function cursorForward(n?: number): string;
|
|
118
|
+
/**
|
|
119
|
+
* Move cursor back n columns (CSI n D).
|
|
120
|
+
* @param n - number of columns to move; defaults to 1.
|
|
121
|
+
* @returns the CSI sequence, or an empty string when n is 0.
|
|
122
|
+
*/
|
|
123
|
+
export declare function cursorBack(n?: number): string;
|
|
124
|
+
/**
|
|
125
|
+
* Move cursor to column n (1-indexed) (CSI n G).
|
|
126
|
+
* @param col - the 1-indexed target column.
|
|
127
|
+
* @returns the CSI sequence.
|
|
128
|
+
*/
|
|
129
|
+
export declare function cursorTo(col: number): string;
|
|
130
|
+
/** Move cursor to column 1 (CSI G) */
|
|
131
|
+
export declare const CURSOR_LEFT: string;
|
|
132
|
+
/**
|
|
133
|
+
* Move cursor to row, col (1-indexed) (CSI row ; col H).
|
|
134
|
+
* @param row - the 1-indexed target row.
|
|
135
|
+
* @param col - the 1-indexed target column.
|
|
136
|
+
* @returns the CSI sequence.
|
|
137
|
+
*/
|
|
138
|
+
export declare function cursorPosition(row: number, col: number): string;
|
|
139
|
+
/** Move cursor to home position (CSI H) */
|
|
140
|
+
export declare const CURSOR_HOME: string;
|
|
141
|
+
/**
|
|
142
|
+
* Move cursor relative to current position.
|
|
143
|
+
* Positive x = right, negative x = left.
|
|
144
|
+
* Positive y = down, negative y = up.
|
|
145
|
+
* @param x - horizontal delta in columns.
|
|
146
|
+
* @param y - vertical delta in rows.
|
|
147
|
+
* @returns the concatenated CSI sequences, or an empty string when both deltas are 0.
|
|
148
|
+
*/
|
|
149
|
+
export declare function cursorMove(x: number, y: number): string;
|
|
150
|
+
/** Save cursor position (CSI s) */
|
|
151
|
+
export declare const CURSOR_SAVE: string;
|
|
152
|
+
/** Restore cursor position (CSI u) */
|
|
153
|
+
export declare const CURSOR_RESTORE: string;
|
|
154
|
+
/**
|
|
155
|
+
* Erase from cursor to end of line (CSI K).
|
|
156
|
+
* @returns the CSI sequence.
|
|
157
|
+
*/
|
|
158
|
+
export declare function eraseToEndOfLine(): string;
|
|
159
|
+
/**
|
|
160
|
+
* Erase from cursor to start of line (CSI 1 K).
|
|
161
|
+
* @returns the CSI sequence.
|
|
162
|
+
*/
|
|
163
|
+
export declare function eraseToStartOfLine(): string;
|
|
164
|
+
/**
|
|
165
|
+
* Erase entire line (CSI 2 K).
|
|
166
|
+
* @returns the CSI sequence.
|
|
167
|
+
*/
|
|
168
|
+
export declare function eraseLine(): string;
|
|
169
|
+
/** Erase entire line - constant form */
|
|
170
|
+
export declare const ERASE_LINE: string;
|
|
171
|
+
/**
|
|
172
|
+
* Erase from cursor to end of screen (CSI J).
|
|
173
|
+
* @returns the CSI sequence.
|
|
174
|
+
*/
|
|
175
|
+
export declare function eraseToEndOfScreen(): string;
|
|
176
|
+
/**
|
|
177
|
+
* Erase from cursor to start of screen (CSI 1 J).
|
|
178
|
+
* @returns the CSI sequence.
|
|
179
|
+
*/
|
|
180
|
+
export declare function eraseToStartOfScreen(): string;
|
|
181
|
+
/**
|
|
182
|
+
* Erase entire screen (CSI 2 J).
|
|
183
|
+
* @returns the CSI sequence.
|
|
184
|
+
*/
|
|
185
|
+
export declare function eraseScreen(): string;
|
|
186
|
+
/** Erase entire screen - constant form */
|
|
187
|
+
export declare const ERASE_SCREEN: string;
|
|
188
|
+
/** Erase scrollback buffer (CSI 3 J) */
|
|
189
|
+
export declare const ERASE_SCROLLBACK: string;
|
|
190
|
+
/**
|
|
191
|
+
* Erase n lines starting from the cursor line, moving the cursor up.
|
|
192
|
+
* This erases each line and moves up, ending at column 1.
|
|
193
|
+
* @param n - the number of lines to erase.
|
|
194
|
+
* @returns the combined erase and cursor sequences, or an empty string when
|
|
195
|
+
* n is 0 or negative.
|
|
196
|
+
*/
|
|
197
|
+
export declare function eraseLines(n: number): string;
|
|
198
|
+
/** Reset all SGR attributes (CSI 0 m). Erase/scroll sequences fill blank
|
|
199
|
+
* cells with the CURRENT background color (BCE) — prefix this before any
|
|
200
|
+
* such sequence that must not inherit a possibly-stuck background (e.g.
|
|
201
|
+
* after a truncated frame left a colored SGR active). */
|
|
202
|
+
export declare const SGR_RESET: string;
|
|
203
|
+
/**
|
|
204
|
+
* Scroll up n lines (CSI n S).
|
|
205
|
+
* @param n - number of lines to scroll; defaults to 1.
|
|
206
|
+
* @returns the CSI sequence, or an empty string when n is 0.
|
|
207
|
+
*/
|
|
208
|
+
export declare function scrollUp(n?: number): string;
|
|
209
|
+
/**
|
|
210
|
+
* Scroll down n lines (CSI n T).
|
|
211
|
+
* @param n - number of lines to scroll; defaults to 1.
|
|
212
|
+
* @returns the CSI sequence, or an empty string when n is 0.
|
|
213
|
+
*/
|
|
214
|
+
export declare function scrollDown(n?: number): string;
|
|
215
|
+
/**
|
|
216
|
+
* Set scroll region (DECSTBM, CSI top;bottom r). 1-indexed, inclusive.
|
|
217
|
+
* @param top - the 1-indexed first row of the region.
|
|
218
|
+
* @param bottom - the 1-indexed last row of the region.
|
|
219
|
+
* @returns the CSI sequence.
|
|
220
|
+
*/
|
|
221
|
+
export declare function setScrollRegion(top: number, bottom: number): string;
|
|
222
|
+
/** Reset scroll region to full screen (DECSTBM, CSI r). Homes the cursor. */
|
|
223
|
+
export declare const RESET_SCROLL_REGION: string;
|
|
224
|
+
/** Sent by terminal before pasted content (CSI 200 ~) */
|
|
225
|
+
export declare const PASTE_START: string;
|
|
226
|
+
/** Sent by terminal after pasted content (CSI 201 ~) */
|
|
227
|
+
export declare const PASTE_END: string;
|
|
228
|
+
/** Sent by terminal when it gains focus (CSI I) */
|
|
229
|
+
export declare const FOCUS_IN: string;
|
|
230
|
+
/** Sent by terminal when it loses focus (CSI O) */
|
|
231
|
+
export declare const FOCUS_OUT: string;
|
|
232
|
+
/**
|
|
233
|
+
* Enable Kitty keyboard protocol with basic modifier reporting
|
|
234
|
+
* CSI > 1 u - pushes mode with flags=1 (disambiguate escape codes)
|
|
235
|
+
* This makes Shift+Enter send CSI 13;2 u instead of just CR
|
|
236
|
+
*/
|
|
237
|
+
export declare const ENABLE_KITTY_KEYBOARD: string;
|
|
238
|
+
/**
|
|
239
|
+
* Disable Kitty keyboard protocol
|
|
240
|
+
* CSI < u - pops the keyboard mode stack
|
|
241
|
+
*/
|
|
242
|
+
export declare const DISABLE_KITTY_KEYBOARD: string;
|
|
243
|
+
/**
|
|
244
|
+
* Enable xterm modifyOtherKeys level 2.
|
|
245
|
+
* tmux accepts this (not the kitty stack) to enable extended keys — when
|
|
246
|
+
* extended-keys-format is csi-u, tmux then emits keys in kitty format.
|
|
247
|
+
*/
|
|
248
|
+
export declare const ENABLE_MODIFY_OTHER_KEYS: string;
|
|
249
|
+
/**
|
|
250
|
+
* Disable xterm modifyOtherKeys (reset to default).
|
|
251
|
+
*/
|
|
252
|
+
export declare const DISABLE_MODIFY_OTHER_KEYS: string;
|
|
253
|
+
//# sourceMappingURL=csi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csi.d.ts","sourceRoot":"","sources":["../../../../src/ink/termio/csi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,kDAAkD;AAClD,eAAO,MAAM,UAAU,QAA0C,CAAA;AAEjE;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAA;AAEV;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIvD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;;;;;;GAOG;AACH,wBAAgB,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,MAAM,CAMxD;AAED;;GAEG;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CN,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,aAAa,oDAAqD,CAAA;AAE/E;;GAEG;AACH,eAAO,MAAM,iBAAiB,sCAAuC,CAAA;AAErE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,KAAK,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAQ1E,CAAA;AAID;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAI,GAAG,MAAM,CAEtC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAI,GAAG,MAAM,CAExC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAI,GAAG,MAAM,CAE3C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAI,GAAG,MAAM,CAExC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,sCAAsC;AACtC,eAAO,MAAM,WAAW,QAAW,CAAA;AAEnC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,2CAA2C;AAC3C,eAAO,MAAM,WAAW,QAAW,CAAA;AAEnC;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAevD;AAID,mCAAmC;AACnC,eAAO,MAAM,WAAW,QAAW,CAAA;AAEnC,sCAAsC;AACtC,eAAO,MAAM,cAAc,QAAW,CAAA;AAItC;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wCAAwC;AACxC,eAAO,MAAM,UAAU,QAAc,CAAA;AAErC;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,0CAA0C;AAC1C,eAAO,MAAM,YAAY,QAAc,CAAA;AAEvC,wCAAwC;AACxC,eAAO,MAAM,gBAAgB,QAAc,CAAA;AAE3C;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAW5C;AAED;;;0DAG0D;AAC1D,eAAO,MAAM,SAAS,QAAc,CAAA;AAIpC;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAI,GAAG,MAAM,CAEtC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAI,GAAG,MAAM,CAExC;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,QAAW,CAAA;AAM3C,yDAAyD;AACzD,eAAO,MAAM,WAAW,QAAc,CAAA;AAEtC,wDAAwD;AACxD,eAAO,MAAM,SAAS,QAAc,CAAA;AAMpC,mDAAmD;AACnD,eAAO,MAAM,QAAQ,QAAW,CAAA;AAEhC,mDAAmD;AACnD,eAAO,MAAM,SAAS,QAAW,CAAA;AAMjC;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAa,CAAA;AAE/C;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAAY,CAAA;AAE/C;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,QAAe,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,yBAAyB,QAAa,CAAA"}
|