@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
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
import { compositionRoot } from './host-access.js';
|
|
23
23
|
import { assertCapabilityShadowPolicy, defaultAdapterRuntime, } from '../adapter/kernel/runtime.js';
|
|
24
24
|
import { snapshotLiveSessionEvents } from './compat/liveSession.js';
|
|
25
|
+
import { getLang } from '../i18n.js';
|
|
25
26
|
import { DEFAULT_PERMISSION_OPTIONS, } from '../channel/permissions.js';
|
|
26
27
|
const approvalStores = new WeakMap();
|
|
27
28
|
/** Host-only registration used by the TUI plugin bootstrap. */
|
|
@@ -35,6 +36,26 @@ export function getApprovalStore(ctx) {
|
|
|
35
36
|
return approvalStores.get(root);
|
|
36
37
|
}
|
|
37
38
|
const COMMAND_CLIP = 500;
|
|
39
|
+
/**
|
|
40
|
+
* The ask's reason in the UI language. Requests may carry a localized
|
|
41
|
+
* `displayReason: { en, zh }` next to the English audit `reason` (DSH's
|
|
42
|
+
* auto-review asks do); older request types lack the field, so it is read
|
|
43
|
+
* structurally.
|
|
44
|
+
* @param req - The pending approval request.
|
|
45
|
+
* @returns The localized reason, else `req.reason`.
|
|
46
|
+
*/
|
|
47
|
+
function reasonOf(req) {
|
|
48
|
+
const display = req.displayReason;
|
|
49
|
+
if (display !== null && typeof display === 'object') {
|
|
50
|
+
const byLang = display;
|
|
51
|
+
for (const lang of [getLang(), 'en']) {
|
|
52
|
+
const text = byLang[lang];
|
|
53
|
+
if (typeof text === 'string' && text.trim() !== '')
|
|
54
|
+
return text;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return req.reason;
|
|
58
|
+
}
|
|
38
59
|
/**
|
|
39
60
|
* Recover the gated command from the session log: the approval request
|
|
40
61
|
* links to an already-presented tool call via `callId`, so the arguments
|
|
@@ -135,6 +156,9 @@ export class ApprovalStore {
|
|
|
135
156
|
* have flipped — re-checks below this guard are skipped.
|
|
136
157
|
*/
|
|
137
158
|
externalCheckedAtEvents = -1;
|
|
159
|
+
/** UI language the parked asks' reasons were resolved in (see
|
|
160
|
+
* {@link refreshReasonLang}). */
|
|
161
|
+
reasonLang = getLang();
|
|
138
162
|
notifyQueued = false;
|
|
139
163
|
/**
|
|
140
164
|
* CallIds whose approval ask already settled (decided or cancelled).
|
|
@@ -172,6 +196,7 @@ export class ApprovalStore {
|
|
|
172
196
|
* @returns The cached snapshot; the reference is stable between mutations.
|
|
173
197
|
*/
|
|
174
198
|
getSnapshot() {
|
|
199
|
+
this.refreshReasonLang();
|
|
175
200
|
this.refreshActiveExternal();
|
|
176
201
|
return this.snapshotCache;
|
|
177
202
|
}
|
|
@@ -200,6 +225,7 @@ export class ApprovalStore {
|
|
|
200
225
|
* when the agent has no parked ask.
|
|
201
226
|
*/
|
|
202
227
|
pendingAgentDetail(agentId) {
|
|
228
|
+
this.refreshReasonLang();
|
|
203
229
|
for (const ask of [...(this.active === undefined ? [] : [this.active]), ...this.queue]) {
|
|
204
230
|
if (ask.snapshot.agentId !== agentId)
|
|
205
231
|
continue;
|
|
@@ -223,6 +249,23 @@ export class ApprovalStore {
|
|
|
223
249
|
this.emit();
|
|
224
250
|
});
|
|
225
251
|
}
|
|
252
|
+
/** Re-resolve every parked ask's localized reason after a `/lang` switch;
|
|
253
|
+
* Chat re-renders on the switch, so the read below lands on the new
|
|
254
|
+
* language without a store subscription. */
|
|
255
|
+
refreshReasonLang() {
|
|
256
|
+
const lang = getLang();
|
|
257
|
+
if (lang === this.reasonLang)
|
|
258
|
+
return;
|
|
259
|
+
this.reasonLang = lang;
|
|
260
|
+
for (const pending of [...(this.active === undefined ? [] : [this.active]), ...this.queue]) {
|
|
261
|
+
const reason = reasonOf(pending.request);
|
|
262
|
+
if (reason === undefined)
|
|
263
|
+
delete pending.snapshot.reason;
|
|
264
|
+
else
|
|
265
|
+
pending.snapshot.reason = reason;
|
|
266
|
+
}
|
|
267
|
+
this.rebuildSnapshot();
|
|
268
|
+
}
|
|
226
269
|
/** Rebuild the cached snapshot after any mutation of active. */
|
|
227
270
|
rebuildSnapshot() {
|
|
228
271
|
const pending = this.active;
|
|
@@ -322,6 +365,7 @@ export class ApprovalStore {
|
|
|
322
365
|
assertCapabilityShadowPolicy('host.presentation.approve', this.runtime.mode, this.runtime.slices);
|
|
323
366
|
return new Promise(resolve => {
|
|
324
367
|
const command = commandOf(req);
|
|
368
|
+
const reason = reasonOf(req);
|
|
325
369
|
// Source badge: park() is reached through the approval/request
|
|
326
370
|
// waterfall, which any in-process plugin can dispatch — the agent-id
|
|
327
371
|
// gate in plugin.ts says whose SESSION it names, not that a live tool
|
|
@@ -342,7 +386,7 @@ export class ApprovalStore {
|
|
|
342
386
|
snapshot: {
|
|
343
387
|
agentId: String(req.agent.id),
|
|
344
388
|
toolName: req.toolName,
|
|
345
|
-
...(
|
|
389
|
+
...(reason !== undefined ? { reason } : {}),
|
|
346
390
|
...(command !== undefined ? { command } : {}),
|
|
347
391
|
...(external ? { external: true } : {}),
|
|
348
392
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/backend/translate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE,OAAO,KAAK,EAAE,YAAY,EAAqC,MAAM,0BAA0B,CAAA;AAC/F,OAAO,EAAa,KAAK,UAAU,EAAqB,KAAK,cAAc,EAA0D,MAAM,uBAAuB,CAAA;AAElK,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAI3D,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/backend/translate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE,OAAO,KAAK,EAAE,YAAY,EAAqC,MAAM,0BAA0B,CAAA;AAC/F,OAAO,EAAa,KAAK,UAAU,EAAqB,KAAK,cAAc,EAA0D,MAAM,uBAAuB,CAAA;AAElK,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAI3D,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAM1F,MAAM,WAAW,iBAAiB;IAChC;;0DAEsD;IACtD,KAAK,IAAI,iBAAiB,GAAG,SAAS,CAAA;IACtC;4EACwE;IACxE,KAAK,IAAI,OAAO,CAAA;IAChB;+DAC2D;IAC3D,WAAW,IAAI,OAAO,CAAA;CACvB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAkEtD;AA6FD,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB;4BA+K1B,YAAY,KAAG,SAAS,UAAU,EAAE;4BA0JpC,oBAAoB,KAAG,SAAS,UAAU,EAAE;8BAmB1C,SAAS,YAAY,EAAE,KAAG,SAAS,UAAU,EAAE;iBAW9D,IAAI;4BA7TS,MAAM,WAAW,MAAM,KAAG,YAAY,GAAG,SAAS;8BAYhD,MAAM,WAAW,MAAM,QAAQ,YAAY,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,KAAG,cAAc,GAAG,SAAS;EAyTjI;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
|
|
@@ -4,6 +4,8 @@ import { BACKGROUND_START_ACK, isSubagentToolName, parseJobOutputId, todoPanelIt
|
|
|
4
4
|
import { harnessToolResultView, prepareReplayEvents, toolErrorText } from '../channel/transcript.js';
|
|
5
5
|
import { isCompactionCheckpointSource, toolResultPayload } from '../compat/messages.js';
|
|
6
6
|
import { transcriptImagesOf } from '../transcript-images.js';
|
|
7
|
+
import { isTeamToolName, TEAM_SPAWN_TOOL, teamMessageOf, teamToolCallView, teamToolResultView } from '../team-tools.js';
|
|
8
|
+
import { teamMailboxAsRelay, withoutTeammateReminder } from '../compat/agent-team-0.2.0.js';
|
|
7
9
|
/**
|
|
8
10
|
* DeepSeek's rate windows, injected into the shared projector as its
|
|
9
11
|
* `pricingWindow`: each usage buckets by the time its request ran.
|
|
@@ -148,6 +150,8 @@ export function createDshTranslator(deps) {
|
|
|
148
150
|
/** Frame revisions are monotone within one attached Agent lifecycle; a
|
|
149
151
|
* re-delivered or out-of-order frame is dropped here. */
|
|
150
152
|
let lastStreamRevision = -1;
|
|
153
|
+
/** Whether this session's first human prompt has been translated. */
|
|
154
|
+
let promptSeen = false;
|
|
151
155
|
/**
|
|
152
156
|
* Open calls by callId until their result: what the result's presenter,
|
|
153
157
|
* images and task feeds need. `card: false` = question-presented (the
|
|
@@ -156,6 +160,35 @@ export function createDshTranslator(deps) {
|
|
|
156
160
|
* projector's own card index: deleted on result, cleared on reset.
|
|
157
161
|
*/
|
|
158
162
|
const openCalls = new Map();
|
|
163
|
+
/**
|
|
164
|
+
* `spawn_teammate` calls that have not written their member yet. The team
|
|
165
|
+
* refuses a teammate (name taken or invalid, member limit, not the Lead,
|
|
166
|
+
* service disposing, cancelled) before it appends `team/member`: no roster
|
|
167
|
+
* row carries that error, so a failed result brings back the plain card.
|
|
168
|
+
* Once the member is written its failure shows on the roster, and the call
|
|
169
|
+
* leaves this map. Bounded like `openCalls`.
|
|
170
|
+
*/
|
|
171
|
+
const unwrittenSpawns = new Map();
|
|
172
|
+
/** A `team/member` write settles the pending spawn of that name. Two
|
|
173
|
+
* parallel spawns of one name cannot be told apart; the first one goes. */
|
|
174
|
+
const onTeamMember = (data) => {
|
|
175
|
+
const name = data?.member?.name;
|
|
176
|
+
if (typeof name !== 'string')
|
|
177
|
+
return;
|
|
178
|
+
for (const [callId, call] of unwrittenSpawns) {
|
|
179
|
+
let args;
|
|
180
|
+
try {
|
|
181
|
+
args = JSON.parse(call.argsJson);
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
if (args?.name === name) {
|
|
187
|
+
unwrittenSpawns.delete(callId);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
};
|
|
159
192
|
/** Ask the producing tool how its call should render (diff/terminal/…).
|
|
160
193
|
* Unknown tool, unparseable args, or a throwing presenter all degrade to
|
|
161
194
|
* the plain text card. */
|
|
@@ -163,7 +196,7 @@ export function createDshTranslator(deps) {
|
|
|
163
196
|
try {
|
|
164
197
|
const tool = deps.tools()?.get(name, deps.scope());
|
|
165
198
|
if (tool?.presentCall === undefined)
|
|
166
|
-
return
|
|
199
|
+
return teamToolCallView(name, rawArgs);
|
|
167
200
|
return tool.presentCall(JSON.parse(rawArgs));
|
|
168
201
|
}
|
|
169
202
|
catch {
|
|
@@ -182,8 +215,13 @@ export function createDshTranslator(deps) {
|
|
|
182
215
|
if (local !== undefined)
|
|
183
216
|
return local;
|
|
184
217
|
const tool = deps.tools()?.get(name, deps.scope());
|
|
185
|
-
if (tool?.presentResult === undefined)
|
|
186
|
-
|
|
218
|
+
if (tool?.presentResult === undefined) {
|
|
219
|
+
// Only the team tools read the text: skip joining every other result.
|
|
220
|
+
if (!isTeamToolName(name))
|
|
221
|
+
return undefined;
|
|
222
|
+
const text = toolResultPayload(data.message).content.map(item => (item.type === 'text' ? item.text : '')).join('').trim();
|
|
223
|
+
return teamToolResultView(name, rawArgs, text);
|
|
224
|
+
}
|
|
187
225
|
return tool.presentResult(JSON.parse(rawArgs), {
|
|
188
226
|
...toolResultPayload(data.message),
|
|
189
227
|
...(data.meta !== undefined ? { meta: data.meta } : {}),
|
|
@@ -194,7 +232,8 @@ export function createDshTranslator(deps) {
|
|
|
194
232
|
}
|
|
195
233
|
};
|
|
196
234
|
const translateUserMessage = (event) => {
|
|
197
|
-
|
|
235
|
+
// compat(dsh 0.2.0, log): a 0.2.0 mailbox delivery reads as the relay it became.
|
|
236
|
+
const data = teamMailboxAsRelay(event.data);
|
|
198
237
|
const base = { id: data.id, anchor: String(event.seq), seq: event.seq, time: event.time, blocks: data.content };
|
|
199
238
|
// Both legacy and V4 checkpoints render as a folded summary rather than
|
|
200
239
|
// disappearing with the other injected context.
|
|
@@ -217,16 +256,28 @@ export function createDshTranslator(deps) {
|
|
|
217
256
|
return NO_EVENTS;
|
|
218
257
|
return [goalChange(change)];
|
|
219
258
|
}
|
|
259
|
+
if (data.source.kind === 'model-selection') {
|
|
260
|
+
return [{ type: 'notice', level: 'info', text: textOf(data.content) }];
|
|
261
|
+
}
|
|
262
|
+
// An Agent Teams peer message: a bubble labelled with its sender.
|
|
263
|
+
const team = teamMessageOf(data.source, data.content);
|
|
264
|
+
if (team !== undefined) {
|
|
265
|
+
return [{ type: 'user.message', ...base, blocks: team.blocks, source: 'team-message', sender: team.sender, text: team.text }];
|
|
266
|
+
}
|
|
220
267
|
// Injected context (plugin/skill source) is model-facing only; it has no
|
|
221
268
|
// transcript-facing text.
|
|
222
269
|
if (data.source.kind !== 'user')
|
|
223
270
|
return [{ type: 'user.message', ...base, source: 'injected', text: '' }];
|
|
271
|
+
// compat(dsh 0.2.0, log): a 0.2.0 teammate's first prompt drops its identity block.
|
|
272
|
+
const content = promptSeen ? data.content : withoutTeammateReminder(data).content;
|
|
273
|
+
promptSeen = true;
|
|
224
274
|
return [{
|
|
225
275
|
type: 'user.message',
|
|
226
276
|
...base,
|
|
277
|
+
blocks: content,
|
|
227
278
|
source: 'user',
|
|
228
|
-
text: firstTextOf(
|
|
229
|
-
images: transcriptImagesOf(
|
|
279
|
+
text: firstTextOf(content),
|
|
280
|
+
images: transcriptImagesOf(content, deps.attachments),
|
|
230
281
|
}];
|
|
231
282
|
};
|
|
232
283
|
const translateToolResult = (event) => {
|
|
@@ -234,6 +285,8 @@ export function createDshTranslator(deps) {
|
|
|
234
285
|
const callId = data.message.source.callId;
|
|
235
286
|
const call = openCalls.get(callId);
|
|
236
287
|
openCalls.delete(callId);
|
|
288
|
+
const spawn = unwrittenSpawns.get(callId);
|
|
289
|
+
unwrittenSpawns.delete(callId);
|
|
237
290
|
const payload = toolResultPayload(data.message);
|
|
238
291
|
const isError = data.error !== undefined || payload.isError;
|
|
239
292
|
// Text/presentation/images are derived only for results something
|
|
@@ -250,11 +303,13 @@ export function createDshTranslator(deps) {
|
|
|
250
303
|
time: event.time,
|
|
251
304
|
content: payload.content,
|
|
252
305
|
text,
|
|
253
|
-
...(isError && call !== undefined ? { errorText: toolErrorText(event) } : {}),
|
|
306
|
+
...(isError && (call !== undefined || spawn !== undefined) ? { errorText: toolErrorText(event) } : {}),
|
|
254
307
|
...(card === undefined ? {} : { images: transcriptImagesOf(data.message.content, deps.attachments) }),
|
|
255
308
|
...(data.meta === undefined ? {} : { meta: data.meta }),
|
|
256
309
|
...(card === undefined || isError ? {} : { presentation: presentResultView(card.name, card.args, data) }),
|
|
257
310
|
};
|
|
311
|
+
if (spawn !== undefined && isError)
|
|
312
|
+
return [{ ...spawn, presentation: presentCallView(spawn.name, spawn.argsJson) }, result];
|
|
258
313
|
if (card === undefined || isError)
|
|
259
314
|
return [result];
|
|
260
315
|
const events = [result];
|
|
@@ -325,8 +380,11 @@ export function createDshTranslator(deps) {
|
|
|
325
380
|
return [{ ...base, presentation: QUESTION }];
|
|
326
381
|
}
|
|
327
382
|
// The delegation tools render as the live subagent card.
|
|
328
|
-
if (isSubagentToolName(data.name))
|
|
383
|
+
if (isSubagentToolName(data.name)) {
|
|
384
|
+
if (data.name === TEAM_SPAWN_TOOL)
|
|
385
|
+
unwrittenSpawns.set(callId, base);
|
|
329
386
|
return [{ ...base, presentation: SUBAGENT }];
|
|
387
|
+
}
|
|
330
388
|
openCalls.set(callId, { name: data.name, args: data.arguments, card: true });
|
|
331
389
|
return [{ ...base, presentation: presentCallView(data.name, data.arguments) }];
|
|
332
390
|
}
|
|
@@ -371,6 +429,8 @@ export function createDshTranslator(deps) {
|
|
|
371
429
|
break;
|
|
372
430
|
}
|
|
373
431
|
const data = event.data;
|
|
432
|
+
if (type === 'team/member')
|
|
433
|
+
onTeamMember(data);
|
|
374
434
|
switch (type) {
|
|
375
435
|
case 'assistant/chunk': {
|
|
376
436
|
// Pre-0.1.5 live streams and raw pre-V3 logs carry per-token chunks
|
|
@@ -451,6 +511,7 @@ export function createDshTranslator(deps) {
|
|
|
451
511
|
*/
|
|
452
512
|
const translateReplay = (events) => {
|
|
453
513
|
lastStreamRevision = -1;
|
|
514
|
+
promptSeen = false;
|
|
454
515
|
const out = [];
|
|
455
516
|
for (const event of prepareReplayEvents(events)) {
|
|
456
517
|
for (const translated of translateEvent(event))
|
|
@@ -461,7 +522,9 @@ export function createDshTranslator(deps) {
|
|
|
461
522
|
/** Forget the frame fence and every open call (paired with a projector reset). */
|
|
462
523
|
const reset = () => {
|
|
463
524
|
lastStreamRevision = -1;
|
|
525
|
+
promptSeen = false;
|
|
464
526
|
openCalls.clear();
|
|
527
|
+
unwrittenSpawns.clear();
|
|
465
528
|
};
|
|
466
529
|
return { translateEvent, translateFrame, translateReplay, reset, presentCallView, presentResultView };
|
|
467
530
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admission of one backend declaration (B-2, W-1): what the *host* knows about a
|
|
3
|
+
* `BackendSpec`, decided before anything runs.
|
|
4
|
+
*
|
|
5
|
+
* `validateBackendSpec()` (tui-profile) answers "is this shape well formed?".
|
|
6
|
+
* This answers the other half: "can this host honor it?" — a capability name in a
|
|
7
|
+
* vocabulary the host does not implement, a permission name with no grant, an id
|
|
8
|
+
* the host owns. The two are deliberately separate layers: the shape validator
|
|
9
|
+
* lives with the protocol (it must reject the same thing in every host that
|
|
10
|
+
* implements the family), while these verdicts depend on host state.
|
|
11
|
+
*
|
|
12
|
+
* The five-state vocabulary is reused verbatim from the plugin admission
|
|
13
|
+
* (`NegotiationDecision`, `NEGOTIATION_ERROR_CODES`), not invented here:
|
|
14
|
+
* a contribution family speaks the same admission language as every other
|
|
15
|
+
* plugin surface, and `negotiate.ts` stays untouched (it has no backend concept
|
|
16
|
+
* and does not need one).
|
|
17
|
+
*
|
|
18
|
+
* **Scope.** This decides; it does not wire the family into the registry /
|
|
19
|
+
* descriptor chain by itself. Since W-2 (stage C) that chain *is* wired —
|
|
20
|
+
* `Backend` is a host-published contract, the profile pins this family's contract
|
|
21
|
+
* profile by digest and the descriptor publishes the coordinate only on real
|
|
22
|
+
* probe evidence ({@link probeBackendAdmission}) — while the step that reads a
|
|
23
|
+
* mounted bundle's declaration into {@link registerBackend} is still the stage C
|
|
24
|
+
* install chain's work.
|
|
25
|
+
*
|
|
26
|
+
* **Published codes.** The contract profile
|
|
27
|
+
* (`tui-profile/registry/contracts/backend-v1alpha1.json`) publishes exactly the
|
|
28
|
+
* codes this file can produce: `BACKEND_ID_RESERVED` and `PERMISSION_NOT_GRANTED`.
|
|
29
|
+
* A code with no producer is a phantom its readers would write error handling for,
|
|
30
|
+
* so a future one waits until the stage that gives it a producer
|
|
31
|
+
* (`scripts/verify-backend-contribution.ts` pins the pair).
|
|
32
|
+
*/
|
|
33
|
+
import type { BackendSpec } from '../adapter/spec/tui-contributions.js';
|
|
34
|
+
import type { NegotiationDecision } from '../adapter/standard/types.js';
|
|
35
|
+
/** The host facts the verdict depends on; passed in, so the function is pure. */
|
|
36
|
+
export interface BackendAdmissionHost {
|
|
37
|
+
/** Ids this host owns (`BUILTIN_BACKEND_IDS`); a contribution may not wear one. */
|
|
38
|
+
readonly reservedIds: ReadonlySet<string>;
|
|
39
|
+
/** Names this host's session model implements (`BACKEND_CAPABILITY_NAMES`). */
|
|
40
|
+
readonly capabilityNames: ReadonlySet<string>;
|
|
41
|
+
/** The host's permission vocabulary (`EXPECTED_PERMISSIONS`). */
|
|
42
|
+
readonly permissionNames: ReadonlySet<string>;
|
|
43
|
+
/** Permissions actually granted to this entry; empty until a grant flow (C). */
|
|
44
|
+
readonly granted: ReadonlySet<string>;
|
|
45
|
+
}
|
|
46
|
+
/** The verdicts a registered entry can carry: the two that admit, and the one
|
|
47
|
+
* that registers without being offered. `rejected`/`unknown` never reach the
|
|
48
|
+
* registry — the caller throws on them (a build-time error for an in-tree
|
|
49
|
+
* manifest must be loud). `reasonCode` stays a `string` because the vocabulary
|
|
50
|
+
* is `NegotiationDecision`'s, shared with every other plugin surface; among
|
|
51
|
+
* these three verdicts the only `reasonCode` produced is
|
|
52
|
+
* `PERMISSION_NOT_GRANTED` (`rejected` carries `BACKEND_ID_RESERVED`). */
|
|
53
|
+
export type BackendAdmission = {
|
|
54
|
+
readonly decision: 'compatible';
|
|
55
|
+
} | {
|
|
56
|
+
readonly decision: 'compatible_degraded';
|
|
57
|
+
readonly missingOptional: readonly string[];
|
|
58
|
+
} | {
|
|
59
|
+
readonly decision: 'waiting_authorization';
|
|
60
|
+
readonly reasonCode: string;
|
|
61
|
+
readonly deniedPermissions: readonly string[];
|
|
62
|
+
};
|
|
63
|
+
export declare function backendAdmission(spec: BackendSpec, host: BackendAdmissionHost): NegotiationDecision;
|
|
64
|
+
//# sourceMappingURL=backend-admission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-admission.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/backend-admission.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAEvE,iFAAiF;AACjF,MAAM,WAAW,oBAAoB;IACnC,mFAAmF;IACnF,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACzC,+EAA+E;IAC/E,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC7C,iEAAiE;IACjE,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC7C,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CACtC;AAED;;;;;;2EAM2E;AAC3E,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,GACnC;IAAE,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IAAC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACzF;IAAE,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAA;AAO9H,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,oBAAoB,GAAG,mBAAmB,CA4BnG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Unknown capability or permission names, in the same list, distinguishable at
|
|
2
|
+
* a glance from protocol coordinates (which are `apiVersion#kind`). */
|
|
3
|
+
const capabilityItem = (name) => `capability:${name}`;
|
|
4
|
+
const permissionItem = (name) => `permission:${name}`;
|
|
5
|
+
export function backendAdmission(spec, host) {
|
|
6
|
+
// A reserved id never reaches here in the in-tree path (registerBackend refuses
|
|
7
|
+
// it before projecting), but this is the reusable gate for a bundle, so it
|
|
8
|
+
// refuses it itself rather than trusting the caller to have done it. The other
|
|
9
|
+
// two member refusals — a host label key and a `nativeKey` declaration — are
|
|
10
|
+
// shape violations: `validateBackendSpec()` rejects both as unknown fields
|
|
11
|
+
// (`exactRecord`), so they cannot arrive as a `BackendSpec` at all and never
|
|
12
|
+
// need a reason code of their own.
|
|
13
|
+
if (host.reservedIds.has(spec.id)) {
|
|
14
|
+
return { decision: 'rejected', reasonCode: 'BACKEND_ID_RESERVED' };
|
|
15
|
+
}
|
|
16
|
+
const unknownCapabilities = spec.capabilities.filter(name => !host.capabilityNames.has(name));
|
|
17
|
+
const unknownGrants = spec.grants.filter(name => !host.permissionNames.has(name));
|
|
18
|
+
const denied = spec.grants.filter(name => host.permissionNames.has(name) && !host.granted.has(name));
|
|
19
|
+
// A permission the host cannot name is a fact the host must not act on: it is
|
|
20
|
+
// recorded as a pending item and the entry degrades, exactly like an unknown
|
|
21
|
+
// capability (D-3). Silently treating it as usable would claim a grant nobody
|
|
22
|
+
// can revoke; refusing would invent a permission vocabulary.
|
|
23
|
+
const missingOptional = [...unknownCapabilities.map(capabilityItem), ...unknownGrants.map(permissionItem)];
|
|
24
|
+
if (denied.length > 0) {
|
|
25
|
+
return {
|
|
26
|
+
decision: 'waiting_authorization',
|
|
27
|
+
reasonCode: 'PERMISSION_NOT_GRANTED',
|
|
28
|
+
deniedPermissions: [...denied],
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (missingOptional.length > 0)
|
|
32
|
+
return { decision: 'compatible_degraded', missingOptional };
|
|
33
|
+
return { decision: 'compatible' };
|
|
34
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
/** One bundle whose `Backend` declaration did not become a registry entry. */
|
|
3
|
+
export interface BackendAssemblyRefusal {
|
|
4
|
+
readonly bundle: string;
|
|
5
|
+
readonly reason: string;
|
|
6
|
+
}
|
|
7
|
+
/** What one assembly pass did. Returned rather than only logged, so the
|
|
8
|
+
* regression can assert the pass without reading the logs. */
|
|
9
|
+
export interface BackendAssembly {
|
|
10
|
+
/** The profile manifest the pass read, when this boot has one. */
|
|
11
|
+
readonly profile: string | undefined;
|
|
12
|
+
/** Bundle layers the pass looked at (composition-owned packages excluded). */
|
|
13
|
+
readonly scanned: readonly string[];
|
|
14
|
+
/** Backend ids registered by this pass, in scan order. The built-in seed is
|
|
15
|
+
* registered before it and is not part of the report. */
|
|
16
|
+
readonly registered: readonly string[];
|
|
17
|
+
/** Bundles that announced a backend this host could not assemble. */
|
|
18
|
+
readonly refused: readonly BackendAssemblyRefusal[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Register every backend an installed bundle declares.
|
|
22
|
+
*
|
|
23
|
+
* Synchronous by contract (see the module comment): the caller runs this before
|
|
24
|
+
* the boot parses a backend choice. A second pass over the same composition is a
|
|
25
|
+
* no-op for the entries the first pass registered (see {@link assemblyStateOf}) —
|
|
26
|
+
* two callers exist on purpose: the entry decides which kernel to boot *before*
|
|
27
|
+
* `apply` runs, and both questions ("is this bundle a layer" for the route, "which
|
|
28
|
+
* backend is this id" for the session) are answered by the same registry.
|
|
29
|
+
*/
|
|
30
|
+
export declare function assembleBackendsFromProfile(ctx: Context): BackendAssembly;
|
|
31
|
+
//# sourceMappingURL=backend-assembly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-assembly.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/backend-assembly.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAOlD,8EAA8E;AAC9E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED;+DAC+D;AAC/D,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC;8DAC0D;IAC1D,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,SAAS,sBAAsB,EAAE,CAAA;CACpD;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CA2CzE"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The assembly point (Stage D-1 / roadmap §4.7): the `Backend` declarations of the
|
|
3
|
+
* bundles a profile composes become registry entries, so that installing a
|
|
4
|
+
* third-party backend bundle and restarting puts that backend in the kernel
|
|
5
|
+
* picker.
|
|
6
|
+
*
|
|
7
|
+
* Three properties decide the shape of this file.
|
|
8
|
+
*
|
|
9
|
+
* - **Discovery precedes parsing, synchronously.** The boot parses a backend
|
|
10
|
+
* choice through the registry (`parseBackendChoice`, membership is the second
|
|
11
|
+
* half of the parse — P0 D1), and an id that is not registered yet reads as an
|
|
12
|
+
* unknown value: dsh plus a warning, never the backend the user installed.
|
|
13
|
+
* Nothing that waits for a fiber to activate can satisfy that: a third-party
|
|
14
|
+
* bundle's rows are composed *after* this row (the profile's own bundles come
|
|
15
|
+
* before `cordis.patch.yml`), so an event or timer would fire after the parse.
|
|
16
|
+
* The discovery therefore reads **files** — the profile's own manifest — and
|
|
17
|
+
* registers before anything is parsed. The import of the backend module stays
|
|
18
|
+
* lazy (an installed backend nobody selects is never imported, D4).
|
|
19
|
+
*
|
|
20
|
+
* - **One reading of "what is installed".** `/plugin install` and the CLI both
|
|
21
|
+
* record an installed bundle in the profile manifest's `dsh.profile.bundles`
|
|
22
|
+
* (the manager's own `reconcile()` writes it), and the profile manifest is what
|
|
23
|
+
* the Loader composes. So the scan reads that file, not the plugin-manager
|
|
24
|
+
* service: the service's `listBundles()` is asynchronous, and a service answer
|
|
25
|
+
* would arrive after the parse. The predicate is the same one
|
|
26
|
+
* `./plugin-manager.ts`'s `extraBundles()` uses — the composition's own packages
|
|
27
|
+
* are not plugins a person installed — so the list and the assembly cannot
|
|
28
|
+
* disagree about whom they are talking about.
|
|
29
|
+
*
|
|
30
|
+
* - **Judgement, never a guess.** A bundle's declaration is read only through the
|
|
31
|
+
* identity rule #1568 established: the entry is resolved by the Loader's own ESM
|
|
32
|
+
* resolver and the `dsh-plugin.json` counts only beside the `package.json` that
|
|
33
|
+
* establishes that entry's package root. A Loader without Node internals cannot
|
|
34
|
+
* answer that question, and this module then refuses to answer it too, saying
|
|
35
|
+
* so, instead of falling back to a second path resolver of its own.
|
|
36
|
+
*
|
|
37
|
+
* A refusal is contained, never silent and never fatal: notes 0009 requires a
|
|
38
|
+
* failure to be attributable to the entry it belongs to, without taking the rest
|
|
39
|
+
* of the composition down. Registration errors therefore become one warning line
|
|
40
|
+
* naming the bundle and the reason (the registry's own checks stay as loud as they
|
|
41
|
+
* are — this catches them one level out), and every other bundle is still
|
|
42
|
+
* assembled.
|
|
43
|
+
*/
|
|
44
|
+
import { readFileSync } from 'node:fs';
|
|
45
|
+
import { fileURLToPath } from 'node:url';
|
|
46
|
+
import { join } from 'node:path';
|
|
47
|
+
import { logForDebugging } from '../utils/debug.js';
|
|
48
|
+
import { findManifest, loadThroughLoader, compositionLoader, resolveEntryUrl } from './admission-loader.js';
|
|
49
|
+
import { backendManifestOf } from './backend-contribution.js';
|
|
50
|
+
import { registerBackend } from './backend-registry.js';
|
|
51
|
+
import { declaredBackendsIn, isCompositionOwned } from './plugin-declaration.js';
|
|
52
|
+
/**
|
|
53
|
+
* Register every backend an installed bundle declares.
|
|
54
|
+
*
|
|
55
|
+
* Synchronous by contract (see the module comment): the caller runs this before
|
|
56
|
+
* the boot parses a backend choice. A second pass over the same composition is a
|
|
57
|
+
* no-op for the entries the first pass registered (see {@link assemblyStateOf}) —
|
|
58
|
+
* two callers exist on purpose: the entry decides which kernel to boot *before*
|
|
59
|
+
* `apply` runs, and both questions ("is this bundle a layer" for the route, "which
|
|
60
|
+
* backend is this id" for the session) are answered by the same registry.
|
|
61
|
+
*/
|
|
62
|
+
export function assembleBackendsFromProfile(ctx) {
|
|
63
|
+
const profile = profileManifestPathOf(ctx);
|
|
64
|
+
const refused = [];
|
|
65
|
+
const registered = [];
|
|
66
|
+
const done = (scanned) => ({ profile, scanned, registered, refused });
|
|
67
|
+
if (profile === undefined) {
|
|
68
|
+
logForDebugging('dsh-tui: backend assembly skipped — this composition has no profile directory to read (no baseUrl)');
|
|
69
|
+
return done([]);
|
|
70
|
+
}
|
|
71
|
+
const bundles = installedBundlesOf(profile);
|
|
72
|
+
if (bundles === undefined)
|
|
73
|
+
return done([]);
|
|
74
|
+
const scanned = bundles.filter(name => !isCompositionOwned(name));
|
|
75
|
+
if (scanned.length === 0)
|
|
76
|
+
return done(scanned);
|
|
77
|
+
const baseUrl = ctx.baseUrl;
|
|
78
|
+
const loader = compositionLoader(ctx);
|
|
79
|
+
if (loader?.internal === undefined) {
|
|
80
|
+
// The Loader runs plugins through plain `import()` when it has no Node
|
|
81
|
+
// internals, but that path resolves relative to *this* module: an answer
|
|
82
|
+
// computed here would name a module the Loader never executes. Refuse.
|
|
83
|
+
logForDebugging(`dsh-tui: backend assembly skipped — the Loader ESM resolver is unavailable, so the entry of `
|
|
84
|
+
+ `${scanned.length} installed bundle(s) cannot be established: ${scanned.join(', ')}`);
|
|
85
|
+
return done(scanned);
|
|
86
|
+
}
|
|
87
|
+
const state = assemblyStateOf(ctx);
|
|
88
|
+
for (const bundle of scanned) {
|
|
89
|
+
for (const refusal of assembleBundle(bundle, loader, baseUrl, registered, state.owners))
|
|
90
|
+
refused.push(refusal);
|
|
91
|
+
}
|
|
92
|
+
if (registered.length > 0) {
|
|
93
|
+
logForDebugging(`dsh-tui: registered ${registered.length} backend(s) from installed bundles: ${registered.join(', ')}`);
|
|
94
|
+
}
|
|
95
|
+
for (const refusal of refused) {
|
|
96
|
+
// Attributable and loud for the person who installed it — a backend that
|
|
97
|
+
// silently never appears is the one outcome nobody can debug. Said once per
|
|
98
|
+
// composition: the second pass (the entry assembles, `apply` assembles again)
|
|
99
|
+
// reports the same refusals and must not repeat them to the reader.
|
|
100
|
+
const said = `${refusal.bundle}\u0000${refusal.reason}`;
|
|
101
|
+
if (state.warned.has(said))
|
|
102
|
+
continue;
|
|
103
|
+
state.warned.add(said);
|
|
104
|
+
ctx.logger.warn(`dsh-tui: bundle "${refusal.bundle}" declares a backend that was not registered: ${refusal.reason}`);
|
|
105
|
+
}
|
|
106
|
+
return done(scanned);
|
|
107
|
+
}
|
|
108
|
+
const assemblyStateOf = (ctx) => {
|
|
109
|
+
const existing = assembled.get(ctx);
|
|
110
|
+
if (existing !== undefined)
|
|
111
|
+
return existing;
|
|
112
|
+
const fresh = { owners: new Map(), warned: new Set() };
|
|
113
|
+
assembled.set(ctx, fresh);
|
|
114
|
+
return fresh;
|
|
115
|
+
};
|
|
116
|
+
const assembled = new WeakMap();
|
|
117
|
+
/** One bundle's declarations → registry entries. Returns the refusals it owns. */
|
|
118
|
+
function assembleBundle(bundle, loader, baseUrl, registered, owned) {
|
|
119
|
+
const refuse = (reason) => [{ bundle, reason }];
|
|
120
|
+
const url = resolveEntryUrl(loader, bundle, baseUrl);
|
|
121
|
+
if (url === undefined) {
|
|
122
|
+
return refuse('its entry module could not be resolved through the Loader resolver');
|
|
123
|
+
}
|
|
124
|
+
let entryFile;
|
|
125
|
+
try {
|
|
126
|
+
entryFile = fileURLToPath(url);
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return refuse(`its entry resolved to ${url}, which is not a file`);
|
|
130
|
+
}
|
|
131
|
+
const manifestPath = findManifest(entryFile);
|
|
132
|
+
// No package-root declaration: this bundle is not a TUI plugin at all, which
|
|
133
|
+
// is the normal case and not a problem to report.
|
|
134
|
+
if (manifestPath === undefined)
|
|
135
|
+
return [];
|
|
136
|
+
let source;
|
|
137
|
+
try {
|
|
138
|
+
source = readFileSync(manifestPath, 'utf8');
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
return refuse(`its declaration at ${manifestPath} could not be read (${messageOf(error)})`);
|
|
142
|
+
}
|
|
143
|
+
const { backends, problems } = declaredBackendsIn(source);
|
|
144
|
+
const refusals = problems.map(problem => ({ bundle, reason: problem }));
|
|
145
|
+
if (backends.length === 0 && problems.length === 0)
|
|
146
|
+
return [];
|
|
147
|
+
// The public declaration has no export selector: all entries would load the
|
|
148
|
+
// same `backend` object, which can carry only one session/data-directory id.
|
|
149
|
+
if (backends.length > 1)
|
|
150
|
+
return [...refusals, { bundle, reason: 'only one Backend per bundle can bind the fixed backend export' }];
|
|
151
|
+
for (const declared of backends) {
|
|
152
|
+
// A second pass over the same composition (the entry assembles before the
|
|
153
|
+
// route and `apply` assembles again) must be a no-op, not a storm of
|
|
154
|
+
// "already registered". An id this very bundle registered is the same entry;
|
|
155
|
+
// an id another bundle claimed is a conflict, and the registry answers it.
|
|
156
|
+
if (owned.get(declared.spec.id) === bundle)
|
|
157
|
+
continue;
|
|
158
|
+
let manifest;
|
|
159
|
+
try {
|
|
160
|
+
manifest = backendManifestOf(declared.spec);
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
refusals.push({ bundle, reason: `its Backend declaration could not be projected (${messageOf(error)})` });
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
try {
|
|
167
|
+
// `load` is the module namespace, resolved once here and imported only if
|
|
168
|
+
// this backend is ever selected. The registry reads `backendExport`
|
|
169
|
+
// (default `backend`) and `unloadExport` out of that namespace, exactly as
|
|
170
|
+
// it does for the built-in index.
|
|
171
|
+
registerBackend({ manifest, load: () => loadThroughLoader(loader, bundle, url, baseUrl) });
|
|
172
|
+
registered.push(manifest.id);
|
|
173
|
+
owned.set(manifest.id, bundle);
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
refusals.push({ bundle, reason: messageOf(error) });
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return refusals;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* The profile manifest this boot reads and composes: the `package.json` of the
|
|
183
|
+
* directory the Loader resolves module specifiers against (`Context.baseUrl`, set
|
|
184
|
+
* by the host to the profile directory — every row's context inherits it). No
|
|
185
|
+
* `baseUrl` means no profile (a bare Cordis root, a `--config` overlay, a source
|
|
186
|
+
* checkout), and then no bundle was installed into anything either.
|
|
187
|
+
*/
|
|
188
|
+
function profileManifestPathOf(ctx) {
|
|
189
|
+
const baseUrl = ctx.baseUrl;
|
|
190
|
+
if (typeof baseUrl !== 'string' || baseUrl === '')
|
|
191
|
+
return undefined;
|
|
192
|
+
try {
|
|
193
|
+
const url = new URL(baseUrl);
|
|
194
|
+
if (url.protocol !== 'file:')
|
|
195
|
+
return undefined;
|
|
196
|
+
return join(fileURLToPath(url), 'package.json');
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return undefined;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* The bundle layers this profile composes: `dsh.profile.bundles` in its manifest,
|
|
204
|
+
* which is what `/plugin install`, `enable` and the CLI all write (the manager's
|
|
205
|
+
* `reconcile()` appends every newly installed bundle that declares `dsh.bundle`;
|
|
206
|
+
* a disabled one leaves the list without being uninstalled). `undefined` when the
|
|
207
|
+
* file cannot be read or parsed — a broken profile is not an empty one.
|
|
208
|
+
*/
|
|
209
|
+
function installedBundlesOf(profile) {
|
|
210
|
+
let parsed;
|
|
211
|
+
try {
|
|
212
|
+
parsed = JSON.parse(readFileSync(profile, 'utf8'));
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
logForDebugging(`dsh-tui: backend assembly skipped — ${profile} could not be read (${messageOf(error)})`);
|
|
216
|
+
return undefined;
|
|
217
|
+
}
|
|
218
|
+
const declared = parsed?.dsh?.profile?.bundles;
|
|
219
|
+
if (!Array.isArray(declared))
|
|
220
|
+
return [];
|
|
221
|
+
return declared.filter((name) => typeof name === 'string' && name !== '');
|
|
222
|
+
}
|
|
223
|
+
function messageOf(error) {
|
|
224
|
+
return error instanceof Error ? error.message : String(error);
|
|
225
|
+
}
|