dev3000 0.0.73 → 0.0.75

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 (46) hide show
  1. package/dist/dev-environment.d.ts +1 -0
  2. package/dist/dev-environment.d.ts.map +1 -1
  3. package/dist/dev-environment.js +131 -50
  4. package/dist/dev-environment.js.map +1 -1
  5. package/dist/src/tui-interface-impl.tsx +3 -24
  6. package/dist/tui-interface-impl.d.ts.map +1 -1
  7. package/dist/tui-interface-impl.js +3 -24
  8. package/dist/tui-interface-impl.js.map +1 -1
  9. package/mcp-server/.next/BUILD_ID +1 -1
  10. package/mcp-server/.next/build-manifest.json +2 -2
  11. package/mcp-server/.next/fallback-build-manifest.json +2 -2
  12. package/mcp-server/.next/next-minimal-server.js.nft.json +1 -1
  13. package/mcp-server/.next/next-server.js.nft.json +1 -1
  14. package/mcp-server/.next/prerender-manifest.json +3 -3
  15. package/mcp-server/.next/required-server-files.json +2 -2
  16. package/mcp-server/.next/server/app/_global-error/page.js.nft.json +1 -1
  17. package/mcp-server/.next/server/app/_global-error.html +2 -2
  18. package/mcp-server/.next/server/app/_global-error.rsc +1 -1
  19. package/mcp-server/.next/server/app/_not-found/page.js.nft.json +1 -1
  20. package/mcp-server/.next/server/app/_not-found.html +1 -1
  21. package/mcp-server/.next/server/app/_not-found.rsc +1 -1
  22. package/mcp-server/.next/server/app/api/logs/append/route.js.nft.json +1 -1
  23. package/mcp-server/.next/server/app/api/logs/head/route.js.nft.json +1 -1
  24. package/mcp-server/.next/server/app/api/logs/list/route.js.nft.json +1 -1
  25. package/mcp-server/.next/server/app/api/logs/rotate/route.js.nft.json +1 -1
  26. package/mcp-server/.next/server/app/api/logs/stream/route.js.nft.json +1 -1
  27. package/mcp-server/.next/server/app/api/logs/tail/route.js.nft.json +1 -1
  28. package/mcp-server/.next/server/app/api/screenshots/[filename]/route.js.nft.json +1 -1
  29. package/mcp-server/.next/server/app/api/tools/route.js.nft.json +1 -1
  30. package/mcp-server/.next/server/app/index.html +1 -1
  31. package/mcp-server/.next/server/app/index.rsc +1 -1
  32. package/mcp-server/.next/server/app/logs/page.js.nft.json +1 -1
  33. package/mcp-server/.next/server/app/mcp/route.js.nft.json +1 -1
  34. package/mcp-server/.next/server/app/page.js.nft.json +1 -1
  35. package/mcp-server/.next/server/chunks/[root-of-the-server]__270b33b7._.js +4 -18
  36. package/mcp-server/.next/server/chunks/[root-of-the-server]__270b33b7._.js.map +1 -1
  37. package/mcp-server/.next/server/server-reference-manifest.js +1 -1
  38. package/mcp-server/.next/server/server-reference-manifest.json +1 -1
  39. package/mcp-server/app/mcp/tools.ts +92 -23
  40. package/mcp-server/{next.config.ts → next.config.mjs} +4 -2
  41. package/mcp-server/{start-production.js → start-production.mjs} +6 -3
  42. package/package.json +3 -3
  43. package/src/tui-interface-impl.tsx +3 -24
  44. /package/mcp-server/.next/static/{mgu8K8xaf4jXbhRidu310 → Uhi1zQoeqTo0Q0A7NvQ69}/_buildManifest.js +0 -0
  45. /package/mcp-server/.next/static/{mgu8K8xaf4jXbhRidu310 → Uhi1zQoeqTo0Q0A7NvQ69}/_clientMiddlewareManifest.json +0 -0
  46. /package/mcp-server/.next/static/{mgu8K8xaf4jXbhRidu310 → Uhi1zQoeqTo0Q0A7NvQ69}/_ssgManifest.js +0 -0
@@ -38,6 +38,7 @@ export declare class DevEnvironment {
38
38
  private portChangeMessage;
39
39
  private firstSigintTime;
40
40
  private configuredAiCliTools;
41
+ private enableNextjsMcp;
41
42
  constructor(options: DevEnvironmentOptions);
42
43
  private checkPortsAvailable;
43
44
  private killMcpServer;
@@ -1 +1 @@
1
- {"version":3,"file":"dev-environment.d.ts","sourceRoot":"","sources":["../src/dev-environment.ts"],"names":[],"mappings":"AA0BA,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM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AAc;CA2J7B;AAED,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,iBAGvE"}
@@ -10,6 +10,12 @@ import { NextJsErrorDetector, OutputProcessor, StandardLogParser } from "./servi
10
10
  import { DevTUI } from "./tui-interface.js";
11
11
  import { getProjectDisplayName, getProjectName } from "./utils/project-name.js";
12
12
  import { formatTimestamp } from "./utils/timestamp.js";
13
+ // MCP names
14
+ const MCP_NAMES = {
15
+ DEV3000: "dev3000",
16
+ CHROME_DEVTOOLS: "dev3000-chrome-devtools",
17
+ NEXTJS_DEV: "dev3000-nextjs-dev"
18
+ };
13
19
  class Logger {
14
20
  logFile;
15
21
  tail;
@@ -75,33 +81,62 @@ const AI_CLI_TOOLS = [
75
81
  {
76
82
  binary: "claude",
77
83
  name: "Claude Code",
78
- addMcpCommand: (name, config) => ["claude", "mcp", "add-json", name, JSON.stringify(config)],
84
+ addMcpCommand: (name, command, ...args) => ["claude", "mcp", "add", name, command, ...args],
79
85
  addHttpMcpCommand: (name, url) => ["claude", "mcp", "add", "-t", "http", name, url],
80
86
  removeMcpCommand: (name) => ["claude", "mcp", "remove", name]
87
+ },
88
+ {
89
+ binary: "gemini",
90
+ name: "Gemini CLI",
91
+ addMcpCommand: (name, command, ...args) => ["gemini", "mcp", "add", name, command, ...args],
92
+ addHttpMcpCommand: (name, url) => ["gemini", "mcp", "add", "-t", "http", name, url],
93
+ removeMcpCommand: (name) => ["gemini", "mcp", "remove", name]
81
94
  }
82
95
  // TODO: Research and add other AI CLI tools once we verify their MCP capabilities
83
96
  // {
84
97
  // binary: "cursor-agent",
85
98
  // name: "Cursor Agent",
86
- // addMcpCommand: (name, config) => ["cursor-agent", "mcp", "add-json", name, JSON.stringify(config)],
99
+ // addMcpCommand: (name, command, ...args) => ["cursor-agent", "mcp", "add", name, command, ...args],
87
100
  // addHttpMcpCommand: (name, url) => ["cursor-agent", "mcp", "add", "-t", "http", name, url],
88
101
  // removeMcpCommand: (name) => ["cursor-agent", "mcp", "remove", name]
89
102
  // },
90
103
  // {
91
104
  // binary: "codex",
92
105
  // name: "Codex CLI",
93
- // addMcpCommand: (name, config) => ["codex", "mcp", "add-json", name, JSON.stringify(config)],
106
+ // addMcpCommand: (name, command, ...args) => ["codex", "mcp", "add", name, command, ...args],
94
107
  // addHttpMcpCommand: (name, url) => ["codex", "mcp", "add", "-t", "http", name, url],
95
108
  // removeMcpCommand: (name) => ["codex", "mcp", "remove", name]
96
- // },
97
- // {
98
- // binary: "gemini",
99
- // name: "Gemini CLI",
100
- // addMcpCommand: (name, config) => ["gemini", "mcp", "add-json", name, JSON.stringify(config)],
101
- // addHttpMcpCommand: (name, url) => ["gemini", "mcp", "add", "-t", "http", name, url],
102
- // removeMcpCommand: (name) => ["gemini", "mcp", "remove", name]
103
109
  // }
104
110
  ];
111
+ /**
112
+ * Check if Next.js MCP server is enabled in the project configuration
113
+ */
114
+ async function isNextjsMcpEnabled() {
115
+ try {
116
+ const configFiles = ["next.config.js", "next.config.ts", "next.config.mjs", "next.config.cjs"];
117
+ for (const configFile of configFiles) {
118
+ if (existsSync(configFile)) {
119
+ try {
120
+ // Read the config file content
121
+ const configContent = readFileSync(configFile, "utf8");
122
+ // Look for experimental.mcpServer: true or experimental.mcpServer = true
123
+ // This is a simple string-based check that should work for most cases
124
+ const hasMcpServerConfig = /experimental\s*:\s*{[^}]*mcpServer\s*:\s*true|experimental\.mcpServer\s*[=:]\s*true/s.test(configContent);
125
+ if (hasMcpServerConfig) {
126
+ return true;
127
+ }
128
+ }
129
+ catch {
130
+ // If we can't read the file, continue checking other config files
131
+ }
132
+ }
133
+ }
134
+ return false;
135
+ }
136
+ catch {
137
+ return false;
138
+ }
139
+ }
105
140
  /**
106
141
  * Check if Chrome version supports chrome-devtools MCP (>= 140.0.7339.214)
107
142
  */
@@ -205,14 +240,15 @@ async function detectAvailableAiCliTools() {
205
240
  /**
206
241
  * Configure MCPs for a specific AI CLI tool
207
242
  */
208
- async function configureMcpsForCliTool(tool, mcpPort, enableChromeDevtools, chromeDevtoolsSupported) {
243
+ async function configureMcpsForCliTool(tool, mcpPort, appPort, enableChromeDevtools, chromeDevtoolsSupported, enableNextjsMcp) {
209
244
  const results = {
210
245
  dev3000: false,
211
- chromeDevtools: false
246
+ chromeDevtools: false,
247
+ nextjsDev: false
212
248
  };
213
249
  // Configure main dev3000 MCP
214
250
  try {
215
- const dev3000Command = tool.addHttpMcpCommand("dev3000", `http://localhost:${mcpPort}/mcp`);
251
+ const dev3000Command = tool.addHttpMcpCommand(MCP_NAMES.DEV3000, `http://localhost:${mcpPort}/mcp`);
216
252
  await new Promise((resolve, reject) => {
217
253
  const configProcess = spawn(dev3000Command[0], dev3000Command.slice(1), {
218
254
  stdio: ["inherit", "pipe", "pipe"]
@@ -239,10 +275,7 @@ async function configureMcpsForCliTool(tool, mcpPort, enableChromeDevtools, chro
239
275
  // Configure chrome-devtools MCP if enabled and Chrome version is supported
240
276
  if (enableChromeDevtools && chromeDevtoolsSupported) {
241
277
  try {
242
- const chromeDevtoolsCommand = tool.addMcpCommand("dev3000-chrome-devtools", {
243
- command: "npx",
244
- args: ["chrome-devtools-mcp@latest", "--browserUrl", "http://127.0.0.1:9222"]
245
- });
278
+ const chromeDevtoolsCommand = tool.addMcpCommand(MCP_NAMES.CHROME_DEVTOOLS, "npx", "chrome-devtools-mcp@latest", "--", "--browserUrl", "http://127.0.0.1:9222");
246
279
  await new Promise((resolve, reject) => {
247
280
  const configProcess = spawn(chromeDevtoolsCommand[0], chromeDevtoolsCommand.slice(1), {
248
281
  stdio: ["inherit", "pipe", "pipe"]
@@ -271,37 +304,72 @@ async function configureMcpsForCliTool(tool, mcpPort, enableChromeDevtools, chro
271
304
  // Chrome version doesn't support chrome-devtools MCP
272
305
  results.chromeSkipped = "Chrome < 140.0.7339.214";
273
306
  }
307
+ // Configure nextjs-dev MCP if enabled
308
+ if (enableNextjsMcp) {
309
+ try {
310
+ const nextjsDevCommand = tool.addHttpMcpCommand(MCP_NAMES.NEXTJS_DEV, `http://localhost:${appPort}/_next/mcp`);
311
+ await new Promise((resolve, reject) => {
312
+ const configProcess = spawn(nextjsDevCommand[0], nextjsDevCommand.slice(1), {
313
+ stdio: ["inherit", "pipe", "pipe"]
314
+ });
315
+ let errorOutput = "";
316
+ configProcess.stderr?.on("data", (data) => {
317
+ errorOutput += data.toString();
318
+ });
319
+ configProcess.on("close", (code) => {
320
+ if (code === 0 || errorOutput.includes("already exists")) {
321
+ results.nextjsDev = true;
322
+ resolve();
323
+ }
324
+ else {
325
+ reject(new Error(`Failed to configure nextjs-dev MCP: ${errorOutput}`));
326
+ }
327
+ });
328
+ configProcess.on("error", reject);
329
+ });
330
+ }
331
+ catch (error) {
332
+ console.log(`⚠️ Failed to configure nextjs-dev MCP for ${tool.name}:`, error);
333
+ }
334
+ }
274
335
  return results;
275
336
  }
276
337
  /**
277
338
  * Clean up MCP configurations for a specific AI CLI tool
278
339
  */
279
- async function cleanupMcpsForCliTool(tool, enableChromeDevtools) {
280
- // Clean up dev3000 MCP
340
+ async function cleanupMcpsForCliTool(tool, enableChromeDevtools, enableNextjsMcp) {
341
+ // Clean up dev3000 MCP (fire and forget)
281
342
  try {
282
- const dev3000Command = tool.removeMcpCommand("dev3000");
283
- await new Promise((resolve) => {
284
- const cleanupProcess = spawn(dev3000Command[0], dev3000Command.slice(1), {
285
- stdio: ["inherit", "pipe", "pipe"]
286
- });
287
- cleanupProcess.on("close", () => resolve());
288
- cleanupProcess.on("error", () => resolve()); // Don't fail on cleanup errors
289
- });
343
+ const dev3000Command = tool.removeMcpCommand(MCP_NAMES.DEV3000);
344
+ spawn(dev3000Command[0], dev3000Command.slice(1), {
345
+ stdio: "ignore",
346
+ detached: true
347
+ }).unref();
290
348
  }
291
349
  catch {
292
350
  // Ignore cleanup errors
293
351
  }
294
- // Clean up chrome-devtools MCP if it was enabled
352
+ // Clean up chrome-devtools MCP if it was enabled (fire and forget)
295
353
  if (enableChromeDevtools) {
296
354
  try {
297
- const chromeDevtoolsCommand = tool.removeMcpCommand("dev3000-chrome-devtools");
298
- await new Promise((resolve) => {
299
- const cleanupProcess = spawn(chromeDevtoolsCommand[0], chromeDevtoolsCommand.slice(1), {
300
- stdio: ["inherit", "pipe", "pipe"]
301
- });
302
- cleanupProcess.on("close", () => resolve());
303
- cleanupProcess.on("error", () => resolve()); // Don't fail on cleanup errors
304
- });
355
+ const chromeDevtoolsCommand = tool.removeMcpCommand(MCP_NAMES.CHROME_DEVTOOLS);
356
+ spawn(chromeDevtoolsCommand[0], chromeDevtoolsCommand.slice(1), {
357
+ stdio: "ignore",
358
+ detached: true
359
+ }).unref();
360
+ }
361
+ catch {
362
+ // Ignore cleanup errors
363
+ }
364
+ }
365
+ // Clean up nextjs-dev MCP if it was enabled (fire and forget)
366
+ if (enableNextjsMcp) {
367
+ try {
368
+ const nextjsDevCommand = tool.removeMcpCommand(MCP_NAMES.NEXTJS_DEV);
369
+ spawn(nextjsDevCommand[0], nextjsDevCommand.slice(1), {
370
+ stdio: "ignore",
371
+ detached: true
372
+ }).unref();
305
373
  }
306
374
  catch {
307
375
  // Ignore cleanup errors
@@ -311,7 +379,7 @@ async function cleanupMcpsForCliTool(tool, enableChromeDevtools) {
311
379
  /**
312
380
  * Configure MCPs for all detected AI CLI tools
313
381
  */
314
- async function configureAiCliIntegrations(mcpPort, enableChromeDevtools, silent = false) {
382
+ async function configureAiCliIntegrations(mcpPort, appPort, enableChromeDevtools, silent = false) {
315
383
  if (!silent)
316
384
  console.log("🔍 Detecting available AI CLI tools...");
317
385
  const availableTools = await detectAvailableAiCliTools();
@@ -330,22 +398,30 @@ async function configureAiCliIntegrations(mcpPort, enableChromeDevtools, silent
330
398
  console.log("⚠️ Chrome version < 140.0.7339.214 detected - chrome-devtools MCP will be skipped");
331
399
  }
332
400
  }
401
+ // Check if NextJS MCP is enabled in project configuration
402
+ const enableNextjsMcp = await isNextjsMcpEnabled();
403
+ if (enableNextjsMcp && !silent) {
404
+ console.log("🔍 Next.js MCP server detected in project configuration");
405
+ }
333
406
  if (!silent)
334
407
  console.log(`🔧 Configuring MCPs for ${availableTools.length} detected AI CLI tools...`);
335
408
  for (const tool of availableTools) {
336
409
  if (!silent)
337
410
  console.log(` Configuring ${tool.name}...`);
338
- const results = await configureMcpsForCliTool(tool, mcpPort, enableChromeDevtools, chromeDevtoolsSupported);
411
+ const results = await configureMcpsForCliTool(tool, mcpPort, appPort, enableChromeDevtools, chromeDevtoolsSupported, enableNextjsMcp);
339
412
  let status = "";
340
413
  if (results.dev3000)
341
414
  status += "✅ dev3000";
342
415
  if (results.chromeDevtools)
343
416
  status += results.dev3000 ? " + chrome-devtools" : "✅ chrome-devtools";
417
+ if (results.nextjsDev)
418
+ status += results.dev3000 || results.chromeDevtools ? " + nextjs-dev" : "✅ nextjs-dev";
344
419
  if (results.chromeSkipped)
345
- status += results.dev3000
346
- ? ` (chrome-devtools skipped: ${results.chromeSkipped})`
347
- : `⚠️ chrome-devtools skipped: ${results.chromeSkipped}`;
348
- if (!results.dev3000 && !results.chromeDevtools && !results.chromeSkipped)
420
+ status +=
421
+ results.dev3000 || results.nextjsDev
422
+ ? ` (chrome-devtools skipped: ${results.chromeSkipped})`
423
+ : `⚠️ chrome-devtools skipped: ${results.chromeSkipped}`;
424
+ if (!results.dev3000 && !results.chromeDevtools && !results.nextjsDev && !results.chromeSkipped)
349
425
  status = "❌ failed";
350
426
  if (!silent)
351
427
  console.log(` ${tool.name}: ${status}`);
@@ -355,13 +431,13 @@ async function configureAiCliIntegrations(mcpPort, enableChromeDevtools, silent
355
431
  /**
356
432
  * Clean up MCP configurations for all detected AI CLI tools
357
433
  */
358
- async function cleanupAiCliIntegrations(availableTools, enableChromeDevtools, silent = false) {
434
+ async function cleanupAiCliIntegrations(availableTools, enableChromeDevtools, enableNextjsMcp, silent = false) {
359
435
  if (availableTools.length === 0)
360
436
  return;
361
437
  if (!silent)
362
438
  console.log("🧹 Cleaning up AI CLI MCP configurations...");
363
439
  for (const tool of availableTools) {
364
- await cleanupMcpsForCliTool(tool, enableChromeDevtools);
440
+ cleanupMcpsForCliTool(tool, enableChromeDevtools, enableNextjsMcp); // Fire and forget
365
441
  }
366
442
  }
367
443
  export function createPersistentLogFile() {
@@ -487,6 +563,7 @@ export class DevEnvironment {
487
563
  portChangeMessage = null;
488
564
  firstSigintTime = null;
489
565
  configuredAiCliTools = [];
566
+ enableNextjsMcp = false;
490
567
  constructor(options) {
491
568
  // Handle portMcp vs mcpPort naming
492
569
  this.options = {
@@ -739,7 +816,9 @@ export class DevEnvironment {
739
816
  // Configure AI CLI integrations (both dev3000 and chrome-devtools MCPs)
740
817
  if (!this.options.serversOnly) {
741
818
  await this.tui.updateStatus("Configuring AI CLI integrations...");
742
- this.configuredAiCliTools = await configureAiCliIntegrations(this.options.mcpPort || "3684", this.options.chromeDevtoolsMcp !== false, // Default to true unless explicitly disabled
819
+ // Check if NextJS MCP is enabled and store the result
820
+ this.enableNextjsMcp = await isNextjsMcpEnabled();
821
+ this.configuredAiCliTools = await configureAiCliIntegrations(this.options.mcpPort || "3684", this.options.port, this.options.chromeDevtoolsMcp !== false, // Default to true unless explicitly disabled
743
822
  true // Silent mode when TUI is active
744
823
  );
745
824
  if (this.configuredAiCliTools.length > 0) {
@@ -794,7 +873,9 @@ export class DevEnvironment {
794
873
  // Configure AI CLI integrations (both dev3000 and chrome-devtools MCPs)
795
874
  if (!this.options.serversOnly) {
796
875
  this.spinner.text = "Configuring AI CLI integrations...";
797
- this.configuredAiCliTools = await configureAiCliIntegrations(this.options.mcpPort || "3684", this.options.chromeDevtoolsMcp !== false, // Default to true unless explicitly disabled
876
+ // Check if NextJS MCP is enabled and store the result
877
+ this.enableNextjsMcp = await isNextjsMcpEnabled();
878
+ this.configuredAiCliTools = await configureAiCliIntegrations(this.options.mcpPort || "3684", this.options.port, this.options.chromeDevtoolsMcp !== false, // Default to true unless explicitly disabled
798
879
  false // Show output in non-TUI mode
799
880
  );
800
881
  if (this.configuredAiCliTools.length > 0) {
@@ -1112,11 +1193,11 @@ export class DevEnvironment {
1112
1193
  mcpCwd = dirname(serverJsPath);
1113
1194
  }
1114
1195
  else {
1115
- // Check for start-production.js script
1116
- const startProdScript = join(mcpServerPath, "start-production.js");
1196
+ // Check for start-production.mjs script
1197
+ const startProdScript = join(mcpServerPath, "start-production.mjs");
1117
1198
  if (existsSync(startProdScript)) {
1118
1199
  // Use the production script
1119
- this.debugLog(`Global install with start-production.js script`);
1200
+ this.debugLog(`Global install with start-production.mjs script`);
1120
1201
  mcpCommand = ["node", startProdScript];
1121
1202
  mcpCwd = mcpServerPath;
1122
1203
  }
@@ -1899,7 +1980,7 @@ export class DevEnvironment {
1899
1980
  }
1900
1981
  // Clean up AI CLI MCP configurations
1901
1982
  if (this.configuredAiCliTools.length > 0) {
1902
- await cleanupAiCliIntegrations(this.configuredAiCliTools, this.options.chromeDevtoolsMcp !== false, this.options.tui);
1983
+ await cleanupAiCliIntegrations(this.configuredAiCliTools, this.options.chromeDevtoolsMcp !== false, this.enableNextjsMcp, this.options.tui);
1903
1984
  }
1904
1985
  // Kill processes on both ports
1905
1986
  const killPortProcess = async (port, name) => {