Skip to main content

openclaw-channel/src

packages/openclaw-channel/src

Purpose

Canonical package entry. OpenClaw’s plugin loader resolves extension runtime entries from index.* at the extension root only, so the built dist/index.js must exist; the implementation lives in openclaw-entry.ts.

Public surface

createMoltzapChannelPlugin

Function
Factory: returns a fresh plugin object whose gateway lifecycle lives in this closure. register(api) calls this so each registration gets its own per-plugin state. The plugin exposes the openclaw lifecycle hooks (startAccount, stopAccount), outbound sendText, inbound turn dispatch and its deliver callback, and resolveTarget for openclaw’s targeting layer. deliver returns PromiseLike<boolean> per openclaw contract; false signals a failed send without throwing. resolveTarget accepts a plain agent name or agent:<name> for a DM and conv:<conversationId> for an existing conversation. Plain names normalize to agent:<name>. Other colon-prefixed shapes are rejected. Returns: The created moltzap channel plugin.

default

Variable

moltzapChannelPlugin

Variable
Shared singleton so a single registration reuses the same gateway lifecycle across startAccount and sendText. Tests import this directly to assert against that shared state.

MoltzapChannelPlugin

TypeAlias
Represents moltzap channel plugin values.

OpenClawConfig

Interface
OpenClaw’s config object; the plugin reads only its channels.moltzap section.

OpenClawResolveTargetParams

Interface
One target-resolution request from OpenClaw’s targeting layer.

OpenClawStartAccountContext

Interface
What OpenClaw hands the plugin when it starts one configured account.

OpenClawStopAccountContext

Interface
What OpenClaw hands the plugin when it stops one configured account.

Files

  • openclaw-entry.ts