import { helloWorldAgent } from './helloAgent'; import { WhatsAppMessage } from './types'; export type Handler = string | ((msg: WhatsAppMessage | string) => Promise); export const chatHandlers: Record = { '50498554225@c.us': helloWorldAgent, // Add other mappings like: // '50496210031@c.us': 'http://llm-agent:8000' }; export function getHandler(chatId: string | undefined, defaultUrl?: string): Handler | undefined { if (!chatId) return defaultUrl; return chatHandlers[chatId] || defaultUrl; }