DAG总览 / 组目录 / G10 凭据与授权

dsh-authorization · @deepseek-ai/dsh-authorization

Layer 2G10
目录: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-authorization
分组G10 · 凭据与授权
拓扑层Layer 2(层次遍历:被依赖方先于依赖方)
源码路径packages/credentials/authorization

① 实现逻辑

定义 `ctx.authorization` 能力 seam:`AuthorizationService` 继承 cordis `Service` 并 `static inject=['credentials']`(src/index.ts:189-198),以 `registerFlow()` 按 `CredentialKey` 注册「凭据获取流程」且一个 key 只允许一个 flow(src/index.ts:209-225)。`begin()` 用 `running` Map 保证同一 key 单飞、校验 method 合法性,并把流程屏蔽在一个中立会话(notify/commit/prompt)后执行(src/index.ts:283-323)。seam 只在流程于本次尝试内确实提交了凭据记录后才报 `authorized`(`observed.committed` + `describeRecord`,src/index.ts:392-453),并以容错扇出广播 `authorization/settled`(src/index.ts:338-358)。`invariant.ts` 独立校验 settled 后 key 不再 in-flight(src/invariant.ts:24-37),`types.ts` 给出不含 cordis/service 依赖的 wire 安全类型(src/types.ts:1-91)。

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

② 注册/提供(provides)

③ 依赖(depends_on · 上游前驱)

dsh-invariantsE1+E2
注册 single-flight 释放不变式,检测 settled 后 key 残留 in-flight
src/invariant.ts:7 import InvariantInstaller + src/invariant.ts:14 inject ['invariants'] + src/invariant.ts:45 register
dsh-llmE1
AuthorizationError 复用 HarnessError 稳定错误分类
src/index.ts:31 import HarnessError

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

dsh-deepseek-account-platform
把浏览器 PKCE 登录注册为授权流程并驱动一次尝试
src/index.ts:12 import AuthorizationSession + src/index.ts:85 inject + src/index.ts:138 registerFlow + src/index.ts:413 begin
dsh-llm-pi-ai
把 pi-ai 的登录会话翻译成 harness 中立的通知/提问流程
src/login.ts:12 import type AuthorizationMethod + src/login.ts:138 ctx.authorization.registerFlow