@deepseek-harness-tui/dsh-tui 0.9.2 → 0.10.0-beta.1
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 +27 -9
- package/bin/dsh-tui.js +26 -4
- package/cordis.patch.yml +117 -39
- package/cordis.yml +13 -10
- package/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -13
- package/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -59
- package/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -15
- package/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -32
- package/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -59
- package/dsh-ecosystem-spec/protocols/tui-channel.js +166 -166
- package/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -42
- package/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -143
- package/dsh-ecosystem-spec/registry/README.md +14 -14
- package/dsh-ecosystem-spec/registry/host-descriptor.tui.example.json +56 -56
- package/dsh-ecosystem-spec/registry/permissions-0.1.json +13 -13
- package/dsh-ecosystem-spec/registry/registry-0.15.json +149 -149
- package/lib/types/api.d.ts +7 -0
- package/lib/types/api.d.ts.map +1 -0
- package/lib/types/api.js +1 -0
- package/lib/types/cc/hyperlink.d.ts.map +1 -1
- package/lib/types/cc/hyperlink.js +42 -4
- package/lib/types/cc/markdown.d.ts.map +1 -1
- package/lib/types/cc/markdown.js +15 -5
- package/lib/types/commands.d.ts +6 -0
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +13 -10
- package/lib/types/components/BalanceReportRow.d.ts +24 -0
- package/lib/types/components/BalanceReportRow.d.ts.map +1 -0
- package/lib/types/components/BalanceReportRow.js +87 -0
- package/lib/types/components/HistorySearchDialog.js +1 -1
- package/lib/types/components/MessageList.d.ts +6 -4
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +36 -31
- package/lib/types/components/PermissionsPicker.d.ts +6 -7
- package/lib/types/components/PermissionsPicker.d.ts.map +1 -1
- package/lib/types/components/PermissionsPicker.js +20 -14
- package/lib/types/components/PluginSceneBoundary.d.ts +1 -1
- package/lib/types/components/PluginSceneBoundary.js +1 -1
- package/lib/types/components/PromptEditor.d.ts +46 -0
- package/lib/types/components/PromptEditor.d.ts.map +1 -0
- package/lib/types/components/PromptEditor.js +60 -0
- package/lib/types/components/PromptInput.d.ts +12 -0
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +1256 -205
- package/lib/types/components/RewindPicker.js +1 -1
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
- package/lib/types/components/StreamingMarkdown.js +140 -3
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +2 -2
- package/lib/types/components/SubagentDetailScene.js +1 -1
- package/lib/types/components/ThemePicker.d.ts +13 -15
- package/lib/types/components/ThemePicker.d.ts.map +1 -1
- package/lib/types/components/ThemePicker.js +24 -26
- package/lib/types/components/Tooltip.d.ts +67 -0
- package/lib/types/components/Tooltip.d.ts.map +1 -0
- package/lib/types/components/Tooltip.js +220 -0
- package/lib/types/components/Whale.d.ts +15 -4
- package/lib/types/components/Whale.d.ts.map +1 -1
- package/lib/types/components/Whale.js +9 -8
- package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
- package/lib/types/components/approvals/ApprovalPanel.js +1 -1
- package/lib/types/components/design-system/Divider.d.ts +9 -1
- package/lib/types/components/design-system/Divider.d.ts.map +1 -1
- package/lib/types/components/design-system/Divider.js +42 -8
- package/lib/types/components/design-system/ThemeProvider.d.ts +5 -2
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +52 -16
- package/lib/types/components/design-system/ThemedBox.d.ts +23 -2
- package/lib/types/components/design-system/ThemedBox.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +5 -5
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +4 -4
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +7 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +48 -7
- package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -1
- package/lib/types/components/messages/UserPromptMessage.js +7 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +1 -1
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +29 -3
- package/lib/types/components/sessions/SessionListRow.d.ts +8 -1
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionListRow.js +9 -2
- package/lib/types/components/sessions/SessionPreview.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionPreview.js +5 -3
- package/lib/types/components/sessions/WorkspaceListRow.d.ts +17 -0
- package/lib/types/components/sessions/WorkspaceListRow.d.ts.map +1 -0
- package/lib/types/components/sessions/WorkspaceListRow.js +27 -0
- package/lib/types/customTheme.d.ts +4 -0
- package/lib/types/customTheme.d.ts.map +1 -1
- package/lib/types/customTheme.js +9 -5
- package/lib/types/deepseekBalance.d.ts +53 -0
- package/lib/types/deepseekBalance.d.ts.map +1 -0
- package/lib/types/deepseekBalance.js +86 -0
- package/lib/types/deepseekPricing.d.ts +82 -0
- package/lib/types/deepseekPricing.d.ts.map +1 -0
- package/lib/types/deepseekPricing.js +133 -0
- package/lib/types/dsh-adapter/approvals.d.ts +114 -2
- package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
- package/lib/types/dsh-adapter/approvals.js +241 -3
- package/lib/types/dsh-adapter/channel.d.ts +88 -3
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +567 -89
- package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -1
- package/lib/types/dsh-adapter/childStderr.js +9 -0
- package/lib/types/dsh-adapter/contract.d.ts +17 -13
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +36 -27
- package/lib/types/dsh-adapter/credentialRefGuard.d.ts +40 -0
- package/lib/types/dsh-adapter/credentialRefGuard.d.ts.map +1 -0
- package/lib/types/dsh-adapter/credentialRefGuard.js +43 -0
- package/lib/types/dsh-adapter/effect-ledger.d.ts +1 -1
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
- package/lib/types/dsh-adapter/effect-ledger.js +1 -0
- package/lib/types/dsh-adapter/extensions.d.ts +4 -1
- package/lib/types/dsh-adapter/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/extensions.js +8 -1
- package/lib/types/dsh-adapter/index.d.ts +11 -1
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +2 -0
- package/lib/types/dsh-adapter/plugin-test-utils.d.ts +62 -0
- package/lib/types/dsh-adapter/plugin-test-utils.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-test-utils.js +61 -0
- package/lib/types/dsh-adapter/plugin.d.ts +26 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +279 -56
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +12 -0
- package/lib/types/dsh-adapter/preset-resolution.d.ts +49 -0
- package/lib/types/dsh-adapter/preset-resolution.d.ts.map +1 -0
- package/lib/types/dsh-adapter/preset-resolution.js +42 -0
- package/lib/types/dsh-adapter/presets.d.ts +0 -26
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +4 -14
- package/lib/types/dsh-adapter/promptDebug.d.ts.map +1 -1
- package/lib/types/dsh-adapter/promptDebug.js +4 -1
- package/lib/types/dsh-adapter/providerGuard.d.ts +75 -0
- package/lib/types/dsh-adapter/providerGuard.d.ts.map +1 -0
- package/lib/types/dsh-adapter/providerGuard.js +104 -0
- package/lib/types/dsh-adapter/questions-answerer.d.ts +49 -0
- package/lib/types/dsh-adapter/questions-answerer.d.ts.map +1 -0
- package/lib/types/dsh-adapter/questions-answerer.js +61 -0
- package/lib/types/dsh-adapter/recap.d.ts.map +1 -1
- package/lib/types/dsh-adapter/recap.js +12 -6
- package/lib/types/dsh-adapter/sanitize.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sanitize.js +6 -1
- package/lib/types/dsh-adapter/sessions/digest.d.ts +21 -1
- package/lib/types/dsh-adapter/sessions/digest.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/digest.js +229 -3
- package/lib/types/dsh-adapter/sessions/frames.d.ts +3 -0
- package/lib/types/dsh-adapter/sessions/frames.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/frames.js +34 -19
- package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/list.js +148 -31
- package/lib/types/dsh-adapter/sessions/store.d.ts +8 -0
- package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/store.js +24 -4
- package/lib/types/dsh-adapter/sessions/types.d.ts +3 -0
- package/lib/types/dsh-adapter/sessions/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.d.ts +1 -0
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +48 -3
- package/lib/types/dsh-adapter/settingsEditor.d.ts +6 -0
- package/lib/types/dsh-adapter/settingsEditor.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settingsEditor.js +15 -3
- package/lib/types/dsh-adapter/subagents.d.ts +4 -0
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +8 -0
- package/lib/types/dsh-adapter/themes.d.ts +51 -0
- package/lib/types/dsh-adapter/themes.d.ts.map +1 -0
- package/lib/types/dsh-adapter/themes.js +272 -0
- package/lib/types/dsh-adapter/toast.d.ts +67 -0
- package/lib/types/dsh-adapter/toast.d.ts.map +1 -0
- package/lib/types/dsh-adapter/toast.js +141 -0
- package/lib/types/dsh-adapter/types.d.ts +1 -1
- package/lib/types/extensions.d.ts +4 -0
- package/lib/types/extensions.d.ts.map +1 -1
- package/lib/types/extensions.js +5 -1
- package/lib/types/history.d.ts +4 -3
- package/lib/types/history.d.ts.map +1 -1
- package/lib/types/history.js +71 -18
- package/lib/types/hooks/useRuntimeThemeSnapshot.d.ts +10 -0
- package/lib/types/hooks/useRuntimeThemeSnapshot.d.ts.map +1 -0
- package/lib/types/hooks/useRuntimeThemeSnapshot.js +32 -0
- package/lib/types/i18n.d.ts +319 -94
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +118 -35
- package/lib/types/ink/components/App.d.ts +20 -0
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +142 -13
- package/lib/types/ink/components/Box.d.ts +39 -2
- package/lib/types/ink/components/Box.d.ts.map +1 -1
- package/lib/types/ink/components/Box.js +61 -37
- package/lib/types/ink/events/context-menu-event.d.ts +19 -0
- package/lib/types/ink/events/context-menu-event.d.ts.map +1 -0
- package/lib/types/ink/events/context-menu-event.js +20 -0
- package/lib/types/ink/events/drag-event.d.ts +44 -0
- package/lib/types/ink/events/drag-event.d.ts.map +1 -0
- package/lib/types/ink/events/drag-event.js +39 -0
- package/lib/types/ink/events/event-handlers.d.ts +8 -0
- package/lib/types/ink/events/event-handlers.d.ts.map +1 -1
- package/lib/types/ink/events/event-handlers.js +8 -0
- package/lib/types/ink/hit-test.d.ts +69 -0
- package/lib/types/ink/hit-test.d.ts.map +1 -1
- package/lib/types/ink/hit-test.js +260 -6
- package/lib/types/ink/ink.d.ts +25 -0
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +141 -27
- package/lib/types/ink/parse-keypress.d.ts +2 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +12 -15
- package/lib/types/ink/renderer.d.ts.map +1 -1
- package/lib/types/ink/renderer.js +7 -0
- package/lib/types/ink/root.d.ts +16 -0
- package/lib/types/ink/root.d.ts.map +1 -1
- package/lib/types/ink/root.js +2 -0
- package/lib/types/ink/screen.d.ts +7 -0
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/screen.js +8 -1
- package/lib/types/ink/terminal-querier.d.ts +8 -0
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +13 -0
- package/lib/types/ink/terminal.d.ts +42 -0
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +52 -2
- package/lib/types/ink/termio/osc.d.ts +2 -1
- package/lib/types/ink/termio/osc.d.ts.map +1 -1
- package/lib/types/ink/termio/osc.js +26 -5
- package/lib/types/plugin-spec/registry.d.ts +1 -1
- package/lib/types/plugin-spec/registry.js +1 -1
- package/lib/types/presetPrefs.d.ts +6 -5
- package/lib/types/presetPrefs.d.ts.map +1 -1
- package/lib/types/presetPrefs.js +10 -5
- package/lib/types/screens/Chat.d.ts +4 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +240 -104
- package/lib/types/screens/SessionBrowser.d.ts +9 -4
- package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
- package/lib/types/screens/SessionBrowser.js +497 -74
- package/lib/types/screens/SessionTree.d.ts.map +1 -1
- package/lib/types/screens/SessionTree.js +37 -9
- package/lib/types/screens/Settings.d.ts +7 -5
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +211 -100
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +37 -2
- package/lib/types/screens/chatOverlay.d.ts +3 -2
- package/lib/types/screens/chatOverlay.d.ts.map +1 -1
- package/lib/types/screens/chatOverlay.js +2 -0
- package/lib/types/sessionHistory.d.ts +11 -0
- package/lib/types/sessionHistory.d.ts.map +1 -1
- package/lib/types/sessionHistory.js +29 -0
- package/lib/types/sessionPins.d.ts +33 -0
- package/lib/types/sessionPins.d.ts.map +1 -0
- package/lib/types/sessionPins.js +181 -0
- package/lib/types/sessions/format.d.ts +2 -0
- package/lib/types/sessions/format.d.ts.map +1 -1
- package/lib/types/sessions/format.js +23 -4
- package/lib/types/sessions/view.d.ts +42 -6
- package/lib/types/sessions/view.d.ts.map +1 -1
- package/lib/types/sessions/view.js +133 -35
- package/lib/types/test-utils.d.ts +2 -0
- package/lib/types/test-utils.d.ts.map +1 -0
- package/lib/types/test-utils.js +8 -0
- package/lib/types/theme.d.ts +22 -5
- package/lib/types/theme.d.ts.map +1 -1
- package/lib/types/theme.js +57 -7
- package/lib/types/themeCatalog.d.ts +36 -0
- package/lib/types/themeCatalog.d.ts.map +1 -0
- package/lib/types/themeCatalog.js +157 -0
- package/lib/types/tips.d.ts.map +1 -1
- package/lib/types/tips.js +115 -19
- package/lib/types/tuiDisplayPrefs.d.ts +3 -0
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +1 -0
- package/lib/types/update.d.ts +202 -0
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +716 -6
- package/lib/types/utils/debug.d.ts.map +1 -1
- package/lib/types/utils/debug.js +2 -1
- package/lib/types/utils/keymap.d.ts +1 -1
- package/lib/types/utils/keymap.d.ts.map +1 -1
- package/lib/types/utils/keymap.js +19 -2
- package/lib/types/utils/urlGuard.d.ts +28 -0
- package/lib/types/utils/urlGuard.d.ts.map +1 -0
- package/lib/types/utils/urlGuard.js +21 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/LICENSE +21 -21
- package/node_modules/@deepseek-harness-tui/dsh-auth/README.md +3 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/dsh-plugin.json +44 -44
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/credentials.d.ts +7 -11
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/index.d.ts +16 -1
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/index.js +23 -2
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/interaction.d.ts +5 -5
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/pi-ai.d.ts +23 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/pi-ai.js +27 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/profiles.d.ts +17 -3
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/profiles.js +36 -4
- package/node_modules/@deepseek-harness-tui/dsh-auth/package.json +11 -12
- package/node_modules/@dsh-std/command/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/command/LICENSE +21 -21
- package/node_modules/@dsh-std/command/README.md +26 -26
- package/node_modules/@dsh-std/command/README.zh.md +28 -28
- package/node_modules/@dsh-std/command/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/command/package.json +22 -22
- package/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/connection/LICENSE +21 -21
- package/node_modules/@dsh-std/connection/README.md +42 -42
- package/node_modules/@dsh-std/connection/README.zh.md +42 -42
- package/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
- package/node_modules/@dsh-std/connection/package.json +20 -20
- package/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/core/LICENSE +21 -21
- package/node_modules/@dsh-std/core/README.md +13 -13
- package/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/core/package.json +21 -21
- package/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
- package/node_modules/@dsh-std/manifest/LICENSE +21 -21
- package/node_modules/@dsh-std/manifest/README.md +5 -5
- package/node_modules/@dsh-std/manifest/README.zh.md +5 -5
- package/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/manifest/package.json +20 -20
- package/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
- package/node_modules/@dsh-std/messages/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/messages/LICENSE +21 -21
- package/node_modules/@dsh-std/messages/README.md +5 -5
- package/node_modules/@dsh-std/messages/README.zh.md +7 -7
- package/node_modules/@dsh-std/messages/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/messages/package.json +20 -20
- package/node_modules/@dsh-std/messages/schema/message-observer-envelope-0.15.schema.json +54 -54
- package/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
- package/node_modules/@dsh-std/presentation/LICENSE +21 -21
- package/node_modules/@dsh-std/presentation/README.md +27 -27
- package/node_modules/@dsh-std/presentation/README.zh.md +29 -29
- package/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
- package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/presentation/package.json +25 -25
- package/node_modules/@dsh-std/storage/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/storage/LICENSE +21 -21
- package/node_modules/@dsh-std/storage/README.md +5 -5
- package/node_modules/@dsh-std/storage/README.zh.md +7 -7
- package/node_modules/@dsh-std/storage/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/storage/package.json +20 -20
- package/node_modules/@dsh-std/storage/schema/local-storage-0.15.schema.json +56 -56
- package/package.json +204 -75
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.md +42 -42
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.zh.md +42 -42
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +20 -20
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.md +5 -5
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.zh.md +5 -5
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +20 -20
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +27 -27
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +29 -29
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +25 -25
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/LICENSE +21 -21
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.md +42 -42
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.zh.md +42 -42
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +20 -20
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +21 -21
- package/lib/types/dsh-adapter/packaged-skills.d.ts +0 -10
- package/lib/types/dsh-adapter/packaged-skills.d.ts.map +0 -1
- package/lib/types/dsh-adapter/packaged-skills.js +0 -63
- package/skills/audit/SKILL.md +0 -24
- package/skills/bug/SKILL.md +0 -27
- package/skills/pr-comments/SKILL.md +0 -20
- package/skills/practice/SKILL.md +0 -22
- package/skills/release-notes/SKILL.md +0 -25
- package/skills/review/SKILL.md +0 -25
- package/skills/vuln-check/SKILL.md +0 -25
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export const TUI_CHANNEL_HTTP_API_VERSION = 'tui.dsh/v1alpha1'
|
|
2
|
-
export const TUI_CHANNEL_HTTP_KIND = 'ChannelEndpoint'
|
|
3
|
-
export const TUI_CHANNEL_HTTP_HEALTH_PATH = '/dsh-tui/v1/health'
|
|
4
|
-
export const TUI_CHANNEL_HTTP_DESCRIPTOR_PATH = '/dsh-tui/v1/endpoint'
|
|
5
|
-
export const TUI_CHANNEL_HTTP_WEBSOCKET_PATH = '/dsh-tui/v1/connection'
|
|
6
|
-
|
|
7
|
-
export function createTuiChannelEndpointDescriptor(origin) {
|
|
8
|
-
const normalized = new URL(origin)
|
|
9
|
-
if (normalized.protocol !== 'http:' && normalized.protocol !== 'https:') {
|
|
10
|
-
throw new TypeError('TUI Channel endpoint origin must use http or https')
|
|
11
|
-
}
|
|
12
|
-
normalized.pathname = '/'
|
|
13
|
-
normalized.search = ''
|
|
14
|
-
normalized.hash = ''
|
|
15
|
-
return Object.freeze({
|
|
16
|
-
apiVersion: TUI_CHANNEL_HTTP_API_VERSION,
|
|
17
|
-
kind: TUI_CHANNEL_HTTP_KIND,
|
|
18
|
-
origin: normalized.toString().replace(/\/$/u, ''),
|
|
19
|
-
connection: TUI_CHANNEL_HTTP_WEBSOCKET_PATH,
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function validateTuiChannelEndpointDescriptor(value) {
|
|
24
|
-
if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError('TUI Channel endpoint descriptor must be an object')
|
|
25
|
-
if (value.apiVersion !== TUI_CHANNEL_HTTP_API_VERSION || value.kind !== TUI_CHANNEL_HTTP_KIND) {
|
|
26
|
-
throw new TypeError('TUI Channel endpoint descriptor version or kind is unsupported')
|
|
27
|
-
}
|
|
28
|
-
if (typeof value.origin !== 'string') throw new TypeError('TUI Channel endpoint origin must be a string')
|
|
29
|
-
createTuiChannelEndpointDescriptor(value.origin)
|
|
30
|
-
if (value.connection !== TUI_CHANNEL_HTTP_WEBSOCKET_PATH) throw new TypeError('TUI Channel endpoint connection path is unsupported')
|
|
31
|
-
return value
|
|
32
|
-
}
|
|
1
|
+
export const TUI_CHANNEL_HTTP_API_VERSION = 'tui.dsh/v1alpha1'
|
|
2
|
+
export const TUI_CHANNEL_HTTP_KIND = 'ChannelEndpoint'
|
|
3
|
+
export const TUI_CHANNEL_HTTP_HEALTH_PATH = '/dsh-tui/v1/health'
|
|
4
|
+
export const TUI_CHANNEL_HTTP_DESCRIPTOR_PATH = '/dsh-tui/v1/endpoint'
|
|
5
|
+
export const TUI_CHANNEL_HTTP_WEBSOCKET_PATH = '/dsh-tui/v1/connection'
|
|
6
|
+
|
|
7
|
+
export function createTuiChannelEndpointDescriptor(origin) {
|
|
8
|
+
const normalized = new URL(origin)
|
|
9
|
+
if (normalized.protocol !== 'http:' && normalized.protocol !== 'https:') {
|
|
10
|
+
throw new TypeError('TUI Channel endpoint origin must use http or https')
|
|
11
|
+
}
|
|
12
|
+
normalized.pathname = '/'
|
|
13
|
+
normalized.search = ''
|
|
14
|
+
normalized.hash = ''
|
|
15
|
+
return Object.freeze({
|
|
16
|
+
apiVersion: TUI_CHANNEL_HTTP_API_VERSION,
|
|
17
|
+
kind: TUI_CHANNEL_HTTP_KIND,
|
|
18
|
+
origin: normalized.toString().replace(/\/$/u, ''),
|
|
19
|
+
connection: TUI_CHANNEL_HTTP_WEBSOCKET_PATH,
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function validateTuiChannelEndpointDescriptor(value) {
|
|
24
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError('TUI Channel endpoint descriptor must be an object')
|
|
25
|
+
if (value.apiVersion !== TUI_CHANNEL_HTTP_API_VERSION || value.kind !== TUI_CHANNEL_HTTP_KIND) {
|
|
26
|
+
throw new TypeError('TUI Channel endpoint descriptor version or kind is unsupported')
|
|
27
|
+
}
|
|
28
|
+
if (typeof value.origin !== 'string') throw new TypeError('TUI Channel endpoint origin must be a string')
|
|
29
|
+
createTuiChannelEndpointDescriptor(value.origin)
|
|
30
|
+
if (value.connection !== TUI_CHANNEL_HTTP_WEBSOCKET_PATH) throw new TypeError('TUI Channel endpoint connection path is unsupported')
|
|
31
|
+
return value
|
|
32
|
+
}
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import type { ApiReference, ProtocolDefinition } from '@dsh-std/core'
|
|
2
|
-
|
|
3
|
-
export type JsonValue = null | boolean | number | string | readonly JsonValue[] | { readonly [key: string]: JsonValue }
|
|
4
|
-
|
|
5
|
-
export const TUI_CHANNEL: Readonly<ApiReference & {
|
|
6
|
-
apiVersion: 'tui.dsh/v1alpha1'
|
|
7
|
-
kind: 'Channel'
|
|
8
|
-
}>
|
|
9
|
-
export const TUI_CHANNEL_WIRE_REVISION: 6
|
|
10
|
-
export const TUI_CHANNEL_FEATURES: readonly string[]
|
|
11
|
-
|
|
12
|
-
export interface TuiChannelRequirementSpec {
|
|
13
|
-
readonly wireRevision: number
|
|
14
|
-
readonly features: readonly string[]
|
|
15
|
-
}
|
|
16
|
-
export interface TuiChannelSupportSpec extends TuiChannelRequirementSpec {}
|
|
17
|
-
|
|
18
|
-
export interface TuiChannelSnapshot {
|
|
19
|
-
readonly wireRevision: number
|
|
20
|
-
readonly channelId: string
|
|
21
|
-
readonly version: number
|
|
22
|
-
readonly state: Readonly<Record<string, JsonValue>>
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface TuiChannelWorkspaceFlowChoice {
|
|
26
|
-
readonly id: string
|
|
27
|
-
readonly label: string
|
|
28
|
-
readonly description?: string
|
|
29
|
-
readonly badge?: string
|
|
30
|
-
readonly action: string
|
|
31
|
-
readonly input?: {
|
|
32
|
-
readonly action: string
|
|
33
|
-
readonly initialValue?: string
|
|
34
|
-
readonly placeholder?: string
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type TuiChannelWorkspaceFlowResult =
|
|
39
|
-
| { readonly kind: 'target'; readonly target: import('./tui-contributions.js').WorkspaceTarget }
|
|
40
|
-
| { readonly kind: 'choices'; readonly title: string; readonly choices: readonly TuiChannelWorkspaceFlowChoice[] }
|
|
41
|
-
|
|
42
|
-
export type TuiChannelInput =
|
|
43
|
-
| { readonly operation: 'open'; readonly value: { readonly workspace?: string; readonly sessionId?: string; readonly options?: JsonValue } }
|
|
44
|
-
| { readonly operation: 'subscribe'; readonly value: { readonly channelId: string; readonly afterVersion: number } }
|
|
45
|
-
| { readonly operation: 'invoke'; readonly value: { readonly channelId: string; readonly method: string; readonly arguments: readonly JsonValue[] } }
|
|
46
|
-
| { readonly operation: 'close'; readonly value: { readonly channelId: string } }
|
|
47
|
-
|
|
48
|
-
export interface TuiChannelInvokeOutput {
|
|
49
|
-
readonly value: JsonValue
|
|
50
|
-
readonly valueDefined?: boolean
|
|
51
|
-
readonly snapshot?: TuiChannelSnapshot
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export const tuiChannelDefinition: ProtocolDefinition
|
|
55
|
-
export function validateTuiChannelRequirement(value: unknown): TuiChannelRequirementSpec
|
|
56
|
-
export function validateTuiChannelSupport(value: unknown): TuiChannelSupportSpec
|
|
57
|
-
export function validateTuiChannelInput(operation: string, value: unknown): object
|
|
58
|
-
export function validateTuiChannelSnapshot(value: unknown): TuiChannelSnapshot
|
|
59
|
-
export function validateTuiChannelOutput(operation: string, value: unknown): object
|
|
1
|
+
import type { ApiReference, ProtocolDefinition } from '@dsh-std/core'
|
|
2
|
+
|
|
3
|
+
export type JsonValue = null | boolean | number | string | readonly JsonValue[] | { readonly [key: string]: JsonValue }
|
|
4
|
+
|
|
5
|
+
export const TUI_CHANNEL: Readonly<ApiReference & {
|
|
6
|
+
apiVersion: 'tui.dsh/v1alpha1'
|
|
7
|
+
kind: 'Channel'
|
|
8
|
+
}>
|
|
9
|
+
export const TUI_CHANNEL_WIRE_REVISION: 6
|
|
10
|
+
export const TUI_CHANNEL_FEATURES: readonly string[]
|
|
11
|
+
|
|
12
|
+
export interface TuiChannelRequirementSpec {
|
|
13
|
+
readonly wireRevision: number
|
|
14
|
+
readonly features: readonly string[]
|
|
15
|
+
}
|
|
16
|
+
export interface TuiChannelSupportSpec extends TuiChannelRequirementSpec {}
|
|
17
|
+
|
|
18
|
+
export interface TuiChannelSnapshot {
|
|
19
|
+
readonly wireRevision: number
|
|
20
|
+
readonly channelId: string
|
|
21
|
+
readonly version: number
|
|
22
|
+
readonly state: Readonly<Record<string, JsonValue>>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface TuiChannelWorkspaceFlowChoice {
|
|
26
|
+
readonly id: string
|
|
27
|
+
readonly label: string
|
|
28
|
+
readonly description?: string
|
|
29
|
+
readonly badge?: string
|
|
30
|
+
readonly action: string
|
|
31
|
+
readonly input?: {
|
|
32
|
+
readonly action: string
|
|
33
|
+
readonly initialValue?: string
|
|
34
|
+
readonly placeholder?: string
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type TuiChannelWorkspaceFlowResult =
|
|
39
|
+
| { readonly kind: 'target'; readonly target: import('./tui-contributions.js').WorkspaceTarget }
|
|
40
|
+
| { readonly kind: 'choices'; readonly title: string; readonly choices: readonly TuiChannelWorkspaceFlowChoice[] }
|
|
41
|
+
|
|
42
|
+
export type TuiChannelInput =
|
|
43
|
+
| { readonly operation: 'open'; readonly value: { readonly workspace?: string; readonly sessionId?: string; readonly options?: JsonValue } }
|
|
44
|
+
| { readonly operation: 'subscribe'; readonly value: { readonly channelId: string; readonly afterVersion: number } }
|
|
45
|
+
| { readonly operation: 'invoke'; readonly value: { readonly channelId: string; readonly method: string; readonly arguments: readonly JsonValue[] } }
|
|
46
|
+
| { readonly operation: 'close'; readonly value: { readonly channelId: string } }
|
|
47
|
+
|
|
48
|
+
export interface TuiChannelInvokeOutput {
|
|
49
|
+
readonly value: JsonValue
|
|
50
|
+
readonly valueDefined?: boolean
|
|
51
|
+
readonly snapshot?: TuiChannelSnapshot
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const tuiChannelDefinition: ProtocolDefinition
|
|
55
|
+
export function validateTuiChannelRequirement(value: unknown): TuiChannelRequirementSpec
|
|
56
|
+
export function validateTuiChannelSupport(value: unknown): TuiChannelSupportSpec
|
|
57
|
+
export function validateTuiChannelInput(operation: string, value: unknown): object
|
|
58
|
+
export function validateTuiChannelSnapshot(value: unknown): TuiChannelSnapshot
|
|
59
|
+
export function validateTuiChannelOutput(operation: string, value: unknown): object
|
|
@@ -1,166 +1,166 @@
|
|
|
1
|
-
import { defineCapabilityProtocol } from '@dsh-std/connection'
|
|
2
|
-
|
|
3
|
-
export const TUI_CHANNEL = Object.freeze({
|
|
4
|
-
apiVersion: 'tui.dsh/v1alpha1',
|
|
5
|
-
kind: 'Channel',
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
export const TUI_CHANNEL_WIRE_REVISION = 6
|
|
9
|
-
|
|
10
|
-
export const TUI_CHANNEL_FEATURES = Object.freeze([
|
|
11
|
-
'commands',
|
|
12
|
-
'credentials',
|
|
13
|
-
'diagnostics',
|
|
14
|
-
'files',
|
|
15
|
-
'models',
|
|
16
|
-
'modes',
|
|
17
|
-
'presets',
|
|
18
|
-
'presentation',
|
|
19
|
-
'provider-setup',
|
|
20
|
-
'scenes',
|
|
21
|
-
'session-history',
|
|
22
|
-
'session-input',
|
|
23
|
-
'session-lifecycle',
|
|
24
|
-
'session-state',
|
|
25
|
-
'settings',
|
|
26
|
-
'skills',
|
|
27
|
-
'subagents',
|
|
28
|
-
'trace',
|
|
29
|
-
'workspaces',
|
|
30
|
-
])
|
|
31
|
-
|
|
32
|
-
export const tuiChannelDefinition = defineCapabilityProtocol({
|
|
33
|
-
...TUI_CHANNEL,
|
|
34
|
-
validateRequirement: validateTuiChannelRequirement,
|
|
35
|
-
validateSupport: validateTuiChannelSupport,
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
export function validateTuiChannelRequirement(value) {
|
|
39
|
-
const spec = exactRecord(value, ['wireRevision', 'features'], 'Channel requirement')
|
|
40
|
-
const wireRevision = positiveInteger(spec.wireRevision, 'Channel requirement.wireRevision')
|
|
41
|
-
const features = featureList(spec.features, 'Channel requirement.features')
|
|
42
|
-
return Object.freeze({ wireRevision, features })
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function validateTuiChannelSupport(value) {
|
|
46
|
-
const spec = exactRecord(value, ['wireRevision', 'features'], 'Channel support')
|
|
47
|
-
const wireRevision = positiveInteger(spec.wireRevision, 'Channel support.wireRevision')
|
|
48
|
-
const features = featureList(spec.features, 'Channel support.features')
|
|
49
|
-
return Object.freeze({ wireRevision, features })
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function validateTuiChannelInput(operation, value) {
|
|
53
|
-
switch (operation) {
|
|
54
|
-
case 'open': {
|
|
55
|
-
const input = exactRecord(value, ['workspace', 'sessionId', 'options'], 'Channel.open input')
|
|
56
|
-
optionalString(input.workspace, 'Channel.open input.workspace')
|
|
57
|
-
optionalString(input.sessionId, 'Channel.open input.sessionId')
|
|
58
|
-
if (input.options !== undefined) jsonValue(input.options, 'Channel.open input.options', new Set())
|
|
59
|
-
return input
|
|
60
|
-
}
|
|
61
|
-
case 'subscribe': {
|
|
62
|
-
const input = exactRecord(value, ['channelId', 'afterVersion'], 'Channel.subscribe input')
|
|
63
|
-
nonEmpty(input.channelId, 'Channel.subscribe input.channelId')
|
|
64
|
-
nonNegativeInteger(input.afterVersion, 'Channel.subscribe input.afterVersion')
|
|
65
|
-
return input
|
|
66
|
-
}
|
|
67
|
-
case 'invoke': {
|
|
68
|
-
const input = exactRecord(value, ['channelId', 'method', 'arguments'], 'Channel.invoke input')
|
|
69
|
-
nonEmpty(input.channelId, 'Channel.invoke input.channelId')
|
|
70
|
-
nonEmpty(input.method, 'Channel.invoke input.method')
|
|
71
|
-
if (!Array.isArray(input.arguments)) throw new TypeError('Channel.invoke input.arguments must be an array')
|
|
72
|
-
jsonValue(input.arguments, 'Channel.invoke input.arguments', new Set())
|
|
73
|
-
return input
|
|
74
|
-
}
|
|
75
|
-
case 'close': {
|
|
76
|
-
const input = exactRecord(value, ['channelId'], 'Channel.close input')
|
|
77
|
-
nonEmpty(input.channelId, 'Channel.close input.channelId')
|
|
78
|
-
return input
|
|
79
|
-
}
|
|
80
|
-
default:
|
|
81
|
-
throw new TypeError(`Channel operation ${JSON.stringify(operation)} is not defined`)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function validateTuiChannelSnapshot(value) {
|
|
86
|
-
const snapshot = exactRecord(value, ['wireRevision', 'channelId', 'version', 'state'], 'Channel snapshot')
|
|
87
|
-
positiveInteger(snapshot.wireRevision, 'Channel snapshot.wireRevision')
|
|
88
|
-
nonEmpty(snapshot.channelId, 'Channel snapshot.channelId')
|
|
89
|
-
nonNegativeInteger(snapshot.version, 'Channel snapshot.version')
|
|
90
|
-
const state = exactRecord(snapshot.state, Object.keys(snapshot.state ?? {}), 'Channel snapshot.state')
|
|
91
|
-
jsonValue(state, 'Channel snapshot.state', new Set())
|
|
92
|
-
return snapshot
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export function validateTuiChannelOutput(operation, value) {
|
|
96
|
-
if (operation === 'open' || operation === 'subscribe') return validateTuiChannelSnapshot(value)
|
|
97
|
-
if (operation === 'invoke') {
|
|
98
|
-
const output = exactRecord(value, ['value', 'valueDefined', 'snapshot'], 'Channel.invoke output')
|
|
99
|
-
jsonValue(output.value, 'Channel.invoke output.value', new Set())
|
|
100
|
-
if (output.valueDefined !== undefined && typeof output.valueDefined !== 'boolean') {
|
|
101
|
-
throw new TypeError('Channel.invoke output.valueDefined must be boolean')
|
|
102
|
-
}
|
|
103
|
-
if (output.snapshot !== undefined) validateTuiChannelSnapshot(output.snapshot)
|
|
104
|
-
return output
|
|
105
|
-
}
|
|
106
|
-
if (operation === 'close') {
|
|
107
|
-
const output = exactRecord(value, ['closed'], 'Channel.close output')
|
|
108
|
-
if (output.closed !== true) throw new TypeError('Channel.close output.closed must be true')
|
|
109
|
-
return output
|
|
110
|
-
}
|
|
111
|
-
throw new TypeError(`Channel operation ${JSON.stringify(operation)} is not defined`)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function exactRecord(value, allowed, label) {
|
|
115
|
-
if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError(`${label} must be an object`)
|
|
116
|
-
const unknown = Object.keys(value).filter(key => !allowed.includes(key) && !key.startsWith('x-'))
|
|
117
|
-
if (unknown.length > 0) throw new TypeError(`${label} contains unknown field ${JSON.stringify(unknown[0])}`)
|
|
118
|
-
return value
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function featureList(value, label) {
|
|
122
|
-
if (!Array.isArray(value) || value.length === 0) throw new TypeError(`${label} must be a non-empty array`)
|
|
123
|
-
const features = value.map((feature, index) => {
|
|
124
|
-
nonEmpty(feature, `${label}[${index}]`)
|
|
125
|
-
return feature
|
|
126
|
-
})
|
|
127
|
-
if (new Set(features).size !== features.length) throw new TypeError(`${label} contains duplicates`)
|
|
128
|
-
return Object.freeze([...features].sort())
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function positiveInteger(value, label) {
|
|
132
|
-
if (!Number.isSafeInteger(value) || value < 1) throw new TypeError(`${label} must be a positive integer`)
|
|
133
|
-
return value
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function nonNegativeInteger(value, label) {
|
|
137
|
-
if (!Number.isSafeInteger(value) || value < 0) throw new TypeError(`${label} must be a non-negative integer`)
|
|
138
|
-
return value
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function nonEmpty(value, label) {
|
|
142
|
-
if (typeof value !== 'string' || value.trim() === '') throw new TypeError(`${label} must be a non-empty string`)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function optionalString(value, label) {
|
|
146
|
-
if (value !== undefined) nonEmpty(value, label)
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function jsonValue(value, label, ancestors) {
|
|
150
|
-
if (value === null || typeof value === 'boolean' || typeof value === 'string') return
|
|
151
|
-
if (typeof value === 'number') {
|
|
152
|
-
if (!Number.isFinite(value)) throw new TypeError(`${label} must contain only finite numbers`)
|
|
153
|
-
return
|
|
154
|
-
}
|
|
155
|
-
if (typeof value !== 'object') throw new TypeError(`${label} must be a JSON value`)
|
|
156
|
-
if (ancestors.has(value)) throw new TypeError(`${label} must not contain cycles`)
|
|
157
|
-
ancestors.add(value)
|
|
158
|
-
if (Array.isArray(value)) {
|
|
159
|
-
for (const [index, item] of value.entries()) jsonValue(item, `${label}[${index}]`, ancestors)
|
|
160
|
-
} else {
|
|
161
|
-
const prototype = Object.getPrototypeOf(value)
|
|
162
|
-
if (prototype !== Object.prototype && prototype !== null) throw new TypeError(`${label} must contain only plain objects`)
|
|
163
|
-
for (const [key, item] of Object.entries(value)) jsonValue(item, `${label}.${key}`, ancestors)
|
|
164
|
-
}
|
|
165
|
-
ancestors.delete(value)
|
|
166
|
-
}
|
|
1
|
+
import { defineCapabilityProtocol } from '@dsh-std/connection'
|
|
2
|
+
|
|
3
|
+
export const TUI_CHANNEL = Object.freeze({
|
|
4
|
+
apiVersion: 'tui.dsh/v1alpha1',
|
|
5
|
+
kind: 'Channel',
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
export const TUI_CHANNEL_WIRE_REVISION = 6
|
|
9
|
+
|
|
10
|
+
export const TUI_CHANNEL_FEATURES = Object.freeze([
|
|
11
|
+
'commands',
|
|
12
|
+
'credentials',
|
|
13
|
+
'diagnostics',
|
|
14
|
+
'files',
|
|
15
|
+
'models',
|
|
16
|
+
'modes',
|
|
17
|
+
'presets',
|
|
18
|
+
'presentation',
|
|
19
|
+
'provider-setup',
|
|
20
|
+
'scenes',
|
|
21
|
+
'session-history',
|
|
22
|
+
'session-input',
|
|
23
|
+
'session-lifecycle',
|
|
24
|
+
'session-state',
|
|
25
|
+
'settings',
|
|
26
|
+
'skills',
|
|
27
|
+
'subagents',
|
|
28
|
+
'trace',
|
|
29
|
+
'workspaces',
|
|
30
|
+
])
|
|
31
|
+
|
|
32
|
+
export const tuiChannelDefinition = defineCapabilityProtocol({
|
|
33
|
+
...TUI_CHANNEL,
|
|
34
|
+
validateRequirement: validateTuiChannelRequirement,
|
|
35
|
+
validateSupport: validateTuiChannelSupport,
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
export function validateTuiChannelRequirement(value) {
|
|
39
|
+
const spec = exactRecord(value, ['wireRevision', 'features'], 'Channel requirement')
|
|
40
|
+
const wireRevision = positiveInteger(spec.wireRevision, 'Channel requirement.wireRevision')
|
|
41
|
+
const features = featureList(spec.features, 'Channel requirement.features')
|
|
42
|
+
return Object.freeze({ wireRevision, features })
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function validateTuiChannelSupport(value) {
|
|
46
|
+
const spec = exactRecord(value, ['wireRevision', 'features'], 'Channel support')
|
|
47
|
+
const wireRevision = positiveInteger(spec.wireRevision, 'Channel support.wireRevision')
|
|
48
|
+
const features = featureList(spec.features, 'Channel support.features')
|
|
49
|
+
return Object.freeze({ wireRevision, features })
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function validateTuiChannelInput(operation, value) {
|
|
53
|
+
switch (operation) {
|
|
54
|
+
case 'open': {
|
|
55
|
+
const input = exactRecord(value, ['workspace', 'sessionId', 'options'], 'Channel.open input')
|
|
56
|
+
optionalString(input.workspace, 'Channel.open input.workspace')
|
|
57
|
+
optionalString(input.sessionId, 'Channel.open input.sessionId')
|
|
58
|
+
if (input.options !== undefined) jsonValue(input.options, 'Channel.open input.options', new Set())
|
|
59
|
+
return input
|
|
60
|
+
}
|
|
61
|
+
case 'subscribe': {
|
|
62
|
+
const input = exactRecord(value, ['channelId', 'afterVersion'], 'Channel.subscribe input')
|
|
63
|
+
nonEmpty(input.channelId, 'Channel.subscribe input.channelId')
|
|
64
|
+
nonNegativeInteger(input.afterVersion, 'Channel.subscribe input.afterVersion')
|
|
65
|
+
return input
|
|
66
|
+
}
|
|
67
|
+
case 'invoke': {
|
|
68
|
+
const input = exactRecord(value, ['channelId', 'method', 'arguments'], 'Channel.invoke input')
|
|
69
|
+
nonEmpty(input.channelId, 'Channel.invoke input.channelId')
|
|
70
|
+
nonEmpty(input.method, 'Channel.invoke input.method')
|
|
71
|
+
if (!Array.isArray(input.arguments)) throw new TypeError('Channel.invoke input.arguments must be an array')
|
|
72
|
+
jsonValue(input.arguments, 'Channel.invoke input.arguments', new Set())
|
|
73
|
+
return input
|
|
74
|
+
}
|
|
75
|
+
case 'close': {
|
|
76
|
+
const input = exactRecord(value, ['channelId'], 'Channel.close input')
|
|
77
|
+
nonEmpty(input.channelId, 'Channel.close input.channelId')
|
|
78
|
+
return input
|
|
79
|
+
}
|
|
80
|
+
default:
|
|
81
|
+
throw new TypeError(`Channel operation ${JSON.stringify(operation)} is not defined`)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function validateTuiChannelSnapshot(value) {
|
|
86
|
+
const snapshot = exactRecord(value, ['wireRevision', 'channelId', 'version', 'state'], 'Channel snapshot')
|
|
87
|
+
positiveInteger(snapshot.wireRevision, 'Channel snapshot.wireRevision')
|
|
88
|
+
nonEmpty(snapshot.channelId, 'Channel snapshot.channelId')
|
|
89
|
+
nonNegativeInteger(snapshot.version, 'Channel snapshot.version')
|
|
90
|
+
const state = exactRecord(snapshot.state, Object.keys(snapshot.state ?? {}), 'Channel snapshot.state')
|
|
91
|
+
jsonValue(state, 'Channel snapshot.state', new Set())
|
|
92
|
+
return snapshot
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function validateTuiChannelOutput(operation, value) {
|
|
96
|
+
if (operation === 'open' || operation === 'subscribe') return validateTuiChannelSnapshot(value)
|
|
97
|
+
if (operation === 'invoke') {
|
|
98
|
+
const output = exactRecord(value, ['value', 'valueDefined', 'snapshot'], 'Channel.invoke output')
|
|
99
|
+
jsonValue(output.value, 'Channel.invoke output.value', new Set())
|
|
100
|
+
if (output.valueDefined !== undefined && typeof output.valueDefined !== 'boolean') {
|
|
101
|
+
throw new TypeError('Channel.invoke output.valueDefined must be boolean')
|
|
102
|
+
}
|
|
103
|
+
if (output.snapshot !== undefined) validateTuiChannelSnapshot(output.snapshot)
|
|
104
|
+
return output
|
|
105
|
+
}
|
|
106
|
+
if (operation === 'close') {
|
|
107
|
+
const output = exactRecord(value, ['closed'], 'Channel.close output')
|
|
108
|
+
if (output.closed !== true) throw new TypeError('Channel.close output.closed must be true')
|
|
109
|
+
return output
|
|
110
|
+
}
|
|
111
|
+
throw new TypeError(`Channel operation ${JSON.stringify(operation)} is not defined`)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function exactRecord(value, allowed, label) {
|
|
115
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError(`${label} must be an object`)
|
|
116
|
+
const unknown = Object.keys(value).filter(key => !allowed.includes(key) && !key.startsWith('x-'))
|
|
117
|
+
if (unknown.length > 0) throw new TypeError(`${label} contains unknown field ${JSON.stringify(unknown[0])}`)
|
|
118
|
+
return value
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function featureList(value, label) {
|
|
122
|
+
if (!Array.isArray(value) || value.length === 0) throw new TypeError(`${label} must be a non-empty array`)
|
|
123
|
+
const features = value.map((feature, index) => {
|
|
124
|
+
nonEmpty(feature, `${label}[${index}]`)
|
|
125
|
+
return feature
|
|
126
|
+
})
|
|
127
|
+
if (new Set(features).size !== features.length) throw new TypeError(`${label} contains duplicates`)
|
|
128
|
+
return Object.freeze([...features].sort())
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function positiveInteger(value, label) {
|
|
132
|
+
if (!Number.isSafeInteger(value) || value < 1) throw new TypeError(`${label} must be a positive integer`)
|
|
133
|
+
return value
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function nonNegativeInteger(value, label) {
|
|
137
|
+
if (!Number.isSafeInteger(value) || value < 0) throw new TypeError(`${label} must be a non-negative integer`)
|
|
138
|
+
return value
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function nonEmpty(value, label) {
|
|
142
|
+
if (typeof value !== 'string' || value.trim() === '') throw new TypeError(`${label} must be a non-empty string`)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function optionalString(value, label) {
|
|
146
|
+
if (value !== undefined) nonEmpty(value, label)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function jsonValue(value, label, ancestors) {
|
|
150
|
+
if (value === null || typeof value === 'boolean' || typeof value === 'string') return
|
|
151
|
+
if (typeof value === 'number') {
|
|
152
|
+
if (!Number.isFinite(value)) throw new TypeError(`${label} must contain only finite numbers`)
|
|
153
|
+
return
|
|
154
|
+
}
|
|
155
|
+
if (typeof value !== 'object') throw new TypeError(`${label} must be a JSON value`)
|
|
156
|
+
if (ancestors.has(value)) throw new TypeError(`${label} must not contain cycles`)
|
|
157
|
+
ancestors.add(value)
|
|
158
|
+
if (Array.isArray(value)) {
|
|
159
|
+
for (const [index, item] of value.entries()) jsonValue(item, `${label}[${index}]`, ancestors)
|
|
160
|
+
} else {
|
|
161
|
+
const prototype = Object.getPrototypeOf(value)
|
|
162
|
+
if (prototype !== Object.prototype && prototype !== null) throw new TypeError(`${label} must contain only plain objects`)
|
|
163
|
+
for (const [key, item] of Object.entries(value)) jsonValue(item, `${label}.${key}`, ancestors)
|
|
164
|
+
}
|
|
165
|
+
ancestors.delete(value)
|
|
166
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import type { ApiReference } from '@dsh-std/core'
|
|
2
|
-
import type { ManifestDefinitionCatalog, ManifestObjectDefinition } from '@dsh-std/manifest'
|
|
3
|
-
|
|
4
|
-
export const API_VERSION: 'tui.dsh/v1alpha1'
|
|
5
|
-
export const SETTINGS_SECTION: Readonly<ApiReference & { kind: 'SettingsSection' }>
|
|
6
|
-
export const SCENE: Readonly<ApiReference & { kind: 'Scene' }>
|
|
7
|
-
|
|
8
|
-
export type LocalizedText = Readonly<Record<string, string>>
|
|
9
|
-
export type SettingsFieldKind = 'text' | 'number' | 'boolean' | 'select'
|
|
10
|
-
export interface SettingsFieldOption { readonly value: string; readonly label: string; readonly titles?: LocalizedText }
|
|
11
|
-
export interface SettingsFieldSpec {
|
|
12
|
-
readonly path: readonly string[]
|
|
13
|
-
readonly label: string
|
|
14
|
-
readonly titles?: LocalizedText
|
|
15
|
-
readonly hint?: string
|
|
16
|
-
readonly hintTitles?: LocalizedText
|
|
17
|
-
readonly kind: SettingsFieldKind
|
|
18
|
-
readonly options?: readonly SettingsFieldOption[]
|
|
19
|
-
readonly placeholder?: string
|
|
20
|
-
readonly secretRef?: string
|
|
21
|
-
}
|
|
22
|
-
export interface SettingsSectionSpec {
|
|
23
|
-
readonly namespace: string
|
|
24
|
-
readonly title: string
|
|
25
|
-
readonly titles?: LocalizedText
|
|
26
|
-
readonly fields: readonly SettingsFieldSpec[]
|
|
27
|
-
}
|
|
28
|
-
export interface SettingsSectionHandler {}
|
|
29
|
-
|
|
30
|
-
export interface SceneSpec { readonly title?: string; readonly titles?: LocalizedText }
|
|
31
|
-
export interface SceneHandler<Props = unknown, Result = unknown> {
|
|
32
|
-
readonly component: (props: Props) => Result
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const settingsSectionExtensionDefinition: ManifestObjectDefinition
|
|
36
|
-
export const sceneExtensionDefinition: ManifestObjectDefinition
|
|
37
|
-
export const contributionExtensionDefinitions: readonly ManifestObjectDefinition[]
|
|
38
|
-
export function validateSettingsSectionSpec(value: unknown): Readonly<SettingsSectionSpec>
|
|
39
|
-
export function validateSceneSpec(value: unknown): Readonly<SceneSpec>
|
|
40
|
-
export function registerTuiContributionExtensions(catalog: ManifestDefinitionCatalog): () => void
|
|
41
|
-
export function assertSettingsSectionHandler(value: unknown): asserts value is SettingsSectionHandler
|
|
42
|
-
export function assertSceneHandler(value: unknown): asserts value is SceneHandler
|
|
1
|
+
import type { ApiReference } from '@dsh-std/core'
|
|
2
|
+
import type { ManifestDefinitionCatalog, ManifestObjectDefinition } from '@dsh-std/manifest'
|
|
3
|
+
|
|
4
|
+
export const API_VERSION: 'tui.dsh/v1alpha1'
|
|
5
|
+
export const SETTINGS_SECTION: Readonly<ApiReference & { kind: 'SettingsSection' }>
|
|
6
|
+
export const SCENE: Readonly<ApiReference & { kind: 'Scene' }>
|
|
7
|
+
|
|
8
|
+
export type LocalizedText = Readonly<Record<string, string>>
|
|
9
|
+
export type SettingsFieldKind = 'text' | 'number' | 'boolean' | 'select'
|
|
10
|
+
export interface SettingsFieldOption { readonly value: string; readonly label: string; readonly titles?: LocalizedText }
|
|
11
|
+
export interface SettingsFieldSpec {
|
|
12
|
+
readonly path: readonly string[]
|
|
13
|
+
readonly label: string
|
|
14
|
+
readonly titles?: LocalizedText
|
|
15
|
+
readonly hint?: string
|
|
16
|
+
readonly hintTitles?: LocalizedText
|
|
17
|
+
readonly kind: SettingsFieldKind
|
|
18
|
+
readonly options?: readonly SettingsFieldOption[]
|
|
19
|
+
readonly placeholder?: string
|
|
20
|
+
readonly secretRef?: string
|
|
21
|
+
}
|
|
22
|
+
export interface SettingsSectionSpec {
|
|
23
|
+
readonly namespace: string
|
|
24
|
+
readonly title: string
|
|
25
|
+
readonly titles?: LocalizedText
|
|
26
|
+
readonly fields: readonly SettingsFieldSpec[]
|
|
27
|
+
}
|
|
28
|
+
export interface SettingsSectionHandler {}
|
|
29
|
+
|
|
30
|
+
export interface SceneSpec { readonly title?: string; readonly titles?: LocalizedText }
|
|
31
|
+
export interface SceneHandler<Props = unknown, Result = unknown> {
|
|
32
|
+
readonly component: (props: Props) => Result
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const settingsSectionExtensionDefinition: ManifestObjectDefinition
|
|
36
|
+
export const sceneExtensionDefinition: ManifestObjectDefinition
|
|
37
|
+
export const contributionExtensionDefinitions: readonly ManifestObjectDefinition[]
|
|
38
|
+
export function validateSettingsSectionSpec(value: unknown): Readonly<SettingsSectionSpec>
|
|
39
|
+
export function validateSceneSpec(value: unknown): Readonly<SceneSpec>
|
|
40
|
+
export function registerTuiContributionExtensions(catalog: ManifestDefinitionCatalog): () => void
|
|
41
|
+
export function assertSettingsSectionHandler(value: unknown): asserts value is SettingsSectionHandler
|
|
42
|
+
export function assertSceneHandler(value: unknown): asserts value is SceneHandler
|