@deepseek-harness-tui/dsh-tui 0.16.1 → 0.18.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 +213 -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/cli.en.md +114 -0
- package/guide/dsh-tui-guide/cli.md +114 -0
- package/guide/dsh-tui-guide/configuration.en.md +7 -5
- package/guide/dsh-tui-guide/configuration.md +7 -5
- package/guide/dsh-tui-guide/getting-started.en.md +33 -3
- package/guide/dsh-tui-guide/getting-started.md +23 -2
- package/guide/dsh-tui-guide/interaction.en.md +50 -17
- package/guide/dsh-tui-guide/interaction.md +35 -13
- package/guide/dsh-tui-guide/plugins.en.md +63 -11
- package/guide/dsh-tui-guide/plugins.md +41 -7
- package/guide/dsh-tui-guide/user-guide.en.md +55 -34
- package/guide/dsh-tui-guide/user-guide.md +45 -28
- package/lib/settings.json +85 -42
- 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 +2 -1
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +4 -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 +22 -2
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +11 -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/adapter/standard/grants.d.ts +60 -0
- package/lib/types/adapter/standard/grants.d.ts.map +1 -1
- package/lib/types/adapter/standard/grants.js +74 -0
- 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 +15 -1
- 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 +14 -5
- 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 +73 -6
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +165 -17
- 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 +20 -14
- package/lib/types/components/PluginGrantList.d.ts +45 -0
- package/lib/types/components/PluginGrantList.d.ts.map +1 -0
- package/lib/types/components/PluginGrantList.js +126 -0
- package/lib/types/components/PluginInstallPane.d.ts.map +1 -1
- package/lib/types/components/PluginInstallPane.js +35 -6
- package/lib/types/components/PluginManagePane.d.ts.map +1 -1
- package/lib/types/components/PluginManagePane.js +65 -8
- 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 +190 -108
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +232 -22
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +10 -0
- 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 +17 -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 +2 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +24 -11
- package/lib/types/components/onboardingModel.d.ts +2 -2
- package/lib/types/components/onboardingModel.js +3 -3
- package/lib/types/components/onboardingProviderPlan.d.ts +110 -0
- package/lib/types/components/onboardingProviderPlan.d.ts.map +1 -0
- package/lib/types/components/onboardingProviderPlan.js +78 -0
- 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/btw/BtwComposer.d.ts +7 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.js +16 -0
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +8 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +7 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +8 -1
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts +30 -0
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.js +94 -0
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
- package/lib/types/components/sidePanel/builtinPanels.js +36 -18
- 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/types.d.ts +2 -0
- package/lib/types/components/sidePanel/types.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.js +39 -7
- 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/session.d.ts +7 -1
- package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/session.js +62 -6
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +18 -4
- package/lib/types/dsh-adapter/backend-admission.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.js +3 -1
- 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 +11 -1
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +121 -113
- package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-mentions.js +38 -17
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.js +9 -5
- 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 +10 -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 +48 -3
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +5 -2
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +7 -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 +2 -2
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-actions.js +34 -0
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +5 -2
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +31 -4
- package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mentions.js +21 -7
- 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/paths.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/paths.js +11 -9
- 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-live-adoption.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.js +6 -1
- 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 +7 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +56 -36
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +3 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +3 -1
- 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 +7 -5
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +10 -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/entry-slot.d.ts +6 -0
- package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -1
- package/lib/types/dsh-adapter/experimental-bundles.d.ts +29 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -0
- package/lib/types/dsh-adapter/experimental-bundles.js +15 -0
- package/lib/types/dsh-adapter/grant-file.d.ts +70 -0
- package/lib/types/dsh-adapter/grant-file.d.ts.map +1 -0
- package/lib/types/dsh-adapter/grant-file.js +178 -0
- package/lib/types/dsh-adapter/host-access.d.ts +4 -0
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +54 -4
- 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/index.d.ts +8 -4
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +17 -12
- package/lib/types/dsh-adapter/panels.d.ts +28 -8
- 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-declaration.d.ts +28 -0
- package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-declaration.js +43 -1
- package/lib/types/dsh-adapter/plugin-install.d.ts +28 -1
- package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-install.js +160 -13
- package/lib/types/dsh-adapter/plugin-manage.d.ts +53 -10
- package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-manage.js +240 -51
- 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 +378 -84
- package/lib/types/dsh-adapter/plugins-info.d.ts +6 -7
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +99 -31
- package/lib/types/dsh-adapter/presets.d.ts +19 -6
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +69 -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/providerWizard.d.ts +2 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +11 -5
- package/lib/types/dsh-adapter/row-attachment.d.ts +30 -0
- package/lib/types/dsh-adapter/row-attachment.d.ts.map +1 -0
- package/lib/types/dsh-adapter/row-attachment.js +29 -0
- 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/dsh-adapter/worktree-tool.d.ts +27 -0
- package/lib/types/dsh-adapter/worktree-tool.d.ts.map +1 -0
- package/lib/types/dsh-adapter/worktree-tool.js +87 -0
- 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/heldInputs.d.ts +36 -0
- package/lib/types/heldInputs.d.ts.map +1 -0
- package/lib/types/heldInputs.js +173 -0
- package/lib/types/i18n.d.ts +543 -73
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +265 -46
- 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/onboardingDraft.d.ts +143 -0
- package/lib/types/onboardingDraft.d.ts.map +1 -0
- package/lib/types/onboardingDraft.js +71 -0
- 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 +394 -141
- 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/Onboarding.d.ts +22 -3
- package/lib/types/screens/Onboarding.d.ts.map +1 -1
- package/lib/types/screens/Onboarding.js +606 -36
- 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 +40 -15
- 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/utils/paths.d.ts +15 -0
- package/lib/types/utils/paths.d.ts.map +1 -1
- package/lib/types/utils/paths.js +25 -0
- 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 +130 -111
- package/presets/liangshen/custom-bash.mjs +13 -1
- package/presets/liangshen/instruction-hint.mjs +4 -1
- package/presets/liangshen/skill-search.mjs +14 -2
- package/presets/winbash.mjs +16 -4
- package/tui-profile/feed/README.md +17 -8
- package/tui-profile/feed/first-party.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type TaskNotifications = 'off' | 'unfocused' | 'always';
|
|
2
|
-
|
|
2
|
+
/** How a task completion is delivered: probe the terminal (`auto`), force
|
|
3
|
+
* OSC 9 or BEL, or ask for the native Windows toast. */
|
|
4
|
+
export type NotificationMethod = 'auto' | 'osc9' | 'bel' | 'windows';
|
|
3
5
|
/** Terminal-owned notification transport; never writes to redirected output. */
|
|
4
6
|
export declare function createTerminalNotifier(stdout: Pick<NodeJS.WriteStream, 'isTTY' | 'write'>): {
|
|
5
7
|
configure(nextCondition?: TaskNotifications, nextMethod?: NotificationMethod): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-notification.d.ts","sourceRoot":"","sources":["../../../src/ink/terminal-notification.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,WAAW,GAAG,QAAQ,CAAA;AAC9D,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"terminal-notification.d.ts","sourceRoot":"","sources":["../../../src/ink/terminal-notification.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,WAAW,GAAG,QAAQ,CAAA;AAC9D;yDACyD;AACzD,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;AAqBpE,gFAAgF;AAChF,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC;8BAK7D,iBAAiB,eAA4B,kBAAkB,GAAY,IAAI;kBAI1F,MAAM,qBAAiB,IAAI;EA0C5C"}
|
|
@@ -36,7 +36,10 @@ export function createTerminalNotifier(stdout) {
|
|
|
36
36
|
notify(title, message = '') {
|
|
37
37
|
if (!stdout.isTTY || condition === 'off' || (condition === 'unfocused' && getTerminalFocused()))
|
|
38
38
|
return;
|
|
39
|
-
|
|
39
|
+
// `windows` is a host transport (the native toast), not a terminal
|
|
40
|
+
// sequence, so this notifier resolves it like `auto` - which is also the
|
|
41
|
+
// resolution off Windows.
|
|
42
|
+
const resolved = method === 'auto' || method === 'windows' ? getNotificationProtocol() : method;
|
|
40
43
|
let sequence;
|
|
41
44
|
if (resolved === 'osc777') {
|
|
42
45
|
// OSC 777 separates title and body with semicolons; only the body
|
|
@@ -97,7 +97,7 @@ export declare function terminalCellSizePixels(): TerminalQuery<TerminalPixelSiz
|
|
|
97
97
|
export declare function terminalWindowSizePixels(): TerminalQuery<TerminalPixelSizeResponse>;
|
|
98
98
|
/**
|
|
99
99
|
* DECXCPR: request cursor position with DEC-private marker (CSI ? 6 n).
|
|
100
|
-
* Terminal replies with CSI ? row ; col R. The `?` marker is critical —
|
|
100
|
+
* Terminal replies with CSI ? row ; col [ ; page ] R. The `?` marker is critical —
|
|
101
101
|
* the plain DSR form (CSI 6 n → CSI row;col R) is ambiguous with
|
|
102
102
|
* modified F3 keys (Shift+F3 = CSI 1;2 R, etc.).
|
|
103
103
|
* @returns a query whose response is the cursor-position reply.
|
|
@@ -179,6 +179,14 @@ export declare class TerminalQuerier {
|
|
|
179
179
|
* answer before the next flush() sentinel.
|
|
180
180
|
*/
|
|
181
181
|
send<T extends TerminalResponse>(query: TerminalQuery<T>): Promise<T | undefined>;
|
|
182
|
+
/** Register a bounded query whose request will be inserted into an ordered frame.
|
|
183
|
+
* The caller must write request immediately, or cancel it if the frame is abandoned.
|
|
184
|
+
*/
|
|
185
|
+
prepare<T extends TerminalResponse>(query: TerminalQuery<T>, timeoutMs: number): {
|
|
186
|
+
request: string;
|
|
187
|
+
response: Promise<T | undefined>;
|
|
188
|
+
cancel: () => void;
|
|
189
|
+
};
|
|
182
190
|
/**
|
|
183
191
|
* Send the DA1 sentinel. Resolves when DA1's response arrives.
|
|
184
192
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-querier.d.ts","sourceRoot":"","s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,CAAC,CAAC,SAAS,gBAAgB,EAC7B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GACtB,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAczB;;OAEG;IACH,OAAO,CAAC,CAAC,SAAS,gBAAgB,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG;QAC/E,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAA;QAChC,MAAM,EAAE,MAAM,IAAI,CAAA;KACnB;IA4BD;;;;;;;;OAQG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IACtB,KAAK,CAAC,OAAO,EAAE;QAAE,UAAU,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAatE,8EAA8E;IAC9E,OAAO,IAAI,IAAI;IAMf;;;OAGG;IACH,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAY;IAEtE;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,CAAC,EAAE,gBAAgB,GAAG,IAAI;IA4BrC;;;;OAIG;IACH,OAAO,IAAI,IAAI;IAMf,6EAA6E;IAC7E,MAAM,IAAI,IAAI;IAId,OAAO,CAAC,YAAY;CAOrB"}
|
|
@@ -103,7 +103,7 @@ export function terminalWindowSizePixels() {
|
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* DECXCPR: request cursor position with DEC-private marker (CSI ? 6 n).
|
|
106
|
-
* Terminal replies with CSI ? row ; col R. The `?` marker is critical —
|
|
106
|
+
* Terminal replies with CSI ? row ; col [ ; page ] R. The `?` marker is critical —
|
|
107
107
|
* the plain DSR form (CSI 6 n → CSI row;col R) is ambiguous with
|
|
108
108
|
* modified F3 keys (Shift+F3 = CSI 1;2 R, etc.).
|
|
109
109
|
* @returns a query whose response is the cursor-position reply.
|
|
@@ -238,6 +238,37 @@ export class TerminalQuerier {
|
|
|
238
238
|
this.stdout.write(query.request);
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
|
+
/** Register a bounded query whose request will be inserted into an ordered frame.
|
|
242
|
+
* The caller must write request immediately, or cancel it if the frame is abandoned.
|
|
243
|
+
*/
|
|
244
|
+
prepare(query, timeoutMs) {
|
|
245
|
+
if (this.disposed || this.suspended) {
|
|
246
|
+
return { request: '', response: Promise.resolve(undefined), cancel: () => { } };
|
|
247
|
+
}
|
|
248
|
+
let cancel = () => { };
|
|
249
|
+
const response = new Promise(resolve => {
|
|
250
|
+
const release = this.holdRawMode();
|
|
251
|
+
const pending = {
|
|
252
|
+
kind: 'query',
|
|
253
|
+
match: query.match,
|
|
254
|
+
responseType: query.responseType,
|
|
255
|
+
resolve: r => resolve(r),
|
|
256
|
+
releaseRawMode: () => { clearTimeout(timer); release(); },
|
|
257
|
+
};
|
|
258
|
+
cancel = () => {
|
|
259
|
+
const index = this.queue.indexOf(pending);
|
|
260
|
+
if (index < 0)
|
|
261
|
+
return;
|
|
262
|
+
this.queue.splice(index, 1);
|
|
263
|
+
pending.resolve(undefined);
|
|
264
|
+
pending.releaseRawMode();
|
|
265
|
+
};
|
|
266
|
+
const timer = setTimeout(cancel, timeoutMs);
|
|
267
|
+
timer.unref?.();
|
|
268
|
+
this.queue.push(pending);
|
|
269
|
+
});
|
|
270
|
+
return { request: query.request, response, cancel: () => cancel() };
|
|
271
|
+
}
|
|
241
272
|
flush(options) {
|
|
242
273
|
if (this.disposed || this.suspended)
|
|
243
274
|
return Promise.resolve();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Writable } from 'stream';
|
|
2
2
|
import type { Diff } from './frame.js';
|
|
3
|
+
import type { NotificationMethod } from './terminal-notification.js';
|
|
3
4
|
/**
|
|
4
5
|
* Progress-report state for OSC 9;4: a state plus an optional percentage.
|
|
5
6
|
*/
|
|
@@ -61,6 +62,23 @@ export declare function isSynchronizedOutputSupported(): boolean;
|
|
|
61
62
|
export declare function setXtversionName(name: string): void;
|
|
62
63
|
/** Notification protocol, using the existing SSH-capable terminal probe. */
|
|
63
64
|
export declare function getNotificationProtocol(): 'osc777' | 'osc99' | 'osc9' | 'bel';
|
|
65
|
+
/**
|
|
66
|
+
* The transport a configured `notificationMethod` resolves to on `platform`.
|
|
67
|
+
*
|
|
68
|
+
* `auto` asks the platform: local Windows shows a native toast, every other platform
|
|
69
|
+
* keeps whatever {@link getNotificationProtocol} probes for, so delivery there
|
|
70
|
+
* is unchanged. An explicit `windows` is a platform capability rather than a
|
|
71
|
+
* terminal sequence, so off Windows it falls back to that same probed protocol;
|
|
72
|
+
* `osc9` and `bel` stay explicit overrides everywhere.
|
|
73
|
+
*
|
|
74
|
+
* `platform` is a parameter, like {@link supportsWin32InputMode}'s, so callers
|
|
75
|
+
* and regressions can resolve for a host that is not this process.
|
|
76
|
+
* @param method - the configured notification method.
|
|
77
|
+
* @param platform - the host platform to resolve for.
|
|
78
|
+
* @param env - SSH sessions keep notifying the attached terminal.
|
|
79
|
+
* @returns the transport to deliver the notification through.
|
|
80
|
+
*/
|
|
81
|
+
export declare function resolveNotificationMethod(method: NotificationMethod, platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): 'windows' | 'osc777' | 'osc99' | 'osc9' | 'bel';
|
|
64
82
|
/**
|
|
65
83
|
* True if running in an xterm.js-based terminal (VS Code, Cursor, Windsurf
|
|
66
84
|
* integrated terminals). Combines TERM_PROGRAM env check (fast, sync, but
|
|
@@ -123,9 +141,12 @@ export declare function supportsExtendedKeys(): boolean;
|
|
|
123
141
|
* 9001 can reduce arrows/mouse sequences to their trailing A-D/M bytes and
|
|
124
142
|
* interfere with IME commits (issue #215). Native VS Code reports its own
|
|
125
143
|
* 1.x application version and retains win32-input-mode support.
|
|
126
|
-
*
|
|
144
|
+
* NVIM/VIM_TERMINAL identify nested VT hosts; the dedicated opt-out also
|
|
145
|
+
* preserves classic input when an unrecognized embedding rejects mode 9001.
|
|
146
|
+
* @param environment - optional capability environment, defaults to the process.
|
|
147
|
+
* @returns true on supported native Windows hosts (never in WSL).
|
|
127
148
|
*/
|
|
128
|
-
export declare function supportsWin32InputMode(platform?: NodeJS.Platform, termProgram?: string | undefined, termProgramVersion?: string | undefined): boolean;
|
|
149
|
+
export declare function supportsWin32InputMode(platform?: NodeJS.Platform, termProgram?: string | undefined, termProgramVersion?: string | undefined, environment?: NodeJS.ProcessEnv): boolean;
|
|
129
150
|
/**
|
|
130
151
|
* True if the terminal scrolls the viewport when it receives cursor-up
|
|
131
152
|
* sequences that reach above the visible area. On Windows, conhost's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../../src/ink/terminal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAKtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../../src/ink/terminal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAKtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAYpE;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,eAAe,CAAA;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,IAAI,OAAO,CAuCtD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED;;;;;G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B,CAAA;AAED;;;;;;;GAOG;AACH;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,eAAe,UAAQ,GACtB,MAAM,CAwFR;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,eAAe,UAAQ,GACtB,IAAI,CAMN"}
|
|
@@ -183,6 +183,29 @@ export function getNotificationProtocol() {
|
|
|
183
183
|
return 'osc9';
|
|
184
184
|
return 'bel';
|
|
185
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* The transport a configured `notificationMethod` resolves to on `platform`.
|
|
188
|
+
*
|
|
189
|
+
* `auto` asks the platform: local Windows shows a native toast, every other platform
|
|
190
|
+
* keeps whatever {@link getNotificationProtocol} probes for, so delivery there
|
|
191
|
+
* is unchanged. An explicit `windows` is a platform capability rather than a
|
|
192
|
+
* terminal sequence, so off Windows it falls back to that same probed protocol;
|
|
193
|
+
* `osc9` and `bel` stay explicit overrides everywhere.
|
|
194
|
+
*
|
|
195
|
+
* `platform` is a parameter, like {@link supportsWin32InputMode}'s, so callers
|
|
196
|
+
* and regressions can resolve for a host that is not this process.
|
|
197
|
+
* @param method - the configured notification method.
|
|
198
|
+
* @param platform - the host platform to resolve for.
|
|
199
|
+
* @param env - SSH sessions keep notifying the attached terminal.
|
|
200
|
+
* @returns the transport to deliver the notification through.
|
|
201
|
+
*/
|
|
202
|
+
export function resolveNotificationMethod(method, platform = process.platform, env = process.env) {
|
|
203
|
+
if (method === 'osc9' || method === 'bel')
|
|
204
|
+
return method;
|
|
205
|
+
if (method === 'auto' && (env.SSH_CONNECTION || env.SSH_CLIENT || env.SSH_TTY))
|
|
206
|
+
return getNotificationProtocol();
|
|
207
|
+
return platform === 'win32' ? 'windows' : getNotificationProtocol();
|
|
208
|
+
}
|
|
186
209
|
/**
|
|
187
210
|
* True if running in an xterm.js-based terminal (VS Code, Cursor, Windsurf
|
|
188
211
|
* integrated terminals). Combines TERM_PROGRAM env check (fast, sync, but
|
|
@@ -277,11 +300,18 @@ export function supportsExtendedKeys() {
|
|
|
277
300
|
* 9001 can reduce arrows/mouse sequences to their trailing A-D/M bytes and
|
|
278
301
|
* interfere with IME commits (issue #215). Native VS Code reports its own
|
|
279
302
|
* 1.x application version and retains win32-input-mode support.
|
|
280
|
-
*
|
|
303
|
+
* NVIM/VIM_TERMINAL identify nested VT hosts; the dedicated opt-out also
|
|
304
|
+
* preserves classic input when an unrecognized embedding rejects mode 9001.
|
|
305
|
+
* @param environment - optional capability environment, defaults to the process.
|
|
306
|
+
* @returns true on supported native Windows hosts (never in WSL).
|
|
281
307
|
*/
|
|
282
|
-
export function supportsWin32InputMode(platform = process.platform, termProgram = process.env.TERM_PROGRAM, termProgramVersion = process.env.TERM_PROGRAM_VERSION) {
|
|
308
|
+
export function supportsWin32InputMode(platform = process.platform, termProgram = process.env.TERM_PROGRAM, termProgramVersion = process.env.TERM_PROGRAM_VERSION, environment = process.env) {
|
|
283
309
|
if (platform !== 'win32')
|
|
284
310
|
return false;
|
|
311
|
+
// Nested VT hosts do not expose the outer ConPTY input-record contract.
|
|
312
|
+
// 请核: Windows Neovim/Vim child environments and post-resume arrow/F-key input.
|
|
313
|
+
if (environment.NVIM || environment.VIM_TERMINAL || environment.DSH_TUI_DISABLE_WIN32_INPUT_MODE === '1')
|
|
314
|
+
return false;
|
|
285
315
|
const version = coerce(termProgramVersion);
|
|
286
316
|
const isEmbeddedXtermJs = termProgram === 'vscode' && version !== null && version.major >= 5;
|
|
287
317
|
return !isEmbeddedXtermJs;
|
|
@@ -91,7 +91,7 @@ export declare function tmuxLoadBuffer(text: string): Promise<boolean>;
|
|
|
91
91
|
* Local (no SSH_CONNECTION): also shell out to a native clipboard utility.
|
|
92
92
|
* OSC 52 and tmux -w both depend on terminal settings — iTerm2 disables
|
|
93
93
|
* OSC 52 by default, VS Code shows a permission prompt on first use. Native
|
|
94
|
-
* utilities (pbcopy/wl-copy/xclip/xsel/
|
|
94
|
+
* utilities (pbcopy/wl-copy/xclip/xsel/PowerShell) bypass terminal settings. Over
|
|
95
95
|
* SSH these would write to the remote clipboard — OSC 52 is the right path there.
|
|
96
96
|
*
|
|
97
97
|
* @param text - the text to place on the clipboard.
|
|
@@ -127,6 +127,7 @@ export declare const OSC: {
|
|
|
127
127
|
readonly RESET_CURSOR_COLOR: 112;
|
|
128
128
|
readonly SEMANTIC_PROMPT: 133;
|
|
129
129
|
readonly GHOSTTY: 777;
|
|
130
|
+
readonly PROGRAM_STATUS: 7501;
|
|
130
131
|
readonly TAB_STATUS: 21337;
|
|
131
132
|
};
|
|
132
133
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"osc.d.ts","sourceRoot":"","sources":["../../../../src/ink/termio/osc.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEhE,kDAAkD;AAClD,eAAO,MAAM,UAAU,QAA0C,CAAA;AAEjE,yEAAyE;AACzE,eAAO,MAAM,EAAE,QAAa,CAAA;AAmB5B;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,MAAM,CAGzD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAS3D;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,aAAa,GAAG,OAAO,CAAA;AAE9D;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAMhD;AAYD;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAYnE;
|
|
1
|
+
{"version":3,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,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAYzE;AASD,8BAA8B;AAC9B,eAAO,MAAM,QAAQ,QAA6B,CAAA;AAIlD,sCAAsC;AACtC,eAAO,MAAM,MAAM;;;;CAIT,CAAA;AAEV,8DAA8D;AAC9D,eAAO,MAAM,QAAQ;;;;;CAKX,CAAA;AAEV;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAA2E,CAAA;AAE7G;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAkD,CAAA;AAEnF,iEAAiE;AACjE,eAAO,MAAM,gBAAgB,QAG5B,CAAA;AAED,2FAA2F;AAC3F,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAiBzD"}
|
|
@@ -105,6 +105,7 @@ export async function tmuxLoadBuffer(text) {
|
|
|
105
105
|
});
|
|
106
106
|
return code === 0;
|
|
107
107
|
}
|
|
108
|
+
let windowsClipboardQueue = Promise.resolve();
|
|
108
109
|
/**
|
|
109
110
|
* OSC 52 clipboard write: ESC ] 52 ; c ; <base64> BEL/ST
|
|
110
111
|
* 'c' selects the clipboard (vs 'p' for primary selection on X11).
|
|
@@ -132,7 +133,7 @@ export async function tmuxLoadBuffer(text) {
|
|
|
132
133
|
* Local (no SSH_CONNECTION): also shell out to a native clipboard utility.
|
|
133
134
|
* OSC 52 and tmux -w both depend on terminal settings — iTerm2 disables
|
|
134
135
|
* OSC 52 by default, VS Code shows a permission prompt on first use. Native
|
|
135
|
-
* utilities (pbcopy/wl-copy/xclip/xsel/
|
|
136
|
+
* utilities (pbcopy/wl-copy/xclip/xsel/PowerShell) bypass terminal settings. Over
|
|
136
137
|
* SSH these would write to the remote clipboard — OSC 52 is the right path there.
|
|
137
138
|
*
|
|
138
139
|
* @param text - the text to place on the clipboard.
|
|
@@ -140,6 +141,16 @@ export async function tmuxLoadBuffer(text) {
|
|
|
140
141
|
* outside tmux, DCS-wrapped inside).
|
|
141
142
|
*/
|
|
142
143
|
export async function setClipboard(text) {
|
|
144
|
+
if (process.platform !== 'win32' || process.env['SSH_CONNECTION']) {
|
|
145
|
+
return setClipboardNow(text);
|
|
146
|
+
}
|
|
147
|
+
// Serialize the entire Windows path, including the returned OSC 52. An
|
|
148
|
+
// older native writer must finish before the next copy can reach the terminal.
|
|
149
|
+
const pending = windowsClipboardQueue.then(() => setClipboardNow(text));
|
|
150
|
+
windowsClipboardQueue = pending.catch(() => { });
|
|
151
|
+
return pending;
|
|
152
|
+
}
|
|
153
|
+
async function setClipboardNow(text) {
|
|
143
154
|
const b64 = Buffer.from(text, 'utf8').toString('base64');
|
|
144
155
|
const raw = osc(OSC.CLIPBOARD, 'c', b64);
|
|
145
156
|
// Native safety net — fire FIRST, before the tmux await, so a quick
|
|
@@ -148,9 +159,14 @@ export async function setClipboard(text) {
|
|
|
148
159
|
// before pbcopy even started — fast cmd+tab → paste would beat it.
|
|
149
160
|
// Gated on SSH_CONNECTION (not SSH_TTY) since tmux panes inherit SSH_TTY
|
|
150
161
|
// forever but SSH_CONNECTION is in tmux's default update-environment and
|
|
151
|
-
// clears on local attach.
|
|
152
|
-
|
|
153
|
-
|
|
162
|
+
// clears on local attach. Windows waits before returning OSC 52 so a
|
|
163
|
+
// failed newer native copy cannot be followed by an older native write.
|
|
164
|
+
if (!process.env['SSH_CONNECTION']) {
|
|
165
|
+
if (process.platform === 'win32')
|
|
166
|
+
await copyWindows(text);
|
|
167
|
+
else
|
|
168
|
+
copyNative(text);
|
|
169
|
+
}
|
|
154
170
|
const tmuxBufferLoaded = await tmuxLoadBuffer(text);
|
|
155
171
|
// Inner OSC uses BEL directly (not osc()) — ST's ESC would need doubling
|
|
156
172
|
// too, and BEL works everywhere for OSC 52.
|
|
@@ -207,12 +223,24 @@ function copyNative(text) {
|
|
|
207
223
|
});
|
|
208
224
|
return;
|
|
209
225
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/** Read UTF-8 bytes explicitly; clipboard content never enters command text. */
|
|
229
|
+
async function copyWindows(text) {
|
|
230
|
+
const command = [
|
|
231
|
+
"$ErrorActionPreference = 'Stop'",
|
|
232
|
+
'$reader = [System.IO.StreamReader]::new([Console]::OpenStandardInput(), [System.Text.UTF8Encoding]::new($false), $false)',
|
|
233
|
+
'Set-Clipboard -Value ($reader.ReadToEnd())',
|
|
234
|
+
].join('; ');
|
|
235
|
+
// 请核: Windows PowerShell 5.1 / PowerShell 7 的原生 Unicode、超时终止与 STA 剪贴板行为须在 Windows 实机验收。
|
|
236
|
+
for (const executable of ['powershell.exe', 'pwsh.exe']) {
|
|
237
|
+
const result = await execFileNoThrow(executable, [
|
|
238
|
+
'-NoLogo', '-NoProfile', '-NonInteractive', '-STA', '-Command', command,
|
|
239
|
+
], { input: text, useCwd: false, timeout: 2000 });
|
|
240
|
+
if (result.code === 0)
|
|
214
241
|
return;
|
|
215
242
|
}
|
|
243
|
+
// Both tools failed or timed out: the caller still emits OSC 52.
|
|
216
244
|
}
|
|
217
245
|
/**
|
|
218
246
|
* Reset the cached Linux clipboard tool probe, forcing the next copy to
|
|
@@ -244,6 +272,7 @@ export const OSC = {
|
|
|
244
272
|
RESET_CURSOR_COLOR: 112,
|
|
245
273
|
SEMANTIC_PROMPT: 133,
|
|
246
274
|
GHOSTTY: 777, // Ghostty notification protocol
|
|
275
|
+
PROGRAM_STATUS: 7501, // Program Status Protocol (see osc7501.ts)
|
|
247
276
|
TAB_STATUS: 21337, // Tab status extension
|
|
248
277
|
};
|
|
249
278
|
/**
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSC 7501 — Program Status Protocol
|
|
3
|
+
*
|
|
4
|
+
* A terminal escape sequence that lets a program tell the terminal what it is
|
|
5
|
+
* doing: idle, working, blocked on the user, done, or failed. The terminal
|
|
6
|
+
* owns presentation; the program only shares state.
|
|
7
|
+
*
|
|
8
|
+
* Spec: https://www.superlogical.com/rex/docs/build/program-status
|
|
9
|
+
*
|
|
10
|
+
* Wire format (the body is `:`-separated `key=value` pairs):
|
|
11
|
+
*
|
|
12
|
+
* ESC ] 7501 ; state=working:app=dsh-tui:msg=<base64> ESC \
|
|
13
|
+
* ESC ] 7501 ; ? ESC \ (detection)
|
|
14
|
+
*
|
|
15
|
+
* Every report REPLACES the addressed record, so a key that must survive has
|
|
16
|
+
* to be repeated on every report. Terminals that do not know the sequence
|
|
17
|
+
* ignore it, which is why reports are sent blind — no detection round trip.
|
|
18
|
+
*
|
|
19
|
+
* This module is pure encoding/parsing: no I/O, no React, no channel imports.
|
|
20
|
+
* The value charset excludes `:` and `;`, so nothing needs escaping; free-text
|
|
21
|
+
* values (`msg`, `title`) are base64 of single-line, control-free UTF-8.
|
|
22
|
+
*/
|
|
23
|
+
/** States a report may carry. `clear` removes records instead of setting one. */
|
|
24
|
+
export type ProgramState = 'idle' | 'working' | 'done' | 'blocked' | 'error' | 'clear';
|
|
25
|
+
/** What a `blocked` record is waiting for. */
|
|
26
|
+
export type ProgramBlockedKind = 'permission' | 'question' | 'auth';
|
|
27
|
+
/**
|
|
28
|
+
* One OSC 7501 report. `app` is included by the encoder on every report
|
|
29
|
+
* because each report replaces its record completely.
|
|
30
|
+
*/
|
|
31
|
+
export type ProgramStatusRecord = {
|
|
32
|
+
state: ProgramState;
|
|
33
|
+
/**
|
|
34
|
+
* Record path such as `build/test`. Omitted addresses the root record,
|
|
35
|
+
* which is what a single-program TUI uses.
|
|
36
|
+
*/
|
|
37
|
+
id?: string;
|
|
38
|
+
/** Stable machine-readable program id, e.g. `dsh-tui`. */
|
|
39
|
+
app?: string;
|
|
40
|
+
/** Only meaningful with `blocked`; ignored by the terminal otherwise. */
|
|
41
|
+
kind?: ProgramBlockedKind;
|
|
42
|
+
/** Only meaningful with `working`/`blocked`; 0-100, absent = indeterminate. */
|
|
43
|
+
progress?: number;
|
|
44
|
+
/** Short human-readable label (base64 on the wire). */
|
|
45
|
+
title?: string;
|
|
46
|
+
/** One human-readable line (base64 on the wire). */
|
|
47
|
+
msg?: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Collapse free text to the single control-free line the protocol requires.
|
|
51
|
+
* Control characters (C0/C1, DEL) and line breaks would be rejected by a
|
|
52
|
+
* conforming terminal and can smuggle sequence boundaries, so they are
|
|
53
|
+
* dropped rather than escaped — there is no escape mechanism in the format.
|
|
54
|
+
* Bidi overrides and isolates are also removed to keep untrusted labels
|
|
55
|
+
* from changing the direction of surrounding status text.
|
|
56
|
+
* @param text - untrusted text (session titles, tool commands, model output).
|
|
57
|
+
* @returns the text with control characters and line breaks removed.
|
|
58
|
+
*/
|
|
59
|
+
export declare function sanitizeProgramText(text: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Build one OSC 7501 report.
|
|
62
|
+
*
|
|
63
|
+
* Returns `''` when the record cannot be encoded legally (unknown state,
|
|
64
|
+
* `kind`/`progress` on a state that forbids it, an `app`/`id` outside its
|
|
65
|
+
* grammar, or a body past the sequence cap) — callers skip the write rather
|
|
66
|
+
* than send a report the terminal would discard.
|
|
67
|
+
*
|
|
68
|
+
* The sequence is NOT wrapped for tmux/screen passthrough on purpose: a
|
|
69
|
+
* passthrough report would reach the outer terminal, which cannot tell panes
|
|
70
|
+
* apart and cannot see the program exit, breaking the protocol's record
|
|
71
|
+
* lifetime. A multiplexer that implements OSC 7501 receives it directly.
|
|
72
|
+
*
|
|
73
|
+
* @param record - the report to encode.
|
|
74
|
+
* @returns the complete sequence, or `''` when it cannot be encoded.
|
|
75
|
+
*/
|
|
76
|
+
export declare function programStatus(record: ProgramStatusRecord): string;
|
|
77
|
+
/**
|
|
78
|
+
* Build a `clear` report. With an `id`, removes that record and every record
|
|
79
|
+
* beneath it; without one, removes every record on the terminal.
|
|
80
|
+
*
|
|
81
|
+
* Note the protocol already drops `working`/`blocked` records when the process
|
|
82
|
+
* exits or the next shell prompt begins, and deliberately keeps `done`/`error`
|
|
83
|
+
* for the user to find — so a normal exit must NOT clear.
|
|
84
|
+
* @param id - the record path to remove; omitted clears every record.
|
|
85
|
+
* @returns the complete sequence, or `''` when the id is malformed.
|
|
86
|
+
*/
|
|
87
|
+
export declare function clearProgramStatus(id?: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* Whether to report program status.
|
|
90
|
+
*
|
|
91
|
+
* On by default: the protocol is a no-op on terminals that do not implement
|
|
92
|
+
* it (unknown OSCs are ignored), so the only hard requirement is an
|
|
93
|
+
* interactive stdout — a piped or redirected one has no terminal to report
|
|
94
|
+
* to. `DSH_TUI_PROGRAM_STATUS` disables it with any falsy spelling
|
|
95
|
+
* (`0`, `false`, `no`, `off`).
|
|
96
|
+
*
|
|
97
|
+
* @param stdoutIsTTY - whether stdout is an interactive terminal.
|
|
98
|
+
* @param env - the environment to read the opt-out from.
|
|
99
|
+
* @returns true when reports should be emitted.
|
|
100
|
+
*/
|
|
101
|
+
export declare function supportsProgramStatus(stdoutIsTTY?: boolean, env?: NodeJS.ProcessEnv): boolean;
|
|
102
|
+
//# sourceMappingURL=osc7501.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"osc7501.d.ts","sourceRoot":"","sources":["../../../../src/ink/termio/osc7501.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAqCH,iFAAiF;AACjF,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,SAAS,GACT,MAAM,GACN,SAAS,GACT,OAAO,GACP,OAAO,CAAA;AAEX,8CAA8C;AAC9C,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,UAAU,GAAG,MAAM,CAAA;AAEnE;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,YAAY,CAAA;IACnB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,0DAA0D;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,yEAAyE;IACzE,IAAI,CAAC,EAAE,kBAAkB,CAAA;IACzB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oDAAoD;IACpD,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGxD;AA2DD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAwDjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAItD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,GAAE,OAAuC,EACpD,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAKT"}
|