parseAgentPickerRefs splits a comma-separated list of agent refs, trims whitespace, and drops empty entries. An empty/blank input or the "defaults" sentinel yields the default ref list.
(raw string)
| 892 | // whitespace, and drops empty entries. An empty/blank input or the |
| 893 | // "defaults" sentinel yields the default ref list. |
| 894 | func parseAgentPickerRefs(raw string) []string { |
| 895 | if trimmed := strings.TrimSpace(raw); trimmed == "" || trimmed == agentPickerDefaultsSpec { |
| 896 | return defaultAgentPickerRefs() |
| 897 | } |
| 898 | var refs []string |
| 899 | for part := range strings.SplitSeq(raw, ",") { |
| 900 | if trimmed := strings.TrimSpace(part); trimmed != "" { |
| 901 | refs = append(refs, trimmed) |
| 902 | } |
| 903 | } |
| 904 | if len(refs) == 0 { |
| 905 | return defaultAgentPickerRefs() |
| 906 | } |
| 907 | return refs |
| 908 | } |