@morlay/dsh-conversation 0.0.0-stage → 0.2.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -2
  3. package/dist/contract-DgH7vjO7.mjs +20 -0
  4. package/dist/contract.d.mts +3 -0
  5. package/dist/contract.mjs +3 -0
  6. package/dist/decorate-g56z_1VW.mjs +8 -0
  7. package/dist/endpoint.d.mts +42 -0
  8. package/dist/endpoint.mjs +50 -0
  9. package/dist/first-prompt-llm.service-BYX1KK4Z.mjs +100 -0
  10. package/dist/first-prompt-llm.service-DVcR15W4.d.mts +55 -0
  11. package/dist/index-BOtIdC0T.d.mts +45 -0
  12. package/dist/index.d.mts +6 -0
  13. package/dist/index.mjs +6 -0
  14. package/dist/server.d.mts +211 -0
  15. package/dist/server.mjs +372 -0
  16. package/dist/session-title.contract-1UPlQFwN.mjs +17 -0
  17. package/dist/session-title.contract-C3tGUiK2.d.mts +132 -0
  18. package/dist/testing.d.mts +14 -0
  19. package/dist/testing.mjs +24 -0
  20. package/dist/tool-results.group-BEGx5hXv.mjs +17 -0
  21. package/dist/tool-results.group-BUjXDYDr.d.mts +16 -0
  22. package/dist/ui.d.mts +531 -0
  23. package/dist/ui.mjs +6678 -0
  24. package/package.json +120 -3
  25. package/src/contract/api-session.contract.ts +182 -0
  26. package/src/contract/conversation-client.contract.ts +13 -0
  27. package/src/contract/index.ts +26 -0
  28. package/src/contract/input-triggers.contract.ts +15 -0
  29. package/src/contract/session-controller.contract.ts +11 -0
  30. package/src/contract/session-title.contract.ts +30 -0
  31. package/src/contract/ui-conversation.contract.ts +15 -0
  32. package/src/contract/ui-session-status.contract.ts +15 -0
  33. package/src/contract/ui-session.contract.ts +16 -0
  34. package/src/contract/ui-workspace.contract.ts +83 -0
  35. package/src/deliverable.service.ts +74 -0
  36. package/src/endpoint/file-references.group.ts +43 -0
  37. package/src/endpoint/index.ts +8 -0
  38. package/src/endpoint/session-reference.group.ts +43 -0
  39. package/src/endpoint/tool-results.group.ts +35 -0
  40. package/src/first-prompt-llm.service.ts +38 -0
  41. package/src/index.ts +16 -0
  42. package/src/server/api-session.provide.ts +232 -0
  43. package/src/server/client-settings-defaults.service.ts +39 -0
  44. package/src/server/conversation-server.provide.ts +33 -0
  45. package/src/server/deliverable.provide.ts +5 -0
  46. package/src/server/first-prompt-llm.provide.ts +5 -0
  47. package/src/server/index.ts +24 -0
  48. package/src/server/open-in-app.service.ts +52 -0
  49. package/src/server/session-controller.remote.ts +11 -0
  50. package/src/server/session-reference.provide.ts +15 -0
  51. package/src/server/session-reference.service.ts +58 -0
  52. package/src/server/session-remote.provide.ts +31 -0
  53. package/src/server/session-status.service.ts +36 -0
  54. package/src/server/session-title.provide.ts +5 -0
  55. package/src/server/tool-results-endpoint.service.ts +56 -0
  56. package/src/server/tool-results.service.ts +59 -0
  57. package/src/session-title.service.ts +38 -0
  58. package/src/testing/index.ts +35 -0
  59. package/src/ui/agent-scopes.service.ts +20 -0
  60. package/src/ui/approval-slot.ts +33 -0
  61. package/src/ui/approval.provide.ts +5 -0
  62. package/src/ui/approval.service.ts +12 -0
  63. package/src/ui/conversation/attachment-slots.ts +23 -0
  64. package/src/ui/conversation/chat-slots.ts +67 -0
  65. package/src/ui/conversation/conversation-slots.ts +90 -0
  66. package/src/ui/conversation/conversation.token.ts +6 -0
  67. package/src/ui/conversation/file-actions-slots.ts +40 -0
  68. package/src/ui/conversation/index.ts +13 -0
  69. package/src/ui/conversation/message-quotes-slot.ts +34 -0
  70. package/src/ui/conversation/open-in-app-slots.ts +64 -0
  71. package/src/ui/conversation/secret-mask-slot.ts +23 -0
  72. package/src/ui/conversation/subagent-slots.ts +31 -0
  73. package/src/ui/conversation/tool-slots.ts +27 -0
  74. package/src/ui/conversation/trajectory-slot.ts +49 -0
  75. package/src/ui/conversation/workflow-run-slot.ts +31 -0
  76. package/src/ui/conversation-ui.provide.ts +32 -0
  77. package/src/ui/deliverable.provide.ts +14 -0
  78. package/src/ui/deliverable.slot.ts +46 -0
  79. package/src/ui/index.ts +64 -0
  80. package/src/ui/input/command-ui-slot.ts +45 -0
  81. package/src/ui/input/index.ts +5 -0
  82. package/src/ui/input/input-trigger-slot.ts +27 -0
  83. package/src/ui/input/input.token.ts +2 -0
  84. package/src/ui/input/reference-slot.ts +42 -0
  85. package/src/ui/model-selection-slots.ts +50 -0
  86. package/src/ui/permission-slots.provide.ts +10 -0
  87. package/src/ui/permission-ui.provide.ts +5 -0
  88. package/src/ui/ports.ts +3 -0
  89. package/src/ui/projections/projections.service.ts +220 -0
  90. package/src/ui/projections/provide.ts +11 -0
  91. package/src/ui/remote-namespace.ts +24 -0
  92. package/src/ui/remote-session.ts +220 -0
  93. package/src/ui/session-controller.service.ts +335 -0
  94. package/src/ui/session-layout.ts +44 -0
  95. package/src/ui/session-reference-endpoint.client.ts +37 -0
  96. package/src/ui/session-scope.contribution.ts +81 -0
  97. package/src/ui/session-status-slots.ts +45 -0
  98. package/src/ui/session-submission.ts +108 -0
  99. package/src/ui/session-ui.provide.ts +51 -0
  100. package/src/ui/sessions.provide.ts +48 -0
  101. package/src/ui/setting-ui.provide.ts +35 -0
  102. package/src/ui/settings-general-slots.ts +66 -0
  103. package/src/ui/settings-host.ts +28 -0
  104. package/src/ui/settings-models-slots.ts +43 -0
  105. package/src/ui/shell/directory-picker-native-slots.ts +83 -0
  106. package/src/ui/shell/index.ts +74 -0
  107. package/src/ui/shell/rightbar-seats.ts +321 -0
  108. package/src/ui/shell/session-panel-slots.ts +33 -0
  109. package/src/ui/shell/sidebar-document-preview-slots.ts +62 -0
  110. package/src/ui/shell/sidebar-slots.ts +33 -0
  111. package/src/ui/shell/workspace-slots.ts +75 -0
  112. package/src/ui/ui-permission.service.ts +78 -0
  113. package/src/ui/ui-session.token.ts +5 -0
  114. package/src/ui/ui-settings.token.ts +9 -0
  115. package/src/ui/upstream-context.ts +27 -0
  116. package/src/ui/user-questions-slots.ts +39 -0
@@ -0,0 +1,34 @@
1
+ // 选中消息文本 →「引用文本」浮层(上游 `message-quotes` 的浏览器半)。
2
+ //
3
+ // 它往两个槽位注册:`conversation.chat.text-interaction`(选中模型回答文本时那个浮层)与
4
+ // `conversation.user.text.node`(用户消息里已引用的片段),另加一条选中交互 + 一条 UserText 规则
5
+ // (发出去的消息把引用带成 Markdown 引用块)。
6
+ //
7
+ // inject 四件(上游逐个真读):`slots` / `locale` / `sessions` / `uiConversation`。
8
+ // 少给任何一个都不会报错而是静默不渲染——所以四件都要在 deps 里点名。
9
+ import * as MessageQuotesPlugin from "@deepseek-ai/dsh-message-quotes/client";
10
+ import { SessionController } from "@morlay/dsh-conversation/contract";
11
+ import { inject, Injectable, type Context } from "@morlay/zephyr";
12
+ import { fromCordis } from "@morlay/zephyr/compat";
13
+ import { Locale, Slots } from "@morlay/zephyr-app/client";
14
+ import { UiConversation } from "./conversation.token.ts";
15
+
16
+ @Injectable()
17
+ export class MessageQuotesSlot extends fromCordis(MessageQuotesPlugin) {
18
+ private readonly slots = inject(Slots);
19
+
20
+ private readonly locale = inject(Locale);
21
+
22
+ private readonly sessions = inject(SessionController);
23
+
24
+ private readonly uiConversation = inject(UiConversation);
25
+
26
+ override async onInit(ctx: Context): Promise<void> {
27
+ await this.mount(ctx, undefined, {
28
+ slots: this.slots,
29
+ locale: this.locale,
30
+ sessions: this.sessions,
31
+ uiConversation: this.uiConversation,
32
+ });
33
+ }
34
+ }
@@ -0,0 +1,64 @@
1
+ // 上游 `ui-open-in-app` 的 client 行:文件 / 会话的「在应用里打开」与右上角的 Open In 分体按钮。
2
+ //
3
+ // 它同时提供三块能力,缺一块都表现为「右键菜单是个空壳 / 右上角没有按钮」:
4
+ // 1. `target: 'file'` 的菜单项(`open-in-app.file`);
5
+ // 2. `target: 'session'` 的菜单项(`open-in-app.reveal`,在访达中显示);
6
+ // 3. 会话标题栏的 Open In… 分体按钮(注册在 `conversation.session.header.utilities`)。
7
+ //
8
+ // 上游的 `export const inject` 是 11 个**服务名**:全部由装配面按字面键交进去。
9
+ import * as UiOpenInAppPlugin from "@deepseek-ai/dsh-client-ui-open-in-app/client";
10
+ import { inject, Injectable, type Context } from "@morlay/zephyr";
11
+ import { fromCordis } from "@morlay/zephyr/compat";
12
+ import { ContextMenus, Layout, Locale, Remote, Shortcuts, Slots } from "@morlay/zephyr-app/client";
13
+ import { remoteNamespaceKey } from "@morlay/zephyr-app/client/remote";
14
+ import { sessionGroupName } from "@morlay/dsh-session/endpoint";
15
+ import { workspaceFilesGroupName } from "@morlay/dsh-workspace/endpoint";
16
+ import { SessionControllerDefault } from "../session-controller.service.ts";
17
+ import { SidebarRight, SidebarRightTabs } from "../ports.ts";
18
+
19
+ /**
20
+ * \`openInApp\` 的契约:上游这一行**不提供任何服务**,只往槽位与菜单表里注册条目。
21
+ *
22
+ * 写出来是为了让 \`fromCordis(契约, 实现)\` 的双参形态保持统一(装任何上游实现之前先说清它的面,
23
+ * 哪怕这个面是「没有」)。
24
+ */
25
+ @Injectable()
26
+ export abstract class OpenInApp {}
27
+
28
+ @Injectable()
29
+ export class OpenInAppSlots extends fromCordis(OpenInApp, UiOpenInAppPlugin) {
30
+ private readonly contextMenus = inject(ContextMenus);
31
+
32
+ private readonly sidebarRight = inject(SidebarRight);
33
+
34
+ private readonly sidebarRightTabs = inject(SidebarRightTabs);
35
+
36
+ private readonly sessions = inject(SessionControllerDefault);
37
+
38
+ private readonly slots = inject(Slots);
39
+
40
+ private readonly locale = inject(Locale);
41
+
42
+ private readonly remote = inject(Remote);
43
+
44
+ private readonly shortcuts = inject(Shortcuts);
45
+
46
+ private readonly layout = inject(Layout);
47
+
48
+ override async onInit(ctx: Context): Promise<void> {
49
+ await this.mount(ctx, undefined, {
50
+ contextMenus: this.contextMenus,
51
+ sidebarRight: this.sidebarRight,
52
+ sidebarRightTabs: this.sidebarRightTabs,
53
+ sessions: this.sessions,
54
+ slots: this.slots,
55
+ locale: this.locale,
56
+ remote: this.remote,
57
+ // 带点的名字是**字面键**:点号在名字里,不是两级属性。
58
+ [remoteNamespaceKey(sessionGroupName())]: this.remote,
59
+ [remoteNamespaceKey(workspaceFilesGroupName())]: this.remote,
60
+ shortcuts: this.shortcuts,
61
+ layout: this.layout,
62
+ });
63
+ }
64
+ }
@@ -0,0 +1,23 @@
1
+ // 会话里的密钥打码(上游 `ui-secret-mask`)。
2
+ import * as UiSecretMaskPlugin from "@deepseek-ai/dsh-client-ui-secret-mask/client";
3
+ import { inject, Injectable, type Context } from "@morlay/zephyr";
4
+ import { fromCordis } from "@morlay/zephyr/compat";
5
+ import { Locale, Slots } from "@morlay/zephyr-app/client";
6
+ import { UiConversation } from "./conversation.token.ts";
7
+
8
+ @Injectable()
9
+ export class SecretMaskSlot extends fromCordis(UiSecretMaskPlugin) {
10
+ private readonly locale = inject(Locale);
11
+
12
+ private readonly slots = inject(Slots);
13
+
14
+ private readonly uiConversation = inject(UiConversation);
15
+
16
+ override async onInit(ctx: Context): Promise<void> {
17
+ await this.mount(ctx, undefined, {
18
+ locale: this.locale,
19
+ slots: this.slots,
20
+ uiConversation: this.uiConversation,
21
+ });
22
+ }
23
+ }
@@ -0,0 +1,31 @@
1
+ // 会话里的子代理卡片与右侧入口(上游 `ui-subagent`)。
2
+ import * as UiSubagentPlugin from "@deepseek-ai/dsh-client-ui-subagent/client";
3
+ import { inject, Injectable, type Context } from "@morlay/zephyr";
4
+ import { fromCordis } from "@morlay/zephyr/compat";
5
+ import { Locale, Slots } from "@morlay/zephyr-app/client";
6
+ import { SessionController } from "@morlay/dsh-conversation/contract";
7
+ import { UiWorkspace } from "@morlay/dsh-conversation/contract";
8
+ import { SidebarRight } from "../ports.ts";
9
+
10
+ @Injectable()
11
+ export class SubagentSlots extends fromCordis(UiSubagentPlugin) {
12
+ private readonly sessions = inject(SessionController);
13
+
14
+ private readonly uiWorkspace = inject(UiWorkspace);
15
+
16
+ private readonly slots = inject(Slots);
17
+
18
+ private readonly locale = inject(Locale);
19
+
20
+ private readonly sidebarRight = inject(SidebarRight);
21
+
22
+ override async onInit(ctx: Context): Promise<void> {
23
+ await this.mount(ctx, undefined, {
24
+ sessions: this.sessions,
25
+ uiWorkspace: this.uiWorkspace,
26
+ slots: this.slots,
27
+ locale: this.locale,
28
+ sidebarRight: this.sidebarRight,
29
+ });
30
+ }
31
+ }
@@ -0,0 +1,27 @@
1
+ // 上游工具卡片渲染(client 行):`ui-tool` 把内置工具的展示注册进会话节点。
2
+ //
3
+ // inject 只有 `slots` / `remote`:工具行按 `conversation.tool` 一类 keyed 位置注册,
4
+ // 那些位置由 `ui-conversation` 声明(`slots.inject` 会等声明出现)。
5
+ import * as UiToolPlugin from "@deepseek-ai/dsh-client-ui-tool/client";
6
+ import { inject, Injectable, type Context } from "@morlay/zephyr";
7
+ import { fromCordis } from "@morlay/zephyr/compat";
8
+ import { Remote, Slots } from "@morlay/zephyr-app/client";
9
+ import { UiConversation } from "./conversation.token.ts";
10
+
11
+ @Injectable()
12
+ export class ToolSlots extends fromCordis(UiToolPlugin) {
13
+ private readonly slots = inject(Slots);
14
+
15
+ private readonly remote = inject(Remote);
16
+
17
+ // 工具卡片(它的子插件)要读 `ctx.uiConversation`:按我们的模式必须是**本行显式注入**的依赖。
18
+ private readonly uiConversation = inject(UiConversation);
19
+
20
+ override async onInit(ctx: Context): Promise<void> {
21
+ await this.mount(ctx, undefined, {
22
+ slots: this.slots,
23
+ remote: this.remote,
24
+ uiConversation: this.uiConversation,
25
+ });
26
+ }
27
+ }
@@ -0,0 +1,49 @@
1
+ // 会话里的轨迹视图(上游 `ui-trajectory`)。
2
+ import * as UiTrajectoryPlugin from "@deepseek-ai/dsh-client-ui-trajectory/client";
3
+ import { inject, Injectable, type Context } from "@morlay/zephyr";
4
+ import { fromCordis } from "@morlay/zephyr/compat";
5
+ import { Locale, Remote, Slots } from "@morlay/zephyr-app/client";
6
+ import { SessionController } from "@morlay/dsh-conversation/contract";
7
+ import { UiSession } from "../ui-session.token.ts";
8
+ import { UiConversation } from "./conversation.token.ts";
9
+ import { remoteNamespaceKey } from "@morlay/zephyr-app/client/remote";
10
+ import { groupNameOf } from "@morlay/zephyr-app/remote";
11
+ import { ToolResultsEndpoint } from "../../endpoint/tool-results.group.ts";
12
+
13
+ /**
14
+ * `toolResults` 的 wire 组名:home 是契约类上的 `@RemoteGroup({ name })`。
15
+ * @returns 组名。
16
+ * @throws 契约类漏了装饰器(装配期就该发现,而不是把空组名塞进 deps)。
17
+ */
18
+ function toolResultsGroup(): string {
19
+ return groupNameOf(ToolResultsEndpoint);
20
+ }
21
+
22
+ @Injectable()
23
+ export class TrajectorySlot extends fromCordis(UiTrajectoryPlugin) {
24
+ private readonly slots = inject(Slots);
25
+
26
+ private readonly sessions = inject(SessionController);
27
+
28
+ private readonly uiSession = inject(UiSession);
29
+
30
+ private readonly uiConversation = inject(UiConversation);
31
+
32
+ private readonly locale = inject(Locale);
33
+
34
+ private readonly remote = inject(Remote);
35
+
36
+ override async onInit(ctx: Context): Promise<void> {
37
+ await this.mount(ctx, undefined, {
38
+ slots: this.slots,
39
+ sessions: this.sessions,
40
+ uiSession: this.uiSession,
41
+ uiConversation: this.uiConversation,
42
+ locale: this.locale,
43
+ remote: this.remote,
44
+ // 带点的名字按**字面键**给出(同 `chat-slots` 的「会话组」)。组名从契约类读(`@RemoteGroup` 的实参),
45
+ // 不在调用点写字符串;契约类上没装饰器时当场抛,而不是塞一个空组名进 deps。
46
+ [remoteNamespaceKey(toolResultsGroup())]: this.remote,
47
+ });
48
+ }
49
+ }
@@ -0,0 +1,31 @@
1
+ // 会话里的工作流运行卡片(上游 `ui-workflow-run`)。
2
+ import * as UiWorkflowRunPlugin from "@deepseek-ai/dsh-client-ui-workflow-run/client";
3
+ import { inject, Injectable, type Context } from "@morlay/zephyr";
4
+ import { fromCordis } from "@morlay/zephyr/compat";
5
+ import { Locale, Slots } from "@morlay/zephyr-app/client";
6
+ import { SessionController } from "@morlay/dsh-conversation/contract";
7
+ import { UiWorkspace } from "@morlay/dsh-conversation/contract";
8
+ import { UiConversation } from "./conversation.token.ts";
9
+
10
+ @Injectable()
11
+ export class WorkflowRunSlot extends fromCordis(UiWorkflowRunPlugin) {
12
+ private readonly uiConversation = inject(UiConversation);
13
+
14
+ private readonly uiWorkspace = inject(UiWorkspace);
15
+
16
+ private readonly slots = inject(Slots);
17
+
18
+ private readonly sessions = inject(SessionController);
19
+
20
+ private readonly locale = inject(Locale);
21
+
22
+ override async onInit(ctx: Context): Promise<void> {
23
+ await this.mount(ctx, undefined, {
24
+ uiConversation: this.uiConversation,
25
+ uiWorkspace: this.uiWorkspace,
26
+ slots: this.slots,
27
+ sessions: this.sessions,
28
+ locale: this.locale,
29
+ });
30
+ }
31
+ }
@@ -0,0 +1,32 @@
1
+ import { type ProviderList } from "@morlay/zephyr";
2
+ import { SubagentsEndpointClient } from "@morlay/dsh-agent/ui";
3
+ import { AgentScopesDefault } from "./agent-scopes.service.ts";
4
+ import { provideSessionShellSlots } from "./shell/index.ts";
5
+ import { provideSessionInputSlots, provideSessionSlots } from "./session-ui.provide.ts";
6
+
7
+ /**
8
+ * 对话域的**浏览器半**:一份清单装完本包的界面面。
9
+ *
10
+ * 内部顺序即依赖顺序:
11
+ * 1. `provideSessionShell()`:`SessionLayout` 包装上游 `ui-session`,产出 `uiSession`;
12
+ * 2. `provideSessionShellSlots()`:侧栏骨架,**要 `uiWorkspace`**(由 workspace 域的 `provideWorkspaceUi()` 给,
13
+ * 所以调用方必须把它排在本函数之前)与 `Layout`;
14
+ * 3. `provideSessionSlots()`:主视图 / 内容渲染 / 会话内卡片(产出 `conversation`);
15
+ * 4. `provideSessionInputSlots()`:输入区触发器、命令 UI 行、`@` 引用——**要 `remote.commands`**,
16
+ * 所以调用方必须把 `provideCommandUi()` 排在本函数之前。
17
+ *
18
+ * @returns provider 清单。
19
+ */
20
+ export function provideConversationUi(): ProviderList {
21
+ return [
22
+ // 转发请求(审批、用户提问)到浏览器只剩 `agentId`:这张表把它解析回会话作用域,
23
+ // 否则 listener 认不出会话、直接 `next()`——界面上是一张卡都不弹。
24
+ AgentScopesDefault,
25
+ // `remote.subagents` 的那份 descriptor 由 agent 域的客户端形态自己挂(它的 `onInit`):
26
+ // 会话界面的子代理入口全读那一面,所以它要排在下面那些界面行之前。
27
+ SubagentsEndpointClient,
28
+ ...provideSessionShellSlots(),
29
+ ...provideSessionSlots(),
30
+ ...provideSessionInputSlots(),
31
+ ];
32
+ }
@@ -0,0 +1,14 @@
1
+ // deliverables 域的**浏览器半装配**:交付物卡片 + 右侧「交付物」标签。
2
+ //
3
+ // 这一行注册进的是**会话界面**已声明的位置(`conversation.chat.turnTail` 等),装配面要把它排在
4
+ // `provideSessionSlots()` 之后;行本身住在本域。
5
+ import { provide, type ProviderList } from "@morlay/zephyr";
6
+ import { DeliverablesSlots } from "./deliverable.slot.ts";
7
+
8
+ /**
9
+ * 交付物界面的行清单。
10
+ * @returns provider 清单。
11
+ */
12
+ export function provideDeliverablesUi(): ProviderList {
13
+ return provide([DeliverablesSlots])();
14
+ }
@@ -0,0 +1,46 @@
1
+ // 交付物卡片 + 右侧「交付物」标签类型(上游 `ui-deliverables`)。
2
+ //
3
+ // 它要 `sidebarRightTabs`(标签类型注册表)与 `sidebarRight`(面板动作面):
4
+ // 前者由应用侧的侧栏行提供独立实例,后者由右栏这一行提供。
5
+ // 标签类型注册到独立实例上,因此**不会出现在右侧面板的标签条里**(面板读的是它自己那一份),
6
+ // 交付物卡片本身照常渲染。
7
+ import * as UiDeliverablesPlugin from "@deepseek-ai/dsh-client-ui-deliverables/client";
8
+ import { inject, Injectable, type Context } from "@morlay/zephyr";
9
+ import { fromCordis } from "@morlay/zephyr/compat";
10
+ import { ConfigForms, Locale, Remote, Slots } from "@morlay/zephyr-app/client";
11
+ // 交付物行住在 deliverables 域(上游 `ui-deliverables` 归这里);它注册进的是**会话界面**的槽位,
12
+ // 那两个端口与对话装配令牌由会话域的 ui 面导出(deliverables → session 单向)。
13
+ import { SidebarRight, SidebarRightTabs } from "./ports.ts";
14
+ import { UiConversation } from "./conversation/conversation.token.ts";
15
+ import { sessionGroupName } from "@morlay/dsh-session/endpoint";
16
+ import { remoteNamespaceKey } from "@morlay/zephyr-app/client/remote";
17
+
18
+ @Injectable()
19
+ export class DeliverablesSlots extends fromCordis(UiDeliverablesPlugin) {
20
+ private readonly slots = inject(Slots);
21
+
22
+ private readonly locale = inject(Locale);
23
+
24
+ private readonly uiConversation = inject(UiConversation);
25
+
26
+ private readonly remote = inject(Remote);
27
+
28
+ private readonly sidebarRightTabs = inject(SidebarRightTabs);
29
+
30
+ private readonly sidebarRight = inject(SidebarRight);
31
+
32
+ private readonly configForms = inject(ConfigForms);
33
+
34
+ override async onInit(ctx: Context): Promise<void> {
35
+ await this.mount(ctx, undefined, {
36
+ slots: this.slots,
37
+ locale: this.locale,
38
+ uiConversation: this.uiConversation,
39
+ remote: this.remote,
40
+ [remoteNamespaceKey(sessionGroupName())]: this.remote,
41
+ sidebarRightTabs: this.sidebarRightTabs,
42
+ sidebarRight: this.sidebarRight,
43
+ configForms: this.configForms,
44
+ });
45
+ }
46
+ }
@@ -0,0 +1,64 @@
1
+ // 对话域的**浏览器半**(`@morlay/dsh-conversation/ui`):会话界面(布局、槽位、client 侧 controller)与它们的装配函数。
2
+ //
3
+ // 这一面原本在 `@morlay/dsh-session/ui`:界面属于对话域,所以整块搬到了这里(数据面留在 `dsh-session`)。
4
+ // 装配面只从这里取 `provideXxx`:清单顺序有语义(先 store 后槽位),别在应用里重排。
5
+ // 契约面走**包出口**(`./contract`)而不是相对路径:预编译时 `ui.js` 才会 external `contract.js`,
6
+ // 不把 `class SessionController` 再定义一份(两份定义 = 两个令牌身份,跨包按令牌注入就会找不到)。
7
+ export {
8
+ SessionController,
9
+ type SessionCatalog,
10
+ type SessionCatalogState,
11
+ type SessionRetainHandle,
12
+ type SessionScope,
13
+ type SessionView,
14
+ } from "@morlay/dsh-conversation/contract";
15
+ export * from "./session-controller.service.ts";
16
+ export * from "./sessions.provide.ts";
17
+ // 投影中继(本域的 `session/control` 流 → 通用 `ProjectionValueStore`):契约与实现都在本域。
18
+ export { Projections, ProjectionsDefault } from "./projections/projections.service.ts";
19
+ export { provideProjections } from "./projections/provide.ts";
20
+ export { SessionLayout } from "./session-layout.ts";
21
+ export { UiSession } from "./ui-session.token.ts";
22
+ export { SidebarRight, SidebarRightTabs } from "./ports.ts";
23
+ export * from "./conversation/index.ts";
24
+ // 两端共用的 client 契约在 **contract** 面(别的域只引 contract,不引本包的 ui)。
25
+ export type {
26
+ ChatNodeOwnerProps,
27
+ ChatNodeViewProps,
28
+ ChatViewSlotProps,
29
+ UserContentAttachment,
30
+ UserContentData,
31
+ UserMessageNode,
32
+ UserTextFacts,
33
+ } from "@morlay/dsh-conversation/contract";
34
+ export * from "./input/index.ts";
35
+ export {
36
+ provideSessionInputSlots,
37
+ provideSessionShell,
38
+ provideSessionSlots,
39
+ } from "./session-ui.provide.ts";
40
+ export { provideSessionShellSlots } from "./shell/index.ts";
41
+ // 本域浏览器面的**聚合入口**(一个面一个装配函数):布局 + 侧栏骨架 + 会话界面 + 输入区。
42
+ export { provideConversationUi } from "./conversation-ui.provide.ts";
43
+ export { provideSessionStatusUi } from "./session-ui.provide.ts";
44
+
45
+ // 设置面板(模型选择 / 通用 / 外观):界面属于会话域,数据面在 `@morlay/dsh-setting`。
46
+ export * from "./setting-ui.provide.ts";
47
+ export * from "./model-selection-slots.ts";
48
+ export * from "./settings-general-slots.ts";
49
+ export * from "./settings-models-slots.ts";
50
+ export * from "./settings-host.ts";
51
+ export * from "./ui-settings.token.ts";
52
+
53
+ // 权限 / 批准 / 用户提问的界面行。
54
+ export * from "./permission-ui.provide.ts";
55
+ export * from "./permission-slots.provide.ts";
56
+ export * from "./approval.provide.ts";
57
+ export * from "./approval.service.ts";
58
+ export * from "./approval-slot.ts";
59
+ export * from "./ui-permission.service.ts";
60
+ export * from "./user-questions-slots.ts";
61
+
62
+ // 交付物的浏览器半(注册进会话界面已声明的位置)。
63
+ export * from "./deliverable.provide.ts";
64
+ export * from "./deliverable.slot.ts";
@@ -0,0 +1,45 @@
1
+ // 命令 UI 行:装上游 `ui-commands` 的 client 半,让 `ctx.commandUi` 真的存在。
2
+ //
3
+ // 上游那一行做三件事(同一个 apply):注册 `/` 的命令源(`inputTriggers.registerSource`)、
4
+ // 把宿主目录与客户端贡献合并成候选、把 `command-popup` 壳注册进 `conversation.input.overlay`。
5
+ // 三者同源,装整行即可——不拆成「服务壳 + 复刻注册」。
6
+ //
7
+ // **放在输入区这一组**:它 `static inject` 的头一项就是 `inputTriggers`,与 `InputTriggerSlot` 同源;
8
+ // 排在它后面(`InputTriggers` 的令牌由那一行提供)。
9
+ import { inject, Injectable, type Context } from "@morlay/zephyr";
10
+ import { Locale, Remote, Slots } from "@morlay/zephyr-app/client";
11
+ // 上游 ui-commands 的适配基类在 command 域(那边 owning):本行只补会话侧的注入。
12
+ import { CommandUiRow } from "@morlay/dsh-command/ui";
13
+ import { SessionController } from "@morlay/dsh-conversation/contract";
14
+ import { InputTriggers } from "./input.token.ts";
15
+ import { remoteNamespaceKey } from "@morlay/zephyr-app/client/remote";
16
+ import { namespaceOf } from "../remote-namespace.ts";
17
+
18
+ @Injectable()
19
+ export class CommandUiSlot extends CommandUiRow {
20
+ private readonly inputTriggers = inject(InputTriggers);
21
+
22
+ private readonly sessions = inject(SessionController);
23
+
24
+ private readonly remote = inject(Remote);
25
+
26
+ private readonly locale = inject(Locale);
27
+
28
+ private readonly slots = inject(Slots);
29
+
30
+ override async onInit(ctx: Context): Promise<void> {
31
+ // 上游按 cordis 服务名读这几项(`ctx.locale` / `ctx.slots` / `ctx.get('inputTriggers')` /
32
+ // `ctx.remote` / `ctx.remote.commands`):按名字替换交给 `deps`,不走 cordis 的 inject 检查。
33
+ await this.mount(ctx, undefined, {
34
+ inputTriggers: this.inputTriggers,
35
+ sessions: this.sessions,
36
+ remote: this.remote,
37
+ // 键名 = remote. + 组名(上游按这个 cordis 服务名读;commands 是我们自己声明的组,上游不会发它)。
38
+ // 键名规则只有一个 home(`remoteNamespaceKey`);`commands` 是我们自己声明的组、上游不会发它,
39
+ // 所以这条 deps 不能删——删了命令面板静默为空。
40
+ [remoteNamespaceKey("commands")]: namespaceOf(this.remote, "commands"),
41
+ locale: this.locale,
42
+ slots: this.slots,
43
+ });
44
+ }
45
+ }
@@ -0,0 +1,5 @@
1
+ // 会话的输入区(输入区属于会话域):触发器、斜杠命令、`@` 引用。
2
+ export { CommandUiSlot } from "./command-ui-slot.ts";
3
+ export { InputTriggerSlot } from "./input-trigger-slot.ts";
4
+ export { ReferenceSlot } from "./reference-slot.ts";
5
+ export { InputTriggers } from "./input.token.ts";
@@ -0,0 +1,27 @@
1
+ // 输入区触发器(`ctx.inputTriggers`)+ slash 菜单(`conversation.input.overlay` 的 `slash-menu`)。
2
+ //
3
+ // 上游 `ui-input-trigger` 的 apply 里既 `ctx.plugin(InputTriggerService)` 又注册菜单 slot——两件事同源,
4
+ // 直接装整行(`allowSubplugins` 逐行显式允许),不再拆成两个"服务壳 + 复刻注册"。
5
+ import * as UiInputTriggerPlugin from "@deepseek-ai/dsh-client-ui-input-trigger/client";
6
+ import { inject, Injectable, type Context } from "@morlay/zephyr";
7
+ import { fromCordis } from "@morlay/zephyr/compat";
8
+ import { Locale, Slots } from "@morlay/zephyr-app/client";
9
+ import { SessionController } from "@morlay/dsh-conversation/contract";
10
+ import { InputTriggers } from "./input.token.ts";
11
+
12
+ @Injectable()
13
+ export class InputTriggerSlot extends fromCordis(InputTriggers, UiInputTriggerPlugin) {
14
+ private readonly sessions = inject(SessionController);
15
+
16
+ private readonly locale = inject(Locale);
17
+
18
+ private readonly slots = inject(Slots);
19
+
20
+ override async onInit(ctx: Context): Promise<void> {
21
+ await this.mount(ctx, undefined, {
22
+ sessions: this.sessions,
23
+ locale: this.locale,
24
+ slots: this.slots,
25
+ });
26
+ }
27
+ }
@@ -0,0 +1,2 @@
1
+ // input(对话的输入区)跨行令牌:home 在对话域契约面(技能域要往输入区注册触发源)。
2
+ export { InputTriggers } from "@morlay/dsh-conversation/contract";
@@ -0,0 +1,42 @@
1
+ // 输入区的一行(上游 `ui-commands` / `ui-reference` / `ui-skill` / `ui-plan`)。
2
+ import * as UiReferencePlugin from "@deepseek-ai/dsh-client-ui-reference/client";
3
+ import { inject, Injectable, type Context } from "@morlay/zephyr";
4
+ import { fromCordis } from "@morlay/zephyr/compat";
5
+ import { Locale, Remote, Slots } from "@morlay/zephyr-app/client";
6
+ import { SessionController } from "@morlay/dsh-conversation/contract";
7
+ import { UiConversation } from "../conversation/conversation.token.ts";
8
+ import { SidebarRight } from "../ports.ts";
9
+ import { InputTriggers } from "../input/input.token.ts";
10
+ import { fileReferencesGroupName, sessionReferenceGroupName } from "../../endpoint/index.ts";
11
+ import { remoteNamespaceKey } from "@morlay/zephyr-app/client/remote";
12
+
13
+ @Injectable()
14
+ export class ReferenceSlot extends fromCordis(UiReferencePlugin) {
15
+ private readonly inputTriggers = inject(InputTriggers);
16
+
17
+ private readonly locale = inject(Locale);
18
+
19
+ private readonly sessions = inject(SessionController);
20
+
21
+ private readonly remote = inject(Remote);
22
+
23
+ private readonly sidebarRight = inject(SidebarRight);
24
+
25
+ private readonly slots = inject(Slots);
26
+
27
+ private readonly uiConversation = inject(UiConversation);
28
+
29
+ override async onInit(ctx: Context): Promise<void> {
30
+ await this.mount(ctx, undefined, {
31
+ inputTriggers: this.inputTriggers,
32
+ locale: this.locale,
33
+ sessions: this.sessions,
34
+ remote: this.remote,
35
+ [remoteNamespaceKey(fileReferencesGroupName())]: this.remote,
36
+ [remoteNamespaceKey(sessionReferenceGroupName())]: this.remote,
37
+ sidebarRight: this.sidebarRight,
38
+ slots: this.slots,
39
+ uiConversation: this.uiConversation,
40
+ });
41
+ }
42
+ }
@@ -0,0 +1,50 @@
1
+ // 输入框旁的模型选择器(上游 `ui-model-selection` 的 **client 半**)。
2
+ //
3
+ // 上游那一行是**一个插件的两个入口**:`/model` 弹层(往 `commandUi` 注册)与输入区的
4
+ // `conversation.input.model` 座位,两者共用它自己建的 `ctx.modelDirectories`(每会话一份目录,
5
+ // 数据来自 `session/modelCatalog`,写入走 `session/selectModel`)。本行不重写任何界面:
6
+ // 只把它的外部服务按上游注册名接上(`sessions` / `slots` / `locale` / `remote` / 「会话组」 /
7
+ // 「子代理组」 / `commandUi` / `uiResponsive`——后三项是 alpha.3 起上游 inject 里多出来的)。
8
+ //
9
+ // `commandUi` 用真的契约(`@morlay/dsh-command` 的 `CommandUi`,实现是上游 `ui-commands` 那一行):
10
+ // 空面会让 `/model` 的贡献被吞掉——`/` 面板里就没有它,而且不报错。
11
+ import * as UiModelSelectionPlugin from "@deepseek-ai/dsh-client-ui-model-selection/client";
12
+ import { inject, Injectable, type Context } from "@morlay/zephyr";
13
+ import { fromCordis } from "@morlay/zephyr/compat";
14
+ import { Locale, Remote, Slots, UiResponsive } from "@morlay/zephyr-app/client";
15
+ import { SessionController } from "@morlay/dsh-session/endpoint";
16
+ import { CommandUi } from "@morlay/dsh-command/ui";
17
+
18
+ import { sessionGroupName } from "@morlay/dsh-session/endpoint";
19
+ import { subagentsGroupName } from "@morlay/dsh-agent/endpoint";
20
+ import { remoteNamespaceKey } from "@morlay/zephyr-app/client/remote";
21
+
22
+ @Injectable()
23
+ export class ModelSelectionSlots extends fromCordis(UiModelSelectionPlugin) {
24
+ private readonly sessions = inject(SessionController);
25
+
26
+ private readonly slots = inject(Slots);
27
+
28
+ private readonly locale = inject(Locale);
29
+
30
+ private readonly remote = inject(Remote);
31
+
32
+ private readonly commandUi = inject(CommandUi);
33
+
34
+ private readonly uiResponsive = inject(UiResponsive);
35
+
36
+ override async onInit(ctx: Context): Promise<void> {
37
+ await this.mount(ctx, undefined, {
38
+ sessions: this.sessions,
39
+ slots: this.slots,
40
+ locale: this.locale,
41
+ remote: this.remote,
42
+ [remoteNamespaceKey(sessionGroupName())]: this.remote,
43
+ // 模型选择器可以按子代理换模型(alpha.3 的 `selectModelByUser`):组由 `@morlay/dsh-agent` 的
44
+ // `SubagentsEndpointClient` 挂上,这里只按同一份组名把名字交给上游。
45
+ [remoteNamespaceKey(subagentsGroupName())]: this.remote,
46
+ commandUi: this.commandUi,
47
+ uiResponsive: this.uiResponsive,
48
+ });
49
+ }
50
+ }
@@ -0,0 +1,10 @@
1
+ import { provide } from "@morlay/zephyr";
2
+ import { ApprovalSlot } from "./approval-slot.ts";
3
+ import { UserQuestionsSlots } from "./user-questions-slots.ts";
4
+
5
+ /**
6
+ * permission 的两个**位置**:批准弹层(`approval`)与用户提问(`userQuestions`)。
7
+ *
8
+ * 与 `provideApproval()` / `providePermissionUi()` 分开:位置贡献要求会话界面已就位,装它们的人自己排序。
9
+ */
10
+ export const provideUserQuestionsSlots = provide([ApprovalSlot, UserQuestionsSlots]);
@@ -0,0 +1,5 @@
1
+ import { provide } from "@morlay/zephyr";
2
+ import { UiPermission } from "./ui-permission.service.ts";
3
+
4
+ /** permission 的浏览器半:上游 UI 行(组件未导出,按转发方式挂载)。 */
5
+ export const providePermissionUi = provide([UiPermission]);
@@ -0,0 +1,3 @@
1
+ // 会话界面**消费**的右侧栏端口:`SidebarRight` 是应用框架的位(home 在 `@morlay/zephyr-app/client`),
2
+ // tab 类型注册表同层。别的域(工作区、技能、终端)也认它们,所以不是某个域的概念。
3
+ export { SidebarRight, SidebarRightTabs } from "@morlay/zephyr-app/client";