@deepseek-harness-tui/dsh-tui 0.11.1 → 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 +50 -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 +39 -17
- package/cordis.yml +3 -2
- package/lib/settings.json +1272 -0
- 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 +13 -0
- 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 +46 -4
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +43 -0
- package/lib/types/adapter/ports/channel-view.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/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 +13 -4
- 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 +48 -7
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +2 -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/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/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.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +2 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +3 -2
- 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/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 +1 -0
- package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/background-action.js +1 -0
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +8 -9
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +69 -21
- package/lib/types/dsh-adapter/channel/compaction.d.ts +2 -1
- package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/compaction.js +35 -2
- 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.map +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.js +5 -1
- 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-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 +2 -0
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.js +9 -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 +39 -7
- 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 -0
- package/lib/types/dsh-adapter/channel/session-resume.d.ts +1 -0
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +4 -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 +14 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +6 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +30 -35
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +138 -4
- 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.map +1 -1
- package/lib/types/dsh-adapter/channel.js +19 -4
- 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/contract.d.ts +5 -5
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +8 -6
- 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 +4 -2
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +143 -364
- 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/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 +28 -3
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +77 -2
- 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/i18n.d.ts +424 -42
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +145 -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/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 +40 -18
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +142 -30
- 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 +14 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +606 -53
- 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.map +1 -1
- package/lib/types/screens/StatusLine.js +45 -15
- 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.map +1 -1
- package/lib/types/utils/fold-long-lines.js +2 -1
- 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/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 +111 -97
|
@@ -1,28 +1,57 @@
|
|
|
1
|
+
import type { SplashFont } from './splashFonts.js';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* fails visibly instead of crashing the splash.
|
|
3
|
+
* 5 行点阵大字的画布:横向颜色渐变 + 一道从左往右扫的高光(节奏与 `✦ dsh-TUI`
|
|
4
|
+
* 字标的扫光一致,见 `stepMs`)。字形与度量来自 `splashFonts.ts` 的字体描述符,
|
|
5
|
+
* 这里只负责"把某款字体画出来"——所以加字体是加数据,不是改画布。
|
|
6
|
+
*
|
|
7
|
+
* 缺字走字体自带的 `fallback` 空心方块:打错字要看得见,而不是让开屏崩掉。
|
|
8
8
|
*/
|
|
9
|
+
/** 颜色通道。 */
|
|
9
10
|
export interface Rgb {
|
|
10
11
|
r: number;
|
|
11
12
|
g: number;
|
|
12
13
|
b: number;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* `flash` travels left to right (one column per `stepMs`, matching the
|
|
18
|
-
* wordmark shimmer's cadence). Returns 5 ANSI rows.
|
|
19
|
-
* @param text - Text to render; only D, E, P, S, K, H, A, R, N have glyphs, unknown letters fall back to a hollow box.
|
|
20
|
-
* @param time - Elapsed time in milliseconds; drives the sweep position and the brightness pulse.
|
|
21
|
-
* @param from - Gradient start color at the left edge.
|
|
22
|
-
* @param to - Gradient end color at the right edge.
|
|
23
|
-
* @param flash - Highlight color mixed into the moving sweep window.
|
|
24
|
-
* @param stepMs - Milliseconds per column of sweep advance (default 60).
|
|
25
|
-
* @returns Five ANSI rows, one per block-font line.
|
|
16
|
+
* 画字量宽只需要字身宽度——`SplashFont` 天然满足,`splashFonts.ts` 解字距时
|
|
17
|
+
* 手里只有宽度,也能直接复用同一套算术。
|
|
26
18
|
*/
|
|
27
|
-
export
|
|
19
|
+
export interface GlyphMetrics {
|
|
20
|
+
/** 字身宽度(列)。 */
|
|
21
|
+
readonly glyphWidth: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* `text` 在该字身宽度、该字距下画出来的列数(含末尾那格字距留白)——与渲染循环
|
|
25
|
+
* 用同一套算术,放在这里以免两处漂移(`splashFonts.ts` 解字距时也读它)。
|
|
26
|
+
* @param font - 字体度量(只用到字身宽度)。
|
|
27
|
+
* @param text - 要量的文本。
|
|
28
|
+
* @param kerning - 每个字形之后补的空列数。
|
|
29
|
+
* @returns 画出来的列数。
|
|
30
|
+
*/
|
|
31
|
+
export declare function paintedWidth(font: GlyphMetrics, text: string, kerning: number): number;
|
|
32
|
+
/**
|
|
33
|
+
* `text` 的显示宽度:含字距、**不含**最后一个字形之后的留白。开屏用它判断
|
|
34
|
+
* 某个词还放不放得下(配合鲸鱼),`verify-splash-layout` 会把它与实际画出的
|
|
35
|
+
* 列数对齐钉死。
|
|
36
|
+
* @param font - 字体度量(只用到字身宽度)。
|
|
37
|
+
* @param text - 要量的文本(只有字体表里定义的字母有字形)。
|
|
38
|
+
* @param kerning - 每个字形之后的空列数(默认 1)。
|
|
39
|
+
* @returns 显示宽度(终端列)。
|
|
40
|
+
*/
|
|
41
|
+
export declare function bigTextWidth(font: GlyphMetrics, text: string, kerning?: number): number;
|
|
42
|
+
/**
|
|
43
|
+
* 用某款字体渲染 `text`:渐变从 `from` 走到 `to`,一段 SWEEP_WINDOW 宽的高光
|
|
44
|
+
* 混向 `flash` 并随时间从左扫到右。返回 5 行 ANSI。
|
|
45
|
+
* @param font - 字体描述符(字形 + 字身宽度 + fallback)。
|
|
46
|
+
* @param text - 要渲染的文本;缺字的字母退化成 fallback 方块。
|
|
47
|
+
* @param time - 毫秒;决定扫光位置与脉动亮度(定格时传 0)。
|
|
48
|
+
* @param from - 渐变起点色(最左列)。
|
|
49
|
+
* @param to - 渐变终点色(最右列)。
|
|
50
|
+
* @param flash - 扫光窗口混入的高光色。
|
|
51
|
+
* @param stepMs - 扫光每前进一列的毫秒数(默认 60)。
|
|
52
|
+
* @param kerning - 每个字形之后的空列数(默认 1)。两行标题靠它撑到等宽。
|
|
53
|
+
* @param indent - 每行左侧缩进列数(下排居中用,默认 0)。
|
|
54
|
+
* @returns 5 行 ANSI,每行是点阵字的一行。
|
|
55
|
+
*/
|
|
56
|
+
export declare function renderBigText(font: SplashFont, text: string, time: number, from: Rgb, to: Rgb, flash: Rgb, stepMs?: number, kerning?: number, indent?: number): string[];
|
|
28
57
|
//# sourceMappingURL=bigfont.d.ts.map
|
|
@@ -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":"AACA,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,51 +1,63 @@
|
|
|
1
1
|
import { interpolateColor } from './Spinner/spinnerUtils.js';
|
|
2
|
-
/**
|
|
3
|
-
const GLYPHS = {
|
|
4
|
-
D: ['█▀▀▀▄', '█···█', '█···█', '█···█', '█▄▄▄▀'],
|
|
5
|
-
E: ['█▀▀▀▀', '█····', '█▀▀▀·', '█····', '█▄▄▄▄'],
|
|
6
|
-
P: ['█▀▀▀▄', '█···█', '█▄▄▄▀', '█····', '█····'],
|
|
7
|
-
S: ['█▀▀▀▀', '█····', '·▀▀▀▄', '····█', '█▄▄▄▀'],
|
|
8
|
-
K: ['█···█', '█·█··', '██···', '█·█··', '█···█'],
|
|
9
|
-
H: ['█···█', '█···█', '█▀▀▀█', '█···█', '█···█'],
|
|
10
|
-
A: ['·▄▀▄·', '█···█', '█▀▀▀█', '█···█', '█···█'],
|
|
11
|
-
R: ['█▀▀▀▄', '█···█', '█▄▄▄▀', '█·█··', '█···█'],
|
|
12
|
-
N: ['█···█', '██··█', '█·█·█', '█··██', '█···█'],
|
|
13
|
-
};
|
|
14
|
-
const FALLBACK = [
|
|
15
|
-
'▄▄▄▄▄',
|
|
16
|
-
'█···█',
|
|
17
|
-
'█···█',
|
|
18
|
-
'█···█',
|
|
19
|
-
'▀▀▀▀▀',
|
|
20
|
-
];
|
|
21
|
-
/** Per-glyph advance (5 glyph columns + 1 kerning column). */
|
|
22
|
-
const ADVANCE = 6;
|
|
23
|
-
/** Space between words. */
|
|
2
|
+
/** 词组之间的间隔列数。 */
|
|
24
3
|
const WORD_GAP = 2;
|
|
25
|
-
/**
|
|
4
|
+
/** 扫光窗口宽度(列)。 */
|
|
26
5
|
const SWEEP_WINDOW = 8;
|
|
6
|
+
/** 一行字画几行。 */
|
|
7
|
+
const ROWS = 5;
|
|
27
8
|
const esc = (rgb) => `\x1b[38;2;${rgb.r};${rgb.g};${rgb.b}m`;
|
|
28
9
|
const RESET = '\x1b[39m';
|
|
29
10
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @param
|
|
35
|
-
* @
|
|
36
|
-
* @param from - Gradient start color at the left edge.
|
|
37
|
-
* @param to - Gradient end color at the right edge.
|
|
38
|
-
* @param flash - Highlight color mixed into the moving sweep window.
|
|
39
|
-
* @param stepMs - Milliseconds per column of sweep advance (default 60).
|
|
40
|
-
* @returns Five ANSI rows, one per block-font line.
|
|
11
|
+
* `text` 在该字身宽度、该字距下画出来的列数(含末尾那格字距留白)——与渲染循环
|
|
12
|
+
* 用同一套算术,放在这里以免两处漂移(`splashFonts.ts` 解字距时也读它)。
|
|
13
|
+
* @param font - 字体度量(只用到字身宽度)。
|
|
14
|
+
* @param text - 要量的文本。
|
|
15
|
+
* @param kerning - 每个字形之后补的空列数。
|
|
16
|
+
* @returns 画出来的列数。
|
|
41
17
|
*/
|
|
42
|
-
export function
|
|
43
|
-
|
|
18
|
+
export function paintedWidth(font, text, kerning) {
|
|
19
|
+
let width = 0;
|
|
20
|
+
for (const ch of text)
|
|
21
|
+
width += ch === ' ' ? WORD_GAP : font.glyphWidth + kerning;
|
|
22
|
+
return width;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* `text` 的显示宽度:含字距、**不含**最后一个字形之后的留白。开屏用它判断
|
|
26
|
+
* 某个词还放不放得下(配合鲸鱼),`verify-splash-layout` 会把它与实际画出的
|
|
27
|
+
* 列数对齐钉死。
|
|
28
|
+
* @param font - 字体度量(只用到字身宽度)。
|
|
29
|
+
* @param text - 要量的文本(只有字体表里定义的字母有字形)。
|
|
30
|
+
* @param kerning - 每个字形之后的空列数(默认 1)。
|
|
31
|
+
* @returns 显示宽度(终端列)。
|
|
32
|
+
*/
|
|
33
|
+
export function bigTextWidth(font, text, kerning = 1) {
|
|
34
|
+
const characters = Array.from(text);
|
|
35
|
+
if (characters.length === 0)
|
|
36
|
+
return 0;
|
|
37
|
+
const trailing = characters[characters.length - 1] === ' ' ? WORD_GAP : kerning;
|
|
38
|
+
return paintedWidth(font, text, kerning) - trailing;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 用某款字体渲染 `text`:渐变从 `from` 走到 `to`,一段 SWEEP_WINDOW 宽的高光
|
|
42
|
+
* 混向 `flash` 并随时间从左扫到右。返回 5 行 ANSI。
|
|
43
|
+
* @param font - 字体描述符(字形 + 字身宽度 + fallback)。
|
|
44
|
+
* @param text - 要渲染的文本;缺字的字母退化成 fallback 方块。
|
|
45
|
+
* @param time - 毫秒;决定扫光位置与脉动亮度(定格时传 0)。
|
|
46
|
+
* @param from - 渐变起点色(最左列)。
|
|
47
|
+
* @param to - 渐变终点色(最右列)。
|
|
48
|
+
* @param flash - 扫光窗口混入的高光色。
|
|
49
|
+
* @param stepMs - 扫光每前进一列的毫秒数(默认 60)。
|
|
50
|
+
* @param kerning - 每个字形之后的空列数(默认 1)。两行标题靠它撑到等宽。
|
|
51
|
+
* @param indent - 每行左侧缩进列数(下排居中用,默认 0)。
|
|
52
|
+
* @returns 5 行 ANSI,每行是点阵字的一行。
|
|
53
|
+
*/
|
|
54
|
+
export function renderBigText(font, text, time, from, to, flash, stepMs = 60, kerning = 1, indent = 0) {
|
|
55
|
+
const width = paintedWidth(font, text, kerning) + indent;
|
|
44
56
|
const cycle = width + SWEEP_WINDOW * 2;
|
|
45
57
|
const sweepStart = (Math.floor(time / stepMs) % cycle) - SWEEP_WINDOW;
|
|
46
58
|
const pulse = (Math.sin(time / (stepMs * 2)) + 1) / 2;
|
|
47
59
|
const rows = [];
|
|
48
|
-
for (let row = 0; row <
|
|
60
|
+
for (let row = 0; row < ROWS; row++) {
|
|
49
61
|
let out = '';
|
|
50
62
|
let current = '';
|
|
51
63
|
let x = 0;
|
|
@@ -72,16 +84,19 @@ export function renderBigText(text, time, from, to, flash, stepMs = 60) {
|
|
|
72
84
|
out += ch;
|
|
73
85
|
x += 1;
|
|
74
86
|
};
|
|
87
|
+
for (let i = 0; i < indent; i++)
|
|
88
|
+
emit(' ');
|
|
75
89
|
for (const ch of text) {
|
|
76
90
|
if (ch === ' ') {
|
|
77
91
|
for (let i = 0; i < WORD_GAP; i++)
|
|
78
92
|
emit(' ');
|
|
79
93
|
continue;
|
|
80
94
|
}
|
|
81
|
-
const glyph =
|
|
82
|
-
for (const cell of glyph[row])
|
|
95
|
+
const glyph = font.glyphs[ch] ?? font.fallback;
|
|
96
|
+
for (const cell of glyph[row] ?? '')
|
|
83
97
|
emit(cell);
|
|
84
|
-
|
|
98
|
+
for (let i = 0; i < kerning; i++)
|
|
99
|
+
emit(' ');
|
|
85
100
|
}
|
|
86
101
|
if (current !== '')
|
|
87
102
|
out += RESET;
|
|
@@ -18,4 +18,10 @@ export declare function ThemeProvider({ children, theme, themeHost, }: {
|
|
|
18
18
|
* `[themeName, setTheme]`.
|
|
19
19
|
*/
|
|
20
20
|
export declare function useTheme(): [string, (name: string) => boolean];
|
|
21
|
+
/**
|
|
22
|
+
* The colour the terminal shows behind the UI (`#rrggbb`): the OSC 11
|
|
23
|
+
* answer when available, else white/black by palette lightness. Terminal
|
|
24
|
+
* image placements use it as their opaque Sixel backing.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useTerminalBackground(): `#${string}`;
|
|
21
27
|
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAA;AAY7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAA;AAY7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AA2E/D;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,SAAS,CAGrD;AAcD,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,KAAK,EACL,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qEAAqE;IACrE,SAAS,CAAC,EAAE,YAAY,CAAA;CACzB,GAAG,KAAK,CAAC,SAAS,CA6MlB;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAG9D;AA2BD;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,MAAM,EAAE,CAEpD"}
|
|
@@ -46,6 +46,7 @@ const ThemeContext = createContext({
|
|
|
46
46
|
theme: 'dark',
|
|
47
47
|
autoBase: 'dark',
|
|
48
48
|
setTheme: () => false,
|
|
49
|
+
terminalBackground: '#000000',
|
|
49
50
|
});
|
|
50
51
|
/**
|
|
51
52
|
* DSH_TUI_THEME skips terminal detection (tests, debugging). Accepts a
|
|
@@ -225,7 +226,17 @@ export function ThemeProvider({ children, theme, themeHost, }) {
|
|
|
225
226
|
: isThemeAvailable(active)
|
|
226
227
|
? active
|
|
227
228
|
: AUTO_THEME_NAME;
|
|
228
|
-
const value = React.useMemo(() => ({
|
|
229
|
+
const value = React.useMemo(() => ({
|
|
230
|
+
theme: renderedTheme,
|
|
231
|
+
autoBase,
|
|
232
|
+
setTheme,
|
|
233
|
+
// 与下面 setShadeTarget 用同一个口径(OSC 11 的回答,缺失时按明暗取
|
|
234
|
+
// 白/黑)——terminal 图像的不透明衬底就合成到这个颜色上。
|
|
235
|
+
// 只在与主题明暗**一致**时才采信 OSC 11 的回答:透明背景/背景图形态
|
|
236
|
+
// 的终端会报一个跟画面对不上的颜色,那时宁可用纯白(浅色主题)或
|
|
237
|
+
// 纯黑(深色主题)——深色终端上糊一块白底最突兀。
|
|
238
|
+
terminalBackground: hexRgb(imageBackingColor(detectedBackground, renderedTheme)),
|
|
239
|
+
}), [renderedTheme, autoBase, setTheme, detectedBackground]);
|
|
229
240
|
useEffect(() => {
|
|
230
241
|
if (active !== null)
|
|
231
242
|
setActiveThemeName(renderedTheme);
|
|
@@ -254,3 +265,31 @@ export function useTheme() {
|
|
|
254
265
|
const { theme, setTheme } = useContext(ThemeContext);
|
|
255
266
|
return [theme, setTheme];
|
|
256
267
|
}
|
|
268
|
+
/** `{r,g,b}` → `#rrggbb` for colour strings the style layer accepts. */
|
|
269
|
+
function hexRgb(color) {
|
|
270
|
+
const part = (value) => Math.max(0, Math.min(255, Math.round(value))).toString(16).padStart(2, '0');
|
|
271
|
+
return `#${part(color.r)}${part(color.g)}${part(color.b)}`;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* The opaque colour terminal images composite onto: the OSC 11 answer while
|
|
275
|
+
* it agrees with the rendered palette's lightness, else pure white (light
|
|
276
|
+
* palette) / pure black (dark palette). A light terminal must never get a
|
|
277
|
+
* dark slab, and a dark terminal must never get a white one.
|
|
278
|
+
*/
|
|
279
|
+
function imageBackingColor(detected, themeName) {
|
|
280
|
+
const light = isLightThemeActive(themeName);
|
|
281
|
+
const fallback = light ? { r: 255, g: 255, b: 255 } : { r: 0, g: 0, b: 0 };
|
|
282
|
+
if (detected === null)
|
|
283
|
+
return fallback;
|
|
284
|
+
// Rec. 601 luma: > 0.5 counts as a light background.
|
|
285
|
+
const luma = (0.299 * detected.r + 0.587 * detected.g + 0.114 * detected.b) / 255;
|
|
286
|
+
return (luma > 0.5) === light ? detected : fallback;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* The colour the terminal shows behind the UI (`#rrggbb`): the OSC 11
|
|
290
|
+
* answer when available, else white/black by palette lightness. Terminal
|
|
291
|
+
* image placements use it as their opaque Sixel backing.
|
|
292
|
+
*/
|
|
293
|
+
export function useTerminalBackground() {
|
|
294
|
+
return useContext(ThemeContext).terminalBackground;
|
|
295
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TerminalImageSource } from '../ink/terminal-image.js';
|
|
3
|
+
/** 一台机器上的两张立绘都解好、并补齐到**同一像素画布**上——几何完全一致,
|
|
4
|
+
* 换图时宿主是「擦旧 + 画新」一次写入,不会留残影。 */
|
|
5
|
+
export interface MaidPortraits {
|
|
6
|
+
readonly normal: TerminalImageSource;
|
|
7
|
+
readonly happy: TerminalImageSource;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 解码两张立绘一次(进程内缓存;失败缓存成 `undefined`,坏安装不会每次
|
|
11
|
+
* 渲染都重试)。两张都裁掉透明边后**居中补到同一张透明画布**(取两者
|
|
12
|
+
* 较大的宽高)——所以它们的像素尺寸与单元格盒完全一致。
|
|
13
|
+
* @returns 两张 RGBA 源;任一张缺失/解码失败时整体 `undefined`。
|
|
14
|
+
*/
|
|
15
|
+
export declare function loadMaidPortraits(): Promise<MaidPortraits | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* 两张立绘,终端图像能力确认后解码(一次把两张都备好,点击换图不等待)。
|
|
18
|
+
* @param enabled - `useTerminalImages()` 的结果;为假时根本不解码。
|
|
19
|
+
* @returns 两张 RGBA 源;未就绪/不可用时为 `undefined`。
|
|
20
|
+
*/
|
|
21
|
+
export declare function useMaidPortraits(enabled: boolean): MaidPortraits | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* The portrait's center column inside the whale's 40-column slot: the
|
|
24
|
+
* aspect-fit image spans columns 5..34 (center 19.5). The welcome tagline
|
|
25
|
+
* centers on this instead of `WHALE_CENTER` while the portrait shows.
|
|
26
|
+
*/
|
|
27
|
+
export declare const MAID_BOX_CENTER = 19.5;
|
|
28
|
+
/**
|
|
29
|
+
* The portrait as an Ink component: a `width × height` cell box (aspect-fit
|
|
30
|
+
* from the real cell metrics so pixels stay square), centered horizontally
|
|
31
|
+
* by the caller's slot. `presentation` follows the surface — `'transcript'`
|
|
32
|
+
* opts into Sixel for the scrollable header, `'preview'` for modal cards —
|
|
33
|
+
* and the portrait always floats `transparent`: her trimmed silhouette sits
|
|
34
|
+
* on whatever the terminal shows, with no backing rectangle behind it.
|
|
35
|
+
*/
|
|
36
|
+
export declare function MaidPortrait({ source, maxColumns, maxRows, presentation, }: {
|
|
37
|
+
/** Decoded RGBA snapshot; `undefined` keeps the caller's fallback. */
|
|
38
|
+
readonly source?: TerminalImageSource;
|
|
39
|
+
/** Cell budget (the header passes the whale's 40-column slot). */
|
|
40
|
+
readonly maxColumns: number;
|
|
41
|
+
readonly maxRows: number;
|
|
42
|
+
readonly presentation: 'transcript' | 'preview';
|
|
43
|
+
}): React.ReactNode;
|
|
44
|
+
//# sourceMappingURL=maidPortrait.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maidPortrait.d.ts","sourceRoot":"","sources":["../../../src/components/maidPortrait.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAuBnE;iCACiC;AACjC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAA;IACpC,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAA;CACpC;AASD;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CA+BtE;AAsDD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAW5E;AAKD;;;;GAIG;AACH,eAAO,MAAM,eAAe,OAAO,CAAA;AAEnC;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,UAAU,EACV,OAAO,EACP,YAAY,GACb,EAAE;IACD,sEAAsE;IACtE,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAA;IACrC,kEAAkE;IAClE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,YAAY,EAAE,YAAY,GAAG,SAAS,CAAA;CAChD,GAAG,KAAK,CAAC,SAAS,CAuBlB"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Image, useTerminalImageCellSize } from '../ui.js';
|
|
4
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { DEFAULT_TERMINAL_CELL_SIZE } from '../ink/terminal-image.js';
|
|
7
|
+
import { loadSharp } from '../dsh-adapter/sharp.js';
|
|
8
|
+
/**
|
|
9
|
+
* The maid portrait (鲸鱼娘) for `dsh-tui.whaleGirl` and the star modal —
|
|
10
|
+
* the author-designed 464×464 pixel art shipped at `assets/whale-girl/`,
|
|
11
|
+
* rendered FIRST as a real raster through the terminal image protocols
|
|
12
|
+
* (Kitty graphics / Sixel): full fidelity, anti-aliased curves, the whole
|
|
13
|
+
* palette. The chain degrades per surface when images cannot show — the
|
|
14
|
+
* header falls back to the character-art maid (`WhaleGirl.tsx`, the
|
|
15
|
+
* author's placeholder), the star modal to the animated pixel whale — so
|
|
16
|
+
* the setting never leaves the header worse than the whale it replaces.
|
|
17
|
+
*/
|
|
18
|
+
/** 两张立绘:`normal` 是安静版,`happy` 是「高兴鲸娘」(点击她 / star 成功
|
|
19
|
+
* 时替换)。资产候选同时覆盖两种目录深度:`lib/types/components`(发布形态)
|
|
20
|
+
* 比 `src/components`(仓库形态)深一层。 */
|
|
21
|
+
const ASSET_FILES = {
|
|
22
|
+
normal: 'whale-girl.png',
|
|
23
|
+
happy: 'whale-girl-happy.png',
|
|
24
|
+
};
|
|
25
|
+
const assetPath = (file) => [`../../../assets/whale-girl/${file}`, `../../assets/whale-girl/${file}`]
|
|
26
|
+
.map(relative => fileURLToPath(new URL(relative, import.meta.url)))
|
|
27
|
+
.find(candidate => existsSync(candidate));
|
|
28
|
+
let loadOnce;
|
|
29
|
+
/**
|
|
30
|
+
* 解码两张立绘一次(进程内缓存;失败缓存成 `undefined`,坏安装不会每次
|
|
31
|
+
* 渲染都重试)。两张都裁掉透明边后**居中补到同一张透明画布**(取两者
|
|
32
|
+
* 较大的宽高)——所以它们的像素尺寸与单元格盒完全一致。
|
|
33
|
+
* @returns 两张 RGBA 源;任一张缺失/解码失败时整体 `undefined`。
|
|
34
|
+
*/
|
|
35
|
+
export function loadMaidPortraits() {
|
|
36
|
+
loadOnce ??= (async () => {
|
|
37
|
+
try {
|
|
38
|
+
const sharp = await loadSharp();
|
|
39
|
+
if (sharp === undefined)
|
|
40
|
+
return undefined;
|
|
41
|
+
const trimmed = { normal: undefined, happy: undefined };
|
|
42
|
+
for (const variant of ['normal', 'happy']) {
|
|
43
|
+
const path = assetPath(ASSET_FILES[variant]);
|
|
44
|
+
if (path === undefined)
|
|
45
|
+
return undefined;
|
|
46
|
+
const decoded = await sharp(readFileSync(path), { failOn: 'error' })
|
|
47
|
+
.toColourspace('srgb')
|
|
48
|
+
.ensureAlpha()
|
|
49
|
+
.raw()
|
|
50
|
+
.toBuffer({ resolveWithObject: true });
|
|
51
|
+
if (decoded.info.channels !== 4
|
|
52
|
+
|| decoded.data.byteLength !== decoded.info.width * decoded.info.height * 4)
|
|
53
|
+
return undefined;
|
|
54
|
+
const rgba = {
|
|
55
|
+
data: new Uint8Array(decoded.data.buffer, decoded.data.byteOffset, decoded.data.byteLength),
|
|
56
|
+
width: decoded.info.width,
|
|
57
|
+
height: decoded.info.height,
|
|
58
|
+
};
|
|
59
|
+
trimmed[variant] = trimTransparent(rgba);
|
|
60
|
+
}
|
|
61
|
+
const width = Math.max(trimmed.normal.width, trimmed.happy.width);
|
|
62
|
+
const height = Math.max(trimmed.normal.height, trimmed.happy.height);
|
|
63
|
+
return { normal: centerOnCanvas(trimmed.normal, width, height), happy: centerOnCanvas(trimmed.happy, width, height) };
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
})();
|
|
69
|
+
return loadOnce;
|
|
70
|
+
}
|
|
71
|
+
/** 把一张已裁边的图居中放进 `width × height` 的透明画布(几何对齐用)。 */
|
|
72
|
+
function centerOnCanvas(source, width, height) {
|
|
73
|
+
if (source.width === width && source.height === height)
|
|
74
|
+
return source;
|
|
75
|
+
const data = new Uint8Array(width * height * 4);
|
|
76
|
+
const left = Math.floor((width - source.width) / 2);
|
|
77
|
+
const top = Math.floor((height - source.height) / 2);
|
|
78
|
+
for (let y = 0; y < source.height; y++) {
|
|
79
|
+
const from = y * source.width * 4;
|
|
80
|
+
data.set(source.data.subarray(from, from + source.width * 4), ((top + y) * width + left) * 4);
|
|
81
|
+
}
|
|
82
|
+
return { data, width, height };
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Trim fully-transparent borders (the art's canvas margins) with a small
|
|
86
|
+
* transparent pad. Sixel cannot express partial alpha, so the pad is dropped
|
|
87
|
+
* by the coverage mask at encode time; trimming first hands the terminal the
|
|
88
|
+
* artwork itself and lets the same cell box draw her larger.
|
|
89
|
+
*/
|
|
90
|
+
function trimTransparent(source, pad = 4) {
|
|
91
|
+
const { data, width, height } = source;
|
|
92
|
+
let minX = width;
|
|
93
|
+
let minY = height;
|
|
94
|
+
let maxX = -1;
|
|
95
|
+
let maxY = -1;
|
|
96
|
+
for (let y = 0; y < height; y++) {
|
|
97
|
+
for (let x = 0; x < width; x++) {
|
|
98
|
+
// Anti-aliased edges carry alpha > 0, so only truly empty pixels fall
|
|
99
|
+
// outside the bounding box.
|
|
100
|
+
if (data[(y * width + x) * 4 + 3] === 0)
|
|
101
|
+
continue;
|
|
102
|
+
if (x < minX)
|
|
103
|
+
minX = x;
|
|
104
|
+
if (x > maxX)
|
|
105
|
+
maxX = x;
|
|
106
|
+
if (y < minY)
|
|
107
|
+
minY = y;
|
|
108
|
+
if (y > maxY)
|
|
109
|
+
maxY = y;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (maxX < minX || maxY < minY)
|
|
113
|
+
return source;
|
|
114
|
+
const left = Math.max(0, minX - pad);
|
|
115
|
+
const top = Math.max(0, minY - pad);
|
|
116
|
+
const right = Math.min(width - 1, maxX + pad);
|
|
117
|
+
const bottom = Math.min(height - 1, maxY + pad);
|
|
118
|
+
const cropWidth = right - left + 1;
|
|
119
|
+
const cropHeight = bottom - top + 1;
|
|
120
|
+
if (cropWidth === width && cropHeight === height)
|
|
121
|
+
return source;
|
|
122
|
+
const cropped = new Uint8Array(cropWidth * cropHeight * 4);
|
|
123
|
+
for (let y = 0; y < cropHeight; y++) {
|
|
124
|
+
const from = ((top + y) * width + left) * 4;
|
|
125
|
+
cropped.set(data.subarray(from, from + cropWidth * 4), y * cropWidth * 4);
|
|
126
|
+
}
|
|
127
|
+
return { data: cropped, width: cropWidth, height: cropHeight };
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* 两张立绘,终端图像能力确认后解码(一次把两张都备好,点击换图不等待)。
|
|
131
|
+
* @param enabled - `useTerminalImages()` 的结果;为假时根本不解码。
|
|
132
|
+
* @returns 两张 RGBA 源;未就绪/不可用时为 `undefined`。
|
|
133
|
+
*/
|
|
134
|
+
export function useMaidPortraits(enabled) {
|
|
135
|
+
const [sources, setSources] = React.useState(undefined);
|
|
136
|
+
React.useEffect(() => {
|
|
137
|
+
if (!enabled)
|
|
138
|
+
return;
|
|
139
|
+
let live = true;
|
|
140
|
+
void loadMaidPortraits().then(next => {
|
|
141
|
+
if (live && next !== undefined)
|
|
142
|
+
setSources(next);
|
|
143
|
+
});
|
|
144
|
+
return () => { live = false; };
|
|
145
|
+
}, [enabled]);
|
|
146
|
+
return enabled ? sources : undefined;
|
|
147
|
+
}
|
|
148
|
+
/** Fallback aspect before the source lands (square canvas). */
|
|
149
|
+
const MAID_RATIO = 1;
|
|
150
|
+
/**
|
|
151
|
+
* The portrait's center column inside the whale's 40-column slot: the
|
|
152
|
+
* aspect-fit image spans columns 5..34 (center 19.5). The welcome tagline
|
|
153
|
+
* centers on this instead of `WHALE_CENTER` while the portrait shows.
|
|
154
|
+
*/
|
|
155
|
+
export const MAID_BOX_CENTER = 19.5;
|
|
156
|
+
/**
|
|
157
|
+
* The portrait as an Ink component: a `width × height` cell box (aspect-fit
|
|
158
|
+
* from the real cell metrics so pixels stay square), centered horizontally
|
|
159
|
+
* by the caller's slot. `presentation` follows the surface — `'transcript'`
|
|
160
|
+
* opts into Sixel for the scrollable header, `'preview'` for modal cards —
|
|
161
|
+
* and the portrait always floats `transparent`: her trimmed silhouette sits
|
|
162
|
+
* on whatever the terminal shows, with no backing rectangle behind it.
|
|
163
|
+
*/
|
|
164
|
+
export function MaidPortrait({ source, maxColumns, maxRows, presentation, }) {
|
|
165
|
+
const cell = useTerminalImageCellSize() ?? DEFAULT_TERMINAL_CELL_SIZE;
|
|
166
|
+
const cellRatio = cell.height / cell.width;
|
|
167
|
+
// Fit the TRIMMED artwork's own aspect, not the source canvas: the raster
|
|
168
|
+
// is her bounding box, so she fills the slot instead of floating in
|
|
169
|
+
// transparent padding.
|
|
170
|
+
const ratio = source !== undefined && source.height > 0 ? source.width / source.height : MAID_RATIO;
|
|
171
|
+
let width = maxColumns;
|
|
172
|
+
let height = Math.round(width / (cellRatio * ratio));
|
|
173
|
+
if (height > maxRows) {
|
|
174
|
+
height = maxRows;
|
|
175
|
+
width = Math.max(1, Math.min(maxColumns, Math.round(cellRatio * height * ratio)));
|
|
176
|
+
}
|
|
177
|
+
return (_jsx(Image, { transparent: true, source: source, width: width, height: height, alt: "", presentation: presentation }));
|
|
178
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TerminalImageSource } from '../ink/terminal-image.js';
|
|
2
|
+
import type { MathRenderRequest } from '../math/renderer.js';
|
|
3
|
+
/** What a click on a formula image hands to the preview host. */
|
|
4
|
+
export interface MathPreviewRequest {
|
|
5
|
+
/** The formula's TeX without delimiters; the card shows it as its title. */
|
|
6
|
+
readonly tex: string;
|
|
7
|
+
/** The request that produced the raster currently on screen. */
|
|
8
|
+
readonly request: MathRenderRequest;
|
|
9
|
+
/** Those pixels, used as-is when a sharper raster cannot be produced. */
|
|
10
|
+
readonly source: TerminalImageSource;
|
|
11
|
+
}
|
|
12
|
+
export type MathPreviewOpener = (request: MathPreviewRequest) => void;
|
|
13
|
+
/** Published by the transcript host; cleared when it unmounts. */
|
|
14
|
+
export declare function setMathPreviewOpener(next: MathPreviewOpener | undefined): void;
|
|
15
|
+
export declare function getMathPreviewOpener(): MathPreviewOpener | undefined;
|
|
16
|
+
export declare function subscribeMathPreviewOpener(listener: () => void): () => void;
|
|
17
|
+
/** The host's opener, or undefined when nothing can show a preview card. */
|
|
18
|
+
export declare function useMathPreviewOpener(): MathPreviewOpener | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* RGBA raster → PNG bytes, the form the image preview card decodes. Sharp is
|
|
21
|
+
* already a runtime dependency (Sixel encoding uses it) and is optional, so a
|
|
22
|
+
* missing build rejects rather than returning a broken byte string.
|
|
23
|
+
*/
|
|
24
|
+
export declare function rasterToPng(source: TerminalImageSource): Promise<Uint8Array>;
|
|
25
|
+
//# sourceMappingURL=mathPreview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mathPreview.d.ts","sourceRoot":"","sources":["../../../src/components/mathPreview.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAG5D,iEAAiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,gEAAgE;IAChE,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAA;IACnC,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAA;CACrC;AAED,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAA;AAKrE,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,GAAG,IAAI,CAI9E;AAED,wBAAgB,oBAAoB,IAAI,iBAAiB,GAAG,SAAS,CAEpE;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAK3E;AAED,4EAA4E;AAC5E,wBAAgB,oBAAoB,IAAI,iBAAiB,GAAG,SAAS,CAEpE;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC,CAOlF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formula-image previews.
|
|
3
|
+
*
|
|
4
|
+
* The transcript host (Chat) publishes an opener for as long as it is mounted,
|
|
5
|
+
* and the math components call it when a formula image is clicked. A
|
|
6
|
+
* module-level registry — the same shape the live display settings use —
|
|
7
|
+
* keeps that callback out of the MessageList → Markdown prop chain, which
|
|
8
|
+
* would otherwise thread it through every message row.
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { loadSharp } from '../dsh-adapter/sharp.js';
|
|
12
|
+
let opener;
|
|
13
|
+
const listeners = new Set();
|
|
14
|
+
/** Published by the transcript host; cleared when it unmounts. */
|
|
15
|
+
export function setMathPreviewOpener(next) {
|
|
16
|
+
if (opener === next)
|
|
17
|
+
return;
|
|
18
|
+
opener = next;
|
|
19
|
+
for (const listener of listeners)
|
|
20
|
+
listener();
|
|
21
|
+
}
|
|
22
|
+
export function getMathPreviewOpener() {
|
|
23
|
+
return opener;
|
|
24
|
+
}
|
|
25
|
+
export function subscribeMathPreviewOpener(listener) {
|
|
26
|
+
listeners.add(listener);
|
|
27
|
+
return () => {
|
|
28
|
+
listeners.delete(listener);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/** The host's opener, or undefined when nothing can show a preview card. */
|
|
32
|
+
export function useMathPreviewOpener() {
|
|
33
|
+
return React.useSyncExternalStore(subscribeMathPreviewOpener, getMathPreviewOpener);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* RGBA raster → PNG bytes, the form the image preview card decodes. Sharp is
|
|
37
|
+
* already a runtime dependency (Sixel encoding uses it) and is optional, so a
|
|
38
|
+
* missing build rejects rather than returning a broken byte string.
|
|
39
|
+
*/
|
|
40
|
+
export async function rasterToPng(source) {
|
|
41
|
+
const sharp = await loadSharp();
|
|
42
|
+
if (sharp === undefined)
|
|
43
|
+
throw new Error('image encoder unavailable');
|
|
44
|
+
const buffer = await sharp(Buffer.from(source.data), {
|
|
45
|
+
raw: { width: source.width, height: source.height, channels: 4 },
|
|
46
|
+
}).png().toBuffer();
|
|
47
|
+
return new Uint8Array(buffer);
|
|
48
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantThinkingMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/AssistantThinkingMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAczB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"AssistantThinkingMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/AssistantThinkingMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAczB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAWjE,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB;;;sDAGkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4CAA4C;IAC5C,eAAe,EAAE,OAAO,CAAA;IACxB,4EAA4E;IAC5E,OAAO,EAAE,OAAO,CAAA;IAChB;;4CAEwC;IACxC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;8EAE0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,wCAAwC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;CAClC,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,OAAO,EACP,SAAiB,EACjB,OAAe,EACf,UAAU,EACV,UAAkB,EAClB,OAAO,GACR,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CAuIzB"}
|
|
@@ -9,6 +9,7 @@ import { THINKING_SPINNER_FRAMES, THINKING_SPINNER_INTERVAL_MS, THINKING_SETTLED
|
|
|
9
9
|
import { BRAND, ICE } from '../shimmer.js';
|
|
10
10
|
import { interpolateColor } from '../Spinner/spinnerUtils.js';
|
|
11
11
|
import { isMinimalMode } from '../../minimalMode.js';
|
|
12
|
+
import { primaryComboString } from '../../utils/keymap.js';
|
|
12
13
|
/** Preview body rows — a FIXED row count (kimicode-style constant-height
|
|
13
14
|
* ticker). Ink's truncate slices the whole string across newlines as one
|
|
14
15
|
* logical line, so a single joined Text collapses to 1-2 rows whenever
|
|
@@ -49,7 +50,7 @@ export function AssistantThinkingMessage({ thinking, textFull, marginTopOnTurn,
|
|
|
49
50
|
// header's brand→ice ladder, one sine period per ~7 frames (≈0.56s) —
|
|
50
51
|
// lively without strobing. Minimal mode drops the color (plain glyph);
|
|
51
52
|
// settled always keeps the plain dim anchor.
|
|
52
|
-
const label = `${t('thinking-label')}${duration}${streaming ? '…' : ` ${t('hint-expand-ctrl-o')}`}`;
|
|
53
|
+
const label = `${t('thinking-label')}${duration}${streaming ? '…' : ` ${t('hint-expand-ctrl-o', { key: primaryComboString('transcript') })}`}`;
|
|
53
54
|
const minimal = isMinimalMode();
|
|
54
55
|
const pulse = (Math.sin(frame * 0.9) + 1) / 2;
|
|
55
56
|
const pulseColor = interpolateColor(BRAND, ICE, pulse);
|
|
@@ -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;
|
|
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;AAKjE,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,kEAAkE;IAClE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;OAIG;IACH,OAAO,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IACjC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;IACzC,2EAA2E;IAC3E,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;8CAC0C;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,qFAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AA2FD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,KAAK,CAKtD;AAsVD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,eAAe,EACf,OAAO,EACP,UAAkB,EAClB,UAAkB,EAClB,OAAO,EACP,QAAQ,EACR,UAAmB,EACnB,cAAuB,EACvB,UAAU,EACV,mBAA2B,EAC3B,YAAoB,EACpB,KAAa,EACb,aAAa,GACd,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CA2PzB"}
|