@intellectronica/ruler 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib.js +14 -5
- package/dist/paths/mcp.js +3 -0
- package/package.json +1 -1
package/dist/lib.js
CHANGED
|
@@ -199,6 +199,9 @@ async function applyAllAgentConfigs(projectRoot, includedAgents, configPath, cli
|
|
|
199
199
|
const outputPaths = getAgentOutputPaths(agent, projectRoot, agentConfig);
|
|
200
200
|
(0, constants_1.logVerbose)(`Agent ${agent.getName()} output paths: ${outputPaths.join(', ')}`, verbose);
|
|
201
201
|
generatedPaths.push(...outputPaths);
|
|
202
|
+
// Also add the backup file paths to the gitignore list
|
|
203
|
+
const backupPaths = outputPaths.map((p) => `${p}.bak`);
|
|
204
|
+
generatedPaths.push(...backupPaths);
|
|
202
205
|
if (dryRun) {
|
|
203
206
|
(0, constants_1.logVerbose)(`DRY RUN: Would write rules to: ${outputPaths.join(', ')}`, verbose);
|
|
204
207
|
}
|
|
@@ -217,6 +220,13 @@ async function applyAllAgentConfigs(projectRoot, includedAgents, configPath, cli
|
|
|
217
220
|
(agentConfig?.mcp?.enabled ?? config.mcp?.enabled ?? true);
|
|
218
221
|
const rulerMcpFile = path.join(rulerDir, 'mcp.json');
|
|
219
222
|
if (dest && mcpEnabledForAgent) {
|
|
223
|
+
// Include MCP config file in .gitignore only if it's within the project directory
|
|
224
|
+
if (dest.startsWith(projectRoot)) {
|
|
225
|
+
const relativeDest = path.relative(projectRoot, dest);
|
|
226
|
+
generatedPaths.push(relativeDest);
|
|
227
|
+
// Also add the backup for the MCP file
|
|
228
|
+
generatedPaths.push(`${relativeDest}.bak`);
|
|
229
|
+
}
|
|
220
230
|
if (agent.getIdentifier() === 'openhands') {
|
|
221
231
|
// *** Special handling for Open Hands ***
|
|
222
232
|
if (dryRun) {
|
|
@@ -225,8 +235,7 @@ async function applyAllAgentConfigs(projectRoot, includedAgents, configPath, cli
|
|
|
225
235
|
else {
|
|
226
236
|
await (0, propagateOpenHandsMcp_1.propagateMcpToOpenHands)(rulerMcpFile, dest);
|
|
227
237
|
}
|
|
228
|
-
//
|
|
229
|
-
generatedPaths.push(dest);
|
|
238
|
+
// Open Hands config file is already included above
|
|
230
239
|
}
|
|
231
240
|
else {
|
|
232
241
|
if (rulerMcpJson) {
|
|
@@ -262,9 +271,9 @@ async function applyAllAgentConfigs(projectRoot, includedAgents, configPath, cli
|
|
|
262
271
|
gitignoreEnabled = true; // Default enabled
|
|
263
272
|
}
|
|
264
273
|
if (gitignoreEnabled && generatedPaths.length > 0) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
274
|
+
const uniquePaths = [...new Set(generatedPaths)];
|
|
275
|
+
// Add wildcard pattern for backup files
|
|
276
|
+
uniquePaths.push('*.bak');
|
|
268
277
|
if (uniquePaths.length > 0) {
|
|
269
278
|
const actionPrefix = dryRun ? '[ruler:dry-run]' : '[ruler]';
|
|
270
279
|
if (dryRun) {
|
package/dist/paths/mcp.js
CHANGED
|
@@ -71,6 +71,9 @@ async function getNativeMcpPath(adapterName, projectRoot) {
|
|
|
71
71
|
// For Open Hands, we target the main config file, not a separate mcp.json
|
|
72
72
|
candidates.push(path.join(projectRoot, '.openhands', 'config.toml'));
|
|
73
73
|
break;
|
|
74
|
+
case 'Gemini CLI':
|
|
75
|
+
candidates.push(path.join(projectRoot, '.gemini', 'settings.json'));
|
|
76
|
+
break;
|
|
74
77
|
default:
|
|
75
78
|
return null;
|
|
76
79
|
}
|