@deepseek-harness-tui/dsh-tui 0.14.1 → 0.16.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 +163 -17
- 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 +47 -10
- package/guide/dsh-tui-guide/codex-backend.md +26 -4
- package/guide/dsh-tui-guide/configuration.en.md +168 -18
- package/guide/dsh-tui-guide/configuration.md +144 -16
- package/guide/dsh-tui-guide/getting-started.en.md +15 -0
- package/guide/dsh-tui-guide/getting-started.md +15 -0
- package/guide/dsh-tui-guide/interaction.en.md +64 -24
- package/guide/dsh-tui-guide/interaction.md +49 -19
- package/guide/dsh-tui-guide/plugins.en.md +97 -3
- package/guide/dsh-tui-guide/plugins.md +55 -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 +53 -21
- package/guide/dsh-tui-guide/user-guide.md +43 -22
- package/lib/settings.json +103 -9
- package/lib/types/adapter/channel/projection.d.ts.map +1 -1
- package/lib/types/adapter/channel/projection.js +1 -0
- package/lib/types/adapter/channel/ui-policy.d.ts +1 -1
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +4 -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-catalog.d.ts +5 -1
- package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-settings.d.ts +14 -3
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +56 -12
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +68 -0
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel.d.ts +2 -0
- package/lib/types/adapter/ports/channel.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/events.d.ts +3 -2
- package/lib/types/agent/events.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/contract.d.ts +3 -0
- package/lib/types/backends/codex/contract.d.ts.map +1 -1
- package/lib/types/backends/codex/contract.js +3 -0
- 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/async-questions.d.ts +17 -0
- package/lib/types/backends/codex/session/async-questions.d.ts.map +1 -0
- package/lib/types/backends/codex/session/async-questions.js +89 -0
- 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 +100 -42
- 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.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/items.js +7 -5
- 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/codex/translate/question-reply.d.ts +11 -0
- package/lib/types/backends/codex/translate/question-reply.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/question-reply.js +53 -0
- 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/projection.d.ts.map +1 -1
- package/lib/types/channel/projection.js +10 -0
- 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 +15 -0
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +58 -10
- 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 +24 -7
- 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 +4 -1
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +14 -9
- 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 +109 -15
- 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/PermissionsPicker.d.ts +10 -1
- package/lib/types/components/PermissionsPicker.d.ts.map +1 -1
- package/lib/types/components/PermissionsPicker.js +24 -16
- package/lib/types/components/PluginInstallPane.d.ts +21 -0
- package/lib/types/components/PluginInstallPane.d.ts.map +1 -0
- package/lib/types/components/PluginInstallPane.js +84 -0
- package/lib/types/components/PluginManagePane.d.ts +21 -0
- package/lib/types/components/PluginManagePane.d.ts.map +1 -0
- package/lib/types/components/PluginManagePane.js +69 -0
- 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 +65 -121
- 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/SubagentCard.d.ts +13 -1
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +27 -12
- package/lib/types/components/SubagentDashboard.d.ts +8 -1
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +58 -16
- 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 +14 -1
- package/lib/types/components/launchpadLayout.d.ts.map +1 -1
- package/lib/types/components/launchpadLayout.js +38 -19
- package/lib/types/components/messages/TeamMessageBubble.d.ts +20 -0
- package/lib/types/components/messages/TeamMessageBubble.d.ts.map +1 -0
- package/lib/types/components/messages/TeamMessageBubble.js +15 -0
- 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/PanelHost.d.ts.map +1 -1
- package/lib/types/components/sidePanel/PanelHost.js +5 -1
- package/lib/types/components/sidePanel/PanelStore.d.ts +8 -0
- package/lib/types/components/sidePanel/PanelStore.d.ts.map +1 -1
- package/lib/types/components/sidePanel/PanelStore.js +11 -0
- 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 +15 -2
- 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/SidePanelRuntimeContext.d.ts +7 -0
- package/lib/types/components/sidePanel/SidePanelRuntimeContext.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelRuntimeContext.js +4 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +7 -2
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.js +28 -8
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts +2 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +156 -21
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +6 -2
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +64 -16
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts +15 -5
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadView.js +101 -10
- package/lib/types/components/sidePanel/btw/threads.d.ts +18 -0
- package/lib/types/components/sidePanel/btw/threads.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/threads.js +51 -0
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
- package/lib/types/components/sidePanel/builtinPanels.js +5 -1
- package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -2
- package/lib/types/components/sidePanel/companion/SplashMascot.d.ts +5 -1
- package/lib/types/components/sidePanel/companion/SplashMascot.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/SplashMascot.js +19 -4
- package/lib/types/components/sidePanel/companion/skins.d.ts +8 -0
- package/lib/types/components/sidePanel/companion/skins.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/skins.js +57 -12
- package/lib/types/components/sidePanel/types.d.ts +7 -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/splashArtRows.d.ts +29 -0
- package/lib/types/components/splashArtRows.d.ts.map +1 -0
- package/lib/types/components/splashArtRows.js +31 -0
- 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/teamRoster.d.ts +70 -0
- package/lib/types/components/teamRoster.d.ts.map +1 -0
- package/lib/types/components/teamRoster.js +78 -0
- 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 +102 -0
- package/lib/types/dsh-adapter/admission-loader.d.ts.map +1 -0
- package/lib/types/dsh-adapter/admission-loader.js +301 -0
- package/lib/types/dsh-adapter/agent-view.d.ts.map +1 -1
- package/lib/types/dsh-adapter/agent-view.js +3 -1
- package/lib/types/dsh-adapter/approvals.d.ts +7 -0
- package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
- package/lib/types/dsh-adapter/approvals.js +45 -1
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +71 -8
- 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-assembly.d.ts +31 -0
- package/lib/types/dsh-adapter/backend-assembly.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend-assembly.js +225 -0
- package/lib/types/dsh-adapter/backend-contribution.d.ts +62 -0
- package/lib/types/dsh-adapter/backend-contribution.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend-contribution.js +78 -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 +304 -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 +91 -46
- package/lib/types/dsh-adapter/bundled-presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/bundled-presets.js +60 -3
- 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 +17 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +19 -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 +79 -6
- package/lib/types/dsh-adapter/channel/compaction.d.ts +7 -2
- package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/compaction.js +100 -26
- 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 +10 -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 +5 -1
- 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 +330 -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 +109 -30
- 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 +7 -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 +235 -13
- 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 +48 -29
- 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/permissions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/permissions.js +4 -1
- package/lib/types/dsh-adapter/channel/projection-helpers.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection-helpers.js +2 -0
- 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 +60 -30
- package/lib/types/dsh-adapter/channel/session-reset.js +2 -2
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +22 -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 +5 -2
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +136 -5
- package/lib/types/dsh-adapter/channel/state.d.ts +43 -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 +84 -12
- 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 +8 -1
- package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/transcript.js +20 -3
- 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/compat/agent-team-0.2.0.d.ts +55 -0
- package/lib/types/dsh-adapter/compat/agent-team-0.2.0.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/agent-team-0.2.0.js +96 -0
- 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 +4 -4
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +20 -5
- package/lib/types/dsh-adapter/effect-ledger.d.ts +7 -0
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
- package/lib/types/dsh-adapter/effect-ledger.js +8 -1
- package/lib/types/dsh-adapter/entry-slot.d.ts +38 -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 +226 -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 +148 -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 +77 -0
- package/lib/types/dsh-adapter/host-dsh.d.ts +112 -0
- package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-dsh.js +481 -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 +253 -0
- package/lib/types/dsh-adapter/index.d.ts +53 -17
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +63 -9
- 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/invariant.d.ts +7 -2
- package/lib/types/dsh-adapter/invariant.d.ts.map +1 -1
- package/lib/types/dsh-adapter/invariant.js +6 -3
- 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/index.js +2 -2
- 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 +41 -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 +119 -0
- package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-declaration.js +183 -0
- package/lib/types/dsh-adapter/plugin-feed.d.ts +94 -0
- package/lib/types/dsh-adapter/plugin-feed.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-feed.js +135 -0
- package/lib/types/dsh-adapter/plugin-guard.d.ts +115 -0
- package/lib/types/dsh-adapter/plugin-guard.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-guard.js +108 -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-install.d.ts +160 -0
- package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-install.js +545 -0
- package/lib/types/dsh-adapter/plugin-manage.d.ts +178 -0
- package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-manage.js +468 -0
- package/lib/types/dsh-adapter/plugin-manager.d.ts +144 -0
- package/lib/types/dsh-adapter/plugin-manager.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-manager.js +83 -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 +918 -234
- package/lib/types/dsh-adapter/plugins-info.d.ts +130 -8
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +469 -44
- 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-projection-store.d.ts +66 -0
- package/lib/types/dsh-adapter/session-projection-store.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-projection-store.js +149 -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/settingsEditor.js +2 -2
- package/lib/types/dsh-adapter/sideQuestion.d.ts +21 -0
- package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sideQuestion.js +53 -0
- 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 +112 -9
- package/lib/types/dsh-adapter/team-mode.d.ts +74 -0
- package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -0
- package/lib/types/dsh-adapter/team-mode.js +188 -0
- package/lib/types/dsh-adapter/team-roster.d.ts +67 -0
- package/lib/types/dsh-adapter/team-roster.d.ts.map +1 -0
- package/lib/types/dsh-adapter/team-roster.js +136 -0
- package/lib/types/dsh-adapter/team-tools.d.ts +58 -0
- package/lib/types/dsh-adapter/team-tools.d.ts.map +1 -0
- package/lib/types/dsh-adapter/team-tools.js +208 -0
- 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/dsh-adapter/types.d.ts +1 -1
- package/lib/types/dsh-adapter/types.d.ts.map +1 -1
- 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 +961 -1439
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +443 -387
- 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/components/ScrollBox.d.ts +9 -0
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
- package/lib/types/ink/components/ScrollBox.js +23 -0
- package/lib/types/ink/dom.d.ts.map +1 -1
- 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 +130 -17
- 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/native-ts/yoga-layout/index.d.ts.map +1 -1
- package/lib/types/native-ts/yoga-layout/index.js +8 -1
- 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/permissionPresetLabels.d.ts +25 -0
- package/lib/types/permissionPresetLabels.d.ts.map +1 -0
- package/lib/types/permissionPresetLabels.js +33 -0
- package/lib/types/plugin-host.d.ts +1 -0
- package/lib/types/plugin-host.d.ts.map +1 -1
- package/lib/types/preset-patch.d.ts +22 -0
- package/lib/types/preset-patch.d.ts.map +1 -0
- package/lib/types/preset-patch.js +14 -0
- 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 +55 -16
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +742 -280
- package/lib/types/screens/Launchpad.d.ts +33 -17
- package/lib/types/screens/Launchpad.d.ts.map +1 -1
- package/lib/types/screens/Launchpad.js +256 -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 +7 -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/chat/usePluginWriteFlow.d.ts +68 -0
- package/lib/types/screens/chat/usePluginWriteFlow.d.ts.map +1 -0
- package/lib/types/screens/chat/usePluginWriteFlow.js +92 -0
- package/lib/types/screens/chatOverlay.d.ts +30 -5
- 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/sessionModes.d.ts +5 -3
- package/lib/types/sessionModes.d.ts.map +1 -1
- package/lib/types/sessionModes.js +9 -3
- 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/lib/types/utils/paths.d.ts +11 -0
- package/lib/types/utils/paths.d.ts.map +1 -1
- package/lib/types/utils/paths.js +13 -0
- package/package.json +150 -114
- package/presets/winbash.mjs +716 -0
- package/tui-profile/feed/README.md +63 -0
- package/tui-profile/feed/first-party.json +10 -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,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The in-tree side of the `Backend` contribution family (B-2): one projection
|
|
3
|
+
* from this package's own manifest shape to the public declaration shape.
|
|
4
|
+
*
|
|
5
|
+
* A built-in manifest is a **superset** of `BackendSpec`: it carries in-tree
|
|
6
|
+
* facts (`inTree`, `alwaysAvailable`, `nativeKey`, `vendorPackages`,
|
|
7
|
+
* `backendExport`, and a `label` that may name a host i18n key) that no
|
|
8
|
+
* contribution may declare. Dogfooding therefore means proving the projection:
|
|
9
|
+
* `backendContributionOf()` strips those, expands the label into the literal
|
|
10
|
+
* text the spec requires, and the result must satisfy `validateBackendSpec()` for
|
|
11
|
+
* every built-in. A manifest that grows a field the spec cannot express reds here
|
|
12
|
+
* instead of drifting (scripts/verify-backend-contribution.ts).
|
|
13
|
+
*
|
|
14
|
+
* `backendExport` stays in-tree on purpose: it is the build-time index's
|
|
15
|
+
* mechanism (the registry reads an export name out of a module namespace), not a
|
|
16
|
+
* contribution field. A contribution hands its handler object over at
|
|
17
|
+
* registration, like `assertSceneHandler`'s scene handlers.
|
|
18
|
+
*
|
|
19
|
+
* D-1 added the other direction ({@link backendManifestOf}): the runtime form of
|
|
20
|
+
* a **third-party** declaration, so that an installed bundle can be registered
|
|
21
|
+
* through the same registry as the seed. The two directions are inverses on the
|
|
22
|
+
* intersection of the two shapes; the in-tree-only fields are what the pair
|
|
23
|
+
* proves (a third-party entry can never grow one).
|
|
24
|
+
*/
|
|
25
|
+
import type { BackendManifest } from '../agent/backend-manifest.js';
|
|
26
|
+
import type { BackendSpec } from '../adapter/spec/tui-contributions.js';
|
|
27
|
+
/**
|
|
28
|
+
* Project one manifest onto the public declaration. Pure: the same manifest
|
|
29
|
+
* projects to a deep-equal value every time (no timestamps, no host state), which
|
|
30
|
+
* is what lets the gate compare two projections and diff keys.
|
|
31
|
+
*/
|
|
32
|
+
export declare function backendContributionOf(manifest: BackendManifest): Record<string, unknown>;
|
|
33
|
+
/**
|
|
34
|
+
* The registry entry a **third-party** declaration becomes (D-1): the inverse of
|
|
35
|
+
* {@link backendContributionOf} on the fields both shapes carry.
|
|
36
|
+
*
|
|
37
|
+
* A contribution declares less than an in-tree manifest, and everything it cannot
|
|
38
|
+
* declare is fixed here rather than defaulted by the caller:
|
|
39
|
+
*
|
|
40
|
+
* - `inTree: false` — the one fact that flips the registry's rules (reserved ids,
|
|
41
|
+
* host label keys, `alwaysAvailable`, `nativeKey`, label sanitization). A
|
|
42
|
+
* contribution is exactly the non-in-tree case, so the projection says so
|
|
43
|
+
* instead of leaving a boolean for a caller to get wrong.
|
|
44
|
+
* - `label` is already the literal the spec requires; `label.kind === 'key'` is
|
|
45
|
+
* unreachable here (the spec has no such field, and `validateBackendSpec()`
|
|
46
|
+
* refuses it as an unknown field), so a declaration can never borrow this
|
|
47
|
+
* host's own vocabulary.
|
|
48
|
+
* - `alwaysAvailable` / `nativeKey` / `vendorPackages` / `backendExport` are
|
|
49
|
+
* **not** writable from a declaration and are therefore absent from the
|
|
50
|
+
* result: `registerBackend()` rejects an explicit `alwaysAvailable` /
|
|
51
|
+
* `nativeKey`, and the `backendExport` default (`'backend'`) is the registry's
|
|
52
|
+
* documented read of the module namespace, not a field to invent here.
|
|
53
|
+
* - `confirmation` stays behind: it is a request to the *install / enable* chain
|
|
54
|
+
* (`BACKEND_CONFIRMATION_POLICIES`), which reads the declaration, not the
|
|
55
|
+
* manifest. Dropping it here is what keeps one reading of it.
|
|
56
|
+
*
|
|
57
|
+
* Pure, like its counterpart: the same declaration projects to a deep-equal
|
|
58
|
+
* manifest every time, and the result is the value `registerBackend()` validates,
|
|
59
|
+
* admits and registers.
|
|
60
|
+
*/
|
|
61
|
+
export declare function backendManifestOf(spec: BackendSpec): BackendManifest;
|
|
62
|
+
//# sourceMappingURL=backend-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-contribution.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/backend-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAoBvE;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAaxF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,eAAe,CAYpE"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { t } from '../i18n.js';
|
|
2
|
+
/** The label text a contribution would declare, or a refusal.
|
|
3
|
+
*
|
|
4
|
+
* Only an in-tree manifest may carry a host i18n key, and the projection is what
|
|
5
|
+
* turns one into the literal text the spec requires — so it is also where the rule
|
|
6
|
+
* has to hold when the projection is called directly: expanding a *plugin's* key
|
|
7
|
+
* would launder it into the literal `t()` happens to return, i.e. let a contribution
|
|
8
|
+
* paint itself with this host's own name. `registerBackend` refuses that combination
|
|
9
|
+
* before projecting; this refuses it again, so the exported projection cannot be used
|
|
10
|
+
* to do what registration forbids. */
|
|
11
|
+
function labelTextOf(manifest) {
|
|
12
|
+
if (manifest.label.kind === 'literal')
|
|
13
|
+
return manifest.label.text;
|
|
14
|
+
if (!manifest.inTree) {
|
|
15
|
+
throw new Error(`dsh-tui: backend "${manifest.id}" is not in-tree and may not project a host label key`);
|
|
16
|
+
}
|
|
17
|
+
return t(manifest.label.key);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Project one manifest onto the public declaration. Pure: the same manifest
|
|
21
|
+
* projects to a deep-equal value every time (no timestamps, no host state), which
|
|
22
|
+
* is what lets the gate compare two projections and diff keys.
|
|
23
|
+
*/
|
|
24
|
+
export function backendContributionOf(manifest) {
|
|
25
|
+
return {
|
|
26
|
+
id: manifest.id,
|
|
27
|
+
label: { text: labelTextOf(manifest) },
|
|
28
|
+
shortLabel: manifest.shortLabel,
|
|
29
|
+
...(manifest.product === undefined ? {} : { product: manifest.product }),
|
|
30
|
+
// Absent declarations project to the empty list: the spec requires both
|
|
31
|
+
// fields, so "I declare nothing" must be sayable and must mean "nothing".
|
|
32
|
+
capabilities: [...(manifest.capabilities ?? [])],
|
|
33
|
+
grants: [...(manifest.grants ?? [])],
|
|
34
|
+
...(manifest.install === undefined ? {} : { install: { ...manifest.install } }),
|
|
35
|
+
...(manifest.unloadExport === undefined ? {} : { unloadExport: manifest.unloadExport }),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The registry entry a **third-party** declaration becomes (D-1): the inverse of
|
|
40
|
+
* {@link backendContributionOf} on the fields both shapes carry.
|
|
41
|
+
*
|
|
42
|
+
* A contribution declares less than an in-tree manifest, and everything it cannot
|
|
43
|
+
* declare is fixed here rather than defaulted by the caller:
|
|
44
|
+
*
|
|
45
|
+
* - `inTree: false` — the one fact that flips the registry's rules (reserved ids,
|
|
46
|
+
* host label keys, `alwaysAvailable`, `nativeKey`, label sanitization). A
|
|
47
|
+
* contribution is exactly the non-in-tree case, so the projection says so
|
|
48
|
+
* instead of leaving a boolean for a caller to get wrong.
|
|
49
|
+
* - `label` is already the literal the spec requires; `label.kind === 'key'` is
|
|
50
|
+
* unreachable here (the spec has no such field, and `validateBackendSpec()`
|
|
51
|
+
* refuses it as an unknown field), so a declaration can never borrow this
|
|
52
|
+
* host's own vocabulary.
|
|
53
|
+
* - `alwaysAvailable` / `nativeKey` / `vendorPackages` / `backendExport` are
|
|
54
|
+
* **not** writable from a declaration and are therefore absent from the
|
|
55
|
+
* result: `registerBackend()` rejects an explicit `alwaysAvailable` /
|
|
56
|
+
* `nativeKey`, and the `backendExport` default (`'backend'`) is the registry's
|
|
57
|
+
* documented read of the module namespace, not a field to invent here.
|
|
58
|
+
* - `confirmation` stays behind: it is a request to the *install / enable* chain
|
|
59
|
+
* (`BACKEND_CONFIRMATION_POLICIES`), which reads the declaration, not the
|
|
60
|
+
* manifest. Dropping it here is what keeps one reading of it.
|
|
61
|
+
*
|
|
62
|
+
* Pure, like its counterpart: the same declaration projects to a deep-equal
|
|
63
|
+
* manifest every time, and the result is the value `registerBackend()` validates,
|
|
64
|
+
* admits and registers.
|
|
65
|
+
*/
|
|
66
|
+
export function backendManifestOf(spec) {
|
|
67
|
+
return {
|
|
68
|
+
id: spec.id,
|
|
69
|
+
label: { kind: 'literal', text: spec.label.text },
|
|
70
|
+
shortLabel: spec.shortLabel,
|
|
71
|
+
...(spec.product === undefined ? {} : { product: spec.product }),
|
|
72
|
+
capabilities: [...spec.capabilities],
|
|
73
|
+
grants: [...spec.grants],
|
|
74
|
+
...(spec.install === undefined ? {} : { install: { ...spec.install } }),
|
|
75
|
+
...(spec.unloadExport === undefined ? {} : { unloadExport: spec.unloadExport }),
|
|
76
|
+
inTree: false,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The runtime backend registry (roadmap Stage A / P0).
|
|
3
|
+
*
|
|
4
|
+
* Before this module, "which backends exist" was a hand-written closed set
|
|
5
|
+
* spread over `kernelPrefs.ts`, this adapter, the launcher copy and the boundary
|
|
6
|
+
* gate: every new backend had to be copied into all of them (codex did exactly
|
|
7
|
+
* that, #1352). Now the set is the built-in seed plus whatever the build-time
|
|
8
|
+
* index found under `src/backends/*/manifest.ts` — adding a backend is a new
|
|
9
|
+
* directory, nothing else.
|
|
10
|
+
*
|
|
11
|
+
* Three properties this file must keep (they are what a fourth backend would
|
|
12
|
+
* otherwise break):
|
|
13
|
+
*
|
|
14
|
+
* - **Lazy**: an entry that is never loaded is never imported. `probeKernels`
|
|
15
|
+
* is the only path that loads everything, and it is opt-in.
|
|
16
|
+
* - **Booked pooling** (D4): `unloadExport` is remembered when — and only when —
|
|
17
|
+
* the entry's module was actually imported, so a DSH-only boot does not pay a
|
|
18
|
+
* module import (let alone a child process) just to close a pool it never
|
|
19
|
+
* opened. The one exit funnel (`plugin.ts`'s `disposeRootAndThen`) calls
|
|
20
|
+
* {@link unloadBackends} after the fiber is disposed and stays otherwise
|
|
21
|
+
* untouched.
|
|
22
|
+
* - **Membership is the second half of the parse** (D1): a syntactically valid
|
|
23
|
+
* but unregistered id must behave exactly like an unknown value everywhere
|
|
24
|
+
* (dsh + a warning, never a crashed boot). See {@link parseBackendChoice}.
|
|
25
|
+
*/
|
|
26
|
+
import type { AgentBackend } from '../agent/backend.js';
|
|
27
|
+
import { isBackendIdSyntax, type BackendEntry, type BackendManifest } from '../agent/backend-manifest.js';
|
|
28
|
+
import { type KernelBackendId } from '../kernelPrefs.js';
|
|
29
|
+
import { type BackendAdmission } from './backend-admission.js';
|
|
30
|
+
export { isBackendIdSyntax };
|
|
31
|
+
/**
|
|
32
|
+
* One registered backend: the manifest, its id as a validated {@link KernelBackendId}
|
|
33
|
+
* (the cast below is reached only after the syntax gate), the lazy loader, and the
|
|
34
|
+
* one fact the registry derives from the manifest.
|
|
35
|
+
*
|
|
36
|
+
* `installable` is derived, not declared: the old `installable` field was a
|
|
37
|
+
* boolean that the registration gate forced to equal "declares install data", so
|
|
38
|
+
* it carried no information of its own — and the half that *is* a runtime
|
|
39
|
+
* question (`does this host run that executor?`) could not be written in a
|
|
40
|
+
* manifest at all. Picker rows read it from here, and `installSurfaceFor(id)`
|
|
41
|
+
* answers the same question with the actions attached.
|
|
42
|
+
*/
|
|
43
|
+
export interface RegisteredBackend {
|
|
44
|
+
readonly id: KernelBackendId;
|
|
45
|
+
readonly manifest: BackendManifest;
|
|
46
|
+
readonly installable: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* What the admission decided about this entry (B-2). `compatible_degraded`
|
|
49
|
+
* carries the names the host does not implement, `waiting_authorization` the
|
|
50
|
+
* permissions nobody granted; `rejected` and `unknown` never become an entry
|
|
51
|
+
* (registration throws on them). Every in-tree backend is `compatible` today.
|
|
52
|
+
*/
|
|
53
|
+
readonly admission: BackendAdmission;
|
|
54
|
+
readonly load?: () => Promise<Record<string, unknown>>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Add one entry. The built-in seeds register themselves below; the plugin
|
|
58
|
+
* discovery of Stage C is the intended second caller, which is why the checks
|
|
59
|
+
* are loud rather than lenient: a bad manifest must fail at registration, not
|
|
60
|
+
* paint a wrong row.
|
|
61
|
+
*/
|
|
62
|
+
export declare function registerBackend(entry: BackendEntry): void;
|
|
63
|
+
/** Every registered backend, in declaration order (= picker order). */
|
|
64
|
+
export declare function listBackends(): readonly RegisteredBackend[];
|
|
65
|
+
/**
|
|
66
|
+
* The entries a picker may offer (B-2). A `waiting_authorization` entry is
|
|
67
|
+
* registered — its id exists, the boot's two-stage parse must find it, and its
|
|
68
|
+
* session refs must resolve — but it is not offered: nothing has granted what it
|
|
69
|
+
* declares, so selecting it would open a backend the host cannot describe. Today
|
|
70
|
+
* no entry is in that state (every in-tree manifest declares `grants: []`); the
|
|
71
|
+
* shape exists so the C stage's grant flow has somewhere to land.
|
|
72
|
+
*/
|
|
73
|
+
export declare function listOfferedBackends(): readonly RegisteredBackend[];
|
|
74
|
+
/**
|
|
75
|
+
* What the backend admission machine reports when asked whether it is mounted
|
|
76
|
+
* and can admit a *contribution* (W-2).
|
|
77
|
+
*/
|
|
78
|
+
export interface BackendAdmissionProbe {
|
|
79
|
+
/** Entries the registry holds: the built-in seed plus every registration. */
|
|
80
|
+
readonly registered: number;
|
|
81
|
+
/** How many of them a picker may offer (not `waiting_authorization`). */
|
|
82
|
+
readonly offered: number;
|
|
83
|
+
/** What a synthetic third-party declaration was admitted as. A machine that
|
|
84
|
+
* could not answer `compatible` would refuse every contribution, so this is
|
|
85
|
+
* the one verdict the probe accepts. */
|
|
86
|
+
readonly verdict: 'compatible';
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Read-only probe behind the host descriptor's `Backend` contract (W-2): is the
|
|
90
|
+
* backend admission machine mounted, and does it answer for a *contribution*?
|
|
91
|
+
*
|
|
92
|
+
* The descriptor publishes `tui.dsh/v1alpha1#Backend` only on real probe evidence
|
|
93
|
+
* (`hasVerificationEvidence`, descriptor publication barrier), and "a service row
|
|
94
|
+
* exists" is deliberately not evidence. So this probe walks the same path a
|
|
95
|
+
* third-party declaration takes — build a declaration no host owns, run it
|
|
96
|
+
* through the family validator, then through the host's admission facts — and
|
|
97
|
+
* reports what came back. It registers nothing, imports nothing and writes
|
|
98
|
+
* nothing: an entry that was never loaded is still never loaded.
|
|
99
|
+
*/
|
|
100
|
+
export declare function probeBackendAdmission(): BackendAdmissionProbe;
|
|
101
|
+
/** One backend, or undefined when no such backend is registered. */
|
|
102
|
+
export declare function getBackend(id: string): RegisteredBackend | undefined;
|
|
103
|
+
/** Whether an untrusted value names a backend this process can actually run.
|
|
104
|
+
* This is the second half of the parse (D1) and the only way to obtain a
|
|
105
|
+
* {@link KernelBackendId} outside `kernelPrefs`' own syntax gate. */
|
|
106
|
+
export declare function isRegisteredBackend(value: unknown): value is KernelBackendId;
|
|
107
|
+
/**
|
|
108
|
+
* The backend a configured / remembered value names: trimmed, lowercased, and
|
|
109
|
+
* **registered**. Anything else is undefined, which every caller already treats
|
|
110
|
+
* as "no choice made" (dsh + a warning) — the semantics an unknown value had
|
|
111
|
+
* before the set was open (D1).
|
|
112
|
+
*/
|
|
113
|
+
export declare function parseBackendChoice(value: unknown): KernelBackendId | undefined;
|
|
114
|
+
/** The display name of a backend id: its manifest's short brand name, else the
|
|
115
|
+
* id itself (a session from an uninstalled plugin must still render as
|
|
116
|
+
* something). */
|
|
117
|
+
export declare function backendLabel(id: string): string;
|
|
118
|
+
/**
|
|
119
|
+
* Import one registered backend's implementation and book its pool hook.
|
|
120
|
+
*
|
|
121
|
+
* The two failure messages stay distinct (D1): "not registered" means the id was
|
|
122
|
+
* never a choice, "has no loader" means the id names the host's own kernel.
|
|
123
|
+
*/
|
|
124
|
+
export declare function loadBackend(id: KernelBackendId): Promise<AgentBackend>;
|
|
125
|
+
/**
|
|
126
|
+
* Close the pooled, process-wide resources of every backend this process
|
|
127
|
+
* actually loaded, in load order, then forget them (idempotent).
|
|
128
|
+
*
|
|
129
|
+
* Called once from the exit funnel *after* `ctx.root.fiber.dispose()`: closing a
|
|
130
|
+
* pool first would break the in-flight sessions whose calls still hold it
|
|
131
|
+
* (D4-P3). A failing or hanging hook must not block the exit — failures only
|
|
132
|
+
* reach the debug log, and a stuck one is caught by the funnel's existing 5s
|
|
133
|
+
* bound (P4).
|
|
134
|
+
*/
|
|
135
|
+
export declare function unloadBackends(): Promise<void>;
|
|
136
|
+
//# sourceMappingURL=backend-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-registry.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/backend-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAKzG,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAE7E,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAKhF,OAAO,EAAE,iBAAiB,EAAE,CAAA;AA6C5B;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,eAAe,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAA;IAClC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAA;IACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACvD;AA0CD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAsEzD;AAOD,uEAAuE;AACvE,wBAAgB,YAAY,IAAI,SAAS,iBAAiB,EAAE,CAE3D;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,SAAS,iBAAiB,EAAE,CAElE;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB;;6CAEyC;IACzC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;CAC/B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,IAAI,qBAAqB,CAkB7D;AAED,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAEpE;AAED;;sEAEsE;AACtE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CAI9E;AAED;;kBAEkB;AAClB,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,CA6B5E;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CASpD"}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { isBackendIdSyntax } from '../agent/backend-manifest.js';
|
|
2
|
+
import { BACKEND_CAPABILITY_NAMES } from '../adapter/spec/backend-capabilities.js';
|
|
3
|
+
import { EXPECTED_PERMISSIONS } from '../adapter/spec/protocol-constants.js';
|
|
4
|
+
import { assertBackendHandler, validateBackendSpec } from '../adapter/spec/tui-contributions.js';
|
|
5
|
+
import { cleanRenderText } from '../channel/sanitize.js';
|
|
6
|
+
import { BUILTIN_BACKEND_IDS } from '../kernelPrefs.js';
|
|
7
|
+
import { logForDebugging } from '../utils/debug.js';
|
|
8
|
+
import { backendAdmission } from './backend-admission.js';
|
|
9
|
+
import { backendContributionOf } from './backend-contribution.js';
|
|
10
|
+
import { GENERATED_BACKENDS } from './backends.generated.js';
|
|
11
|
+
import { installExecutor } from './install/executors.js';
|
|
12
|
+
export { isBackendIdSyntax };
|
|
13
|
+
/**
|
|
14
|
+
* The DSH kernel. In-tree and always available, but **not** an `AgentBackend`:
|
|
15
|
+
* its session is built by `createDshSession()` from the DSH agent, and P0 does
|
|
16
|
+
* not force it into the backend contract just for symmetry (roadmap §7.3).
|
|
17
|
+
* Seeded first, so the picker order stays `dsh, claude, codex, …`.
|
|
18
|
+
*/
|
|
19
|
+
const DSH_MANIFEST = {
|
|
20
|
+
id: 'dsh',
|
|
21
|
+
label: { kind: 'key', key: 'kernel-label-dsh' },
|
|
22
|
+
shortLabel: 'DSH',
|
|
23
|
+
product: 'dsh-core',
|
|
24
|
+
inTree: true,
|
|
25
|
+
alwaysAvailable: true,
|
|
26
|
+
// Not an `AgentBackend`, so it has no optional session surface to declare —
|
|
27
|
+
// stated explicitly rather than left to the projection's default (B-2).
|
|
28
|
+
capabilities: [],
|
|
29
|
+
grants: [],
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* What replaced Stage A's `HOST_INSTALLABLE_BACKEND_ID = 'claude'`: a manifest
|
|
33
|
+
* now *names an executor* (`BackendManifest.install.executor`) and the registry
|
|
34
|
+
* looks the name up in the host's table (`src/dsh-adapter/install/`). An entry is
|
|
35
|
+
* installable exactly when that lookup finds something, so the row that opens a
|
|
36
|
+
* wizard is the row whose own recipe names an executor this host runs — not the
|
|
37
|
+
* row that happens to wear the privileged id.
|
|
38
|
+
*
|
|
39
|
+
* A table rather than a static import of one backend's installer, because the
|
|
40
|
+
* discovery this has to survive is the post-mount one: Stage C reads a bundle's
|
|
41
|
+
* contribution after the plugin is mounted (§4.4), and a link-time constant could
|
|
42
|
+
* not be consulted then.
|
|
43
|
+
*
|
|
44
|
+
* An unknown executor is **not** a registration error (§6 item 12): the entry
|
|
45
|
+
* registers with no install surface, and its "not installed" row degrades to
|
|
46
|
+
* detection's own hint instead of growing a button that cannot work. The recipe
|
|
47
|
+
* is therefore validated for *shape* here, never for whether this host likes its
|
|
48
|
+
* value. The strings a plugin declares are also the wizard's render path and (on
|
|
49
|
+
* Windows) a `pnpm add` argument, so admitting a third-party recipe is Stage C/D
|
|
50
|
+
* work — until then a plugin may name only a value of this closed table.
|
|
51
|
+
*/
|
|
52
|
+
const installableOf = (manifest) => manifest.install !== undefined && installExecutor(manifest.install.executor) !== undefined;
|
|
53
|
+
/** Registration order = picker order (`listBackends`). */
|
|
54
|
+
const entries = new Map();
|
|
55
|
+
/**
|
|
56
|
+
* Cell budget for a plugin-declared name. The picker pane is at most ~72 cells
|
|
57
|
+
* wide and the launchpad plate far narrower, so this only bounds what a
|
|
58
|
+
* misbehaving manifest can put on the render path (and in the notices written to
|
|
59
|
+
* stdout) — layout truncation stays the renderer's job.
|
|
60
|
+
*/
|
|
61
|
+
const LABEL_MAX_CELLS = 48;
|
|
62
|
+
/** Close hooks of the entries whose module was actually imported (D4). */
|
|
63
|
+
const loadedUnloads = new Map();
|
|
64
|
+
/**
|
|
65
|
+
* What this host knows when admitting a backend declaration (B-2). The
|
|
66
|
+
* vocabularies come from the spec plane (`src/adapter/spec/**`), the granted set
|
|
67
|
+
* is empty until a backend grant flow exists (C stage) — which is why every
|
|
68
|
+
* in-tree manifest declares `grants: []` rather than a permission nobody could
|
|
69
|
+
* grant (D-3).
|
|
70
|
+
*/
|
|
71
|
+
const HOST_ADMISSION_FACTS = {
|
|
72
|
+
reservedIds: new Set(BUILTIN_BACKEND_IDS),
|
|
73
|
+
capabilityNames: new Set(BACKEND_CAPABILITY_NAMES),
|
|
74
|
+
permissionNames: new Set(EXPECTED_PERMISSIONS.map(permission => permission.name)),
|
|
75
|
+
granted: new Set(),
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* The same facts for **this host's own seed**: a built-in manifest legitimately
|
|
79
|
+
* wears a built-in id, so the reserved set is the one rule that flips. Everything
|
|
80
|
+
* else (the capability and permission vocabularies) applies to a seed exactly as
|
|
81
|
+
* it does to a contribution — and the admission verdict is still recorded, which
|
|
82
|
+
* is what makes the dogfood check in `verify-backend-contribution.ts` meaningful.
|
|
83
|
+
*/
|
|
84
|
+
const SEED_ADMISSION_FACTS = { ...HOST_ADMISSION_FACTS, reservedIds: new Set() };
|
|
85
|
+
const admissionFactsFor = (manifest) => manifest.inTree ? SEED_ADMISSION_FACTS : HOST_ADMISSION_FACTS;
|
|
86
|
+
/**
|
|
87
|
+
* Add one entry. The built-in seeds register themselves below; the plugin
|
|
88
|
+
* discovery of Stage C is the intended second caller, which is why the checks
|
|
89
|
+
* are loud rather than lenient: a bad manifest must fail at registration, not
|
|
90
|
+
* paint a wrong row.
|
|
91
|
+
*/
|
|
92
|
+
export function registerBackend(entry) {
|
|
93
|
+
const { manifest } = entry;
|
|
94
|
+
const where = `dsh-tui: backend "${manifest.id}"`;
|
|
95
|
+
if (!isBackendIdSyntax(manifest.id)) {
|
|
96
|
+
throw new Error(`${where} has an invalid id (lowercase letters, digits and dashes, at most 32 characters)`);
|
|
97
|
+
}
|
|
98
|
+
// The reserved check comes first on purpose (D-1). Every built-in id is seeded
|
|
99
|
+
// before any other caller can run, so an "is it taken?" test would answer for a
|
|
100
|
+
// plugin wearing `claude` too — and it would name the wrong reason: the id is
|
|
101
|
+
// not taken by a rival, it is one this host owns and no declaration may wear
|
|
102
|
+
// (`BACKEND_ID_RESERVED` in the family's contract). Registration is the last
|
|
103
|
+
// place that can still tell the two apart.
|
|
104
|
+
if (!manifest.inTree && BUILTIN_BACKEND_IDS.includes(manifest.id)) {
|
|
105
|
+
// `dsh` refs serialize without a prefix (`formatSessionRef`), so a plugin
|
|
106
|
+
// wearing that id would collide with first-party references.
|
|
107
|
+
throw new Error(`${where} is a reserved built-in id`);
|
|
108
|
+
}
|
|
109
|
+
if (entries.has(manifest.id))
|
|
110
|
+
throw new Error(`${where} is already registered`);
|
|
111
|
+
if (!manifest.inTree && manifest.label.kind === 'key') {
|
|
112
|
+
// Otherwise a plugin could claim a first-party name: `t()` returns the text
|
|
113
|
+
// of an existing key (`src/i18n.ts`), so the row would read "DeepSeek Harness".
|
|
114
|
+
throw new Error(`${where} is not in-tree and may not use a host label key; declare { kind: 'literal', text }`);
|
|
115
|
+
}
|
|
116
|
+
if (!manifest.inTree && manifest.alwaysAvailable === true) {
|
|
117
|
+
throw new Error(`${where} is not in-tree and may not be always-available`);
|
|
118
|
+
}
|
|
119
|
+
if (!manifest.inTree && manifest.nativeKey !== undefined) {
|
|
120
|
+
throw new Error(`${where} is not in-tree and may not declare a native channel`);
|
|
121
|
+
}
|
|
122
|
+
if (manifest.alwaysAvailable === true && entry.load !== undefined) {
|
|
123
|
+
throw new Error(`${where} is always-available and must not have a loader (it is not an AgentBackend)`);
|
|
124
|
+
}
|
|
125
|
+
// Shape only: what the recipe names is the host's business, and a value it does
|
|
126
|
+
// not implement means "no install surface", never a refused registration.
|
|
127
|
+
const install = manifest.install;
|
|
128
|
+
if (install !== undefined && ![install.executor, install.specifier, install.version].every(field => typeof field === 'string' && field !== '')) {
|
|
129
|
+
throw new Error(`${where} declares an install recipe without a non-empty executor, specifier and version`);
|
|
130
|
+
}
|
|
131
|
+
// The contribution family gate (B-2). Order matters: project the in-tree
|
|
132
|
+
// superset down to the public declaration, validate that declaration against the
|
|
133
|
+
// family's own definition (the same validator every other host of this protocol
|
|
134
|
+
// runs), then decide the half only this host can answer — capability and
|
|
135
|
+
// permission vocabularies. A refusal here is a build-time error and must be
|
|
136
|
+
// loud; a `waiting_authorization` entry registers, because the id does exist and
|
|
137
|
+
// the boot, the warnings and the session refs must know it, but it is not
|
|
138
|
+
// offered (see {@link listOfferedBackends}).
|
|
139
|
+
const contribution = validateBackendSpec(backendContributionOf(manifest));
|
|
140
|
+
const verdict = backendAdmission(contribution, admissionFactsFor(manifest));
|
|
141
|
+
if (verdict.decision === 'rejected' || verdict.decision === 'unknown') {
|
|
142
|
+
throw new Error(`${where} was refused at admission: ${verdict.reasonCode}`);
|
|
143
|
+
}
|
|
144
|
+
const admission = verdict;
|
|
145
|
+
// Plugin-declared names are external input: flatten control/escape sequences
|
|
146
|
+
// and cap the width here, once, so the picker, the launchpad plate and the
|
|
147
|
+
// handoff notices all render the same sanitized text (in-tree names are this
|
|
148
|
+
// package's own strings and stay verbatim; `label.key` must stay a raw key).
|
|
149
|
+
const registered = {
|
|
150
|
+
// The one place that may mint a KernelBackendId: the syntax gate above has
|
|
151
|
+
// already run, and membership is this very map.
|
|
152
|
+
id: manifest.id,
|
|
153
|
+
manifest: manifest.inTree ? manifest : {
|
|
154
|
+
...manifest,
|
|
155
|
+
label: manifest.label.kind === 'literal' ? { kind: 'literal', text: cleanRenderText(manifest.label.text, LABEL_MAX_CELLS) } : manifest.label,
|
|
156
|
+
shortLabel: cleanRenderText(manifest.shortLabel, LABEL_MAX_CELLS),
|
|
157
|
+
},
|
|
158
|
+
installable: installableOf(manifest),
|
|
159
|
+
admission,
|
|
160
|
+
...(entry.load === undefined ? {} : { load: entry.load }),
|
|
161
|
+
};
|
|
162
|
+
entries.set(manifest.id, registered);
|
|
163
|
+
}
|
|
164
|
+
// The built-in seed: dsh first, then the generated index in directory-name
|
|
165
|
+
// order (claude, codex, …).
|
|
166
|
+
registerBackend({ manifest: DSH_MANIFEST });
|
|
167
|
+
for (const entry of GENERATED_BACKENDS)
|
|
168
|
+
registerBackend(entry);
|
|
169
|
+
/** Every registered backend, in declaration order (= picker order). */
|
|
170
|
+
export function listBackends() {
|
|
171
|
+
return [...entries.values()];
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The entries a picker may offer (B-2). A `waiting_authorization` entry is
|
|
175
|
+
* registered — its id exists, the boot's two-stage parse must find it, and its
|
|
176
|
+
* session refs must resolve — but it is not offered: nothing has granted what it
|
|
177
|
+
* declares, so selecting it would open a backend the host cannot describe. Today
|
|
178
|
+
* no entry is in that state (every in-tree manifest declares `grants: []`); the
|
|
179
|
+
* shape exists so the C stage's grant flow has somewhere to land.
|
|
180
|
+
*/
|
|
181
|
+
export function listOfferedBackends() {
|
|
182
|
+
return listBackends().filter(entry => entry.admission.decision !== 'waiting_authorization');
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Read-only probe behind the host descriptor's `Backend` contract (W-2): is the
|
|
186
|
+
* backend admission machine mounted, and does it answer for a *contribution*?
|
|
187
|
+
*
|
|
188
|
+
* The descriptor publishes `tui.dsh/v1alpha1#Backend` only on real probe evidence
|
|
189
|
+
* (`hasVerificationEvidence`, descriptor publication barrier), and "a service row
|
|
190
|
+
* exists" is deliberately not evidence. So this probe walks the same path a
|
|
191
|
+
* third-party declaration takes — build a declaration no host owns, run it
|
|
192
|
+
* through the family validator, then through the host's admission facts — and
|
|
193
|
+
* reports what came back. It registers nothing, imports nothing and writes
|
|
194
|
+
* nothing: an entry that was never loaded is still never loaded.
|
|
195
|
+
*/
|
|
196
|
+
export function probeBackendAdmission() {
|
|
197
|
+
const entries = listBackends();
|
|
198
|
+
const offered = listOfferedBackends().length;
|
|
199
|
+
// A declaration with no reserved id, no capabilities and no grants — the shape
|
|
200
|
+
// the profile's own CLI-shaped fixture uses, so the verdict cannot depend on
|
|
201
|
+
// anything this host happens to have registered.
|
|
202
|
+
const declaration = validateBackendSpec({
|
|
203
|
+
id: 'admission-probe',
|
|
204
|
+
label: { text: 'Admission probe' },
|
|
205
|
+
shortLabel: 'Admission probe',
|
|
206
|
+
capabilities: [],
|
|
207
|
+
grants: [],
|
|
208
|
+
});
|
|
209
|
+
const verdict = backendAdmission(declaration, HOST_ADMISSION_FACTS);
|
|
210
|
+
if (verdict.decision !== 'compatible') {
|
|
211
|
+
throw new Error(`dsh-tui: backend admission machine answered ${verdict.decision}; it cannot admit a contribution`);
|
|
212
|
+
}
|
|
213
|
+
return Object.freeze({ registered: entries.length, offered, verdict: 'compatible' });
|
|
214
|
+
}
|
|
215
|
+
/** One backend, or undefined when no such backend is registered. */
|
|
216
|
+
export function getBackend(id) {
|
|
217
|
+
return entries.get(id);
|
|
218
|
+
}
|
|
219
|
+
/** Whether an untrusted value names a backend this process can actually run.
|
|
220
|
+
* This is the second half of the parse (D1) and the only way to obtain a
|
|
221
|
+
* {@link KernelBackendId} outside `kernelPrefs`' own syntax gate. */
|
|
222
|
+
export function isRegisteredBackend(value) {
|
|
223
|
+
return isBackendIdSyntax(value) && entries.has(value);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* The backend a configured / remembered value names: trimmed, lowercased, and
|
|
227
|
+
* **registered**. Anything else is undefined, which every caller already treats
|
|
228
|
+
* as "no choice made" (dsh + a warning) — the semantics an unknown value had
|
|
229
|
+
* before the set was open (D1).
|
|
230
|
+
*/
|
|
231
|
+
export function parseBackendChoice(value) {
|
|
232
|
+
if (typeof value !== 'string')
|
|
233
|
+
return undefined;
|
|
234
|
+
const id = value.trim().toLowerCase();
|
|
235
|
+
return isRegisteredBackend(id) ? id : undefined;
|
|
236
|
+
}
|
|
237
|
+
/** The display name of a backend id: its manifest's short brand name, else the
|
|
238
|
+
* id itself (a session from an uninstalled plugin must still render as
|
|
239
|
+
* something). */
|
|
240
|
+
export function backendLabel(id) {
|
|
241
|
+
return getBackend(id)?.manifest.shortLabel ?? id;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Import one registered backend's implementation and book its pool hook.
|
|
245
|
+
*
|
|
246
|
+
* The two failure messages stay distinct (D1): "not registered" means the id was
|
|
247
|
+
* never a choice, "has no loader" means the id names the host's own kernel.
|
|
248
|
+
*/
|
|
249
|
+
export async function loadBackend(id) {
|
|
250
|
+
const entry = entries.get(id);
|
|
251
|
+
if (entry === undefined)
|
|
252
|
+
throw new Error(`dsh-tui: backend "${id}" is not registered`);
|
|
253
|
+
if (entry.admission.decision === 'waiting_authorization') {
|
|
254
|
+
throw new Error(`dsh-tui: backend "${id}" cannot load: ${entry.admission.reasonCode} (${entry.admission.deniedPermissions.join(', ')})`);
|
|
255
|
+
}
|
|
256
|
+
if (entry.load === undefined)
|
|
257
|
+
throw new Error(`dsh-tui: backend "${id}" has no loader (only the DSH kernel is not an AgentBackend)`);
|
|
258
|
+
const module = await entry.load();
|
|
259
|
+
const { backendExport, unloadExport } = entry.manifest;
|
|
260
|
+
if (unloadExport !== undefined) {
|
|
261
|
+
const unload = module[unloadExport];
|
|
262
|
+
if (typeof unload !== 'function') {
|
|
263
|
+
throw new Error(`dsh-tui: backend "${id}" declares unloadExport "${unloadExport}", but its module does not export it`);
|
|
264
|
+
}
|
|
265
|
+
// Overwriting is fine: the same module instance hands back the same hook.
|
|
266
|
+
loadedUnloads.set(id, unload);
|
|
267
|
+
}
|
|
268
|
+
const exportName = backendExport ?? 'backend';
|
|
269
|
+
const backend = module[exportName];
|
|
270
|
+
if (backend === undefined)
|
|
271
|
+
throw new Error(`dsh-tui: backend "${id}" does not export "${exportName}"`);
|
|
272
|
+
// Book the imported module's pool above even when its handler is invalid.
|
|
273
|
+
// No caller may prepare a session or data directory under another backend id.
|
|
274
|
+
try {
|
|
275
|
+
assertBackendHandler(backend);
|
|
276
|
+
}
|
|
277
|
+
catch (error) {
|
|
278
|
+
throw new Error(`dsh-tui: backend "${id}" has an invalid handler (${error instanceof Error ? error.message : String(error)})`, { cause: error });
|
|
279
|
+
}
|
|
280
|
+
if (backend.id !== id)
|
|
281
|
+
throw new Error(`dsh-tui: backend "${id}" exports a handler for ${JSON.stringify(backend.id)}`);
|
|
282
|
+
return backend;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Close the pooled, process-wide resources of every backend this process
|
|
286
|
+
* actually loaded, in load order, then forget them (idempotent).
|
|
287
|
+
*
|
|
288
|
+
* Called once from the exit funnel *after* `ctx.root.fiber.dispose()`: closing a
|
|
289
|
+
* pool first would break the in-flight sessions whose calls still hold it
|
|
290
|
+
* (D4-P3). A failing or hanging hook must not block the exit — failures only
|
|
291
|
+
* reach the debug log, and a stuck one is caught by the funnel's existing 5s
|
|
292
|
+
* bound (P4).
|
|
293
|
+
*/
|
|
294
|
+
export async function unloadBackends() {
|
|
295
|
+
for (const [id, unload] of loadedUnloads) {
|
|
296
|
+
try {
|
|
297
|
+
await unload();
|
|
298
|
+
}
|
|
299
|
+
catch (error) {
|
|
300
|
+
logForDebugging(`dsh-tui: backend "${id}" unload failed (${error instanceof Error ? error.message : String(error)})`);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
loadedUnloads.clear();
|
|
304
|
+
}
|