@deepseek-harness-tui/dsh-tui 0.16.1 → 0.18.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 +213 -34
- package/assets/plugin-icon.svg +13 -0
- package/assets/windows-installer.cs +308 -0
- package/assets/windows-installer.ps1 +17 -0
- package/bin/dsh-tui.js +64 -5
- package/cli/adapters/dsh/index.mjs +111 -0
- package/cli/adapters/dsh/locate.mjs +73 -0
- package/cli/adapters/dsh/management-plugin.mjs +111 -0
- package/cli/args.mjs +154 -0
- package/cli/contracts.d.ts +48 -0
- package/cli/engine.mjs +92 -0
- package/cli/entry.mjs +48 -0
- package/cli/process.mjs +118 -0
- package/cli/protocol.mjs +23 -0
- package/cli/schema-v1.json +33 -0
- package/cordis.patch.yml +3 -1
- package/cordis.yml +3 -1
- package/guide/dsh-tui-guide/SKILL.md +1 -0
- package/guide/dsh-tui-guide/cli.en.md +114 -0
- package/guide/dsh-tui-guide/cli.md +114 -0
- package/guide/dsh-tui-guide/configuration.en.md +7 -5
- package/guide/dsh-tui-guide/configuration.md +7 -5
- package/guide/dsh-tui-guide/getting-started.en.md +33 -3
- package/guide/dsh-tui-guide/getting-started.md +23 -2
- package/guide/dsh-tui-guide/interaction.en.md +50 -17
- package/guide/dsh-tui-guide/interaction.md +35 -13
- package/guide/dsh-tui-guide/plugins.en.md +63 -11
- package/guide/dsh-tui-guide/plugins.md +41 -7
- package/guide/dsh-tui-guide/user-guide.en.md +55 -34
- package/guide/dsh-tui-guide/user-guide.md +45 -28
- package/lib/settings.json +85 -42
- package/lib/types/adapter/channel/plugins.d.ts.map +1 -1
- package/lib/types/adapter/channel/plugins.js +8 -0
- package/lib/types/adapter/channel/ui-policy.d.ts +2 -1
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +4 -0
- package/lib/types/adapter/ports/channel-display.d.ts +10 -0
- package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-session.d.ts +2 -0
- package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-settings.d.ts +20 -0
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +22 -2
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +11 -1
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel.d.ts +7 -0
- package/lib/types/adapter/ports/channel.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/capabilities.d.ts +2 -0
- package/lib/types/agent/capabilities.d.ts.map +1 -1
- package/lib/types/agent/events.d.ts +15 -1
- package/lib/types/agent/events.d.ts.map +1 -1
- package/lib/types/api.d.ts +2 -2
- package/lib/types/api.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/events.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/events.js +2 -1
- package/lib/types/backends/codex/auth/status.js +1 -1
- package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
- package/lib/types/backends/codex/session/controls.js +6 -5
- package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
- package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/events.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/events.js +3 -1
- package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
- package/lib/types/backends/shared/channel-tokens.js +9 -8
- package/lib/types/channel/history-restore.d.ts.map +1 -1
- package/lib/types/channel/history-restore.js +2 -0
- package/lib/types/channel/interaction.d.ts.map +1 -1
- package/lib/types/channel/interaction.js +1 -0
- package/lib/types/channel/projection.d.ts +1 -1
- package/lib/types/channel/projection.d.ts.map +1 -1
- package/lib/types/channel/projection.js +19 -4
- package/lib/types/channel/questions.d.ts +2 -0
- package/lib/types/channel/questions.d.ts.map +1 -1
- package/lib/types/channel/sanitize.d.ts +14 -0
- package/lib/types/channel/sanitize.d.ts.map +1 -1
- package/lib/types/channel/sanitize.js +55 -0
- package/lib/types/channel/working-directory.d.ts +9 -0
- package/lib/types/channel/working-directory.d.ts.map +1 -0
- package/lib/types/channel/working-directory.js +7 -0
- package/lib/types/commands.d.ts +8 -1
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +14 -5
- package/lib/types/components/ChatTitle.d.ts +7 -0
- package/lib/types/components/ChatTitle.d.ts.map +1 -0
- package/lib/types/components/ChatTitle.js +15 -0
- package/lib/types/components/CodeBlockFrame.d.ts.map +1 -1
- package/lib/types/components/CodeBlockFrame.js +10 -5
- package/lib/types/components/CompactionStatusRow.d.ts.map +1 -1
- package/lib/types/components/CompactionStatusRow.js +24 -3
- package/lib/types/components/GoalTodoPanel.d.ts +73 -6
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +165 -17
- package/lib/types/components/Markdown.d.ts +9 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +5 -4
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +20 -14
- 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 +13 -5
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +190 -108
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +232 -22
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +10 -0
- package/lib/types/components/SubagentDetailScene.d.ts +3 -1
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +17 -1
- package/lib/types/components/Whale.d.ts.map +1 -1
- package/lib/types/components/Whale.js +8 -5
- package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
- package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
- package/lib/types/components/approvals/ApprovalPanel.js +93 -11
- package/lib/types/components/bigfont.d.ts.map +1 -1
- package/lib/types/components/bigfont.js +2 -1
- 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 +24 -11
- 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/previewRows.d.ts +19 -0
- package/lib/types/components/previewRows.d.ts.map +1 -0
- package/lib/types/components/previewRows.js +46 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +75 -10
- package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -9
- package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
- package/lib/types/components/sessions/ForeignSessionRow.js +6 -10
- package/lib/types/components/sessions/SessionListRow.d.ts +4 -9
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionListRow.js +18 -10
- package/lib/types/components/sidePanel/InfoPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/InfoPanel.js +4 -3
- package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelLayout.js +5 -5
- package/lib/types/components/sidePanel/WorkspacePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/WorkspacePanel.js +19 -7
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +7 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.js +16 -0
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +8 -1
- 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 +8 -1
- 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 +36 -18
- package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -1
- package/lib/types/components/sidePanel/panelMarkdown.d.ts +32 -0
- package/lib/types/components/sidePanel/panelMarkdown.d.ts.map +1 -0
- package/lib/types/components/sidePanel/panelMarkdown.js +45 -0
- package/lib/types/components/sidePanel/pluginPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/pluginPanelAdapter.js +6 -1
- package/lib/types/components/sidePanel/subagentFailureRead.d.ts +21 -0
- package/lib/types/components/sidePanel/subagentFailureRead.d.ts.map +1 -0
- package/lib/types/components/sidePanel/subagentFailureRead.js +66 -0
- 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 +39 -7
- package/lib/types/components/trajectory/MiniWake.d.ts +2 -2
- package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -1
- package/lib/types/components/trajectory/MiniWake.js +7 -3
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +4 -7
- 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 +62 -6
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +18 -4
- package/lib/types/dsh-adapter/backend-admission.d.ts +3 -3
- 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/binding-events.d.ts +5 -1
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +18 -1
- package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/command-completions.js +6 -8
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +11 -1
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +121 -113
- package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-mentions.js +38 -17
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.js +9 -5
- package/lib/types/dsh-adapter/channel/core/actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/actions.js +23 -2
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +10 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +48 -3
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +5 -2
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +7 -0
- package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/files.js +2 -1
- package/lib/types/dsh-adapter/channel/core/host.d.ts +14 -10
- package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/host.js +192 -13
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +1 -0
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.js +32 -3
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/extensions.js +31 -5
- package/lib/types/dsh-adapter/channel/input-actions.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-actions.js +34 -0
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +5 -2
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +31 -4
- 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 +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +7 -1
- package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-selection.js +6 -4
- 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-fork.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.js +1 -0
- 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-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +15 -2
- package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.js +7 -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 +56 -36
- 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 +3 -1
- 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 +3 -1
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +10 -3
- package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +2 -2
- package/lib/types/dsh-adapter/channel/types.d.ts +13 -1
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/liveSession.d.ts +3 -3
- package/lib/types/dsh-adapter/compat/liveSession.js +3 -3
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.js +17 -1
- package/lib/types/dsh-adapter/contract.d.ts +7 -5
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +10 -5
- package/lib/types/dsh-adapter/effect-ledger.d.ts +1 -1
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
- package/lib/types/dsh-adapter/effect-ledger.js +1 -0
- 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 +29 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -0
- package/lib/types/dsh-adapter/experimental-bundles.js +15 -0
- 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 +54 -4
- package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
- package/lib/types/dsh-adapter/host-contract.js +2 -2
- package/lib/types/dsh-adapter/host-dsh.js +3 -3
- package/lib/types/dsh-adapter/index.d.ts +8 -4
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +17 -12
- package/lib/types/dsh-adapter/panels.d.ts +28 -8
- package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
- package/lib/types/dsh-adapter/panels.js +11 -56
- 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 +81 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +378 -84
- 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 +99 -31
- package/lib/types/dsh-adapter/presets.d.ts +19 -6
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +69 -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/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-tools.d.ts +34 -0
- package/lib/types/dsh-adapter/session-tools.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-tools.js +39 -0
- package/lib/types/dsh-adapter/settings-sections.d.ts +18 -1
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +73 -0
- package/lib/types/dsh-adapter/status.d.ts +88 -1
- package/lib/types/dsh-adapter/status.d.ts.map +1 -1
- package/lib/types/dsh-adapter/status.js +318 -3
- package/lib/types/dsh-adapter/team-mode.d.ts +42 -33
- package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
- package/lib/types/dsh-adapter/team-mode.js +76 -112
- 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/extensions.d.ts +1 -1
- package/lib/types/extensions.d.ts.map +1 -1
- package/lib/types/force-production-react.js +3 -3
- package/lib/types/heldInputs.d.ts +36 -0
- package/lib/types/heldInputs.d.ts.map +1 -0
- package/lib/types/heldInputs.js +173 -0
- package/lib/types/i18n.d.ts +543 -73
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +265 -46
- package/lib/types/ink/colorize.d.ts +7 -1
- package/lib/types/ink/colorize.d.ts.map +1 -1
- package/lib/types/ink/colorize.js +29 -8
- package/lib/types/ink/components/App.d.ts +2 -1
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +10 -3
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
- package/lib/types/ink/components/ScrollBox.js +1 -0
- package/lib/types/ink/dom.d.ts +1 -0
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-program-status.d.ts +78 -0
- package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-program-status.js +96 -0
- package/lib/types/ink/ink.d.ts +13 -4
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +119 -25
- package/lib/types/ink/output.d.ts +17 -2
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +85 -2
- package/lib/types/ink/parse-keypress.d.ts +1 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +5 -4
- package/lib/types/ink/render-node-to-output.d.ts +2 -0
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +79 -10
- package/lib/types/ink/root.d.ts +8 -0
- package/lib/types/ink/root.d.ts.map +1 -1
- package/lib/types/ink/root.js +12 -3
- package/lib/types/ink/screen.d.ts +11 -0
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/screen.js +44 -0
- package/lib/types/ink/selection.d.ts +7 -2
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +187 -44
- package/lib/types/ink/shutdown-input.d.ts +15 -0
- package/lib/types/ink/shutdown-input.d.ts.map +1 -0
- package/lib/types/ink/shutdown-input.js +28 -0
- package/lib/types/ink/sixel-cursor-heal.d.ts +21 -0
- package/lib/types/ink/sixel-cursor-heal.d.ts.map +1 -0
- package/lib/types/ink/sixel-cursor-heal.js +62 -0
- package/lib/types/ink/sixel-graphics.d.ts +6 -0
- package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
- package/lib/types/ink/sixel-graphics.js +18 -0
- package/lib/types/ink/styles.d.ts +8 -1
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification-windows.d.ts +195 -0
- package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -0
- package/lib/types/ink/terminal-notification-windows.js +433 -0
- package/lib/types/ink/terminal-notification.d.ts +3 -1
- package/lib/types/ink/terminal-notification.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification.js +4 -1
- package/lib/types/ink/terminal-querier.d.ts +9 -1
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +32 -1
- package/lib/types/ink/terminal.d.ts +23 -2
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +32 -2
- package/lib/types/ink/termio/osc.d.ts +2 -1
- package/lib/types/ink/termio/osc.d.ts.map +1 -1
- package/lib/types/ink/termio/osc.js +37 -8
- package/lib/types/ink/termio/osc7501.d.ts +102 -0
- package/lib/types/ink/termio/osc7501.d.ts.map +1 -0
- package/lib/types/ink/termio/osc7501.js +229 -0
- package/lib/types/ink/termio/tokenize.js +5 -7
- 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/panels.d.ts +1 -1
- package/lib/types/panels.d.ts.map +1 -1
- package/lib/types/screens/AgentTranscriptScene.d.ts +3 -1
- package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
- package/lib/types/screens/AgentTranscriptScene.js +5 -1
- package/lib/types/screens/Chat.d.ts +6 -6
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +394 -141
- package/lib/types/screens/Launchpad.d.ts +8 -2
- package/lib/types/screens/Launchpad.d.ts.map +1 -1
- package/lib/types/screens/Launchpad.js +32 -12
- 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.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +31 -21
- package/lib/types/screens/Settings.d.ts +5 -1
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +528 -51
- package/lib/types/screens/StatusLine.d.ts +9 -3
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +91 -15
- package/lib/types/screens/StatusMetrics.d.ts +2 -11
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +20 -14
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +13 -21
- package/lib/types/sessionMounts.d.ts +14 -0
- package/lib/types/sessionMounts.d.ts.map +1 -1
- package/lib/types/sessionMounts.js +20 -9
- package/lib/types/sessions/format.d.ts +39 -0
- package/lib/types/sessions/format.d.ts.map +1 -1
- package/lib/types/sessions/format.js +83 -0
- package/lib/types/sessions/resumeFailure.d.ts +4 -0
- package/lib/types/sessions/resumeFailure.d.ts.map +1 -1
- package/lib/types/sessions/resumeFailure.js +12 -4
- package/lib/types/sessions/workspaceCounts.d.ts +6 -0
- package/lib/types/sessions/workspaceCounts.d.ts.map +1 -0
- package/lib/types/sessions/workspaceCounts.js +24 -0
- package/lib/types/settings/definitions.d.ts +24 -0
- package/lib/types/settings/definitions.d.ts.map +1 -1
- package/lib/types/settings/definitions.js +40 -15
- package/lib/types/tips.js +2 -2
- package/lib/types/tuiDisplayPrefs.d.ts +113 -5
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +276 -14
- package/lib/types/update.d.ts +15 -14
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +163 -115
- package/lib/types/updateProcess.d.ts +28 -0
- package/lib/types/updateProcess.d.ts.map +1 -0
- package/lib/types/updateProcess.js +135 -0
- package/lib/types/utils/inputWordBoundary.d.ts +5 -0
- package/lib/types/utils/inputWordBoundary.d.ts.map +1 -0
- package/lib/types/utils/inputWordBoundary.js +18 -0
- package/lib/types/utils/keymap.d.ts +1 -1
- package/lib/types/utils/keymap.d.ts.map +1 -1
- package/lib/types/utils/keymap.js +6 -1
- 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/windowsInstaller.d.ts +4 -0
- package/lib/types/windowsInstaller.d.ts.map +1 -0
- package/lib/types/windowsInstaller.js +237 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +130 -111
- package/presets/liangshen/custom-bash.mjs +13 -1
- package/presets/liangshen/instruction-hint.mjs +4 -1
- package/presets/liangshen/skill-search.mjs +14 -2
- package/presets/winbash.mjs +16 -4
- package/tui-profile/feed/README.md +17 -8
- package/tui-profile/feed/first-party.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
3
|
* The approval panel — the permission prompt every backend renders
|
|
4
4
|
* through. One ask per panel: a
|
|
@@ -26,11 +26,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
26
26
|
import React from 'react';
|
|
27
27
|
import { t } from '../../i18n.js';
|
|
28
28
|
import { stringWidth } from '../../ink/stringWidth.js';
|
|
29
|
-
import { Box, Text, useInput, useTerminalSize } from '../../ui.js';
|
|
29
|
+
import { Box, Text, ScrollBox, useInput, useTerminalSize } from '../../ui.js';
|
|
30
|
+
import wrapText from '../../ink/wrap-text.js';
|
|
31
|
+
import { actionMatches, effectiveComboDisplay } from '../../utils/keymap.js';
|
|
30
32
|
import { isPlainReturnInput } from '../../utils/modifiers.js';
|
|
31
33
|
import { Divider } from '../design-system/Divider.js';
|
|
32
34
|
import { POINTER } from '../../terminal-utils/figures.js';
|
|
33
35
|
import { flattenPasteInline } from '../../channel/sanitize.js';
|
|
36
|
+
import { clipPreviewRows, pagePreview } from '../previewRows.js';
|
|
34
37
|
import { panelOutcomeOf, visiblePermissionOptions, } from '../../channel/permissions.js';
|
|
35
38
|
/** A feedback reason is a short sentence, not a document. */
|
|
36
39
|
const FEEDBACK_MAX_POINTS = 2000;
|
|
@@ -39,6 +42,27 @@ const FEEDBACK_MAX_POINTS = 2000;
|
|
|
39
42
|
const ROW_CHROME_CELLS = 5;
|
|
40
43
|
/** The reason never takes more than this many rows of the option list. */
|
|
41
44
|
const FEEDBACK_MAX_LINES = 2;
|
|
45
|
+
/**
|
|
46
|
+
* Preview caps. The panel is in-flow in the bottom chrome, so its height is
|
|
47
|
+
* its content height: an unbounded command pushed the question, the option
|
|
48
|
+
* rows and the hint off screen and left the user nothing to answer (#1664).
|
|
49
|
+
* These caps are the worst case; the terminal-row budget below shrinks them
|
|
50
|
+
* further on a short terminal.
|
|
51
|
+
*/
|
|
52
|
+
const COMMAND_MAX_LINES = 8;
|
|
53
|
+
const TITLE_MAX_LINES = 3;
|
|
54
|
+
const REASON_MAX_LINES = 3;
|
|
55
|
+
/**
|
|
56
|
+
* Rows kept for the rest of the bottom chrome while this panel is up: the
|
|
57
|
+
* status line plus a floor of transcript rows. The composer does not count —
|
|
58
|
+
* Chat replaces it with this panel (`PromptInput` stays mounted but suspended,
|
|
59
|
+
* rendering nothing). The value deliberately matches the picker overlay's
|
|
60
|
+
* prompt-slot reserve so both surfaces leave the same footer budget; the two
|
|
61
|
+
* stay separate literals because the overlay's composer IS on screen.
|
|
62
|
+
*/
|
|
63
|
+
const CHROME_RESERVED_ROWS = 8;
|
|
64
|
+
/** Compact prompts spend the transcript reserve but keep the three-row footer. */
|
|
65
|
+
const COMPACT_FOOTER_ROWS = 3;
|
|
42
66
|
/** The longest tail of `text` that fits in `cells` display cells. */
|
|
43
67
|
function tailWithin(text, cells) {
|
|
44
68
|
const points = [...text];
|
|
@@ -77,12 +101,12 @@ function hardWrap(text, cells) {
|
|
|
77
101
|
* the reason does not fit, its tail (the typing position) is shown after an
|
|
78
102
|
* ellipsis.
|
|
79
103
|
*/
|
|
80
|
-
export function feedbackRowLines(prefix, label, reason, columns) {
|
|
104
|
+
export function feedbackRowLines(prefix, label, reason, columns, maxLines = FEEDBACK_MAX_LINES) {
|
|
81
105
|
const cells = Math.max(8, columns - ROW_CHROME_CELLS);
|
|
82
106
|
const head = `${prefix}${t('approval-feedback-row', { label, reason: '' })}`;
|
|
83
|
-
const budget =
|
|
107
|
+
const budget = maxLines * cells - stringWidth(head);
|
|
84
108
|
const shown = stringWidth(reason) <= budget ? reason : `…${tailWithin(reason, Math.max(0, budget - 1))}`;
|
|
85
|
-
return hardWrap(`${prefix}${t('approval-feedback-row', { label, reason: shown })}`, cells).slice(0,
|
|
109
|
+
return hardWrap(`${prefix}${t('approval-feedback-row', { label, reason: shown })}`, cells).slice(0, maxLines);
|
|
86
110
|
}
|
|
87
111
|
/** The localized label of an option without backend wording. */
|
|
88
112
|
function optionLabel(option) {
|
|
@@ -92,7 +116,7 @@ function optionLabel(option) {
|
|
|
92
116
|
}
|
|
93
117
|
export function ApprovalPanel({ approval, background = false, onDecide }) {
|
|
94
118
|
const options = visiblePermissionOptions(approval);
|
|
95
|
-
const { columns } = useTerminalSize();
|
|
119
|
+
const { columns, rows } = useTerminalSize();
|
|
96
120
|
// `defaultToNo` opens on the rejection (sorted first); otherwise on the
|
|
97
121
|
// first option, as the DSH panel always has. The ref is the synchronous
|
|
98
122
|
// source of truth: one stdin chunk can carry a focus move and the typing
|
|
@@ -111,6 +135,7 @@ export function ApprovalPanel({ approval, background = false, onDecide }) {
|
|
|
111
135
|
// One stdin chunk can carry several key events inside a single React
|
|
112
136
|
// batch: the ref is the synchronous source of truth for the handlers.
|
|
113
137
|
const feedbackRef = React.useRef('');
|
|
138
|
+
const previewScrollRef = React.useRef(null);
|
|
114
139
|
const applyFeedback = (next) => {
|
|
115
140
|
feedbackRef.current = next;
|
|
116
141
|
setFeedback(next);
|
|
@@ -141,7 +166,16 @@ export function ApprovalPanel({ approval, background = false, onDecide }) {
|
|
|
141
166
|
const points = [...feedbackRef.current, ...text];
|
|
142
167
|
applyFeedback(points.slice(0, FEEDBACK_MAX_POINTS).join(''));
|
|
143
168
|
};
|
|
144
|
-
useInput((input, key) => {
|
|
169
|
+
useInput((input, key, event) => {
|
|
170
|
+
if (compact && hasPreview) {
|
|
171
|
+
const up = actionMatches('questionDetailUp', input, key);
|
|
172
|
+
const down = actionMatches('questionDetailDown', input, key);
|
|
173
|
+
if (up || down) {
|
|
174
|
+
pagePreview(previewScrollRef.current, up ? -1 : 1);
|
|
175
|
+
event.stopImmediatePropagation();
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
145
179
|
if (key.escape || (key.ctrl && input === 'c')) {
|
|
146
180
|
reject();
|
|
147
181
|
return;
|
|
@@ -189,13 +223,61 @@ export function ApprovalPanel({ approval, background = false, onDecide }) {
|
|
|
189
223
|
decide(index, false);
|
|
190
224
|
}
|
|
191
225
|
}, { isActive: true });
|
|
192
|
-
|
|
226
|
+
// ── Preview budget ─────────────────────────────────────────────────────
|
|
227
|
+
// The divider, the proceed question, the option rows and the key hint are
|
|
228
|
+
// always painted; the preview text between them must fold instead of
|
|
229
|
+
// growing the panel past the viewport (#1664).
|
|
230
|
+
const contentCells = Math.max(8, columns - 4);
|
|
231
|
+
// The command sits in a Box with paddingX={2} inside the panel's 2+2.
|
|
232
|
+
const commandCells = Math.max(8, columns - 8);
|
|
233
|
+
const warningRows = (background ? 1 : 0)
|
|
234
|
+
+ (approval.subagentId === undefined ? 0 : 1)
|
|
235
|
+
+ (approval.external === true ? 1 : 0)
|
|
236
|
+
+ (approval.blockedPath === undefined ? 0 : 1);
|
|
237
|
+
// root margin + divider + content margin + warnings + "proceed" + options
|
|
238
|
+
// margin + option rows + the focused row's spacer + hint margin + hint.
|
|
239
|
+
const fixedRows = 8 + warningRows + options.length;
|
|
240
|
+
const previewBlockCount = (approval.title === undefined ? 0 : 1)
|
|
241
|
+
+ (approval.command === undefined ? 0 : 1)
|
|
242
|
+
+ (approval.reason === undefined ? 0 : 1);
|
|
243
|
+
const hasPreview = previewBlockCount + warningRows > 0;
|
|
244
|
+
// Below this floor even one marker per block would hide a decision row.
|
|
245
|
+
// Remove decorative gaps and put all request text in one bounded viewport.
|
|
246
|
+
const compact = rows < fixedRows + previewBlockCount + COMPACT_FOOTER_ROWS;
|
|
247
|
+
const hint = compact && hasPreview
|
|
248
|
+
? t('approval-hint-preview', { up: effectiveComboDisplay('questionDetailUp'), down: effectiveComboDisplay('questionDetailDown') })
|
|
249
|
+
: acceptsFeedback ? t('approval-hint-feedback') : t('approval-hint');
|
|
250
|
+
const hintRows = wrapText(hint, contentCells, 'wrap').split('\n').length;
|
|
251
|
+
// The divider and choices already identify the decision. On a tiny
|
|
252
|
+
// three-choice prompt, drop the repeated question before any request text.
|
|
253
|
+
const showProceed = !compact || rows >= COMPACT_FOOTER_ROWS + 2 + options.length + hintRows + (hasPreview ? 1 : 0);
|
|
254
|
+
const compactPreviewRows = Math.max(1, rows - COMPACT_FOOTER_ROWS - 1 - (showProceed ? 1 : 0) - options.length - hintRows);
|
|
255
|
+
let previewRowsLeft = Math.max(1, rows - fixedRows - CHROME_RESERVED_ROWS);
|
|
256
|
+
// A present text is never dropped: once the budget is spent it still keeps
|
|
257
|
+
// its omitted marker, overdrawing the chrome reserve by at most one row per
|
|
258
|
+
// block. Silently hiding the asker's reason reads as "there was none".
|
|
259
|
+
const takePreview = (text, cells, cap) => {
|
|
260
|
+
if (text === undefined)
|
|
261
|
+
return undefined;
|
|
262
|
+
const view = clipPreviewRows(text, cells, Math.max(1, Math.min(cap, previewRowsLeft)));
|
|
263
|
+
previewRowsLeft = Math.max(0, previewRowsLeft - view.rows.length - (view.omitted > 0 ? 1 : 0));
|
|
264
|
+
return view;
|
|
265
|
+
};
|
|
266
|
+
// The gated command is what the decision is about: it takes the budget
|
|
267
|
+
// first, then the backend's reason, then the prompt sentence.
|
|
268
|
+
const commandView = takePreview(approval.command, commandCells, COMMAND_MAX_LINES);
|
|
269
|
+
const reasonView = takePreview(approval.reason, contentCells, REASON_MAX_LINES);
|
|
270
|
+
const titleView = takePreview(approval.title, contentCells, TITLE_MAX_LINES);
|
|
271
|
+
/** Preview rows (already wrapped to one row each) and the omitted marker. */
|
|
272
|
+
const preview = (view, dim = false) => view === undefined ? null : (_jsxs(_Fragment, { children: [view.rows.length > 0 && (_jsx(Text, { dimColor: dim, wrap: "wrap", children: view.rows.join('\n') })), view.omitted > 0 && (_jsx(Text, { dimColor: true, wrap: "truncate-end", children: t('panel-preview-omitted', { count: view.omitted }) }))] }));
|
|
273
|
+
const previewContent = (_jsxs(_Fragment, { children: [background && (_jsx(Text, { color: "warning", children: t('approval-background-agent', { id: approval.agentId.slice(0, 8) }) })), approval.subagentId !== undefined && (_jsx(Text, { color: "warning", children: t('approval-subagent', { id: approval.subagentId.slice(0, 8) }) })), approval.external === true && (_jsxs(Text, { color: "warning", wrap: "wrap", children: ["[external] ", t('approval-external-hint')] })), compact && approval.title !== undefined ? _jsx(Text, { wrap: "wrap", children: approval.title }) : preview(titleView), approval.command !== undefined && (_jsx(Box, { flexDirection: "column", paddingX: 2, children: compact ? _jsx(Text, { dimColor: true, wrap: "wrap", children: approval.command }) : preview(commandView, true) })), compact && approval.reason !== undefined ? _jsx(Text, { dimColor: true, wrap: "wrap", children: approval.reason }) : preview(reasonView, true), approval.blockedPath !== undefined && (_jsx(Text, { color: "warning", wrap: "wrap", children: t('approval-blocked-path', { path: approval.blockedPath }) }))] }));
|
|
274
|
+
return (_jsxs(Box, { flexDirection: "column", marginTop: compact ? 0 : 1, paddingLeft: 2, paddingRight: 2, width: "100%", children: [_jsx(Divider, { color: "permission", title: t('approval-waiting', { tool: approval.toolName }) }), _jsxs(Box, { flexDirection: "column", marginTop: compact ? 0 : 1, children: [compact && hasPreview ? (_jsx(ScrollBox, { ref: previewScrollRef, flexDirection: "column", height: compactPreviewRows, flexShrink: 0, children: previewContent })) : previewContent, showProceed && _jsx(Text, { dimColor: true, wrap: compact ? 'truncate-end' : 'wrap', children: t('approval-proceed') })] }), _jsx(Box, { flexDirection: "column", marginTop: compact ? 0 : 1, children: options.map((option, index) => {
|
|
193
275
|
const focused = index === focusIndex;
|
|
194
276
|
const hovered = index === hoverIndex;
|
|
195
277
|
const label = optionLabel(option);
|
|
196
278
|
const reasonLines = acceptsFeedback && option.kind === 'reject' && feedback !== ''
|
|
197
|
-
? feedbackRowLines(`${index + 1}. `, label, feedback, columns)
|
|
279
|
+
? feedbackRowLines(`${index + 1}. `, label, feedback, columns, compact ? 1 : FEEDBACK_MAX_LINES)
|
|
198
280
|
: undefined;
|
|
199
|
-
return (_jsxs(Box, { flexDirection: "row", marginTop: focused ? 1 : 0, onClick: () => decide(index, true), onMouseEnter: () => setHoverIndex(index), onMouseLeave: () => setHoverIndex(current => (current === index ? -1 : current)), backgroundColor: hovered && !focused ? 'userMessageBackgroundHover' : undefined, children: [_jsx(Box, { width: 1, flexShrink: 0, children: _jsx(Text, { color: focused ? 'accent' : undefined, bold: focused, children: focused ? POINTER : ' ' }) }), reasonLines === undefined ? (_jsxs(Text, { bold: focused, color: focused ? 'accent' : undefined, wrap:
|
|
200
|
-
}) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children:
|
|
281
|
+
return (_jsxs(Box, { flexDirection: "row", marginTop: !compact && focused ? 1 : 0, onClick: () => decide(index, true), onMouseEnter: () => setHoverIndex(index), onMouseLeave: () => setHoverIndex(current => (current === index ? -1 : current)), backgroundColor: hovered && !focused ? 'userMessageBackgroundHover' : undefined, children: [_jsx(Box, { width: 1, flexShrink: 0, children: _jsx(Text, { color: focused ? 'accent' : undefined, bold: focused, children: focused ? POINTER : ' ' }) }), reasonLines === undefined ? (_jsxs(Text, { bold: focused, color: focused ? 'accent' : undefined, wrap: compact ? 'truncate-end' : 'wrap', children: [index + 1, ". ", label] })) : (_jsx(Box, { flexDirection: "column", children: reasonLines.map((line, row) => (_jsx(Text, { bold: focused, color: focused ? 'accent' : undefined, wrap: "truncate-end", children: line }, row))) }))] }, option.id));
|
|
282
|
+
}) }), _jsx(Box, { marginTop: compact ? 0 : 1, children: _jsx(Text, { dimColor: true, children: hint }) })] }));
|
|
201
283
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bigfont.d.ts","sourceRoot":"","sources":["../../../src/components/bigfont.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bigfont.d.ts","sourceRoot":"","sources":["../../../src/components/bigfont.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD;;;;;;GAMG;AAEH,YAAY;AACZ,MAAM,WAAW,GAAG;IAClB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,eAAe;IACf,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAYD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAItF;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,SAAI,GAAG,MAAM,CAKlF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,GAAG,EACT,EAAE,EAAE,GAAG,EACP,KAAK,EAAE,GAAG,EACV,MAAM,SAAK,EACX,OAAO,SAAI,EACX,MAAM,SAAI,GACT,MAAM,EAAE,CAgDV"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { foregroundOpenCode } from '../ink/colorize.js';
|
|
1
2
|
import { interpolateColor } from './Spinner/spinnerUtils.js';
|
|
2
3
|
/** 词组之间的间隔列数。 */
|
|
3
4
|
const WORD_GAP = 2;
|
|
@@ -5,7 +6,7 @@ const WORD_GAP = 2;
|
|
|
5
6
|
const SWEEP_WINDOW = 8;
|
|
6
7
|
/** 一行字画几行。 */
|
|
7
8
|
const ROWS = 5;
|
|
8
|
-
const esc = (rgb) =>
|
|
9
|
+
const esc = (rgb) => foregroundOpenCode(`rgb(${rgb.r},${rgb.g},${rgb.b})`);
|
|
9
10
|
const RESET = '\x1b[39m';
|
|
10
11
|
/**
|
|
11
12
|
* `text` 在该字身宽度、该字距下画出来的列数(含末尾那格字距留白)——与渲染循环
|
|
@@ -11,7 +11,8 @@ type Props = {
|
|
|
11
11
|
verbose: boolean;
|
|
12
12
|
/** Message-selection mode highlight. */
|
|
13
13
|
isSelected?: boolean;
|
|
14
|
-
/** Row expanded on its own (
|
|
14
|
+
/** Row expanded on its own (click / Enter); the card keeps the background
|
|
15
|
+
* configured for tool cards. */
|
|
15
16
|
isExpanded?: boolean;
|
|
16
17
|
/**
|
|
17
18
|
* Mouse click (fullscreen): toggles the row's expansion — same action as
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantToolUseMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/AssistantToolUseMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAA8C,OAAO,EAAE,MAAM,8BAA8B,CAAA;AASvG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AASjE,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,OAAO,CAAA;IACb,4CAA4C;IAC5C,eAAe,EAAE,OAAO,CAAA;IACxB,iEAAiE;IACjE,OAAO,EAAE,OAAO,CAAA;IAChB,wCAAwC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB
|
|
1
|
+
{"version":3,"file":"AssistantToolUseMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/AssistantToolUseMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAA8C,OAAO,EAAE,MAAM,8BAA8B,CAAA;AASvG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AASjE,KAAK,KAAK,GAAG;IACX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AoB,EACpB,UAAkB,GACnB,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CAiYzB"}
|
|
@@ -503,9 +503,14 @@ function HeaderTitle({ name, title, isTerminal, folded, displayArgs, argsLanguag
|
|
|
503
503
|
onOpenFile(filePath);
|
|
504
504
|
}, children: _jsx(Text, { underline: true, wrap: "truncate-end", children: filePath }) }), after !== '' && (_jsx(Text, { bold: false, color: "text", wrap: "truncate-end", children: after }))] }));
|
|
505
505
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
506
|
+
// The accent covers the leading word only. A title written as `Name(args)`
|
|
507
|
+
// (the session-search cards, or any presenter that echoes its input the way
|
|
508
|
+
// the terminal card does) has no space to split on, so the opening paren is
|
|
509
|
+
// a delimiter too — otherwise the whole header would carry the tool tone.
|
|
510
|
+
const cuts = [trimmed.indexOf(' '), trimmed.indexOf('(')].filter(at => at > 0);
|
|
511
|
+
const cut = cuts.length === 0 ? -1 : Math.min(...cuts);
|
|
512
|
+
const head = cut === -1 ? trimmed : trimmed.slice(0, cut);
|
|
513
|
+
const tail = cut === -1 ? '' : trimmed.slice(cut);
|
|
509
514
|
return (_jsx(Box, { flexWrap: "nowrap", ...headerTooltip, children: _jsxs(Text, { bold: true, color: nameColor, wrap: "truncate-end", children: [head, _jsx(Text, { bold: false, color: "text", children: tail })] }) }));
|
|
510
515
|
}
|
|
511
516
|
/**
|
|
@@ -569,9 +574,11 @@ export function AssistantToolUseMessage({ tool, marginTopOnTurn, verbose, isSele
|
|
|
569
574
|
const elapsedText = elapsedMs !== undefined ? ` · ${formatDuration(elapsedMs)}` : '';
|
|
570
575
|
// Body lines: the structured view first, raw result text as the fallback
|
|
571
576
|
// (tools without a presenter, or a folded row awaiting loadOlder).
|
|
572
|
-
// Wide terminals render diffs as a two-pane side-by-side instead:
|
|
573
|
-
// source line per terminal row (truncate)
|
|
574
|
-
//
|
|
577
|
+
// Wide terminals render diffs as a two-pane side-by-side instead: the
|
|
578
|
+
// collapsed preview keeps one source line per terminal row (truncate) so the
|
|
579
|
+
// card keeps a fixed height, while the expanded view wraps each pane and pads
|
|
580
|
+
// the shorter side so the two stay row-aligned. Neither fits the flat
|
|
581
|
+
// add/del line model.
|
|
575
582
|
const { columns } = useTerminalSize();
|
|
576
583
|
// Interactive rows grow a ▾/▴ disclose column while the pointer dwells
|
|
577
584
|
// (fixed, no layout shift elsewhere). The tooltip resolves at show time —
|
|
@@ -722,14 +729,20 @@ export function AssistantToolUseMessage({ tool, marginTopOnTurn, verbose, isSele
|
|
|
722
729
|
const shownLines = liveLines.length === 0 || revealedLines.length < rendered.length
|
|
723
730
|
? revealedLines
|
|
724
731
|
: [...lines, ...liveLines, ...rendered.slice(lines.length)];
|
|
725
|
-
//
|
|
726
|
-
//
|
|
727
|
-
|
|
728
|
-
const
|
|
732
|
+
// The configured treatment is the ordinary card's own face, so it stays on
|
|
733
|
+
// while the row is expanded — growing the body must not make the card lose
|
|
734
|
+
// the surface the user chose. Selection is the exception: it owns the row.
|
|
735
|
+
const cardToolBackground = isSelected ? 'none' : toolBackground;
|
|
736
|
+
const ordinaryBackground = cardToolBackground === 'subtle'
|
|
729
737
|
? 'toolCardBackgroundDim'
|
|
730
|
-
:
|
|
738
|
+
: cardToolBackground === 'strong'
|
|
731
739
|
? 'toolCardBackground'
|
|
732
740
|
: undefined;
|
|
741
|
+
// Nested split-diff context panes must yield to whatever paints the card:
|
|
742
|
+
// `none` keeps them transparent so the selection highlight, or the root
|
|
743
|
+
// card's configured face while expanded, shows through instead of stacking
|
|
744
|
+
// a second fill on top of it.
|
|
745
|
+
const ordinaryToolBackground = isSelected || isExpanded ? 'none' : toolBackground;
|
|
733
746
|
// Hover affordance for the click-to-toggle row: the theme's tool-card blue
|
|
734
747
|
// face marks the call's content area while the pointer dwells (the
|
|
735
748
|
// toolBackground treatment steps up one level to the strong card face), the
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { LlmModelInfo, LlmProviderInfo } from '../adapter/ports/channel-view.js';
|
|
2
2
|
import type { BalanceResult } from '../adapter/ports/channel-catalog.js';
|
|
3
3
|
/** 引导的四个配置域,按"先解决拦路的事、再解决好不好看、最后解决怎么用"排。 */
|
|
4
|
-
export declare const ONBOARDING_STEPS: readonly ["
|
|
4
|
+
export declare const ONBOARDING_STEPS: readonly ["access", "look", "model", "keys"];
|
|
5
5
|
export type OnboardingStep = (typeof ONBOARDING_STEPS)[number];
|
|
6
6
|
/**
|
|
7
|
-
* 步骤条需要的**最小**尺寸:四步的标题横排(`❯
|
|
7
|
+
* 步骤条需要的**最小**尺寸:四步的标题横排(`❯ 账号与模型接入 · ...`)
|
|
8
8
|
* 在 76 列下会被截成残句,在 8 行下会把内容挤没——那时整条不画,进度改由
|
|
9
9
|
* 头部那行"第 N / 4 步"承担(信息不丢,只是换了个地方)。
|
|
10
10
|
*/
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { t } from '../i18n.js';
|
|
10
10
|
/** 引导的四个配置域,按"先解决拦路的事、再解决好不好看、最后解决怎么用"排。 */
|
|
11
|
-
export const ONBOARDING_STEPS = ['
|
|
11
|
+
export const ONBOARDING_STEPS = ['access', 'look', 'model', 'keys'];
|
|
12
12
|
/**
|
|
13
|
-
* 步骤条需要的**最小**尺寸:四步的标题横排(`❯
|
|
13
|
+
* 步骤条需要的**最小**尺寸:四步的标题横排(`❯ 账号与模型接入 · ...`)
|
|
14
14
|
* 在 76 列下会被截成残句,在 8 行下会把内容挤没——那时整条不画,进度改由
|
|
15
15
|
* 头部那行"第 N / 4 步"承担(信息不丢,只是换了个地方)。
|
|
16
16
|
*/
|
|
@@ -38,7 +38,7 @@ export const TUTORIAL_CARDS = [
|
|
|
38
38
|
* 文案"一眼可读。
|
|
39
39
|
*/
|
|
40
40
|
const STEP_TEXT = {
|
|
41
|
-
|
|
41
|
+
access: { title: 'onboarding-step-access-title', desc: 'onboarding-step-access-desc' },
|
|
42
42
|
look: { title: 'onboarding-step-look-title', desc: 'onboarding-step-look-desc' },
|
|
43
43
|
model: { title: 'onboarding-step-model-title', desc: 'onboarding-step-model-desc' },
|
|
44
44
|
keys: { title: 'onboarding-step-keys-title', desc: 'onboarding-step-keys-desc' },
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure derivation for the first-run guide's "accounts and models" step: what
|
|
3
|
+
* a sign-in or a provider write actually produced, and what that means for
|
|
4
|
+
* the default model.
|
|
5
|
+
*
|
|
6
|
+
* The guide's first step used to be a read-only credential check, which left
|
|
7
|
+
* the user with an environment variable and no action. The configuration
|
|
8
|
+
* surfaces already exist (`/provider`, `dsh-auth`'s subscription sign-in);
|
|
9
|
+
* what was missing is the piece that catches their RESULT. That result is
|
|
10
|
+
* observable: `dsh-auth`'s catalog is credential-gated
|
|
11
|
+
* (`dsh-adapter/oauth/index.ts`, `CredentialGatedAdapter`), so a provider
|
|
12
|
+
* with no stored credential lists no models — the moment a sign-in or key
|
|
13
|
+
* write lands, its models appear in `channel.listModels()`.
|
|
14
|
+
*
|
|
15
|
+
* Everything here is a pure function of two catalog snapshots, so the
|
|
16
|
+
* three-way decision the product wants — nothing new, exactly one model, or
|
|
17
|
+
* several — is pinned by `scripts/verify-onboarding-provider-plan.ts` without
|
|
18
|
+
* a terminal, a channel, or a credential store.
|
|
19
|
+
*
|
|
20
|
+
* @module dsh-tui/components/onboardingProviderPlan
|
|
21
|
+
*/
|
|
22
|
+
import type { LlmModelInfo } from '../adapter/ports/channel-view.js';
|
|
23
|
+
/** One model row, reduced to the identity the diff and the pickers need. */
|
|
24
|
+
export interface ProviderModelRef {
|
|
25
|
+
readonly provider: string;
|
|
26
|
+
readonly id: string;
|
|
27
|
+
/** Display name; falls back to the id at the call site, never here. */
|
|
28
|
+
readonly name: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* What the adopter should do with the models that just appeared.
|
|
32
|
+
*
|
|
33
|
+
* - `none` — nothing new; the caller only reports the action's outcome.
|
|
34
|
+
* - `auto` — exactly one new model; it becomes the default without asking
|
|
35
|
+
* (the product rule: one candidate needs no question).
|
|
36
|
+
* - `ask` — several; the caller asks which one becomes the default. All of
|
|
37
|
+
* them are usable either way (the catalog is credential-gated, not
|
|
38
|
+
* selection-gated), so there is nothing to adopt or leave out — only a
|
|
39
|
+
* default to pick.
|
|
40
|
+
*/
|
|
41
|
+
export type AdoptionDecision = 'none' | 'auto' | 'ask';
|
|
42
|
+
/** The adoption plan for one action's catalog delta. */
|
|
43
|
+
export interface AdoptionPlan {
|
|
44
|
+
/**
|
|
45
|
+
* The provider this batch belongs to: the explicit filter when the caller
|
|
46
|
+
* knows what it acted on, else the first provider with new models. Absent
|
|
47
|
+
* only when nothing was added.
|
|
48
|
+
*/
|
|
49
|
+
readonly provider: string | undefined;
|
|
50
|
+
/** New models, current-catalog order, deduped by provider/id. */
|
|
51
|
+
readonly added: readonly ProviderModelRef[];
|
|
52
|
+
/** True when `added` spans more than one provider (copy needs the plural). */
|
|
53
|
+
readonly multiProvider: boolean;
|
|
54
|
+
readonly decision: AdoptionDecision;
|
|
55
|
+
/**
|
|
56
|
+
* The preselection for the `ask` branch: the live route when it is among
|
|
57
|
+
* the new models (a re-login of the provider already in use must not move
|
|
58
|
+
* the cursor), else the first added model. `undefined` for `none`.
|
|
59
|
+
*/
|
|
60
|
+
readonly defaultPick: ProviderModelRef | undefined;
|
|
61
|
+
}
|
|
62
|
+
/** Stable identity of one catalog row across snapshots. */
|
|
63
|
+
export declare function modelRefKey(ref: ProviderModelRef): string;
|
|
64
|
+
/**
|
|
65
|
+
* Reduce a channel catalog to the diffable rows.
|
|
66
|
+
*
|
|
67
|
+
* @param models - `channel.listModels()` result (advisory order preserved).
|
|
68
|
+
* @returns One row per model, in the order the catalog listed them.
|
|
69
|
+
*/
|
|
70
|
+
export declare function modelRefsOf(models: readonly LlmModelInfo[]): readonly ProviderModelRef[];
|
|
71
|
+
/**
|
|
72
|
+
* Models present now and absent from the baseline.
|
|
73
|
+
*
|
|
74
|
+
* @param baseline - Catalog snapshot taken BEFORE the action.
|
|
75
|
+
* @param current - Catalog snapshot taken after it.
|
|
76
|
+
* @param provider - Optional filter (the provider the action touched).
|
|
77
|
+
* @returns New rows in `current` order, deduped by provider/id.
|
|
78
|
+
*/
|
|
79
|
+
export declare function addedModelRefs(baseline: readonly ProviderModelRef[], current: readonly ProviderModelRef[], provider?: string): readonly ProviderModelRef[];
|
|
80
|
+
/**
|
|
81
|
+
* The whole step-1 decision in one call.
|
|
82
|
+
*
|
|
83
|
+
* Repeated calls with the same baseline are idempotent (`added` is a set
|
|
84
|
+
* difference), which is what lets a remount after a question panel re-run the
|
|
85
|
+
* same plan without asking about the same models twice — the baseline lives
|
|
86
|
+
* in `src/onboardingDraft.ts`, not in React state, exactly for that remount.
|
|
87
|
+
*
|
|
88
|
+
* @param input - Baseline and current catalogs, optional provider filter and
|
|
89
|
+
* the live route used to preselect the `ask` branch.
|
|
90
|
+
* @returns The plan described by {@link AdoptionPlan}.
|
|
91
|
+
*/
|
|
92
|
+
export declare function planModelAdoption(input: {
|
|
93
|
+
readonly baseline: readonly ProviderModelRef[];
|
|
94
|
+
readonly current: readonly ProviderModelRef[];
|
|
95
|
+
readonly provider?: string | undefined;
|
|
96
|
+
readonly currentRoute?: {
|
|
97
|
+
readonly provider: string;
|
|
98
|
+
readonly id: string;
|
|
99
|
+
} | undefined;
|
|
100
|
+
}): AdoptionPlan;
|
|
101
|
+
/**
|
|
102
|
+
* Provider ids in first-appearance order — the group order for the adoption
|
|
103
|
+
* layer, so a batch is presented in the order the catalog produced it rather
|
|
104
|
+
* than in a second, arbitrary sort.
|
|
105
|
+
*
|
|
106
|
+
* @param added - The plan's `added` rows.
|
|
107
|
+
* @returns Distinct provider ids.
|
|
108
|
+
*/
|
|
109
|
+
export declare function addedProviderOrder(added: readonly ProviderModelRef[]): readonly string[];
|
|
110
|
+
//# sourceMappingURL=onboardingProviderPlan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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H,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAC9C,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAC7C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAA;CACvF,GAAG,YAAY,CAef;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,GAAG,SAAS,MAAM,EAAE,CAIxF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** Stable identity of one catalog row across snapshots. */
|
|
2
|
+
export function modelRefKey(ref) {
|
|
3
|
+
return `${ref.provider}/${ref.id}`;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Reduce a channel catalog to the diffable rows.
|
|
7
|
+
*
|
|
8
|
+
* @param models - `channel.listModels()` result (advisory order preserved).
|
|
9
|
+
* @returns One row per model, in the order the catalog listed them.
|
|
10
|
+
*/
|
|
11
|
+
export function modelRefsOf(models) {
|
|
12
|
+
return models.map(model => ({ provider: model.provider, id: model.id, name: model.name }));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Models present now and absent from the baseline.
|
|
16
|
+
*
|
|
17
|
+
* @param baseline - Catalog snapshot taken BEFORE the action.
|
|
18
|
+
* @param current - Catalog snapshot taken after it.
|
|
19
|
+
* @param provider - Optional filter (the provider the action touched).
|
|
20
|
+
* @returns New rows in `current` order, deduped by provider/id.
|
|
21
|
+
*/
|
|
22
|
+
export function addedModelRefs(baseline, current, provider) {
|
|
23
|
+
const seen = new Set(baseline.map(modelRefKey));
|
|
24
|
+
const added = [];
|
|
25
|
+
for (const row of current) {
|
|
26
|
+
if (provider !== undefined && row.provider !== provider)
|
|
27
|
+
continue;
|
|
28
|
+
const key = modelRefKey(row);
|
|
29
|
+
if (seen.has(key))
|
|
30
|
+
continue;
|
|
31
|
+
seen.add(key);
|
|
32
|
+
added.push(row);
|
|
33
|
+
}
|
|
34
|
+
return added;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The whole step-1 decision in one call.
|
|
38
|
+
*
|
|
39
|
+
* Repeated calls with the same baseline are idempotent (`added` is a set
|
|
40
|
+
* difference), which is what lets a remount after a question panel re-run the
|
|
41
|
+
* same plan without asking about the same models twice — the baseline lives
|
|
42
|
+
* in `src/onboardingDraft.ts`, not in React state, exactly for that remount.
|
|
43
|
+
*
|
|
44
|
+
* @param input - Baseline and current catalogs, optional provider filter and
|
|
45
|
+
* the live route used to preselect the `ask` branch.
|
|
46
|
+
* @returns The plan described by {@link AdoptionPlan}.
|
|
47
|
+
*/
|
|
48
|
+
export function planModelAdoption(input) {
|
|
49
|
+
const added = addedModelRefs(input.baseline, input.current, input.provider);
|
|
50
|
+
const providers = new Set(added.map(row => row.provider));
|
|
51
|
+
const provider = input.provider
|
|
52
|
+
?? (added[0] === undefined ? undefined : added[0].provider);
|
|
53
|
+
const live = input.currentRoute === undefined
|
|
54
|
+
? undefined
|
|
55
|
+
: added.find(row => row.provider === input.currentRoute.provider && row.id === input.currentRoute.id);
|
|
56
|
+
return {
|
|
57
|
+
provider,
|
|
58
|
+
added,
|
|
59
|
+
multiProvider: providers.size > 1,
|
|
60
|
+
decision: added.length === 0 ? 'none' : added.length === 1 ? 'auto' : 'ask',
|
|
61
|
+
defaultPick: added.length === 0 ? undefined : live ?? added[0],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Provider ids in first-appearance order — the group order for the adoption
|
|
66
|
+
* layer, so a batch is presented in the order the catalog produced it rather
|
|
67
|
+
* than in a second, arbitrary sort.
|
|
68
|
+
*
|
|
69
|
+
* @param added - The plan's `added` rows.
|
|
70
|
+
* @returns Distinct provider ids.
|
|
71
|
+
*/
|
|
72
|
+
export function addedProviderOrder(added) {
|
|
73
|
+
const order = [];
|
|
74
|
+
for (const row of added)
|
|
75
|
+
if (!order.includes(row.provider))
|
|
76
|
+
order.push(row.provider);
|
|
77
|
+
return order;
|
|
78
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ScrollBoxHandle } from '../ui.js';
|
|
2
|
+
/** Page immediately: keyboard navigation must not leave queued wheel motion. */
|
|
3
|
+
export declare function pagePreview(scroll: ScrollBoxHandle | null, direction: -1 | 1): void;
|
|
4
|
+
export interface PreviewRowView {
|
|
5
|
+
/** Display rows to paint, each at most `cells` wide, in order. */
|
|
6
|
+
readonly rows: readonly string[];
|
|
7
|
+
/** Source rows that did not fit under the budget (0 = nothing cut). */
|
|
8
|
+
readonly omitted: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Wrap `text` to `cells` display cells and keep at most `maxRows` rows,
|
|
12
|
+
* reserving the last row for the omitted marker when anything is cut.
|
|
13
|
+
*
|
|
14
|
+
* @param text - the backend text (may contain newlines, wide chars, ANSI).
|
|
15
|
+
* @param cells - content width in display cells (the row's real width).
|
|
16
|
+
* @param maxRows - rows this block may occupy, marker included (≥1).
|
|
17
|
+
*/
|
|
18
|
+
export declare function clipPreviewRows(text: string, cells: number, maxRows: number): PreviewRowView;
|
|
19
|
+
//# sourceMappingURL=previewRows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"previewRows.d.ts","sourceRoot":"","sources":["../../../src/components/previewRows.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAMnF;AAED,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAU5F"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preview text clipped to a row budget — the shared bound for in-flow panels
|
|
3
|
+
* that show backend-authored text (an approval's command/reason/title, a
|
|
4
|
+
* questionnaire's question/detail) above their interactive tail.
|
|
5
|
+
*
|
|
6
|
+
* Those panels sit in the bottom chrome with `flexShrink: 0`, so their height
|
|
7
|
+
* IS their content height: unbounded text pushed the option rows and the key
|
|
8
|
+
* hint past the viewport, and the renderer clips rows below the screen — the
|
|
9
|
+
* user saw a wall of command text and no button to answer (#1664). Wrapping
|
|
10
|
+
* to the real content width first is what makes the budget exact: counting
|
|
11
|
+
* `split('\n')` rows under `wrap="wrap"` undercounts every long line.
|
|
12
|
+
*
|
|
13
|
+
* The caller renders one row per entry, then the omitted marker when
|
|
14
|
+
* `omitted > 0`. `rows.length + (omitted > 0 ? 1 : 0)` never exceeds
|
|
15
|
+
* `maxRows`, so a caller can subtract that from its budget.
|
|
16
|
+
*/
|
|
17
|
+
import wrapText from '../ink/wrap-text.js';
|
|
18
|
+
/** Page immediately: keyboard navigation must not leave queued wheel motion. */
|
|
19
|
+
export function pagePreview(scroll, direction) {
|
|
20
|
+
if (scroll === null)
|
|
21
|
+
return;
|
|
22
|
+
const rows = scroll.getViewportHeight();
|
|
23
|
+
const maxTop = Math.max(0, scroll.getFreshScrollHeight() - rows);
|
|
24
|
+
const next = scroll.getScrollTop() + direction * Math.max(1, rows - 1);
|
|
25
|
+
scroll.scrollTo(Math.max(0, Math.min(maxTop, next)));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Wrap `text` to `cells` display cells and keep at most `maxRows` rows,
|
|
29
|
+
* reserving the last row for the omitted marker when anything is cut.
|
|
30
|
+
*
|
|
31
|
+
* @param text - the backend text (may contain newlines, wide chars, ANSI).
|
|
32
|
+
* @param cells - content width in display cells (the row's real width).
|
|
33
|
+
* @param maxRows - rows this block may occupy, marker included (≥1).
|
|
34
|
+
*/
|
|
35
|
+
export function clipPreviewRows(text, cells, maxRows) {
|
|
36
|
+
// wrapText hard-wraps at `cells`, so every returned row renders as exactly
|
|
37
|
+
// one row (the Text node re-wraps but each line already fits).
|
|
38
|
+
const rows = wrapText(text, Math.max(1, Math.floor(cells)), 'wrap').split('\n');
|
|
39
|
+
const budget = Math.max(1, Math.floor(maxRows));
|
|
40
|
+
if (rows.length <= budget)
|
|
41
|
+
return { rows, omitted: 0 };
|
|
42
|
+
// A one-row budget can only say "there is more"; two rows show the first
|
|
43
|
+
// line plus the marker, and so on.
|
|
44
|
+
const shown = budget >= 2 ? rows.slice(0, budget - 1) : [];
|
|
45
|
+
return { rows: shown, omitted: rows.length - shown.length };
|
|
46
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AskUserQuestionPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/questions/AskUserQuestionPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"AskUserQuestionPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/questions/AskUserQuestionPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAClF,OAAO,KAAK,EAAE,mBAAmB,IA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