namespace ZB.MOM.WW.ScadaBridge.Commons.Messages.Instance;
///
/// Request to wait, event-driven, until an attribute reaches a value (or any
/// value satisfying a predicate), bounded by a timeout — the backing protocol for
/// the script-facing Attributes.WaitAsync helper.
///
///
/// Site-local only. The optional is a non-serializable
/// in-process delegate, so this message MUST flow only within a single site node's
/// actor system (script execution → Instance Actor). It is never sent across the
/// site↔central gRPC boundary. The value-equality form ()
/// would serialize, but the routed/inbound variant is deliberately out of scope here.
///
///
/// Per-wait correlation id; keys the waiter registry and the timeout self-message.
/// The instance this wait targets.
/// The attribute to watch — already scope-resolved by the accessor.
///
/// The codec-encoded target value (AttributeValueCodec.Encode(target)). A
/// match compares the codec-encoded form of the current value against this string.
/// When both this and are null the wait matches on ANY change.
///
///
/// Site-local predicate tested against the raw (decoded) current value. Mutually
/// exclusive with — null when the encoded target is used.
///
/// How long to wait before self-evicting with a timeout reply.
/// When the request was issued (UTC).
///
/// Quality-gated ("Good"-only) mode (spec §4.2): when , a
/// match additionally requires the attribute quality to be exactly
/// "Good" () — a value that
/// reaches the target / satisfies the predicate at Bad/Uncertain quality is NOT a
/// match and the waiter stays pending until the value satisfies the test at Good
/// quality (or times out). Defaults to (quality-agnostic:
/// the match tests the value only). Trailing/defaulted so existing positional
/// constructions compile unchanged.
///
public record WaitForAttributeRequest(
string CorrelationId,
string InstanceName,
string AttributeName,
string? TargetValueEncoded,
Func