feat(adapters): 新增Claude Code、CodeBuddy跨平台适配器,实现四层记忆引擎多平台接入(腾讯犀牛鸟开源)#385
feat(adapters): 新增Claude Code、CodeBuddy跨平台适配器,实现四层记忆引擎多平台接入(腾讯犀牛鸟开源)#385rainforest888 wants to merge 3 commits into
Conversation
完成 Issue TencentCloud#235 全部四个验收标准: 基础: 阅读TdaiCore/HostAdapter源码,绘制架构图与数据流(docs/tdai-adapter-architecture.md) 进阶: 为Claude Code编写MCP适配层,实现记忆读写(cc-mcp-server.ts, 169行, 4工具) 深入: 适配Claude Code + CodeBuddy + Hermes三平台,编写对比文档(docs/platform-adapter-comparison.md) 拓展: 封装TdaiPlatformAdapter统一接口,新平台~85行薄壳即可接入(src/adapters/shared/types.ts) 核心设计: 复用项目原生HostAdapter模式,不引入额外抽象层(总代码~800行 vs 同类PR~5800行)。 已验证: Gateway四端全通,MCP协议合规(CodeBuddy审查),三平台E2E跨平台记忆共享通过。
|
有任何问题请直接联系我!谢谢导师或者其他开源伙伴的帮助! |
|
Thanks for the thoughtful comparison! A few clarifications from the PR #339 side: You are right that directly extending HostAdapter is the canonical pattern for pure TS adapters. Your CCHostAdapter and CodeBuddyHostAdapter at ~40-60 lines each are cleaner than what we did for the TS path. If our goal were only to add more TypeScript platform adapters, your approach would be the right one. Where the difference comes from: cross-language goal. PR #339 is not just a TS adapter -- it also provides a Python SDK (bridge_adapter) and a standalone MCP stdio server. Python has no HostAdapter, no Hermes provider, so we needed a new abstraction layer (TdaiAdapter ABC) on that side. The TypeScript TdaiAdapter interface exists mainly for parity with the Python ABC, so that both SDKs speak the same contract. On the MCP server side: The self-gated server (G0-G4: format check, HMAC auth, rate limit, circuit breaker, audit) is designed as a standalone fallback that works without Hermes. In production it sits behind agentgateway and only activates as a safety net -- different role from the Hermes MCP provider. I think these two approaches are complementary:
Happy to discuss further if any of this is unclear. Good work on the Claude Code and CodeBuddy adapters! |
|
Thank you for submitting this PR and participating in Tencent Rhino-bird Open-source Training Program! |
|
Hi @gugu23456789, thanks a lot for the detailed clarification — it really helps frame the two PRs correctly, and I appreciate the constructive tone. Fully agree with your complementary framing:
Both serve Issue #235's goal of making TDAI memory accessible from anywhere, and they operate at different layers, so they don't conflict. One housekeeping note: to keep this PR's docs self-contained, I've removed the cross-PR comparison from Thanks again for the feedback, and nice work on the Python SDK + standalone MCP server! 🚀 |
完成内容
实现 Issue #235 全部四个验收标准:
基础 ✅ 架构图与数据流
docs/tdai-adapter-architecture.md进阶 ✅ Claude Code 适配器
深入 ✅ 三平台适配 + 对比文档
docs/platform-adapter-comparison.md拓展 ✅ 统一适配器 SDK
docs/methodology.md核心设计
复用项目原生 HostAdapter 模式(与 OpenClawHostAdapter/StandaloneHostAdapter 一致),不引入额外抽象层。
验证
claude mcp list/codebuddy mcp list)新增文件
src/adapters/claude-code/host-adapter.tssrc/adapters/codebuddy/host-adapter.tssrc/adapters/shared/types.tsdocs/tdai-adapter-architecture.mddocs/platform-adapter-comparison.mddocs/methodology.mdCloses #235