@deepseek-harness-tui/dsh-tui 0.15.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -8
- package/guide/dsh-tui-guide/claude-backend.en.md +8 -0
- package/guide/dsh-tui-guide/claude-backend.md +5 -0
- package/guide/dsh-tui-guide/codex-backend.en.md +13 -3
- package/guide/dsh-tui-guide/codex-backend.md +9 -2
- package/guide/dsh-tui-guide/configuration.en.md +39 -2
- package/guide/dsh-tui-guide/configuration.md +34 -2
- package/guide/dsh-tui-guide/getting-started.en.md +32 -9
- package/guide/dsh-tui-guide/getting-started.md +27 -8
- package/guide/dsh-tui-guide/interaction.en.md +8 -1
- package/guide/dsh-tui-guide/interaction.md +8 -1
- package/guide/dsh-tui-guide/plugins.en.md +66 -5
- package/guide/dsh-tui-guide/plugins.md +37 -3
- package/guide/dsh-tui-guide/user-guide.en.md +3 -2
- package/guide/dsh-tui-guide/user-guide.md +3 -2
- package/lib/settings.json +1 -1
- package/lib/types/adapter/channel/projection.d.ts.map +1 -1
- package/lib/types/adapter/channel/projection.js +1 -0
- package/lib/types/adapter/channel/ui-policy.d.ts +1 -1
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +1 -0
- package/lib/types/adapter/ports/channel-catalog.d.ts +5 -1
- package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-settings.d.ts +5 -3
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +7 -1
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +47 -0
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel.d.ts +2 -0
- package/lib/types/adapter/ports/channel.d.ts.map +1 -1
- package/lib/types/agent/events.d.ts +3 -2
- package/lib/types/agent/events.d.ts.map +1 -1
- package/lib/types/backends/codex/contract.d.ts +3 -0
- package/lib/types/backends/codex/contract.d.ts.map +1 -1
- package/lib/types/backends/codex/contract.js +3 -0
- package/lib/types/backends/codex/session/async-questions.d.ts +17 -0
- package/lib/types/backends/codex/session/async-questions.d.ts.map +1 -0
- package/lib/types/backends/codex/session/async-questions.js +89 -0
- package/lib/types/backends/codex/session/session.d.ts.map +1 -1
- package/lib/types/backends/codex/session/session.js +35 -9
- package/lib/types/backends/codex/text.d.ts +3 -3
- package/lib/types/backends/codex/text.js +1 -1
- package/lib/types/backends/codex/translate/items.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/items.js +3 -1
- package/lib/types/backends/codex/translate/question-reply.d.ts +11 -0
- package/lib/types/backends/codex/translate/question-reply.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/question-reply.js +53 -0
- package/lib/types/channel/projection.d.ts.map +1 -1
- package/lib/types/channel/projection.js +10 -0
- package/lib/types/commands.d.ts +10 -0
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +11 -2
- package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
- package/lib/types/components/CommandSuggestions.js +4 -1
- package/lib/types/components/LogoV2.d.ts +4 -1
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +5 -3
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +95 -14
- package/lib/types/components/PermissionsPicker.d.ts +10 -1
- package/lib/types/components/PermissionsPicker.d.ts.map +1 -1
- package/lib/types/components/PermissionsPicker.js +24 -16
- package/lib/types/components/PluginInstallPane.d.ts +21 -0
- package/lib/types/components/PluginInstallPane.d.ts.map +1 -0
- package/lib/types/components/PluginInstallPane.js +84 -0
- package/lib/types/components/PluginManagePane.d.ts +21 -0
- package/lib/types/components/PluginManagePane.d.ts.map +1 -0
- package/lib/types/components/PluginManagePane.js +69 -0
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +7 -3
- package/lib/types/components/SubagentCard.d.ts +13 -1
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +27 -12
- package/lib/types/components/SubagentDashboard.d.ts +8 -1
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +58 -16
- package/lib/types/components/launchpadLayout.d.ts +14 -1
- package/lib/types/components/launchpadLayout.d.ts.map +1 -1
- package/lib/types/components/launchpadLayout.js +36 -17
- package/lib/types/components/messages/TeamMessageBubble.d.ts +20 -0
- package/lib/types/components/messages/TeamMessageBubble.d.ts.map +1 -0
- package/lib/types/components/messages/TeamMessageBubble.js +15 -0
- package/lib/types/components/sidePanel/PanelHost.d.ts.map +1 -1
- package/lib/types/components/sidePanel/PanelHost.js +5 -1
- package/lib/types/components/sidePanel/PanelStore.d.ts +8 -0
- package/lib/types/components/sidePanel/PanelStore.d.ts.map +1 -1
- package/lib/types/components/sidePanel/PanelStore.js +11 -0
- package/lib/types/components/sidePanel/SidePanelColumn.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelColumn.js +13 -1
- package/lib/types/components/sidePanel/SidePanelRuntimeContext.d.ts +7 -0
- package/lib/types/components/sidePanel/SidePanelRuntimeContext.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelRuntimeContext.js +4 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +3 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.js +20 -8
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts +2 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +104 -13
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +6 -2
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +61 -15
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts +14 -4
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadView.js +90 -5
- package/lib/types/components/sidePanel/btw/threads.d.ts +18 -0
- package/lib/types/components/sidePanel/btw/threads.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/threads.js +51 -0
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
- package/lib/types/components/sidePanel/builtinPanels.js +5 -1
- package/lib/types/components/sidePanel/companion/SplashMascot.d.ts +5 -1
- package/lib/types/components/sidePanel/companion/SplashMascot.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/SplashMascot.js +19 -4
- package/lib/types/components/sidePanel/companion/skins.d.ts +8 -0
- package/lib/types/components/sidePanel/companion/skins.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/skins.js +57 -12
- package/lib/types/components/sidePanel/types.d.ts +6 -0
- package/lib/types/components/sidePanel/types.d.ts.map +1 -1
- package/lib/types/components/splashArtRows.d.ts +29 -0
- package/lib/types/components/splashArtRows.d.ts.map +1 -0
- package/lib/types/components/splashArtRows.js +31 -0
- package/lib/types/components/teamRoster.d.ts +70 -0
- package/lib/types/components/teamRoster.d.ts.map +1 -0
- package/lib/types/components/teamRoster.js +78 -0
- package/lib/types/dsh-adapter/admission-loader.d.ts +82 -0
- package/lib/types/dsh-adapter/admission-loader.d.ts.map +1 -1
- package/lib/types/dsh-adapter/admission-loader.js +73 -28
- package/lib/types/dsh-adapter/agent-view.d.ts.map +1 -1
- package/lib/types/dsh-adapter/agent-view.js +3 -1
- package/lib/types/dsh-adapter/approvals.d.ts +7 -0
- package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
- package/lib/types/dsh-adapter/approvals.js +45 -1
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +68 -8
- package/lib/types/dsh-adapter/backend-assembly.d.ts +31 -0
- package/lib/types/dsh-adapter/backend-assembly.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend-assembly.js +225 -0
- package/lib/types/dsh-adapter/backend-contribution.d.ts +36 -0
- package/lib/types/dsh-adapter/backend-contribution.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend-contribution.js +41 -0
- package/lib/types/dsh-adapter/backend-registry.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend-registry.js +22 -3
- package/lib/types/dsh-adapter/backends.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backends.js +4 -5
- package/lib/types/dsh-adapter/bundled-presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/bundled-presets.js +60 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +1 -0
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +1 -0
- package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/command-completions.js +64 -7
- package/lib/types/dsh-adapter/channel/compaction.d.ts +7 -2
- package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/compaction.js +100 -26
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +3 -0
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +2 -1
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +12 -0
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/extensions.js +68 -8
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts +6 -0
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-permission-actions.js +104 -12
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +8 -1
- package/lib/types/dsh-adapter/channel/permissions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/permissions.js +4 -1
- package/lib/types/dsh-adapter/channel/projection-helpers.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection-helpers.js +2 -0
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +4 -3
- package/lib/types/dsh-adapter/channel/session-reset.js +2 -2
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +7 -0
- package/lib/types/dsh-adapter/channel/settings-host.d.ts +3 -0
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +135 -5
- package/lib/types/dsh-adapter/channel/state.d.ts +6 -0
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +18 -6
- package/lib/types/dsh-adapter/channel/transcript.d.ts +7 -0
- package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/transcript.js +19 -2
- package/lib/types/dsh-adapter/compat/agent-team-0.2.0.d.ts +55 -0
- package/lib/types/dsh-adapter/compat/agent-team-0.2.0.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/agent-team-0.2.0.js +96 -0
- package/lib/types/dsh-adapter/contract.d.ts +4 -4
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +5 -5
- package/lib/types/dsh-adapter/effect-ledger.d.ts +7 -0
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
- package/lib/types/dsh-adapter/effect-ledger.js +8 -1
- package/lib/types/dsh-adapter/entry-slot.d.ts +3 -1
- package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -1
- package/lib/types/dsh-adapter/entry-slot.js +2 -2
- package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -1
- package/lib/types/dsh-adapter/fresh-agent.js +6 -1
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +99 -0
- package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
- package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-contract.js +4 -3
- package/lib/types/dsh-adapter/host-dsh.d.ts +8 -2
- package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-dsh.js +45 -30
- package/lib/types/dsh-adapter/host-entry.js +40 -13
- package/lib/types/dsh-adapter/index.d.ts +9 -10
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +8 -6
- package/lib/types/dsh-adapter/install/pnpm-profile-add.d.ts.map +1 -1
- package/lib/types/dsh-adapter/install/pnpm-profile-add.js +9 -3
- package/lib/types/dsh-adapter/invariant.d.ts +7 -2
- package/lib/types/dsh-adapter/invariant.d.ts.map +1 -1
- package/lib/types/dsh-adapter/invariant.js +6 -3
- package/lib/types/dsh-adapter/migrate/index.js +2 -2
- package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
- package/lib/types/dsh-adapter/panels.js +6 -0
- package/lib/types/dsh-adapter/plugin-declaration.d.ts +99 -1
- package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-declaration.js +132 -2
- package/lib/types/dsh-adapter/plugin-feed.d.ts +94 -0
- package/lib/types/dsh-adapter/plugin-feed.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-feed.js +135 -0
- package/lib/types/dsh-adapter/plugin-guard.d.ts +115 -0
- package/lib/types/dsh-adapter/plugin-guard.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-guard.js +108 -0
- package/lib/types/dsh-adapter/plugin-install.d.ts +160 -0
- package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-install.js +545 -0
- package/lib/types/dsh-adapter/plugin-manage.d.ts +178 -0
- package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-manage.js +468 -0
- package/lib/types/dsh-adapter/plugin-manager.d.ts +78 -2
- package/lib/types/dsh-adapter/plugin-manager.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-manager.js +32 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +49 -2
- package/lib/types/dsh-adapter/plugins-info.d.ts +87 -1
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +131 -26
- package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
- package/lib/types/dsh-adapter/process-exit.d.ts.map +1 -1
- package/lib/types/dsh-adapter/process-exit.js +1 -1
- package/lib/types/dsh-adapter/session-projection-store.d.ts +66 -0
- package/lib/types/dsh-adapter/session-projection-store.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-projection-store.js +149 -0
- package/lib/types/dsh-adapter/settingsEditor.js +2 -2
- package/lib/types/dsh-adapter/sideQuestion.d.ts +21 -0
- package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sideQuestion.js +53 -0
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +2 -1
- package/lib/types/dsh-adapter/team-mode.d.ts +74 -0
- package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -0
- package/lib/types/dsh-adapter/team-mode.js +188 -0
- package/lib/types/dsh-adapter/team-roster.d.ts +67 -0
- package/lib/types/dsh-adapter/team-roster.d.ts.map +1 -0
- package/lib/types/dsh-adapter/team-roster.js +136 -0
- package/lib/types/dsh-adapter/team-tools.d.ts +58 -0
- package/lib/types/dsh-adapter/team-tools.d.ts.map +1 -0
- package/lib/types/dsh-adapter/team-tools.js +208 -0
- package/lib/types/dsh-adapter/types.d.ts +1 -1
- package/lib/types/dsh-adapter/types.d.ts.map +1 -1
- package/lib/types/i18n.d.ts +607 -16
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +295 -9
- package/lib/types/ink/components/ScrollBox.d.ts +9 -0
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
- package/lib/types/ink/components/ScrollBox.js +23 -0
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/kernelPrefs.d.ts +1 -1
- package/lib/types/kernelPrefs.d.ts.map +1 -1
- package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -1
- package/lib/types/native-ts/yoga-layout/index.js +8 -1
- package/lib/types/permissionPresetLabels.d.ts +25 -0
- package/lib/types/permissionPresetLabels.d.ts.map +1 -0
- package/lib/types/permissionPresetLabels.js +33 -0
- package/lib/types/preset-patch.d.ts +22 -0
- package/lib/types/preset-patch.d.ts.map +1 -0
- package/lib/types/preset-patch.js +14 -0
- package/lib/types/screens/Chat.d.ts +33 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +301 -9
- package/lib/types/screens/Launchpad.d.ts +7 -1
- package/lib/types/screens/Launchpad.d.ts.map +1 -1
- package/lib/types/screens/Launchpad.js +19 -4
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +1 -0
- package/lib/types/screens/chat/usePluginWriteFlow.d.ts +68 -0
- package/lib/types/screens/chat/usePluginWriteFlow.d.ts.map +1 -0
- package/lib/types/screens/chat/usePluginWriteFlow.js +92 -0
- package/lib/types/screens/chatOverlay.d.ts +19 -1
- package/lib/types/screens/chatOverlay.d.ts.map +1 -1
- package/lib/types/sessionModes.d.ts +5 -3
- package/lib/types/sessionModes.d.ts.map +1 -1
- package/lib/types/sessionModes.js +9 -3
- package/lib/types/tips.js +2 -2
- package/lib/types/update.d.ts +31 -22
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +85 -42
- package/lib/types/utils/paths.d.ts +11 -0
- package/lib/types/utils/paths.d.ts.map +1 -1
- package/lib/types/utils/paths.js +13 -0
- package/package.json +126 -120
- package/tui-profile/feed/README.md +63 -0
- package/tui-profile/feed/first-party.json +10 -0
|
@@ -7,6 +7,55 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Context } from '@deepseek-ai/cordis';
|
|
9
9
|
import { type TuiPluginHost } from './plugin-host.js';
|
|
10
|
+
/**
|
|
11
|
+
* The Loader's own ESM resolver (`cordis-plugin-loader`'s Node-internals
|
|
12
|
+
* adapter, or `undefined` when this runtime exposes no internals). Admission
|
|
13
|
+
* must resolve the entry through it: the Loader's active export conditions and
|
|
14
|
+
* custom hooks decide which module actually executes, and that module's
|
|
15
|
+
* manifest owns the identity and permissions.
|
|
16
|
+
*
|
|
17
|
+
* `import` is the same door `EntryTree.import()` uses — the module the Loader
|
|
18
|
+
* would execute for that specifier, out of the Loader's own cache. It is
|
|
19
|
+
* optional because the shape is classified by `resolveSync` alone; a
|
|
20
|
+
* resolution that cannot be executed is still a resolution, and the D-1
|
|
21
|
+
* assembly falls back to importing the URL the resolver returned.
|
|
22
|
+
*/
|
|
23
|
+
export type ActiveResolver = {
|
|
24
|
+
readonly version: 'v1';
|
|
25
|
+
resolveSync(specifier: string, parentURL: string, attributes: object): {
|
|
26
|
+
readonly url: string;
|
|
27
|
+
};
|
|
28
|
+
import?(specifier: string, parentURL: string, attributes: object): Promise<unknown>;
|
|
29
|
+
} | {
|
|
30
|
+
readonly version: 'v2';
|
|
31
|
+
resolveSync(parentURL: string, request: {
|
|
32
|
+
specifier: string;
|
|
33
|
+
attributes: object;
|
|
34
|
+
}): {
|
|
35
|
+
readonly url: string;
|
|
36
|
+
};
|
|
37
|
+
import?(specifier: string, parentURL: string, attributes: object): Promise<unknown>;
|
|
38
|
+
};
|
|
39
|
+
/** The Cordis loader entry that owns a fiber (`cordis-plugin-loader`). */
|
|
40
|
+
interface LoaderEntryLike {
|
|
41
|
+
readonly options?: {
|
|
42
|
+
readonly name?: string;
|
|
43
|
+
};
|
|
44
|
+
readonly ctx?: {
|
|
45
|
+
readonly baseUrl?: string;
|
|
46
|
+
};
|
|
47
|
+
readonly fiber?: {
|
|
48
|
+
readonly state?: number;
|
|
49
|
+
} | null;
|
|
50
|
+
}
|
|
51
|
+
/** The part of the Loader's surface this package reads. Exported (D-1) because
|
|
52
|
+
* the backend assembly resolves a bundle's entry through the same resolver. */
|
|
53
|
+
export interface LoaderLike {
|
|
54
|
+
readonly internal?: ActiveResolver;
|
|
55
|
+
locate?(fiber?: object): string | undefined;
|
|
56
|
+
resolve?(id: string): LoaderEntryLike | undefined;
|
|
57
|
+
entries?(): Iterable<LoaderEntryLike>;
|
|
58
|
+
}
|
|
10
59
|
/**
|
|
11
60
|
* Watch `ctx`'s composition and admit every third-party activation that
|
|
12
61
|
* carries a package-root `dsh-plugin.json`. The listeners and the retry
|
|
@@ -17,4 +66,37 @@ export declare function armAdmissionLoader(ctx: Context, options?: {
|
|
|
17
66
|
/** @internal retry bound for the regression; production uses RETRY_ATTEMPTS. */
|
|
18
67
|
retryAttempts?: number;
|
|
19
68
|
}): void;
|
|
69
|
+
/** The Loader of `ctx`'s composition, when there is one. One accessor for both
|
|
70
|
+
* readers of it (the admission loader and the D-1 backend assembly), so
|
|
71
|
+
* "which Loader" cannot drift between them. */
|
|
72
|
+
export declare function compositionLoader(ctx: Context): LoaderLike | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* The **URL** an entry `name` resolves to, through the exact resolver owned by
|
|
75
|
+
* the Loader that would execute it: its active conditions and hooks must select
|
|
76
|
+
* the same code and authority.
|
|
77
|
+
*
|
|
78
|
+
* `undefined` is a refusal to guess, not a "not found": a `cordis:` builtin has
|
|
79
|
+
* no module of its own, and a Loader without Node internals leaves the question
|
|
80
|
+
* open (one debug line, then out). Exported for the D-1 backend assembly, which
|
|
81
|
+
* resolves a *package* the same way rather than growing a second path resolver.
|
|
82
|
+
*/
|
|
83
|
+
export declare function resolveEntryUrl(loader: LoaderLike, name: string, baseUrl: string | undefined): string | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Import a module through the Loader's own door (`EntryTree.import`), so the
|
|
86
|
+
* namespace handed back is the one the Loader executed — conditions, hooks and
|
|
87
|
+
* module cache included. Falls back to importing the URL the resolver already
|
|
88
|
+
* returned (still the Loader's answer; no second resolver) for a loader shape
|
|
89
|
+
* that can resolve but not import.
|
|
90
|
+
*/
|
|
91
|
+
export declare function loadThroughLoader(loader: LoaderLike, name: string, url: string, baseUrl: string | undefined): Promise<Record<string, unknown>>;
|
|
92
|
+
/** Walk up from the entry module to its package root. A manifest counts only
|
|
93
|
+
* beside the `package.json` that establishes that root: a stray copy deeper
|
|
94
|
+
* in the tree (a build output directory, say) must not claim an outer
|
|
95
|
+
* package's code for its own identity. The walk stops at the first
|
|
96
|
+
* `package.json`, so DSH's own rows (a `package.json` one level up from
|
|
97
|
+
* their entry) cost one lookup instead of a climb to the filesystem root.
|
|
98
|
+
* Exported for the D-1 backend assembly, which reads a bundle's declaration
|
|
99
|
+
* through this same rule. */
|
|
100
|
+
export declare function findManifest(from: string): string | undefined;
|
|
101
|
+
export {};
|
|
20
102
|
//# sourceMappingURL=admission-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admission-loader.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/admission-loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"admission-loader.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/admission-loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAG7C,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAA;AASvE;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAA;IACtB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/F,MAAM,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE,GACvF;IAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAA;IACtB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5G,MAAM,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE,CAAA;AAE3F,0EAA0E;AAC1E,UAAU,eAAe;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC7C,QAAQ,CAAC,GAAG,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5C,QAAQ,CAAC,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CACpD;AAED;gFACgF;AAChF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAA;IAClC,MAAM,CAAC,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IAC3C,OAAO,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAAA;IACjD,OAAO,CAAC,IAAI,QAAQ,CAAC,eAAe,CAAC,CAAA;CACtC;AASD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE;IACP,IAAI,CAAC,EAAE,MAAM,aAAa,GAAG,SAAS,CAAA;IACtC,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAA;CAClB,GACL,IAAI,CA8JN;AAED;;gDAEgD;AAChD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAKtE;AAgCD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAgBjH;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAMlC;AAWD;;;;;;;8BAO8B;AAC9B,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAY7D"}
|
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
* unload would rewrite the user's profile) but stays outside every mediated
|
|
6
6
|
* capability. Listeners and the retry timer ride the caller's `ctx.effect`.
|
|
7
7
|
*/
|
|
8
|
-
import { findPackageJSON } from 'node:module';
|
|
9
8
|
import { existsSync, readFileSync } from 'node:fs';
|
|
10
|
-
import { dirname,
|
|
9
|
+
import { dirname, join, resolve as resolvePath } from 'node:path';
|
|
11
10
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
12
11
|
import { Context } from '@deepseek-ai/cordis';
|
|
13
12
|
import { componentIdentityOf } from './component-identity.js';
|
|
@@ -27,8 +26,8 @@ const RETRY_ATTEMPTS = 100;
|
|
|
27
26
|
export function armAdmissionLoader(ctx, options = {}) {
|
|
28
27
|
const root = compositionRoot(ctx);
|
|
29
28
|
const retryAttempts = options.retryAttempts ?? RETRY_ATTEMPTS;
|
|
30
|
-
const loader = root
|
|
31
|
-
if (loader === undefined
|
|
29
|
+
const loader = compositionLoader(root);
|
|
30
|
+
if (loader === undefined) {
|
|
32
31
|
logForDebugging('dsh-tui: admission loader not armed — this composition has no cordis loader');
|
|
33
32
|
return;
|
|
34
33
|
}
|
|
@@ -181,6 +180,15 @@ export function armAdmissionLoader(ctx, options = {}) {
|
|
|
181
180
|
ctx.effect(() => stopTimer);
|
|
182
181
|
seed();
|
|
183
182
|
}
|
|
183
|
+
/** The Loader of `ctx`'s composition, when there is one. One accessor for both
|
|
184
|
+
* readers of it (the admission loader and the D-1 backend assembly), so
|
|
185
|
+
* "which Loader" cannot drift between them. */
|
|
186
|
+
export function compositionLoader(ctx) {
|
|
187
|
+
const loader = compositionRoot(ctx).get('loader', false);
|
|
188
|
+
return loader !== undefined && typeof loader.locate === 'function' && typeof loader.resolve === 'function'
|
|
189
|
+
? loader
|
|
190
|
+
: undefined;
|
|
191
|
+
}
|
|
184
192
|
/** The package-root `dsh-plugin.json` of the entry that owns `fiber`, if any.
|
|
185
193
|
* Both loader calls are fenced: `EntryTree.resolve` throws for nested ids
|
|
186
194
|
* (`include:<group>:<row>`); an uninspectable entry is simply skipped. */
|
|
@@ -196,33 +204,67 @@ function manifestPathOf(loader, fiber) {
|
|
|
196
204
|
const name = entry?.options?.name;
|
|
197
205
|
if (typeof name !== 'string' || name === '')
|
|
198
206
|
return undefined;
|
|
199
|
-
const entryFile = resolveEntryFile(name, entry?.ctx?.baseUrl);
|
|
207
|
+
const entryFile = resolveEntryFile(loader, name, entry?.ctx?.baseUrl);
|
|
200
208
|
return entryFile === undefined ? undefined : findManifest(entryFile);
|
|
201
209
|
}
|
|
202
|
-
/** The module
|
|
210
|
+
/** The module an entry `name` resolves to, following the same rules the
|
|
203
211
|
* loader's own import uses (file URL, relative to `baseUrl`, bare
|
|
204
212
|
* specifier relative to the profile). */
|
|
205
|
-
function resolveEntryFile(name, baseUrl) {
|
|
213
|
+
function resolveEntryFile(loader, name, baseUrl) {
|
|
214
|
+
const url = resolveEntryUrl(loader, name, baseUrl);
|
|
215
|
+
if (url === undefined)
|
|
216
|
+
return undefined;
|
|
217
|
+
try {
|
|
218
|
+
return fileURLToPath(url);
|
|
219
|
+
}
|
|
220
|
+
catch {
|
|
221
|
+
return undefined;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* The **URL** an entry `name` resolves to, through the exact resolver owned by
|
|
226
|
+
* the Loader that would execute it: its active conditions and hooks must select
|
|
227
|
+
* the same code and authority.
|
|
228
|
+
*
|
|
229
|
+
* `undefined` is a refusal to guess, not a "not found": a `cordis:` builtin has
|
|
230
|
+
* no module of its own, and a Loader without Node internals leaves the question
|
|
231
|
+
* open (one debug line, then out). Exported for the D-1 backend assembly, which
|
|
232
|
+
* resolves a *package* the same way rather than growing a second path resolver.
|
|
233
|
+
*/
|
|
234
|
+
export function resolveEntryUrl(loader, name, baseUrl) {
|
|
206
235
|
try {
|
|
207
|
-
// Builtin rows (loader groups, timers) have no package directory.
|
|
208
236
|
if (name.startsWith('cordis:'))
|
|
209
237
|
return undefined;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
return
|
|
214
|
-
if (name.startsWith('.')) {
|
|
215
|
-
return baseUrl === undefined || baseUrl === '' ? undefined : fileURLToPath(new URL(name, baseUrl));
|
|
238
|
+
const resolver = loader.internal;
|
|
239
|
+
if (resolver === undefined) {
|
|
240
|
+
logForDebugging('dsh-tui: admission skipped — the Loader ESM resolver is unavailable; refusing to guess component identity');
|
|
241
|
+
return undefined;
|
|
216
242
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
243
|
+
const parent = moduleBase(baseUrl).href;
|
|
244
|
+
const resolved = resolver.version === 'v1'
|
|
245
|
+
? resolver.resolveSync(name, parent, {})
|
|
246
|
+
: resolver.resolveSync(parent, { specifier: name, attributes: {} });
|
|
247
|
+
return resolved.url;
|
|
220
248
|
}
|
|
221
249
|
catch {
|
|
222
250
|
return undefined;
|
|
223
251
|
}
|
|
224
252
|
}
|
|
225
|
-
|
|
253
|
+
/**
|
|
254
|
+
* Import a module through the Loader's own door (`EntryTree.import`), so the
|
|
255
|
+
* namespace handed back is the one the Loader executed — conditions, hooks and
|
|
256
|
+
* module cache included. Falls back to importing the URL the resolver already
|
|
257
|
+
* returned (still the Loader's answer; no second resolver) for a loader shape
|
|
258
|
+
* that can resolve but not import.
|
|
259
|
+
*/
|
|
260
|
+
export async function loadThroughLoader(loader, name, url, baseUrl) {
|
|
261
|
+
const internal = loader.internal;
|
|
262
|
+
if (internal?.import !== undefined) {
|
|
263
|
+
return await internal.import(name, moduleBase(baseUrl).href, {});
|
|
264
|
+
}
|
|
265
|
+
return await import(/* @vite-ignore */ url);
|
|
266
|
+
}
|
|
267
|
+
function moduleBase(baseUrl) {
|
|
226
268
|
if (baseUrl === undefined || baseUrl === '')
|
|
227
269
|
return pathToFileURL(join(process.cwd(), 'index.js'));
|
|
228
270
|
try {
|
|
@@ -232,18 +274,21 @@ function requireBase(baseUrl) {
|
|
|
232
274
|
return pathToFileURL(join(process.cwd(), 'index.js'));
|
|
233
275
|
}
|
|
234
276
|
}
|
|
235
|
-
/** Walk up from the entry module to its package root.
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
|
|
277
|
+
/** Walk up from the entry module to its package root. A manifest counts only
|
|
278
|
+
* beside the `package.json` that establishes that root: a stray copy deeper
|
|
279
|
+
* in the tree (a build output directory, say) must not claim an outer
|
|
280
|
+
* package's code for its own identity. The walk stops at the first
|
|
281
|
+
* `package.json`, so DSH's own rows (a `package.json` one level up from
|
|
282
|
+
* their entry) cost one lookup instead of a climb to the filesystem root.
|
|
283
|
+
* Exported for the D-1 backend assembly, which reads a bundle's declaration
|
|
284
|
+
* through this same rule. */
|
|
285
|
+
export function findManifest(from) {
|
|
240
286
|
let dir = dirname(resolvePath(from));
|
|
241
287
|
for (let depth = 0; depth < 64; depth += 1) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
return candidate;
|
|
245
|
-
|
|
246
|
-
return undefined;
|
|
288
|
+
if (existsSync(join(dir, 'package.json'))) {
|
|
289
|
+
const candidate = join(dir, 'dsh-plugin.json');
|
|
290
|
+
return existsSync(candidate) ? candidate : undefined;
|
|
291
|
+
}
|
|
247
292
|
const parent = dirname(dir);
|
|
248
293
|
if (parent === dir)
|
|
249
294
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-view.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/agent-view.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"agent-view.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/agent-view.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAGnD,gEAAgE;AAChE,eAAO,MAAM,uBAAuB,EAAE,SAAS,eAAe,EAE7D,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,wBAAwB,MAAM,CAAA;AAE3C;4DAC4D;AAC5D,eAAO,MAAM,qBAAqB,KAAK,CAAA;AAEvC;iEACiE;AACjE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAcpE;AAED,2DAA2D;AAC3D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,OAAO,CAE1E;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,CAAA;IACjB,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAA;IACnB;kEAC8D;IAC9D,OAAO,EAAE,MAAM,CAAA;IACf;yCACqC;IACrC,WAAW,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;IACrD,KAAK,EAAE,MAAM,CAAA;IACb,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAA;IACjB,wDAAwD;IACxD,cAAc,EAAE,OAAO,CAAA;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,aAAa,GAClB,aAAa,CAmDf;AAED,gEAAgE;AAChE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE,CAanG;AAED;4DAC4D;AAC5D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAUzF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,IAAI,EAAE,aAAa,EACnB,UAAU,EAAE,OAAO,GAClB,eAAe,CAMjB"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module @deepseek-harness-tui/dsh-tui/agent-view
|
|
8
8
|
*/
|
|
9
|
+
import { withoutTeammateReminder } from './compat/agent-team-0.2.0.js';
|
|
9
10
|
/** Agent-view row ordering: needs-input first, stopped last. */
|
|
10
11
|
export const AGENT_VIEW_STATUS_ORDER = [
|
|
11
12
|
'needs-input', 'working', 'failed', 'completed', 'idle', 'stopped',
|
|
@@ -59,7 +60,8 @@ export function foldAgentViewEvents(events, start, base) {
|
|
|
59
60
|
switch (event.type) {
|
|
60
61
|
case 'user/message': {
|
|
61
62
|
fold.hasTurns = true;
|
|
62
|
-
|
|
63
|
+
// compat(dsh 0.2.0, log): a 0.2.0 teammate's first prompt drops its identity block.
|
|
64
|
+
const text = agentViewTextOf(fold.firstPrompt.length === 0 ? withoutTeammateReminder(event.data).content : event.data.content);
|
|
63
65
|
if (fold.firstPrompt.length === 0 && text !== undefined)
|
|
64
66
|
fold.firstPrompt = oneLine(text);
|
|
65
67
|
// The prompt stands in for the summary only until the session
|
|
@@ -88,6 +88,9 @@ export declare class ApprovalStore implements PermissionPanelSource {
|
|
|
88
88
|
* have flipped — re-checks below this guard are skipped.
|
|
89
89
|
*/
|
|
90
90
|
private externalCheckedAtEvents;
|
|
91
|
+
/** UI language the parked asks' reasons were resolved in (see
|
|
92
|
+
* {@link refreshReasonLang}). */
|
|
93
|
+
private reasonLang;
|
|
91
94
|
private notifyQueued;
|
|
92
95
|
/**
|
|
93
96
|
* CallIds whose approval ask already settled (decided or cancelled).
|
|
@@ -138,6 +141,10 @@ export declare class ApprovalStore implements PermissionPanelSource {
|
|
|
138
141
|
/** Notify on a microtask so a re-check triggered inside getSnapshot
|
|
139
142
|
* (during a React render) never fires listeners synchronously mid-render. */
|
|
140
143
|
private scheduleNotify;
|
|
144
|
+
/** Re-resolve every parked ask's localized reason after a `/lang` switch;
|
|
145
|
+
* Chat re-renders on the switch, so the read below lands on the new
|
|
146
|
+
* language without a store subscription. */
|
|
147
|
+
private refreshReasonLang;
|
|
141
148
|
/** Rebuild the cached snapshot after any mutation of active. */
|
|
142
149
|
private rebuildSnapshot;
|
|
143
150
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approvals.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/approvals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"approvals.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/approvals.ts"],"names":[],"mappings":"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"}
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
import { compositionRoot } from './host-access.js';
|
|
23
23
|
import { assertCapabilityShadowPolicy, defaultAdapterRuntime, } from '../adapter/kernel/runtime.js';
|
|
24
24
|
import { snapshotLiveSessionEvents } from './compat/liveSession.js';
|
|
25
|
+
import { getLang } from '../i18n.js';
|
|
25
26
|
import { DEFAULT_PERMISSION_OPTIONS, } from '../channel/permissions.js';
|
|
26
27
|
const approvalStores = new WeakMap();
|
|
27
28
|
/** Host-only registration used by the TUI plugin bootstrap. */
|
|
@@ -35,6 +36,26 @@ export function getApprovalStore(ctx) {
|
|
|
35
36
|
return approvalStores.get(root);
|
|
36
37
|
}
|
|
37
38
|
const COMMAND_CLIP = 500;
|
|
39
|
+
/**
|
|
40
|
+
* The ask's reason in the UI language. Requests may carry a localized
|
|
41
|
+
* `displayReason: { en, zh }` next to the English audit `reason` (DSH's
|
|
42
|
+
* auto-review asks do); older request types lack the field, so it is read
|
|
43
|
+
* structurally.
|
|
44
|
+
* @param req - The pending approval request.
|
|
45
|
+
* @returns The localized reason, else `req.reason`.
|
|
46
|
+
*/
|
|
47
|
+
function reasonOf(req) {
|
|
48
|
+
const display = req.displayReason;
|
|
49
|
+
if (display !== null && typeof display === 'object') {
|
|
50
|
+
const byLang = display;
|
|
51
|
+
for (const lang of [getLang(), 'en']) {
|
|
52
|
+
const text = byLang[lang];
|
|
53
|
+
if (typeof text === 'string' && text.trim() !== '')
|
|
54
|
+
return text;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return req.reason;
|
|
58
|
+
}
|
|
38
59
|
/**
|
|
39
60
|
* Recover the gated command from the session log: the approval request
|
|
40
61
|
* links to an already-presented tool call via `callId`, so the arguments
|
|
@@ -135,6 +156,9 @@ export class ApprovalStore {
|
|
|
135
156
|
* have flipped — re-checks below this guard are skipped.
|
|
136
157
|
*/
|
|
137
158
|
externalCheckedAtEvents = -1;
|
|
159
|
+
/** UI language the parked asks' reasons were resolved in (see
|
|
160
|
+
* {@link refreshReasonLang}). */
|
|
161
|
+
reasonLang = getLang();
|
|
138
162
|
notifyQueued = false;
|
|
139
163
|
/**
|
|
140
164
|
* CallIds whose approval ask already settled (decided or cancelled).
|
|
@@ -172,6 +196,7 @@ export class ApprovalStore {
|
|
|
172
196
|
* @returns The cached snapshot; the reference is stable between mutations.
|
|
173
197
|
*/
|
|
174
198
|
getSnapshot() {
|
|
199
|
+
this.refreshReasonLang();
|
|
175
200
|
this.refreshActiveExternal();
|
|
176
201
|
return this.snapshotCache;
|
|
177
202
|
}
|
|
@@ -200,6 +225,7 @@ export class ApprovalStore {
|
|
|
200
225
|
* when the agent has no parked ask.
|
|
201
226
|
*/
|
|
202
227
|
pendingAgentDetail(agentId) {
|
|
228
|
+
this.refreshReasonLang();
|
|
203
229
|
for (const ask of [...(this.active === undefined ? [] : [this.active]), ...this.queue]) {
|
|
204
230
|
if (ask.snapshot.agentId !== agentId)
|
|
205
231
|
continue;
|
|
@@ -223,6 +249,23 @@ export class ApprovalStore {
|
|
|
223
249
|
this.emit();
|
|
224
250
|
});
|
|
225
251
|
}
|
|
252
|
+
/** Re-resolve every parked ask's localized reason after a `/lang` switch;
|
|
253
|
+
* Chat re-renders on the switch, so the read below lands on the new
|
|
254
|
+
* language without a store subscription. */
|
|
255
|
+
refreshReasonLang() {
|
|
256
|
+
const lang = getLang();
|
|
257
|
+
if (lang === this.reasonLang)
|
|
258
|
+
return;
|
|
259
|
+
this.reasonLang = lang;
|
|
260
|
+
for (const pending of [...(this.active === undefined ? [] : [this.active]), ...this.queue]) {
|
|
261
|
+
const reason = reasonOf(pending.request);
|
|
262
|
+
if (reason === undefined)
|
|
263
|
+
delete pending.snapshot.reason;
|
|
264
|
+
else
|
|
265
|
+
pending.snapshot.reason = reason;
|
|
266
|
+
}
|
|
267
|
+
this.rebuildSnapshot();
|
|
268
|
+
}
|
|
226
269
|
/** Rebuild the cached snapshot after any mutation of active. */
|
|
227
270
|
rebuildSnapshot() {
|
|
228
271
|
const pending = this.active;
|
|
@@ -322,6 +365,7 @@ export class ApprovalStore {
|
|
|
322
365
|
assertCapabilityShadowPolicy('host.presentation.approve', this.runtime.mode, this.runtime.slices);
|
|
323
366
|
return new Promise(resolve => {
|
|
324
367
|
const command = commandOf(req);
|
|
368
|
+
const reason = reasonOf(req);
|
|
325
369
|
// Source badge: park() is reached through the approval/request
|
|
326
370
|
// waterfall, which any in-process plugin can dispatch — the agent-id
|
|
327
371
|
// gate in plugin.ts says whose SESSION it names, not that a live tool
|
|
@@ -342,7 +386,7 @@ export class ApprovalStore {
|
|
|
342
386
|
snapshot: {
|
|
343
387
|
agentId: String(req.agent.id),
|
|
344
388
|
toolName: req.toolName,
|
|
345
|
-
...(
|
|
389
|
+
...(reason !== undefined ? { reason } : {}),
|
|
346
390
|
...(command !== undefined ? { command } : {}),
|
|
347
391
|
...(external ? { external: true } : {}),
|
|
348
392
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/backend/translate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE,OAAO,KAAK,EAAE,YAAY,EAAqC,MAAM,0BAA0B,CAAA;AAC/F,OAAO,EAAa,KAAK,UAAU,EAAqB,KAAK,cAAc,EAA0D,MAAM,uBAAuB,CAAA;AAElK,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAI3D,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/backend/translate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE,OAAO,KAAK,EAAE,YAAY,EAAqC,MAAM,0BAA0B,CAAA;AAC/F,OAAO,EAAa,KAAK,UAAU,EAAqB,KAAK,cAAc,EAA0D,MAAM,uBAAuB,CAAA;AAElK,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAI3D,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAM1F,MAAM,WAAW,iBAAiB;IAChC;;0DAEsD;IACtD,KAAK,IAAI,iBAAiB,GAAG,SAAS,CAAA;IACtC;4EACwE;IACxE,KAAK,IAAI,OAAO,CAAA;IAChB;+DAC2D;IAC3D,WAAW,IAAI,OAAO,CAAA;CACvB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAkEtD;AA6FD,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB;4BA+K1B,YAAY,KAAG,SAAS,UAAU,EAAE;4BA0JpC,oBAAoB,KAAG,SAAS,UAAU,EAAE;8BAmB1C,SAAS,YAAY,EAAE,KAAG,SAAS,UAAU,EAAE;iBAW9D,IAAI;4BA7TS,MAAM,WAAW,MAAM,KAAG,YAAY,GAAG,SAAS;8BAYhD,MAAM,WAAW,MAAM,QAAQ,YAAY,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,KAAG,cAAc,GAAG,SAAS;EAyTjI;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
|
|
@@ -4,6 +4,8 @@ import { BACKGROUND_START_ACK, isSubagentToolName, parseJobOutputId, todoPanelIt
|
|
|
4
4
|
import { harnessToolResultView, prepareReplayEvents, toolErrorText } from '../channel/transcript.js';
|
|
5
5
|
import { isCompactionCheckpointSource, toolResultPayload } from '../compat/messages.js';
|
|
6
6
|
import { transcriptImagesOf } from '../transcript-images.js';
|
|
7
|
+
import { isTeamToolName, TEAM_SPAWN_TOOL, teamMessageOf, teamToolCallView, teamToolResultView } from '../team-tools.js';
|
|
8
|
+
import { teamMailboxAsRelay, withoutTeammateReminder } from '../compat/agent-team-0.2.0.js';
|
|
7
9
|
/**
|
|
8
10
|
* DeepSeek's rate windows, injected into the shared projector as its
|
|
9
11
|
* `pricingWindow`: each usage buckets by the time its request ran.
|
|
@@ -148,6 +150,8 @@ export function createDshTranslator(deps) {
|
|
|
148
150
|
/** Frame revisions are monotone within one attached Agent lifecycle; a
|
|
149
151
|
* re-delivered or out-of-order frame is dropped here. */
|
|
150
152
|
let lastStreamRevision = -1;
|
|
153
|
+
/** Whether this session's first human prompt has been translated. */
|
|
154
|
+
let promptSeen = false;
|
|
151
155
|
/**
|
|
152
156
|
* Open calls by callId until their result: what the result's presenter,
|
|
153
157
|
* images and task feeds need. `card: false` = question-presented (the
|
|
@@ -156,6 +160,35 @@ export function createDshTranslator(deps) {
|
|
|
156
160
|
* projector's own card index: deleted on result, cleared on reset.
|
|
157
161
|
*/
|
|
158
162
|
const openCalls = new Map();
|
|
163
|
+
/**
|
|
164
|
+
* `spawn_teammate` calls that have not written their member yet. The team
|
|
165
|
+
* refuses a teammate (name taken or invalid, member limit, not the Lead,
|
|
166
|
+
* service disposing, cancelled) before it appends `team/member`: no roster
|
|
167
|
+
* row carries that error, so a failed result brings back the plain card.
|
|
168
|
+
* Once the member is written its failure shows on the roster, and the call
|
|
169
|
+
* leaves this map. Bounded like `openCalls`.
|
|
170
|
+
*/
|
|
171
|
+
const unwrittenSpawns = new Map();
|
|
172
|
+
/** A `team/member` write settles the pending spawn of that name. Two
|
|
173
|
+
* parallel spawns of one name cannot be told apart; the first one goes. */
|
|
174
|
+
const onTeamMember = (data) => {
|
|
175
|
+
const name = data?.member?.name;
|
|
176
|
+
if (typeof name !== 'string')
|
|
177
|
+
return;
|
|
178
|
+
for (const [callId, call] of unwrittenSpawns) {
|
|
179
|
+
let args;
|
|
180
|
+
try {
|
|
181
|
+
args = JSON.parse(call.argsJson);
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
if (args?.name === name) {
|
|
187
|
+
unwrittenSpawns.delete(callId);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
};
|
|
159
192
|
/** Ask the producing tool how its call should render (diff/terminal/…).
|
|
160
193
|
* Unknown tool, unparseable args, or a throwing presenter all degrade to
|
|
161
194
|
* the plain text card. */
|
|
@@ -163,7 +196,7 @@ export function createDshTranslator(deps) {
|
|
|
163
196
|
try {
|
|
164
197
|
const tool = deps.tools()?.get(name, deps.scope());
|
|
165
198
|
if (tool?.presentCall === undefined)
|
|
166
|
-
return
|
|
199
|
+
return teamToolCallView(name, rawArgs);
|
|
167
200
|
return tool.presentCall(JSON.parse(rawArgs));
|
|
168
201
|
}
|
|
169
202
|
catch {
|
|
@@ -182,8 +215,13 @@ export function createDshTranslator(deps) {
|
|
|
182
215
|
if (local !== undefined)
|
|
183
216
|
return local;
|
|
184
217
|
const tool = deps.tools()?.get(name, deps.scope());
|
|
185
|
-
if (tool?.presentResult === undefined)
|
|
186
|
-
|
|
218
|
+
if (tool?.presentResult === undefined) {
|
|
219
|
+
// Only the team tools read the text: skip joining every other result.
|
|
220
|
+
if (!isTeamToolName(name))
|
|
221
|
+
return undefined;
|
|
222
|
+
const text = toolResultPayload(data.message).content.map(item => (item.type === 'text' ? item.text : '')).join('').trim();
|
|
223
|
+
return teamToolResultView(name, rawArgs, text);
|
|
224
|
+
}
|
|
187
225
|
return tool.presentResult(JSON.parse(rawArgs), {
|
|
188
226
|
...toolResultPayload(data.message),
|
|
189
227
|
...(data.meta !== undefined ? { meta: data.meta } : {}),
|
|
@@ -194,7 +232,8 @@ export function createDshTranslator(deps) {
|
|
|
194
232
|
}
|
|
195
233
|
};
|
|
196
234
|
const translateUserMessage = (event) => {
|
|
197
|
-
|
|
235
|
+
// compat(dsh 0.2.0, log): a 0.2.0 mailbox delivery reads as the relay it became.
|
|
236
|
+
const data = teamMailboxAsRelay(event.data);
|
|
198
237
|
const base = { id: data.id, anchor: String(event.seq), seq: event.seq, time: event.time, blocks: data.content };
|
|
199
238
|
// Both legacy and V4 checkpoints render as a folded summary rather than
|
|
200
239
|
// disappearing with the other injected context.
|
|
@@ -220,16 +259,25 @@ export function createDshTranslator(deps) {
|
|
|
220
259
|
if (data.source.kind === 'model-selection') {
|
|
221
260
|
return [{ type: 'notice', level: 'info', text: textOf(data.content) }];
|
|
222
261
|
}
|
|
262
|
+
// An Agent Teams peer message: a bubble labelled with its sender.
|
|
263
|
+
const team = teamMessageOf(data.source, data.content);
|
|
264
|
+
if (team !== undefined) {
|
|
265
|
+
return [{ type: 'user.message', ...base, blocks: team.blocks, source: 'team-message', sender: team.sender, text: team.text }];
|
|
266
|
+
}
|
|
223
267
|
// Injected context (plugin/skill source) is model-facing only; it has no
|
|
224
268
|
// transcript-facing text.
|
|
225
269
|
if (data.source.kind !== 'user')
|
|
226
270
|
return [{ type: 'user.message', ...base, source: 'injected', text: '' }];
|
|
271
|
+
// compat(dsh 0.2.0, log): a 0.2.0 teammate's first prompt drops its identity block.
|
|
272
|
+
const content = promptSeen ? data.content : withoutTeammateReminder(data).content;
|
|
273
|
+
promptSeen = true;
|
|
227
274
|
return [{
|
|
228
275
|
type: 'user.message',
|
|
229
276
|
...base,
|
|
277
|
+
blocks: content,
|
|
230
278
|
source: 'user',
|
|
231
|
-
text: firstTextOf(
|
|
232
|
-
images: transcriptImagesOf(
|
|
279
|
+
text: firstTextOf(content),
|
|
280
|
+
images: transcriptImagesOf(content, deps.attachments),
|
|
233
281
|
}];
|
|
234
282
|
};
|
|
235
283
|
const translateToolResult = (event) => {
|
|
@@ -237,6 +285,8 @@ export function createDshTranslator(deps) {
|
|
|
237
285
|
const callId = data.message.source.callId;
|
|
238
286
|
const call = openCalls.get(callId);
|
|
239
287
|
openCalls.delete(callId);
|
|
288
|
+
const spawn = unwrittenSpawns.get(callId);
|
|
289
|
+
unwrittenSpawns.delete(callId);
|
|
240
290
|
const payload = toolResultPayload(data.message);
|
|
241
291
|
const isError = data.error !== undefined || payload.isError;
|
|
242
292
|
// Text/presentation/images are derived only for results something
|
|
@@ -253,11 +303,13 @@ export function createDshTranslator(deps) {
|
|
|
253
303
|
time: event.time,
|
|
254
304
|
content: payload.content,
|
|
255
305
|
text,
|
|
256
|
-
...(isError && call !== undefined ? { errorText: toolErrorText(event) } : {}),
|
|
306
|
+
...(isError && (call !== undefined || spawn !== undefined) ? { errorText: toolErrorText(event) } : {}),
|
|
257
307
|
...(card === undefined ? {} : { images: transcriptImagesOf(data.message.content, deps.attachments) }),
|
|
258
308
|
...(data.meta === undefined ? {} : { meta: data.meta }),
|
|
259
309
|
...(card === undefined || isError ? {} : { presentation: presentResultView(card.name, card.args, data) }),
|
|
260
310
|
};
|
|
311
|
+
if (spawn !== undefined && isError)
|
|
312
|
+
return [{ ...spawn, presentation: presentCallView(spawn.name, spawn.argsJson) }, result];
|
|
261
313
|
if (card === undefined || isError)
|
|
262
314
|
return [result];
|
|
263
315
|
const events = [result];
|
|
@@ -328,8 +380,11 @@ export function createDshTranslator(deps) {
|
|
|
328
380
|
return [{ ...base, presentation: QUESTION }];
|
|
329
381
|
}
|
|
330
382
|
// The delegation tools render as the live subagent card.
|
|
331
|
-
if (isSubagentToolName(data.name))
|
|
383
|
+
if (isSubagentToolName(data.name)) {
|
|
384
|
+
if (data.name === TEAM_SPAWN_TOOL)
|
|
385
|
+
unwrittenSpawns.set(callId, base);
|
|
332
386
|
return [{ ...base, presentation: SUBAGENT }];
|
|
387
|
+
}
|
|
333
388
|
openCalls.set(callId, { name: data.name, args: data.arguments, card: true });
|
|
334
389
|
return [{ ...base, presentation: presentCallView(data.name, data.arguments) }];
|
|
335
390
|
}
|
|
@@ -374,6 +429,8 @@ export function createDshTranslator(deps) {
|
|
|
374
429
|
break;
|
|
375
430
|
}
|
|
376
431
|
const data = event.data;
|
|
432
|
+
if (type === 'team/member')
|
|
433
|
+
onTeamMember(data);
|
|
377
434
|
switch (type) {
|
|
378
435
|
case 'assistant/chunk': {
|
|
379
436
|
// Pre-0.1.5 live streams and raw pre-V3 logs carry per-token chunks
|
|
@@ -454,6 +511,7 @@ export function createDshTranslator(deps) {
|
|
|
454
511
|
*/
|
|
455
512
|
const translateReplay = (events) => {
|
|
456
513
|
lastStreamRevision = -1;
|
|
514
|
+
promptSeen = false;
|
|
457
515
|
const out = [];
|
|
458
516
|
for (const event of prepareReplayEvents(events)) {
|
|
459
517
|
for (const translated of translateEvent(event))
|
|
@@ -464,7 +522,9 @@ export function createDshTranslator(deps) {
|
|
|
464
522
|
/** Forget the frame fence and every open call (paired with a projector reset). */
|
|
465
523
|
const reset = () => {
|
|
466
524
|
lastStreamRevision = -1;
|
|
525
|
+
promptSeen = false;
|
|
467
526
|
openCalls.clear();
|
|
527
|
+
unwrittenSpawns.clear();
|
|
468
528
|
};
|
|
469
529
|
return { translateEvent, translateFrame, translateReplay, reset, presentCallView, presentResultView };
|
|
470
530
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
/** One bundle whose `Backend` declaration did not become a registry entry. */
|
|
3
|
+
export interface BackendAssemblyRefusal {
|
|
4
|
+
readonly bundle: string;
|
|
5
|
+
readonly reason: string;
|
|
6
|
+
}
|
|
7
|
+
/** What one assembly pass did. Returned rather than only logged, so the
|
|
8
|
+
* regression can assert the pass without reading the logs. */
|
|
9
|
+
export interface BackendAssembly {
|
|
10
|
+
/** The profile manifest the pass read, when this boot has one. */
|
|
11
|
+
readonly profile: string | undefined;
|
|
12
|
+
/** Bundle layers the pass looked at (composition-owned packages excluded). */
|
|
13
|
+
readonly scanned: readonly string[];
|
|
14
|
+
/** Backend ids registered by this pass, in scan order. The built-in seed is
|
|
15
|
+
* registered before it and is not part of the report. */
|
|
16
|
+
readonly registered: readonly string[];
|
|
17
|
+
/** Bundles that announced a backend this host could not assemble. */
|
|
18
|
+
readonly refused: readonly BackendAssemblyRefusal[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Register every backend an installed bundle declares.
|
|
22
|
+
*
|
|
23
|
+
* Synchronous by contract (see the module comment): the caller runs this before
|
|
24
|
+
* the boot parses a backend choice. A second pass over the same composition is a
|
|
25
|
+
* no-op for the entries the first pass registered (see {@link assemblyStateOf}) —
|
|
26
|
+
* two callers exist on purpose: the entry decides which kernel to boot *before*
|
|
27
|
+
* `apply` runs, and both questions ("is this bundle a layer" for the route, "which
|
|
28
|
+
* backend is this id" for the session) are answered by the same registry.
|
|
29
|
+
*/
|
|
30
|
+
export declare function assembleBackendsFromProfile(ctx: Context): BackendAssembly;
|
|
31
|
+
//# sourceMappingURL=backend-assembly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-assembly.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/backend-assembly.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAOlD,8EAA8E;AAC9E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED;+DAC+D;AAC/D,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC;8DAC0D;IAC1D,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,SAAS,sBAAsB,EAAE,CAAA;CACpD;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CA2CzE"}
|