| 1 | package capdiag |
| 2 | |
| 3 | import ( |
| 4 | "reasonix/internal/config" |
| 5 | "reasonix/internal/skill" |
| 6 | "reasonix/internal/tool" |
| 7 | _ "reasonix/internal/tool/builtin" // Initialize compile-time tool identities. |
| 8 | ) |
| 9 | |
| 10 | func skillToolIssues(store *skill.Store, cfg *config.Config, mcp MCPReport, sanitize func(string) string) []Issue { |
| 11 | var issues []Issue |
| 12 | opts := skill.ToolReferenceOptions{Known: tool.KnownToolNames(), Bindings: mcp.bindings} |
| 13 | failed := map[string]string{} |
| 14 | for _, server := range mcp.Servers { |
| 15 | if server.RuntimeStatus == "failed" { |
| 16 | failed[server.Name] = server.Error |
| 17 | } |
| 18 | } |
| 19 | diagnostics := skill.CheckToolReferences(store.List(), opts) |
| 20 | diagnostics = append(diagnostics, skill.CheckMCPRequirements(store.List(), cfg.Plugins, failed)...) |
| 21 | for _, d := range diagnostics { |
| 22 | issues = append(issues, Issue{ |
| 23 | Severity: d.Severity, Code: d.Code, Subsystem: "skills", Name: d.Skill, |
| 24 | Message: sanitize(d.Message), SettingsTab: "skills", |
| 25 | Remediation: "Check the reference against the target session's tool inventory; offline recognition does not establish runtime availability", |
| 26 | }) |
| 27 | } |
| 28 | return issues |
| 29 | } |
| 30 |