目录:ACP 协议API 网关与控制器附件启动与插件管理客户端运行时客户端 UI 包上下文压缩上下文注入核心运行时凭据与授权交付物文档处理实验特性宿主扩展反馈通道文件系统目标与计划工具守卫Hooks 扩展宿主服务交互命令作业调度LLM 适配LSP 集成MCP 协议规划模式Agent 预设代码执行运行时运行时诊断沙箱定时调度SDK 与协议会话核心会话检索设置Shell 执行技能溢出存储SSH 远程执行存储子代理子进程终端待办类型契约框架 vendorWeb 访问Webhook工作流工作区
依赖链 · 上游(该插件依赖的前驱):
dsh-api-remotesdsh-api-session-controllerdsh-client-localedsh-client-shortcutsdsh-client-ui-conversationdsh-client-ui-primitivesdsh-client-ui-rendererdsh-client-ui-sessiondsh-llmdsh-session
依赖链 · 下游(依赖该插件的节点):
同一拓扑层(Layer 14,层次遍历层序):
插件信息
| 包名 | @deepseek-ai/dsh-client-ui-approval |
|---|---|
| 分组 | G06 · 客户端 UI 包 |
| 拓扑层 | Layer 14(层次遍历:被依赖方先于依赖方) |
| 源码路径 | packages/client/ui-approval |
| 来源层 | L2 web-app bundle(base 之上装配) |
① 实现逻辑
浏览器半实现 Remote Event 瀑布的一环:apply 取 ctx.uiSession.registerPendingInteraction 发布器 (src/client/index.ts:88-90),向 'conversation.composer' 以 priority 1 注册接管面板并声明子槽 'conversation.approval.detail' (src/client/index.ts:91-103)。对 ctx.remote.$on('approval/request') 的每个请求构造 PendingApproval,把 sessionId 与 callId/reason/signal 投影成可回答项;未回答时用 delegate() 抛内部拒绝以回到瀑布 next() 继续 (src/client/index.ts:36-70, 104-106)。另在 shortcuts 注册固定 Enter=允许、Esc=拒绝,并注册 approval 字典 (src/client/index.ts:78-87)。宿主半为空 apply (src/index.ts:4)。
内部结构动态 DAG(深色主题:橙色=上游依赖 · 绿色=下游依赖 · 棕色=外部seam · 蓝=本插件)
本插件
上游依赖
下游依赖
外部 seam
② 注册/提供(provides)
- slot: conversation.composer (priority 1 的审批接管面板,选择函数匹配 PendingApproval)
- 子槽声明: conversation.approval.detail (kind single, scope session)
- ctx.uiSession 待决交互类型 approval 的 PendingApproval 呈现与回答生命周期 (answer/delegate/abort/isDelegation)
- Locale 命名空间 approval (zh/en)
- 快捷键 approval.allow (Enter) 与 approval.reject (Esc)
- 导出 PendingApproval 类与 ApprovalComposerProps/ApprovalDecision/ApprovalDetailOwnerProps 类型 (供 ui-chat 的 ApprovalCommand 以 type-only 消费)
③ 依赖(depends_on · 上游前驱)
dsh-api-remotesE1+E2
订阅审批请求瀑布
src/client/index.ts:3 ctx.remote merge + src/client/index.ts:104 ctx.remote.$on('approval/request')
dsh-api-session-controllerE2
把 Remote 监听者 owner 解析成会话 id
src/client/index.ts:4 + src/client/index.ts:43 ctx.sessions.scopeOf(owner)
dsh-client-localeE1+E2
注册 approval 字典与 resolveText
src/client/index.ts:9 + src/client/index.ts:78 ctx.locale.register(NS)
dsh-client-shortcutsE1+E2
注册 Enter/Esc 固定审批快捷键
src/client/index.ts:10 ShortcutCommandId + src/client/index.ts:81-86 scope.shortcuts.registerFixed
dsh-client-ui-conversationE1+E2
占用会话编辑器槽位以接管审批
src/client/index.ts:5 ComposerChainProps + src/client/index.ts:91 ctx.slots.inject('conversation.composer')
dsh-client-ui-primitivesE1
审批面板复用基础组件
src/client/ApprovalPanel.tsx:3 import @deepseek-ai/dsh-client-ui-primitives
dsh-client-ui-rendererE1
引入 slots 服务声明
src/client/index.ts:6 import @deepseek-ai/dsh-client-ui-renderer/client
dsh-client-ui-sessionE1+E2
发布待决交互供会话 UI 呈现
src/client/index.ts:7 PendingInteractionPublisher + src/client/index.ts:88 ctx.uiSession.registerPendingInteraction
dsh-sessionE1
会话标识类型
src/client/contract/slots.ts:3 import SessionId from @deepseek-ai/dsh-session/types
④ 被依赖(dependents · 下游消费者)
dsh-client-ui-chat
消费 conversation.approval.detail 槽的 owner 契约
src/client/chat/ApprovalCommand.tsx:3 import type @deepseek-ai/dsh-client-ui-approval/client