@deepseek-harness-tui/dsh-tui 0.6.1 → 0.7.1
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 +77 -23
- package/bin/dsh-tui.js +132 -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} +198 -43
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -0
- package/lib/types/{channel.js → dsh-adapter/channel.js} +1129 -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} +294 -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 +981 -36
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +308 -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 +31 -10
- package/lib/invariant.js +0 -28
- 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
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace-target extension seam for terminal front doors.
|
|
3
|
+
*
|
|
4
|
+
* The TUI owns local URI parsing and session switching. Optional plugins add
|
|
5
|
+
* providers for external schemes without coupling the TUI to them.
|
|
6
|
+
*/
|
|
7
|
+
import { Context, Service } from '@deepseek-ai/cordis';
|
|
8
|
+
export type TuiWorkspaceKind = 'local' | 'provider';
|
|
9
|
+
export interface TuiWorkspaceTarget {
|
|
10
|
+
/** Stable, user-pasteable target identifier. */
|
|
11
|
+
uri: string;
|
|
12
|
+
/** Host-side cwd recorded in the DSH session header. */
|
|
13
|
+
cwd: string;
|
|
14
|
+
/** Compact picker/status label. */
|
|
15
|
+
label: string;
|
|
16
|
+
/** Optional secondary picker copy. */
|
|
17
|
+
description?: string;
|
|
18
|
+
kind: TuiWorkspaceKind;
|
|
19
|
+
/** Provider-owned compact badge; the TUI does not interpret it. */
|
|
20
|
+
badge: string;
|
|
21
|
+
}
|
|
22
|
+
export interface TuiWorkspaceChoice {
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
badge?: string;
|
|
27
|
+
choose(signal?: AbortSignal): Promise<TuiWorkspaceCommandResult> | TuiWorkspaceCommandResult;
|
|
28
|
+
/** Optional inline editor entered with Tab while this choice is focused. */
|
|
29
|
+
input?: {
|
|
30
|
+
initialValue?: string;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
submit(value: string, signal?: AbortSignal): Promise<TuiWorkspaceCommandResult> | TuiWorkspaceCommandResult;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export type TuiWorkspaceCommandResult = {
|
|
36
|
+
kind: 'choices';
|
|
37
|
+
title: string;
|
|
38
|
+
choices: readonly TuiWorkspaceChoice[];
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'target';
|
|
41
|
+
target: TuiWorkspaceTarget;
|
|
42
|
+
};
|
|
43
|
+
export interface TuiWorkspaceCommand {
|
|
44
|
+
name: string;
|
|
45
|
+
aliases?: readonly string[];
|
|
46
|
+
description: string;
|
|
47
|
+
run(input: string, context: {
|
|
48
|
+
cwd: string;
|
|
49
|
+
}, signal?: AbortSignal): Promise<TuiWorkspaceCommandResult> | TuiWorkspaceCommandResult;
|
|
50
|
+
}
|
|
51
|
+
export interface TuiCommandShell {
|
|
52
|
+
resolve(request: {
|
|
53
|
+
command: string;
|
|
54
|
+
workdir?: string;
|
|
55
|
+
timeoutMs?: number;
|
|
56
|
+
}): unknown;
|
|
57
|
+
run(spec: unknown): Promise<{
|
|
58
|
+
exitCode: number | null;
|
|
59
|
+
stdout: {
|
|
60
|
+
text: string;
|
|
61
|
+
};
|
|
62
|
+
stderr: {
|
|
63
|
+
text: string;
|
|
64
|
+
};
|
|
65
|
+
timedOut: boolean;
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
export interface TuiWorkspaceProvider {
|
|
69
|
+
/** URI schemes owned by this provider, without the trailing colon. */
|
|
70
|
+
schemes: readonly string[];
|
|
71
|
+
/** Enumerate targets owned by this provider. */
|
|
72
|
+
list(signal?: AbortSignal): Promise<readonly TuiWorkspaceTarget[]> | readonly TuiWorkspaceTarget[];
|
|
73
|
+
/** Resolve a provider URI, or return undefined when its scheme is not owned. */
|
|
74
|
+
resolve(uri: string, signal?: AbortSignal): Promise<TuiWorkspaceTarget | undefined> | TuiWorkspaceTarget | undefined;
|
|
75
|
+
/** Resolve a path relative to a cwd already owned by this provider. */
|
|
76
|
+
resolvePath?(path: string, cwd: string, signal?: AbortSignal): Promise<TuiWorkspaceTarget | undefined> | TuiWorkspaceTarget | undefined;
|
|
77
|
+
/** Describe an already-recorded cwd without performing I/O. */
|
|
78
|
+
describe(cwd: string): TuiWorkspaceTarget | undefined;
|
|
79
|
+
/** Override `!command` execution for a provider-owned cwd. */
|
|
80
|
+
commandShell?(cwd: string): Promise<TuiCommandShell | undefined> | TuiCommandShell | undefined;
|
|
81
|
+
/** Rename a provider-owned workspace durably. */
|
|
82
|
+
rename?(cwd: string, title: string): Promise<TuiWorkspaceTarget | undefined> | TuiWorkspaceTarget | undefined;
|
|
83
|
+
/** Provider-owned `/workspace <command>` extensions. */
|
|
84
|
+
commands?: readonly TuiWorkspaceCommand[];
|
|
85
|
+
}
|
|
86
|
+
declare module '@deepseek-ai/cordis' {
|
|
87
|
+
interface Context {
|
|
88
|
+
tuiWorkspaces: TuiWorkspaceRuntime;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
export declare const name = "dsh-tui-workspaces";
|
|
92
|
+
/** Registry and local fallback shared by the TUI and workspace plugins. */
|
|
93
|
+
export declare class TuiWorkspaceRuntime extends Service {
|
|
94
|
+
private readonly providers;
|
|
95
|
+
private readonly providerWaiters;
|
|
96
|
+
constructor(ctx: Context);
|
|
97
|
+
register(provider: TuiWorkspaceProvider): () => void;
|
|
98
|
+
list(currentCwd: string, signal?: AbortSignal): Promise<readonly TuiWorkspaceTarget[]>;
|
|
99
|
+
/** Resolve a URI, briefly allowing concurrently mounted providers to register. */
|
|
100
|
+
resolve(reference: string, currentCwd?: string, signal?: AbortSignal): Promise<TuiWorkspaceTarget | undefined>;
|
|
101
|
+
describe(cwd: string): TuiWorkspaceTarget;
|
|
102
|
+
commandShell(cwd: string): Promise<TuiCommandShell | undefined>;
|
|
103
|
+
rename(cwd: string, title: string): Promise<TuiWorkspaceTarget>;
|
|
104
|
+
commands(): readonly Pick<TuiWorkspaceCommand, 'name' | 'aliases' | 'description'>[];
|
|
105
|
+
runCommand(name: string, input: string, cwd: string, signal?: AbortSignal): Promise<TuiWorkspaceCommandResult | undefined>;
|
|
106
|
+
private workspaceRegistry;
|
|
107
|
+
private withStoredTitle;
|
|
108
|
+
private notifyProviderWaiters;
|
|
109
|
+
private waitForProvider;
|
|
110
|
+
}
|
|
111
|
+
/** Local-only fallback for direct embedders that call createChannel() without
|
|
112
|
+
* mounting the optional workspace registry/provider service. */
|
|
113
|
+
export declare function createLocalWorkspaceRuntime(): Pick<TuiWorkspaceRuntime, 'list' | 'resolve' | 'describe' | 'commandShell' | 'rename' | 'commands' | 'runCommand'>;
|
|
114
|
+
export declare function localWorkspaceUri(path: string): string;
|
|
115
|
+
/** Resolve a native absolute path or the standard file URL form. */
|
|
116
|
+
export declare function parseLocalWorkspaceReference(reference: string): TuiWorkspaceTarget | undefined;
|
|
117
|
+
export default TuiWorkspaceRuntime;
|
|
118
|
+
//# sourceMappingURL=workspaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/workspaces.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAEtD,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,U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AAE,MAAM,GAAG,SAAS,GAAG,aAAa,CAAC,EAAE;IAQ9E,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC;IAWhI,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,qBAAqB;IAK7B,OAAO,CAAC,eAAe;CAwBxB;AAED;gEACgE;AAChE,wBAAgB,2BAA2B,IAAI,IAAI,CACjD,mBAAmB,EACnB,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,cAAc,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,CACxF,CA4BA;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,oEAAoE;AACpE,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAY9F;AAwBD,eAAe,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace-target extension seam for terminal front doors.
|
|
3
|
+
*
|
|
4
|
+
* The TUI owns local URI parsing and session switching. Optional plugins add
|
|
5
|
+
* providers for external schemes without coupling the TUI to them.
|
|
6
|
+
*/
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
|
+
import { basename, isAbsolute, resolve } from 'node:path';
|
|
9
|
+
import { Service } from '@deepseek-ai/cordis';
|
|
10
|
+
export const name = 'dsh-tui-workspaces';
|
|
11
|
+
/** Registry and local fallback shared by the TUI and workspace plugins. */
|
|
12
|
+
export class TuiWorkspaceRuntime extends Service {
|
|
13
|
+
providers = new Set();
|
|
14
|
+
providerWaiters = new Set();
|
|
15
|
+
constructor(ctx) {
|
|
16
|
+
super(ctx, 'tuiWorkspaces');
|
|
17
|
+
}
|
|
18
|
+
register(provider) {
|
|
19
|
+
this.providers.add(provider);
|
|
20
|
+
this.notifyProviderWaiters();
|
|
21
|
+
return () => {
|
|
22
|
+
this.providers.delete(provider);
|
|
23
|
+
this.notifyProviderWaiters();
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
async list(currentCwd, signal) {
|
|
27
|
+
signal?.throwIfAborted();
|
|
28
|
+
const targets = new Map();
|
|
29
|
+
for (const provider of this.providers) {
|
|
30
|
+
try {
|
|
31
|
+
for (const target of await provider.list(signal))
|
|
32
|
+
targets.set(target.uri, this.withStoredTitle(target));
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
this.ctx.logger.warn(`dsh-tui: workspace provider list failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// The official registry is the durable catalog. Provider-owned aliases
|
|
39
|
+
// have already been added above with richer URI/badge metadata; remaining
|
|
40
|
+
// records are ordinary local workspaces.
|
|
41
|
+
for (const workspace of this.workspaceRegistry()?.list() ?? []) {
|
|
42
|
+
if ([...targets.values()].some(target => sameCwd(target.cwd, workspace.path)))
|
|
43
|
+
continue;
|
|
44
|
+
targets.set(localWorkspaceUri(workspace.path), {
|
|
45
|
+
...localWorkspaceTarget(workspace.path),
|
|
46
|
+
label: workspace.title,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
// The current local directory is always selectable, even in a bare TUI
|
|
50
|
+
// composition without dsh-workspace or another provider.
|
|
51
|
+
if (![...targets.values()].some(target => sameCwd(target.cwd, currentCwd))) {
|
|
52
|
+
const local = localWorkspaceTarget(currentCwd);
|
|
53
|
+
targets.set(local.uri, local);
|
|
54
|
+
}
|
|
55
|
+
return [...targets.values()].sort((left, right) => {
|
|
56
|
+
if (left.kind !== right.kind)
|
|
57
|
+
return left.kind === 'local' ? -1 : 1;
|
|
58
|
+
return left.label.localeCompare(right.label);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** Resolve a URI, briefly allowing concurrently mounted providers to register. */
|
|
62
|
+
async resolve(reference, currentCwd = process.cwd(), signal) {
|
|
63
|
+
if (isAbsolute(reference))
|
|
64
|
+
return localWorkspaceTarget(reference);
|
|
65
|
+
const deadline = Date.now() + 5000;
|
|
66
|
+
const scheme = uriScheme(reference);
|
|
67
|
+
if (scheme === undefined) {
|
|
68
|
+
const owner = [...this.providers].find((provider) => {
|
|
69
|
+
try {
|
|
70
|
+
return provider.describe(currentCwd) !== undefined;
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
if (owner !== undefined)
|
|
77
|
+
return owner.resolvePath?.(reference, currentCwd, signal);
|
|
78
|
+
return localWorkspaceTarget(resolve(currentCwd, reference));
|
|
79
|
+
}
|
|
80
|
+
const local = parseLocalWorkspaceReference(reference);
|
|
81
|
+
if (local !== undefined)
|
|
82
|
+
return local;
|
|
83
|
+
for (;;) {
|
|
84
|
+
signal?.throwIfAborted();
|
|
85
|
+
const owners = [...this.providers].filter(provider => provider.schemes.some(candidate => candidate.toLowerCase() === scheme));
|
|
86
|
+
for (const provider of owners) {
|
|
87
|
+
const target = await provider.resolve(reference, signal);
|
|
88
|
+
if (target !== undefined)
|
|
89
|
+
return target;
|
|
90
|
+
}
|
|
91
|
+
if (owners.length > 0)
|
|
92
|
+
return undefined;
|
|
93
|
+
if (Date.now() >= deadline)
|
|
94
|
+
return undefined;
|
|
95
|
+
await this.waitForProvider(Math.min(100, deadline - Date.now()), signal);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
describe(cwd) {
|
|
99
|
+
for (const provider of this.providers) {
|
|
100
|
+
let target;
|
|
101
|
+
try {
|
|
102
|
+
target = provider.describe(cwd);
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
this.ctx.logger.warn(`dsh-tui: workspace provider describe failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (target !== undefined)
|
|
109
|
+
return this.withStoredTitle(target);
|
|
110
|
+
}
|
|
111
|
+
return this.withStoredTitle(localWorkspaceTarget(cwd));
|
|
112
|
+
}
|
|
113
|
+
async commandShell(cwd) {
|
|
114
|
+
for (const provider of this.providers) {
|
|
115
|
+
let shell;
|
|
116
|
+
try {
|
|
117
|
+
shell = await provider.commandShell?.(cwd);
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
this.ctx.logger.warn(`dsh-tui: workspace provider commandShell failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if (shell !== undefined)
|
|
124
|
+
return shell;
|
|
125
|
+
}
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
async rename(cwd, title) {
|
|
129
|
+
const normalizedTitle = title.trim();
|
|
130
|
+
if (normalizedTitle.length === 0)
|
|
131
|
+
throw new Error('workspace title must not be empty');
|
|
132
|
+
for (const provider of this.providers) {
|
|
133
|
+
let owned = false;
|
|
134
|
+
try {
|
|
135
|
+
owned = provider.describe(cwd) !== undefined;
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (!owned)
|
|
141
|
+
continue;
|
|
142
|
+
// A provider without rename (or returning undefined) falls through to
|
|
143
|
+
// the local durable ledger below — the title stays visible everywhere
|
|
144
|
+
// this runtime runs. A rename that THROWS propagates to the caller's
|
|
145
|
+
// failure notification instead of silently writing a local record.
|
|
146
|
+
const renamed = await provider.rename?.(cwd, normalizedTitle);
|
|
147
|
+
if (renamed !== undefined)
|
|
148
|
+
return this.withStoredTitle(renamed);
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
const registry = this.workspaceRegistry();
|
|
152
|
+
if (registry === undefined)
|
|
153
|
+
throw new Error('workspace registry is unavailable');
|
|
154
|
+
const workspace = registry.list().find(candidate => sameCwd(candidate.path, cwd))
|
|
155
|
+
?? await registry.create(cwd, normalizedTitle);
|
|
156
|
+
await workspace.setTitle(normalizedTitle);
|
|
157
|
+
return { ...this.describe(cwd), label: normalizedTitle };
|
|
158
|
+
}
|
|
159
|
+
commands() {
|
|
160
|
+
return [...this.providers].flatMap(provider => provider.commands ?? []).map(command => ({
|
|
161
|
+
name: command.name,
|
|
162
|
+
aliases: command.aliases,
|
|
163
|
+
description: command.description,
|
|
164
|
+
}));
|
|
165
|
+
}
|
|
166
|
+
async runCommand(name, input, cwd, signal) {
|
|
167
|
+
const normalized = name.toLowerCase();
|
|
168
|
+
for (const provider of this.providers) {
|
|
169
|
+
const command = provider.commands?.find(candidate => candidate.name.toLowerCase() === normalized
|
|
170
|
+
|| candidate.aliases?.some(alias => alias.toLowerCase() === normalized));
|
|
171
|
+
if (command !== undefined)
|
|
172
|
+
return command.run(input, { cwd }, signal);
|
|
173
|
+
}
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
workspaceRegistry() {
|
|
177
|
+
return this.ctx.get('workspaceRegistry');
|
|
178
|
+
}
|
|
179
|
+
withStoredTitle(target) {
|
|
180
|
+
const workspace = this.workspaceRegistry()?.list().find(candidate => sameCwd(candidate.path, target.cwd));
|
|
181
|
+
return workspace === undefined ? target : { ...target, label: workspace.title };
|
|
182
|
+
}
|
|
183
|
+
notifyProviderWaiters() {
|
|
184
|
+
for (const waiter of this.providerWaiters)
|
|
185
|
+
waiter();
|
|
186
|
+
this.providerWaiters.clear();
|
|
187
|
+
}
|
|
188
|
+
waitForProvider(timeoutMs, signal) {
|
|
189
|
+
if (timeoutMs <= 0)
|
|
190
|
+
return Promise.resolve();
|
|
191
|
+
return new Promise((resolveWait, reject) => {
|
|
192
|
+
let settled = false;
|
|
193
|
+
const finish = () => {
|
|
194
|
+
if (settled)
|
|
195
|
+
return;
|
|
196
|
+
settled = true;
|
|
197
|
+
clearTimeout(timer);
|
|
198
|
+
signal?.removeEventListener('abort', abort);
|
|
199
|
+
this.providerWaiters.delete(finish);
|
|
200
|
+
resolveWait();
|
|
201
|
+
};
|
|
202
|
+
const abort = () => {
|
|
203
|
+
if (settled)
|
|
204
|
+
return;
|
|
205
|
+
settled = true;
|
|
206
|
+
clearTimeout(timer);
|
|
207
|
+
this.providerWaiters.delete(finish);
|
|
208
|
+
reject(signal?.reason instanceof Error ? signal.reason : new Error('workspace resolution aborted'));
|
|
209
|
+
};
|
|
210
|
+
const timer = setTimeout(finish, timeoutMs);
|
|
211
|
+
this.providerWaiters.add(finish);
|
|
212
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/** Local-only fallback for direct embedders that call createChannel() without
|
|
217
|
+
* mounting the optional workspace registry/provider service. */
|
|
218
|
+
export function createLocalWorkspaceRuntime() {
|
|
219
|
+
return {
|
|
220
|
+
async list(currentCwd) {
|
|
221
|
+
return [localWorkspaceTarget(currentCwd)];
|
|
222
|
+
},
|
|
223
|
+
async resolve(reference, currentCwd = process.cwd()) {
|
|
224
|
+
if (isAbsolute(reference))
|
|
225
|
+
return localWorkspaceTarget(reference);
|
|
226
|
+
const local = parseLocalWorkspaceReference(reference);
|
|
227
|
+
if (local !== undefined)
|
|
228
|
+
return local;
|
|
229
|
+
if (uriScheme(reference) !== undefined)
|
|
230
|
+
return undefined;
|
|
231
|
+
return localWorkspaceTarget(resolve(currentCwd, reference));
|
|
232
|
+
},
|
|
233
|
+
describe(cwd) {
|
|
234
|
+
return localWorkspaceTarget(cwd);
|
|
235
|
+
},
|
|
236
|
+
async commandShell() {
|
|
237
|
+
return undefined;
|
|
238
|
+
},
|
|
239
|
+
async rename() {
|
|
240
|
+
throw new Error('workspace registry is unavailable');
|
|
241
|
+
},
|
|
242
|
+
commands() {
|
|
243
|
+
return [];
|
|
244
|
+
},
|
|
245
|
+
async runCommand() {
|
|
246
|
+
return undefined;
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
export function localWorkspaceUri(path) {
|
|
251
|
+
return pathToFileURL(resolve(path)).href;
|
|
252
|
+
}
|
|
253
|
+
/** Resolve a native absolute path or the standard file URL form. */
|
|
254
|
+
export function parseLocalWorkspaceReference(reference) {
|
|
255
|
+
if (isAbsolute(reference))
|
|
256
|
+
return localWorkspaceTarget(reference);
|
|
257
|
+
let parsed;
|
|
258
|
+
try {
|
|
259
|
+
parsed = new URL(reference);
|
|
260
|
+
}
|
|
261
|
+
catch {
|
|
262
|
+
return undefined;
|
|
263
|
+
}
|
|
264
|
+
if (parsed.protocol !== 'file:')
|
|
265
|
+
return undefined;
|
|
266
|
+
const cwd = fileURLToPath(parsed);
|
|
267
|
+
if (!isAbsolute(cwd))
|
|
268
|
+
throw new Error(`file workspace URI must resolve to an absolute path: ${reference}`);
|
|
269
|
+
return localWorkspaceTarget(cwd);
|
|
270
|
+
}
|
|
271
|
+
function localWorkspaceTarget(cwd) {
|
|
272
|
+
const absolute = resolve(cwd);
|
|
273
|
+
return {
|
|
274
|
+
uri: localWorkspaceUri(absolute),
|
|
275
|
+
cwd: absolute,
|
|
276
|
+
label: basename(absolute) || absolute,
|
|
277
|
+
description: absolute,
|
|
278
|
+
kind: 'local',
|
|
279
|
+
badge: 'LOCAL',
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
function uriScheme(uri) {
|
|
283
|
+
return /^([a-z][a-z0-9+.-]*):/iu.exec(uri)?.[1]?.toLowerCase();
|
|
284
|
+
}
|
|
285
|
+
function sameCwd(left, right) {
|
|
286
|
+
return process.platform === 'win32'
|
|
287
|
+
? resolve(left).toLowerCase() === resolve(right).toLowerCase()
|
|
288
|
+
: resolve(left) === resolve(right);
|
|
289
|
+
}
|
|
290
|
+
export default TuiWorkspaceRuntime;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Persisted reasoning-effort preference (`~/.dsh-
|
|
2
|
+
* Persisted reasoning-effort preference (`~/.dsh-tui/effort.json`). Shift+Tab
|
|
3
3
|
* cycles the live route's adapter-owned levels (dsh-llm `LlmModelReasoningInfo`);
|
|
4
4
|
* the choice lands here so the next boot starts on it. The file is
|
|
5
5
|
* best-effort: a missing/corrupt file or a level the current adapter does not
|
package/lib/types/effortPrefs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Persisted reasoning-effort preference (`~/.dsh-
|
|
2
|
+
* Persisted reasoning-effort preference (`~/.dsh-tui/effort.json`). Shift+Tab
|
|
3
3
|
* cycles the live route's adapter-owned levels (dsh-llm `LlmModelReasoningInfo`);
|
|
4
4
|
* the choice lands here so the next boot starts on it. The file is
|
|
5
5
|
* best-effort: a missing/corrupt file or a level the current adapter does not
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* event always re-asserts the truth on the status line.
|
|
8
8
|
*/
|
|
9
9
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
10
|
-
import { homedir } from 'node:os';
|
|
11
10
|
import { join } from 'node:path';
|
|
12
|
-
|
|
11
|
+
import { DATA_DIR } from './utils/paths.js';
|
|
12
|
+
const PREFS_DIR = DATA_DIR;
|
|
13
13
|
/**
|
|
14
14
|
* The persisted reasoning-effort id, or undefined when unset or invalid.
|
|
15
15
|
* @param dir - Prefs directory (injectable for tests).
|
package/lib/types/history.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
|
-
import { homedir } from 'node:os';
|
|
4
3
|
import { join } from 'node:path';
|
|
5
|
-
|
|
4
|
+
import { DATA_DIR } from './utils/paths.js';
|
|
5
|
+
const HISTORY_DIR = DATA_DIR;
|
|
6
6
|
const HISTORY_FILE = join(HISTORY_DIR, 'history.jsonl');
|
|
7
7
|
const HISTORY_LIMIT = 200;
|
|
8
8
|
function loadRaw() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DOMElement } from '../ink/dom.js';
|
|
2
2
|
/**
|
|
3
3
|
* Hook for synchronized blinking animations that pause when offscreen
|
|
4
|
-
* (
|
|
4
|
+
* (mirroring Claude Code's `src/hooks/useBlink.ts`).
|
|
5
5
|
*
|
|
6
6
|
* @param enabled - Whether blinking is active
|
|
7
7
|
* @param intervalMs - Blink cycle length in ms; defaults to 600.
|
|
@@ -3,7 +3,7 @@ import { useTerminalFocus } from '../ink/hooks/use-terminal-focus.js';
|
|
|
3
3
|
const BLINK_INTERVAL_MS = 600;
|
|
4
4
|
/**
|
|
5
5
|
* Hook for synchronized blinking animations that pause when offscreen
|
|
6
|
-
* (
|
|
6
|
+
* (mirroring Claude Code's `src/hooks/useBlink.ts`).
|
|
7
7
|
*
|
|
8
8
|
* @param enabled - Whether blinking is active
|
|
9
9
|
* @param intervalMs - Blink cycle length in ms; defaults to 600.
|