@intellectronica/ruler
Version:
Ruler — apply the same rules to all coding agents
18 lines (17 loc) • 634 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateMcp = validateMcp;
/**
* Validate the structure of the Ruler MCP JSON config.
* Minimal validation: ensure 'mcpServers' property exists and is an object.
* @param data Parsed JSON object from .ruler/mcp.json.
* @throws Error if validation fails.
*/
function validateMcp(data) {
if (!data ||
typeof data !== 'object' ||
!('mcpServers' in data) ||
typeof data.mcpServers !== 'object') {
throw new Error('[ruler] Invalid MCP config: must contain an object property "mcpServers" (Ruler style)');
}
}