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.
- package/README.md +59 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +47 -0
- package/dist/cli.js.map +1 -0
- package/dist/dev-environment.d.ts +36 -0
- package/dist/dev-environment.d.ts.map +1 -0
- package/dist/dev-environment.js +594 -0
- package/dist/dev-environment.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/mcp-server/app/api/config/route.ts +10 -0
- package/mcp-server/app/api/logs/head/route.ts +32 -0
- package/mcp-server/app/api/logs/stream/route.ts +61 -0
- package/mcp-server/app/api/logs/tail/route.ts +32 -0
- package/mcp-server/app/api/mcp/[transport]/route.ts +188 -0
- package/mcp-server/app/layout.tsx +15 -0
- package/mcp-server/app/logs/LogsClient.tsx +292 -0
- package/mcp-server/app/logs/page.tsx +7 -0
- package/mcp-server/app/page.tsx +45 -0
- package/mcp-server/next-env.d.ts +6 -0
- package/mcp-server/next.config.ts +14 -0
- package/mcp-server/package.json +23 -0
- package/mcp-server/tsconfig.json +40 -0
- package/package.json +53 -7
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# dev3000
|
|
2
|
+
|
|
3
|
+
Captures your web app's complete development timeline - server logs, browser events, console messages, network requests, and automatic screenshots - in a unified, timestamped feed for AI debugging.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm install dev3000
|
|
9
|
+
pnpx dev3000
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## What it does
|
|
13
|
+
|
|
14
|
+
Creates a comprehensive log of your development session that AI assistants can easily understand. When you have a bug or issue, Claude can see your server output, browser console, network requests, and screenshots all in chronological order.
|
|
15
|
+
|
|
16
|
+
The tool monitors your app in a real browser and captures:
|
|
17
|
+
- Server logs and console output
|
|
18
|
+
- Browser console messages and errors
|
|
19
|
+
- Network requests and responses
|
|
20
|
+
- Automatic screenshots on navigation, errors, and key events
|
|
21
|
+
- Visual timeline at `http://localhost:3684/logs`
|
|
22
|
+
|
|
23
|
+
## AI Integration
|
|
24
|
+
|
|
25
|
+
Give Claude your log file for instant debugging:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Read /tmp/dev3000.log
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or use the MCP server at `http://localhost:3684/api/mcp/http` for advanced querying:
|
|
32
|
+
- `read_consolidated_logs` - Get recent logs with filtering
|
|
33
|
+
- `search_logs` - Regex search with context
|
|
34
|
+
- `get_browser_errors` - Extract browser errors by time period
|
|
35
|
+
|
|
36
|
+
## Options
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpx dev3000 [options]
|
|
40
|
+
|
|
41
|
+
-p, --port <port> Your app's port (default: 3000)
|
|
42
|
+
--mcp-port <port> MCP server port (default: 3684)
|
|
43
|
+
-s, --script <script> Package.json script to run (default: dev)
|
|
44
|
+
--profile-dir <dir> Chrome profile directory (persists cookies/login state)
|
|
45
|
+
--logfile <file> Log file path (default: /tmp/dev3000.log)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Examples:
|
|
49
|
+
```bash
|
|
50
|
+
# Custom port for Vite
|
|
51
|
+
pnpx dev3000 --port 5173
|
|
52
|
+
|
|
53
|
+
# Persistent login state
|
|
54
|
+
pnpx dev3000 --profile-dir ./chrome-profile
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
_Made by [elsigh](https://github.com/elsigh)_
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { tmpdir } from 'os';
|
|
5
|
+
import { join } from 'path';
|
|
6
|
+
import { existsSync } from 'fs';
|
|
7
|
+
import { startDevEnvironment } from './dev-environment.js';
|
|
8
|
+
function detectPackageManager() {
|
|
9
|
+
if (existsSync('pnpm-lock.yaml'))
|
|
10
|
+
return 'pnpm';
|
|
11
|
+
if (existsSync('yarn.lock'))
|
|
12
|
+
return 'yarn';
|
|
13
|
+
if (existsSync('package-lock.json'))
|
|
14
|
+
return 'npm';
|
|
15
|
+
return 'npm'; // fallback
|
|
16
|
+
}
|
|
17
|
+
const program = new Command();
|
|
18
|
+
program
|
|
19
|
+
.name('dev3000')
|
|
20
|
+
.description('AI-powered development tools with browser monitoring and MCP server')
|
|
21
|
+
.version('0.0.1');
|
|
22
|
+
program
|
|
23
|
+
.description('AI-powered development tools with browser monitoring and MCP server')
|
|
24
|
+
.option('-p, --port <port>', 'Development server port', '3000')
|
|
25
|
+
.option('--mcp-port <port>', 'MCP server port', '3684')
|
|
26
|
+
.option('-s, --script <script>', 'Package.json script to run (e.g. dev, build-start)', 'dev')
|
|
27
|
+
.option('--profile-dir <dir>', 'Chrome profile directory', join(tmpdir(), 'dev3000-chrome-profile'))
|
|
28
|
+
.option('--logfile <file>', 'Consolidated log file path', '/tmp/dev3000.log')
|
|
29
|
+
.action(async (options) => {
|
|
30
|
+
console.log(chalk.blue.bold('🤖 Starting AI Development Environment'));
|
|
31
|
+
// Convert script option to full command
|
|
32
|
+
const packageManager = detectPackageManager();
|
|
33
|
+
const serverCommand = `${packageManager} run ${options.script}`;
|
|
34
|
+
try {
|
|
35
|
+
await startDevEnvironment({
|
|
36
|
+
...options,
|
|
37
|
+
logFile: options.logfile,
|
|
38
|
+
serverCommand
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
console.error(chalk.red('❌ Failed to start development environment:'), error);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
program.parse();
|
|
47
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,SAAS,oBAAoB;IAC3B,IAAI,UAAU,CAAC,gBAAgB,CAAC;QAAE,OAAO,MAAM,CAAC;IAChD,IAAI,UAAU,CAAC,WAAW,CAAC;QAAE,OAAO,MAAM,CAAC;IAC3C,IAAI,UAAU,CAAC,mBAAmB,CAAC;QAAE,OAAO,KAAK,CAAC;IAClD,OAAO,KAAK,CAAC,CAAC,WAAW;AAC3B,CAAC;AAED,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAAC,qEAAqE,CAAC;KAClF,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,WAAW,CAAC,qEAAqE,CAAC;KAClF,MAAM,CAAC,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,CAAC;KAC9D,MAAM,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,CAAC;KACtD,MAAM,CAAC,uBAAuB,EAAE,oDAAoD,EAAE,KAAK,CAAC;KAC5F,MAAM,CAAC,qBAAqB,EAAE,0BAA0B,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,wBAAwB,CAAC,CAAC;KACnG,MAAM,CAAC,kBAAkB,EAAE,4BAA4B,EAAE,kBAAkB,CAAC;KAC5E,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC,CAAC;IAEvE,wCAAwC;IACxC,MAAM,cAAc,GAAG,oBAAoB,EAAE,CAAC;IAC9C,MAAM,aAAa,GAAG,GAAG,cAAc,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC;IAEhE,IAAI,CAAC;QACH,MAAM,mBAAmB,CAAC;YACxB,GAAG,OAAO;YACV,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,aAAa;SACd,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,4CAA4C,CAAC,EAAE,KAAK,CAAC,CAAC;QAC9E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
interface DevEnvironmentOptions {
|
|
2
|
+
port: string;
|
|
3
|
+
mcpPort: string;
|
|
4
|
+
serverCommand: string;
|
|
5
|
+
profileDir: string;
|
|
6
|
+
logFile: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class DevEnvironment {
|
|
9
|
+
private serverProcess;
|
|
10
|
+
private mcpServerProcess;
|
|
11
|
+
private browser;
|
|
12
|
+
private browserContext;
|
|
13
|
+
private logger;
|
|
14
|
+
private stateTimer;
|
|
15
|
+
private browserType;
|
|
16
|
+
private options;
|
|
17
|
+
private screenshotDir;
|
|
18
|
+
private mcpPublicDir;
|
|
19
|
+
private pidFile;
|
|
20
|
+
private progressBar;
|
|
21
|
+
constructor(options: DevEnvironmentOptions);
|
|
22
|
+
private checkPortsAvailable;
|
|
23
|
+
start(): Promise<void>;
|
|
24
|
+
private startServer;
|
|
25
|
+
private startMcpServer;
|
|
26
|
+
private waitForServer;
|
|
27
|
+
private waitForMcpServer;
|
|
28
|
+
private startBrowserMonitoring;
|
|
29
|
+
private installPlaywrightBrowsers;
|
|
30
|
+
private takeScreenshot;
|
|
31
|
+
private setupPageMonitoring;
|
|
32
|
+
private setupCleanupHandlers;
|
|
33
|
+
}
|
|
34
|
+
export declare function startDevEnvironment(options: DevEnvironmentOptions): Promise<void>;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=dev-environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-environment.d.ts","sourceRoot":"","sources":["../src/dev-environment.ts"],"names":[],"mappings":"AASA,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAqCD,qBAAa,cAAc;IACzB,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,WAAW,CAAwD;IAC3E,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAAwB;gBAE/B,OAAO,EAAE,qBAAqB;YA6B5B,mBAAmB;IA4B3B,KAAK;YA8CG,WAAW;YAiCX,cAAc;YAkEd,aAAa;YAwBb,gBAAgB;YAwBhB,sBAAsB;YA4HtB,yBAAyB;YA8DzB,cAAc;YAwBd,mBAAmB;IAyEjC,OAAO,CAAC,oBAAoB;CAkE7B;AAED,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,iBAGvE"}
|