@deepseek-harness-tui/dsh-tui 0.16.1 → 0.17.0
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 +208 -31
- package/assets/plugin-icon.svg +13 -0
- package/assets/windows-installer.cs +308 -0
- package/assets/windows-installer.ps1 +17 -0
- package/bin/dsh-tui.js +64 -5
- package/cli/adapters/dsh/index.mjs +111 -0
- package/cli/adapters/dsh/locate.mjs +73 -0
- package/cli/adapters/dsh/management-plugin.mjs +111 -0
- package/cli/args.mjs +154 -0
- package/cli/contracts.d.ts +48 -0
- package/cli/engine.mjs +92 -0
- package/cli/entry.mjs +48 -0
- package/cli/process.mjs +118 -0
- package/cli/protocol.mjs +23 -0
- package/cli/schema-v1.json +33 -0
- package/cordis.patch.yml +3 -1
- package/cordis.yml +3 -1
- package/guide/dsh-tui-guide/SKILL.md +1 -0
- package/guide/dsh-tui-guide/cli.en.md +114 -0
- package/guide/dsh-tui-guide/cli.md +114 -0
- package/guide/dsh-tui-guide/configuration.en.md +6 -5
- package/guide/dsh-tui-guide/configuration.md +6 -5
- package/guide/dsh-tui-guide/getting-started.en.md +27 -1
- package/guide/dsh-tui-guide/getting-started.md +19 -1
- package/guide/dsh-tui-guide/interaction.en.md +22 -10
- package/guide/dsh-tui-guide/interaction.md +18 -8
- package/guide/dsh-tui-guide/plugins.en.md +35 -4
- package/guide/dsh-tui-guide/plugins.md +23 -2
- package/guide/dsh-tui-guide/user-guide.en.md +30 -23
- package/guide/dsh-tui-guide/user-guide.md +29 -22
- package/lib/settings.json +83 -40
- package/lib/types/adapter/channel/plugins.d.ts.map +1 -1
- package/lib/types/adapter/channel/plugins.js +8 -0
- package/lib/types/adapter/channel/ui-policy.d.ts +1 -1
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +3 -0
- package/lib/types/adapter/ports/channel-display.d.ts +10 -0
- package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-session.d.ts +2 -0
- package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-settings.d.ts +20 -0
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +17 -2
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +8 -1
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel.d.ts +7 -0
- package/lib/types/adapter/ports/channel.d.ts.map +1 -1
- package/lib/types/agent/capabilities.d.ts +2 -0
- package/lib/types/agent/capabilities.d.ts.map +1 -1
- package/lib/types/agent/events.d.ts +8 -0
- package/lib/types/agent/events.d.ts.map +1 -1
- package/lib/types/api.d.ts +2 -2
- package/lib/types/api.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/events.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/events.js +2 -1
- package/lib/types/backends/codex/auth/status.js +1 -1
- package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
- package/lib/types/backends/codex/session/controls.js +6 -5
- package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
- package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/events.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/events.js +3 -1
- package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
- package/lib/types/backends/shared/channel-tokens.js +9 -8
- package/lib/types/channel/history-restore.d.ts.map +1 -1
- package/lib/types/channel/history-restore.js +2 -0
- package/lib/types/channel/interaction.d.ts.map +1 -1
- package/lib/types/channel/interaction.js +1 -0
- package/lib/types/channel/projection.d.ts +1 -1
- package/lib/types/channel/projection.d.ts.map +1 -1
- package/lib/types/channel/projection.js +19 -4
- package/lib/types/channel/questions.d.ts +2 -0
- package/lib/types/channel/questions.d.ts.map +1 -1
- package/lib/types/channel/sanitize.d.ts +14 -0
- package/lib/types/channel/sanitize.d.ts.map +1 -1
- package/lib/types/channel/sanitize.js +55 -0
- package/lib/types/channel/working-directory.d.ts +9 -0
- package/lib/types/channel/working-directory.d.ts.map +1 -0
- package/lib/types/channel/working-directory.js +7 -0
- package/lib/types/commands.d.ts +8 -1
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +13 -4
- package/lib/types/components/ChatTitle.d.ts +7 -0
- package/lib/types/components/ChatTitle.d.ts.map +1 -0
- package/lib/types/components/ChatTitle.js +15 -0
- package/lib/types/components/CodeBlockFrame.d.ts.map +1 -1
- package/lib/types/components/CodeBlockFrame.js +10 -5
- package/lib/types/components/CompactionStatusRow.d.ts.map +1 -1
- package/lib/types/components/CompactionStatusRow.js +24 -3
- package/lib/types/components/GoalTodoPanel.d.ts +3 -1
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +2 -2
- package/lib/types/components/Markdown.d.ts +9 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +5 -4
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +17 -12
- package/lib/types/components/PromptInput.d.ts +13 -5
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +189 -107
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +232 -22
- package/lib/types/components/SubagentDetailScene.d.ts +3 -1
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +5 -1
- package/lib/types/components/Whale.d.ts.map +1 -1
- package/lib/types/components/Whale.js +8 -5
- package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
- package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
- package/lib/types/components/approvals/ApprovalPanel.js +93 -11
- package/lib/types/components/bigfont.d.ts.map +1 -1
- package/lib/types/components/bigfont.js +2 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +13 -6
- package/lib/types/components/previewRows.d.ts +19 -0
- package/lib/types/components/previewRows.d.ts.map +1 -0
- package/lib/types/components/previewRows.js +46 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +75 -10
- package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -9
- package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
- package/lib/types/components/sessions/ForeignSessionRow.js +6 -10
- package/lib/types/components/sessions/SessionListRow.d.ts +4 -9
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionListRow.js +18 -10
- package/lib/types/components/sidePanel/InfoPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/InfoPanel.js +4 -3
- package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelLayout.js +5 -5
- package/lib/types/components/sidePanel/WorkspacePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/WorkspacePanel.js +19 -7
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
- package/lib/types/components/sidePanel/builtinPanels.js +22 -16
- package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -1
- package/lib/types/components/sidePanel/panelMarkdown.d.ts +32 -0
- package/lib/types/components/sidePanel/panelMarkdown.d.ts.map +1 -0
- package/lib/types/components/sidePanel/panelMarkdown.js +45 -0
- package/lib/types/components/sidePanel/pluginPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/pluginPanelAdapter.js +6 -1
- package/lib/types/components/sidePanel/subagentFailureRead.d.ts +21 -0
- package/lib/types/components/sidePanel/subagentFailureRead.d.ts.map +1 -0
- package/lib/types/components/sidePanel/subagentFailureRead.js +66 -0
- package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.js +24 -6
- package/lib/types/components/trajectory/MiniWake.d.ts +2 -2
- package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -1
- package/lib/types/components/trajectory/MiniWake.js +7 -3
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +4 -7
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +11 -1
- package/lib/types/dsh-adapter/backend-admission.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +5 -1
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +18 -1
- package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/command-completions.js +6 -8
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +9 -1
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +111 -111
- package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-mentions.js +16 -10
- package/lib/types/dsh-adapter/channel/core/actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/actions.js +23 -2
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +13 -2
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +2 -0
- package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/files.js +2 -1
- package/lib/types/dsh-adapter/channel/core/host.d.ts +14 -10
- package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/host.js +192 -13
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +1 -0
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.js +32 -3
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/extensions.js +31 -5
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-actions.js +4 -0
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +24 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +7 -1
- package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-selection.js +6 -4
- package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.js +1 -0
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +15 -2
- 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 +4 -0
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +46 -33
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +10 -3
- package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +2 -2
- package/lib/types/dsh-adapter/channel/types.d.ts +13 -1
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/liveSession.d.ts +3 -3
- package/lib/types/dsh-adapter/compat/liveSession.js +3 -3
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.js +17 -1
- package/lib/types/dsh-adapter/contract.d.ts +6 -5
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +7 -5
- package/lib/types/dsh-adapter/effect-ledger.d.ts +1 -1
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
- package/lib/types/dsh-adapter/effect-ledger.js +1 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts +26 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -0
- package/lib/types/dsh-adapter/experimental-bundles.js +11 -0
- package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
- package/lib/types/dsh-adapter/host-contract.js +1 -1
- package/lib/types/dsh-adapter/host-dsh.js +3 -3
- package/lib/types/dsh-adapter/index.d.ts +8 -4
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +9 -7
- package/lib/types/dsh-adapter/panels.d.ts +21 -7
- package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
- package/lib/types/dsh-adapter/panels.js +11 -56
- package/lib/types/dsh-adapter/plugin.d.ts +81 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +318 -70
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +65 -10
- package/lib/types/dsh-adapter/presets.d.ts +15 -6
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +51 -12
- package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
- package/lib/types/dsh-adapter/process-exit.js +1 -1
- package/lib/types/dsh-adapter/session-tools.d.ts +34 -0
- package/lib/types/dsh-adapter/session-tools.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-tools.js +39 -0
- package/lib/types/dsh-adapter/settings-sections.d.ts +18 -1
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +73 -0
- package/lib/types/dsh-adapter/status.d.ts +88 -1
- package/lib/types/dsh-adapter/status.d.ts.map +1 -1
- package/lib/types/dsh-adapter/status.js +318 -3
- package/lib/types/dsh-adapter/team-mode.d.ts +42 -33
- package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
- package/lib/types/dsh-adapter/team-mode.js +76 -112
- package/lib/types/extensions.d.ts +1 -1
- package/lib/types/extensions.d.ts.map +1 -1
- package/lib/types/force-production-react.js +3 -3
- package/lib/types/i18n.d.ts +195 -52
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +96 -30
- package/lib/types/ink/colorize.d.ts +7 -1
- package/lib/types/ink/colorize.d.ts.map +1 -1
- package/lib/types/ink/colorize.js +29 -8
- package/lib/types/ink/components/App.d.ts +2 -1
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +10 -3
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
- package/lib/types/ink/components/ScrollBox.js +1 -0
- package/lib/types/ink/dom.d.ts +1 -0
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-program-status.d.ts +78 -0
- package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-program-status.js +96 -0
- package/lib/types/ink/ink.d.ts +13 -4
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +119 -25
- package/lib/types/ink/output.d.ts +17 -2
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +85 -2
- package/lib/types/ink/parse-keypress.d.ts +1 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +5 -4
- package/lib/types/ink/render-node-to-output.d.ts +2 -0
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +79 -10
- package/lib/types/ink/root.d.ts +8 -0
- package/lib/types/ink/root.d.ts.map +1 -1
- package/lib/types/ink/root.js +12 -3
- package/lib/types/ink/screen.d.ts +11 -0
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/screen.js +44 -0
- package/lib/types/ink/selection.d.ts +7 -2
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +187 -44
- package/lib/types/ink/shutdown-input.d.ts +15 -0
- package/lib/types/ink/shutdown-input.d.ts.map +1 -0
- package/lib/types/ink/shutdown-input.js +28 -0
- package/lib/types/ink/sixel-cursor-heal.d.ts +21 -0
- package/lib/types/ink/sixel-cursor-heal.d.ts.map +1 -0
- package/lib/types/ink/sixel-cursor-heal.js +62 -0
- package/lib/types/ink/sixel-graphics.d.ts +6 -0
- package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
- package/lib/types/ink/sixel-graphics.js +18 -0
- package/lib/types/ink/styles.d.ts +8 -1
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification-windows.d.ts +195 -0
- package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -0
- package/lib/types/ink/terminal-notification-windows.js +433 -0
- package/lib/types/ink/terminal-notification.d.ts +3 -1
- package/lib/types/ink/terminal-notification.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification.js +4 -1
- package/lib/types/ink/terminal-querier.d.ts +9 -1
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +32 -1
- package/lib/types/ink/terminal.d.ts +23 -2
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +32 -2
- package/lib/types/ink/termio/osc.d.ts +2 -1
- package/lib/types/ink/termio/osc.d.ts.map +1 -1
- package/lib/types/ink/termio/osc.js +37 -8
- package/lib/types/ink/termio/osc7501.d.ts +102 -0
- package/lib/types/ink/termio/osc7501.d.ts.map +1 -0
- package/lib/types/ink/termio/osc7501.js +229 -0
- package/lib/types/ink/termio/tokenize.js +5 -7
- package/lib/types/panels.d.ts +1 -1
- package/lib/types/panels.d.ts.map +1 -1
- package/lib/types/screens/AgentTranscriptScene.d.ts +3 -1
- package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
- package/lib/types/screens/AgentTranscriptScene.js +5 -1
- package/lib/types/screens/Chat.d.ts +6 -6
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +304 -111
- package/lib/types/screens/Launchpad.d.ts +8 -2
- package/lib/types/screens/Launchpad.d.ts.map +1 -1
- package/lib/types/screens/Launchpad.js +32 -12
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +31 -21
- package/lib/types/screens/Settings.d.ts +5 -1
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +528 -51
- package/lib/types/screens/StatusLine.d.ts +9 -3
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +91 -15
- package/lib/types/screens/StatusMetrics.d.ts +2 -11
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +20 -14
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +13 -21
- package/lib/types/sessionMounts.d.ts +14 -0
- package/lib/types/sessionMounts.d.ts.map +1 -1
- package/lib/types/sessionMounts.js +20 -9
- package/lib/types/sessions/format.d.ts +39 -0
- package/lib/types/sessions/format.d.ts.map +1 -1
- package/lib/types/sessions/format.js +83 -0
- package/lib/types/sessions/resumeFailure.d.ts +4 -0
- package/lib/types/sessions/resumeFailure.d.ts.map +1 -1
- package/lib/types/sessions/resumeFailure.js +12 -4
- package/lib/types/sessions/workspaceCounts.d.ts +6 -0
- package/lib/types/sessions/workspaceCounts.d.ts.map +1 -0
- package/lib/types/sessions/workspaceCounts.js +24 -0
- package/lib/types/settings/definitions.d.ts +24 -0
- package/lib/types/settings/definitions.d.ts.map +1 -1
- package/lib/types/settings/definitions.js +38 -13
- package/lib/types/tips.js +2 -2
- package/lib/types/tuiDisplayPrefs.d.ts +113 -5
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +276 -14
- package/lib/types/update.d.ts +15 -14
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +163 -115
- package/lib/types/updateProcess.d.ts +28 -0
- package/lib/types/updateProcess.d.ts.map +1 -0
- package/lib/types/updateProcess.js +135 -0
- package/lib/types/utils/inputWordBoundary.d.ts +5 -0
- package/lib/types/utils/inputWordBoundary.d.ts.map +1 -0
- package/lib/types/utils/inputWordBoundary.js +18 -0
- package/lib/types/utils/keymap.d.ts +1 -1
- package/lib/types/utils/keymap.d.ts.map +1 -1
- package/lib/types/utils/keymap.js +6 -1
- package/lib/types/windowsInstaller.d.ts +4 -0
- package/lib/types/windowsInstaller.d.ts.map +1 -0
- package/lib/types/windowsInstaller.js +237 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +127 -111
- package/presets/liangshen/custom-bash.mjs +13 -1
- package/presets/liangshen/instruction-hint.mjs +4 -1
- package/presets/liangshen/skill-search.mjs +14 -2
- package/presets/winbash.mjs +16 -4
- package/tui-profile/feed/README.md +17 -8
- package/tui-profile/feed/first-party.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/ink/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,UAAU,EAIhB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAExE,0DAA0D;AAC1D,MAAM,MAAM,QAAQ,GAAG,OAAO,MAAM,IAAI,MAAM,IAAI,MAAM,GAAG,CAAA;AAC3D,kEAAkE;AAClE,MAAM,MAAM,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAA;AACnC,uEAAuE;AACvE,MAAM,MAAM,YAAY,GAAG,WAAW,MAAM,GAAG,CAAA;AAC/C,4DAA4D;AAC5D,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,aAAa,GACb,WAAW,GACX,cAAc,GACd,WAAW,GACX,YAAY,GACZ,kBAAkB,GAClB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,iBAAiB,GACjB,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,CAAA;AAEtB,wCAAwC;AACxC,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAA;AAElE;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;IACtB,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,CAAA;IAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,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CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;KACvC,CAAA;IAED;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AA+VD;;;;;;;GAOG;AACH,QAAA,MAAM,MAAM,GACV,MAAM,UAAU,EAChB,QAAO,MAAW,EAClB,gBAAgB,MAAM,KACrB,IAUF,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Windows toast transport (DESIGN D3/D4/D8/D10/D11/D12): the only place the
|
|
3
|
+
* renderer talks to the Windows shell about task-completion notifications.
|
|
4
|
+
*
|
|
5
|
+
* It answers two questions, and a caller should not need anything else:
|
|
6
|
+
* - show one {@link notifyWindowsToast}
|
|
7
|
+
* - yield when the caller confirms an active external notifier
|
|
8
|
+
*
|
|
9
|
+
* Every system side effect sits behind the win32 guard and behind the injected
|
|
10
|
+
* ports, so a POSIX process that reaches this module anyway neither writes the
|
|
11
|
+
* registry nor spawns anything (AC-7/D12). Reaching it is the unusual case:
|
|
12
|
+
* nothing imports it at load time - the host loads it for the first toast - so a
|
|
13
|
+
* POSIX process does not load it at all.
|
|
14
|
+
*
|
|
15
|
+
* Showing is in-box PowerShell 5.1 + WinRT, one process per notification (D3):
|
|
16
|
+
* the ~3 s cold start of `powershell.exe` is the accepted cost of adding no
|
|
17
|
+
* resident helper (R1). That process is started without a console of this one's
|
|
18
|
+
* ({@link toastHostSpawnOptions}), because a PowerShell host renames the console
|
|
19
|
+
* it runs on. Nothing here waits for the user either: `Show()` hands the
|
|
20
|
+
* notification to the shell and the process exits.
|
|
21
|
+
*/
|
|
22
|
+
import type { SpawnOptions } from 'node:child_process';
|
|
23
|
+
import type { ExecFileNoThrowOptions, ExecFileNoThrowResult } from '../utils/execFileNoThrow.js';
|
|
24
|
+
/** The process runner the ports below drive, as `execFileNoThrow` provides it. */
|
|
25
|
+
type RunCommand = (file: string, args: readonly string[], options?: ExecFileNoThrowOptions) => Promise<ExecFileNoThrowResult>;
|
|
26
|
+
/** The AppUserModelID the toast is shown under (spike H, 2026-10-16). */
|
|
27
|
+
export declare const TOAST_AUMID = "dsh-tui";
|
|
28
|
+
/**
|
|
29
|
+
* The AUMID key. Writing it is what makes the toast display at all: an
|
|
30
|
+
* unregistered AUMID answers `Show()` in 15 ms without an error and shows
|
|
31
|
+
* nothing (E2), which is why "registration succeeded" - not `Show()` - is the
|
|
32
|
+
* success signal this module reports (D11).
|
|
33
|
+
*/
|
|
34
|
+
export declare const AUMID_REGISTRY_KEY = "HKCU\\Software\\Classes\\AppUserModelId\\dsh-tui";
|
|
35
|
+
/**
|
|
36
|
+
* How the toast host is started: as a console application with no console.
|
|
37
|
+
*
|
|
38
|
+
* Showing a toast means running in-box `powershell.exe` (D3), and a PowerShell
|
|
39
|
+
* host sets the console title as it starts. A child that inherits this process's
|
|
40
|
+
* console therefore renames the session's tab - measured 2026-10-16, before and
|
|
41
|
+
* after one toast: `✦ 🐋 [dsh-tui:42672]` became `Windows PowerShell` (UAT-M4).
|
|
42
|
+
*
|
|
43
|
+
* `windowsHide` is what keeps that console away: Windows starts the child with
|
|
44
|
+
* CREATE_NO_WINDOW, so it has none of its own to retitle, while the pipes below
|
|
45
|
+
* still carry its XML and its failure text. Both halves were measured on a real
|
|
46
|
+
* machine (2026-10-16): the host runs - a write to disk and its stdout arrive,
|
|
47
|
+
* exit 0, 2.1 s for the real toast body whose `Show()` did not throw - and the
|
|
48
|
+
* console title is left alone, against the same measurement with today's options,
|
|
49
|
+
* which clobbered it with `Windows PowerShell`.
|
|
50
|
+
*
|
|
51
|
+
* `detached: true` (DETACHED_PROCESS) was measured and rejected: the title
|
|
52
|
+
* survived there too, but the host exited after ~0.4 s without running the script
|
|
53
|
+
* at all - a silent no-op that would trade a dead click for a toast that never
|
|
54
|
+
* appears. Do not swap one for the other without repeating that measurement.
|
|
55
|
+
* @returns The spawn options the toast host is started with.
|
|
56
|
+
*/
|
|
57
|
+
export declare function toastHostSpawnOptions(): SpawnOptions;
|
|
58
|
+
/**
|
|
59
|
+
* Escape the four characters that would otherwise end a text node (AC-8). A
|
|
60
|
+
* summary is arbitrary model output, so nothing may reach the XML unescaped.
|
|
61
|
+
* @param text Raw text from the renderer.
|
|
62
|
+
* @returns The same text, safe inside an XML text node.
|
|
63
|
+
*/
|
|
64
|
+
export declare function escapeXmlText(text: string): string;
|
|
65
|
+
/** The parts of a task-completion toast. */
|
|
66
|
+
export interface ToastContent {
|
|
67
|
+
/** First line; the renderer passes its localized title (AC-1). */
|
|
68
|
+
title: string;
|
|
69
|
+
/** Second line: the single-line summary. Omitted when empty, clipped by {@link clampSummary}. */
|
|
70
|
+
message?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Build the ToastGeneric document (D10).
|
|
74
|
+
* @param content Title and summary.
|
|
75
|
+
* @returns The XML handed to `XmlDocument.LoadXml` on the PowerShell side.
|
|
76
|
+
*/
|
|
77
|
+
export declare function toastXml(content: ToastContent): string;
|
|
78
|
+
/** One HKCU value write; the default port shells out to in-box `reg.exe`. */
|
|
79
|
+
export interface RegistryPort {
|
|
80
|
+
/**
|
|
81
|
+
* @param key One of this module's own keys.
|
|
82
|
+
* @param name Value name, or null for the key's default value.
|
|
83
|
+
* @param value The string to store.
|
|
84
|
+
* @returns Success, or the reason the write was refused. Never throws.
|
|
85
|
+
*/
|
|
86
|
+
setValue(key: string, name: string | null, value: string): Promise<RegistryWriteResult>;
|
|
87
|
+
}
|
|
88
|
+
export type RegistryWriteResult = {
|
|
89
|
+
ok: true;
|
|
90
|
+
} | {
|
|
91
|
+
ok: false;
|
|
92
|
+
detail: string;
|
|
93
|
+
};
|
|
94
|
+
/** Every port is injectable so the regression never writes the registry or spawns. */
|
|
95
|
+
export interface WindowsToastTransportOptions {
|
|
96
|
+
/** Platform override for the regression; production is `process.platform`. */
|
|
97
|
+
platform?: NodeJS.Platform;
|
|
98
|
+
/** Environment for the `%WINDIR%` lookups; defaults to `process.env`. */
|
|
99
|
+
env?: Record<string, string | undefined>;
|
|
100
|
+
/** Registry port; defaults to in-box `reg.exe` on this module's own HKCU keys. */
|
|
101
|
+
registry?: RegistryPort;
|
|
102
|
+
/**
|
|
103
|
+
* Where the toast's icon comes from; defaults to {@link shippedToastIcon},
|
|
104
|
+
* which looks for the file the package ships. `undefined` registers no icon
|
|
105
|
+
* at all rather than a path the shell cannot read.
|
|
106
|
+
*/
|
|
107
|
+
iconPath?: () => string | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Process runner for `reg.exe`; defaults to `execFileNoThrow`. Not the toast
|
|
110
|
+
* host's: that one must not inherit this console, so it has
|
|
111
|
+
* {@link WindowsToastTransportOptions.runToastHost}.
|
|
112
|
+
*/
|
|
113
|
+
run?: RunCommand;
|
|
114
|
+
/**
|
|
115
|
+
* Process runner for the toast host; defaults to the console-less spawn
|
|
116
|
+
* ({@link toastHostSpawnOptions}). A port of its own because "which runner"
|
|
117
|
+
* is exactly the difference between a session whose tab keeps its title and
|
|
118
|
+
* one whose tab a PowerShell host renames (UAT-M4).
|
|
119
|
+
*/
|
|
120
|
+
runToastHost?: RunCommand;
|
|
121
|
+
/** Clock, so the log can report how long the toast spawn took (R1); defaults to `Date.now`. */
|
|
122
|
+
now?: () => number;
|
|
123
|
+
/** Log sink; defaults to `logForDebugging`. */
|
|
124
|
+
log?: (message: string, fields?: Record<string, unknown>) => void;
|
|
125
|
+
}
|
|
126
|
+
export type WindowsToastFailure = 'not-win32'
|
|
127
|
+
/** No `%WINDIR%`, so neither in-box tool can be located. */
|
|
128
|
+
| 'system-root-missing'
|
|
129
|
+
/** D11: the toast cannot display, so the caller has to ring the bell instead (AC-5). */
|
|
130
|
+
| 'aumid-registration-failed'
|
|
131
|
+
/** The toast process failed; the caller rings the bell rather than going silent. */
|
|
132
|
+
| 'toast-failed' | 'unexpected';
|
|
133
|
+
export type WindowsToastAvailability = {
|
|
134
|
+
available: true;
|
|
135
|
+
} | {
|
|
136
|
+
available: false;
|
|
137
|
+
reason: 'yielded' | WindowsToastFailure;
|
|
138
|
+
detail?: string;
|
|
139
|
+
};
|
|
140
|
+
export type WindowsToastResult = {
|
|
141
|
+
status: 'shown';
|
|
142
|
+
}
|
|
143
|
+
/** An external notifier owns task completions: no toast and no bell (AC-6). */
|
|
144
|
+
| {
|
|
145
|
+
status: 'yielded';
|
|
146
|
+
}
|
|
147
|
+
/** The caller revoked this pending delivery: no toast and no bell. */
|
|
148
|
+
| {
|
|
149
|
+
status: 'suppressed';
|
|
150
|
+
}
|
|
151
|
+
/** Nothing was delivered: the caller falls back to the bell, never to silence. */
|
|
152
|
+
| {
|
|
153
|
+
status: 'unavailable';
|
|
154
|
+
reason: WindowsToastFailure;
|
|
155
|
+
detail?: string;
|
|
156
|
+
};
|
|
157
|
+
export interface WindowsToastInput {
|
|
158
|
+
/** The localized title (AC-1). */
|
|
159
|
+
title: string;
|
|
160
|
+
/** Single-line summary; empty shows the title alone. */
|
|
161
|
+
message?: string;
|
|
162
|
+
/** The host confirmed an enabled, active DSH notifier in its live inventory. */
|
|
163
|
+
externalNotifierActive?: boolean;
|
|
164
|
+
/** Recheck live permission before dispatch, without repeating the focus gate. */
|
|
165
|
+
canDispatch?: () => boolean;
|
|
166
|
+
}
|
|
167
|
+
/** The two overrides a caller may need before a notification exists. */
|
|
168
|
+
export interface WindowsToastAvailabilityQuery {
|
|
169
|
+
/** Platform override for a regression; defaults to the transport's platform. */
|
|
170
|
+
platform?: NodeJS.Platform;
|
|
171
|
+
/** Active notifier ownership, supplied by the host rather than inferred from installed files. */
|
|
172
|
+
externalNotifierActive?: boolean;
|
|
173
|
+
}
|
|
174
|
+
export interface WindowsToastTransport {
|
|
175
|
+
/** Dedup, register, show. Never rejects: the caller treats this as fire-and-forget. */
|
|
176
|
+
notify(input: WindowsToastInput): Promise<WindowsToastResult>;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Create a transport with its own registration state. Production shares one
|
|
180
|
+
* instance through {@link notifyWindowsToast}, because "the AUMID is registered"
|
|
181
|
+
* is a per-process fact (D11).
|
|
182
|
+
* @param options Ports and paths; every one of them has a production default.
|
|
183
|
+
* @returns The transport.
|
|
184
|
+
*/
|
|
185
|
+
export declare function createWindowsToastTransport(options?: WindowsToastTransportOptions): WindowsToastTransport;
|
|
186
|
+
/**
|
|
187
|
+
* Show one task-completion toast: stand down for an external notifier, register
|
|
188
|
+
* once, then spawn the in-box host. Never rejects, and an unavailable transport
|
|
189
|
+
* is reported so the caller can ring the bell instead (AC-5).
|
|
190
|
+
* @param input Title, summary and the profile document for the dedup read.
|
|
191
|
+
* @returns What happened, in terms the caller can act on.
|
|
192
|
+
*/
|
|
193
|
+
export declare function notifyWindowsToast(input: WindowsToastInput): Promise<WindowsToastResult>;
|
|
194
|
+
export {};
|
|
195
|
+
//# sourceMappingURL=terminal-notification-windows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-notification-windows.d.ts","sourceRoot":"","sources":["../../../src/ink/terminal-notification-windows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAgB,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAMpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAIhG,kFAAkF;AAClF,KAAK,UAAU,GAAG,CAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE,sBAAsB,KAC7B,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAEnC,yEAAyE;AACzE,eAAO,MAAM,WAAW,YAAY,CAAA;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,qDAA4D,CAAA;AAmE3F;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,qBAAqB,IAAI,YAAY,CAKpD;AAyDD;;;;;GAKG;AAC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AAgB,2BAA2B,CAAC,OAAO,GAAE,4BAAiC,GAAG,qBAAqB,CAiG7G;AAuFD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAExF"}
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Windows toast transport (DESIGN D3/D4/D8/D10/D11/D12): the only place the
|
|
3
|
+
* renderer talks to the Windows shell about task-completion notifications.
|
|
4
|
+
*
|
|
5
|
+
* It answers two questions, and a caller should not need anything else:
|
|
6
|
+
* - show one {@link notifyWindowsToast}
|
|
7
|
+
* - yield when the caller confirms an active external notifier
|
|
8
|
+
*
|
|
9
|
+
* Every system side effect sits behind the win32 guard and behind the injected
|
|
10
|
+
* ports, so a POSIX process that reaches this module anyway neither writes the
|
|
11
|
+
* registry nor spawns anything (AC-7/D12). Reaching it is the unusual case:
|
|
12
|
+
* nothing imports it at load time - the host loads it for the first toast - so a
|
|
13
|
+
* POSIX process does not load it at all.
|
|
14
|
+
*
|
|
15
|
+
* Showing is in-box PowerShell 5.1 + WinRT, one process per notification (D3):
|
|
16
|
+
* the ~3 s cold start of `powershell.exe` is the accepted cost of adding no
|
|
17
|
+
* resident helper (R1). That process is started without a console of this one's
|
|
18
|
+
* ({@link toastHostSpawnOptions}), because a PowerShell host renames the console
|
|
19
|
+
* it runs on. Nothing here waits for the user either: `Show()` hands the
|
|
20
|
+
* notification to the shell and the process exits.
|
|
21
|
+
*/
|
|
22
|
+
import { spawn } from 'node:child_process';
|
|
23
|
+
import { existsSync } from 'node:fs';
|
|
24
|
+
import { join } from 'node:path';
|
|
25
|
+
import { fileURLToPath } from 'node:url';
|
|
26
|
+
import { logForDebugging } from '../utils/debug.js';
|
|
27
|
+
import { execFileNoThrow } from '../utils/execFileNoThrow.js';
|
|
28
|
+
import { stringWidth } from './stringWidth.js';
|
|
29
|
+
import { getGraphemeSegmenter } from '../utils/intl.js';
|
|
30
|
+
/** The AppUserModelID the toast is shown under (spike H, 2026-10-16). */
|
|
31
|
+
export const TOAST_AUMID = 'dsh-tui';
|
|
32
|
+
/**
|
|
33
|
+
* The AUMID key. Writing it is what makes the toast display at all: an
|
|
34
|
+
* unregistered AUMID answers `Show()` in 15 ms without an error and shows
|
|
35
|
+
* nothing (E2), which is why "registration succeeded" - not `Show()` - is the
|
|
36
|
+
* success signal this module reports (D11).
|
|
37
|
+
*/
|
|
38
|
+
export const AUMID_REGISTRY_KEY = `HKCU\\Software\\Classes\\AppUserModelId\\${TOAST_AUMID}`;
|
|
39
|
+
/**
|
|
40
|
+
* The icon the AUMID registers, and the two depths it can be found at: tsc
|
|
41
|
+
* emits this module into `lib/types/ink/` (the packaged tree) while the source
|
|
42
|
+
* sits at `src/ink/` (the repo), so the same pair of relative paths
|
|
43
|
+
* `components/maidPortrait.tsx` resolves its art with. `assets` is in the
|
|
44
|
+
* package's `files`, so an installed package really ships it.
|
|
45
|
+
*
|
|
46
|
+
* The shell resolves `IconUri` with no working directory of ours, and the UAT
|
|
47
|
+
* (2026-10-16) found the previous value - in-box `powershell.exe`, an executable
|
|
48
|
+
* with no icon index - rendering no icon at all. A path that does not exist is
|
|
49
|
+
* therefore worse than no icon: it leaves nothing to diagnose.
|
|
50
|
+
*/
|
|
51
|
+
const TOAST_ICON_CANDIDATES = [
|
|
52
|
+
'../../../assets/whale-girl/whale-girl.png',
|
|
53
|
+
'../../assets/whale-girl/whale-girl.png',
|
|
54
|
+
];
|
|
55
|
+
/**
|
|
56
|
+
* The image file this package ships for the toast, or undefined when the
|
|
57
|
+
* install has none (a pruned tree, a layout change) - {@link registerAumid}
|
|
58
|
+
* then registers no icon rather than a broken one.
|
|
59
|
+
*/
|
|
60
|
+
function shippedToastIcon() {
|
|
61
|
+
return TOAST_ICON_CANDIDATES
|
|
62
|
+
.map(relative => fileURLToPath(new URL(relative, import.meta.url)))
|
|
63
|
+
.find(candidate => existsSync(candidate));
|
|
64
|
+
}
|
|
65
|
+
/** `reg.exe` answers in milliseconds; a write that takes longer is stuck, not slow. */
|
|
66
|
+
const REGISTRY_TIMEOUT_MS = 15_000;
|
|
67
|
+
/** Why nothing can be delivered when `%WINDIR%` is missing; the one wording for both answers. */
|
|
68
|
+
const SYSTEM_ROOT_MISSING_DETAIL = '%WINDIR% is not set, so reg.exe and powershell.exe cannot be located';
|
|
69
|
+
/** PowerShell's cold start measures 3.1-3.4 s and the toast body 0.8-1.1 s (spike C/E1). */
|
|
70
|
+
const TOAST_TIMEOUT_MS = 30_000;
|
|
71
|
+
/**
|
|
72
|
+
* The toast body, run by in-box PowerShell 5.1 (D3). Two details are load
|
|
73
|
+
* bearing and were both measured on a real machine:
|
|
74
|
+
* - the three WinRT types have to be loaded explicitly. Windows PowerShell
|
|
75
|
+
* does not project them on demand, and `New-Object` otherwise fails with
|
|
76
|
+
* "Cannot find type [Windows.Data.Xml.Dom.XmlDocument]";
|
|
77
|
+
* - the XML arrives on stdin and is decoded as UTF-8 explicitly, because
|
|
78
|
+
* `[Console]::In` decodes with the console code page (CP936 on this
|
|
79
|
+
* machine), which mangles every non-ASCII summary.
|
|
80
|
+
*/
|
|
81
|
+
const TOAST_SCRIPT = `$ErrorActionPreference='Stop'
|
|
82
|
+
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | Out-Null
|
|
83
|
+
[Windows.UI.Notifications.ToastNotification, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
|
|
84
|
+
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
|
|
85
|
+
$i=[Console]::OpenStandardInput()
|
|
86
|
+
$m=New-Object System.IO.MemoryStream
|
|
87
|
+
$i.CopyTo($m)
|
|
88
|
+
$x=[System.Text.Encoding]::UTF8.GetString($m.ToArray())
|
|
89
|
+
$d=New-Object Windows.Data.Xml.Dom.XmlDocument
|
|
90
|
+
$d.LoadXml($x)
|
|
91
|
+
$t=New-Object Windows.UI.Notifications.ToastNotification $d
|
|
92
|
+
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier('${TOAST_AUMID}').Show($t)`;
|
|
93
|
+
// --- how the toast host is started (T-FIX-05) ----------------------------------
|
|
94
|
+
/** How much of a host's output is kept; the bound `execFileNoThrow` applies too. */
|
|
95
|
+
const MAX_CAPTURE_BYTES = 64 * 1024;
|
|
96
|
+
/**
|
|
97
|
+
* How the toast host is started: as a console application with no console.
|
|
98
|
+
*
|
|
99
|
+
* Showing a toast means running in-box `powershell.exe` (D3), and a PowerShell
|
|
100
|
+
* host sets the console title as it starts. A child that inherits this process's
|
|
101
|
+
* console therefore renames the session's tab - measured 2026-10-16, before and
|
|
102
|
+
* after one toast: `✦ 🐋 [dsh-tui:42672]` became `Windows PowerShell` (UAT-M4).
|
|
103
|
+
*
|
|
104
|
+
* `windowsHide` is what keeps that console away: Windows starts the child with
|
|
105
|
+
* CREATE_NO_WINDOW, so it has none of its own to retitle, while the pipes below
|
|
106
|
+
* still carry its XML and its failure text. Both halves were measured on a real
|
|
107
|
+
* machine (2026-10-16): the host runs - a write to disk and its stdout arrive,
|
|
108
|
+
* exit 0, 2.1 s for the real toast body whose `Show()` did not throw - and the
|
|
109
|
+
* console title is left alone, against the same measurement with today's options,
|
|
110
|
+
* which clobbered it with `Windows PowerShell`.
|
|
111
|
+
*
|
|
112
|
+
* `detached: true` (DETACHED_PROCESS) was measured and rejected: the title
|
|
113
|
+
* survived there too, but the host exited after ~0.4 s without running the script
|
|
114
|
+
* at all - a silent no-op that would trade a dead click for a toast that never
|
|
115
|
+
* appears. Do not swap one for the other without repeating that measurement.
|
|
116
|
+
* @returns The spawn options the toast host is started with.
|
|
117
|
+
*/
|
|
118
|
+
export function toastHostSpawnOptions() {
|
|
119
|
+
return {
|
|
120
|
+
windowsHide: true,
|
|
121
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Run the toast host under {@link toastHostSpawnOptions}, with `execFileNoThrow`'s
|
|
126
|
+
* contract: never throws, bounded output, and a timeout. `code` is 1 when the
|
|
127
|
+
* host could not be started at all.
|
|
128
|
+
*
|
|
129
|
+
* A spawn of its own rather than that helper, because the console has to be kept
|
|
130
|
+
* from this one child: `reg.exe` shares the caller's console with no
|
|
131
|
+
* consequence, and `execFileNoThrow` - which it uses - inherits it, with no
|
|
132
|
+
* option to say otherwise.
|
|
133
|
+
* @param file - The in-box host to run.
|
|
134
|
+
* @param args - Its argv.
|
|
135
|
+
* @param options - The stdin payload and the timeout, as `execFileNoThrow` takes them.
|
|
136
|
+
* @returns What the host answered.
|
|
137
|
+
*/
|
|
138
|
+
function spawnConsoleLess(file, args, options) {
|
|
139
|
+
return new Promise(resolve => {
|
|
140
|
+
let child;
|
|
141
|
+
try {
|
|
142
|
+
child = spawn(file, args, { ...toastHostSpawnOptions(), timeout: options?.timeout });
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
resolve({ code: 1, stdout: '', stderr: '' });
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const stdoutChunks = [];
|
|
149
|
+
const stderrChunks = [];
|
|
150
|
+
const stdoutTotal = { value: 0 };
|
|
151
|
+
const stderrTotal = { value: 0 };
|
|
152
|
+
let settled = false;
|
|
153
|
+
const finish = (code) => {
|
|
154
|
+
if (settled)
|
|
155
|
+
return;
|
|
156
|
+
settled = true;
|
|
157
|
+
resolve({
|
|
158
|
+
code,
|
|
159
|
+
stdout: Buffer.concat(stdoutChunks).toString('utf8'),
|
|
160
|
+
stderr: Buffer.concat(stderrChunks).toString('utf8'),
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
const collect = (chunks, total) => (chunk) => {
|
|
164
|
+
if (total.value >= MAX_CAPTURE_BYTES)
|
|
165
|
+
return;
|
|
166
|
+
const part = chunk.subarray(0, MAX_CAPTURE_BYTES - total.value);
|
|
167
|
+
chunks.push(part);
|
|
168
|
+
total.value += part.length;
|
|
169
|
+
};
|
|
170
|
+
child.stdout?.on('data', collect(stdoutChunks, stdoutTotal));
|
|
171
|
+
child.stderr?.on('data', collect(stderrChunks, stderrTotal));
|
|
172
|
+
child.stdin?.on('error', () => { });
|
|
173
|
+
child.on('error', () => finish(1));
|
|
174
|
+
child.on('close', code => finish(code));
|
|
175
|
+
if (options?.input !== undefined)
|
|
176
|
+
child.stdin?.write(options.input);
|
|
177
|
+
child.stdin?.end();
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
// --- the pure layer (D10) ------------------------------------------------------
|
|
181
|
+
/**
|
|
182
|
+
* Escape the four characters that would otherwise end a text node (AC-8). A
|
|
183
|
+
* summary is arbitrary model output, so nothing may reach the XML unescaped.
|
|
184
|
+
* @param text Raw text from the renderer.
|
|
185
|
+
* @returns The same text, safe inside an XML text node.
|
|
186
|
+
*/
|
|
187
|
+
export function escapeXmlText(text) {
|
|
188
|
+
// `&` first: escaping it after `<` would double-escape the entities.
|
|
189
|
+
return text
|
|
190
|
+
.replaceAll('&', '&')
|
|
191
|
+
.replaceAll('<', '<')
|
|
192
|
+
.replaceAll('>', '>')
|
|
193
|
+
.replaceAll('"', '"');
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* How much summary the toast body may carry, in display columns. Windows clips
|
|
197
|
+
* the body itself at around four rendered lines and stops mid-sentence with no
|
|
198
|
+
* ellipsis at all - the UAT screenshot (2026-10-16) ended on "…(和 Claude (" -
|
|
199
|
+
* so the budget has to be ours. Two of the roughly 43-column lines that
|
|
200
|
+
* screenshot rendered is ~86 columns; 80 leaves margin for the wider glyphs of
|
|
201
|
+
* other locales and is measured with {@link stringWidth}, the display width the
|
|
202
|
+
* terminal side uses, so a CJK summary is not silently given twice the room of
|
|
203
|
+
* a Latin one.
|
|
204
|
+
*/
|
|
205
|
+
const TOAST_MESSAGE_MAX_WIDTH = 80;
|
|
206
|
+
/**
|
|
207
|
+
* Clip a summary to {@link TOAST_MESSAGE_MAX_WIDTH}, with an ellipsis that says
|
|
208
|
+
* the text continues. The ellipsis is one of those columns, so the text keeps
|
|
209
|
+
* the rest. Cuts between grapheme clusters so combined emoji stay whole.
|
|
210
|
+
* @param message The single-line summary from the renderer.
|
|
211
|
+
* @returns The summary, whole or clipped.
|
|
212
|
+
*/
|
|
213
|
+
function clampSummary(message) {
|
|
214
|
+
if (stringWidth(message) <= TOAST_MESSAGE_MAX_WIDTH)
|
|
215
|
+
return message;
|
|
216
|
+
let width = 0;
|
|
217
|
+
let clipped = '';
|
|
218
|
+
for (const { segment } of getGraphemeSegmenter().segment(message)) {
|
|
219
|
+
const segmentWidth = stringWidth(segment);
|
|
220
|
+
if (width + segmentWidth > TOAST_MESSAGE_MAX_WIDTH - 1)
|
|
221
|
+
break;
|
|
222
|
+
clipped += segment;
|
|
223
|
+
width += segmentWidth;
|
|
224
|
+
}
|
|
225
|
+
return `${clipped}…`;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Build the ToastGeneric document (D10).
|
|
229
|
+
* @param content Title and summary.
|
|
230
|
+
* @returns The XML handed to `XmlDocument.LoadXml` on the PowerShell side.
|
|
231
|
+
*/
|
|
232
|
+
export function toastXml(content) {
|
|
233
|
+
const texts = [`<text>${escapeXmlText(content.title)}</text>`];
|
|
234
|
+
if (content.message !== undefined && content.message !== '') {
|
|
235
|
+
texts.push(`<text>${escapeXmlText(clampSummary(content.message))}</text>`);
|
|
236
|
+
}
|
|
237
|
+
return `<toast><visual><binding template="ToastGeneric">${texts.join('')}</binding></visual></toast>`;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Create a transport with its own registration state. Production shares one
|
|
241
|
+
* instance through {@link notifyWindowsToast}, because "the AUMID is registered"
|
|
242
|
+
* is a per-process fact (D11).
|
|
243
|
+
* @param options Ports and paths; every one of them has a production default.
|
|
244
|
+
* @returns The transport.
|
|
245
|
+
*/
|
|
246
|
+
export function createWindowsToastTransport(options = {}) {
|
|
247
|
+
const platform = options.platform ?? process.platform;
|
|
248
|
+
const env = options.env ?? process.env;
|
|
249
|
+
const run = options.run ?? execFileNoThrow;
|
|
250
|
+
const toastHost = options.runToastHost ?? spawnConsoleLess;
|
|
251
|
+
const log = options.log ?? logForDebugging;
|
|
252
|
+
const now = options.now ?? Date.now;
|
|
253
|
+
const tools = toolsFor(env);
|
|
254
|
+
const registry = options.registry ?? regExeRegistry(run, tools);
|
|
255
|
+
const icon = options.iconPath ?? shippedToastIcon;
|
|
256
|
+
let settled;
|
|
257
|
+
let pending;
|
|
258
|
+
const fail = (reason, detail) => {
|
|
259
|
+
log('windows toast unavailable', detail === undefined ? { reason } : { reason, detail });
|
|
260
|
+
return detail === undefined ? { ok: false, reason } : { ok: false, reason, detail };
|
|
261
|
+
};
|
|
262
|
+
const unavailable = (reason, detail) => detail === undefined ? { status: 'unavailable', reason } : { status: 'unavailable', reason, detail };
|
|
263
|
+
function available(query = {}) {
|
|
264
|
+
if ((query.platform ?? platform) !== 'win32')
|
|
265
|
+
return { available: false, reason: 'not-win32' };
|
|
266
|
+
if (query.externalNotifierActive === true) {
|
|
267
|
+
return { available: false, reason: 'yielded' };
|
|
268
|
+
}
|
|
269
|
+
// The same two refusals `register()` makes, in the same order: without an
|
|
270
|
+
// in-box host to render the toast there is nothing to register.
|
|
271
|
+
if (tools === null)
|
|
272
|
+
return { available: false, reason: 'system-root-missing', detail: SYSTEM_ROOT_MISSING_DETAIL };
|
|
273
|
+
// Once a registration has failed it is final for this process (D11).
|
|
274
|
+
if (settled !== undefined && !settled.ok) {
|
|
275
|
+
return settled.detail === undefined
|
|
276
|
+
? { available: false, reason: settled.reason }
|
|
277
|
+
: { available: false, reason: settled.reason, detail: settled.detail };
|
|
278
|
+
}
|
|
279
|
+
return { available: true };
|
|
280
|
+
}
|
|
281
|
+
function resolve() {
|
|
282
|
+
// One attempt per process: a policy that refuses the key will refuse it
|
|
283
|
+
// again, and retrying it per notification would only add a round trip.
|
|
284
|
+
pending ??= register()
|
|
285
|
+
.catch((error) => fail('unexpected', describe(error)))
|
|
286
|
+
.then(result => {
|
|
287
|
+
settled = result;
|
|
288
|
+
return result;
|
|
289
|
+
});
|
|
290
|
+
return pending;
|
|
291
|
+
}
|
|
292
|
+
async function register() {
|
|
293
|
+
// D12: the platform gate comes before every other check, so a POSIX process
|
|
294
|
+
// that reached this module still cannot write a key.
|
|
295
|
+
if (platform !== 'win32')
|
|
296
|
+
return fail('not-win32');
|
|
297
|
+
if (tools === null)
|
|
298
|
+
return fail('system-root-missing', SYSTEM_ROOT_MISSING_DETAIL);
|
|
299
|
+
const aumidFailure = await registerAumid(registry, icon(), log);
|
|
300
|
+
if (aumidFailure !== undefined)
|
|
301
|
+
return fail('aumid-registration-failed', aumidFailure);
|
|
302
|
+
return { ok: true, tools };
|
|
303
|
+
}
|
|
304
|
+
async function show(input, powershell) {
|
|
305
|
+
const xml = toastXml({ title: input.title, message: input.message });
|
|
306
|
+
const started = now();
|
|
307
|
+
const result = await toastHost(powershell, ['-NoProfile', '-Command', TOAST_SCRIPT], { input: xml, timeout: TOAST_TIMEOUT_MS });
|
|
308
|
+
if (result.code !== 0) {
|
|
309
|
+
// The caller answers an `unavailable` with the bell, so the cause is the
|
|
310
|
+
// only thing that explains why both a toast and a bell were needed.
|
|
311
|
+
const detail = failureCause(result);
|
|
312
|
+
log('windows toast failed to appear', { detail });
|
|
313
|
+
return unavailable('toast-failed', detail);
|
|
314
|
+
}
|
|
315
|
+
log('windows toast shown', { ms: now() - started });
|
|
316
|
+
return { status: 'shown' };
|
|
317
|
+
}
|
|
318
|
+
return {
|
|
319
|
+
async notify(input) {
|
|
320
|
+
try {
|
|
321
|
+
if (input.canDispatch?.() === false)
|
|
322
|
+
return { status: 'suppressed' };
|
|
323
|
+
const judgement = available({ externalNotifierActive: input.externalNotifierActive });
|
|
324
|
+
if (!judgement.available) {
|
|
325
|
+
if (judgement.reason === 'yielded')
|
|
326
|
+
return { status: 'yielded' };
|
|
327
|
+
return unavailable(judgement.reason, judgement.detail);
|
|
328
|
+
}
|
|
329
|
+
const registration = await resolve();
|
|
330
|
+
if (!registration.ok)
|
|
331
|
+
return unavailable(registration.reason, registration.detail);
|
|
332
|
+
if (input.canDispatch?.() === false)
|
|
333
|
+
return { status: 'suppressed' };
|
|
334
|
+
return await show(input, registration.tools.powershell);
|
|
335
|
+
}
|
|
336
|
+
catch (error) {
|
|
337
|
+
// The caller's path is fire-and-forget (the renderer cannot await a
|
|
338
|
+
// notification), so a rejection here would surface as an unhandled one.
|
|
339
|
+
log('windows toast failed', { detail: describe(error) });
|
|
340
|
+
return unavailable('unexpected', describe(error));
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* The in-box tools under `%WINDIR%`, or null when there is no system root to
|
|
347
|
+
* find them under. Resolved by absolute path, never through `PATH`.
|
|
348
|
+
*/
|
|
349
|
+
function toolsFor(env) {
|
|
350
|
+
const windir = env.windir;
|
|
351
|
+
if (windir === undefined || windir === '')
|
|
352
|
+
return null;
|
|
353
|
+
return {
|
|
354
|
+
reg: join(windir, 'System32', 'reg.exe'),
|
|
355
|
+
powershell: join(windir, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe'),
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Create the AUMID key the shell needs before it will display anything (D11).
|
|
360
|
+
*
|
|
361
|
+
* DisplayName goes first because it is the write that creates the key. The
|
|
362
|
+
* order cannot be repaired afterwards: the shell fixes an AUMID's identity the
|
|
363
|
+
* first time it sees a notification for it, and never re-reads the key. The
|
|
364
|
+
* 2026-10-16 UAT still showed the bare AUMID `dsh-tui` above a toast whose key
|
|
365
|
+
* held `DisplayName` = `dsh-TUI` - and the notification database dates that
|
|
366
|
+
* first sighting eight hours before this write first existed
|
|
367
|
+
* (`NotificationHandler`, primary id `dsh-tui`, created 2026-10-15 21:33:04,
|
|
368
|
+
* never modified). What this can promise is the order: every process writes
|
|
369
|
+
* both values before its first `Show()`.
|
|
370
|
+
*
|
|
371
|
+
* @param registry The HKCU writer.
|
|
372
|
+
* @param iconUri The image file to register, or undefined to register none.
|
|
373
|
+
* @param log Where a refusal that costs only the icon is reported.
|
|
374
|
+
* @returns Why the key could not be registered, or undefined on success.
|
|
375
|
+
*/
|
|
376
|
+
async function registerAumid(registry, iconUri, log) {
|
|
377
|
+
const display = await registry.setValue(AUMID_REGISTRY_KEY, 'DisplayName', 'dsh-TUI');
|
|
378
|
+
if (!display.ok)
|
|
379
|
+
return `DisplayName: ${display.detail}`;
|
|
380
|
+
if (iconUri === undefined) {
|
|
381
|
+
// An icon is decoration: the toast renders without one, and a path the
|
|
382
|
+
// shell cannot read renders nothing either - with nothing left to
|
|
383
|
+
// diagnose. So a missing file registers no value instead of a bad one.
|
|
384
|
+
log('windows toast: no icon file to register, the toast shows without one');
|
|
385
|
+
return undefined;
|
|
386
|
+
}
|
|
387
|
+
// IconUri only decorates the entry in Settings > Notifications, so a refusal
|
|
388
|
+
// there costs the icon, not the toast.
|
|
389
|
+
const icon = await registry.setValue(AUMID_REGISTRY_KEY, 'IconUri', iconUri);
|
|
390
|
+
if (!icon.ok)
|
|
391
|
+
log('windows toast: the AUMID icon was refused, the toast is unaffected', { detail: icon.detail });
|
|
392
|
+
return undefined;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* The production registry port: one `reg.exe add` per value, always against the
|
|
396
|
+
* key it is given - which is always one of this module's own HKCU keys.
|
|
397
|
+
*/
|
|
398
|
+
function regExeRegistry(run, tools) {
|
|
399
|
+
return {
|
|
400
|
+
async setValue(key, name, value) {
|
|
401
|
+
if (tools === null)
|
|
402
|
+
return { ok: false, detail: '%WINDIR% is not set, so reg.exe cannot be located' };
|
|
403
|
+
const args = ['add', key, ...(name === null ? ['/ve'] : ['/v', name]), '/t', 'REG_SZ', '/d', value, '/f'];
|
|
404
|
+
const result = await run(tools.reg, args, { timeout: REGISTRY_TIMEOUT_MS });
|
|
405
|
+
// `reg.exe` is chatty about success too; only a non-zero exit matters.
|
|
406
|
+
return result.code === 0 ? { ok: true } : { ok: false, detail: failureCause(result) };
|
|
407
|
+
},
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
/** The first line of a failed command's output, the only clue the caller gets. */
|
|
411
|
+
function failureCause(result) {
|
|
412
|
+
for (const stream of [result.stderr, result.stdout]) {
|
|
413
|
+
const line = stream.trim().split(/\r?\n/u)[0];
|
|
414
|
+
if (line !== '')
|
|
415
|
+
return line;
|
|
416
|
+
}
|
|
417
|
+
return `exited with code ${result.code}`;
|
|
418
|
+
}
|
|
419
|
+
function describe(error) {
|
|
420
|
+
return error instanceof Error ? error.message : String(error);
|
|
421
|
+
}
|
|
422
|
+
// --- the shared instance ------------------------------------------------------
|
|
423
|
+
let shared;
|
|
424
|
+
/**
|
|
425
|
+
* Show one task-completion toast: stand down for an external notifier, register
|
|
426
|
+
* once, then spawn the in-box host. Never rejects, and an unavailable transport
|
|
427
|
+
* is reported so the caller can ring the bell instead (AC-5).
|
|
428
|
+
* @param input Title, summary and the profile document for the dedup read.
|
|
429
|
+
* @returns What happened, in terms the caller can act on.
|
|
430
|
+
*/
|
|
431
|
+
export function notifyWindowsToast(input) {
|
|
432
|
+
return (shared ??= createWindowsToastTransport()).notify(input);
|
|
433
|
+
}
|