(prefix string)
| 962 | } |
| 963 | |
| 964 | func (cli *ChatCLI) getPluginNameSuggestions(prefix string) []prompt.Suggest { |
| 965 | if cli.pluginManager == nil { |
| 966 | return nil |
| 967 | } |
| 968 | plugins := cli.pluginManager.GetPlugins() |
| 969 | suggestions := make([]prompt.Suggest, 0, len(plugins)) |
| 970 | for _, p := range plugins { |
| 971 | // Remove o '@' para a sugestão, pois é mais fácil de digitar |
| 972 | nameWithoutAt := strings.TrimPrefix(p.Name(), "@") |
| 973 | suggestions = append(suggestions, prompt.Suggest{ |
| 974 | Text: nameWithoutAt, |
| 975 | Description: p.Description(), |
| 976 | }) |
| 977 | } |
| 978 | return prompt.FilterHasPrefix(suggestions, prefix, true) |
| 979 | } |
| 980 | |
| 981 | func (cli *ChatCLI) getAgentSuggestions(d prompt.Document) []prompt.Suggest { |
| 982 | line := d.TextBeforeCursor() |
no test coverage detected