dev3000 0.0.0 → 0.0.2

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.
@@ -0,0 +1,594 @@
1
+ import { spawn } from 'child_process';
2
+ import { chromium } from 'playwright';
3
+ import { writeFileSync, appendFileSync, mkdirSync, existsSync, copyFileSync, readFileSync } from 'fs';
4
+ import { join, dirname } from 'path';
5
+ import { fileURLToPath } from 'url';
6
+ import { tmpdir } from 'os';
7
+ import chalk from 'chalk';
8
+ import * as cliProgress from 'cli-progress';
9
+ class Logger {
10
+ logFile;
11
+ constructor(logFile) {
12
+ this.logFile = logFile;
13
+ // Ensure directory exists
14
+ const logDir = dirname(logFile);
15
+ if (!existsSync(logDir)) {
16
+ mkdirSync(logDir, { recursive: true });
17
+ }
18
+ // Clear log file
19
+ writeFileSync(this.logFile, '');
20
+ }
21
+ log(source, message) {
22
+ const timestamp = new Date().toISOString();
23
+ const logEntry = `[${timestamp}] [${source.toUpperCase()}] ${message}\n`;
24
+ appendFileSync(this.logFile, logEntry);
25
+ }
26
+ }
27
+ function detectPackageManager() {
28
+ if (existsSync('pnpm-lock.yaml'))
29
+ return 'pnpx';
30
+ if (existsSync('yarn.lock'))
31
+ return 'yarn dlx';
32
+ if (existsSync('package-lock.json'))
33
+ return 'npx';
34
+ return 'npx'; // fallback
35
+ }
36
+ function detectPackageManagerForRun() {
37
+ if (existsSync('pnpm-lock.yaml'))
38
+ return 'pnpm';
39
+ if (existsSync('yarn.lock'))
40
+ return 'yarn';
41
+ if (existsSync('package-lock.json'))
42
+ return 'npm';
43
+ return 'npm'; // fallback
44
+ }
45
+ export class DevEnvironment {
46
+ serverProcess = null;
47
+ mcpServerProcess = null;
48
+ browser = null;
49
+ browserContext = null;
50
+ logger;
51
+ stateTimer = null;
52
+ browserType = null;
53
+ options;
54
+ screenshotDir;
55
+ mcpPublicDir;
56
+ pidFile;
57
+ progressBar;
58
+ constructor(options) {
59
+ this.options = options;
60
+ this.logger = new Logger(options.logFile);
61
+ this.screenshotDir = join(dirname(options.logFile), 'screenshots');
62
+ this.pidFile = join(tmpdir(), 'dev3000.pid');
63
+ // Set up MCP server public directory for web-accessible screenshots
64
+ const currentFile = fileURLToPath(import.meta.url);
65
+ const packageRoot = dirname(dirname(currentFile));
66
+ this.mcpPublicDir = join(packageRoot, 'mcp-server', 'public', 'screenshots');
67
+ // Initialize progress bar
68
+ this.progressBar = new cliProgress.SingleBar({
69
+ format: chalk.blue('Starting dev3000') + ' |' + chalk.cyan('{bar}') + '| {percentage}% | {stage}',
70
+ barCompleteChar: '█',
71
+ barIncompleteChar: '░',
72
+ hideCursor: true,
73
+ barsize: 40
74
+ }, cliProgress.Presets.shades_classic);
75
+ // Ensure directories exist
76
+ if (!existsSync(this.screenshotDir)) {
77
+ mkdirSync(this.screenshotDir, { recursive: true });
78
+ }
79
+ if (!existsSync(this.mcpPublicDir)) {
80
+ mkdirSync(this.mcpPublicDir, { recursive: true });
81
+ }
82
+ }
83
+ async checkPortsAvailable() {
84
+ const ports = [this.options.port, this.options.mcpPort];
85
+ for (const port of ports) {
86
+ try {
87
+ const result = await new Promise((resolve) => {
88
+ const proc = spawn('lsof', ['-ti', `:${port}`], { stdio: 'pipe' });
89
+ let output = '';
90
+ proc.stdout?.on('data', (data) => output += data.toString());
91
+ proc.on('exit', () => resolve(output.trim()));
92
+ });
93
+ if (result) {
94
+ const pids = result.split('\n').filter(line => line.trim());
95
+ console.log(chalk.red(`❌ Port ${port} is already in use`));
96
+ console.log(chalk.yellow(`💡 To free up port ${port}, run: lsof -ti:${port} | xargs kill -9`));
97
+ throw new Error(`Port ${port} is already in use. Please free the port and try again.`);
98
+ }
99
+ }
100
+ catch (error) {
101
+ if (error instanceof Error && error.message.includes('Port')) {
102
+ throw error; // Re-throw our custom error
103
+ }
104
+ // Ignore other errors - port might just be free
105
+ }
106
+ }
107
+ }
108
+ async start() {
109
+ // Start progress bar
110
+ this.progressBar.start(100, 0, { stage: 'Checking ports...' });
111
+ // Check if ports are available first
112
+ await this.checkPortsAvailable();
113
+ this.progressBar.update(10, { stage: 'Starting servers...' });
114
+ // Write our process group ID to PID file for cleanup
115
+ writeFileSync(this.pidFile, process.pid.toString());
116
+ // Setup cleanup handlers
117
+ this.setupCleanupHandlers();
118
+ // Start user's dev server
119
+ await this.startServer();
120
+ this.progressBar.update(20, { stage: 'Starting MCP server...' });
121
+ // Start MCP server
122
+ await this.startMcpServer();
123
+ this.progressBar.update(30, { stage: 'Waiting for your app server...' });
124
+ // Wait for both servers to be ready
125
+ await this.waitForServer();
126
+ this.progressBar.update(50, { stage: 'Waiting for MCP server...' });
127
+ await this.waitForMcpServer();
128
+ this.progressBar.update(70, { stage: 'Starting browser...' });
129
+ // Start browser monitoring
130
+ await this.startBrowserMonitoring();
131
+ this.progressBar.update(100, { stage: 'Complete!' });
132
+ // Stop progress bar and show results
133
+ this.progressBar.stop();
134
+ console.log(chalk.green('\n✅ Development environment ready!'));
135
+ console.log(chalk.blue(`📊 Logs: ${this.options.logFile}`));
136
+ console.log(chalk.gray(`🔧 MCP Server Logs: ${join(dirname(this.options.logFile), 'dev3000-mcp.log')}`));
137
+ console.log(chalk.yellow('☝️ Give this to an AI to auto debug and fix your app\n'));
138
+ console.log(chalk.blue(`🌐 Your App: http://localhost:${this.options.port}`));
139
+ console.log(chalk.blue(`🤖 MCP Server: http://localhost:${this.options.mcpPort}/api/mcp/http`));
140
+ console.log(chalk.magenta(`📸 Visual Timeline: http://localhost:${this.options.mcpPort}/logs`));
141
+ console.log(chalk.gray('\n💡 To stop all servers and kill dev3000: Ctrl-C'));
142
+ }
143
+ async startServer() {
144
+ const [command, ...args] = this.options.serverCommand.split(' ');
145
+ this.serverProcess = spawn(command, args, {
146
+ stdio: ['ignore', 'pipe', 'pipe'],
147
+ shell: true,
148
+ detached: true, // Run independently
149
+ });
150
+ // Log server output (to file only, reduce stdout noise)
151
+ this.serverProcess.stdout?.on('data', (data) => {
152
+ const message = data.toString().trim();
153
+ if (message) {
154
+ this.logger.log('server', message);
155
+ }
156
+ });
157
+ this.serverProcess.stderr?.on('data', (data) => {
158
+ const message = data.toString().trim();
159
+ if (message) {
160
+ this.logger.log('server', `ERROR: ${message}`);
161
+ // Only show critical server errors in stdout
162
+ if (message.includes('FATAL') || message.includes('Error:')) {
163
+ console.error(chalk.red('[SERVER ERROR]'), message);
164
+ }
165
+ }
166
+ });
167
+ this.serverProcess.on('exit', (code) => {
168
+ console.log(chalk.red(`Server process exited with code ${code}`));
169
+ });
170
+ }
171
+ async startMcpServer() {
172
+ // Get the path to our bundled MCP server
173
+ const currentFile = fileURLToPath(import.meta.url);
174
+ const packageRoot = dirname(dirname(currentFile)); // Go up from dist/ to package root
175
+ const mcpServerPath = join(packageRoot, 'mcp-server');
176
+ if (!existsSync(mcpServerPath)) {
177
+ throw new Error(`MCP server directory not found at ${mcpServerPath}`);
178
+ }
179
+ // Read version from package.json
180
+ const versionCurrentFile = fileURLToPath(import.meta.url);
181
+ const versionPackageRoot = dirname(dirname(versionCurrentFile));
182
+ const packageJsonPath = join(versionPackageRoot, 'package.json');
183
+ let version = '0.0.0';
184
+ try {
185
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
186
+ version = packageJson.version;
187
+ }
188
+ catch (error) {
189
+ console.log(chalk.yellow('⚠️ Could not read version from package.json'));
190
+ }
191
+ // Start the MCP server using detected package manager
192
+ const packageManagerForRun = detectPackageManagerForRun();
193
+ this.mcpServerProcess = spawn(packageManagerForRun, ['run', 'dev'], {
194
+ stdio: ['ignore', 'pipe', 'pipe'],
195
+ shell: true,
196
+ detached: true, // Run independently
197
+ cwd: mcpServerPath,
198
+ env: {
199
+ ...process.env,
200
+ PORT: this.options.mcpPort,
201
+ LOG_FILE_PATH: this.options.logFile, // Pass log file path to MCP server
202
+ DEV3000_VERSION: version, // Pass version to MCP server
203
+ },
204
+ });
205
+ // Log MCP server output to separate file for debugging
206
+ const mcpLogFile = join(dirname(this.options.logFile), 'dev3000-mcp.log');
207
+ writeFileSync(mcpLogFile, ''); // Clear the file
208
+ this.mcpServerProcess.stdout?.on('data', (data) => {
209
+ const message = data.toString().trim();
210
+ if (message) {
211
+ const timestamp = new Date().toISOString();
212
+ appendFileSync(mcpLogFile, `[${timestamp}] [MCP-STDOUT] ${message}\n`);
213
+ }
214
+ });
215
+ this.mcpServerProcess.stderr?.on('data', (data) => {
216
+ const message = data.toString().trim();
217
+ if (message) {
218
+ const timestamp = new Date().toISOString();
219
+ appendFileSync(mcpLogFile, `[${timestamp}] [MCP-STDERR] ${message}\n`);
220
+ // Only show critical errors in stdout for debugging
221
+ if (message.includes('FATAL') || message.includes('Error:')) {
222
+ console.error(chalk.red('[LOG VIEWER ERROR]'), message);
223
+ }
224
+ }
225
+ });
226
+ this.mcpServerProcess.on('exit', (code) => {
227
+ console.log(chalk.red(`MCP server process exited with code ${code}`));
228
+ });
229
+ }
230
+ async waitForServer() {
231
+ const maxAttempts = 30;
232
+ let attempts = 0;
233
+ while (attempts < maxAttempts) {
234
+ try {
235
+ const response = await fetch(`http://localhost:${this.options.port}`, {
236
+ method: 'HEAD',
237
+ signal: AbortSignal.timeout(2000)
238
+ });
239
+ if (response.ok || response.status === 404) {
240
+ return;
241
+ }
242
+ }
243
+ catch (error) {
244
+ // Server not ready yet, continue waiting
245
+ }
246
+ attempts++;
247
+ await new Promise(resolve => setTimeout(resolve, 1000));
248
+ }
249
+ // Continue anyway if health check fails
250
+ }
251
+ async waitForMcpServer() {
252
+ const maxAttempts = 30;
253
+ let attempts = 0;
254
+ while (attempts < maxAttempts) {
255
+ try {
256
+ const response = await fetch(`http://localhost:${this.options.mcpPort}`, {
257
+ method: 'HEAD',
258
+ signal: AbortSignal.timeout(2000)
259
+ });
260
+ if (response.ok || response.status === 404) {
261
+ return;
262
+ }
263
+ }
264
+ catch (error) {
265
+ // MCP server not ready yet, continue waiting
266
+ }
267
+ attempts++;
268
+ await new Promise(resolve => setTimeout(resolve, 1000));
269
+ }
270
+ // Continue anyway if health check fails
271
+ }
272
+ async startBrowserMonitoring() {
273
+ // Ensure profile directory exists
274
+ if (!existsSync(this.options.profileDir)) {
275
+ mkdirSync(this.options.profileDir, { recursive: true });
276
+ }
277
+ try {
278
+ // Try to use system Chrome first
279
+ this.browser = await chromium.launch({
280
+ headless: false,
281
+ channel: 'chrome', // Use system Chrome
282
+ // Remove automation flags to allow normal dialog behavior
283
+ args: [
284
+ '--disable-web-security', // Keep this for dev server access
285
+ '--hide-crash-restore-bubble', // Don't ask to restore pages
286
+ '--disable-infobars', // Remove info bars
287
+ '--disable-blink-features=AutomationControlled', // Hide automation detection
288
+ '--disable-features=VizDisplayCompositor', // Reduce automation fingerprinting
289
+ ],
290
+ });
291
+ this.browserType = 'system-chrome';
292
+ }
293
+ catch (error) {
294
+ // Fallback to Playwright's bundled chromium
295
+ try {
296
+ this.browser = await chromium.launch({
297
+ headless: false,
298
+ // Remove automation flags to allow normal dialog behavior
299
+ args: [
300
+ '--disable-web-security', // Keep this for dev server access
301
+ '--hide-crash-restore-bubble', // Don't ask to restore pages
302
+ '--disable-infobars', // Remove info bars
303
+ '--disable-blink-features=AutomationControlled', // Hide automation detection
304
+ '--disable-features=VizDisplayCompositor', // Reduce automation fingerprinting
305
+ ],
306
+ });
307
+ this.browserType = 'playwright-chromium';
308
+ }
309
+ catch (playwrightError) {
310
+ if (playwrightError.message?.includes('Executable doesn\'t exist')) {
311
+ const packageManager = detectPackageManager();
312
+ console.log(chalk.yellow('📦 Installing Playwright chromium browser...'));
313
+ await this.installPlaywrightBrowsers();
314
+ // Retry with bundled chromium
315
+ this.browser = await chromium.launch({
316
+ headless: false,
317
+ // Remove automation flags to allow normal dialog behavior
318
+ args: [
319
+ '--disable-web-security', // Keep this for dev server access
320
+ '--hide-crash-restore-bubble', // Don't ask to restore pages
321
+ '--disable-infobars', // Remove info bars
322
+ ],
323
+ });
324
+ this.browserType = 'playwright-chromium';
325
+ }
326
+ else {
327
+ throw playwrightError;
328
+ }
329
+ }
330
+ }
331
+ // Create context with viewport: null to enable window resizing + persistent storage
332
+ try {
333
+ const stateFile = join(this.options.profileDir, 'state.json');
334
+ this.browserContext = await this.browser.newContext({
335
+ viewport: null, // This makes the page size depend on the window size
336
+ storageState: existsSync(stateFile) ? stateFile : undefined, // Load persistent state if it exists
337
+ });
338
+ }
339
+ catch (error) {
340
+ console.error(chalk.red('[BROWSER CONTEXT ERROR]'), error);
341
+ // Fallback: create context without storage state
342
+ this.browserContext = await this.browser.newContext({
343
+ viewport: null,
344
+ });
345
+ }
346
+ // Set up periodic storage state saving (every 30 seconds)
347
+ this.stateTimer = setInterval(async () => {
348
+ if (this.browserContext) {
349
+ try {
350
+ const stateFile = join(this.options.profileDir, 'state.json');
351
+ await this.browserContext.storageState({ path: stateFile });
352
+ }
353
+ catch (error) {
354
+ // Ignore errors - context might be closed
355
+ }
356
+ }
357
+ }, 15000); // Save every 15 seconds
358
+ // Navigate to the app using the existing blank page
359
+ const pages = this.browserContext.pages();
360
+ const page = pages.length > 0 ? pages[0] : await this.browserContext.newPage();
361
+ // Disable automatic dialog handling - let dialogs behave naturally
362
+ page.removeAllListeners('dialog');
363
+ // Add a no-op dialog handler to prevent auto-dismissal
364
+ page.on('dialog', async (dialog) => {
365
+ // Don't accept or dismiss - let user handle it manually
366
+ // This prevents Playwright from auto-handling the dialog
367
+ });
368
+ await page.goto(`http://localhost:${this.options.port}`);
369
+ // Take initial screenshot
370
+ const initialScreenshot = await this.takeScreenshot(page, 'initial-load');
371
+ if (initialScreenshot) {
372
+ this.logger.log('browser', `[SCREENSHOT] ${initialScreenshot}`);
373
+ }
374
+ // Set up monitoring
375
+ await this.setupPageMonitoring(page);
376
+ // Monitor new pages
377
+ this.browserContext.on('page', async (newPage) => {
378
+ // Disable automatic dialog handling for new pages too
379
+ newPage.removeAllListeners('dialog');
380
+ // Add a no-op dialog handler to prevent auto-dismissal
381
+ newPage.on('dialog', async (dialog) => {
382
+ // Don't accept or dismiss - let user handle it manually
383
+ });
384
+ await this.setupPageMonitoring(newPage);
385
+ });
386
+ }
387
+ async installPlaywrightBrowsers() {
388
+ this.progressBar.update(75, { stage: 'Installing Playwright browser (2-3 min)...' });
389
+ return new Promise((resolve, reject) => {
390
+ const packageManager = detectPackageManager();
391
+ const [command, ...args] = packageManager.split(' ');
392
+ console.log(chalk.gray(`Running: ${command} ${[...args, 'playwright', 'install', 'chromium'].join(' ')}`));
393
+ const installProcess = spawn(command, [...args, 'playwright', 'install', 'chromium'], {
394
+ stdio: ['inherit', 'pipe', 'pipe'],
395
+ shell: true,
396
+ });
397
+ // Add timeout (5 minutes)
398
+ const timeout = setTimeout(() => {
399
+ installProcess.kill('SIGKILL');
400
+ reject(new Error('Playwright installation timed out after 5 minutes'));
401
+ }, 5 * 60 * 1000);
402
+ let hasOutput = false;
403
+ installProcess.stdout?.on('data', (data) => {
404
+ hasOutput = true;
405
+ const message = data.toString().trim();
406
+ if (message) {
407
+ console.log(chalk.gray('[PLAYWRIGHT]'), message);
408
+ }
409
+ });
410
+ installProcess.stderr?.on('data', (data) => {
411
+ hasOutput = true;
412
+ const message = data.toString().trim();
413
+ if (message) {
414
+ console.log(chalk.gray('[PLAYWRIGHT]'), message);
415
+ }
416
+ });
417
+ installProcess.on('exit', (code) => {
418
+ clearTimeout(timeout);
419
+ if (code === 0) {
420
+ console.log(chalk.green('✅ Playwright chromium installed successfully!'));
421
+ resolve();
422
+ }
423
+ else {
424
+ reject(new Error(`Playwright installation failed with exit code ${code}`));
425
+ }
426
+ });
427
+ installProcess.on('error', (error) => {
428
+ clearTimeout(timeout);
429
+ reject(new Error(`Failed to start Playwright installation: ${error.message}`));
430
+ });
431
+ // Check if process seems stuck
432
+ setTimeout(() => {
433
+ if (!hasOutput) {
434
+ console.log(chalk.yellow('⚠️ Installation seems stuck. This is normal for the first run - downloading ~100MB...'));
435
+ }
436
+ }, 10000); // Show message after 10 seconds of no output
437
+ });
438
+ }
439
+ async takeScreenshot(page, event) {
440
+ try {
441
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
442
+ const filename = `${timestamp}-${event}.png`;
443
+ const screenshotPath = join(this.screenshotDir, filename);
444
+ const mcpScreenshotPath = join(this.mcpPublicDir, filename);
445
+ await page.screenshot({
446
+ path: screenshotPath,
447
+ fullPage: false, // Just viewport for speed
448
+ animations: 'disabled' // Disable animations during screenshot
449
+ });
450
+ // Copy to MCP server public folder for web access
451
+ copyFileSync(screenshotPath, mcpScreenshotPath);
452
+ // Return web-accessible URL
453
+ return `http://localhost:${this.options.mcpPort}/screenshots/${filename}`;
454
+ }
455
+ catch (error) {
456
+ console.error(chalk.red('[SCREENSHOT ERROR]'), error);
457
+ return null;
458
+ }
459
+ }
460
+ async setupPageMonitoring(page) {
461
+ const url = page.url();
462
+ // Only monitor localhost pages
463
+ if (!url.includes(`localhost:${this.options.port}`) && url !== 'about:blank') {
464
+ return;
465
+ }
466
+ this.logger.log('browser', `📄 New page: ${url}`);
467
+ // Console logs
468
+ page.on('console', (msg) => {
469
+ if (page.url().includes(`localhost:${this.options.port}`)) {
470
+ const level = msg.type().toUpperCase();
471
+ const text = msg.text();
472
+ this.logger.log('browser', `[CONSOLE ${level}] ${text}`);
473
+ }
474
+ });
475
+ // Page errors
476
+ page.on('pageerror', async (error) => {
477
+ if (page.url().includes(`localhost:${this.options.port}`)) {
478
+ const screenshotPath = await this.takeScreenshot(page, 'error');
479
+ this.logger.log('browser', `[PAGE ERROR] ${error.message}`);
480
+ if (screenshotPath) {
481
+ this.logger.log('browser', `[SCREENSHOT] ${screenshotPath}`);
482
+ }
483
+ if (error.stack) {
484
+ this.logger.log('browser', `[PAGE ERROR STACK] ${error.stack}`);
485
+ }
486
+ }
487
+ });
488
+ // Network requests
489
+ page.on('request', (request) => {
490
+ if (page.url().includes(`localhost:${this.options.port}`) && !request.url().includes(`localhost:${this.options.mcpPort}`)) {
491
+ this.logger.log('browser', `[NETWORK REQUEST] ${request.method()} ${request.url()}`);
492
+ }
493
+ });
494
+ page.on('response', async (response) => {
495
+ if (page.url().includes(`localhost:${this.options.port}`) && !response.url().includes(`localhost:${this.options.mcpPort}`)) {
496
+ const status = response.status();
497
+ const url = response.url();
498
+ if (status >= 400) {
499
+ const screenshotPath = await this.takeScreenshot(page, 'network-error');
500
+ this.logger.log('browser', `[NETWORK ERROR] ${status} ${url}`);
501
+ if (screenshotPath) {
502
+ this.logger.log('browser', `[SCREENSHOT] ${screenshotPath}`);
503
+ }
504
+ }
505
+ }
506
+ });
507
+ // Navigation (only screenshot on route changes, not every navigation)
508
+ let lastRoute = '';
509
+ page.on('framenavigated', async (frame) => {
510
+ if (frame === page.mainFrame() && frame.url().includes(`localhost:${this.options.port}`)) {
511
+ const currentRoute = new URL(frame.url()).pathname;
512
+ this.logger.log('browser', `[NAVIGATION] ${frame.url()}`);
513
+ // Only screenshot if route actually changed
514
+ if (currentRoute !== lastRoute) {
515
+ const screenshotPath = await this.takeScreenshot(page, 'route-change');
516
+ if (screenshotPath) {
517
+ this.logger.log('browser', `[SCREENSHOT] ${screenshotPath}`);
518
+ }
519
+ lastRoute = currentRoute;
520
+ }
521
+ }
522
+ });
523
+ }
524
+ setupCleanupHandlers() {
525
+ // Handle Ctrl+C to kill all processes
526
+ process.on('SIGINT', async () => {
527
+ console.log(chalk.yellow('\n🛑 Received interrupt signal. Cleaning up processes...'));
528
+ // Kill processes on both ports
529
+ const killPortProcess = async (port, name) => {
530
+ try {
531
+ const { spawn } = await import('child_process');
532
+ const killProcess = spawn('sh', ['-c', `lsof -ti:${port} | xargs kill -9`], { stdio: 'inherit' });
533
+ killProcess.on('exit', (code) => {
534
+ if (code === 0) {
535
+ console.log(chalk.green(`✅ Killed ${name} on port ${port}`));
536
+ }
537
+ });
538
+ }
539
+ catch (error) {
540
+ console.log(chalk.gray(`⚠️ Could not kill ${name} on port ${port}`));
541
+ }
542
+ };
543
+ // Clear the state saving timer
544
+ if (this.stateTimer) {
545
+ clearInterval(this.stateTimer);
546
+ }
547
+ // Try to save browser state before closing
548
+ if (this.browserContext) {
549
+ try {
550
+ console.log(chalk.blue('💾 Saving browser state...'));
551
+ const stateFile = join(this.options.profileDir, 'state.json');
552
+ await this.browserContext.storageState({ path: stateFile });
553
+ console.log(chalk.green('✅ Browser state saved'));
554
+ }
555
+ catch (error) {
556
+ console.log(chalk.gray('⚠️ Could not save browser state'));
557
+ }
558
+ }
559
+ // Close browser
560
+ if (this.browser) {
561
+ try {
562
+ if (this.browserType === 'system-chrome') {
563
+ console.log(chalk.blue('🔄 Closing browser tab (keeping Chrome open)...'));
564
+ }
565
+ else {
566
+ console.log(chalk.blue('🔄 Closing browser...'));
567
+ }
568
+ await this.browser.close();
569
+ console.log(chalk.green('✅ Browser closed'));
570
+ }
571
+ catch (error) {
572
+ if (this.browserType === 'system-chrome') {
573
+ console.log(chalk.gray('⚠️ Chrome tab close failed (this is normal - your Chrome stays open)'));
574
+ }
575
+ else {
576
+ console.log(chalk.gray('⚠️ Browser already closed'));
577
+ }
578
+ }
579
+ }
580
+ // Kill servers after browser is closed
581
+ await Promise.all([
582
+ killPortProcess(this.options.port, 'your app server'),
583
+ killPortProcess(this.options.mcpPort, 'dev3000 MCP server')
584
+ ]);
585
+ console.log(chalk.green('✅ Cleanup complete'));
586
+ process.exit(0);
587
+ });
588
+ }
589
+ }
590
+ export async function startDevEnvironment(options) {
591
+ const devEnv = new DevEnvironment(options);
592
+ await devEnv.start();
593
+ }
594
+ //# sourceMappingURL=dev-environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-environment.js","sourceRoot":"","sources":["../src/dev-environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAiC,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAc,YAAY,EAAE,MAAM,IAAI,CAAC;AAClH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAY,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BAA2B,CAAC,CAAC,CAAC;oBACvD,CAAC;gBACH,CAAC;YACH,CAAC;YAED,uCAAuC;YACvC,MAAM,OAAO,CAAC,GAAG,CAAC;gBAChB,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,iBAAiB,CAAC;gBACrD,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,oBAAoB,CAAC;aAC5D,CAAC,CAAC;YAEH,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAA8B;IACtE,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { startDevEnvironment, DevEnvironment } from './dev-environment.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { startDevEnvironment, DevEnvironment } from './dev-environment.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { NextResponse } from 'next/server';
2
+ import { ConfigApiResponse } from '../../types';
3
+
4
+ export async function GET(): Promise<NextResponse> {
5
+ const response: ConfigApiResponse = {
6
+ version: process.env.DEV_PLAYWRIGHT_VERSION || '0.0.0'
7
+ };
8
+
9
+ return NextResponse.json(response);
10
+ }