DAG总览 / 组目录 / G02 API 网关与控制器

dsh-api-workspace-controller · @deepseek-ai/dsh-api-workspace-controller

Layer 4G02L2 web-app
目录:ACP 协议API 网关与控制器附件启动与插件管理客户端运行时客户端 UI 包上下文压缩上下文注入核心运行时凭据与授权交付物文档处理实验特性宿主扩展反馈通道文件系统目标与计划工具守卫Hooks 扩展宿主服务交互命令作业调度LLM 适配LSP 集成MCP 协议规划模式Agent 预设代码执行运行时运行时诊断沙箱定时调度SDK 与协议会话核心会话检索设置Shell 执行技能溢出存储SSH 远程执行存储子代理子进程终端待办类型契约框架 vendorWeb 访问Webhook工作流工作区
依赖链 · 上游(该插件依赖的前驱):
依赖链 · 下游(依赖该插件的节点):
同一拓扑层(Layer 4,层次遍历层序):
↑ Layer 3(24 插件)Layer 4↓ Layer 5(55 插件)

插件信息

包名@deepseek-ai/dsh-api-workspace-controller
分组G02 · API 网关与控制器
拓扑层Layer 4(层次遍历:被依赖方先于依赖方)
源码路径packages/api/workspace-controller
来源层L2 web-app bundle(base 之上装配)

① 实现逻辑

WorkspaceController 继承 TypertRemoteService,以 namespace 'workspace' 注册,注入 typert/workspaceRegistry,并用 WorkspaceCommands/WorkspaceFeed 承载命令与状态流,同时把 DirectoryPickerController 作为子插件挂载 (src/index.ts:51-78)。命令方法(create/rename/delete/insertBefore/insertSessionBefore/archiveSession/unarchiveSession/pinSession/unpinSession)先串行化再调用 workspaceRegistry,并把注册表异常映射为 workspace/* / session/* Remote 失败 (src/commands.ts:45-227, 242-248)。follow 先产 baseline 再订阅 domain/changed,按 workspace 域变更派发 upsert/order/archived/pinned/remove 增量 (src/feed.ts:85-139)。DirectoryPickerController 依 directoryPicker.capability() 门控分发 pick/list/createDirectory,并把 seam 错误投影为 directory-picker/* (src/directory-picker.ts:54-119, 127-170)。

内部结构动态 DAG(深色主题:橙色=上游依赖 · 绿色=下游依赖 · 棕色=外部seam · 蓝=本插件)
本插件 上游依赖 下游依赖 外部 seam

② 注册/提供(provides)

③ 依赖(depends_on · 上游前驱)

dsh-api-gatewayE1
客户端 Remote 载体
src/client/model.ts:5 import
dsh-sessionE1
会话身份类型
src/types.ts:8 import type
dsh-storage-domainE1
domain/changed 事件类型
src/feed.ts:5 import type DomainChanged
dsh-workspaceE1+E2
工作区注册表 seam(全部命令与状态源)
src/commands.ts:4 import + src/index.ts:52 static inject 'workspaceRegistry'

④ 被依赖(dependents · 下游消费者)

dsh-api-remotes
装配 workspace 命名空间
src/client/index.ts:24 import remote
dsh-client-ui-conversation
工作区状态以渲染工作区标题
src/client/contract/slots.ts:6 + src/client/skeleton/ConversationContent.tsx:4
dsh-client-ui-schedule
工作区状态以判定会话是否可跳转
src/client/session-link.ts:3 import
dsh-client-ui-sidebar
startSession 的 workspace 参数类型
src/client/contract/slots.ts:12 import type WorkspaceId
dsh-client-ui-sidebar-browser
经 workspace 服务把浏览器页面映射到工作区
src/client/electron/workspace.ts:2 import (client) + src/client/index.ts:98 ctx.inject(['workspaces'])
dsh-client-ui-workspace
读写工作区实体与快照(create/rename/delete/pin)
src/client/index.ts:29 import + src/client/index.ts:107 ctx.get('workspaces')