Check opencode.json has tracedecay registered.
(dc: &mut DoctorCounters, home: &Path)
| 292 | |
| 293 | /// Check opencode.json has tracedecay registered. |
| 294 | fn doctor_check_config(dc: &mut DoctorCounters, home: &Path) { |
| 295 | let config_path = opencode_config_path(home); |
| 296 | if !config_path.exists() { |
| 297 | dc.warn(&format!( |
| 298 | "{} not found — run `tracedecay install --agent opencode` if you use OpenCode", |
| 299 | config_path.display() |
| 300 | )); |
| 301 | return; |
| 302 | } |
| 303 | |
| 304 | let config = load_json_file(&config_path); |
| 305 | let mcp_entry = &config["mcp"]["tracedecay"]; |
| 306 | if !mcp_entry.is_object() { |
| 307 | dc.fail(&format!( |
| 308 | "MCP server NOT registered in {} — run `tracedecay install --agent opencode`", |
| 309 | config_path.display() |
| 310 | )); |
| 311 | return; |
| 312 | } |
| 313 | dc.pass(&format!( |
| 314 | "MCP server registered in {}", |
| 315 | config_path.display() |
| 316 | )); |
| 317 | |
| 318 | let command = mcp_entry["command"].as_array(); |
| 319 | let has_serve = command.is_some_and(|arr| arr.iter().any(|v| v.as_str() == Some("serve"))); |
| 320 | if has_serve { |
| 321 | dc.pass("MCP server args include \"serve\""); |
| 322 | } else { |
| 323 | dc.fail("MCP server args missing \"serve\" — run `tracedecay install --agent opencode`"); |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | /// Check AGENTS.md contains tracedecay rules. |
| 328 | fn doctor_check_prompt(dc: &mut DoctorCounters, home: &Path) { |
no test coverage detected