Part of #430. ## Task Implement config read/write module for agent configuration files. ## Supported Formats 1. **JSON** — `serde_json` with preserve-order + comments support 2. **JSONC** (JSON with comments) — strip `//` and `/* */` before parse 3. **YAML** — `serde_yaml` ## API ```rust mod agent_config { fn read_config(path: &Path, format: Format) -> Result<AgentConfig>; fn write_config(path: &Path, format: Format, config: &AgentConfig) -> Result<()>; fn has_cora_entry(config: &AgentConfig) -> bool; fn add_cora_entry(config: &mut AgentConfig, binary_path: &str) -> Result<()>; fn remove_cora_entry(config: &mut AgentConfig) -> Result<()>; } ``` ## Edge Cases - File has BOM → strip before parse - File has trailing comma in JSON → tolerant parse - File permissions → return clear error - File does not exist → create with just Cora entry - Existing `mcpServers` key → merge into it - No `mcpServers` key → create it ## Acceptance - Round-trip: read → add entry → write → read → verify entry present - No data loss: existing MCP servers preserved - JSONC comments preserved (if using serde_json with preserve) ## Est: 2-3 days
Activity