@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
|
@@ -83,16 +83,28 @@ export interface TuiWorkspaceProvider {
|
|
|
83
83
|
/** Provider-owned `/workspace <command>` extensions. */
|
|
84
84
|
commands?: readonly TuiWorkspaceCommand[];
|
|
85
85
|
}
|
|
86
|
+
/** Host-only workspace controls used by the TUI front door. Plugin-facing
|
|
87
|
+
* service methods below are intentionally scoped to their calling activation;
|
|
88
|
+
* the channel must use this facade to enumerate and route all providers. */
|
|
89
|
+
export interface TuiWorkspaceHost {
|
|
90
|
+
list(currentCwd: string, signal?: AbortSignal): Promise<readonly TuiWorkspaceTarget[]>;
|
|
91
|
+
resolve(request: string, currentCwd?: string, signal?: AbortSignal): Promise<TuiWorkspaceTarget | undefined>;
|
|
92
|
+
describe(cwd: string): TuiWorkspaceTarget;
|
|
93
|
+
commandShell(cwd: string): Promise<TuiCommandShell | undefined>;
|
|
94
|
+
rename(cwd: string, title: string): Promise<TuiWorkspaceTarget>;
|
|
95
|
+
commands(): readonly Pick<TuiWorkspaceCommand, 'name' | 'aliases' | 'description'>[];
|
|
96
|
+
runCommand(name: string, input: string, cwd: string, signal?: AbortSignal): Promise<TuiWorkspaceCommandResult | undefined>;
|
|
97
|
+
}
|
|
86
98
|
declare module '@deepseek-ai/cordis' {
|
|
87
99
|
interface Context {
|
|
88
100
|
tuiWorkspaces: TuiWorkspaceRuntime;
|
|
89
101
|
}
|
|
90
102
|
}
|
|
91
103
|
export declare const name = "dsh-tui-workspaces";
|
|
104
|
+
/** Bound every provider promise so one plugin cannot park workspace flows. */
|
|
105
|
+
export declare const WORKSPACE_PROVIDER_TIMEOUT_MS = 2000;
|
|
92
106
|
/** Registry and local fallback shared by the TUI and workspace plugins. */
|
|
93
107
|
export declare class TuiWorkspaceRuntime extends Service {
|
|
94
|
-
private readonly providers;
|
|
95
|
-
private readonly providerWaiters;
|
|
96
108
|
constructor(ctx: Context);
|
|
97
109
|
register(provider: TuiWorkspaceProvider): () => void;
|
|
98
110
|
list(currentCwd: string, signal?: AbortSignal): Promise<readonly TuiWorkspaceTarget[]>;
|
|
@@ -103,11 +115,10 @@ export declare class TuiWorkspaceRuntime extends Service {
|
|
|
103
115
|
rename(cwd: string, title: string): Promise<TuiWorkspaceTarget>;
|
|
104
116
|
commands(): readonly Pick<TuiWorkspaceCommand, 'name' | 'aliases' | 'description'>[];
|
|
105
117
|
runCommand(name: string, input: string, cwd: string, signal?: AbortSignal): Promise<TuiWorkspaceCommandResult | undefined>;
|
|
106
|
-
private workspaceRegistry;
|
|
107
|
-
private withStoredTitle;
|
|
108
118
|
private notifyProviderWaiters;
|
|
109
|
-
private waitForProvider;
|
|
110
119
|
}
|
|
120
|
+
/** Resolve the host-only facade for channel/plugin bootstrap code. */
|
|
121
|
+
export declare function getHostWorkspaceRuntime(runtime: TuiWorkspaceRuntime | undefined): TuiWorkspaceHost | undefined;
|
|
111
122
|
/** Local-only fallback for direct embedders that call createChannel() without
|
|
112
123
|
* mounting the optional workspace registry/provider service. */
|
|
113
124
|
export declare function createLocalWorkspaceRuntime(): Pick<TuiWorkspaceRuntime, 'list' | 'resolve' | 'describe' | 'commandShell' | 'rename' | 'commands' | 'runCommand'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/workspaces.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/workspaces.ts"],"names":[],"mappings":"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"}
|
|
@@ -7,211 +7,328 @@
|
|
|
7
7
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
8
|
import { basename, isAbsolute, resolve } from 'node:path';
|
|
9
9
|
import { Service } from '@deepseek-ai/cordis';
|
|
10
|
+
import { activationFiber, bindCallerEffect, compositionRoot, concreteService, requirePluginCaller } from './host-access.js';
|
|
10
11
|
export const name = 'dsh-tui-workspaces';
|
|
12
|
+
/** Bound every provider promise so one plugin cannot park workspace flows. */
|
|
13
|
+
export const WORKSPACE_PROVIDER_TIMEOUT_MS = 2000;
|
|
14
|
+
async function providerWithBudget(task, signal, timeoutMs = WORKSPACE_PROVIDER_TIMEOUT_MS) {
|
|
15
|
+
signal?.throwIfAborted();
|
|
16
|
+
let timer;
|
|
17
|
+
const work = Promise.resolve().then(task);
|
|
18
|
+
const timeout = new Promise(resolveTimeout => {
|
|
19
|
+
timer = setTimeout(() => resolveTimeout(undefined), timeoutMs);
|
|
20
|
+
});
|
|
21
|
+
try {
|
|
22
|
+
return await Promise.race([work, timeout]);
|
|
23
|
+
}
|
|
24
|
+
finally {
|
|
25
|
+
if (timer !== undefined)
|
|
26
|
+
clearTimeout(timer);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
11
29
|
/** Registry and local fallback shared by the TUI and workspace plugins. */
|
|
12
30
|
export class TuiWorkspaceRuntime extends Service {
|
|
13
|
-
providers = new Set();
|
|
14
|
-
providerWaiters = new Set();
|
|
15
31
|
constructor(ctx) {
|
|
16
32
|
super(ctx, 'tuiWorkspaces');
|
|
33
|
+
const runtime = this;
|
|
34
|
+
const state = {
|
|
35
|
+
hostContext: compositionRoot(ctx),
|
|
36
|
+
providers: new Set(),
|
|
37
|
+
providerOwners: new Map(),
|
|
38
|
+
providerWaiters: new Set(),
|
|
39
|
+
host: undefined,
|
|
40
|
+
};
|
|
41
|
+
state.host = Object.freeze({
|
|
42
|
+
list: (currentCwd, signal) => listWorkspaces(runtime, currentCwd, signal, undefined),
|
|
43
|
+
resolve: (reference, currentCwd, signal) => resolveWorkspace(runtime, reference, currentCwd ?? process.cwd(), signal, undefined),
|
|
44
|
+
describe: (cwd) => describeWorkspace(runtime, cwd, undefined),
|
|
45
|
+
commandShell: (cwd) => commandShellFor(runtime, cwd, undefined),
|
|
46
|
+
rename: (cwd, title) => renameWorkspace(runtime, cwd, title, undefined),
|
|
47
|
+
commands: () => workspaceCommands(runtime, undefined),
|
|
48
|
+
runCommand: (name, input, cwd, signal) => runWorkspaceCommand(runtime, name, input, cwd, signal, undefined),
|
|
49
|
+
});
|
|
50
|
+
workspaceStates.set(this, state);
|
|
17
51
|
}
|
|
18
52
|
register(provider) {
|
|
19
|
-
this.
|
|
53
|
+
const caller = requirePluginCaller(this.ctx, 'tuiWorkspaces.register', this);
|
|
54
|
+
const state = workspaceStateFor(this);
|
|
55
|
+
state.providers.add(provider);
|
|
56
|
+
const owner = activationFiber(caller);
|
|
57
|
+
if (owner === undefined) {
|
|
58
|
+
state.providers.delete(provider);
|
|
59
|
+
throw new Error('dsh-tui: tuiWorkspaces.register requires a live activation');
|
|
60
|
+
}
|
|
61
|
+
state.providerOwners.set(provider, owner);
|
|
20
62
|
this.notifyProviderWaiters();
|
|
21
|
-
|
|
22
|
-
|
|
63
|
+
const dispose = () => {
|
|
64
|
+
state.providers.delete(provider);
|
|
65
|
+
state.providerOwners.delete(provider);
|
|
23
66
|
this.notifyProviderWaiters();
|
|
24
67
|
};
|
|
68
|
+
bindCallerEffect(caller, dispose);
|
|
69
|
+
return dispose;
|
|
25
70
|
}
|
|
26
71
|
async list(currentCwd, signal) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
for (const provider of this.providers) {
|
|
30
|
-
try {
|
|
31
|
-
for (const target of await provider.list(signal))
|
|
32
|
-
targets.set(target.uri, this.withStoredTitle(target));
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
this.ctx.logger.warn(`dsh-tui: workspace provider list failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
// The official registry is the durable catalog. Provider-owned aliases
|
|
39
|
-
// have already been added above with richer URI/badge metadata; remaining
|
|
40
|
-
// records are ordinary local workspaces.
|
|
41
|
-
for (const workspace of this.workspaceRegistry()?.list() ?? []) {
|
|
42
|
-
if ([...targets.values()].some(target => sameCwd(target.cwd, workspace.path)))
|
|
43
|
-
continue;
|
|
44
|
-
targets.set(localWorkspaceUri(workspace.path), {
|
|
45
|
-
...localWorkspaceTarget(workspace.path),
|
|
46
|
-
label: workspace.title,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
// The current local directory is always selectable, even in a bare TUI
|
|
50
|
-
// composition without dsh-workspace or another provider.
|
|
51
|
-
if (![...targets.values()].some(target => sameCwd(target.cwd, currentCwd))) {
|
|
52
|
-
const local = localWorkspaceTarget(currentCwd);
|
|
53
|
-
targets.set(local.uri, local);
|
|
54
|
-
}
|
|
55
|
-
return [...targets.values()].sort((left, right) => {
|
|
56
|
-
if (left.kind !== right.kind)
|
|
57
|
-
return left.kind === 'local' ? -1 : 1;
|
|
58
|
-
return left.label.localeCompare(right.label);
|
|
59
|
-
});
|
|
72
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.list');
|
|
73
|
+
return listWorkspaces(this, currentCwd, signal, owner);
|
|
60
74
|
}
|
|
61
75
|
/** Resolve a URI, briefly allowing concurrently mounted providers to register. */
|
|
62
76
|
async resolve(reference, currentCwd = process.cwd(), signal) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const deadline = Date.now() + 5000;
|
|
66
|
-
const scheme = uriScheme(reference);
|
|
67
|
-
if (scheme === undefined) {
|
|
68
|
-
const owner = [...this.providers].find((provider) => {
|
|
69
|
-
try {
|
|
70
|
-
return provider.describe(currentCwd) !== undefined;
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
if (owner !== undefined)
|
|
77
|
-
return owner.resolvePath?.(reference, currentCwd, signal);
|
|
78
|
-
return localWorkspaceTarget(resolve(currentCwd, reference));
|
|
79
|
-
}
|
|
80
|
-
const local = parseLocalWorkspaceReference(reference);
|
|
81
|
-
if (local !== undefined)
|
|
82
|
-
return local;
|
|
83
|
-
for (;;) {
|
|
84
|
-
signal?.throwIfAborted();
|
|
85
|
-
const owners = [...this.providers].filter(provider => provider.schemes.some(candidate => candidate.toLowerCase() === scheme));
|
|
86
|
-
for (const provider of owners) {
|
|
87
|
-
const target = await provider.resolve(reference, signal);
|
|
88
|
-
if (target !== undefined)
|
|
89
|
-
return target;
|
|
90
|
-
}
|
|
91
|
-
if (owners.length > 0)
|
|
92
|
-
return undefined;
|
|
93
|
-
if (Date.now() >= deadline)
|
|
94
|
-
return undefined;
|
|
95
|
-
await this.waitForProvider(Math.min(100, deadline - Date.now()), signal);
|
|
96
|
-
}
|
|
77
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.resolve');
|
|
78
|
+
return resolveWorkspace(this, reference, currentCwd, signal, owner);
|
|
97
79
|
}
|
|
98
80
|
describe(cwd) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
try {
|
|
102
|
-
target = provider.describe(cwd);
|
|
103
|
-
}
|
|
104
|
-
catch (error) {
|
|
105
|
-
this.ctx.logger.warn(`dsh-tui: workspace provider describe failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
if (target !== undefined)
|
|
109
|
-
return this.withStoredTitle(target);
|
|
110
|
-
}
|
|
111
|
-
return this.withStoredTitle(localWorkspaceTarget(cwd));
|
|
81
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.describe');
|
|
82
|
+
return describeWorkspace(this, cwd, owner);
|
|
112
83
|
}
|
|
113
84
|
async commandShell(cwd) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
85
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.commandShell');
|
|
86
|
+
return commandShellFor(this, cwd, owner);
|
|
87
|
+
}
|
|
88
|
+
async rename(cwd, title) {
|
|
89
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.rename');
|
|
90
|
+
return renameWorkspace(this, cwd, title, owner);
|
|
91
|
+
}
|
|
92
|
+
commands() {
|
|
93
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.commands');
|
|
94
|
+
return workspaceCommands(this, owner);
|
|
95
|
+
}
|
|
96
|
+
async runCommand(name, input, cwd, signal) {
|
|
97
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.runCommand');
|
|
98
|
+
return runWorkspaceCommand(this, name, input, cwd, signal, owner);
|
|
99
|
+
}
|
|
100
|
+
notifyProviderWaiters() {
|
|
101
|
+
const state = workspaceStateFor(this);
|
|
102
|
+
for (const waiter of state.providerWaiters)
|
|
103
|
+
waiter();
|
|
104
|
+
state.providerWaiters.clear();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const workspaceStates = new WeakMap();
|
|
108
|
+
function workspaceStateFor(runtime) {
|
|
109
|
+
const state = workspaceStates.get(concreteService(runtime));
|
|
110
|
+
if (state === undefined)
|
|
111
|
+
throw new Error('tuiWorkspaces host state is unavailable');
|
|
112
|
+
return state;
|
|
113
|
+
}
|
|
114
|
+
/** Resolve the host-only facade for channel/plugin bootstrap code. */
|
|
115
|
+
export function getHostWorkspaceRuntime(runtime) {
|
|
116
|
+
if (runtime === undefined)
|
|
117
|
+
return undefined;
|
|
118
|
+
try {
|
|
119
|
+
return workspaceStateFor(runtime).host;
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function workspaceCaller(runtime, capability) {
|
|
126
|
+
const caller = requirePluginCaller(runtimeContext(runtime), capability, runtime);
|
|
127
|
+
const owner = activationFiber(caller);
|
|
128
|
+
if (owner === undefined)
|
|
129
|
+
throw new Error(`dsh-tui: ${capability} requires a live activation`);
|
|
130
|
+
return owner;
|
|
131
|
+
}
|
|
132
|
+
function runtimeContext(runtime) {
|
|
133
|
+
return runtime.ctx;
|
|
134
|
+
}
|
|
135
|
+
function providersFor(state, owner) {
|
|
136
|
+
if (owner === undefined)
|
|
137
|
+
return [...state.providers];
|
|
138
|
+
return [...state.providers].filter(provider => state.providerOwners.get(provider) === owner);
|
|
139
|
+
}
|
|
140
|
+
async function listWorkspaces(runtime, currentCwd, signal, owner) {
|
|
141
|
+
signal?.throwIfAborted();
|
|
142
|
+
const state = workspaceStateFor(runtime);
|
|
143
|
+
const targets = new Map();
|
|
144
|
+
for (const provider of providersFor(state, owner)) {
|
|
145
|
+
try {
|
|
146
|
+
const listed = await providerWithBudget(() => provider.list(signal), signal);
|
|
147
|
+
if (listed === undefined)
|
|
121
148
|
continue;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
149
|
+
for (const target of listed)
|
|
150
|
+
targets.set(target.uri, withStoredTitle(runtime, target));
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
runtimeContext(runtime).logger.warn(`dsh-tui: workspace provider list failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
125
154
|
}
|
|
126
|
-
return undefined;
|
|
127
155
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
156
|
+
for (const workspace of workspaceRegistry(runtime)?.list() ?? []) {
|
|
157
|
+
if ([...targets.values()].some(target => sameCwd(target.cwd, workspace.path)))
|
|
158
|
+
continue;
|
|
159
|
+
targets.set(localWorkspaceUri(workspace.path), {
|
|
160
|
+
...localWorkspaceTarget(workspace.path),
|
|
161
|
+
label: workspace.title,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (![...targets.values()].some(target => sameCwd(target.cwd, currentCwd))) {
|
|
165
|
+
const local = localWorkspaceTarget(currentCwd);
|
|
166
|
+
targets.set(local.uri, local);
|
|
167
|
+
}
|
|
168
|
+
return [...targets.values()].sort((left, right) => {
|
|
169
|
+
if (left.kind !== right.kind)
|
|
170
|
+
return left.kind === 'local' ? -1 : 1;
|
|
171
|
+
return left.label.localeCompare(right.label);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
async function resolveWorkspace(runtime, reference, currentCwd, signal, owner) {
|
|
175
|
+
const state = workspaceStateFor(runtime);
|
|
176
|
+
const providers = () => providersFor(state, owner);
|
|
177
|
+
if (isAbsolute(reference))
|
|
178
|
+
return localWorkspaceTarget(reference);
|
|
179
|
+
const deadline = Date.now() + 5000;
|
|
180
|
+
const scheme = uriScheme(reference);
|
|
181
|
+
if (scheme === undefined) {
|
|
182
|
+
const provider = providers().find(candidate => {
|
|
134
183
|
try {
|
|
135
|
-
|
|
184
|
+
return candidate.describe(currentCwd) !== undefined;
|
|
136
185
|
}
|
|
137
186
|
catch {
|
|
138
|
-
|
|
187
|
+
return false;
|
|
139
188
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
// failure notification instead of silently writing a local record.
|
|
146
|
-
const renamed = await provider.rename?.(cwd, normalizedTitle);
|
|
147
|
-
if (renamed !== undefined)
|
|
148
|
-
return this.withStoredTitle(renamed);
|
|
149
|
-
break;
|
|
189
|
+
});
|
|
190
|
+
if (provider !== undefined) {
|
|
191
|
+
return provider.resolvePath === undefined
|
|
192
|
+
? undefined
|
|
193
|
+
: providerWithBudget(() => provider.resolvePath(reference, currentCwd, signal), signal);
|
|
150
194
|
}
|
|
151
|
-
|
|
152
|
-
if (registry === undefined)
|
|
153
|
-
throw new Error('workspace registry is unavailable');
|
|
154
|
-
const workspace = registry.list().find(candidate => sameCwd(candidate.path, cwd))
|
|
155
|
-
?? await registry.create(cwd, normalizedTitle);
|
|
156
|
-
await workspace.setTitle(normalizedTitle);
|
|
157
|
-
return { ...this.describe(cwd), label: normalizedTitle };
|
|
195
|
+
return localWorkspaceTarget(resolve(currentCwd, reference));
|
|
158
196
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
197
|
+
const local = parseLocalWorkspaceReference(reference);
|
|
198
|
+
if (local !== undefined)
|
|
199
|
+
return local;
|
|
200
|
+
for (;;) {
|
|
201
|
+
signal?.throwIfAborted();
|
|
202
|
+
const owners = providers().filter(provider => provider.schemes.some(candidate => candidate.toLowerCase() === scheme));
|
|
203
|
+
for (const provider of owners) {
|
|
204
|
+
const target = await providerWithBudget(() => provider.resolve(reference, signal), signal, Math.max(1, deadline - Date.now()));
|
|
205
|
+
if (target !== undefined)
|
|
206
|
+
return target;
|
|
207
|
+
}
|
|
208
|
+
if (owners.length > 0)
|
|
209
|
+
return undefined;
|
|
210
|
+
if (Date.now() >= deadline)
|
|
211
|
+
return undefined;
|
|
212
|
+
await waitForProvider(runtime, Math.min(100, deadline - Date.now()), signal);
|
|
165
213
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
214
|
+
}
|
|
215
|
+
function describeWorkspace(runtime, cwd, owner) {
|
|
216
|
+
const state = workspaceStateFor(runtime);
|
|
217
|
+
for (const provider of providersFor(state, owner)) {
|
|
218
|
+
let target;
|
|
219
|
+
try {
|
|
220
|
+
target = provider.describe(cwd);
|
|
173
221
|
}
|
|
174
|
-
|
|
222
|
+
catch (error) {
|
|
223
|
+
runtimeContext(runtime).logger.warn(`dsh-tui: workspace provider describe failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if (target !== undefined)
|
|
227
|
+
return withStoredTitle(runtime, target);
|
|
175
228
|
}
|
|
176
|
-
|
|
177
|
-
|
|
229
|
+
return withStoredTitle(runtime, localWorkspaceTarget(cwd));
|
|
230
|
+
}
|
|
231
|
+
async function commandShellFor(runtime, cwd, owner) {
|
|
232
|
+
const state = workspaceStateFor(runtime);
|
|
233
|
+
for (const provider of providersFor(state, owner)) {
|
|
234
|
+
let shell;
|
|
235
|
+
try {
|
|
236
|
+
shell = await providerWithBudget(() => provider.commandShell?.(cwd), undefined);
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
runtimeContext(runtime).logger.warn(`dsh-tui: workspace provider commandShell failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
if (shell !== undefined)
|
|
243
|
+
return shell;
|
|
178
244
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
245
|
+
return undefined;
|
|
246
|
+
}
|
|
247
|
+
async function renameWorkspace(runtime, cwd, title, owner) {
|
|
248
|
+
const normalizedTitle = title.trim();
|
|
249
|
+
if (normalizedTitle.length === 0)
|
|
250
|
+
throw new Error('workspace title must not be empty');
|
|
251
|
+
const state = workspaceStateFor(runtime);
|
|
252
|
+
let providerOwned = false;
|
|
253
|
+
for (const provider of providersFor(state, owner)) {
|
|
254
|
+
let owned = false;
|
|
255
|
+
try {
|
|
256
|
+
owned = provider.describe(cwd) !== undefined;
|
|
257
|
+
}
|
|
258
|
+
catch {
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
if (!owned)
|
|
262
|
+
continue;
|
|
263
|
+
providerOwned = true;
|
|
264
|
+
const renamed = await providerWithBudget(() => provider.rename?.(cwd, normalizedTitle), undefined);
|
|
265
|
+
if (renamed !== undefined)
|
|
266
|
+
return withStoredTitle(runtime, renamed);
|
|
267
|
+
break;
|
|
182
268
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
269
|
+
// A plugin may only mutate the durable title ledger for a workspace it
|
|
270
|
+
// owns. Host callers retain the historical local-registry behavior.
|
|
271
|
+
if (owner !== undefined && !providerOwned) {
|
|
272
|
+
throw new Error('workspace is not owned by the calling activation');
|
|
187
273
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
};
|
|
210
|
-
const timer = setTimeout(finish, timeoutMs);
|
|
211
|
-
this.providerWaiters.add(finish);
|
|
212
|
-
signal?.addEventListener('abort', abort, { once: true });
|
|
213
|
-
});
|
|
274
|
+
const registry = workspaceRegistry(runtime);
|
|
275
|
+
if (registry === undefined)
|
|
276
|
+
throw new Error('workspace registry is unavailable');
|
|
277
|
+
const workspace = registry.list().find(candidate => sameCwd(candidate.path, cwd))
|
|
278
|
+
?? await registry.create(cwd, normalizedTitle);
|
|
279
|
+
await workspace.setTitle(normalizedTitle);
|
|
280
|
+
return { ...describeWorkspace(runtime, cwd, owner), label: normalizedTitle };
|
|
281
|
+
}
|
|
282
|
+
function workspaceCommands(runtime, owner) {
|
|
283
|
+
return providersFor(workspaceStateFor(runtime), owner).flatMap(provider => provider.commands ?? []).map(command => ({
|
|
284
|
+
name: command.name,
|
|
285
|
+
aliases: command.aliases,
|
|
286
|
+
description: command.description,
|
|
287
|
+
}));
|
|
288
|
+
}
|
|
289
|
+
async function runWorkspaceCommand(runtime, name, input, cwd, signal, owner) {
|
|
290
|
+
const normalized = name.toLowerCase();
|
|
291
|
+
for (const provider of providersFor(workspaceStateFor(runtime), owner)) {
|
|
292
|
+
const command = provider.commands?.find(candidate => candidate.name.toLowerCase() === normalized
|
|
293
|
+
|| candidate.aliases?.some(alias => alias.toLowerCase() === normalized));
|
|
294
|
+
if (command !== undefined)
|
|
295
|
+
return providerWithBudget(() => command.run(input, { cwd }, signal), signal);
|
|
214
296
|
}
|
|
297
|
+
return undefined;
|
|
298
|
+
}
|
|
299
|
+
function workspaceRegistry(runtime) {
|
|
300
|
+
return workspaceStateFor(runtime).hostContext.get('workspaceRegistry');
|
|
301
|
+
}
|
|
302
|
+
function withStoredTitle(runtime, target) {
|
|
303
|
+
const workspace = workspaceRegistry(runtime)?.list().find(candidate => sameCwd(candidate.path, target.cwd));
|
|
304
|
+
return workspace === undefined ? target : { ...target, label: workspace.title };
|
|
305
|
+
}
|
|
306
|
+
function waitForProvider(runtime, timeoutMs, signal) {
|
|
307
|
+
if (timeoutMs <= 0)
|
|
308
|
+
return Promise.resolve();
|
|
309
|
+
return new Promise((resolveWait, reject) => {
|
|
310
|
+
let settled = false;
|
|
311
|
+
const finish = () => {
|
|
312
|
+
if (settled)
|
|
313
|
+
return;
|
|
314
|
+
settled = true;
|
|
315
|
+
clearTimeout(timer);
|
|
316
|
+
signal?.removeEventListener('abort', abort);
|
|
317
|
+
workspaceStateFor(runtime).providerWaiters.delete(finish);
|
|
318
|
+
resolveWait();
|
|
319
|
+
};
|
|
320
|
+
const abort = () => {
|
|
321
|
+
if (settled)
|
|
322
|
+
return;
|
|
323
|
+
settled = true;
|
|
324
|
+
clearTimeout(timer);
|
|
325
|
+
workspaceStateFor(runtime).providerWaiters.delete(finish);
|
|
326
|
+
reject(signal?.reason instanceof Error ? signal.reason : new Error('workspace resolution aborted'));
|
|
327
|
+
};
|
|
328
|
+
const timer = setTimeout(finish, timeoutMs);
|
|
329
|
+
workspaceStateFor(runtime).providerWaiters.add(finish);
|
|
330
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
331
|
+
});
|
|
215
332
|
}
|
|
216
333
|
/** Local-only fallback for direct embedders that call createChannel() without
|
|
217
334
|
* mounting the optional workspace registry/provider service. */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './dsh-adapter/extensions.js';
|
|
2
|
+
export { DECISION_HANDLER_TIMEOUT_MS, DECISION_TOTAL_TIMEOUT_MS, normalizeCancelDecision, } from './dsh-adapter/extension-events.js';
|
|
3
|
+
export type { TuiDecisionContext, TuiInputEvent, TuiInputDecision, TuiRewindPromptEvent, TuiRewindMode, TuiRewindPromptDecision, TuiRewindDoneEvent, TuiSessionSwitchEvent, TuiSessionSwitchDecision, TuiSessionSwitchedEvent, TuiCompactEvent, TuiCompactDecision, } from './dsh-adapter/extension-events.js';
|
|
4
|
+
export { DIALOG_DEFAULT_TIMEOUT_MS, INPUT_CELLS, TuiDialogRuntime, TuiDialogStore, } from './dsh-adapter/dialogs.js';
|
|
5
|
+
export type { TuiDialogAnswer, TuiDialogBase, TuiDialogConfirmRequest, TuiDialogInputRequest, TuiDialogSelectOption, TuiDialogSelectRequest, TuiDialogSnapshot, } from './dsh-adapter/dialogs.js';
|
|
6
|
+
export { TuiStatusRuntime, TuiStatusStore } from './dsh-adapter/status.js';
|
|
7
|
+
export type { TuiStatusEntry } from './dsh-adapter/status.js';
|
|
8
|
+
export { matchShortcut, parseShortcutCombo, TuiShortcutRuntime } from './dsh-adapter/shortcuts.js';
|
|
9
|
+
export type { TuiShortcutKey, TuiShortcutOptions } from './dsh-adapter/shortcuts.js';
|
|
10
|
+
export { TuiRendererRuntime } from './dsh-adapter/renderers.js';
|
|
11
|
+
export type { TuiEntryRenderer, TuiEntryRenderResult } from './dsh-adapter/renderers.js';
|
|
12
|
+
export { DECISION_EVENT_PERMISSIONS } from './dsh-adapter/decision-guard.js';
|
|
13
|
+
//# sourceMappingURL=extensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/extensions.ts"],"names":[],"mappings":"AAMA,cAAc,6BAA6B,CAAA;AAI3C,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,mCAAmC,CAAA;AAC1C,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,GACnB,MAAM,mCAAmC,CAAA;AAI1C,OAAO,EACL,yBAAyB,EACzB,WAAW,EACX,gBAAgB,EAChB,cAAc,GACf,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC1E,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAClG,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAGxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Re-export shim: the Cordis-backed implementation lives behind the adapter
|
|
2
|
+
// boundary so UI consumers never import official @deepseek-ai/* packages.
|
|
3
|
+
// Plugin authors import the seam types from here
|
|
4
|
+
// (`@deepseek-harness-tui/dsh-tui/extensions`); importing the module also
|
|
5
|
+
// applies the `declare module '@deepseek-ai/cordis'` augmentation for the
|
|
6
|
+
// decision events and the four service properties on Context.
|
|
7
|
+
export * from './dsh-adapter/extensions.js';
|
|
8
|
+
// Decision dispatch is a host/channel operation. Export only the event
|
|
9
|
+
// vocabulary and safe normalizers; dispatching an arbitrary payload through
|
|
10
|
+
// this module would let a plugin trigger every other plugin's handlers.
|
|
11
|
+
export { DECISION_HANDLER_TIMEOUT_MS, DECISION_TOTAL_TIMEOUT_MS, normalizeCancelDecision, } from './dsh-adapter/extension-events.js';
|
|
12
|
+
// Keep host accessors out of the plugin-facing export. The implementation
|
|
13
|
+
// modules expose them only so the TUI host can wire Chat/channel; exporting
|
|
14
|
+
// them here would let a plugin recover the private queue/store/dispatcher.
|
|
15
|
+
export { DIALOG_DEFAULT_TIMEOUT_MS, INPUT_CELLS, TuiDialogRuntime, TuiDialogStore, } from './dsh-adapter/dialogs.js';
|
|
16
|
+
export { TuiStatusRuntime, TuiStatusStore } from './dsh-adapter/status.js';
|
|
17
|
+
export { matchShortcut, parseShortcutCombo, TuiShortcutRuntime } from './dsh-adapter/shortcuts.js';
|
|
18
|
+
export { TuiRendererRuntime } from './dsh-adapter/renderers.js';
|
|
19
|
+
// The D-7 permission vocabulary (which grant each decision event needs) is
|
|
20
|
+
// part of the plugin-facing contract too.
|
|
21
|
+
export { DECISION_EVENT_PERMISSIONS } from './dsh-adapter/decision-guard.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=force-production-react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"force-production-react.d.ts","sourceRoot":"","sources":["../../src/force-production-react.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* React-reconciler selects its dev/production build at require time from
|
|
4
|
+
* NODE_ENV; the dev build records one performance.measure() per render into
|
|
5
|
+
* an unbounded buffer — the 4 GB long-session OOM (b1e06d8). Every launcher
|
|
6
|
+
* forces production, but a direct `dsh --profile dsh-tui` boot loads this
|
|
7
|
+
* plugin without one and silently regressed to the dev build. This module
|
|
8
|
+
* must stay the FIRST import of the package entry so its body runs before
|
|
9
|
+
* any module in the plugin graph requires react. `??=` keeps an explicit
|
|
10
|
+
* environment choice (a debugging session) in control.
|
|
11
|
+
*/
|
|
12
|
+
process.env.NODE_ENV ??= 'production';
|