@deepseek-harness-tui/dsh-tui 0.16.0 → 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 +214 -34
- 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/claude-backend.en.md +8 -0
- package/guide/dsh-tui-guide/claude-backend.md +5 -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 +44 -10
- package/guide/dsh-tui-guide/getting-started.md +31 -9
- 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-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +4 -0
- package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
- package/lib/types/dsh-adapter/host-contract.js +2 -2
- package/lib/types/dsh-adapter/host-dsh.js +3 -3
- package/lib/types/dsh-adapter/host-entry.js +5 -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/install/pnpm-profile-add.d.ts.map +1 -1
- package/lib/types/dsh-adapter/install/pnpm-profile-add.js +9 -3
- 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 +46 -36
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +248 -157
- 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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Conservative wall-clock limit, independent of output/silence. */
|
|
2
|
+
export declare const DEFAULT_UPDATE_TIMEOUT_MS: number;
|
|
3
|
+
export declare function updateTimeoutMs(value?: string | undefined): number;
|
|
4
|
+
export interface InstallerEvent {
|
|
5
|
+
readonly category: string;
|
|
6
|
+
readonly pid?: number;
|
|
7
|
+
readonly lastOutputAt?: number;
|
|
8
|
+
readonly stage: 'start' | 'timeout' | 'cancel' | 'error' | 'close' | 'cleanup-error';
|
|
9
|
+
readonly code?: number;
|
|
10
|
+
readonly message?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface InstallerOptions {
|
|
13
|
+
env?: NodeJS.ProcessEnv;
|
|
14
|
+
shell?: boolean;
|
|
15
|
+
category: string;
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
/** Grace period for this owned process group, before forceful termination. */
|
|
19
|
+
terminationGraceMs?: number;
|
|
20
|
+
onStdout?: (text: string) => void;
|
|
21
|
+
onStderr?: (text: string) => void;
|
|
22
|
+
onEvent?: (event: InstallerEvent) => void;
|
|
23
|
+
}
|
|
24
|
+
/** Installer-only runner: one result, owned tree cancellation, bounded cleanup.
|
|
25
|
+
* Output is observational; even "Done" cannot settle the process successfully.
|
|
26
|
+
*/
|
|
27
|
+
export declare function runInstallerProcess(command: string, args: readonly string[], options: InstallerOptions): Promise<number>;
|
|
28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,GAAG,OAAO,CAAC,MAAM,CAAC,CA0GxH"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { runWindowsInstaller } from './windowsInstaller.js';
|
|
3
|
+
/** Conservative wall-clock limit, independent of output/silence. */
|
|
4
|
+
export const DEFAULT_UPDATE_TIMEOUT_MS = 30 * 60 * 1000;
|
|
5
|
+
export function updateTimeoutMs(value = process.env['DSH_TUI_UPDATE_TIMEOUT_MS']) {
|
|
6
|
+
const parsed = value === undefined ? NaN : Number(value);
|
|
7
|
+
return Number.isSafeInteger(parsed) && parsed > 0 && parsed <= 2 ** 31 - 1
|
|
8
|
+
? parsed
|
|
9
|
+
: DEFAULT_UPDATE_TIMEOUT_MS;
|
|
10
|
+
}
|
|
11
|
+
/** Installer-only runner: one result, owned tree cancellation, bounded cleanup.
|
|
12
|
+
* Output is observational; even "Done" cannot settle the process successfully.
|
|
13
|
+
*/
|
|
14
|
+
export function runInstallerProcess(command, args, options) {
|
|
15
|
+
if (options.signal?.aborted) {
|
|
16
|
+
options.onEvent?.({ category: options.category, stage: 'cancel', code: 130 });
|
|
17
|
+
return Promise.resolve(130);
|
|
18
|
+
}
|
|
19
|
+
if (process.platform === 'win32') {
|
|
20
|
+
return runWindowsInstaller(command, args, options, options.timeoutMs ?? updateTimeoutMs(options.env?.['DSH_TUI_UPDATE_TIMEOUT_MS']));
|
|
21
|
+
}
|
|
22
|
+
return new Promise(resolve => {
|
|
23
|
+
let settled = false;
|
|
24
|
+
let stopping = false;
|
|
25
|
+
let childClosed = false;
|
|
26
|
+
let treeTerminated = false;
|
|
27
|
+
let stopCode = 1;
|
|
28
|
+
let lastOutputAt;
|
|
29
|
+
let deadline;
|
|
30
|
+
let escalation;
|
|
31
|
+
let reapDeadline;
|
|
32
|
+
const timeoutMs = options.timeoutMs ?? updateTimeoutMs(options.env?.['DSH_TUI_UPDATE_TIMEOUT_MS']);
|
|
33
|
+
const graceMs = options.terminationGraceMs ?? 2000;
|
|
34
|
+
// A separate POSIX process group is the ownership boundary. Never signal
|
|
35
|
+
// the app's own group, and never enumerate/kill processes by executable name.
|
|
36
|
+
const child = spawn(command, [...args], {
|
|
37
|
+
env: options.env,
|
|
38
|
+
detached: true,
|
|
39
|
+
stdio: ['inherit', 'pipe', 'pipe'],
|
|
40
|
+
});
|
|
41
|
+
const emit = (stage, code, message) => {
|
|
42
|
+
options.onEvent?.({ category: options.category, pid: child.pid, lastOutputAt, stage, code, message });
|
|
43
|
+
};
|
|
44
|
+
const finish = (code) => {
|
|
45
|
+
if (settled)
|
|
46
|
+
return;
|
|
47
|
+
settled = true;
|
|
48
|
+
clearTimeout(deadline);
|
|
49
|
+
clearTimeout(escalation);
|
|
50
|
+
clearTimeout(reapDeadline);
|
|
51
|
+
options.signal?.removeEventListener('abort', onAbort);
|
|
52
|
+
process.removeListener('SIGINT', onInterrupt);
|
|
53
|
+
process.removeListener('SIGTERM', onTerminate);
|
|
54
|
+
process.removeListener('SIGHUP', onHangup);
|
|
55
|
+
child.stdout?.destroy();
|
|
56
|
+
child.stderr?.destroy();
|
|
57
|
+
child.unref();
|
|
58
|
+
emit('close', code);
|
|
59
|
+
resolve(code);
|
|
60
|
+
};
|
|
61
|
+
const signalGroup = (signal) => {
|
|
62
|
+
if (child.pid === undefined)
|
|
63
|
+
return;
|
|
64
|
+
try {
|
|
65
|
+
process.kill(-child.pid, signal);
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (error.code !== 'ESRCH') {
|
|
69
|
+
emit('cleanup-error', stopCode, error instanceof Error ? error.message : String(error));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const afterKill = () => {
|
|
74
|
+
treeTerminated = true;
|
|
75
|
+
if (childClosed)
|
|
76
|
+
finish(stopCode);
|
|
77
|
+
else
|
|
78
|
+
reapDeadline = setTimeout(() => {
|
|
79
|
+
emit('cleanup-error', stopCode, 'Installer did not close after tree termination; inspect the recorded PID before repairing the installation');
|
|
80
|
+
finish(stopCode);
|
|
81
|
+
}, 2000);
|
|
82
|
+
};
|
|
83
|
+
const stop = (code, stage) => {
|
|
84
|
+
if (settled || stopping)
|
|
85
|
+
return;
|
|
86
|
+
stopping = true;
|
|
87
|
+
stopCode = code;
|
|
88
|
+
clearTimeout(deadline);
|
|
89
|
+
emit(stage, code);
|
|
90
|
+
if (child.pid === undefined) {
|
|
91
|
+
finish(code);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
signalGroup('SIGTERM');
|
|
95
|
+
// Always escalate the owned GROUP even if its root exits on TERM:
|
|
96
|
+
// a grandchild may ignore TERM or hold the inherited pipes open.
|
|
97
|
+
escalation = setTimeout(() => { signalGroup('SIGKILL'); afterKill(); }, graceMs);
|
|
98
|
+
};
|
|
99
|
+
const onAbort = () => stop(130, 'cancel');
|
|
100
|
+
const onInterrupt = () => stop(130, 'cancel');
|
|
101
|
+
const onTerminate = () => stop(143, 'cancel');
|
|
102
|
+
const onHangup = () => stop(129, 'cancel');
|
|
103
|
+
child.stdout?.setEncoding('utf8');
|
|
104
|
+
child.stderr?.setEncoding('utf8');
|
|
105
|
+
child.stdout?.on('data', (chunk) => {
|
|
106
|
+
lastOutputAt = Date.now();
|
|
107
|
+
options.onStdout?.(chunk);
|
|
108
|
+
});
|
|
109
|
+
child.stderr?.on('data', (chunk) => {
|
|
110
|
+
lastOutputAt = Date.now();
|
|
111
|
+
options.onStderr?.(chunk);
|
|
112
|
+
});
|
|
113
|
+
child.once('error', error => {
|
|
114
|
+
emit('error', 127, error.message);
|
|
115
|
+
if (!stopping)
|
|
116
|
+
finish(127);
|
|
117
|
+
});
|
|
118
|
+
child.once('close', code => {
|
|
119
|
+
childClosed = true;
|
|
120
|
+
if (!stopping)
|
|
121
|
+
finish(code ?? 1);
|
|
122
|
+
else if (treeTerminated)
|
|
123
|
+
finish(stopCode);
|
|
124
|
+
// Cancellation waits for tree termination, not merely the root's close.
|
|
125
|
+
});
|
|
126
|
+
process.on('SIGINT', onInterrupt);
|
|
127
|
+
process.on('SIGTERM', onTerminate);
|
|
128
|
+
process.on('SIGHUP', onHangup);
|
|
129
|
+
options.signal?.addEventListener('abort', onAbort, { once: true });
|
|
130
|
+
emit('start');
|
|
131
|
+
deadline = setTimeout(() => stop(124, 'timeout'), timeoutMs);
|
|
132
|
+
if (options.signal?.aborted)
|
|
133
|
+
onAbort();
|
|
134
|
+
});
|
|
135
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Previous whitespace-delimited word start (readline Alt+B / Ctrl+W). */
|
|
2
|
+
export declare function wordBoundaryLeft(text: string, cursor: number): number;
|
|
3
|
+
/** Next whitespace-delimited word start (readline Alt+F). */
|
|
4
|
+
export declare function wordBoundaryRight(text: string, cursor: number): number;
|
|
5
|
+
//# sourceMappingURL=inputWordBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputWordBoundary.d.ts","sourceRoot":"","sources":["../../../src/utils/inputWordBoundary.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAKrE;AAED,6DAA6D;AAC7D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAKtE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Previous whitespace-delimited word start (readline Alt+B / Ctrl+W). */
|
|
2
|
+
export function wordBoundaryLeft(text, cursor) {
|
|
3
|
+
let index = cursor;
|
|
4
|
+
while (index > 0 && /\s/.test(text[index - 1]))
|
|
5
|
+
index--;
|
|
6
|
+
while (index > 0 && !/\s/.test(text[index - 1]))
|
|
7
|
+
index--;
|
|
8
|
+
return index;
|
|
9
|
+
}
|
|
10
|
+
/** Next whitespace-delimited word start (readline Alt+F). */
|
|
11
|
+
export function wordBoundaryRight(text, cursor) {
|
|
12
|
+
let index = cursor;
|
|
13
|
+
while (index < text.length && !/\s/.test(text[index]))
|
|
14
|
+
index++;
|
|
15
|
+
while (index < text.length && /\s/.test(text[index]))
|
|
16
|
+
index++;
|
|
17
|
+
return index;
|
|
18
|
+
}
|
|
@@ -68,7 +68,7 @@ export declare function comboMatchesStrict(combo: ParsedCombo, input: string, ke
|
|
|
68
68
|
/** Identifiers of every customizable built-in action. */
|
|
69
69
|
export type ShortcutActionId = 'paste' | 'history' | 'editor' | 'transcript' | 'trajectory' | 'dashboard' | 'contextPanel'
|
|
70
70
|
/** 落地页「继续上次会话」一键(第七版):只在启动页生效,聊天页不绑。 */
|
|
71
|
-
| 'continue' | 'showAll' | 'questionFold' | 'redraw' | 'todoFold' | 'expandEditor' | 'star' | 'undo' | 'sidePanel' | 'sidePanelZoom';
|
|
71
|
+
| 'continue' | 'showAll' | 'questionFold' | 'questionDetailUp' | 'questionDetailDown' | 'redraw' | 'todoFold' | 'expandEditor' | 'star' | 'undo' | 'sidePanel' | 'sidePanelZoom';
|
|
72
72
|
export interface ShortcutActionSpec {
|
|
73
73
|
readonly id: ShortcutActionId;
|
|
74
74
|
/** Default combos; the FIRST entry is the canonical display form. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keymap.d.ts","sourceRoot":"","sources":["../../../src/utils/keymap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,uEAAuE;AACvE,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC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AKG;AACH,wBAAgB,oBAAoB,IAAI,WAAW,CAAC,MAAM,CAAC,CAM1D"}
|
|
@@ -176,12 +176,14 @@ export const SHORTCUT_ACTIONS = [
|
|
|
176
176
|
{ id: 'contextPanel', defaults: ['ctrl+p'] },
|
|
177
177
|
// 落地页 Continue:alt+r(resume 语义)。占用核对(SHORTCUT_ACTIONS defaults ∪
|
|
178
178
|
// FIXED_RESERVED_COMBOS):ctrl 系 v/r/g/o/t/a/p/e/l/q/k/b/c/d/u/w/j/left/right/return
|
|
179
|
-
//
|
|
179
|
+
// 全占;alt+r 空闲,且不与输入框抢字母键。
|
|
180
180
|
{ id: 'continue', defaults: ['alt+r'] },
|
|
181
181
|
{ id: 'showAll', defaults: ['ctrl+e'] },
|
|
182
182
|
{ id: 'redraw', defaults: ['ctrl+l'] },
|
|
183
183
|
{ id: 'todoFold', defaults: ['ctrl+q'] },
|
|
184
184
|
{ id: 'questionFold', defaults: ['ctrl+k'] },
|
|
185
|
+
{ id: 'questionDetailUp', defaults: ['alt+up'] },
|
|
186
|
+
{ id: 'questionDetailDown', defaults: ['alt+down'] },
|
|
185
187
|
{ id: 'expandEditor', defaults: ['ctrl+shift+e'] },
|
|
186
188
|
// 开屏标语里的"一键 star":与 `/star`、弹窗按钮同一个动作(gh api PUT)。
|
|
187
189
|
// 用 alt 组合是为了不跟输入框抢字母键。
|
|
@@ -314,9 +316,12 @@ export const FIXED_RESERVED_COMBOS = [
|
|
|
314
316
|
'ctrl+u', // kill line
|
|
315
317
|
'ctrl+k', // kill to end
|
|
316
318
|
'ctrl+w', // kill word
|
|
319
|
+
'alt+backspace', // kill word (Option-as-Meta / extended key reporting)
|
|
317
320
|
'ctrl+j', // newline fallback (legacy LF / extended key reporting)
|
|
318
321
|
'ctrl+left', // word jump
|
|
319
322
|
'ctrl+right', // word jump
|
|
323
|
+
'alt+left', // word jump
|
|
324
|
+
'alt+right', // word jump
|
|
320
325
|
'ctrl+return', // newline (multi-line input)
|
|
321
326
|
'ctrl+shift+return', // shift+Enter newline (CSI 13;6u) — same editor binding
|
|
322
327
|
'alt+return', // newline fallback on terminals without shift reporting
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { InstallerOptions } from './updateProcess.js';
|
|
2
|
+
/** The supervisor owns a private job handle, including after the root exits. */
|
|
3
|
+
export declare function runWindowsInstaller(command: string, args: readonly string[], options: InstallerOptions, timeoutMs: number): Promise<number>;
|
|
4
|
+
//# sourceMappingURL=windowsInstaller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windowsInstaller.d.ts","sourceRoot":"","sources":["../../src/windowsInstaller.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAkB,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AA6C1E,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmK3I"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join, win32 } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { cmdEscapeArgument, cmdEscapeCommand } from './utils/shellQuote.js';
|
|
7
|
+
function environmentValue(env, key) {
|
|
8
|
+
return Object.entries(env).find(([name]) => name.toLowerCase() === key.toLowerCase())?.[1];
|
|
9
|
+
}
|
|
10
|
+
/** Quote a single argv element for CreateProcess/CommandLineToArgvW. */
|
|
11
|
+
function quoteWindowsArgument(value) {
|
|
12
|
+
return `"${value.replace(/(\\*)"/g, '$1$1\\"').replace(/(\\+)$/g, '$1$1')}"`;
|
|
13
|
+
}
|
|
14
|
+
function commandLine(command, args, options) {
|
|
15
|
+
if (!command || [command, ...args].some(value => value.includes('\0')))
|
|
16
|
+
throw new Error('Invalid installer command or argument');
|
|
17
|
+
if (!options.shell) {
|
|
18
|
+
// A null application lets CreateProcess search PATH for a bare executable.
|
|
19
|
+
return { application: '', commandLine: [command, ...args].map(quoteWindowsArgument).join(' ') };
|
|
20
|
+
}
|
|
21
|
+
const env = options.env ?? process.env;
|
|
22
|
+
const application = environmentValue(env, 'ComSpec') || join(environmentValue(env, 'SystemRoot') || 'C:\\Windows', 'System32', 'cmd.exe');
|
|
23
|
+
const normalized = win32.normalize(command);
|
|
24
|
+
const shim = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i.test(normalized);
|
|
25
|
+
const line = [cmdEscapeCommand(normalized), ...args.map(arg => cmdEscapeArgument(arg, shim))].join(' ');
|
|
26
|
+
return { application, commandLine: `${quoteWindowsArgument(application)} /d /s /c "${line}"` };
|
|
27
|
+
}
|
|
28
|
+
function readResult(directory) {
|
|
29
|
+
try {
|
|
30
|
+
const value = JSON.parse(readFileSync(join(directory, 'result.json'), 'utf8'));
|
|
31
|
+
if (typeof value !== 'object' || value === null)
|
|
32
|
+
return undefined;
|
|
33
|
+
const result = value;
|
|
34
|
+
if (!Number.isInteger(result['code']) || typeof result['cleanupConfirmed'] !== 'boolean')
|
|
35
|
+
return undefined;
|
|
36
|
+
return {
|
|
37
|
+
code: result['code'],
|
|
38
|
+
cleanupConfirmed: result['cleanupConfirmed'],
|
|
39
|
+
error: typeof result['error'] === 'string' ? result['error'] : undefined,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** The supervisor owns a private job handle, including after the root exits. */
|
|
47
|
+
export function runWindowsInstaller(command, args, options, timeoutMs) {
|
|
48
|
+
return new Promise(resolve => {
|
|
49
|
+
let directory = '';
|
|
50
|
+
let child;
|
|
51
|
+
try {
|
|
52
|
+
const descriptor = commandLine(command, args, options);
|
|
53
|
+
directory = mkdtempSync(join(tmpdir(), 'dsh-installer-'));
|
|
54
|
+
writeFileSync(join(directory, 'config.json'), JSON.stringify({
|
|
55
|
+
...descriptor, parentPid: process.pid, parentNotAfterMs: Date.now(),
|
|
56
|
+
}), { encoding: 'utf8', mode: 0o600 });
|
|
57
|
+
// Source-mode tools and installed npm packages use different asset paths.
|
|
58
|
+
const sourceAsset = new URL('../assets/windows-installer.ps1', import.meta.url);
|
|
59
|
+
const script = fileURLToPath(existsSync(sourceAsset) ? sourceAsset : new URL('../../assets/windows-installer.ps1', import.meta.url));
|
|
60
|
+
const env = options.env ?? process.env;
|
|
61
|
+
const powershell = join(environmentValue(env, 'SystemRoot') || 'C:\\Windows', 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe');
|
|
62
|
+
// A restrictive outer Windows job can make spawn throw synchronously.
|
|
63
|
+
// Establish no listeners or timers until a supervisor has been returned.
|
|
64
|
+
child = spawn(powershell, ['-NoLogo', '-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-File', script, directory], {
|
|
65
|
+
env: options.env,
|
|
66
|
+
stdio: ['inherit', 'pipe', 'pipe'],
|
|
67
|
+
windowsHide: true,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
options.onEvent?.({ category: options.category, stage: 'error', code: 127, message: String(error) });
|
|
72
|
+
if (directory) {
|
|
73
|
+
try {
|
|
74
|
+
rmSync(directory, { recursive: true, force: true });
|
|
75
|
+
}
|
|
76
|
+
catch (cleanupError) {
|
|
77
|
+
options.onEvent?.({ category: options.category, stage: 'cleanup-error', code: 127, message: `Temporary installer control files could not be removed: ${String(cleanupError)}` });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
options.onEvent?.({ category: options.category, stage: 'close', code: 127 });
|
|
81
|
+
resolve(127);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
let settled = false;
|
|
85
|
+
let stopCode;
|
|
86
|
+
let rootPid;
|
|
87
|
+
let lastOutputAt;
|
|
88
|
+
let deadline;
|
|
89
|
+
let startupDeadline;
|
|
90
|
+
let reapDeadline;
|
|
91
|
+
let statusPoll;
|
|
92
|
+
let emergency = false;
|
|
93
|
+
const emit = (stage, code, message) => {
|
|
94
|
+
options.onEvent?.({ category: options.category, pid: rootPid, lastOutputAt, stage, code, message });
|
|
95
|
+
};
|
|
96
|
+
const finish = (code, removeDirectory = true) => {
|
|
97
|
+
if (settled)
|
|
98
|
+
return;
|
|
99
|
+
settled = true;
|
|
100
|
+
clearTimeout(deadline);
|
|
101
|
+
clearTimeout(startupDeadline);
|
|
102
|
+
clearTimeout(reapDeadline);
|
|
103
|
+
clearInterval(statusPoll);
|
|
104
|
+
options.signal?.removeEventListener('abort', onAbort);
|
|
105
|
+
process.removeListener('SIGINT', onInterrupt);
|
|
106
|
+
process.removeListener('SIGTERM', onTerminate);
|
|
107
|
+
process.removeListener('SIGHUP', onHangup);
|
|
108
|
+
child.stdout?.destroy();
|
|
109
|
+
child.stderr?.destroy();
|
|
110
|
+
child.unref();
|
|
111
|
+
if (removeDirectory) {
|
|
112
|
+
try {
|
|
113
|
+
rmSync(directory, { recursive: true, force: true });
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
emit('cleanup-error', code, `Temporary installer control files could not be removed: ${String(error)}`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
emit('close', code);
|
|
120
|
+
resolve(code);
|
|
121
|
+
};
|
|
122
|
+
const forceSupervisorExit = () => {
|
|
123
|
+
if (settled || emergency)
|
|
124
|
+
return;
|
|
125
|
+
emergency = true;
|
|
126
|
+
emit('cleanup-error', stopCode ?? 127, 'Windows installer supervisor did not confirm an empty job; closing its owned handle is a fail-safe, but cleanup is unconfirmed');
|
|
127
|
+
// ChildProcess retains the supervisor's process handle. This is never a
|
|
128
|
+
// taskkill of an exited installer PID, nor discovery by process name.
|
|
129
|
+
child.kill();
|
|
130
|
+
reapDeadline = setTimeout(() => {
|
|
131
|
+
// Keep config/cancel if supervisor exit cannot be observed: a late
|
|
132
|
+
// startup must still see cancellation and must never run the payload.
|
|
133
|
+
finish(stopCode ?? 127, false);
|
|
134
|
+
}, 2000);
|
|
135
|
+
};
|
|
136
|
+
const stop = (code, stage, message) => {
|
|
137
|
+
if (settled || stopCode !== undefined)
|
|
138
|
+
return;
|
|
139
|
+
stopCode = code;
|
|
140
|
+
clearTimeout(deadline);
|
|
141
|
+
clearTimeout(startupDeadline);
|
|
142
|
+
emit(stage, code, message);
|
|
143
|
+
try {
|
|
144
|
+
writeFileSync(join(directory, 'cancel'), '');
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
emit('cleanup-error', code, `Cannot request Windows job termination: ${String(error)}`);
|
|
148
|
+
forceSupervisorExit();
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
reapDeadline = setTimeout(forceSupervisorExit, 8000);
|
|
152
|
+
};
|
|
153
|
+
const onAbort = () => stop(130, 'cancel');
|
|
154
|
+
const onInterrupt = () => stop(130, 'cancel');
|
|
155
|
+
const onTerminate = () => stop(143, 'cancel');
|
|
156
|
+
const onHangup = () => stop(129, 'cancel');
|
|
157
|
+
const pollReady = () => {
|
|
158
|
+
if (rootPid !== undefined || settled)
|
|
159
|
+
return;
|
|
160
|
+
try {
|
|
161
|
+
const ready = JSON.parse(readFileSync(join(directory, 'ready'), 'utf8'));
|
|
162
|
+
if (typeof ready !== 'object' || ready === null)
|
|
163
|
+
return;
|
|
164
|
+
const status = ready;
|
|
165
|
+
if (!Number.isSafeInteger(status['pid']) || status['pid'] <= 0 || status['member'] !== true || status['inheritable'] !== false)
|
|
166
|
+
return;
|
|
167
|
+
rootPid = status['pid'];
|
|
168
|
+
clearTimeout(startupDeadline);
|
|
169
|
+
emit('start', undefined, 'Private Windows job membership verified; job handle inheritance disabled');
|
|
170
|
+
}
|
|
171
|
+
catch { /* Atomic ready file has not been published yet. */ }
|
|
172
|
+
};
|
|
173
|
+
child.stdout?.setEncoding('utf8');
|
|
174
|
+
child.stderr?.setEncoding('utf8');
|
|
175
|
+
child.stdout?.on('data', (chunk) => {
|
|
176
|
+
lastOutputAt = Date.now();
|
|
177
|
+
options.onStdout?.(chunk);
|
|
178
|
+
});
|
|
179
|
+
child.stderr?.on('data', (chunk) => {
|
|
180
|
+
lastOutputAt = Date.now();
|
|
181
|
+
options.onStderr?.(chunk);
|
|
182
|
+
});
|
|
183
|
+
child.once('error', error => {
|
|
184
|
+
emit('error', 127, error.message);
|
|
185
|
+
if (child.pid === undefined)
|
|
186
|
+
finish(stopCode ?? 127);
|
|
187
|
+
else
|
|
188
|
+
stop(127, 'error', error.message);
|
|
189
|
+
});
|
|
190
|
+
child.once('exit', () => {
|
|
191
|
+
if (settled) {
|
|
192
|
+
// An emergency bound may settle before process exit is confirmed.
|
|
193
|
+
try {
|
|
194
|
+
rmSync(directory, { recursive: true, force: true });
|
|
195
|
+
}
|
|
196
|
+
catch { /* Already reported unconfirmed cleanup. */ }
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
clearTimeout(deadline);
|
|
200
|
+
clearTimeout(startupDeadline);
|
|
201
|
+
clearTimeout(reapDeadline);
|
|
202
|
+
if (!readResult(directory) && stopCode === undefined) {
|
|
203
|
+
stopCode = 127;
|
|
204
|
+
emit('error', 127, 'Windows installer supervisor exited without a result');
|
|
205
|
+
}
|
|
206
|
+
reapDeadline = setTimeout(() => {
|
|
207
|
+
emit('cleanup-error', stopCode ?? 127, 'Windows supervisor exited but installer streams did not close; cleanup is unconfirmed');
|
|
208
|
+
finish(stopCode ?? 127);
|
|
209
|
+
}, 2000);
|
|
210
|
+
});
|
|
211
|
+
child.once('close', () => {
|
|
212
|
+
if (settled)
|
|
213
|
+
return;
|
|
214
|
+
pollReady();
|
|
215
|
+
const result = readResult(directory);
|
|
216
|
+
if (!result || !result.cleanupConfirmed) {
|
|
217
|
+
if (!emergency)
|
|
218
|
+
emit('cleanup-error', stopCode ?? 127, result?.error || 'Windows supervisor exited without confirming installer job cleanup');
|
|
219
|
+
finish(stopCode ?? 127);
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
if (result.error)
|
|
223
|
+
emit('error', result.code, result.error);
|
|
224
|
+
finish(stopCode ?? (emergency ? 127 : result.code));
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
process.on('SIGINT', onInterrupt);
|
|
228
|
+
process.on('SIGTERM', onTerminate);
|
|
229
|
+
process.on('SIGHUP', onHangup);
|
|
230
|
+
options.signal?.addEventListener('abort', onAbort, { once: true });
|
|
231
|
+
statusPoll = setInterval(pollReady, 50);
|
|
232
|
+
deadline = setTimeout(() => stop(124, 'timeout'), timeoutMs);
|
|
233
|
+
startupDeadline = setTimeout(() => stop(127, 'error', 'Windows installer supervisor did not establish job ownership within 30 seconds'), 30000);
|
|
234
|
+
if (options.signal?.aborted)
|
|
235
|
+
onAbort();
|
|
236
|
+
});
|
|
237
|
+
}
|
package/locale/en.json
ADDED