@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,672 @@
|
|
|
1
|
+
import { type Agent, type AgentHandle, type AgentStatus } from '@deepseek-ai/dsh-agent';
|
|
2
|
+
import type { LlmModelInfo } from '@deepseek-ai/dsh-llm';
|
|
3
|
+
import { type SessionEvent } from '@deepseek-ai/dsh-session';
|
|
4
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
5
|
+
import { type LocalCommand } from './commands.js';
|
|
6
|
+
import { type SessionRecord } from './sessionHistory.js';
|
|
7
|
+
import type { SpinnerMode } from './components/Spinner/spinnerMode.js';
|
|
8
|
+
/** Tool-call card state, mirroring the Claude Code tool-use presentation. */
|
|
9
|
+
export interface ToolRow {
|
|
10
|
+
readonly callId: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
/** Raw JSON arguments as the model produced them (displayed truncated). */
|
|
13
|
+
readonly argsText: string;
|
|
14
|
+
/** Full arguments, shown when Ctrl+O verbose mode is on; dropped when the
|
|
15
|
+
* row is folded (session log retains it). */
|
|
16
|
+
argsFull?: string;
|
|
17
|
+
status: 'running' | 'ok' | 'error';
|
|
18
|
+
resultText?: string;
|
|
19
|
+
/** Full result text, shown when Ctrl+O verbose mode is on. */
|
|
20
|
+
resultFull?: string;
|
|
21
|
+
errorText?: string;
|
|
22
|
+
/** Tool-owned render intent from dsh-tools `presentCall` (diff/terminal/
|
|
23
|
+
* generic). Drives the structured card body instead of the raw text. */
|
|
24
|
+
callView?: ToolCallView;
|
|
25
|
+
/** Tool-owned completed-state view from `presentResult` (applied diff
|
|
26
|
+
* hunks, terminal output, read content…). Wins over callView once set. */
|
|
27
|
+
resultView?: ToolResultView;
|
|
28
|
+
/** Wall-clock start of the call (live elapsed while running). */
|
|
29
|
+
startedAt: number;
|
|
30
|
+
/** Settled wall-clock duration, written by tool/result. */
|
|
31
|
+
durationMs?: number;
|
|
32
|
+
}
|
|
33
|
+
/** One file change in a tool presentation (dsh-tools FileDiff). */
|
|
34
|
+
export interface ToolFileDiff {
|
|
35
|
+
readonly path: string;
|
|
36
|
+
/** Prior content, or null for a new file / no before-image. */
|
|
37
|
+
readonly oldText: string | null;
|
|
38
|
+
readonly newText: string;
|
|
39
|
+
}
|
|
40
|
+
/** Pending-call render intent (structural subset of dsh-tools ToolCallView). */
|
|
41
|
+
export type ToolCallView = {
|
|
42
|
+
readonly card: 'generic';
|
|
43
|
+
readonly title: string;
|
|
44
|
+
readonly kind?: string;
|
|
45
|
+
} | {
|
|
46
|
+
readonly card: 'terminal';
|
|
47
|
+
readonly title: string;
|
|
48
|
+
readonly description?: string;
|
|
49
|
+
readonly cwd?: string;
|
|
50
|
+
} | {
|
|
51
|
+
readonly card: 'diff';
|
|
52
|
+
readonly title: string;
|
|
53
|
+
readonly diffs: readonly ToolFileDiff[];
|
|
54
|
+
};
|
|
55
|
+
/** Completed-call render intent (structural subset of dsh-tools
|
|
56
|
+
* ToolResultView). `web` results and unknown shapes fall back to raw text. */
|
|
57
|
+
export type ToolResultView = {
|
|
58
|
+
readonly card: 'generic';
|
|
59
|
+
readonly title?: string;
|
|
60
|
+
readonly content?: ReadonlyArray<{
|
|
61
|
+
readonly type: string;
|
|
62
|
+
readonly text?: string;
|
|
63
|
+
}>;
|
|
64
|
+
} | {
|
|
65
|
+
readonly card: 'terminal';
|
|
66
|
+
readonly title?: string;
|
|
67
|
+
readonly output?: string;
|
|
68
|
+
readonly exitCode?: number;
|
|
69
|
+
readonly signal?: string;
|
|
70
|
+
} | {
|
|
71
|
+
readonly card: 'diff';
|
|
72
|
+
readonly title?: string;
|
|
73
|
+
readonly diffs: readonly ToolFileDiff[];
|
|
74
|
+
} | {
|
|
75
|
+
readonly card: 'read';
|
|
76
|
+
readonly title?: string;
|
|
77
|
+
readonly path?: string;
|
|
78
|
+
readonly content?: ReadonlyArray<{
|
|
79
|
+
readonly type: string;
|
|
80
|
+
readonly text?: string;
|
|
81
|
+
}>;
|
|
82
|
+
} | {
|
|
83
|
+
readonly card: 'search';
|
|
84
|
+
readonly shape: 'matches';
|
|
85
|
+
readonly title?: string;
|
|
86
|
+
readonly files: ReadonlyArray<{
|
|
87
|
+
readonly path: string;
|
|
88
|
+
readonly matches: ReadonlyArray<{
|
|
89
|
+
readonly lineNumber: number;
|
|
90
|
+
readonly line: string;
|
|
91
|
+
}>;
|
|
92
|
+
}>;
|
|
93
|
+
readonly truncated: boolean;
|
|
94
|
+
readonly total: number;
|
|
95
|
+
} | {
|
|
96
|
+
readonly card: 'search';
|
|
97
|
+
readonly shape: 'paths';
|
|
98
|
+
readonly title?: string;
|
|
99
|
+
readonly paths: readonly string[];
|
|
100
|
+
readonly truncated: boolean;
|
|
101
|
+
readonly total: number;
|
|
102
|
+
};
|
|
103
|
+
/** Re-derives the presentation views foldRows dropped, threaded into
|
|
104
|
+
* foldBack (module-level, no ctx access) by the channel. */
|
|
105
|
+
export interface ToolViewPresenter {
|
|
106
|
+
call(name: string, rawArgs: string): ToolCallView | undefined;
|
|
107
|
+
result(name: string, rawArgs: string, data: SessionEvent<'tool/result'>['data']): ToolResultView | undefined;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* One rendered transcript row. The DSH session log is the source of truth:
|
|
111
|
+
* rows are derived from `session/event` records (and the initial
|
|
112
|
+
* `agent.session.events` replay), never from optimistic local state.
|
|
113
|
+
*/
|
|
114
|
+
export interface ChatRow {
|
|
115
|
+
id: number;
|
|
116
|
+
kind: 'user' | 'assistant' | 'tool' | 'notice' | 'reasoning' | 'interrupt' | 'local' | 'local-output' | 'compact';
|
|
117
|
+
/** Extra label for non-human user rows (e.g. `steering`). */
|
|
118
|
+
label?: string;
|
|
119
|
+
text: string;
|
|
120
|
+
/** True while an assistant step is still streaming chunks. */
|
|
121
|
+
streaming?: boolean;
|
|
122
|
+
/** Present on `tool` rows; the card model. */
|
|
123
|
+
tool?: ToolRow;
|
|
124
|
+
/** Event wall-clock time (transcript-mode metadata, assistant rows). */
|
|
125
|
+
time?: number;
|
|
126
|
+
/** Present on `reasoning` rows once settled: thinking wall-clock duration. */
|
|
127
|
+
durationMs?: number;
|
|
128
|
+
/** Source session event seq — present on every log-derived row (rewind
|
|
129
|
+
* fork anchor on user rows; window-floor bookkeeping for the rest). */
|
|
130
|
+
seq?: number;
|
|
131
|
+
/** True when the row's full text was folded to keep the transcript window
|
|
132
|
+
* bounded (see MAX_ROWS); the session log still holds the full content
|
|
133
|
+
* and loadOlder() restores it. */
|
|
134
|
+
folded?: boolean;
|
|
135
|
+
/** True when loadOlder() restored this row from the log; restored rows are
|
|
136
|
+
* exempt from the next fold pass so a restore is not instantly undone. */
|
|
137
|
+
restored?: boolean;
|
|
138
|
+
}
|
|
139
|
+
/** Running token totals across the session's assistant messages. */
|
|
140
|
+
export interface TokenUsage {
|
|
141
|
+
input: number;
|
|
142
|
+
output: number;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Latest `activity/status` snapshot (the log-only event appended by
|
|
146
|
+
* `@deepseek-ai/dsh-working-activity` for any UI consumer): the model's
|
|
147
|
+
* live working line — thinking copy, running tool, turn summary. dsh-tui
|
|
148
|
+
* renders it on the status line; nothing here requires the plugin (absent
|
|
149
|
+
* events simply leave the slot empty).
|
|
150
|
+
*/
|
|
151
|
+
export interface ActivityStatus {
|
|
152
|
+
readonly phase: 'idle' | 'waiting' | 'thinking' | 'tool' | 'done';
|
|
153
|
+
/** Human-readable status line (plain text, no ANSI). */
|
|
154
|
+
readonly line: string;
|
|
155
|
+
readonly label?: string;
|
|
156
|
+
readonly detail?: string;
|
|
157
|
+
readonly phrase?: string;
|
|
158
|
+
readonly toolCount: number;
|
|
159
|
+
readonly turnElapsedMs: number;
|
|
160
|
+
}
|
|
161
|
+
/** A transient status message shown above the prompt input. */
|
|
162
|
+
export interface NotificationItem {
|
|
163
|
+
id: number;
|
|
164
|
+
text: string;
|
|
165
|
+
/** Theme color key; defaults to dim. */
|
|
166
|
+
color?: 'error' | 'warning' | 'success';
|
|
167
|
+
/** Auto-dismiss after this many ms (default 4000). */
|
|
168
|
+
timeoutMs: number;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Durable same-session goal projection surfaced on the channel (see
|
|
172
|
+
* {@link Channel['goal']}). Mirrors the goal domain's `GoalSnapshot` +
|
|
173
|
+
* replay counters; declared locally so the UI needs no dsh-goal dependency.
|
|
174
|
+
*/
|
|
175
|
+
export interface ChannelGoal {
|
|
176
|
+
id: string;
|
|
177
|
+
revision: number;
|
|
178
|
+
objective: string;
|
|
179
|
+
phase: 'active' | 'paused' | 'blocked' | 'complete';
|
|
180
|
+
/** Total admitted goal-round cap. */
|
|
181
|
+
maxGoalRounds: number;
|
|
182
|
+
/** Highest admitted continuation round so far. */
|
|
183
|
+
roundsStarted: number;
|
|
184
|
+
/** Present exactly while `phase` is `blocked`. */
|
|
185
|
+
blockedReason?: {
|
|
186
|
+
code: string;
|
|
187
|
+
message: string;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/** One entry of the latest todo-list snapshot (mirrors the session domain's
|
|
191
|
+
* `TodoItem`; declared locally for the same reason as {@link ChannelGoal}). */
|
|
192
|
+
export interface TodoPanelItem {
|
|
193
|
+
content: string;
|
|
194
|
+
status: 'pending' | 'in_progress' | 'completed';
|
|
195
|
+
}
|
|
196
|
+
/** One named prompt contribution with its model-visible text. */
|
|
197
|
+
export interface LoadedContextEntry {
|
|
198
|
+
/** Provider-declared name (e.g. `harness:identity`, `deployment:persona`). */
|
|
199
|
+
readonly name: string;
|
|
200
|
+
/** The interpolated text the model receives for this entry. */
|
|
201
|
+
readonly text: string;
|
|
202
|
+
}
|
|
203
|
+
/** One discovered workspace instruction file (AGENTS.md-family). */
|
|
204
|
+
export interface LoadedContextFile {
|
|
205
|
+
/** Model-facing path (e.g. `./AGENTS.md`). */
|
|
206
|
+
readonly displayPath: string;
|
|
207
|
+
}
|
|
208
|
+
/** One model-invocable skill from the skill registry. */
|
|
209
|
+
export interface LoadedContextSkill {
|
|
210
|
+
readonly name: string;
|
|
211
|
+
readonly description: string;
|
|
212
|
+
}
|
|
213
|
+
/** One model-visible tool from the prompt assembly. */
|
|
214
|
+
export interface LoadedContextTool {
|
|
215
|
+
readonly name: string;
|
|
216
|
+
readonly description: string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Snapshot of everything a fresh conversation for the current agent will
|
|
220
|
+
* load: the assembled system prompt (ordered sections, dynamic context,
|
|
221
|
+
* tools), the workspace instruction files baseline discovery would inject,
|
|
222
|
+
* and the skill catalog. Declared locally so screens and helpers consume a
|
|
223
|
+
* self-contained contract instead of the dsh-system-prompt/dsh-skill types.
|
|
224
|
+
*/
|
|
225
|
+
export interface LoadedContext {
|
|
226
|
+
/** Ordered system-prompt sections after strict variable interpolation. */
|
|
227
|
+
readonly sections: readonly LoadedContextEntry[];
|
|
228
|
+
/** Dynamic context contributions (runtime snapshot parts). */
|
|
229
|
+
readonly contexts: readonly LoadedContextEntry[];
|
|
230
|
+
/** Workspace instruction files (AGENTS.md-family) discovered for the cwd. */
|
|
231
|
+
readonly files: readonly LoadedContextFile[];
|
|
232
|
+
/** Model-invocable skills, when the skill registry is mounted. */
|
|
233
|
+
readonly skills: readonly LoadedContextSkill[];
|
|
234
|
+
/** Model-visible tools in assembly order. */
|
|
235
|
+
readonly tools: readonly LoadedContextTool[];
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* The public channel surface a screen renders: the full transcript and live
|
|
239
|
+
* status snapshot (tokens, spinner, working activity, goals, todos, loaded
|
|
240
|
+
* context) plus every action the TUI can take (submit, steer, cancel,
|
|
241
|
+
* rewind, resume, model switching, …). Implementations mutate internal state
|
|
242
|
+
* and bump `version` so subscribed screens re-render.
|
|
243
|
+
*/
|
|
244
|
+
export interface Channel {
|
|
245
|
+
/** Monotonic version — bump on every mutation so screens can re-render. */
|
|
246
|
+
readonly version: number;
|
|
247
|
+
readonly rows: readonly ChatRow[];
|
|
248
|
+
readonly status: AgentStatus | 'starting' | 'disposed';
|
|
249
|
+
readonly sessionTitle: string;
|
|
250
|
+
readonly agentId: string;
|
|
251
|
+
/** Resolved model id (from the plugin config). */
|
|
252
|
+
readonly model: string;
|
|
253
|
+
/** Provider route of the live agent. */
|
|
254
|
+
readonly provider: string;
|
|
255
|
+
/** Running token totals across the session's assistant messages. */
|
|
256
|
+
readonly tokens: TokenUsage;
|
|
257
|
+
/** Working directory of the session. */
|
|
258
|
+
readonly cwd: string;
|
|
259
|
+
/** Current git branch, when the cwd is inside a git worktree. */
|
|
260
|
+
readonly gitBranch: string | undefined;
|
|
261
|
+
/** True between turn/start and turn/end — drives the working spinner. */
|
|
262
|
+
readonly working: boolean;
|
|
263
|
+
/** Which phase the spinner should present while working. */
|
|
264
|
+
readonly spinnerMode: SpinnerMode;
|
|
265
|
+
/** Chars streamed as text this turn (feeds the spinner token counter). */
|
|
266
|
+
readonly responseChars: number;
|
|
267
|
+
/** Number of tool calls still in flight this turn. */
|
|
268
|
+
readonly activeToolCount: number;
|
|
269
|
+
/** Wall-clock ms of turn/start (spinner elapsed timer). */
|
|
270
|
+
readonly turnStart: number;
|
|
271
|
+
/** Last user prompt text (sticky header + statusline). */
|
|
272
|
+
readonly lastUserText: string;
|
|
273
|
+
/** Transient notifications, newest last. */
|
|
274
|
+
readonly notifications: readonly NotificationItem[];
|
|
275
|
+
/** Adapter-advertised context capacity for the model route, when known. */
|
|
276
|
+
readonly contextWindow: number | undefined;
|
|
277
|
+
/** Reasoning effort of the latest request header, when the adapter sets one. */
|
|
278
|
+
readonly reasoningEffort: string | undefined;
|
|
279
|
+
/** Usage of the most recent request (context share + cache hits come from
|
|
280
|
+
* this, not the running totals — each request's input IS the context). */
|
|
281
|
+
readonly lastUsage: {
|
|
282
|
+
input: number;
|
|
283
|
+
output: number;
|
|
284
|
+
cacheRead: number;
|
|
285
|
+
cacheWrite: number;
|
|
286
|
+
} | undefined;
|
|
287
|
+
/** Output tokens per second of the current/last turn's response, when known. */
|
|
288
|
+
readonly tps: number | undefined;
|
|
289
|
+
/** Per-turn tps samples (sparkline history), oldest first. */
|
|
290
|
+
readonly tpsSamples: readonly {
|
|
291
|
+
tps: number;
|
|
292
|
+
at: number;
|
|
293
|
+
}[];
|
|
294
|
+
/** Latest working-activity snapshot (log-only `activity/status` event),
|
|
295
|
+
* when the leaf mounts dsh-working-activity. */
|
|
296
|
+
readonly workingActivity: ActivityStatus | undefined;
|
|
297
|
+
/** Working-activity indicator preset name (`claude`/`moon`/…/`random`). */
|
|
298
|
+
readonly activityFrames: string | undefined;
|
|
299
|
+
/** Whether working-activity events are consumed (config.activity). */
|
|
300
|
+
readonly activityEnabled: boolean;
|
|
301
|
+
/** Whether the segmented context bar row shows in the status footer
|
|
302
|
+
* (config.contextBar; the status/mode lines are unaffected). */
|
|
303
|
+
readonly contextBarEnabled: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Current same-session goal projection, when a goal exists. Derived live
|
|
306
|
+
* from the durable `goal/change` context events (round-zero goal-sourced
|
|
307
|
+
* user messages) in the session log — every goal mutation appends one, so
|
|
308
|
+
* this snapshot tracks create/edit/pause/resume/complete/block/clear in
|
|
309
|
+
* real time and replays correctly on resume/rewind.
|
|
310
|
+
*/
|
|
311
|
+
readonly goal: ChannelGoal | undefined;
|
|
312
|
+
/**
|
|
313
|
+
* Latest todo-list snapshot (`todo/write` whole-list event, last write
|
|
314
|
+
* wins). Log-only UI state, updated live and on replay.
|
|
315
|
+
*/
|
|
316
|
+
readonly todos: readonly TodoPanelItem[];
|
|
317
|
+
/**
|
|
318
|
+
* Snapshot of the context a fresh conversation for this agent will load
|
|
319
|
+
* (system prompt sections, dynamic context, workspace instructions, skill
|
|
320
|
+
* catalog, tools), computed at boot and on every agent swap. `undefined`
|
|
321
|
+
* while loading or when the snapshot could not be assembled — the startup
|
|
322
|
+
* panel stays hidden until it lands.
|
|
323
|
+
*/
|
|
324
|
+
readonly loadedContext: LoadedContext | undefined;
|
|
325
|
+
/**
|
|
326
|
+
* Messages submitted while the model was working and not yet claimed by a
|
|
327
|
+
* turn (`steer` → next step boundary of the running turn, `followup` →
|
|
328
|
+
* after the turn ends). Driven by agent inbox events.
|
|
329
|
+
*/
|
|
330
|
+
readonly pending: readonly PendingMessage[];
|
|
331
|
+
/**
|
|
332
|
+
* Effective slash commands: built-in locals plus plugin-registered
|
|
333
|
+
* commands (plan/goal/…) merged from the DSH command registry. The
|
|
334
|
+
* registry is the source of truth for external names — a plugin shadows
|
|
335
|
+
* nothing here; locals win on name collisions.
|
|
336
|
+
*/
|
|
337
|
+
readonly commandList: readonly LocalCommand[];
|
|
338
|
+
/**
|
|
339
|
+
* Run a plugin-registered slash command against the live agent (DSH
|
|
340
|
+
* `dsh-commands` registry): logs `command/run`/`command/done` and returns
|
|
341
|
+
* the handler's result text — `''` when the handler succeeded silently,
|
|
342
|
+
* `undefined` when the registry has no such command (the caller falls
|
|
343
|
+
* back to sending the line to the model).
|
|
344
|
+
*/
|
|
345
|
+
runExternalCommand(name: string, rawInput: string): Promise<string | undefined>;
|
|
346
|
+
/** Estimated context segments by content type (pi-nano-context style bar). */
|
|
347
|
+
readonly contextSegments: {
|
|
348
|
+
system: number;
|
|
349
|
+
prompt: number;
|
|
350
|
+
assistant: number;
|
|
351
|
+
thinking: number;
|
|
352
|
+
tools: number;
|
|
353
|
+
};
|
|
354
|
+
subscribe: (listener: () => void) => () => void;
|
|
355
|
+
submit(text: string): void;
|
|
356
|
+
/**
|
|
357
|
+
* Steer a message into the running turn (Codex/pi semantics): injected at
|
|
358
|
+
* the next step boundary, the agent continues without aborting.
|
|
359
|
+
*/
|
|
360
|
+
steer(text: string): void;
|
|
361
|
+
/** Pull a pending message back out of the inbox (Alt+Up) for re-editing. */
|
|
362
|
+
removePending(id: string): boolean;
|
|
363
|
+
/** Abort the in-flight turn (`Ctrl+C` while working). */
|
|
364
|
+
cancel(): void;
|
|
365
|
+
/** Abort the in-flight turn and process `texts` right away (Esc/Ctrl+Enter
|
|
366
|
+
* with queued input): each text is re-queued as a followup once the abort
|
|
367
|
+
* settles, so the new turn starts immediately. Returns the count queued. */
|
|
368
|
+
interruptAndDeliver(texts: readonly string[]): number;
|
|
369
|
+
/** Rewind the conversation to a past user message (CC's double-Esc rewind):
|
|
370
|
+
* forks the session through that message, swaps in a fresh agent, and
|
|
371
|
+
* returns the message text for re-editing — or `null` when unwritable. */
|
|
372
|
+
rewindTo(row: ChatRow): Promise<string | null>;
|
|
373
|
+
/** Switch the live agent to a persisted session, replaying its history. */
|
|
374
|
+
resumeTo(sessionId: string): Promise<boolean>;
|
|
375
|
+
/** Start a fresh conversation (`/new`): a brand-new agent + session, the
|
|
376
|
+
* transcript cleared, the resume marker forgotten. */
|
|
377
|
+
newSession(): Promise<boolean>;
|
|
378
|
+
/** Switch the live model (`/model` picker): forks the conversation at its
|
|
379
|
+
* current end and continues it with a new agent routed to `provider`/`model`.
|
|
380
|
+
* The history replays unchanged; only the request route changes. */
|
|
381
|
+
switchModel(provider: string, model: string): Promise<boolean>;
|
|
382
|
+
/** Cycle the live route's reasoning effort (Shift+Tab) through the
|
|
383
|
+
* adapter's own level list (dsh parity: deepseek Off→High→Max), taking
|
|
384
|
+
* effect on the next request and persisting across restarts. */
|
|
385
|
+
cycleEffort(): Promise<void>;
|
|
386
|
+
/** The preset the CURRENT session runs under (issue #8), resolved from its
|
|
387
|
+
* log at create/resume time; undefined when no roster is mounted. */
|
|
388
|
+
readonly agentPreset: string | undefined;
|
|
389
|
+
/** The roster's presets for the `/preset` picker (empty without a roster). */
|
|
390
|
+
listPresets(): Promise<readonly PresetOption[]>;
|
|
391
|
+
/** Switch the agent preset (`/preset`): a blank session swaps composition
|
|
392
|
+
* in place (official `recompose` + logged `agent-preset/selected`); a
|
|
393
|
+
* started session is locked, so the choice persists as the default for
|
|
394
|
+
* future sessions instead. False when the roster is absent, the id is
|
|
395
|
+
* unknown/broken, or a turn is running. */
|
|
396
|
+
switchPreset(presetId: string): Promise<boolean>;
|
|
397
|
+
/** Reset the visible transcript (`/clear`). */
|
|
398
|
+
clear(): void;
|
|
399
|
+
/**
|
|
400
|
+
* Re-render rows older than the current in-memory window from the session
|
|
401
|
+
* log (rows beyond {@link ChannelState.rows}' cap are folded away; this
|
|
402
|
+
* restores them for review). Returns the number of rows restored, 0 when
|
|
403
|
+
* the whole log is already materialized.
|
|
404
|
+
*/
|
|
405
|
+
loadOlder(): number;
|
|
406
|
+
/** Push a transient notification above the prompt input. */
|
|
407
|
+
notify(text: string, options?: {
|
|
408
|
+
color?: NotificationItem['color'];
|
|
409
|
+
timeoutMs?: number;
|
|
410
|
+
}): void;
|
|
411
|
+
/** Switch the working-activity indicator preset (`/activity`): validates
|
|
412
|
+
* the name, persists it to `~/.dsh-cc/working-activity.json`, and
|
|
413
|
+
* re-renders the indicator immediately; false when the name is unknown
|
|
414
|
+
* or the preference cannot be written. */
|
|
415
|
+
setActivityFrames(name: string): boolean;
|
|
416
|
+
/** Advertised models across every registered provider route (empty when the LLM service is absent). */
|
|
417
|
+
listModels(): Promise<readonly LlmModelInfo[]>;
|
|
418
|
+
/** Top-level entries of the session cwd for `@` file completion. */
|
|
419
|
+
listFiles(): Promise<readonly string[]>;
|
|
420
|
+
/** Recent sessions recorded by the DSH persistence backend (for `/resume`). */
|
|
421
|
+
listSessions(): Promise<readonly SessionRecord[]>;
|
|
422
|
+
/** Mark a session for `dsh-tui --resume` on the next launch. */
|
|
423
|
+
setResumeTarget(sessionId: string): void;
|
|
424
|
+
/** Manually compact the session history (CC's /compact); no-op notify when the leaf lacks a compaction service. */
|
|
425
|
+
compact(): void;
|
|
426
|
+
/** Render a multi-line local report in the transcript (`/status`,
|
|
427
|
+
* `/doctor`, …): a `local` row plus one `local-output` row per line. */
|
|
428
|
+
pushLocal(title: string, lines: readonly string[]): void;
|
|
429
|
+
/** MCP server/tool status for /mcp: one line per server, or setup guidance. */
|
|
430
|
+
mcpStatus(): string[];
|
|
431
|
+
/** Write the conversation transcript to `dsh-tui-export-<ts>.md` in the
|
|
432
|
+
* session cwd; returns the written path, or null on failure. */
|
|
433
|
+
exportSession(): string | null;
|
|
434
|
+
/** Create `AGENTS.md` in the session cwd (DSH workspace-context file);
|
|
435
|
+
* returns the path, `'exists'` when already present, or null on failure. */
|
|
436
|
+
initWorkspace(): string | null;
|
|
437
|
+
/** Environment diagnostics for `/doctor`. */
|
|
438
|
+
doctorInfo(): string[];
|
|
439
|
+
/** Subagent rows for `/agents` (DSH subagent service; empty message when
|
|
440
|
+
* the service is absent). */
|
|
441
|
+
listSubagents(): Promise<string[]>;
|
|
442
|
+
}
|
|
443
|
+
/** @internal */
|
|
444
|
+
/** One roster entry in the `/preset` picker (see {@link Channel.listPresets}). */
|
|
445
|
+
export interface PresetOption {
|
|
446
|
+
id: string;
|
|
447
|
+
name?: string;
|
|
448
|
+
description?: string;
|
|
449
|
+
/** Present when the roster marked this preset unloadable (shown verbatim). */
|
|
450
|
+
broken?: string;
|
|
451
|
+
isDefault: boolean;
|
|
452
|
+
}
|
|
453
|
+
/** @internal */
|
|
454
|
+
/** One user message submitted while the model was working, not yet claimed
|
|
455
|
+
* by a turn. `steer` lands at the next step boundary of the running turn;
|
|
456
|
+
* `followup` waits for the turn to end. */
|
|
457
|
+
export interface PendingMessage {
|
|
458
|
+
id: string;
|
|
459
|
+
text: string;
|
|
460
|
+
placement: 'steer' | 'followup';
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Mutable channel state owned by {@link createChannel}: the screen's
|
|
464
|
+
* reactive store. Screens subscribe and re-render on `version` bumps; the
|
|
465
|
+
* fields mirror the public {@link Channel} contract, and the `@internal`
|
|
466
|
+
* emit hooks belong to the implementation.
|
|
467
|
+
*/
|
|
468
|
+
export interface ChannelState {
|
|
469
|
+
version: number;
|
|
470
|
+
rows: ChatRow[];
|
|
471
|
+
status: AgentStatus | 'starting' | 'disposed';
|
|
472
|
+
sessionTitle: string;
|
|
473
|
+
agentId: string;
|
|
474
|
+
model: string;
|
|
475
|
+
provider: string;
|
|
476
|
+
tokens: TokenUsage;
|
|
477
|
+
cwd: string;
|
|
478
|
+
gitBranch: string | undefined;
|
|
479
|
+
working: boolean;
|
|
480
|
+
spinnerMode: SpinnerMode;
|
|
481
|
+
responseChars: number;
|
|
482
|
+
activeToolCount: number;
|
|
483
|
+
turnStart: number;
|
|
484
|
+
lastUserText: string;
|
|
485
|
+
notifications: NotificationItem[];
|
|
486
|
+
/** Adapter-advertised context capacity for the model route, when known. */
|
|
487
|
+
contextWindow: number | undefined;
|
|
488
|
+
/** Reasoning effort of the latest request header, when the adapter sets one. */
|
|
489
|
+
reasoningEffort: string | undefined;
|
|
490
|
+
/** Usage of the most recent request (context share + cache hits). */
|
|
491
|
+
lastUsage: {
|
|
492
|
+
input: number;
|
|
493
|
+
output: number;
|
|
494
|
+
cacheRead: number;
|
|
495
|
+
cacheWrite: number;
|
|
496
|
+
} | undefined;
|
|
497
|
+
/** Output tokens per second of the current/last turn's response, when known. */
|
|
498
|
+
tps: number | undefined;
|
|
499
|
+
/** Per-turn tps samples (sparkline history), oldest first. */
|
|
500
|
+
tpsSamples: {
|
|
501
|
+
tps: number;
|
|
502
|
+
at: number;
|
|
503
|
+
}[];
|
|
504
|
+
/** Latest working-activity snapshot (see the public Channel type). */
|
|
505
|
+
workingActivity: ActivityStatus | undefined;
|
|
506
|
+
/** Working-activity indicator preset (see the public Channel type). */
|
|
507
|
+
activityFrames: string | undefined;
|
|
508
|
+
/** Working-activity consumption switch (see the public Channel type). */
|
|
509
|
+
activityEnabled: boolean;
|
|
510
|
+
/** Context bar row switch (see the public Channel type). */
|
|
511
|
+
contextBarEnabled: boolean;
|
|
512
|
+
/** Current same-session goal projection (see the public Channel type). */
|
|
513
|
+
goal: ChannelGoal | undefined;
|
|
514
|
+
/** Latest todo-list snapshot (see the public Channel type). */
|
|
515
|
+
todos: TodoPanelItem[];
|
|
516
|
+
/** Loaded-context snapshot (see the public Channel type). */
|
|
517
|
+
loadedContext: LoadedContext | undefined;
|
|
518
|
+
/** Messages submitted while working, awaiting their turn/step boundary.
|
|
519
|
+
* Driven by agent inbox events (inserted/claimed/discarded). */
|
|
520
|
+
pending: PendingMessage[];
|
|
521
|
+
/** Effective slash commands (see the public Channel type). */
|
|
522
|
+
commandList: readonly LocalCommand[];
|
|
523
|
+
/** Run a plugin-registered command (see the public Channel type). */
|
|
524
|
+
runExternalCommand(name: string, rawInput: string): Promise<string | undefined>;
|
|
525
|
+
/** Estimated context segments by content type (pi-nano-context style bar). */
|
|
526
|
+
contextSegments: {
|
|
527
|
+
system: number;
|
|
528
|
+
prompt: number;
|
|
529
|
+
assistant: number;
|
|
530
|
+
thinking: number;
|
|
531
|
+
tools: number;
|
|
532
|
+
};
|
|
533
|
+
subscribe: (listener: () => void) => () => void;
|
|
534
|
+
/** @internal event bump (the public `notify(text)` posts a notification). */
|
|
535
|
+
emit(): void;
|
|
536
|
+
/** @internal frame-aligned emit for high-frequency streaming deltas:
|
|
537
|
+
* version bumps synchronously but listeners fire at most once per 16ms
|
|
538
|
+
* window (trailing edge). */
|
|
539
|
+
emitStream(): void;
|
|
540
|
+
submit(text: string): void;
|
|
541
|
+
steer(text: string): void;
|
|
542
|
+
removePending(id: string): boolean;
|
|
543
|
+
cancel(): void;
|
|
544
|
+
/** @internal interrupt-and-deliver (see the public Channel type). */
|
|
545
|
+
interruptAndDeliver(texts: readonly string[]): number;
|
|
546
|
+
rewindTo(row: ChatRow): Promise<string | null>;
|
|
547
|
+
/** Switch the live agent to a persisted session, replaying its history. */
|
|
548
|
+
resumeTo(sessionId: string): Promise<boolean>;
|
|
549
|
+
/** Start a fresh conversation (`/new`). */
|
|
550
|
+
newSession(): Promise<boolean>;
|
|
551
|
+
/** Switch the live model (`/model` picker). */
|
|
552
|
+
switchModel(provider: string, model: string): Promise<boolean>;
|
|
553
|
+
/** Cycle reasoning effort (see the public Channel type). */
|
|
554
|
+
cycleEffort(): Promise<void>;
|
|
555
|
+
/** The preset the current session runs under (see the public Channel type). */
|
|
556
|
+
agentPreset: string | undefined;
|
|
557
|
+
/** The roster's presets for the `/preset` picker (see the public Channel type). */
|
|
558
|
+
listPresets(): Promise<readonly PresetOption[]>;
|
|
559
|
+
/** Switch the agent preset (see the public Channel type). */
|
|
560
|
+
switchPreset(presetId: string): Promise<boolean>;
|
|
561
|
+
clear(): void;
|
|
562
|
+
/** @internal older-row restoration (see the public Channel.loadOlder). */
|
|
563
|
+
loadOlder(): number;
|
|
564
|
+
notify(text: string, options?: {
|
|
565
|
+
color?: NotificationItem['color'];
|
|
566
|
+
timeoutMs?: number;
|
|
567
|
+
}): void;
|
|
568
|
+
/** Switch the working-activity indicator preset (see the public Channel). */
|
|
569
|
+
setActivityFrames(name: string): boolean;
|
|
570
|
+
listModels(): Promise<readonly LlmModelInfo[]>;
|
|
571
|
+
listFiles(): Promise<readonly string[]>;
|
|
572
|
+
listSessions(): Promise<readonly SessionRecord[]>;
|
|
573
|
+
setResumeTarget(sessionId: string): void;
|
|
574
|
+
/** Manually compact the session history (CC's /compact). */
|
|
575
|
+
compact(): void;
|
|
576
|
+
/** Multi-line local report (`/status`, `/doctor`, …). */
|
|
577
|
+
pushLocal(title: string, lines: readonly string[]): void;
|
|
578
|
+
/** MCP server/tool status for /mcp: one line per server, or setup guidance. */
|
|
579
|
+
mcpStatus(): string[];
|
|
580
|
+
/** Export the transcript to a markdown file (CC's /export). */
|
|
581
|
+
exportSession(): string | null;
|
|
582
|
+
/** Create `AGENTS.md` in the session cwd (CC's /init). */
|
|
583
|
+
initWorkspace(): string | null;
|
|
584
|
+
/** Environment diagnostics (CC's /doctor). */
|
|
585
|
+
doctorInfo(): string[];
|
|
586
|
+
/** Subagent rows (CC's /agents). */
|
|
587
|
+
listSubagents(): Promise<string[]>;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Create the live channel state for one agent session: replay the durable
|
|
591
|
+
* transcript, subscribe to the agent's events, and expose every TUI action.
|
|
592
|
+
* @internal
|
|
593
|
+
* @param ctx - The plugin context; optional services are resolved via ctx.get.
|
|
594
|
+
* @param initialAgent - The agent whose session the channel renders; rewinds,
|
|
595
|
+
* resumes, and model switches replace it.
|
|
596
|
+
* @param options - Boot options: model route, cwd, provider, and the
|
|
597
|
+
* reasoning-effort / working-activity / agent-handle preferences.
|
|
598
|
+
* @returns The live channel state, subscribed and ready to render.
|
|
599
|
+
*/
|
|
600
|
+
export declare function createChannel(ctx: Context, initialAgent: Agent, options: {
|
|
601
|
+
model: string;
|
|
602
|
+
cwd: string;
|
|
603
|
+
provider: string;
|
|
604
|
+
/** Configured reasoning effort: applied to the agent's requests when the
|
|
605
|
+
* live route offers it (silently ignored otherwise), and shown from
|
|
606
|
+
* startup until the first request/header event reports the adapter's
|
|
607
|
+
* live value. */
|
|
608
|
+
effort?: string;
|
|
609
|
+
/** Consume `activity/status` session events (dsh-working-activity) into
|
|
610
|
+
* the status line; default on. */
|
|
611
|
+
activity?: boolean;
|
|
612
|
+
/** Indicator preset for the working-activity line (`claude`/`moon`/
|
|
613
|
+
* `comet`/`dots`/… or `random`); default `claude`. */
|
|
614
|
+
activityFrames?: string;
|
|
615
|
+
/** Show the segmented context bar row in the status footer; default on
|
|
616
|
+
* (cordis.yml `contextBar: false` hides it, issue #29). */
|
|
617
|
+
contextBar?: boolean;
|
|
618
|
+
/** cordis.yml's static preset choice (`preset` key): wins over the
|
|
619
|
+
* persisted `/preset` preference for NEW sessions this channel starts. */
|
|
620
|
+
configuredPreset?: string;
|
|
621
|
+
/** cordis.yml's static route (`provider`/`model` keys), undefined when
|
|
622
|
+
* unset: wins over the persisted `/model` preference for NEW sessions
|
|
623
|
+
* only when BOTH halves are pinned (atomic rule, issue #67), and is the
|
|
624
|
+
* only route a resume overrides the target's own record with. */
|
|
625
|
+
configuredProvider?: string;
|
|
626
|
+
configuredModel?: string;
|
|
627
|
+
/** The preset the initial agent's session runs under (from resolveAgent). */
|
|
628
|
+
agentPreset?: string;
|
|
629
|
+
/** Handle of the initial agent; disposed when a rewind replaces it. */
|
|
630
|
+
handle?: AgentHandle;
|
|
631
|
+
}): ChannelState;
|
|
632
|
+
/** The fs-service surface `@`-mention expansion consumes (dsh-fs-local). */
|
|
633
|
+
export interface MentionFs {
|
|
634
|
+
resolve(path: string): Promise<{
|
|
635
|
+
displayPath: string;
|
|
636
|
+
}>;
|
|
637
|
+
stat(target: {
|
|
638
|
+
displayPath: string;
|
|
639
|
+
}): Promise<{
|
|
640
|
+
type: 'file' | 'directory' | 'other';
|
|
641
|
+
} | undefined>;
|
|
642
|
+
readText(target: {
|
|
643
|
+
displayPath: string;
|
|
644
|
+
}): Promise<string>;
|
|
645
|
+
listDir(target: {
|
|
646
|
+
displayPath: string;
|
|
647
|
+
}): Promise<Array<{
|
|
648
|
+
name: string;
|
|
649
|
+
type: 'file' | 'directory' | 'other';
|
|
650
|
+
}>>;
|
|
651
|
+
}
|
|
652
|
+
export interface MentionExpansion {
|
|
653
|
+
/** Model-facing blocks: the typed text first, one block per attachment. */
|
|
654
|
+
blocks: Array<{
|
|
655
|
+
type: 'text';
|
|
656
|
+
text: string;
|
|
657
|
+
}>;
|
|
658
|
+
/** Paths that resolved and were attached (for the confirmation notice). */
|
|
659
|
+
attached: string[];
|
|
660
|
+
/** Mention tokens that failed to resolve (kept literal, warned about). */
|
|
661
|
+
missing: string[];
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* Expand a submitted text's `@` mentions (issue #15) into model-facing
|
|
665
|
+
* attachment blocks: each referenced file contributes its (capped) content,
|
|
666
|
+
* each directory a shallow listing. The typed text stays the first block
|
|
667
|
+
* verbatim — mentions that resolve keep their `@path` spelling in it, and
|
|
668
|
+
* unresolved ones stay literal everywhere. Best-effort: an unreadable or
|
|
669
|
+
* binary file degrades to `missing`, never a failed send.
|
|
670
|
+
*/
|
|
671
|
+
export declare function expandMentions(fs: MentionFs | undefined, cwd: string, text: string): Promise<MentionExpansion>;
|
|
672
|
+
//# sourceMappingURL=channel.d.ts.map
|