UNPKG

plazbot

Version:

Official Plazbot SDK for creating AI agents for WhatsApp, portals, and developers.

19 lines (18 loc) 698 B
import type { PlzContext } from './context'; import type { PlazbotEvent, PlazbotEventType } from './events'; /** Configuracion completa de un worker (event listener) */ export interface WorkerConfig { /** Nombre unico del worker (slug) */ name: string; /** Referencia del worker — describe que hace y cuando debe ejecutarse */ reference: string; /** Eventos que disparan este worker */ events: PlazbotEventType[]; /** Handler que se ejecuta cuando ocurre un evento */ handler(event: PlazbotEvent, plz: PlzContext): Promise<void>; } /** Worker definido y listo para desplegar */ export interface WorkerDefinition { __type: 'worker'; config: WorkerConfig; }