@innerlife/channel
v0.0.2
Published
Engine- and framework-neutral channel framework: bridge IM channels (WeChat, Telegram, Lark) to any conversational brain.
Readme
@innerlife/channel
Engine- and framework-neutral channel framework. Bridges IM channels (WeChat, Telegram, Lark…) to any conversational brain, and embeds in NestJS, bare Node, or any Node framework.
- Engine-neutral — the core has zero dependency on Innerlife Agent. A brain
is plugged in via a
ChannelEngineadapter. - Framework-neutral —
ChannelHostis a plain class. Framework adapters (e.g.@innerlife/channel-nestjs) only wrap its lifecycle. - Decoupled receive/emit ports — inbound is fire-and-forget; outbound (replies
and proactive sends) flows through an
OutboundPortthe host gives the engine.
The full design spec lives in DESIGN.md in the source repository (not shipped in the npm package).
🚧 Scaffolding. Core types +
ChannelHostskeleton are in place. Channel plugins (@innerlife/channel-weixin) and the Innerlife engine adapter (@innerlife/channel-engine-adapter) come next.
Shape
import { ChannelHost } from "@innerlife/channel";
const host = new ChannelHost({
channels: [ /* weixin(), ... */ ], // ChannelPlugin[]
engine, // your ChannelEngine adapter
// storage, logger, media are optional (filesystem / console / OS-temp defaults)
});
host.on("account:status", (s) => console.log(s));
host.on("peer:first-seen", (p) => {/* kick off binding flow */});
await host.start();
// ... await host.stop();Build
pnpm build # tsup → dist/{index.js, index.cjs, index.d.ts}
pnpm typecheck