@innerlife/channel-weixin
v0.0.3
Published
WeChat (iLink bot) channel plugin for @innerlife/channel. Ported from @tencent-weixin/openclaw-weixin (MIT).
Readme
@innerlife/channel-weixin
WeChat (iLink bot) channel plugin for @innerlife/channel.
Ported from Tencent's @tencent-weixin/openclaw-weixin (MIT) — protocol layer
vendored under src/vendor/, glue rewritten against our ChannelPlugin contract.
🚧 Text + inbound image. Working: QR login, long-poll inbound, text send, typing, inbound image download + AES decrypt →
MediaRef(for multimodal models). Not yet: outbound media (CDN upload), voice (SILK), file/video receive, durable cursor. The full porting blueprint and gotchas live inPORT.mdin the source repository (not shipped in the npm package).
Usage
import { ChannelHost } from "@innerlife/channel";
import { weixin } from "@innerlife/channel-weixin";
const host = new ChannelHost({ channels: [weixin()], engine });
// First-time login (render qr.url / qr.image, await done):
const { qr, done } = await host.login("weixin");
console.log(qr.url);
const { accountId } = await done;
await host.start();Layout
src/
vendor/ VENDORED protocol (zero openclaw): types · api · poller · login-qr
cdn/{aes-ecb,cdn-url,pic-decrypt} CDN download + AES-128-ECB decrypt
weixin-plugin.ts ChannelPlugin (gateway/outbound/auth)
inbound.ts WeixinMessage → InboundMessage (text + image MediaRef)
media.ts image download/decrypt → temp file via host MediaResolver
login.ts QR orchestration → ChannelLoginResult
context-token.ts per accountId:peerId token store
constants.ts