Map<String, dynamic> toJson() => { 'path': path, if (meshagent != null) 'meshagent': meshagent!.toJson(), if (mcp != null) 'mcp': mcp!.toJson(), };