ropilot 0.1.28 → 0.1.29

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.
Files changed (2) hide show
  1. package/lib/setup.js +49 -0
  2. package/package.json +1 -1
package/lib/setup.js CHANGED
@@ -245,6 +245,34 @@ function getDefaultPrompts() {
245
245
  };
246
246
  }
247
247
 
248
+ /**
249
+ * Generate platform-specific .mcp.json
250
+ * Windows needs cmd /c wrapper for npx to work properly
251
+ */
252
+ function generateMcpJson() {
253
+ const isWindows = platform() === 'win32' || (platform() === 'linux' && isWSL());
254
+
255
+ if (isWindows) {
256
+ return JSON.stringify({
257
+ mcpServers: {
258
+ ropilot: {
259
+ command: "cmd",
260
+ args: ["/c", "npx", "ropilot", "serve"]
261
+ }
262
+ }
263
+ }, null, 2);
264
+ } else {
265
+ return JSON.stringify({
266
+ mcpServers: {
267
+ ropilot: {
268
+ command: "npx",
269
+ args: ["ropilot", "serve"]
270
+ }
271
+ }
272
+ }, null, 2);
273
+ }
274
+ }
275
+
248
276
  /**
249
277
  * Set up agent files in current project
250
278
  */
@@ -255,6 +283,11 @@ function setupProjectPrompts(pkg) {
255
283
  let created = 0, updated = 0, skipped = 0;
256
284
 
257
285
  for (const [filePath, content] of Object.entries(files)) {
286
+ // Skip .mcp.json from server - we generate it locally with platform detection
287
+ if (filePath === '.mcp.json') {
288
+ continue;
289
+ }
290
+
258
291
  const fullPath = filePath;
259
292
  const dir = dirname(fullPath);
260
293
 
@@ -283,6 +316,22 @@ function setupProjectPrompts(pkg) {
283
316
  }
284
317
  }
285
318
 
319
+ // Generate .mcp.json with platform-specific command
320
+ const mcpJson = generateMcpJson();
321
+ const mcpPath = '.mcp.json';
322
+ if (existsSync(mcpPath)) {
323
+ const existing = readFileSync(mcpPath, 'utf-8');
324
+ if (existing !== mcpJson) {
325
+ writeFileSync(mcpPath, mcpJson);
326
+ updated++;
327
+ } else {
328
+ skipped++;
329
+ }
330
+ } else {
331
+ writeFileSync(mcpPath, mcpJson);
332
+ created++;
333
+ }
334
+
286
335
  console.log(`Project files: ${created} created, ${updated} updated, ${skipped} unchanged`);
287
336
  }
288
337
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ropilot",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "description": "AI-powered Roblox development assistant - MCP CLI",
5
5
  "author": "whut",
6
6
  "license": "MIT",