back to home

wong2 / weixin-agent-sdk

View on GitHub
574 stars
72 forks
4 issues

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing wong2/weixin-agent-sdk in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/wong2/weixin-agent-sdk)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

weixin-agent-sdk > 本项目非微信官方项目,代码由 @tencent-weixin/openclaw-weixin 改造而来,仅供学习交流使用。 微信 AI Agent 桥接框架 —— 通过简单的 Agent 接口,将任意 AI 后端接入微信。 项目结构 通过 ACP 接入 Claude Code, Codex, kimi-cli 等 Agent ACP (Agent Client Protocol) 是一个开放的 Agent 通信协议。如果你已有兼容 ACP 的 agent,可以直接通过 接入微信,无需编写任何代码。 扫码登录 Claude Code Codex kimi-cli 后面的部分就是你的 ACP agent 启动命令, 会自动以子进程方式启动它,通过 JSON-RPC over stdio 进行通信。 更多 ACP 兼容 agent 请参考 ACP agent 列表。 自定义 Agent SDK 只导出三样东西: • ** ** 接口 —— 实现它就能接入微信 • ** ** —— 扫码登录 • ** ** —— 启动消息循环 Agent 接口 最简示例 完整示例(自己管理对话历史) OpenAI 示例 是一个完整的 OpenAI Agent 实现,支持多轮对话和图片输入: 支持的环境变量: | 变量 | 必填 | 说明 | |------|------|------| | | 是 | OpenAI API Key | | | 否 | 自定义 API 地址(兼容 OpenAI 接口的第三方服务) | | | 否 | 模型名称,默认 | | | 否 | 系统提示词 | 支持的消息类型 接收(微信 → Agent) | 类型 | | 说明 | |------|-------------|------| | 文本 | — | 直接拿到文字 | | 图片 | | 自动从 CDN 下载解密, 指向本地文件 | | 语音 | | SILK 格式自动转 WAV(需安装 ) | | 视频 | | 自动下载解密 | | 文件 | | 自动下载解密,保留原始文件名 | | 引用消息 | — | 被引用的文本拼入 ,被引用的媒体作为 传入 | | 语音转文字 | — | 微信侧转写的文字直接作为 | 发送(Agent → 微信) | 类型 | 用法 | |------|------| | 文本 | 返回 | | 图片 | 返回 | | 视频 | 返回 | | 文件 | 返回 | | 文本 + 媒体 | 和 同时返回,文本作为附带说明发送 | | 远程图片 | 填 HTTPS 链接,SDK 自动下载后上传到微信 CDN | 内置斜杠命令 在微信中发送以下命令: • —— 直接回复(不经过 Agent),附带通道耗时统计 • —— 开关 debug 模式,启用后每条回复追加全链路耗时 技术细节 • 使用 **长轮询** ( ) 接收消息,无需公网服务器 • 媒体文件通过微信 CDN 中转,**AES-128-ECB** 加密传输 • 单账号模式:每次 覆盖之前的账号 • 断点续传: 持久化到 ,重启后从上次位置继续 • 会话过期自动重连(errcode -14 触发 1 小时冷却后恢复) • Node.js >= 22