@deepseek-harness-tui/dsh-tui 0.6.0 → 0.7.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/README.md +74 -21
- package/bin/dsh-tui.js +115 -25
- package/cordis.patch.yml +69 -17
- package/cordis.yml +50 -12
- package/lib/types/activityPrefs.d.ts +1 -1
- package/lib/types/activityPrefs.js +3 -3
- package/lib/types/cc/figures.d.ts +27 -20
- package/lib/types/cc/figures.d.ts.map +1 -1
- package/lib/types/cc/figures.js +43 -34
- package/lib/types/cc/format.d.ts +18 -9
- package/lib/types/cc/format.d.ts.map +1 -1
- package/lib/types/cc/format.js +26 -18
- package/lib/types/cc/markdown.d.ts +31 -16
- package/lib/types/cc/markdown.d.ts.map +1 -1
- package/lib/types/cc/markdown.js +283 -260
- package/lib/types/cc/terminal.d.ts +10 -7
- package/lib/types/cc/terminal.d.ts.map +1 -1
- package/lib/types/cc/terminal.js +62 -50
- package/lib/types/command-trees.d.ts +3 -0
- package/lib/types/command-trees.d.ts.map +1 -0
- package/lib/types/command-trees.js +4 -0
- package/lib/types/commands.d.ts +37 -1
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +68 -3
- package/lib/types/components/ActivityLine.d.ts +1 -1
- package/lib/types/components/ActivityLine.d.ts.map +1 -1
- package/lib/types/components/ActivityPicker.d.ts.map +1 -1
- package/lib/types/components/ActivityPicker.js +3 -4
- package/lib/types/components/BtwPanel.d.ts +16 -0
- package/lib/types/components/BtwPanel.d.ts.map +1 -0
- package/lib/types/components/BtwPanel.js +47 -0
- package/lib/types/components/CommandSuggestions.d.ts +4 -2
- package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
- package/lib/types/components/CommandSuggestions.js +2 -2
- package/lib/types/components/EffortSlider.d.ts +15 -0
- package/lib/types/components/EffortSlider.d.ts.map +1 -0
- package/lib/types/components/EffortSlider.js +17 -0
- package/lib/types/components/GoalTodoPanel.d.ts +1 -1
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/HelpMenu.d.ts +5 -2
- package/lib/types/components/HelpMenu.d.ts.map +1 -1
- package/lib/types/components/HelpMenu.js +8 -3
- package/lib/types/components/HistorySearchDialog.d.ts +1 -1
- package/lib/types/components/HistorySearchDialog.d.ts.map +1 -1
- package/lib/types/components/HistorySearchDialog.js +21 -10
- package/lib/types/components/InterruptedByUser.d.ts +2 -2
- package/lib/types/components/InterruptedByUser.d.ts.map +1 -1
- package/lib/types/components/InterruptedByUser.js +4 -3
- package/lib/types/components/LoadedContextPanel.d.ts +1 -1
- package/lib/types/components/LoadedContextPanel.d.ts.map +1 -1
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +2 -1
- package/lib/types/components/Markdown.d.ts +11 -11
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +63 -57
- package/lib/types/components/MarkdownTable.d.ts +1 -1
- package/lib/types/components/MarkdownTable.js +2 -2
- package/lib/types/components/MessageList.d.ts +10 -2
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +17 -10
- package/lib/types/components/ModelPicker.d.ts +4 -1
- package/lib/types/components/ModelPicker.d.ts.map +1 -1
- package/lib/types/components/ModelPicker.js +16 -4
- package/lib/types/components/OverlayAbove.d.ts +20 -0
- package/lib/types/components/OverlayAbove.d.ts.map +1 -0
- package/lib/types/components/OverlayAbove.js +18 -0
- package/lib/types/components/PresetPicker.d.ts +1 -1
- package/lib/types/components/PresetPicker.d.ts.map +1 -1
- package/lib/types/components/PresetPicker.js +2 -3
- package/lib/types/components/PromptInput.d.ts +5 -4
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +186 -39
- package/lib/types/components/ResumePicker.d.ts +15 -4
- package/lib/types/components/ResumePicker.d.ts.map +1 -1
- package/lib/types/components/ResumePicker.js +25 -9
- package/lib/types/components/RewindPicker.d.ts +1 -1
- package/lib/types/components/RewindPicker.d.ts.map +1 -1
- package/lib/types/components/RewindPicker.js +14 -5
- package/lib/types/components/SearchBox.d.ts +1 -1
- package/lib/types/components/SearchBox.js +1 -1
- package/lib/types/components/Spinner/GlimmerMessage.d.ts +1 -2
- package/lib/types/components/Spinner/GlimmerMessage.d.ts.map +1 -1
- package/lib/types/components/Spinner/GlimmerMessage.js +1 -2
- package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +1 -1
- package/lib/types/components/Spinner/SpinnerAnimationRow.js +2 -2
- package/lib/types/components/Spinner/SpinnerGlyph.d.ts +1 -1
- package/lib/types/components/Spinner/SpinnerGlyph.js +1 -1
- package/lib/types/components/Spinner/spinnerUtils.d.ts +13 -18
- package/lib/types/components/Spinner/spinnerUtils.d.ts.map +1 -1
- package/lib/types/components/Spinner/spinnerUtils.js +67 -71
- package/lib/types/components/Spinner/useStalledAnimation.d.ts +1 -2
- package/lib/types/components/Spinner/useStalledAnimation.d.ts.map +1 -1
- package/lib/types/components/Spinner/useStalledAnimation.js +1 -2
- package/lib/types/components/StreamingMarkdown.d.ts +1 -1
- package/lib/types/components/StreamingMarkdown.js +1 -1
- package/lib/types/components/ThemePicker.d.ts +13 -9
- package/lib/types/components/ThemePicker.d.ts.map +1 -1
- package/lib/types/components/ThemePicker.js +21 -15
- package/lib/types/components/ThinkingToggle.d.ts +1 -1
- package/lib/types/components/ThinkingToggle.d.ts.map +1 -1
- package/lib/types/components/ThinkingToggle.js +8 -8
- package/lib/types/components/ToolUseLoader.d.ts +1 -1
- package/lib/types/components/ToolUseLoader.js +1 -1
- package/lib/types/components/WorkingSpinner.d.ts +2 -2
- package/lib/types/components/WorkingSpinner.js +2 -2
- package/lib/types/components/WorkspaceFlowPicker.d.ts +15 -0
- package/lib/types/components/WorkspaceFlowPicker.d.ts.map +1 -0
- package/lib/types/components/WorkspaceFlowPicker.js +19 -0
- package/lib/types/components/WorkspacePicker.d.ts +9 -0
- package/lib/types/components/WorkspacePicker.d.ts.map +1 -0
- package/lib/types/components/WorkspacePicker.js +13 -0
- package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
- package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
- package/lib/types/components/approvals/ApprovalPanel.js +2 -1
- package/lib/types/components/design-system/Byline.d.ts +1 -1
- package/lib/types/components/design-system/Byline.js +1 -1
- package/lib/types/components/design-system/Divider.d.ts +1 -1
- package/lib/types/components/design-system/Divider.js +1 -1
- package/lib/types/components/design-system/HintLine.d.ts +12 -0
- package/lib/types/components/design-system/HintLine.d.ts.map +1 -0
- package/lib/types/components/design-system/HintLine.js +15 -0
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts +1 -1
- package/lib/types/components/design-system/KeyboardShortcutHint.js +1 -1
- package/lib/types/components/design-system/ListItem.d.ts +2 -2
- package/lib/types/components/design-system/ListItem.d.ts.map +1 -1
- package/lib/types/components/design-system/ListItem.js +35 -3
- package/lib/types/components/design-system/LoadingState.d.ts +1 -2
- package/lib/types/components/design-system/LoadingState.d.ts.map +1 -1
- package/lib/types/components/design-system/LoadingState.js +1 -2
- package/lib/types/components/design-system/Pane.d.ts +2 -2
- package/lib/types/components/design-system/Pane.js +2 -2
- package/lib/types/components/design-system/ProgressBar.d.ts +1 -2
- package/lib/types/components/design-system/ProgressBar.d.ts.map +1 -1
- package/lib/types/components/design-system/ProgressBar.js +1 -2
- package/lib/types/components/design-system/StatusIcon.d.ts +2 -2
- package/lib/types/components/design-system/StatusIcon.js +2 -2
- package/lib/types/components/design-system/ThemeProvider.d.ts +1 -1
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +87 -26
- package/lib/types/components/design-system/ThemedBox.d.ts +1 -1
- package/lib/types/components/design-system/ThemedBox.js +1 -1
- package/lib/types/components/design-system/ThemedText.d.ts +2 -2
- package/lib/types/components/design-system/ThemedText.js +2 -2
- package/lib/types/components/listWindow.d.ts +26 -0
- package/lib/types/components/listWindow.d.ts.map +1 -0
- package/lib/types/components/listWindow.js +47 -0
- package/lib/types/components/messages/AssistantTextMessage.d.ts +1 -2
- package/lib/types/components/messages/AssistantTextMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantTextMessage.js +1 -2
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +2 -2
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +6 -6
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +12 -4
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +9 -5
- package/lib/types/components/messages/MessageMetadata.d.ts +1 -1
- package/lib/types/components/messages/MessageMetadata.js +1 -1
- package/lib/types/components/messages/UserPromptMessage.d.ts +1 -1
- package/lib/types/components/messages/UserPromptMessage.js +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +5 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +11 -9
- package/lib/types/components/questions/PlanReviewPanel.d.ts +1 -1
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +3 -2
- package/lib/types/components/trajectory/HotspotView.d.ts +14 -0
- package/lib/types/components/trajectory/HotspotView.d.ts.map +1 -0
- package/lib/types/components/trajectory/HotspotView.js +83 -0
- package/lib/types/components/trajectory/Inspector.d.ts +31 -0
- package/lib/types/components/trajectory/Inspector.d.ts.map +1 -0
- package/lib/types/components/trajectory/Inspector.js +67 -0
- package/lib/types/components/trajectory/Ledger.d.ts +20 -0
- package/lib/types/components/trajectory/Ledger.d.ts.map +1 -0
- package/lib/types/components/trajectory/Ledger.js +112 -0
- package/lib/types/components/trajectory/MiniWake.d.ts +24 -0
- package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -0
- package/lib/types/components/trajectory/MiniWake.js +99 -0
- package/lib/types/components/trajectory/WaveBand.d.ts +33 -0
- package/lib/types/components/trajectory/WaveBand.d.ts.map +1 -0
- package/lib/types/components/trajectory/WaveBand.js +145 -0
- package/lib/types/customTheme.d.ts +6 -6
- package/lib/types/customTheme.d.ts.map +1 -1
- package/lib/types/customTheme.js +15 -12
- package/lib/types/dsh-adapter/approvals.d.ts.map +1 -0
- package/lib/types/{channel.d.ts → dsh-adapter/channel.d.ts} +184 -43
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -0
- package/lib/types/{channel.js → dsh-adapter/channel.js} +972 -201
- package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -0
- package/lib/types/{childStderr.js → dsh-adapter/childStderr.js} +1 -1
- package/lib/types/dsh-adapter/command-trees.d.ts +27 -0
- package/lib/types/dsh-adapter/command-trees.d.ts.map +1 -0
- package/lib/types/dsh-adapter/command-trees.js +42 -0
- package/lib/types/dsh-adapter/compat/index.d.ts +22 -0
- package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -0
- package/lib/types/{compat → dsh-adapter/compat}/index.js +7 -4
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +86 -0
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/sessionLog.js +347 -0
- package/lib/types/dsh-adapter/contract.d.ts +20 -0
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -0
- package/lib/types/dsh-adapter/contract.js +109 -0
- package/lib/types/dsh-adapter/index.d.ts +80 -0
- package/lib/types/dsh-adapter/index.d.ts.map +1 -0
- package/lib/types/dsh-adapter/index.js +45 -0
- package/lib/types/dsh-adapter/invariant.d.ts.map +1 -0
- package/lib/types/dsh-adapter/packaged-skills.d.ts.map +1 -0
- package/lib/types/{plugin.d.ts → dsh-adapter/plugin.d.ts} +17 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -0
- package/lib/types/{plugin.js → dsh-adapter/plugin.js} +280 -80
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts +91 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -0
- package/lib/types/dsh-adapter/providerWizard.js +332 -0
- package/lib/types/{questions.d.ts → dsh-adapter/questions.d.ts} +7 -2
- package/lib/types/dsh-adapter/questions.d.ts.map +1 -0
- package/lib/types/{questions.js → dsh-adapter/questions.js} +15 -7
- package/lib/types/dsh-adapter/sideQuestion.d.ts +38 -0
- package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sideQuestion.js +69 -0
- package/lib/types/dsh-adapter/trajectory/aggregate.d.ts +46 -0
- package/lib/types/dsh-adapter/trajectory/aggregate.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/aggregate.js +207 -0
- package/lib/types/dsh-adapter/trajectory/guards.d.ts +177 -0
- package/lib/types/dsh-adapter/trajectory/guards.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/guards.js +235 -0
- package/lib/types/dsh-adapter/trajectory/index.d.ts +16 -0
- package/lib/types/dsh-adapter/trajectory/index.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/index.js +15 -0
- package/lib/types/dsh-adapter/trajectory/inspect.d.ts +40 -0
- package/lib/types/dsh-adapter/trajectory/inspect.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/inspect.js +160 -0
- package/lib/types/dsh-adapter/trajectory/projection.d.ts +128 -0
- package/lib/types/dsh-adapter/trajectory/projection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/projection.js +653 -0
- package/lib/types/dsh-adapter/trajectory/types.d.ts +232 -0
- package/lib/types/dsh-adapter/trajectory/types.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/types.js +70 -0
- package/lib/types/dsh-adapter/trajectory/wave.d.ts +45 -0
- package/lib/types/dsh-adapter/trajectory/wave.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/wave.js +210 -0
- package/lib/types/dsh-adapter/types.d.ts +23 -0
- package/lib/types/dsh-adapter/types.d.ts.map +1 -0
- package/lib/types/dsh-adapter/types.js +1 -0
- package/lib/types/dsh-adapter/workspace.d.ts +22 -0
- package/lib/types/dsh-adapter/workspace.d.ts.map +1 -0
- package/lib/types/dsh-adapter/workspace.js +16 -0
- package/lib/types/dsh-adapter/workspaces.d.ts +118 -0
- package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -0
- package/lib/types/dsh-adapter/workspaces.js +290 -0
- package/lib/types/effortPrefs.d.ts +1 -1
- package/lib/types/effortPrefs.js +3 -3
- package/lib/types/history.js +2 -2
- package/lib/types/hooks/useBlink.d.ts +1 -1
- package/lib/types/hooks/useBlink.js +1 -1
- package/lib/types/i18n.d.ts +977 -36
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +307 -30
- package/lib/types/index.d.ts +1 -69
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +3 -31
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +33 -19
- package/lib/types/ink/dom.d.ts +15 -0
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/dom.js +32 -0
- package/lib/types/ink/hooks/use-input.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-input.js +8 -0
- package/lib/types/ink/hooks/use-terminal-size.d.ts +1 -1
- package/lib/types/ink/hooks/use-terminal-size.js +1 -1
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +109 -28
- package/lib/types/ink/input-suppression.d.ts +20 -0
- package/lib/types/ink/input-suppression.d.ts.map +1 -0
- package/lib/types/ink/input-suppression.js +26 -0
- package/lib/types/ink/log-update.js +21 -6
- package/lib/types/ink/parse-keypress.d.ts +31 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +442 -8
- package/lib/types/ink/terminal-querier.d.ts +5 -1
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +27 -3
- package/lib/types/ink/terminal.d.ts +18 -0
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +32 -4
- package/lib/types/ink/termio/csi.d.ts +10 -0
- package/lib/types/ink/termio/csi.d.ts.map +1 -1
- package/lib/types/ink/termio/csi.js +20 -0
- package/lib/types/ink/termio/tokenize.js +10 -0
- package/lib/types/modelPrefs.d.ts +1 -1
- package/lib/types/modelPrefs.js +3 -3
- package/lib/types/presetPrefs.d.ts +1 -1
- package/lib/types/presetPrefs.js +3 -3
- package/lib/types/screens/Chat.d.ts +20 -4
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +655 -55
- package/lib/types/screens/StatusLine.d.ts +17 -2
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +12 -4
- package/lib/types/screens/TrajectoryScene.d.ts +16 -0
- package/lib/types/screens/TrajectoryScene.d.ts.map +1 -0
- package/lib/types/screens/TrajectoryScene.js +305 -0
- package/lib/types/sessionHistory.d.ts +9 -1
- package/lib/types/sessionHistory.d.ts.map +1 -1
- package/lib/types/sessionHistory.js +56 -16
- package/lib/types/sessionModes.d.ts +29 -0
- package/lib/types/sessionModes.d.ts.map +1 -0
- package/lib/types/sessionModes.js +45 -0
- package/lib/types/theme.d.ts +27 -3
- package/lib/types/theme.d.ts.map +1 -1
- package/lib/types/theme.js +48 -4
- package/lib/types/themePrefs.d.ts +3 -3
- package/lib/types/themePrefs.js +5 -5
- package/lib/types/trajectory/format.d.ts +100 -0
- package/lib/types/trajectory/format.d.ts.map +1 -0
- package/lib/types/trajectory/format.js +213 -0
- package/lib/types/trajectory/motion.d.ts +99 -0
- package/lib/types/trajectory/motion.d.ts.map +1 -0
- package/lib/types/trajectory/motion.js +143 -0
- package/lib/types/trajectory/query.d.ts +83 -0
- package/lib/types/trajectory/query.d.ts.map +1 -0
- package/lib/types/trajectory/query.js +187 -0
- package/lib/types/trajectoryPrefs.d.ts +36 -0
- package/lib/types/trajectoryPrefs.d.ts.map +1 -0
- package/lib/types/trajectoryPrefs.js +65 -0
- package/lib/types/update.d.ts +3 -3
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +18 -7
- package/lib/types/utils/clipboard.d.ts +101 -29
- package/lib/types/utils/clipboard.d.ts.map +1 -1
- package/lib/types/utils/clipboard.js +533 -55
- package/lib/types/utils/debug.d.ts +1 -1
- package/lib/types/utils/debug.js +2 -2
- package/lib/types/utils/execFileNoThrow.d.ts.map +1 -1
- package/lib/types/utils/execFileNoThrow.js +16 -6
- package/lib/types/utils/externalEditor.d.ts +115 -0
- package/lib/types/utils/externalEditor.d.ts.map +1 -0
- package/lib/types/utils/externalEditor.js +270 -0
- package/lib/types/utils/fullscreen.d.ts +2 -2
- package/lib/types/utils/fullscreen.js +3 -3
- package/lib/types/utils/loaded-context.d.ts +1 -1
- package/lib/types/utils/loaded-context.d.ts.map +1 -1
- package/lib/types/utils/modifiers.d.ts +24 -0
- package/lib/types/utils/modifiers.d.ts.map +1 -1
- package/lib/types/utils/modifiers.js +27 -0
- package/lib/types/utils/paths.d.ts +45 -0
- package/lib/types/utils/paths.d.ts.map +1 -0
- package/lib/types/utils/paths.js +69 -0
- package/lib/types/utils/shellQuote.d.ts +14 -0
- package/lib/types/utils/shellQuote.d.ts.map +1 -0
- package/lib/types/utils/shellQuote.js +39 -0
- package/lib/types/utils/workspaceRoot.d.ts +21 -0
- package/lib/types/utils/workspaceRoot.d.ts.map +1 -0
- package/lib/types/utils/workspaceRoot.js +47 -0
- package/lib/types/workspaces.d.ts +3 -0
- package/lib/types/workspaces.d.ts.map +1 -0
- package/lib/types/workspaces.js +4 -0
- package/package.json +26 -8
- package/lib/types/approvals.d.ts.map +0 -1
- package/lib/types/channel.d.ts.map +0 -1
- package/lib/types/childStderr.d.ts.map +0 -1
- package/lib/types/compat/index.d.ts +0 -20
- package/lib/types/compat/index.d.ts.map +0 -1
- package/lib/types/compat/sessionLog.d.ts +0 -40
- package/lib/types/compat/sessionLog.d.ts.map +0 -1
- package/lib/types/compat/sessionLog.js +0 -226
- package/lib/types/invariant.d.ts.map +0 -1
- package/lib/types/packaged-skills.d.ts.map +0 -1
- package/lib/types/plugin.d.ts.map +0 -1
- package/lib/types/presets.d.ts.map +0 -1
- package/lib/types/questions.d.ts.map +0 -1
- /package/lib/types/{approvals.d.ts → dsh-adapter/approvals.d.ts} +0 -0
- /package/lib/types/{approvals.js → dsh-adapter/approvals.js} +0 -0
- /package/lib/types/{childStderr.d.ts → dsh-adapter/childStderr.d.ts} +0 -0
- /package/lib/types/{invariant.d.ts → dsh-adapter/invariant.d.ts} +0 -0
- /package/lib/types/{invariant.js → dsh-adapter/invariant.js} +0 -0
- /package/lib/types/{packaged-skills.d.ts → dsh-adapter/packaged-skills.d.ts} +0 -0
- /package/lib/types/{packaged-skills.js → dsh-adapter/packaged-skills.js} +0 -0
- /package/lib/types/{presets.d.ts → dsh-adapter/presets.d.ts} +0 -0
- /package/lib/types/{presets.js → dsh-adapter/presets.js} +0 -0
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Persisted working-activity indicator preference, mirroring the pi
|
|
3
3
|
* working-activity extension's `~/.pi/agent/working-activity.json`
|
|
4
4
|
* (`frames` key). dsh-tui keeps its own copy at
|
|
5
|
-
* `~/.dsh-
|
|
5
|
+
* `~/.dsh-tui/working-activity.json` so the `/activity` choice survives
|
|
6
6
|
* restarts. The file is best-effort: a missing or corrupt file (or an
|
|
7
7
|
* unknown preset left behind by an older version) just falls back to the
|
|
8
8
|
* default preset.
|
|
9
9
|
*/
|
|
10
10
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
11
|
-
import { homedir } from 'node:os';
|
|
12
11
|
import { join } from 'node:path';
|
|
13
12
|
import { isPresetName } from './components/activityFrames.js';
|
|
14
|
-
|
|
13
|
+
import { DATA_DIR } from './utils/paths.js';
|
|
14
|
+
const PREFS_DIR = DATA_DIR;
|
|
15
15
|
/**
|
|
16
16
|
* Parse a persisted `{ frames }` value; anything else yields undefined.
|
|
17
17
|
* @param text - Raw file contents.
|
|
@@ -1,41 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* UI glyph constants
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* UI glyph constants used across the TUI: prompt markers, status badges,
|
|
3
|
+
* direction arrows, media controls, reasoning-effort indicators, and
|
|
4
|
+
* bridge-state symbols.
|
|
5
|
+
*
|
|
6
|
+
* Every constant is a fixed Unicode character, so rendering is identical on
|
|
7
|
+
* all platforms except the activity bullet: macOS gets a heavier ring glyph
|
|
8
|
+
* that matches its default terminal font, everything else gets a solid dot.
|
|
9
|
+
* Escapes are used instead of raw characters so the file stays robust to
|
|
10
|
+
* encoding round-trips; the rendered glyph is shown in each comment.
|
|
5
11
|
*/
|
|
12
|
+
/** Activity bullet: ring on macOS (`⏺`), solid dot elsewhere (`●`). */
|
|
6
13
|
export declare const BLACK_CIRCLE: string;
|
|
7
|
-
/**
|
|
14
|
+
/** Prompt pointer, a bold right chevron (`❯`). */
|
|
8
15
|
export declare const POINTER = "\u276F";
|
|
9
|
-
/**
|
|
16
|
+
/** Success checkmark (`✓`). */
|
|
10
17
|
export declare const TICK = "\u2713";
|
|
11
|
-
/**
|
|
18
|
+
/** Small dot for separating operators (`∙`). */
|
|
12
19
|
export declare const BULLET_OPERATOR = "\u2219";
|
|
13
|
-
/** Teardrop asterisk (`✻`)
|
|
20
|
+
/** Teardrop asterisk, decorative list marker (`✻`). */
|
|
14
21
|
export declare const TEARDROP_ASTERISK = "\u273B";
|
|
22
|
+
/** Lightning bolt, "fast / hot" marker (`↯`). */
|
|
23
|
+
export declare const LIGHTNING_BOLT = "\u21AF";
|
|
15
24
|
/** Up arrow (`↑`). */
|
|
16
25
|
export declare const UP_ARROW = "\u2191";
|
|
17
26
|
/** Down arrow (`↓`). */
|
|
18
27
|
export declare const DOWN_ARROW = "\u2193";
|
|
19
|
-
/**
|
|
20
|
-
export declare const
|
|
21
|
-
/**
|
|
28
|
+
/** Left arrow (`←`), channel indicator. */
|
|
29
|
+
export declare const CHANNEL_ARROW = "\u2190";
|
|
30
|
+
/** Right arrow (`→`), injected-message indicator. */
|
|
31
|
+
export declare const INJECTED_ARROW = "\u2192";
|
|
32
|
+
/** Low effort: open circle (`○`). */
|
|
22
33
|
export declare const EFFORT_LOW = "\u25CB";
|
|
23
|
-
/** Medium
|
|
34
|
+
/** Medium effort: half-filled circle (`◐`). */
|
|
24
35
|
export declare const EFFORT_MEDIUM = "\u25D0";
|
|
25
|
-
/** High
|
|
36
|
+
/** High effort: filled circle (`●`). */
|
|
26
37
|
export declare const EFFORT_HIGH = "\u25CF";
|
|
27
|
-
/**
|
|
38
|
+
/** Maximum effort: bullseye (`◉`). */
|
|
28
39
|
export declare const EFFORT_MAX = "\u25C9";
|
|
29
|
-
/** Play control
|
|
40
|
+
/** Play control (`▶`). */
|
|
30
41
|
export declare const PLAY_ICON = "\u25B6";
|
|
31
|
-
/** Pause control
|
|
42
|
+
/** Pause control (`⏸`). */
|
|
32
43
|
export declare const PAUSE_ICON = "\u23F8";
|
|
33
44
|
/** Refresh arrow (`↻`), MCP subscription indicator. */
|
|
34
45
|
export declare const REFRESH_ARROW = "\u21BB";
|
|
35
|
-
/** Left arrow (`←`), channel indicator. */
|
|
36
|
-
export declare const CHANNEL_ARROW = "\u2190";
|
|
37
|
-
/** Right arrow (`→`), injected-message indicator. */
|
|
38
|
-
export declare const INJECTED_ARROW = "\u2192";
|
|
39
46
|
/** Fork glyph (`⑂`), fork indicator. */
|
|
40
47
|
export declare const FORK_GLYPH = "\u2442";
|
|
41
48
|
/** Open diamond (`◇`), review status indicator. */
|
|
@@ -50,7 +57,7 @@ export declare const FLAG_ICON = "\u2691";
|
|
|
50
57
|
export declare const BLOCKQUOTE_BAR = "\u258E";
|
|
51
58
|
/** Heavy horizontal rule (`━`). */
|
|
52
59
|
export declare const HEAVY_HORIZONTAL = "\u2501";
|
|
53
|
-
/** Bridge
|
|
60
|
+
/** Bridge spinner frames: `·|·` → `·/·` → `·—·` → `·\·`. */
|
|
54
61
|
export declare const BRIDGE_SPINNER_FRAMES: string[];
|
|
55
62
|
/** Bridge ready indicator (`·✔︎·`). */
|
|
56
63
|
export declare const BRIDGE_READY_INDICATOR = "\u00B7\u2714\uFE0E\u00B7";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"figures.d.ts","sourceRoot":"","sources":["../../../src/cc/figures.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"figures.d.ts","sourceRoot":"","sources":["../../../src/cc/figures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,uEAAuE;AACvE,eAAO,MAAM,YAAY,QAA4C,CAAA;AAGrE,kDAAkD;AAClD,eAAO,MAAM,OAAO,WAAW,CAAA;AAC/B,+BAA+B;AAC/B,eAAO,MAAM,IAAI,WAAW,CAAA;AAC5B,gDAAgD;AAChD,eAAO,MAAM,eAAe,WAAW,CAAA;AACvC,uDAAuD;AACvD,eAAO,MAAM,iBAAiB,WAAW,CAAA;AACzC,iDAAiD;AACjD,eAAO,MAAM,cAAc,WAAW,CAAA;AAGtC,sBAAsB;AACtB,eAAO,MAAM,QAAQ,WAAW,CAAA;AAChC,wBAAwB;AACxB,eAAO,MAAM,UAAU,WAAW,CAAA;AAClC,2CAA2C;AAC3C,eAAO,MAAM,aAAa,WAAW,CAAA;AACrC,qDAAqD;AACrD,eAAO,MAAM,cAAc,WAAW,CAAA;AAGtC,qCAAqC;AACrC,eAAO,MAAM,UAAU,WAAW,CAAA;AAClC,+CAA+C;AAC/C,eAAO,MAAM,aAAa,WAAW,CAAA;AACrC,wCAAwC;AACxC,eAAO,MAAM,WAAW,WAAW,CAAA;AACnC,sCAAsC;AACtC,eAAO,MAAM,UAAU,WAAW,CAAA;AAGlC,0BAA0B;AAC1B,eAAO,MAAM,SAAS,WAAW,CAAA;AACjC,2BAA2B;AAC3B,eAAO,MAAM,UAAU,WAAW,CAAA;AAGlC,uDAAuD;AACvD,eAAO,MAAM,aAAa,WAAW,CAAA;AACrC,wCAAwC;AACxC,eAAO,MAAM,UAAU,WAAW,CAAA;AAGlC,mDAAmD;AACnD,eAAO,MAAM,YAAY,WAAW,CAAA;AACpC,qDAAqD;AACrD,eAAO,MAAM,cAAc,WAAW,CAAA;AACtC,iDAAiD;AACjD,eAAO,MAAM,cAAc,WAAW,CAAA;AAGtC,wCAAwC;AACxC,eAAO,MAAM,SAAS,WAAW,CAAA;AACjC,oDAAoD;AACpD,eAAO,MAAM,cAAc,WAAW,CAAA;AACtC,mCAAmC;AACnC,eAAO,MAAM,gBAAgB,WAAW,CAAA;AAGxC,4DAA4D;AAC5D,eAAO,MAAM,qBAAqB,UAKjC,CAAA;AACD,uCAAuC;AACvC,eAAO,MAAM,sBAAsB,6BAA6B,CAAA;AAChE,qCAAqC;AACrC,eAAO,MAAM,uBAAuB,WAAW,CAAA"}
|
package/lib/types/cc/figures.js
CHANGED
|
@@ -1,62 +1,71 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* UI glyph constants
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* UI glyph constants used across the TUI: prompt markers, status badges,
|
|
3
|
+
* direction arrows, media controls, reasoning-effort indicators, and
|
|
4
|
+
* bridge-state symbols.
|
|
5
|
+
*
|
|
6
|
+
* Every constant is a fixed Unicode character, so rendering is identical on
|
|
7
|
+
* all platforms except the activity bullet: macOS gets a heavier ring glyph
|
|
8
|
+
* that matches its default terminal font, everything else gets a solid dot.
|
|
9
|
+
* Escapes are used instead of raw characters so the file stays robust to
|
|
10
|
+
* encoding round-trips; the rendered glyph is shown in each comment.
|
|
5
11
|
*/
|
|
12
|
+
/** Activity bullet: ring on macOS (`⏺`), solid dot elsewhere (`●`). */
|
|
6
13
|
export const BLACK_CIRCLE = process.platform === 'darwin' ? '⏺' : '●';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
// Prompt and list markers
|
|
15
|
+
/** Prompt pointer, a bold right chevron (`❯`). */
|
|
16
|
+
export const POINTER = '\u276f'; // ❯
|
|
17
|
+
/** Success checkmark (`✓`). */
|
|
18
|
+
export const TICK = '\u2713'; // ✓
|
|
19
|
+
/** Small dot for separating operators (`∙`). */
|
|
20
|
+
export const BULLET_OPERATOR = '\u2219'; // ∙
|
|
21
|
+
/** Teardrop asterisk, decorative list marker (`✻`). */
|
|
22
|
+
export const TEARDROP_ASTERISK = '\u273b'; // ✻
|
|
23
|
+
/** Lightning bolt, "fast / hot" marker (`↯`). */
|
|
24
|
+
export const LIGHTNING_BOLT = '\u21af'; // ↯
|
|
25
|
+
// Direction arrows
|
|
15
26
|
/** Up arrow (`↑`). */
|
|
16
27
|
export const UP_ARROW = '\u2191'; // ↑
|
|
17
28
|
/** Down arrow (`↓`). */
|
|
18
29
|
export const DOWN_ARROW = '\u2193'; // ↓
|
|
19
|
-
/** Lightning bolt (`↯`), figures.lightningBolt. */
|
|
20
|
-
export const LIGHTNING_BOLT = '↯';
|
|
21
|
-
/** Low-effort indicator: open circle (`○`). */
|
|
22
|
-
export const EFFORT_LOW = '○';
|
|
23
|
-
/** Medium-effort indicator: half circle (`◐`). */
|
|
24
|
-
export const EFFORT_MEDIUM = '◐';
|
|
25
|
-
/** High-effort indicator: filled circle (`●`). */
|
|
26
|
-
export const EFFORT_HIGH = '●';
|
|
27
|
-
/** Max-effort indicator: bullseye (`◉`). */
|
|
28
|
-
export const EFFORT_MAX = '◉';
|
|
29
|
-
// Media/trigger status indicators
|
|
30
|
-
/** Play control icon (`▶`). */
|
|
31
|
-
export const PLAY_ICON = '\u25b6'; // ▶
|
|
32
|
-
/** Pause control icon (`⏸`). */
|
|
33
|
-
export const PAUSE_ICON = '\u23f8'; // ⏸
|
|
34
|
-
// MCP subscription indicators
|
|
35
|
-
/** Refresh arrow (`↻`), MCP subscription indicator. */
|
|
36
|
-
export const REFRESH_ARROW = '\u21bb'; // ↻
|
|
37
30
|
/** Left arrow (`←`), channel indicator. */
|
|
38
31
|
export const CHANNEL_ARROW = '\u2190'; // ←
|
|
39
32
|
/** Right arrow (`→`), injected-message indicator. */
|
|
40
33
|
export const INJECTED_ARROW = '\u2192'; // →
|
|
34
|
+
// Reasoning-effort badges, from low to maximum
|
|
35
|
+
/** Low effort: open circle (`○`). */
|
|
36
|
+
export const EFFORT_LOW = '\u25cb'; // ○
|
|
37
|
+
/** Medium effort: half-filled circle (`◐`). */
|
|
38
|
+
export const EFFORT_MEDIUM = '\u25d0'; // ◐
|
|
39
|
+
/** High effort: filled circle (`●`). */
|
|
40
|
+
export const EFFORT_HIGH = '\u25cf'; // ●
|
|
41
|
+
/** Maximum effort: bullseye (`◉`). */
|
|
42
|
+
export const EFFORT_MAX = '\u25c9'; // ◉
|
|
43
|
+
// Media transport controls
|
|
44
|
+
/** Play control (`▶`). */
|
|
45
|
+
export const PLAY_ICON = '\u25b6'; // ▶
|
|
46
|
+
/** Pause control (`⏸`). */
|
|
47
|
+
export const PAUSE_ICON = '\u23f8'; // ⏸
|
|
48
|
+
// Subscription and routing
|
|
49
|
+
/** Refresh arrow (`↻`), MCP subscription indicator. */
|
|
50
|
+
export const REFRESH_ARROW = '\u21bb'; // ↻
|
|
41
51
|
/** Fork glyph (`⑂`), fork indicator. */
|
|
42
52
|
export const FORK_GLYPH = '\u2442'; // ⑂
|
|
43
|
-
// Review status
|
|
53
|
+
// Review status
|
|
44
54
|
/** Open diamond (`◇`), review status indicator. */
|
|
45
55
|
export const DIAMOND_OPEN = '\u25c7'; // ◇
|
|
46
56
|
/** Filled diamond (`◆`), review status indicator. */
|
|
47
57
|
export const DIAMOND_FILLED = '\u25c6'; // ◆
|
|
48
58
|
/** Reference mark (`※`), reference indicator. */
|
|
49
59
|
export const REFERENCE_MARK = '\u203b'; // ※
|
|
50
|
-
//
|
|
60
|
+
// Flag, quote, and rule markers
|
|
51
61
|
/** Flag icon (`⚑`), issue indicator. */
|
|
52
62
|
export const FLAG_ICON = '\u2691'; // ⚑
|
|
53
|
-
// Blockquote indicator
|
|
54
63
|
/** Blockquote bar (`▎`), left one-quarter block. */
|
|
55
64
|
export const BLOCKQUOTE_BAR = '\u258e'; // ▎
|
|
56
65
|
/** Heavy horizontal rule (`━`). */
|
|
57
66
|
export const HEAVY_HORIZONTAL = '\u2501'; // ━
|
|
58
|
-
// Bridge status
|
|
59
|
-
/** Bridge
|
|
67
|
+
// Bridge status
|
|
68
|
+
/** Bridge spinner frames: `·|·` → `·/·` → `·—·` → `·\·`. */
|
|
60
69
|
export const BRIDGE_SPINNER_FRAMES = [
|
|
61
70
|
'\u00b7|\u00b7',
|
|
62
71
|
'\u00b7/\u00b7',
|
package/lib/types/cc/format.d.ts
CHANGED
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Number, token-count, and duration formatters shared by the status line
|
|
3
|
+
* and message rows.
|
|
4
|
+
*
|
|
5
|
+
* All number output uses the `en` locale with at most one fraction digit.
|
|
6
|
+
* Values at or above 1000 switch to compact notation (e.g. `1.5K`), which
|
|
7
|
+
* callers receive lowercased as `1.5k` for a calmer status-line look.
|
|
4
8
|
*/
|
|
5
9
|
/**
|
|
6
10
|
* Format a number for display, switching to compact notation at 1000.
|
|
7
11
|
* @param number - The value to format.
|
|
8
|
-
* @returns The formatted number, lowercased (e.g. `1.2k`).
|
|
12
|
+
* @returns The formatted number, lowercased (e.g. `1.2k`, `1.5m`).
|
|
9
13
|
*/
|
|
10
14
|
export declare function formatNumber(number: number): string;
|
|
11
15
|
/**
|
|
12
|
-
* Format a token count
|
|
16
|
+
* Format a token count for display.
|
|
17
|
+
* Compact values that round to an even unit (e.g. `1.0k`) drop the
|
|
18
|
+
* trailing zero so the status line reads `1k` instead of `1.0k`.
|
|
13
19
|
* @param count - The token count to format.
|
|
14
|
-
* @returns The formatted count (e.g. `988`, `3.4k`).
|
|
20
|
+
* @returns The formatted count (e.g. `988`, `3.4k`, `1k`).
|
|
15
21
|
*/
|
|
16
22
|
export declare function formatTokens(count: number): string;
|
|
17
23
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* @
|
|
24
|
+
* Format a duration in milliseconds as a compact `h`/`m`/`s` string
|
|
25
|
+
* (e.g. `12s`, `3m 4s`, `1h 2m`).
|
|
26
|
+
* Negative durations are clamped to zero; a zero duration renders as `0s`.
|
|
27
|
+
* @param durationMs - Duration in milliseconds.
|
|
28
|
+
* @param options - `mostSignificantOnly` stops at the first non-zero unit
|
|
29
|
+
* (e.g. `1h`, `3m`) instead of emitting every unit.
|
|
30
|
+
* @returns The space-joined duration string.
|
|
22
31
|
*/
|
|
23
32
|
export declare function formatDuration(durationMs: number, options?: {
|
|
24
33
|
mostSignificantOnly?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/cc/format.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/cc/format.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IAAE,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC9C,MAAM,CAwBR"}
|
package/lib/types/cc/format.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Number, token-count, and duration formatters shared by the status line
|
|
3
|
+
* and message rows.
|
|
4
|
+
*
|
|
5
|
+
* All number output uses the `en` locale with at most one fraction digit.
|
|
6
|
+
* Values at or above 1000 switch to compact notation (e.g. `1.5K`), which
|
|
7
|
+
* callers receive lowercased as `1.5k` for a calmer status-line look.
|
|
4
8
|
*/
|
|
5
|
-
|
|
9
|
+
/** Build a formatter that emits either compact or standard notation. */
|
|
10
|
+
function buildNumberFormat(compact) {
|
|
6
11
|
return new Intl.NumberFormat('en', {
|
|
7
12
|
notation: compact ? 'compact' : 'standard',
|
|
8
13
|
maximumFractionDigits: 1,
|
|
@@ -11,25 +16,29 @@ function numberFormatter(compact) {
|
|
|
11
16
|
/**
|
|
12
17
|
* Format a number for display, switching to compact notation at 1000.
|
|
13
18
|
* @param number - The value to format.
|
|
14
|
-
* @returns The formatted number, lowercased (e.g. `1.2k`).
|
|
19
|
+
* @returns The formatted number, lowercased (e.g. `1.2k`, `1.5m`).
|
|
15
20
|
*/
|
|
16
21
|
export function formatNumber(number) {
|
|
17
|
-
|
|
18
|
-
return numberFormatter(compact).format(number).toLowerCase();
|
|
22
|
+
return buildNumberFormat(number >= 1000).format(number).toLowerCase();
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
21
|
-
* Format a token count
|
|
25
|
+
* Format a token count for display.
|
|
26
|
+
* Compact values that round to an even unit (e.g. `1.0k`) drop the
|
|
27
|
+
* trailing zero so the status line reads `1k` instead of `1.0k`.
|
|
22
28
|
* @param count - The token count to format.
|
|
23
|
-
* @returns The formatted count (e.g. `988`, `3.4k`).
|
|
29
|
+
* @returns The formatted count (e.g. `988`, `3.4k`, `1k`).
|
|
24
30
|
*/
|
|
25
31
|
export function formatTokens(count) {
|
|
26
32
|
return formatNumber(count).replace('.0', '');
|
|
27
33
|
}
|
|
28
34
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @
|
|
35
|
+
* Format a duration in milliseconds as a compact `h`/`m`/`s` string
|
|
36
|
+
* (e.g. `12s`, `3m 4s`, `1h 2m`).
|
|
37
|
+
* Negative durations are clamped to zero; a zero duration renders as `0s`.
|
|
38
|
+
* @param durationMs - Duration in milliseconds.
|
|
39
|
+
* @param options - `mostSignificantOnly` stops at the first non-zero unit
|
|
40
|
+
* (e.g. `1h`, `3m`) instead of emitting every unit.
|
|
41
|
+
* @returns The space-joined duration string.
|
|
33
42
|
*/
|
|
34
43
|
export function formatDuration(durationMs, options = {}) {
|
|
35
44
|
const { mostSignificantOnly = false } = options;
|
|
@@ -38,17 +47,16 @@ export function formatDuration(durationMs, options = {}) {
|
|
|
38
47
|
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
|
39
48
|
const seconds = totalSeconds % 60;
|
|
40
49
|
const parts = [];
|
|
50
|
+
let stopAfterFirst = false;
|
|
41
51
|
if (hours > 0) {
|
|
42
52
|
parts.push(`${hours}h`);
|
|
43
|
-
|
|
44
|
-
return parts.join(' ');
|
|
53
|
+
stopAfterFirst = mostSignificantOnly;
|
|
45
54
|
}
|
|
46
|
-
if (minutes > 0) {
|
|
55
|
+
if (!stopAfterFirst && minutes > 0) {
|
|
47
56
|
parts.push(`${minutes}m`);
|
|
48
|
-
|
|
49
|
-
return parts.join(' ');
|
|
57
|
+
stopAfterFirst = mostSignificantOnly && hours === 0;
|
|
50
58
|
}
|
|
51
|
-
if (seconds > 0 || parts.length === 0) {
|
|
59
|
+
if (!stopAfterFirst && (seconds > 0 || parts.length === 0)) {
|
|
52
60
|
parts.push(`${seconds}s`);
|
|
53
61
|
}
|
|
54
62
|
return parts.join(' ');
|
|
@@ -1,24 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown-to-ANSI renderer over marked's token stream.
|
|
3
|
+
*
|
|
4
|
+
* Converts the shared marked lexer output into styled terminal text: quote
|
|
5
|
+
* gutters, syntax-highlighted fenced blocks, indented list bullets with
|
|
6
|
+
* depth-based numbering, and alignment-padded tables. The visual conventions
|
|
7
|
+
* (▎ bars for blockquotes, theme-colored inline code, OSC 8 hyperlinks) are
|
|
8
|
+
* standard terminal markdown idioms, but this is an independent
|
|
9
|
+
* implementation: a single dispatch switch fans tokens out to dedicated
|
|
10
|
+
* per-type render functions, and all recursive calls thread one immutable
|
|
11
|
+
* RenderState (parent token, list depth, list ordinal, highlighter) instead
|
|
12
|
+
* of passing positional arguments.
|
|
13
|
+
*/
|
|
1
14
|
import { type Token } from 'marked';
|
|
2
15
|
import type { CliHighlight } from './cliHighlight.js';
|
|
3
16
|
/**
|
|
4
|
-
* Strip tool-analysis XML
|
|
5
|
-
* `<pr_analysis>`) and their contents, then trim
|
|
6
|
-
* @param content - Markdown
|
|
7
|
-
* @returns The content with those blocks removed and
|
|
17
|
+
* Strip tool-analysis XML blocks (`<commit_analysis>`, `<context>`,
|
|
18
|
+
* `<function_analysis>`, `<pr_analysis>`) and their contents, then trim.
|
|
19
|
+
* @param content - Markdown that may wrap the tool-analysis tag blocks.
|
|
20
|
+
* @returns The content with those blocks removed and whitespace trimmed.
|
|
8
21
|
*/
|
|
9
22
|
export declare function stripPromptXMLTags(content: string): string;
|
|
10
23
|
/**
|
|
11
|
-
* Configure the shared `marked` instance once
|
|
12
|
-
* `~100` renders literally instead of as deleted text
|
|
24
|
+
* Configure the shared `marked` instance once. Strikethrough parsing is
|
|
25
|
+
* disabled so that `~100` renders literally instead of as deleted text —
|
|
26
|
+
* models use `~` far more often for "approximate" than for real
|
|
27
|
+
* strikethrough.
|
|
13
28
|
*/
|
|
14
29
|
export declare function configureMarked(): void;
|
|
15
|
-
/**
|
|
16
|
-
* Render markdown content to ANSI-styled text via the shared `marked` instance.
|
|
17
|
-
* @param content - Markdown source to render.
|
|
18
|
-
* @param highlight - Optional cli-highlight surface for code blocks; null disables syntax highlighting.
|
|
19
|
-
* @returns The rendered ANSI string, trimmed.
|
|
20
|
-
*/
|
|
21
|
-
export declare function applyMarkdown(content: string, highlight?: CliHighlight | null): string;
|
|
22
30
|
/**
|
|
23
31
|
* Render one marked token to ANSI text, recursing into child tokens.
|
|
24
32
|
* @param token - The marked token to render.
|
|
@@ -30,9 +38,16 @@ export declare function applyMarkdown(content: string, highlight?: CliHighlight
|
|
|
30
38
|
*/
|
|
31
39
|
export declare function formatToken(token: Token, listDepth?: number, orderedListNumber?: number | null, parent?: Token | null, highlight?: CliHighlight | null): string;
|
|
32
40
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
41
|
+
* Render markdown content to ANSI-styled text via the shared `marked` instance.
|
|
42
|
+
* @param content - Markdown source to render.
|
|
43
|
+
* @param highlight - Optional cli-highlight surface for code blocks; null disables syntax highlighting.
|
|
44
|
+
* @returns The rendered ANSI string, trimmed.
|
|
45
|
+
*/
|
|
46
|
+
export declare function applyMarkdown(content: string, highlight?: CliHighlight | null): string;
|
|
47
|
+
/**
|
|
48
|
+
* Pad `content` to `targetWidth` according to alignment. `displayWidth` is
|
|
49
|
+
* the visible width of `content` (callers compute it via stringWidth on the
|
|
50
|
+
* ANSI-stripped text, so embedded escape codes don't affect padding).
|
|
36
51
|
* @param content - The text to pad, which may carry ANSI codes.
|
|
37
52
|
* @param displayWidth - Visible width of `content` without ANSI codes.
|
|
38
53
|
* @param targetWidth - Column width to pad `content` to.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/cc/markdown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/cc/markdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAA4B,KAAK,KAAK,EAAe,MAAM,QAAQ,CAAA;AAM1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AA4BrD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAID;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAWtC;AAuCD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,KAAK,EACZ,SAAS,SAAI,EACb,iBAAiB,GAAE,MAAM,GAAG,IAAW,EACvC,MAAM,GAAE,KAAK,GAAG,IAAW,EAC3B,SAAS,GAAE,YAAY,GAAG,IAAW,GACpC,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,YAAY,GAAG,IAAW,GACpC,MAAM,CAaR;AA2QD;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GACpD,MAAM,CAUR"}
|