LoadMultiple 批量加载技能
(ctx context.Context, skillPaths []string)
| 200 | |
| 201 | // LoadMultiple 批量加载技能 |
| 202 | func (sl *SkillLoader) LoadMultiple(ctx context.Context, skillPaths []string) (map[string]*SkillDefinition, error) { |
| 203 | skills := make(map[string]*SkillDefinition) |
| 204 | |
| 205 | for _, path := range skillPaths { |
| 206 | skill, err := sl.Load(ctx, path) |
| 207 | if err != nil { |
| 208 | // 记录错误但继续加载其他技能 |
| 209 | fmt.Printf("[Skills Loader] Failed to load skill '%s': %v\n", path, err) |
| 210 | continue |
| 211 | } |
| 212 | skills[path] = skill |
| 213 | fmt.Printf("[Skills Loader] Successfully loaded skill: %s\n", path) |
| 214 | } |
| 215 | |
| 216 | return skills, nil |
| 217 | } |
| 218 | |
| 219 | // Discover 发现所有可用技能 |
| 220 | func (sl *SkillLoader) Discover(ctx context.Context) ([]string, error) { |
no test coverage detected