MCPcopy Create free account
hub / github.com/github/gh-aw / buildSafeOutputOptions

Function buildSafeOutputOptions

pkg/cli/interactive.go:787–803  ·  view source on GitHub ↗

buildSafeOutputOptions loads safe output tool options from safe_outputs_tools.json and returns them as huh form options.

()

Source from the content-addressed store, hash-verified

785// buildSafeOutputOptions loads safe output tool options from safe_outputs_tools.json
786// and returns them as huh form options.
787func 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.
806var repoLanguageMarkers = []struct {

Callers 3

Calls 1

GetSafeOutputToolOptionsFunction · 0.92

Tested by 1