@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
|
@@ -160,6 +160,39 @@ export function Settings({ channel, onClose, }) {
|
|
|
160
160
|
setNotice(undefined);
|
|
161
161
|
bump();
|
|
162
162
|
};
|
|
163
|
+
/**
|
|
164
|
+
* Activate one focusable entry — the keyboard Enter path, shared with the
|
|
165
|
+
* mouse click. Groups open their subpage; boolean/select fields cycle their
|
|
166
|
+
* value; text/secret fields enter the edit mode.
|
|
167
|
+
*/
|
|
168
|
+
const activateEntry = (entry) => {
|
|
169
|
+
if (entry.kind === 'group') {
|
|
170
|
+
setActiveGroup({ ns: entry.ns, id: entry.group.id });
|
|
171
|
+
setFocusIndex(0);
|
|
172
|
+
setWindowStart(0);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
// A save in flight owns the section's drafts; starting an edit mid-write
|
|
176
|
+
// is exactly the lost-draft race the staged model exists to prevent.
|
|
177
|
+
const form = forms.get(entry.ns);
|
|
178
|
+
if (form === undefined || !form.available || form.saving)
|
|
179
|
+
return;
|
|
180
|
+
if (entry.field.kind === 'boolean' || entry.field.kind === 'select') {
|
|
181
|
+
cycleField(entry.ns, entry.field);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
setEditing({ ns: entry.ns, field: entry.field, draft: form.field(entry.field).text });
|
|
185
|
+
setMode('edit');
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
/** Mouse wheel moves the focus (the window is focus-follow, so moving the
|
|
189
|
+
* focus IS scrolling); the edit mode keeps the keyboard as sole owner. */
|
|
190
|
+
const handleWheel = (event) => {
|
|
191
|
+
if (mode === 'edit')
|
|
192
|
+
return;
|
|
193
|
+
const direction = event.deltaY >= 0 ? 1 : -1;
|
|
194
|
+
setFocusIndex(previous => Math.min(Math.max(0, focusable.length - 1), Math.max(0, previous + direction)));
|
|
195
|
+
};
|
|
163
196
|
useInput((input, key) => {
|
|
164
197
|
if (mode === 'edit' && editing !== null) {
|
|
165
198
|
if (isPlainReturn(key)) {
|
|
@@ -192,23 +225,7 @@ export function Settings({ channel, onClose, }) {
|
|
|
192
225
|
setFocusIndex(Math.min(Math.max(0, focusable.length - 1), effFocus + 1));
|
|
193
226
|
}
|
|
194
227
|
else if (isPlainReturn(key) && focused !== undefined) {
|
|
195
|
-
|
|
196
|
-
setActiveGroup({ ns: focused.ns, id: focused.group.id });
|
|
197
|
-
setFocusIndex(0);
|
|
198
|
-
setWindowStart(0);
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
// A save in flight owns the section's drafts; starting an edit mid-write
|
|
202
|
-
// is exactly the lost-draft race the staged model exists to prevent.
|
|
203
|
-
if (focusedForm === undefined || !focusedForm.available || focusedForm.saving)
|
|
204
|
-
return;
|
|
205
|
-
if (focused.field.kind === 'boolean' || focused.field.kind === 'select') {
|
|
206
|
-
cycleField(focused.ns, focused.field);
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
setEditing({ ns: focused.ns, field: focused.field, draft: focusedForm.field(focused.field).text });
|
|
210
|
-
setMode('edit');
|
|
211
|
-
}
|
|
228
|
+
activateEntry(focused);
|
|
212
229
|
}
|
|
213
230
|
else if (input === 's' && focused !== undefined) {
|
|
214
231
|
commitSave(focused.ns);
|
|
@@ -246,7 +263,7 @@ export function Settings({ channel, onClose, }) {
|
|
|
246
263
|
}
|
|
247
264
|
}
|
|
248
265
|
});
|
|
249
|
-
const renderField = (section, field) => {
|
|
266
|
+
const renderField = (section, field, focus) => {
|
|
250
267
|
const ns = section.ns;
|
|
251
268
|
const form = forms.get(ns);
|
|
252
269
|
const state = form?.field(field) ?? { text: '', overridden: false, invalid: false };
|
|
@@ -254,6 +271,20 @@ export function Settings({ channel, onClose, }) {
|
|
|
254
271
|
const isEditing = isFocused && mode === 'edit' && editing !== null;
|
|
255
272
|
const label = pick(field.label, field.descriptions);
|
|
256
273
|
const hint = field.hint !== undefined ? pick(field.hint, field.hintDescriptions) : undefined;
|
|
274
|
+
// 鼠标:编辑态整屏不响应(草稿由键盘独占,防误触抢焦点);列表态
|
|
275
|
+
// 悬停即移动焦点(lazygit 语义——焦点就是选中),点击 = 焦点 + 该行
|
|
276
|
+
// 的 Enter 动作(boolean/select 循环值,文本/secret 进编辑态)。
|
|
277
|
+
const rowEvents = mode === 'edit'
|
|
278
|
+
? undefined
|
|
279
|
+
: {
|
|
280
|
+
onClick: () => {
|
|
281
|
+
setFocusIndex(focus);
|
|
282
|
+
activateEntry({ kind: 'field', ns: section.ns, field });
|
|
283
|
+
},
|
|
284
|
+
onMouseEnter: () => {
|
|
285
|
+
setFocusIndex(focus);
|
|
286
|
+
},
|
|
287
|
+
};
|
|
257
288
|
let value;
|
|
258
289
|
if (field.secret !== undefined) {
|
|
259
290
|
const configured = secrets.get(`${ns}:${field.path.join('.')}`) === true;
|
|
@@ -276,7 +307,7 @@ export function Settings({ channel, onClose, }) {
|
|
|
276
307
|
else {
|
|
277
308
|
value = state.text;
|
|
278
309
|
}
|
|
279
|
-
return (_jsxs(Box, { children: [_jsx(Text, { color: isFocused ? 'suggestion' : undefined, children: isFocused ? '❯ ' : ' ' }), _jsx(Text, { bold: isFocused, children: label }), _jsx(Box, { flexGrow: 1 }), state.invalid && _jsxs(Text, { color: "error", children: [t('settings-field-invalid'), " "] }), state.overridden && _jsxs(Text, { dimColor: true, children: ["[", t('settings-badge-override'), "] "] }), form?.isStaged(field) === true && !isEditing && _jsx(Text, { color: "suggestion", children: "* " }), _jsx(Text, { color: isEditing || isFocused ? 'suggestion' : undefined, dimColor: !isFocused && !isEditing && state.text === '', children: value }), hint !== undefined && isFocused && (_jsxs(Text, { dimColor: true, children: ['\n ', hint] }))] }));
|
|
310
|
+
return (_jsxs(Box, { ...rowEvents, children: [_jsx(Text, { color: isFocused ? 'suggestion' : undefined, children: isFocused ? '❯ ' : ' ' }), _jsx(Text, { bold: isFocused, children: label }), _jsx(Box, { flexGrow: 1 }), state.invalid && _jsxs(Text, { color: "error", children: [t('settings-field-invalid'), " "] }), state.overridden && _jsxs(Text, { dimColor: true, children: ["[", t('settings-badge-override'), "] "] }), form?.isStaged(field) === true && !isEditing && _jsx(Text, { color: "suggestion", children: "* " }), _jsx(Text, { color: isEditing || isFocused ? 'suggestion' : undefined, dimColor: !isFocused && !isEditing && state.text === '', children: value }), hint !== undefined && isFocused && (_jsxs(Text, { dimColor: true, children: ['\n ', hint] }))] }));
|
|
280
311
|
};
|
|
281
312
|
// ── Layout: a flat entry list with accounted line heights, windowed so the
|
|
282
313
|
// focused row is always on screen no matter how long the current page gets. ─
|
|
@@ -290,7 +321,7 @@ export function Settings({ channel, onClose, }) {
|
|
|
290
321
|
key: `field:${section.ns}:${field.path.join('.')}`,
|
|
291
322
|
lines: field.hint !== undefined && isFocused ? 2 : 1,
|
|
292
323
|
focus: index,
|
|
293
|
-
node: renderField(section, field),
|
|
324
|
+
node: renderField(section, field, index),
|
|
294
325
|
});
|
|
295
326
|
};
|
|
296
327
|
if (activeSection !== undefined && activeGroupSpec !== undefined) {
|
|
@@ -319,11 +350,22 @@ export function Settings({ channel, onClose, }) {
|
|
|
319
350
|
const isFocused = focused?.kind === 'group' && focused.ns === section.ns && focused.group === group;
|
|
320
351
|
const index = focusCursor;
|
|
321
352
|
focusCursor += 1;
|
|
353
|
+
const groupRowEvents = mode === 'edit'
|
|
354
|
+
? undefined
|
|
355
|
+
: {
|
|
356
|
+
onClick: () => {
|
|
357
|
+
setFocusIndex(index);
|
|
358
|
+
activateEntry({ kind: 'group', ns: section.ns, group });
|
|
359
|
+
},
|
|
360
|
+
onMouseEnter: () => {
|
|
361
|
+
setFocusIndex(index);
|
|
362
|
+
},
|
|
363
|
+
};
|
|
322
364
|
entries.push({
|
|
323
365
|
key: `group:${section.ns}:${group.id}`,
|
|
324
366
|
lines: 1,
|
|
325
367
|
focus: index,
|
|
326
|
-
node: (_jsxs(Box, { children: [_jsx(Text, { color: isFocused ? 'suggestion' : undefined, children: isFocused ? '❯ ' : ' ' }), _jsx(Text, { bold: isFocused, children: pick(group.title, group.descriptions) }), _jsx(Box, { flexGrow: 1 }), _jsx(Text, { color: isFocused ? 'suggestion' : undefined, children: "\u203A" })] })),
|
|
368
|
+
node: (_jsxs(Box, { ...groupRowEvents, children: [_jsx(Text, { color: isFocused ? 'suggestion' : undefined, children: isFocused ? '❯ ' : ' ' }), _jsx(Text, { bold: isFocused, children: pick(group.title, group.descriptions) }), _jsx(Box, { flexGrow: 1 }), _jsx(Text, { color: isFocused ? 'suggestion' : undefined, children: "\u203A" })] })),
|
|
327
369
|
});
|
|
328
370
|
}
|
|
329
371
|
});
|
|
@@ -388,5 +430,5 @@ export function Settings({ channel, onClose, }) {
|
|
|
388
430
|
? `${t('settings-title')} › ${pick(activeSection.title, activeSection.descriptions)} › ${pick(activeGroupSpec.title, activeGroupSpec.descriptions)}`
|
|
389
431
|
: t('settings-title');
|
|
390
432
|
const navigationHint = activeGroupSpec === undefined ? t('settings-hint-list') : t('settings-hint-group');
|
|
391
|
-
return (_jsxs(Box, { flexDirection: "column", width: columns, height: rows, children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, children: title }), _jsx(Box, { flexGrow: 1 }), host === undefined && _jsx(Text, { color: "warning", children: t('settings-unavailable') })] }), _jsx(Divider, {}), visible.map(entry => (_jsx(React.Fragment, { children: entry.node }, entry.key))), _jsx(Box, { flexGrow: 1 }), notice !== undefined && (_jsx(Text, { color: notice.tone === 'error' ? 'error' : 'success', children: notice.text })), _jsx(Divider, {}), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: mode === 'edit' ? t('settings-hint-edit') : navigationHint }) })] }));
|
|
433
|
+
return (_jsxs(Box, { flexDirection: "column", width: columns, height: rows, children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, children: title }), _jsx(Box, { flexGrow: 1 }), host === undefined && _jsx(Text, { color: "warning", children: t('settings-unavailable') })] }), _jsx(Divider, {}), _jsx("ink-box", { style: { flexDirection: 'column', flexGrow: 1, flexShrink: 1, overflow: 'hidden' }, onWheel: handleWheel, children: visible.map(entry => (_jsx(React.Fragment, { children: entry.node }, entry.key))) }), _jsx(Box, { flexGrow: 1 }), notice !== undefined && (_jsx(Text, { color: notice.tone === 'error' ? 'error' : 'success', children: notice.text })), _jsx(Divider, {}), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: mode === 'edit' ? t('settings-hint-edit') : navigationHint }) })] }));
|
|
392
434
|
}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Channel } from '../dsh-adapter/channel.js';
|
|
3
3
|
import type { WaveBand } from '../dsh-adapter/types.js';
|
|
4
|
-
/**
|
|
5
|
-
* The footer under the prompt input, in Claude Code's PromptInputFooter
|
|
6
|
-
* layout: the segmented context progress bar on its own first line, the
|
|
7
|
-
* status line below (left group: model · tokens · think level · cache · tps
|
|
8
|
-
* gauge/sparkline; right group: git · cwd · title, right-aligned), and the
|
|
9
|
-
* mode/hint line last. The right side of the footer shows the latest
|
|
10
|
-
* transient notification (errors in red, warnings in amber — CC style).
|
|
11
|
-
*/
|
|
12
4
|
export declare function StatusLine({ channel, selectionActive, helpOpen, wake, }: {
|
|
13
5
|
channel: Channel;
|
|
14
6
|
selectionActive?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusLine.d.ts","sourceRoot":"","sources":["../../../src/screens/StatusLine.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"StatusLine.d.ts","sourceRoot":"","sources":["../../../src/screens/StatusLine.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAYxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AA6EvD,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,eAAuB,EACvB,QAAgB,EAChB,IAAI,GACL,EAAE;IACD,OAAO,EAAE,OAAO,CAAA;IAChB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CACvD,qBA8VA;AAED,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAyHD,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKvF"}
|
|
@@ -1,24 +1,36 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { Box, Text, useTerminalSize, useTheme } from '../ui.js';
|
|
3
4
|
import { formatTokens } from '../cc/format.js';
|
|
4
5
|
import { t } from '../i18n.js';
|
|
5
6
|
import { formatContextUsage, DEFAULT_STATUS_BAR, normalizeStatusBar } from '../tuiDisplayPrefs.js';
|
|
6
|
-
import { Byline } from '../components/design-system/Byline.js';
|
|
7
7
|
import { ActivityLine, contextPressurePct } from '../components/ActivityLine.js';
|
|
8
|
+
import { GoalStatusChip } from '../components/GoalTodoPanel.js';
|
|
8
9
|
import { modeDisplayName } from '../sessionModes.js';
|
|
9
10
|
import { MiniWake } from '../components/trajectory/MiniWake.js';
|
|
10
|
-
import {
|
|
11
|
+
import { ContextBarView } from '../components/ContextBarView.js';
|
|
12
|
+
import { USED_SEGMENTS, renderMiniContextBar, renderTpsGauge, renderTpsSparkline, speedColor, tpsStats, } from './StatusMetrics.js';
|
|
11
13
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* transient notification (errors in red, warnings in amber — CC style).
|
|
14
|
+
* Render field parts as sibling shrinkable Boxes joined by the Byline
|
|
15
|
+
* separator (` · `). The Box-per-field layout is what makes individual
|
|
16
|
+
* fields hoverable — a Byline inside one Text cannot carry per-field mouse
|
|
17
|
+
* rects — at the cost of truncating each field on its own under pressure
|
|
18
|
+
* instead of truncating the joined string's tail.
|
|
18
19
|
*/
|
|
20
|
+
function FieldLine({ parts, hoverProps, }) {
|
|
21
|
+
const visible = parts.filter(part => part.node !== null && part.node !== undefined && part.node !== false);
|
|
22
|
+
return (_jsx(_Fragment, { children: visible.map((part, index) => (_jsxs(React.Fragment, { children: [index > 0 ? _jsx(Text, { dimColor: true, children: " \u00B7 " }) : null, _jsx(Box, { flexShrink: 1, ...(part.id === undefined ? {} : hoverProps(part.id)), children: _jsx(Text, { wrap: "truncate", children: part.node }) })] }, part.key))) }));
|
|
23
|
+
}
|
|
19
24
|
export function StatusLine({ channel, selectionActive = false, helpOpen = false, wake, }) {
|
|
20
25
|
const { columns } = useTerminalSize();
|
|
21
26
|
const [themeName] = useTheme();
|
|
27
|
+
const [hover, setHover] = React.useState(null);
|
|
28
|
+
const hoverProps = React.useCallback((id) => ({
|
|
29
|
+
onMouseEnter: () => setHover(id),
|
|
30
|
+
// Guarded leave: a late leave from a field the pointer already left must
|
|
31
|
+
// not clobber the field it entered.
|
|
32
|
+
onMouseLeave: () => setHover(current => (current === id ? null : current)),
|
|
33
|
+
}), []);
|
|
22
34
|
const statusBar = channel.minimal
|
|
23
35
|
// Minimal mode overrides every field switch: model + cwd only, so the
|
|
24
36
|
// footer can never grow decorations regardless of saved preferences.
|
|
@@ -30,65 +42,145 @@ export function StatusLine({ channel, selectionActive = false, helpOpen = false,
|
|
|
30
42
|
: usage.input + usage.cacheRead + usage.cacheWrite;
|
|
31
43
|
const contextParts = [];
|
|
32
44
|
if (statusBar.thinking && channel.reasoningEffort !== undefined) {
|
|
33
|
-
contextParts.push(
|
|
45
|
+
contextParts.push({
|
|
46
|
+
key: 'effort',
|
|
47
|
+
node: _jsx(Text, { color: "inactiveShimmer", children: channel.reasoningEffort }),
|
|
48
|
+
});
|
|
34
49
|
}
|
|
35
50
|
if (statusBar.mode && channel.modeIndex > 0) {
|
|
36
|
-
contextParts.push(
|
|
51
|
+
contextParts.push({
|
|
52
|
+
key: 'mode',
|
|
53
|
+
node: (_jsx(Text, { color: channel.mode.plan === true ? 'planMode' : 'warning', children: modeDisplayName(channel.mode) })),
|
|
54
|
+
});
|
|
37
55
|
}
|
|
38
56
|
const formattedContext = statusBar.contextUsage
|
|
39
57
|
? formatContextUsage(contextUsed, channel.contextWindow, statusBar.compact)
|
|
40
58
|
: undefined;
|
|
41
|
-
|
|
59
|
+
// The ctx field's two faces: the idle readout, and the hover state — an
|
|
60
|
+
// in-place pressure bar (the user-liked "text becomes a bar" morph).
|
|
61
|
+
//
|
|
62
|
+
// WIDTH-STABLE BY CONSTRUCTION: the idle variable part is
|
|
63
|
+
// `P + " (" + C + ")"` (either order; P = percent text, C = counts) —
|
|
64
|
+
// len(P)+len(C)+3 cells. The hover variant is `▕+bar+▏ + " " + P` —
|
|
65
|
+
// 3+barLen+len(P) cells. Sizing barLen = len(C) makes them equal, so the
|
|
66
|
+
// morph swaps glyphs in place and NO sibling field, separator, or the
|
|
67
|
+
// right-aligned group moves a single cell (the first attempt used a fixed
|
|
68
|
+
// 10-cell gauge and made the whole row jump).
|
|
69
|
+
const ctxParts = (() => {
|
|
70
|
+
if (formattedContext === undefined)
|
|
71
|
+
return undefined;
|
|
72
|
+
const open = formattedContext.indexOf(' (');
|
|
73
|
+
if (open < 0)
|
|
74
|
+
return undefined;
|
|
75
|
+
const first = formattedContext.slice(0, open);
|
|
76
|
+
const second = formattedContext.slice(open + 2, -1);
|
|
77
|
+
if (first.endsWith('%'))
|
|
78
|
+
return { percent: first, counts: second };
|
|
79
|
+
if (second.endsWith('%'))
|
|
80
|
+
return { percent: second, counts: first };
|
|
81
|
+
return undefined;
|
|
82
|
+
})();
|
|
83
|
+
const ctxHoverBarWidth = ctxParts?.counts.length ?? 0;
|
|
84
|
+
const ctxNode = formattedContext === undefined
|
|
42
85
|
? undefined
|
|
43
|
-
:
|
|
86
|
+
: hover === 'ctx' &&
|
|
87
|
+
ctxParts !== undefined &&
|
|
88
|
+
ctxHoverBarWidth > 0 &&
|
|
89
|
+
contextUsed !== undefined &&
|
|
90
|
+
channel.contextWindow !== undefined
|
|
91
|
+
? (_jsxs(Text, { color: "inactiveShimmer", children: [_jsx(Text, { dimColor: true, children: "ctx " }), renderMiniContextBar(contextUsed, channel.contextWindow, ctxHoverBarWidth), ' ', ctxParts.percent] }))
|
|
92
|
+
: (_jsxs(Text, { color: "inactiveShimmer", children: [_jsx(Text, { dimColor: true, children: "ctx " }), formattedContext] }));
|
|
44
93
|
if (statusBar.cache) {
|
|
45
94
|
const cacheRate = formatCacheHitRate(usage);
|
|
46
95
|
if (cacheRate !== undefined) {
|
|
47
|
-
contextParts.push(
|
|
96
|
+
contextParts.push({
|
|
97
|
+
key: 'cache',
|
|
98
|
+
id: 'cache',
|
|
99
|
+
node: (_jsxs(Text, { color: "inactiveShimmer", children: [_jsx(Text, { dimColor: true, children: t('status-cache-label') }), cacheRate] })),
|
|
100
|
+
});
|
|
48
101
|
}
|
|
49
102
|
}
|
|
50
|
-
|
|
103
|
+
let tpsPart;
|
|
51
104
|
if (statusBar.tps && channel.tps !== undefined) {
|
|
52
105
|
if (channel.working && channel.tpsSamples.length === 0) {
|
|
53
|
-
|
|
106
|
+
tpsPart = {
|
|
107
|
+
key: 'tps',
|
|
108
|
+
id: 'tps',
|
|
109
|
+
node: (_jsxs(Text, { children: [renderTpsGauge(channel.tps, channel.tps), ' ', _jsxs(Text, { dimColor: true, children: [Math.round(channel.tps), " tps"] })] })),
|
|
110
|
+
};
|
|
54
111
|
}
|
|
55
112
|
else if (channel.tpsSamples.length > 0) {
|
|
56
113
|
const peak = Math.max(...channel.tpsSamples.map(sample => sample.tps), channel.tps);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
114
|
+
tpsPart = {
|
|
115
|
+
key: 'tps',
|
|
116
|
+
id: 'tps',
|
|
117
|
+
node: (_jsxs(Text, { children: [channel.working
|
|
118
|
+
? renderTpsGauge(channel.tps, peak)
|
|
119
|
+
: renderTpsSparkline(channel.tpsSamples), ' ', speedColor(channel.tps, `${Math.round(channel.tps)}`), " tps"] })),
|
|
120
|
+
};
|
|
60
121
|
}
|
|
61
122
|
else {
|
|
62
|
-
|
|
123
|
+
tpsPart = {
|
|
124
|
+
key: 'tps',
|
|
125
|
+
id: 'tps',
|
|
126
|
+
node: _jsxs(Text, { dimColor: true, children: [Math.round(channel.tps), " t/s"] }),
|
|
127
|
+
};
|
|
63
128
|
}
|
|
64
129
|
}
|
|
65
|
-
const
|
|
130
|
+
const leftFields = [
|
|
66
131
|
...(statusBar.model
|
|
67
|
-
? [_jsx(Text, { color: "inactiveShimmer", children: channel.model }
|
|
132
|
+
? [{ key: 'model', node: _jsx(Text, { color: "inactiveShimmer", children: channel.model }) }]
|
|
68
133
|
: []),
|
|
69
|
-
...
|
|
134
|
+
...(tpsPart !== undefined ? [tpsPart] : []),
|
|
70
135
|
...contextParts,
|
|
71
136
|
...(statusBar.tokens
|
|
72
|
-
? [
|
|
73
|
-
|
|
74
|
-
|
|
137
|
+
? [{
|
|
138
|
+
key: 'tokens',
|
|
139
|
+
id: 'tokens',
|
|
140
|
+
node: (_jsxs(Text, { color: "inactiveShimmer", children: [formatTokens(channel.tokens.input), "\u2192", formatTokens(channel.tokens.output)] })),
|
|
141
|
+
}]
|
|
75
142
|
: []),
|
|
76
143
|
];
|
|
77
|
-
const
|
|
144
|
+
const rightFields = [
|
|
145
|
+
// Goal chip first: session-level state outranks repo/location details.
|
|
146
|
+
...(statusBar.goal && channel.goal !== undefined
|
|
147
|
+
? [{
|
|
148
|
+
key: 'goal',
|
|
149
|
+
id: 'goal',
|
|
150
|
+
node: _jsx(GoalStatusChip, { goal: channel.goal, minimal: channel.minimal }),
|
|
151
|
+
}]
|
|
152
|
+
: []),
|
|
78
153
|
...(statusBar.gitBranch && channel.gitBranch
|
|
79
154
|
? [
|
|
80
|
-
|
|
155
|
+
{
|
|
156
|
+
key: 'git',
|
|
157
|
+
node: _jsx(Text, { color: "professionalBlue", children: channel.gitBranch }),
|
|
158
|
+
},
|
|
81
159
|
]
|
|
82
160
|
: []),
|
|
83
161
|
...(statusBar.cwd
|
|
84
|
-
? [
|
|
85
|
-
|
|
86
|
-
|
|
162
|
+
? [{
|
|
163
|
+
key: 'cwd',
|
|
164
|
+
id: 'cwd',
|
|
165
|
+
node: (_jsx(Text, { color: "inactiveShimmer", children: statusBar.compact ? basename(channel.displayCwd) : channel.displayCwd })),
|
|
166
|
+
}]
|
|
87
167
|
: []),
|
|
88
168
|
...(statusBar.sessionTitle && channel.sessionTitle
|
|
89
|
-
? [
|
|
90
|
-
|
|
91
|
-
|
|
169
|
+
? [{
|
|
170
|
+
key: 'title',
|
|
171
|
+
id: 'title',
|
|
172
|
+
node: _jsx(Text, { dimColor: true, children: channel.sessionTitle }),
|
|
173
|
+
}]
|
|
174
|
+
: []),
|
|
175
|
+
// Short id last: a provenance tag trails the content it identifies, and
|
|
176
|
+
// the 8-char form is what the session log filename starts with, so a
|
|
177
|
+
// truncated rendering still names the right log for --resume.
|
|
178
|
+
...(statusBar.sessionId && channel.agentId
|
|
179
|
+
? [{
|
|
180
|
+
key: 'sessionId',
|
|
181
|
+
id: 'sessionId',
|
|
182
|
+
node: _jsx(Text, { dimColor: true, children: `#${channel.agentId.slice(0, 8)}` }),
|
|
183
|
+
}]
|
|
92
184
|
: []),
|
|
93
185
|
];
|
|
94
186
|
const hint = selectionActive
|
|
@@ -106,24 +198,111 @@ export function StatusLine({ channel, selectionActive = false, helpOpen = false,
|
|
|
106
198
|
activity.phase !== 'idle';
|
|
107
199
|
const showTrajectory = statusBar.trajectory && wake !== undefined;
|
|
108
200
|
const barWidth = columns - 4;
|
|
109
|
-
let bar = null;
|
|
110
201
|
const barColors = themeName === 'light'
|
|
111
202
|
? undefined
|
|
112
203
|
: { freeFill: '#2E3440', freeText: '#8D95A6' };
|
|
113
|
-
|
|
204
|
+
const barVisible = statusBar.contextBar &&
|
|
114
205
|
channel.contextBarEnabled &&
|
|
115
206
|
barWidth >= 14 &&
|
|
116
207
|
usage !== undefined &&
|
|
117
|
-
channel.contextWindow !== undefined
|
|
118
|
-
|
|
208
|
+
channel.contextWindow !== undefined;
|
|
209
|
+
// The supplemental-row readout for the hovered field: replaces the idle
|
|
210
|
+
// hint (never the activity line) while the pointer dwells on a field.
|
|
211
|
+
const detail = buildHoverDetail(hover, channel, usage, contextUsed);
|
|
212
|
+
const trailer = detail !== null
|
|
213
|
+
? detail
|
|
214
|
+
: hint !== ''
|
|
215
|
+
? _jsx(Text, { color: "inactiveShimmer", children: hint })
|
|
216
|
+
: null;
|
|
217
|
+
const compactFields = [...leftFields, ...rightFields];
|
|
218
|
+
const fullLeftFields = [
|
|
219
|
+
...leftFields,
|
|
220
|
+
...(ctxNode !== undefined ? [{ key: 'context', id: 'ctx', node: ctxNode }] : []),
|
|
221
|
+
];
|
|
222
|
+
const hasStatusFields = compactFields.length > 0 || ctxNode !== undefined;
|
|
223
|
+
// The supplemental row is PERMANENTLY mounted (height pinned to 1)
|
|
224
|
+
// whenever the footer carries hoverable chrome — mounting it from nothing
|
|
225
|
+
// on hover is what made the footer grow mid-gesture and shoved the
|
|
226
|
+
// transcript up (user feedback). Idle it may sit blank: a stable footer
|
|
227
|
+
// outranks a reclaimable row, and hovering only ever swaps this line's
|
|
228
|
+
// content. Minimal mode keeps the old contract — no hover details, the
|
|
229
|
+
// row appears only for real content (which its defaults never produce).
|
|
230
|
+
const showSupplementalRow = (!channel.minimal && (hasStatusFields || barVisible)) ||
|
|
231
|
+
showActivity ||
|
|
232
|
+
showTrajectory ||
|
|
233
|
+
hint !== '';
|
|
234
|
+
return (_jsx(Box, { paddingX: 1, width: columns, flexShrink: 0, children: _jsxs(Box, { flexDirection: "column", width: "100%", children: [barVisible ? (_jsx(ContextBarView, { segments: channel.contextSegments, usedTokens: contextUsed ?? 0, contextWindow: channel.contextWindow ?? 0, width: barWidth, colors: barColors, onHover: segment => setHover(current => segment === null
|
|
235
|
+
? (current !== null && current.startsWith('segment:') ? null : current)
|
|
236
|
+
: `segment:${segment}`) })) : null, hasStatusFields ? statusBar.compact ? (_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsx(Box, { flexGrow: 1, flexShrink: 1, flexDirection: "row", overflow: "hidden", children: _jsx(FieldLine, { parts: compactFields, hoverProps: hoverProps }) }), ctxNode !== undefined ? (_jsx(Box, { flexShrink: 0, ...hoverProps('ctx'), children: _jsx(Text, { wrap: "truncate", children: ctxNode }) })) : null] })) : (_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsx(Box, { flexGrow: 1, flexShrink: 1, flexDirection: "row", overflow: "hidden", children: _jsx(FieldLine, { parts: fullLeftFields, hoverProps: hoverProps }) }), _jsx(Box, { justifyContent: "flex-end", flexShrink: 2, flexDirection: "row", overflow: "hidden", children: _jsx(FieldLine, { parts: rightFields, hoverProps: hoverProps }) })] })) : null, showSupplementalRow ? _jsxs(Box, { height: 1, overflow: "hidden", flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsxs(Box, { flexDirection: "row", flexGrow: 1, justifyContent: showActivity && trailer !== null ? 'space-between' : 'flex-start', gap: 2, children: [showActivity && activity !== undefined ? (_jsx(ActivityLine, { activity: activity, activityFrames: channel.activityFrames, warnPct: contextPressurePct(usage, channel.contextWindow), warnDanger: (contextPressurePct(usage, channel.contextWindow) ?? 0) >= 95 })) : trailer, showActivity ? trailer : null] }), showTrajectory && wake !== undefined ? (_jsx(MiniWake, { band: wake.band, hint: wake.hint, tick: wake.tick })) : null] }) : null] }) }));
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* The supplemental-row readout for a hovered footer field. Technical label
|
|
240
|
+
* tokens (ctx, free, read, sys…) stay unlocalized like the footer fields
|
|
241
|
+
* themselves; sentences go through t(). Returns null when nothing is
|
|
242
|
+
* hovered (or the hover outlived its data, which the field gating makes
|
|
243
|
+
* near-impossible).
|
|
244
|
+
*/
|
|
245
|
+
function buildHoverDetail(hover, channel, usage, contextUsed) {
|
|
246
|
+
if (hover === null)
|
|
247
|
+
return null;
|
|
248
|
+
const window = channel.contextWindow;
|
|
249
|
+
const dim = (label) => _jsx(Text, { dimColor: true, children: label });
|
|
250
|
+
if (hover.startsWith('segment:')) {
|
|
251
|
+
if (window === undefined || window <= 0 || contextUsed === undefined)
|
|
252
|
+
return null;
|
|
253
|
+
const key = hover.slice('segment:'.length);
|
|
254
|
+
const free = Math.max(0, window - contextUsed);
|
|
255
|
+
if (key === 'free') {
|
|
256
|
+
return (_jsxs(Text, { wrap: "truncate", children: [dim('free '), formatTokens(free), " \u00B7 ", ((free / window) * 100).toFixed(1), "% ", t('status-detail-of-window')] }));
|
|
257
|
+
}
|
|
258
|
+
const segment = USED_SEGMENTS.find(s => s.key === key);
|
|
259
|
+
if (segment === undefined)
|
|
260
|
+
return null;
|
|
261
|
+
const tokens = channel.contextSegments[segment.key];
|
|
262
|
+
return (_jsxs(Text, { wrap: "truncate", children: [dim(`${segment.labels[1] ?? segment.key} `), formatTokens(tokens), " \u00B7", ' ', ((tokens / window) * 100).toFixed(1), "% ", t('status-detail-of-window')] }));
|
|
263
|
+
}
|
|
264
|
+
switch (hover) {
|
|
265
|
+
case 'ctx': {
|
|
266
|
+
if (contextUsed === undefined || window === undefined || window <= 0)
|
|
267
|
+
return null;
|
|
268
|
+
const free = Math.max(0, window - contextUsed);
|
|
269
|
+
// The hover payoff for the ctx ask: percent + counts + free, then the
|
|
270
|
+
// segment breakdown as the truncate-able tail (no bar — the row's
|
|
271
|
+
// in-place morph and the segment bar above already carry the gauge).
|
|
272
|
+
const segments = USED_SEGMENTS.map(segment => `${segment.labels[1] ?? segment.key} ${formatTokens(channel.contextSegments[segment.key])}`).join(' · ');
|
|
273
|
+
return (_jsxs(Text, { wrap: "truncate", children: [((contextUsed / window) * 100).toFixed(1), "% \u00B7", ' ', formatTokens(contextUsed), "/", formatTokens(window), " \u00B7 ", dim('free '), formatTokens(free), ' · ', segments] }));
|
|
274
|
+
}
|
|
275
|
+
case 'cache': {
|
|
276
|
+
const rate = formatCacheHitRate(usage);
|
|
277
|
+
if (usage === undefined || rate === undefined)
|
|
278
|
+
return null;
|
|
279
|
+
return (_jsxs(Text, { wrap: "truncate", children: [dim('cache '), rate, " \u00B7 ", dim('read '), formatTokens(usage.cacheRead), " \u00B7", ' ', dim('write '), formatTokens(usage.cacheWrite), " \u00B7 ", dim('input '), formatTokens(usage.input)] }));
|
|
280
|
+
}
|
|
281
|
+
case 'tps': {
|
|
282
|
+
if (channel.tps === undefined)
|
|
283
|
+
return null;
|
|
284
|
+
const stats = tpsStats(channel.tpsSamples, Date.now());
|
|
285
|
+
return (_jsxs(Text, { wrap: "truncate", children: [dim('tps '), Math.round(channel.tps), " \u00B7 ", dim('avg60 '), stats.avg.toFixed(1), " \u00B7", ' ', dim('mean '), stats.mean.toFixed(1), " \u00B7 ", dim('p95 '), stats.p95.toFixed(1)] }));
|
|
286
|
+
}
|
|
287
|
+
case 'tokens': {
|
|
288
|
+
const { input, output } = channel.tokens;
|
|
289
|
+
return (_jsxs(Text, { wrap: "truncate", children: [dim('in '), input.toLocaleString(), " \u00B7 ", dim('out '), output.toLocaleString(), " \u00B7", ' ', dim('total '), (input + output).toLocaleString()] }));
|
|
290
|
+
}
|
|
291
|
+
case 'goal': {
|
|
292
|
+
const goal = channel.goal;
|
|
293
|
+
if (goal === undefined)
|
|
294
|
+
return null;
|
|
295
|
+
return (_jsxs(Text, { wrap: "truncate", children: [dim('goal '), goal.phase, " \u00B7 ", dim('r'), goal.roundsStarted, "/", goal.maxGoalRounds, " \u00B7", ' ', goal.objective] }));
|
|
296
|
+
}
|
|
297
|
+
case 'sessionId':
|
|
298
|
+
return (_jsxs(Text, { wrap: "truncate", children: [dim('# '), channel.agentId, " \u00B7 ", t('status-detail-session-id')] }));
|
|
299
|
+
case 'cwd':
|
|
300
|
+
return (_jsxs(Text, { wrap: "truncate", children: [dim('cwd '), channel.displayCwd] }));
|
|
301
|
+
case 'title':
|
|
302
|
+
return (_jsxs(Text, { wrap: "truncate", children: [dim('title '), channel.sessionTitle] }));
|
|
303
|
+
default:
|
|
304
|
+
return null;
|
|
119
305
|
}
|
|
120
|
-
const compactLeftParts = [...leftParts, ...rightParts];
|
|
121
|
-
const fullLeftParts = contextUsagePart === undefined
|
|
122
|
-
? leftParts
|
|
123
|
-
: [...leftParts, contextUsagePart];
|
|
124
|
-
const hasStatusFields = compactLeftParts.length > 0 || contextUsagePart !== undefined;
|
|
125
|
-
const showSupplementalRow = hint !== '' || showActivity || showTrajectory;
|
|
126
|
-
return (_jsx(Box, { paddingX: 1, width: columns, flexShrink: 0, children: _jsxs(Box, { flexDirection: "column", width: "100%", children: [bar ? _jsx(Text, { children: bar }) : null, hasStatusFields ? statusBar.compact ? (_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsx(Box, { flexGrow: 1, flexShrink: 1, children: _jsx(Text, { wrap: "truncate", children: _jsx(Byline, { children: compactLeftParts }) }) }), contextUsagePart ? (_jsx(Box, { flexShrink: 0, children: _jsx(Text, { wrap: "truncate", children: _jsx(Byline, { children: [contextUsagePart] }) }) })) : null] })) : (_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsx(Box, { flexGrow: 1, flexShrink: 1, children: _jsx(Text, { wrap: "truncate", children: _jsx(Byline, { children: fullLeftParts }) }) }), _jsx(Box, { justifyContent: "flex-end", flexShrink: 2, children: _jsx(Text, { wrap: "truncate", children: _jsx(Byline, { children: rightParts }) }) })] })) : null, showSupplementalRow ? _jsxs(Box, { height: 1, overflow: "hidden", flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsxs(Box, { flexDirection: "row", flexGrow: 1, justifyContent: showActivity && hint ? 'space-between' : 'flex-start', gap: 2, children: [showActivity && activity !== undefined ? (_jsx(ActivityLine, { activity: activity, activityFrames: channel.activityFrames, warnPct: contextPressurePct(usage, channel.contextWindow), warnDanger: (contextPressurePct(usage, channel.contextWindow) ?? 0) >= 95 })) : hint ? (_jsx(Text, { color: "inactiveShimmer", children: hint })) : null, showActivity && hint ? (_jsx(Text, { color: "inactiveShimmer", wrap: "truncate", children: hint })) : null] }), showTrajectory && wake !== undefined ? (_jsx(MiniWake, { band: wake.band, hint: wake.hint, tick: wake.tick })) : null] }) : null] }) }));
|
|
127
306
|
}
|
|
128
307
|
/** Return the prompt-cache hit rate, or nothing when usage is unavailable. */
|
|
129
308
|
export function formatCacheHitRate(usage) {
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
* yellow ≥ 20, red below.
|
|
9
9
|
*/
|
|
10
10
|
/** Context bar segments — DeepSeek blue family (dark-theme friendly: deep
|
|
11
|
-
* navy → brand blue, neutral grey free segment; labels adapt to width).
|
|
12
|
-
|
|
11
|
+
* navy → brand blue, neutral grey free segment; labels adapt to width).
|
|
12
|
+
* Exported for the hoverable JSX bar (ContextBarView), which re-derives
|
|
13
|
+
* the same column split this module's ANSI path renders. */
|
|
14
|
+
export declare const USED_SEGMENTS: readonly [{
|
|
13
15
|
readonly key: "system";
|
|
14
16
|
readonly color: "#22305F";
|
|
15
17
|
readonly labels: readonly ["system", "sys", "s"];
|
|
@@ -37,6 +39,22 @@ export type ContextSegments = Record<(typeof USED_SEGMENTS)[number]['key'], numb
|
|
|
37
39
|
* @returns The compact count string.
|
|
38
40
|
*/
|
|
39
41
|
export declare function formatTokens(count: number): string;
|
|
42
|
+
/** Center `text` in `width` cells (plain spaces, no ANSI). Exported for
|
|
43
|
+
* ContextBarView's JSX used-segment labels. */
|
|
44
|
+
export declare function centeredText(text: string, width: number): string;
|
|
45
|
+
/** Pick the longest label that fits `width` cells. Exported for
|
|
46
|
+
* ContextBarView's JSX segments (same fallback ladder as the ANSI path). */
|
|
47
|
+
export declare function chooseLabel(labels: readonly string[], width: number): string;
|
|
48
|
+
/**
|
|
49
|
+
* Compose the free segment's plain text: the `free` label centered, the
|
|
50
|
+
* usage readout right-aligned into whatever width remains. Shared by the
|
|
51
|
+
* ANSI string path (renderContextBar) and the hoverable JSX bar
|
|
52
|
+
* (ContextBarView) so both render pixel-identical content.
|
|
53
|
+
*/
|
|
54
|
+
export declare function composeFreeSegmentText(options: readonly string[], width: number): string;
|
|
55
|
+
/** Give every visible used segment at least one column before sharing the
|
|
56
|
+
* rest. Exported for ContextBarView (hoverable JSX twin of the bar). */
|
|
57
|
+
export declare function allocateBarColumns(values: readonly number[], width: number): number[];
|
|
40
58
|
/**
|
|
41
59
|
* The segmented context bar: used segments by content type, the remainder as
|
|
42
60
|
* a light free segment whose right edge carries the usage readout
|
|
@@ -51,6 +69,21 @@ export declare function renderContextBar(segments: ContextSegments, usedTokens:
|
|
|
51
69
|
freeFill: string;
|
|
52
70
|
freeText: string;
|
|
53
71
|
}): string;
|
|
72
|
+
/** Pressure-colored text: green below 80%, amber ≥ 80, red ≥ 95.
|
|
73
|
+
* @param pct - Context occupancy percent (0–100+).
|
|
74
|
+
* @param text - Text to color.
|
|
75
|
+
* @returns The ANSI 24-bit color-wrapped text.
|
|
76
|
+
*/
|
|
77
|
+
export declare function pressureColor(pct: number, text: string): string;
|
|
78
|
+
/** Compact 1/8-cell context gauge for the footer's ctx field on hover:
|
|
79
|
+
* `▕██████▋···▏`, fill proportional to context occupancy, colored by the
|
|
80
|
+
* amber/red pressure thresholds. Same block ramp as the TPS gauge.
|
|
81
|
+
* @param usedTokens - Total context tokens in use.
|
|
82
|
+
* @param contextWindow - Context window size in tokens.
|
|
83
|
+
* @param width - Gauge width in terminal columns (fill cells, brackets excluded).
|
|
84
|
+
* @returns The ANSI gauge string, or '' for a non-positive window.
|
|
85
|
+
*/
|
|
86
|
+
export declare function renderMiniContextBar(usedTokens: number, contextWindow: number, width?: number): string;
|
|
54
87
|
/** Speed color: green ≥ 50, yellow ≥ 20, red below (pi-tps-meter).
|
|
55
88
|
* @param tps - Tokens per second; selects the color threshold.
|
|
56
89
|
* @param text - Text to color.
|
|
@@ -83,5 +116,4 @@ export declare function tpsStats(samples: readonly {
|
|
|
83
116
|
mean: number;
|
|
84
117
|
p95: number;
|
|
85
118
|
};
|
|
86
|
-
export {};
|
|
87
119
|
//# sourceMappingURL=StatusMetrics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusMetrics.d.ts","sourceRoot":"","sources":["../../../src/screens/StatusMetrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;
|
|
1
|
+
{"version":3,"file":"StatusMetrics.d.ts","sourceRoot":"","sources":["../../../src/screens/StatusMetrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;6DAG6D;AAC7D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;EAMhB,CAAA;AAEV,yFAAyF;AACzF,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAA;AAsBnF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlD;AAID;gDACgD;AAChD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAMhE;AAED;6EAC6E;AAC7E,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAK5E;AA4BD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,KAAK,EAAE,MAAM,GACZ,MAAM,CAmBR;AA+BD;yEACyE;AACzE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBrF;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC9C,MAAM,CAkBR;AASD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,KAAK,SAAK,GACT,MAAM,CAaR;AAYD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG5D;AAYD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAYhE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,MAAM,CAqB9E;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG;IACxF,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACZ,CAUA"}
|