目录:ACP 协议API 网关与控制器附件启动与插件管理客户端运行时客户端 UI 包上下文压缩上下文注入核心运行时凭据与授权交付物文档处理实验特性宿主扩展反馈通道文件系统目标与计划工具守卫Hooks 扩展宿主服务交互命令作业调度LLM 适配LSP 集成MCP 协议规划模式Agent 预设代码执行运行时运行时诊断沙箱定时调度SDK 与协议会话核心会话检索设置Shell 执行技能溢出存储SSH 远程执行存储子代理子进程终端待办类型契约框架 vendorWeb 访问Webhook工作流工作区
依赖链 · 上游(该插件依赖的前驱):
依赖链 · 下游(依赖该插件的节点):
dsh-api-gatewaydsh-api-remotesdsh-api-session-controllerdsh-client-file-uploaddsh-client-ui-deliverablesdsh-client-ui-permission-presetsdsh-client-ui-scheduledsh-client-ui-settings-generaldsh-experimental-webworker-runtimedsh-host-frontend-staticdsh-host-open-in-app
同一拓扑层(Layer 2,层次遍历层序):
插件信息
| 包名 | @deepseek-ai/dsh-client-connection |
|---|---|
| 分组 | G05 · 客户端运行时 |
| 拓扑层 | Layer 2(层次遍历:被依赖方先于依赖方) |
| 源码路径 | packages/client/connection |
| 来源层 | L2 web-app bundle(base 之上装配) |
① 实现逻辑
Host 侧 `HostConnectionService` 提供载体中立的 RPC 与 Fetch 注册表,并在有 `webServer` 时把 `/api` 路由挂到 Web 服务器,经 Host/Origin 信任栅栏与持久浏览器认证后才放行 (src/index.ts:124-162, src/rpc-host.ts:63-113)。浏览器侧 `installConnection` 装配 `ctx.connection`,把 `ConnectionController` 的连接/重连循环、generation 状态与通用 RPC 通道以 getSnapshot/subscribe 观察面暴露,并在 online/offline 时更新可用性 (src/client/index.ts:205-311)。两侧通过 `__DSH_CONNECTION_RECOVERY__` 全局与 `connection/request` waterfall 协同。
内部结构动态 DAG(深色主题:橙色=上游依赖 · 绿色=下游依赖 · 棕色=外部seam · 蓝=本插件)
本插件
上游依赖
下游依赖
外部 seam
② 注册/提供(provides)
- ctx.connection (Host 侧 Connection 传输与 RPC/Fetch 注册表;浏览器侧连接 generation 与恢复循环句柄)
- connection/request waterfall 事件 (允许对已认证 /api 请求做准入/包装)
- OperatorPeer 与 rpc/schema 导出 (RpcId、transportError、rpcMessageSchema 等)
③ 依赖(depends_on · 上游前驱)
dsh-host-webserverE1+E2
把 /api 路由和 recovery 注入表挂到 Web carrier 上
src/index.ts:8 + src/index.ts:139 ctx.inject(['webServer']) + src/index.ts:158 webCtx.webServer.register
④ 被依赖(dependents · 下游消费者)
dsh-api-gateway
承载 /api RPC 与对等 Peer 身份
src/index.ts:14 import + src/index.ts:233 connection.rpc.intercept
dsh-api-session-controller
媒体引用与客户端连接
src/media-references.ts:10 import + src/client/index.ts:5 import
dsh-client-file-upload
在 Connection 的 fetch 注册表上挂原始字节上传路由
src/index.ts:7 + src/index.ts:58 inject 'connection' + src/index.ts:73 ctx.connection.fetch.register
dsh-client-ui-deliverables
原生打开请求经连接层发送
src/client/index.ts:14 + src/present-open.ts:21 ctx.connection
dsh-client-ui-permission-presets
目录结算以连接世代为围栏
src/client/index.ts:24 import type {} + src/client/catalog.ts:4 import type { ConnectionHandle }
dsh-client-ui-settings-general
取连接状态用于重连入口与桌面更新徽标
src/client/shell-contract.ts:9 import type ConnectionState + src/client/index.ts:88 ctx.get('connection')
dsh-experimental-webworker-runtime
从树中取得共享 fetch handler 供 tunnel 直连
src/worker-host.ts:27 import type { HostConnectionHandle }
dsh-host-frontend-static
对 index 响应执行浏览器鉴权
package.json:31 peerDep + src/index.ts:20 type import; src/index.ts:136 ctx.connection.authorizeIndex
dsh-host-open-in-app
每条路由的信任栅栏与浏览器鉴权
src/index.ts:47 inject=['webServer','connection','subprocess'] + src/index.ts:186 ctx.connection.requestRejection