Openclaw 到本地 wechat-publisher-agent 的发布总控网关(V1)。和https://github.com/xu75/wechat-unofficial-publisher-agent 配套使用。
因为是自己用的,安装说明不是很清楚,建议用codex帮你分析后安装。欢迎对安装说明进行更新完善。
在openclaw里面,配合wechat-notes-style生成文章,直接用/publish_wechat发布到自己公众号,如果Agent没有登录,则会返回登录二维码,扫码登录后继续执行就可以了。如果已经登录但是想换另一个账号,或者未登录状态,可用/publish_wechat_relogin来登录。
- 固定三条 API:
POST /wechat/publishPOST /wechat/publish/:task_id/confirm-loginGET /wechat/publish/:task_id
- Gateway 内容处理(不下沉 Agent):
- markdown -> html
- HTML sanitize
- 图片 URL 规则校验与重写(仅允许绝对 HTTPS)
- Agent 对接方式(Remote MCP):
- 默认 Agent 地址
http://127.0.0.1:14273(自动走/mcp) - 工具调用固定使用
structuredContent解析 - 当前使用工具:
publisher_healthpublisher_login_statuspublisher_login_qr_getpublisher_publish
- 发布成功判定:
status=accepted且execution.draft_saved=true
- 状态机与登录约束:
waiting_login不轮询 publishconfirm-login仅允许一次重试waiting_login默认 600s 超时转manual_intervention并告警
- 可观测与回放:
request_id透传- 结构化日志(
request_id/task_id/stage/status/error_code) - sqlite 持久化
publish_tasks / publish_events / publish_audit_logs
cp .env.example .env
npm install
npm run db:migrate
npm run devnpm run check
npm run test
npm run db:migrate
npm run dev
npm run build
npm run start:prod./scripts/smoke-curl.sh