ropilot 0.1.36 → 0.1.38
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/proxy.js +27 -0
- package/lib/setup.js +28 -22
- package/package.json +1 -1
package/lib/proxy.js
CHANGED
|
@@ -231,6 +231,30 @@ async function checkPluginUpdate() {
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
/**
|
|
235
|
+
* Try to start rojo serve in background (non-blocking, silent on failure)
|
|
236
|
+
*/
|
|
237
|
+
function tryStartRojoServe() {
|
|
238
|
+
try {
|
|
239
|
+
// Check if default.project.json exists (indicates a Rojo project)
|
|
240
|
+
if (!existsSync(join(process.cwd(), 'default.project.json'))) {
|
|
241
|
+
return; // Not a Rojo project
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Start rojo serve in background, detached from this process
|
|
245
|
+
const child = spawn('rojo', ['serve'], {
|
|
246
|
+
cwd: process.cwd(),
|
|
247
|
+
detached: true,
|
|
248
|
+
stdio: 'ignore'
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
// Unref so parent can exit independently
|
|
252
|
+
child.unref();
|
|
253
|
+
} catch {
|
|
254
|
+
// Silently ignore - rojo not installed or failed to start
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
234
258
|
/**
|
|
235
259
|
* Run the stdio MCP server
|
|
236
260
|
*/
|
|
@@ -249,6 +273,9 @@ export async function serve() {
|
|
|
249
273
|
// Check for plugin updates in background (non-blocking)
|
|
250
274
|
checkPluginUpdate();
|
|
251
275
|
|
|
276
|
+
// Start rojo serve in background if available (non-blocking, silent on failure)
|
|
277
|
+
tryStartRojoServe();
|
|
278
|
+
|
|
252
279
|
// Read JSON-RPC messages from stdin
|
|
253
280
|
// Supports both Content-Length framing (LSP-style) and newline-delimited JSON
|
|
254
281
|
let buffer = '';
|
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`);
|