@deepseek-harness-tui/dsh-tui 0.14.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -17
- package/bin/dsh-tui.js +200 -34
- package/cordis.patch.yml +16 -52
- package/cordis.yml +6 -2
- package/guide/dsh-tui-guide/claude-backend.en.md +44 -7
- package/guide/dsh-tui-guide/claude-backend.md +28 -6
- package/guide/dsh-tui-guide/codex-backend.en.md +47 -10
- package/guide/dsh-tui-guide/codex-backend.md +26 -4
- package/guide/dsh-tui-guide/configuration.en.md +168 -18
- package/guide/dsh-tui-guide/configuration.md +144 -16
- package/guide/dsh-tui-guide/getting-started.en.md +15 -0
- package/guide/dsh-tui-guide/getting-started.md +15 -0
- package/guide/dsh-tui-guide/interaction.en.md +64 -24
- package/guide/dsh-tui-guide/interaction.md +49 -19
- package/guide/dsh-tui-guide/plugins.en.md +97 -3
- package/guide/dsh-tui-guide/plugins.md +55 -2
- package/guide/dsh-tui-guide/themes.en.md +23 -14
- package/guide/dsh-tui-guide/themes.md +19 -12
- package/guide/dsh-tui-guide/user-guide.en.md +53 -21
- package/guide/dsh-tui-guide/user-guide.md +43 -22
- package/lib/settings.json +103 -9
- package/lib/types/adapter/channel/projection.d.ts.map +1 -1
- package/lib/types/adapter/channel/projection.js +1 -0
- package/lib/types/adapter/channel/ui-policy.d.ts +1 -1
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +4 -0
- package/lib/types/adapter/channel/ui.d.ts +2 -0
- package/lib/types/adapter/channel/ui.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui.js +6 -2
- package/lib/types/adapter/kernel/runtime.d.ts.map +1 -1
- package/lib/types/adapter/kernel/runtime.js +2 -0
- package/lib/types/adapter/ports/channel-catalog.d.ts +5 -1
- package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-settings.d.ts +14 -3
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +56 -12
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +68 -0
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel.d.ts +2 -0
- package/lib/types/adapter/ports/channel.d.ts.map +1 -1
- package/lib/types/adapter/spec/backend-capabilities.d.ts +22 -0
- package/lib/types/adapter/spec/backend-capabilities.d.ts.map +1 -0
- package/lib/types/adapter/spec/backend-capabilities.js +49 -0
- package/lib/types/adapter/spec/protocol-constants.d.ts.map +1 -1
- package/lib/types/adapter/spec/protocol-constants.js +10 -3
- package/lib/types/adapter/spec/tui-contributions.d.ts +3 -0
- package/lib/types/adapter/spec/tui-contributions.d.ts.map +1 -1
- package/lib/types/adapter/spec/tui-contributions.js +7 -0
- package/lib/types/adapter/standard/registry.d.ts +6 -0
- package/lib/types/adapter/standard/registry.d.ts.map +1 -1
- package/lib/types/adapter/standard/registry.js +65 -15
- package/lib/types/adapter/standard/tui-extension.d.ts.map +1 -1
- package/lib/types/adapter/standard/tui-extension.js +7 -1
- package/lib/types/adapter/standard/types.d.ts +10 -1
- package/lib/types/adapter/standard/types.d.ts.map +1 -1
- package/lib/types/adapter/upstream/host-descriptor-driver.d.ts.map +1 -1
- package/lib/types/adapter/upstream/host-descriptor-driver.js +52 -0
- package/lib/types/agent/backend-manifest.d.ts +152 -0
- package/lib/types/agent/backend-manifest.d.ts.map +1 -0
- package/lib/types/agent/backend-manifest.js +14 -0
- package/lib/types/agent/backend.d.ts +71 -5
- package/lib/types/agent/backend.d.ts.map +1 -1
- package/lib/types/agent/capabilities.d.ts +6 -0
- package/lib/types/agent/capabilities.d.ts.map +1 -1
- package/lib/types/agent/events.d.ts +3 -2
- package/lib/types/agent/events.d.ts.map +1 -1
- package/lib/types/agent/index.d.ts +2 -0
- package/lib/types/agent/index.d.ts.map +1 -1
- package/lib/types/agent/refs.d.ts +11 -1
- package/lib/types/agent/refs.d.ts.map +1 -1
- package/lib/types/agent/starting-session.d.ts +4 -0
- package/lib/types/agent/starting-session.d.ts.map +1 -0
- package/lib/types/agent/starting-session.js +19 -0
- package/lib/types/backends/claude/activity.d.ts +1 -1
- package/lib/types/backends/claude/activity.d.ts.map +1 -1
- package/lib/types/backends/claude/activity.js +5 -5
- package/lib/types/backends/claude/auth.d.ts.map +1 -1
- package/lib/types/backends/claude/auth.js +10 -3
- package/lib/types/backends/claude/backend.d.ts.map +1 -1
- package/lib/types/backends/claude/backend.js +103 -29
- package/lib/types/backends/claude/catalog.d.ts +2 -1
- package/lib/types/backends/claude/catalog.d.ts.map +1 -1
- package/lib/types/backends/claude/catalog.js +15 -5
- package/lib/types/backends/claude/channels.d.ts +5 -3
- package/lib/types/backends/claude/channels.d.ts.map +1 -1
- package/lib/types/backends/claude/channels.js +5 -4
- package/lib/types/backends/claude/contract.d.ts +4 -0
- package/lib/types/backends/claude/contract.d.ts.map +1 -1
- package/lib/types/backends/claude/contract.js +4 -0
- package/lib/types/backends/claude/controls.d.ts +4 -0
- package/lib/types/backends/claude/controls.d.ts.map +1 -1
- package/lib/types/backends/claude/controls.js +34 -42
- package/lib/types/backends/claude/dialogs.d.ts +8 -2
- package/lib/types/backends/claude/dialogs.d.ts.map +1 -1
- package/lib/types/backends/claude/dialogs.js +24 -16
- package/lib/types/backends/claude/images.d.ts +1 -1
- package/lib/types/backends/claude/images.d.ts.map +1 -1
- package/lib/types/backends/claude/images.js +7 -7
- package/lib/types/backends/claude/manifest.d.ts +21 -0
- package/lib/types/backends/claude/manifest.d.ts.map +1 -0
- package/lib/types/backends/claude/manifest.js +29 -0
- package/lib/types/backends/claude/older-history.js +2 -2
- package/lib/types/backends/claude/permissions.js +11 -11
- package/lib/types/backends/claude/prefs.d.ts +4 -2
- package/lib/types/backends/claude/prefs.d.ts.map +1 -1
- package/lib/types/backends/claude/prefs.js +4 -3
- package/lib/types/backends/claude/process.d.ts +16 -4
- package/lib/types/backends/claude/process.d.ts.map +1 -1
- package/lib/types/backends/claude/process.js +100 -37
- package/lib/types/backends/claude/send-message.d.ts +1 -1
- package/lib/types/backends/claude/send-message.d.ts.map +1 -1
- package/lib/types/backends/claude/session/auth.js +22 -22
- package/lib/types/backends/claude/session/channels.d.ts +4 -0
- package/lib/types/backends/claude/session/channels.d.ts.map +1 -1
- package/lib/types/backends/claude/session/channels.js +5 -3
- package/lib/types/backends/claude/session/lifecycle.d.ts.map +1 -1
- package/lib/types/backends/claude/session/lifecycle.js +31 -23
- package/lib/types/backends/claude/session/store.js +8 -8
- package/lib/types/backends/claude/session/subagents.js +2 -2
- package/lib/types/backends/claude/session/types.d.ts +7 -0
- package/lib/types/backends/claude/session/types.d.ts.map +1 -1
- package/lib/types/backends/claude/side-query.js +3 -3
- package/lib/types/backends/claude/task-output.js +5 -5
- package/lib/types/backends/claude/text.d.ts +778 -0
- package/lib/types/backends/claude/text.d.ts.map +1 -0
- package/lib/types/backends/claude/text.js +298 -0
- package/lib/types/backends/claude/transcript-file.d.ts +1 -1
- package/lib/types/backends/claude/transcript-file.d.ts.map +1 -1
- package/lib/types/backends/claude/transcript-file.js +4 -4
- package/lib/types/backends/claude/translate/attempts.js +2 -2
- package/lib/types/backends/claude/translate/core.js +3 -3
- package/lib/types/backends/claude/translate/messages.js +4 -4
- package/lib/types/backends/claude/translate/system.js +14 -14
- package/lib/types/backends/claude/translate/tasks.js +2 -2
- package/lib/types/backends/claude/translate/types.d.ts +1 -1
- package/lib/types/backends/claude/translate/types.d.ts.map +1 -1
- package/lib/types/backends/codex/auth/external-tokens.js +16 -16
- package/lib/types/backends/codex/auth/status.js +14 -14
- package/lib/types/backends/codex/backend.d.ts +4 -19
- package/lib/types/backends/codex/backend.d.ts.map +1 -1
- package/lib/types/backends/codex/backend.js +118 -25
- package/lib/types/backends/codex/catalog.d.ts +2 -1
- package/lib/types/backends/codex/catalog.d.ts.map +1 -1
- package/lib/types/backends/codex/catalog.js +63 -18
- package/lib/types/backends/codex/channels.d.ts +6 -3
- package/lib/types/backends/codex/channels.d.ts.map +1 -1
- package/lib/types/backends/codex/channels.js +15 -13
- package/lib/types/backends/codex/contract.d.ts +3 -0
- package/lib/types/backends/codex/contract.d.ts.map +1 -1
- package/lib/types/backends/codex/contract.js +3 -0
- package/lib/types/backends/codex/detect.d.ts.map +1 -1
- package/lib/types/backends/codex/detect.js +9 -6
- package/lib/types/backends/codex/manifest.d.ts +30 -0
- package/lib/types/backends/codex/manifest.d.ts.map +1 -0
- package/lib/types/backends/codex/manifest.js +23 -0
- package/lib/types/backends/codex/prefs.d.ts +4 -2
- package/lib/types/backends/codex/prefs.d.ts.map +1 -1
- package/lib/types/backends/codex/prefs.js +4 -3
- package/lib/types/backends/codex/rpc/hub.js +2 -2
- package/lib/types/backends/codex/session/activity.d.ts +1 -1
- package/lib/types/backends/codex/session/activity.d.ts.map +1 -1
- package/lib/types/backends/codex/session/activity.js +13 -13
- package/lib/types/backends/codex/session/approvals.js +30 -30
- package/lib/types/backends/codex/session/async-questions.d.ts +17 -0
- package/lib/types/backends/codex/session/async-questions.d.ts.map +1 -0
- package/lib/types/backends/codex/session/async-questions.js +89 -0
- package/lib/types/backends/codex/session/commands.d.ts +8 -2
- package/lib/types/backends/codex/session/commands.d.ts.map +1 -1
- package/lib/types/backends/codex/session/commands.js +71 -23
- package/lib/types/backends/codex/session/controls.d.ts +1 -1
- package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
- package/lib/types/backends/codex/session/controls.js +21 -16
- package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
- package/lib/types/backends/codex/session/goals.js +3 -3
- package/lib/types/backends/codex/session/history.js +2 -2
- package/lib/types/backends/codex/session/images.js +8 -8
- package/lib/types/backends/codex/session/input.d.ts +6 -2
- package/lib/types/backends/codex/session/input.d.ts.map +1 -1
- package/lib/types/backends/codex/session/input.js +55 -13
- package/lib/types/backends/codex/session/plan-review.js +6 -6
- package/lib/types/backends/codex/session/session.d.ts.map +1 -1
- package/lib/types/backends/codex/session/session.js +100 -42
- package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
- package/lib/types/backends/codex/session/side-query.js +27 -9
- package/lib/types/backends/codex/session/state.d.ts +6 -1
- package/lib/types/backends/codex/session/state.d.ts.map +1 -1
- package/lib/types/backends/codex/session/subagents.js +5 -5
- package/lib/types/backends/codex/session/tasks.js +4 -4
- package/lib/types/backends/codex/text.d.ts +933 -0
- package/lib/types/backends/codex/text.d.ts.map +1 -0
- package/lib/types/backends/codex/text.js +313 -0
- package/lib/types/backends/codex/translate/items.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/items.js +7 -5
- package/lib/types/backends/codex/translate/live.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/live.js +11 -8
- package/lib/types/backends/codex/translate/notices.js +10 -10
- package/lib/types/backends/codex/translate/question-reply.d.ts +11 -0
- package/lib/types/backends/codex/translate/question-reply.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/question-reply.js +53 -0
- package/lib/types/backends/shared/channel-slug.d.ts +4 -0
- package/lib/types/backends/shared/channel-slug.d.ts.map +1 -0
- package/lib/types/backends/shared/channel-slug.js +25 -0
- package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
- package/lib/types/backends/shared/channel-tokens.js +30 -23
- package/lib/types/{channel → backends/shared}/elicitation.d.ts +78 -21
- package/lib/types/backends/shared/elicitation.d.ts.map +1 -0
- package/lib/types/{channel → backends/shared}/elicitation.js +64 -66
- package/lib/types/backends/shared/image-size.d.ts +33 -0
- package/lib/types/backends/shared/image-size.d.ts.map +1 -0
- package/lib/types/backends/shared/image-size.js +134 -0
- package/lib/types/{utils → backends/shared}/jsonl.d.ts +5 -1
- package/lib/types/backends/shared/jsonl.d.ts.map +1 -0
- package/lib/types/{utils → backends/shared}/jsonl.js +5 -1
- package/lib/types/backends/shared/localized-text.d.ts +30 -0
- package/lib/types/backends/shared/localized-text.d.ts.map +1 -0
- package/lib/types/backends/shared/localized-text.js +24 -0
- package/lib/types/backends/shared/platform-text.d.ts +88 -0
- package/lib/types/backends/shared/platform-text.d.ts.map +1 -0
- package/lib/types/backends/shared/platform-text.js +33 -0
- package/lib/types/branding.d.ts +13 -0
- package/lib/types/branding.d.ts.map +1 -1
- package/lib/types/branding.js +18 -0
- package/lib/types/channel/channel-slug.d.ts +3 -1
- package/lib/types/channel/channel-slug.d.ts.map +1 -1
- package/lib/types/channel/channel-slug.js +3 -1
- package/lib/types/channel/projection.d.ts.map +1 -1
- package/lib/types/channel/projection.js +10 -0
- package/lib/types/channel/sanitize.d.ts +7 -0
- package/lib/types/channel/sanitize.d.ts.map +1 -1
- package/lib/types/channel/sanitize.js +9 -0
- package/lib/types/channel/usage.d.ts.map +1 -1
- package/lib/types/channel/usage.js +5 -0
- package/lib/types/commands.d.ts +15 -0
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +58 -10
- package/lib/types/components/AgentMessageComposer.d.ts.map +1 -1
- package/lib/types/components/AgentMessageComposer.js +3 -2
- package/lib/types/components/BtwPanel.d.ts.map +1 -1
- package/lib/types/components/BtwPanel.js +4 -2
- package/lib/types/components/Chat/JobCard.js +3 -3
- package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
- package/lib/types/components/CommandSuggestions.js +24 -7
- package/lib/types/components/ContextBarView.d.ts +5 -1
- package/lib/types/components/ContextBarView.d.ts.map +1 -1
- package/lib/types/components/ContextBarView.js +6 -3
- package/lib/types/components/ExtensionDialog.d.ts.map +1 -1
- package/lib/types/components/ExtensionDialog.js +2 -3
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +14 -3
- package/lib/types/components/InlineMathParagraph.js +1 -1
- package/lib/types/components/KernelPicker.d.ts.map +1 -1
- package/lib/types/components/KernelPicker.js +1 -1
- package/lib/types/components/LogoV2.d.ts +4 -1
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +14 -9
- package/lib/types/components/MarkdownTable.d.ts.map +1 -1
- package/lib/types/components/MarkdownTable.js +4 -3
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +109 -15
- package/lib/types/components/ModelPicker.d.ts +24 -31
- package/lib/types/components/ModelPicker.d.ts.map +1 -1
- package/lib/types/components/ModelPicker.js +115 -40
- package/lib/types/components/PermissionsPicker.d.ts +10 -1
- package/lib/types/components/PermissionsPicker.d.ts.map +1 -1
- package/lib/types/components/PermissionsPicker.js +24 -16
- package/lib/types/components/PluginInstallPane.d.ts +21 -0
- package/lib/types/components/PluginInstallPane.d.ts.map +1 -0
- package/lib/types/components/PluginInstallPane.js +84 -0
- package/lib/types/components/PluginManagePane.d.ts +21 -0
- package/lib/types/components/PluginManagePane.d.ts.map +1 -0
- package/lib/types/components/PluginManagePane.js +69 -0
- package/lib/types/components/PromptEditor.d.ts +3 -3
- package/lib/types/components/PromptInput.d.ts +21 -3
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +65 -121
- package/lib/types/components/SdkInstallWizard.d.ts +3 -1
- package/lib/types/components/SdkInstallWizard.d.ts.map +1 -1
- package/lib/types/components/SdkInstallWizard.js +8 -1
- package/lib/types/components/SearchBox.d.ts +13 -15
- package/lib/types/components/SearchBox.d.ts.map +1 -1
- package/lib/types/components/SearchBox.js +58 -27
- package/lib/types/components/SubagentCard.d.ts +13 -1
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +27 -12
- package/lib/types/components/SubagentDashboard.d.ts +8 -1
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +58 -16
- package/lib/types/components/ThemePicker.d.ts +1 -1
- package/lib/types/components/ThemePicker.d.ts.map +1 -1
- package/lib/types/components/ThemePicker.js +14 -11
- package/lib/types/components/Tooltip.js +1 -1
- package/lib/types/components/WorkingSpinner.js +1 -1
- package/lib/types/components/WorkspaceFlowPicker.d.ts.map +1 -1
- package/lib/types/components/WorkspaceFlowPicker.js +4 -3
- package/lib/types/components/composerImageTokens.d.ts +24 -0
- package/lib/types/components/composerImageTokens.d.ts.map +1 -0
- package/lib/types/components/composerImageTokens.js +37 -0
- package/lib/types/components/design-system/InputCaret.d.ts +7 -0
- package/lib/types/components/design-system/InputCaret.d.ts.map +1 -0
- package/lib/types/components/design-system/InputCaret.js +9 -0
- package/lib/types/components/design-system/ListItem.d.ts +13 -2
- package/lib/types/components/design-system/ListItem.d.ts.map +1 -1
- package/lib/types/components/design-system/ListItem.js +11 -5
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +6 -8
- package/lib/types/components/kernelCatalog.d.ts +55 -11
- package/lib/types/components/kernelCatalog.d.ts.map +1 -1
- package/lib/types/components/kernelCatalog.js +42 -23
- package/lib/types/components/launchpadActions.d.ts +4 -0
- package/lib/types/components/launchpadActions.d.ts.map +1 -1
- package/lib/types/components/launchpadActions.js +5 -4
- package/lib/types/components/launchpadLayout.d.ts +14 -1
- package/lib/types/components/launchpadLayout.d.ts.map +1 -1
- package/lib/types/components/launchpadLayout.js +38 -19
- package/lib/types/components/messages/TeamMessageBubble.d.ts +20 -0
- package/lib/types/components/messages/TeamMessageBubble.d.ts.map +1 -0
- package/lib/types/components/messages/TeamMessageBubble.js +15 -0
- package/lib/types/components/messages/UserPromptMessage.d.ts +4 -3
- package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -1
- package/lib/types/components/messages/UserPromptMessage.js +4 -3
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +8 -3
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +4 -3
- package/lib/types/components/questions/ProviderModelEditor.d.ts.map +1 -1
- package/lib/types/components/questions/ProviderModelEditor.js +3 -13
- package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -1
- package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
- package/lib/types/components/sessions/ForeignSessionRow.js +5 -2
- package/lib/types/components/sessions/SessionListRow.d.ts +3 -1
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionListRow.js +5 -2
- package/lib/types/components/sidePanel/PanelBar.d.ts +1 -0
- package/lib/types/components/sidePanel/PanelBar.d.ts.map +1 -1
- package/lib/types/components/sidePanel/PanelBar.js +21 -17
- package/lib/types/components/sidePanel/PanelHost.d.ts.map +1 -1
- package/lib/types/components/sidePanel/PanelHost.js +5 -1
- package/lib/types/components/sidePanel/PanelStore.d.ts +8 -0
- package/lib/types/components/sidePanel/PanelStore.d.ts.map +1 -1
- package/lib/types/components/sidePanel/PanelStore.js +11 -0
- package/lib/types/components/sidePanel/SidePanelColumn.d.ts +1 -1
- package/lib/types/components/sidePanel/SidePanelColumn.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelColumn.js +15 -2
- package/lib/types/components/sidePanel/SidePanelLayout.d.ts +6 -4
- package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelLayout.js +33 -7
- package/lib/types/components/sidePanel/SidePanelRuntimeContext.d.ts +7 -0
- package/lib/types/components/sidePanel/SidePanelRuntimeContext.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelRuntimeContext.js +4 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +7 -2
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.js +28 -8
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts +2 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +156 -21
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +6 -2
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +64 -16
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts +15 -5
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadView.js +101 -10
- package/lib/types/components/sidePanel/btw/threads.d.ts +18 -0
- package/lib/types/components/sidePanel/btw/threads.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/threads.js +51 -0
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
- package/lib/types/components/sidePanel/builtinPanels.js +5 -1
- package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -2
- package/lib/types/components/sidePanel/companion/SplashMascot.d.ts +5 -1
- package/lib/types/components/sidePanel/companion/SplashMascot.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/SplashMascot.js +19 -4
- package/lib/types/components/sidePanel/companion/skins.d.ts +8 -0
- package/lib/types/components/sidePanel/companion/skins.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/skins.js +57 -12
- package/lib/types/components/sidePanel/types.d.ts +7 -1
- package/lib/types/components/sidePanel/types.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.d.ts +2 -0
- package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.js +11 -1
- package/lib/types/components/splashArtRows.d.ts +29 -0
- package/lib/types/components/splashArtRows.d.ts.map +1 -0
- package/lib/types/components/splashArtRows.js +31 -0
- package/lib/types/components/splashFonts.d.ts +24 -1
- package/lib/types/components/splashFonts.d.ts.map +1 -1
- package/lib/types/components/splashFonts.js +40 -5
- package/lib/types/components/teamRoster.d.ts +70 -0
- package/lib/types/components/teamRoster.d.ts.map +1 -0
- package/lib/types/components/teamRoster.js +78 -0
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +3 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +5 -2
- package/lib/types/dsh-adapter/admission-loader.d.ts +102 -0
- package/lib/types/dsh-adapter/admission-loader.d.ts.map +1 -0
- package/lib/types/dsh-adapter/admission-loader.js +301 -0
- package/lib/types/dsh-adapter/agent-view.d.ts.map +1 -1
- package/lib/types/dsh-adapter/agent-view.js +3 -1
- package/lib/types/dsh-adapter/approvals.d.ts +7 -0
- package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
- package/lib/types/dsh-adapter/approvals.js +45 -1
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +71 -8
- package/lib/types/dsh-adapter/backend-admission.d.ts +64 -0
- package/lib/types/dsh-adapter/backend-admission.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend-admission.js +34 -0
- package/lib/types/dsh-adapter/backend-assembly.d.ts +31 -0
- package/lib/types/dsh-adapter/backend-assembly.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend-assembly.js +225 -0
- package/lib/types/dsh-adapter/backend-contribution.d.ts +62 -0
- package/lib/types/dsh-adapter/backend-contribution.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend-contribution.js +78 -0
- package/lib/types/dsh-adapter/backend-registry.d.ts +136 -0
- package/lib/types/dsh-adapter/backend-registry.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend-registry.js +304 -0
- package/lib/types/dsh-adapter/backends.d.ts +67 -24
- package/lib/types/dsh-adapter/backends.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backends.generated.d.ts +12 -0
- package/lib/types/dsh-adapter/backends.generated.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backends.generated.js +6 -0
- package/lib/types/dsh-adapter/backends.js +91 -46
- package/lib/types/dsh-adapter/bundled-presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/bundled-presets.js +60 -3
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts +2 -0
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.js +9 -3
- package/lib/types/dsh-adapter/channel/agent-view-projection.js +2 -2
- package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/background-action.js +8 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +17 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +19 -46
- package/lib/types/dsh-adapter/channel/channel-host.d.ts +45 -0
- package/lib/types/dsh-adapter/channel/channel-host.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/channel-host.js +1 -0
- package/lib/types/dsh-adapter/channel/command-completions.d.ts +5 -0
- package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/command-completions.js +79 -6
- package/lib/types/dsh-adapter/channel/compaction.d.ts +7 -2
- package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/compaction.js +100 -26
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +4 -2
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +36 -5
- package/lib/types/dsh-adapter/channel/cordis-host.d.ts +14 -0
- package/lib/types/dsh-adapter/channel/cordis-host.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/cordis-host.js +35 -0
- package/lib/types/dsh-adapter/channel/core/actions.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/actions.js +15 -6
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +10 -3
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +5 -1
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +12 -28
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +330 -117
- package/lib/types/dsh-adapter/channel/core/files.d.ts +7 -2
- package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/files.js +1 -0
- package/lib/types/dsh-adapter/channel/core/host.d.ts +12 -6
- package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/host.js +69 -35
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +5 -3
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.js +5 -2
- package/lib/types/dsh-adapter/channel/core/session-controls.js +2 -2
- package/lib/types/dsh-adapter/channel/core/session-switch.d.ts +7 -4
- package/lib/types/dsh-adapter/channel/core/session-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/session-switch.js +8 -4
- package/lib/types/dsh-adapter/channel/core/sessions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/core/sessions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/sessions.js +75 -16
- package/lib/types/dsh-adapter/channel/extensions.d.ts +4 -3
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/extensions.js +109 -30
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +14 -5
- package/lib/types/dsh-adapter/channel/job-projection.d.ts +4 -0
- package/lib/types/dsh-adapter/channel/job-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/job-projection.js +205 -24
- package/lib/types/dsh-adapter/channel/mentions.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts +7 -0
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-permission-actions.js +235 -13
- package/lib/types/dsh-adapter/channel/model-actions.d.ts +5 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +48 -29
- package/lib/types/dsh-adapter/channel/model-selection.d.ts +17 -0
- package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/model-selection.js +109 -0
- package/lib/types/dsh-adapter/channel/model-switch.d.ts +12 -21
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.js +39 -102
- package/lib/types/dsh-adapter/channel/permissions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/permissions.js +4 -1
- package/lib/types/dsh-adapter/channel/projection-helpers.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection-helpers.js +2 -0
- package/lib/types/dsh-adapter/channel/projection.js +1 -1
- package/lib/types/dsh-adapter/channel/reports.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/reports.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/reports.js +11 -3
- package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.js +33 -20
- package/lib/types/dsh-adapter/channel/session-listing.d.ts +20 -0
- package/lib/types/dsh-adapter/channel/session-listing.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-listing.js +51 -0
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts +3 -1
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +60 -30
- package/lib/types/dsh-adapter/channel/session-reset.js +2 -2
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +22 -8
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +38 -24
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +38 -24
- package/lib/types/dsh-adapter/channel/settings-host.d.ts +5 -2
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +136 -5
- package/lib/types/dsh-adapter/channel/state.d.ts +43 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +14 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +84 -12
- package/lib/types/dsh-adapter/channel/task-completion.d.ts +6 -0
- package/lib/types/dsh-adapter/channel/task-completion.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/task-completion.js +114 -0
- package/lib/types/dsh-adapter/channel/transcript.d.ts +8 -1
- package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/transcript.js +20 -3
- package/lib/types/dsh-adapter/channel/upstream-retry.d.ts +81 -0
- package/lib/types/dsh-adapter/channel/upstream-retry.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/upstream-retry.js +138 -0
- package/lib/types/dsh-adapter/channel/workspace-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/workspace-actions.js +9 -8
- package/lib/types/dsh-adapter/channel-ui.d.ts +3 -1
- package/lib/types/dsh-adapter/channel-ui.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel-ui.js +4 -2
- package/lib/types/dsh-adapter/channel.d.ts +2 -2
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +19 -5
- package/lib/types/dsh-adapter/compat/agent-team-0.2.0.d.ts +55 -0
- package/lib/types/dsh-adapter/compat/agent-team-0.2.0.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/agent-team-0.2.0.js +96 -0
- package/lib/types/dsh-adapter/context-occupancy.d.ts +81 -4
- package/lib/types/dsh-adapter/context-occupancy.d.ts.map +1 -1
- package/lib/types/dsh-adapter/context-occupancy.js +108 -17
- package/lib/types/dsh-adapter/contract.d.ts +4 -4
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +20 -5
- package/lib/types/dsh-adapter/effect-ledger.d.ts +7 -0
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
- package/lib/types/dsh-adapter/effect-ledger.js +8 -1
- package/lib/types/dsh-adapter/entry-slot.d.ts +38 -0
- package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -0
- package/lib/types/dsh-adapter/entry-slot.js +28 -0
- package/lib/types/dsh-adapter/fresh-agent.d.ts +22 -0
- package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -0
- package/lib/types/dsh-adapter/fresh-agent.js +226 -0
- package/lib/types/dsh-adapter/host-access.d.ts +16 -1
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +148 -2
- package/lib/types/dsh-adapter/host-contract.d.ts +103 -0
- package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-contract.js +77 -0
- package/lib/types/dsh-adapter/host-dsh.d.ts +112 -0
- package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-dsh.js +481 -0
- package/lib/types/dsh-adapter/host-entry.d.ts +9 -0
- package/lib/types/dsh-adapter/host-entry.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-entry.js +253 -0
- package/lib/types/dsh-adapter/index.d.ts +53 -17
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +63 -9
- package/lib/types/dsh-adapter/install/executors.d.ts +44 -0
- package/lib/types/dsh-adapter/install/executors.d.ts.map +1 -0
- package/lib/types/dsh-adapter/install/executors.js +15 -0
- package/lib/types/dsh-adapter/install/pnpm-profile-add.d.ts +3 -0
- package/lib/types/dsh-adapter/install/pnpm-profile-add.d.ts.map +1 -0
- package/lib/types/dsh-adapter/install/pnpm-profile-add.js +150 -0
- package/lib/types/dsh-adapter/invariant.d.ts +7 -2
- package/lib/types/dsh-adapter/invariant.d.ts.map +1 -1
- package/lib/types/dsh-adapter/invariant.js +6 -3
- package/lib/types/dsh-adapter/jobs.d.ts +7 -0
- package/lib/types/dsh-adapter/jobs.d.ts.map +1 -1
- package/lib/types/dsh-adapter/jobs.js +13 -0
- package/lib/types/dsh-adapter/lite-profile.d.ts +50 -0
- package/lib/types/dsh-adapter/lite-profile.d.ts.map +1 -0
- package/lib/types/dsh-adapter/lite-profile.js +49 -0
- package/lib/types/dsh-adapter/migrate/index.js +2 -2
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts +1 -1
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts.map +1 -1
- package/lib/types/dsh-adapter/migrate/parse/jsonl.js +4 -3
- package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/profiles.js +5 -1
- package/lib/types/dsh-adapter/panels.d.ts +7 -0
- package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
- package/lib/types/dsh-adapter/panels.js +41 -2
- package/lib/types/dsh-adapter/plugin-completions.d.ts +32 -0
- package/lib/types/dsh-adapter/plugin-completions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-completions.js +80 -0
- package/lib/types/dsh-adapter/plugin-declaration.d.ts +119 -0
- package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-declaration.js +183 -0
- package/lib/types/dsh-adapter/plugin-feed.d.ts +94 -0
- package/lib/types/dsh-adapter/plugin-feed.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-feed.js +135 -0
- package/lib/types/dsh-adapter/plugin-guard.d.ts +115 -0
- package/lib/types/dsh-adapter/plugin-guard.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-guard.js +108 -0
- package/lib/types/dsh-adapter/plugin-host.d.ts +13 -2
- package/lib/types/dsh-adapter/plugin-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-host.js +34 -8
- package/lib/types/dsh-adapter/plugin-install.d.ts +160 -0
- package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-install.js +545 -0
- package/lib/types/dsh-adapter/plugin-manage.d.ts +178 -0
- package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-manage.js +468 -0
- package/lib/types/dsh-adapter/plugin-manager.d.ts +144 -0
- package/lib/types/dsh-adapter/plugin-manager.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-manager.js +83 -0
- package/lib/types/dsh-adapter/plugin.d.ts +50 -1
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +918 -234
- package/lib/types/dsh-adapter/plugins-info.d.ts +130 -8
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +469 -44
- package/lib/types/dsh-adapter/process-exit.d.ts +43 -0
- package/lib/types/dsh-adapter/process-exit.d.ts.map +1 -0
- package/lib/types/dsh-adapter/process-exit.js +60 -0
- package/lib/types/dsh-adapter/root-dispose.d.ts +18 -0
- package/lib/types/dsh-adapter/root-dispose.d.ts.map +1 -0
- package/lib/types/dsh-adapter/root-dispose.js +28 -0
- package/lib/types/dsh-adapter/session-list-metadata.d.ts +20 -0
- package/lib/types/dsh-adapter/session-list-metadata.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-list-metadata.js +56 -0
- package/lib/types/dsh-adapter/session-projection-store.d.ts +66 -0
- package/lib/types/dsh-adapter/session-projection-store.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-projection-store.js +149 -0
- package/lib/types/dsh-adapter/session-seed.d.ts +11 -0
- package/lib/types/dsh-adapter/session-seed.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-seed.js +47 -0
- package/lib/types/dsh-adapter/sessions/list.d.ts +3 -1
- package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/list.js +11 -5
- package/lib/types/dsh-adapter/sessions/snapshot.d.ts +0 -2
- package/lib/types/dsh-adapter/sessions/snapshot.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/snapshot.js +7 -70
- package/lib/types/dsh-adapter/settingsEditor.js +2 -2
- package/lib/types/dsh-adapter/sideQuestion.d.ts +21 -0
- package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sideQuestion.js +53 -0
- package/lib/types/dsh-adapter/startup-args.d.ts +2 -0
- package/lib/types/dsh-adapter/startup-args.d.ts.map +1 -1
- package/lib/types/dsh-adapter/startup-args.js +5 -0
- package/lib/types/dsh-adapter/subagents.d.ts +33 -1
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +112 -9
- package/lib/types/dsh-adapter/team-mode.d.ts +74 -0
- package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -0
- package/lib/types/dsh-adapter/team-mode.js +188 -0
- package/lib/types/dsh-adapter/team-roster.d.ts +67 -0
- package/lib/types/dsh-adapter/team-roster.d.ts.map +1 -0
- package/lib/types/dsh-adapter/team-roster.js +136 -0
- package/lib/types/dsh-adapter/team-tools.d.ts +58 -0
- package/lib/types/dsh-adapter/team-tools.d.ts.map +1 -0
- package/lib/types/dsh-adapter/team-tools.js +208 -0
- package/lib/types/dsh-adapter/tui-settings.d.ts +57 -0
- package/lib/types/dsh-adapter/tui-settings.d.ts.map +1 -0
- package/lib/types/dsh-adapter/tui-settings.js +199 -0
- package/lib/types/dsh-adapter/types.d.ts +1 -1
- package/lib/types/dsh-adapter/types.d.ts.map +1 -1
- package/lib/types/effortPrefs.d.ts +6 -3
- package/lib/types/effortPrefs.d.ts.map +1 -1
- package/lib/types/effortPrefs.js +7 -4
- package/lib/types/hostEntryRoute.d.ts +18 -0
- package/lib/types/hostEntryRoute.d.ts.map +1 -0
- package/lib/types/hostEntryRoute.js +57 -0
- package/lib/types/i18n.d.ts +961 -1439
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +443 -387
- package/lib/types/ink/components/AlternateScreen.js +2 -2
- package/lib/types/ink/components/App.d.ts +1 -0
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +16 -4
- package/lib/types/ink/components/CursorDeclarationContext.d.ts +9 -0
- package/lib/types/ink/components/CursorDeclarationContext.d.ts.map +1 -1
- package/lib/types/ink/components/CursorDeclarationContext.js +2 -0
- package/lib/types/ink/components/ScrollBox.d.ts +9 -0
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
- package/lib/types/ink/components/ScrollBox.js +23 -0
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-copy-on-select.d.ts +2 -2
- package/lib/types/ink/hooks/use-copy-on-select.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-copy-on-select.js +13 -7
- package/lib/types/ink/hooks/use-declared-cursor.d.ts +11 -3
- package/lib/types/ink/hooks/use-declared-cursor.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-declared-cursor.js +30 -10
- package/lib/types/ink/ink.d.ts +22 -17
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +151 -40
- package/lib/types/ink/kitty-graphics.d.ts +2 -0
- package/lib/types/ink/kitty-graphics.d.ts.map +1 -1
- package/lib/types/ink/kitty-graphics.js +6 -1
- package/lib/types/ink/node-cache.d.ts +2 -1
- package/lib/types/ink/node-cache.d.ts.map +1 -1
- package/lib/types/ink/output.d.ts +10 -4
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +14 -10
- package/lib/types/ink/render-node-to-output.d.ts +5 -2
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +27 -9
- package/lib/types/ink/renderer.d.ts +1 -0
- package/lib/types/ink/renderer.d.ts.map +1 -1
- package/lib/types/ink/renderer.js +4 -3
- package/lib/types/ink/root.d.ts +4 -1
- package/lib/types/ink/root.d.ts.map +1 -1
- package/lib/types/ink/screen.d.ts +4 -2
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/selection.d.ts +10 -1
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +94 -25
- package/lib/types/ink/stdin-handoff.d.ts +11 -0
- package/lib/types/ink/stdin-handoff.d.ts.map +1 -0
- package/lib/types/ink/stdin-handoff.js +20 -0
- package/lib/types/ink/styles.d.ts +2 -1
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/terminal-image.d.ts +6 -4
- package/lib/types/ink/terminal-image.d.ts.map +1 -1
- package/lib/types/ink/terminal-image.js +16 -39
- package/lib/types/ink/terminal-notification.d.ts +8 -0
- package/lib/types/ink/terminal-notification.d.ts.map +1 -0
- package/lib/types/ink/terminal-notification.js +83 -0
- package/lib/types/ink/terminal.d.ts +9 -0
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +34 -1
- package/lib/types/ink/termio/csi.d.ts +11 -0
- package/lib/types/ink/termio/csi.d.ts.map +1 -1
- package/lib/types/ink/termio/csi.js +13 -0
- package/lib/types/ink/update-overflow-guard.d.ts +6 -0
- package/lib/types/ink/update-overflow-guard.d.ts.map +1 -1
- package/lib/types/ink/update-overflow-guard.js +17 -0
- package/lib/types/ink/wrap-text.d.ts +6 -0
- package/lib/types/ink/wrap-text.d.ts.map +1 -1
- package/lib/types/ink/wrap-text.js +17 -0
- package/lib/types/kernelPrefs.d.ts +130 -17
- package/lib/types/kernelPrefs.d.ts.map +1 -1
- package/lib/types/kernelPrefs.js +98 -35
- package/lib/types/math/inline-layout.d.ts +2 -0
- package/lib/types/math/inline-layout.d.ts.map +1 -1
- package/lib/types/math/inline-layout.js +5 -27
- package/lib/types/modelGroups.d.ts +15 -27
- package/lib/types/modelGroups.d.ts.map +1 -1
- package/lib/types/modelGroups.js +17 -31
- package/lib/types/modelPrefs.d.ts +5 -4
- package/lib/types/modelPrefs.d.ts.map +1 -1
- package/lib/types/modelPrefs.js +5 -4
- package/lib/types/modelRoute.d.ts +23 -9
- package/lib/types/modelRoute.d.ts.map +1 -1
- package/lib/types/modelRoute.js +25 -11
- package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -1
- package/lib/types/native-ts/yoga-layout/index.js +8 -1
- package/lib/types/permissionPrefs.d.ts +34 -0
- package/lib/types/permissionPrefs.d.ts.map +1 -0
- package/lib/types/permissionPrefs.js +61 -0
- package/lib/types/permissionPresetLabels.d.ts +25 -0
- package/lib/types/permissionPresetLabels.d.ts.map +1 -0
- package/lib/types/permissionPresetLabels.js +33 -0
- package/lib/types/plugin-host.d.ts +1 -0
- package/lib/types/plugin-host.d.ts.map +1 -1
- package/lib/types/preset-patch.d.ts +22 -0
- package/lib/types/preset-patch.d.ts.map +1 -0
- package/lib/types/preset-patch.js +14 -0
- package/lib/types/presetPrefs.d.ts +17 -3
- package/lib/types/presetPrefs.d.ts.map +1 -1
- package/lib/types/presetPrefs.js +20 -3
- package/lib/types/reload.d.ts +6 -10
- package/lib/types/reload.d.ts.map +1 -1
- package/lib/types/reload.js +14 -14
- package/lib/types/screens/Chat.d.ts +55 -16
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +742 -280
- package/lib/types/screens/Launchpad.d.ts +33 -17
- package/lib/types/screens/Launchpad.d.ts.map +1 -1
- package/lib/types/screens/Launchpad.js +256 -78
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +53 -12
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +7 -0
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +24 -7
- package/lib/types/screens/StatusMetrics.d.ts +46 -1
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +72 -0
- package/lib/types/screens/chat/useKernelPicker.d.ts +8 -4
- package/lib/types/screens/chat/useKernelPicker.d.ts.map +1 -1
- package/lib/types/screens/chat/useKernelPicker.js +61 -21
- package/lib/types/screens/chat/useModelPicker.d.ts +42 -0
- package/lib/types/screens/chat/useModelPicker.d.ts.map +1 -0
- package/lib/types/screens/chat/useModelPicker.js +182 -0
- package/lib/types/screens/chat/usePluginWriteFlow.d.ts +68 -0
- package/lib/types/screens/chat/usePluginWriteFlow.d.ts.map +1 -0
- package/lib/types/screens/chat/usePluginWriteFlow.js +92 -0
- package/lib/types/screens/chatOverlay.d.ts +30 -5
- package/lib/types/screens/chatOverlay.d.ts.map +1 -1
- package/lib/types/screens/chatOverlay.js +0 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +4 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +26 -5
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +51 -29
- package/lib/types/sessionHistory.d.ts +5 -0
- package/lib/types/sessionHistory.d.ts.map +1 -1
- package/lib/types/sessionHistory.js +5 -0
- package/lib/types/sessionModes.d.ts +5 -3
- package/lib/types/sessionModes.d.ts.map +1 -1
- package/lib/types/sessionModes.js +9 -3
- package/lib/types/sessions/listSnapshot.d.ts +6 -0
- package/lib/types/sessions/listSnapshot.d.ts.map +1 -0
- package/lib/types/sessions/listSnapshot.js +67 -0
- package/lib/types/settings/definitions.d.ts +50 -0
- package/lib/types/settings/definitions.d.ts.map +1 -1
- package/lib/types/settings/definitions.js +42 -8
- package/lib/types/terminal-utils/cjk-emphasis.d.ts +28 -0
- package/lib/types/terminal-utils/cjk-emphasis.d.ts.map +1 -0
- package/lib/types/terminal-utils/cjk-emphasis.js +31 -0
- package/lib/types/terminal-utils/markdown.d.ts +3 -1
- package/lib/types/terminal-utils/markdown.d.ts.map +1 -1
- package/lib/types/terminal-utils/markdown.js +7 -2
- package/lib/types/theme.d.ts +29 -12
- package/lib/types/theme.d.ts.map +1 -1
- package/lib/types/theme.js +310 -23
- package/lib/types/themeCatalog.d.ts.map +1 -1
- package/lib/types/themeCatalog.js +21 -2
- package/lib/types/tips.js +4 -4
- package/lib/types/tuiSettingsFile.d.ts +56 -0
- package/lib/types/tuiSettingsFile.d.ts.map +1 -0
- package/lib/types/tuiSettingsFile.js +206 -0
- package/lib/types/ui.d.ts +2 -0
- package/lib/types/ui.d.ts.map +1 -1
- package/lib/types/ui.js +2 -0
- package/lib/types/update.d.ts +72 -26
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +131 -43
- package/lib/types/utils/bmp.d.ts +7 -0
- package/lib/types/utils/bmp.d.ts.map +1 -1
- package/lib/types/utils/bmp.js +27 -0
- package/lib/types/utils/bootTrace.d.ts +2 -0
- package/lib/types/utils/bootTrace.d.ts.map +1 -0
- package/lib/types/utils/bootTrace.js +20 -0
- package/lib/types/utils/clipboard.d.ts.map +1 -1
- package/lib/types/utils/clipboard.js +11 -3
- package/lib/types/utils/credentials.d.ts +14 -2
- package/lib/types/utils/credentials.d.ts.map +1 -1
- package/lib/types/utils/credentials.js +34 -11
- package/lib/types/utils/imageResize.d.ts +10 -20
- package/lib/types/utils/imageResize.d.ts.map +1 -1
- package/lib/types/utils/imageResize.js +61 -134
- package/lib/types/utils/inputPaste.d.ts +2 -2
- package/lib/types/utils/inputPaste.js +2 -2
- package/lib/types/utils/pastedImagePath.d.ts +5 -0
- package/lib/types/utils/pastedImagePath.d.ts.map +1 -1
- package/lib/types/utils/pastedImagePath.js +33 -0
- package/lib/types/utils/paths.d.ts +11 -0
- package/lib/types/utils/paths.d.ts.map +1 -1
- package/lib/types/utils/paths.js +13 -0
- package/package.json +150 -114
- package/presets/winbash.mjs +716 -0
- package/tui-profile/feed/README.md +63 -0
- package/tui-profile/feed/first-party.json +10 -0
- package/tui-profile/protocols/profile-definitions.d.ts +1 -0
- package/tui-profile/protocols/profile-definitions.js +14 -0
- package/tui-profile/protocols/tui-contributions.d.ts +55 -0
- package/tui-profile/protocols/tui-contributions.js +141 -0
- package/tui-profile/registry/contracts/backend-v1alpha1.json +13 -0
- package/tui-profile/registry/registry-0.15.json +12 -0
- package/lib/types/backends/claude/install.d.ts +0 -15
- package/lib/types/backends/claude/install.d.ts.map +0 -1
- package/lib/types/backends/claude/install.js +0 -91
- package/lib/types/channel/elicitation.d.ts.map +0 -1
- package/lib/types/dsh-adapter/channel/session-lineage.d.ts +0 -42
- package/lib/types/dsh-adapter/channel/session-lineage.d.ts.map +0 -1
- package/lib/types/dsh-adapter/channel/session-lineage.js +0 -51
- package/lib/types/utils/jsonl.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-slug.d.ts","sourceRoot":"","sources":["../../../../src/backends/shared/channel-slug.ts"],"names":[],"mappings":"AAiBA;kDACkD;AAClD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKvD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The stable id of a channel profile name, for backends (D15).
|
|
3
|
+
*
|
|
4
|
+
* Backends keep their own channel store and must not reach into
|
|
5
|
+
* `src/channel/` (B-3's boundary rule), while the `/channel` wizard keeps
|
|
6
|
+
* using `src/channel/channel-slug.ts`. The two implementations MUST stay
|
|
7
|
+
* byte-identical: the id is a *persistent* join key (the profile file's row
|
|
8
|
+
* and the token ref derived from it), so a drift would make the wizard and a
|
|
9
|
+
* backend disagree about which channel a row is.
|
|
10
|
+
* `scripts/verify-claude-channels.ts` pins that equality over a name vector.
|
|
11
|
+
*
|
|
12
|
+
* A name with no ASCII letter or digit (智谱, 硅基流动) gets
|
|
13
|
+
* `channel-<first 8 hex of its sha256>` instead, so two such names never
|
|
14
|
+
* share one id.
|
|
15
|
+
*/
|
|
16
|
+
import { createHash } from 'node:crypto';
|
|
17
|
+
/** The id of a channel profile name: lowercase ASCII, runs of other
|
|
18
|
+
* characters collapsed to `-`, edges trimmed. */
|
|
19
|
+
export function channelProfileSlug(name) {
|
|
20
|
+
const trimmed = name.trim();
|
|
21
|
+
const slug = trimmed.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
|
|
22
|
+
if (slug !== '')
|
|
23
|
+
return slug;
|
|
24
|
+
return `channel-${createHash('sha256').update(trimmed.normalize('NFC')).digest('hex').slice(0, 8)}`;
|
|
25
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-tokens.d.ts","sourceRoot":"","sources":["../../../../src/backends/shared/channel-tokens.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"channel-tokens.d.ts","sourceRoot":"","sources":["../../../../src/backends/shared/channel-tokens.ts"],"names":[],"mappings":"AAsCA;mDACmD;AACnD,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAGlD;AAED,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IAChC,iEAAiE;IACjE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACrC;mEAC+D;IAC/D,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACvC,4CAA4C;IAC5C,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,2DAA2D;IAC3D,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAC/B;AAID;kCACkC;AAClC,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,MAAqB,EAAE,KAAK,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAsB,GAAG,iBAAiB,CA6FpI;AAED,6CAA6C;AAC7C,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAAG,iBAAiB,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,CASjJ;AAED,oFAAoF;AACpF,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAA;AACnD,oFAAoF;AACpF,eAAO,MAAM,uBAAuB,0BAAoB,CAAA;AACxD,sFAAsF;AACtF,eAAO,MAAM,yBAAyB,4BAAsB,CAAA"}
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
*
|
|
9
9
|
* This module is a direct, host-side file view of that store (a non-DSH
|
|
10
10
|
* backend has no cordis context to resolve `ctx.get('credentials')` from).
|
|
11
|
+
* Reads consult the active home's store and then the default `~/.dsh` store
|
|
12
|
+
* (`credentialStoreFiles`), so a `DSH_HOME` override does not orphan a key the
|
|
13
|
+
* user stored at the documented location; writes always target the active home.
|
|
11
14
|
* The store is edited through a YAML document parser (`yaml`): the top-level
|
|
12
15
|
* `refs` mapping is found in block or flow style, quoted keys included;
|
|
13
16
|
* foreign fields, comments and multiline scalars keep their meaning, and a
|
|
@@ -30,7 +33,7 @@
|
|
|
30
33
|
import { readFileSync } from 'node:fs';
|
|
31
34
|
import { join } from 'node:path';
|
|
32
35
|
import { isMap, parseDocument } from 'yaml';
|
|
33
|
-
import { dshHomeDir } from '../../utils/credentials.js';
|
|
36
|
+
import { credentialStoreFiles, dshHomeDir } from '../../utils/credentials.js';
|
|
34
37
|
import { writeFileAtomic } from './atomic-file.js';
|
|
35
38
|
/** The credential ref of one channel id (the deriveKeyRef convention:
|
|
36
39
|
* uppercase, runs of non-alphanumerics → `_`). */
|
|
@@ -43,13 +46,17 @@ const FILE = '.credentials.yaml';
|
|
|
43
46
|
* `~/.dsh/.credentials.yaml`). */
|
|
44
47
|
export function fileChannelTokens(home = dshHomeDir(), debug = () => undefined) {
|
|
45
48
|
const path = join(home, FILE);
|
|
46
|
-
|
|
49
|
+
// Writes stay in the active home; reads also consult the default `~/.dsh`
|
|
50
|
+
// store so a key stored at the documented location survives a DSH_HOME
|
|
51
|
+
// override (the codex bridge injects provider env keys from here).
|
|
52
|
+
const files = credentialStoreFiles(home);
|
|
53
|
+
/** Parse one store into a YAML document; undefined for a file that
|
|
47
54
|
* cannot be read or does not parse (never rebuilt over). An absent file
|
|
48
55
|
* parses as an empty document, so the first write can create it. */
|
|
49
|
-
const load = () => {
|
|
56
|
+
const load = (file) => {
|
|
50
57
|
let text;
|
|
51
58
|
try {
|
|
52
|
-
text = readFileSync(
|
|
59
|
+
text = readFileSync(file, 'utf8');
|
|
53
60
|
}
|
|
54
61
|
catch (error) {
|
|
55
62
|
if (error.code === 'ENOENT')
|
|
@@ -77,6 +84,14 @@ export function fileChannelTokens(home = dshHomeDir(), debug = () => undefined)
|
|
|
77
84
|
return undefined;
|
|
78
85
|
return isMap(refs) ? refs : null;
|
|
79
86
|
};
|
|
87
|
+
/** The `refs` mapping of one candidate store (undefined when it has none). */
|
|
88
|
+
const refsAt = (file) => {
|
|
89
|
+
const doc = load(file);
|
|
90
|
+
if (doc === undefined)
|
|
91
|
+
return undefined;
|
|
92
|
+
const refs = refsOf(doc);
|
|
93
|
+
return refs === undefined || refs === null ? undefined : refs;
|
|
94
|
+
};
|
|
80
95
|
const commit = (next) => {
|
|
81
96
|
try {
|
|
82
97
|
writeFileAtomic(home, FILE, next);
|
|
@@ -87,19 +102,17 @@ export function fileChannelTokens(home = dshHomeDir(), debug = () => undefined)
|
|
|
87
102
|
};
|
|
88
103
|
return {
|
|
89
104
|
read: ref => {
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
// scalars are declared but not usable credential material.
|
|
99
|
-
return typeof value === 'string' && value !== '' ? value : undefined;
|
|
105
|
+
for (const file of files) {
|
|
106
|
+
const value = refsAt(file)?.get(ref);
|
|
107
|
+
// Only a non-empty string scalar is a token; null/number/boolean
|
|
108
|
+
// scalars are declared but not usable credential material.
|
|
109
|
+
if (typeof value === 'string' && value !== '')
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
return undefined;
|
|
100
113
|
},
|
|
101
114
|
write: (ref, value) => {
|
|
102
|
-
const doc = load();
|
|
115
|
+
const doc = load(path);
|
|
103
116
|
if (doc === undefined)
|
|
104
117
|
return;
|
|
105
118
|
const refs = refsOf(doc);
|
|
@@ -122,7 +135,7 @@ export function fileChannelTokens(home = dshHomeDir(), debug = () => undefined)
|
|
|
122
135
|
commit(next);
|
|
123
136
|
},
|
|
124
137
|
erase: ref => {
|
|
125
|
-
const doc = load();
|
|
138
|
+
const doc = load(path);
|
|
126
139
|
if (doc === undefined)
|
|
127
140
|
return;
|
|
128
141
|
const refs = refsOf(doc);
|
|
@@ -133,13 +146,7 @@ export function fileChannelTokens(home = dshHomeDir(), debug = () => undefined)
|
|
|
133
146
|
refs.delete(ref);
|
|
134
147
|
commit(doc.toString({ lineWidth: 0 }));
|
|
135
148
|
},
|
|
136
|
-
declared: ref =>
|
|
137
|
-
const doc = load();
|
|
138
|
-
if (doc === undefined)
|
|
139
|
-
return false;
|
|
140
|
-
const refs = refsOf(doc);
|
|
141
|
-
return refs !== undefined && refs !== null && refs.has(ref);
|
|
142
|
-
},
|
|
149
|
+
declared: ref => files.some(file => refsAt(file)?.has(ref) === true),
|
|
143
150
|
};
|
|
144
151
|
}
|
|
145
152
|
/** An in-memory store (tests, embedders). */
|
|
@@ -23,10 +23,75 @@
|
|
|
23
23
|
* are matched against the very strings the panel showed, so a language
|
|
24
24
|
* switch meanwhile cannot turn a valid answer into a mismatch.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
26
|
+
* **Locale-free (B-3)**: this module writes no copy of its own. Every string
|
|
27
|
+
* it puts on screen comes from the {@link ElicitationText} the caller hands
|
|
28
|
+
* over — one snapshot per flow, taken in the backend's own language through
|
|
29
|
+
* `BackendHost.locale()`. A backend's text is its own (D2); the host
|
|
30
|
+
* dictionary is not readable from here.
|
|
31
|
+
*
|
|
32
|
+
* Backend-neutral (`verify:boundary`): no vendor types, no I/O, no host
|
|
33
|
+
* module — the module lives in `src/backends/shared/` because the two
|
|
34
|
+
* backends are its only callers.
|
|
27
35
|
*/
|
|
28
|
-
import type { QuestionAnswers } from '
|
|
29
|
-
import type { QuestionItemView } from '
|
|
36
|
+
import type { QuestionAnswers } from '../../agent/capabilities.js';
|
|
37
|
+
import type { QuestionItemView } from '../../agent/events.js';
|
|
38
|
+
/** Every string this flow puts on screen, in one language, as the caller's
|
|
39
|
+
* own dictionary holds it. Values may carry `{{name}}` placeholders: this
|
|
40
|
+
* module fills them from the values of the call. */
|
|
41
|
+
export interface ElicitationText {
|
|
42
|
+
/** The label that skips an optional field. */
|
|
43
|
+
readonly skip: string;
|
|
44
|
+
readonly skipDesc: string;
|
|
45
|
+
readonly yes: string;
|
|
46
|
+
readonly no: string;
|
|
47
|
+
/** The last question's two options. */
|
|
48
|
+
readonly send: string;
|
|
49
|
+
readonly sendDesc: string;
|
|
50
|
+
readonly decline: string;
|
|
51
|
+
readonly declineDesc: string;
|
|
52
|
+
readonly confirm: string;
|
|
53
|
+
/** `{{title}}` = the field's title. */
|
|
54
|
+
readonly optional: string;
|
|
55
|
+
/** `{{reason}}` = the reason the field is asked again. */
|
|
56
|
+
readonly invalid: string;
|
|
57
|
+
readonly invalidChoice: string;
|
|
58
|
+
readonly invalidRequired: string;
|
|
59
|
+
readonly invalidNumber: string;
|
|
60
|
+
readonly invalidInteger: string;
|
|
61
|
+
/** `{{min}}` / `{{max}}` / `{{n}}`. */
|
|
62
|
+
readonly invalidMin: string;
|
|
63
|
+
readonly invalidMax: string;
|
|
64
|
+
readonly invalidMinLength: string;
|
|
65
|
+
readonly invalidMaxLength: string;
|
|
66
|
+
readonly invalidMinItems: string;
|
|
67
|
+
readonly invalidMaxItems: string;
|
|
68
|
+
readonly invalidJson: string;
|
|
69
|
+
readonly invalidEmail: string;
|
|
70
|
+
readonly invalidUri: string;
|
|
71
|
+
readonly invalidDate: string;
|
|
72
|
+
readonly invalidDateTime: string;
|
|
73
|
+
readonly invalidPattern: string;
|
|
74
|
+
readonly kindInteger: string;
|
|
75
|
+
readonly kindNumber: string;
|
|
76
|
+
/** `{{kind}}` / `{{min}}` / `{{max}}`. */
|
|
77
|
+
readonly hintRange: string;
|
|
78
|
+
readonly hintMin: string;
|
|
79
|
+
readonly hintMax: string;
|
|
80
|
+
readonly hintJson: string;
|
|
81
|
+
/** `{{format}}` = the declared string format (email, date, …). */
|
|
82
|
+
readonly hintFormat: string;
|
|
83
|
+
readonly urlAccept: string;
|
|
84
|
+
readonly urlAcceptDesc: string;
|
|
85
|
+
/** `{{server}}` = the MCP server's name. */
|
|
86
|
+
readonly urlQuestion: string;
|
|
87
|
+
readonly urlDetail: string;
|
|
88
|
+
/** `{{server}}` + `{{url}}`. */
|
|
89
|
+
readonly urlNotice: string;
|
|
90
|
+
readonly urlComplete: string;
|
|
91
|
+
readonly urlMissing: string;
|
|
92
|
+
/** `{{server}}` + `{{mode}}`. */
|
|
93
|
+
readonly unsupported: string;
|
|
94
|
+
}
|
|
30
95
|
/** A JSON object as read from an untyped schema. */
|
|
31
96
|
type Rec = Readonly<Record<string, unknown>>;
|
|
32
97
|
/** A form value the MCP result carries. */
|
|
@@ -48,23 +113,15 @@ export interface FormField {
|
|
|
48
113
|
/** The fields of a requested schema, in declaration order. */
|
|
49
114
|
export declare function formFields(schema: unknown): FormField[];
|
|
50
115
|
/** Validate one typed value against its field; the value or the reason. */
|
|
51
|
-
export declare function parseFieldText(field: FormField, text: string): {
|
|
116
|
+
export declare function parseFieldText(field: FormField, text: string, elicit: ElicitationText): {
|
|
52
117
|
readonly value: ElicitationValue;
|
|
53
118
|
} | {
|
|
54
119
|
readonly error: string;
|
|
55
120
|
};
|
|
56
|
-
/** The option labels of one form flow, fixed when it is first asked. */
|
|
57
|
-
export interface FormLabels {
|
|
58
|
-
readonly skip: string;
|
|
59
|
-
readonly yes: string;
|
|
60
|
-
readonly no: string;
|
|
61
|
-
}
|
|
62
|
-
/** The current language's form labels. */
|
|
63
|
-
export declare const formLabels: () => FormLabels;
|
|
64
121
|
/** A field's question (with the reason it is asked again, if any). */
|
|
65
|
-
export declare function fieldQuestion(field: FormField, header: string, lead: string | undefined, error: string | undefined,
|
|
122
|
+
export declare function fieldQuestion(field: FormField, header: string, lead: string | undefined, error: string | undefined, elicit: ElicitationText): QuestionItemView;
|
|
66
123
|
/** One answered field: its value, `skip`, or why it is invalid. */
|
|
67
|
-
export declare function fieldValue(field: FormField, answer: QuestionAnswers['answers'][number] | undefined,
|
|
124
|
+
export declare function fieldValue(field: FormField, answer: QuestionAnswers['answers'][number] | undefined, elicit: ElicitationText): {
|
|
68
125
|
readonly value: ElicitationValue;
|
|
69
126
|
} | {
|
|
70
127
|
readonly skip: true;
|
|
@@ -111,7 +168,7 @@ export interface ElicitationForm {
|
|
|
111
168
|
* send / decline choice is asked once, after the first round; a re-ask
|
|
112
169
|
* keeps the values already accepted and replaces the re-asked ones.
|
|
113
170
|
*/
|
|
114
|
-
export declare function createElicitationForm(request: ElicitationRequestView): ElicitationForm;
|
|
171
|
+
export declare function createElicitationForm(request: ElicitationRequestView, elicit: ElicitationText): ElicitationForm;
|
|
115
172
|
/** A URL elicitation as one accept / decline question carrying the link. */
|
|
116
173
|
export interface ElicitationUrlAsk {
|
|
117
174
|
readonly questions: readonly QuestionItemView[];
|
|
@@ -119,17 +176,17 @@ export interface ElicitationUrlAsk {
|
|
|
119
176
|
accepted(answers: QuestionAnswers): boolean;
|
|
120
177
|
}
|
|
121
178
|
/** The URL-mode question; undefined when the request names no URL. */
|
|
122
|
-
export declare function createElicitationUrlAsk(request: ElicitationRequestView): ElicitationUrlAsk | undefined;
|
|
179
|
+
export declare function createElicitationUrlAsk(request: ElicitationRequestView, elicit: ElicitationText): ElicitationUrlAsk | undefined;
|
|
123
180
|
/** The notice texts a backend shows around an elicitation. */
|
|
124
|
-
export declare
|
|
181
|
+
export declare function elicitationNotices(elicit: ElicitationText): {
|
|
125
182
|
/** URL mode: the server asks the user to open a page. */
|
|
126
|
-
urlOpen
|
|
183
|
+
urlOpen(server: string, url: string): string;
|
|
127
184
|
/** URL mode: the server reported the flow done. */
|
|
128
|
-
urlComplete
|
|
185
|
+
urlComplete(server: string): string;
|
|
129
186
|
/** URL mode without a URL: declined. */
|
|
130
|
-
urlMissing
|
|
187
|
+
urlMissing(server: string): string;
|
|
131
188
|
/** A mode this client cannot render: declined. */
|
|
132
|
-
unsupported
|
|
189
|
+
unsupported(server: string, mode: string): string;
|
|
133
190
|
};
|
|
134
191
|
export {};
|
|
135
192
|
//# sourceMappingURL=elicitation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elicitation.d.ts","sourceRoot":"","sources":["../../../../src/backends/shared/elicitation.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fillTemplate } from './localized-text.js';
|
|
2
|
+
/** Substitute the values of this call into a template of {@link ElicitationText}
|
|
3
|
+
* (one rule for every backend: `shared/localized-text.ts`). */
|
|
4
|
+
const fill = fillTemplate;
|
|
2
5
|
const rec = (value) => typeof value === 'object' && value !== null && !Array.isArray(value) ? value : undefined;
|
|
3
6
|
const str = (value) => typeof value === 'string' ? value : undefined;
|
|
4
7
|
const num = (value) => typeof value === 'number' && Number.isFinite(value) ? value : undefined;
|
|
@@ -86,20 +89,20 @@ function calendarDay(year, month, day) {
|
|
|
86
89
|
return day <= length;
|
|
87
90
|
}
|
|
88
91
|
/** Validate one typed value against its field; the value or the reason. */
|
|
89
|
-
export function parseFieldText(field, text) {
|
|
92
|
+
export function parseFieldText(field, text, elicit) {
|
|
90
93
|
const schema = field.schema;
|
|
91
94
|
if (field.kind === 'number' || field.kind === 'integer') {
|
|
92
95
|
const value = Number(text);
|
|
93
96
|
if (text.trim() === '' || !Number.isFinite(value))
|
|
94
|
-
return { error:
|
|
97
|
+
return { error: elicit.invalidNumber };
|
|
95
98
|
if (field.kind === 'integer' && !Number.isInteger(value))
|
|
96
|
-
return { error:
|
|
99
|
+
return { error: elicit.invalidInteger };
|
|
97
100
|
const min = num(schema.minimum);
|
|
98
101
|
const max = num(schema.maximum);
|
|
99
102
|
if (min !== undefined && value < min)
|
|
100
|
-
return { error:
|
|
103
|
+
return { error: fill(elicit.invalidMin, { min }) };
|
|
101
104
|
if (max !== undefined && value > max)
|
|
102
|
-
return { error:
|
|
105
|
+
return { error: fill(elicit.invalidMax, { max }) };
|
|
103
106
|
return { value };
|
|
104
107
|
}
|
|
105
108
|
if (field.kind === 'json') {
|
|
@@ -108,7 +111,7 @@ export function parseFieldText(field, text) {
|
|
|
108
111
|
value = JSON.parse(text);
|
|
109
112
|
}
|
|
110
113
|
catch {
|
|
111
|
-
return { error:
|
|
114
|
+
return { error: elicit.invalidJson };
|
|
112
115
|
}
|
|
113
116
|
const type = str(schema.type);
|
|
114
117
|
const fits = type === 'array'
|
|
@@ -116,33 +119,33 @@ export function parseFieldText(field, text) {
|
|
|
116
119
|
: type === 'object' ? false : typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';
|
|
117
120
|
// An MCP form value is a string, number, boolean or string array.
|
|
118
121
|
if (!fits)
|
|
119
|
-
return { error:
|
|
122
|
+
return { error: elicit.invalidJson };
|
|
120
123
|
return { value: value };
|
|
121
124
|
}
|
|
122
125
|
const length = [...text].length;
|
|
123
126
|
const minLength = num(schema.minLength);
|
|
124
127
|
const maxLength = num(schema.maxLength);
|
|
125
128
|
if (minLength !== undefined && length < minLength)
|
|
126
|
-
return { error:
|
|
129
|
+
return { error: fill(elicit.invalidMinLength, { n: minLength }) };
|
|
127
130
|
if (maxLength !== undefined && length > maxLength)
|
|
128
|
-
return { error:
|
|
131
|
+
return { error: fill(elicit.invalidMaxLength, { n: maxLength }) };
|
|
129
132
|
switch (str(schema.format)) {
|
|
130
133
|
case 'email':
|
|
131
134
|
if (!EMAIL.test(text))
|
|
132
|
-
return { error:
|
|
135
|
+
return { error: elicit.invalidEmail };
|
|
133
136
|
break;
|
|
134
137
|
case 'uri':
|
|
135
138
|
try {
|
|
136
139
|
new URL(text);
|
|
137
140
|
}
|
|
138
141
|
catch {
|
|
139
|
-
return { error:
|
|
142
|
+
return { error: elicit.invalidUri };
|
|
140
143
|
}
|
|
141
144
|
break;
|
|
142
145
|
case 'date': {
|
|
143
146
|
const match = DATE.exec(text);
|
|
144
147
|
if (match === null || !calendarDay(Number(match[1]), Number(match[2]), Number(match[3])))
|
|
145
|
-
return { error:
|
|
148
|
+
return { error: elicit.invalidDate };
|
|
146
149
|
break;
|
|
147
150
|
}
|
|
148
151
|
case 'date-time': {
|
|
@@ -155,7 +158,7 @@ export function parseFieldText(field, text) {
|
|
|
155
158
|
|| !calendarDay(Number(match[1]), Number(match[2]), Number(match[3]))
|
|
156
159
|
|| Number(match[4]) > 23 || Number(match[5]) > 59 || Number(match[6]) > 60
|
|
157
160
|
|| Number(match[7]) > 23 || Number(match[8]) > 59)
|
|
158
|
-
return { error:
|
|
161
|
+
return { error: elicit.invalidDateTime };
|
|
159
162
|
break;
|
|
160
163
|
}
|
|
161
164
|
default:
|
|
@@ -171,50 +174,48 @@ export function parseFieldText(field, text) {
|
|
|
171
174
|
// A pattern this runtime cannot compile is the server's to check.
|
|
172
175
|
}
|
|
173
176
|
if (!matches)
|
|
174
|
-
return { error:
|
|
177
|
+
return { error: elicit.invalidPattern };
|
|
175
178
|
}
|
|
176
179
|
return { value: text };
|
|
177
180
|
}
|
|
178
181
|
/** A short constraint hint for a free-text field (shown under the question). */
|
|
179
|
-
function constraintHint(field) {
|
|
182
|
+
function constraintHint(field, elicit) {
|
|
180
183
|
const schema = field.schema;
|
|
181
184
|
switch (field.kind) {
|
|
182
185
|
case 'number':
|
|
183
186
|
case 'integer': {
|
|
184
187
|
const min = num(schema.minimum);
|
|
185
188
|
const max = num(schema.maximum);
|
|
186
|
-
const kind =
|
|
189
|
+
const kind = field.kind === 'integer' ? elicit.kindInteger : elicit.kindNumber;
|
|
187
190
|
if (min !== undefined && max !== undefined)
|
|
188
|
-
return
|
|
191
|
+
return fill(elicit.hintRange, { kind, min, max });
|
|
189
192
|
if (min !== undefined)
|
|
190
|
-
return
|
|
193
|
+
return fill(elicit.hintMin, { kind, min });
|
|
191
194
|
if (max !== undefined)
|
|
192
|
-
return
|
|
195
|
+
return fill(elicit.hintMax, { kind, max });
|
|
193
196
|
return kind;
|
|
194
197
|
}
|
|
195
198
|
case 'json':
|
|
196
|
-
return
|
|
199
|
+
return elicit.hintJson;
|
|
197
200
|
case 'text': {
|
|
198
201
|
const format = str(schema.format);
|
|
199
|
-
return format === undefined ? undefined :
|
|
202
|
+
return format === undefined ? undefined : fill(elicit.hintFormat, { format });
|
|
200
203
|
}
|
|
201
204
|
default:
|
|
202
205
|
return undefined;
|
|
203
206
|
}
|
|
204
207
|
}
|
|
205
|
-
/** The current language's form labels. */
|
|
206
|
-
export const formLabels = () => ({ skip: t('elicit-skip'), yes: t('elicit-yes'), no: t('elicit-no') });
|
|
207
208
|
/** A field's question (with the reason it is asked again, if any). */
|
|
208
|
-
export function fieldQuestion(field, header, lead, error,
|
|
209
|
-
const skip =
|
|
209
|
+
export function fieldQuestion(field, header, lead, error, elicit) {
|
|
210
|
+
const skip = elicit.skip;
|
|
210
211
|
const detail = [
|
|
211
|
-
error === undefined ? undefined :
|
|
212
|
+
error === undefined ? undefined : fill(elicit.invalid, { reason: error }),
|
|
212
213
|
lead,
|
|
213
214
|
field.description,
|
|
214
|
-
constraintHint(field),
|
|
215
|
+
constraintHint(field, elicit),
|
|
215
216
|
].filter((line) => line !== undefined && line !== '').join('\n');
|
|
216
|
-
const question = field.required ? field.title :
|
|
217
|
-
const optional = field.required ? [] : [{ label: skip, description:
|
|
217
|
+
const question = field.required ? field.title : fill(elicit.optional, { title: field.title });
|
|
218
|
+
const optional = field.required ? [] : [{ label: skip, description: elicit.skipDesc }];
|
|
218
219
|
const defaults = (labels) => labels.length === 0 ? {} : { defaultSelected: labels };
|
|
219
220
|
const base = { question, header, ...(detail === '' ? {} : { detail }) };
|
|
220
221
|
switch (field.kind) {
|
|
@@ -223,7 +224,7 @@ export function fieldQuestion(field, header, lead, error, labels = formLabels())
|
|
|
223
224
|
return { ...base, options: [...field.choices.map(choice => ({ label: choice.label })), ...optional], hideCustomInput: true, ...defaults(field.choices.filter(choice => choice.value === fallback).map(choice => choice.label)) };
|
|
224
225
|
}
|
|
225
226
|
case 'boolean': {
|
|
226
|
-
const { yes, no } =
|
|
227
|
+
const { yes, no } = elicit;
|
|
227
228
|
const fallback = field.schema.default;
|
|
228
229
|
return { ...base, options: [{ label: yes }, { label: no }, ...optional], hideCustomInput: true, ...defaults(fallback === true ? [yes] : fallback === false ? [no] : []) };
|
|
229
230
|
}
|
|
@@ -236,40 +237,40 @@ export function fieldQuestion(field, header, lead, error, labels = formLabels())
|
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
239
|
/** One answered field: its value, `skip`, or why it is invalid. */
|
|
239
|
-
export function fieldValue(field, answer,
|
|
240
|
+
export function fieldValue(field, answer, elicit) {
|
|
240
241
|
const selected = answer?.selected ?? [];
|
|
241
242
|
const custom = answer?.custom?.trim() ?? '';
|
|
242
|
-
const skip =
|
|
243
|
+
const skip = elicit.skip;
|
|
243
244
|
const skipped = selected.includes(skip);
|
|
244
245
|
switch (field.kind) {
|
|
245
246
|
case 'choice': {
|
|
246
247
|
const choice = field.choices.find(item => item.label === selected[0]);
|
|
247
248
|
if (choice !== undefined)
|
|
248
249
|
return { value: choice.value };
|
|
249
|
-
return skipped && !field.required ? { skip: true } : { error:
|
|
250
|
+
return skipped && !field.required ? { skip: true } : { error: elicit.invalidChoice };
|
|
250
251
|
}
|
|
251
252
|
case 'boolean':
|
|
252
|
-
if (selected[0] ===
|
|
253
|
+
if (selected[0] === elicit.yes)
|
|
253
254
|
return { value: true };
|
|
254
|
-
if (selected[0] ===
|
|
255
|
+
if (selected[0] === elicit.no)
|
|
255
256
|
return { value: false };
|
|
256
|
-
return skipped && !field.required ? { skip: true } : { error:
|
|
257
|
+
return skipped && !field.required ? { skip: true } : { error: elicit.invalidChoice };
|
|
257
258
|
case 'multi': {
|
|
258
259
|
const values = field.choices.filter(choice => selected.includes(choice.label)).map(choice => choice.value);
|
|
259
260
|
if (values.length === 0)
|
|
260
|
-
return skipped && !field.required ? { skip: true } : { error:
|
|
261
|
+
return skipped && !field.required ? { skip: true } : { error: elicit.invalidChoice };
|
|
261
262
|
const min = num(field.schema.minItems);
|
|
262
263
|
const max = num(field.schema.maxItems);
|
|
263
264
|
if (min !== undefined && values.length < min)
|
|
264
|
-
return { error:
|
|
265
|
+
return { error: fill(elicit.invalidMinItems, { n: min }) };
|
|
265
266
|
if (max !== undefined && values.length > max)
|
|
266
|
-
return { error:
|
|
267
|
+
return { error: fill(elicit.invalidMaxItems, { n: max }) };
|
|
267
268
|
return { value: values };
|
|
268
269
|
}
|
|
269
270
|
default:
|
|
270
271
|
if (custom === '')
|
|
271
|
-
return skipped && !field.required ? { skip: true } : { error:
|
|
272
|
-
return parseFieldText(field, custom);
|
|
272
|
+
return skipped && !field.required ? { skip: true } : { error: elicit.invalidRequired };
|
|
273
|
+
return parseFieldText(field, custom, elicit);
|
|
273
274
|
}
|
|
274
275
|
}
|
|
275
276
|
/** A short server label for the panel header chip. */
|
|
@@ -283,18 +284,17 @@ export function serverHeader(name) {
|
|
|
283
284
|
* send / decline choice is asked once, after the first round; a re-ask
|
|
284
285
|
* keeps the values already accepted and replaces the re-asked ones.
|
|
285
286
|
*/
|
|
286
|
-
export function createElicitationForm(request) {
|
|
287
|
+
export function createElicitationForm(request, elicit) {
|
|
287
288
|
const fields = formFields(request.requestedSchema);
|
|
288
289
|
const header = serverHeader(request.displayName ?? request.serverName);
|
|
289
290
|
const lead = [request.title, request.message].filter((line) => line !== undefined && line.trim() !== '').join('\n');
|
|
290
|
-
const send =
|
|
291
|
-
const decline =
|
|
292
|
-
const labels = formLabels();
|
|
291
|
+
const send = elicit.send;
|
|
292
|
+
const decline = elicit.decline;
|
|
293
293
|
const confirm = {
|
|
294
|
-
question:
|
|
294
|
+
question: fill(elicit.confirm, { server: request.serverName }),
|
|
295
295
|
header,
|
|
296
296
|
...(fields.length === 0 && lead !== '' ? { detail: lead } : {}),
|
|
297
|
-
options: [{ label: send, description:
|
|
297
|
+
options: [{ label: send, description: elicit.sendDesc }, { label: decline, description: elicit.declineDesc }],
|
|
298
298
|
hideCustomInput: true,
|
|
299
299
|
};
|
|
300
300
|
const values = new Map();
|
|
@@ -302,7 +302,7 @@ export function createElicitationForm(request) {
|
|
|
302
302
|
let asked = fields;
|
|
303
303
|
let sending = false;
|
|
304
304
|
return {
|
|
305
|
-
questions: [...fields.map((field, index) => fieldQuestion(field, header, index === 0 ? lead : undefined, undefined,
|
|
305
|
+
questions: [...fields.map((field, index) => fieldQuestion(field, header, index === 0 ? lead : undefined, undefined, elicit)), confirm],
|
|
306
306
|
answer: answers => {
|
|
307
307
|
if (!sending) {
|
|
308
308
|
const choice = answers.answers[asked.length]?.selected[0];
|
|
@@ -312,7 +312,7 @@ export function createElicitationForm(request) {
|
|
|
312
312
|
}
|
|
313
313
|
const invalid = [];
|
|
314
314
|
asked.forEach((field, index) => {
|
|
315
|
-
const outcome = fieldValue(field, answers.answers[index],
|
|
315
|
+
const outcome = fieldValue(field, answers.answers[index], elicit);
|
|
316
316
|
if ('error' in outcome)
|
|
317
317
|
invalid.push({ field, error: outcome.error });
|
|
318
318
|
else if ('skip' in outcome)
|
|
@@ -322,39 +322,37 @@ export function createElicitationForm(request) {
|
|
|
322
322
|
});
|
|
323
323
|
if (invalid.length > 0) {
|
|
324
324
|
asked = invalid.map(item => item.field);
|
|
325
|
-
return { kind: 'reask', questions: invalid.map(item => fieldQuestion(item.field, header, undefined, item.error,
|
|
325
|
+
return { kind: 'reask', questions: invalid.map(item => fieldQuestion(item.field, header, undefined, item.error, elicit)) };
|
|
326
326
|
}
|
|
327
327
|
return { kind: 'accept', content: Object.fromEntries(values) };
|
|
328
328
|
},
|
|
329
329
|
};
|
|
330
330
|
}
|
|
331
331
|
/** The URL-mode question; undefined when the request names no URL. */
|
|
332
|
-
export function createElicitationUrlAsk(request) {
|
|
332
|
+
export function createElicitationUrlAsk(request, elicit) {
|
|
333
333
|
const target = request.url;
|
|
334
334
|
if (target === undefined || target.trim() === '')
|
|
335
335
|
return undefined;
|
|
336
|
-
const accept =
|
|
336
|
+
const accept = elicit.urlAccept;
|
|
337
337
|
const message = request.message ?? '';
|
|
338
338
|
return {
|
|
339
339
|
questions: [{
|
|
340
|
-
question: message.trim() === '' ?
|
|
340
|
+
question: message.trim() === '' ? fill(elicit.urlQuestion, { server: request.serverName }) : message,
|
|
341
341
|
header: serverHeader(request.displayName ?? request.serverName),
|
|
342
|
-
detail:
|
|
342
|
+
detail: elicit.urlDetail,
|
|
343
343
|
link: target,
|
|
344
|
-
options: [{ label: accept, description:
|
|
344
|
+
options: [{ label: accept, description: elicit.urlAcceptDesc }, { label: elicit.decline, description: elicit.declineDesc }],
|
|
345
345
|
hideCustomInput: true,
|
|
346
346
|
}],
|
|
347
347
|
accepted: answers => answers.answers[0]?.selected[0] === accept,
|
|
348
348
|
};
|
|
349
349
|
}
|
|
350
350
|
/** The notice texts a backend shows around an elicitation. */
|
|
351
|
-
export
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
unsupported: (server, mode) => t('elicit-unsupported', { server, mode }),
|
|
360
|
-
};
|
|
351
|
+
export function elicitationNotices(elicit) {
|
|
352
|
+
return {
|
|
353
|
+
urlOpen: (server, url) => fill(elicit.urlNotice, { server, url }),
|
|
354
|
+
urlComplete: server => fill(elicit.urlComplete, { server }),
|
|
355
|
+
urlMissing: server => fill(elicit.urlMissing, { server }),
|
|
356
|
+
unsupported: (server, mode) => fill(elicit.unsupported, { server, mode }),
|
|
357
|
+
};
|
|
358
|
+
}
|