buildSafeOutputOptions loads safe output tool options from safe_outputs_tools.json and returns them as huh form options.
()
| 785 | // buildSafeOutputOptions loads safe output tool options from safe_outputs_tools.json |
| 786 | // and returns them as huh form options. |
| 787 | func buildSafeOutputOptions() []huh.Option[string] { |
| 788 | tools := workflow.GetSafeOutputToolOptions() |
| 789 | |
| 790 | options := make([]huh.Option[string], 0, len(tools)) |
| 791 | for _, t := range tools { |
| 792 | // Truncate long descriptions so option labels remain readable |
| 793 | desc := t.Description |
| 794 | if idx := strings.IndexByte(desc, '.'); idx > 0 && idx < 120 { |
| 795 | desc = desc[:idx] |
| 796 | } else if len(desc) > 120 { |
| 797 | desc = desc[:120] + "…" |
| 798 | } |
| 799 | label := fmt.Sprintf("%s - %s", t.Key, desc) |
| 800 | options = append(options, huh.NewOption(label, t.Key)) |
| 801 | } |
| 802 | return options |
| 803 | } |
| 804 | |
| 805 | // repoLanguageMarkers maps well-known ecosystem indicator files to their network bucket name. |
| 806 | var repoLanguageMarkers = []struct { |