@deepseek-harness-tui/dsh-tui 0.11.0 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -20
- package/assets/whale-girl/whale-girl-dark.png +0 -0
- package/assets/whale-girl/whale-girl-happy.png +0 -0
- package/assets/whale-girl/whale-girl.png +0 -0
- package/bin/dsh-tui.js +63 -3
- package/cordis.patch.yml +43 -20
- package/cordis.yml +6 -4
- package/lib/settings.json +1272 -0
- package/lib/types/activityPrefs.d.ts +24 -0
- package/lib/types/activityPrefs.d.ts.map +1 -1
- package/lib/types/activityPrefs.js +50 -1
- package/lib/types/adapter/channel/state.d.ts.map +1 -1
- package/lib/types/adapter/channel/state.js +3 -1
- package/lib/types/adapter/channel/ui-policy.d.ts +9 -2
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +14 -1
- package/lib/types/adapter/kernel/replay.d.ts.map +1 -1
- package/lib/types/adapter/kernel/replay.js +2 -0
- package/lib/types/adapter/ports/channel-display.d.ts +12 -0
- package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-session.d.ts +38 -0
- package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-settings.d.ts +12 -0
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +53 -7
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +43 -12
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel.d.ts +4 -1
- package/lib/types/adapter/ports/channel.d.ts.map +1 -1
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +2 -0
- package/lib/types/components/ActivityLine.d.ts +7 -2
- package/lib/types/components/ActivityLine.d.ts.map +1 -1
- package/lib/types/components/ActivityLine.js +0 -8
- package/lib/types/components/BalanceReportRow.d.ts +10 -2
- package/lib/types/components/BalanceReportRow.d.ts.map +1 -1
- package/lib/types/components/BalanceReportRow.js +18 -4
- package/lib/types/components/CompactionStatusRow.d.ts +24 -0
- package/lib/types/components/CompactionStatusRow.d.ts.map +1 -0
- package/lib/types/components/CompactionStatusRow.js +72 -0
- package/lib/types/components/GoalTodoPanel.js +2 -2
- package/lib/types/components/HelpMenu.d.ts +2 -2
- package/lib/types/components/HelpMenu.d.ts.map +1 -1
- package/lib/types/components/HelpMenu.js +5 -4
- package/lib/types/components/InlineMathParagraph.d.ts +22 -0
- package/lib/types/components/InlineMathParagraph.d.ts.map +1 -0
- package/lib/types/components/InlineMathParagraph.js +178 -0
- package/lib/types/components/LogoV2.d.ts +41 -3
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +148 -24
- package/lib/types/components/Markdown.d.ts +10 -3
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +47 -14
- package/lib/types/components/MathBlock.d.ts +13 -0
- package/lib/types/components/MathBlock.d.ts.map +1 -0
- package/lib/types/components/MathBlock.js +136 -0
- package/lib/types/components/MessageList.d.ts +10 -1
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +15 -5
- package/lib/types/components/MigratePicker.d.ts +30 -0
- package/lib/types/components/MigratePicker.d.ts.map +1 -0
- package/lib/types/components/MigratePicker.js +38 -0
- package/lib/types/components/PromptInput.d.ts +17 -0
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +96 -9
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +3 -1
- package/lib/types/components/StarPrompt.d.ts +53 -0
- package/lib/types/components/StarPrompt.d.ts.map +1 -0
- package/lib/types/components/StarPrompt.js +281 -0
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
- package/lib/types/components/StreamingMarkdown.js +20 -3
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +12 -6
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +8 -3
- package/lib/types/components/TimelineRail.d.ts.map +1 -1
- package/lib/types/components/TimelineRail.js +9 -1
- package/lib/types/components/Whale.d.ts +17 -8
- package/lib/types/components/Whale.d.ts.map +1 -1
- package/lib/types/components/Whale.js +25 -15
- package/lib/types/components/WhaleGirl.d.ts +29 -0
- package/lib/types/components/WhaleGirl.d.ts.map +1 -0
- package/lib/types/components/WhaleGirl.js +32 -0
- package/lib/types/components/WorkingSpinner.d.ts +4 -1
- package/lib/types/components/WorkingSpinner.d.ts.map +1 -1
- package/lib/types/components/WorkingSpinner.js +2 -2
- package/lib/types/components/bigfont.d.ts +47 -18
- package/lib/types/components/bigfont.d.ts.map +1 -1
- package/lib/types/components/bigfont.js +55 -40
- package/lib/types/components/design-system/HintLine.d.ts +1 -2
- package/lib/types/components/design-system/HintLine.d.ts.map +1 -1
- package/lib/types/components/design-system/HintLine.js +1 -2
- package/lib/types/components/design-system/ThemeProvider.d.ts +6 -0
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +40 -1
- package/lib/types/components/maidPortrait.d.ts +44 -0
- package/lib/types/components/maidPortrait.d.ts.map +1 -0
- package/lib/types/components/maidPortrait.js +178 -0
- package/lib/types/components/mathPreview.d.ts +25 -0
- package/lib/types/components/mathPreview.d.ts.map +1 -0
- package/lib/types/components/mathPreview.js +48 -0
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +2 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +4 -2
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -2
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +31 -26
- package/lib/types/components/messages/TranscriptImages.d.ts.map +1 -1
- package/lib/types/components/messages/TranscriptImages.js +11 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +14 -2
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +80 -38
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +3 -3
- package/lib/types/components/sessions/ForeignSessionRow.d.ts +34 -0
- package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -0
- package/lib/types/components/sessions/ForeignSessionRow.js +43 -0
- package/lib/types/components/sessions/SourceTabs.d.ts +52 -0
- package/lib/types/components/sessions/SourceTabs.d.ts.map +1 -0
- package/lib/types/components/sessions/SourceTabs.js +70 -0
- package/lib/types/components/splashEggs.d.ts +56 -0
- package/lib/types/components/splashEggs.d.ts.map +1 -0
- package/lib/types/components/splashEggs.js +67 -0
- package/lib/types/components/splashFonts.d.ts +119 -0
- package/lib/types/components/splashFonts.d.ts.map +1 -0
- package/lib/types/components/splashFonts.js +267 -0
- package/lib/types/components/splashLayout.d.ts +41 -0
- package/lib/types/components/splashLayout.d.ts.map +1 -0
- package/lib/types/components/splashLayout.js +40 -0
- package/lib/types/components/whaleGirlSprite.d.ts +17 -0
- package/lib/types/components/whaleGirlSprite.d.ts.map +1 -0
- package/lib/types/components/whaleGirlSprite.js +47 -0
- package/lib/types/deepseekPricing.d.ts +74 -0
- package/lib/types/deepseekPricing.d.ts.map +1 -1
- package/lib/types/deepseekPricing.js +110 -11
- package/lib/types/dsh-adapter/activity-store.d.ts +221 -0
- package/lib/types/dsh-adapter/activity-store.d.ts.map +1 -0
- package/lib/types/dsh-adapter/activity-store.js +359 -0
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.js +6 -1
- package/lib/types/dsh-adapter/channel/background-action.d.ts +2 -1
- package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/background-action.js +2 -0
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +15 -14
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +70 -21
- package/lib/types/dsh-adapter/channel/compaction.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/compaction.js +35 -4
- package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/local-actions.js +6 -1
- package/lib/types/dsh-adapter/channel/model-switch.d.ts +1 -2
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.js +6 -2
- package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/paths.js +7 -1
- package/lib/types/dsh-adapter/channel/preferences.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/preferences.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/preferences.js +16 -0
- package/lib/types/dsh-adapter/channel/projection.d.ts +1 -2
- package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection.js +127 -17
- package/lib/types/dsh-adapter/channel/question-record.d.ts +76 -0
- package/lib/types/dsh-adapter/channel/question-record.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/question-record.js +107 -0
- package/lib/types/dsh-adapter/channel/session-adoption.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-adoption.js +1 -0
- package/lib/types/dsh-adapter/channel/session-lineage.d.ts +42 -0
- package/lib/types/dsh-adapter/channel/session-lineage.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-lineage.js +51 -0
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +3 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.js +10 -3
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts +2 -1
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +43 -9
- package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.js +7 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts +2 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +5 -2
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +8 -0
- package/lib/types/dsh-adapter/channel/state.d.ts +19 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +8 -3
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +32 -17
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +309 -8
- package/lib/types/dsh-adapter/channel/types.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.d.ts +1 -1
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +34 -18
- package/lib/types/dsh-adapter/compat/index.d.ts +1 -1
- package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/index.js +1 -1
- package/lib/types/dsh-adapter/compat/messages.d.ts +6 -0
- package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/messages.js +9 -0
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +18 -0
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.js +18 -3
- package/lib/types/dsh-adapter/compat/settings.d.ts +2 -0
- package/lib/types/dsh-adapter/compat/settings.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/settings.js +14 -0
- package/lib/types/dsh-adapter/contract.d.ts +5 -4
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +9 -5
- package/lib/types/dsh-adapter/index.d.ts +36 -1
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +22 -6
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.js +131 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.parse.d.ts +17 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.parse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.parse.js +329 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.js +102 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.parse.d.ts +16 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.parse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.parse.js +289 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.js +117 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.parse.d.ts +13 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.parse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.parse.js +178 -0
- package/lib/types/dsh-adapter/migrate/adapters/omp.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/omp.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/omp.js +133 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan-fs.d.ts +60 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan-fs.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan-fs.js +178 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan.d.ts +8 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan.js +40 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.js +93 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.parse.d.ts +9 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.parse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.parse.js +89 -0
- package/lib/types/dsh-adapter/migrate/bin-path.d.ts +6 -0
- package/lib/types/dsh-adapter/migrate/bin-path.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/bin-path.js +30 -0
- package/lib/types/dsh-adapter/migrate/browse.d.ts +42 -0
- package/lib/types/dsh-adapter/migrate/browse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/browse.js +90 -0
- package/lib/types/dsh-adapter/migrate/cli.d.ts +9 -0
- package/lib/types/dsh-adapter/migrate/cli.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/cli.js +106 -0
- package/lib/types/dsh-adapter/migrate/import-one.d.ts +89 -0
- package/lib/types/dsh-adapter/migrate/import-one.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/import-one.js +133 -0
- package/lib/types/dsh-adapter/migrate/index.d.ts +35 -0
- package/lib/types/dsh-adapter/migrate/index.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/index.js +107 -0
- package/lib/types/dsh-adapter/migrate/parse/injection.d.ts +40 -0
- package/lib/types/dsh-adapter/migrate/parse/injection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/injection.js +127 -0
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts +28 -0
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/jsonl.js +40 -0
- package/lib/types/dsh-adapter/migrate/parse/role-turns.d.ts +28 -0
- package/lib/types/dsh-adapter/migrate/parse/role-turns.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/role-turns.js +50 -0
- package/lib/types/dsh-adapter/migrate/parse/title.d.ts +18 -0
- package/lib/types/dsh-adapter/migrate/parse/title.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/title.js +29 -0
- package/lib/types/dsh-adapter/migrate/parse/tools.d.ts +62 -0
- package/lib/types/dsh-adapter/migrate/parse/tools.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/tools.js +110 -0
- package/lib/types/dsh-adapter/migrate/picker.d.ts +64 -0
- package/lib/types/dsh-adapter/migrate/picker.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/picker.js +86 -0
- package/lib/types/dsh-adapter/migrate/recent-agents.d.ts +40 -0
- package/lib/types/dsh-adapter/migrate/recent-agents.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/recent-agents.js +100 -0
- package/lib/types/dsh-adapter/migrate/sessionize.d.ts +39 -0
- package/lib/types/dsh-adapter/migrate/sessionize.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/sessionize.js +271 -0
- package/lib/types/dsh-adapter/migrate/types.d.ts +176 -0
- package/lib/types/dsh-adapter/migrate/types.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/types.js +11 -0
- package/lib/types/dsh-adapter/migrate/uuid.d.ts +7 -0
- package/lib/types/dsh-adapter/migrate/uuid.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/uuid.js +25 -0
- package/lib/types/dsh-adapter/plugin.d.ts +5 -3
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +168 -372
- package/lib/types/dsh-adapter/providerWizard.d.ts +17 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +254 -66
- package/lib/types/dsh-adapter/questions.d.ts +22 -15
- package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/questions.js +47 -45
- package/lib/types/dsh-adapter/sessions/digest.d.ts +11 -6
- package/lib/types/dsh-adapter/sessions/digest.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/digest.js +20 -13
- package/lib/types/dsh-adapter/sessions/frames.d.ts +3 -1
- package/lib/types/dsh-adapter/sessions/frames.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/frames.js +5 -4
- package/lib/types/dsh-adapter/sessions/list.d.ts +6 -1
- package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/list.js +188 -164
- package/lib/types/dsh-adapter/sessions/recovery.d.ts +16 -0
- package/lib/types/dsh-adapter/sessions/recovery.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessions/recovery.js +108 -0
- package/lib/types/dsh-adapter/sessions/snapshot.d.ts +7 -0
- package/lib/types/dsh-adapter/sessions/snapshot.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessions/snapshot.js +90 -0
- package/lib/types/dsh-adapter/sessions/store.d.ts +10 -4
- package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/store.js +62 -25
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +7 -4
- package/lib/types/dsh-adapter/sideQuestion.d.ts +41 -2
- package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sideQuestion.js +98 -2
- package/lib/types/dsh-adapter/subagents.d.ts +44 -6
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +163 -26
- package/lib/types/herdr.d.ts +2 -0
- package/lib/types/herdr.d.ts.map +1 -1
- package/lib/types/herdr.js +9 -3
- package/lib/types/history.d.ts +13 -1
- package/lib/types/history.d.ts.map +1 -1
- package/lib/types/history.js +15 -2
- package/lib/types/i18n.d.ts +512 -41
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +199 -20
- package/lib/types/ink/components/App.d.ts +2 -2
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +5 -1
- package/lib/types/ink/components/Image.d.ts +14 -1
- package/lib/types/ink/components/Image.d.ts.map +1 -1
- package/lib/types/ink/components/Image.js +2 -2
- package/lib/types/ink/events/input-event.js +3 -3
- package/lib/types/ink/hooks/use-terminal-images.d.ts +12 -0
- package/lib/types/ink/hooks/use-terminal-images.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-terminal-images.js +13 -0
- package/lib/types/ink/ink.d.ts +6 -0
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +16 -1
- package/lib/types/ink/kitty-graphics.d.ts +44 -3
- package/lib/types/ink/kitty-graphics.d.ts.map +1 -1
- package/lib/types/ink/kitty-graphics.js +184 -23
- package/lib/types/ink/log-update.d.ts.map +1 -1
- package/lib/types/ink/log-update.js +19 -1
- package/lib/types/ink/output.d.ts +24 -2
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +83 -5
- package/lib/types/ink/parse-keypress.d.ts +26 -1
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +156 -13
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +8 -1
- package/lib/types/ink/screen.d.ts +24 -0
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/screen.js +89 -0
- package/lib/types/ink/selection.d.ts +68 -18
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +178 -31
- package/lib/types/ink/sixel-codec.d.ts +12 -1
- package/lib/types/ink/sixel-codec.d.ts.map +1 -1
- package/lib/types/ink/sixel-codec.js +29 -5
- package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
- package/lib/types/ink/sixel-graphics.js +5 -3
- package/lib/types/ink/styles.d.ts +9 -0
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/terminal-image.d.ts +8 -0
- package/lib/types/ink/terminal-image.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.d.ts +7 -1
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +12 -2
- package/lib/types/ink/timeline-rail.d.ts +5 -0
- package/lib/types/ink/timeline-rail.d.ts.map +1 -1
- package/lib/types/math/inline-layout.d.ts +29 -0
- package/lib/types/math/inline-layout.d.ts.map +1 -0
- package/lib/types/math/inline-layout.js +106 -0
- package/lib/types/math/layout.d.ts +58 -0
- package/lib/types/math/layout.d.ts.map +1 -0
- package/lib/types/math/layout.js +59 -0
- package/lib/types/math/renderer.d.ts +64 -0
- package/lib/types/math/renderer.d.ts.map +1 -0
- package/lib/types/math/renderer.js +256 -0
- package/lib/types/screens/Chat.d.ts +17 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +618 -57
- package/lib/types/screens/SessionSupervisor.d.ts +2 -1
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +156 -19
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +49 -11
- package/lib/types/screens/StatusLine.d.ts +5 -1
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +47 -17
- package/lib/types/screens/chatOverlay.d.ts +5 -0
- package/lib/types/screens/chatOverlay.d.ts.map +1 -1
- package/lib/types/screens/chatOverlay.js +1 -0
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +47 -0
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -0
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +65 -0
- package/lib/types/screens/sessionSupervisor/model.d.ts +12 -0
- package/lib/types/screens/sessionSupervisor/model.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/model.js +26 -0
- package/lib/types/screens/sessionSupervisor/useForeignSessions.d.ts +107 -0
- package/lib/types/screens/sessionSupervisor/useForeignSessions.d.ts.map +1 -0
- package/lib/types/screens/sessionSupervisor/useForeignSessions.js +312 -0
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +4 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +97 -14
- package/lib/types/sessionHistory.d.ts +2 -2
- package/lib/types/sessionHistory.d.ts.map +1 -1
- package/lib/types/sessionHistory.js +31 -5
- package/lib/types/settings/definitions.d.ts +681 -0
- package/lib/types/settings/definitions.d.ts.map +1 -0
- package/lib/types/settings/definitions.js +511 -0
- package/lib/types/starAction.d.ts +44 -0
- package/lib/types/starAction.d.ts.map +1 -0
- package/lib/types/starAction.js +52 -0
- package/lib/types/terminal-utils/latex.d.ts +10 -0
- package/lib/types/terminal-utils/latex.d.ts.map +1 -0
- package/lib/types/terminal-utils/latex.js +1417 -0
- package/lib/types/terminal-utils/markdown.d.ts +3 -1
- package/lib/types/terminal-utils/markdown.d.ts.map +1 -1
- package/lib/types/terminal-utils/markdown.js +26 -1
- package/lib/types/terminal-utils/math.d.ts +66 -0
- package/lib/types/terminal-utils/math.d.ts.map +1 -0
- package/lib/types/terminal-utils/math.js +337 -0
- package/lib/types/tips.d.ts.map +1 -1
- package/lib/types/tips.js +6 -0
- package/lib/types/tuiDisplayPrefs.d.ts +67 -0
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +59 -0
- package/lib/types/ui.d.ts +1 -1
- package/lib/types/ui.d.ts.map +1 -1
- package/lib/types/ui.js +1 -1
- package/lib/types/usageStats.d.ts +98 -0
- package/lib/types/usageStats.d.ts.map +1 -0
- package/lib/types/usageStats.js +169 -0
- package/lib/types/utils/bmp.d.ts +17 -0
- package/lib/types/utils/bmp.d.ts.map +1 -0
- package/lib/types/utils/bmp.js +154 -0
- package/lib/types/utils/clipboard.d.ts +14 -2
- package/lib/types/utils/clipboard.d.ts.map +1 -1
- package/lib/types/utils/clipboard.js +143 -8
- package/lib/types/utils/fold-long-lines.d.ts +1 -1
- package/lib/types/utils/fold-long-lines.d.ts.map +1 -1
- package/lib/types/utils/fold-long-lines.js +3 -2
- package/lib/types/utils/keymap.d.ts +4 -1
- package/lib/types/utils/keymap.d.ts.map +1 -1
- package/lib/types/utils/keymap.js +8 -0
- package/lib/types/utils/modifiers.d.ts +4 -3
- package/lib/types/utils/modifiers.d.ts.map +1 -1
- package/lib/types/utils/modifiers.js +4 -3
- package/lib/types/working-activity.d.ts +10 -9
- package/lib/types/working-activity.d.ts.map +1 -1
- package/lib/types/working-activity.js +17 -10
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/LICENSE +202 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/NOTICE +20 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/index.d.ts +16 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/lib/bundled-packages.json +4 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/lib/index.mjs +20 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/lib/index.mjs.LEGAL.txt +35 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/package.json +29 -0
- package/package.json +117 -99
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts +0 -19
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts.map +0 -1
- package/lib/types/components/design-system/KeyboardShortcutHint.js +0 -14
- package/lib/types/dsh-adapter/channel/activity.d.ts +0 -20
- package/lib/types/dsh-adapter/channel/activity.d.ts.map +0 -1
- package/lib/types/dsh-adapter/channel/activity.js +0 -113
- package/lib/types/terminal-utils/terminal.d.ts +0 -18
- package/lib/types/terminal-utils/terminal.d.ts.map +0 -1
- package/lib/types/terminal-utils/terminal.js +0 -96
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session-scoped activity snapshots for the working-status line.
|
|
3
|
+
*
|
|
4
|
+
* The line's *semantics* belong to the `dsh-working-activity` plugin: it folds
|
|
5
|
+
* durable session events and live model frames into a **session projection**
|
|
6
|
+
* (`workingActivity`) that any client can read — the browser reads it, and so
|
|
7
|
+
* does this TUI. Consuming the projection is what removes the second tracker
|
|
8
|
+
* this app used to run: one semantic owner, and a value that arrives already
|
|
9
|
+
* scoped to a session, so a background session can no longer overwrite the line
|
|
10
|
+
* of the session on screen.
|
|
11
|
+
*
|
|
12
|
+
* Two properties of the transport shape this module:
|
|
13
|
+
*
|
|
14
|
+
* 1. **It is event-driven.** A value changes when a committed event folds, never
|
|
15
|
+
* on its own. `updatedAt` is the timestamp of the last folded event (session
|
|
16
|
+
* time, so it survives a restart) and `live` says whether `line` counts
|
|
17
|
+
* elapsed time. A renderer that wants the counter to move must derive it from
|
|
18
|
+
* `turnStartedAt` / `phaseStartedAt` instead of re-rendering `line`.
|
|
19
|
+
* 2. **The value is host data, not plugin API.** The shape below is a local
|
|
20
|
+
* structural copy of the plugin's wire value, the same discipline the channel
|
|
21
|
+
* port already applies to the activity state: this app must not import the
|
|
22
|
+
* plugin's internals to display a line.
|
|
23
|
+
* @module dsh-tui/dsh-adapter/activity-store
|
|
24
|
+
*/
|
|
25
|
+
import React from 'react';
|
|
26
|
+
/** The projection key the activity plugin publishes. */
|
|
27
|
+
export const ACTIVITY_PROJECTION_KEY = 'workingActivity';
|
|
28
|
+
/**
|
|
29
|
+
* Narrow one projection value: anything that is not an activity view is
|
|
30
|
+
* dropped rather than rendered half-formed.
|
|
31
|
+
* @param value - Raw projection value.
|
|
32
|
+
* @returns the value as an activity view, or `undefined`.
|
|
33
|
+
*/
|
|
34
|
+
export function asActivityView(value) {
|
|
35
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
36
|
+
return undefined;
|
|
37
|
+
const record = value;
|
|
38
|
+
if (typeof record.phase !== 'string' || typeof record.line !== 'string')
|
|
39
|
+
return undefined;
|
|
40
|
+
if (!PHASES.has(record.phase))
|
|
41
|
+
return undefined;
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
const PHASES = new Set(['idle', 'waiting', 'thinking', 'tool', 'done']);
|
|
45
|
+
/**
|
|
46
|
+
* The latest activity value for the session on screen, with a subscription
|
|
47
|
+
* for renderers.
|
|
48
|
+
*
|
|
49
|
+
* The store is effectively single-current: binding a session ({@link
|
|
50
|
+
* ActivityStore.seed}) names the session the UI is showing, and every other
|
|
51
|
+
* id is dropped — values, session objects and read-failure counts alike. A
|
|
52
|
+
* registry-less store (the UI's fallback, test rigs) has no current session
|
|
53
|
+
* and keeps today's accept-all behavior.
|
|
54
|
+
*/
|
|
55
|
+
export class ActivityStore {
|
|
56
|
+
values = new Map();
|
|
57
|
+
/** Session objects seen for each id, so a live value can be re-read. */
|
|
58
|
+
sessions = new Map();
|
|
59
|
+
/** Consecutive failed reads per session id; reset by a successful read. */
|
|
60
|
+
readFailures = new Map();
|
|
61
|
+
/** Sessions already warned about (see {@link noteReadFailure}): once each. */
|
|
62
|
+
warned = new Set();
|
|
63
|
+
listeners = new Set();
|
|
64
|
+
/** The session the UI is showing (the last {@link seed}); the only id kept. */
|
|
65
|
+
currentId;
|
|
66
|
+
/** Host registry, remembered so a bind can read a baseline on demand. */
|
|
67
|
+
registry;
|
|
68
|
+
/** Warn sink (see {@link noteReadFailure}); injected by the composition root. */
|
|
69
|
+
warn;
|
|
70
|
+
constructor(warn) {
|
|
71
|
+
this.warn = warn;
|
|
72
|
+
}
|
|
73
|
+
/** Remember the host registry (see {@link seed} and {@link refreshLive}). */
|
|
74
|
+
attachRegistry(registry) {
|
|
75
|
+
this.registry = registry;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Seed one session from the registry's current snapshot and make it the
|
|
79
|
+
* current one.
|
|
80
|
+
*
|
|
81
|
+
* A value only *arrives* when it changes, so a session opened after its last
|
|
82
|
+
* change — a resume, or a window reattached to a running agent — would show
|
|
83
|
+
* nothing until the next event without this read. The bind also defines the
|
|
84
|
+
* session on screen: every other id is pruned, so a later event — or the
|
|
85
|
+
* tick — for a session the user switched away from can no longer fill this
|
|
86
|
+
* store or keep a timer armed.
|
|
87
|
+
* @param session - Session being bound.
|
|
88
|
+
*/
|
|
89
|
+
seed(session) {
|
|
90
|
+
if (session === null || session === undefined)
|
|
91
|
+
return;
|
|
92
|
+
this.currentId = String(session.id);
|
|
93
|
+
this.pruneToCurrent();
|
|
94
|
+
seedActivity(this.registry, this, session);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Note the session object behind an id, so a live value can be re-read.
|
|
98
|
+
* Dropped for any id other than the current one (see {@link seed}). */
|
|
99
|
+
remember(sessionId, session) {
|
|
100
|
+
if (this.currentId !== undefined && sessionId !== this.currentId)
|
|
101
|
+
return;
|
|
102
|
+
this.sessions.set(sessionId, session);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Re-read the current session's value while it is still counting time.
|
|
106
|
+
*
|
|
107
|
+
* The host renders the value when it is *read*, so this is what makes the
|
|
108
|
+
* elapsed seconds advance between committed events — with the host's own copy
|
|
109
|
+
* and language, since nothing is re-rendered here. A value that has settled
|
|
110
|
+
* (`live` false: idle, or a finished turn) is deliberately skipped: its text
|
|
111
|
+
* cannot change on its own. Only the current session can be live (see
|
|
112
|
+
* {@link seed}), so the tick never polls a session the user left.
|
|
113
|
+
*/
|
|
114
|
+
refreshLive() {
|
|
115
|
+
const registry = this.registry;
|
|
116
|
+
if (registry === undefined)
|
|
117
|
+
return;
|
|
118
|
+
for (const [sessionId, value] of [...this.values]) {
|
|
119
|
+
if (!value.live)
|
|
120
|
+
continue;
|
|
121
|
+
const session = this.sessions.get(sessionId);
|
|
122
|
+
if (session === undefined)
|
|
123
|
+
continue;
|
|
124
|
+
seedActivity(registry, this, session);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/** Whether the current session's value is still counting time (see {@link refreshLive}). */
|
|
128
|
+
hasLive() {
|
|
129
|
+
for (const value of this.values.values())
|
|
130
|
+
if (value.live)
|
|
131
|
+
return true;
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
/** The current value for one session, stable between updates. */
|
|
135
|
+
get(sessionId) {
|
|
136
|
+
if (sessionId === undefined)
|
|
137
|
+
return undefined;
|
|
138
|
+
return this.values.get(sessionId);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Record one projection value. Dropped for any id other than the current
|
|
142
|
+
* one (see {@link seed}).
|
|
143
|
+
* @param sessionId - Session the value belongs to.
|
|
144
|
+
* @param view - The published value.
|
|
145
|
+
*/
|
|
146
|
+
update(sessionId, view) {
|
|
147
|
+
if (this.currentId !== undefined && sessionId !== this.currentId)
|
|
148
|
+
return;
|
|
149
|
+
if (this.values.get(sessionId) === view)
|
|
150
|
+
return;
|
|
151
|
+
this.values.set(sessionId, view);
|
|
152
|
+
this.emit();
|
|
153
|
+
}
|
|
154
|
+
/** Forget one session (disposed, or left behind by a reset). */
|
|
155
|
+
clear(sessionId) {
|
|
156
|
+
this.sessions.delete(sessionId);
|
|
157
|
+
if (!this.values.delete(sessionId))
|
|
158
|
+
return;
|
|
159
|
+
this.emit();
|
|
160
|
+
}
|
|
161
|
+
/** A read succeeded: this session's consecutive-failure count restarts. */
|
|
162
|
+
noteReadSuccess(sessionId) {
|
|
163
|
+
this.readFailures.delete(sessionId);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* A read failed. The failure is reported to the warn sink ONCE per session
|
|
167
|
+
* (the sink is the composition root's logger — this module stays free of
|
|
168
|
+
* cordis types), and after {@link MAX_READ_FAILURES} consecutive failures
|
|
169
|
+
* the value is cleared so the tick disarms instead of polling a registry
|
|
170
|
+
* that will never answer.
|
|
171
|
+
* @param sessionId - Session whose read failed.
|
|
172
|
+
* @param detail - What the failed read threw.
|
|
173
|
+
*/
|
|
174
|
+
noteReadFailure(sessionId, detail) {
|
|
175
|
+
const failures = (this.readFailures.get(sessionId) ?? 0) + 1;
|
|
176
|
+
this.readFailures.set(sessionId, failures);
|
|
177
|
+
if (!this.warned.has(sessionId)) {
|
|
178
|
+
this.warned.add(sessionId);
|
|
179
|
+
this.warn?.(`dsh-tui: working-activity projection read failed for session ${sessionId}: ${detail}`);
|
|
180
|
+
}
|
|
181
|
+
if (failures >= MAX_READ_FAILURES)
|
|
182
|
+
this.clear(sessionId);
|
|
183
|
+
}
|
|
184
|
+
/** Drop every id that is not the current one; emit when a value went. */
|
|
185
|
+
pruneToCurrent() {
|
|
186
|
+
if (this.currentId === undefined)
|
|
187
|
+
return;
|
|
188
|
+
let removedValue = false;
|
|
189
|
+
for (const id of [...this.values.keys()]) {
|
|
190
|
+
if (id === this.currentId)
|
|
191
|
+
continue;
|
|
192
|
+
this.values.delete(id);
|
|
193
|
+
removedValue = true;
|
|
194
|
+
this.sessions.delete(id);
|
|
195
|
+
this.readFailures.delete(id);
|
|
196
|
+
this.warned.delete(id);
|
|
197
|
+
}
|
|
198
|
+
for (const id of [...this.sessions.keys()]) {
|
|
199
|
+
if (id === this.currentId)
|
|
200
|
+
continue;
|
|
201
|
+
this.sessions.delete(id);
|
|
202
|
+
this.readFailures.delete(id);
|
|
203
|
+
this.warned.delete(id);
|
|
204
|
+
}
|
|
205
|
+
if (removedValue)
|
|
206
|
+
this.emit();
|
|
207
|
+
}
|
|
208
|
+
/** Subscribe to value changes; returns the unsubscribe function. */
|
|
209
|
+
subscribe(listener) {
|
|
210
|
+
this.listeners.add(listener);
|
|
211
|
+
return () => { this.listeners.delete(listener); };
|
|
212
|
+
}
|
|
213
|
+
emit() {
|
|
214
|
+
for (const listener of [...this.listeners])
|
|
215
|
+
listener();
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* The change-feed listener for one store.
|
|
220
|
+
*
|
|
221
|
+
* Only this plugin's key is read, and only values that narrow to an activity
|
|
222
|
+
* view are accepted: the feed is host-wide, so every other unit's change and
|
|
223
|
+
* every malformed value must be dropped here rather than inside a renderer.
|
|
224
|
+
* @param store - Store to fill.
|
|
225
|
+
* @returns the listener to hand to `ProjectionRegistry.onChanged`.
|
|
226
|
+
*/
|
|
227
|
+
export function createActivityFeed(store) {
|
|
228
|
+
return (session, key, value) => {
|
|
229
|
+
if (key !== ACTIVITY_PROJECTION_KEY)
|
|
230
|
+
return;
|
|
231
|
+
const view = asActivityView(value);
|
|
232
|
+
if (view === undefined)
|
|
233
|
+
return;
|
|
234
|
+
const sessionId = String(session.id);
|
|
235
|
+
// Values for a session other than the current one are dropped inside
|
|
236
|
+
// remember/update, so the feed needs no filter of its own.
|
|
237
|
+
store.remember(sessionId, session);
|
|
238
|
+
store.update(sessionId, view);
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/** How often a value that is still counting time is re-read from the host. */
|
|
242
|
+
export const LIVE_TICK_MS = 500;
|
|
243
|
+
/** Consecutive failed reads before a session's value is dropped (see {@link ActivityStore.noteReadFailure}). */
|
|
244
|
+
const MAX_READ_FAILURES = 3;
|
|
245
|
+
/**
|
|
246
|
+
* Wire one store to the host's projection registry.
|
|
247
|
+
*
|
|
248
|
+
* Registration is deferred through `inject` because the plugin that *publishes*
|
|
249
|
+
* the unit is mounted alongside this one: the registry may not exist yet, and
|
|
250
|
+
* the unit may not be registered until later still. Both absences are normal —
|
|
251
|
+
* a composition without the activity plugin simply never fills the store, and
|
|
252
|
+
* the line falls back to whatever else the UI has.
|
|
253
|
+
*
|
|
254
|
+
* The feed is event-driven, so a value only lands when a committed event folds;
|
|
255
|
+
* its elapsed text would therefore freeze for the length of a long tool. The
|
|
256
|
+
* host renders a value when it is READ, so a timer re-reads the live ones: the
|
|
257
|
+
* seconds advance, the copy and language stay the plugin's, and a settled value
|
|
258
|
+
* (idle, or a finished turn) stops the timer instead of being polled forever.
|
|
259
|
+
* @param ctx - Host context of the composition root.
|
|
260
|
+
* @param store - Store to fill.
|
|
261
|
+
*/
|
|
262
|
+
export function attachActivityProjection(ctx, store) {
|
|
263
|
+
ctx.inject(['sessionProjections'], ((projectionCtx) => {
|
|
264
|
+
const registry = projectionCtx.sessionProjections;
|
|
265
|
+
if (registry === undefined)
|
|
266
|
+
return;
|
|
267
|
+
store.attachRegistry(registry);
|
|
268
|
+
const offFeed = registry.onChanged(createActivityFeed(store));
|
|
269
|
+
let timer;
|
|
270
|
+
const stopTimer = () => {
|
|
271
|
+
if (timer === undefined)
|
|
272
|
+
return;
|
|
273
|
+
clearInterval(timer);
|
|
274
|
+
timer = undefined;
|
|
275
|
+
};
|
|
276
|
+
/** Arm while something is counting time, disarm the moment nothing is. */
|
|
277
|
+
const reconcileTimer = () => {
|
|
278
|
+
if (!store.hasLive()) {
|
|
279
|
+
stopTimer();
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (timer !== undefined)
|
|
283
|
+
return;
|
|
284
|
+
timer = setInterval(() => {
|
|
285
|
+
store.refreshLive();
|
|
286
|
+
}, LIVE_TICK_MS);
|
|
287
|
+
timer.unref();
|
|
288
|
+
};
|
|
289
|
+
const offStore = store.subscribe(reconcileTimer);
|
|
290
|
+
reconcileTimer();
|
|
291
|
+
// The cleanup belongs to the injected fiber, not the outer ctx: a service
|
|
292
|
+
// re-provide re-runs the callback above, and registering on the outer ctx
|
|
293
|
+
// would stack feed listeners (the old listener's disposer would only run
|
|
294
|
+
// when the whole composition root goes down).
|
|
295
|
+
projectionCtx.effect(() => () => {
|
|
296
|
+
offStore();
|
|
297
|
+
stopTimer();
|
|
298
|
+
offFeed();
|
|
299
|
+
}, 'dsh-tui activity projection feed');
|
|
300
|
+
}));
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Create the composition root's activity store and wire it to the host.
|
|
304
|
+
* @param ctx - Host context of the composition root.
|
|
305
|
+
* @param enabled - Whether the working line is shown at all (cordis.yml
|
|
306
|
+
* `activity`; a static, config-time switch — the runtime `/activity` command
|
|
307
|
+
* only changes the preset). With the line off, nothing attaches: no feed,
|
|
308
|
+
* no registry, and therefore no 500ms tick for a line nobody renders.
|
|
309
|
+
* @returns the store the UI reads from.
|
|
310
|
+
*/
|
|
311
|
+
export function createActivityStore(ctx, enabled) {
|
|
312
|
+
const store = new ActivityStore(message => { ctx.logger.warn(message); });
|
|
313
|
+
if (enabled)
|
|
314
|
+
attachActivityProjection(ctx, store);
|
|
315
|
+
return store;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Read one session's activity value in a component.
|
|
319
|
+
* @param store - Store to read.
|
|
320
|
+
* @param sessionId - Session the UI is showing.
|
|
321
|
+
* @returns the current value, or `undefined` when there is none.
|
|
322
|
+
*/
|
|
323
|
+
export function useActivity(store, sessionId) {
|
|
324
|
+
const subscribe = React.useCallback((listener) => store.subscribe(listener), [store]);
|
|
325
|
+
const read = React.useCallback(() => store.get(sessionId), [store, sessionId]);
|
|
326
|
+
return React.useSyncExternalStore(subscribe, read);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Seed one session's value from the registry's current snapshot.
|
|
330
|
+
*
|
|
331
|
+
* A value only *arrives* when it changes, so a session opened after its last
|
|
332
|
+
* change — a resume, or a window reattached to a running agent — would show
|
|
333
|
+
* nothing until the next event without this read.
|
|
334
|
+
* @param registry - Host projection registry.
|
|
335
|
+
* @param store - Store to fill.
|
|
336
|
+
* @param session - Session to read.
|
|
337
|
+
*/
|
|
338
|
+
export function seedActivity(registry, store, session) {
|
|
339
|
+
if (registry === undefined || session === null || session === undefined)
|
|
340
|
+
return;
|
|
341
|
+
const id = String(session.id);
|
|
342
|
+
try {
|
|
343
|
+
const snapshot = registry.snapshot(session, [ACTIVITY_PROJECTION_KEY]);
|
|
344
|
+
const view = asActivityView(snapshot.values[ACTIVITY_PROJECTION_KEY]);
|
|
345
|
+
if (view === undefined)
|
|
346
|
+
store.clear(id);
|
|
347
|
+
else {
|
|
348
|
+
store.remember(id, session);
|
|
349
|
+
store.update(id, view);
|
|
350
|
+
}
|
|
351
|
+
store.noteReadSuccess(id);
|
|
352
|
+
}
|
|
353
|
+
catch (error) {
|
|
354
|
+
// An unreadable snapshot is still not worth failing a session bind over,
|
|
355
|
+
// but it is no longer silent either: warn once per session, and a read
|
|
356
|
+
// that keeps failing eventually drops the value so the tick disarms.
|
|
357
|
+
store.noteReadFailure(id, error instanceof Error ? error.message : String(error));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
@@ -4,7 +4,7 @@ import type { ChannelState } from './types.js';
|
|
|
4
4
|
* specialist has been constructed. Construction-time callers fail closed
|
|
5
5
|
* rather than receiving a plausible no-op while the Channel is incomplete.
|
|
6
6
|
*/
|
|
7
|
-
export type ChannelActionDelegates = Pick<ChannelState, 'commandCompletions' | 'loadOlder' | 'rewindTo' | 'rewindToNode' | 'forkSession' | 'resumeTo' | 'newSession' | 'listWorkspaces' | 'listWorkspaceRegistry' | 'removeWorkspace' | 'renameWorkspaceAt' | 'resolveWorkspace' | 'switchWorkspace' | 'renameWorkspace' | 'workspaceCommands' | 'runWorkspaceCommand' | 'switchModel' | 'listEfforts' | 'setEffort' | 'setDefaultEffort' | 'cycleMode' | 'runPermissionPreset' | 'clear' | 'setActivityFrames' | 'listPresets' | 'switchPreset' | 'listModels' | 'listProviders' | 'invalidateModelCompletion' | 'listSkills' | 'describeCredential' | 'balanceInfo' | 'sideQuestion' | 'listFileCandidates' | 'listFiles' | 'listSessions' | 'previewSession' | 'bindApprovalStore' | 'agentViewRows' | 'subscribeAgentView' | 'dispatchBackgroundAgent' | 'stopBackgroundAgent' | 'attachToAgent' | 'peekAgentSession' | 'replyToAgent' | 'backgroundCurrent' | 'setResumeTarget' | 'renameSession' | 'setSessionColor' | 'recapRecent' | 'deleteSession' | 'renameSessionTo' | 'compact' | 'runExternalCommand' | 'runExternalCommandOutcome' | 'pushLocal' | 'mcpStatus' | 'exportSession' | 'initWorkspace' | 'doctorInfo' | 'pluginsInfo' | 'listSubagents'> & {
|
|
7
|
+
export type ChannelActionDelegates = Pick<ChannelState, 'commandCompletions' | 'loadOlder' | 'rewindTo' | 'rewindToNode' | 'forkSession' | 'resumeTo' | 'newSession' | 'listWorkspaces' | 'listWorkspaceRegistry' | 'removeWorkspace' | 'renameWorkspaceAt' | 'resolveWorkspace' | 'switchWorkspace' | 'renameWorkspace' | 'workspaceCommands' | 'runWorkspaceCommand' | 'switchModel' | 'listEfforts' | 'setEffort' | 'setDefaultEffort' | 'cycleMode' | 'runPermissionPreset' | 'clear' | 'setActivityFrames' | 'listPresets' | 'switchPreset' | 'listModels' | 'listProviders' | 'invalidateModelCompletion' | 'listSkills' | 'describeCredential' | 'balanceInfo' | 'sideQuestion' | 'listFileCandidates' | 'listFiles' | 'cachedSessions' | 'listSessions' | 'previewSession' | 'listForeignSources' | 'listForeignSessions' | 'importForeignSession' | 'bindApprovalStore' | 'agentViewRows' | 'subscribeAgentView' | 'dispatchBackgroundAgent' | 'stopBackgroundAgent' | 'attachToAgent' | 'peekAgentSession' | 'replyToAgent' | 'backgroundCurrent' | 'setResumeTarget' | 'renameSession' | 'setSessionColor' | 'recapRecent' | 'deleteSession' | 'renameSessionTo' | 'compact' | 'cancelCompact' | 'runExternalCommand' | 'runExternalCommandOutcome' | 'pushLocal' | 'mcpStatus' | 'exportSession' | 'initWorkspace' | 'doctorInfo' | 'pluginsInfo' | 'listSubagents'> & {
|
|
8
8
|
runLocalCommand(command: string, includeInContext: boolean): Promise<void>;
|
|
9
9
|
};
|
|
10
10
|
type ChannelActionMethodName = Exclude<keyof ChannelActionDelegates, 'runLocalCommand'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-readiness.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/action-readiness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,YAAY,EAClD,oBAAoB,GACpB,WAAW,GACX,UAAU,GACV,cAAc,GACd,aAAa,GACb,UAAU,GACV,YAAY,GACZ,gBAAgB,GAChB,uBAAuB,GACvB,iBAAiB,GACjB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,qBAAqB,GACrB,aAAa,GACb,aAAa,GACb,WAAW,GACX,kBAAkB,GAClB,WAAW,GACX,qBAAqB,GACrB,OAAO,GACP,mBAAmB,GACnB,aAAa,GACb,cAAc,GACd,YAAY,GACZ,eAAe,GACf,2BAA2B,GAC3B,YAAY,GACZ,oBAAoB,GACpB,aAAa,GACb,cAAc,GACd,oBAAoB,GACpB,WAAW,GACX,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,oBAAoB,GACpB,yBAAyB,GACzB,qBAAqB,GACrB,eAAe,GACf,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,SAAS,GACT,oBAAoB,GACpB,2BAA2B,GAC3B,WAAW,GACX,WAAW,GACX,eAAe,GACf,eAAe,GACf,YAAY,GACZ,aAAa,GACb,eAAe,CAClB,GAAG;IACF,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3E,CAAA;AAED,KAAK,uBAAuB,GAAG,OAAO,CAAC,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,CAAA;AACvF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAA;AAE9E;4EAC4E;AAC5E,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,MAAM,sBAAsB,GAC5C,oBAAoB,
|
|
1
|
+
{"version":3,"file":"action-readiness.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/action-readiness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,YAAY,EAClD,oBAAoB,GACpB,WAAW,GACX,UAAU,GACV,cAAc,GACd,aAAa,GACb,UAAU,GACV,YAAY,GACZ,gBAAgB,GAChB,uBAAuB,GACvB,iBAAiB,GACjB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,qBAAqB,GACrB,aAAa,GACb,aAAa,GACb,WAAW,GACX,kBAAkB,GAClB,WAAW,GACX,qBAAqB,GACrB,OAAO,GACP,mBAAmB,GACnB,aAAa,GACb,cAAc,GACd,YAAY,GACZ,eAAe,GACf,2BAA2B,GAC3B,YAAY,GACZ,oBAAoB,GACpB,aAAa,GACb,cAAc,GACd,oBAAoB,GACpB,WAAW,GACX,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAChB,oBAAoB,GACpB,qBAAqB,GACrB,sBAAsB,GACtB,mBAAmB,GACnB,eAAe,GACf,oBAAoB,GACpB,yBAAyB,GACzB,qBAAqB,GACrB,eAAe,GACf,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,SAAS,GACT,eAAe,GACf,oBAAoB,GACpB,2BAA2B,GAC3B,WAAW,GACX,WAAW,GACX,eAAe,GACf,eAAe,GACf,YAAY,GACZ,aAAa,GACb,eAAe,CAClB,GAAG;IACF,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3E,CAAA;AAED,KAAK,uBAAuB,GAAG,OAAO,CAAC,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,CAAA;AACvF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAA;AAE9E;4EAC4E;AAC5E,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,MAAM,sBAAsB,GAC5C,oBAAoB,CAyEtB;AAED,wBAAgB,4BAA4B;kBAG1B,sBAAsB,GAAG,IAAI;uBAIxB,sBAAsB;EAK5C"}
|
|
@@ -40,8 +40,12 @@ export function createChannelActionMethods(getReadyActions) {
|
|
|
40
40
|
sideQuestion: (question, options) => getReadyActions().sideQuestion(question, options),
|
|
41
41
|
listFileCandidates: (query, options) => getReadyActions().listFileCandidates(query, options),
|
|
42
42
|
listFiles: () => getReadyActions().listFiles(),
|
|
43
|
-
|
|
43
|
+
cachedSessions: () => getReadyActions().cachedSessions(),
|
|
44
|
+
listSessions: (onEnriched, onPartial) => getReadyActions().listSessions(onEnriched, onPartial),
|
|
44
45
|
previewSession: sessionId => getReadyActions().previewSession(sessionId),
|
|
46
|
+
listForeignSources: () => getReadyActions().listForeignSources(),
|
|
47
|
+
listForeignSessions: (agentId, onRow) => getReadyActions().listForeignSessions(agentId, onRow),
|
|
48
|
+
importForeignSession: (agentId, key) => getReadyActions().importForeignSession(agentId, key),
|
|
45
49
|
bindApprovalStore: store => getReadyActions().bindApprovalStore(store),
|
|
46
50
|
agentViewRows: () => getReadyActions().agentViewRows(),
|
|
47
51
|
subscribeAgentView: listener => getReadyActions().subscribeAgentView(listener),
|
|
@@ -58,6 +62,7 @@ export function createChannelActionMethods(getReadyActions) {
|
|
|
58
62
|
deleteSession: sessionId => getReadyActions().deleteSession(sessionId),
|
|
59
63
|
renameSessionTo: (sessionId, title) => getReadyActions().renameSessionTo(sessionId, title),
|
|
60
64
|
compact: () => getReadyActions().compact(),
|
|
65
|
+
cancelCompact: () => getReadyActions().cancelCompact(),
|
|
61
66
|
runExternalCommand: (name, rawInput) => getReadyActions().runExternalCommand(name, rawInput),
|
|
62
67
|
runExternalCommandOutcome: (name, rawInput, images) => getReadyActions().runExternalCommandOutcome(name, rawInput, images),
|
|
63
68
|
pushLocal: (title, lines) => getReadyActions().pushLocal(title, lines),
|
|
@@ -7,7 +7,7 @@ import type { BackgroundResult, ChannelState } from './types.js';
|
|
|
7
7
|
type Binding = ReturnType<typeof createChannelBinding>;
|
|
8
8
|
/** `/bg` foreground handoff. The binding remains the sole identity writer;
|
|
9
9
|
* this action only parks the exact previous handle passed by its transaction. */
|
|
10
|
-
export declare function createBackgroundCurrentAction(ctx: Context, state: Pick<ChannelState, 'cwd' | 'status' | 'agentId' | 'loadedContext' | 'contextWindow' | 'effortLevels' | 'reasoningEffort' | 'emit' | 'notify'> & Parameters<typeof resetSessionProjection>[0], options: {
|
|
10
|
+
export declare function createBackgroundCurrentAction(ctx: Context, state: Pick<ChannelState, 'cwd' | 'status' | 'agentId' | 'sessionId' | 'loadedContext' | 'contextWindow' | 'effortLevels' | 'reasoningEffort' | 'emit' | 'notify'> & Parameters<typeof resetSessionProjection>[0], options: {
|
|
11
11
|
configuredPreset?: string;
|
|
12
12
|
configuredProvider?: string;
|
|
13
13
|
configuredModel?: string;
|
|
@@ -22,6 +22,7 @@ export declare function createBackgroundCurrentAction(ctx: Context, state: Pick<
|
|
|
22
22
|
};
|
|
23
23
|
resetProjector(): void;
|
|
24
24
|
resetSubagents(): void;
|
|
25
|
+
parkSubagents(agent: AgentHandle['agent']): void;
|
|
25
26
|
resetJobs(): void;
|
|
26
27
|
refreshEffortLevels(): void;
|
|
27
28
|
bindAgent(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-action.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/background-action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAYlD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEhE,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEtD;iFACiF;AACjF,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,IAAI,CAAC,YAAY,EACtB,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,eAAe,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"background-action.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/background-action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAYlD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEhE,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEtD;iFACiF;AACjF,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,IAAI,CAAC,YAAY,EACtB,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,eAAe,GAAG,eAAe,GAC9E,cAAc,GAAG,iBAAiB,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,EACxG,OAAO,EAAE;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAC9H,IAAI,EAAE;IACJ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;IACpC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC,CAAA;IACjF,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IAC3C,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACzB,cAAc,IAAI,IAAI,CAAA;IACtB,cAAc,IAAI,IAAI,CAAA;IACtB,aAAa,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;IAChD,SAAS,IAAI,IAAI,CAAA;IACjB,mBAAmB,IAAI,IAAI,CAAA;IAC3B,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,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7F,4EAA4E;IAC5E,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAA;IAC5F,eAAe,IAAI,IAAI,CAAA;CACxB,GACA,MAAM,OAAO,CAAC,gBAAgB,CAAC,CA0FjC"}
|
|
@@ -62,6 +62,7 @@ export function createBackgroundCurrentAction(ctx, state, options, deps) {
|
|
|
62
62
|
try {
|
|
63
63
|
const result = deps.binding.adopt(handle, adoption, (previous, disposePrevious) => {
|
|
64
64
|
const previousSessionId = String(previous.agent.session.id);
|
|
65
|
+
deps.parkSubagents(previous.agent);
|
|
65
66
|
if (previous.handle !== undefined) {
|
|
66
67
|
deps.backgroundHandles.set(previousSessionId, previous.handle);
|
|
67
68
|
disposePrevious('park');
|
|
@@ -69,6 +70,7 @@ export function createBackgroundCurrentAction(ctx, state, options, deps) {
|
|
|
69
70
|
resetSessionProjection(state, deps.rowIds, deps.resetProjector, deps.resetSubagents, deps.resetJobs);
|
|
70
71
|
state.status = handle.agent.status;
|
|
71
72
|
state.agentId = handle.agent.id;
|
|
73
|
+
state.sessionId = handle.agent.session.id;
|
|
72
74
|
state.loadedContext = undefined;
|
|
73
75
|
state.contextWindow = undefined;
|
|
74
76
|
state.effortLevels = undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AssistantStreamFrame, ModelSelectionRef } from '@deepseek-ai/dsh-agent';
|
|
1
|
+
import type { Agent, AssistantStreamFrame, ModelSelectionRef } from '@deepseek-ai/dsh-agent';
|
|
2
2
|
import type { Context } from '@deepseek-ai/cordis';
|
|
3
3
|
import type { InputConvergence } from './input-actions.js';
|
|
4
4
|
import type { ChannelBinding } from './binding.js';
|
|
@@ -6,22 +6,21 @@ import type { ChannelOwner } from './owner.js';
|
|
|
6
6
|
import { type createChannelProjection } from './projection.js';
|
|
7
7
|
import type { ChannelState } from './types.js';
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* ChannelProjection.
|
|
9
|
+
* Foreground transcript listeners capture a binding generation. Child event
|
|
10
|
+
* listeners instead span the Channel owner, keeping parked reducers current
|
|
11
|
+
* across rebinds. Both paths own registrations incrementally and fence retained
|
|
12
|
+
* callbacks; only ChannelProjection presents the foreground transcript.
|
|
14
13
|
*/
|
|
15
14
|
export declare function createBindingEvents(ctx: Context, deps: {
|
|
16
15
|
owner: ChannelOwner;
|
|
17
16
|
binding: ChannelBinding;
|
|
18
17
|
state: ChannelState;
|
|
19
|
-
activity
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
/** Read the activity projection's current value for a freshly bound session.
|
|
19
|
+
* A projection value only arrives when it changes, so a resumed or
|
|
20
|
+
* reattached session needs this read to show its line before the next event.
|
|
21
|
+
* The line's semantics live in the working-activity plugin: this app folds
|
|
22
|
+
* nothing itself and forwards no events. */
|
|
23
|
+
seedActivity?(session: unknown): void;
|
|
25
24
|
inputConvergence: InputConvergence;
|
|
26
25
|
selection: ModelSelectionRef;
|
|
27
26
|
modelActions: {
|
|
@@ -41,12 +40,14 @@ export declare function createBindingEvents(ctx: Context, deps: {
|
|
|
41
40
|
runId?: string;
|
|
42
41
|
provider: string;
|
|
43
42
|
local?: boolean;
|
|
44
|
-
}): void;
|
|
43
|
+
}, parent: object | null): void;
|
|
45
44
|
onEnd(info: {
|
|
46
45
|
id: string;
|
|
46
|
+
runId?: string;
|
|
47
47
|
stopReason: string;
|
|
48
48
|
lastAssistantMessage?: unknown[];
|
|
49
|
-
}): void;
|
|
49
|
+
}, parent: object | null): void;
|
|
50
|
+
forget?(agent: Agent): void;
|
|
50
51
|
};
|
|
51
52
|
agentView: {
|
|
52
53
|
schedule(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-events.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/binding-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"binding-events.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/binding-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC5F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE;IACtD,KAAK,EAAE,YAAY,CAAA;IACnB,OAAO,EAAE,cAAc,CAAA;IACvB,KAAK,EAAE,YAAY,CAAA;IACnB;;;;iDAI6C;IAC7C,YAAY,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IACrC,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,SAAS,EAAE,iBAAiB,CAAA;IAC5B,YAAY,EAAE;QAAE,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QAAC,SAAS,EAAE,iBAAiB,CAAA;KAAE,CAAA;IACrF,WAAW,EAAE;QAAE,WAAW,IAAI,IAAI,CAAC;QAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAA;KAAE,CAAA;IAC5F,SAAS,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAA;IACrD,SAAS,EAAE;QACT,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAA;QACzD,aAAa,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAA;QACpE,OAAO,CAAC,IAAI,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,OAAO,CAAA;SAAE,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;QAC7G,KAAK,CAAC,IAAI,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,CAAA;SAAE,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;QAC9H,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;KAC5B,CAAA;IACD,SAAS,EAAE;QAAE,QAAQ,IAAI,IAAI,CAAA;KAAE,CAAA;IAC/B,eAAe,CAAC,EAAE;QAAE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAA;KAAE,CAAA;IACrE;;;sCAGkC;IAClC,gBAAgB,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3C;gBAqCkB,IAAI;EAiJtB"}
|