namespace AIStudio.Assistants.VisualBriefing; /// /// Maps briefing sources to stable short handles used by model contracts. /// internal static class VisualBriefingSourceHandles { /// /// Orders sources canonically and pairs them with their handles. /// /// The briefing manifest. /// The handles and sources in canonical order. internal static IReadOnlyList<(string Handle, VisualBriefingSource Source)> Map(VisualBriefingManifest manifest) => [ .. manifest.Sources.OrderBy(source => source.SourceId).Select((source, index) => (Handle: Handle(index), Source: source)) ]; /// /// Names the handle at one zero-based canonical source position. /// /// The zero-based canonical position. /// The source handle. private static string Handle(int index) => $"s{index + 1}"; }