namespace ZB.MOM.WW.OtOpcUa.Commons.Messages.Mesh;

/// <summary>
///     A central→node command, plus the DistributedPubSub topic it would have been published on.
/// </summary>
/// <param name="Topic">
///     The legacy DPS topic. Carried so the router can publish under
///     <c>MeshTransport:Mode = Dps</c> without a second dispatch table; ignored entirely under
///     <c>ClusterClient</c> mode, where the destination is an actor path rather than a topic.
/// </param>
/// <param name="Message">
///     The command itself, never wrapped. Node-side handlers see exactly the type they see today,
///     which is what lets the dark switch touch publishers only.
/// </param>
/// <remarks>
///     <para>
///         This envelope exists so the admin singletons stop knowing which transport is in force.
///         Before per-cluster mesh Phase 2 each publisher held its own
///         <c>DistributedPubSub.Get(Context.System).Mediator</c> call, so the switch would have had
///         to be threaded through five call sites across two actors, and each would have been free
///         to drift.
///     </para>
///     <para>
///         Central-side only — it never crosses the wire, so it carries no serialization contract
///         and needs no additive-evolution discipline.
///     </para>
/// </remarks>
public sealed record MeshCommand(string Topic, object Message);
