@dpskh/a2a
Agent2Agent interop for the DeepSeek Harness in one package — the realtime mesh hub (project registry, immutable message history, WebSocket presence) and mesh client (per-agent connections, serial injection), the model-facing a2a_peers / a2a_message / a2a_history tools, and the /a2a command surface
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:dpskh/dsh-a2a说明文档
阅读完整 README ↗@dpskh/a2a —— DeepSeek Harness 的 Agent2Agent 实时 mesh
English | 中文
一个包、一个入口插件。挂载 @dpskh/a2a 0.3 即获得实时 A2A mesh:hub 主机(ctx.a2aHub:基于 storage 域的项目注册表与不可变消息历史,可选监听 hub 服务器,同时承载实时 WebSocket)、mesh 客户端(ctx.a2aMesh:每个已连接 agent 一个 WebSocket presence,串行注入)、a2a_peers / a2a_message / a2a_history 工具族与 /a2a 命令面。Presence 即存活的 socket;消息是唯一的持久记录——运行于可信私有网络上的实时聊天。
配置
- id: a2a
name: '@dpskh/a2a'
config:
hub: # optional: run the mesh hub server
host: 127.0.0.1
port: 43123 # base bind port
maxPort: 43223 # optional: walk up on EADDRINUSE
mesh: # optional: mesh client
project: main # project to connect to (defaults to main)
agentId: main # local agent this presence belongs to
name: main # roster name; defaults to the agent id
autoConnect: true # connect when the configured agent registers
persistConnections: false # remember each session's last connection and rejoin it
reconnectMs: 500 # initial reconnect delay (doubles to 10 s)
hub 需要路由的存储后端:挂载 @deepseek-ai/dsh-storage、一个后端(storage-json 或 storage-sqlite)以及 @deepseek-ai/dsh-storage-domain,并将后端路由到 a2a 域。入口插件组合 hub 主机服务(ctx.a2aHub)、mesh 客户端(ctx.a2aMesh),以及——当配置了 mesh 时——工具与命令插件(cordis 依据其 inject 依赖激活)。已移除的 0.2 mesh 配置字段(persistBindings、autoRejoin、pollIntervalMs、heartbeatMs、caps)会被忽略,以便兼容复制的 0.2 配置。
Mesh
- Hub(
ctx.a2aHub):权威项目注册表与追加式消息历史(每个项目单调递增的序号、项目作用域的messageRef,如demo:42)。可选的 hub 服务器通过 HTTP 提供项目/历史路由,并在/v1/connect提供实时 WebSocket(协议版本 3)。 - Presence:presence 存在当且仅当某条 WebSocket 存活。注册名在项目内唯一;同名后到的连接是新的 presence,不继承任何旧状态。Hub 重启清空全部 presence,消息历史则幸存。
- 消息:不可变,按
messageId幂等(重试相同内容返回原消息;用相同 id 发不同内容会以MessageIdConflictError失败)。定向发送在接收时解析接收方的当前 presence,接收方不在场立即失败;项目广播冻结当前 presence 快照(排除发送者),绝不回填后来的加入者。replyTo在同一项目历史内提供因果性。文本与附件共享 4 MiB 解码内容预算;每条消息最多八个附件,以 base64 传输(更小时使用 gzip)。 - 投递:面向发送者的内存内结果——
delivered证明接收方客户端已注入该消息, 是物化/注入错误, 是确认前关闭的 socket。