| 1 | namespace AgentForge.Plugin.Grouping.Core; |
| 2 | |
| 3 | public static class ForgeGroupingUrlBuilder |
| 4 | { |
| 5 | public static string AppendGroupStack(string basePath, IReadOnlyList<string> groupStack) |
| 6 | { |
| 7 | if (groupStack.Count == 0) |
| 8 | return basePath; |
| 9 | |
| 10 | var separator = basePath.Contains('?', StringComparison.Ordinal) ? '&' : '?'; |
| 11 | return $"{basePath}{separator}groupStack={Uri.EscapeDataString(string.Join(',', groupStack))}"; |
| 12 | } |
| 13 | } |
| 14 |