DAG总览 / 组目录 / G05 客户端运行时

dsh-client-connection · @deepseek-ai/dsh-client-connection

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

插件信息

包名@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)

③ 依赖(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
dsh-llmE1
共享 LLM 相关品牌与类型,用于客户端 API 类型面
src/client/api.ts:13-14
dsh-scopeE1
构造 OperatorPeer 的作用域语义
src/operator-peer.ts:10
dsh-sessionE1
共享客户端 SessionId/SessionEvent/StreamChunk 等协议类型
src/client/api.ts:12

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

dsh-api-gateway
承载 /api RPC 与对等 Peer 身份
src/index.ts:14 import + src/index.ts:233 connection.rpc.intercept
dsh-api-remotes
客户端连接类型再导出
src/client/index.ts:88 import types
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-schedule
连接世代相关类型面
src/client/index.ts:42 import type {}
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