@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
|
@@ -17,7 +17,22 @@ import { t } from '../../i18n.js';
|
|
|
17
17
|
import { normalizeWorkspaceCwd } from '../../sessions/view.js';
|
|
18
18
|
import { readSessionPins, setSessionPinned } from '../../sessionPins.js';
|
|
19
19
|
import { readSessionOwners } from '../../sessionMounts.js';
|
|
20
|
-
import {
|
|
20
|
+
import { resumeFailureText } from '../../sessions/resumeFailure.js';
|
|
21
|
+
import { RAIL_CHROME_ROWS, WORKSPACE_ROW_LINES, RAIL_MIN_TOTAL_COLUMNS, RAIL_WIDTH_MIN, RAIL_WIDTH_MAX, SESSION_ROW_LINES, SESSION_PANE_CHROME_ROWS, noticeLines, MENU_ACTIONS, UNREGISTERED_RAIL_ID, message, samePath, sessionMatchesQuery } from './model.js';
|
|
22
|
+
const listingSnapshots = new WeakMap();
|
|
23
|
+
/**
|
|
24
|
+
* The snapshot slot for one channel, created on first use.
|
|
25
|
+
* @param channel - The screen's channel, which owns the rows.
|
|
26
|
+
* @returns The channel's slot, empty when it has never listed.
|
|
27
|
+
*/
|
|
28
|
+
function snapshotSlot(channel) {
|
|
29
|
+
let slot = listingSnapshots.get(channel);
|
|
30
|
+
if (slot === undefined) {
|
|
31
|
+
slot = { rows: undefined, requestGeneration: 0 };
|
|
32
|
+
listingSnapshots.set(channel, slot);
|
|
33
|
+
}
|
|
34
|
+
return slot;
|
|
35
|
+
}
|
|
21
36
|
/**
|
|
22
37
|
* Derive the whole screen model.
|
|
23
38
|
* @param input - Channel, home, the opening/stop actions and the live lookup.
|
|
@@ -26,8 +41,26 @@ import { RAIL_CHROME_ROWS, WORKSPACE_ROW_LINES, RAIL_MIN_TOTAL_COLUMNS, RAIL_WID
|
|
|
26
41
|
export function useSessionSupervisor(input) {
|
|
27
42
|
const { channel, home, onOpenSession, onNewSession, onStopSession, liveStateOf, columns, rows } = input;
|
|
28
43
|
const [entries, setEntries] = useState([]);
|
|
29
|
-
|
|
30
|
-
|
|
44
|
+
// Lazy so a non-empty snapshot from this channel's previous mount paints as
|
|
45
|
+
// the first frame, including after restart; undefined alone means unknown.
|
|
46
|
+
const [sessions, setSessions] = useState(() => {
|
|
47
|
+
const slot = snapshotSlot(channel);
|
|
48
|
+
// Recheck the provider's scope on every mount (including service replacement).
|
|
49
|
+
if (typeof channel.cachedSessions === 'function') {
|
|
50
|
+
try {
|
|
51
|
+
slot.rows = channel.cachedSessions();
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
slot.rows = undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return slot.rows ?? [];
|
|
58
|
+
});
|
|
59
|
+
const [loading, setLoading] = useState(() => {
|
|
60
|
+
const snapshot = snapshotSlot(channel).rows;
|
|
61
|
+
return snapshot === undefined;
|
|
62
|
+
});
|
|
63
|
+
const [refreshing, setRefreshing] = useState(true);
|
|
31
64
|
const [notice, setNotice] = useState(undefined);
|
|
32
65
|
/** Live status and occupancy are re-read on their own clock, not the listing's. */
|
|
33
66
|
const [pulse, setPulse] = useState(0);
|
|
@@ -219,6 +252,13 @@ export function useSessionSupervisor(input) {
|
|
|
219
252
|
* this screen cannot work without, so it must survive a missing ledger.
|
|
220
253
|
*/
|
|
221
254
|
const reload = useCallback(async () => {
|
|
255
|
+
// Claim this reload's generation before the first await: everything below
|
|
256
|
+
// only publishes while it is still the newest request, so a slower earlier
|
|
257
|
+
// one that lands later cannot repaint the screen (or the snapshot) with
|
|
258
|
+
// rows the newer listing has already corrected.
|
|
259
|
+
const slot = snapshotSlot(channel);
|
|
260
|
+
const generation = ++slot.requestGeneration;
|
|
261
|
+
setRefreshing(true);
|
|
222
262
|
// The two reads are independent, and the session listing is the half this
|
|
223
263
|
// screen cannot work without: a registry that rejects (bare composition,
|
|
224
264
|
// unmounted service, a provider throwing) must not take the history down
|
|
@@ -227,10 +267,30 @@ export function useSessionSupervisor(input) {
|
|
|
227
267
|
await Promise.all([
|
|
228
268
|
(async () => {
|
|
229
269
|
try {
|
|
230
|
-
|
|
270
|
+
const fresh = await channel.listSessions(enriched => {
|
|
271
|
+
if (slot.requestGeneration !== generation)
|
|
272
|
+
return;
|
|
273
|
+
slot.rows = slot.rows?.map(row => row.id === enriched.id ? enriched : row);
|
|
274
|
+
setSessions(current => current.map(row => row.id === enriched.id ? enriched : row));
|
|
275
|
+
}, partial => {
|
|
276
|
+
// Keep a complete cached list over a partial cold scan. With no
|
|
277
|
+
// snapshot, show useful rows now rather than waiting for every log.
|
|
278
|
+
if (slot.requestGeneration !== generation || slot.rows !== undefined)
|
|
279
|
+
return;
|
|
280
|
+
setSessions(partial);
|
|
281
|
+
setLoading(false);
|
|
282
|
+
});
|
|
283
|
+
// Recorded only after success: a failed listing keeps the previous
|
|
284
|
+
// snapshot, and only the newest reload may write it.
|
|
285
|
+
if (slot.requestGeneration !== generation)
|
|
286
|
+
return;
|
|
287
|
+
slot.rows = fresh;
|
|
288
|
+
setSessions(fresh);
|
|
231
289
|
setNotice(current => (current?.tone === 'error' ? undefined : current));
|
|
232
290
|
}
|
|
233
291
|
catch (error) {
|
|
292
|
+
if (slot.requestGeneration !== generation)
|
|
293
|
+
return;
|
|
234
294
|
setNotice({ text: t('home-sessions-failed', { err: message(error) }), tone: 'error' });
|
|
235
295
|
}
|
|
236
296
|
})(),
|
|
@@ -239,20 +299,30 @@ export function useSessionSupervisor(input) {
|
|
|
239
299
|
const registry = typeof channel.listWorkspaceRegistry === 'function'
|
|
240
300
|
? await channel.listWorkspaceRegistry()
|
|
241
301
|
: [];
|
|
302
|
+
if (slot.requestGeneration !== generation)
|
|
303
|
+
return;
|
|
242
304
|
setEntries(registry.map(entry => ({ ...entry, from: 'registry' })));
|
|
243
305
|
}
|
|
244
306
|
catch {
|
|
245
307
|
// An unreadable registry is not an empty history: the sessions stay
|
|
246
308
|
// listed (and resumable) under the cwd-derived fallback groups.
|
|
309
|
+
if (slot.requestGeneration !== generation)
|
|
310
|
+
return;
|
|
247
311
|
setEntries([]);
|
|
248
312
|
}
|
|
249
313
|
})(),
|
|
250
314
|
]);
|
|
251
|
-
|
|
315
|
+
if (slot.requestGeneration === generation) {
|
|
316
|
+
setLoading(false);
|
|
317
|
+
setRefreshing(false);
|
|
318
|
+
}
|
|
252
319
|
}, [channel]);
|
|
253
320
|
React.useEffect(() => {
|
|
254
321
|
void reload();
|
|
255
322
|
}, [reload]);
|
|
323
|
+
React.useEffect(() => () => {
|
|
324
|
+
snapshotSlot(channel).requestGeneration++;
|
|
325
|
+
}, [channel]);
|
|
256
326
|
// Selection follows the terminal's own directory, then the ledger: the rail
|
|
257
327
|
// must open on the workspace this terminal is IN, not on whichever record
|
|
258
328
|
// sorts first — otherwise launching in a workspace you have never opened
|
|
@@ -390,7 +460,16 @@ export function useSessionSupervisor(input) {
|
|
|
390
460
|
* clipped the focused one out of the viewport.
|
|
391
461
|
*/
|
|
392
462
|
const railEntryCapacity = Math.max(1, Math.floor(railListHeight / WORKSPACE_ROW_LINES));
|
|
393
|
-
|
|
463
|
+
/**
|
|
464
|
+
* The notice wraps (a mount refusal carries the adapter's full error), and
|
|
465
|
+
* every row it takes beyond its reserved one comes out of the list window —
|
|
466
|
+
* otherwise the list would overflow and clip the focused row instead.
|
|
467
|
+
*/
|
|
468
|
+
// Wrapped to the VISIBLE width: below 20 columns the pane keeps its 20-cell
|
|
469
|
+
// floor and the renderer clips at the terminal edge, which would cut every
|
|
470
|
+
// notice row short of the reason it carries.
|
|
471
|
+
const noticeRows = noticeLines(notice?.text, Math.max(0, Math.min(sessionWidth, columns) - 3));
|
|
472
|
+
const sessionListHeight = Math.max(SESSION_ROW_LINES, rows - SESSION_PANE_CHROME_ROWS - (noticeRows.length - 1));
|
|
394
473
|
const report = useCallback((text, tone) => {
|
|
395
474
|
setNotice({ text, tone });
|
|
396
475
|
}, []);
|
|
@@ -424,14 +503,16 @@ export function useSessionSupervisor(input) {
|
|
|
424
503
|
}
|
|
425
504
|
setNotice(undefined);
|
|
426
505
|
void onOpenSession(session.id)
|
|
427
|
-
.then((
|
|
428
|
-
// The
|
|
429
|
-
//
|
|
430
|
-
//
|
|
431
|
-
//
|
|
432
|
-
//
|
|
433
|
-
|
|
434
|
-
|
|
506
|
+
.then((result) => {
|
|
507
|
+
// The reason is shown HERE, not in a channel notification: this
|
|
508
|
+
// screen replaces the conversation, so the composer that draws
|
|
509
|
+
// notifications is not mounted and a "see below" pointer led nowhere.
|
|
510
|
+
// `cancelled` stays silent (the user or a rival switch asked for it).
|
|
511
|
+
// A plain failure shows the bare error: "Could not enter" already says
|
|
512
|
+
// resuming failed, and the rows it would repeat are the error's own.
|
|
513
|
+
const reason = !result.ok && result.reason === 'failed' ? result.error : resumeFailureText(result);
|
|
514
|
+
if (reason !== undefined)
|
|
515
|
+
report(t('supervisor-open-failed', { name: session.title.text, reason }), 'error');
|
|
435
516
|
})
|
|
436
517
|
.catch(error => report(t('session-resume-failed', { err: message(error) }), 'error'));
|
|
437
518
|
}, [holderOf, onOpenSession, report]);
|
|
@@ -541,6 +622,7 @@ export function useSessionSupervisor(input) {
|
|
|
541
622
|
entries,
|
|
542
623
|
sessions,
|
|
543
624
|
loading,
|
|
625
|
+
refreshing,
|
|
544
626
|
notice,
|
|
545
627
|
setNotice,
|
|
546
628
|
query,
|
|
@@ -577,6 +659,7 @@ export function useSessionSupervisor(input) {
|
|
|
577
659
|
sessionWidth,
|
|
578
660
|
railEntryCapacity,
|
|
579
661
|
sessionListHeight,
|
|
662
|
+
noticeRows,
|
|
580
663
|
persistPin,
|
|
581
664
|
selectEntry,
|
|
582
665
|
openSession,
|
|
@@ -16,8 +16,8 @@ export declare function readResumeTarget(): string | undefined;
|
|
|
16
16
|
* `dsh --profile tui` boot path forwards these args to the booted app
|
|
17
17
|
* verbatim and never parses them into DSH_TUI_RESUME_SESSION, so the
|
|
18
18
|
* in-profile plugin reads them itself. A bare flag with no id defers to the
|
|
19
|
-
* exit-time marker, exactly like the bin.
|
|
20
|
-
* @param argv - the app arguments
|
|
19
|
+
* exit-time marker, exactly like the bin. An app-level `--` ends option parsing.
|
|
20
|
+
* @param argv - the app arguments from cmdlineArgs, after the host's own options.
|
|
21
21
|
* @returns The requested session id, or undefined when none was given.
|
|
22
22
|
*/
|
|
23
23
|
export declare function resumeTargetFromArgv(argv: readonly string[]): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionHistory.d.ts","sourceRoot":"","sources":["../../src/sessionHistory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sessionHistory.d.ts","sourceRoot":"","sources":["../../src/sessionHistory.ts"],"names":[],"mappings":"AAyCA;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAGzD;AAED,qEAAqE;AACrE,wBAAgB,iBAAiB,IAAI,IAAI,CAMxC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,SAAS,CAOrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAgBhF;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAyB/D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAUpD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAYrD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAiBxE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAQ7D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAU9D"}
|
|
@@ -8,12 +8,23 @@
|
|
|
8
8
|
* touches so `/resume` can sort most-recently-used first (DSH session
|
|
9
9
|
* headers carry only `createdAt`).
|
|
10
10
|
*/
|
|
11
|
-
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
11
|
+
import { mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
12
12
|
import { join } from 'node:path';
|
|
13
13
|
import { DATA_DIR } from './utils/paths.js';
|
|
14
14
|
const DIR = DATA_DIR;
|
|
15
15
|
const RESUME_FILE = join(DIR, 'resume.txt');
|
|
16
16
|
const LAST_USED_FILE = join(DIR, 'last-used.json');
|
|
17
|
+
let lastUsedStamp;
|
|
18
|
+
let lastUsedCache;
|
|
19
|
+
function lastUsedFileStamp() {
|
|
20
|
+
try {
|
|
21
|
+
const stats = statSync(LAST_USED_FILE);
|
|
22
|
+
return `${stats.dev}:${stats.ino}:${stats.size}:${stats.mtimeMs}:${stats.ctimeMs}`;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
17
28
|
/**
|
|
18
29
|
* The agent view's OWN ledger: session-id → epoch-ms of the moments this TUI
|
|
19
30
|
* dispatched, backgrounded, or attached to a session FROM the agent view.
|
|
@@ -61,13 +72,15 @@ export function readResumeTarget() {
|
|
|
61
72
|
* `dsh --profile tui` boot path forwards these args to the booted app
|
|
62
73
|
* verbatim and never parses them into DSH_TUI_RESUME_SESSION, so the
|
|
63
74
|
* in-profile plugin reads them itself. A bare flag with no id defers to the
|
|
64
|
-
* exit-time marker, exactly like the bin.
|
|
65
|
-
* @param argv - the app arguments
|
|
75
|
+
* exit-time marker, exactly like the bin. An app-level `--` ends option parsing.
|
|
76
|
+
* @param argv - the app arguments from cmdlineArgs, after the host's own options.
|
|
66
77
|
* @returns The requested session id, or undefined when none was given.
|
|
67
78
|
*/
|
|
68
79
|
export function resumeTargetFromArgv(argv) {
|
|
69
80
|
for (let i = 0; i < argv.length; i++) {
|
|
70
81
|
const a = argv[i];
|
|
82
|
+
if (a === '--')
|
|
83
|
+
break;
|
|
71
84
|
if (a === '--resume' || a === '-c' || a === '--continue' || a.startsWith('--resume=')) {
|
|
72
85
|
let sessionId = '';
|
|
73
86
|
if (a.startsWith('--resume=')) {
|
|
@@ -89,10 +102,15 @@ export function resumeTargetFromArgv(argv) {
|
|
|
89
102
|
* @returns The parsed map; best effort, an unreadable file yields {}.
|
|
90
103
|
*/
|
|
91
104
|
export function readLastUsed() {
|
|
105
|
+
const stamp = lastUsedFileStamp();
|
|
106
|
+
if (lastUsedCache !== undefined && lastUsedStamp === stamp)
|
|
107
|
+
return lastUsedCache;
|
|
92
108
|
try {
|
|
93
109
|
const parsed = JSON.parse(readFileSync(LAST_USED_FILE, 'utf8'));
|
|
94
110
|
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
95
|
-
|
|
111
|
+
lastUsedCache = {};
|
|
112
|
+
lastUsedStamp = stamp;
|
|
113
|
+
return lastUsedCache;
|
|
96
114
|
}
|
|
97
115
|
const record = parsed;
|
|
98
116
|
const result = {};
|
|
@@ -101,10 +119,14 @@ export function readLastUsed() {
|
|
|
101
119
|
result[id] = value;
|
|
102
120
|
}
|
|
103
121
|
}
|
|
122
|
+
lastUsedCache = result;
|
|
123
|
+
lastUsedStamp = stamp;
|
|
104
124
|
return result;
|
|
105
125
|
}
|
|
106
126
|
catch {
|
|
107
|
-
|
|
127
|
+
lastUsedCache = {};
|
|
128
|
+
lastUsedStamp = stamp;
|
|
129
|
+
return lastUsedCache;
|
|
108
130
|
}
|
|
109
131
|
}
|
|
110
132
|
/**
|
|
@@ -117,6 +139,8 @@ export function touchSession(sessionId) {
|
|
|
117
139
|
ensureDir();
|
|
118
140
|
const lastUsed = { ...readLastUsed(), [sessionId]: Date.now() };
|
|
119
141
|
writeFileSync(LAST_USED_FILE, JSON.stringify(lastUsed));
|
|
142
|
+
lastUsedCache = lastUsed;
|
|
143
|
+
lastUsedStamp = lastUsedFileStamp();
|
|
120
144
|
}
|
|
121
145
|
catch {
|
|
122
146
|
// Best effort — MRU ordering is a nicety.
|
|
@@ -135,6 +159,8 @@ export function forgetSession(sessionId) {
|
|
|
135
159
|
delete lastUsed[sessionId];
|
|
136
160
|
ensureDir();
|
|
137
161
|
writeFileSync(LAST_USED_FILE, JSON.stringify(lastUsed));
|
|
162
|
+
lastUsedCache = lastUsed;
|
|
163
|
+
lastUsedStamp = lastUsedFileStamp();
|
|
138
164
|
}
|
|
139
165
|
catch {
|
|
140
166
|
// Best effort — a stale entry only skews sort order.
|