(messages []map[string]any, sources map[string]struct{})
| 28 | } |
| 29 | |
| 30 | func StripSkillContextMessages(messages []map[string]any, sources map[string]struct{}) []map[string]any { |
| 31 | if sources == nil { |
| 32 | sources = SkillTransientSources |
| 33 | } |
| 34 | var kept []map[string]any |
| 35 | for _, message := range messages { |
| 36 | metadata, _ := message["metadata"].(map[string]any) |
| 37 | source, _ := metadata["source"].(string) |
| 38 | if _, drop := sources[source]; !drop { |
| 39 | kept = append(kept, message) |
| 40 | } |
| 41 | } |
| 42 | return kept |
| 43 | } |
| 44 | |
| 45 | func ResolveSkillContextCWD(defaultCWD string, context map[string]any) string { |
| 46 | if context != nil { |
no outgoing calls