@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
|
@@ -1,6 +1,122 @@
|
|
|
1
1
|
import { t } from '../../i18n.js';
|
|
2
2
|
import { isReservedCredentialRef } from '../credentialRefGuard.js';
|
|
3
|
+
import { getPath } from '../settingsEditor.js';
|
|
3
4
|
import { settingsValue } from '../compat/settings.js';
|
|
5
|
+
import { concreteService } from '../host-access.js';
|
|
6
|
+
// An opaque leaf survives the renderer's detached read projections. Plain
|
|
7
|
+
// metadata cannot forge it; writes still pass the Channel UI lifetime/policy gate.
|
|
8
|
+
class WebCredentialAuthorization {
|
|
9
|
+
}
|
|
10
|
+
const webCredentialFields = new WeakMap();
|
|
11
|
+
/** Forms over the host's web settings; provider selection remains owned by DSH. */
|
|
12
|
+
export function webSettingsSections(ctx, namespaces) {
|
|
13
|
+
const available = new Set(namespaces.map(view => view.ns));
|
|
14
|
+
const loader = ctx.get('loader');
|
|
15
|
+
const web = ctx.get('web');
|
|
16
|
+
const webOwner = web === undefined ? undefined : concreteService(web).ctx.fiber;
|
|
17
|
+
let webNs;
|
|
18
|
+
let apiNs;
|
|
19
|
+
let messagesNs;
|
|
20
|
+
let apiOwner;
|
|
21
|
+
let messagesOwner;
|
|
22
|
+
// Settings namespaces belong to Config-owning fibers, not package or row names.
|
|
23
|
+
for (const entry of loader?.entries() ?? []) {
|
|
24
|
+
// entry.id includes an Include tree path; settings uses the raw Config owner ID.
|
|
25
|
+
const ns = entry.options.id;
|
|
26
|
+
if (entry.fiber === undefined || !available.has(ns))
|
|
27
|
+
continue;
|
|
28
|
+
if (webOwner !== undefined && concreteService(entry.fiber) === concreteService(webOwner))
|
|
29
|
+
webNs = ns;
|
|
30
|
+
if (entry.fiber.runtime?.name === 'web-deepseek-api') {
|
|
31
|
+
apiNs = ns;
|
|
32
|
+
apiOwner = concreteService(entry.fiber);
|
|
33
|
+
}
|
|
34
|
+
if (entry.fiber.runtime?.name === 'web-search-deepseek') {
|
|
35
|
+
messagesNs = ns;
|
|
36
|
+
messagesOwner = concreteService(entry.fiber);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
// This section is introduced together with live provider selection in rc.2.
|
|
40
|
+
// Older hosts keep their existing search route without an ineffective picker.
|
|
41
|
+
if (apiNs === undefined)
|
|
42
|
+
return [];
|
|
43
|
+
const sections = [];
|
|
44
|
+
if (webNs !== undefined)
|
|
45
|
+
sections.push({
|
|
46
|
+
ns: webNs, title: 'Web search', descriptions: { zh: '网页搜索' },
|
|
47
|
+
fields: [
|
|
48
|
+
{
|
|
49
|
+
path: ['searchProvider'], label: 'Search', descriptions: { zh: '搜索' }, kind: 'text',
|
|
50
|
+
hint: 'Select DeepSeek Search API or Messages search. Custom provider IDs are also accepted.',
|
|
51
|
+
hintDescriptions: { zh: '选择 DeepSeek Search API 或 Messages 搜索,也可输入自定义提供者 ID。' },
|
|
52
|
+
options: [
|
|
53
|
+
{ value: 'deepseek-search-api', label: 'Search API', descriptions: { zh: '搜索 API' } },
|
|
54
|
+
{ value: 'deepseek-official', label: 'Messages' },
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
path: ['fetchProvider'], label: 'Fetch', descriptions: { zh: '抓取' }, kind: 'text',
|
|
59
|
+
hint: 'Select DeepSeek Fetch API or local HTTP fetch. Changes apply to the next operation.',
|
|
60
|
+
hintDescriptions: { zh: '选择 DeepSeek Fetch API 或本地 HTTP 抓取,保存后从下一次操作生效。' },
|
|
61
|
+
options: [
|
|
62
|
+
{ value: 'deepseek-fetch-api', label: 'Fetch API', descriptions: { zh: '抓取 API' } },
|
|
63
|
+
{ value: 'http', label: 'HTTP' },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
...(() => {
|
|
67
|
+
const searchApi = getPath(namespaces.find(view => view.ns === webNs)?.value, ['searchProvider']) === 'deepseek-search-api';
|
|
68
|
+
const ns = searchApi ? apiNs : messagesNs ?? apiNs;
|
|
69
|
+
const owner = searchApi ? apiOwner : messagesOwner ?? apiOwner;
|
|
70
|
+
const ref = getPath(namespaces.find(view => view.ns === ns)?.value, ['apiKeyEnv']) ?? 'DEEPSEEK_API_KEY';
|
|
71
|
+
const store = ctx.get('credentials');
|
|
72
|
+
if (owner === undefined || store === undefined || typeof ref !== 'string' || !/^[A-Za-z_][A-Za-z0-9_]*$/u.test(ref))
|
|
73
|
+
return [];
|
|
74
|
+
const authorization = Object.freeze(new WebCredentialAuthorization());
|
|
75
|
+
const field = {
|
|
76
|
+
path: ['apiKey'], label: 'API key', descriptions: { zh: 'API 密钥' }, kind: 'text', secret: { ref, authorization },
|
|
77
|
+
hint: 'Paste a key for the selected search API. Saved keys are never displayed.',
|
|
78
|
+
hintDescriptions: { zh: '粘贴当前搜索 API 的密钥,保存后不再显示原值。' },
|
|
79
|
+
};
|
|
80
|
+
webCredentialFields.set(authorization, { store: concreteService(store), owner, ns, ref });
|
|
81
|
+
return [field];
|
|
82
|
+
})(),
|
|
83
|
+
],
|
|
84
|
+
});
|
|
85
|
+
sections.push({
|
|
86
|
+
ns: apiNs, title: 'DeepSeek Search / Fetch API',
|
|
87
|
+
descriptions: { zh: 'DeepSeek 搜索 / 抓取 API' },
|
|
88
|
+
fields: [
|
|
89
|
+
{ path: ['baseURL'], label: 'API base URL', descriptions: { zh: 'API 基础地址' }, kind: 'text',
|
|
90
|
+
hint: 'Include the path prefix, without /search or /fetch.',
|
|
91
|
+
hintDescriptions: { zh: '包含路径前缀,不含末尾的 /search 或 /fetch。' } },
|
|
92
|
+
{ path: ['count'], label: 'Search result count', descriptions: { zh: '搜索结果数' }, kind: 'number',
|
|
93
|
+
parse(text) {
|
|
94
|
+
if (text.trim() === '')
|
|
95
|
+
return { kind: 'clear' };
|
|
96
|
+
const value = Number(text);
|
|
97
|
+
return Number.isInteger(value) && value >= 1 && value <= 50 ? { kind: 'set', value } : undefined;
|
|
98
|
+
} },
|
|
99
|
+
{ path: ['sendOriginalQuestion'], label: 'Send original question', descriptions: { zh: '发送原始问题' }, kind: 'boolean',
|
|
100
|
+
hint: 'Send up to 128 characters of the latest user prompt with the search query.',
|
|
101
|
+
hintDescriptions: { zh: '搜索时附带最近一条用户提示,最多 128 个字符。' } },
|
|
102
|
+
],
|
|
103
|
+
});
|
|
104
|
+
if (messagesNs !== undefined)
|
|
105
|
+
sections.push({
|
|
106
|
+
ns: messagesNs, title: 'DeepSeek Messages search', descriptions: { zh: 'DeepSeek Messages 搜索' },
|
|
107
|
+
fields: [
|
|
108
|
+
{ path: ['baseURL'], label: 'Messages API base URL', descriptions: { zh: 'Messages API 基础地址' }, kind: 'text' },
|
|
109
|
+
{ path: ['maxUses'], label: 'Maximum searches per request', descriptions: { zh: '每次请求的最大搜索次数' }, kind: 'number',
|
|
110
|
+
parse(text) {
|
|
111
|
+
if (text.trim() === '')
|
|
112
|
+
return { kind: 'clear' };
|
|
113
|
+
const value = Number(text);
|
|
114
|
+
return Number.isInteger(value) && value > 0 ? { kind: 'set', value } : undefined;
|
|
115
|
+
} },
|
|
116
|
+
],
|
|
117
|
+
});
|
|
118
|
+
return sections;
|
|
119
|
+
}
|
|
4
120
|
export function createSettingsHosts(ctx, assertActive = () => undefined) {
|
|
5
121
|
let settingsHostResolved = false;
|
|
6
122
|
let settingsHostCache;
|
|
@@ -14,7 +130,7 @@ export function createSettingsHosts(ctx, assertActive = () => undefined) {
|
|
|
14
130
|
// revision-fenced mutate) and credentials (secret writes). Structurally
|
|
15
131
|
// typed like the other optional seams in this file.
|
|
16
132
|
const settings = ctx.get('settings');
|
|
17
|
-
const credentials = ctx.get('credentials');
|
|
133
|
+
const credentials = () => ctx.get('credentials');
|
|
18
134
|
if (!settings)
|
|
19
135
|
return undefined;
|
|
20
136
|
settingsHostCache = {
|
|
@@ -27,6 +143,7 @@ export function createSettingsHosts(ctx, assertActive = () => undefined) {
|
|
|
27
143
|
applies: descriptor.applies,
|
|
28
144
|
value: descriptor.value,
|
|
29
145
|
user: descriptor.user,
|
|
146
|
+
warning: descriptor.warning,
|
|
30
147
|
}));
|
|
31
148
|
},
|
|
32
149
|
write(ns, ops, expectedRevision) {
|
|
@@ -37,11 +154,25 @@ export function createSettingsHosts(ctx, assertActive = () => undefined) {
|
|
|
37
154
|
// an env-provided key counts as configured.
|
|
38
155
|
if (process.env[ref] !== undefined)
|
|
39
156
|
return true;
|
|
40
|
-
return
|
|
157
|
+
return (await credentials()?.resolve(ref)) !== undefined;
|
|
41
158
|
},
|
|
42
|
-
async writeCredential(ref, value) {
|
|
43
|
-
|
|
159
|
+
async writeCredential(ref, value, authorization) {
|
|
160
|
+
const store = credentials();
|
|
161
|
+
if (!store)
|
|
44
162
|
throw new Error('credentials service unavailable');
|
|
163
|
+
const authorized = authorization === undefined ? undefined : webCredentialFields.get(authorization);
|
|
164
|
+
if (authorized !== undefined) {
|
|
165
|
+
const currentFields = webSettingsSections(ctx, settingsHostCache.listNamespaces()).flatMap(section => section.fields);
|
|
166
|
+
const current = currentFields.flatMap(candidate => {
|
|
167
|
+
const binding = candidate.secret?.authorization === undefined ? undefined : webCredentialFields.get(candidate.secret.authorization);
|
|
168
|
+
return binding === undefined ? [] : [binding];
|
|
169
|
+
}).some(binding => binding.owner === authorized.owner && binding.ns === authorized.ns && binding.ref === ref);
|
|
170
|
+
if (!current || authorized.ref !== ref || authorized.store !== concreteService(store)) {
|
|
171
|
+
throw new Error(t('settings-web-key-changed'));
|
|
172
|
+
}
|
|
173
|
+
await store.set(ref, value);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
45
176
|
// Second layer of the secret-ref reservation guard: the
|
|
46
177
|
// registration layer already rejects plugin sections with
|
|
47
178
|
// host-owned refs, but this seam must not trust it — a stale
|
|
@@ -50,7 +181,7 @@ export function createSettingsHosts(ctx, assertActive = () => undefined) {
|
|
|
50
181
|
// writes go through providerSetup().writeCredential instead.
|
|
51
182
|
if (isReservedCredentialRef(ref))
|
|
52
183
|
throw new Error(t('settings-secret-ref-reserved', { ref }));
|
|
53
|
-
await
|
|
184
|
+
await store.set(ref, value);
|
|
54
185
|
},
|
|
55
186
|
};
|
|
56
187
|
return settingsHostCache;
|
|
@@ -5,6 +5,7 @@ import type { AgentSession } from '../../agent/session.js';
|
|
|
5
5
|
import type { PermissionStore } from '../../channel/permissions.js';
|
|
6
6
|
import type { QuestionStoreLike } from '../../channel/questions.js';
|
|
7
7
|
import type { ContextPressureSource } from '../context-occupancy.js';
|
|
8
|
+
import type { TeamSource } from '../team-roster.js';
|
|
8
9
|
import type { ActivityView } from '../activity-store.js';
|
|
9
10
|
import type { SessionModeSpec } from '../../sessionModes.js';
|
|
10
11
|
import { type JobGroupFoldMode, type PageMarginSetting, type ScrollGutterMode, type StatusBarConfig, type ToolBackground } from '../../tuiDisplayPrefs.js';
|
|
@@ -13,8 +14,31 @@ import { type BrandSetting } from '../../branding.js';
|
|
|
13
14
|
import type { ChannelState } from './types.js';
|
|
14
15
|
/** The DSH backend's user-facing name (capability snapshot default). */
|
|
15
16
|
export declare const DSH_BACKEND_LABEL = "DSH";
|
|
17
|
+
/** The settled startup open (`ChannelLaunchOptions.startup`). */
|
|
18
|
+
export interface ChannelStartup {
|
|
19
|
+
readonly session: AgentSession;
|
|
20
|
+
readonly history: readonly AgentEvent[];
|
|
21
|
+
readonly route?: {
|
|
22
|
+
readonly provider: string;
|
|
23
|
+
readonly model: string;
|
|
24
|
+
};
|
|
25
|
+
readonly agentPreset?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A startup open that failed for a reason `/new` cannot fix (the in-process
|
|
29
|
+
* DSH kernel's composition failed: there is no DSH to open a session on).
|
|
30
|
+
* Its `hint` replaces the failure row's `/new` hint (`startup-open-failed-hint`).
|
|
31
|
+
*/
|
|
32
|
+
export declare class StartupOpenError extends Error {
|
|
33
|
+
readonly hint: string;
|
|
34
|
+
constructor(message: string, hint: string, options?: {
|
|
35
|
+
cause?: unknown;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
16
38
|
/** Launch configuration belongs to channel construction, not the composition root. */
|
|
17
39
|
export interface ChannelLaunchOptions {
|
|
40
|
+
/** Host notification effect with the last settled reply's preview, when present. */
|
|
41
|
+
onTaskComplete?: (preview?: string) => void;
|
|
18
42
|
model: string;
|
|
19
43
|
cwd: string;
|
|
20
44
|
provider: string;
|
|
@@ -47,6 +71,11 @@ export interface ChannelLaunchOptions {
|
|
|
47
71
|
/** Read that source's current value when a session binds (see
|
|
48
72
|
* {@link ChannelLaunchOptions.contextPressure}). */
|
|
49
73
|
seedContextOccupancy?: (session: unknown) => void;
|
|
74
|
+
/** Agent Teams roster/task-board source (see `dsh-adapter/team-roster.ts`);
|
|
75
|
+
* a cached read, republished through its change feed. Absent → no team. */
|
|
76
|
+
team?: TeamSource;
|
|
77
|
+
/** Point that source at the bound session's team and read its baseline. */
|
|
78
|
+
seedTeam?: (session: unknown) => void;
|
|
50
79
|
activityFrames?: string;
|
|
51
80
|
/** Settings namespace this boot registered its section under: the Config
|
|
52
81
|
* owner's Loader id (`resolveSettingsNamespace`), which is NOT always the
|
|
@@ -55,6 +84,11 @@ export interface ChannelLaunchOptions {
|
|
|
55
84
|
* `'dsh-tui'` (direct `createChannel` embedders and fixtures). */
|
|
56
85
|
settingsNs?: string;
|
|
57
86
|
diffLayout?: 'auto' | 'split' | 'unified';
|
|
87
|
+
/** Seed the upstream auto-retry policy (upstream-retry.ts) on the
|
|
88
|
+
* llm-pi-ai route the bound session actually uses, when that route
|
|
89
|
+
* declares no retryPolicy. Absent means enabled (the Config schema's
|
|
90
|
+
* default); false opts out without touching settings. */
|
|
91
|
+
upstreamRetry?: boolean;
|
|
58
92
|
thinkingFold?: 'preview' | 'full';
|
|
59
93
|
jobGroupFold?: JobGroupFoldMode;
|
|
60
94
|
toolBackground?: ToolBackground;
|
|
@@ -120,6 +154,14 @@ export interface ChannelLaunchOptions {
|
|
|
120
154
|
/** The startup session's durable history, read before construction so
|
|
121
155
|
* the first bind paints it ahead of any live event. */
|
|
122
156
|
initialHistory?: readonly AgentEvent[];
|
|
157
|
+
/** The `/settings` service (../tui-settings.ts); absent → the host's `settings`. */
|
|
158
|
+
settingsService?: unknown;
|
|
159
|
+
/**
|
|
160
|
+
* The startup session still opening: the channel starts on a placeholder
|
|
161
|
+
* (`ready` false) and `start()` adopts the real one once this settles; a
|
|
162
|
+
* rejection stays on the placeholder and `/new` retries. `route`/`agentPreset` override the construction options.
|
|
163
|
+
*/
|
|
164
|
+
startup?: Promise<ChannelStartup>;
|
|
123
165
|
/** How a user re-enters a session of this backend from a shell (the
|
|
124
166
|
* `/fork` notice); absent → the in-TUI `/resume` hint. */
|
|
125
167
|
resumeCommand?: (sessionId: string) => string;
|
|
@@ -149,5 +191,5 @@ export declare function createInitialChannelView(options: ChannelLaunchOptions,
|
|
|
149
191
|
sessionId: string;
|
|
150
192
|
mode: ChannelState['mode'];
|
|
151
193
|
cwdDescription: string;
|
|
152
|
-
}): Pick<ChannelState, 'effortLevels' | 'version' | 'rows' | 'status' | 'sessionTitle' | 'sessionColor' | 'agentId' | 'sessionId' | 'agentBindingGeneration' | 'model' | 'modelDisplay' | 'provider' | 'tokens' | 'cwd' | 'displayCwd' | 'gitBranch' | 'working' | 'compaction' | 'cancelPending' | 'spinnerMode' | 'responseChars' | 'activeToolCount' | 'turnStart' | 'lastUserText' | 'notifications' | 'contextWindow' | 'reasoningEffort' | 'mode' | 'modeIndex' | 'activityFrames' | 'configuredProvider' | 'configuredModel' | 'configuredPreset' | 'configuredActivityFrames' | 'configuredLang' | 'diffLayout' | 'thinkingFold' | 'jobGroupFold' | 'toolBackground' | 'scrollGutter' | 'pageMargin' | 'foldTerminalCommand' | 'turnUsageRow' | 'promptSessionLabel' | 'expandEditor' | 'smoothStreaming' | 'statusBar' | 'whale' | 'whaleIdle' | 'splashFont' | 'brand' | 'minimalUi' | 'activityEnabled' | 'contextBarEnabled' | 'statusBar' | 'whale' | 'whaleIdle' | 'whaleGirl' | 'minimalUi' | 'activityEnabled' | 'contextBarEnabled' | 'agentPreset' | 'goal' | 'todos' | 'loadedContext' | 'pending' | 'commandList' | 'lastUsage' | 'turnUsage' | 'tps' | 'tpsSamples' | 'contextSegments' | 'mainCost' | 'subagentCost' | 'subagents' | 'backgroundJobs' | 'selection'>;
|
|
194
|
+
}): Pick<ChannelState, 'effortLevels' | 'version' | 'ready' | 'startupFailure' | 'rows' | 'status' | 'sessionTitle' | 'sessionColor' | 'agentId' | 'sessionId' | 'agentBindingGeneration' | 'model' | 'modelDisplay' | 'provider' | 'tokens' | 'cwd' | 'displayCwd' | 'gitBranch' | 'working' | 'compaction' | 'cancelPending' | 'spinnerMode' | 'responseChars' | 'activeToolCount' | 'turnStart' | 'lastUserText' | 'notifications' | 'contextWindow' | 'reasoningEffort' | 'mode' | 'modeIndex' | 'activityFrames' | 'configuredProvider' | 'configuredModel' | 'configuredPreset' | 'configuredActivityFrames' | 'configuredLang' | 'diffLayout' | 'thinkingFold' | 'jobGroupFold' | 'toolBackground' | 'scrollGutter' | 'pageMargin' | 'foldTerminalCommand' | 'turnUsageRow' | 'promptSessionLabel' | 'expandEditor' | 'smoothStreaming' | 'statusBar' | 'whale' | 'whaleIdle' | 'splashFont' | 'brand' | 'minimalUi' | 'activityEnabled' | 'contextBarEnabled' | 'statusBar' | 'whale' | 'whaleIdle' | 'whaleGirl' | 'minimalUi' | 'activityEnabled' | 'contextBarEnabled' | 'agentPreset' | 'goal' | 'todos' | 'loadedContext' | 'pending' | 'commandList' | 'lastUsage' | 'turnUsage' | 'tps' | 'tpsSamples' | 'contextSegments' | 'mainCost' | 'subagentCost' | 'subagents' | 'backgroundJobs' | 'selection'>;
|
|
153
195
|
//# sourceMappingURL=state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAkH,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,0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c,GAAG,YAAY,GAClF,qBAAqB,GAAG,cAAc,GAAG,oBAAoB,GAAG,cAAc,GAAG,iBAAiB,GAClG,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,YAAY,GAAG,OAAO,GAAG,WAAW,GAAG,iBAAiB,GAAG,mBAAmB,GACpH,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,iBAAiB,GAAG,mBAAmB,GACzG,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,eAAe,GAAG,SAAS,GAAG,aAAa,GAC9E,WAAW,GAAG,WAAW,GAAG,KAAK,GAAG,YAAY,GAAG,iBAAiB,GAAG,UAAU,GAAG,cAAc,GAAG,WAAW,GAAG,gBAAgB,GAAG,WAAW,CAClJ,CA6BA"}
|
|
@@ -4,6 +4,19 @@ import { normalizeSplashFont } from '../../components/splashFonts.js';
|
|
|
4
4
|
import { normalizeBrandSetting } from '../../branding.js';
|
|
5
5
|
/** The DSH backend's user-facing name (capability snapshot default). */
|
|
6
6
|
export const DSH_BACKEND_LABEL = 'DSH';
|
|
7
|
+
/**
|
|
8
|
+
* A startup open that failed for a reason `/new` cannot fix (the in-process
|
|
9
|
+
* DSH kernel's composition failed: there is no DSH to open a session on).
|
|
10
|
+
* Its `hint` replaces the failure row's `/new` hint (`startup-open-failed-hint`).
|
|
11
|
+
*/
|
|
12
|
+
export class StartupOpenError extends Error {
|
|
13
|
+
hint;
|
|
14
|
+
constructor(message, hint, options) {
|
|
15
|
+
super(message, options);
|
|
16
|
+
this.hint = hint;
|
|
17
|
+
this.name = 'StartupOpenError';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
7
20
|
/**
|
|
8
21
|
* Neutral observable fields only. Behaviour is assembled explicitly by the
|
|
9
22
|
* composition root after each specialist owner exists, so this factory cannot
|
|
@@ -11,7 +24,7 @@ export const DSH_BACKEND_LABEL = 'DSH';
|
|
|
11
24
|
*/
|
|
12
25
|
export function createInitialChannelView(options, input) {
|
|
13
26
|
return {
|
|
14
|
-
effortLevels: undefined, version: 0, rows: [], selection: undefined, status: 'starting', sessionTitle: '', sessionColor: '',
|
|
27
|
+
effortLevels: undefined, version: 0, ready: options.startup === undefined, startupFailure: undefined, rows: [], selection: undefined, status: 'starting', sessionTitle: '', sessionColor: '',
|
|
15
28
|
agentId: input.agentId, sessionId: input.sessionId, agentBindingGeneration: 0, model: options.model, modelDisplay: undefined, provider: options.provider,
|
|
16
29
|
tokens: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, peak: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, idle: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 } },
|
|
17
30
|
cwd: options.cwd, displayCwd: input.cwdDescription, gitBranch: undefined, working: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-projection.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/subagent-projection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAGzE,OAAO,EAAE,qBAAqB,EAAsB,MAAM,iBAAiB,CAAA;AAC3E,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACnG,OAAO,KAAK,EAAE,aAAa,EAAuB,uBAAuB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAClK,OAAO,KAAK,EAAE,YAAY,EAAyC,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"subagent-projection.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/subagent-projection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAGzE,OAAO,EAAE,qBAAqB,EAAsB,MAAM,iBAAiB,CAAA;AAC3E,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,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,CAAC,EAAE,OAAO,CAAA;KAAE,KAAG,IAAI,CAlT9C,CAAC,CAAC,CAAC,WAAW,MAAM,GAAG,IAAI;gBAC9D,UAAU,QAoWH;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,CAAA;KAAE,KAAG,IAAI,CApWnE,CAAC,CAAC,CAAC,WAAW,MAAM,GAAG,IAAI;2BAC/C,OAAO;6BACL,SAAS,OAAO,EAAE;;;;kBAnFxB,KAAK,KAAG,IAAI;qBAIT,KAAK,KAAG,IAAI;kBAyFpB,KAAK;;;EAItB"}
|
|
@@ -3,6 +3,20 @@ import { markChannelReadDirty } from '../../adapter/channel/read-view.js';
|
|
|
3
3
|
import { agentMessageFailureOf, agentMessageTextOf, agentRelaySourceOf, foldAgentMessage } from '../../agent/messages.js';
|
|
4
4
|
import { SubagentActivityStore } from '../subagents.js';
|
|
5
5
|
import { isSubagentToolName } from './projection-helpers.js';
|
|
6
|
+
import { teamMailboxAsRelay } from '../compat/agent-team-0.2.0.js';
|
|
7
|
+
import { teamMessageOf } from '../team-tools.js';
|
|
8
|
+
/** A relay's body as the agent-message feed shows it: a team message without
|
|
9
|
+
* its `Team message from <name>:` framing block (the sender is `from`). */
|
|
10
|
+
function relayTextOf(source, content) {
|
|
11
|
+
const team = Array.isArray(content) ? teamMessageOf(source, content) : undefined;
|
|
12
|
+
return team?.text ?? agentMessageTextOf(content);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Bound the retained description text. Evicting an older term does not cancel
|
|
16
|
+
* its pending spawn: a separate count keeps those unmatched starts from
|
|
17
|
+
* consuming a later delegation's title without retaining unbounded text.
|
|
18
|
+
*/
|
|
19
|
+
const MAX_PENDING_TASK_DESCRIPTIONS = 32;
|
|
6
20
|
/**
|
|
7
21
|
* Keep each parked parent's reducer alive, including session links and the
|
|
8
22
|
* stream attempt/settlement cursor. A display snapshot cannot resume either
|
|
@@ -158,7 +172,7 @@ export function createSubagentProjection(getState, deps) {
|
|
|
158
172
|
dropRows: () => active.dropRows(),
|
|
159
173
|
park, restore,
|
|
160
174
|
forget(agent) { parked.delete(agent); },
|
|
161
|
-
dispose() { parked.clear(); active.
|
|
175
|
+
dispose() { parked.clear(); active.reset(); },
|
|
162
176
|
reset() { active = make(); activeParent = deps.agent(); restored = false; getState().subagents = []; getState().subagentCost = []; },
|
|
163
177
|
};
|
|
164
178
|
}
|
|
@@ -187,7 +201,9 @@ function createSessionSubagentProjection(getState, deps) {
|
|
|
187
201
|
* oldest first, folded by durable message id. */
|
|
188
202
|
const agentMessages = [];
|
|
189
203
|
const rowsByAgentId = new Map();
|
|
204
|
+
/** Empty entries reserve starts whose ambiguous description was discarded. */
|
|
190
205
|
const pendingTaskDescriptions = [];
|
|
206
|
+
let evictedDescriptionCount = 0;
|
|
191
207
|
/** Workflow member identity: `tool-workflow/agent-end` carries no childId,
|
|
192
208
|
* so member starts remember `runId:seq` → agentId for their settlement. */
|
|
193
209
|
const workflowMembers = new Map();
|
|
@@ -245,29 +261,46 @@ function createSessionSubagentProjection(getState, deps) {
|
|
|
245
261
|
* provable from the log alone; a plain user/message (no relay source)
|
|
246
262
|
* never becomes one. */
|
|
247
263
|
const noteChildRelay = (childId, event) => {
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
264
|
+
const raw = event.data;
|
|
265
|
+
if (raw === undefined || typeof raw.id !== 'string' || raw.id === '')
|
|
250
266
|
return;
|
|
267
|
+
// compat(dsh 0.2.0, log): a 0.2.0 mailbox delivery reads as the relay it became.
|
|
268
|
+
const data = teamMailboxAsRelay(raw);
|
|
251
269
|
const relay = agentRelaySourceOf(data.source);
|
|
252
270
|
if (relay === undefined)
|
|
253
271
|
return;
|
|
254
272
|
foldAgentMessage(agentMessages, {
|
|
255
|
-
messageId:
|
|
273
|
+
messageId: raw.id,
|
|
256
274
|
from: relay.senderSessionId,
|
|
257
275
|
to: childId,
|
|
258
276
|
via: 'agent-relay',
|
|
259
|
-
text:
|
|
277
|
+
text: relayTextOf(data.source, data.content),
|
|
260
278
|
state: 'queued',
|
|
261
279
|
...(typeof event.seq === 'number' ? { sourceRef: `seq:${event.seq}` } : {}),
|
|
262
280
|
observedAt: eventTime(event) ?? Date.now(),
|
|
263
281
|
});
|
|
264
282
|
};
|
|
283
|
+
/** A child session's own descriptor can beat the host's spawn edge. With no
|
|
284
|
+
* row to attribute it to the label would be lost for good — an external
|
|
285
|
+
* child never gets a catalog to re-state it — so park it under the session
|
|
286
|
+
* id (the child id the host links rows by) for the row born later to adopt. */
|
|
287
|
+
const rememberEarlyLabel = (session, event) => {
|
|
288
|
+
if (event.type !== 'subagent/descriptor')
|
|
289
|
+
return;
|
|
290
|
+
const sessionId = session?.id;
|
|
291
|
+
const label = event.data?.label;
|
|
292
|
+
if (typeof sessionId !== 'string' || sessionId === '')
|
|
293
|
+
return;
|
|
294
|
+
store.holdKeyedLabel(sessionId, label);
|
|
295
|
+
};
|
|
265
296
|
const onSessionEvent = (session, event) => {
|
|
266
297
|
let id = store.getSubagentIdBySession(session);
|
|
267
298
|
if (id === undefined)
|
|
268
299
|
id = backfillSessionLink(session);
|
|
269
|
-
if (id === undefined)
|
|
300
|
+
if (id === undefined) {
|
|
301
|
+
rememberEarlyLabel(session, event);
|
|
270
302
|
return false;
|
|
303
|
+
}
|
|
271
304
|
if (event.type === 'user/message')
|
|
272
305
|
noteChildRelay(id, event);
|
|
273
306
|
store.onSessionEvent(id, event);
|
|
@@ -378,14 +411,16 @@ function createSessionSubagentProjection(getState, deps) {
|
|
|
378
411
|
// names the sending session. Plain user text, injected context and
|
|
379
412
|
// settlement notices are not relays; they stay invisible here, just as
|
|
380
413
|
// the translator keeps them out of bubbles.
|
|
381
|
-
|
|
414
|
+
// compat(dsh 0.2.0, log): a 0.2.0 mailbox delivery reads as the relay it became.
|
|
415
|
+
const delivered = teamMailboxAsRelay(data);
|
|
416
|
+
const relay = agentRelaySourceOf(delivered.source);
|
|
382
417
|
if (relay !== undefined && typeof data.id === 'string' && data.id !== '') {
|
|
383
418
|
foldAgentMessage(agentMessages, {
|
|
384
419
|
messageId: data.id,
|
|
385
420
|
from: relay.senderSessionId,
|
|
386
421
|
...(parentSessionId === undefined ? {} : { to: parentSessionId, parentSessionId }),
|
|
387
422
|
via: 'agent-relay',
|
|
388
|
-
text:
|
|
423
|
+
text: relayTextOf(delivered.source, delivered.content),
|
|
389
424
|
state: 'queued',
|
|
390
425
|
...(typeof ev.seq === 'number' ? { sourceRef: `seq:${ev.seq}` } : {}),
|
|
391
426
|
observedAt: eventTime(event) ?? Date.now(),
|
|
@@ -397,8 +432,13 @@ function createSessionSubagentProjection(getState, deps) {
|
|
|
397
432
|
if (!historical && typeof data.name === 'string' && isSubagentToolName(data.name) && typeof data.arguments === 'string') {
|
|
398
433
|
try {
|
|
399
434
|
const args = JSON.parse(data.arguments);
|
|
400
|
-
if (typeof args.description === 'string' && args.description)
|
|
435
|
+
if (typeof args.description === 'string' && args.description) {
|
|
436
|
+
if (pendingTaskDescriptions.length >= MAX_PENDING_TASK_DESCRIPTIONS) {
|
|
437
|
+
pendingTaskDescriptions.shift();
|
|
438
|
+
evictedDescriptionCount += 1;
|
|
439
|
+
}
|
|
401
440
|
pendingTaskDescriptions.push(args.description);
|
|
441
|
+
}
|
|
402
442
|
}
|
|
403
443
|
catch { /* malformed arguments do not describe a child */ }
|
|
404
444
|
}
|
|
@@ -469,11 +509,43 @@ function createSessionSubagentProjection(getState, deps) {
|
|
|
469
509
|
return;
|
|
470
510
|
// The fact that the host spawned a child is authoritative even when its
|
|
471
511
|
// optional discovery seam is absent, unloading, or throws.
|
|
512
|
+
// The queue is keyed by nothing, so only a NEW run may consume a term from
|
|
513
|
+
// it: a re-announced edge for the same runId (a continuable epoch's
|
|
514
|
+
// refresh) must leave the queue alone, or every later row shifts by one.
|
|
515
|
+
// An edge without a run key is itself such a refresh (the store's epoch
|
|
516
|
+
// rule) — only a real, different key opens a new epoch.
|
|
517
|
+
const knownRunId = store.runIdOf(info.id);
|
|
518
|
+
// A row that does not exist yet is a fresh run even when the edge carries
|
|
519
|
+
// no run key: the store's refresh rule is about a row it already tracks,
|
|
520
|
+
// and treating the first edge of an untracked child as a refresh would
|
|
521
|
+
// skip its term and hand that term to the next spawn instead.
|
|
522
|
+
const freshRun = !store.has(info.id)
|
|
523
|
+
|| (info.runId !== undefined && (knownRunId === undefined || knownRunId !== info.runId));
|
|
524
|
+
// A queued term is a first-frame guess; `subagent/catalog`'s childId-keyed
|
|
525
|
+
// label is the authority and corrects it in the store (describeFromLabel).
|
|
526
|
+
// A row a keyed label already settled still consumes the term here — the
|
|
527
|
+
// store drops it instead of applying it, so the FIFO stays aligned.
|
|
528
|
+
//
|
|
529
|
+
// The queue carries no childId, so a term is only usable while exactly one
|
|
530
|
+
// delegation is outstanding. With two or more, any pick is a coin flip
|
|
531
|
+
// that puts a concurrent child's name on this card until its keyed label
|
|
532
|
+
// arrives. Discard the text, but retain every unmatched start slot: a new
|
|
533
|
+
// call can arrive before the rest of this batch starts. Forgetting those
|
|
534
|
+
// slots would let an older start consume that new call's title.
|
|
535
|
+
let description;
|
|
536
|
+
if (freshRun) {
|
|
537
|
+
if (evictedDescriptionCount + pendingTaskDescriptions.length > 1)
|
|
538
|
+
pendingTaskDescriptions.fill('');
|
|
539
|
+
if (evictedDescriptionCount > 0)
|
|
540
|
+
evictedDescriptionCount -= 1;
|
|
541
|
+
else
|
|
542
|
+
description = pendingTaskDescriptions.shift() || undefined;
|
|
543
|
+
}
|
|
472
544
|
store.onSpawned(info.id, info.provider || 'subagent', info.provider, {
|
|
473
|
-
runId: info.runId
|
|
545
|
+
...(freshRun ? { runId: info.runId } : {}),
|
|
474
546
|
local: info.local,
|
|
475
547
|
startedAt: Date.now(),
|
|
476
|
-
description:
|
|
548
|
+
...(description === undefined ? {} : { description, descriptionFromQueue: true }),
|
|
477
549
|
});
|
|
478
550
|
cardedIds.add(info.id);
|
|
479
551
|
try {
|
|
@@ -585,6 +657,6 @@ function createSessionSubagentProjection(getState, deps) {
|
|
|
585
657
|
},
|
|
586
658
|
};
|
|
587
659
|
const dropRows = () => { streamDirty = false; rowsByAgentId.clear(); };
|
|
588
|
-
const reset = () => { dropRows(); cardedIds.clear(); workflowMembers.clear(); pendingTaskDescriptions.length = 0; agentMessages.length = 0; store.reset(); getState().subagents = []; getState().subagentCost = []; };
|
|
660
|
+
const reset = () => { dropRows(); cardedIds.clear(); workflowMembers.clear(); pendingTaskDescriptions.length = 0; evictedDescriptionCount = 0; agentMessages.length = 0; store.reset(); getState().subagents = []; getState().subagentCost = []; };
|
|
589
661
|
return { store, control, pendingTaskDescriptions, agentMessages, onSessionEvent, onStreamFrame, onParentEvent, bootstrapFromLog, onStart, onEnd, syncNow, flush, dropRows, reset, submitPrompt };
|
|
590
662
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AgentEvent, AgentEventMeta } from '../../agent/events.js';
|
|
2
|
+
import type { ChannelOwner } from './owner.js';
|
|
3
|
+
import type { ChannelState } from './types.js';
|
|
4
|
+
/** Notify once a successful live turn has settled with no automatic follow-up. */
|
|
5
|
+
export declare function createTaskCompletion(state: ChannelState, owner: ChannelOwner, notify: (preview?: string) => void): (batch: readonly AgentEvent[], meta: AgentEventMeta, current: () => boolean) => void;
|
|
6
|
+
//# sourceMappingURL=task-completion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-completion.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/task-completion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAKvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,kFAAkF;AAClF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,IAmBvG,OAAO,SAAS,UAAU,EAAE,EAAE,MAAM,cAAc,EAAE,SAAS,MAAM,OAAO,KAAG,IAAI,CAwC1F"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import stripAnsi from 'strip-ansi';
|
|
2
|
+
import { Lexer } from 'marked';
|
|
3
|
+
import { textOfBlocks } from '../../channel/projection.js';
|
|
4
|
+
import { getGraphemeSegmenter } from '../../utils/intl.js';
|
|
5
|
+
/** Notify once a successful live turn has settled with no automatic follow-up. */
|
|
6
|
+
export function createTaskCompletion(state, owner, notify) {
|
|
7
|
+
let generation = -1;
|
|
8
|
+
let completedTurn = -1;
|
|
9
|
+
let pending = false;
|
|
10
|
+
let responseTurn;
|
|
11
|
+
let responseSeq = -1;
|
|
12
|
+
let preview;
|
|
13
|
+
let timer;
|
|
14
|
+
const reset = () => {
|
|
15
|
+
if (timer !== undefined)
|
|
16
|
+
clearImmediate(timer);
|
|
17
|
+
timer = undefined;
|
|
18
|
+
completedTurn = -1;
|
|
19
|
+
pending = false;
|
|
20
|
+
responseTurn = undefined;
|
|
21
|
+
responseSeq = -1;
|
|
22
|
+
preview = undefined;
|
|
23
|
+
};
|
|
24
|
+
owner.own(reset);
|
|
25
|
+
return (batch, meta, current) => {
|
|
26
|
+
if (!current() || meta.replay)
|
|
27
|
+
return;
|
|
28
|
+
if (generation !== state.agentBindingGeneration) {
|
|
29
|
+
reset();
|
|
30
|
+
generation = state.agentBindingGeneration;
|
|
31
|
+
}
|
|
32
|
+
for (const event of batch) {
|
|
33
|
+
if (event.type === 'session.reset')
|
|
34
|
+
reset();
|
|
35
|
+
else if (event.type === 'turn.start') {
|
|
36
|
+
pending = false;
|
|
37
|
+
responseTurn = event.turn;
|
|
38
|
+
responseSeq = -1;
|
|
39
|
+
preview = undefined;
|
|
40
|
+
}
|
|
41
|
+
else if (event.type === 'assistant.message' && event.parentCallId === undefined && !event.interrupted) {
|
|
42
|
+
// Only settled main-session replies; provisional stream output and
|
|
43
|
+
// child agents must never become the completion notification body.
|
|
44
|
+
responseTurn ??= event.turn;
|
|
45
|
+
if (event.turn !== responseTurn || event.seq <= responseSeq)
|
|
46
|
+
continue;
|
|
47
|
+
responseSeq = event.seq;
|
|
48
|
+
const text = textOfBlocks(event.blocks);
|
|
49
|
+
if (text.trim())
|
|
50
|
+
preview = notificationPreview(text);
|
|
51
|
+
}
|
|
52
|
+
else if (event.type === 'turn.end' && event.turn > completedTurn) {
|
|
53
|
+
completedTurn = event.turn;
|
|
54
|
+
pending = event.reason.kind === 'completed';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (!pending || timer !== undefined)
|
|
58
|
+
return;
|
|
59
|
+
// Queue/status changes can follow turn.end in the same dispatch. Wait
|
|
60
|
+
// for that dispatch, then retain the candidate until status is idle.
|
|
61
|
+
timer = setImmediate(() => {
|
|
62
|
+
timer = undefined;
|
|
63
|
+
if (!current()) {
|
|
64
|
+
pending = false;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (pending && !state.working && state.status !== 'running') {
|
|
68
|
+
pending = false;
|
|
69
|
+
if (state.status !== 'disposed' && !state.pending.some(item => !item.docked) && state.goal?.phase !== 'active') {
|
|
70
|
+
notify(responseTurn === completedTurn ? preview : undefined);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/** Plain-text preview; notification daemons may interpret raw Markdown headings. */
|
|
77
|
+
function notificationPreview(text) {
|
|
78
|
+
const plain = markdownText(Lexer.lex(stripAnsi(text), { gfm: true }));
|
|
79
|
+
const flat = plain.replace(/[\x00-\x1f\x7f-\x9f]/g, ' ').replace(/\s+/g, ' ').trim();
|
|
80
|
+
const graphemes = [];
|
|
81
|
+
for (const { segment } of getGraphemeSegmenter().segment(flat)) {
|
|
82
|
+
if (graphemes.length === 200)
|
|
83
|
+
return `${graphemes.slice(0, 199).join('')}…`;
|
|
84
|
+
graphemes.push(segment);
|
|
85
|
+
}
|
|
86
|
+
return graphemes.join('') || undefined;
|
|
87
|
+
}
|
|
88
|
+
function isMarkdownToken(token, kind) {
|
|
89
|
+
return token.type === kind;
|
|
90
|
+
}
|
|
91
|
+
/** Extract visible text before flattening lines or truncating emphasis/link pairs. */
|
|
92
|
+
function markdownText(tokens) {
|
|
93
|
+
return tokens.map(token => {
|
|
94
|
+
if (isMarkdownToken(token, 'heading') || isMarkdownToken(token, 'paragraph') || isMarkdownToken(token, 'blockquote'))
|
|
95
|
+
return `${markdownText(token.tokens)}\n`;
|
|
96
|
+
if (isMarkdownToken(token, 'strong') || isMarkdownToken(token, 'em') || isMarkdownToken(token, 'del') || isMarkdownToken(token, 'link'))
|
|
97
|
+
return markdownText(token.tokens);
|
|
98
|
+
if (isMarkdownToken(token, 'text'))
|
|
99
|
+
return token.tokens === undefined ? token.text : markdownText(token.tokens);
|
|
100
|
+
if (isMarkdownToken(token, 'codespan') || isMarkdownToken(token, 'escape') || isMarkdownToken(token, 'image'))
|
|
101
|
+
return token.text;
|
|
102
|
+
if (isMarkdownToken(token, 'code'))
|
|
103
|
+
return `${token.text}\n`;
|
|
104
|
+
if (isMarkdownToken(token, 'list'))
|
|
105
|
+
return `${token.items.map(item => markdownText(item.tokens)).join('\n')}\n`;
|
|
106
|
+
if (isMarkdownToken(token, 'table'))
|
|
107
|
+
return `${[token.header, ...token.rows].map(row => row.map(cell => markdownText(cell.tokens)).join(' ')).join('\n')}\n`;
|
|
108
|
+
if (isMarkdownToken(token, 'html'))
|
|
109
|
+
return token.text.replace(/<[^>]*>/g, '');
|
|
110
|
+
if (isMarkdownToken(token, 'space') || isMarkdownToken(token, 'br') || isMarkdownToken(token, 'hr'))
|
|
111
|
+
return '\n';
|
|
112
|
+
return '';
|
|
113
|
+
}).join('');
|
|
114
|
+
}
|