Created At: 2026-11-18T18:33:07Z Completed At: 2026-11-18T18:33:08Z Command exited with code 0. Command output: 165-}; 166- 167-const INITIAL_BOTS: BotContextData[] = []; 168- 169-export interface BotContextType { 170- bots: BotContextData[]; 171- currentBot: BotContextData; 172- selectBot: (idOrUsername: string) => void; 173- registerBot: (name: string, token: string, defaultLocale?: string) => Promise; 174- refreshBots: () => Promise; 175: toggleBotModule: (botId: string, moduleId: string, enabled?: boolean) => void; 176- updateModuleConfig: (botId: string, moduleId: string, config: Record) => void; 177- toggleChecklistStep: (botId: string, stepKey: keyof BotSetupChecklist) => void; 178- applyTemplateToBot: (botId: string, templateName: string, moduleIds: string[]) => void; 179-} 180- 181-const BotContext = createContext(undefined); 182- 183-export const BotProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => { 184- const [bots, setBots] = useState(() => { 185- try { -- 330- ...m, 331- is_enabled: m.id === 'welcome_message', 332- })), 333- }; 334- 335- setBots((prev) => [newBot, ...prev.filter((b) => b.id !== newBot.id)]); 336- setCurrentBotId(newBot.id); 337- return newBot; 338- }; 339- 340: const toggleBotModule = (botId: string, moduleId: string, enabled?: boolean) => { 341- setBots((prev) => 342- prev.map((b) => { 343- if (b.id !== botId) return b; 344- const updatedModules = b.modules.map((m) => { 345- if (m.id !== moduleId) return m; 346- const nextState = enabled !== undefined ? enabled : !m.is_enabled; 347- return { ...m, is_enabled: nextState }; 348- }); 349- return { 350- ...b, -- 407- }; 408- 409- return ( 410- 423- {children} 424- 425- ); 426-}; 427-