toDict
Convert all contexts to a dictionary for SWML generation. Calls validate()
first and throws Error if the configuration is invalid.
Returns
Record<string, unknown> — A mapping of context names to their serialized dictionaries,
ready for inclusion in the SWML document.