@deepseek-harness-tui/dsh-tui 0.11.0 → 0.11.2
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 +55 -20
- package/assets/whale-girl/whale-girl-dark.png +0 -0
- package/assets/whale-girl/whale-girl-happy.png +0 -0
- package/assets/whale-girl/whale-girl.png +0 -0
- package/bin/dsh-tui.js +63 -3
- package/cordis.patch.yml +43 -20
- package/cordis.yml +6 -4
- package/lib/settings.json +1272 -0
- package/lib/types/activityPrefs.d.ts +24 -0
- package/lib/types/activityPrefs.d.ts.map +1 -1
- package/lib/types/activityPrefs.js +50 -1
- package/lib/types/adapter/channel/state.d.ts.map +1 -1
- package/lib/types/adapter/channel/state.js +3 -1
- package/lib/types/adapter/channel/ui-policy.d.ts +9 -2
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +14 -1
- package/lib/types/adapter/kernel/replay.d.ts.map +1 -1
- package/lib/types/adapter/kernel/replay.js +2 -0
- package/lib/types/adapter/ports/channel-display.d.ts +12 -0
- package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-session.d.ts +38 -0
- package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-settings.d.ts +12 -0
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +53 -7
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +43 -12
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel.d.ts +4 -1
- package/lib/types/adapter/ports/channel.d.ts.map +1 -1
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +2 -0
- package/lib/types/components/ActivityLine.d.ts +7 -2
- package/lib/types/components/ActivityLine.d.ts.map +1 -1
- package/lib/types/components/ActivityLine.js +0 -8
- package/lib/types/components/BalanceReportRow.d.ts +10 -2
- package/lib/types/components/BalanceReportRow.d.ts.map +1 -1
- package/lib/types/components/BalanceReportRow.js +18 -4
- package/lib/types/components/CompactionStatusRow.d.ts +24 -0
- package/lib/types/components/CompactionStatusRow.d.ts.map +1 -0
- package/lib/types/components/CompactionStatusRow.js +72 -0
- package/lib/types/components/GoalTodoPanel.js +2 -2
- package/lib/types/components/HelpMenu.d.ts +2 -2
- package/lib/types/components/HelpMenu.d.ts.map +1 -1
- package/lib/types/components/HelpMenu.js +5 -4
- package/lib/types/components/InlineMathParagraph.d.ts +22 -0
- package/lib/types/components/InlineMathParagraph.d.ts.map +1 -0
- package/lib/types/components/InlineMathParagraph.js +178 -0
- package/lib/types/components/LogoV2.d.ts +41 -3
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +148 -24
- package/lib/types/components/Markdown.d.ts +10 -3
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +47 -14
- package/lib/types/components/MathBlock.d.ts +13 -0
- package/lib/types/components/MathBlock.d.ts.map +1 -0
- package/lib/types/components/MathBlock.js +136 -0
- package/lib/types/components/MessageList.d.ts +10 -1
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +15 -5
- package/lib/types/components/MigratePicker.d.ts +30 -0
- package/lib/types/components/MigratePicker.d.ts.map +1 -0
- package/lib/types/components/MigratePicker.js +38 -0
- package/lib/types/components/PromptInput.d.ts +17 -0
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +96 -9
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +3 -1
- package/lib/types/components/StarPrompt.d.ts +53 -0
- package/lib/types/components/StarPrompt.d.ts.map +1 -0
- package/lib/types/components/StarPrompt.js +281 -0
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
- package/lib/types/components/StreamingMarkdown.js +20 -3
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +12 -6
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +8 -3
- package/lib/types/components/TimelineRail.d.ts.map +1 -1
- package/lib/types/components/TimelineRail.js +9 -1
- package/lib/types/components/Whale.d.ts +17 -8
- package/lib/types/components/Whale.d.ts.map +1 -1
- package/lib/types/components/Whale.js +25 -15
- package/lib/types/components/WhaleGirl.d.ts +29 -0
- package/lib/types/components/WhaleGirl.d.ts.map +1 -0
- package/lib/types/components/WhaleGirl.js +32 -0
- package/lib/types/components/WorkingSpinner.d.ts +4 -1
- package/lib/types/components/WorkingSpinner.d.ts.map +1 -1
- package/lib/types/components/WorkingSpinner.js +2 -2
- package/lib/types/components/bigfont.d.ts +47 -18
- package/lib/types/components/bigfont.d.ts.map +1 -1
- package/lib/types/components/bigfont.js +55 -40
- package/lib/types/components/design-system/HintLine.d.ts +1 -2
- package/lib/types/components/design-system/HintLine.d.ts.map +1 -1
- package/lib/types/components/design-system/HintLine.js +1 -2
- package/lib/types/components/design-system/ThemeProvider.d.ts +6 -0
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +40 -1
- package/lib/types/components/maidPortrait.d.ts +44 -0
- package/lib/types/components/maidPortrait.d.ts.map +1 -0
- package/lib/types/components/maidPortrait.js +178 -0
- package/lib/types/components/mathPreview.d.ts +25 -0
- package/lib/types/components/mathPreview.d.ts.map +1 -0
- package/lib/types/components/mathPreview.js +48 -0
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +2 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +4 -2
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -2
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +31 -26
- package/lib/types/components/messages/TranscriptImages.d.ts.map +1 -1
- package/lib/types/components/messages/TranscriptImages.js +11 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +14 -2
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +80 -38
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +3 -3
- package/lib/types/components/sessions/ForeignSessionRow.d.ts +34 -0
- package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -0
- package/lib/types/components/sessions/ForeignSessionRow.js +43 -0
- package/lib/types/components/sessions/SourceTabs.d.ts +52 -0
- package/lib/types/components/sessions/SourceTabs.d.ts.map +1 -0
- package/lib/types/components/sessions/SourceTabs.js +70 -0
- package/lib/types/components/splashEggs.d.ts +56 -0
- package/lib/types/components/splashEggs.d.ts.map +1 -0
- package/lib/types/components/splashEggs.js +67 -0
- package/lib/types/components/splashFonts.d.ts +119 -0
- package/lib/types/components/splashFonts.d.ts.map +1 -0
- package/lib/types/components/splashFonts.js +267 -0
- package/lib/types/components/splashLayout.d.ts +41 -0
- package/lib/types/components/splashLayout.d.ts.map +1 -0
- package/lib/types/components/splashLayout.js +40 -0
- package/lib/types/components/whaleGirlSprite.d.ts +17 -0
- package/lib/types/components/whaleGirlSprite.d.ts.map +1 -0
- package/lib/types/components/whaleGirlSprite.js +47 -0
- package/lib/types/deepseekPricing.d.ts +74 -0
- package/lib/types/deepseekPricing.d.ts.map +1 -1
- package/lib/types/deepseekPricing.js +110 -11
- package/lib/types/dsh-adapter/activity-store.d.ts +221 -0
- package/lib/types/dsh-adapter/activity-store.d.ts.map +1 -0
- package/lib/types/dsh-adapter/activity-store.js +359 -0
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.js +6 -1
- package/lib/types/dsh-adapter/channel/background-action.d.ts +2 -1
- package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/background-action.js +2 -0
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +15 -14
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +70 -21
- package/lib/types/dsh-adapter/channel/compaction.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/compaction.js +35 -4
- package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/local-actions.js +6 -1
- package/lib/types/dsh-adapter/channel/model-switch.d.ts +1 -2
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.js +6 -2
- package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/paths.js +7 -1
- package/lib/types/dsh-adapter/channel/preferences.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/preferences.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/preferences.js +16 -0
- package/lib/types/dsh-adapter/channel/projection.d.ts +1 -2
- package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection.js +127 -17
- package/lib/types/dsh-adapter/channel/question-record.d.ts +76 -0
- package/lib/types/dsh-adapter/channel/question-record.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/question-record.js +107 -0
- package/lib/types/dsh-adapter/channel/session-adoption.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-adoption.js +1 -0
- package/lib/types/dsh-adapter/channel/session-lineage.d.ts +42 -0
- package/lib/types/dsh-adapter/channel/session-lineage.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-lineage.js +51 -0
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +3 -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 +10 -3
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts +2 -1
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +43 -9
- 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 +2 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +5 -2
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +8 -0
- package/lib/types/dsh-adapter/channel/state.d.ts +19 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +8 -3
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +32 -17
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +309 -8
- package/lib/types/dsh-adapter/channel/types.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.d.ts +1 -1
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +34 -18
- package/lib/types/dsh-adapter/compat/index.d.ts +1 -1
- package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/index.js +1 -1
- package/lib/types/dsh-adapter/compat/messages.d.ts +6 -0
- package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/messages.js +9 -0
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +18 -0
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.js +18 -3
- package/lib/types/dsh-adapter/compat/settings.d.ts +2 -0
- package/lib/types/dsh-adapter/compat/settings.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/settings.js +14 -0
- package/lib/types/dsh-adapter/contract.d.ts +5 -4
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +9 -5
- package/lib/types/dsh-adapter/index.d.ts +36 -1
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +22 -6
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.js +131 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.parse.d.ts +17 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.parse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.parse.js +329 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.js +102 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.parse.d.ts +16 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.parse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.parse.js +289 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.js +117 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.parse.d.ts +13 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.parse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.parse.js +178 -0
- package/lib/types/dsh-adapter/migrate/adapters/omp.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/omp.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/omp.js +133 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan-fs.d.ts +60 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan-fs.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan-fs.js +178 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan.d.ts +8 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan.js +40 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.js +93 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.parse.d.ts +9 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.parse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.parse.js +89 -0
- package/lib/types/dsh-adapter/migrate/bin-path.d.ts +6 -0
- package/lib/types/dsh-adapter/migrate/bin-path.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/bin-path.js +30 -0
- package/lib/types/dsh-adapter/migrate/browse.d.ts +42 -0
- package/lib/types/dsh-adapter/migrate/browse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/browse.js +90 -0
- package/lib/types/dsh-adapter/migrate/cli.d.ts +9 -0
- package/lib/types/dsh-adapter/migrate/cli.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/cli.js +106 -0
- package/lib/types/dsh-adapter/migrate/import-one.d.ts +89 -0
- package/lib/types/dsh-adapter/migrate/import-one.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/import-one.js +133 -0
- package/lib/types/dsh-adapter/migrate/index.d.ts +35 -0
- package/lib/types/dsh-adapter/migrate/index.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/index.js +107 -0
- package/lib/types/dsh-adapter/migrate/parse/injection.d.ts +40 -0
- package/lib/types/dsh-adapter/migrate/parse/injection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/injection.js +127 -0
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts +28 -0
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/jsonl.js +40 -0
- package/lib/types/dsh-adapter/migrate/parse/role-turns.d.ts +28 -0
- package/lib/types/dsh-adapter/migrate/parse/role-turns.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/role-turns.js +50 -0
- package/lib/types/dsh-adapter/migrate/parse/title.d.ts +18 -0
- package/lib/types/dsh-adapter/migrate/parse/title.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/title.js +29 -0
- package/lib/types/dsh-adapter/migrate/parse/tools.d.ts +62 -0
- package/lib/types/dsh-adapter/migrate/parse/tools.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/tools.js +110 -0
- package/lib/types/dsh-adapter/migrate/picker.d.ts +64 -0
- package/lib/types/dsh-adapter/migrate/picker.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/picker.js +86 -0
- package/lib/types/dsh-adapter/migrate/recent-agents.d.ts +40 -0
- package/lib/types/dsh-adapter/migrate/recent-agents.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/recent-agents.js +100 -0
- package/lib/types/dsh-adapter/migrate/sessionize.d.ts +39 -0
- package/lib/types/dsh-adapter/migrate/sessionize.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/sessionize.js +271 -0
- package/lib/types/dsh-adapter/migrate/types.d.ts +176 -0
- package/lib/types/dsh-adapter/migrate/types.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/types.js +11 -0
- package/lib/types/dsh-adapter/migrate/uuid.d.ts +7 -0
- package/lib/types/dsh-adapter/migrate/uuid.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/uuid.js +25 -0
- package/lib/types/dsh-adapter/plugin.d.ts +5 -3
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +168 -372
- package/lib/types/dsh-adapter/providerWizard.d.ts +17 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +254 -66
- package/lib/types/dsh-adapter/questions.d.ts +22 -15
- package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/questions.js +47 -45
- package/lib/types/dsh-adapter/sessions/digest.d.ts +11 -6
- package/lib/types/dsh-adapter/sessions/digest.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/digest.js +20 -13
- package/lib/types/dsh-adapter/sessions/frames.d.ts +3 -1
- package/lib/types/dsh-adapter/sessions/frames.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/frames.js +5 -4
- package/lib/types/dsh-adapter/sessions/list.d.ts +6 -1
- package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/list.js +188 -164
- package/lib/types/dsh-adapter/sessions/recovery.d.ts +16 -0
- package/lib/types/dsh-adapter/sessions/recovery.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessions/recovery.js +108 -0
- package/lib/types/dsh-adapter/sessions/snapshot.d.ts +7 -0
- package/lib/types/dsh-adapter/sessions/snapshot.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessions/snapshot.js +90 -0
- package/lib/types/dsh-adapter/sessions/store.d.ts +10 -4
- package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/store.js +62 -25
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +7 -4
- package/lib/types/dsh-adapter/sideQuestion.d.ts +41 -2
- package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sideQuestion.js +98 -2
- package/lib/types/dsh-adapter/subagents.d.ts +44 -6
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +163 -26
- package/lib/types/herdr.d.ts +2 -0
- package/lib/types/herdr.d.ts.map +1 -1
- package/lib/types/herdr.js +9 -3
- package/lib/types/history.d.ts +13 -1
- package/lib/types/history.d.ts.map +1 -1
- package/lib/types/history.js +15 -2
- package/lib/types/i18n.d.ts +512 -41
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +199 -20
- package/lib/types/ink/components/App.d.ts +2 -2
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +5 -1
- package/lib/types/ink/components/Image.d.ts +14 -1
- package/lib/types/ink/components/Image.d.ts.map +1 -1
- package/lib/types/ink/components/Image.js +2 -2
- package/lib/types/ink/events/input-event.js +3 -3
- package/lib/types/ink/hooks/use-terminal-images.d.ts +12 -0
- package/lib/types/ink/hooks/use-terminal-images.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-terminal-images.js +13 -0
- package/lib/types/ink/ink.d.ts +6 -0
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +16 -1
- package/lib/types/ink/kitty-graphics.d.ts +44 -3
- package/lib/types/ink/kitty-graphics.d.ts.map +1 -1
- package/lib/types/ink/kitty-graphics.js +184 -23
- package/lib/types/ink/log-update.d.ts.map +1 -1
- package/lib/types/ink/log-update.js +19 -1
- package/lib/types/ink/output.d.ts +24 -2
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +83 -5
- package/lib/types/ink/parse-keypress.d.ts +26 -1
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +156 -13
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +8 -1
- package/lib/types/ink/screen.d.ts +24 -0
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/screen.js +89 -0
- package/lib/types/ink/selection.d.ts +68 -18
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +178 -31
- package/lib/types/ink/sixel-codec.d.ts +12 -1
- package/lib/types/ink/sixel-codec.d.ts.map +1 -1
- package/lib/types/ink/sixel-codec.js +29 -5
- package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
- package/lib/types/ink/sixel-graphics.js +5 -3
- package/lib/types/ink/styles.d.ts +9 -0
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/terminal-image.d.ts +8 -0
- package/lib/types/ink/terminal-image.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.d.ts +7 -1
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +12 -2
- package/lib/types/ink/timeline-rail.d.ts +5 -0
- package/lib/types/ink/timeline-rail.d.ts.map +1 -1
- package/lib/types/math/inline-layout.d.ts +29 -0
- package/lib/types/math/inline-layout.d.ts.map +1 -0
- package/lib/types/math/inline-layout.js +106 -0
- package/lib/types/math/layout.d.ts +58 -0
- package/lib/types/math/layout.d.ts.map +1 -0
- package/lib/types/math/layout.js +59 -0
- package/lib/types/math/renderer.d.ts +64 -0
- package/lib/types/math/renderer.d.ts.map +1 -0
- package/lib/types/math/renderer.js +256 -0
- package/lib/types/screens/Chat.d.ts +17 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +618 -57
- package/lib/types/screens/SessionSupervisor.d.ts +2 -1
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +156 -19
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +49 -11
- package/lib/types/screens/StatusLine.d.ts +5 -1
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +47 -17
- package/lib/types/screens/chatOverlay.d.ts +5 -0
- package/lib/types/screens/chatOverlay.d.ts.map +1 -1
- package/lib/types/screens/chatOverlay.js +1 -0
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +47 -0
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -0
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +65 -0
- package/lib/types/screens/sessionSupervisor/model.d.ts +12 -0
- package/lib/types/screens/sessionSupervisor/model.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/model.js +26 -0
- package/lib/types/screens/sessionSupervisor/useForeignSessions.d.ts +107 -0
- package/lib/types/screens/sessionSupervisor/useForeignSessions.d.ts.map +1 -0
- package/lib/types/screens/sessionSupervisor/useForeignSessions.js +312 -0
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +4 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +97 -14
- package/lib/types/sessionHistory.d.ts +2 -2
- package/lib/types/sessionHistory.d.ts.map +1 -1
- package/lib/types/sessionHistory.js +31 -5
- package/lib/types/settings/definitions.d.ts +681 -0
- package/lib/types/settings/definitions.d.ts.map +1 -0
- package/lib/types/settings/definitions.js +511 -0
- package/lib/types/starAction.d.ts +44 -0
- package/lib/types/starAction.d.ts.map +1 -0
- package/lib/types/starAction.js +52 -0
- package/lib/types/terminal-utils/latex.d.ts +10 -0
- package/lib/types/terminal-utils/latex.d.ts.map +1 -0
- package/lib/types/terminal-utils/latex.js +1417 -0
- package/lib/types/terminal-utils/markdown.d.ts +3 -1
- package/lib/types/terminal-utils/markdown.d.ts.map +1 -1
- package/lib/types/terminal-utils/markdown.js +26 -1
- package/lib/types/terminal-utils/math.d.ts +66 -0
- package/lib/types/terminal-utils/math.d.ts.map +1 -0
- package/lib/types/terminal-utils/math.js +337 -0
- package/lib/types/tips.d.ts.map +1 -1
- package/lib/types/tips.js +6 -0
- package/lib/types/tuiDisplayPrefs.d.ts +67 -0
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +59 -0
- package/lib/types/ui.d.ts +1 -1
- package/lib/types/ui.d.ts.map +1 -1
- package/lib/types/ui.js +1 -1
- package/lib/types/usageStats.d.ts +98 -0
- package/lib/types/usageStats.d.ts.map +1 -0
- package/lib/types/usageStats.js +169 -0
- package/lib/types/utils/bmp.d.ts +17 -0
- package/lib/types/utils/bmp.d.ts.map +1 -0
- package/lib/types/utils/bmp.js +154 -0
- package/lib/types/utils/clipboard.d.ts +14 -2
- package/lib/types/utils/clipboard.d.ts.map +1 -1
- package/lib/types/utils/clipboard.js +143 -8
- package/lib/types/utils/fold-long-lines.d.ts +1 -1
- package/lib/types/utils/fold-long-lines.d.ts.map +1 -1
- package/lib/types/utils/fold-long-lines.js +3 -2
- package/lib/types/utils/keymap.d.ts +4 -1
- package/lib/types/utils/keymap.d.ts.map +1 -1
- package/lib/types/utils/keymap.js +8 -0
- package/lib/types/utils/modifiers.d.ts +4 -3
- package/lib/types/utils/modifiers.d.ts.map +1 -1
- package/lib/types/utils/modifiers.js +4 -3
- package/lib/types/working-activity.d.ts +10 -9
- package/lib/types/working-activity.d.ts.map +1 -1
- package/lib/types/working-activity.js +17 -10
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/LICENSE +202 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/NOTICE +20 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/index.d.ts +16 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/lib/bundled-packages.json +4 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/lib/index.mjs +20 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/lib/index.mjs.LEGAL.txt +35 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/package.json +29 -0
- package/package.json +117 -99
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts +0 -19
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts.map +0 -1
- package/lib/types/components/design-system/KeyboardShortcutHint.js +0 -14
- package/lib/types/dsh-adapter/channel/activity.d.ts +0 -20
- package/lib/types/dsh-adapter/channel/activity.d.ts.map +0 -1
- package/lib/types/dsh-adapter/channel/activity.js +0 -113
- package/lib/types/terminal-utils/terminal.d.ts +0 -18
- package/lib/types/terminal-utils/terminal.d.ts.map +0 -1
- package/lib/types/terminal-utils/terminal.js +0 -96
|
@@ -5,8 +5,12 @@ import { Box, Text } from '../ui.js';
|
|
|
5
5
|
import { configureMarked, formatToken, stripPromptXMLTags } from '../terminal-utils/markdown.js';
|
|
6
6
|
import { getCliHighlightPromise } from '../terminal-utils/cliHighlight.js';
|
|
7
7
|
import { isMermaidLang } from '../terminal-utils/mermaid.js';
|
|
8
|
+
import { isMathBlockToken, isMathToken } from '../terminal-utils/math.js';
|
|
9
|
+
import { getMathRendering, subscribeMathRendering } from '../tuiDisplayPrefs.js';
|
|
8
10
|
import { MarkdownTable } from './MarkdownTable.js';
|
|
9
11
|
import { MermaidDiagram } from './MermaidDiagram.js';
|
|
12
|
+
import { InlineMathParagraph } from './InlineMathParagraph.js';
|
|
13
|
+
import { MathBlock } from './MathBlock.js';
|
|
10
14
|
// ---- token 缓存 ----
|
|
11
15
|
//
|
|
12
16
|
// marked.lexer 在组件重挂载时是最贵的开销;消息内容不可变,相同文本
|
|
@@ -23,13 +27,11 @@ const TOKEN_CACHE_MAX_SOURCE_LENGTH = 20_000;
|
|
|
23
27
|
const TEXT_BLOCK_BUDGET = 8192;
|
|
24
28
|
const tokenCache = new Map();
|
|
25
29
|
let tokenCacheChars = 0;
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
const MD_SYNTAX_MARKERS = /[#*`|[>\-_
|
|
29
|
-
const SYNTAX_PROBE_WINDOW = 500;
|
|
30
|
+
// 语法探针:全文都没有结构标记时才跳过 lexer,不能仅凭纯文本前缀
|
|
31
|
+
// 忽略后面的公式或 Markdown。`$` 与 `\` 覆盖 LaTeX 公式定界符。
|
|
32
|
+
const MD_SYNTAX_MARKERS = /[#*`|[>\-_~$\\]|\n\n|^\d+\. |\n\d+\. /;
|
|
30
33
|
function looksLikePlainText(s) {
|
|
31
|
-
|
|
32
|
-
return !MD_SYNTAX_MARKERS.test(probe);
|
|
34
|
+
return !MD_SYNTAX_MARKERS.test(s);
|
|
33
35
|
}
|
|
34
36
|
function lexWithCache(content, allowCache) {
|
|
35
37
|
// 快速路径:纯文本直接合成单个段落 token,不触碰 lexer。
|
|
@@ -81,19 +83,28 @@ function lexWithCache(content, allowCache) {
|
|
|
81
83
|
* rather than the newline-derived spacing of text blocks.
|
|
82
84
|
*/
|
|
83
85
|
export function isStandaloneToken(token) {
|
|
84
|
-
return token.type === 'table' || isMermaidToken(token);
|
|
86
|
+
return token.type === 'table' || isMermaidToken(token) || isMathBlockToken(token);
|
|
87
|
+
}
|
|
88
|
+
/** Whether a paragraph holds inline math anywhere in its inline tokens. */
|
|
89
|
+
function hasInlineMath(token) {
|
|
90
|
+
for (const child of token.tokens ?? []) {
|
|
91
|
+
if (isMathToken(child) || hasInlineMath(child))
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
return false;
|
|
85
95
|
}
|
|
86
96
|
function isMermaidToken(token) {
|
|
87
97
|
return token.type === 'code' && isMermaidLang(token.lang);
|
|
88
98
|
}
|
|
89
99
|
/**
|
|
90
|
-
* 把 lexer 产出的 token 列表转成 React 节点序列:table
|
|
91
|
-
*
|
|
100
|
+
* 把 lexer 产出的 token 列表转成 React 节点序列:table、mermaid 与公式块
|
|
101
|
+
* 独立渲染,其余 token 的 ANSI 文本按完整块分批拼接,只去整段首尾空白。
|
|
92
102
|
*/
|
|
93
|
-
function renderTokensToNodes(tokens, highlight, dimColor) {
|
|
103
|
+
function renderTokensToNodes(tokens, highlight, dimColor, inlineMathImages) {
|
|
94
104
|
const nodes = [];
|
|
95
105
|
let ansiText = '';
|
|
96
106
|
let textParts = [];
|
|
107
|
+
let afterOwnNode = false;
|
|
97
108
|
const flushAnsiText = () => {
|
|
98
109
|
if (!ansiText && textParts.length === 0)
|
|
99
110
|
return;
|
|
@@ -118,10 +129,26 @@ function renderTokensToNodes(tokens, highlight, dimColor) {
|
|
|
118
129
|
textParts = [];
|
|
119
130
|
};
|
|
120
131
|
for (const token of tokens) {
|
|
132
|
+
const ownNodeBefore = afterOwnNode;
|
|
133
|
+
afterOwnNode = false;
|
|
121
134
|
if (token.type === 'table') {
|
|
122
135
|
flushAnsiText();
|
|
123
136
|
nodes.push(_jsx(MarkdownTable, { token: token, highlight: highlight }, nodes.length));
|
|
124
137
|
}
|
|
138
|
+
else if (inlineMathImages && token.type === 'paragraph' && hasInlineMath(token)) {
|
|
139
|
+
flushAnsiText();
|
|
140
|
+
nodes.push(_jsx(InlineMathParagraph, { token: token, highlight: highlight }, nodes.length));
|
|
141
|
+
afterOwnNode = true;
|
|
142
|
+
}
|
|
143
|
+
else if (ownNodeBefore && token.type === 'space') {
|
|
144
|
+
// The blank line after a paragraph that became its own node is the
|
|
145
|
+
// column gap now; as text it would flush as an empty node (an extra
|
|
146
|
+
// gap row). In a text run the same newline is trimmed at the flush.
|
|
147
|
+
}
|
|
148
|
+
else if (isMathBlockToken(token)) {
|
|
149
|
+
flushAnsiText();
|
|
150
|
+
nodes.push(_jsx(MathBlock, { token: token, dimColor: dimColor }, nodes.length));
|
|
151
|
+
}
|
|
125
152
|
else if (isMermaidToken(token)) {
|
|
126
153
|
flushAnsiText();
|
|
127
154
|
nodes.push(_jsx(MermaidDiagram, { token: token, highlight: highlight, dimColor: dimColor }, nodes.length));
|
|
@@ -150,8 +177,11 @@ function renderTokensToNodes(tokens, highlight, dimColor) {
|
|
|
150
177
|
* block — the dominant long-output stall (string-width via wrap-ansi, 60%+
|
|
151
178
|
* of CPU in streaming profiles).
|
|
152
179
|
*/
|
|
153
|
-
function MarkdownImpl({ children, dimColor = false, cacheTokens = true }) {
|
|
180
|
+
function MarkdownImpl({ children, dimColor = false, cacheTokens = true, inlineMathImages = true }) {
|
|
154
181
|
const [highlight, setHighlight] = React.useState(null);
|
|
182
|
+
// Inline math is baked into the ANSI text, so the switch must invalidate
|
|
183
|
+
// the memo below (MathBlock nodes subscribe on their own).
|
|
184
|
+
const mathRendering = React.useSyncExternalStore(subscribeMathRendering, getMathRendering);
|
|
155
185
|
React.useEffect(() => {
|
|
156
186
|
let mounted = true;
|
|
157
187
|
void getCliHighlightPromise().then((loaded) => {
|
|
@@ -165,8 +195,10 @@ function MarkdownImpl({ children, dimColor = false, cacheTokens = true }) {
|
|
|
165
195
|
configureMarked();
|
|
166
196
|
const renderedNodes = React.useMemo(() => {
|
|
167
197
|
const source = stripPromptXMLTags(children);
|
|
168
|
-
return renderTokensToNodes(lexWithCache(source, cacheTokens), highlight, dimColor
|
|
169
|
-
|
|
198
|
+
return renderTokensToNodes(lexWithCache(source, cacheTokens), highlight, dimColor,
|
|
199
|
+
// Dimmed text (thinking) cannot dim an image, so it keeps Unicode.
|
|
200
|
+
inlineMathImages && mathRendering === 'image' && !dimColor);
|
|
201
|
+
}, [children, dimColor, highlight, cacheTokens, mathRendering, inlineMathImages]);
|
|
170
202
|
return (_jsx(Box, { flexDirection: "column", gap: 1, children: renderedNodes }));
|
|
171
203
|
}
|
|
172
204
|
/**
|
|
@@ -175,4 +207,5 @@ function MarkdownImpl({ children, dimColor = false, cacheTokens = true }) {
|
|
|
175
207
|
*/
|
|
176
208
|
export const Markdown = React.memo(MarkdownImpl, (prev, next) => prev.children === next.children &&
|
|
177
209
|
prev.dimColor === next.dimColor &&
|
|
178
|
-
prev.cacheTokens === next.cacheTokens
|
|
210
|
+
prev.cacheTokens === next.cacheTokens &&
|
|
211
|
+
prev.inlineMathImages === next.inlineMathImages);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MathToken } from '../terminal-utils/math.js';
|
|
3
|
+
type Props = {
|
|
4
|
+
token: MathToken;
|
|
5
|
+
dimColor: boolean;
|
|
6
|
+
/** Override terminal width (useful for testing). */
|
|
7
|
+
forceWidth?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function MathBlock({ token, dimColor, forceWidth }: Props): React.ReactNode;
|
|
10
|
+
/** A theme color as `#rrggbb`, or undefined for ANSI names the image cannot match. */
|
|
11
|
+
export declare function themeInkHex(color: string): string | undefined;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=MathBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MathBlock.d.ts","sourceRoot":"","sources":["../../../src/components/MathBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAA;AA+B/F,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CA+FjF;AAgCD,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK7D"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Box, Image, Text, useTerminalImageCellSize, useTerminalImages } from '../ui.js';
|
|
4
|
+
import { useTerminalSize } from '../ink/hooks/use-terminal-size.js';
|
|
5
|
+
import { stringWidth } from '../ink/stringWidth.js';
|
|
6
|
+
import { peekMathRaster, renderMathRaster } from '../math/renderer.js';
|
|
7
|
+
import { getTheme } from '../theme.js';
|
|
8
|
+
import { LARGE_DISPLAY_EX_TO_CELL_HEIGHT, XLARGE_DISPLAY_EX_TO_CELL_HEIGHT } from '../math/layout.js';
|
|
9
|
+
import { renderDisplayMath, renderInlineMath } from '../terminal-utils/math.js';
|
|
10
|
+
import { getMathImageBacking, getMathImageScale, getMathRendering, subscribeMathImageBacking, subscribeMathImageScale, subscribeMathRendering } from '../tuiDisplayPrefs.js';
|
|
11
|
+
import { useTerminalBackground, useTheme } from './design-system/ThemeProvider.js';
|
|
12
|
+
import { useMathPreviewOpener } from './mathPreview.js';
|
|
13
|
+
/**
|
|
14
|
+
* A `$$…$$` / `\[…\]` block rendered as display-mode Unicode: fractions and
|
|
15
|
+
* operator limits stacked over several rows, indented like a code-block body.
|
|
16
|
+
* The indent is layout padding rather than leading spaces, so a wrapped
|
|
17
|
+
* single-line fallback keeps it on every row.
|
|
18
|
+
*
|
|
19
|
+
* A stacked layout cannot wrap, so when it is wider than the viewport the
|
|
20
|
+
* block falls back to the single-line form (which wraps like prose), and
|
|
21
|
+
* when there is none of that either, to the exact source. The source is also
|
|
22
|
+
* what shows while the block is still streaming (no closer yet), when the
|
|
23
|
+
* formula is unsupported, and when the setting is off.
|
|
24
|
+
*
|
|
25
|
+
* With `mathRendering: image`, a complete block is typeset by MathJax and
|
|
26
|
+
* shown as a terminal image in the theme's text color when the terminal
|
|
27
|
+
* supports graphics and reports its cell size. The Unicode rendering shows
|
|
28
|
+
* until the image is ready and stays whenever any step fails, so the image
|
|
29
|
+
* path can only upgrade a block, never lose it.
|
|
30
|
+
*/
|
|
31
|
+
/** Same viewport slack MarkdownTable and MermaidDiagram keep. */
|
|
32
|
+
const SAFETY_MARGIN = 4;
|
|
33
|
+
/** Left padding in columns, matching the code-block body indent. */
|
|
34
|
+
const INDENT_WIDTH = 2;
|
|
35
|
+
/** Tallest image a block may take; taller formulas shrink to fit. */
|
|
36
|
+
const IMAGE_MAX_ROWS = 16;
|
|
37
|
+
export function MathBlock({ token, dimColor, forceWidth }) {
|
|
38
|
+
const mode = React.useSyncExternalStore(subscribeMathRendering, getMathRendering);
|
|
39
|
+
// Display size is a user choice now (settings `mathImageScale`): bigger
|
|
40
|
+
// images are also the only way a terminal gets more pixels per stroke.
|
|
41
|
+
const imageScale = React.useSyncExternalStore(subscribeMathImageScale, getMathImageScale);
|
|
42
|
+
const exToCellHeight = imageScale === 'xlarge'
|
|
43
|
+
? XLARGE_DISPLAY_EX_TO_CELL_HEIGHT
|
|
44
|
+
: imageScale === 'large' ? LARGE_DISPLAY_EX_TO_CELL_HEIGHT : undefined;
|
|
45
|
+
// What sits behind the formula: transparent (only its own pixels) or the
|
|
46
|
+
// terminal's own background colour, composited first.
|
|
47
|
+
const backdrop = React.useSyncExternalStore(subscribeMathImageBacking, getMathImageBacking);
|
|
48
|
+
const composited = backdrop === 'terminal';
|
|
49
|
+
const terminalBackground = useTerminalBackground();
|
|
50
|
+
const enabled = mode !== 'source';
|
|
51
|
+
const { columns } = useTerminalSize();
|
|
52
|
+
const width = Math.max(0, forceWidth ?? columns);
|
|
53
|
+
const renderable = enabled && token.pending !== true;
|
|
54
|
+
const budget = width - INDENT_WIDTH - SAFETY_MARGIN;
|
|
55
|
+
// Dimmed blocks (e.g. inside thinking) keep text: an image cannot dim.
|
|
56
|
+
const wantImage = mode === 'image' && renderable && !dimColor && budget > 0;
|
|
57
|
+
const graphics = useTerminalImages(wantImage);
|
|
58
|
+
const cellSize = useTerminalImageCellSize();
|
|
59
|
+
const [themeName] = useTheme();
|
|
60
|
+
const color = themeInkHex(getTheme(themeName).text);
|
|
61
|
+
const request = wantImage && graphics && cellSize !== undefined && color !== undefined
|
|
62
|
+
? {
|
|
63
|
+
tex: token.text, display: true, color, cellSize, maxColumns: budget, maxRows: IMAGE_MAX_ROWS,
|
|
64
|
+
...(exToCellHeight === undefined ? {} : { baseExToCellHeight: exToCellHeight }),
|
|
65
|
+
}
|
|
66
|
+
: undefined;
|
|
67
|
+
const raster = useMathRaster(request);
|
|
68
|
+
const previewMath = useMathPreviewOpener();
|
|
69
|
+
// Layout is width-independent; a resize only re-checks the fit.
|
|
70
|
+
const lines = React.useMemo(() => (renderable ? renderDisplayMath(token.text) : undefined), [renderable, token.text]);
|
|
71
|
+
if (raster !== undefined && request !== undefined) {
|
|
72
|
+
// What the box shows when the renderer does not place the image (e.g. a
|
|
73
|
+
// Kitty image partly scrolled out before cropping is available): the
|
|
74
|
+
// stacked Unicode layout when it fits the box, else the one-line form
|
|
75
|
+
// wrapped across it, so every visible row of the box carries the formula.
|
|
76
|
+
const stackedFits = lines !== undefined && lines.length <= raster.rows &&
|
|
77
|
+
lines.every(line => stringWidth(line) <= raster.columns);
|
|
78
|
+
const painted = (_jsx(Image, { ...(composited ? {} : { transparent: true }), presentation: "transcript", source: raster.source, width: raster.columns, height: raster.rows, alt: token.text, copyText: token.raw.trim(), children: _jsx(Box, { width: raster.columns, height: raster.rows, overflow: "hidden", children: _jsx(Text, { dimColor: true, wrap: stackedFits ? 'truncate' : 'wrap', children: stackedFits ? lines.join('\n') : renderInlineMath(token.text) ?? token.text }) }) }));
|
|
79
|
+
// A composited formula needs a real surface: the slot carries the terminal
|
|
80
|
+
// background, so both the placement and its cells use that colour.
|
|
81
|
+
const image = composited
|
|
82
|
+
? (_jsx(Box, { width: raster.columns, height: raster.rows, flexShrink: 0, backgroundColor: terminalBackground, children: painted }))
|
|
83
|
+
: painted;
|
|
84
|
+
return (_jsx(Box, { paddingLeft: INDENT_WIDTH, children: previewMath === undefined
|
|
85
|
+
? image
|
|
86
|
+
: (_jsx(Box, { onClick: event => { event.stopImmediatePropagation(); previewMath({ tex: token.text, request, source: raster.source }); }, children: image })) }));
|
|
87
|
+
}
|
|
88
|
+
if (lines !== undefined && lines.every(line => stringWidth(line) <= budget)) {
|
|
89
|
+
return (_jsx(Box, { paddingLeft: INDENT_WIDTH, children: _jsx(Text, { dimColor: dimColor, children: lines.join('\n') }) }));
|
|
90
|
+
}
|
|
91
|
+
const linear = renderable && lines !== undefined ? renderInlineMath(token.text) : undefined;
|
|
92
|
+
if (linear !== undefined) {
|
|
93
|
+
return (_jsx(Box, { paddingLeft: INDENT_WIDTH, children: _jsx(Text, { dimColor: dimColor, children: linear }) }));
|
|
94
|
+
}
|
|
95
|
+
return _jsx(Text, { dimColor: dimColor, children: token.raw.trim() });
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The typeset image for `request`, or undefined while it renders, when it
|
|
99
|
+
* failed, or when there is no request. A cached result is used on the first
|
|
100
|
+
* render, so a block scrolled back into view does not flash its fallback.
|
|
101
|
+
*/
|
|
102
|
+
function useMathRaster(request) {
|
|
103
|
+
const cached = request === undefined ? undefined : peekMathRaster(request);
|
|
104
|
+
const [settled, setSettled] = React.useState();
|
|
105
|
+
const pending = request !== undefined && cached === undefined ? request : undefined;
|
|
106
|
+
const key = pending === undefined ? undefined : requestKey(pending);
|
|
107
|
+
React.useEffect(() => {
|
|
108
|
+
if (pending === undefined)
|
|
109
|
+
return;
|
|
110
|
+
let live = true;
|
|
111
|
+
void renderMathRaster(pending).then(result => {
|
|
112
|
+
if (live)
|
|
113
|
+
setSettled({ request: pending, raster: result.ok ? result.raster : undefined });
|
|
114
|
+
});
|
|
115
|
+
return () => { live = false; };
|
|
116
|
+
// `key` captures every field of the request.
|
|
117
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
118
|
+
}, [key]);
|
|
119
|
+
if (cached !== undefined)
|
|
120
|
+
return cached.ok ? cached.raster : undefined;
|
|
121
|
+
return settled !== undefined && request !== undefined && requestKey(settled.request) === requestKey(request)
|
|
122
|
+
? settled.raster
|
|
123
|
+
: undefined;
|
|
124
|
+
}
|
|
125
|
+
function requestKey(request) {
|
|
126
|
+
return [request.tex, request.color, request.cellSize.width, request.cellSize.height, request.maxColumns, request.maxRows, request.baseExToCellHeight ?? ''].join('\u0000');
|
|
127
|
+
}
|
|
128
|
+
/** A theme color as `#rrggbb`, or undefined for ANSI names the image cannot match. */
|
|
129
|
+
export function themeInkHex(color) {
|
|
130
|
+
if (/^#[0-9a-f]{6}$/i.test(color))
|
|
131
|
+
return color;
|
|
132
|
+
const match = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/.exec(color);
|
|
133
|
+
if (match === null)
|
|
134
|
+
return undefined;
|
|
135
|
+
return `#${match.slice(1, 4).map(channel => Math.min(255, Number(channel)).toString(16).padStart(2, '0')).join('')}`;
|
|
136
|
+
}
|
|
@@ -129,13 +129,22 @@ export declare function MessageList({ rows, expanded, expandedRows, selectedId,
|
|
|
129
129
|
* welcome line. It scrolls away with the transcript once the conversation
|
|
130
130
|
* fills the viewport.
|
|
131
131
|
*/
|
|
132
|
-
export declare function LogoHeader({ model, effort, cwd, whale, whaleIdle, working, skipIntro, }: {
|
|
132
|
+
export declare function LogoHeader({ model, effort, cwd, fontId, whale, whaleIdle, whaleGirl, starred, onStarClick, working, skipIntro, }: {
|
|
133
133
|
model: string;
|
|
134
134
|
effort?: string | undefined;
|
|
135
135
|
cwd: string;
|
|
136
|
+
/** Big-text face pin (settings `dsh-tui.splashFont`; `undefined` leaves
|
|
137
|
+
* `LogoV2` on its date rotation). Passed through to LogoV2. */
|
|
138
|
+
fontId?: string | undefined;
|
|
136
139
|
whale?: boolean;
|
|
137
140
|
/** Idle whale behaviors + working signal (passed through to LogoV2). */
|
|
138
141
|
whaleIdle?: boolean;
|
|
142
|
+
/** Maid portrait swap (passed through to LogoV2; settings `dsh-tui.whaleGirl`). */
|
|
143
|
+
whaleGirl?: boolean;
|
|
144
|
+
/** 求 star 标语行被点击(一键 star;host 不传则不可点)。 */
|
|
145
|
+
onStarClick?: () => void;
|
|
146
|
+
/** 本次会话已 star(彩蛋换「捡到星星」版)。 */
|
|
147
|
+
starred?: boolean;
|
|
139
148
|
working?: boolean;
|
|
140
149
|
/** Jump straight to the settled header (long-session resume: the ~3.4s
|
|
141
150
|
* opening animation competes with transcript mount batches). */
|
|
@@ -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,EAA8D,MAAM,2BAA2B,CAAA;AAEpH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAmB/C,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":"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"}
|
|
@@ -25,11 +25,13 @@ import { clipPreview } from '../ink/timeline-rail.js';
|
|
|
25
25
|
import { getRevealVersion, revealLengthOf, revealTextOf } from './smoothReveal.js';
|
|
26
26
|
import { useRevealVersion } from '../hooks/useRevealVersion.js';
|
|
27
27
|
import { TranscriptImages } from './messages/TranscriptImages.js';
|
|
28
|
+
import { primaryComboString } from '../utils/keymap.js';
|
|
28
29
|
/**
|
|
29
30
|
* Transcript rows rendered with the dsh-TUI message layout: user prompts
|
|
30
31
|
* on a grey bubble with a `❯` pointer, assistant text with a `●` bullet and
|
|
31
32
|
* markdown, thinking as a live three-line/full toggle then a settled
|
|
32
|
-
* `⚓ Thinking
|
|
33
|
+
* `⚓ Thinking` row with the localized ctrl+o expand hint, and tool calls as
|
|
34
|
+
* status-dot cards.
|
|
33
35
|
* `expanded` (Ctrl+O) shows full reasoning + full tool
|
|
34
36
|
* args/results; `expandedRows` (message-selection mode, Enter) expands single
|
|
35
37
|
* rows; `selectedId` highlights the selected row.
|
|
@@ -763,6 +765,7 @@ export function MessageList({ rows, expanded, expandedRows, selectedId, onToggle
|
|
|
763
765
|
// post-commit, only when the signature changes.
|
|
764
766
|
let timelineTurns = [];
|
|
765
767
|
let activeTurnIndex = null;
|
|
768
|
+
let pinnedTurnIndex = null;
|
|
766
769
|
let upTurnIndex = null;
|
|
767
770
|
let downTurnIndex = null;
|
|
768
771
|
const timelineMemoRef = React.useRef(null);
|
|
@@ -855,10 +858,16 @@ export function MessageList({ rows, expanded, expandedRows, selectedId, onToggle
|
|
|
855
858
|
}
|
|
856
859
|
if (timelineTurns.length > 0 && activeTurnIndex === null)
|
|
857
860
|
activeTurnIndex = 0;
|
|
861
|
+
if (activeTurnIndex !== null) {
|
|
862
|
+
const active = timelineTurns[activeTurnIndex];
|
|
863
|
+
if (active.folded === true || active.top < viewTop)
|
|
864
|
+
pinnedTurnIndex = activeTurnIndex;
|
|
865
|
+
}
|
|
858
866
|
}
|
|
859
867
|
const timeline = {
|
|
860
868
|
turns: timelineTurns,
|
|
861
869
|
activeId: activeTurnIndex === null ? null : timelineTurns[activeTurnIndex].id,
|
|
870
|
+
pinnedId: pinnedTurnIndex === null ? null : timelineTurns[pinnedTurnIndex].id,
|
|
862
871
|
upId: upTurnIndex === null ? null : timelineTurns[upTurnIndex].id,
|
|
863
872
|
downId: downTurnIndex === null ? null : timelineTurns[downTurnIndex].id,
|
|
864
873
|
};
|
|
@@ -877,6 +886,7 @@ export function MessageList({ rows, expanded, expandedRows, selectedId, onToggle
|
|
|
877
886
|
const prev = lastTimelineReportRef.current;
|
|
878
887
|
if (prev !== null &&
|
|
879
888
|
prev.activeId === timeline.activeId &&
|
|
889
|
+
prev.pinnedId === timeline.pinnedId &&
|
|
880
890
|
prev.upId === timeline.upId &&
|
|
881
891
|
prev.downId === timeline.downId &&
|
|
882
892
|
prev.turns.length === timeline.turns.length &&
|
|
@@ -987,7 +997,7 @@ export function MessageList({ rows, expanded, expandedRows, selectedId, onToggle
|
|
|
987
997
|
localRefs.current.delete(rowId);
|
|
988
998
|
registerRowRef?.(rowId, el);
|
|
989
999
|
}, [registerRowRef]);
|
|
990
|
-
return (_jsxs(_Fragment, { children: [rows.some(row => row.folded) && (_jsx(ClickableDivider, { title: t('load-earlier'), onClick: onLoadOlder })), !showAll && hiddenCount > 0 && (_jsx(ClickableDivider, { title: t('show-previous-messages', { n: hiddenCount }), onClick: onToggleAll })), topPad > 0 && _jsx(Box, { height: topPad, flexShrink: 0 }), visibleRows
|
|
1000
|
+
return (_jsxs(_Fragment, { children: [rows.some(row => row.folded) && (_jsx(ClickableDivider, { title: t('load-earlier'), onClick: onLoadOlder })), !showAll && hiddenCount > 0 && (_jsx(ClickableDivider, { title: t('show-previous-messages', { n: hiddenCount, key: primaryComboString('showAll') }), onClick: onToggleAll })), topPad > 0 && _jsx(Box, { height: topPad, flexShrink: 0 }), visibleRows
|
|
991
1001
|
.slice(start, end)
|
|
992
1002
|
.map((row) => {
|
|
993
1003
|
// The pre-pass result keeps windowed rows at full-mount
|
|
@@ -1135,7 +1145,7 @@ function TranscriptRow({ rowId, kind, text, images, textFull, executionTarget, s
|
|
|
1135
1145
|
// The post-compaction summary defaults to a folded one-liner with a
|
|
1136
1146
|
// text preview; Ctrl+O (global), message-selection Enter, or a click
|
|
1137
1147
|
// reveals the full summary.
|
|
1138
|
-
return (_jsx(Box, { marginTop: marginTopOnTurn ? 1 : 0, paddingLeft: 2, backgroundColor: background, ref: ref, onClick: foldOnClick, onMouseEnter: () => setCompactHovered(true), onMouseLeave: () => setCompactHovered(false), children: expanded || isExpanded ? (_jsx(Text, { dimColor: true, children: text })) : (_jsxs(Text, { dimColor: true, italic: true, color: compactHovered ? 'text' : undefined, children: [_jsx(Text, { color: compactHovered ? 'text' : undefined, children: "\u2234" }), ' ', t('compact-summary-folded'), " \u00B7 ", compactPreview(displayText), ' ', t('hint-expand-ctrl-o')] })) }));
|
|
1148
|
+
return (_jsx(Box, { marginTop: marginTopOnTurn ? 1 : 0, paddingLeft: 2, backgroundColor: background, ref: ref, onClick: foldOnClick, onMouseEnter: () => setCompactHovered(true), onMouseLeave: () => setCompactHovered(false), children: expanded || isExpanded ? (_jsx(Text, { dimColor: true, children: text })) : (_jsxs(Text, { dimColor: true, italic: true, color: compactHovered ? 'text' : undefined, children: [_jsx(Text, { color: compactHovered ? 'text' : undefined, children: "\u2234" }), ' ', t('compact-summary-folded'), " \u00B7 ", compactPreview(displayText), ' ', t('hint-expand-ctrl-o', { key: primaryComboString('transcript') })] })) }));
|
|
1139
1149
|
case 'subagent':
|
|
1140
1150
|
if (!subagent)
|
|
1141
1151
|
return null;
|
|
@@ -1160,10 +1170,10 @@ const MemoRow = React.memo(TranscriptRow);
|
|
|
1160
1170
|
* welcome line. It scrolls away with the transcript once the conversation
|
|
1161
1171
|
* fills the viewport.
|
|
1162
1172
|
*/
|
|
1163
|
-
export function LogoHeader({ model, effort, cwd, whale = true, whaleIdle = true, working = false, skipIntro = false, }) {
|
|
1173
|
+
export function LogoHeader({ model, effort, cwd, fontId, whale = true, whaleIdle = true, whaleGirl = false, starred = false, onStarClick, working = false, skipIntro = false, }) {
|
|
1164
1174
|
// Minimal mode drops the whole splash (whale art AND wordmark) — only the
|
|
1165
1175
|
// transcript and a bare status bar remain.
|
|
1166
1176
|
if (isMinimalMode())
|
|
1167
1177
|
return null;
|
|
1168
|
-
return (_jsx(Box, { flexDirection: "column", marginBottom: 1, children: _jsx(LogoV2, { model: model, effort: effort, cwd: cwd, whale: whale, whaleIdle: whaleIdle, working: working, skipIntro: skipIntro }) }));
|
|
1178
|
+
return (_jsx(Box, { flexDirection: "column", marginBottom: 1, children: _jsx(LogoV2, { model: model, effort: effort, cwd: cwd, fontId: fontId, whale: whale, whaleIdle: whaleIdle, whaleGirl: whaleGirl, starred: starred, onStarClick: onStarClick, working: working, skipIntro: skipIntro }) }));
|
|
1169
1179
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MigratePickerRow } from '../dsh-adapter/migrate/picker.js';
|
|
3
|
+
/**
|
|
4
|
+
* `/migrate` source picker (multi-select, PRD revision): each row shows a
|
|
5
|
+
* checkbox, the scannable file count, and a recent-activity badge. Keys
|
|
6
|
+
* (Chat owns the logic): space toggles the focused source, `a` selects
|
|
7
|
+
* all/none, Enter proceeds to the confirmation layer with the checked set
|
|
8
|
+
* (the focused row when nothing is checked), Esc closes. While the rows are
|
|
9
|
+
* still being collected it says so — the scan takes a moment on real stores
|
|
10
|
+
* and "no sources available" would be a lie in that window.
|
|
11
|
+
*/
|
|
12
|
+
export declare function MigratePicker({ rows, focusIndex, checked, loading, onPick, }: {
|
|
13
|
+
rows: readonly MigratePickerRow[];
|
|
14
|
+
focusIndex: number;
|
|
15
|
+
/** Checked agent ids (multi-select state lives in Chat). */
|
|
16
|
+
checked: ReadonlySet<string>;
|
|
17
|
+
/** Rows still loading: render the scanning line, not the empty state. */
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
/** Mouse pick (fullscreen): toggle the clicked row's checked state. */
|
|
20
|
+
onPick?: (index: number) => void;
|
|
21
|
+
}): React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* The second confirmation layer (PRD #2): one line per checked source with
|
|
24
|
+
* its scannable count and the repeat-safe note. Keys (Chat): Enter imports,
|
|
25
|
+
* `d` dry-runs, Esc returns to the picker with the checked set preserved.
|
|
26
|
+
*/
|
|
27
|
+
export declare function MigrateConfirm({ rows, }: {
|
|
28
|
+
rows: readonly MigratePickerRow[];
|
|
29
|
+
}): React.ReactNode;
|
|
30
|
+
//# sourceMappingURL=MigratePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MigratePicker.d.ts","sourceRoot":"","sources":["../../../src/components/MigratePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAExE;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,UAAU,EACV,OAAO,EACP,OAAe,EACf,MAAM,GACP,EAAE;IACD,IAAI,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACjC,UAAU,EAAE,MAAM,CAAA;IAClB,4DAA4D;IAC5D,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC5B,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,uEAAuE;IACvE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC,GAAG,KAAK,CAAC,SAAS,CA+ClB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI,GACL,EAAE;IACD,IAAI,EAAE,SAAS,gBAAgB,EAAE,CAAA;CAClC,GAAG,KAAK,CAAC,SAAS,CAyBlB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t } from '../i18n.js';
|
|
3
|
+
import { Box, Text } from '../ui.js';
|
|
4
|
+
import { Pane } from './design-system/Pane.js';
|
|
5
|
+
import { ListItem } from './design-system/ListItem.js';
|
|
6
|
+
import { HintLine } from './design-system/HintLine.js';
|
|
7
|
+
import { listWindow } from './listWindow.js';
|
|
8
|
+
import { useOverlayListRows } from './OverlayAbove.js';
|
|
9
|
+
/**
|
|
10
|
+
* `/migrate` source picker (multi-select, PRD revision): each row shows a
|
|
11
|
+
* checkbox, the scannable file count, and a recent-activity badge. Keys
|
|
12
|
+
* (Chat owns the logic): space toggles the focused source, `a` selects
|
|
13
|
+
* all/none, Enter proceeds to the confirmation layer with the checked set
|
|
14
|
+
* (the focused row when nothing is checked), Esc closes. While the rows are
|
|
15
|
+
* still being collected it says so — the scan takes a moment on real stores
|
|
16
|
+
* and "no sources available" would be a lie in that window.
|
|
17
|
+
*/
|
|
18
|
+
export function MigratePicker({ rows, focusIndex, checked, loading = false, onPick, }) {
|
|
19
|
+
// 每项恒占 2 行(主行 + 描述行),预算同 SkillsPicker(OverlayAbove 高度
|
|
20
|
+
// 减 Pane 2 + 标题 2 + 页脚 1 + marginTop 1 = 6)。
|
|
21
|
+
const listRows = useOverlayListRows(6);
|
|
22
|
+
const { start, end } = listWindow(rows.map(() => 2), focusIndex, listRows);
|
|
23
|
+
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: t('picker-title-migrate') }) }), loading ? (_jsx(Text, { dimColor: true, children: t('migrate-picker-scanning') })) : rows.length === 0 ? (_jsx(Text, { dimColor: true, children: t('migrate-picker-empty') })) : (rows.slice(start, end).map((row, index) => {
|
|
24
|
+
const absoluteIndex = start + index;
|
|
25
|
+
const description = row.minutesAgo !== undefined
|
|
26
|
+
? t('migrate-picker-recent', { minutes: row.minutesAgo })
|
|
27
|
+
: t('migrate-picker-cold');
|
|
28
|
+
return (_jsx(ListItem, { isFocused: absoluteIndex === focusIndex, description: description, showScrollUp: absoluteIndex === start && start > 0, showScrollDown: absoluteIndex === end - 1 && end < rows.length, onClick: onPick ? () => onPick(absoluteIndex) : undefined, children: `${checked.has(row.agentId) ? '[x]' : '[ ]'} ${row.label} · ${t('migrate-picker-count', { n: row.count })}` }, row.agentId));
|
|
29
|
+
}))] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('migrate-picker-hint') }) })] }));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The second confirmation layer (PRD #2): one line per checked source with
|
|
33
|
+
* its scannable count and the repeat-safe note. Keys (Chat): Enter imports,
|
|
34
|
+
* `d` dry-runs, Esc returns to the picker with the checked set preserved.
|
|
35
|
+
*/
|
|
36
|
+
export function MigrateConfirm({ rows, }) {
|
|
37
|
+
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: t('migrate-confirm-title') }) }), rows.map(row => (_jsx(Box, { paddingLeft: 1, children: _jsx(Text, { children: t('migrate-confirm-line', { label: row.label, n: row.count }) }) }, row.agentId))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: t('migrate-confirm-note') }) })] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('migrate-confirm-actions') }) })] }));
|
|
38
|
+
}
|
|
@@ -3,6 +3,23 @@ import type { ChannelUi as Channel } from '../adapter/channel/ui-policy.js';
|
|
|
3
3
|
import type { ComposerImageRef } from '../dsh-adapter/channel.js';
|
|
4
4
|
import type { TranscriptImage } from '../dsh-adapter/transcript-images.js';
|
|
5
5
|
import { type PromptDraftCache } from './promptDraftCache.js';
|
|
6
|
+
/**
|
|
7
|
+
* Normalize editable text so no terminal control characters remain in state.
|
|
8
|
+
*/
|
|
9
|
+
export declare function sanitizeEditableText(text: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Paste-payload ingress: strip the ESC-less tail of a split record before
|
|
12
|
+
* normalizing. The tail is printable, so it survives `sanitizeEditableText`'s
|
|
13
|
+
* control probe untouched; typed text keeps it because only a paste payload
|
|
14
|
+
* can carry a partial record.
|
|
15
|
+
*
|
|
16
|
+
* The five separators only prove the *shape*, not that a record was split:
|
|
17
|
+
* a user can legitimately paste the literal `[13;28;13;1;0;1_`. Strip the
|
|
18
|
+
* ESC-less form only when the same payload also carries a full ESC-bearing
|
|
19
|
+
* record — only then is there in-payload evidence of a split stream.
|
|
20
|
+
* Otherwise the bytes are ordinary text and must survive verbatim.
|
|
21
|
+
*/
|
|
22
|
+
export declare function sanitizePastedText(text: string): string;
|
|
6
23
|
/** Capabilities referenced by `text`, in first occurrence order. A raw token
|
|
7
24
|
* restored from disk/history has no sidecar entry and therefore stays inert. */
|
|
8
25
|
export declare function composerImageRefsForText(text: string, stagedByToken: ReadonlyMap<string, string>): ComposerImageRef[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromptInput.d.ts","sourceRoot":"","sources":["../../../src/components/PromptInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AA0BzB,OAAO,KAAK,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EACV,gBAAgB,EAGjB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAY1E,OAAO,EAIL,KAAK,gBAAgB,EAEtB,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"PromptInput.d.ts","sourceRoot":"","sources":["../../../src/components/PromptInput.tsx"],"names":[],"mappings":"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"}
|