@deepseek-harness-tui/dsh-tui 0.14.0 → 0.15.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 +73 -14
- package/bin/dsh-tui.js +200 -34
- package/cordis.patch.yml +16 -52
- package/cordis.yml +6 -2
- package/guide/dsh-tui-guide/claude-backend.en.md +44 -7
- package/guide/dsh-tui-guide/claude-backend.md +28 -6
- package/guide/dsh-tui-guide/codex-backend.en.md +34 -7
- package/guide/dsh-tui-guide/codex-backend.md +17 -2
- package/guide/dsh-tui-guide/configuration.en.md +129 -16
- package/guide/dsh-tui-guide/configuration.md +110 -14
- package/guide/dsh-tui-guide/interaction.en.md +57 -24
- package/guide/dsh-tui-guide/interaction.md +42 -19
- package/guide/dsh-tui-guide/plugins.en.md +36 -3
- package/guide/dsh-tui-guide/plugins.md +21 -2
- package/guide/dsh-tui-guide/themes.en.md +23 -14
- package/guide/dsh-tui-guide/themes.md +19 -12
- package/guide/dsh-tui-guide/user-guide.en.md +51 -20
- package/guide/dsh-tui-guide/user-guide.md +41 -21
- package/lib/settings.json +103 -9
- 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/channel/ui.d.ts +2 -0
- package/lib/types/adapter/channel/ui.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui.js +6 -2
- package/lib/types/adapter/kernel/runtime.d.ts.map +1 -1
- package/lib/types/adapter/kernel/runtime.js +2 -0
- package/lib/types/adapter/ports/channel-settings.d.ts +9 -0
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +50 -12
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +21 -0
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/spec/backend-capabilities.d.ts +22 -0
- package/lib/types/adapter/spec/backend-capabilities.d.ts.map +1 -0
- package/lib/types/adapter/spec/backend-capabilities.js +49 -0
- package/lib/types/adapter/spec/protocol-constants.d.ts.map +1 -1
- package/lib/types/adapter/spec/protocol-constants.js +10 -3
- package/lib/types/adapter/spec/tui-contributions.d.ts +3 -0
- package/lib/types/adapter/spec/tui-contributions.d.ts.map +1 -1
- package/lib/types/adapter/spec/tui-contributions.js +7 -0
- package/lib/types/adapter/standard/registry.d.ts +6 -0
- package/lib/types/adapter/standard/registry.d.ts.map +1 -1
- package/lib/types/adapter/standard/registry.js +65 -15
- package/lib/types/adapter/standard/tui-extension.d.ts.map +1 -1
- package/lib/types/adapter/standard/tui-extension.js +7 -1
- package/lib/types/adapter/standard/types.d.ts +10 -1
- package/lib/types/adapter/standard/types.d.ts.map +1 -1
- package/lib/types/adapter/upstream/host-descriptor-driver.d.ts.map +1 -1
- package/lib/types/adapter/upstream/host-descriptor-driver.js +52 -0
- package/lib/types/agent/backend-manifest.d.ts +152 -0
- package/lib/types/agent/backend-manifest.d.ts.map +1 -0
- package/lib/types/agent/backend-manifest.js +14 -0
- package/lib/types/agent/backend.d.ts +71 -5
- package/lib/types/agent/backend.d.ts.map +1 -1
- package/lib/types/agent/capabilities.d.ts +6 -0
- package/lib/types/agent/capabilities.d.ts.map +1 -1
- package/lib/types/agent/index.d.ts +2 -0
- package/lib/types/agent/index.d.ts.map +1 -1
- package/lib/types/agent/refs.d.ts +11 -1
- package/lib/types/agent/refs.d.ts.map +1 -1
- package/lib/types/agent/starting-session.d.ts +4 -0
- package/lib/types/agent/starting-session.d.ts.map +1 -0
- package/lib/types/agent/starting-session.js +19 -0
- package/lib/types/backends/claude/activity.d.ts +1 -1
- package/lib/types/backends/claude/activity.d.ts.map +1 -1
- package/lib/types/backends/claude/activity.js +5 -5
- package/lib/types/backends/claude/auth.d.ts.map +1 -1
- package/lib/types/backends/claude/auth.js +10 -3
- package/lib/types/backends/claude/backend.d.ts.map +1 -1
- package/lib/types/backends/claude/backend.js +103 -29
- package/lib/types/backends/claude/catalog.d.ts +2 -1
- package/lib/types/backends/claude/catalog.d.ts.map +1 -1
- package/lib/types/backends/claude/catalog.js +15 -5
- package/lib/types/backends/claude/channels.d.ts +5 -3
- package/lib/types/backends/claude/channels.d.ts.map +1 -1
- package/lib/types/backends/claude/channels.js +5 -4
- package/lib/types/backends/claude/contract.d.ts +4 -0
- package/lib/types/backends/claude/contract.d.ts.map +1 -1
- package/lib/types/backends/claude/contract.js +4 -0
- package/lib/types/backends/claude/controls.d.ts +4 -0
- package/lib/types/backends/claude/controls.d.ts.map +1 -1
- package/lib/types/backends/claude/controls.js +34 -42
- package/lib/types/backends/claude/dialogs.d.ts +8 -2
- package/lib/types/backends/claude/dialogs.d.ts.map +1 -1
- package/lib/types/backends/claude/dialogs.js +24 -16
- package/lib/types/backends/claude/images.d.ts +1 -1
- package/lib/types/backends/claude/images.d.ts.map +1 -1
- package/lib/types/backends/claude/images.js +7 -7
- package/lib/types/backends/claude/manifest.d.ts +21 -0
- package/lib/types/backends/claude/manifest.d.ts.map +1 -0
- package/lib/types/backends/claude/manifest.js +29 -0
- package/lib/types/backends/claude/older-history.js +2 -2
- package/lib/types/backends/claude/permissions.js +11 -11
- package/lib/types/backends/claude/prefs.d.ts +4 -2
- package/lib/types/backends/claude/prefs.d.ts.map +1 -1
- package/lib/types/backends/claude/prefs.js +4 -3
- package/lib/types/backends/claude/process.d.ts +16 -4
- package/lib/types/backends/claude/process.d.ts.map +1 -1
- package/lib/types/backends/claude/process.js +100 -37
- package/lib/types/backends/claude/send-message.d.ts +1 -1
- package/lib/types/backends/claude/send-message.d.ts.map +1 -1
- package/lib/types/backends/claude/session/auth.js +22 -22
- package/lib/types/backends/claude/session/channels.d.ts +4 -0
- package/lib/types/backends/claude/session/channels.d.ts.map +1 -1
- package/lib/types/backends/claude/session/channels.js +5 -3
- package/lib/types/backends/claude/session/lifecycle.d.ts.map +1 -1
- package/lib/types/backends/claude/session/lifecycle.js +31 -23
- package/lib/types/backends/claude/session/store.js +8 -8
- package/lib/types/backends/claude/session/subagents.js +2 -2
- package/lib/types/backends/claude/session/types.d.ts +7 -0
- package/lib/types/backends/claude/session/types.d.ts.map +1 -1
- package/lib/types/backends/claude/side-query.js +3 -3
- package/lib/types/backends/claude/task-output.js +5 -5
- package/lib/types/backends/claude/text.d.ts +778 -0
- package/lib/types/backends/claude/text.d.ts.map +1 -0
- package/lib/types/backends/claude/text.js +298 -0
- package/lib/types/backends/claude/transcript-file.d.ts +1 -1
- package/lib/types/backends/claude/transcript-file.d.ts.map +1 -1
- package/lib/types/backends/claude/transcript-file.js +4 -4
- package/lib/types/backends/claude/translate/attempts.js +2 -2
- package/lib/types/backends/claude/translate/core.js +3 -3
- package/lib/types/backends/claude/translate/messages.js +4 -4
- package/lib/types/backends/claude/translate/system.js +14 -14
- package/lib/types/backends/claude/translate/tasks.js +2 -2
- package/lib/types/backends/claude/translate/types.d.ts +1 -1
- package/lib/types/backends/claude/translate/types.d.ts.map +1 -1
- package/lib/types/backends/codex/auth/external-tokens.js +16 -16
- package/lib/types/backends/codex/auth/status.js +14 -14
- package/lib/types/backends/codex/backend.d.ts +4 -19
- package/lib/types/backends/codex/backend.d.ts.map +1 -1
- package/lib/types/backends/codex/backend.js +118 -25
- package/lib/types/backends/codex/catalog.d.ts +2 -1
- package/lib/types/backends/codex/catalog.d.ts.map +1 -1
- package/lib/types/backends/codex/catalog.js +63 -18
- package/lib/types/backends/codex/channels.d.ts +6 -3
- package/lib/types/backends/codex/channels.d.ts.map +1 -1
- package/lib/types/backends/codex/channels.js +15 -13
- package/lib/types/backends/codex/detect.d.ts.map +1 -1
- package/lib/types/backends/codex/detect.js +9 -6
- package/lib/types/backends/codex/manifest.d.ts +30 -0
- package/lib/types/backends/codex/manifest.d.ts.map +1 -0
- package/lib/types/backends/codex/manifest.js +23 -0
- package/lib/types/backends/codex/prefs.d.ts +4 -2
- package/lib/types/backends/codex/prefs.d.ts.map +1 -1
- package/lib/types/backends/codex/prefs.js +4 -3
- package/lib/types/backends/codex/rpc/hub.js +2 -2
- package/lib/types/backends/codex/session/activity.d.ts +1 -1
- package/lib/types/backends/codex/session/activity.d.ts.map +1 -1
- package/lib/types/backends/codex/session/activity.js +13 -13
- package/lib/types/backends/codex/session/approvals.js +30 -30
- package/lib/types/backends/codex/session/commands.d.ts +8 -2
- package/lib/types/backends/codex/session/commands.d.ts.map +1 -1
- package/lib/types/backends/codex/session/commands.js +71 -23
- package/lib/types/backends/codex/session/controls.d.ts +1 -1
- package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
- package/lib/types/backends/codex/session/controls.js +21 -16
- package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
- package/lib/types/backends/codex/session/goals.js +3 -3
- package/lib/types/backends/codex/session/history.js +2 -2
- package/lib/types/backends/codex/session/images.js +8 -8
- package/lib/types/backends/codex/session/input.d.ts +6 -2
- package/lib/types/backends/codex/session/input.d.ts.map +1 -1
- package/lib/types/backends/codex/session/input.js +55 -13
- package/lib/types/backends/codex/session/plan-review.js +6 -6
- package/lib/types/backends/codex/session/session.d.ts.map +1 -1
- package/lib/types/backends/codex/session/session.js +66 -34
- package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
- package/lib/types/backends/codex/session/side-query.js +27 -9
- package/lib/types/backends/codex/session/state.d.ts +6 -1
- package/lib/types/backends/codex/session/state.d.ts.map +1 -1
- package/lib/types/backends/codex/session/subagents.js +5 -5
- package/lib/types/backends/codex/session/tasks.js +4 -4
- package/lib/types/backends/codex/text.d.ts +933 -0
- package/lib/types/backends/codex/text.d.ts.map +1 -0
- package/lib/types/backends/codex/text.js +313 -0
- package/lib/types/backends/codex/translate/items.js +4 -4
- package/lib/types/backends/codex/translate/live.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/live.js +11 -8
- package/lib/types/backends/codex/translate/notices.js +10 -10
- package/lib/types/backends/shared/channel-slug.d.ts +4 -0
- package/lib/types/backends/shared/channel-slug.d.ts.map +1 -0
- package/lib/types/backends/shared/channel-slug.js +25 -0
- package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
- package/lib/types/backends/shared/channel-tokens.js +30 -23
- package/lib/types/{channel → backends/shared}/elicitation.d.ts +78 -21
- package/lib/types/backends/shared/elicitation.d.ts.map +1 -0
- package/lib/types/{channel → backends/shared}/elicitation.js +64 -66
- package/lib/types/backends/shared/image-size.d.ts +33 -0
- package/lib/types/backends/shared/image-size.d.ts.map +1 -0
- package/lib/types/backends/shared/image-size.js +134 -0
- package/lib/types/{utils → backends/shared}/jsonl.d.ts +5 -1
- package/lib/types/backends/shared/jsonl.d.ts.map +1 -0
- package/lib/types/{utils → backends/shared}/jsonl.js +5 -1
- package/lib/types/backends/shared/localized-text.d.ts +30 -0
- package/lib/types/backends/shared/localized-text.d.ts.map +1 -0
- package/lib/types/backends/shared/localized-text.js +24 -0
- package/lib/types/backends/shared/platform-text.d.ts +88 -0
- package/lib/types/backends/shared/platform-text.d.ts.map +1 -0
- package/lib/types/backends/shared/platform-text.js +33 -0
- package/lib/types/branding.d.ts +13 -0
- package/lib/types/branding.d.ts.map +1 -1
- package/lib/types/branding.js +18 -0
- package/lib/types/channel/channel-slug.d.ts +3 -1
- package/lib/types/channel/channel-slug.d.ts.map +1 -1
- package/lib/types/channel/channel-slug.js +3 -1
- package/lib/types/channel/sanitize.d.ts +7 -0
- package/lib/types/channel/sanitize.d.ts.map +1 -1
- package/lib/types/channel/sanitize.js +9 -0
- package/lib/types/channel/usage.d.ts.map +1 -1
- package/lib/types/channel/usage.js +5 -0
- package/lib/types/commands.d.ts +5 -0
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +47 -8
- package/lib/types/components/AgentMessageComposer.d.ts.map +1 -1
- package/lib/types/components/AgentMessageComposer.js +3 -2
- package/lib/types/components/BtwPanel.d.ts.map +1 -1
- package/lib/types/components/BtwPanel.js +4 -2
- package/lib/types/components/Chat/JobCard.js +3 -3
- package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
- package/lib/types/components/CommandSuggestions.js +20 -6
- package/lib/types/components/ContextBarView.d.ts +5 -1
- package/lib/types/components/ContextBarView.d.ts.map +1 -1
- package/lib/types/components/ContextBarView.js +6 -3
- package/lib/types/components/ExtensionDialog.d.ts.map +1 -1
- package/lib/types/components/ExtensionDialog.js +2 -3
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +14 -3
- package/lib/types/components/InlineMathParagraph.js +1 -1
- package/lib/types/components/KernelPicker.d.ts.map +1 -1
- package/lib/types/components/KernelPicker.js +1 -1
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +9 -6
- package/lib/types/components/MarkdownTable.d.ts.map +1 -1
- package/lib/types/components/MarkdownTable.js +4 -3
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +18 -5
- package/lib/types/components/ModelPicker.d.ts +24 -31
- package/lib/types/components/ModelPicker.d.ts.map +1 -1
- package/lib/types/components/ModelPicker.js +115 -40
- package/lib/types/components/PromptEditor.d.ts +3 -3
- package/lib/types/components/PromptInput.d.ts +21 -3
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +58 -118
- package/lib/types/components/SdkInstallWizard.d.ts +3 -1
- package/lib/types/components/SdkInstallWizard.d.ts.map +1 -1
- package/lib/types/components/SdkInstallWizard.js +8 -1
- package/lib/types/components/SearchBox.d.ts +13 -15
- package/lib/types/components/SearchBox.d.ts.map +1 -1
- package/lib/types/components/SearchBox.js +58 -27
- package/lib/types/components/ThemePicker.d.ts +1 -1
- package/lib/types/components/ThemePicker.d.ts.map +1 -1
- package/lib/types/components/ThemePicker.js +14 -11
- package/lib/types/components/Tooltip.js +1 -1
- package/lib/types/components/WorkingSpinner.js +1 -1
- package/lib/types/components/WorkspaceFlowPicker.d.ts.map +1 -1
- package/lib/types/components/WorkspaceFlowPicker.js +4 -3
- package/lib/types/components/composerImageTokens.d.ts +24 -0
- package/lib/types/components/composerImageTokens.d.ts.map +1 -0
- package/lib/types/components/composerImageTokens.js +37 -0
- package/lib/types/components/design-system/InputCaret.d.ts +7 -0
- package/lib/types/components/design-system/InputCaret.d.ts.map +1 -0
- package/lib/types/components/design-system/InputCaret.js +9 -0
- package/lib/types/components/design-system/ListItem.d.ts +13 -2
- package/lib/types/components/design-system/ListItem.d.ts.map +1 -1
- package/lib/types/components/design-system/ListItem.js +11 -5
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +6 -8
- package/lib/types/components/kernelCatalog.d.ts +55 -11
- package/lib/types/components/kernelCatalog.d.ts.map +1 -1
- package/lib/types/components/kernelCatalog.js +42 -23
- package/lib/types/components/launchpadActions.d.ts +4 -0
- package/lib/types/components/launchpadActions.d.ts.map +1 -1
- package/lib/types/components/launchpadActions.js +5 -4
- package/lib/types/components/launchpadLayout.d.ts.map +1 -1
- package/lib/types/components/launchpadLayout.js +2 -2
- package/lib/types/components/messages/UserPromptMessage.d.ts +4 -3
- package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -1
- package/lib/types/components/messages/UserPromptMessage.js +4 -3
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +8 -3
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +4 -3
- package/lib/types/components/questions/ProviderModelEditor.d.ts.map +1 -1
- package/lib/types/components/questions/ProviderModelEditor.js +3 -13
- package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -1
- package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
- package/lib/types/components/sessions/ForeignSessionRow.js +5 -2
- package/lib/types/components/sessions/SessionListRow.d.ts +3 -1
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionListRow.js +5 -2
- package/lib/types/components/sidePanel/PanelBar.d.ts +1 -0
- package/lib/types/components/sidePanel/PanelBar.d.ts.map +1 -1
- package/lib/types/components/sidePanel/PanelBar.js +21 -17
- package/lib/types/components/sidePanel/SidePanelColumn.d.ts +1 -1
- package/lib/types/components/sidePanel/SidePanelColumn.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelColumn.js +2 -1
- package/lib/types/components/sidePanel/SidePanelLayout.d.ts +6 -4
- package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelLayout.js +33 -7
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +4 -2
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.js +12 -4
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +59 -15
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +4 -2
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadView.js +12 -6
- package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -2
- package/lib/types/components/sidePanel/types.d.ts +1 -1
- package/lib/types/components/sidePanel/types.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.d.ts +2 -0
- package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.js +11 -1
- package/lib/types/components/splashFonts.d.ts +24 -1
- package/lib/types/components/splashFonts.d.ts.map +1 -1
- package/lib/types/components/splashFonts.js +40 -5
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +3 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +5 -2
- package/lib/types/dsh-adapter/admission-loader.d.ts +20 -0
- package/lib/types/dsh-adapter/admission-loader.d.ts.map +1 -0
- package/lib/types/dsh-adapter/admission-loader.js +256 -0
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +3 -0
- package/lib/types/dsh-adapter/backend-admission.d.ts +64 -0
- package/lib/types/dsh-adapter/backend-admission.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend-admission.js +34 -0
- package/lib/types/dsh-adapter/backend-contribution.d.ts +26 -0
- package/lib/types/dsh-adapter/backend-contribution.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend-contribution.js +37 -0
- package/lib/types/dsh-adapter/backend-registry.d.ts +136 -0
- package/lib/types/dsh-adapter/backend-registry.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend-registry.js +285 -0
- package/lib/types/dsh-adapter/backends.d.ts +67 -24
- package/lib/types/dsh-adapter/backends.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backends.generated.d.ts +12 -0
- package/lib/types/dsh-adapter/backends.generated.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backends.generated.js +6 -0
- package/lib/types/dsh-adapter/backends.js +92 -46
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts +2 -0
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.js +9 -3
- package/lib/types/dsh-adapter/channel/agent-view-projection.js +2 -2
- package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/background-action.js +8 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +16 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +18 -46
- package/lib/types/dsh-adapter/channel/channel-host.d.ts +45 -0
- package/lib/types/dsh-adapter/channel/channel-host.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/channel-host.js +1 -0
- package/lib/types/dsh-adapter/channel/command-completions.d.ts +5 -0
- package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/command-completions.js +16 -0
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +4 -2
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +36 -5
- package/lib/types/dsh-adapter/channel/cordis-host.d.ts +14 -0
- package/lib/types/dsh-adapter/channel/cordis-host.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/cordis-host.js +35 -0
- package/lib/types/dsh-adapter/channel/core/actions.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/actions.js +15 -6
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +7 -3
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +3 -0
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +12 -28
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +318 -117
- package/lib/types/dsh-adapter/channel/core/files.d.ts +7 -2
- package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/files.js +1 -0
- package/lib/types/dsh-adapter/channel/core/host.d.ts +12 -6
- package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/host.js +69 -35
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +5 -3
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.js +5 -2
- package/lib/types/dsh-adapter/channel/core/session-controls.js +2 -2
- package/lib/types/dsh-adapter/channel/core/session-switch.d.ts +7 -4
- package/lib/types/dsh-adapter/channel/core/session-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/session-switch.js +8 -4
- package/lib/types/dsh-adapter/channel/core/sessions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/core/sessions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/sessions.js +75 -16
- package/lib/types/dsh-adapter/channel/extensions.d.ts +4 -3
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/extensions.js +41 -22
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +14 -5
- package/lib/types/dsh-adapter/channel/job-projection.d.ts +4 -0
- package/lib/types/dsh-adapter/channel/job-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/job-projection.js +205 -24
- package/lib/types/dsh-adapter/channel/mentions.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts +1 -0
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-permission-actions.js +138 -8
- package/lib/types/dsh-adapter/channel/model-actions.d.ts +5 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +40 -28
- package/lib/types/dsh-adapter/channel/model-selection.d.ts +17 -0
- package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/model-selection.js +109 -0
- package/lib/types/dsh-adapter/channel/model-switch.d.ts +12 -21
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.js +39 -102
- package/lib/types/dsh-adapter/channel/projection.js +1 -1
- package/lib/types/dsh-adapter/channel/reports.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/reports.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/reports.js +11 -3
- package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.js +33 -20
- package/lib/types/dsh-adapter/channel/session-listing.d.ts +20 -0
- package/lib/types/dsh-adapter/channel/session-listing.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-listing.js +51 -0
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts +3 -1
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +56 -27
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +15 -8
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +38 -24
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +38 -24
- package/lib/types/dsh-adapter/channel/settings-host.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +1 -0
- package/lib/types/dsh-adapter/channel/state.d.ts +37 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +14 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +66 -6
- package/lib/types/dsh-adapter/channel/task-completion.d.ts +6 -0
- package/lib/types/dsh-adapter/channel/task-completion.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/task-completion.js +114 -0
- package/lib/types/dsh-adapter/channel/transcript.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/transcript.js +1 -1
- package/lib/types/dsh-adapter/channel/upstream-retry.d.ts +81 -0
- package/lib/types/dsh-adapter/channel/upstream-retry.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/upstream-retry.js +138 -0
- package/lib/types/dsh-adapter/channel/workspace-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/workspace-actions.js +9 -8
- package/lib/types/dsh-adapter/channel-ui.d.ts +3 -1
- package/lib/types/dsh-adapter/channel-ui.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel-ui.js +4 -2
- package/lib/types/dsh-adapter/channel.d.ts +2 -2
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +19 -5
- package/lib/types/dsh-adapter/context-occupancy.d.ts +81 -4
- package/lib/types/dsh-adapter/context-occupancy.d.ts.map +1 -1
- package/lib/types/dsh-adapter/context-occupancy.js +108 -17
- package/lib/types/dsh-adapter/contract.d.ts +1 -1
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +15 -0
- package/lib/types/dsh-adapter/entry-slot.d.ts +36 -0
- package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -0
- package/lib/types/dsh-adapter/entry-slot.js +28 -0
- package/lib/types/dsh-adapter/fresh-agent.d.ts +22 -0
- package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -0
- package/lib/types/dsh-adapter/fresh-agent.js +221 -0
- package/lib/types/dsh-adapter/host-access.d.ts +16 -1
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +53 -2
- package/lib/types/dsh-adapter/host-contract.d.ts +103 -0
- package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-contract.js +76 -0
- package/lib/types/dsh-adapter/host-dsh.d.ts +106 -0
- package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-dsh.js +466 -0
- package/lib/types/dsh-adapter/host-entry.d.ts +9 -0
- package/lib/types/dsh-adapter/host-entry.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-entry.js +228 -0
- package/lib/types/dsh-adapter/index.d.ts +55 -18
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +59 -7
- package/lib/types/dsh-adapter/install/executors.d.ts +44 -0
- package/lib/types/dsh-adapter/install/executors.d.ts.map +1 -0
- package/lib/types/dsh-adapter/install/executors.js +15 -0
- package/lib/types/dsh-adapter/install/pnpm-profile-add.d.ts +3 -0
- package/lib/types/dsh-adapter/install/pnpm-profile-add.d.ts.map +1 -0
- package/lib/types/dsh-adapter/install/pnpm-profile-add.js +150 -0
- package/lib/types/dsh-adapter/jobs.d.ts +7 -0
- package/lib/types/dsh-adapter/jobs.d.ts.map +1 -1
- package/lib/types/dsh-adapter/jobs.js +13 -0
- package/lib/types/dsh-adapter/lite-profile.d.ts +50 -0
- package/lib/types/dsh-adapter/lite-profile.d.ts.map +1 -0
- package/lib/types/dsh-adapter/lite-profile.js +49 -0
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts +1 -1
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts.map +1 -1
- package/lib/types/dsh-adapter/migrate/parse/jsonl.js +4 -3
- package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/profiles.js +5 -1
- package/lib/types/dsh-adapter/panels.d.ts +7 -0
- package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
- package/lib/types/dsh-adapter/panels.js +35 -2
- package/lib/types/dsh-adapter/plugin-completions.d.ts +32 -0
- package/lib/types/dsh-adapter/plugin-completions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-completions.js +80 -0
- package/lib/types/dsh-adapter/plugin-declaration.d.ts +21 -0
- package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-declaration.js +53 -0
- package/lib/types/dsh-adapter/plugin-host.d.ts +13 -2
- package/lib/types/dsh-adapter/plugin-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-host.js +34 -8
- package/lib/types/dsh-adapter/plugin-manager.d.ts +68 -0
- package/lib/types/dsh-adapter/plugin-manager.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-manager.js +51 -0
- package/lib/types/dsh-adapter/plugin.d.ts +50 -1
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +870 -233
- package/lib/types/dsh-adapter/plugins-info.d.ts +44 -8
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +354 -34
- package/lib/types/dsh-adapter/process-exit.d.ts +43 -0
- package/lib/types/dsh-adapter/process-exit.d.ts.map +1 -0
- package/lib/types/dsh-adapter/process-exit.js +60 -0
- package/lib/types/dsh-adapter/root-dispose.d.ts +18 -0
- package/lib/types/dsh-adapter/root-dispose.d.ts.map +1 -0
- package/lib/types/dsh-adapter/root-dispose.js +28 -0
- package/lib/types/dsh-adapter/session-list-metadata.d.ts +20 -0
- package/lib/types/dsh-adapter/session-list-metadata.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-list-metadata.js +56 -0
- package/lib/types/dsh-adapter/session-seed.d.ts +11 -0
- package/lib/types/dsh-adapter/session-seed.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-seed.js +47 -0
- package/lib/types/dsh-adapter/sessions/list.d.ts +3 -1
- package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/list.js +11 -5
- package/lib/types/dsh-adapter/sessions/snapshot.d.ts +0 -2
- package/lib/types/dsh-adapter/sessions/snapshot.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/snapshot.js +7 -70
- package/lib/types/dsh-adapter/startup-args.d.ts +2 -0
- package/lib/types/dsh-adapter/startup-args.d.ts.map +1 -1
- package/lib/types/dsh-adapter/startup-args.js +5 -0
- package/lib/types/dsh-adapter/subagents.d.ts +33 -1
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +110 -8
- package/lib/types/dsh-adapter/tui-settings.d.ts +57 -0
- package/lib/types/dsh-adapter/tui-settings.d.ts.map +1 -0
- package/lib/types/dsh-adapter/tui-settings.js +199 -0
- package/lib/types/effortPrefs.d.ts +6 -3
- package/lib/types/effortPrefs.d.ts.map +1 -1
- package/lib/types/effortPrefs.js +7 -4
- package/lib/types/hostEntryRoute.d.ts +18 -0
- package/lib/types/hostEntryRoute.d.ts.map +1 -0
- package/lib/types/hostEntryRoute.js +57 -0
- package/lib/types/i18n.d.ts +363 -1432
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +155 -385
- package/lib/types/ink/components/AlternateScreen.js +2 -2
- package/lib/types/ink/components/App.d.ts +1 -0
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +16 -4
- package/lib/types/ink/components/CursorDeclarationContext.d.ts +9 -0
- package/lib/types/ink/components/CursorDeclarationContext.d.ts.map +1 -1
- package/lib/types/ink/components/CursorDeclarationContext.js +2 -0
- package/lib/types/ink/hooks/use-copy-on-select.d.ts +2 -2
- package/lib/types/ink/hooks/use-copy-on-select.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-copy-on-select.js +13 -7
- package/lib/types/ink/hooks/use-declared-cursor.d.ts +11 -3
- package/lib/types/ink/hooks/use-declared-cursor.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-declared-cursor.js +30 -10
- package/lib/types/ink/ink.d.ts +22 -17
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +151 -40
- package/lib/types/ink/kitty-graphics.d.ts +2 -0
- package/lib/types/ink/kitty-graphics.d.ts.map +1 -1
- package/lib/types/ink/kitty-graphics.js +6 -1
- package/lib/types/ink/node-cache.d.ts +2 -1
- package/lib/types/ink/node-cache.d.ts.map +1 -1
- package/lib/types/ink/output.d.ts +10 -4
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +14 -10
- package/lib/types/ink/render-node-to-output.d.ts +5 -2
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +27 -9
- package/lib/types/ink/renderer.d.ts +1 -0
- package/lib/types/ink/renderer.d.ts.map +1 -1
- package/lib/types/ink/renderer.js +4 -3
- package/lib/types/ink/root.d.ts +4 -1
- package/lib/types/ink/root.d.ts.map +1 -1
- package/lib/types/ink/screen.d.ts +4 -2
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/selection.d.ts +10 -1
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +94 -25
- package/lib/types/ink/stdin-handoff.d.ts +11 -0
- package/lib/types/ink/stdin-handoff.d.ts.map +1 -0
- package/lib/types/ink/stdin-handoff.js +20 -0
- package/lib/types/ink/styles.d.ts +2 -1
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/terminal-image.d.ts +6 -4
- package/lib/types/ink/terminal-image.d.ts.map +1 -1
- package/lib/types/ink/terminal-image.js +16 -39
- package/lib/types/ink/terminal-notification.d.ts +8 -0
- package/lib/types/ink/terminal-notification.d.ts.map +1 -0
- package/lib/types/ink/terminal-notification.js +83 -0
- package/lib/types/ink/terminal.d.ts +9 -0
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +34 -1
- package/lib/types/ink/termio/csi.d.ts +11 -0
- package/lib/types/ink/termio/csi.d.ts.map +1 -1
- package/lib/types/ink/termio/csi.js +13 -0
- package/lib/types/ink/update-overflow-guard.d.ts +6 -0
- package/lib/types/ink/update-overflow-guard.d.ts.map +1 -1
- package/lib/types/ink/update-overflow-guard.js +17 -0
- package/lib/types/ink/wrap-text.d.ts +6 -0
- package/lib/types/ink/wrap-text.d.ts.map +1 -1
- package/lib/types/ink/wrap-text.js +17 -0
- package/lib/types/kernelPrefs.d.ts +129 -16
- package/lib/types/kernelPrefs.d.ts.map +1 -1
- package/lib/types/kernelPrefs.js +98 -35
- package/lib/types/math/inline-layout.d.ts +2 -0
- package/lib/types/math/inline-layout.d.ts.map +1 -1
- package/lib/types/math/inline-layout.js +5 -27
- package/lib/types/modelGroups.d.ts +15 -27
- package/lib/types/modelGroups.d.ts.map +1 -1
- package/lib/types/modelGroups.js +17 -31
- package/lib/types/modelPrefs.d.ts +5 -4
- package/lib/types/modelPrefs.d.ts.map +1 -1
- package/lib/types/modelPrefs.js +5 -4
- package/lib/types/modelRoute.d.ts +23 -9
- package/lib/types/modelRoute.d.ts.map +1 -1
- package/lib/types/modelRoute.js +25 -11
- package/lib/types/permissionPrefs.d.ts +34 -0
- package/lib/types/permissionPrefs.d.ts.map +1 -0
- package/lib/types/permissionPrefs.js +61 -0
- package/lib/types/plugin-host.d.ts +1 -0
- package/lib/types/plugin-host.d.ts.map +1 -1
- package/lib/types/presetPrefs.d.ts +17 -3
- package/lib/types/presetPrefs.d.ts.map +1 -1
- package/lib/types/presetPrefs.js +20 -3
- package/lib/types/reload.d.ts +6 -10
- package/lib/types/reload.d.ts.map +1 -1
- package/lib/types/reload.js +14 -14
- package/lib/types/screens/Chat.d.ts +22 -15
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +442 -272
- package/lib/types/screens/Launchpad.d.ts +27 -17
- package/lib/types/screens/Launchpad.d.ts.map +1 -1
- package/lib/types/screens/Launchpad.js +241 -78
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +53 -12
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +6 -0
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +24 -7
- package/lib/types/screens/StatusMetrics.d.ts +46 -1
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +72 -0
- package/lib/types/screens/chat/useKernelPicker.d.ts +8 -4
- package/lib/types/screens/chat/useKernelPicker.d.ts.map +1 -1
- package/lib/types/screens/chat/useKernelPicker.js +61 -21
- package/lib/types/screens/chat/useModelPicker.d.ts +42 -0
- package/lib/types/screens/chat/useModelPicker.d.ts.map +1 -0
- package/lib/types/screens/chat/useModelPicker.js +182 -0
- package/lib/types/screens/chatOverlay.d.ts +11 -4
- package/lib/types/screens/chatOverlay.d.ts.map +1 -1
- package/lib/types/screens/chatOverlay.js +0 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +4 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +26 -5
- 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 +51 -29
- package/lib/types/sessionHistory.d.ts +5 -0
- package/lib/types/sessionHistory.d.ts.map +1 -1
- package/lib/types/sessionHistory.js +5 -0
- package/lib/types/sessions/listSnapshot.d.ts +6 -0
- package/lib/types/sessions/listSnapshot.d.ts.map +1 -0
- package/lib/types/sessions/listSnapshot.js +67 -0
- package/lib/types/settings/definitions.d.ts +50 -0
- package/lib/types/settings/definitions.d.ts.map +1 -1
- package/lib/types/settings/definitions.js +42 -8
- package/lib/types/terminal-utils/cjk-emphasis.d.ts +28 -0
- package/lib/types/terminal-utils/cjk-emphasis.d.ts.map +1 -0
- package/lib/types/terminal-utils/cjk-emphasis.js +31 -0
- package/lib/types/terminal-utils/markdown.d.ts +3 -1
- package/lib/types/terminal-utils/markdown.d.ts.map +1 -1
- package/lib/types/terminal-utils/markdown.js +7 -2
- package/lib/types/theme.d.ts +29 -12
- package/lib/types/theme.d.ts.map +1 -1
- package/lib/types/theme.js +310 -23
- package/lib/types/themeCatalog.d.ts.map +1 -1
- package/lib/types/themeCatalog.js +21 -2
- package/lib/types/tips.js +4 -4
- package/lib/types/tuiSettingsFile.d.ts +56 -0
- package/lib/types/tuiSettingsFile.d.ts.map +1 -0
- package/lib/types/tuiSettingsFile.js +206 -0
- package/lib/types/ui.d.ts +2 -0
- package/lib/types/ui.d.ts.map +1 -1
- package/lib/types/ui.js +2 -0
- package/lib/types/update.d.ts +72 -26
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +131 -43
- package/lib/types/utils/bmp.d.ts +7 -0
- package/lib/types/utils/bmp.d.ts.map +1 -1
- package/lib/types/utils/bmp.js +27 -0
- package/lib/types/utils/bootTrace.d.ts +2 -0
- package/lib/types/utils/bootTrace.d.ts.map +1 -0
- package/lib/types/utils/bootTrace.js +20 -0
- package/lib/types/utils/clipboard.d.ts.map +1 -1
- package/lib/types/utils/clipboard.js +11 -3
- package/lib/types/utils/credentials.d.ts +14 -2
- package/lib/types/utils/credentials.d.ts.map +1 -1
- package/lib/types/utils/credentials.js +34 -11
- package/lib/types/utils/imageResize.d.ts +10 -20
- package/lib/types/utils/imageResize.d.ts.map +1 -1
- package/lib/types/utils/imageResize.js +61 -134
- package/lib/types/utils/inputPaste.d.ts +2 -2
- package/lib/types/utils/inputPaste.js +2 -2
- package/lib/types/utils/pastedImagePath.d.ts +5 -0
- package/lib/types/utils/pastedImagePath.d.ts.map +1 -1
- package/lib/types/utils/pastedImagePath.js +33 -0
- package/package.json +36 -6
- package/presets/winbash.mjs +716 -0
- package/tui-profile/protocols/profile-definitions.d.ts +1 -0
- package/tui-profile/protocols/profile-definitions.js +14 -0
- package/tui-profile/protocols/tui-contributions.d.ts +55 -0
- package/tui-profile/protocols/tui-contributions.js +141 -0
- package/tui-profile/registry/contracts/backend-v1alpha1.json +13 -0
- package/tui-profile/registry/registry-0.15.json +12 -0
- package/lib/types/backends/claude/install.d.ts +0 -15
- package/lib/types/backends/claude/install.d.ts.map +0 -1
- package/lib/types/backends/claude/install.js +0 -91
- package/lib/types/channel/elicitation.d.ts.map +0 -1
- package/lib/types/dsh-adapter/channel/session-lineage.d.ts +0 -42
- package/lib/types/dsh-adapter/channel/session-lineage.d.ts.map +0 -1
- package/lib/types/dsh-adapter/channel/session-lineage.js +0 -51
- package/lib/types/utils/jsonl.d.ts.map +0 -1
|
@@ -0,0 +1,716 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* custom-bash (winbash) — the Windows-capable full-featured `bash` tool:
|
|
3
|
+
* foreground execution, background jobs, and promote-on-timeout, with the
|
|
4
|
+
* model-facing behavior aligned to the official @deepseek-ai/dsh-tool-bash.
|
|
5
|
+
*
|
|
6
|
+
* WHY this file exists: the official executor (`dsh-bash-local`, the shell
|
|
7
|
+
* seam behind `dsh-tool-bash`) is POSIX-only — its README states "the bash
|
|
8
|
+
* binary is hardcoded and the underlying service's group semantics are POSIX;
|
|
9
|
+
* Windows is unsupported" — and the official persistent bash needs a PTY
|
|
10
|
+
* backend that is linux/darwin-only. This plugin therefore talks to the
|
|
11
|
+
* cross-platform `ctx.subprocess` seam directly (spawning Git Bash) and
|
|
12
|
+
* adapts the process handle onto the generic job registry (`ctx.jobs`),
|
|
13
|
+
* so `run_in_background`, `job_output`/`job_kill`, and the
|
|
14
|
+
* still-running-hand-off work exactly like the official bash/pwsh tools.
|
|
15
|
+
*
|
|
16
|
+
* Lineage: presets/liangshen/custom-bash.mjs (foreground-only; that copy is
|
|
17
|
+
* untouched and keeps serving the liangshen preset's bootstrap anchor). The
|
|
18
|
+
* executable-resolution chain below is carried over verbatim from it.
|
|
19
|
+
*
|
|
20
|
+
* Semantics (aligned with the official tool where noted):
|
|
21
|
+
* - Each call runs `bash -c <command>` in a fresh shell; state never persists.
|
|
22
|
+
* - `run_in_background: true` admits a job via `registry.start` and returns
|
|
23
|
+
* the id at once; no timeout applies to background runs.
|
|
24
|
+
* - A foreground call with the registry composed is registered as a job from
|
|
25
|
+
* its start; when its wait times out the job keeps running and the call
|
|
26
|
+
* returns the promoted hand-off text (official promoteOnTimeout behavior).
|
|
27
|
+
* - Non-zero exits are reported as `[exit code: N]` markers for the model
|
|
28
|
+
* to interpret, not surfaced as tool errors; only infrastructure failures
|
|
29
|
+
* (spawn errors, aborts) throw.
|
|
30
|
+
* - Without a job registry the tool is foreground-only and the registered
|
|
31
|
+
* tool-level timeout kills the command (the liangshen behavior).
|
|
32
|
+
*
|
|
33
|
+
* Self-contained by design: node: built-ins only. `presentCall` and
|
|
34
|
+
* `presentResult` are native `ctx.tools.register` fields (same shape the
|
|
35
|
+
* official pwsh tool registers), so no framework import is needed.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
import { readFileSync } from 'node:fs'
|
|
39
|
+
import { isAbsolute, sep } from 'node:path'
|
|
40
|
+
|
|
41
|
+
/** Cordis plugin name used by loader diagnostics. */
|
|
42
|
+
export const name = 'custom-bash'
|
|
43
|
+
|
|
44
|
+
/** The subprocess and tools services must exist before this tool can register. */
|
|
45
|
+
export const inject = ['subprocess', 'tools']
|
|
46
|
+
|
|
47
|
+
const DEFAULT_TIMEOUT_MS = 120000
|
|
48
|
+
const DEFAULT_MAX_TIMEOUT_MS = 600000
|
|
49
|
+
const DEFAULT_MAX_OUTPUT_BYTES = 64000
|
|
50
|
+
const GRACE_MS = 3000
|
|
51
|
+
|
|
52
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
53
|
+
// Git Bash executable resolution (carried over verbatim from the liangshen
|
|
54
|
+
// preset's custom-bash; explicit override first, then the git tree, then the
|
|
55
|
+
// conventional roots; the WSL launcher is always rejected).
|
|
56
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The explicit override, if any: `config.bashPath`, else the winbash
|
|
60
|
+
* environment variable, else (for compatibility) the liangshen one.
|
|
61
|
+
*/
|
|
62
|
+
function explicitBashPath(config, environment) {
|
|
63
|
+
const names = [config.bashPath, environment.DSH_TUI_WINBASH_BASH_PATH, environment.DSH_TUI_LIANGSHEN_BASH_PATH]
|
|
64
|
+
for (const value of names) {
|
|
65
|
+
if (typeof value === 'string' && value.length > 0) return value
|
|
66
|
+
}
|
|
67
|
+
return undefined
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function addCandidate(candidates, seen, candidate) {
|
|
71
|
+
if (typeof candidate !== 'string' || candidate.length === 0) return
|
|
72
|
+
const key = candidate.toLowerCase()
|
|
73
|
+
if (seen.has(key)) return
|
|
74
|
+
seen.add(key)
|
|
75
|
+
candidates.push(candidate)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Return conventional Git Bash locations in deterministic order (explicit config first). */
|
|
79
|
+
export function windowsBashCandidates(config = {}, environment = process.env) {
|
|
80
|
+
const explicit = explicitBashPath(config, environment)
|
|
81
|
+
if (explicit !== undefined) return [explicit]
|
|
82
|
+
|
|
83
|
+
const candidates = []
|
|
84
|
+
const seen = new Set()
|
|
85
|
+
for (const root of [
|
|
86
|
+
environment.ProgramFiles,
|
|
87
|
+
environment['ProgramFiles(x86)'],
|
|
88
|
+
]) {
|
|
89
|
+
if (typeof root !== 'string' || root.length === 0) continue
|
|
90
|
+
addCandidate(candidates, seen, `${root}\\Git\\bin\\bash.exe`)
|
|
91
|
+
addCandidate(candidates, seen, `${root}\\Git\\usr\\bin\\bash.exe`)
|
|
92
|
+
}
|
|
93
|
+
if (typeof environment.LOCALAPPDATA === 'string' && environment.LOCALAPPDATA.length > 0) {
|
|
94
|
+
addCandidate(candidates, seen, `${environment.LOCALAPPDATA}\\Programs\\Git\\bin\\bash.exe`)
|
|
95
|
+
addCandidate(candidates, seen, `${environment.LOCALAPPDATA}\\Programs\\Git\\usr\\bin\\bash.exe`)
|
|
96
|
+
}
|
|
97
|
+
// Scoop keeps Git under its own root; SCOOP is exported by some setups, but
|
|
98
|
+
// the per-user default location works without it.
|
|
99
|
+
const scoopRoots = []
|
|
100
|
+
if (typeof environment.SCOOP === 'string' && environment.SCOOP.length > 0) {
|
|
101
|
+
scoopRoots.push(environment.SCOOP)
|
|
102
|
+
}
|
|
103
|
+
if (typeof environment.USERPROFILE === 'string' && environment.USERPROFILE.length > 0) {
|
|
104
|
+
scoopRoots.push(`${environment.USERPROFILE}\\scoop`)
|
|
105
|
+
}
|
|
106
|
+
for (const root of scoopRoots) {
|
|
107
|
+
addCandidate(candidates, seen, `${root}\\apps\\git\\current\\bin\\bash.exe`)
|
|
108
|
+
addCandidate(candidates, seen, `${root}\\apps\\git\\current\\usr\\bin\\bash.exe`)
|
|
109
|
+
}
|
|
110
|
+
addCandidate(candidates, seen, 'bash')
|
|
111
|
+
return candidates
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Windows' System32 bash.exe is a WSL launcher, not the Git Bash executor. */
|
|
115
|
+
export function isWindowsSubsystemLauncher(path) {
|
|
116
|
+
return /[\\/]windows[\\/](?:system32|sysnative)[\\/]bash\.exe$/i.test(path)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Scoop-style shim launchers keep the real target in a sibling `.shim` text
|
|
121
|
+
* file (`path = "..."`); follow it so a PATH-resolved git.exe still yields
|
|
122
|
+
* its installation tree.
|
|
123
|
+
*/
|
|
124
|
+
export function resolveShimTarget(exePath, reader = readFileSync) {
|
|
125
|
+
for (const sidecar of [exePath.replace(/\.exe$/i, '') + '.shim', `${exePath}.shim`]) {
|
|
126
|
+
try {
|
|
127
|
+
const text = reader(sidecar, 'utf8')
|
|
128
|
+
const match = text.match(/^\s*path\s*=\s*"?([^"\r\n]+?)"?\s*$/mi)
|
|
129
|
+
if (match !== null) return match[1]
|
|
130
|
+
} catch { /* not a shim launcher */ }
|
|
131
|
+
}
|
|
132
|
+
return exePath
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Bash candidates derived from a git.exe inside a Git for Windows tree. */
|
|
136
|
+
export function bashCandidatesFromGit(gitPath) {
|
|
137
|
+
if (typeof gitPath !== 'string' || gitPath.length === 0) return []
|
|
138
|
+
const parts = gitPath.replace(/\//g, '\\').split('\\').filter((part) => part.length > 0)
|
|
139
|
+
if (parts.at(-1)?.toLowerCase() !== 'git.exe') return []
|
|
140
|
+
const roots = []
|
|
141
|
+
const push = (root) => {
|
|
142
|
+
if (root.length > 0 && !roots.includes(root)) roots.push(root)
|
|
143
|
+
}
|
|
144
|
+
// <root>\cmd\git.exe and <root>\bin\git.exe -> <root>
|
|
145
|
+
if (parts.length >= 3) push(parts.slice(0, -2).join('\\'))
|
|
146
|
+
// <root>\mingw64\bin\git.exe -> <root>; a plain <root>\cmd layout must not
|
|
147
|
+
// also strip its real root.
|
|
148
|
+
if (parts.length >= 5
|
|
149
|
+
&& parts.at(-2)?.toLowerCase() === 'bin'
|
|
150
|
+
&& /^mingw(32|64)$/.test(parts.at(-3) ?? '')) {
|
|
151
|
+
push(parts.slice(0, -3).join('\\'))
|
|
152
|
+
}
|
|
153
|
+
const candidates = []
|
|
154
|
+
for (const root of roots) {
|
|
155
|
+
candidates.push(`${root}\\bin\\bash.exe`, `${root}\\usr\\bin\\bash.exe`)
|
|
156
|
+
}
|
|
157
|
+
return candidates
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Follow the PATH-visible git executable to its installation tree: every
|
|
162
|
+
* Windows Git install ships git-bash next to git, wherever it was installed,
|
|
163
|
+
* so this covers installer, portable, and Scoop layouts without hardcoding.
|
|
164
|
+
*/
|
|
165
|
+
async function gitTreeCandidates(subprocess, failures) {
|
|
166
|
+
let gitPath
|
|
167
|
+
try {
|
|
168
|
+
gitPath = await subprocess.resolveExecutable('git')
|
|
169
|
+
} catch (error) {
|
|
170
|
+
failures.push(`git: ${error instanceof Error ? error.message : String(error)}`)
|
|
171
|
+
return []
|
|
172
|
+
}
|
|
173
|
+
return bashCandidatesFromGit(resolveShimTarget(gitPath))
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** Resolve Git Bash without accidentally accepting the WSL compatibility shim. */
|
|
177
|
+
export async function resolveWindowsBash(subprocess, config = {}, environment = process.env) {
|
|
178
|
+
const failures = []
|
|
179
|
+
const explicit = explicitBashPath(config, environment)
|
|
180
|
+
const candidates = explicit !== undefined
|
|
181
|
+
// An explicit path is honored as-is: never silently substitute a guess.
|
|
182
|
+
? [explicit]
|
|
183
|
+
: [...await gitTreeCandidates(subprocess, failures), ...windowsBashCandidates(config, environment)]
|
|
184
|
+
for (const candidate of candidates) {
|
|
185
|
+
try {
|
|
186
|
+
const resolved = await subprocess.resolveExecutable(candidate)
|
|
187
|
+
if (isWindowsSubsystemLauncher(resolved)) {
|
|
188
|
+
failures.push(`${candidate}: resolved to the Windows Subsystem for Linux launcher`)
|
|
189
|
+
continue
|
|
190
|
+
}
|
|
191
|
+
return resolved
|
|
192
|
+
} catch (error) {
|
|
193
|
+
failures.push(`${candidate}: ${error instanceof Error ? error.message : String(error)}`)
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
throw new Error(`Git Bash executable unavailable (${failures.join('; ')})`)
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function warn(ctx, message) {
|
|
200
|
+
try {
|
|
201
|
+
ctx.logger.warn(message)
|
|
202
|
+
} catch {
|
|
203
|
+
// Logger unavailable — registration is skipped either way.
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
208
|
+
// Model-facing rendering (shapes aligned with the official dsh-tool-bash).
|
|
209
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
210
|
+
|
|
211
|
+
/** Read one collected stream of a settled process into a value-stream pair. */
|
|
212
|
+
function streamValue(handle, channel) {
|
|
213
|
+
const reader = handle?.collected?.[channel]
|
|
214
|
+
if (reader === undefined || typeof reader.readFrom !== 'function') {
|
|
215
|
+
return { text: '', truncated: false }
|
|
216
|
+
}
|
|
217
|
+
try {
|
|
218
|
+
const chunk = reader.readFrom(0)
|
|
219
|
+
return {
|
|
220
|
+
text: typeof chunk?.text === 'string' ? chunk.text : '',
|
|
221
|
+
truncated: chunk?.lossy === true,
|
|
222
|
+
}
|
|
223
|
+
} catch {
|
|
224
|
+
return { text: '', truncated: false }
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Shape one finished run into the text the model sees: stdout, then a marked
|
|
230
|
+
* stderr section, then exit-status markers. Non-zero exits are reported, not
|
|
231
|
+
* errored — the model decides how to react (official semantics).
|
|
232
|
+
*/
|
|
233
|
+
function renderResult(result) {
|
|
234
|
+
let body = result.stdout.text
|
|
235
|
+
if (result.stderr.text.length > 0) {
|
|
236
|
+
if (body.length > 0 && !body.endsWith('\n')) body += '\n'
|
|
237
|
+
body += `[stderr]\n${result.stderr.text}`
|
|
238
|
+
}
|
|
239
|
+
if (body.length === 0) body = '(no output)'
|
|
240
|
+
const markers = []
|
|
241
|
+
if (result.timedOut) markers.push(`[timed out after ${result.timeoutMs}ms]`)
|
|
242
|
+
if (result.stopped !== undefined) markers.push(`[stopped: ${result.stopped}]`)
|
|
243
|
+
if (result.signal !== null) markers.push(`[killed by signal: ${result.signal}]`)
|
|
244
|
+
else if (result.exitCode !== 0 && result.exitCode !== null) markers.push(`[exit code: ${result.exitCode}]`)
|
|
245
|
+
if (markers.length === 0) return body
|
|
246
|
+
if (!body.endsWith('\n')) body += '\n'
|
|
247
|
+
return body + markers.join('\n')
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/** The promoted hand-off text (official wording). */
|
|
251
|
+
function renderPromoted(promoted) {
|
|
252
|
+
return `${promoted.output.length > 0 ? promoted.output.endsWith('\n') ? promoted.output : `${promoted.output}\n` : ''}[still running after ${promoted.timeoutMs}ms; moved to background job ${promoted.jobId}]\nThe command keeps running in the background. You will be notified when it finishes; read newer output with job_output, stop it with job_kill.`
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** Map an execute() value onto the text block the model reads. */
|
|
256
|
+
function renderValue(value) {
|
|
257
|
+
if (value?.kind === 'background') return `started background job ${value.jobId}`
|
|
258
|
+
if (value?.kind === 'promoted') return renderPromoted(value)
|
|
259
|
+
if (value?.kind === 'foreground') return renderResult(value)
|
|
260
|
+
return String(value)
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Reverse the exit-status markers renderResult appends, so presentResult can
|
|
265
|
+
* split a rendered body from its exit facts (small local stand-in for the
|
|
266
|
+
* official dsh-shell parseExitStatus).
|
|
267
|
+
*/
|
|
268
|
+
function parseExitStatus(raw) {
|
|
269
|
+
const lines = raw.split('\n')
|
|
270
|
+
const exit = {}
|
|
271
|
+
let index = lines.length - 1
|
|
272
|
+
while (index >= 0) {
|
|
273
|
+
const line = lines[index]
|
|
274
|
+
let match
|
|
275
|
+
if ((match = line.match(/^\[exit code: (\d+)\]$/)) !== null) {
|
|
276
|
+
if (exit.exitCode === undefined) exit.exitCode = Number(match[1])
|
|
277
|
+
index -= 1
|
|
278
|
+
continue
|
|
279
|
+
}
|
|
280
|
+
if ((match = line.match(/^\[killed by signal: (.+)\]$/)) !== null) {
|
|
281
|
+
if (exit.signal === undefined) exit.signal = match[1]
|
|
282
|
+
index -= 1
|
|
283
|
+
continue
|
|
284
|
+
}
|
|
285
|
+
if (/^\[timed out after \d+ms\]$/.test(line) || /^\[stopped: .+\]$/.test(line)) {
|
|
286
|
+
index -= 1
|
|
287
|
+
continue
|
|
288
|
+
}
|
|
289
|
+
break
|
|
290
|
+
}
|
|
291
|
+
while (index >= 0 && lines[index] === '') index -= 1
|
|
292
|
+
return { body: lines.slice(0, index + 1).join('\n'), ...exit }
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
296
|
+
// Generic-job adaptation for subprocess handles (shapes follow the official
|
|
297
|
+
// dsh-tool-bash background adaptation).
|
|
298
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
299
|
+
|
|
300
|
+
/** Map a settled subprocess onto the job-outcome vocabulary the registry records. */
|
|
301
|
+
function processOutcome(settled, aborted) {
|
|
302
|
+
if (aborted) {
|
|
303
|
+
return {
|
|
304
|
+
status: 'killed',
|
|
305
|
+
detail: settled?.signal != null ? `signal: ${settled.signal}` : 'killed before exit',
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return { status: 'completed', detail: `exit code: ${settled?.exitCode ?? 0}` }
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* The process's non-consuming stream readers as registry pull sources. They
|
|
313
|
+
* bind lazily because the process is spawned inside the starter, after the
|
|
314
|
+
* registry admitted the job; a read before the spawn yields nothing, and the
|
|
315
|
+
* pump keeps the model's consuming cursor untouched.
|
|
316
|
+
*/
|
|
317
|
+
function processSources(procRef) {
|
|
318
|
+
const source = (channel) => ({
|
|
319
|
+
channel,
|
|
320
|
+
read: (fromByte) => {
|
|
321
|
+
const reader = procRef()?.collected?.[channel]
|
|
322
|
+
if (reader === undefined || typeof reader.readFrom !== 'function') {
|
|
323
|
+
return { text: '', nextOffset: fromByte, lossy: false }
|
|
324
|
+
}
|
|
325
|
+
try {
|
|
326
|
+
const chunk = reader.readFrom(fromByte)
|
|
327
|
+
return {
|
|
328
|
+
text: typeof chunk?.text === 'string' ? chunk.text : '',
|
|
329
|
+
nextOffset: typeof chunk?.nextOffset === 'number' ? chunk.nextOffset : fromByte,
|
|
330
|
+
lossy: chunk?.lossy === true,
|
|
331
|
+
}
|
|
332
|
+
} catch {
|
|
333
|
+
return { text: '', nextOffset: fromByte, lossy: false }
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
})
|
|
337
|
+
return [source('stdout'), source('stderr')]
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Adapt asynchronous process preparation after job admission without exposing
|
|
342
|
+
* a partial process: job-owned cancellation, completion including settlement.
|
|
343
|
+
*/
|
|
344
|
+
function processJob(start, outcome) {
|
|
345
|
+
const controller = new AbortController()
|
|
346
|
+
let process
|
|
347
|
+
return {
|
|
348
|
+
cancel: (reason) => {
|
|
349
|
+
if (controller.signal.aborted) return
|
|
350
|
+
controller.abort(reason)
|
|
351
|
+
try { process?.kill?.() } catch { /* signal abort drives the subprocess service */ }
|
|
352
|
+
},
|
|
353
|
+
done: (async () => {
|
|
354
|
+
let settled
|
|
355
|
+
try {
|
|
356
|
+
process = await start(controller.signal)
|
|
357
|
+
try { if (controller.signal.aborted) process.kill?.() } catch { /* already settling */ }
|
|
358
|
+
settled = await process.done
|
|
359
|
+
return outcome(process, settled, controller.signal.aborted)
|
|
360
|
+
} catch (error) {
|
|
361
|
+
// A cancelled run settles as killed whichever way the teardown
|
|
362
|
+
// surfaces (the subprocess seam rethrows the abort as an error
|
|
363
|
+
// once the process was already running): the intent was the kill.
|
|
364
|
+
return {
|
|
365
|
+
status: controller.signal.aborted ? 'killed' : 'failed',
|
|
366
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
})(),
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* The ring chunks of one consuming registry read as the shell tools render a
|
|
375
|
+
* process read: stdout chunks in order, then every stderr chunk in one
|
|
376
|
+
* `[stderr]` section.
|
|
377
|
+
*/
|
|
378
|
+
function ringDelta(chunks) {
|
|
379
|
+
const out = chunks.filter((chunk) => chunk.channel !== 'stderr').map((chunk) => chunk.text).join('')
|
|
380
|
+
const err = chunks.filter((chunk) => chunk.channel === 'stderr').map((chunk) => chunk.text).join('')
|
|
381
|
+
const separator = out.length > 0 && !out.endsWith('\n') ? '\n' : ''
|
|
382
|
+
return out + (err.length > 0 ? `${separator}[stderr]\n${err}` : '')
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/** Append the dropped-output notice when the model cursor fell behind the ring. */
|
|
386
|
+
function withNotices(delta, lossy) {
|
|
387
|
+
if (!lossy) return delta
|
|
388
|
+
return `${delta}${delta.length > 0 && !delta.endsWith('\n') ? '\n' : ''}[some output was dropped from memory]`
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
392
|
+
// Plugin entry.
|
|
393
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
394
|
+
|
|
395
|
+
/** Register the model-facing `bash` tool. */
|
|
396
|
+
export async function apply(ctx, config) {
|
|
397
|
+
const source = config === undefined ? {} : config
|
|
398
|
+
const defaultTimeoutMs = Number.isSafeInteger(source.timeoutMs) && source.timeoutMs > 0 ? source.timeoutMs : DEFAULT_TIMEOUT_MS
|
|
399
|
+
const maxTimeoutMs = Number.isSafeInteger(source.maxTimeoutMs) && source.maxTimeoutMs > 0
|
|
400
|
+
? Math.max(source.maxTimeoutMs, defaultTimeoutMs)
|
|
401
|
+
: DEFAULT_MAX_TIMEOUT_MS
|
|
402
|
+
const maxOutputBytes = Number.isSafeInteger(source.maxOutputBytes) && source.maxOutputBytes > 0 ? source.maxOutputBytes : DEFAULT_MAX_OUTPUT_BYTES
|
|
403
|
+
const enableRunInBackground = source.enableRunInBackground !== false
|
|
404
|
+
const promote = source.promoteOnTimeout !== false
|
|
405
|
+
const graceMs = Number.isSafeInteger(source.graceMs) && source.graceMs > 0 ? source.graceMs : GRACE_MS
|
|
406
|
+
|
|
407
|
+
let bashPath
|
|
408
|
+
try {
|
|
409
|
+
bashPath = await resolveWindowsBash(ctx.subprocess, source)
|
|
410
|
+
} catch (error) {
|
|
411
|
+
// Skip registration on a miss: an absent `bash` in the assembled catalog
|
|
412
|
+
// makes tool-bootstrap fail open to the full catalog, while a registered
|
|
413
|
+
// tool that cannot spawn would fail on every call mid-session.
|
|
414
|
+
warn(ctx, `custom-bash: ${error instanceof Error ? error.message : String(error)} — the Windows bash tool is not registered; the bootstrap filter will expose the full catalog`)
|
|
415
|
+
return
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
const bashDescription = (background, promoteOnTimeout) => [
|
|
419
|
+
'Run commands in a bash shell (Git Bash on Windows).',
|
|
420
|
+
'* When invoking this tool, the contents of the "command" parameter does NOT need to be XML-escaped.',
|
|
421
|
+
"* State does NOT persist across command calls: each call runs in a fresh shell — chain steps with && or ; inside one command.",
|
|
422
|
+
"* To inspect a particular line range of a file, e.g. lines 10-25, try 'sed -n 10,25p /path/to/the/file'.",
|
|
423
|
+
'* Please avoid commands that may produce a very large amount of output.',
|
|
424
|
+
'* Non-zero exits are reported as `[exit code: N]` markers; investigate failures before moving on.',
|
|
425
|
+
'* Windows drives are /d/code/... in this shell; quote native Windows paths.',
|
|
426
|
+
'* NOTE: runs without OS sandbox confinement on Windows (no landlock); treat output as untrusted.',
|
|
427
|
+
...(background ? [
|
|
428
|
+
'* Pass `run_in_background: true` to run long commands as background jobs (collect with job_output, stop with job_kill); no timeout applies to background runs.',
|
|
429
|
+
...(promoteOnTimeout ? ['* A foreground command that outlives its timeout keeps running as its background job instead of being killed.'] : []),
|
|
430
|
+
] : []),
|
|
431
|
+
].join('\n')
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* One registration of the `bash` tool. With a registry, every call
|
|
435
|
+
* registers its process as a job at its start; without one the tool is
|
|
436
|
+
* foreground-only and the tool-level timeout kills the command.
|
|
437
|
+
*/
|
|
438
|
+
const makeTool = (jobs) => {
|
|
439
|
+
const background = jobs !== undefined
|
|
440
|
+
const foregroundPromote = background && promote
|
|
441
|
+
|
|
442
|
+
/** Register the command as a job; the process spawns inside the starter, after admission. */
|
|
443
|
+
const startJob = (registry, args, exec, workdir) => {
|
|
444
|
+
let proc
|
|
445
|
+
let stopped
|
|
446
|
+
return {
|
|
447
|
+
id: registry.start({
|
|
448
|
+
kind: 'bash',
|
|
449
|
+
label: args.command,
|
|
450
|
+
...(exec?.agent !== undefined ? { owner: exec.agent.id } : {}),
|
|
451
|
+
output: processSources(() => proc),
|
|
452
|
+
run: () => {
|
|
453
|
+
const hooks = processJob(
|
|
454
|
+
(signal) => {
|
|
455
|
+
proc = ctx.subprocess.spawn({
|
|
456
|
+
argv: [bashPath, '-c', args.command],
|
|
457
|
+
...(workdir !== undefined ? { cwd: workdir } : {}),
|
|
458
|
+
stdio: {
|
|
459
|
+
stdin: 'ignore',
|
|
460
|
+
stdout: { maxBytes: maxOutputBytes },
|
|
461
|
+
stderr: { maxBytes: maxOutputBytes },
|
|
462
|
+
},
|
|
463
|
+
signal,
|
|
464
|
+
graceMs,
|
|
465
|
+
})
|
|
466
|
+
return proc
|
|
467
|
+
},
|
|
468
|
+
(_started, settled, aborted) => processOutcome(settled, aborted),
|
|
469
|
+
)
|
|
470
|
+
return {
|
|
471
|
+
done: hooks.done,
|
|
472
|
+
cancel: (reason) => {
|
|
473
|
+
stopped = reason
|
|
474
|
+
hooks.cancel(reason)
|
|
475
|
+
},
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
}),
|
|
479
|
+
process: () => proc,
|
|
480
|
+
stopped: () => stopped,
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/** Wait on a registered foreground command until it settles or the timeout passes. */
|
|
485
|
+
const waitOnJob = async (registry, attached, exec, timeoutMs) => {
|
|
486
|
+
const owner = exec?.agent?.id
|
|
487
|
+
/**
|
|
488
|
+
* Stop the job on this call's own account and stay on it until it
|
|
489
|
+
* settles, so the settlement is awaited and no completion notice
|
|
490
|
+
* follows a result this call already carries; the record then leaves
|
|
491
|
+
* with the call, as the model never saw the id.
|
|
492
|
+
*/
|
|
493
|
+
const stop = async (reason) => {
|
|
494
|
+
try { registry.kill(attached.id, owner, reason) } catch { /* already settled */ }
|
|
495
|
+
let settled
|
|
496
|
+
try { settled = await registry.wait(attached.id, timeoutMs, owner) } catch { settled = undefined }
|
|
497
|
+
if (settled !== undefined && settled.status !== 'running' && settled.status !== 'stopping') {
|
|
498
|
+
try { registry.remove(attached.id, owner) } catch { /* already removed */ }
|
|
499
|
+
}
|
|
500
|
+
return settled
|
|
501
|
+
}
|
|
502
|
+
let view
|
|
503
|
+
try {
|
|
504
|
+
view = await registry.wait(attached.id, timeoutMs, owner, exec?.signal)
|
|
505
|
+
} catch {
|
|
506
|
+
await stop('tool call aborted')
|
|
507
|
+
throw new Error('tool call aborted')
|
|
508
|
+
}
|
|
509
|
+
if ((view.status === 'running' || view.status === 'stopping') && attached.process() === undefined) {
|
|
510
|
+
await stop('timed out during preparation')
|
|
511
|
+
return {
|
|
512
|
+
kind: 'foreground',
|
|
513
|
+
exitCode: null,
|
|
514
|
+
signal: null,
|
|
515
|
+
timedOut: true,
|
|
516
|
+
aborted: false,
|
|
517
|
+
timeoutMs,
|
|
518
|
+
stdout: { text: '', truncated: false },
|
|
519
|
+
stderr: { text: '', truncated: false },
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
if (view.status === 'running' || view.status === 'stopping') {
|
|
523
|
+
let read
|
|
524
|
+
try { read = registry.read(attached.id, owner) } catch { read = { chunks: [], lossy: false } }
|
|
525
|
+
return {
|
|
526
|
+
kind: 'promoted',
|
|
527
|
+
jobId: attached.id,
|
|
528
|
+
timeoutMs,
|
|
529
|
+
output: withNotices(ringDelta(read.chunks ?? []), read.lossy === true),
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
try { registry.remove(attached.id, owner) } catch { /* already removed */ }
|
|
533
|
+
const proc = attached.process()
|
|
534
|
+
if (proc === undefined) throw new Error(typeof view.detail === 'string' ? view.detail : 'bash process failed to start')
|
|
535
|
+
let settled
|
|
536
|
+
try {
|
|
537
|
+
settled = await proc.done
|
|
538
|
+
} catch (error) {
|
|
539
|
+
throw new Error(`bash spawn failed: ${String(error)}`)
|
|
540
|
+
}
|
|
541
|
+
const stopped = attached.stopped()
|
|
542
|
+
return {
|
|
543
|
+
kind: 'foreground',
|
|
544
|
+
exitCode: settled.exitCode ?? null,
|
|
545
|
+
signal: settled.signal ?? null,
|
|
546
|
+
timedOut: false,
|
|
547
|
+
aborted: false,
|
|
548
|
+
timeoutMs,
|
|
549
|
+
stdout: streamValue(proc, 'stdout'),
|
|
550
|
+
stderr: streamValue(proc, 'stderr'),
|
|
551
|
+
...(stopped !== undefined ? { stopped } : {}),
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
return {
|
|
556
|
+
name: 'bash',
|
|
557
|
+
description: bashDescription(background, foregroundPromote),
|
|
558
|
+
parameters: {
|
|
559
|
+
type: 'object',
|
|
560
|
+
properties: {
|
|
561
|
+
command: {
|
|
562
|
+
type: 'string',
|
|
563
|
+
description: 'The bash command to execute (`bash -c` string domain).',
|
|
564
|
+
},
|
|
565
|
+
description: {
|
|
566
|
+
type: 'string',
|
|
567
|
+
description: 'Clear, concise description of what this command does in active voice, 5-10 words (shown in the UI). Examples: "List files in current directory"; "git status" → "Show working tree status".',
|
|
568
|
+
},
|
|
569
|
+
workdir: {
|
|
570
|
+
type: 'string',
|
|
571
|
+
description: 'Optional working directory; defaults to the session cwd; a relative path is resolved against it.',
|
|
572
|
+
},
|
|
573
|
+
timeoutMs: {
|
|
574
|
+
type: 'number',
|
|
575
|
+
description: foregroundPromote
|
|
576
|
+
? 'Timeout in milliseconds. The tool applies its configured default and cap; on expiry the command moves to the background as a job instead of being killed.'
|
|
577
|
+
: 'Timeout in milliseconds. The tool applies its configured default and cap, and kills the command on expiry.',
|
|
578
|
+
},
|
|
579
|
+
...(background ? {
|
|
580
|
+
run_in_background: {
|
|
581
|
+
type: 'boolean',
|
|
582
|
+
description: 'Run in the background and return a job id immediately (collect with job_output, stop with job_kill). No background execution timeout applies.',
|
|
583
|
+
},
|
|
584
|
+
} : {}),
|
|
585
|
+
},
|
|
586
|
+
required: ['command', 'description'],
|
|
587
|
+
additionalProperties: false,
|
|
588
|
+
},
|
|
589
|
+
// With the registry composed the tool-level timeout is the hard cap
|
|
590
|
+
// (the per-call timeout promotes first); without one it is the kill.
|
|
591
|
+
timeoutMs: background ? maxTimeoutMs : defaultTimeoutMs,
|
|
592
|
+
output: {
|
|
593
|
+
schema: { type: 'object' },
|
|
594
|
+
render: (_args, value) => [{ type: 'text', text: renderValue(value) }],
|
|
595
|
+
},
|
|
596
|
+
async execute(args, exec) {
|
|
597
|
+
if (typeof args.command !== 'string' || args.command.trim().length === 0) {
|
|
598
|
+
throw new Error('invalid command: expected a non-empty string')
|
|
599
|
+
}
|
|
600
|
+
if (typeof args.description !== 'string' || args.description.trim().length === 0) {
|
|
601
|
+
throw new Error('invalid description: expected a non-empty string')
|
|
602
|
+
}
|
|
603
|
+
if (args.timeoutMs !== undefined && (!Number.isFinite(args.timeoutMs) || args.timeoutMs <= 0)) {
|
|
604
|
+
throw new Error(`invalid timeoutMs: expected a positive number, got ${JSON.stringify(args.timeoutMs)}`)
|
|
605
|
+
}
|
|
606
|
+
const sessionCwd = exec?.agent?.session?.header?.cwd
|
|
607
|
+
let workdir = typeof args.workdir === 'string' && args.workdir.length > 0 ? args.workdir : sessionCwd
|
|
608
|
+
if (workdir !== undefined && !isAbsolute(workdir) && sessionCwd !== undefined) {
|
|
609
|
+
workdir = `${sessionCwd}${sep}${workdir}`
|
|
610
|
+
}
|
|
611
|
+
const timeoutMs = Math.min(args.timeoutMs ?? defaultTimeoutMs, maxTimeoutMs)
|
|
612
|
+
|
|
613
|
+
if (args.run_in_background === true) {
|
|
614
|
+
if (!enableRunInBackground) throw new Error('run_in_background is disabled for this deployment (enableRunInBackground: false)')
|
|
615
|
+
if (jobs === undefined) throw new Error('background jobs unavailable: load @deepseek-ai/dsh-jobs and @deepseek-ai/dsh-tool-jobs')
|
|
616
|
+
if (exec?.signal?.aborted) throw new Error('tool call aborted')
|
|
617
|
+
return { kind: 'background', jobId: startJob(jobs, args, exec, workdir).id }
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
if (foregroundPromote) {
|
|
621
|
+
let attached
|
|
622
|
+
try {
|
|
623
|
+
attached = startJob(jobs, args, exec, workdir)
|
|
624
|
+
} catch (error) {
|
|
625
|
+
warn(ctx, `custom-bash: job registration refused, running in the foreground with the timeout kill instead: ${String(error)}`)
|
|
626
|
+
}
|
|
627
|
+
if (attached !== undefined) return waitOnJob(jobs, attached, exec, timeoutMs)
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
// Foreground without a registry (or when registration was refused):
|
|
631
|
+
// the liangshen behavior — spawn, wait, report.
|
|
632
|
+
const signal = exec?.signal
|
|
633
|
+
let handle
|
|
634
|
+
let outcome
|
|
635
|
+
try {
|
|
636
|
+
handle = ctx.subprocess.spawn({
|
|
637
|
+
argv: [bashPath, '-c', args.command],
|
|
638
|
+
...(workdir !== undefined ? { cwd: workdir } : {}),
|
|
639
|
+
stdio: {
|
|
640
|
+
stdin: 'ignore',
|
|
641
|
+
stdout: { maxBytes: maxOutputBytes },
|
|
642
|
+
stderr: { maxBytes: maxOutputBytes },
|
|
643
|
+
},
|
|
644
|
+
...(signal !== undefined ? { signal } : {}),
|
|
645
|
+
graceMs,
|
|
646
|
+
})
|
|
647
|
+
outcome = await handle.done
|
|
648
|
+
} catch (error) {
|
|
649
|
+
throw new Error(`bash spawn failed: ${String(error)}`)
|
|
650
|
+
}
|
|
651
|
+
return {
|
|
652
|
+
kind: 'foreground',
|
|
653
|
+
exitCode: outcome.exitCode ?? null,
|
|
654
|
+
signal: outcome.signal ?? null,
|
|
655
|
+
timedOut: false,
|
|
656
|
+
aborted: false,
|
|
657
|
+
timeoutMs,
|
|
658
|
+
stdout: streamValue(handle, 'stdout'),
|
|
659
|
+
stderr: streamValue(handle, 'stderr'),
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
presentCall: (args) => {
|
|
663
|
+
if (args.run_in_background === true) {
|
|
664
|
+
return {
|
|
665
|
+
card: 'generic',
|
|
666
|
+
title: args.command,
|
|
667
|
+
kind: 'execute',
|
|
668
|
+
rawInput: args.command,
|
|
669
|
+
content: [{ type: 'text', text: args.description }],
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
return {
|
|
673
|
+
card: 'terminal',
|
|
674
|
+
title: args.command,
|
|
675
|
+
description: args.description,
|
|
676
|
+
...(args.workdir !== undefined ? { cwd: args.workdir } : {}),
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
presentResult: (args, result) => {
|
|
680
|
+
const block = result.content.length === 1 ? result.content[0] : undefined
|
|
681
|
+
if (block === undefined || block.type !== 'text') return undefined
|
|
682
|
+
const raw = block.text
|
|
683
|
+
const isBackground = typeof args === 'object' && args !== null && args.run_in_background === true
|
|
684
|
+
const isPromoted = result.value?.kind === 'promoted'
|
|
685
|
+
if (isBackground || isPromoted || result.isError) {
|
|
686
|
+
return {
|
|
687
|
+
card: 'generic',
|
|
688
|
+
content: [{
|
|
689
|
+
type: 'text',
|
|
690
|
+
text: `\`\`\`console\n${raw.replace(/\n+$/, '')}\n\`\`\``,
|
|
691
|
+
}],
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
const { body, ...exit } = parseExitStatus(raw)
|
|
695
|
+
return { card: 'terminal', output: body, ...exit }
|
|
696
|
+
},
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
if (!enableRunInBackground) {
|
|
701
|
+
ctx.tools.register(makeTool(undefined))
|
|
702
|
+
return
|
|
703
|
+
}
|
|
704
|
+
let foregroundOnly = ctx.get('jobs') === undefined ? ctx.tools.register(makeTool(undefined)) : undefined
|
|
705
|
+
ctx.inject(['jobs'], (jobCtx) => {
|
|
706
|
+
if (typeof foregroundOnly === 'function') {
|
|
707
|
+
foregroundOnly()
|
|
708
|
+
foregroundOnly = undefined
|
|
709
|
+
}
|
|
710
|
+
const unregister = ctx.tools.register(makeTool(jobCtx.jobs))
|
|
711
|
+
jobCtx.effect(() => () => {
|
|
712
|
+
unregister()
|
|
713
|
+
if (ctx.fiber?.state === 2) foregroundOnly = ctx.tools.register(makeTool(undefined))
|
|
714
|
+
})
|
|
715
|
+
})
|
|
716
|
+
}
|