ropilot 0.1.36 → 0.1.37
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/lib/setup.js +28 -22
- package/package.json +1 -1
package/lib/setup.js
CHANGED
|
@@ -245,20 +245,6 @@ function getDefaultPrompts() {
|
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
/**
|
|
249
|
-
* Generate .mcp.json for Claude Code MCP server configuration
|
|
250
|
-
*/
|
|
251
|
-
function generateMcpJson() {
|
|
252
|
-
return JSON.stringify({
|
|
253
|
-
mcpServers: {
|
|
254
|
-
ropilot: {
|
|
255
|
-
command: "npx",
|
|
256
|
-
args: ["ropilot", "serve"]
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}, null, 2);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
248
|
/**
|
|
263
249
|
* Set up agent files in current project
|
|
264
250
|
*/
|
|
@@ -302,20 +288,40 @@ function setupProjectPrompts(pkg) {
|
|
|
302
288
|
}
|
|
303
289
|
}
|
|
304
290
|
|
|
305
|
-
//
|
|
306
|
-
const mcpJson = generateMcpJson();
|
|
291
|
+
// Update .mcp.json - preserve existing servers, only add/update ropilot
|
|
307
292
|
const mcpPath = '.mcp.json';
|
|
293
|
+
const ropilotServer = {
|
|
294
|
+
command: "npx",
|
|
295
|
+
args: ["ropilot", "serve"]
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
let mcpConfig = { mcpServers: {} };
|
|
308
299
|
if (existsSync(mcpPath)) {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
300
|
+
try {
|
|
301
|
+
const existing = readFileSync(mcpPath, 'utf-8');
|
|
302
|
+
mcpConfig = JSON.parse(existing);
|
|
303
|
+
if (!mcpConfig.mcpServers) {
|
|
304
|
+
mcpConfig.mcpServers = {};
|
|
305
|
+
}
|
|
306
|
+
} catch {
|
|
307
|
+
// Invalid JSON, start fresh but warn user
|
|
308
|
+
console.log('Warning: .mcp.json was invalid, recreating it');
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const existingRopilot = mcpConfig.mcpServers.ropilot;
|
|
313
|
+
const ropilotChanged = JSON.stringify(existingRopilot) !== JSON.stringify(ropilotServer);
|
|
314
|
+
|
|
315
|
+
if (ropilotChanged) {
|
|
316
|
+
mcpConfig.mcpServers.ropilot = ropilotServer;
|
|
317
|
+
writeFileSync(mcpPath, JSON.stringify(mcpConfig, null, 2));
|
|
318
|
+
if (existingRopilot) {
|
|
312
319
|
updated++;
|
|
313
320
|
} else {
|
|
314
|
-
|
|
321
|
+
created++;
|
|
315
322
|
}
|
|
316
323
|
} else {
|
|
317
|
-
|
|
318
|
-
created++;
|
|
324
|
+
skipped++;
|
|
319
325
|
}
|
|
320
326
|
|
|
321
327
|
console.log(`Project files: ${created} created, ${updated} updated, ${skipped} unchanged`);
|