// Copyright (c) Microsoft. All rights reserved. namespace Microsoft.Agents.AI.Workflows.Generators.Models; /// /// Represents protocol type information extracted from class-level [SendsMessage] or [YieldsOutput] attributes. /// Used by the incremental generator pipeline to capture classes that declare protocol types /// but may not have [MessageHandler] methods (e.g., when ConfigureRoutes is manually implemented). /// /// Unique identifier for the class (fully qualified name). /// The namespace of the class. /// The name of the class. /// The generic type parameters (e.g., "<T>"), or null if not generic. /// Whether the class is nested inside another class. /// The chain of containing types for nested classes. Empty if not nested. /// Whether the class is declared as partial. /// Whether the class derives from Executor. /// Whether the class has a manually defined ConfigureRoutes method. /// Whether a base class already overrides ConfigureProtocol. /// Location info for diagnostics. /// The fully qualified type name from the attribute. /// Whether this is from a SendsMessage or YieldsOutput attribute. internal sealed record ClassProtocolInfo( string ClassKey, string? Namespace, string ClassName, string? GenericParameters, bool IsNested, string ContainingTypeChain, bool IsPartialClass, bool DerivesFromExecutor, bool HasManualConfigureRoutes, bool BaseHasConfigureProtocol, DiagnosticLocationInfo? ClassLocation, string TypeName, ProtocolAttributeKind AttributeKind) { /// /// Gets an empty result for invalid targets. /// public static ClassProtocolInfo Empty { get; } = new( string.Empty, null, string.Empty, null, false, string.Empty, false, false, false, false, null, string.Empty, ProtocolAttributeKind.Send); }