// Copyright (c) 2026 defconxt. All rights reserved.
// Licensed under AGPL-3.0 — see LICENSE file for details.

/**
 * Domain handler registry.
 * Maps mode names to handler modules.
 */

import { RedHandler } from './handlers/red.js';
import { BlueHandler } from './handlers/blue.js';
import { PurpleHandler } from './handlers/purple.js';
import { IncidentHandler } from './handlers/incident.js';
import { PrivacyHandler } from './handlers/privacy.js';
import { ReconHandler } from './handlers/recon.js';
import { ArchitectHandler } from './handlers/architect.js';
import { ResearcherHandler } from './handlers/researcher.js';

const HANDLERS = {
  red:        new RedHandler(),
  blue:       new BlueHandler(),
  purple:     new PurpleHandler(),
  incident:   new IncidentHandler(),
  privacy:    new PrivacyHandler(),
  recon:      new ReconHandler(),
  architect:  new ArchitectHandler(),
  researcher: new ResearcherHandler(),
};

/**
 * Get the handler for a given mode.
 * Falls back to architect if mode is unknown.
 */
export function getHandler(mode) {
  return HANDLERS[mode] || HANDLERS.architect;
}
