// Source-specific normalisers for conversation-archive ingestion.
//
// Each normaliser implements `ConversationNormaliser` and returns the same
// `ParsedLine[]` contract regardless of source format. Adding a new source
// (telegram, slack, signal, …) means adding a sibling file here, registering
// it in `NORMALISERS_BY_SOURCE` below, and extending `CONVERSATION_SOURCES`
// in `types.ts`. No new skill, no new MCP tool, no new plugin.
import { whatsappTextNormaliser } from "./whatsapp-text.js";
import { xDmNormaliser } from "./x-dm.js";
import { emailNormaliser } from "./email.js";
export * from "./types.js";
export { whatsappTextNormaliser } from "./whatsapp-text.js";
export { xDmNormaliser } from "./x-dm.js";
export { emailNormaliser } from "./email.js";
/**
 * Closed registry from source enum → normaliser. Phase 0 ships only
 * `whatsapp`; future sources land here as they are implemented.
 *
 * `getNormaliser` is the only legal lookup — it loud-fails on unimplemented
 * sources rather than silently returning undefined, so the orchestrator
 * cannot drift into "source name in enum but no parser wired" territory.
 */
const NORMALISERS_BY_SOURCE = {
    whatsapp: whatsappTextNormaliser,
    "x-dm": xDmNormaliser,
    email: emailNormaliser,
};
export function getNormaliser(source) {
    const normaliser = NORMALISERS_BY_SOURCE[source];
    if (!normaliser) {
        const implemented = Object.keys(NORMALISERS_BY_SOURCE).join(", ");
        throw new Error(`conversation-archive: no normaliser implemented for source="${source}". Implemented: ${implemented}. Add a sibling file in conversation-normalisers/ and register it in NORMALISERS_BY_SOURCE.`);
    }
    return normaliser;
}
//# sourceMappingURL=index.js.map