| 1 | package skill |
| 2 | |
| 3 | import ( |
| 4 | "strings" |
| 5 | |
| 6 | "reasonix/internal/tool" |
| 7 | ) |
| 8 | |
| 9 | // ToolBindingsForSkill applies the same ownership boundary to invocation and |
| 10 | // diagnostics. Portable aliases are bound only for plugin-owned skills. |
| 11 | func ToolBindingsForSkill(sk Skill, bindings []tool.MCPBinding) []tool.MCPBinding { |
| 12 | if strings.TrimSpace(sk.Plugin) == "" { |
| 13 | return nil |
| 14 | } |
| 15 | var out []tool.MCPBinding |
| 16 | for _, binding := range bindings { |
| 17 | if binding.Package == sk.Plugin { |
| 18 | out = append(out, binding) |
| 19 | } |
| 20 | } |
| 21 | return out |
| 22 | } |
| 23 |