| 643 | } |
| 644 | |
| 645 | func validPlugin(plugin pluginapi.Plugin) bool { |
| 646 | if strings.TrimSpace(plugin.Metadata.Name) == "" { |
| 647 | return false |
| 648 | } |
| 649 | if strings.TrimSpace(plugin.Metadata.Version) == "" { |
| 650 | return false |
| 651 | } |
| 652 | if strings.TrimSpace(plugin.Metadata.Author) == "" { |
| 653 | return false |
| 654 | } |
| 655 | if strings.TrimSpace(plugin.Metadata.GitHubRepository) == "" { |
| 656 | return false |
| 657 | } |
| 658 | caps := plugin.Capabilities |
| 659 | return caps.ModelRegistrar != nil || |
| 660 | caps.ModelProvider != nil || |
| 661 | caps.AuthProvider != nil || |
| 662 | caps.FrontendAuthProvider != nil || |
| 663 | caps.Scheduler != nil || |
| 664 | caps.ModelRouter != nil || |
| 665 | caps.Executor != nil || |
| 666 | caps.RequestTranslator != nil || |
| 667 | caps.RequestNormalizer != nil || |
| 668 | caps.RequestInterceptor != nil || |
| 669 | caps.ResponseTranslator != nil || |
| 670 | caps.ResponseBeforeTranslator != nil || |
| 671 | caps.ResponseAfterTranslator != nil || |
| 672 | caps.ResponseInterceptor != nil || |
| 673 | caps.StreamChunkInterceptor != nil || |
| 674 | caps.ThinkingApplier != nil || |
| 675 | caps.UsagePlugin != nil || |
| 676 | caps.CommandLinePlugin != nil || |
| 677 | caps.ManagementAPI != nil |
| 678 | } |
| 679 | |
| 680 | func typeName(v any) string { |
| 681 | return fmt.Sprintf("%T", v) |