SuperAPI AI 工具集

sync-upstream-gateway

智能体与模型

查看项目

更新于 10-15 20:04

技能介绍

用途:把 lobehub-gateway-go 的 Go 实现与上游 LobeHub gateway 参考实现的协议行为对齐。适用于任务要求“同步上游”“对齐协议”“追平最新实现”,或指定 LobeHub tag/commit 要求对齐时。

主要能力:确定目标版本(对齐指定 tag/commit,或追平 device-gateway main、agent-gateway master 的 HEAD);准备上游参考 checkout;读取 README 中固定的协议基线;diff 协议变化(HTTP 路由、请求/响应 JSON schema、WebSocket 消息与事件名、鉴权行为、路由语义与超时、src/types.ts);核对应用侧客户端协议;更新 Go 实现;更新协议基线;验证并记录变化。

使用方式:默认沿用 README 固定基线,不主动同步;未指定且未要求追平时应先向用户确认。参考仓库:device-gateway(main)、agent-gateway(master)、应用侧 lobehub(main)。参考 checkout 位置:device-gateway/、agent-gateway/ 在项目根目录(已被 .gitignore 忽略),lobehub/ 在上一级 ../lobehub/。命令示例:git clone https://github.com/lobehub-biz/device-gateway device-gateway;git clone https://github.com/lobehub-biz/agent-gateway agent-gateway;git clone --depth 1 https://github.com/lobehub/lobehub ../lobehub。验证:go build -o gateway ./cmd/gateway;go test ./...;子模块 cd agent-gateway-go && go test ./...;cd device-gateway-go && go test ./...。

适用场景:上游协议变更需评估同步、需对齐到指定版本、需核对客户端调用约定时。

限制:明确排除 admin APIs、metrics、Durable Object 存储或 WebSocket hibernation、多实例协调、geo reporting、admin reporting;不引入 Cloudflare Workers / Durable Objects 绑定及 Redis、PostgreSQL、NATS 等外部运行时依赖;仅明确要求时才跟踪 main 或 canary。具体 commit、tag 与版本号资料未提供。