@deepseek-harness-tui/dsh-tui 0.8.0 → 0.8.2
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 +32 -15
- package/cordis.patch.yml +21 -2
- package/cordis.yml +12 -1
- package/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -0
- package/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -0
- package/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -0
- package/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -0
- package/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -0
- package/dsh-ecosystem-spec/protocols/tui-channel.js +166 -0
- package/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -0
- package/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -0
- package/dsh-ecosystem-spec/registry/README.md +14 -0
- package/dsh-ecosystem-spec/registry/contracts/decision-events-v1alpha1.json +13 -0
- package/dsh-ecosystem-spec/registry/contracts/scene-v1alpha1.json +13 -0
- package/dsh-ecosystem-spec/registry/contracts/settings-section-v1alpha1.json +13 -0
- package/dsh-ecosystem-spec/registry/contracts/tui-channel-v1alpha1.json +30 -0
- package/dsh-ecosystem-spec/registry/contracts/workspace-provider-v1alpha1.json +6 -0
- package/dsh-ecosystem-spec/registry/host-descriptor.tui.example.json +56 -0
- package/dsh-ecosystem-spec/registry/permissions-0.1.json +13 -0
- package/dsh-ecosystem-spec/registry/registry-0.15.json +149 -0
- package/dsh-ecosystem-spec/schemas/conformance-claim.schema.json +15 -0
- package/dsh-ecosystem-spec/schemas/effect-ledger-record.schema.json +16 -0
- package/dsh-ecosystem-spec/schemas/host-descriptor.schema.json +26 -0
- package/lib/types/cc/figures.d.ts +4 -0
- package/lib/types/cc/figures.d.ts.map +1 -1
- package/lib/types/cc/figures.js +4 -0
- package/lib/types/command-trees.d.ts +2 -1
- package/lib/types/command-trees.d.ts.map +1 -1
- package/lib/types/command-trees.js +1 -1
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +2 -0
- package/lib/types/components/ExtensionDialog.d.ts +40 -0
- package/lib/types/components/ExtensionDialog.d.ts.map +1 -0
- package/lib/types/components/ExtensionDialog.js +210 -0
- package/lib/types/components/HelpMenu.js +1 -1
- package/lib/types/components/LoadedContextPanel.d.ts +5 -5
- package/lib/types/components/LoadedContextPanel.js +6 -6
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +16 -8
- package/lib/types/components/Markdown.d.ts +13 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +15 -1
- package/lib/types/components/MessageList.d.ts +3 -1
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +111 -6
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +26 -12
- package/lib/types/components/RewindPicker.d.ts +13 -1
- package/lib/types/components/RewindPicker.d.ts.map +1 -1
- package/lib/types/components/RewindPicker.js +26 -2
- package/lib/types/components/StreamingMarkdown.d.ts +2 -8
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
- package/lib/types/components/StreamingMarkdown.js +51 -9
- package/lib/types/components/ToolUseLoader.d.ts +8 -3
- package/lib/types/components/ToolUseLoader.d.ts.map +1 -1
- package/lib/types/components/ToolUseLoader.js +43 -9
- package/lib/types/components/activityFrames.d.ts +1 -1
- package/lib/types/components/activityFrames.d.ts.map +1 -1
- package/lib/types/components/activityFrames.js +4 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +5 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +26 -3
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +13 -2
- package/lib/types/dsh-adapter/channel.d.ts +61 -11
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +767 -120
- package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -1
- package/lib/types/dsh-adapter/childStderr.js +10 -0
- package/lib/types/dsh-adapter/command-attribution.d.ts +51 -0
- package/lib/types/dsh-adapter/command-attribution.d.ts.map +1 -0
- package/lib/types/dsh-adapter/command-attribution.js +93 -0
- package/lib/types/dsh-adapter/command-errors.d.ts +42 -0
- package/lib/types/dsh-adapter/command-errors.d.ts.map +1 -0
- package/lib/types/dsh-adapter/command-errors.js +63 -0
- package/lib/types/dsh-adapter/command-trees.d.ts +7 -1
- package/lib/types/dsh-adapter/command-trees.d.ts.map +1 -1
- package/lib/types/dsh-adapter/command-trees.js +70 -20
- package/lib/types/dsh-adapter/component-identity.d.ts +33 -0
- package/lib/types/dsh-adapter/component-identity.d.ts.map +1 -0
- package/lib/types/dsh-adapter/component-identity.js +108 -0
- package/lib/types/dsh-adapter/contract.d.ts +1 -1
- package/lib/types/dsh-adapter/contract.js +2 -2
- package/lib/types/dsh-adapter/decision-guard.d.ts +84 -0
- package/lib/types/dsh-adapter/decision-guard.d.ts.map +1 -0
- package/lib/types/dsh-adapter/decision-guard.js +348 -0
- package/lib/types/dsh-adapter/dialogs.d.ts +145 -0
- package/lib/types/dsh-adapter/dialogs.d.ts.map +1 -0
- package/lib/types/dsh-adapter/dialogs.js +316 -0
- package/lib/types/dsh-adapter/effect-ledger.d.ts +91 -0
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -0
- package/lib/types/dsh-adapter/effect-ledger.js +251 -0
- package/lib/types/dsh-adapter/extension-events.d.ts +193 -0
- package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -0
- package/lib/types/dsh-adapter/extension-events.js +207 -0
- package/lib/types/dsh-adapter/extensions.d.ts +32 -0
- package/lib/types/dsh-adapter/extensions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/extensions.js +42 -0
- package/lib/types/dsh-adapter/grants.d.ts +25 -0
- package/lib/types/dsh-adapter/grants.d.ts.map +1 -0
- package/lib/types/dsh-adapter/grants.js +213 -0
- package/lib/types/dsh-adapter/host-access.d.ts +37 -0
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-access.js +652 -0
- package/lib/types/dsh-adapter/host-descriptor.d.ts +24 -0
- package/lib/types/dsh-adapter/host-descriptor.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-descriptor.js +169 -0
- package/lib/types/dsh-adapter/index.d.ts +4 -0
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +1 -0
- package/lib/types/dsh-adapter/message-observer.d.ts +173 -0
- package/lib/types/dsh-adapter/message-observer.d.ts.map +1 -0
- package/lib/types/dsh-adapter/message-observer.js +553 -0
- package/lib/types/dsh-adapter/plugin-host.d.ts +136 -0
- package/lib/types/dsh-adapter/plugin-host.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-host.js +365 -0
- package/lib/types/dsh-adapter/plugin-storage.d.ts +108 -0
- package/lib/types/dsh-adapter/plugin-storage.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-storage.js +397 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +124 -14
- package/lib/types/dsh-adapter/plugins-info.d.ts +43 -0
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugins-info.js +276 -0
- package/lib/types/dsh-adapter/promptDebug.d.ts +0 -6
- package/lib/types/dsh-adapter/promptDebug.d.ts.map +1 -1
- package/lib/types/dsh-adapter/promptDebug.js +13 -4
- package/lib/types/dsh-adapter/renderers.d.ts +57 -0
- package/lib/types/dsh-adapter/renderers.d.ts.map +1 -0
- package/lib/types/dsh-adapter/renderers.js +173 -0
- package/lib/types/dsh-adapter/sanitize.d.ts +36 -0
- package/lib/types/dsh-adapter/sanitize.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sanitize.js +65 -0
- package/lib/types/dsh-adapter/scenes.d.ts +15 -5
- package/lib/types/dsh-adapter/scenes.d.ts.map +1 -1
- package/lib/types/dsh-adapter/scenes.js +149 -35
- package/lib/types/dsh-adapter/settings-sections.d.ts +7 -3
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +106 -26
- package/lib/types/dsh-adapter/shortcuts.d.ts +107 -0
- package/lib/types/dsh-adapter/shortcuts.d.ts.map +1 -0
- package/lib/types/dsh-adapter/shortcuts.js +340 -0
- package/lib/types/dsh-adapter/status.d.ts +74 -0
- package/lib/types/dsh-adapter/status.d.ts.map +1 -0
- package/lib/types/dsh-adapter/status.js +234 -0
- package/lib/types/dsh-adapter/workspaces.d.ts +16 -5
- package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -1
- package/lib/types/dsh-adapter/workspaces.js +287 -170
- package/lib/types/extensions.d.ts +13 -0
- package/lib/types/extensions.d.ts.map +1 -0
- package/lib/types/extensions.js +21 -0
- package/lib/types/force-production-react.d.ts +1 -0
- package/lib/types/force-production-react.d.ts.map +1 -0
- package/lib/types/force-production-react.js +12 -0
- package/lib/types/i18n.d.ts +174 -20
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +56 -6
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +1 -0
- package/lib/types/ink/components/App.d.ts +2 -0
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +4 -0
- package/lib/types/ink/ink.d.ts +31 -3
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +90 -5
- package/lib/types/ink/log-update.d.ts.map +1 -1
- package/lib/types/ink/log-update.js +225 -56
- package/lib/types/ink/output.d.ts +35 -2
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +281 -14
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +14 -6
- package/lib/types/ink/screen.d.ts +39 -0
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/screen.js +117 -0
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +26 -6
- package/lib/types/ink/wrapAnsi.d.ts +1 -1
- package/lib/types/ink/wrapAnsi.d.ts.map +1 -1
- package/lib/types/ink/wrapAnsi.js +29 -2
- package/lib/types/plugin-host.d.ts +15 -0
- package/lib/types/plugin-host.d.ts.map +1 -0
- package/lib/types/plugin-host.js +17 -0
- package/lib/types/plugin-spec/negotiate.d.ts +11 -0
- package/lib/types/plugin-spec/negotiate.d.ts.map +1 -0
- package/lib/types/plugin-spec/negotiate.js +97 -0
- package/lib/types/plugin-spec/permission-scope.d.ts +32 -0
- package/lib/types/plugin-spec/permission-scope.d.ts.map +1 -0
- package/lib/types/plugin-spec/permission-scope.js +90 -0
- package/lib/types/plugin-spec/registry.d.ts +23 -0
- package/lib/types/plugin-spec/registry.d.ts.map +1 -0
- package/lib/types/plugin-spec/registry.js +252 -0
- package/lib/types/plugin-spec/schema-check.d.ts +17 -0
- package/lib/types/plugin-spec/schema-check.d.ts.map +1 -0
- package/lib/types/plugin-spec/schema-check.js +165 -0
- package/lib/types/plugin-spec/tui-extension.d.ts +16 -0
- package/lib/types/plugin-spec/tui-extension.d.ts.map +1 -0
- package/lib/types/plugin-spec/tui-extension.js +79 -0
- package/lib/types/plugin-spec/types.d.ts +114 -0
- package/lib/types/plugin-spec/types.d.ts.map +1 -0
- package/lib/types/plugin-spec/types.js +10 -0
- package/lib/types/plugin-spec/validate.d.ts +21 -0
- package/lib/types/plugin-spec/validate.d.ts.map +1 -0
- package/lib/types/plugin-spec/validate.js +138 -0
- package/lib/types/scenes.d.ts +2 -1
- package/lib/types/scenes.d.ts.map +1 -1
- package/lib/types/scenes.js +1 -1
- package/lib/types/screens/Chat.d.ts +14 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +173 -49
- package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
- package/lib/types/screens/SessionBrowser.js +10 -3
- package/lib/types/sessions/view.d.ts +3 -2
- package/lib/types/sessions/view.d.ts.map +1 -1
- package/lib/types/sessions/view.js +18 -0
- package/lib/types/settings-sections.d.ts +2 -1
- package/lib/types/settings-sections.d.ts.map +1 -1
- package/lib/types/settings-sections.js +1 -1
- package/lib/types/theme.d.ts +5 -0
- package/lib/types/theme.d.ts.map +1 -1
- package/lib/types/theme.js +15 -0
- package/lib/types/update.d.ts +20 -0
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +54 -7
- package/lib/types/utils/execFileNoThrow.d.ts.map +1 -1
- package/lib/types/utils/execFileNoThrow.js +3 -0
- package/lib/types/utils/loaded-context.d.ts +8 -3
- package/lib/types/utils/loaded-context.d.ts.map +1 -1
- package/lib/types/utils/loaded-context.js +39 -3
- package/lib/types/utils/modifiers.d.ts.map +1 -1
- package/lib/types/utils/modifiers.js +3 -2
- package/lib/types/working-activity.d.ts +12 -0
- package/lib/types/working-activity.d.ts.map +1 -1
- package/lib/types/working-activity.js +13 -0
- package/lib/types/workspaces.d.ts +2 -1
- package/lib/types/workspaces.d.ts.map +1 -1
- package/lib/types/workspaces.js +1 -1
- package/node_modules/@dsh-std/command/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/command/LICENSE +21 -0
- package/node_modules/@dsh-std/command/README.md +26 -0
- package/node_modules/@dsh-std/command/README.zh.md +28 -0
- package/node_modules/@dsh-std/command/lib/index.d.ts +144 -0
- package/node_modules/@dsh-std/command/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/command/lib/index.js +252 -0
- package/node_modules/@dsh-std/command/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/command/package.json +22 -0
- package/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/connection/LICENSE +21 -0
- package/node_modules/@dsh-std/connection/README.md +42 -0
- package/node_modules/@dsh-std/connection/README.zh.md +42 -0
- package/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
- package/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
- package/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
- package/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/connection/lib/index.js +158 -0
- package/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
- package/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
- package/node_modules/@dsh-std/connection/lib/memory.js +258 -0
- package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
- package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
- package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
- package/node_modules/@dsh-std/connection/package.json +20 -0
- package/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/core/LICENSE +21 -0
- package/node_modules/@dsh-std/core/README.md +13 -0
- package/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/core/package.json +21 -0
- package/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -0
- package/node_modules/@dsh-std/manifest/LICENSE +21 -0
- package/node_modules/@dsh-std/manifest/README.md +5 -0
- package/node_modules/@dsh-std/manifest/README.zh.md +5 -0
- package/node_modules/@dsh-std/manifest/lib/index.d.ts +182 -0
- package/node_modules/@dsh-std/manifest/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/manifest/lib/index.js +625 -0
- package/node_modules/@dsh-std/manifest/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/manifest/package.json +20 -0
- package/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -0
- package/node_modules/@dsh-std/messages/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/messages/LICENSE +21 -0
- package/node_modules/@dsh-std/messages/README.md +5 -0
- package/node_modules/@dsh-std/messages/README.zh.md +7 -0
- package/node_modules/@dsh-std/messages/lib/index.d.ts +50 -0
- package/node_modules/@dsh-std/messages/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/messages/lib/index.js +151 -0
- package/node_modules/@dsh-std/messages/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/messages/package.json +20 -0
- package/node_modules/@dsh-std/messages/schema/message-observer-envelope-0.15.schema.json +54 -0
- package/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -0
- package/node_modules/@dsh-std/presentation/LICENSE +21 -0
- package/node_modules/@dsh-std/presentation/README.md +27 -0
- package/node_modules/@dsh-std/presentation/README.zh.md +29 -0
- package/node_modules/@dsh-std/presentation/lib/callback.d.ts +2 -0
- package/node_modules/@dsh-std/presentation/lib/callback.js +179 -0
- package/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -0
- package/node_modules/@dsh-std/presentation/lib/index.d.ts +262 -0
- package/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/presentation/lib/index.js +550 -0
- package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/presentation/lib/interaction.d.ts +2 -0
- package/node_modules/@dsh-std/presentation/lib/interaction.js +2 -0
- package/node_modules/@dsh-std/presentation/lib/operations.d.ts +2 -0
- package/node_modules/@dsh-std/presentation/lib/operations.js +2 -0
- package/node_modules/@dsh-std/presentation/package.json +25 -0
- package/node_modules/@dsh-std/storage/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/storage/LICENSE +21 -0
- package/node_modules/@dsh-std/storage/README.md +5 -0
- package/node_modules/@dsh-std/storage/README.zh.md +7 -0
- package/node_modules/@dsh-std/storage/lib/index.d.ts +48 -0
- package/node_modules/@dsh-std/storage/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/storage/lib/index.js +104 -0
- package/node_modules/@dsh-std/storage/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/storage/package.json +20 -0
- package/node_modules/@dsh-std/storage/schema/local-storage-0.15.schema.json +56 -0
- package/package.json +110 -70
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/LICENSE +21 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.md +42 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.zh.md +42 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js +158 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js +258 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +20 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/LICENSE +21 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.md +13 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +21 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/LICENSE +21 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.md +5 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.zh.md +5 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.d.ts +182 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js +625 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +20 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/LICENSE +21 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +27 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +29 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.d.ts +2 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js +179 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts +262 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js +550 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/interaction.d.ts +2 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/interaction.js +2 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/operations.d.ts +2 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/operations.js +2 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +25 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/LICENSE +21 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.md +13 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +21 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/LICENSE +21 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.md +13 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +21 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/LICENSE +21 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.md +13 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +21 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/LICENSE +21 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.md +42 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.zh.md +42 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js +158 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js +258 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +20 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/LICENSE +21 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.md +13 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +21 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/LICENSE +21 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.md +13 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +21 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/** Build the current dsh-TUI Host Descriptor from the pinned admission profile. */
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { digestFile, loadSpecData, verifyContractProfiles } from '../plugin-spec/registry.js';
|
|
6
|
+
import { TUI_DECISION_EVENT_NAMES } from '../plugin-spec/tui-extension.js';
|
|
7
|
+
import { createContractIndex, validateHost } from '../plugin-spec/validate.js';
|
|
8
|
+
import { check } from '../plugin-spec/schema-check.js';
|
|
9
|
+
export const HOST_SUPPORTED_CONTRACTS = Object.freeze([
|
|
10
|
+
{ apiVersion: 'commands.dsh/v1alpha1', kind: 'Command' },
|
|
11
|
+
{ apiVersion: 'storage.dsh/v1alpha1', kind: 'LocalStorage' },
|
|
12
|
+
{ apiVersion: 'messages.dsh/v1alpha1', kind: 'MessageObserver' },
|
|
13
|
+
{ apiVersion: 'tui.dsh/v1alpha1', kind: 'DecisionEvents' },
|
|
14
|
+
]);
|
|
15
|
+
/** The facet version is part of the host identity, not a protocol definition.
|
|
16
|
+
* Keep a conservative fallback so a descriptor remains schema-valid when the
|
|
17
|
+
* optional vendored registry is unavailable; the contract list is still
|
|
18
|
+
* empty in that degraded state. */
|
|
19
|
+
export const HOST_FACET_API_VERSIONS = Object.freeze(['v1alpha1']);
|
|
20
|
+
function freezeDeep(value, seen = new WeakSet()) {
|
|
21
|
+
if (value === null || typeof value !== 'object' || seen.has(value))
|
|
22
|
+
return value;
|
|
23
|
+
seen.add(value);
|
|
24
|
+
for (const child of Object.values(value))
|
|
25
|
+
freezeDeep(child, seen);
|
|
26
|
+
return Object.freeze(value);
|
|
27
|
+
}
|
|
28
|
+
export function readOwnPackageVersion() {
|
|
29
|
+
const candidates = [];
|
|
30
|
+
try {
|
|
31
|
+
candidates.push(fileURLToPath(import.meta.resolve('@deepseek-harness-tui/dsh-tui/package.json')));
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// Fall through to the source/package walk-up path.
|
|
35
|
+
}
|
|
36
|
+
let dir = dirname(fileURLToPath(import.meta.url));
|
|
37
|
+
for (let index = 0; index < 8; index++) {
|
|
38
|
+
candidates.push(join(dir, 'package.json'));
|
|
39
|
+
const parent = dirname(dir);
|
|
40
|
+
if (parent === dir)
|
|
41
|
+
break;
|
|
42
|
+
dir = parent;
|
|
43
|
+
}
|
|
44
|
+
for (const candidate of candidates) {
|
|
45
|
+
try {
|
|
46
|
+
const manifest = JSON.parse(readFileSync(candidate, 'utf8'));
|
|
47
|
+
if (manifest.name === '@deepseek-harness-tui/dsh-tui'
|
|
48
|
+
&& typeof manifest.version === 'string'
|
|
49
|
+
&& manifest.version !== '')
|
|
50
|
+
return manifest.version;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// Keep looking.
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return '0.0.0';
|
|
57
|
+
}
|
|
58
|
+
function supportSpec(coordinate) {
|
|
59
|
+
if (coordinate.apiVersion === 'tui.dsh/v1alpha1' && coordinate.kind === 'DecisionEvents') {
|
|
60
|
+
return { features: [...TUI_DECISION_EVENT_NAMES] };
|
|
61
|
+
}
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
export function buildHostDescriptor(options) {
|
|
65
|
+
const warnings = [];
|
|
66
|
+
const dropped = [];
|
|
67
|
+
const contracts = [];
|
|
68
|
+
const data = loadSpecData(options.specDir);
|
|
69
|
+
// `loadSpecData` rejects malformed/empty facet declarations. Preserve the
|
|
70
|
+
// pinned values exactly when data is valid; use the schema-valid fallback
|
|
71
|
+
// only for the completely unavailable/degraded path.
|
|
72
|
+
const facetApiVersions = data === undefined
|
|
73
|
+
? [...HOST_FACET_API_VERSIONS]
|
|
74
|
+
: [...data.registry.facetApiVersions];
|
|
75
|
+
const profileFailures = data === undefined ? [] : verifyContractProfiles(data);
|
|
76
|
+
if (data === undefined) {
|
|
77
|
+
warnings.push('admission profile unavailable (dsh-ecosystem-spec/); advertising an empty protocol surface');
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const index = createContractIndex(data.registry, data.permissions);
|
|
81
|
+
for (const coordinate of options.supported ?? HOST_SUPPORTED_CONTRACTS) {
|
|
82
|
+
const key = `${coordinate.apiVersion}#${coordinate.kind}`;
|
|
83
|
+
const entry = index.lookupContract(coordinate);
|
|
84
|
+
const definition = index.protocols.resolve(coordinate);
|
|
85
|
+
if (entry === undefined || definition === undefined) {
|
|
86
|
+
dropped.push(key);
|
|
87
|
+
warnings.push(`${key}: live implementation has no pinned ProtocolCatalog definition`);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if ('profile' in entry) {
|
|
91
|
+
if (profileFailures.length > 0) {
|
|
92
|
+
dropped.push(key);
|
|
93
|
+
warnings.push(`${key}: TUI contract profile self-check failed (${profileFailures.join(' | ')})`);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
let actual;
|
|
97
|
+
try {
|
|
98
|
+
actual = digestFile(data.dir, entry.profile);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
dropped.push(key);
|
|
102
|
+
warnings.push(`${key}: TUI profile is unreadable (${entry.profile})`);
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (actual !== entry.profileHash) {
|
|
106
|
+
dropped.push(key);
|
|
107
|
+
warnings.push(`${key}: TUI profile hash drifted (expected ${entry.profileHash}, actual ${actual})`);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const spec = supportSpec(coordinate);
|
|
112
|
+
try {
|
|
113
|
+
definition.validateSupport(spec);
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
dropped.push(key);
|
|
117
|
+
warnings.push(`${key}: support spec rejected by its definition (${error instanceof Error ? error.message : String(error)})`);
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
contracts.push({
|
|
121
|
+
...coordinate,
|
|
122
|
+
...(spec === undefined ? {} : { spec }),
|
|
123
|
+
definition: 'package' in entry
|
|
124
|
+
? { source: 'dsh-std', package: entry.package }
|
|
125
|
+
: { source: 'tui-profile', profileHash: entry.profileHash },
|
|
126
|
+
permissions: [...entry.permissions],
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const descriptor = {
|
|
131
|
+
$schema: 'urn:dsh-tui:host-descriptor:0.15',
|
|
132
|
+
hostId: options.hostId ?? 'dsh-tui',
|
|
133
|
+
hostVersion: options.hostVersion ?? readOwnPackageVersion(),
|
|
134
|
+
facetApiVersions: [...facetApiVersions],
|
|
135
|
+
contracts,
|
|
136
|
+
runtime: {
|
|
137
|
+
location: 'local',
|
|
138
|
+
generationId: options.generationId,
|
|
139
|
+
headless: options.headless ?? false,
|
|
140
|
+
},
|
|
141
|
+
trustLevel: 'trusted-in-process',
|
|
142
|
+
platform: { os: process.platform, arch: process.arch, node: process.version },
|
|
143
|
+
};
|
|
144
|
+
if (data !== undefined) {
|
|
145
|
+
try {
|
|
146
|
+
validateHost(createContractIndex(data.registry, data.permissions), descriptor);
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
warnings.push(`constructed descriptor failed semantic validation: ${error instanceof Error ? error.message : String(error)}`);
|
|
150
|
+
descriptor.contracts.length = 0;
|
|
151
|
+
}
|
|
152
|
+
try {
|
|
153
|
+
check(descriptor, data.schemas.host, data.schemas.host);
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
warnings.push(`constructed descriptor failed schema validation: ${error instanceof Error ? error.message : String(error)}`);
|
|
157
|
+
descriptor.contracts.length = 0;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// The descriptor is handed to untrusted admission/diagnostic callers. A
|
|
161
|
+
// cached mutable object would let one caller delete contracts or forge the
|
|
162
|
+
// runtime generation for every later negotiation, so freeze the complete
|
|
163
|
+
// graph and return immutable diagnostic arrays as well.
|
|
164
|
+
return Object.freeze({
|
|
165
|
+
descriptor: freezeDeep(descriptor),
|
|
166
|
+
dropped: Object.freeze(dropped),
|
|
167
|
+
warnings: Object.freeze(warnings),
|
|
168
|
+
});
|
|
169
|
+
}
|
|
@@ -66,6 +66,10 @@ export interface Config {
|
|
|
66
66
|
* terminals (≥110 cols) and unified below; `split`/`unified` force one
|
|
67
67
|
* layout. Editable live from the `/settings` screen. */
|
|
68
68
|
diffLayout?: 'auto' | 'split' | 'unified';
|
|
69
|
+
/** Thinking-block display: `preview` (default) streams a 2-3 line live
|
|
70
|
+
* preview and folds each step when it settles; `full` keeps thinking
|
|
71
|
+
* expanded until the whole turn ends. Editable live from `/settings`. */
|
|
72
|
+
thinkingFold?: 'preview' | 'full';
|
|
69
73
|
/** Shift+Tab session-mode cycle (array order IS the cycle order; index 0
|
|
70
74
|
* is the unmarked base mode). Each entry bundles any subset of the
|
|
71
75
|
* `plan`/`sandbox`/`approval` atoms; absent → the built-in
|
|
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;AAEF;;;;;;GAMG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAWvE"}
|
|
@@ -28,6 +28,7 @@ export const Config = Schema.object({
|
|
|
28
28
|
lang: Schema.string().required(false),
|
|
29
29
|
preset: Schema.string().required(false),
|
|
30
30
|
diffLayout: Schema.union(['auto', 'split', 'unified']).default('auto'),
|
|
31
|
+
thinkingFold: Schema.union(['preview', 'full']).default('preview'),
|
|
31
32
|
modes: Schema.array(Schema.object({
|
|
32
33
|
id: Schema.string(),
|
|
33
34
|
label: Schema.string().required(false),
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* messages.observe contract surface (C-042,
|
|
3
|
+
* `messages.dsh/v1alpha1#MessageObserver`): the host event broker, mounted
|
|
4
|
+
* by the dsh-tui-plugin-host row as `ctx.tuiMessageObserver`.
|
|
5
|
+
*
|
|
6
|
+
* Mapping (deliberately narrow):
|
|
7
|
+
*
|
|
8
|
+
* - `user/message` → `message.received` (the user's prompt)
|
|
9
|
+
* - `assistant/message` → `message.sent` (the assembled step reply)
|
|
10
|
+
* - EVERYTHING ELSE (assistant/chunk streaming, tool/*, turn/*, mode
|
|
11
|
+
* events, …) produces NO envelope — observation starts conservative.
|
|
12
|
+
*
|
|
13
|
+
* Envelope rules (the pinned `@dsh-std/messages` v0.15 definition):
|
|
14
|
+
*
|
|
15
|
+
* - `scope` = `session:<sessionId>`; `sequence` = the session event's own
|
|
16
|
+
* `seq` (monotonic within scope, gaps allowed — unmapped events simply
|
|
17
|
+
* leave holes); `eventId` = `<sessionId>:<seq>` with schema-unsafe
|
|
18
|
+
* characters flattened to `_`.
|
|
19
|
+
* - privacyClass is ALWAYS `sensitive` for now (conservative and
|
|
20
|
+
* irreversible-safe; finer classification is a future, documented step).
|
|
21
|
+
* - Content carries the text/image subset (MCP ContentBlock): text runs
|
|
22
|
+
* join (a pure-text message keeps the single trimmed block); session
|
|
23
|
+
* image blocks are `{type:'image', attachment}` REFERENCES resolved via
|
|
24
|
+
* the attachments service into base64 `data` with a 192 KiB budget —
|
|
25
|
+
* an unreadable/oversize image is dropped and marks `truncated`.
|
|
26
|
+
* `summary` is the sanitized first 200 cells of the joined text;
|
|
27
|
+
* `truncated` marks summary, content, or image-drop truncation.
|
|
28
|
+
* - EVERY produced envelope passes the official pinned validator before delivery;
|
|
29
|
+
* a malformed envelope is dropped with a warning, never delivered.
|
|
30
|
+
*
|
|
31
|
+
* Scope isolation (C-042): `subscribe` requires an exact `scope` string
|
|
32
|
+
* and an envelope is delivered ONLY to subscriptions of the same scope —
|
|
33
|
+
* a plugin moving between sessions subscribes per scope and never
|
|
34
|
+
* receives another session's sensitive content.
|
|
35
|
+
*
|
|
36
|
+
* Grant gating (`messages.observe.read`, default deny):
|
|
37
|
+
*
|
|
38
|
+
* - SUBSCRIBE time: a denied plugin gets a no-op disposer + a warning
|
|
39
|
+
* naming plugin and grant (fast fail, as-if-unsubscribed).
|
|
40
|
+
* - DELIVER time: every publish re-checks each subscription; a revoked
|
|
41
|
+
* grant RELEASES the subscription (contract cleanup rule) with one
|
|
42
|
+
* warning.
|
|
43
|
+
*
|
|
44
|
+
* Delivery semantics: at-most-once, no replay; envelope builds serialize
|
|
45
|
+
* broker-wide (image reads are async — delivery order stays the publish
|
|
46
|
+
* order, so sequence stays monotonic); callbacks of ONE subscription run
|
|
47
|
+
* serially (per-subscription promise chain); a throwing listener is
|
|
48
|
+
* isolated (warn, name the plugin, keep delivering to the rest). The host
|
|
49
|
+
* MUST NOT persist payload through this contract — the broker keeps no
|
|
50
|
+
* history.
|
|
51
|
+
*
|
|
52
|
+
* privacyClass: sensitive — envelope content is never logged.
|
|
53
|
+
*/
|
|
54
|
+
import { Context, Service } from '@deepseek-ai/cordis';
|
|
55
|
+
import { type GrantStore } from './grants.js';
|
|
56
|
+
import type { TuiEffectLedgerRuntime } from './effect-ledger.js';
|
|
57
|
+
/** Envelope content block (MCP ContentBlock text/image subset). */
|
|
58
|
+
export type MessagesObserveContentBlock = {
|
|
59
|
+
type: 'text';
|
|
60
|
+
text: string;
|
|
61
|
+
} | {
|
|
62
|
+
type: 'image';
|
|
63
|
+
data: string;
|
|
64
|
+
mimeType: string;
|
|
65
|
+
};
|
|
66
|
+
export interface MessagesObservePayload {
|
|
67
|
+
kind: 'message.created' | 'message.received' | 'message.sent';
|
|
68
|
+
messageId?: string;
|
|
69
|
+
author?: string;
|
|
70
|
+
content: MessagesObserveContentBlock[];
|
|
71
|
+
truncated?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/** The vendored `messages-observe-envelope-0.15.json` shape. */
|
|
74
|
+
export interface MessagesObserveEnvelope {
|
|
75
|
+
eventType: 'messages.observe';
|
|
76
|
+
eventVersion: '0.15';
|
|
77
|
+
eventId: string;
|
|
78
|
+
scope: string;
|
|
79
|
+
sequence: number;
|
|
80
|
+
privacyClass: 'public' | 'internal' | 'sensitive';
|
|
81
|
+
summary: string;
|
|
82
|
+
payload: MessagesObservePayload;
|
|
83
|
+
}
|
|
84
|
+
export type MessagesObserveListener = (envelope: MessagesObserveEnvelope) => void | Promise<void>;
|
|
85
|
+
/** Host-only session-event ingress. Plugins receive only `subscribe`; the
|
|
86
|
+
* channel uses this capability to publish events after its own identity check. */
|
|
87
|
+
export interface TuiMessageObserverHost {
|
|
88
|
+
publish(session: unknown, event: unknown): void;
|
|
89
|
+
}
|
|
90
|
+
/** Summary bound (cells; schema maxLength 1024 chars — 200 cells ≤ 1024). */
|
|
91
|
+
export declare const OBSERVE_SUMMARY_CELLS = 200;
|
|
92
|
+
/** Content text bound (chars; schema maxLength 262144). */
|
|
93
|
+
export declare const OBSERVE_CONTENT_MAX_CHARS = 262144;
|
|
94
|
+
/** Scope bound (schema maxLength 256). */
|
|
95
|
+
export declare const OBSERVE_SCOPE_MAX_CHARS = 256;
|
|
96
|
+
/** messageId bound (schema maxLength 256). */
|
|
97
|
+
export declare const OBSERVE_ID_MAX_CHARS = 256;
|
|
98
|
+
/** Raw image byte budget per block (192 KiB → ≤262144 base64 chars). */
|
|
99
|
+
export declare const OBSERVE_IMAGE_MAX_BYTES: number;
|
|
100
|
+
/** Base64 length bound implied by OBSERVE_IMAGE_MAX_BYTES. */
|
|
101
|
+
export declare const OBSERVE_IMAGE_BASE64_MAX_CHARS = 262144;
|
|
102
|
+
/** Per-callback budget; timeout closes the subscription deterministically. */
|
|
103
|
+
export declare const OBSERVE_CALLBACK_TIMEOUT_MS = 1500;
|
|
104
|
+
/** Bound queued callbacks per subscription so a stalled listener cannot grow
|
|
105
|
+
* an unbounded Promise chain before its timeout closes the subscription. */
|
|
106
|
+
export declare const OBSERVE_CALLBACK_QUEUE_LIMIT = 32;
|
|
107
|
+
/** Attachment reads are part of the broker build chain and therefore need an
|
|
108
|
+
* independent bound; a wedged reader must not stall every later envelope. */
|
|
109
|
+
export declare const OBSERVE_IMAGE_READ_TIMEOUT_MS = 1500;
|
|
110
|
+
declare module '@deepseek-ai/cordis' {
|
|
111
|
+
interface Context {
|
|
112
|
+
tuiMessageObserver: TuiMessageObserverRuntime;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* `ctx.tuiMessageObserver` — the messages.observe broker. The channel
|
|
117
|
+
* publishes mapped session events; plugins subscribe with their own
|
|
118
|
+
* context. When the vendored envelope schema is unavailable (packaging
|
|
119
|
+
* accident) the broker fails CLOSED: subscriptions are accepted but nothing
|
|
120
|
+
* is ever delivered (a host that cannot self-check must not emit).
|
|
121
|
+
*/
|
|
122
|
+
export declare class TuiMessageObserverRuntime extends Service {
|
|
123
|
+
#private;
|
|
124
|
+
constructor(ctx: Context, options?: {
|
|
125
|
+
grants?: GrantStore;
|
|
126
|
+
ledger?: TuiEffectLedgerRuntime;
|
|
127
|
+
validateEnvelope?: (value: unknown) => void;
|
|
128
|
+
/** @deprecated compatibility alias; prefer validateEnvelope. */
|
|
129
|
+
envelopeSchema?: Record<string, unknown>;
|
|
130
|
+
});
|
|
131
|
+
/** Grants: the plugin-host row's store when mounted, else a private read.
|
|
132
|
+
* Resolved PER CALL — sibling services mounted later by the same apply()
|
|
133
|
+
* are not visible to constructors (cordis), so a constructor-time probe
|
|
134
|
+
* would silently stick to the fallback. */
|
|
135
|
+
private grants;
|
|
136
|
+
/** Optional observability; a bare mount (tests) simply records nothing. */
|
|
137
|
+
private ledger;
|
|
138
|
+
/**
|
|
139
|
+
* Subscribe to observation envelopes for ONE scope. Identity = the verified
|
|
140
|
+
* Component bound to the PASSED activation (the same identity rule as
|
|
141
|
+
* storage); the scope
|
|
142
|
+
* is required and matched exactly — a plugin moving between sessions
|
|
143
|
+
* subscribes per scope and never receives another scope's sensitive
|
|
144
|
+
* content (C-042 isolation). A denied subscription fast-fails: no-op
|
|
145
|
+
* disposer + warning. The subscription releases when the caller's context
|
|
146
|
+
* unloads.
|
|
147
|
+
*/
|
|
148
|
+
subscribe(pluginCtx: Context, listener: MessagesObserveListener, options: {
|
|
149
|
+
scope: string;
|
|
150
|
+
}): () => void;
|
|
151
|
+
private buildAndDeliver;
|
|
152
|
+
/** Release a subscription exactly once (disposer, ctx unload, revoke). */
|
|
153
|
+
private drop;
|
|
154
|
+
/** Join the text blocks of a session message's content (text-only view). */
|
|
155
|
+
private textOf;
|
|
156
|
+
/**
|
|
157
|
+
* Map session content blocks to envelope blocks in order (text/image
|
|
158
|
+
* subset). Consecutive text runs join into one block (capped at
|
|
159
|
+
* OBSERVE_CONTENT_MAX_CHARS, pure-text messages keep the exact legacy
|
|
160
|
+
* shape: a single trimmed block); image blocks resolve through the
|
|
161
|
+
* attachments service (soft-probe) with a byte budget. A failed or
|
|
162
|
+
* oversize image becomes NO block plus the truncation mark; zero
|
|
163
|
+
* surviving blocks collapse to a single empty text block (schema
|
|
164
|
+
* minItems 1).
|
|
165
|
+
*/
|
|
166
|
+
private contentOf;
|
|
167
|
+
/** Resolve a session image block (`{type:'image', attachment}` — a
|
|
168
|
+
* REFERENCE, never inline data) to an envelope image block; undefined =
|
|
169
|
+
* drop (unreadable, oversize, bad media type, no attachment store). */
|
|
170
|
+
private imageBlockOf;
|
|
171
|
+
}
|
|
172
|
+
export declare function getHostMessageObserver(runtime: TuiMessageObserverRuntime | undefined): TuiMessageObserverHost | undefined;
|
|
173
|
+
//# sourceMappingURL=message-observer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-observer.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/message-observer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKtD,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAchE,mEAAmE;AACnE,MAAM,MAAM,2BAA2B,GACnC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAA;AAErD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,iBAAiB,GAAG,kBAAkB,GAAG,cAAc,CAAA;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,2BAA2B,EAAE,CAAA;IACtC,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,gEAAgE;AAChE,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,kBAAkB,CAAA;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ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