@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlternateScreen.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/AlternateScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlternateScreen.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/AlternateScreen.tsx"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,EAAE,KAAA,OAyDjC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
3
|
import { useContext, useInsertionEffect } from 'react';
|
|
4
4
|
import instances from '../instances.js';
|
|
5
|
+
import { logMouseDebug } from '../../utils/debug.js';
|
|
5
6
|
import { DISABLE_MOUSE_TRACKING, ENABLE_MOUSE_TRACKING, ENTER_ALT_SCREEN, EXIT_ALT_SCREEN } from '../termio/dec.js';
|
|
6
7
|
import { TerminalWriteContext } from '../useTerminalNotification.js';
|
|
7
8
|
import Box from './Box.js';
|
|
@@ -36,13 +37,24 @@ export function AlternateScreen(t0) {
|
|
|
36
37
|
let t3;
|
|
37
38
|
if ($[0] !== mouseTracking || $[1] !== writeRaw) {
|
|
38
39
|
t2 = () => {
|
|
39
|
-
|
|
40
|
+
// Same fallback as Chat's reanchor plumbing: embedders and test
|
|
41
|
+
// harnesses render with a stdout that is not process.stdout, so the
|
|
42
|
+
// strict key lookup would miss the only live instance and the
|
|
43
|
+
// alt-screen flag would never flip — silently killing click/hover
|
|
44
|
+
// dispatch (both are gated on altScreenActive). The "any instance"
|
|
45
|
+
// fallback is deliberately narrowed to the SINGLE-instance case:
|
|
46
|
+
// with several live Ink instances (multi-app embedding, tests
|
|
47
|
+
// running in parallel) guessing the first one would flip the wrong
|
|
48
|
+
// app's alt-screen state.
|
|
49
|
+
const ink = instances.get(process.stdout) ?? (instances.size === 1 ? instances.values().next().value : undefined);
|
|
50
|
+
logMouseDebug('alt-screen enter', { mouseTracking, inkFound: ink !== undefined, writeRaw: !!writeRaw, stack: new Error().stack?.split('\n').slice(2, 5).join(' | ') });
|
|
40
51
|
if (!writeRaw) {
|
|
41
52
|
return;
|
|
42
53
|
}
|
|
43
54
|
writeRaw(ENTER_ALT_SCREEN + "\x1B[2J\x1B[H" + (mouseTracking ? ENABLE_MOUSE_TRACKING : ""));
|
|
44
55
|
ink?.setAltScreenActive(true, mouseTracking);
|
|
45
56
|
return () => {
|
|
57
|
+
logMouseDebug('alt-screen exit', { stack: new Error().stack?.split('\n').slice(2, 5).join(' | ') });
|
|
46
58
|
ink?.setAltScreenActive(false);
|
|
47
59
|
ink?.clearTextSelection();
|
|
48
60
|
writeRaw((mouseTracking ? DISABLE_MOUSE_TRACKING : "") + EXIT_ALT_SCREEN);
|
|
@@ -15,13 +15,15 @@ type Props = {
|
|
|
15
15
|
readonly terminalRows: number;
|
|
16
16
|
readonly selection: SelectionState;
|
|
17
17
|
readonly onSelectionChange: () => void;
|
|
18
|
-
readonly onClickAt: (col: number, row: number) => boolean;
|
|
18
|
+
readonly onClickAt: (col: number, row: number, button?: number) => boolean;
|
|
19
19
|
readonly onHoverAt: (col: number, row: number) => void;
|
|
20
|
+
readonly onWheelAt: (col: number, row: number, deltaY: number, deltaX: number, button?: number) => boolean;
|
|
20
21
|
readonly getHyperlinkAt: (col: number, row: number) => string | undefined;
|
|
21
22
|
readonly onOpenHyperlink: (url: string) => void;
|
|
22
23
|
readonly onMultiClick: (col: number, row: number, count: 2 | 3) => void;
|
|
23
24
|
readonly onSelectionDrag: (col: number, row: number) => void;
|
|
24
25
|
readonly onStdinResume?: () => void;
|
|
26
|
+
readonly onTerminalFocus?: (focused: boolean) => void;
|
|
25
27
|
readonly onCursorDeclaration?: CursorDeclarationSetter;
|
|
26
28
|
readonly dispatchKeyboardEvent: (parsedKey: ParsedKey) => void;
|
|
27
29
|
};
|
|
@@ -51,6 +53,15 @@ export default class App extends PureComponent<Props, State> {
|
|
|
51
53
|
pendingHyperlinkTimer: ReturnType<typeof setTimeout> | null;
|
|
52
54
|
lastHoverCol: number;
|
|
53
55
|
lastHoverRow: number;
|
|
56
|
+
/**
|
|
57
|
+
* Reset all transient pointer state. Called by Ink when the alt screen
|
|
58
|
+
* is entered/exited and on resize: rects, hover targets, and the click
|
|
59
|
+
* chain from the previous screen geometry/scene must not leak into the
|
|
60
|
+
* new one (stale hover sets would suppress the next real onMouseEnter;
|
|
61
|
+
* a stale clickCount could turn the first click on a fresh screen into
|
|
62
|
+
* a double-click).
|
|
63
|
+
*/
|
|
64
|
+
resetPointerState(): void;
|
|
54
65
|
lastStdinTime: number;
|
|
55
66
|
writeRaw: (data: string) => void;
|
|
56
67
|
isRawModeSupported(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAS7D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAGN,KAAK,SAAS,EACd,KAAK,WAAW,EAEhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAGN,KAAK,cAAc,EAEnB,MAAM,iBAAiB,CAAC;AAWzB,OAAO,EAAE,eAAe,EAAa,MAAM,wBAAwB,CAAC;AAsBpE,OAAiC,EAChC,KAAK,uBAAuB,EAC5B,MAAM,+BAA+B,CAAC;AAgBvC,KAAK,KAAK,GAAG;IACZ,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAK9B,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAMvC,QAAQ,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;IAI3E,QAAQ,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAMvD,QAAQ,CAAC,SAAS,EAAE,CACnB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,KACX,OAAO,CAAC;IAIb,QAAQ,CAAC,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAE1E,QAAQ,CAAC,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAKhD,QAAQ,CAAC,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IAIxE,QAAQ,CAAC,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAK7D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAIpC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAKtD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;IAGvD,QAAQ,CAAC,qBAAqB,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;CAC/D,CAAC;AAMF,KAAK,KAAK,GAAG;IACZ,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;CACvB,CAAC;AAKF,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC;IAC3D,MAAM,CAAC,WAAW,SAAiB;IACnC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;IAKnC,KAAK;;MAEZ;IAIF,mBAAmB,SAAK;IACxB,qBAAqB,eAAsB;IAC3C,aAAa,+CAAiB;IAE9B,qBAAqB,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAQ;IAGpD,cAAc,EAAE,MAAM,CAAC,SAAS,GAAG,IAAI,CAAQ;IAE/C,QAAQ,CAAC,cAAc,MAAM;IAC7B,QAAQ,CAAC,aAAa,OAAO;IAI7B,OAAO,kBAEL;IAKF,aAAa,SAAK;IAClB,YAAY,SAAM;IAClB,YAAY,SAAM;IAClB,UAAU,SAAK;IAKf,qBAAqB,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAQ;IAInE,YAAY,SAAM;IAClB,YAAY,SAAM;IAElB;;;;;;;OAOG;IACH,iBAAiB,IAAI,IAAI;IAwBzB,aAAa,SAAc;IAQ3B,QAAQ,GAAI,MAAM,MAAM,KAAG,IAAI,CAK7B;IAGF,kBAAkB,IAAI,OAAO;IAGpB,MAAM;IA2CN,iBAAiB;IASjB,oBAAoB;IAO7B,4EAA4E;IAC5E,iBAAiB;IAoBR,iBAAiB,CAAC,KAAK,EAAE,KAAK;IAGvC,gBAAgB,GAAI,WAAW,OAAO,KAAG,IAAI,CA8F3C;IAGF,eAAe,QAAO,IAAI,CA0BxB;IAGF,YAAY,GAAI,OAAO,MAAM,GAAG,MAAM,GAAG,IAAI,KAAG,IAAI,CAsClD;IACF,cAAc,QAAO,IAAI,CAwCvB;IACF,WAAW,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,IAAI,CAS7C;IACF,UAAU,GAAI,QAAQ,KAAK,KAAG,IAAI,CAKhC;IACF,mBAAmB,GAAI,WAAW,OAAO,KAAG,IAAI,CAI9C;IACF,aAAa,QAAO,IAAI,CAiDtB;CACF;AA6JD,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,WAAW,GAAG,IAAI,CAyJ/D"}
|
|
@@ -5,6 +5,8 @@ import { logForDebugging } from "../../utils/debug.js";
|
|
|
5
5
|
import { stopCapturingEarlyInput } from "../../utils/earlyInput.js";
|
|
6
6
|
import { isEnvTruthy } from "../../utils/envUtils.js";
|
|
7
7
|
import { isMouseClicksDisabled } from "../../utils/fullscreen.js";
|
|
8
|
+
import { isInputSuppressed } from "../input-suppression.js";
|
|
9
|
+
import { logMouseDebug } from "../../utils/debug.js";
|
|
8
10
|
import { logError } from "../../utils/log.js";
|
|
9
11
|
import { EventEmitter } from "../events/emitter.js";
|
|
10
12
|
import { InputEvent } from "../events/input-event.js";
|
|
@@ -83,6 +85,34 @@ export default class App extends PureComponent {
|
|
|
83
85
|
// repeat events (drag-then-release at same cell, etc.).
|
|
84
86
|
lastHoverCol = -1;
|
|
85
87
|
lastHoverRow = -1;
|
|
88
|
+
/**
|
|
89
|
+
* Reset all transient pointer state. Called by Ink when the alt screen
|
|
90
|
+
* is entered/exited and on resize: rects, hover targets, and the click
|
|
91
|
+
* chain from the previous screen geometry/scene must not leak into the
|
|
92
|
+
* new one (stale hover sets would suppress the next real onMouseEnter;
|
|
93
|
+
* a stale clickCount could turn the first click on a fresh screen into
|
|
94
|
+
* a double-click).
|
|
95
|
+
*/
|
|
96
|
+
resetPointerState() {
|
|
97
|
+
this.clickCount = 0;
|
|
98
|
+
this.lastClickTime = 0;
|
|
99
|
+
this.lastClickCol = -1;
|
|
100
|
+
this.lastClickRow = -1;
|
|
101
|
+
this.lastHoverCol = -1;
|
|
102
|
+
this.lastHoverRow = -1;
|
|
103
|
+
if (this.pendingHyperlinkTimer) {
|
|
104
|
+
clearTimeout(this.pendingHyperlinkTimer);
|
|
105
|
+
this.pendingHyperlinkTimer = null;
|
|
106
|
+
}
|
|
107
|
+
// A drag interrupted by a screen swap has no release coming — settle
|
|
108
|
+
// the selection so copy-on-select fires rather than orphaning
|
|
109
|
+
// isDragging with its drag-to-scroll timer running.
|
|
110
|
+
const sel = this.props.selection;
|
|
111
|
+
if (sel.isDragging) {
|
|
112
|
+
finishSelection(sel);
|
|
113
|
+
this.props.onSelectionChange();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
86
116
|
// Timestamp of last stdin chunk. Used to detect long gaps (tmux attach,
|
|
87
117
|
// ssh reconnect, laptop wake) and trigger terminal mode re-assert.
|
|
88
118
|
// Initialized to now so startup doesn't false-trigger.
|
|
@@ -94,6 +124,9 @@ export default class App extends PureComponent {
|
|
|
94
124
|
// <AlternateScreen>'s insertion effect every frame, flapping the alt
|
|
95
125
|
// screen on/off.
|
|
96
126
|
writeRaw = (data) => {
|
|
127
|
+
if (data.includes("\x1b[?1049")) {
|
|
128
|
+
logMouseDebug("stdout:1049", { len: data.length, head: data.slice(0, 60) });
|
|
129
|
+
}
|
|
97
130
|
this.props.stdout.write(data);
|
|
98
131
|
};
|
|
99
132
|
// Determines if TTY is supported on the provided stdin
|
|
@@ -400,6 +433,32 @@ export default class App extends PureComponent {
|
|
|
400
433
|
// Helper to process all keys within a single discrete update context.
|
|
401
434
|
// discreteUpdates expects (fn, a, b, c, d) -> fn(a, b, c, d)
|
|
402
435
|
function processKeysInBatch(app, items, _unused1, _unused2) {
|
|
436
|
+
// Mouse-chain diagnostics: the single choke point every parsed mouse and
|
|
437
|
+
// wheel event passes through. Empty log here = the terminal never sent
|
|
438
|
+
// the sequences (tracking modes, ConPTY) rather than an in-app loss.
|
|
439
|
+
if (process.env.DSH_TUI_DEBUG_MOUSE) {
|
|
440
|
+
for (const item of items) {
|
|
441
|
+
if (item.kind === "mouse") {
|
|
442
|
+
logMouseDebug("mouse arrive", {
|
|
443
|
+
button: item.button,
|
|
444
|
+
action: item.action,
|
|
445
|
+
col: item.col,
|
|
446
|
+
row: item.row,
|
|
447
|
+
clicksDisabled: isMouseClicksDisabled(),
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
else if (item.kind === "key" &&
|
|
451
|
+
(item.name === "wheelup" || item.name === "wheeldown")) {
|
|
452
|
+
logMouseDebug("wheel arrive", { name: item.name });
|
|
453
|
+
}
|
|
454
|
+
else if (item.kind === "key") {
|
|
455
|
+
logMouseDebug("key arrive", {
|
|
456
|
+
name: item.name,
|
|
457
|
+
seq: (item.sequence ?? "").slice(0, 10),
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
403
462
|
// Update interaction time for notification timeout tracking.
|
|
404
463
|
// This is called from the central input handler to avoid having multiple
|
|
405
464
|
// stdin listeners that can cause race conditions and dropped input.
|
|
@@ -429,6 +488,10 @@ function processKeysInBatch(app, items, _unused1, _unused2) {
|
|
|
429
488
|
// Handle terminal focus events (DECSET 1004)
|
|
430
489
|
if (sequence === FOCUS_IN) {
|
|
431
490
|
app.handleTerminalFocus(true);
|
|
491
|
+
// Refocus is the first observable moment after a terminal-side
|
|
492
|
+
// mode reset (conpty drops 1049/mouse on DPI moves, renderer
|
|
493
|
+
// restarts, window snapping): probe and self-heal.
|
|
494
|
+
app.props.onTerminalFocus?.(true);
|
|
432
495
|
const event = new TerminalFocusEvent("terminalfocus");
|
|
433
496
|
app.internal_eventEmitter.emit("terminalfocus", event);
|
|
434
497
|
continue;
|
|
@@ -458,6 +521,37 @@ function processKeysInBatch(app, items, _unused1, _unused2) {
|
|
|
458
521
|
app.handleSuspend();
|
|
459
522
|
continue;
|
|
460
523
|
}
|
|
524
|
+
// Wheel keys carry the pointer position (SGR/X10 col/row). Route
|
|
525
|
+
// position-first: if a scroll container sits under the pointer, its
|
|
526
|
+
// onWheel consumes the event and the legacy global keybinding path
|
|
527
|
+
// never fires — exactly one layer scrolls. Events without coords
|
|
528
|
+
// (shouldn't happen for wheel) or over non-scroll areas fall
|
|
529
|
+
// through to the normal input path (Chat scrolls the transcript).
|
|
530
|
+
// Skipped during the post-handoff suppression window: a terminal
|
|
531
|
+
// replay burst can contain mouse-wheel fragments, and use-input's
|
|
532
|
+
// choke point never sees events consumed here.
|
|
533
|
+
if ((item.name === "wheelup" ||
|
|
534
|
+
item.name === "wheeldown" ||
|
|
535
|
+
item.name === "wheelleft" ||
|
|
536
|
+
item.name === "wheelright") &&
|
|
537
|
+
item.mouseCol !== undefined &&
|
|
538
|
+
item.mouseRow !== undefined &&
|
|
539
|
+
!isInputSuppressed()) {
|
|
540
|
+
const step = (item.name === "wheelup" || item.name === "wheelleft") ? -3 : 3;
|
|
541
|
+
const deltaY = item.name === "wheelup" || item.name === "wheeldown" ? step : 0;
|
|
542
|
+
const deltaX = item.name === "wheelleft" || item.name === "wheelright" ? step : 0;
|
|
543
|
+
const consumed = app.props.onWheelAt(item.mouseCol, item.mouseRow, deltaY, deltaX);
|
|
544
|
+
if (consumed) {
|
|
545
|
+
logMouseDebug("wheel routed by position", {
|
|
546
|
+
col: item.mouseCol,
|
|
547
|
+
row: item.mouseRow,
|
|
548
|
+
deltaY,
|
|
549
|
+
deltaX,
|
|
550
|
+
name: item.name,
|
|
551
|
+
});
|
|
552
|
+
continue;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
461
555
|
app.handleInput(sequence);
|
|
462
556
|
const event = new InputEvent(item);
|
|
463
557
|
app.internal_eventEmitter.emit("input", event);
|
|
@@ -472,9 +566,12 @@ export function handleMouseEvent(app, m) {
|
|
|
472
566
|
if (isMouseClicksDisabled())
|
|
473
567
|
return;
|
|
474
568
|
const sel = app.props.selection;
|
|
475
|
-
// Terminal coords are 1-indexed; screen buffer is 0-indexed
|
|
476
|
-
|
|
477
|
-
|
|
569
|
+
// Terminal coords are 1-indexed; screen buffer is 0-indexed. Clamp to
|
|
570
|
+
// the current frame's dimensions: a resize (or a terminal reporting a
|
|
571
|
+
// stale position) can deliver coordinates outside the screen buffer,
|
|
572
|
+
// and selection/hyperlink reads assume in-bounds cells.
|
|
573
|
+
const col = Math.max(0, Math.min(m.col - 1, app.props.terminalColumns - 1));
|
|
574
|
+
const row = Math.max(0, Math.min(m.row - 1, app.props.terminalRows - 1));
|
|
478
575
|
const baseButton = m.button & 0x03;
|
|
479
576
|
if (m.action === "press") {
|
|
480
577
|
if ((m.button & 0x20) !== 0 && baseButton === 3) {
|
|
@@ -582,7 +679,7 @@ export function handleMouseEvent(app, m) {
|
|
|
582
679
|
// Single click: dispatch DOM click immediately (cursor repositioning
|
|
583
680
|
// etc. are latency-sensitive). If no DOM handler consumed it, defer
|
|
584
681
|
// the hyperlink check so a second click can cancel it.
|
|
585
|
-
if (!app.props.onClickAt(col, row)) {
|
|
682
|
+
if (!app.props.onClickAt(col, row, m.button)) {
|
|
586
683
|
// Resolve the hyperlink URL synchronously while the screen buffer
|
|
587
684
|
// still reflects what the user clicked — deferring only the
|
|
588
685
|
// browser-open so double-click can cancel it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClockContext.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/ClockContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ClockContext.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/ClockContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAIlE,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,SAAS,EAAE,OAAO,KAAK,MAAM,IAAI,CAAC;IACpE,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AACF,wBAAgB,WAAW,CAAC,cAAc,EAAE,MAAM,GAAG,KAAK,CA2DzD;AACD,eAAO,MAAM,YAAY,6BAAoC,CAAC;AAM9D,wBAAgB,aAAa,CAAC,EAAE,KAAA,OAiC/B"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
3
|
import { createContext, useEffect, useState } from 'react';
|
|
4
4
|
import { FRAME_INTERVAL_MS } from '../constants.js';
|
|
5
|
+
import { noteFrameCause } from '../geometry-trace.js';
|
|
5
6
|
import { useTerminalFocus } from '../hooks/use-terminal-focus.js';
|
|
6
7
|
export function createClock(tickIntervalMs) {
|
|
7
8
|
const subscribers = new Map();
|
|
@@ -13,6 +14,7 @@ export function createClock(tickIntervalMs) {
|
|
|
13
14
|
let tickTime = 0;
|
|
14
15
|
function tick() {
|
|
15
16
|
tickTime = Date.now() - startTime;
|
|
17
|
+
noteFrameCause('animation');
|
|
16
18
|
for (const onChange of subscribers.keys()) {
|
|
17
19
|
onChange();
|
|
18
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollBox.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/ScrollBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"ScrollBox.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/ScrollBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,GAAG,EAAsD,MAAM,OAAO,CAAC;AACpH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAK5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B;;;;;;OAMG;IACH,eAAe,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,MAAM,CAAC;IAC9B,eAAe,EAAE,MAAM,MAAM,CAAC;IAC9B;;;;;OAKG;IACH,oBAAoB,EAAE,MAAM,MAAM,CAAC;IACnC,iBAAiB,EAAE,MAAM,MAAM,CAAC;IAChC;;;OAGG;IACH,cAAc,EAAE,MAAM,MAAM,CAAC;IAC7B;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB;;;;;OAKG;IACH,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IAChD;;;;;;;OAOG;IACH,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CAC5E,CAAC;AACF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC,GAAG;IACjG,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;;;;;;;;GASG;AACH,iBAAS,SAAS,CAAC,EACjB,QAAQ,EACR,GAAG,EACH,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,SAAS,CAqOrD;AACD,eAAe,SAAS,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useImperativeHandle, useRef, useState } from 'react';
|
|
2
|
+
import { useCallback, useImperativeHandle, useRef, useState } from 'react';
|
|
3
|
+
import { FRAME_INTERVAL_MS } from '../constants.js';
|
|
3
4
|
import { markScrollActivity } from '../../bootstrap/state.js';
|
|
4
5
|
import { markDirty, scheduleRenderFrom } from '../dom.js';
|
|
6
|
+
import { noteFrameCause } from '../geometry-trace.js';
|
|
5
7
|
import { markCommitStart } from '../reconciler.js';
|
|
6
8
|
import Box from './Box.js';
|
|
7
9
|
/**
|
|
@@ -27,18 +29,56 @@ function ScrollBox({ children, ref, stickyScroll, ...style }) {
|
|
|
27
29
|
const [, forceRender] = useState(0);
|
|
28
30
|
const listenersRef = useRef(new Set());
|
|
29
31
|
const renderQueuedRef = useRef(false);
|
|
32
|
+
// The imperative handle, kept in a ref so the onWheel handler below can
|
|
33
|
+
// call scrollBy through the full public path (clamp bounds, sticky
|
|
34
|
+
// clearing, subscriber notify) instead of duplicating its logic.
|
|
35
|
+
const handleRef = useRef(null);
|
|
30
36
|
const notify = () => {
|
|
31
37
|
for (const l of listenersRef.current)
|
|
32
38
|
l();
|
|
33
39
|
};
|
|
40
|
+
// Input-edge intent coalescing (Qwen Code's 16ms wheel merge, Crush's
|
|
41
|
+
// pre-queue filter): subscribers drive React state (MessageList's mount
|
|
42
|
+
// window, Chat's sticky flag, the timeline rail), so notifying per wheel
|
|
43
|
+
// EVENT runs a full React commit per event — a fast flick is 10-30
|
|
44
|
+
// events, each re-running the offsets/window/timeline loops on a big
|
|
45
|
+
// session. The scrollTop mutation and the ink render are already
|
|
46
|
+
// frame-throttled; this aligns the React commits to the same frame
|
|
47
|
+
// budget. Both edges defer to a microtask: the remaining input events of
|
|
48
|
+
// the same stdin batch then land BEFORE any commit, and one commit
|
|
49
|
+
// covers the whole batch (the sync leading edge used to run a full
|
|
50
|
+
// commit inside the wheel dispatch itself — pure input latency).
|
|
51
|
+
const notifyQueuedRef = useRef(false);
|
|
52
|
+
const lastNotifyAtRef = useRef(-Infinity);
|
|
53
|
+
const notifyCoalesced = () => {
|
|
54
|
+
const since = performance.now() - lastNotifyAtRef.current;
|
|
55
|
+
if (!notifyQueuedRef.current && since >= FRAME_INTERVAL_MS) {
|
|
56
|
+
notifyQueuedRef.current = true;
|
|
57
|
+
lastNotifyAtRef.current = performance.now();
|
|
58
|
+
queueMicrotask(() => {
|
|
59
|
+
notifyQueuedRef.current = false;
|
|
60
|
+
notify();
|
|
61
|
+
});
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (notifyQueuedRef.current)
|
|
65
|
+
return;
|
|
66
|
+
notifyQueuedRef.current = true;
|
|
67
|
+
setTimeout(() => {
|
|
68
|
+
notifyQueuedRef.current = false;
|
|
69
|
+
lastNotifyAtRef.current = performance.now();
|
|
70
|
+
notify();
|
|
71
|
+
}, Math.max(0, FRAME_INTERVAL_MS - since));
|
|
72
|
+
};
|
|
34
73
|
function scrollMutated(el) {
|
|
35
74
|
// Signal background intervals (IDE poll, LSP poll, GCS fetch, orphan
|
|
36
75
|
// check) to skip their next tick — they compete for the event loop and
|
|
37
76
|
// contributed to 1402ms max frame gaps during scroll drain.
|
|
38
77
|
markScrollActivity();
|
|
78
|
+
noteFrameCause('scroll');
|
|
39
79
|
markDirty(el);
|
|
40
80
|
markCommitStart();
|
|
41
|
-
|
|
81
|
+
notifyCoalesced();
|
|
42
82
|
if (renderQueuedRef.current)
|
|
43
83
|
return;
|
|
44
84
|
renderQueuedRef.current = true;
|
|
@@ -47,99 +87,138 @@ function ScrollBox({ children, ref, stickyScroll, ...style }) {
|
|
|
47
87
|
scheduleRenderFrom(el);
|
|
48
88
|
});
|
|
49
89
|
}
|
|
50
|
-
useImperativeHandle(ref, () =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
return;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
90
|
+
useImperativeHandle(ref, () => {
|
|
91
|
+
const handle = {
|
|
92
|
+
scrollTo(y) {
|
|
93
|
+
const el = domRef.current;
|
|
94
|
+
if (!el)
|
|
95
|
+
return;
|
|
96
|
+
// Explicit false overrides the DOM attribute so manual scroll
|
|
97
|
+
// breaks stickiness. Render code checks ?? precedence.
|
|
98
|
+
el.stickyScroll = false;
|
|
99
|
+
el.pendingScrollDelta = undefined;
|
|
100
|
+
el.scrollAnchor = undefined;
|
|
101
|
+
el.scrollTop = Math.max(0, Math.floor(y));
|
|
102
|
+
scrollMutated(el);
|
|
103
|
+
},
|
|
104
|
+
scrollToElement(el, offset = 0) {
|
|
105
|
+
const box = domRef.current;
|
|
106
|
+
if (!box)
|
|
107
|
+
return;
|
|
108
|
+
box.stickyScroll = false;
|
|
109
|
+
box.pendingScrollDelta = undefined;
|
|
110
|
+
box.scrollAnchor = {
|
|
111
|
+
el,
|
|
112
|
+
offset
|
|
113
|
+
};
|
|
114
|
+
scrollMutated(box);
|
|
115
|
+
},
|
|
116
|
+
scrollBy(dy) {
|
|
117
|
+
const el = domRef.current;
|
|
118
|
+
if (!el)
|
|
119
|
+
return;
|
|
120
|
+
el.stickyScroll = false;
|
|
121
|
+
// Wheel input cancels any in-flight anchor seek — user override.
|
|
122
|
+
el.scrollAnchor = undefined;
|
|
123
|
+
// Accumulate in pendingScrollDelta; renderer drains it at a capped
|
|
124
|
+
// rate so fast flicks show intermediate frames. Pure accumulator:
|
|
125
|
+
// scroll-up followed by scroll-down naturally cancels.
|
|
126
|
+
el.pendingScrollDelta = (el.pendingScrollDelta ?? 0) + Math.floor(dy);
|
|
127
|
+
scrollMutated(el);
|
|
128
|
+
},
|
|
129
|
+
scrollToBottom() {
|
|
130
|
+
const el = domRef.current;
|
|
131
|
+
if (!el)
|
|
132
|
+
return;
|
|
133
|
+
el.scrollAnchor = undefined;
|
|
134
|
+
const viewportH = el.scrollViewportHeight ?? 0;
|
|
135
|
+
const maxScroll = Math.max(0, (el.scrollHeight ?? 0) - viewportH);
|
|
136
|
+
const distance = maxScroll - (el.scrollTop ?? 0);
|
|
137
|
+
if (distance > viewportH && viewportH > 0) {
|
|
138
|
+
// FAR jump: drain instead of teleport. The viewport would land on
|
|
139
|
+
// rows that were never mounted — their spacer heights are
|
|
140
|
+
// DEFAULT_ROW_HEIGHT estimates, so the topPad swallows the view
|
|
141
|
+
// (blank transcript) AND it is a fixed point: unmounted rows never
|
|
142
|
+
// measure, nothing retried until the next wheel event. The drain
|
|
143
|
+
// walks the exact wheel path instead: proportional steps, the
|
|
144
|
+
// virtualization window follows per commit (it mounts the union of
|
|
145
|
+
// committed + pending), the visual clamp pins to the mounted edge
|
|
146
|
+
// while rows measure as they enter — no blank at any distance. The
|
|
147
|
+
// renderer's at-bottom re-pin restores sticky when it lands
|
|
148
|
+
// (stickyScroll=false + pending undefined + scrollTop >= maxScroll).
|
|
149
|
+
el.stickyScroll = false;
|
|
150
|
+
el.pendingScrollDelta = (el.pendingScrollDelta ?? 0) + distance;
|
|
151
|
+
scrollMutated(el);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
el.pendingScrollDelta = undefined;
|
|
155
|
+
el.stickyScroll = true;
|
|
156
|
+
// DOM-direct pre-write of the target (near jumps only): the notify
|
|
157
|
+
// below triggers MessageList's window recompute, and its React commit
|
|
158
|
+
// must read the NEW scrollTop — the old order (notify first, renderer
|
|
159
|
+
// moves scrollTop later) left the window one commit behind. The
|
|
160
|
+
// renderer's sticky branch re-pins scrollTop to the exact fresh
|
|
161
|
+
// maxScroll next frame, so a stale cached height costs one frame.
|
|
162
|
+
el.scrollTop = maxScroll;
|
|
163
|
+
scrollMutated(el);
|
|
164
|
+
forceRender(n => n + 1);
|
|
165
|
+
},
|
|
166
|
+
getScrollTop() {
|
|
167
|
+
return domRef.current?.scrollTop ?? 0;
|
|
168
|
+
},
|
|
169
|
+
getPendingDelta() {
|
|
170
|
+
// Accumulated-but-not-yet-drained delta. useVirtualScroll needs
|
|
171
|
+
// this to mount the union [committed, committed+pending] range —
|
|
172
|
+
// otherwise intermediate drain frames find no children (blank).
|
|
173
|
+
return domRef.current?.pendingScrollDelta ?? 0;
|
|
174
|
+
},
|
|
175
|
+
getScrollHeight() {
|
|
176
|
+
return domRef.current?.scrollHeight ?? 0;
|
|
177
|
+
},
|
|
178
|
+
getFreshScrollHeight() {
|
|
179
|
+
const content = domRef.current?.childNodes[0];
|
|
180
|
+
return content?.yogaNode?.getComputedHeight() ?? domRef.current?.scrollHeight ?? 0;
|
|
181
|
+
},
|
|
182
|
+
getViewportHeight() {
|
|
183
|
+
return domRef.current?.scrollViewportHeight ?? 0;
|
|
184
|
+
},
|
|
185
|
+
getViewportTop() {
|
|
186
|
+
return domRef.current?.scrollViewportTop ?? 0;
|
|
187
|
+
},
|
|
188
|
+
isSticky() {
|
|
189
|
+
const el = domRef.current;
|
|
190
|
+
if (!el)
|
|
191
|
+
return false;
|
|
192
|
+
return el.stickyScroll ?? Boolean(el.attributes['stickyScroll']);
|
|
193
|
+
},
|
|
194
|
+
subscribe(listener) {
|
|
195
|
+
listenersRef.current.add(listener);
|
|
196
|
+
return () => listenersRef.current.delete(listener);
|
|
197
|
+
},
|
|
198
|
+
setClampBounds(min, max) {
|
|
199
|
+
const el = domRef.current;
|
|
200
|
+
if (!el)
|
|
201
|
+
return;
|
|
202
|
+
el.scrollClampMin = min;
|
|
203
|
+
el.scrollClampMax = max;
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
handleRef.current = handle;
|
|
207
|
+
return handle;
|
|
208
|
+
},
|
|
138
209
|
// notify/scrollMutated are inline (no useCallback) but only close over
|
|
139
210
|
// refs + imports — stable. Empty deps avoids rebuilding the handle on
|
|
140
211
|
// every render (which re-registers the ref = churn).
|
|
141
212
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
142
213
|
[]);
|
|
214
|
+
// Position-routed wheel events (pointer over this box) scroll THIS box
|
|
215
|
+
// through the public scrollBy path — clamp bounds, sticky clearing, and
|
|
216
|
+
// subscriber notify all apply. Horizontal wheel (deltaX) has no renderer
|
|
217
|
+
// support yet (no scrollLeft in the DOM model) and is ignored.
|
|
218
|
+
const handleWheel = useCallback((e) => {
|
|
219
|
+
if (e.deltaY !== 0)
|
|
220
|
+
handleRef.current?.scrollBy(e.deltaY);
|
|
221
|
+
}, []);
|
|
143
222
|
// Structure: outer viewport (overflow:scroll, constrained height) >
|
|
144
223
|
// inner content (flexGrow:1, flexShrink:0 — fills at least the viewport
|
|
145
224
|
// but grows beyond it for tall content). flexGrow:1 lets children use
|
|
@@ -159,7 +238,7 @@ function ScrollBox({ children, ref, stickyScroll, ...style }) {
|
|
|
159
238
|
// must reach React subscribers too — see dom.ts onStickyRestore.
|
|
160
239
|
el.onStickyRestore = notify;
|
|
161
240
|
}
|
|
162
|
-
}, style: {
|
|
241
|
+
}, onWheel: handleWheel, style: {
|
|
163
242
|
flexWrap: 'nowrap',
|
|
164
243
|
flexDirection: style.flexDirection ?? 'row',
|
|
165
244
|
flexGrow: style.flexGrow ?? 0,
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
/** Shared frame interval for render throttling and animations (~60fps). */
|
|
2
2
|
export declare const FRAME_INTERVAL_MS = 16;
|
|
3
|
+
/**
|
|
4
|
+
* In-flight pty gate threshold (bytes) for scroll-drain frames — Grok
|
|
5
|
+
* Build's Presenter in_flight gate. While stdout holds more unflushed
|
|
6
|
+
* output than this, drain frames hold off instead of stacking latency
|
|
7
|
+
* into a slow ConPTY/ssh link. Sized above one full-screen diff (~4KB at
|
|
8
|
+
* 100 cols) so the gate only trips on genuine backlog, never on a single
|
|
9
|
+
* in-transit frame.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PTY_BACKLOG_BYTES = 8192;
|
|
3
12
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/ink/constants.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,KAAK,CAAA"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/ink/constants.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,KAAK,CAAA;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,OAAO,CAAA"}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
/** Shared frame interval for render throttling and animations (~60fps). */
|
|
2
2
|
export const FRAME_INTERVAL_MS = 16;
|
|
3
|
+
/**
|
|
4
|
+
* In-flight pty gate threshold (bytes) for scroll-drain frames — Grok
|
|
5
|
+
* Build's Presenter in_flight gate. While stdout holds more unflushed
|
|
6
|
+
* output than this, drain frames hold off instead of stacking latency
|
|
7
|
+
* into a slow ConPTY/ssh link. Sized above one full-screen diff (~4KB at
|
|
8
|
+
* 100 cols) so the gate only trips on genuine backlog, never on a single
|
|
9
|
+
* in-transit frame.
|
|
10
|
+
*/
|
|
11
|
+
export const PTY_BACKLOG_BYTES = 8192;
|