@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
|
@@ -2,7 +2,7 @@ import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
|
2
2
|
import type { Context } from '@deepseek-ai/cordis';
|
|
3
3
|
import type { ChannelOwner } from './owner.js';
|
|
4
4
|
import type { ChannelState } from './types.js';
|
|
5
|
-
type CompactionState = Pick<ChannelState, 'agentId' | 'cwd' | 'working'>;
|
|
5
|
+
type CompactionState = Pick<ChannelState, 'agentId' | 'cwd' | 'working' | 'compaction' | 'emit'>;
|
|
6
6
|
type Notify = ChannelState['notify'];
|
|
7
7
|
/** Owns the one manual compaction transaction that must settle before a switch. */
|
|
8
8
|
export declare function createManualCompaction(ctx: Context, state: CompactionState, deps: {
|
|
@@ -13,6 +13,7 @@ export declare function createManualCompaction(ctx: Context, state: CompactionSt
|
|
|
13
13
|
}): {
|
|
14
14
|
compact: () => void;
|
|
15
15
|
settle: () => Promise<void>;
|
|
16
|
+
cancel: () => void;
|
|
16
17
|
};
|
|
17
18
|
export {};
|
|
18
19
|
//# sourceMappingURL=compaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/compaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAIlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAO9C,KAAK,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,KAAK,GAAG,SAAS,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/compaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAIlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAO9C,KAAK,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,YAAY,GAAG,MAAM,CAAC,CAAA;AAChG,KAAK,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;AAEpC,mFAAmF;AACnF,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE;IACJ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,QAAQ,GAAG,KAAK,CAAC,CAAA;IACvD,KAAK,IAAI,KAAK,CAAA;IACd,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IACrE,MAAM,EAAE,MAAM,CAAA;CACf;mBA0BmB,IAAI;kBAlBC,OAAO,CAAC,IAAI,CAAC;kBA4HnB,IAAI;EAQxB"}
|
|
@@ -5,6 +5,9 @@ import { serviceForAgent } from '../presets.js';
|
|
|
5
5
|
export function createManualCompaction(ctx, state, deps) {
|
|
6
6
|
let active;
|
|
7
7
|
const cancelled = new WeakSet();
|
|
8
|
+
/** Aborts the user asked for (Esc / Ctrl+C) rather than an ownership change:
|
|
9
|
+
* only those are reported as a cancellation instead of a failure. */
|
|
10
|
+
const userCancelled = new WeakSet();
|
|
8
11
|
const settle = async () => {
|
|
9
12
|
const transaction = active;
|
|
10
13
|
if (transaction === undefined)
|
|
@@ -71,7 +74,17 @@ export function createManualCompaction(ctx, state, deps) {
|
|
|
71
74
|
deps.notify(t('compact-while-working'), { color: 'warning' });
|
|
72
75
|
return;
|
|
73
76
|
}
|
|
74
|
-
|
|
77
|
+
// The status row replaces the old 4s toast: a real compaction runs for
|
|
78
|
+
// tens of seconds (measured: median ~25s, p90 ~70s), and the toast was
|
|
79
|
+
// gone for all but the first four of them.
|
|
80
|
+
const row = {
|
|
81
|
+
startedAt: Date.now(),
|
|
82
|
+
phase: 'prefill',
|
|
83
|
+
outputChars: 0,
|
|
84
|
+
cancellable: true,
|
|
85
|
+
};
|
|
86
|
+
state.compaction = row;
|
|
87
|
+
state.emit();
|
|
75
88
|
try {
|
|
76
89
|
// Compact the entry agent, never a later binding read after await.
|
|
77
90
|
const result = await compactService.compactNow(originAgent, controller.signal);
|
|
@@ -80,6 +93,11 @@ export function createManualCompaction(ctx, state, deps) {
|
|
|
80
93
|
deps.notify(result ? t('compact-done') : t('compact-nothing'));
|
|
81
94
|
}
|
|
82
95
|
catch (error) {
|
|
96
|
+
if (userCancelled.has(controller)) {
|
|
97
|
+
if (isCurrent())
|
|
98
|
+
deps.notify(t('compact-cancelled'));
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
83
101
|
if (!isCurrent() || cancelled.has(controller))
|
|
84
102
|
return;
|
|
85
103
|
if (error.code === 'persistence') {
|
|
@@ -99,6 +117,13 @@ export function createManualCompaction(ctx, state, deps) {
|
|
|
99
117
|
finally {
|
|
100
118
|
finished = true;
|
|
101
119
|
releaseOwner();
|
|
120
|
+
// The durable `compaction/end` event already cleared the row on every
|
|
121
|
+
// path that reached the host; this covers the ones that never did
|
|
122
|
+
// (vetoed decision, unavailable service, a throw before the bracket).
|
|
123
|
+
if (state.compaction?.cancellable === true) {
|
|
124
|
+
state.compaction = undefined;
|
|
125
|
+
state.emit();
|
|
126
|
+
}
|
|
102
127
|
const currentTransaction = active;
|
|
103
128
|
if (currentTransaction?.controller === controller)
|
|
104
129
|
active = undefined;
|
|
@@ -110,5 +135,13 @@ export function createManualCompaction(ctx, state, deps) {
|
|
|
110
135
|
if (!finished)
|
|
111
136
|
active = { controller, settled };
|
|
112
137
|
};
|
|
113
|
-
|
|
138
|
+
/** Abort the in-flight manual compaction the user asked to stop. */
|
|
139
|
+
const cancel = () => {
|
|
140
|
+
const transaction = active;
|
|
141
|
+
if (transaction === undefined)
|
|
142
|
+
return;
|
|
143
|
+
userCancelled.add(transaction.controller);
|
|
144
|
+
transaction.controller.abort(new Error('user cancelled compaction'));
|
|
145
|
+
};
|
|
146
|
+
return { compact, settle, cancel };
|
|
114
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/local-actions.ts"],"names":[],"mappings":"AAOA,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAC7E,OAAO,EAA+B,KAAK,QAAQ,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEjE,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,GAAG,EAAE;QAAE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;IACnC,KAAK,EAAE;QAAE,OAAO,IAAI,OAAO,CAAA;KAAE,CAAA;IAC7B,OAAO,EAAE;QACP,OAAO,IAAI,OAAO,CAAA;QAClB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAA;QACpC,QAAQ,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,OAAO,CAAC;YAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;SAAE,CAAA;KACvE,CAAA;IACD,KAAK,EAAE,YAAY,CAAA;IACnB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACzB,SAAS,EAAE;QAAE,KAAK,IAAI,IAAI,CAAC;QAAC,eAAe,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;QAAC,iBAAiB,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAA;KAAE,CAAA;IAClJ,SAAS,EAAE;QAAE,QAAQ,IAAI,IAAI,CAAA;KAAE,CAAA;IAC/B,IAAI,EAAE;QAAE,QAAQ,IAAI,IAAI,CAAA;KAAE,CAAA;IAC1B,QAAQ,EAAE,OAAO,QAAQ,CAAA;IACzB,SAAS,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;QAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAA;KAAE,CAAA;IACrJ,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;CAC/B;iBAIgB,MAAM;aAKV,IAAI;qBAYI,MAAM,SAAS,SAAS,MAAM,EAAE,GAAG,IAAI;4BAKhC,MAAM,GAAG,OAAO;qBAajB,OAAO,CAAC,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"local-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/local-actions.ts"],"names":[],"mappings":"AAOA,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAC7E,OAAO,EAA+B,KAAK,QAAQ,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEjE,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,GAAG,EAAE;QAAE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;IACnC,KAAK,EAAE;QAAE,OAAO,IAAI,OAAO,CAAA;KAAE,CAAA;IAC7B,OAAO,EAAE;QACP,OAAO,IAAI,OAAO,CAAA;QAClB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAA;QACpC,QAAQ,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,OAAO,CAAC;YAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;SAAE,CAAA;KACvE,CAAA;IACD,KAAK,EAAE,YAAY,CAAA;IACnB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACzB,SAAS,EAAE;QAAE,KAAK,IAAI,IAAI,CAAC;QAAC,eAAe,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;QAAC,iBAAiB,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAA;KAAE,CAAA;IAClJ,SAAS,EAAE;QAAE,QAAQ,IAAI,IAAI,CAAA;KAAE,CAAA;IAC/B,IAAI,EAAE;QAAE,QAAQ,IAAI,IAAI,CAAA;KAAE,CAAA;IAC1B,QAAQ,EAAE,OAAO,QAAQ,CAAA;IACzB,SAAS,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;QAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAA;KAAE,CAAA;IACrJ,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;CAC/B;iBAIgB,MAAM;aAKV,IAAI;qBAYI,MAAM,SAAS,SAAS,MAAM,EAAE,GAAG,IAAI;4BAKhC,MAAM,GAAG,OAAO;qBAajB,OAAO,CAAC,MAAM,EAAE,CAAC;6BAwBT,MAAM,oBAAoB,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;EAqBnF"}
|
|
@@ -70,7 +70,12 @@ export function createLocalActions(deps) {
|
|
|
70
70
|
return [t('subagent-none')];
|
|
71
71
|
return children.map(child => {
|
|
72
72
|
const id = typeof child.id === 'string' ? child.id : (child.id.value ?? '');
|
|
73
|
-
|
|
73
|
+
// The host's non-running activity is not proof that a child was
|
|
74
|
+
// archived: continuable children can be idle or temporarily unknown.
|
|
75
|
+
// Prefer the live projection when this process still owns the run.
|
|
76
|
+
const running = state.subagents.some(sub => sub.agentId === id && sub.status === 'running');
|
|
77
|
+
const activity = running || child.activity === 'running' ? t('subagent-running') : t('subagent-unknown');
|
|
78
|
+
return t('subagent-row', { mode: child.mode === 'continuable' ? t('subagent-resumable') : t('subagent-oneshot'), label: child.label ? `「${child.label}」` : '', activity, id: id.slice(0, 8) });
|
|
74
79
|
});
|
|
75
80
|
}
|
|
76
81
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-switch.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/model-switch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAQvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"model-switch.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/model-switch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAQvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACtD,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,EACjF,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,GAAG,OAAO,GAAG,eAAe,GAAG,cAAc,GAAG,iBAAiB,GAAG,MAAM,CAAC,CAAA;AAEhK,uHAAuH;AACvH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE;IACJ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;IACpC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,CAAA;IAC3F,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACzB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC,cAAc,IAAI,IAAI,CAAA;IACtB,cAAc,IAAI,IAAI,CAAA;IACtB,SAAS,IAAI,IAAI,CAAA;IACjB,MAAM,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,IAAI,CAAA;IAC7C,YAAY,IAAI,IAAI,CAAA;IACpB,SAAS,IAAI,IAAI,CAAA;IACjB,eAAe,IAAI,IAAI,CAAA;IACvB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,iBAAiB,IAAI,IAAI,CAAA;IACzB,mBAAmB,IAAI,IAAI,CAAA;IAC3B,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;CAC/B,IAEa,UAAU,MAAM,EAAE,OAAO,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC,CA+EjE"}
|
|
@@ -8,6 +8,7 @@ import { composePreset, runningPresetOf } from '../presets.js';
|
|
|
8
8
|
import { reserveNewSession } from '../../sessionMounts.js';
|
|
9
9
|
import { attachSessionToWorkspace } from '../workspace.js';
|
|
10
10
|
import { resetSessionProjection } from './session-reset.js';
|
|
11
|
+
import { childRecordsLineage } from './session-lineage.js';
|
|
11
12
|
/** Model-route adoption transaction. It settles compaction before its fork snapshot and owns the post-commit reset. */
|
|
12
13
|
export function createModelSwitchAction(ctx, state, deps) {
|
|
13
14
|
return async (provider, model) => {
|
|
@@ -48,7 +49,10 @@ export function createModelSwitchAction(ctx, state, deps) {
|
|
|
48
49
|
runtimeSession: deps.binding.agent.session,
|
|
49
50
|
inheritedCount: seed.length,
|
|
50
51
|
cwd: state.cwd,
|
|
51
|
-
|
|
52
|
+
// A session nobody has typed into has no conversation to relate, and
|
|
53
|
+
// lineage would cost its first real prompt the generated title — the
|
|
54
|
+
// child stands as its own root instead (session-lineage.ts).
|
|
55
|
+
parentSession: childRecordsLineage(seed) ? deps.binding.agent.session.id : undefined,
|
|
52
56
|
agentPreset: composed.agentPreset,
|
|
53
57
|
agentOptions: { provider, model },
|
|
54
58
|
setup: composed.setup,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/paths.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAEvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,8CAA8C;AAC9C,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7C;AAED;4EAC4E;AAC5E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,GAAG,MAAM,CAG3E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,eAAe,GAAE,OAAsC,GACtD,OAAO,CAwBT;AAED,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/paths.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAEvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,8CAA8C;AAC9C,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7C;AAED;4EAC4E;AAC5E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,GAAG,MAAM,CAG3E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,eAAe,GAAE,OAAsC,GACtD,OAAO,CAwBT;AAED,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CA+BlK;AAED,wBAAsB,uBAAuB,CAAC,EAAE,EAAE,gBAAgB,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAmD5I"}
|
|
@@ -59,9 +59,15 @@ export function sessionCwdMatches(stateCwd, headerCwd, caseInsensitive = process
|
|
|
59
59
|
export async function listPathCandidates(fs, cwd, query, signal, topK) {
|
|
60
60
|
const normalized = query.replaceAll('\\', '/');
|
|
61
61
|
const slash = normalized.lastIndexOf('/');
|
|
62
|
+
// Keep the user's spelling for the completion result. The normalized form
|
|
63
|
+
// is only for resolution/ranking; writing it back turns Windows `\\` paths
|
|
64
|
+
// into `/` paths and makes completion mutate otherwise valid input.
|
|
65
|
+
const rawSlash = Math.max(query.lastIndexOf('/'), query.lastIndexOf('\\'));
|
|
62
66
|
// `.` / `..` without a trailing separator are whole-directory queries too.
|
|
63
67
|
const bareDir = slash < 0 && (normalized === '.' || normalized === '..' || normalized === '~');
|
|
64
68
|
const directoryPart = slash < 0 ? (bareDir ? `${normalized}/` : '') : normalized.slice(0, slash + 1);
|
|
69
|
+
const displayDirectoryPart = rawSlash < 0 ? (bareDir ? `${query}/` : '') : query.slice(0, rawSlash + 1);
|
|
70
|
+
const displaySeparator = displayDirectoryPart.endsWith('\\') ? '\\' : '/';
|
|
65
71
|
const nameQuery = slash < 0 || bareDir ? '' : normalized.slice(slash + 1);
|
|
66
72
|
// `~/` expands against the host home (matches the cwd resolution rules);
|
|
67
73
|
// drive-letter and POSIX-absolute prefixes pass through untouched.
|
|
@@ -76,7 +82,7 @@ export async function listPathCandidates(fs, cwd, query, signal, topK) {
|
|
|
76
82
|
const target = await fs.resolve(expanded);
|
|
77
83
|
const entries = (await fs.listDir(target)).slice().sort((a, b) => a.name.localeCompare(b.name));
|
|
78
84
|
return rankFileCandidates(entries.filter(entry => entry.type === 'file' || entry.type === 'directory').map(entry => {
|
|
79
|
-
const path = `${
|
|
85
|
+
const path = `${displayDirectoryPart}${entry.name}${entry.type === 'directory' ? displaySeparator : ''}`;
|
|
80
86
|
return { id: path, path, displayPath: path, name: entry.name, kind: entry.type, score: 0 };
|
|
81
87
|
}), nameQuery, topK);
|
|
82
88
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ChannelState } from '../channel/types.js';
|
|
2
|
-
export declare function createPreferences(getState: () => Pick<ChannelState, 'diffLayout' | 'thinkingFold' | 'toolBackground' | 'scrollGutter' | 'pageMargin' | 'foldTerminalCommand' | 'promptSessionLabel' | 'expandEditor' | 'smoothStreaming' | 'statusBar' | 'whale' | 'whaleIdle' | 'minimal' | 'emit'>): Pick<ChannelState, 'setDiffLayout' | 'setThinkingFold' | 'setToolBackground' | 'setScrollGutter' | 'setPageMargin' | 'setFoldTerminalCommand' | 'setPromptSessionLabel' | 'setExpandEditor' | 'setSmoothStreaming' | 'setStatusBar' | 'setWhale' | 'setWhaleIdle' | 'setMinimal'>;
|
|
2
|
+
export declare function createPreferences(getState: () => Pick<ChannelState, 'diffLayout' | 'thinkingFold' | 'toolBackground' | 'scrollGutter' | 'pageMargin' | 'foldTerminalCommand' | 'promptSessionLabel' | 'expandEditor' | 'smoothStreaming' | 'statusBar' | 'whale' | 'whaleIdle' | 'whaleGirl' | 'splashFont' | 'minimal' | 'emit'>): Pick<ChannelState, 'setDiffLayout' | 'setThinkingFold' | 'setToolBackground' | 'setScrollGutter' | 'setPageMargin' | 'setFoldTerminalCommand' | 'setPromptSessionLabel' | 'setExpandEditor' | 'setSmoothStreaming' | 'setStatusBar' | 'setWhale' | 'setWhaleIdle' | 'setWhaleGirl' | 'setSplashFont' | 'setMinimal'>;
|
|
3
3
|
//# sourceMappingURL=preferences.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/preferences.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/preferences.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAEvD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,YAAY,GAAG,cAAc,GAAG,gBAAgB,GAAG,cAAc,GAAG,YAAY,GAAG,qBAAqB,GAAG,oBAAoB,GAAG,cAAc,GAAG,iBAAiB,GAAG,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,eAAe,GAAG,iBAAiB,GAAG,mBAAmB,GAAG,iBAAiB,GAAG,eAAe,GAAG,wBAAwB,GAAG,uBAAuB,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,cAAc,GAAG,UAAU,GAAG,cAAc,GAAG,cAAc,GAAG,eAAe,GAAG,YAAY,CAAC,CAqHxnB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { setMinimalMode } from '../../minimalMode.js';
|
|
2
|
+
import { normalizeSplashFont } from '../../components/splashFonts.js';
|
|
2
3
|
import { normalizePageMargin, normalizeScrollGutter, normalizeStatusBar, normalizeToolBackground } from '../../tuiDisplayPrefs.js';
|
|
3
4
|
export function createPreferences(getState) {
|
|
4
5
|
return {
|
|
@@ -91,6 +92,21 @@ export function createPreferences(getState) {
|
|
|
91
92
|
state.whaleIdle = enabled;
|
|
92
93
|
state.emit();
|
|
93
94
|
},
|
|
95
|
+
setSplashFont(setting) {
|
|
96
|
+
const state = getState();
|
|
97
|
+
const normalized = normalizeSplashFont(setting);
|
|
98
|
+
if (normalized === state.splashFont)
|
|
99
|
+
return;
|
|
100
|
+
state.splashFont = normalized;
|
|
101
|
+
state.emit();
|
|
102
|
+
},
|
|
103
|
+
setWhaleGirl(enabled) {
|
|
104
|
+
const state = getState();
|
|
105
|
+
if (enabled === state.whaleGirl)
|
|
106
|
+
return;
|
|
107
|
+
state.whaleGirl = enabled;
|
|
108
|
+
state.emit();
|
|
109
|
+
},
|
|
94
110
|
setMinimal(enabled) {
|
|
95
111
|
const state = getState();
|
|
96
112
|
setMinimalMode(enabled);
|
|
@@ -6,14 +6,13 @@ import type { SelectionAttachment } from '../../adapter/ports/channel-view.js';
|
|
|
6
6
|
import type { InputConvergence } from './input-actions.js';
|
|
7
7
|
import type { BackgroundJobStore } from '../jobs.js';
|
|
8
8
|
import type { TuiRendererHost } from '../renderers.js';
|
|
9
|
-
type ProjectionState = Pick<ChannelState, 'rows' | 'thinkingFold' | 'activeToolCount' | 'spinnerMode' | 'goal' | 'contextSegments' | 'tokens' | 'lastUsage' | 'lastUserText' | 'responseChars' | 'tps' | 'cancelPending' | 'working' | 'turnStart' | 'tpsSamples' | 'contextWindow' | 'reasoningEffort' | 'sessionTitle' | 'todos' | 'agentPreset' | 'sessionColor' | 'status' | 'emit'>;
|
|
9
|
+
type ProjectionState = Pick<ChannelState, 'rows' | 'thinkingFold' | 'activeToolCount' | 'spinnerMode' | 'goal' | 'contextSegments' | 'tokens' | 'mainCost' | 'model' | 'lastUsage' | 'lastUserText' | 'responseChars' | 'tps' | 'cancelPending' | 'working' | 'compaction' | 'turnStart' | 'tpsSamples' | 'contextWindow' | 'reasoningEffort' | 'sessionTitle' | 'todos' | 'agentPreset' | 'sessionColor' | 'status' | 'emit'>;
|
|
10
10
|
interface ProjectionDependencies {
|
|
11
11
|
agent(): Agent;
|
|
12
12
|
rowIds: {
|
|
13
13
|
value: number;
|
|
14
14
|
};
|
|
15
15
|
resetContextWarning(): void;
|
|
16
|
-
pendingTaskDescriptions: string[];
|
|
17
16
|
jobs: Pick<BackgroundJobStore, 'onOutputSeen' | 'onStarted'>;
|
|
18
17
|
inputConvergence: Pick<InputConvergence, 'cancelInFlight'>;
|
|
19
18
|
checkContextWarning(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,sBAAsB,CAAA;AACrE,OAAO,KAAK,EAAE,YAAY,EAAwB,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACrH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,sBAAsB,CAAA;AACrE,OAAO,KAAK,EAAE,YAAY,EAAwB,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACrH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAkBtD,KAAK,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc,GAAG,iBAAiB,GAAG,aAAa,GAAG,MAAM,GAAG,iBAAiB,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,WAAW,GAAG,cAAc,GAAG,eAAe,GAAG,KAAK,GAAG,eAAe,GAAG,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,GAAG,iBAAiB,GAAG,cAAc,GAAG,OAAO,GAAG,aAAa,GAAG,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAA;AAC9Z,UAAU,sBAAsB;IAC/B,KAAK,IAAI,KAAK,CAAA;IACd,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACzB,mBAAmB,IAAI,IAAI,CAAA;IAC3B,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,cAAc,GAAG,WAAW,CAAC,CAAA;IAC5D,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAA;IAC1D,mBAAmB,IAAI,IAAI,CAAA;IAC3B,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;IAC9B,KAAK,CAAC,EAAE,iBAAiB,CAAA;IACzB,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B;+DAC2D;IAC3D,WAAW,IAAI,OAAO,CAAA;IACtB;4EACwE;IACxE,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAAA;CACrE;AACD,iFAAiF;AACjF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,sBAAsB;iBAgmCxE,IAAI;2BA9tBQ,SAAS,YAAY,EAAE,KAAG,IAAI;yBAkGhC,YAAY,KAAG,IAAI;+BAxBb,oBAAoB,KAAG,IAAI;2BA1MjC,IAAI;6BAmDF,IAAI;4BA9KH,MAAM,WAAW,MAAM,KAAG,YAAY,GAAG,SAAS;8BAYhD,MAAM,WAAW,MAAM,QAAQ,YAAY,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,KAAG,cAAc,GAAG,SAAS;sBAoBvG,SAAS,YAAY,EAAE,GAAG,SAAS,KAAG,MAAM;2BASvC,SAAS,YAAY,EAAE,GAAG,SAAS,KAAG,MAAM;EAs8B3E"}
|
|
@@ -4,12 +4,13 @@ import { ARGS_PREVIEW_LIMIT, harnessToolResultView, LOCAL_OUTPUT_LIMIT, prepareR
|
|
|
4
4
|
import { estimateTokens, isTokenDelta, tokenDeltaChars, usageOutputTokens } from './usage.js';
|
|
5
5
|
import { transcriptImagesOf } from '../transcript-images.js';
|
|
6
6
|
import { isCompactionCheckpointSource, toolResultPayload } from '../compat/messages.js';
|
|
7
|
-
import { isPeakHour } from '../../deepseekPricing.js';
|
|
7
|
+
import { addUsageToCostBuckets, emptyCostBuckets, isPeakHour } from '../../deepseekPricing.js';
|
|
8
8
|
import { t } from '../../i18n.js';
|
|
9
9
|
import { logForDebugging } from '../../utils/debug.js';
|
|
10
10
|
import { cleanRenderText } from '../sanitize.js';
|
|
11
11
|
import { NOTICE_CELLS } from './decisions.js';
|
|
12
12
|
import { markChannelReadDirty } from '../../adapter/channel/read-view.js';
|
|
13
|
+
import { buildQuestionRecord, parseQuestionRecordAnswers, parseQuestionRecordQuestions, } from './question-record.js';
|
|
13
14
|
/** One authoritative reducer for both durable replay and live session events. */
|
|
14
15
|
export function createChannelProjection(state, deps) {
|
|
15
16
|
/** The in-progress assistant text row; `undefined` when no step is streaming. */
|
|
@@ -34,6 +35,15 @@ export function createChannelProjection(state, deps) {
|
|
|
34
35
|
let tpsStep;
|
|
35
36
|
/** Tool cards by callId, so tool/result can settle the running card. */
|
|
36
37
|
const toolCards = new Map();
|
|
38
|
+
/**
|
|
39
|
+
* `ask_user_question` calls by callId, holding their raw arguments. The ask
|
|
40
|
+
* renders as the interactive panel rather than a tool card, so its result
|
|
41
|
+
* has no card to settle — but the answered record is still a transcript
|
|
42
|
+
* fact and must come from the durable log (issue #1009), never from the
|
|
43
|
+
* view. Remembering the call lets `tool/result` derive that record on the
|
|
44
|
+
* live stream AND on every replay (`/resume`, rewind, model switch).
|
|
45
|
+
*/
|
|
46
|
+
const askCalls = new Map();
|
|
37
47
|
/**
|
|
38
48
|
* Session events are delivered live and can also be replayed around a
|
|
39
49
|
* reconnect. A repeated sealed message must not create a second assistant
|
|
@@ -46,6 +56,11 @@ export function createChannelProjection(state, deps) {
|
|
|
46
56
|
let openStep;
|
|
47
57
|
let activeAttempt;
|
|
48
58
|
let lastStreamRevision = -1;
|
|
59
|
+
/** 最近一次 request/header 的模型:durable usage 的模型归属真源。replay
|
|
60
|
+
* 会按历史请求逐个还原,因此 /model 切换(reset + replay 整个 seed)
|
|
61
|
+
* 不会把换模型前的用量重估到新模型;旧日志没有 header 时回退
|
|
62
|
+
* 事件发生时的 state.model(AC-A4)。 */
|
|
63
|
+
let eventModel;
|
|
49
64
|
const assistantRowsByStep = new Map();
|
|
50
65
|
const lastTextDelta = new Map();
|
|
51
66
|
const stepKey = (turn, step) => `${turn}:${step}`;
|
|
@@ -268,6 +283,40 @@ export function createChannelProjection(state, deps) {
|
|
|
268
283
|
if (folded > 0)
|
|
269
284
|
logForDebugging(`thinking: folded ${folded} reasoning row(s) at turn settle`);
|
|
270
285
|
};
|
|
286
|
+
/**
|
|
287
|
+
* Project one answered `ask_user_question` result into the transcript.
|
|
288
|
+
*
|
|
289
|
+
* The row shape reuses what `pushLocal` emits (`local` title + one
|
|
290
|
+
* `local-output` per line), so rendering, preview clipping and the local
|
|
291
|
+
* rows' fold exemption all keep their existing behavior. A failed ask
|
|
292
|
+
* renders the log's own error text — never a fabricated answer (the ask
|
|
293
|
+
* was cancelled/aborted, so no human ever chose anything).
|
|
294
|
+
*/
|
|
295
|
+
const projectAskResult = (event, rawArguments) => {
|
|
296
|
+
const append = (record) => {
|
|
297
|
+
appendRow({ id: deps.rowIds.value, kind: 'local', text: record.title, seq: event.seq });
|
|
298
|
+
deps.rowIds.value += 1;
|
|
299
|
+
for (const line of record.lines) {
|
|
300
|
+
appendRow({
|
|
301
|
+
id: deps.rowIds.value,
|
|
302
|
+
kind: 'local-output',
|
|
303
|
+
text: preview(line, LOCAL_OUTPUT_LIMIT),
|
|
304
|
+
seq: event.seq,
|
|
305
|
+
});
|
|
306
|
+
deps.rowIds.value += 1;
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
if (event.data.error !== undefined || toolResultPayload(event.data.message).isError) {
|
|
310
|
+
const errorText = toolErrorText(event);
|
|
311
|
+
append({ title: errorText, lines: [] });
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
const answers = parseQuestionRecordAnswers(textOf(toolResultPayload(event.data.message).content));
|
|
315
|
+
// No parseable answers (unparseable durable payload, or an older host):
|
|
316
|
+
// `answers: []` still yields the title, so the transcript shows that a
|
|
317
|
+
// questionnaire happened instead of dropping the fact silently.
|
|
318
|
+
append(buildQuestionRecord(parseQuestionRecordQuestions(rawArguments), answers ?? []));
|
|
319
|
+
};
|
|
271
320
|
/** Recompute the spinner phase from live row/tool state. */
|
|
272
321
|
const updateSpinnerMode = () => {
|
|
273
322
|
if (state.activeToolCount > 0) {
|
|
@@ -332,6 +381,7 @@ export function createChannelProjection(state, deps) {
|
|
|
332
381
|
openStep = undefined;
|
|
333
382
|
activeAttempt = undefined;
|
|
334
383
|
lastStreamRevision = -1;
|
|
384
|
+
eventModel = undefined;
|
|
335
385
|
assistantRowsByStep.clear();
|
|
336
386
|
lastTextDelta.clear();
|
|
337
387
|
replaying = true;
|
|
@@ -438,7 +488,7 @@ export function createChannelProjection(state, deps) {
|
|
|
438
488
|
// than disappearing with the other injected context.
|
|
439
489
|
if (isCompactionCheckpointSource(event.data.source)) {
|
|
440
490
|
const summary = textOf(event.data.content);
|
|
441
|
-
appendRow({ id: deps.rowIds.value, kind: 'notice', text: '
|
|
491
|
+
appendRow({ id: deps.rowIds.value, kind: 'notice', text: t('compact-done') });
|
|
442
492
|
deps.rowIds.value += 1;
|
|
443
493
|
if (summary) {
|
|
444
494
|
appendRow({ id: deps.rowIds.value, kind: 'compact', text: summary });
|
|
@@ -646,8 +696,9 @@ export function createChannelProjection(state, deps) {
|
|
|
646
696
|
// replays historical events, so a resumed session prices each
|
|
647
697
|
// request at the rate window it actually ran in — the session cost
|
|
648
698
|
// estimate never prices the whole session at the current window).
|
|
699
|
+
const peak = isPeakHour(new Date(event.time));
|
|
649
700
|
{
|
|
650
|
-
const bucket =
|
|
701
|
+
const bucket = peak
|
|
651
702
|
? state.tokens.peak
|
|
652
703
|
: state.tokens.idle;
|
|
653
704
|
bucket.input += usage.inputTokens ?? 0;
|
|
@@ -655,6 +706,24 @@ export function createChannelProjection(state, deps) {
|
|
|
655
706
|
bucket.cacheRead += usage.cacheReadTokens ?? 0;
|
|
656
707
|
bucket.cacheWrite += usage.cacheWriteTokens ?? 0;
|
|
657
708
|
}
|
|
709
|
+
// 主会话费用分桶(DESIGN D2):与 tokens 同口径,但按事件发生时
|
|
710
|
+
// 的模型归属——replay 用 request/header 还原历史请求模型,旧日志
|
|
711
|
+
// 回退 channel 模型;换模型不会把历史 token 重估到新模型。
|
|
712
|
+
const costInput = usage.inputTokens ?? 0;
|
|
713
|
+
const costOutput = usage.outputTokens ?? 0;
|
|
714
|
+
const costCacheRead = usage.cacheReadTokens ?? 0;
|
|
715
|
+
const costCacheWrite = usage.cacheWriteTokens ?? 0;
|
|
716
|
+
if (costInput !== 0 || costOutput !== 0 || costCacheRead !== 0 || costCacheWrite !== 0) {
|
|
717
|
+
const model = eventModel ?? state.model;
|
|
718
|
+
const cost = state.mainCost[model] ?? emptyCostBuckets();
|
|
719
|
+
addUsageToCostBuckets(cost, {
|
|
720
|
+
input: costInput,
|
|
721
|
+
output: costOutput,
|
|
722
|
+
cacheRead: costCacheRead,
|
|
723
|
+
cacheWrite: costCacheWrite,
|
|
724
|
+
}, peak);
|
|
725
|
+
state.mainCost[model] = cost;
|
|
726
|
+
}
|
|
658
727
|
// The most recent request's usage describes the CURRENT context:
|
|
659
728
|
// input (uncached) + cache hits all occupy the window. Cache hits
|
|
660
729
|
// also drive the status-line `cache N` readout.
|
|
@@ -707,25 +776,21 @@ export function createChannelProjection(state, deps) {
|
|
|
707
776
|
// The ask-user-question tool renders as the interactive questionnaire
|
|
708
777
|
// panel (DSH user-interaction seam), not as a tool card: the model is
|
|
709
778
|
// parked waiting for the human, so no running card, no active-tool
|
|
710
|
-
// spinner, no args noise in the transcript.
|
|
711
|
-
//
|
|
712
|
-
//
|
|
713
|
-
|
|
779
|
+
// spinner, no args noise in the transcript. Only the ARGUMENTS are
|
|
780
|
+
// remembered: the paired tool/result below projects the answered
|
|
781
|
+
// record from them (issue #1009), so `/resume`, rewind and replay
|
|
782
|
+
// rebuild it from the persisted log like every other transcript row.
|
|
783
|
+
if (event.data.name === 'ask_user_question') {
|
|
784
|
+
askCalls.set(event.data.callId, event.data.arguments);
|
|
714
785
|
break;
|
|
786
|
+
}
|
|
715
787
|
// The Task tool's plain card is replaced by the live subagent card
|
|
716
788
|
// (Kimi Code semantics): the delegation itself renders as a subagent
|
|
717
789
|
// row, so the raw args/result card would only duplicate it. The call
|
|
718
790
|
// still runs - only its transcript rendering is suppressed.
|
|
719
791
|
if (isSubagentToolName(event.data.name)) {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
if (typeof args.description === 'string' && args.description)
|
|
723
|
-
deps.pendingTaskDescriptions.push(args.description);
|
|
724
|
-
}
|
|
725
|
-
catch {
|
|
726
|
-
// Unparseable args leave the queue untouched; the card falls back
|
|
727
|
-
// to the provider label.
|
|
728
|
-
}
|
|
792
|
+
// The parent-scoped subagent reducer owns pending descriptions,
|
|
793
|
+
// including delegations made while this transcript is parked.
|
|
729
794
|
break;
|
|
730
795
|
}
|
|
731
796
|
// Reasoning that led to a tool call is done thinking — fold the
|
|
@@ -759,7 +824,19 @@ export function createChannelProjection(state, deps) {
|
|
|
759
824
|
break;
|
|
760
825
|
}
|
|
761
826
|
case 'tool/result': {
|
|
762
|
-
const
|
|
827
|
+
const callId = event.data.message.source.callId;
|
|
828
|
+
const card = toolCards.get(callId);
|
|
829
|
+
const askArguments = askCalls.get(callId);
|
|
830
|
+
// A call with no card is usually an ask_user_question (above) — its
|
|
831
|
+
// interaction lives in the panel, but its OUTCOME still belongs in
|
|
832
|
+
// the transcript. Project it from the durable log here: consumed
|
|
833
|
+
// before the card branch so the two can never both fire, and deleted
|
|
834
|
+
// so a repeated replay of the same result cannot double the record.
|
|
835
|
+
if (card === undefined && askArguments !== undefined) {
|
|
836
|
+
projectAskResult(event, askArguments);
|
|
837
|
+
askCalls.delete(callId);
|
|
838
|
+
break;
|
|
839
|
+
}
|
|
763
840
|
if (card !== undefined && card.tool !== undefined) {
|
|
764
841
|
const images = transcriptImages(event.data.message.content);
|
|
765
842
|
card.images = images.length === 0 ? undefined : images;
|
|
@@ -924,6 +1001,12 @@ export function createChannelProjection(state, deps) {
|
|
|
924
1001
|
if (typeof effort === 'string') {
|
|
925
1002
|
state.reasoningEffort = effort;
|
|
926
1003
|
}
|
|
1004
|
+
// 模型归属真源:该请求的 usage 按这里的 model 计价(replay 时逐请求
|
|
1005
|
+
// 还原;live 时与 state.model 同步更新,AC-A4)。header 缺/空 model
|
|
1006
|
+
// 必须清掉上一条 header 的值——否则后续 usage 会沿用旧模型进错桶;
|
|
1007
|
+
// 归属时再回退 state.model(旧日志没有 header 的既有语义)。
|
|
1008
|
+
const headerModel = event.data.header.config?.model;
|
|
1009
|
+
eventModel = typeof headerModel === 'string' && headerModel !== '' ? headerModel : undefined;
|
|
927
1010
|
const legacySystem = event.data.header.system;
|
|
928
1011
|
if (typeof legacySystem === 'string') {
|
|
929
1012
|
state.contextSegments.system = estimateTokens(legacySystem);
|
|
@@ -982,6 +1065,31 @@ export function createChannelProjection(state, deps) {
|
|
|
982
1065
|
state.sessionColor = typeof data.color === 'string' ? data.color : '';
|
|
983
1066
|
break;
|
|
984
1067
|
}
|
|
1068
|
+
// The compaction bracket is a plugin-appended event pair (not part of
|
|
1069
|
+
// dsh-session's typed map). Opening it here rather than in the manual
|
|
1070
|
+
// path is what makes an AUTOMATIC pressure compaction visible too: the
|
|
1071
|
+
// host writes `compaction/start` before the summarizer runs and
|
|
1072
|
+
// `compaction/end` once the checkpoint is committed or abandoned.
|
|
1073
|
+
// A manual request already installed its own cancellable row, so this
|
|
1074
|
+
// only fills the gap for one this process did not start.
|
|
1075
|
+
if (event.type === 'compaction/start') {
|
|
1076
|
+
// Replay is settled history, and a process killed between start and
|
|
1077
|
+
// end leaves an unmatched start in the log: painting a row for it
|
|
1078
|
+
// would show a compaction that nothing will ever clear.
|
|
1079
|
+
if (!replaying && state.compaction === undefined) {
|
|
1080
|
+
state.compaction = {
|
|
1081
|
+
startedAt: typeof event.time === 'number' ? event.time : Date.now(),
|
|
1082
|
+
phase: 'prefill',
|
|
1083
|
+
outputChars: 0,
|
|
1084
|
+
cancellable: false,
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
break;
|
|
1088
|
+
}
|
|
1089
|
+
if (event.type === 'compaction/end') {
|
|
1090
|
+
state.compaction = undefined;
|
|
1091
|
+
break;
|
|
1092
|
+
}
|
|
985
1093
|
// Custom plugin events (tuiRenderers seam): a registered renderer
|
|
986
1094
|
// maps the payload to text rows — title as a local row, body as
|
|
987
1095
|
// preview-clipped local-output rows, same shape pushLocal uses.
|
|
@@ -1014,11 +1122,13 @@ export function createChannelProjection(state, deps) {
|
|
|
1014
1122
|
sealedReasoning.length = 0;
|
|
1015
1123
|
lastReasoningRow = undefined;
|
|
1016
1124
|
toolCards.clear();
|
|
1125
|
+
askCalls.clear();
|
|
1017
1126
|
handledAssistantMessages.clear();
|
|
1018
1127
|
handledAssistantChunks.clear();
|
|
1019
1128
|
openStep = undefined;
|
|
1020
1129
|
activeAttempt = undefined;
|
|
1021
1130
|
lastStreamRevision = -1;
|
|
1131
|
+
eventModel = undefined;
|
|
1022
1132
|
assistantRowsByStep.clear();
|
|
1023
1133
|
lastTextDelta.clear();
|
|
1024
1134
|
tpsTurn = undefined;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Answered-questionnaire transcript record — a PURE fold of the durable
|
|
3
|
+
* session log (issue #1009).
|
|
4
|
+
*
|
|
5
|
+
* `ask_user_question` renders as the interactive panel, not as a tool card,
|
|
6
|
+
* so its `tool/result` had no renderer at all: the answers lived only in the
|
|
7
|
+
* current process's view rows (the TUI used to push a summary when the panel
|
|
8
|
+
* closed). That violated the transcript's source-of-truth rule — `/resume`,
|
|
9
|
+
* rewind, `loadOlder` and any replay lost the record, and an ask that was
|
|
10
|
+
* never observed closing produced none at all.
|
|
11
|
+
*
|
|
12
|
+
* The record now derives from the same log every other transcript row comes
|
|
13
|
+
* from: the `tool/call` arguments carry the questions, the `tool/result`
|
|
14
|
+
* payload carries the answers. Both are parsed at the caller's edge here, so
|
|
15
|
+
* this module stays pure (no store, no i18n state, no projection imports) and
|
|
16
|
+
* is directly testable.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* The parts of a question this fold needs. Structurally compatible with the
|
|
20
|
+
* harness's `AskUserQuestionItem`, so `src/dsh-adapter/` callers pass the
|
|
21
|
+
* official type straight through while this module keeps its own shape.
|
|
22
|
+
*/
|
|
23
|
+
export interface QuestionRecordQuestion {
|
|
24
|
+
readonly question: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* One answer as the harness persists it (a subset of
|
|
28
|
+
* `AskUserQuestionAnswerItem`: the fold matches answers to questions BY ORDER,
|
|
29
|
+
* mirroring how the panel collects one answer per question).
|
|
30
|
+
*/
|
|
31
|
+
export interface QuestionRecordAnswer {
|
|
32
|
+
readonly selected: readonly string[];
|
|
33
|
+
readonly custom?: string;
|
|
34
|
+
}
|
|
35
|
+
/** One answered questionnaire as the transcript renders it. */
|
|
36
|
+
export interface QuestionRecord {
|
|
37
|
+
/** Local-row title (dictionary text, never hand-written here). */
|
|
38
|
+
readonly title: string;
|
|
39
|
+
/** One `· question → answer` line per answered question. */
|
|
40
|
+
readonly lines: readonly string[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Fold one answered questionnaire into its transcript record.
|
|
44
|
+
*
|
|
45
|
+
* Tolerant by contract: the projection calls this on durable replay data it
|
|
46
|
+
* does not control (truncated logs, older hosts, a wizard-shaped caller), and
|
|
47
|
+
* a throw inside `renderEvent` would abort the whole transcript fold. So a
|
|
48
|
+
* missing/garbled question list or answer item degrades to a shorter line
|
|
49
|
+
* instead of raising.
|
|
50
|
+
*
|
|
51
|
+
* @param questions - The ask's questions, in the order they were answered.
|
|
52
|
+
* @param answers - The answers the log recorded for that same ask.
|
|
53
|
+
* @param options - `redact` masks answer text (local wizards collecting
|
|
54
|
+
* secrets such as API keys must never leak into the transcript or an
|
|
55
|
+
* `/export` dump); the model-side ask never sets it.
|
|
56
|
+
* @returns The title line plus its `· question → choice` body lines.
|
|
57
|
+
*/
|
|
58
|
+
export declare function buildQuestionRecord(questions: readonly (QuestionRecordQuestion | undefined)[] | undefined, answers: readonly (QuestionRecordAnswer | undefined)[] | undefined, options?: {
|
|
59
|
+
redact?: boolean;
|
|
60
|
+
}): QuestionRecord;
|
|
61
|
+
/**
|
|
62
|
+
* Parse the questions out of a persisted `ask_user_question` `tool/call`
|
|
63
|
+
* arguments string. Returns `undefined` when the payload is not the
|
|
64
|
+
* `{ questions: [...] }` object the tool declares, so the caller can fall
|
|
65
|
+
* back to a title-only record.
|
|
66
|
+
*/
|
|
67
|
+
export declare function parseQuestionRecordQuestions(rawArguments: string | undefined): QuestionRecordQuestion[] | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Parse the answers out of a `tool/result` text payload. `dsh-tool-ask-user`
|
|
70
|
+
* renders its output as one JSON text block — the same bytes the model reads
|
|
71
|
+
* back — so the durable log is a sufficient source. A failed ask (or any
|
|
72
|
+
* non-JSON body) yields `undefined`: the caller then renders the log's own
|
|
73
|
+
* error text instead of fabricating an answer.
|
|
74
|
+
*/
|
|
75
|
+
export declare function parseQuestionRecordAnswers(rawResult: string): QuestionRecordAnswer[] | undefined;
|
|
76
|
+
//# sourceMappingURL=question-record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question-record.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/question-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAClC;AAQD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,SAAS,CAAC,sBAAsB,GAAG,SAAS,CAAC,EAAE,GAAG,SAAS,EACtE,OAAO,EAAE,SAAS,CAAC,oBAAoB,GAAG,SAAS,CAAC,EAAE,GAAG,SAAS,EAClE,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7B,cAAc,CAyBhB;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,sBAAsB,EAAE,GAAG,SAAS,CAWnH;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,oBAAoB,EAAE,GAAG,SAAS,CAShG"}
|