@deepseek-harness-tui/dsh-tui 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -16
- package/bin/dsh-tui.js +46 -3
- package/cli/adapters/dsh/index.mjs +2 -2
- package/guide/dsh-tui-guide/cli.en.md +1 -1
- package/guide/dsh-tui-guide/cli.md +1 -1
- package/guide/dsh-tui-guide/codex-backend.en.md +2 -2
- package/guide/dsh-tui-guide/codex-backend.md +2 -2
- package/guide/dsh-tui-guide/configuration.en.md +8 -2
- package/guide/dsh-tui-guide/configuration.md +8 -2
- package/guide/dsh-tui-guide/getting-started.en.md +174 -6
- package/guide/dsh-tui-guide/getting-started.md +125 -15
- package/guide/dsh-tui-guide/interaction.en.md +30 -8
- package/guide/dsh-tui-guide/interaction.md +18 -5
- package/guide/dsh-tui-guide/plugins.en.md +28 -7
- package/guide/dsh-tui-guide/plugins.md +18 -5
- package/guide/dsh-tui-guide/user-guide.en.md +32 -17
- package/guide/dsh-tui-guide/user-guide.md +23 -12
- package/lib/settings.json +3 -3
- package/lib/types/adapter/channel/ui-policy.d.ts +1 -0
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +1 -0
- package/lib/types/adapter/ports/channel-ui.d.ts +10 -2
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +31 -5
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/standard/grants.d.ts +60 -0
- package/lib/types/adapter/standard/grants.d.ts.map +1 -1
- package/lib/types/adapter/standard/grants.js +74 -0
- package/lib/types/agent/events.d.ts +16 -3
- package/lib/types/agent/events.d.ts.map +1 -1
- package/lib/types/agent/session.d.ts +5 -0
- package/lib/types/agent/session.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/core.d.ts +2 -2
- package/lib/types/backends/claude/translate/core.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/core.js +10 -6
- package/lib/types/backends/codex/session/commands.d.ts +2 -0
- package/lib/types/backends/codex/session/commands.d.ts.map +1 -1
- package/lib/types/backends/codex/session/commands.js +8 -4
- package/lib/types/backends/codex/session/input.d.ts +11 -7
- package/lib/types/backends/codex/session/input.d.ts.map +1 -1
- package/lib/types/backends/codex/session/input.js +68 -15
- package/lib/types/backends/codex/session/session.d.ts.map +1 -1
- package/lib/types/backends/codex/session/session.js +2 -3
- package/lib/types/channel/projection.d.ts.map +1 -1
- package/lib/types/channel/projection.js +78 -10
- package/lib/types/channel/questions.d.ts +19 -3
- package/lib/types/channel/questions.d.ts.map +1 -1
- package/lib/types/channel/sanitize.d.ts.map +1 -1
- package/lib/types/channel/sanitize.js +8 -4
- package/lib/types/channel/subagent-failure.d.ts +49 -0
- package/lib/types/channel/subagent-failure.d.ts.map +1 -0
- package/lib/types/channel/subagent-failure.js +59 -0
- package/lib/types/channel/transcript.d.ts +17 -0
- package/lib/types/channel/transcript.d.ts.map +1 -1
- package/lib/types/channel/transcript.js +35 -0
- package/lib/types/commands.js +2 -2
- package/lib/types/components/GoalTodoPanel.d.ts +71 -6
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +165 -17
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +14 -9
- package/lib/types/components/PluginGrantList.d.ts +45 -0
- package/lib/types/components/PluginGrantList.d.ts.map +1 -0
- package/lib/types/components/PluginGrantList.js +126 -0
- package/lib/types/components/PluginInstallPane.d.ts.map +1 -1
- package/lib/types/components/PluginInstallPane.js +35 -6
- package/lib/types/components/PluginManagePane.d.ts.map +1 -1
- package/lib/types/components/PluginManagePane.js +65 -8
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +63 -8
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +17 -1
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +12 -0
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +16 -7
- package/lib/types/components/onboardingModel.d.ts +2 -2
- package/lib/types/components/onboardingModel.js +3 -3
- package/lib/types/components/onboardingProviderPlan.d.ts +110 -0
- package/lib/types/components/onboardingProviderPlan.d.ts.map +1 -0
- package/lib/types/components/onboardingProviderPlan.js +78 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +5 -8
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +7 -4
- package/lib/types/components/questions/PlanReviewPanel.d.ts +3 -6
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/revealScope.d.ts +15 -0
- package/lib/types/components/revealScope.d.ts.map +1 -0
- package/lib/types/components/revealScope.js +17 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +41 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.js +123 -6
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +9 -2
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +7 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +9 -2
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts +30 -0
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.js +94 -0
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
- package/lib/types/components/sidePanel/builtinPanels.js +14 -2
- package/lib/types/components/sidePanel/types.d.ts +2 -0
- package/lib/types/components/sidePanel/types.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.js +15 -1
- package/lib/types/components/smoothReveal.d.ts +36 -6
- package/lib/types/components/smoothReveal.d.ts.map +1 -1
- package/lib/types/components/smoothReveal.js +92 -21
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +4 -14
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +26 -17
- package/lib/types/dsh-adapter/backend/session.d.ts +7 -1
- package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/session.js +74 -6
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +15 -6
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.js +3 -1
- package/lib/types/dsh-adapter/channel/attached-context.d.ts +15 -2
- package/lib/types/dsh-adapter/channel/attached-context.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/attached-context.js +26 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +3 -0
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +43 -2
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +2 -0
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +10 -2
- package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-mentions.js +22 -7
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +3 -7
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.js +16 -6
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +6 -0
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +35 -1
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +3 -7
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +6 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.js +3 -26
- package/lib/types/dsh-adapter/channel/emitter.js +1 -1
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/extensions.js +8 -0
- package/lib/types/dsh-adapter/channel/input-actions.d.ts +4 -4
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-actions.js +59 -5
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +3 -7
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +21 -8
- package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mentions.js +21 -7
- package/lib/types/dsh-adapter/channel/model-actions.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +26 -9
- package/lib/types/dsh-adapter/channel/model-selection.d.ts +27 -2
- package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-selection.js +81 -37
- package/lib/types/dsh-adapter/channel/model-switch.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/paths.js +11 -9
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.js +6 -1
- package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.js +3 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +10 -3
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +9 -3
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +11 -5
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +6 -3
- package/lib/types/dsh-adapter/channel/transcript.d.ts +3 -2
- package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/transcript.js +13 -4
- package/lib/types/dsh-adapter/channel/types.d.ts +11 -2
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.d.ts +27 -3
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +47 -5
- package/lib/types/dsh-adapter/entry-slot.d.ts +6 -0
- package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -1
- package/lib/types/dsh-adapter/experimental-bundles.d.ts +3 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -1
- package/lib/types/dsh-adapter/experimental-bundles.js +4 -0
- package/lib/types/dsh-adapter/fresh-agent.d.ts +1 -1
- package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -1
- package/lib/types/dsh-adapter/fresh-agent.js +60 -11
- package/lib/types/dsh-adapter/grant-file.d.ts +70 -0
- package/lib/types/dsh-adapter/grant-file.d.ts.map +1 -0
- package/lib/types/dsh-adapter/grant-file.js +178 -0
- package/lib/types/dsh-adapter/host-access.d.ts +4 -0
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +114 -15
- package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
- package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-contract.js +5 -3
- package/lib/types/dsh-adapter/host-dsh.d.ts +0 -8
- package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-dsh.js +27 -6
- package/lib/types/dsh-adapter/host-entry.js +4 -0
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +8 -5
- package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/profiles.js +14 -1
- package/lib/types/dsh-adapter/panels.d.ts +7 -1
- package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-declaration.d.ts +28 -0
- package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-declaration.js +43 -1
- package/lib/types/dsh-adapter/plugin-install.d.ts +28 -1
- package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-install.js +160 -13
- package/lib/types/dsh-adapter/plugin-manage.d.ts +53 -10
- package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-manage.js +240 -51
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +203 -58
- package/lib/types/dsh-adapter/plugins-info.d.ts +6 -7
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +34 -21
- package/lib/types/dsh-adapter/presets.d.ts +41 -10
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +59 -12
- package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
- package/lib/types/dsh-adapter/process-exit.js +1 -1
- package/lib/types/dsh-adapter/providerWizard.d.ts +2 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +11 -5
- package/lib/types/dsh-adapter/questions.d.ts +3 -4
- package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/questions.js +1 -1
- package/lib/types/dsh-adapter/row-attachment.d.ts +30 -0
- package/lib/types/dsh-adapter/row-attachment.d.ts.map +1 -0
- package/lib/types/dsh-adapter/row-attachment.js +29 -0
- package/lib/types/dsh-adapter/session-list-metadata.js +2 -2
- package/lib/types/dsh-adapter/subagents.d.ts +5 -0
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +22 -1
- package/lib/types/dsh-adapter/team-mode.d.ts +17 -10
- package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
- package/lib/types/dsh-adapter/team-mode.js +19 -12
- package/lib/types/dsh-adapter/tool-scope.d.ts +24 -0
- package/lib/types/dsh-adapter/tool-scope.d.ts.map +1 -0
- package/lib/types/dsh-adapter/tool-scope.js +127 -0
- package/lib/types/dsh-adapter/types.d.ts +2 -1
- package/lib/types/dsh-adapter/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/worktree-tool.d.ts +27 -0
- package/lib/types/dsh-adapter/worktree-tool.d.ts.map +1 -0
- package/lib/types/dsh-adapter/worktree-tool.js +87 -0
- package/lib/types/heldInputs.d.ts +75 -0
- package/lib/types/heldInputs.d.ts.map +1 -0
- package/lib/types/heldInputs.js +409 -0
- package/lib/types/i18n.d.ts +577 -34
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +230 -22
- package/lib/types/ink/components/App.d.ts +2 -0
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +8 -0
- package/lib/types/ink/events/input-event.d.ts.map +1 -1
- package/lib/types/ink/events/input-event.js +7 -6
- package/lib/types/ink/hit-test.d.ts +2 -0
- package/lib/types/ink/hit-test.d.ts.map +1 -1
- package/lib/types/ink/hit-test.js +10 -0
- package/lib/types/ink/hooks/use-program-status.d.ts +1 -1
- package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-program-status.js +3 -2
- package/lib/types/ink/ink.d.ts +1 -0
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +5 -2
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +25 -0
- package/lib/types/ink/terminal.d.ts +13 -2
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +29 -5
- package/lib/types/onboardingDraft.d.ts +143 -0
- package/lib/types/onboardingDraft.d.ts.map +1 -0
- package/lib/types/onboardingDraft.js +71 -0
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +133 -32
- package/lib/types/screens/Onboarding.d.ts +22 -3
- package/lib/types/screens/Onboarding.d.ts.map +1 -1
- package/lib/types/screens/Onboarding.js +606 -36
- package/lib/types/screens/SessionSupervisor.d.ts +3 -6
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +5 -8
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +1 -2
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +2 -2
- package/lib/types/screens/sessionSupervisor/model.d.ts +1 -1
- package/lib/types/screens/sessionSupervisor/model.js +1 -1
- package/lib/types/sessionMounts.d.ts +12 -5
- package/lib/types/sessionMounts.d.ts.map +1 -1
- package/lib/types/sessionMounts.js +33 -6
- package/lib/types/settings/definitions.js +2 -2
- package/lib/types/update.d.ts +412 -20
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +2094 -193
- package/lib/types/updateHost.d.ts +198 -0
- package/lib/types/updateHost.d.ts.map +1 -0
- package/lib/types/updateHost.js +608 -0
- package/lib/types/utils/paths.d.ts +15 -0
- package/lib/types/utils/paths.d.ts.map +1 -1
- package/lib/types/utils/paths.js +25 -0
- package/lib/types/utils/processName.d.ts +16 -0
- package/lib/types/utils/processName.d.ts.map +1 -0
- package/lib/types/utils/processName.js +27 -0
- package/package.json +114 -108
- package/tui-profile/feed/README.md +1 -1
- package/tui-profile/feed/first-party.json +1 -1
package/lib/types/commands.js
CHANGED
|
@@ -56,7 +56,7 @@ export const LOCAL_COMMANDS = [
|
|
|
56
56
|
{ name: 'config', description: 'Show the dsh-tui configuration source' },
|
|
57
57
|
{ name: 'reload', description: 'Reload preference files from disk and apply live' },
|
|
58
58
|
{ name: 'settings', description: 'View and edit plugin settings' },
|
|
59
|
-
{ name: 'setup', description: 'Re-run the first-run guide (
|
|
59
|
+
{ name: 'setup', description: 'Re-run the first-run guide (accounts + models / language + theme / model + workspace / shortcuts)' },
|
|
60
60
|
{ name: 'star', description: 'Star this project on GitHub (one-key via the gh CLI)' },
|
|
61
61
|
{ name: 'doctor', description: 'Run environment checks' },
|
|
62
62
|
{ name: 'migrate', description: 'Import conversations from other coding agents (claude-code / codex / omp / zcode / grok-build)' },
|
|
@@ -85,7 +85,7 @@ export const LOCAL_COMMANDS = [
|
|
|
85
85
|
{ name: 'mcp', description: 'Show MCP status' },
|
|
86
86
|
{ name: 'skills', description: 'List available skills' },
|
|
87
87
|
{ name: 'plugin', description: 'Show plugin diagnostics, added plugins, and switchable experimental features' },
|
|
88
|
-
{ name: 'update', description: '
|
|
88
|
+
{ name: 'update', description: 'Align the TUI, dsh engine and global launcher, then restart' },
|
|
89
89
|
// Skills are discovered through the DSH registry and added at runtime.
|
|
90
90
|
// A local entry of the same name would win the collision filter.
|
|
91
91
|
// Misc / not applicable on this leaf
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ChannelUi as Channel } from '../adapter/channel/ui-policy.js';
|
|
3
|
-
import type { ChannelGoal } from '../dsh-adapter/channel.js';
|
|
3
|
+
import type { ChannelGoal, TodoPanelItem } from '../dsh-adapter/channel.js';
|
|
4
4
|
/**
|
|
5
5
|
* Compact goal chip for the status footer: phase glyph + rounds (a goal a
|
|
6
6
|
* backend budgets by tokens: tokens used / budget instead), colored by
|
|
@@ -11,6 +11,67 @@ export declare function GoalStatusChip({ goal, minimal }: {
|
|
|
11
11
|
goal: ChannelGoal;
|
|
12
12
|
minimal?: boolean;
|
|
13
13
|
}): React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* 面板内容宽:面板宽减去左右 padding 各 1。所有折行/截断都以显示单元
|
|
16
|
+
* 宽(stringWidth)为准,不用 JS 字符串长度。
|
|
17
|
+
*/
|
|
18
|
+
export declare function goalPanelContentWidth(width: number): number;
|
|
19
|
+
/** 目标折行宽:去掉首行 glyph 前缀,再留 1 格余量防 ink 二次折行。 */
|
|
20
|
+
export declare function goalObjectiveWidth(contentWidth: number): number;
|
|
21
|
+
/** blocked 原因折行宽:去掉竖线前缀,同样留 1 格余量。 */
|
|
22
|
+
export declare function goalBlockedWidth(contentWidth: number): number;
|
|
23
|
+
/** todo 折行:单条最多 2 行,超出部分拼回一行截断加省略号(现状语义)。 */
|
|
24
|
+
export declare function wrapTodoLines(content: string, width: number): string[];
|
|
25
|
+
/**
|
|
26
|
+
* panel 形态的逐行模型:拍平成「每行恰好一个终端行」,渲染时只切可视
|
|
27
|
+
* 窗口(D-5:不用 ScrollBox——内容平移会让折叠头的点击命中错位)。
|
|
28
|
+
* 纯函数、无 React:回归直接断言同一份行模型,避免「渲染一套、断言另一套」。
|
|
29
|
+
*/
|
|
30
|
+
export type GoalPanelRow = {
|
|
31
|
+
readonly kind: 'objective';
|
|
32
|
+
readonly text: string;
|
|
33
|
+
readonly first: boolean;
|
|
34
|
+
readonly softWrapContinuation?: number;
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: 'status';
|
|
37
|
+
}
|
|
38
|
+
/** blocked 前的空行(与 default 形态的 marginTop 对应)。 */
|
|
39
|
+
| {
|
|
40
|
+
readonly kind: 'gap';
|
|
41
|
+
} | {
|
|
42
|
+
readonly kind: 'blocked';
|
|
43
|
+
readonly text: string;
|
|
44
|
+
readonly softWrapContinuation?: number;
|
|
45
|
+
}
|
|
46
|
+
/** ✓ done/total 折叠头(折叠时同一行带预览)。 */
|
|
47
|
+
| {
|
|
48
|
+
readonly kind: 'header';
|
|
49
|
+
} | {
|
|
50
|
+
readonly kind: 'todo';
|
|
51
|
+
readonly text: string;
|
|
52
|
+
readonly status: TodoPanelItem['status'];
|
|
53
|
+
readonly first: boolean;
|
|
54
|
+
readonly last: boolean;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* panel 形态的行模型:目标/状态/blocked/折叠头/todo 全部拍平成逐行数据。
|
|
58
|
+
* 面板可滚动,因此 todo 不再按高度截断(没有 `…N more`)——所有条目都
|
|
59
|
+
* 进入模型,渲染时只挂载视口内的行。折叠时只保留固定行。
|
|
60
|
+
*/
|
|
61
|
+
export declare function buildGoalPanelRows(input: {
|
|
62
|
+
goal: ChannelGoal | undefined;
|
|
63
|
+
todos: readonly TodoPanelItem[];
|
|
64
|
+
showTodoSection: boolean;
|
|
65
|
+
collapsed: boolean;
|
|
66
|
+
contentWidth: number;
|
|
67
|
+
todoWidth: number;
|
|
68
|
+
}): GoalPanelRow[];
|
|
69
|
+
/** panel 视口行数:height 含顶部 padding(height>1 时占 1 行;缺省不窗口化)。 */
|
|
70
|
+
export declare function goalPanelViewportRows(height: number | undefined): number;
|
|
71
|
+
/** panel 形态的滚动句柄:adapter 只把键交进来,不复制折行/窗口。 */
|
|
72
|
+
export interface GoalTodoPanelScrollHandle {
|
|
73
|
+
scrollBy(delta: number): void;
|
|
74
|
+
}
|
|
14
75
|
/**
|
|
15
76
|
* Live goal + todo panel above the prompt input. Data rides on the channel:
|
|
16
77
|
* `channel.goal` is folded from `goal/change` context events and
|
|
@@ -29,7 +90,7 @@ export declare function GoalStatusChip({ goal, minimal }: {
|
|
|
29
90
|
* id first appears, frozen on completion) — deliberately not derived from
|
|
30
91
|
* session-event timestamps.
|
|
31
92
|
*/
|
|
32
|
-
export declare function GoalTodoPanel({ channel, collapsed, onToggle, idleDismissal, variant, visible,
|
|
93
|
+
export declare function GoalTodoPanel({ channel, collapsed, onToggle, idleDismissal, variant, visible, wrapWidth, width, height, scrollRef, }: {
|
|
33
94
|
channel: Channel;
|
|
34
95
|
/** Fold the whole todo section to its summary header line. */
|
|
35
96
|
collapsed?: boolean;
|
|
@@ -43,11 +104,15 @@ export declare function GoalTodoPanel({ channel, collapsed, onToggle, idleDismis
|
|
|
43
104
|
/** 侧栏 visible 契约:非 active Panel 时 false——暂停本地计时,
|
|
44
105
|
* store(channel.goal/todos)照常更新,重新打开直接读最新值。 */
|
|
45
106
|
visible?: boolean;
|
|
46
|
-
/** 覆盖 MAX_TODOS(panel variant 按宿主高度传入)。 */
|
|
47
|
-
maxTodos?: number;
|
|
48
107
|
/** panel variant:todo 行按此宽度折行——单条最多 2 行,超出部分截断
|
|
49
|
-
*
|
|
50
|
-
*
|
|
108
|
+
* 加省略号;全部条目都进入行模型,靠滚动查看。缺省(default 形态)
|
|
109
|
+
* 不折行,保持单行 truncate 的 chat 页现状。 */
|
|
51
110
|
wrapWidth?: number;
|
|
111
|
+
/** panel variant:面板宽(含左右 padding)。缺省时按 wrapWidth 反推。 */
|
|
112
|
+
width?: number;
|
|
113
|
+
/** panel variant:面板高(含顶部 padding)。缺省时不窗口化(直接挂载)。 */
|
|
114
|
+
height?: number;
|
|
115
|
+
/** panel variant:滚动句柄(adapter 的 ↑/↓ 与滚轮走这里)。 */
|
|
116
|
+
scrollRef?: React.Ref<GoalTodoPanelScrollHandle>;
|
|
52
117
|
}): React.ReactNode;
|
|
53
118
|
//# sourceMappingURL=GoalTodoPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoalTodoPanel.d.ts","sourceRoot":"","sources":["../../../src/components/GoalTodoPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"GoalTodoPanel.d.ts","sourceRoot":"","sources":["../../../src/components/GoalTodoPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAwC3E;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,OAAe,EAAE,EAAE;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CASnH;AA2DD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,8CAA8C;AAC9C,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,sCAAsC;AACtC,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,6CAA6C;AAC7C,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAItE;AAED;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AC7C,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAiB,EACjB,QAAQ,EACR,aAAqB,EACrB,OAAmB,EACnB,OAAc,EACd,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,GACV,EAAE;IACD,OAAO,EAAE,OAAO,CAAA;IAChB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;8CAC0C;IAC1C,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC7B;oDACgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;wCAEoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gDAAgD;IAChD,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAA;CACjD,GAAG,KAAK,CAAC,SAAS,CAoUlB"}
|
|
@@ -51,9 +51,9 @@ export function GoalStatusChip({ goal, minimal = false }) {
|
|
|
51
51
|
function PhaseBadge({ phase, roundsStarted, maxGoalRounds, budget, elapsed, }) {
|
|
52
52
|
const color = phaseColor(phase);
|
|
53
53
|
if (budget !== undefined) {
|
|
54
|
-
return (_jsxs(Text, { color: color, dimColor: phase === 'complete', children: [PHASE_LABEL[phase], " \u00B7 ", formatGoalBudget(budget)] }));
|
|
54
|
+
return (_jsxs(Text, { color: color, dimColor: phase === 'complete', wrap: "truncate", children: [PHASE_LABEL[phase], " \u00B7 ", formatGoalBudget(budget)] }));
|
|
55
55
|
}
|
|
56
|
-
return (_jsxs(Text, { color: color, dimColor: phase === 'complete', children: [PHASE_LABEL[phase], " \u00B7 ", roundsStarted, "/", maxGoalRounds, elapsed !== undefined ? ` · ${elapsed}` : ''] }));
|
|
56
|
+
return (_jsxs(Text, { color: color, dimColor: phase === 'complete', wrap: "truncate", children: [PHASE_LABEL[phase], " \u00B7 ", roundsStarted, "/", maxGoalRounds, elapsed !== undefined ? ` · ${elapsed}` : ''] }));
|
|
57
57
|
}
|
|
58
58
|
function TodoGlyph({ status }) {
|
|
59
59
|
switch (status) {
|
|
@@ -73,6 +73,91 @@ function TodoGlyph({ status }) {
|
|
|
73
73
|
function BranchPrefix({ last }) {
|
|
74
74
|
return _jsx(Text, { dimColor: true, children: last ? '└─ ' : '├─ ' });
|
|
75
75
|
}
|
|
76
|
+
/** 目标首行前缀;display width 运行时算(emoji 宽度随终端数据源变化)。 */
|
|
77
|
+
const GOAL_GLYPH = '🎯 ';
|
|
78
|
+
/** blocked 原因行前缀(与 §16 的树形装饰同宽)。 */
|
|
79
|
+
const BLOCKED_BAR = '│ ';
|
|
80
|
+
/**
|
|
81
|
+
* 面板内容宽:面板宽减去左右 padding 各 1。所有折行/截断都以显示单元
|
|
82
|
+
* 宽(stringWidth)为准,不用 JS 字符串长度。
|
|
83
|
+
*/
|
|
84
|
+
export function goalPanelContentWidth(width) {
|
|
85
|
+
return Math.max(4, width - 2);
|
|
86
|
+
}
|
|
87
|
+
/** 目标折行宽:去掉首行 glyph 前缀,再留 1 格余量防 ink 二次折行。 */
|
|
88
|
+
export function goalObjectiveWidth(contentWidth) {
|
|
89
|
+
return Math.max(4, contentWidth - stringWidth(GOAL_GLYPH) - 1);
|
|
90
|
+
}
|
|
91
|
+
/** blocked 原因折行宽:去掉竖线前缀,同样留 1 格余量。 */
|
|
92
|
+
export function goalBlockedWidth(contentWidth) {
|
|
93
|
+
return Math.max(4, contentWidth - stringWidth(BLOCKED_BAR) - 1);
|
|
94
|
+
}
|
|
95
|
+
/** todo 折行:单条最多 2 行,超出部分拼回一行截断加省略号(现状语义)。 */
|
|
96
|
+
export function wrapTodoLines(content, width) {
|
|
97
|
+
const wrapped = wrapTextLines(content, width).map(line => line.text);
|
|
98
|
+
if (wrapped.length <= 2)
|
|
99
|
+
return wrapped;
|
|
100
|
+
return [wrapped[0], wrapText(wrapped.slice(1).join(''), width, 'truncate')];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* panel 形态的行模型:目标/状态/blocked/折叠头/todo 全部拍平成逐行数据。
|
|
104
|
+
* 面板可滚动,因此 todo 不再按高度截断(没有 `…N more`)——所有条目都
|
|
105
|
+
* 进入模型,渲染时只挂载视口内的行。折叠时只保留固定行。
|
|
106
|
+
*/
|
|
107
|
+
export function buildGoalPanelRows(input) {
|
|
108
|
+
const { goal, todos, showTodoSection, collapsed, contentWidth, todoWidth } = input;
|
|
109
|
+
const rows = [];
|
|
110
|
+
if (goal !== undefined) {
|
|
111
|
+
const objectiveWidth = goalObjectiveWidth(contentWidth);
|
|
112
|
+
const objectiveLines = wrapTextLines(goal.objective, objectiveWidth);
|
|
113
|
+
objectiveLines.forEach((line, index) => {
|
|
114
|
+
rows.push({
|
|
115
|
+
kind: 'objective', text: line.text, first: index === 0,
|
|
116
|
+
// Signed content-end column is the renderer's copy contract: a
|
|
117
|
+
// negative value restores the separator omitted at an exact fill.
|
|
118
|
+
softWrapContinuation: line.continuation
|
|
119
|
+
? (line.gap ? -1 : 1) * (stringWidth(GOAL_GLYPH) + stringWidth(objectiveLines[index - 1].text))
|
|
120
|
+
: undefined,
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
rows.push({ kind: 'status' });
|
|
124
|
+
if (goal.phase === 'blocked' && goal.blockedReason !== undefined) {
|
|
125
|
+
rows.push({ kind: 'gap' });
|
|
126
|
+
const blockedLines = wrapTextLines(goal.blockedReason.message, goalBlockedWidth(contentWidth));
|
|
127
|
+
blockedLines.forEach((line, index) => {
|
|
128
|
+
rows.push({
|
|
129
|
+
kind: 'blocked', text: line.text,
|
|
130
|
+
softWrapContinuation: line.continuation
|
|
131
|
+
? (line.gap ? -1 : 1) * (stringWidth(BLOCKED_BAR) + stringWidth(blockedLines[index - 1].text))
|
|
132
|
+
: undefined,
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (showTodoSection)
|
|
138
|
+
rows.push({ kind: 'header' });
|
|
139
|
+
if (!showTodoSection || collapsed)
|
|
140
|
+
return rows;
|
|
141
|
+
// 全部 todo 进入模型(D-9 修订:可滚动后不再用 `…N more` 隐藏条目)。
|
|
142
|
+
// 视口只挂载 slice 出来的行,列表再长也不会撑破盒高。
|
|
143
|
+
todos.forEach((todo, index) => {
|
|
144
|
+
const last = index === todos.length - 1;
|
|
145
|
+
wrapTodoLines(todo.content, todoWidth).forEach((text, lineIndex) => {
|
|
146
|
+
rows.push({
|
|
147
|
+
kind: 'todo',
|
|
148
|
+
text,
|
|
149
|
+
status: todo.status,
|
|
150
|
+
first: lineIndex === 0,
|
|
151
|
+
last,
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
return rows;
|
|
156
|
+
}
|
|
157
|
+
/** panel 视口行数:height 含顶部 padding(height>1 时占 1 行;缺省不窗口化)。 */
|
|
158
|
+
export function goalPanelViewportRows(height) {
|
|
159
|
+
return height === undefined ? Number.POSITIVE_INFINITY : Math.max(1, height - (height > 1 ? 1 : 0));
|
|
160
|
+
}
|
|
76
161
|
/**
|
|
77
162
|
* Live goal + todo panel above the prompt input. Data rides on the channel:
|
|
78
163
|
* `channel.goal` is folded from `goal/change` context events and
|
|
@@ -91,10 +176,14 @@ function BranchPrefix({ last }) {
|
|
|
91
176
|
* id first appears, frozen on completion) — deliberately not derived from
|
|
92
177
|
* session-event timestamps.
|
|
93
178
|
*/
|
|
94
|
-
export function GoalTodoPanel({ channel, collapsed = false, onToggle, idleDismissal = false, variant = 'default', visible = true,
|
|
179
|
+
export function GoalTodoPanel({ channel, collapsed = false, onToggle, idleDismissal = false, variant = 'default', visible = true, wrapWidth, width, height, scrollRef, }) {
|
|
95
180
|
const goal = channel.goal;
|
|
96
181
|
const objectiveRef = React.useRef(null);
|
|
97
182
|
const goalTooltip = useTooltip(() => {
|
|
183
|
+
// panel 形态目标完整可见、滚动就是全文入口——不挂 hover 全文(D-7);
|
|
184
|
+
// default 形态(chat 页底部 chrome)的 tooltip 原样保留。
|
|
185
|
+
if (variant === 'panel')
|
|
186
|
+
return '';
|
|
98
187
|
const width = objectiveRef.current?.yogaNode?.getComputedWidth() ?? 0;
|
|
99
188
|
if (goal === undefined || width <= 0)
|
|
100
189
|
return '';
|
|
@@ -152,21 +241,83 @@ export function GoalTodoPanel({ channel, collapsed = false, onToggle, idleDismis
|
|
|
152
241
|
const anyUnfinished = allTodos.some(todo => todo.status !== 'completed');
|
|
153
242
|
const showTodoSection = allTodos.length > 0 &&
|
|
154
243
|
(channel.working || anyUnfinished || goal !== undefined || variant === 'panel');
|
|
244
|
+
// ── panel 几何 / 滚动(default 形态不读这些值) ─────────────────────────
|
|
245
|
+
// 宽度、折行与视口全部按显示单元计;直接挂载(缺省 width/height)时退化
|
|
246
|
+
// 为不窗口化,行为与旧面板一致,夹具可以直接断言行模型。
|
|
247
|
+
const [scrollTop, setScrollTop] = React.useState(0);
|
|
248
|
+
const panelWidth = width ?? (wrapWidth !== undefined ? wrapWidth + 8 : 80);
|
|
249
|
+
const contentWidth = goalPanelContentWidth(panelWidth);
|
|
250
|
+
const todoWidth = wrapWidth !== undefined && wrapWidth > 4 ? wrapWidth : Math.max(10, panelWidth - 8);
|
|
251
|
+
const viewportRows = goalPanelViewportRows(height);
|
|
252
|
+
const panelRows = variant === 'panel'
|
|
253
|
+
? buildGoalPanelRows({ goal, todos, showTodoSection, collapsed, contentWidth, todoWidth })
|
|
254
|
+
: undefined;
|
|
255
|
+
const maxScroll = panelRows === undefined
|
|
256
|
+
? 0
|
|
257
|
+
: Math.max(0, panelRows.length - viewportRows);
|
|
258
|
+
// 渲染永远用 clamp 后的 top:state 短暂超过 maxScroll 也不会画出空白。
|
|
259
|
+
const top = Math.min(scrollTop, maxScroll);
|
|
260
|
+
const scrollBy = React.useCallback((delta) => {
|
|
261
|
+
// 折叠头可能被滚出视口,onMouseLeave 不再触发——这里主动清 hover 底色。
|
|
262
|
+
setHeaderHovered(false);
|
|
263
|
+
setScrollTop(current => Math.max(0, Math.min(maxScroll, current + delta)));
|
|
264
|
+
}, [maxScroll]);
|
|
265
|
+
React.useImperativeHandle(scrollRef, () => ({ scrollBy }), [scrollBy]);
|
|
266
|
+
// 切换会话或 goal 复位;同 id 的 revision 更新保留滚动位置。
|
|
267
|
+
React.useEffect(() => {
|
|
268
|
+
setScrollTop(0);
|
|
269
|
+
setHeaderHovered(false);
|
|
270
|
+
}, [channel.sessionId, goal?.id]);
|
|
271
|
+
// 内容变短 / 折叠 / resize:只收敛 offset,不强制归零。
|
|
272
|
+
React.useEffect(() => {
|
|
273
|
+
setScrollTop(current => Math.min(current, maxScroll));
|
|
274
|
+
}, [maxScroll]);
|
|
155
275
|
if (goal === undefined && !showTodoSection)
|
|
156
276
|
return null;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
//
|
|
161
|
-
//
|
|
277
|
+
// Collapsed preview: the live task when one runs, else the next open row.
|
|
278
|
+
const preview = allTodos.find(todo => todo.status === 'in_progress')
|
|
279
|
+
?? allTodos.find(todo => todo.status !== 'completed');
|
|
280
|
+
// 折叠头两种形态共用同一份结构/行为(点击、hover、▸/▾、✓ done/total、
|
|
281
|
+
// 折叠预览),避免面板形态与 chat 页形态漂移。
|
|
282
|
+
const foldHeader = (key) => (_jsxs(Box, { flexDirection: "row", height: 1, onClick: onToggle, onMouseEnter: () => setHeaderHovered(true), onMouseLeave: () => setHeaderHovered(false), backgroundColor: headerHovered ? 'userMessageBackgroundHover' : undefined, children: [_jsxs(Text, { dimColor: true, children: [collapsed ? '▸' : '▾', " "] }), _jsxs(Text, { dimColor: true, children: ["\u2713 ", doneCount, "/", allTodos.length] }), collapsed && preview !== undefined && (_jsx(Box, { flexGrow: 1, flexShrink: 1, marginLeft: 1, children: preview.status === 'in_progress' ? (_jsxs(Text, { wrap: "truncate", children: [_jsx(Text, { color: "suggestion", children: "\u25CF " }), preview.content] })) : (_jsxs(Text, { wrap: "truncate", dimColor: true, children: ["\u25CB ", preview.content] })) }))] }, key));
|
|
283
|
+
if (variant === 'panel' && panelRows !== undefined) {
|
|
284
|
+
const objectiveIndent = ' '.repeat(stringWidth(GOAL_GLYPH));
|
|
285
|
+
return (_jsx(Box, { ref: clockRef, flexDirection: "column", width: width, height: height, paddingLeft: 1, paddingRight: 1, paddingTop: height !== undefined && height > 1 ? 1 : 0, overflow: "hidden", onWheel: (event) => {
|
|
286
|
+
if (event.deltaY !== 0)
|
|
287
|
+
scrollBy(event.deltaY > 0 ? 1 : -1);
|
|
288
|
+
}, children: panelRows.slice(top, top + viewportRows).map((row, index) => {
|
|
289
|
+
switch (row.kind) {
|
|
290
|
+
case 'objective':
|
|
291
|
+
// 折行是渲染前预算好的(wrapTextLines),每行显式 height={1};
|
|
292
|
+
// 续行用等宽空格对齐首行正文。前提是终端与 stringWidth 对 🎯 的
|
|
293
|
+
// 宽度取法一致:终端把它记成 1 格时,首行正文会比续行左移一格
|
|
294
|
+
// (宽度表差异,面板侧无法同时对齐两种终端)。
|
|
295
|
+
return (_jsxs(Box, { flexDirection: "row", height: 1, softWrapContinuation: row.softWrapContinuation, children: [_jsx(Box, { noSelect: true, marginLeft: -1, paddingLeft: 1, children: _jsx(Text, { color: "suggestion", children: row.first ? GOAL_GLYPH : objectiveIndent }) }), _jsx(Text, { bold: true, wrap: "truncate", children: row.text })] }, index));
|
|
296
|
+
case 'status':
|
|
297
|
+
// 状态独占一行,不再和目标争宽(窄面板下 truncate 兜底)。
|
|
298
|
+
return (_jsx(Box, { flexDirection: "row", height: 1, children: _jsx(PhaseBadge, { phase: goal.phase, roundsStarted: goal.roundsStarted, maxGoalRounds: goal.maxGoalRounds, budget: goal.budget, elapsed: elapsed }) }, index));
|
|
299
|
+
case 'gap':
|
|
300
|
+
return _jsx(Box, { height: 1 }, index);
|
|
301
|
+
case 'blocked':
|
|
302
|
+
return (_jsxs(Box, { flexDirection: "row", height: 1, softWrapContinuation: row.softWrapContinuation, children: [_jsx(Box, { noSelect: true, marginLeft: -1, paddingLeft: 1, children: _jsx(Text, { dimColor: true, children: BLOCKED_BAR }) }), _jsx(Text, { color: "error", wrap: "truncate", children: row.text })] }, index));
|
|
303
|
+
case 'header':
|
|
304
|
+
return foldHeader(index);
|
|
305
|
+
case 'todo':
|
|
306
|
+
return (_jsxs(Box, { flexDirection: "row", height: 1, children: [row.first ? (_jsxs(_Fragment, { children: [_jsx(BranchPrefix, { last: row.last }), _jsx(TodoGlyph, { status: row.status })] })) : (_jsx(Text, { dimColor: true, children: row.last ? ' ' : '\u2502 ' })), _jsx(Text, { wrap: "truncate", dimColor: row.status === 'completed', children: row.text })] }, index));
|
|
307
|
+
}
|
|
308
|
+
}) }));
|
|
309
|
+
}
|
|
310
|
+
// ── default 形态的行预算(panel 形态渲染全部 todo,不走这段) ──
|
|
311
|
+
const budget = MAX_TODOS;
|
|
312
|
+
// 折行形态(宿主传 wrapWidth 时):每条 todo 占 1~2 行,预算按「行」
|
|
313
|
+
// 折算——放不下的整条让位给「…N more」,不撑破盒高。cap:折出 >2 行时
|
|
314
|
+
// 保留第一行、其余拼回一行截断加省略号(wrapText truncate)。
|
|
315
|
+
// 单行形态(chat 页现状):与原 slice 语义逐字节一致。
|
|
162
316
|
const display = [];
|
|
163
317
|
if (wrapWidth !== undefined && wrapWidth > 4) {
|
|
164
318
|
let used = 0;
|
|
165
319
|
for (const todo of todos) {
|
|
166
|
-
const
|
|
167
|
-
const lines = wrapped.length <= 2
|
|
168
|
-
? wrapped
|
|
169
|
-
: [wrapped[0], wrapText(wrapped.slice(1).join(''), wrapWidth, 'truncate')];
|
|
320
|
+
const lines = wrapTodoLines(todo.content, wrapWidth);
|
|
170
321
|
if (display.length > 0 && used + lines.length > budget)
|
|
171
322
|
break;
|
|
172
323
|
display.push({ todo, lines });
|
|
@@ -179,11 +330,8 @@ export function GoalTodoPanel({ channel, collapsed = false, onToggle, idleDismis
|
|
|
179
330
|
}
|
|
180
331
|
const visibleTodos = display;
|
|
181
332
|
const hidden = todos.length - display.length;
|
|
182
|
-
|
|
183
|
-
const preview = allTodos.find(todo => todo.status === 'in_progress')
|
|
184
|
-
?? allTodos.find(todo => todo.status !== 'completed');
|
|
185
|
-
return (_jsxs(Box, { ref: variant === 'panel' ? clockRef : undefined, flexDirection: "column", paddingLeft: variant === 'panel' ? 1 : 2, paddingRight: variant === 'panel' ? 1 : 2, paddingTop: 1, children: [goal !== undefined && (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", width: "100%", height: 1, children: [_jsx(Text, { color: "suggestion", children: "\uD83C\uDFAF " }), _jsx(Box, { ref: objectiveRef, flexGrow: 1, flexShrink: 1, ...goalTooltip, children: _jsx(Text, { bold: true, wrap: "truncate", children: goal.objective }) }), _jsx(Box, { flexShrink: 0, marginLeft: 1, children: _jsx(PhaseBadge, { phase: goal.phase, roundsStarted: goal.roundsStarted, maxGoalRounds: goal.maxGoalRounds, budget: goal.budget, elapsed: elapsed }) })] }), goal.phase === 'blocked' && goal.blockedReason !== undefined && (_jsxs(Box, { flexDirection: "row", marginTop: 1, height: 1, children: [_jsx(Text, { dimColor: true, children: "\u2502 " }), _jsx(Text, { color: "error", wrap: "truncate", children: goal.blockedReason.message })] }))] })), showTodoSection && (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", height: 1, onClick: onToggle, onMouseEnter: () => setHeaderHovered(true), onMouseLeave: () => setHeaderHovered(false), backgroundColor: headerHovered ? 'userMessageBackgroundHover' : undefined, children: [_jsxs(Text, { dimColor: true, children: [collapsed ? '▸' : '▾', " "] }), _jsxs(Text, { dimColor: true, children: ["\u2713 ", doneCount, "/", allTodos.length] }), collapsed && preview !== undefined && (_jsx(Box, { flexGrow: 1, flexShrink: 1, marginLeft: 1, children: preview.status === 'in_progress' ? (_jsxs(Text, { wrap: "truncate", children: [_jsx(Text, { color: "suggestion", children: "\u25CF " }), preview.content] })) : (_jsxs(Text, { wrap: "truncate", dimColor: true, children: ["\u25CB ", preview.content] })) }))] }), !collapsed && (_jsxs(Box, { flexDirection: "column", children: [visibleTodos.map((item, index) => {
|
|
333
|
+
return (_jsxs(Box, { flexDirection: "column", paddingLeft: 2, paddingRight: 2, paddingTop: 1, children: [goal !== undefined && (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", width: "100%", height: 1, children: [_jsx(Text, { color: "suggestion", children: GOAL_GLYPH }), _jsx(Box, { ref: objectiveRef, flexGrow: 1, flexShrink: 1, ...goalTooltip, children: _jsx(Text, { bold: true, wrap: "truncate", children: goal.objective }) }), _jsx(Box, { flexShrink: 0, marginLeft: 1, children: _jsx(PhaseBadge, { phase: goal.phase, roundsStarted: goal.roundsStarted, maxGoalRounds: goal.maxGoalRounds, budget: goal.budget, elapsed: elapsed }) })] }), goal.phase === 'blocked' && goal.blockedReason !== undefined && (_jsxs(Box, { flexDirection: "row", marginTop: 1, height: 1, children: [_jsx(Text, { dimColor: true, children: BLOCKED_BAR }), _jsx(Text, { color: "error", wrap: "truncate", children: goal.blockedReason.message })] }))] })), showTodoSection && (_jsxs(Box, { flexDirection: "column", children: [foldHeader(), !collapsed && (_jsxs(Box, { flexDirection: "column", children: [visibleTodos.map((item, index) => {
|
|
186
334
|
const last = index === visibleTodos.length - 1 && hidden === 0;
|
|
187
335
|
return item.lines.map((line, li) => (_jsxs(Box, { flexDirection: "row", height: 1, children: [li === 0 ? (_jsxs(_Fragment, { children: [_jsx(BranchPrefix, { last: last }), _jsx(TodoGlyph, { status: item.todo.status })] })) : (_jsx(Text, { dimColor: true, children: last ? ' ' : '\u2502 ' })), _jsx(Text, { wrap: "truncate", dimColor: item.todo.status === 'completed', children: line })] }, li)));
|
|
188
|
-
}), hidden > 0 && (_jsxs(Box, { flexDirection: "row", height: 1, children: [_jsx(BranchPrefix, { last: true }), _jsxs(Text, { dimColor: true, children: ["\u2026 ", hidden, " more"] })] })),
|
|
336
|
+
}), hidden > 0 && (_jsxs(Box, { flexDirection: "row", height: 1, children: [_jsx(BranchPrefix, { last: true }), _jsxs(Text, { dimColor: true, children: ["\u2026 ", hidden, " more"] })] })), _jsxs(Text, { dimColor: true, children: [" ", t(idleDismissal && !channel.working ? 'goal-todo-hide-hint' : 'goal-todo-fold-hint', { key: primaryComboString('todoFold') })] })] }))] }))] }));
|
|
189
337
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,EAA8B,KAAK,eAAe,EAAE,MAAM,UAAU,CAAA;AAE3E,OAAO,KAAK,EAAE,OAAO,EAA2E,MAAM,2BAA2B,CAAA;AAEjI,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAe/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAO3C,OAAO,EAAe,KAAK,gBAAgB,EAAqB,MAAM,yBAAyB,CAAA;AAC/F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,EAA8B,KAAK,eAAe,EAAE,MAAM,UAAU,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AAe,EACf,WAAW,EACX,OAAe,EACf,SAAiB,GAClB,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX;oEACgE;IAChE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,kDAAkD;IAClD,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;qEACiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,KAAK,CAAC,SAAS,CASlB"}
|
|
@@ -24,7 +24,8 @@ import { foldLongLines } from '../utils/fold-long-lines.js';
|
|
|
24
24
|
import { stringWidth } from '../ink/stringWidth.js';
|
|
25
25
|
import { truncateToWidth } from '../ink/truncateToWidth.js';
|
|
26
26
|
import { clipPreview } from '../ink/timeline-rail.js';
|
|
27
|
-
import { getRevealVersion, revealLengthOf, revealTextOf } from './smoothReveal.js';
|
|
27
|
+
import { getRevealVersion, revealLengthOf, revealTextOf, scopeRevealKey } from './smoothReveal.js';
|
|
28
|
+
import { useRevealScope } from './revealScope.js';
|
|
28
29
|
import { useRevealVersion } from '../hooks/useRevealVersion.js';
|
|
29
30
|
import { TranscriptImages } from './messages/TranscriptImages.js';
|
|
30
31
|
import { primaryComboString } from '../utils/keymap.js';
|
|
@@ -109,16 +110,16 @@ function reasoningRevealText(row, enabled) {
|
|
|
109
110
|
return revealTextOf(`r${row.id}`, row.text, { enabled, active: row.streaming === true });
|
|
110
111
|
}
|
|
111
112
|
/** Display length only (layout signature; no slice allocation). */
|
|
112
|
-
function revealDisplayLen(row, enabled) {
|
|
113
|
+
function revealDisplayLen(row, enabled, scope) {
|
|
113
114
|
if (row.kind === 'assistant') {
|
|
114
115
|
const stripped = assistantDisplayText(row);
|
|
115
|
-
return revealLengthOf(`a${row.id}
|
|
116
|
+
return revealLengthOf(scopeRevealKey(scope, `a${row.id}`), stripped, {
|
|
116
117
|
enabled,
|
|
117
118
|
active: row.streaming === true || row.fresh === true,
|
|
118
119
|
});
|
|
119
120
|
}
|
|
120
121
|
if (row.kind === 'reasoning') {
|
|
121
|
-
return revealLengthOf(`r${row.id}
|
|
122
|
+
return revealLengthOf(scopeRevealKey(scope, `r${row.id}`), row.text, { enabled, active: row.streaming === true });
|
|
122
123
|
}
|
|
123
124
|
return row.text.length;
|
|
124
125
|
}
|
|
@@ -305,6 +306,9 @@ function signatureParts(row, columns, expanded, expandedRows, streamViewToggledR
|
|
|
305
306
|
}
|
|
306
307
|
export function MessageList({ rows, expanded, expandedRows, selectedId, onToggleRow, streamViewToggledRows = NO_STREAM_VIEW_TOGGLED, onToggleStreamView = NOOP_TOGGLE_STREAM_VIEW, model, diffLayout = 'auto', thinkingFold = 'preview', jobGroupFold = 'auto', toolBackground = 'none', foldTerminalCommand = false, turnUsageRow = false, smoothStreaming = false, activityFrames, showAll, onToggleAll, onLoadOlder, olderHistory, thinkingVisible = true, historyPaintEnabled = true, fullscreen = false, registerRowRef, scrollHandle, forceMountRowId, newSinceRowId, onUnseenCount, onTimeline, failureHintRowId, failureHint, onOpenSubagent, onOpenSubagentView, onOpenJobs, onWatchJobOutput, onOpenFile, sessionCwd, onPreviewImage, suppressImageGraphics = false, }) {
|
|
307
308
|
const lang = React.useSyncExternalStore(subscribeLang, getLang);
|
|
309
|
+
// Reveal memory is per Chat root: a recompose can mount this transcript
|
|
310
|
+
// under a fresh root, and each root owns its row ids.
|
|
311
|
+
const revealScope = useRevealScope();
|
|
308
312
|
const hiddenCount = rows.length - RENDERED_ROW_CAP;
|
|
309
313
|
// The thinking filter runs BEFORE virtualization so window indices line up.
|
|
310
314
|
//
|
|
@@ -535,8 +539,9 @@ export function MessageList({ rows, expanded, expandedRows, selectedId, onToggle
|
|
|
535
539
|
}
|
|
536
540
|
const visibleRows = visibleRowsCacheRef.current.out;
|
|
537
541
|
const margins = visibleRowsCacheRef.current.margins;
|
|
538
|
-
// Selection keeps its highlight;
|
|
539
|
-
//
|
|
542
|
+
// Selection keeps its highlight; expanding a row adds no band of its own.
|
|
543
|
+
// A tool card supplies the configured tool-card surface (and its diff line
|
|
544
|
+
// tints) from the inside; the band itself stays limited to selection.
|
|
540
545
|
const rowBackground = (rowId) => {
|
|
541
546
|
const isSelected = selectedId === rowId;
|
|
542
547
|
if (isSelected)
|
|
@@ -664,7 +669,7 @@ export function MessageList({ rows, expanded, expandedRows, selectedId, onToggle
|
|
|
664
669
|
// reasoning height at once, remounting the widened window over rows
|
|
665
670
|
// whose rendering never changed (Yoga spike + measure churn for
|
|
666
671
|
// nothing). Base parts cover the universal height inputs.
|
|
667
|
-
const parts = signatureParts(row, columns, expanded, expandedRows, streamViewToggledRows, thinkingVisible, thinkingFold, diffLayout, foldTerminalCommand, model, failureHintRowId, failureHint, revealDisplayLen(row, smoothStreaming), sessionCwd, fullscreen);
|
|
672
|
+
const parts = signatureParts(row, columns, expanded, expandedRows, streamViewToggledRows, thinkingVisible, thinkingFold, diffLayout, foldTerminalCommand, model, failureHintRowId, failureHint, revealDisplayLen(row, smoothStreaming, revealScope), sessionCwd, fullscreen);
|
|
668
673
|
const cachedParts = sigs.get(row.id);
|
|
669
674
|
let same = false;
|
|
670
675
|
if (cachedParts !== undefined && cachedParts.length === parts.length) {
|
|
@@ -1303,7 +1308,7 @@ export function MessageList({ rows, expanded, expandedRows, selectedId, onToggle
|
|
|
1303
1308
|
let displayStreaming = row.streaming === true;
|
|
1304
1309
|
if (row.kind === 'assistant' && smoothStreaming) {
|
|
1305
1310
|
const stripped = assistantDisplayText(row);
|
|
1306
|
-
displayText = revealTextOf(`a${row.id}
|
|
1311
|
+
displayText = revealTextOf(scopeRevealKey(revealScope, `a${row.id}`), stripped, {
|
|
1307
1312
|
enabled: true,
|
|
1308
1313
|
active: displayStreaming || row.fresh === true,
|
|
1309
1314
|
});
|
|
@@ -1313,7 +1318,7 @@ export function MessageList({ rows, expanded, expandedRows, selectedId, onToggle
|
|
|
1313
1318
|
displayText = assistantDisplayText(row);
|
|
1314
1319
|
}
|
|
1315
1320
|
else if (row.kind === 'reasoning' && smoothStreaming) {
|
|
1316
|
-
displayText = revealTextOf(`r${row.id}
|
|
1321
|
+
displayText = revealTextOf(scopeRevealKey(revealScope, `r${row.id}`), row.text, { enabled: true, active: displayStreaming });
|
|
1317
1322
|
}
|
|
1318
1323
|
return (_jsx(MemoRow, { rowId: row.id, kind: row.kind, text: displayText, interruptBackend: row.interruptBackend, images: row.images, textFull: row.kind === 'reasoning' ? row.text : undefined, executionTarget: row.executionTarget, selectionAttached: row.selectionAttached, sender: teamSenderOf(row), streaming: displayStreaming, thinkingOpen: row.thinkingOpen === true, durationMs: row.durationMs, reasoningTokens: row.reasoningTokens, time: row.time, marginTopOnTurn: marginTopOnTurn, isSelected: selectedId === row.id, isExpanded: expandedRows.has(row.id), expanded: expanded, model: model, diffLayout: diffLayout, thinkingFold: thinkingFold, toolBackground: toolBackground, foldTerminalCommand: foldTerminalCommand, smoothStreaming: smoothStreaming, fresh: row.fresh === true, revealVersion: revealVersion, activityFrames: activityFrames, background: rowBackground(row.id), toolCallId: tool?.callId, toolName: tool?.name, toolArgsText: tool?.argsText, toolArgsFull: tool?.argsFull, toolStatus: tool?.status, toolResultText: tool?.resultText, toolResultFull: tool?.resultFull, toolErrorText: tool?.errorText, toolFootnote: failureHintRowId === row.id ? failureHint : undefined, toolCallView: tool?.callView, toolResultView: tool?.resultView, toolStartedAt: tool?.startedAt, toolDurationMs: tool?.durationMs, toolSourceFolded: row.folded === true, toolLiveOutput: tool?.liveOutput, toolLiveOutputDropped: tool?.liveOutputDropped, fullscreen: fullscreen, turnUsage: row.turnUsage, subagent: subagent, job: job, jobGroup: jobGroup, onToggleRow: onToggleRow, onToggleStreamView: onToggleStreamView, streamViewToggled: streamViewToggledRows.has(row.id), onOpenSubagent: onOpenSubagent, onOpenSubagentView: onOpenSubagentView, onOpenJobs: onOpenJobs, onWatchJobOutput: onWatchJobOutput, onOpenFile: onOpenFile, sessionCwd: sessionCwd, onPreviewImage: onPreviewImage, suppressImageGraphics: suppressImageGraphics, setRowRef: setRowRef }, row.id));
|
|
1319
1324
|
}), bottomPad > 0 && _jsx(Box, { height: bottomPad, flexShrink: 0 })] }));
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { GrantPlan } from '../dsh-adapter/grant-file.js';
|
|
3
|
+
/**
|
|
4
|
+
* Rows one localized line occupies inside a `Pane` at the current width.
|
|
5
|
+
*
|
|
6
|
+
* A pane that hands the permission list its frame has to know how tall that
|
|
7
|
+
* frame really is: the trust and notice copy wraps differently at 50 and 80
|
|
8
|
+
* columns, so a fixed row count either folds rows that would have fit or lets
|
|
9
|
+
* the list push the pane title off the overlay. This measures with the
|
|
10
|
+
* renderer's own wrap function (the one `Text` uses) at the pane's content
|
|
11
|
+
* width, so the count matches what is drawn.
|
|
12
|
+
*/
|
|
13
|
+
export declare function usePaneTextRows(): (text: string) => number;
|
|
14
|
+
/**
|
|
15
|
+
* The permissions one lifecycle action is about, as the confirmation pane shows
|
|
16
|
+
* them (grant lifecycle plan §8).
|
|
17
|
+
*
|
|
18
|
+
* Both the install confirmation and the lifecycle confirmation read the same
|
|
19
|
+
* list, so they cannot describe the same declaration differently. Ordering is
|
|
20
|
+
* deliberate: default-deny (the interception-class) permissions lead — the risk
|
|
21
|
+
* a person is least likely to expect is what they see first — and inside that
|
|
22
|
+
* block the ones not granted yet come first. Granted entries sink within their
|
|
23
|
+
* own group, never across it, so a hand-edited grant on a default-deny row
|
|
24
|
+
* keeps its place in the leading block instead of disappearing under the
|
|
25
|
+
* default-allow rows.
|
|
26
|
+
*
|
|
27
|
+
* Height is the overlay's, not the terminal's: the pane sits in `OverlayAbove`,
|
|
28
|
+
* which reserves a strip above the prompt and clips whole rows from the top.
|
|
29
|
+
* The list therefore folds to whatever its pane's frame leaves — fewer rows plus
|
|
30
|
+
* `and N more…` — instead of pushing the package identity, the trust notice or
|
|
31
|
+
* the key hint off a short terminal.
|
|
32
|
+
*
|
|
33
|
+
* Presentational only; the state lives in the flows.
|
|
34
|
+
*/
|
|
35
|
+
export declare function PluginGrantList({ plan, mode, frameRows }: {
|
|
36
|
+
plan: GrantPlan;
|
|
37
|
+
mode: 'grant' | 'revoke';
|
|
38
|
+
/**
|
|
39
|
+
* Rows the pane spends outside the permission rows: the pane frame, the
|
|
40
|
+
* heading, the facts, the hint. The margin the caller wraps the pane in is
|
|
41
|
+
* reserved here, since it is part of the overlay this list has to fit.
|
|
42
|
+
*/
|
|
43
|
+
readonly frameRows: number;
|
|
44
|
+
}): React.ReactNode;
|
|
45
|
+
//# sourceMappingURL=PluginGrantList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginGrantList.d.ts","sourceRoot":"","sources":["../../../src/components/PluginGrantList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,8BAA8B,CAAA;AAmB7E;;;;;;;;;GASG;AACH,wBAAgB,eAAe,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAO1D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACzD,IAAI,EAAE,SAAS,CAAA;IACf,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAA;IACxB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B,GAAG,KAAK,CAAC,SAAS,CA8DlB"}
|