UNPKG

@intellectronica/ruler

Version:

Ruler — apply the same rules to all coding agents

47 lines (46 loc) 1.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CopilotAgent = void 0; const AgentsMdAgent_1 = require("./AgentsMdAgent"); /** * GitHub Copilot agent adapter. * Writes to AGENTS.md for both web-based GitHub Copilot and VS Code extension. */ class CopilotAgent { constructor() { this.agentsMdAgent = new AgentsMdAgent_1.AgentsMdAgent(); } getIdentifier() { return 'copilot'; } getName() { return 'GitHub Copilot'; } /** * Returns the default output path for AGENTS.md. */ getDefaultOutputPath(projectRoot) { return this.agentsMdAgent.getDefaultOutputPath(projectRoot); } async applyRulerConfig(concatenatedRules, projectRoot, rulerMcpJson, agentConfig, backup = true) { // Write to AGENTS.md using the existing AgentsMdAgent infrastructure await this.agentsMdAgent.applyRulerConfig(concatenatedRules, projectRoot, null, // No MCP config needed for the instructions file { // Preserve explicit outputPath precedence semantics if provided outputPath: agentConfig?.outputPath || agentConfig?.outputPathInstructions, }, backup); } getMcpServerKey() { return 'servers'; } supportsMcpStdio() { return true; } supportsMcpRemote() { return true; } supportsNativeSkills() { return true; } } exports.CopilotAgent = CopilotAgent;