@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
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
// Private installer ownership. JOB_LIST requires Windows 10 / Server 2016.
|
|
2
|
+
// Assignment failures fail closed before the suspended installer can execute.
|
|
3
|
+
// https://learn.microsoft.com/windows/win32/procthread/nested-jobs
|
|
4
|
+
// https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-updateprocthreadattribute
|
|
5
|
+
using System;
|
|
6
|
+
using System.ComponentModel;
|
|
7
|
+
using System.Diagnostics;
|
|
8
|
+
using System.IO;
|
|
9
|
+
using System.Runtime.InteropServices;
|
|
10
|
+
using System.Text;
|
|
11
|
+
using System.Threading;
|
|
12
|
+
|
|
13
|
+
public static class DshInstallerJob
|
|
14
|
+
{
|
|
15
|
+
public sealed class Result
|
|
16
|
+
{
|
|
17
|
+
public int code = 127;
|
|
18
|
+
public bool cleanupConfirmed = true;
|
|
19
|
+
public string error;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
23
|
+
struct BasicLimits
|
|
24
|
+
{
|
|
25
|
+
public long ProcessTime, JobTime;
|
|
26
|
+
public uint Flags;
|
|
27
|
+
public UIntPtr MinWorkingSet, MaxWorkingSet;
|
|
28
|
+
public uint ActiveProcessLimit;
|
|
29
|
+
public UIntPtr Affinity;
|
|
30
|
+
public uint PriorityClass, SchedulingClass;
|
|
31
|
+
}
|
|
32
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
33
|
+
struct IoCounters
|
|
34
|
+
{
|
|
35
|
+
public ulong ReadOperations, WriteOperations, OtherOperations;
|
|
36
|
+
public ulong ReadBytes, WriteBytes, OtherBytes;
|
|
37
|
+
}
|
|
38
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
39
|
+
struct ExtendedLimits
|
|
40
|
+
{
|
|
41
|
+
public BasicLimits Basic;
|
|
42
|
+
public IoCounters Io;
|
|
43
|
+
public UIntPtr ProcessMemory, JobMemory, PeakProcessMemory, PeakJobMemory;
|
|
44
|
+
}
|
|
45
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
46
|
+
struct Accounting
|
|
47
|
+
{
|
|
48
|
+
public long UserTime, KernelTime, PeriodUserTime, PeriodKernelTime;
|
|
49
|
+
public uint PageFaults, TotalProcesses, ActiveProcesses, TerminatedProcesses;
|
|
50
|
+
}
|
|
51
|
+
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
|
52
|
+
struct StartupInfo
|
|
53
|
+
{
|
|
54
|
+
public uint Size;
|
|
55
|
+
public string Reserved, Desktop, Title;
|
|
56
|
+
public uint X, Y, XSize, YSize, XChars, YChars, Fill, Flags;
|
|
57
|
+
public ushort ShowWindow, ReservedBytes;
|
|
58
|
+
public IntPtr ReservedData, Stdin, Stdout, Stderr;
|
|
59
|
+
}
|
|
60
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
61
|
+
struct StartupInfoEx
|
|
62
|
+
{
|
|
63
|
+
public StartupInfo Startup;
|
|
64
|
+
public IntPtr Attributes;
|
|
65
|
+
}
|
|
66
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
67
|
+
struct ProcessInfo
|
|
68
|
+
{
|
|
69
|
+
public IntPtr Process, Thread;
|
|
70
|
+
public uint Pid, Tid;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
|
|
74
|
+
static extern IntPtr CreateJobObjectW(IntPtr attributes, string name);
|
|
75
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
76
|
+
static extern bool SetInformationJobObject(IntPtr job, int kind, ref ExtendedLimits limits, uint size);
|
|
77
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
78
|
+
static extern bool QueryInformationJobObject(IntPtr job, int kind, out Accounting info, uint size, IntPtr length);
|
|
79
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
80
|
+
static extern bool InitializeProcThreadAttributeList(IntPtr list, int count, uint flags, ref UIntPtr size);
|
|
81
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
82
|
+
static extern bool UpdateProcThreadAttribute(IntPtr list, uint flags, UIntPtr attribute,
|
|
83
|
+
IntPtr value, UIntPtr size, IntPtr previous, IntPtr returnedSize);
|
|
84
|
+
[DllImport("kernel32.dll")]
|
|
85
|
+
static extern void DeleteProcThreadAttributeList(IntPtr list);
|
|
86
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
87
|
+
static extern bool GetHandleInformation(IntPtr handle, out uint flags);
|
|
88
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
89
|
+
static extern bool GetProcessTimes(IntPtr process, out long created, out long exited, out long kernel, out long user);
|
|
90
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
91
|
+
static extern bool IsProcessInJob(IntPtr process, IntPtr job, out bool member);
|
|
92
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
93
|
+
static extern bool TerminateJobObject(IntPtr job, uint code);
|
|
94
|
+
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
|
|
95
|
+
static extern bool CreateProcessW(string application, StringBuilder command, IntPtr processAttributes,
|
|
96
|
+
IntPtr threadAttributes, bool inherit, uint flags, IntPtr environment, string directory,
|
|
97
|
+
ref StartupInfoEx startup, out ProcessInfo process);
|
|
98
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
99
|
+
static extern uint ResumeThread(IntPtr thread);
|
|
100
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
101
|
+
static extern uint WaitForSingleObject(IntPtr handle, uint milliseconds);
|
|
102
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
103
|
+
static extern bool GetExitCodeProcess(IntPtr process, out uint code);
|
|
104
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
105
|
+
static extern bool TerminateProcess(IntPtr process, uint code);
|
|
106
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
107
|
+
static extern IntPtr OpenProcess(uint access, bool inherit, uint pid);
|
|
108
|
+
[DllImport("kernel32.dll")]
|
|
109
|
+
static extern IntPtr GetCurrentProcess();
|
|
110
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
111
|
+
static extern IntPtr GetStdHandle(int which);
|
|
112
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
113
|
+
static extern bool DuplicateHandle(IntPtr sourceProcess, IntPtr source, IntPtr targetProcess,
|
|
114
|
+
out IntPtr target, uint access, bool inherit, uint options);
|
|
115
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
116
|
+
static extern bool CloseHandle(IntPtr handle);
|
|
117
|
+
|
|
118
|
+
static void Check(bool success, string operation)
|
|
119
|
+
{
|
|
120
|
+
if (!success)
|
|
121
|
+
{
|
|
122
|
+
int code = Marshal.GetLastWin32Error();
|
|
123
|
+
throw new Win32Exception(code, operation + " failed (Win32 " + code + "): " + new Win32Exception(code).Message);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
static bool Exited(IntPtr process)
|
|
127
|
+
{
|
|
128
|
+
uint result = WaitForSingleObject(process, 0);
|
|
129
|
+
if (result == 0) return true;
|
|
130
|
+
if (result == 258) return false;
|
|
131
|
+
throw new Win32Exception(Marshal.GetLastWin32Error(), "WaitForSingleObject");
|
|
132
|
+
}
|
|
133
|
+
static uint Active(IntPtr job)
|
|
134
|
+
{
|
|
135
|
+
Accounting info;
|
|
136
|
+
Check(QueryInformationJobObject(job, 1, out info, (uint)Marshal.SizeOf(typeof(Accounting)), IntPtr.Zero),
|
|
137
|
+
"QueryInformationJobObject");
|
|
138
|
+
return info.ActiveProcesses;
|
|
139
|
+
}
|
|
140
|
+
static bool Drain(IntPtr job)
|
|
141
|
+
{
|
|
142
|
+
Stopwatch clock = Stopwatch.StartNew();
|
|
143
|
+
do
|
|
144
|
+
{
|
|
145
|
+
if (Active(job) == 0) return true;
|
|
146
|
+
Thread.Sleep(20);
|
|
147
|
+
} while (clock.ElapsedMilliseconds < 5000);
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
static IntPtr StandardHandle(int which)
|
|
151
|
+
{
|
|
152
|
+
IntPtr source = GetStdHandle(which);
|
|
153
|
+
if (source == IntPtr.Zero || source == new IntPtr(-1))
|
|
154
|
+
throw new InvalidOperationException("Missing inherited installer standard handle " + which);
|
|
155
|
+
IntPtr copy;
|
|
156
|
+
Check(DuplicateHandle(GetCurrentProcess(), source, GetCurrentProcess(), out copy, 0, true, 2),
|
|
157
|
+
"DuplicateHandle(standard stream)");
|
|
158
|
+
return copy;
|
|
159
|
+
}
|
|
160
|
+
static void Close(IntPtr handle)
|
|
161
|
+
{
|
|
162
|
+
if (handle != IntPtr.Zero && handle != new IntPtr(-1)) CloseHandle(handle);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
public static Result Run(string application, string commandLine, string directory, uint parentPid, long parentNotAfterMs)
|
|
166
|
+
{
|
|
167
|
+
Result result = new Result();
|
|
168
|
+
IntPtr parent = IntPtr.Zero, job = IntPtr.Zero;
|
|
169
|
+
ProcessInfo child = new ProcessInfo();
|
|
170
|
+
StartupInfoEx startup = new StartupInfoEx();
|
|
171
|
+
IntPtr handleList = IntPtr.Zero, jobList = IntPtr.Zero;
|
|
172
|
+
bool attributesInitialized = false;
|
|
173
|
+
bool assigned = false;
|
|
174
|
+
try
|
|
175
|
+
{
|
|
176
|
+
// Pin identity once, before launching anything. No PID lookup is used to
|
|
177
|
+
// terminate an installer or to rediscover descendants after root exit.
|
|
178
|
+
parent = OpenProcess(0x00101000, false, parentPid); // SYNCHRONIZE | QUERY_LIMITED_INFORMATION
|
|
179
|
+
Check(parent != IntPtr.Zero, "OpenProcess(installer owner)");
|
|
180
|
+
if (Exited(parent)) throw new InvalidOperationException("Installer owner has exited");
|
|
181
|
+
long created, exited, kernel, user;
|
|
182
|
+
Check(GetProcessTimes(parent, out created, out exited, out kernel, out user), "GetProcessTimes(installer owner)");
|
|
183
|
+
if (created / 10000 - 11644473600000L > parentNotAfterMs)
|
|
184
|
+
throw new InvalidOperationException("Installer owner PID was reused before supervisor startup");
|
|
185
|
+
job = CreateJobObjectW(IntPtr.Zero, null); // unnamed and non-inheritable
|
|
186
|
+
Check(job != IntPtr.Zero, "CreateJobObject");
|
|
187
|
+
uint handleFlags;
|
|
188
|
+
Check(GetHandleInformation(job, out handleFlags), "GetHandleInformation(job)");
|
|
189
|
+
if ((handleFlags & 1) != 0) throw new InvalidOperationException("Installer job handle must not be inheritable");
|
|
190
|
+
ExtendedLimits limits = new ExtendedLimits();
|
|
191
|
+
limits.Basic.Flags = 0x00002000; // KILL_ON_JOB_CLOSE; NEVER allow breakaway
|
|
192
|
+
Check(SetInformationJobObject(job, 9, ref limits, (uint)Marshal.SizeOf(typeof(ExtendedLimits))),
|
|
193
|
+
"SetInformationJobObject(KILL_ON_JOB_CLOSE)");
|
|
194
|
+
if (File.Exists(Path.Combine(directory, "cancel"))) { result.code = 130; return result; }
|
|
195
|
+
startup.Startup.Size = (uint)Marshal.SizeOf(typeof(StartupInfoEx));
|
|
196
|
+
startup.Startup.Flags = 0x00000100; // STARTF_USESTDHANDLES
|
|
197
|
+
startup.Startup.Stdin = StandardHandle(-10);
|
|
198
|
+
startup.Startup.Stdout = StandardHandle(-11);
|
|
199
|
+
startup.Startup.Stderr = StandardHandle(-12);
|
|
200
|
+
UIntPtr attributeBytes = UIntPtr.Zero;
|
|
201
|
+
InitializeProcThreadAttributeList(IntPtr.Zero, 2, 0, ref attributeBytes);
|
|
202
|
+
startup.Attributes = Marshal.AllocHGlobal(checked((int)attributeBytes.ToUInt64()));
|
|
203
|
+
Check(InitializeProcThreadAttributeList(startup.Attributes, 2, 0, ref attributeBytes),
|
|
204
|
+
"InitializeProcThreadAttributeList");
|
|
205
|
+
attributesInitialized = true;
|
|
206
|
+
handleList = Marshal.AllocHGlobal(IntPtr.Size * 3);
|
|
207
|
+
Marshal.WriteIntPtr(handleList, 0, startup.Startup.Stdin);
|
|
208
|
+
Marshal.WriteIntPtr(handleList, IntPtr.Size, startup.Startup.Stdout);
|
|
209
|
+
Marshal.WriteIntPtr(handleList, IntPtr.Size * 2, startup.Startup.Stderr);
|
|
210
|
+
Check(UpdateProcThreadAttribute(startup.Attributes, 0, new UIntPtr(0x00020002), handleList,
|
|
211
|
+
new UIntPtr((uint)(IntPtr.Size * 3)), IntPtr.Zero, IntPtr.Zero), "UpdateProcThreadAttribute(HANDLE_LIST)");
|
|
212
|
+
jobList = Marshal.AllocHGlobal(IntPtr.Size);
|
|
213
|
+
Marshal.WriteIntPtr(jobList, job);
|
|
214
|
+
Check(UpdateProcThreadAttribute(startup.Attributes, 0, new UIntPtr(0x0002000d), jobList,
|
|
215
|
+
new UIntPtr((uint)IntPtr.Size), IntPtr.Zero, IntPtr.Zero), "UpdateProcThreadAttribute(JOB_LIST)");
|
|
216
|
+
// Atomically assign during creation: killing the supervisor between
|
|
217
|
+
// CreateProcess and a separate AssignProcessToJobObject must not leak an
|
|
218
|
+
// unowned suspended installer. No breakaway or unowned fallback exists.
|
|
219
|
+
Check(CreateProcessW(String.IsNullOrEmpty(application) ? null : application,
|
|
220
|
+
new StringBuilder(commandLine), IntPtr.Zero, IntPtr.Zero, true,
|
|
221
|
+
0x00080004, IntPtr.Zero, null, ref startup, out child), "CreateProcess(CREATE_SUSPENDED, JOB_LIST)");
|
|
222
|
+
result.cleanupConfirmed = false;
|
|
223
|
+
assigned = true;
|
|
224
|
+
bool member;
|
|
225
|
+
Check(IsProcessInJob(child.Process, job, out member), "IsProcessInJob");
|
|
226
|
+
if (!member) throw new InvalidOperationException("Installer job membership could not be verified");
|
|
227
|
+
// Recheck cancellation/parent while the installer still cannot execute.
|
|
228
|
+
if (Exited(parent) || File.Exists(Path.Combine(directory, "cancel")))
|
|
229
|
+
{
|
|
230
|
+
result.code = 130;
|
|
231
|
+
Check(TerminateJobObject(job, 130), "TerminateJobObject");
|
|
232
|
+
result.cleanupConfirmed = Drain(job);
|
|
233
|
+
return result;
|
|
234
|
+
}
|
|
235
|
+
Check(ResumeThread(child.Thread) != 0xffffffff, "ResumeThread");
|
|
236
|
+
Close(child.Thread);
|
|
237
|
+
child.Thread = IntPtr.Zero;
|
|
238
|
+
File.WriteAllText(Path.Combine(directory, "ready.tmp"), "{\"pid\":" + child.Pid + ",\"member\":true,\"inheritable\":false}", Encoding.ASCII);
|
|
239
|
+
File.Move(Path.Combine(directory, "ready.tmp"), Path.Combine(directory, "ready"));
|
|
240
|
+
while (true)
|
|
241
|
+
{
|
|
242
|
+
if (File.Exists(Path.Combine(directory, "cancel")) || Exited(parent))
|
|
243
|
+
{
|
|
244
|
+
result.code = 130;
|
|
245
|
+
Check(TerminateJobObject(job, 130), "TerminateJobObject");
|
|
246
|
+
result.cleanupConfirmed = Drain(job);
|
|
247
|
+
if (!result.cleanupConfirmed) result.error = "Installer job did not empty after termination";
|
|
248
|
+
return result;
|
|
249
|
+
}
|
|
250
|
+
if (Active(job) == 0)
|
|
251
|
+
{
|
|
252
|
+
if (WaitForSingleObject(child.Process, 5000) != 0)
|
|
253
|
+
throw new InvalidOperationException("Empty installer job did not signal root exit");
|
|
254
|
+
uint code;
|
|
255
|
+
Check(GetExitCodeProcess(child.Process, out code), "GetExitCodeProcess");
|
|
256
|
+
result.code = unchecked((int)code);
|
|
257
|
+
result.cleanupConfirmed = true;
|
|
258
|
+
return result;
|
|
259
|
+
}
|
|
260
|
+
Thread.Sleep(25);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
catch (Exception error)
|
|
264
|
+
{
|
|
265
|
+
result.code = 127;
|
|
266
|
+
result.error = error.Message;
|
|
267
|
+
try
|
|
268
|
+
{
|
|
269
|
+
if (job != IntPtr.Zero)
|
|
270
|
+
{
|
|
271
|
+
// Even a failed atomic assignment can briefly leave a terminating
|
|
272
|
+
// process in job accounting. Confirm zero instead of assuming it.
|
|
273
|
+
Check(TerminateJobObject(job, 127), "TerminateJobObject after failure");
|
|
274
|
+
result.cleanupConfirmed = Drain(job);
|
|
275
|
+
}
|
|
276
|
+
if (!assigned && child.Process != IntPtr.Zero)
|
|
277
|
+
{
|
|
278
|
+
// Still suspended and never assigned: terminate only the retained
|
|
279
|
+
// process handle, even when assignment failed under an outer job.
|
|
280
|
+
if (!Exited(child.Process)) Check(TerminateProcess(child.Process, 127), "TerminateProcess(suspended root)");
|
|
281
|
+
bool rootStopped = WaitForSingleObject(child.Process, 5000) == 0;
|
|
282
|
+
result.cleanupConfirmed = result.cleanupConfirmed && rootStopped;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
catch (Exception cleanupError)
|
|
286
|
+
{
|
|
287
|
+
result.cleanupConfirmed = false;
|
|
288
|
+
result.error += "; cleanup: " + cleanupError.Message;
|
|
289
|
+
}
|
|
290
|
+
return result;
|
|
291
|
+
}
|
|
292
|
+
finally
|
|
293
|
+
{
|
|
294
|
+
// Closing the sole job handle is a fail-safe even if confirmation failed.
|
|
295
|
+
Close(job);
|
|
296
|
+
Close(child.Thread);
|
|
297
|
+
Close(child.Process);
|
|
298
|
+
if (attributesInitialized) DeleteProcThreadAttributeList(startup.Attributes);
|
|
299
|
+
if (startup.Attributes != IntPtr.Zero) Marshal.FreeHGlobal(startup.Attributes);
|
|
300
|
+
if (handleList != IntPtr.Zero) Marshal.FreeHGlobal(handleList);
|
|
301
|
+
if (jobList != IntPtr.Zero) Marshal.FreeHGlobal(jobList);
|
|
302
|
+
Close(startup.Startup.Stdin);
|
|
303
|
+
Close(startup.Startup.Stdout);
|
|
304
|
+
Close(startup.Startup.Stderr);
|
|
305
|
+
Close(parent);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
param([Parameter(Mandatory = $true)][string]$ControlDirectory)
|
|
2
|
+
$ErrorActionPreference = 'Stop'
|
|
3
|
+
$nativeStarted = $false
|
|
4
|
+
# No pipeline or Read-Host: installer stdin belongs exclusively to the child.
|
|
5
|
+
try {
|
|
6
|
+
$config = [IO.File]::ReadAllText((Join-Path $ControlDirectory 'config.json')) | ConvertFrom-Json
|
|
7
|
+
Add-Type -Path (Join-Path $PSScriptRoot 'windows-installer.cs')
|
|
8
|
+
$nativeStarted = $true
|
|
9
|
+
$result = [DshInstallerJob]::Run([string]$config.application, [string]$config.commandLine,
|
|
10
|
+
$ControlDirectory, [uint32]$config.parentPid, [long]$config.parentNotAfterMs)
|
|
11
|
+
} catch {
|
|
12
|
+
$result = @{ code = 127; cleanupConfirmed = (-not $nativeStarted); error = $_.Exception.Message }
|
|
13
|
+
}
|
|
14
|
+
$json = $result | ConvertTo-Json -Compress
|
|
15
|
+
[IO.File]::WriteAllText((Join-Path $ControlDirectory 'result.tmp'), $json, [Text.UTF8Encoding]::new($false))
|
|
16
|
+
[IO.File]::Move((Join-Path $ControlDirectory 'result.tmp'), (Join-Path $ControlDirectory 'result.json'))
|
|
17
|
+
exit 0
|
package/bin/dsh-tui.js
CHANGED
|
@@ -172,8 +172,38 @@ const isVersionNewer = (a, b) => {
|
|
|
172
172
|
return false
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
// The migrated launcher is a single file, so this conservative evaluator has
|
|
176
|
+
// no package dependencies. Only stable positive-major caret / lower-bound OR
|
|
177
|
+
// ranges are recognized. Unknown manifests or syntax must never block launch.
|
|
178
|
+
const supportsNode = (version, range) => {
|
|
179
|
+
const current = parseVersion(version)
|
|
180
|
+
if (!current || typeof range !== 'string') return undefined
|
|
181
|
+
const alternatives = range.split('||').map(part => /^(\^|>=)([1-9]\d*)(?:\.(\d+))?(?:\.(\d+))?$/.exec(part.trim()))
|
|
182
|
+
if (alternatives.some(part => !part || (part[1] === '^' && part[3] === undefined))) return undefined
|
|
183
|
+
// Stable engine ranges exclude prereleases, including a future major's RC.
|
|
184
|
+
if (current.pre !== null) return false
|
|
185
|
+
return alternatives.some(part => {
|
|
186
|
+
const [, operator, major, minor = '0', patch = '0'] = part
|
|
187
|
+
const floor = [Number(major), Number(minor), Number(patch)]
|
|
188
|
+
const actual = [current.major, current.minor, current.patch]
|
|
189
|
+
const firstDifference = actual.findIndex((value, i) => value !== floor[i])
|
|
190
|
+
const atLeast = firstDifference < 0 || actual[firstDifference] > floor[firstDifference]
|
|
191
|
+
return atLeast && (operator !== '^' || current.major === floor[0])
|
|
192
|
+
})
|
|
193
|
+
}
|
|
194
|
+
const nodeRange = ownPackage?.name === PACKAGE ? ownPackage.engines?.node : undefined
|
|
195
|
+
const nodeSupported = supportsNode(process.versions.node, nodeRange)
|
|
196
|
+
|
|
175
197
|
const lang = process.env.DSH_TUI_LANG === 'en' ? 'en' : 'zh'
|
|
176
198
|
const MSG = {
|
|
199
|
+
nodeUnsupported: {
|
|
200
|
+
en: `[dsh-tui] Node ${process.version} is unsupported (required: ${nodeRange}). Install a supported Node release from https://nodejs.org/en/download and reopen this terminal.`,
|
|
201
|
+
zh: `[dsh-tui] Node ${process.version} 不受支持(要求:${nodeRange})。请从 https://nodejs.org/en/download 安装受支持的 Node 并重新打开终端。`,
|
|
202
|
+
},
|
|
203
|
+
nodeUnknown: {
|
|
204
|
+
en: `[dsh-tui] Cannot determine Node ${process.version} compatibility: package engines.node is missing or unrecognized (${nodeRange ?? 'unknown'}).`,
|
|
205
|
+
zh: `[dsh-tui] 无法判断 Node ${process.version} 兼容性:包 engines.node 缺失或无法识别(${nodeRange ?? 'unknown'})。`,
|
|
206
|
+
},
|
|
177
207
|
noDsh: {
|
|
178
208
|
en: '[dsh-tui] dsh CLI not found. Install the official client first:\n npm install -g @deepseek-ai/dsh',
|
|
179
209
|
zh: '[dsh-tui] 未检测到 dsh CLI。请先安装官方客户端:\n npm install -g @deepseek-ai/dsh',
|
|
@@ -490,6 +520,9 @@ const MSG = {
|
|
|
490
520
|
en:
|
|
491
521
|
`Usage: dsh-tui|dst [command] [options] [path|url]\n\n` +
|
|
492
522
|
`Commands:\n` +
|
|
523
|
+
` run / -p Run one non-interactive DSH task (dst cli --help)\n` +
|
|
524
|
+
` cli <command> Independent automation CLI and management commands\n` +
|
|
525
|
+
` dsh <argv...> Forward native DSH arguments unchanged\n` +
|
|
493
526
|
` update Update the ${PROFILE} profile to the latest release\n` +
|
|
494
527
|
` migrate [agent] Import conversations from claude-code/codex/omp/zcode/grok-build (--dry-run to preview)\n` +
|
|
495
528
|
` doctor Pre-flight environment checks (dsh/pnpm/profile/key)\n` +
|
|
@@ -509,6 +542,9 @@ const MSG = {
|
|
|
509
542
|
zh:
|
|
510
543
|
`用法:dsh-tui|dst [命令] [选项] [路径|URL]\n\n` +
|
|
511
544
|
`命令:\n` +
|
|
545
|
+
` run / -p 无界面运行单个 DSH 任务(dst cli --help)\n` +
|
|
546
|
+
` cli <命令> 独立自动化 CLI 与管理命令\n` +
|
|
547
|
+
` dsh <参数...> 原样转交官方 DSH CLI\n` +
|
|
512
548
|
` update 将 ${PROFILE} profile 升级到最新版本\n` +
|
|
513
549
|
` migrate [agent] 迁移 claude-code/codex/omp/zcode/grok-build 的对话(--dry-run 预览)\n` +
|
|
514
550
|
` doctor 启动前环境诊断(dsh/pnpm/profile/密钥)\n` +
|
|
@@ -529,9 +565,9 @@ const MSG = {
|
|
|
529
565
|
}
|
|
530
566
|
const msg = key => MSG[key][lang]
|
|
531
567
|
|
|
532
|
-
//
|
|
533
|
-
//
|
|
534
|
-
process.env.NODE_ENV
|
|
568
|
+
// 与包入口的 force-production-react 保持一致:工作区 NODE_ENV 不能启用
|
|
569
|
+
// React 开发构建的无界渲染插桩,调试须显式设置 DSH_TUI_REACT_DEV=1。
|
|
570
|
+
process.env.NODE_ENV = process.env.DSH_TUI_REACT_DEV === '1' ? 'development' : 'production'
|
|
535
571
|
|
|
536
572
|
const sameDir = (a, b) => {
|
|
537
573
|
try {
|
|
@@ -595,6 +631,26 @@ if (subcommand === 'help' || subcommand === '--help' || subcommand === '-h') {
|
|
|
595
631
|
console.log(msg('helpText'))
|
|
596
632
|
process.exit(0)
|
|
597
633
|
}
|
|
634
|
+
// Help/version stay readable. Unknown engines in migrated/profile manifests
|
|
635
|
+
// are allowed; doctor exposes the uncertainty without breaking delegation.
|
|
636
|
+
if (subcommand !== 'doctor' && nodeSupported === false) {
|
|
637
|
+
console.error(msg('nodeUnsupported'))
|
|
638
|
+
process.exit(1)
|
|
639
|
+
}
|
|
640
|
+
// CLI is a separate, uncompiled application. Never bootstrap/render the TUI for
|
|
641
|
+
// automation. A migrated single-file launcher prefers the updated profile copy.
|
|
642
|
+
const cliInvocation = ['cli', 'run', '-p', '--print', 'session', 'models', 'skills', 'mcp', 'auth', 'capabilities', 'dsh'].includes(subcommand)
|
|
643
|
+
if (cliInvocation) {
|
|
644
|
+
const profileEntry = join(profilePkgDir, 'cli', 'entry.mjs')
|
|
645
|
+
const ownEntry = join(ownDir, 'cli', 'entry.mjs')
|
|
646
|
+
const entry = existsSync(profileEntry) ? profileEntry : ownEntry
|
|
647
|
+
if (!existsSync(entry)) {
|
|
648
|
+
console.error('[dsh-tui] CLI_ENTRY_MISSING: update the profile or reinstall the package; no task was started.')
|
|
649
|
+
process.exit(3)
|
|
650
|
+
}
|
|
651
|
+
const { main } = await import(pathToFileURL(entry).href)
|
|
652
|
+
process.exit(await main(process.argv.slice(2)))
|
|
653
|
+
}
|
|
598
654
|
/**
|
|
599
655
|
* The credential documents a read may consult, most authoritative first: the
|
|
600
656
|
* active home's store, then the default `~/.dsh` store. A `DSH_HOME` override
|
|
@@ -645,7 +701,10 @@ const runDoctorChecks = () => {
|
|
|
645
701
|
let hardFailure = false
|
|
646
702
|
const report = (ok, label, detail) => lines.push(`${ok ? '✓' : '✗'} ${label}: ${detail}`)
|
|
647
703
|
lines.push(`dsh-tui doctor · ${PACKAGE} ${ownVersion ?? 'unknown'}`)
|
|
648
|
-
report(true, 'node',
|
|
704
|
+
report(nodeSupported === true, 'node', nodeSupported === true
|
|
705
|
+
? `${process.version} · ${process.platform} ${process.arch}`
|
|
706
|
+
: msg(nodeSupported === false ? 'nodeUnsupported' : 'nodeUnknown'))
|
|
707
|
+
if (nodeSupported !== true) hardFailure = true
|
|
649
708
|
const probeVersion = command => {
|
|
650
709
|
const probe = spawnSync(...cmd(command, ['--version']), { stdio: 'pipe', encoding: 'utf8', ...shellOpt })
|
|
651
710
|
if (probe.error || probe.status !== 0) return undefined
|
|
@@ -765,7 +824,7 @@ const renderSafeReport = extraLines => {
|
|
|
765
824
|
// 启动前环境诊断——针对「TUI 起不来」的故障域(装不上、update 后版本不
|
|
766
825
|
// 同步、密钥没配),与 TUI 内 /doctor 的会话内诊断互补。零 lib 依赖、
|
|
767
826
|
// 不委托、不自举:profile 残缺时它必须还能跑。密钥红线:只报告是否已
|
|
768
|
-
//
|
|
827
|
+
// 设置,绝不输出值。Node 不兼容/无法判断或 dsh 缺失记为硬失败(其余检查照常打印后再
|
|
769
828
|
// 以退出码 1 收束)。
|
|
770
829
|
if (subcommand === 'doctor') {
|
|
771
830
|
const { hardFailure, lines } = runDoctorChecks()
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/** Official headless subprocess adapter. This directory alone owns DSH details. */
|
|
2
|
+
import { mkdtemp, writeFile, rm } from 'node:fs/promises'
|
|
3
|
+
import { constants as osConstants, tmpdir } from 'node:os'
|
|
4
|
+
import { join } from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
import { CliError } from '../../protocol.mjs'
|
|
7
|
+
import { startProcess, records, parseRecord } from '../../process.mjs'
|
|
8
|
+
import { locateDsh } from './locate.mjs'
|
|
9
|
+
|
|
10
|
+
const manager = fileURLToPath(new URL('./management-plugin.mjs', import.meta.url))
|
|
11
|
+
const validated = new Set(['0.2.0-rc.2', '0.2.1-rc.2', '0.2.1-rc.3'])
|
|
12
|
+
const allowedEvents = new Set(['session', 'status', 'text', 'thinking', 'tool_call', 'tool_result', 'error', 'final'])
|
|
13
|
+
|
|
14
|
+
function requireContract(runtime) {
|
|
15
|
+
// A new version is not proof of wire compatibility. Passthrough is ungated.
|
|
16
|
+
if (!validated.has(runtime.version)) throw new CliError('ADAPTER_UNAVAILABLE', `This adapter validates DSH ${[...validated].join(' or ')}; use dst dsh for another runtime`, 3)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Create the default adapter; host/process facilities are injectable in tests. */
|
|
20
|
+
export function createDshAdapter({ locate = locateDsh, start = startProcess, diagnostic = () => {} } = {}) {
|
|
21
|
+
async function* perform(request, { signal }) {
|
|
22
|
+
const runtime = locate(request)
|
|
23
|
+
requireContract(runtime)
|
|
24
|
+
signal.throwIfAborted()
|
|
25
|
+
let directory
|
|
26
|
+
let processRun
|
|
27
|
+
let pendingFailure
|
|
28
|
+
let completed = false
|
|
29
|
+
try {
|
|
30
|
+
directory = await mkdtemp(join(tmpdir(), 'dst-cli-'))
|
|
31
|
+
const patches = []
|
|
32
|
+
if (request.kind !== 'run') {
|
|
33
|
+
patches.push({ id: 'headless-startup', disabled: true }, { id: 'headless-runner', disabled: true })
|
|
34
|
+
patches.push({ insert: [{ id: 'dst-cli-management', name: manager, config: { request } }] })
|
|
35
|
+
} else if (request.model) {
|
|
36
|
+
patches.push({ id: 'agent-default-model', config: { provider: request.provider, model: request.model } })
|
|
37
|
+
}
|
|
38
|
+
const overlay = join(directory, 'cli.patch.json')
|
|
39
|
+
await writeFile(overlay, JSON.stringify(patches), { mode: 0o600 })
|
|
40
|
+
const args = [runtime.path, '--profile', request.profile]
|
|
41
|
+
for (const patch of request.patches) args.push('--patch', patch)
|
|
42
|
+
args.push('--patch', overlay, '--')
|
|
43
|
+
if (request.kind === 'run') {
|
|
44
|
+
args.push('--json')
|
|
45
|
+
if (request.sessionId) args.push('--session-id', request.sessionId)
|
|
46
|
+
args.push('-') // Prompt travels through stdin, never a command or process argv.
|
|
47
|
+
}
|
|
48
|
+
const env = { ...process.env }
|
|
49
|
+
if (request.permission) env.DSH_PERMISSION_MODE = request.permission
|
|
50
|
+
processRun = start({ command: process.execPath, args, cwd: request.cwd, env, input: request.kind === 'run' ? request.prompt : '' }, signal, diagnostic)
|
|
51
|
+
for await (const line of records(processRun.child.stdout)) {
|
|
52
|
+
const event = parseRecord(line)
|
|
53
|
+
if (request.kind === 'run') {
|
|
54
|
+
if (!allowedEvents.has(event.type)) throw new CliError('PROTOCOL_ERROR', 'Unsupported DSH headless event; adapter update required', 4)
|
|
55
|
+
} else if (event.schemaVersion !== 1 || !['final', 'error'].includes(event.type)) {
|
|
56
|
+
throw new CliError('PROTOCOL_ERROR', 'Management plugin protocol mismatch', 4)
|
|
57
|
+
}
|
|
58
|
+
if (event.type === 'status' && event.phase === 'turn_end') completed = event.reason?.kind === 'completed'
|
|
59
|
+
if (event.type === 'error') {
|
|
60
|
+
const code = ['SESSION_NOT_FOUND', 'PROVIDER_NOT_FOUND', 'CAPABILITY_UNAVAILABLE'].includes(event.code) ? event.code : 'TASK_FAILED'
|
|
61
|
+
pendingFailure = new CliError(code, 'DSH could not complete the requested operation', code === 'TASK_FAILED' ? 1 : 3)
|
|
62
|
+
yield { type: 'error', code, message: pendingFailure.message }
|
|
63
|
+
} else if (event.type === 'final') yield { ...event, ok: request.kind !== 'run' || completed }
|
|
64
|
+
else yield event
|
|
65
|
+
}
|
|
66
|
+
const exit = await processRun.settled
|
|
67
|
+
signal.throwIfAborted()
|
|
68
|
+
if (exit.drainFailed) throw new CliError('PROTOCOL_ERROR', 'Backend descendants did not release output pipes', 4)
|
|
69
|
+
if (exit.error) throw new CliError('ADAPTER_UNAVAILABLE', 'Unable to start the DSH process', 3)
|
|
70
|
+
if (exit.signal || exit.code !== 0) throw pendingFailure ?? new CliError('TASK_FAILED', `DSH exited unsuccessfully (${exit.code}); no operation was retried`, 1)
|
|
71
|
+
if (pendingFailure) throw pendingFailure
|
|
72
|
+
} finally {
|
|
73
|
+
if (processRun) {
|
|
74
|
+
processRun.stop()
|
|
75
|
+
await processRun.settled
|
|
76
|
+
}
|
|
77
|
+
if (directory) await rm(directory, { recursive: true, force: true })
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
id: 'dsh-headless',
|
|
82
|
+
async capabilities(request) {
|
|
83
|
+
const runtime = locate(request)
|
|
84
|
+
return {
|
|
85
|
+
adapter: 'dsh-headless', runtimeVersion: runtime.version,
|
|
86
|
+
validated: validated.has(runtime.version),
|
|
87
|
+
operations: ['run', 'session.list', 'session.show', 'session.export', 'continue', 'models.list', 'skills.list', 'mcp.status', 'auth.status', 'dsh'],
|
|
88
|
+
output: ['text', 'json', 'stream-json'],
|
|
89
|
+
limits: { inputBytes: 8 * 1024 * 1024, recordBytes: 32 * 1024 * 1024 },
|
|
90
|
+
limitations: ['committed-message-stream-not-token-stream', 'official-headless-resume-restrictions', 'profile-not-tui-preferences', 'mcp-registered-tools-not-connection-health', 'no-credential-values-or-login', 'profile-code-is-trusted'],
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
execute: perform,
|
|
94
|
+
async continueSession(request, context) {
|
|
95
|
+
let id
|
|
96
|
+
for await (const event of perform({ ...request, kind: 'session', action: 'continue' }, context)) {
|
|
97
|
+
if (event.type === 'final') id = event.data?.sessionId
|
|
98
|
+
}
|
|
99
|
+
if (typeof id !== 'string' || !id) throw new CliError('SESSION_NOT_FOUND', 'No compatible session exists in this cwd', 3)
|
|
100
|
+
return id
|
|
101
|
+
},
|
|
102
|
+
async passthrough(request, { signal }) {
|
|
103
|
+
const runtime = locate(request)
|
|
104
|
+
const processRun = start({ command: process.execPath, args: [runtime.path, ...request.args], cwd: request.cwd, env: process.env, inherit: true }, signal)
|
|
105
|
+
const exit = await processRun.settled
|
|
106
|
+
signal.throwIfAborted()
|
|
107
|
+
if (exit.error) throw new CliError('ADAPTER_UNAVAILABLE', 'Unable to start DSH', 3)
|
|
108
|
+
return exit.signal ? 128 + (osConstants.signals[exit.signal] ?? 0) : exit.code
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/** Resolve a built DSH JS bin without executing a shell or importing the TUI. */
|
|
2
|
+
import { accessSync, constants, existsSync, readFileSync, realpathSync, statSync } from 'node:fs'
|
|
3
|
+
import { basename, delimiter, dirname, join, resolve } from 'node:path'
|
|
4
|
+
import { CliError } from '../../protocol.mjs'
|
|
5
|
+
|
|
6
|
+
function fromPackage(dir) {
|
|
7
|
+
try {
|
|
8
|
+
const manifest = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8'))
|
|
9
|
+
if (manifest.name !== '@deepseek-ai/dsh') return undefined
|
|
10
|
+
const bin = typeof manifest.bin === 'string' ? manifest.bin : manifest.bin?.dsh
|
|
11
|
+
if (typeof bin !== 'string') return undefined
|
|
12
|
+
const path = resolve(dir, bin)
|
|
13
|
+
if (!existsSync(path)) return undefined
|
|
14
|
+
return { path: realpathSync(path), version: manifest.version }
|
|
15
|
+
} catch { return undefined }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function above(path) {
|
|
19
|
+
for (let dir = dirname(path); ; dir = dirname(dir)) {
|
|
20
|
+
const found = fromPackage(dir)
|
|
21
|
+
if (found) return found
|
|
22
|
+
if (dirname(dir) === dir) return undefined
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Explicit bin -> standalone install anchor -> first executable on PATH. */
|
|
27
|
+
export function locateDsh(request, env = process.env) {
|
|
28
|
+
const configured = request.dshBin ?? env.DSH_TUI_CLI_DSH_BIN
|
|
29
|
+
if (configured !== undefined) {
|
|
30
|
+
const path = resolve(request.cwd, configured)
|
|
31
|
+
if (!/\.[cm]?js$/iu.test(path) || !existsSync(path)) throw new CliError('ADAPTER_UNAVAILABLE', 'Explicit DSH bin must be an existing built JavaScript entry', 3)
|
|
32
|
+
const found = above(path)
|
|
33
|
+
if (!found) throw new CliError('ADAPTER_UNAVAILABLE', 'Explicit bin must belong to an installed @deepseek-ai/dsh package', 3)
|
|
34
|
+
return { ...found, path: realpathSync(path) }
|
|
35
|
+
}
|
|
36
|
+
if (env.DSH_TUI_CLI_INSTALL_ANCHOR) {
|
|
37
|
+
const found = fromPackage(env.DSH_TUI_CLI_INSTALL_ANCHOR)
|
|
38
|
+
if (found) return found
|
|
39
|
+
throw new CliError('ADAPTER_UNAVAILABLE', 'Standalone DSH installation is incomplete', 3)
|
|
40
|
+
}
|
|
41
|
+
const names = process.platform === 'win32' ? ['dsh.cmd', 'dsh.exe', 'dsh'] : ['dsh']
|
|
42
|
+
for (const dir of (env.PATH ?? env.Path ?? '').split(delimiter).filter(Boolean)) {
|
|
43
|
+
for (const name of names) {
|
|
44
|
+
const candidate = join(dir, name)
|
|
45
|
+
try { accessSync(candidate, process.platform === 'win32' ? constants.F_OK : constants.X_OK) } catch { continue }
|
|
46
|
+
const beside = fromPackage(join(dir, 'node_modules', '@deepseek-ai', 'dsh'))
|
|
47
|
+
if (beside) return beside
|
|
48
|
+
let real
|
|
49
|
+
try { real = realpathSync(candidate) } catch { break }
|
|
50
|
+
const direct = above(real)
|
|
51
|
+
if (direct) return direct
|
|
52
|
+
const size = statSync(real).size
|
|
53
|
+
const bytes = size < 65536 ? readFileSync(real) : Buffer.alloc(0)
|
|
54
|
+
if (size < 65536 && !bytes.subarray(0, 4096).includes(0)) {
|
|
55
|
+
const text = bytes.toString('utf8')
|
|
56
|
+
const tokens = /"([^"\r\n]+?\.[cm]?js)"|'([^'\r\n]+?\.[cm]?js)'|([^\s"'`;|&<>()]+\.[cm]?js)(?=[\s"';|&)]|$)/gmu
|
|
57
|
+
for (const match of text.matchAll(tokens)) {
|
|
58
|
+
const script = (match[1] ?? match[2] ?? match[3])
|
|
59
|
+
.replace(/^\$\{?basedir\}?/u, dirname(real))
|
|
60
|
+
.replace(/^%~dp0%?/iu, `${dirname(real)}\\`)
|
|
61
|
+
.replace(/^%dp0%/iu, dirname(real))
|
|
62
|
+
.replace(/^\$PSScriptRoot/iu, dirname(real))
|
|
63
|
+
if (/[$%]/u.test(script)) continue
|
|
64
|
+
const found = above(resolve(dirname(real), script))
|
|
65
|
+
if (found) return found
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Do not quietly launch a different installation than the first shim.
|
|
69
|
+
throw new CliError('ADAPTER_UNAVAILABLE', `Cannot resolve the first ${basename(candidate)} on PATH; use --dsh-bin`, 3)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
throw new CliError('ADAPTER_UNAVAILABLE', 'DSH was not found on PATH; install the official CLI or pass --dsh-bin', 3)
|
|
73
|
+
}
|