/** * Gateway cross-wiring for MAMA OS runtime. * * Extracted from cli/commands/start.ts to keep the orchestrator thin. * All logic and function signatures are unchanged. * * Responsibilities: * 1. Gateway registry for memory save confirmations (messageRouter.setGatewayRegistry) * 2. Health check gateway wiring (healthCheckService.addGateway for each active gateway) * 3. Security alert sender wiring (parseSecurityAlertTargets → healthCheckService.securityAlertSender) * 4. CronResultRouter — routes cron results to Discord/Slack/Telegram gateways * 5. Graph handler runtime wiring — populates graphHandlerOptions with: * - getAgentStates(), getSwarmTasks(), getRecentDelegations() * - applyMultiAgentConfig(), restartMultiAgentAgent(), stopMultiAgentAgent() * - delegation count and agent states wired into healthCheckService * 6. Plugin gateway loader — PluginLoader for additional gateways (e.g. Chatwork) */ import type { EventEmitter } from 'node:events'; import type { MAMAConfig } from '../config/types.js'; import type { AgentLoop } from '../../agent/index.js'; import { DiscordGateway, SlackGateway, TelegramGateway, MessageRouter, PluginLoader } from '../../gateways/index.js'; import type { HealthCheckService } from '../../observability/health-check.js'; import type { GraphHandlerOptions } from '../../api/graph-api-types.js'; import type { SQLiteDatabase } from '../../sqlite.js'; /** * Result returned by wireGateways. */ export interface GatewayWiringResult { pluginLoader: PluginLoader; } /** * Wire gateways into the various subsystems after gateway initialization. * * Populates graphHandlerOptions in place (mutable object, matching current pattern). */ export declare function wireGateways(params: { config: MAMAConfig; messageRouter: MessageRouter; healthCheckService: HealthCheckService; graphHandlerOptions: GraphHandlerOptions; db: SQLiteDatabase; discordGateway: DiscordGateway | null; slackGateway: SlackGateway | null; telegramGateway: TelegramGateway | null; gateways: Array<{ stop: () => Promise; }>; agentLoop: AgentLoop; cronEmitter: EventEmitter; }): Promise; //# sourceMappingURL=gateway-wiring.d.ts.map