@deepseek-harness-tui/dsh-tui 0.8.8 → 0.9.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 +60 -238
- package/bin/dsh-tui.js +172 -5
- package/cordis.patch.yml +16 -4
- package/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -13
- package/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -59
- package/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -15
- package/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -32
- package/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -59
- package/dsh-ecosystem-spec/protocols/tui-channel.js +166 -166
- package/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -42
- package/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -143
- package/dsh-ecosystem-spec/registry/README.md +14 -14
- package/dsh-ecosystem-spec/registry/host-descriptor.tui.example.json +56 -56
- package/dsh-ecosystem-spec/registry/permissions-0.1.json +13 -13
- package/dsh-ecosystem-spec/registry/registry-0.15.json +149 -149
- package/lib/types/cc/hyperlink.d.ts +7 -1
- package/lib/types/cc/hyperlink.d.ts.map +1 -1
- package/lib/types/cc/hyperlink.js +3 -2
- package/lib/types/cc/markdown.d.ts.map +1 -1
- package/lib/types/cc/markdown.js +33 -3
- package/lib/types/cc/sessionColors.d.ts +27 -0
- package/lib/types/cc/sessionColors.d.ts.map +1 -0
- package/lib/types/cc/sessionColors.js +39 -0
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +10 -2
- package/lib/types/components/ActivityPicker.d.ts +4 -1
- package/lib/types/components/ActivityPicker.d.ts.map +1 -1
- package/lib/types/components/ActivityPicker.js +2 -2
- package/lib/types/components/AutoRecapRow.d.ts +23 -0
- package/lib/types/components/AutoRecapRow.d.ts.map +1 -0
- package/lib/types/components/AutoRecapRow.js +23 -0
- package/lib/types/components/BtwPanel.d.ts.map +1 -1
- package/lib/types/components/BtwPanel.js +1 -1
- package/lib/types/components/Chat/SubagentMessage.d.ts +2 -1
- package/lib/types/components/Chat/SubagentMessage.d.ts.map +1 -1
- package/lib/types/components/Chat/SubagentMessage.js +11 -3
- package/lib/types/components/ColorPicker.d.ts +17 -0
- package/lib/types/components/ColorPicker.d.ts.map +1 -0
- package/lib/types/components/ColorPicker.js +20 -0
- package/lib/types/components/CommandSuggestions.d.ts +23 -4
- package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
- package/lib/types/components/CommandSuggestions.js +41 -14
- package/lib/types/components/ContextBarView.d.ts +33 -0
- package/lib/types/components/ContextBarView.d.ts.map +1 -0
- package/lib/types/components/ContextBarView.js +46 -0
- package/lib/types/components/EffortInputBorder.d.ts +12 -1
- package/lib/types/components/EffortInputBorder.d.ts.map +1 -1
- package/lib/types/components/EffortInputBorder.js +22 -5
- package/lib/types/components/EffortSlider.d.ts +4 -1
- package/lib/types/components/EffortSlider.d.ts.map +1 -1
- package/lib/types/components/EffortSlider.js +4 -2
- package/lib/types/components/ExtensionDialog.js +6 -2
- package/lib/types/components/FileActionsPanel.d.ts +22 -0
- package/lib/types/components/FileActionsPanel.d.ts.map +1 -0
- package/lib/types/components/FileActionsPanel.js +28 -0
- package/lib/types/components/FileSuggestions.d.ts +26 -7
- package/lib/types/components/FileSuggestions.d.ts.map +1 -1
- package/lib/types/components/FileSuggestions.js +39 -12
- package/lib/types/components/GoalTodoPanel.d.ts +26 -2
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +86 -17
- package/lib/types/components/HelpMenu.d.ts +7 -1
- package/lib/types/components/HelpMenu.d.ts.map +1 -1
- package/lib/types/components/HelpMenu.js +12 -4
- package/lib/types/components/HistorySearchDialog.d.ts +4 -1
- package/lib/types/components/HistorySearchDialog.d.ts.map +1 -1
- package/lib/types/components/HistorySearchDialog.js +2 -2
- package/lib/types/components/LangPicker.d.ts +14 -0
- package/lib/types/components/LangPicker.d.ts.map +1 -0
- package/lib/types/components/LangPicker.js +17 -0
- package/lib/types/components/LoadedContextPanel.d.ts.map +1 -1
- package/lib/types/components/LoadedContextPanel.js +3 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +12 -3
- package/lib/types/components/MessageList.d.ts +45 -2
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +560 -41
- package/lib/types/components/ModelPicker.d.ts +27 -2
- package/lib/types/components/ModelPicker.d.ts.map +1 -1
- package/lib/types/components/ModelPicker.js +26 -6
- package/lib/types/components/PermissionsPicker.d.ts +21 -0
- package/lib/types/components/PermissionsPicker.d.ts.map +1 -0
- package/lib/types/components/PermissionsPicker.js +27 -0
- package/lib/types/components/PlanPicker.d.ts +15 -0
- package/lib/types/components/PlanPicker.d.ts.map +1 -0
- package/lib/types/components/PlanPicker.js +18 -0
- package/lib/types/components/PresetPicker.d.ts +4 -1
- package/lib/types/components/PresetPicker.d.ts.map +1 -1
- package/lib/types/components/PresetPicker.js +2 -2
- package/lib/types/components/PromptInput.d.ts +4 -3
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +602 -75
- package/lib/types/components/RecapPanel.d.ts +25 -0
- package/lib/types/components/RecapPanel.d.ts.map +1 -0
- package/lib/types/components/RecapPanel.js +55 -0
- package/lib/types/components/RewindPicker.d.ts +12 -1
- package/lib/types/components/RewindPicker.d.ts.map +1 -1
- package/lib/types/components/RewindPicker.js +6 -4
- package/lib/types/components/ScrollbarGutter.d.ts +28 -0
- package/lib/types/components/ScrollbarGutter.d.ts.map +1 -0
- package/lib/types/components/ScrollbarGutter.js +119 -0
- package/lib/types/components/Select.d.ts +8 -1
- package/lib/types/components/Select.d.ts.map +1 -1
- package/lib/types/components/Select.js +4 -2
- package/lib/types/components/SkillsPicker.d.ts +4 -1
- package/lib/types/components/SkillsPicker.d.ts.map +1 -1
- package/lib/types/components/SkillsPicker.js +2 -2
- package/lib/types/components/SubagentCard.d.ts +2 -1
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +9 -2
- package/lib/types/components/SubagentDashboard.d.ts +4 -0
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +9 -1
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +5 -4
- package/lib/types/components/SuggestionCard.d.ts +65 -0
- package/lib/types/components/SuggestionCard.d.ts.map +1 -0
- package/lib/types/components/SuggestionCard.js +77 -0
- package/lib/types/components/ThemePicker.d.ts +4 -1
- package/lib/types/components/ThemePicker.d.ts.map +1 -1
- package/lib/types/components/ThemePicker.js +2 -2
- package/lib/types/components/ThinkingToggle.d.ts +4 -1
- package/lib/types/components/ThinkingToggle.d.ts.map +1 -1
- package/lib/types/components/ThinkingToggle.js +2 -2
- package/lib/types/components/TimelineRail.d.ts +53 -0
- package/lib/types/components/TimelineRail.d.ts.map +1 -0
- package/lib/types/components/TimelineRail.js +197 -0
- package/lib/types/components/WorkspaceFlowPicker.d.ts +6 -1
- package/lib/types/components/WorkspaceFlowPicker.d.ts.map +1 -1
- package/lib/types/components/WorkspaceFlowPicker.js +4 -2
- package/lib/types/components/WorkspaceMenuPicker.d.ts +19 -0
- package/lib/types/components/WorkspaceMenuPicker.d.ts.map +1 -0
- package/lib/types/components/WorkspaceMenuPicker.js +19 -0
- package/lib/types/components/WorkspacePicker.d.ts +4 -1
- package/lib/types/components/WorkspacePicker.d.ts.map +1 -1
- package/lib/types/components/WorkspacePicker.js +2 -2
- package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
- package/lib/types/components/approvals/ApprovalPanel.js +5 -1
- package/lib/types/components/design-system/ListItem.d.ts +8 -1
- package/lib/types/components/design-system/ListItem.d.ts.map +1 -1
- package/lib/types/components/design-system/ListItem.js +8 -3
- package/lib/types/components/design-system/ThemeProvider.d.ts +7 -0
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +2 -1
- package/lib/types/components/messages/AssistantTextMessage.d.ts +5 -2
- package/lib/types/components/messages/AssistantTextMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantTextMessage.js +6 -2
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +2 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +10 -4
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +15 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +37 -7
- package/lib/types/components/messages/UserPromptMessage.d.ts +2 -1
- package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +7 -3
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +75 -11
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +13 -2
- package/lib/types/components/sessions/SessionListRow.d.ts +4 -1
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionListRow.js +4 -2
- package/lib/types/components/trajectory/HotspotView.d.ts +7 -1
- package/lib/types/components/trajectory/HotspotView.d.ts.map +1 -1
- package/lib/types/components/trajectory/HotspotView.js +8 -2
- package/lib/types/components/trajectory/Ledger.d.ts +9 -1
- package/lib/types/components/trajectory/Ledger.d.ts.map +1 -1
- package/lib/types/components/trajectory/Ledger.js +23 -5
- package/lib/types/components/trajectory/WaveBand.d.ts +10 -1
- package/lib/types/components/trajectory/WaveBand.d.ts.map +1 -1
- package/lib/types/components/trajectory/WaveBand.js +7 -2
- package/lib/types/dsh-adapter/channel.d.ts +117 -7
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +1301 -122
- package/lib/types/dsh-adapter/compat/index.d.ts +8 -6
- package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/index.js +8 -6
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +150 -0
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.js +518 -41
- package/lib/types/dsh-adapter/contract.d.ts +1 -1
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +1 -0
- package/lib/types/dsh-adapter/extension-events.d.ts +1 -1
- package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.d.ts +20 -2
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +9 -1
- package/lib/types/dsh-adapter/plugin.d.ts +0 -9
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +453 -14
- package/lib/types/dsh-adapter/presets.d.ts +18 -0
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +31 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts +29 -1
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +89 -5
- package/lib/types/dsh-adapter/questions.d.ts +19 -2
- package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/questions.js +53 -10
- package/lib/types/dsh-adapter/recap.d.ts +49 -0
- package/lib/types/dsh-adapter/recap.d.ts.map +1 -0
- package/lib/types/dsh-adapter/recap.js +121 -0
- package/lib/types/dsh-adapter/sessionTree.d.ts +314 -0
- package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessionTree.js +954 -0
- package/lib/types/dsh-adapter/shortcuts.d.ts +15 -44
- package/lib/types/dsh-adapter/shortcuts.d.ts.map +1 -1
- package/lib/types/dsh-adapter/shortcuts.js +28 -165
- package/lib/types/dsh-adapter/types.d.ts +1 -1
- package/lib/types/dsh-adapter/types.d.ts.map +1 -1
- package/lib/types/herdr.js +1 -1
- package/lib/types/i18n.d.ts +770 -181
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +257 -80
- package/lib/types/ink/components/AlternateScreen.d.ts.map +1 -1
- package/lib/types/ink/components/AlternateScreen.js +13 -1
- package/lib/types/ink/components/App.d.ts +12 -1
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +101 -4
- package/lib/types/ink/components/ClockContext.d.ts.map +1 -1
- package/lib/types/ink/components/ClockContext.js +2 -0
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
- package/lib/types/ink/components/ScrollBox.js +170 -91
- package/lib/types/ink/constants.d.ts +9 -0
- package/lib/types/ink/constants.d.ts.map +1 -1
- package/lib/types/ink/constants.js +9 -0
- package/lib/types/ink/events/click-event.d.ts +7 -16
- package/lib/types/ink/events/click-event.d.ts.map +1 -1
- package/lib/types/ink/events/click-event.js +16 -19
- package/lib/types/ink/events/event-handlers.d.ts +11 -1
- package/lib/types/ink/events/event-handlers.d.ts.map +1 -1
- package/lib/types/ink/events/event-handlers.js +2 -0
- package/lib/types/ink/events/input-event.d.ts +9 -0
- package/lib/types/ink/events/input-event.d.ts.map +1 -1
- package/lib/types/ink/events/input-event.js +4 -0
- package/lib/types/ink/events/pointer-event.d.ts +61 -0
- package/lib/types/ink/events/pointer-event.d.ts.map +1 -0
- package/lib/types/ink/events/pointer-event.js +61 -0
- package/lib/types/ink/events/wheel-event.d.ts +17 -0
- package/lib/types/ink/events/wheel-event.d.ts.map +1 -0
- package/lib/types/ink/events/wheel-event.js +20 -0
- package/lib/types/ink/geometry-trace.d.ts +51 -0
- package/lib/types/ink/geometry-trace.d.ts.map +1 -0
- package/lib/types/ink/geometry-trace.js +83 -0
- package/lib/types/ink/hit-test.d.ts +56 -1
- package/lib/types/ink/hit-test.d.ts.map +1 -1
- package/lib/types/ink/hit-test.js +146 -8
- package/lib/types/ink/ink.d.ts +58 -1
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +230 -29
- package/lib/types/ink/log-update.d.ts.map +1 -1
- package/lib/types/ink/log-update.js +21 -0
- package/lib/types/ink/node-cache.d.ts +5 -0
- package/lib/types/ink/node-cache.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.d.ts +8 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +101 -12
- package/lib/types/ink/render-node-to-output.d.ts +10 -0
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +111 -18
- package/lib/types/ink/timeline-rail.d.ts +138 -0
- package/lib/types/ink/timeline-rail.d.ts.map +1 -0
- package/lib/types/ink/timeline-rail.js +179 -0
- package/lib/types/ink/wrap-text.d.ts.map +1 -1
- package/lib/types/ink/wrap-text.js +47 -5
- package/lib/types/migrationPrefs.d.ts +60 -0
- package/lib/types/migrationPrefs.d.ts.map +1 -0
- package/lib/types/migrationPrefs.js +97 -0
- package/lib/types/modelGroups.d.ts +72 -0
- package/lib/types/modelGroups.d.ts.map +1 -0
- package/lib/types/modelGroups.js +97 -0
- package/lib/types/modelRecents.d.ts +39 -0
- package/lib/types/modelRecents.d.ts.map +1 -0
- package/lib/types/modelRecents.js +97 -0
- package/lib/types/native-ts/yoga-layout/index.d.ts +11 -0
- package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -1
- package/lib/types/native-ts/yoga-layout/index.js +31 -1
- package/lib/types/oauth.d.ts +15 -0
- package/lib/types/oauth.d.ts.map +1 -0
- package/lib/types/oauth.js +14 -0
- package/lib/types/reload.d.ts +109 -0
- package/lib/types/reload.d.ts.map +1 -0
- package/lib/types/reload.js +118 -0
- package/lib/types/screens/Chat.d.ts +3 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +1377 -371
- package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
- package/lib/types/screens/SessionBrowser.js +56 -29
- package/lib/types/screens/SessionTree.d.ts +27 -0
- package/lib/types/screens/SessionTree.d.ts.map +1 -0
- package/lib/types/screens/SessionTree.js +555 -0
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +64 -22
- package/lib/types/screens/StatusLine.d.ts +0 -8
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +224 -45
- package/lib/types/screens/StatusMetrics.d.ts +35 -3
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +63 -8
- package/lib/types/screens/TrajectoryScene.d.ts.map +1 -1
- package/lib/types/screens/TrajectoryScene.js +81 -14
- package/lib/types/screens/chatOverlay.d.ts +237 -0
- package/lib/types/screens/chatOverlay.d.ts.map +1 -0
- package/lib/types/screens/chatOverlay.js +116 -0
- package/lib/types/tips.d.ts.map +1 -1
- package/lib/types/tips.js +64 -10
- package/lib/types/tuiDisplayPrefs.d.ts +15 -0
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +9 -0
- package/lib/types/update.d.ts +139 -0
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +382 -30
- package/lib/types/utils/debug.d.ts +10 -0
- package/lib/types/utils/debug.d.ts.map +1 -1
- package/lib/types/utils/debug.js +24 -0
- package/lib/types/utils/fileTarget.d.ts +46 -0
- package/lib/types/utils/fileTarget.d.ts.map +1 -0
- package/lib/types/utils/fileTarget.js +178 -0
- package/lib/types/utils/keymap.d.ts +134 -0
- package/lib/types/utils/keymap.d.ts.map +1 -0
- package/lib/types/utils/keymap.js +311 -0
- package/lib/types/utils/mentions.d.ts +25 -2
- package/lib/types/utils/mentions.d.ts.map +1 -1
- package/lib/types/utils/mentions.js +69 -10
- package/lib/types/utils/openExternal.d.ts +50 -0
- package/lib/types/utils/openExternal.d.ts.map +1 -0
- package/lib/types/utils/openExternal.js +170 -0
- package/lib/types/utils/paths.d.ts.map +1 -1
- package/lib/types/utils/paths.js +1 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/LICENSE +21 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/README.md +140 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/cordis.patch.yml +11 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/dsh-plugin.json +44 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/command.d.ts +14 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/command.js +67 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/credentials.d.ts +64 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/credentials.js +170 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/index.d.ts +79 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/index.js +196 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/interaction.d.ts +68 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/interaction.js +193 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/opener.d.ts +32 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/opener.js +101 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/profiles.d.ts +31 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/profiles.js +68 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/service.d.ts +69 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/service.js +129 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/package.json +70 -0
- package/node_modules/@dsh-std/command/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/command/LICENSE +21 -21
- package/node_modules/@dsh-std/command/README.md +26 -26
- package/node_modules/@dsh-std/command/README.zh.md +28 -28
- package/node_modules/@dsh-std/command/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/command/package.json +22 -22
- package/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/connection/LICENSE +21 -21
- package/node_modules/@dsh-std/connection/README.md +42 -42
- package/node_modules/@dsh-std/connection/README.zh.md +42 -42
- package/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
- package/node_modules/@dsh-std/connection/package.json +20 -20
- package/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/core/LICENSE +21 -21
- package/node_modules/@dsh-std/core/README.md +13 -13
- package/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/core/package.json +21 -21
- package/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
- package/node_modules/@dsh-std/manifest/LICENSE +21 -21
- package/node_modules/@dsh-std/manifest/README.md +5 -5
- package/node_modules/@dsh-std/manifest/README.zh.md +5 -5
- package/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/manifest/package.json +20 -20
- package/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
- package/node_modules/@dsh-std/messages/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/messages/LICENSE +21 -21
- package/node_modules/@dsh-std/messages/README.md +5 -5
- package/node_modules/@dsh-std/messages/README.zh.md +7 -7
- package/node_modules/@dsh-std/messages/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/messages/package.json +20 -20
- package/node_modules/@dsh-std/messages/schema/message-observer-envelope-0.15.schema.json +54 -54
- package/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
- package/node_modules/@dsh-std/presentation/LICENSE +21 -21
- package/node_modules/@dsh-std/presentation/README.md +27 -27
- package/node_modules/@dsh-std/presentation/README.zh.md +29 -29
- package/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
- package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/presentation/package.json +25 -25
- package/node_modules/@dsh-std/storage/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/storage/LICENSE +21 -21
- package/node_modules/@dsh-std/storage/README.md +5 -5
- package/node_modules/@dsh-std/storage/README.zh.md +7 -7
- package/node_modules/@dsh-std/storage/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/storage/package.json +20 -20
- package/node_modules/@dsh-std/storage/schema/local-storage-0.15.schema.json +56 -56
- package/package.json +19 -5
- package/presets/liangshen/.dsh-tui-managed.json +1 -1
- package/presets/liangshen/instruction-hint.mjs +8 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.md +42 -42
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.zh.md +42 -42
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +20 -20
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.md +5 -5
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.zh.md +5 -5
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +20 -20
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +27 -27
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +29 -29
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +25 -25
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/LICENSE +21 -21
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.md +42 -42
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.zh.md +42 -42
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +20 -20
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +21 -21
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Color } from '../ink/styles.js';
|
|
3
|
+
import type { Theme } from '../theme.js';
|
|
4
|
+
/**
|
|
5
|
+
* `/` 命令菜单与 `@` 文件菜单共用的圆角卡片外壳(与输入框 EffortInputBorder
|
|
6
|
+
* 同款 ╭╮╰╯ 视觉语言):
|
|
7
|
+
*
|
|
8
|
+
* ╭─ 标题 ─────────────────────╮
|
|
9
|
+
* │ ❯ 行内容 … │
|
|
10
|
+
* │ 行内容 … │
|
|
11
|
+
* │ ↑2 · ↓3 │ ← 仅当列表被裁剪
|
|
12
|
+
* ╰────────────────────────────╯
|
|
13
|
+
*
|
|
14
|
+
* 底边 ╰╯ 直接坐在输入框顶边 ╭╮ 的上一行(PromptInput 的浮层包装去掉了
|
|
15
|
+
* 底部留白),卡片与输入框连成一体,读作"挂在输入框上的下拉"。边框色
|
|
16
|
+
* 跟随输入框 idle 色(plan 模式下整套面板一起变 sage 绿)。
|
|
17
|
+
*
|
|
18
|
+
* 每一行的左右 │ 由本组件包在行外——侧边框若是内容列旁的单行 Text,只
|
|
19
|
+
* 会画在自己那一行(行高的首行),多行列表的中段行会裸奔无边框。
|
|
20
|
+
* 卡片左右各占 2 列(│ + 1 空格),行内容的可用宽度由
|
|
21
|
+
* {@link cardContentWidth} 统一计算,CJK 截断契约(verify-cjk-truncate)
|
|
22
|
+
* 按该宽度钉住。
|
|
23
|
+
*/
|
|
24
|
+
export declare function SuggestionCard({ title, columns, accent, footer, rows, onRowPick, onWheelStep, }: {
|
|
25
|
+
/** 嵌在顶边框里的标题(已本地化、含计数)。 */
|
|
26
|
+
title: string;
|
|
27
|
+
columns: number;
|
|
28
|
+
/** 边框色(主题 token 或裸色);缺省 promptBorder。 */
|
|
29
|
+
accent?: keyof Theme | Color;
|
|
30
|
+
/** 底部 dim 提示行(滚动指示);null/undefined 时不渲染。 */
|
|
31
|
+
footer?: string | null;
|
|
32
|
+
/** 已渲染的行内容(每行一个节点),本组件为各行补上左右边框。 */
|
|
33
|
+
rows: readonly React.ReactNode[];
|
|
34
|
+
/**
|
|
35
|
+
* 鼠标点击行(fullscreen):上报行索引——命令/文件补全用它接受该项
|
|
36
|
+
* (与 Tab/Enter 同路径)。未提供时行为不变。
|
|
37
|
+
*/
|
|
38
|
+
onRowPick?: (index: number) => void;
|
|
39
|
+
/**
|
|
40
|
+
* 滚轮在菜单上滚动(fullscreen):每次滚动上报 ±1 步——补全菜单用它
|
|
41
|
+
* 移动选中行(窗口随之滚动)。位置路由保证只有菜单下的滚轮到达这里。
|
|
42
|
+
*/
|
|
43
|
+
onWheelStep?: (step: 1 | -1) => void;
|
|
44
|
+
}): React.ReactNode;
|
|
45
|
+
/**
|
|
46
|
+
* 卡片内一行内容的可用显示宽度:总宽减去两侧 │ + 各 1 空格的内边距。
|
|
47
|
+
* CommandSuggestions / FileSuggestions 的截断数学共用这一口径。
|
|
48
|
+
*/
|
|
49
|
+
export declare function cardContentWidth(columns: number): number;
|
|
50
|
+
/**
|
|
51
|
+
* 把补全名按「命中的查询前缀」拆成三段(用于前缀高亮)。三级尝试,
|
|
52
|
+
* 均大小写不敏感,与 completeCommands / 文件候选的过滤语义对齐:
|
|
53
|
+
* 1. 整名前缀(文件查询是路径前缀,`src/re` 命中 `src/render`);
|
|
54
|
+
* 2. 最后一个空格 token 的前缀(嵌套命令 `model deepseek/…` 的
|
|
55
|
+
* `deepseek/` 查询——补全名带 `model ` 路径前缀);
|
|
56
|
+
* 3. 最后一个 `/` 段的前缀(`/model deepseek-v` 命中段
|
|
57
|
+
* `deepseek-v4-flash` 的开头)。
|
|
58
|
+
* 查询为空、或都不命中(别名命中、过期候选)返回 null——渲染方整体 dim。
|
|
59
|
+
*/
|
|
60
|
+
export declare function splitQueryMatch(name: string, query: string): {
|
|
61
|
+
before: string;
|
|
62
|
+
match: string;
|
|
63
|
+
after: string;
|
|
64
|
+
} | null;
|
|
65
|
+
//# sourceMappingURL=SuggestionCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuggestionCard.d.ts","sourceRoot":"","sources":["../../../src/components/SuggestionCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAGxC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,IAAI,EACJ,SAAS,EACT,WAAW,GACZ,EAAE;IACD,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,KAAK,GAAG,KAAK,CAAA;IAC5B,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,oCAAoC;IACpC,IAAI,EAAE,SAAS,KAAK,CAAC,SAAS,EAAE,CAAA;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAA;CACrC,GAAG,KAAK,CAAC,SAAS,CAwDlB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAmBzD"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Box, Text } from '../ui.js';
|
|
4
|
+
import { stringWidth } from '../ink/stringWidth.js';
|
|
5
|
+
/**
|
|
6
|
+
* `/` 命令菜单与 `@` 文件菜单共用的圆角卡片外壳(与输入框 EffortInputBorder
|
|
7
|
+
* 同款 ╭╮╰╯ 视觉语言):
|
|
8
|
+
*
|
|
9
|
+
* ╭─ 标题 ─────────────────────╮
|
|
10
|
+
* │ ❯ 行内容 … │
|
|
11
|
+
* │ 行内容 … │
|
|
12
|
+
* │ ↑2 · ↓3 │ ← 仅当列表被裁剪
|
|
13
|
+
* ╰────────────────────────────╯
|
|
14
|
+
*
|
|
15
|
+
* 底边 ╰╯ 直接坐在输入框顶边 ╭╮ 的上一行(PromptInput 的浮层包装去掉了
|
|
16
|
+
* 底部留白),卡片与输入框连成一体,读作"挂在输入框上的下拉"。边框色
|
|
17
|
+
* 跟随输入框 idle 色(plan 模式下整套面板一起变 sage 绿)。
|
|
18
|
+
*
|
|
19
|
+
* 每一行的左右 │ 由本组件包在行外——侧边框若是内容列旁的单行 Text,只
|
|
20
|
+
* 会画在自己那一行(行高的首行),多行列表的中段行会裸奔无边框。
|
|
21
|
+
* 卡片左右各占 2 列(│ + 1 空格),行内容的可用宽度由
|
|
22
|
+
* {@link cardContentWidth} 统一计算,CJK 截断契约(verify-cjk-truncate)
|
|
23
|
+
* 按该宽度钉住。
|
|
24
|
+
*/
|
|
25
|
+
export function SuggestionCard({ title, columns, accent, footer, rows, onRowPick, onWheelStep, }) {
|
|
26
|
+
const inner = Math.max(0, columns - 2);
|
|
27
|
+
const lead = `─ ${title} `;
|
|
28
|
+
// 标题放不下(极窄终端)时退化为素边框,不做半截标题。
|
|
29
|
+
const titleFits = stringWidth(lead) + 1 <= inner;
|
|
30
|
+
const top = titleFits
|
|
31
|
+
? `╭${lead}${'─'.repeat(inner - stringWidth(lead))}╮`
|
|
32
|
+
: `╭${'─'.repeat(inner)}╮`;
|
|
33
|
+
const borderColor = accent ?? 'promptBorder';
|
|
34
|
+
const [hoveredRow, setHoveredRow] = React.useState(-1);
|
|
35
|
+
const handleWheel = React.useCallback((e) => {
|
|
36
|
+
if (e.deltaY !== 0)
|
|
37
|
+
onWheelStep?.(e.deltaY > 0 ? 1 : -1);
|
|
38
|
+
}, [onWheelStep]);
|
|
39
|
+
return (_jsxs("ink-box", { style: { flexDirection: 'column', width: '100%', flexShrink: 0 }, onWheel: onWheelStep !== undefined ? handleWheel : undefined, children: [_jsx(Text, { color: borderColor, wrap: "truncate-end", children: top }), rows.map((row, index) => (_jsxs(Box, { flexDirection: "row", width: "100%", onClick: onRowPick ? () => onRowPick(index) : undefined, onMouseEnter: onRowPick ? () => setHoveredRow(index) : undefined, onMouseLeave: onRowPick ? () => setHoveredRow(current => (current === index ? -1 : current)) : undefined, children: [_jsx(Text, { color: borderColor, children: "\u2502" }), _jsx(Box, { flexDirection: "column", flexGrow: 1, minWidth: 0, backgroundColor: onRowPick !== undefined && hoveredRow === index ? 'userMessageBackgroundHover' : undefined, children: row }), _jsx(Text, { color: borderColor, children: "\u2502" })] }, index))), footer ? (_jsxs(Box, { flexDirection: "row", width: "100%", children: [_jsx(Text, { color: borderColor, children: "\u2502" }), _jsx(Box, { flexGrow: 1, minWidth: 0, children: _jsxs(Text, { dimColor: true, wrap: "truncate-end", children: [" ", footer] }) }), _jsx(Text, { color: borderColor, children: "\u2502" })] })) : null, _jsx(Text, { color: borderColor, wrap: "truncate-end", children: `╰${'─'.repeat(inner)}╯` })] }));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 卡片内一行内容的可用显示宽度:总宽减去两侧 │ + 各 1 空格的内边距。
|
|
43
|
+
* CommandSuggestions / FileSuggestions 的截断数学共用这一口径。
|
|
44
|
+
*/
|
|
45
|
+
export function cardContentWidth(columns) {
|
|
46
|
+
return Math.max(0, columns - 4);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 把补全名按「命中的查询前缀」拆成三段(用于前缀高亮)。三级尝试,
|
|
50
|
+
* 均大小写不敏感,与 completeCommands / 文件候选的过滤语义对齐:
|
|
51
|
+
* 1. 整名前缀(文件查询是路径前缀,`src/re` 命中 `src/render`);
|
|
52
|
+
* 2. 最后一个空格 token 的前缀(嵌套命令 `model deepseek/…` 的
|
|
53
|
+
* `deepseek/` 查询——补全名带 `model ` 路径前缀);
|
|
54
|
+
* 3. 最后一个 `/` 段的前缀(`/model deepseek-v` 命中段
|
|
55
|
+
* `deepseek-v4-flash` 的开头)。
|
|
56
|
+
* 查询为空、或都不命中(别名命中、过期候选)返回 null——渲染方整体 dim。
|
|
57
|
+
*/
|
|
58
|
+
export function splitQueryMatch(name, query) {
|
|
59
|
+
if (query === '')
|
|
60
|
+
return null;
|
|
61
|
+
const lower = query.toLowerCase();
|
|
62
|
+
const startsWith = (start) => {
|
|
63
|
+
const segment = name.slice(start);
|
|
64
|
+
if (!segment.toLowerCase().startsWith(lower))
|
|
65
|
+
return null;
|
|
66
|
+
const matched = segment.slice(0, Math.min(query.length, segment.length));
|
|
67
|
+
return {
|
|
68
|
+
before: name.slice(0, start),
|
|
69
|
+
match: matched,
|
|
70
|
+
after: segment.slice(matched.length),
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
const lastSpace = name.lastIndexOf(' ');
|
|
74
|
+
return (startsWith(0)
|
|
75
|
+
?? (lastSpace >= 0 ? startsWith(lastSpace + 1) : null)
|
|
76
|
+
?? startsWith(name.lastIndexOf('/') + 1));
|
|
77
|
+
}
|
|
@@ -19,8 +19,11 @@ export declare function getThemeOptions(): SelectOption[];
|
|
|
19
19
|
* active theme. Enter applies through the ThemeProvider setter (persists to
|
|
20
20
|
* ~/.dsh-tui/theme.json and hot swaps), Esc cancels.
|
|
21
21
|
*/
|
|
22
|
-
export declare function ThemePicker({ focusIndex, currentTheme, }: {
|
|
22
|
+
export declare function ThemePicker({ focusIndex, currentTheme, onPick, }: {
|
|
23
23
|
focusIndex: number;
|
|
24
24
|
currentTheme: string | undefined;
|
|
25
|
+
/** Mouse pick (fullscreen): clicked row's absolute index (Chat applies
|
|
26
|
+
* the same code path as the keyboard Enter). */
|
|
27
|
+
onPick?: (index: number) => void;
|
|
25
28
|
}): React.ReactNode;
|
|
26
29
|
//# sourceMappingURL=ThemePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemePicker.d.ts","sourceRoot":"","sources":["../../../src/components/ThemePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAuCvD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,IAAI,YAAY,EAAE,CAsBhD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,UAAU,EACV,YAAY,
|
|
1
|
+
{"version":3,"file":"ThemePicker.d.ts","sourceRoot":"","sources":["../../../src/components/ThemePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAuCvD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,IAAI,YAAY,EAAE,CAsBhD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,UAAU,EACV,YAAY,EACZ,MAAM,GACP,EAAE;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC;qDACiD;IACjD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC,GAAG,KAAK,CAAC,SAAS,CAuBlB"}
|
|
@@ -51,7 +51,7 @@ export function getThemeOptions() {
|
|
|
51
51
|
* active theme. Enter applies through the ThemeProvider setter (persists to
|
|
52
52
|
* ~/.dsh-tui/theme.json and hot swaps), Esc cancels.
|
|
53
53
|
*/
|
|
54
|
-
export function ThemePicker({ focusIndex, currentTheme, }) {
|
|
54
|
+
export function ThemePicker({ focusIndex, currentTheme, onPick, }) {
|
|
55
55
|
const options = React.useMemo(() => getThemeOptions(), []);
|
|
56
|
-
return (_jsx(Pane, { color: "permission", children: _jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: t('picker-title-theme') }) }), _jsx(Select, { options: options, focusIndex: focusIndex, selectedValue: currentTheme, visibleOptionCount: 6 }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('hint-confirm-exit') }) })] }) }));
|
|
56
|
+
return (_jsx(Pane, { color: "permission", children: _jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: t('picker-title-theme') }) }), _jsx(Select, { options: options, focusIndex: focusIndex, selectedValue: currentTheme, visibleOptionCount: 6, onPick: onPick ? index => onPick(index) : undefined }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('hint-confirm-exit') }) })] }) }));
|
|
57
57
|
}
|
|
@@ -3,8 +3,11 @@ import React from 'react';
|
|
|
3
3
|
* The `/thinking` display dialog: a permission-colored Pane with a bold
|
|
4
4
|
* title, the Shown/Hidden select, and the Enter/Esc hint line.
|
|
5
5
|
*/
|
|
6
|
-
export declare function ThinkingToggle({ currentValue, focusIndex, }: {
|
|
6
|
+
export declare function ThinkingToggle({ currentValue, focusIndex, onPick, }: {
|
|
7
7
|
currentValue: boolean;
|
|
8
8
|
focusIndex: number;
|
|
9
|
+
/** Mouse pick (fullscreen): reports the clicked row's index — Chat
|
|
10
|
+
* applies it with the same code path as the keyboard Enter. */
|
|
11
|
+
onPick?: (index: number) => void;
|
|
9
12
|
}): React.ReactNode;
|
|
10
13
|
//# sourceMappingURL=ThinkingToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThinkingToggle.d.ts","sourceRoot":"","sources":["../../../src/components/ThinkingToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,UAAU,
|
|
1
|
+
{"version":3,"file":"ThinkingToggle.d.ts","sourceRoot":"","sources":["../../../src/components/ThinkingToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,UAAU,EACV,MAAM,GACP,EAAE;IACD,YAAY,EAAE,OAAO,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB;oEACgE;IAChE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC,GAAG,KAAK,CAAC,SAAS,CAuClB"}
|
|
@@ -8,7 +8,7 @@ import { HintLine } from './design-system/HintLine.js';
|
|
|
8
8
|
* The `/thinking` display dialog: a permission-colored Pane with a bold
|
|
9
9
|
* title, the Shown/Hidden select, and the Enter/Esc hint line.
|
|
10
10
|
*/
|
|
11
|
-
export function ThinkingToggle({ currentValue, focusIndex, }) {
|
|
11
|
+
export function ThinkingToggle({ currentValue, focusIndex, onPick, }) {
|
|
12
12
|
const options = [
|
|
13
13
|
{
|
|
14
14
|
value: 'true',
|
|
@@ -21,5 +21,5 @@ export function ThinkingToggle({ currentValue, focusIndex, }) {
|
|
|
21
21
|
description: t('thinking-disabled-desc'),
|
|
22
22
|
},
|
|
23
23
|
];
|
|
24
|
-
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { marginBottom: 1, flexDirection: "column", children: [_jsx(Text, { color: "remember", bold: true, children: t('thinking-title') }), _jsx(Text, { dimColor: true, children: t('thinking-subtitle') })] }), _jsx(Box, { flexDirection: "column", marginBottom: 1, children: _jsx(Select, { options: options, focusIndex: focusIndex, selectedValue: currentValue ? 'true' : 'false', visibleOptionCount: 2 }) })] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('hint-confirm-exit') }) })] }));
|
|
24
|
+
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { marginBottom: 1, flexDirection: "column", children: [_jsx(Text, { color: "remember", bold: true, children: t('thinking-title') }), _jsx(Text, { dimColor: true, children: t('thinking-subtitle') })] }), _jsx(Box, { flexDirection: "column", marginBottom: 1, children: _jsx(Select, { options: options, focusIndex: focusIndex, selectedValue: currentValue ? 'true' : 'false', visibleOptionCount: 2, onPick: onPick === undefined ? undefined : (index) => onPick(index) }) })] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('hint-confirm-exit') }) })] }));
|
|
25
25
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ScrollBoxHandle } from '../ui.js';
|
|
3
|
+
import { type TimelineTurn } from '../ink/timeline-rail.js';
|
|
4
|
+
/**
|
|
5
|
+
* Timeline rail: the fullscreen transcript's turn navigator — a 2-column
|
|
6
|
+
* gutter REPLACING the classic scrollbar (Grok Build's timeline sidebar,
|
|
7
|
+
* ported to the dsh Ink tree).
|
|
8
|
+
*
|
|
9
|
+
* - one tick per user turn; tick position encodes conversation order,
|
|
10
|
+
* not scroll proportion (a long answer must not skew the timeline);
|
|
11
|
+
* - the tick of the turn owning the viewport top row (the turn being
|
|
12
|
+
* read — same anchor the sticky prompt header pins) renders as `━━`;
|
|
13
|
+
* hovering a tick widens it to `──` and pops a preview card left of
|
|
14
|
+
* the rail; idle ticks are a short dim ` ─`;
|
|
15
|
+
* - ▲ / ▾ step between turns by STRICT geometry (nearest prompt above /
|
|
16
|
+
* below the viewport top — never `active ± 1`, which can name a turn
|
|
17
|
+
* no scroll reaches), so a dim chevron is always a guaranteed no-op;
|
|
18
|
+
* - clicking a tick (or chevron) jumps by content coordinate — the
|
|
19
|
+
* prompt's measured top — no element seek, no force-mount race;
|
|
20
|
+
* - more turns than rows: the window slides around the active tick, and
|
|
21
|
+
* pins to the tail while at the bottom (never excluding active);
|
|
22
|
+
* - hidden below 60 terminal columns, under 2 turns, under 3 viewport
|
|
23
|
+
* rows, or when the content fits (inline mode keeps the terminal's
|
|
24
|
+
* native scrollback).
|
|
25
|
+
*
|
|
26
|
+
* The whole 2-column width is the hit target; the rail is fenced with
|
|
27
|
+
* NoSelect so click-drag text selection never picks up its glyphs, and
|
|
28
|
+
* the wheel scrolls the transcript (the rail has no scroll of its own).
|
|
29
|
+
*/
|
|
30
|
+
export declare function TimelineRail({ handle, turns, activeId, upId, downId, terminalWidth, hoverEnabled, onRevealTurn, }: {
|
|
31
|
+
handle: ScrollBoxHandle | null;
|
|
32
|
+
/** Turns in conversation order (MessageList's measured snapshot). */
|
|
33
|
+
turns: ReadonlyArray<TimelineTurn>;
|
|
34
|
+
/** Turn owning the viewport top row (rail highlight target). */
|
|
35
|
+
activeId: number | null;
|
|
36
|
+
/** ▲ target: nearest turn strictly above the viewport top. */
|
|
37
|
+
upId: number | null;
|
|
38
|
+
/** ▼ target: nearest turn below the viewport top that a scroll can
|
|
39
|
+
* still bring to the top row. */
|
|
40
|
+
downId: number | null;
|
|
41
|
+
terminalWidth: number;
|
|
42
|
+
/** False while a modal overlay owns the screen — suppress the hover
|
|
43
|
+
* card (the rail itself stays, but stops narrating). */
|
|
44
|
+
hoverEnabled: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Reveal-and-seek for FOLDED turns (older than the recent-rows window):
|
|
47
|
+
* Chat expands the fold (showAll) and seeks through the force-mount
|
|
48
|
+
* path — the row's top is unknown until it mounts, so the coordinate
|
|
49
|
+
* jump below does not apply to it.
|
|
50
|
+
*/
|
|
51
|
+
onRevealTurn: (rowId: number) => void;
|
|
52
|
+
}): React.ReactNode;
|
|
53
|
+
//# sourceMappingURL=TimelineRail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimelineRail.d.ts","sourceRoot":"","sources":["../../../src/components/TimelineRail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,UAAU,CAAA;AAEpE,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,yBAAyB,CAAA;AAwBhC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,aAAa,EACb,YAAY,EACZ,YAAY,GACb,EAAE;IACD,MAAM,EAAE,eAAe,GAAG,IAAI,CAAA;IAC9B,qEAAqE;IACrE,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;IAClC,gEAAgE;IAChE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB;sCACkC;IAClC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB;6DACyD;IACzD,YAAY,EAAE,OAAO,CAAA;IACrB;;;;;OAKG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACtC,GAAG,KAAK,CAAC,SAAS,CAqNlB"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Box, Text, NoSelect } from '../ui.js';
|
|
4
|
+
import { stringWidth } from '../ink/stringWidth.js';
|
|
5
|
+
import { RAIL_WIDTH, railEligible, computeRailGeometry, wrapPreviewLines, } from '../ink/timeline-rail.js';
|
|
6
|
+
/** ▴ / ▾ (U+25B4 / U+25BE — the small triangles; CP437-safe on ConHost too). */
|
|
7
|
+
const CHEVRON_UP = ' ▴';
|
|
8
|
+
const CHEVRON_DOWN = ' ▾';
|
|
9
|
+
/** Tick glyphs, right-aligned across the 2-col rail (Grok Build spec):
|
|
10
|
+
* active = heavy stroke, hover = wide light stroke, idle = short dim
|
|
11
|
+
* stroke in the rightmost cell. */
|
|
12
|
+
const TICK_ACTIVE = '━━';
|
|
13
|
+
const TICK_HOVER = '──';
|
|
14
|
+
const TICK_IDLE = ' ─';
|
|
15
|
+
/** Pointer rest time before the hover preview card pops (ms). Sweeps
|
|
16
|
+
* never mount a card; only a deliberate pause does. */
|
|
17
|
+
const HOVER_DWELL_MS = 120;
|
|
18
|
+
/**
|
|
19
|
+
* Timeline rail: the fullscreen transcript's turn navigator — a 2-column
|
|
20
|
+
* gutter REPLACING the classic scrollbar (Grok Build's timeline sidebar,
|
|
21
|
+
* ported to the dsh Ink tree).
|
|
22
|
+
*
|
|
23
|
+
* - one tick per user turn; tick position encodes conversation order,
|
|
24
|
+
* not scroll proportion (a long answer must not skew the timeline);
|
|
25
|
+
* - the tick of the turn owning the viewport top row (the turn being
|
|
26
|
+
* read — same anchor the sticky prompt header pins) renders as `━━`;
|
|
27
|
+
* hovering a tick widens it to `──` and pops a preview card left of
|
|
28
|
+
* the rail; idle ticks are a short dim ` ─`;
|
|
29
|
+
* - ▲ / ▾ step between turns by STRICT geometry (nearest prompt above /
|
|
30
|
+
* below the viewport top — never `active ± 1`, which can name a turn
|
|
31
|
+
* no scroll reaches), so a dim chevron is always a guaranteed no-op;
|
|
32
|
+
* - clicking a tick (or chevron) jumps by content coordinate — the
|
|
33
|
+
* prompt's measured top — no element seek, no force-mount race;
|
|
34
|
+
* - more turns than rows: the window slides around the active tick, and
|
|
35
|
+
* pins to the tail while at the bottom (never excluding active);
|
|
36
|
+
* - hidden below 60 terminal columns, under 2 turns, under 3 viewport
|
|
37
|
+
* rows, or when the content fits (inline mode keeps the terminal's
|
|
38
|
+
* native scrollback).
|
|
39
|
+
*
|
|
40
|
+
* The whole 2-column width is the hit target; the rail is fenced with
|
|
41
|
+
* NoSelect so click-drag text selection never picks up its glyphs, and
|
|
42
|
+
* the wheel scrolls the transcript (the rail has no scroll of its own).
|
|
43
|
+
*/
|
|
44
|
+
export function TimelineRail({ handle, turns, activeId, upId, downId, terminalWidth, hoverEnabled, onRevealTurn, }) {
|
|
45
|
+
const [, setTick] = React.useState(0);
|
|
46
|
+
const [hover, setHover] = React.useState(null);
|
|
47
|
+
// Dwell-gated preview card: the card pops only after the pointer RESTS
|
|
48
|
+
// on a tick for HOVER_DWELL_MS. Sweeping the rail fires enter/leave per
|
|
49
|
+
// cell — without the gate each crossing mounts an absolute-positioned
|
|
50
|
+
// card at a new spot (flapping previews, absolute-rect churn, and the
|
|
51
|
+
// fast-sweep residue users reported). The glyph highlight stays instant
|
|
52
|
+
// (cheap, no overlay); only the card waits for intent.
|
|
53
|
+
const [cardIndex, setCardIndex] = React.useState(null);
|
|
54
|
+
const dwellTimerRef = React.useRef(null);
|
|
55
|
+
const clearDwell = React.useCallback(() => {
|
|
56
|
+
if (dwellTimerRef.current !== null) {
|
|
57
|
+
clearTimeout(dwellTimerRef.current);
|
|
58
|
+
dwellTimerRef.current = null;
|
|
59
|
+
}
|
|
60
|
+
setCardIndex(null);
|
|
61
|
+
}, []);
|
|
62
|
+
const armDwell = React.useCallback((index) => {
|
|
63
|
+
if (dwellTimerRef.current !== null)
|
|
64
|
+
clearTimeout(dwellTimerRef.current);
|
|
65
|
+
dwellTimerRef.current = setTimeout(() => {
|
|
66
|
+
dwellTimerRef.current = null;
|
|
67
|
+
setCardIndex(index);
|
|
68
|
+
}, HOVER_DWELL_MS);
|
|
69
|
+
}, []);
|
|
70
|
+
React.useEffect(() => () => {
|
|
71
|
+
if (dwellTimerRef.current !== null)
|
|
72
|
+
clearTimeout(dwellTimerRef.current);
|
|
73
|
+
}, []);
|
|
74
|
+
React.useEffect(() => {
|
|
75
|
+
if (!handle)
|
|
76
|
+
return;
|
|
77
|
+
return handle.subscribe(() => {
|
|
78
|
+
setTick(t => t + 1);
|
|
79
|
+
// A scroll (wheel over the rail, tick/chevron jump, header click)
|
|
80
|
+
// slides the tick window under a STATIONARY pointer — without this,
|
|
81
|
+
// the hover card keeps re-narrating whatever turn now sits under the
|
|
82
|
+
// pointer cell, flapping previews across turns every frame (reads as
|
|
83
|
+
// ghosting). OpenCode's modality rule: only a real mouse move may
|
|
84
|
+
// re-enter hover; Grok likewise clears the hover popup on tick click.
|
|
85
|
+
// setHover(null) on an already-null hover is a React no-op.
|
|
86
|
+
setHover(null);
|
|
87
|
+
clearDwell();
|
|
88
|
+
});
|
|
89
|
+
}, [handle, clearDwell]);
|
|
90
|
+
if (!handle)
|
|
91
|
+
return null;
|
|
92
|
+
const viewport = handle.getViewportHeight();
|
|
93
|
+
const content = handle.getScrollHeight();
|
|
94
|
+
const maxScroll = Math.max(0, content - viewport);
|
|
95
|
+
if (!railEligible({
|
|
96
|
+
turnCount: turns.length,
|
|
97
|
+
terminalWidth,
|
|
98
|
+
viewportRows: viewport,
|
|
99
|
+
scrollable: content > viewport,
|
|
100
|
+
}))
|
|
101
|
+
return null;
|
|
102
|
+
const activeIndex = turns.findIndex(t => t.id === activeId);
|
|
103
|
+
// Tail-pin the tick window while the viewport sits at the bottom
|
|
104
|
+
// (sticky flag OR positional) — newest ticks stay on screen.
|
|
105
|
+
const atBottom = handle.isSticky() || handle.getScrollTop() >= maxScroll;
|
|
106
|
+
const geo = computeRailGeometry(turns.length, viewport, activeIndex === -1 ? null : activeIndex, atBottom);
|
|
107
|
+
if (!geo)
|
|
108
|
+
return null;
|
|
109
|
+
// Jump by CONTENT COORDINATE, not by element: the target row is usually
|
|
110
|
+
// unmounted (virtualization), and the element-based seek's force-mount
|
|
111
|
+
// path races React's synchronous re-render (the renderer's deferred
|
|
112
|
+
// Yoga read can see a detached anchor and silently no-op). The turn's
|
|
113
|
+
// reported top is the measured text position — scrollTo() lands the
|
|
114
|
+
// prompt exactly at the viewport top; the renderer clamps unreachable
|
|
115
|
+
// tail tops to maxScroll (their turns stay on screen, just short of
|
|
116
|
+
// owning the top row — and ▼ never names them, see timeline-rail.ts).
|
|
117
|
+
// FOLDDED turns have no measured top (-1): their click (and ▲ naming
|
|
118
|
+
// one) routes through onRevealTurn instead — expand the fold, then the
|
|
119
|
+
// existing force-mount seek lands the row once it measures.
|
|
120
|
+
const jumpToIndex = (index) => {
|
|
121
|
+
const turn = turns[index];
|
|
122
|
+
if (!turn)
|
|
123
|
+
return;
|
|
124
|
+
if (turn.folded)
|
|
125
|
+
onRevealTurn(turn.id);
|
|
126
|
+
else
|
|
127
|
+
handle.scrollTo(turn.top);
|
|
128
|
+
};
|
|
129
|
+
const jumpToId = (id) => {
|
|
130
|
+
if (id === null)
|
|
131
|
+
return;
|
|
132
|
+
const index = turns.findIndex(t => t.id === id);
|
|
133
|
+
if (index !== -1)
|
|
134
|
+
jumpToIndex(index);
|
|
135
|
+
};
|
|
136
|
+
const shown = geo.windowEnd - geo.windowStart;
|
|
137
|
+
const chevron = (kind) => {
|
|
138
|
+
const enabled = (kind === 'up' ? upId : downId) !== null;
|
|
139
|
+
const hovered = hover?.kind === kind;
|
|
140
|
+
const glyph = kind === 'up' ? CHEVRON_UP : CHEVRON_DOWN;
|
|
141
|
+
const color = !enabled ? 'subtle' : hovered ? 'text' : 'inactive';
|
|
142
|
+
return (_jsx(Box, { height: 1, flexShrink: 0, onClick: () => jumpToId(kind === 'up' ? upId : downId), onMouseEnter: () => setHover({ kind }), onMouseLeave: () => setHover(null), children: _jsx(Text, { color: color, children: glyph }) }, kind));
|
|
143
|
+
};
|
|
144
|
+
const tickRows = [];
|
|
145
|
+
for (let k = 0; k < shown; k++) {
|
|
146
|
+
const index = geo.windowStart + k;
|
|
147
|
+
const turn = turns[index];
|
|
148
|
+
const isActive = index === activeIndex;
|
|
149
|
+
const isHovered = hover?.kind === 'tick' && hover.index === index;
|
|
150
|
+
const glyph = isActive ? TICK_ACTIVE : isHovered ? TICK_HOVER : TICK_IDLE;
|
|
151
|
+
const color = isActive || isHovered ? 'text' : 'subtle';
|
|
152
|
+
tickRows.push(_jsx(Box, { height: 1, flexShrink: 0, onClick: () => jumpToIndex(index), onMouseEnter: () => {
|
|
153
|
+
setHover({ kind: 'tick', index });
|
|
154
|
+
armDwell(index);
|
|
155
|
+
}, onMouseLeave: () => {
|
|
156
|
+
setHover(null);
|
|
157
|
+
clearDwell();
|
|
158
|
+
}, children: _jsx(Text, { color: color, children: glyph }) }, turn.id));
|
|
159
|
+
}
|
|
160
|
+
// Hover preview card, anchored left of the rail and vertically centered
|
|
161
|
+
// on the hovered tick (shrink-to-fit, rounded chrome). Dwell-gated: only
|
|
162
|
+
// cardIndex (armed after HOVER_DWELL_MS of rest) draws — a sweep keeps
|
|
163
|
+
// hover flashing on glyphs but never mounts the overlay. Suppressed
|
|
164
|
+
// while an overlay owns the screen — the rail stops narrating over
|
|
165
|
+
// dialogs.
|
|
166
|
+
let card = null;
|
|
167
|
+
if (hoverEnabled && cardIndex !== null) {
|
|
168
|
+
const turn = turns[cardIndex];
|
|
169
|
+
if (turn && turn.preview.length > 0) {
|
|
170
|
+
const tickRow = geo.tickTop + cardIndex - geo.windowStart;
|
|
171
|
+
if (tickRow >= geo.tickTop && tickRow < geo.downRow) {
|
|
172
|
+
const budget = Math.min(32, Math.max(16, Math.floor((terminalWidth - RAIL_WIDTH) / 2)));
|
|
173
|
+
const lines = wrapPreviewLines(turn.preview, budget);
|
|
174
|
+
if (lines.length > 0 && lines.some(l => l.length > 0)) {
|
|
175
|
+
const widest = Math.max(...lines.map(l => stringWidth(l)));
|
|
176
|
+
const cardW = widest + 4; // rounded border ×2 + padding ×2
|
|
177
|
+
const cardH = lines.length + 2;
|
|
178
|
+
if (cardH <= viewport) {
|
|
179
|
+
const top = Math.max(0, Math.min(tickRow - Math.floor(cardH / 2), viewport - cardH));
|
|
180
|
+
card = (_jsx(Box, { position: "absolute", top: top, right: RAIL_WIDTH + 1, width: cardW, height: cardH, flexDirection: "column", flexShrink: 0, borderStyle: "round", borderColor: "inactive", paddingX: 1,
|
|
181
|
+
// The card floats LEFT of the rail over selectable
|
|
182
|
+
// transcript text; fence its own rect so a drag that
|
|
183
|
+
// happens under a dwell-popped preview never copies the
|
|
184
|
+
// card's preview glyphs. On the box itself (not a NoSelect
|
|
185
|
+
// wrapper): absolute children don't contribute to a flow
|
|
186
|
+
// wrapper's layout, so a wrapper's region would be 0×0.
|
|
187
|
+
noSelect: true, children: lines.map((line, i) => (_jsx(Text, { color: "text", wrap: "truncate-end", children: line }, i))) }));
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return (_jsx(NoSelect, { children: _jsxs("ink-box", { onWheel: e => {
|
|
194
|
+
if (e.deltaY !== 0)
|
|
195
|
+
handle.scrollBy(e.deltaY);
|
|
196
|
+
}, style: { flexDirection: 'column', flexShrink: 0, width: RAIL_WIDTH }, children: [_jsx(Box, { height: geo.upRow, flexShrink: 0 }), chevron('up'), tickRows, chevron('down'), card] }) }));
|
|
197
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TuiWorkspaceChoice } from '../workspaces.js';
|
|
3
3
|
/** Generic nested choice surface returned by a workspace provider command. */
|
|
4
|
-
export declare function WorkspaceFlowPicker({ title, choices, focusIndex, busy, input, }: {
|
|
4
|
+
export declare function WorkspaceFlowPicker({ title, choices, focusIndex, busy, input, onPick, }: {
|
|
5
5
|
title: string;
|
|
6
6
|
choices: readonly TuiWorkspaceChoice[];
|
|
7
7
|
focusIndex: number;
|
|
@@ -11,5 +11,10 @@ export declare function WorkspaceFlowPicker({ title, choices, focusIndex, busy,
|
|
|
11
11
|
cursor: number;
|
|
12
12
|
placeholder?: string;
|
|
13
13
|
} | null;
|
|
14
|
+
/** Mouse pick (fullscreen): reports the clicked row's absolute index —
|
|
15
|
+
* Chat applies it with the same code path as the keyboard Enter. Rows
|
|
16
|
+
* are inert while busy (keyboard is swallowed too) and while the inline
|
|
17
|
+
* text input owns the interaction. */
|
|
18
|
+
onPick?: (index: number) => void;
|
|
14
19
|
}): React.ReactNode;
|
|
15
20
|
//# sourceMappingURL=WorkspaceFlowPicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceFlowPicker.d.ts","sourceRoot":"","sources":["../../../src/components/WorkspaceFlowPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAO1D,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,OAAO,EACP,UAAU,EACV,IAAY,EACZ,KAAY,
|
|
1
|
+
{"version":3,"file":"WorkspaceFlowPicker.d.ts","sourceRoot":"","sources":["../../../src/components/WorkspaceFlowPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAO1D,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,OAAO,EACP,UAAU,EACV,IAAY,EACZ,KAAY,EACZ,MAAM,GACP,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IACtE;;;2CAGuC;IACvC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC,GAAG,KAAK,CAAC,SAAS,CA0DlB"}
|
|
@@ -6,10 +6,12 @@ import { ListItem } from './design-system/ListItem.js';
|
|
|
6
6
|
import { HintLine } from './design-system/HintLine.js';
|
|
7
7
|
const WINDOW = 8;
|
|
8
8
|
/** Generic nested choice surface returned by a workspace provider command. */
|
|
9
|
-
export function WorkspaceFlowPicker({ title, choices, focusIndex, busy = false, input = null, }) {
|
|
9
|
+
export function WorkspaceFlowPicker({ title, choices, focusIndex, busy = false, input = null, onPick, }) {
|
|
10
10
|
const start = Math.max(0, Math.min(focusIndex - Math.floor(WINDOW / 2), choices.length - WINDOW));
|
|
11
11
|
const visible = choices.slice(start, start + WINDOW);
|
|
12
|
-
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: title }) }), visible.map((choice, index) => (_jsxs(ListItem, { isFocused: start + index === focusIndex, isSelected: false, description: choice.description, showScrollUp: index === 0 && start > 0, showScrollDown: index === visible.length - 1 && start + visible.length < choices.length,
|
|
12
|
+
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: title }) }), visible.map((choice, index) => (_jsxs(ListItem, { isFocused: start + index === focusIndex, isSelected: false, description: choice.description, disabled: busy, showScrollUp: index === 0 && start > 0, showScrollDown: index === visible.length - 1 && start + visible.length < choices.length, onClick: onPick !== undefined && !busy && input === null
|
|
13
|
+
? () => onPick(start + index)
|
|
14
|
+
: undefined, children: [choice.badge ? `${choice.badge} · ` : '', choice.label] }, choice.id))), input !== null && (_jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: "remember", children: "\u276F " }), input.value.length === 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { inverse: true, children: " " }), _jsx(Text, { dimColor: true, children: input.placeholder ?? '' })] })) : (_jsxs(_Fragment, { children: [_jsx(Text, { children: input.value.slice(0, input.cursor) }), _jsx(Text, { inverse: true, children: input.value[input.cursor] ?? ' ' }), _jsx(Text, { children: input.value.slice(input.cursor + 1) })] }))] }))] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: busy
|
|
13
15
|
? t('workspace-flow-loading')
|
|
14
16
|
: input !== null
|
|
15
17
|
? t('workspace-flow-input-hint')
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Bare `/workspace` action menu: the built-in subcommands (resume / rename /
|
|
4
|
+
* open) plus any dynamically registered workspace extensions. Enter runs the
|
|
5
|
+
* focused action through the same paths a hand-typed subcommand takes;
|
|
6
|
+
* actions needing free text (rename/open) fall back to their usage notice.
|
|
7
|
+
*/
|
|
8
|
+
export declare function WorkspaceMenuPicker({ options, focusIndex, onPick, }: {
|
|
9
|
+
options: readonly {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
description: string;
|
|
13
|
+
}[];
|
|
14
|
+
focusIndex: number;
|
|
15
|
+
/** Mouse pick (fullscreen): reports the clicked row's index — Chat
|
|
16
|
+
* applies it with the same code path as the keyboard Enter. */
|
|
17
|
+
onPick?: (index: number) => void;
|
|
18
|
+
}): React.ReactNode;
|
|
19
|
+
//# sourceMappingURL=WorkspaceMenuPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceMenuPicker.d.ts","sourceRoot":"","sources":["../../../src/components/WorkspaceMenuPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,UAAU,EACV,MAAM,GACP,EAAE;IACD,OAAO,EAAE,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACtE,UAAU,EAAE,MAAM,CAAA;IAClB;oEACgE;IAChE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC,GAAG,KAAK,CAAC,SAAS,CAyBlB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t } from '../i18n.js';
|
|
3
|
+
import { Box, Text } from '../ui.js';
|
|
4
|
+
import { Pane } from './design-system/Pane.js';
|
|
5
|
+
import { Select } from './Select.js';
|
|
6
|
+
import { HintLine } from './design-system/HintLine.js';
|
|
7
|
+
/**
|
|
8
|
+
* Bare `/workspace` action menu: the built-in subcommands (resume / rename /
|
|
9
|
+
* open) plus any dynamically registered workspace extensions. Enter runs the
|
|
10
|
+
* focused action through the same paths a hand-typed subcommand takes;
|
|
11
|
+
* actions needing free text (rename/open) fall back to their usage notice.
|
|
12
|
+
*/
|
|
13
|
+
export function WorkspaceMenuPicker({ options, focusIndex, onPick, }) {
|
|
14
|
+
return (_jsx(Pane, { color: "permission", children: _jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: t('workspace-menu-title') }) }), _jsx(Select, { options: options.map(option => ({
|
|
15
|
+
value: option.id,
|
|
16
|
+
label: option.label,
|
|
17
|
+
description: option.description,
|
|
18
|
+
})), focusIndex: focusIndex, selectedValue: undefined, onPick: onPick === undefined ? undefined : (index) => onPick(index) }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('hint-confirm-exit') }) })] }) }));
|
|
19
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TuiWorkspaceTarget } from '../workspaces.js';
|
|
3
3
|
/** `/workspace` target picker contributed by local and optional providers. */
|
|
4
|
-
export declare function WorkspacePicker({ targets, focusIndex, currentCwd, }: {
|
|
4
|
+
export declare function WorkspacePicker({ targets, focusIndex, currentCwd, onPick, }: {
|
|
5
5
|
targets: readonly TuiWorkspaceTarget[];
|
|
6
6
|
focusIndex: number;
|
|
7
7
|
currentCwd: string;
|
|
8
|
+
/** Mouse pick (fullscreen): reports the clicked row's absolute index —
|
|
9
|
+
* Chat applies it with the same code path as the keyboard Enter. */
|
|
10
|
+
onPick?: (index: number) => void;
|
|
8
11
|
}): React.ReactNode;
|
|
9
12
|
//# sourceMappingURL=WorkspacePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspacePicker.d.ts","sourceRoot":"","sources":["../../../src/components/WorkspacePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAO1D,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,UAAU,EACV,UAAU,
|
|
1
|
+
{"version":3,"file":"WorkspacePicker.d.ts","sourceRoot":"","sources":["../../../src/components/WorkspacePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAO1D,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,UAAU,EACV,UAAU,EACV,MAAM,GACP,EAAE;IACD,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB;yEACqE;IACrE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC,GAAG,KAAK,CAAC,SAAS,CA0BlB"}
|
|
@@ -6,8 +6,8 @@ import { ListItem } from './design-system/ListItem.js';
|
|
|
6
6
|
import { HintLine } from './design-system/HintLine.js';
|
|
7
7
|
const WINDOW = 8;
|
|
8
8
|
/** `/workspace` target picker contributed by local and optional providers. */
|
|
9
|
-
export function WorkspacePicker({ targets, focusIndex, currentCwd, }) {
|
|
9
|
+
export function WorkspacePicker({ targets, focusIndex, currentCwd, onPick, }) {
|
|
10
10
|
const start = Math.max(0, Math.min(focusIndex - Math.floor(WINDOW / 2), targets.length - WINDOW));
|
|
11
11
|
const visible = targets.slice(start, start + WINDOW);
|
|
12
|
-
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: t('workspace-picker-title') }) }), visible.map((target, index) => (_jsxs(ListItem, { isFocused: start + index === focusIndex, isSelected: target.cwd === currentCwd, description: target.description ?? target.uri, showScrollUp: index === 0 && start > 0, showScrollDown: index === visible.length - 1 && start + visible.length < targets.length, children: [target.badge, " \u00B7 ", target.label] }, target.uri)))] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('workspace-picker-hint') }) })] }));
|
|
12
|
+
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: t('workspace-picker-title') }) }), visible.map((target, index) => (_jsxs(ListItem, { isFocused: start + index === focusIndex, isSelected: target.cwd === currentCwd, description: target.description ?? target.uri, showScrollUp: index === 0 && start > 0, showScrollDown: index === visible.length - 1 && start + visible.length < targets.length, onClick: onPick === undefined ? undefined : () => onPick(start + index), children: [target.badge, " \u00B7 ", target.label] }, target.uri)))] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('workspace-picker-hint') }) })] }));
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovalPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/approvals/ApprovalPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEtE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAA;IACnC,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,UAAU,KAAK,IAAI,CAAA;CAClE,CAAA;AAID,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,kBAAkB,GAAG,KAAK,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"ApprovalPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/approvals/ApprovalPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEtE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAA;IACnC,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,UAAU,KAAK,IAAI,CAAA;CAClE,CAAA;AAID,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,kBAAkB,GAAG,KAAK,CAAC,SAAS,CA+EzF"}
|