@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { addUsageToCostBuckets, cloneCostBuckets, emptyCostBuckets, isDeepSeekOfficialProvider, isPeakHour, priceForModel } from '../deepseekPricing.js';
|
|
1
2
|
import { toolResultPayload } from './compat/messages.js';
|
|
2
3
|
const MAX_OUTPUT_EVENTS = 160;
|
|
3
4
|
const MAX_OUTPUT_LINES = 160;
|
|
@@ -6,6 +7,12 @@ export class SubagentActivityStore {
|
|
|
6
7
|
sessionToAgent = new Map();
|
|
7
8
|
listeners = new Set();
|
|
8
9
|
streams = new Map();
|
|
10
|
+
/** 会话级 durable usage 费用桶,key = `${provider}\u0000${model}`。 */
|
|
11
|
+
costByModel = new Map();
|
|
12
|
+
/** 非官方 provider / 未收录模型的用量副本(只展示 token,不计金额)。 */
|
|
13
|
+
costUnpriced = emptyCostBuckets();
|
|
14
|
+
/** 每个 agent 已消费的最大 durable 事件 seq(同一事件重投不重复计费)。 */
|
|
15
|
+
costSeq = new Map();
|
|
9
16
|
commitLine(agentId, kind, text) {
|
|
10
17
|
const state = this.states.get(agentId);
|
|
11
18
|
if (!state)
|
|
@@ -22,28 +29,80 @@ export class SubagentActivityStore {
|
|
|
22
29
|
}
|
|
23
30
|
onSpawned(agentId, provider = 'subagent', model, info = {}) {
|
|
24
31
|
const existing = this.states.get(agentId);
|
|
25
|
-
|
|
32
|
+
if (!existing) {
|
|
33
|
+
this.states.set(agentId, {
|
|
34
|
+
agentId,
|
|
35
|
+
runId: info.runId ?? agentId,
|
|
36
|
+
description: info.description ?? `${provider} task`,
|
|
37
|
+
provider,
|
|
38
|
+
model: model ?? info.model ?? provider,
|
|
39
|
+
effort: info.effort,
|
|
40
|
+
status: 'running',
|
|
41
|
+
startedAt: info.startedAt ?? Date.now(),
|
|
42
|
+
local: info.local,
|
|
43
|
+
parentSessionId: info.parentSessionId,
|
|
44
|
+
sessionId: info.sessionId,
|
|
45
|
+
output: [],
|
|
46
|
+
outputEvents: [],
|
|
47
|
+
toolCalls: [],
|
|
48
|
+
});
|
|
49
|
+
this.notify();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
// Continuable children re-use one agent id across residency epochs, and a
|
|
53
|
+
// new epoch announces a NEW runId (the host's `subagent/start` pairing
|
|
54
|
+
// key). A runId change therefore opens a fresh run: the previous epoch's
|
|
55
|
+
// terminal state, timing, output and tools must not leak into it. The
|
|
56
|
+
// same runId re-announced only refreshes display metadata.
|
|
57
|
+
if (info.runId !== undefined && info.runId !== existing.runId) {
|
|
58
|
+
this.streams.delete(agentId);
|
|
59
|
+
existing.runId = info.runId;
|
|
60
|
+
existing.status = 'running';
|
|
61
|
+
existing.startedAt = info.startedAt ?? Date.now();
|
|
62
|
+
existing.completedAt = undefined;
|
|
63
|
+
existing.endedAt = undefined;
|
|
64
|
+
existing.stopReason = undefined;
|
|
65
|
+
existing.summary = undefined;
|
|
66
|
+
existing.error = undefined;
|
|
67
|
+
existing.output = [];
|
|
68
|
+
existing.outputEvents = [];
|
|
69
|
+
existing.toolCalls = [];
|
|
70
|
+
existing.tokens = undefined;
|
|
71
|
+
existing.description = info.description ?? existing.description;
|
|
72
|
+
existing.local = info.local ?? existing.local;
|
|
73
|
+
existing.provider = provider;
|
|
74
|
+
existing.model = model ?? existing.model;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
existing.provider = provider;
|
|
78
|
+
existing.model = model ?? existing.model;
|
|
79
|
+
if (info.description !== undefined)
|
|
80
|
+
existing.description = info.description;
|
|
81
|
+
if (info.local !== undefined)
|
|
82
|
+
existing.local = info.local;
|
|
83
|
+
}
|
|
84
|
+
this.notify();
|
|
85
|
+
}
|
|
86
|
+
/** Durable discovery (`subagent/catalog`, workflow member events, registry
|
|
87
|
+
* back-fill): register a child WITHOUT disturbing an already-tracked run.
|
|
88
|
+
* `live` marks a child the agents registry currently holds, which keeps the
|
|
89
|
+
* row running; an idle historical child shows as `unknown` (the parent log
|
|
90
|
+
* alone cannot prove how its last epoch ended). */
|
|
91
|
+
onDiscovered(agentId, info = {}) {
|
|
92
|
+
if (this.states.has(agentId))
|
|
93
|
+
return;
|
|
94
|
+
this.states.set(agentId, {
|
|
26
95
|
agentId,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
provider,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
startedAt: info.startedAt ?? Date.now(),
|
|
34
|
-
local: info.local,
|
|
35
|
-
parentSessionId: info.parentSessionId,
|
|
36
|
-
sessionId: info.sessionId,
|
|
96
|
+
description: info.label ?? `${info.provider ?? 'subagent'} task`,
|
|
97
|
+
provider: info.provider ?? 'subagent',
|
|
98
|
+
model: info.model ?? info.provider,
|
|
99
|
+
status: info.live ? 'running' : 'unknown',
|
|
100
|
+
startedAt: info.childCreatedAt ?? Date.now(),
|
|
101
|
+
sessionId: agentId,
|
|
37
102
|
output: [],
|
|
38
103
|
outputEvents: [],
|
|
39
104
|
toolCalls: [],
|
|
40
|
-
};
|
|
41
|
-
if (existing) {
|
|
42
|
-
Object.assign(existing, info, { provider, model: model ?? existing.model, status: existing.status === 'completed' ? existing.status : 'running' });
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
this.states.set(agentId, state);
|
|
46
|
-
}
|
|
105
|
+
});
|
|
47
106
|
this.notify();
|
|
48
107
|
}
|
|
49
108
|
linkSession(agentId, session) {
|
|
@@ -54,6 +113,7 @@ export class SubagentActivityStore {
|
|
|
54
113
|
state.sessionId = session;
|
|
55
114
|
}
|
|
56
115
|
getSubagentIdBySession(session) { return this.sessionToAgent.get(session); }
|
|
116
|
+
has(agentId) { return this.states.has(agentId); }
|
|
57
117
|
appendOutput(agentId, text, kind = 'text') {
|
|
58
118
|
const state = this.states.get(agentId);
|
|
59
119
|
if (!state || !text)
|
|
@@ -188,8 +248,12 @@ export class SubagentActivityStore {
|
|
|
188
248
|
case 'assistant/message': {
|
|
189
249
|
if (Array.isArray(data.stream))
|
|
190
250
|
this.settleAssistant(agentId, data.message?.content, data.turn, data.step, ev.seq);
|
|
191
|
-
if (data.usage)
|
|
251
|
+
if (data.usage) {
|
|
192
252
|
this.setTokens(agentId, data.usage);
|
|
253
|
+
// durable usage 才进费用累计:live assistant/chunk 的 usage 只更新
|
|
254
|
+
// 展示 token(见 setTokens 调用点),两路同时到达也只计这一路。
|
|
255
|
+
this.accumulateCost(agentId, data.usage, ev.time, ev.seq);
|
|
256
|
+
}
|
|
193
257
|
break;
|
|
194
258
|
}
|
|
195
259
|
case 'assistant/attempt': {
|
|
@@ -267,18 +331,87 @@ export class SubagentActivityStore {
|
|
|
267
331
|
state.tokens = { ...state.tokens, input, output, total: usage.total ?? ((input ?? 0) + (output ?? 0) || undefined) };
|
|
268
332
|
this.notify();
|
|
269
333
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
334
|
+
/** durable usage 的计价字段;全零/非法返回 undefined(不建零桶)。 */
|
|
335
|
+
costDeltaOf(usage) {
|
|
336
|
+
if (usage === null || typeof usage !== 'object')
|
|
337
|
+
return undefined;
|
|
338
|
+
const value = usage;
|
|
339
|
+
const count = (raw) => typeof raw === 'number' && Number.isFinite(raw) && raw > 0 ? raw : 0;
|
|
340
|
+
const delta = {
|
|
341
|
+
input: count(value.inputTokens ?? value.input),
|
|
342
|
+
output: count(value.outputTokens ?? value.output),
|
|
343
|
+
cacheRead: count(value.cacheReadTokens),
|
|
344
|
+
cacheWrite: count(value.cacheWriteTokens),
|
|
345
|
+
};
|
|
346
|
+
if (delta.input === 0 && delta.output === 0 && delta.cacheRead === 0 && delta.cacheWrite === 0)
|
|
347
|
+
return undefined;
|
|
348
|
+
return delta;
|
|
349
|
+
}
|
|
350
|
+
/** 一笔 durable usage 按发生时刻落 peak/idle 桶,model/provider 取事件
|
|
351
|
+
* 发生时的子代理身份;非官方/未收录同时进 unpriced 副本。
|
|
352
|
+
*
|
|
353
|
+
* `seq` 是同一 binding 内的事件序号:重放/回放把同一条 durable 事件再投
|
|
354
|
+
* 一次时只计第一笔(重投即双计会让"并入子代理"的估算凭空变大)。判据与
|
|
355
|
+
* `settleAssistant` 的 `settledSeq` 同源但**各自独立**——两处都要消费
|
|
356
|
+
* 同一个 seq,共用字段会让后消费的那处被前一处挡掉。 */
|
|
357
|
+
accumulateCost(agentId, usage, time, seq) {
|
|
274
358
|
const state = this.states.get(agentId);
|
|
275
|
-
|
|
359
|
+
const delta = this.costDeltaOf(usage);
|
|
360
|
+
if (state === undefined || delta === undefined)
|
|
361
|
+
return;
|
|
362
|
+
if (typeof seq === 'number') {
|
|
363
|
+
const consumed = this.costSeq.get(agentId);
|
|
364
|
+
if (consumed !== undefined && seq <= consumed)
|
|
365
|
+
return;
|
|
366
|
+
this.costSeq.set(agentId, seq);
|
|
367
|
+
}
|
|
368
|
+
const provider = state.provider ?? 'subagent';
|
|
369
|
+
const model = state.model ?? provider;
|
|
370
|
+
const key = `${provider}\u0000${model}`;
|
|
371
|
+
let entry = this.costByModel.get(key);
|
|
372
|
+
if (entry === undefined) {
|
|
373
|
+
entry = { provider, model, buckets: emptyCostBuckets() };
|
|
374
|
+
this.costByModel.set(key, entry);
|
|
375
|
+
}
|
|
376
|
+
const at = typeof time === 'number' ? new Date(time) : new Date();
|
|
377
|
+
const peak = isPeakHour(at);
|
|
378
|
+
addUsageToCostBuckets(entry.buckets, delta, peak);
|
|
379
|
+
if (!isDeepSeekOfficialProvider(provider) || priceForModel(model) === undefined) {
|
|
380
|
+
addUsageToCostBuckets(this.costUnpriced, delta, peak);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/** durable 用量的费用快照(深拷贝):entries 供计价,unpriced 供展示。 */
|
|
384
|
+
costSnapshot() {
|
|
385
|
+
return {
|
|
386
|
+
entries: Array.from(this.costByModel.values()).map(entry => ({
|
|
387
|
+
provider: entry.provider,
|
|
388
|
+
model: entry.model,
|
|
389
|
+
buckets: cloneCostBuckets(entry.buckets),
|
|
390
|
+
})),
|
|
391
|
+
unpriced: cloneCostBuckets(this.costUnpriced),
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
onCompleted(agentId, summary, stopReason = 'completed', endedAt) { this.finish(agentId, 'completed', stopReason, summary, endedAt); }
|
|
395
|
+
onFailed(agentId, error, endedAt) { this.finish(agentId, 'failed', error, undefined, endedAt); }
|
|
396
|
+
onCancelled(agentId, reason = 'cancelled', summary, endedAt) { this.finish(agentId, 'cancelled', reason, summary, endedAt); }
|
|
397
|
+
finish(agentId, status, reason, summary, endedAt) {
|
|
398
|
+
const state = this.states.get(agentId);
|
|
399
|
+
// `unknown` rows (durable discovery: catalog children, workflow members
|
|
400
|
+
// folded from the log) accept their settlement edge the same as live
|
|
401
|
+
// rows — a terminal edge is authoritative regardless of how the row was
|
|
402
|
+
// born. Already-settled rows keep their first outcome.
|
|
403
|
+
if (!state || (state.status !== 'running' && state.status !== 'starting' && state.status !== 'unknown'))
|
|
276
404
|
return;
|
|
405
|
+
// A discovered row settling from `unknown` closes at the durable event's
|
|
406
|
+
// wall time (`agent-end` stamps it), falling back to startedAt when even
|
|
407
|
+
// that is missing: completedAt must stay a number so the row projection's
|
|
408
|
+
// durationMs never ticks on a settled row.
|
|
409
|
+
const discovered = state.status === 'unknown';
|
|
277
410
|
const stream = this.streams.get(agentId);
|
|
278
411
|
if (stream !== undefined)
|
|
279
412
|
this.restoreAttempt(agentId, stream);
|
|
280
413
|
state.status = status;
|
|
281
|
-
state.completedAt = Date.now();
|
|
414
|
+
state.completedAt = discovered ? endedAt ?? state.startedAt : Date.now();
|
|
282
415
|
state.endedAt = state.completedAt;
|
|
283
416
|
state.stopReason = reason;
|
|
284
417
|
if (summary)
|
|
@@ -289,11 +422,15 @@ export class SubagentActivityStore {
|
|
|
289
422
|
}
|
|
290
423
|
/** Drop all tracked subagents and session links (session swap: the old
|
|
291
424
|
* session's children were disposed with their parent — nothing may keep
|
|
292
|
-
* routing events of a session the channel no longer projects).
|
|
425
|
+
* routing events of a session the channel no longer projects). The
|
|
426
|
+
* session-scoped cost buckets reset with them. */
|
|
293
427
|
reset() {
|
|
294
428
|
this.states.clear();
|
|
295
429
|
this.sessionToAgent.clear();
|
|
296
430
|
this.streams.clear();
|
|
431
|
+
this.costByModel.clear();
|
|
432
|
+
this.costUnpriced = emptyCostBuckets();
|
|
433
|
+
this.costSeq.clear();
|
|
297
434
|
this.notify();
|
|
298
435
|
}
|
|
299
436
|
snapshot() { return Array.from(this.states.values()).map(state => ({ ...state, output: [...state.output], outputEvents: [...state.outputEvents], toolCalls: state.toolCalls.map(tool => ({ ...tool })), tokens: state.tokens ? { ...state.tokens } : undefined })); }
|
package/lib/types/herdr.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export interface HerdrIntegrationOptions {
|
|
|
21
21
|
readonly reportTimeoutMs?: number;
|
|
22
22
|
readonly releaseTimeoutMs?: number;
|
|
23
23
|
readonly retryDelaysMs?: readonly number[];
|
|
24
|
+
/** Milliseconds. Tests pin this so a later report can jump ahead of another pane reporter. */
|
|
25
|
+
readonly now?: () => number;
|
|
24
26
|
}
|
|
25
27
|
/** Report this TUI's lifecycle to the owning Herdr pane when Herdr launches it. */
|
|
26
28
|
export declare function attachHerdrIntegration(options: HerdrIntegrationOptions): HerdrIntegration | undefined;
|
package/lib/types/herdr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"herdr.d.ts","sourceRoot":"","sources":["../../src/herdr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAQxF,UAAU,YAAY;IACpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;CAC5C;AAED,UAAU,aAAa;IACrB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;IAC3C,WAAW,IAAI,OAAO,GAAG,IAAI,CAAA;CAC9B;AAED,KAAK,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAE3F,MAAM,WAAW,gBAAgB;IAC/B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACxB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;IAC9B,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAA;IACjC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAA;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;IAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"herdr.d.ts","sourceRoot":"","sources":["../../src/herdr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAQxF,UAAU,YAAY;IACpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;CAC5C;AAED,UAAU,aAAa;IACrB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;IAC3C,WAAW,IAAI,OAAO,GAAG,IAAI,CAAA;CAC9B;AAED,KAAK,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAE3F,MAAM,WAAW,gBAAgB;IAC/B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACxB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;IAC9B,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAA;IACjC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAA;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;IAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1C,8FAA8F;IAC9F,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CAC5B;AAkBD,mFAAmF;AACnF,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,uBAAuB,GAC/B,gBAAgB,GAAG,SAAS,CAsH9B"}
|
package/lib/types/herdr.js
CHANGED
|
@@ -33,7 +33,13 @@ export function attachHerdrIntegration(options) {
|
|
|
33
33
|
return Promise.reject(new Error('Herdr command could not be started'));
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
|
|
36
|
+
const now = options.now ?? Date.now;
|
|
37
|
+
let sequence = 0;
|
|
38
|
+
const nextSequence = () => {
|
|
39
|
+
const clock = now() * 1000;
|
|
40
|
+
sequence = clock > sequence ? clock : sequence + 1;
|
|
41
|
+
return String(sequence);
|
|
42
|
+
};
|
|
37
43
|
let lastConfirmedReport = '';
|
|
38
44
|
let disposed = false;
|
|
39
45
|
let running = false;
|
|
@@ -73,7 +79,7 @@ export function attachHerdrIntegration(options) {
|
|
|
73
79
|
'--agent', 'dsh-tui',
|
|
74
80
|
'--state', state,
|
|
75
81
|
...(blocked ? ['--message', 'Waiting for user input'] : []),
|
|
76
|
-
'--seq',
|
|
82
|
+
'--seq', nextSequence(),
|
|
77
83
|
]), reportTimeoutMs);
|
|
78
84
|
if (disposed)
|
|
79
85
|
break;
|
|
@@ -124,7 +130,7 @@ export function attachHerdrIntegration(options) {
|
|
|
124
130
|
'pane', 'release-agent', paneId,
|
|
125
131
|
'--source', 'custom:dsh-tui',
|
|
126
132
|
'--agent', 'dsh-tui',
|
|
127
|
-
'--seq',
|
|
133
|
+
'--seq', nextSequence(),
|
|
128
134
|
]);
|
|
129
135
|
disposePromise = withTimeout(release, releaseTimeoutMs).then(() => undefined);
|
|
130
136
|
return disposePromise;
|
package/lib/types/history.d.ts
CHANGED
|
@@ -4,9 +4,14 @@ export type HistoryEntry = {
|
|
|
4
4
|
/** Unix ms timestamp. */
|
|
5
5
|
ts: number;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Entry cap for the persisted history. `↑`/`↓` and the Ctrl+R overlay read
|
|
9
|
+
* the same file, so both depths come from this one number.
|
|
10
|
+
*/
|
|
11
|
+
export declare const HISTORY_LIMIT = 200;
|
|
7
12
|
/**
|
|
8
13
|
* Append an input to the persisted history, deduping the immediately
|
|
9
|
-
* previous entry and capping the file at
|
|
14
|
+
* previous entry and capping the file at `HISTORY_LIMIT` entries.
|
|
10
15
|
* @param text - Input to persist; blank inputs are ignored.
|
|
11
16
|
* @returns Resolves once this entry is persisted; callers on the input path
|
|
12
17
|
* intentionally discard it because persistence is best-effort.
|
|
@@ -17,6 +22,13 @@ export declare function appendHistory(text: string): Promise<void>;
|
|
|
17
22
|
* @returns The persisted entries in reverse-chronological order.
|
|
18
23
|
*/
|
|
19
24
|
export declare function loadHistory(): HistoryEntry[];
|
|
25
|
+
/**
|
|
26
|
+
* Read the persisted history in the order the composer walks it: oldest
|
|
27
|
+
* first, so `↑` reaches the newest entry first (the list tail) exactly as it
|
|
28
|
+
* does for the entries this process pushed itself.
|
|
29
|
+
* @returns The persisted entries in chronological order.
|
|
30
|
+
*/
|
|
31
|
+
export declare function loadHistoryOldestFirst(): HistoryEntry[];
|
|
20
32
|
/**
|
|
21
33
|
* Stable id for a history entry (keeps React keys distinct across identical texts).
|
|
22
34
|
* @param entry - The history entry to hash.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/history.ts"],"names":[],"mappings":"AAWA,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/history.ts"],"names":[],"mappings":"AAWA,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,MAAM,CAAA;AAuHhC;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,YAAY,EAAE,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,YAAY,EAAE,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,SAAI,GAAG,MAAM,CAErE"}
|
package/lib/types/history.js
CHANGED
|
@@ -7,7 +7,11 @@ import { DATA_DIR } from './utils/paths.js';
|
|
|
7
7
|
const HISTORY_DIR = DATA_DIR;
|
|
8
8
|
const HISTORY_FILE = join(HISTORY_DIR, 'history.jsonl');
|
|
9
9
|
const HISTORY_LOCK = `${HISTORY_FILE}.lock`;
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Entry cap for the persisted history. `↑`/`↓` and the Ctrl+R overlay read
|
|
12
|
+
* the same file, so both depths come from this one number.
|
|
13
|
+
*/
|
|
14
|
+
export const HISTORY_LIMIT = 200;
|
|
11
15
|
const LOCK_RETRY_LIMIT = 500;
|
|
12
16
|
const LOCK_RETRY_DELAY_MS = 5;
|
|
13
17
|
const STALE_LOCK_MS = 30_000;
|
|
@@ -131,7 +135,7 @@ async function persistEntry(trimmed) {
|
|
|
131
135
|
let appendChain = Promise.resolve();
|
|
132
136
|
/**
|
|
133
137
|
* Append an input to the persisted history, deduping the immediately
|
|
134
|
-
* previous entry and capping the file at
|
|
138
|
+
* previous entry and capping the file at `HISTORY_LIMIT` entries.
|
|
135
139
|
* @param text - Input to persist; blank inputs are ignored.
|
|
136
140
|
* @returns Resolves once this entry is persisted; callers on the input path
|
|
137
141
|
* intentionally discard it because persistence is best-effort.
|
|
@@ -153,6 +157,15 @@ export function appendHistory(text) {
|
|
|
153
157
|
export function loadHistory() {
|
|
154
158
|
return loadRaw().reverse();
|
|
155
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Read the persisted history in the order the composer walks it: oldest
|
|
162
|
+
* first, so `↑` reaches the newest entry first (the list tail) exactly as it
|
|
163
|
+
* does for the entries this process pushed itself.
|
|
164
|
+
* @returns The persisted entries in chronological order.
|
|
165
|
+
*/
|
|
166
|
+
export function loadHistoryOldestFirst() {
|
|
167
|
+
return loadRaw();
|
|
168
|
+
}
|
|
156
169
|
/**
|
|
157
170
|
* Stable id for a history entry (keeps React keys distinct across identical texts).
|
|
158
171
|
* @param entry - The history entry to hash.
|