oaslananka/a2amesh
GitHub: oaslananka/a2amesh
A2A Mesh 是一个 TypeScript 实现的 Agent2Agent 协议运行时与工具包,用于构建、编排和管理多 AI Agent 协作网络。
Stars: 2 | Forks: 1
A2A Mesh 是一个独立的 TypeScript 运行时和工具包,用于 Agent2Agent (A2A) 协议。它不是官方的 Google、Linux Foundation 或 a2aproject 包。
## 信任与供应链
A2A Mesh 在 [`docs/security/trust-evidence.md`](docs/security/trust-evidence.md) 中保留公开信任凭证,并在 [`docs/release/package-verification.md`](docs/release/package-verification.md) 中保留发布包验证凭证。README 徽章仅链接到由工作流支持的信号:CI、文档、安全、CodeQL、OpenSSF Scorecard、npm 包元数据、许可证以及包管理器约束。
## 提供的功能
- A2A 服务器运行时和客户端 SDK,用于处理 Agent Cards、JSON-RPC 消息、tasks、artifacts 和状态转换。
- 用于本地发现和健康轮询的 Registry 组件。
- 在安装可选的 peer dependency 时,用于 OpenAI、Anthropic、LangChain、Google ADK、LlamaIndex 和 CrewAI HTTP bridge 流程的适配器。
- 用于验证、发现、发送消息、registry 导出/导入、监控 tasks、基准测试、诊断和脚手架的 CLI 命令。
- 用于经验证的工作流仓库的 MCP bridge、WebSocket transport、gRPC transport 和测试辅助包。
- 可运行的示例,包括身份验证服务器、流式传输、推送通知、registry 租户、WebSocket、gRPC、MCP bridge、适配器模板以及多 agent registry 发现 mesh。
## 安装
```
pnpm add @a2amesh/runtime
```
PowerShell:
```
pnpm add @a2amesh/runtime
```
## 快速开始
```
pnpm dlx @a2amesh/create-a2amesh demo
cd demo
pnpm install
pnpm run dev
```
PowerShell:
```
pnpm dlx @a2amesh/create-a2amesh demo
Set-Location demo
pnpm install
pnpm run dev
```
## CLI 示例
```
a2amesh validate ./agent-card.json
a2amesh discover http://127.0.0.1:3000
a2amesh init demo-agent --adapter custom
a2amesh send http://127.0.0.1:3000 "hello"
a2amesh task status http://127.0.0.1:3000 task-123
a2amesh health http://127.0.0.1:3000 --timeout-ms 1000 --json
a2amesh conformance http://127.0.0.1:3000 --protocol-version 1.0 --json
a2amesh conformance-badge report.json --output badge.svg
a2amesh registry export --url http://127.0.0.1:3099 --output ./registry-export.json
a2amesh registry import --url http://127.0.0.1:3099 --input ./registry-export.json
a2amesh export-card http://127.0.0.1:3000 --output ./agent-card.json
a2amesh monitor http://127.0.0.1:3000 --cycles 3
a2amesh benchmark http://127.0.0.1:3000 --requests 25 --concurrency 5
a2amesh release-check
a2amesh doctor --json
```
PowerShell:
```
a2amesh validate .\agent-card.json
a2amesh discover http://127.0.0.1:3000
a2amesh init demo-agent --adapter custom
a2amesh send http://127.0.0.1:3000 "hello"
a2amesh task status http://127.0.0.1:3000 task-123
a2amesh health http://127.0.0.1:3000 --timeout-ms 1000 --json
a2amesh conformance http://127.0.0.1:3000 --protocol-version 1.0 --json
a2amesh conformance-badge report.json --output badge.svg
a2amesh registry export --url http://127.0.0.1:3099 --output .\registry-export.json
a2amesh registry import --url http://127.0.0.1:3099 --input .\registry-export.json
a2amesh export-card http://127.0.0.1:3000 --output .\agent-card.json
a2amesh monitor http://127.0.0.1:3000 --cycles 3
a2amesh benchmark http://127.0.0.1:3000 --requests 25 --concurrency 5
a2amesh release-check
a2amesh doctor --json
```
## 包列表
| 包名 | 用途 |
| ------------------------- | ------------------------------------------------------------------------------------------------- |
| `@a2amesh/protocol` | 协议类型、Agent Card、Task、Message、Artifact、JSON schemas、兼容性夹具。 |
| `@a2amesh/runtime` | A2A 客户端/服务器运行时、task 生命周期、流式传输、推送、auth hooks、存储、遥测 hooks。 |
| `@a2amesh/registry` | Agent 发现、健康、信任评分、签名 cards、registry API。 |
| `@a2amesh/mcp` | 安全、可审计、支持审批、受策略限制的 A2A ↔ MCP bridge。 |
| `@a2amesh/cli` | CLI 二进制文件 `a2amesh`。 |
| `@a2amesh/create-a2amesh` | 项目脚手架。 |
## A2A 协议兼容性
该实现的目标是 Agent2Agent 协议 `v1.0.0`。有关受支持的 Node.js、包、协议、transport、可选 peer 和弃用策略矩阵,请参阅 [兼容性](docs/compatibility.md)。
## 安全默认设置
- 公共 HTTP 服务器模式必须使用身份验证,除非它绑定到 loopback。
- A2A 服务器和 registry HTTP 路由默认应用每个客户端的请求限制。
- 远程获取和回调 URL 需通过 SSRF 策略助手。
- CORS 和 WebSocket 源检查在配置后会严格拦截(fail closed)。
- CLI 和 bridge 代码避免打印完整的 auth headers 或具体的 secret 值。
- 版本发布仅由所有者触发,并使用 npm Trusted Publishing/OIDC。
## 支持的适配器和 Transports
| 接口 | 状态 | 验证 |
| ------------------- | ----------------------- | -------------------------------------------------- |
| OpenAI adapter | 支持 | 使用模拟 provider 对象进行单元测试。 |
| Anthropic adapter | 支持 | 使用模拟 provider 对象进行单元测试。 |
| LangChain adapter | 支持 | 使用模拟 runnables 进行单元测试。 |
| Google ADK adapter | 支持 | 单元测试和流式传输测试。 |
| LlamaIndex adapter | 支持 | 使用模拟 provider 对象进行单元测试。 |
| CrewAI HTTP bridge | 支持 | 使用本地 fetch mocks 进行单元测试。 |
| SSE streaming | 支持 | 单元测试和集成测试。 |
| WebSocket transport | 支持 | 包测试。 |
| gRPC transport | 作为包接口保留 | 构建和包检查;参见兼容性说明。 |
| MCP bridge | 支持 | 映射测试。 |
## 文档
- [安装](docs/install.md)
- [兼容性](docs/compatibility.md)
- [发布流程](docs/release/process.md)
文档站点:[https://oaslananka.github.io/a2amesh/](https://oaslananka.github.io/a2amesh/)
## 许可证
Apache-2.0。请参阅 [LICENSE](LICENSE)。
## 仓库成熟度与治理
该仓库作为专业的开源项目进行维护。有关当前的运营模式,请参阅成熟度与贡献文档:
- [仓库成熟度报告](docs/repo-maturity-report.md)
- [贡献指南](CONTRIBUTING.md)
- [治理](GOVERNANCE.md)
- [维护者](MAINTAINERS.md)
- [路线图](ROADMAP.md)
- [安全策略](SECURITY.md)
- [支持策略](SUPPORT.md)
- [OpenSSF 凭证](docs/openssf-evidence.md)
标签:A2A通信, AI智能体, MCP协议, MITM代理, Python工具, TypeScript, 安全插件, 智能体编排, 自动化攻击, 运行时环境