dev3000 0.0.49 → 0.0.51

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 (36) hide show
  1. package/README.md +55 -6
  2. package/dist/cdp-monitor.d.ts.map +1 -1
  3. package/dist/cdp-monitor.js +54 -48
  4. package/dist/cdp-monitor.js.map +1 -1
  5. package/dist/cli.js +39 -33
  6. package/dist/cli.js.map +1 -1
  7. package/dist/dev-environment.d.ts +2 -0
  8. package/dist/dev-environment.d.ts.map +1 -1
  9. package/dist/dev-environment.js +212 -181
  10. package/dist/dev-environment.js.map +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/mcp-server/app/api/config/route.ts +7 -7
  16. package/mcp-server/app/api/logs/append/route.ts +59 -51
  17. package/mcp-server/app/api/logs/head/route.ts +22 -22
  18. package/mcp-server/app/api/logs/list/route.ts +39 -42
  19. package/mcp-server/app/api/logs/rotate/route.ts +28 -38
  20. package/mcp-server/app/api/logs/stream/route.ts +35 -35
  21. package/mcp-server/app/api/logs/tail/route.ts +22 -22
  22. package/mcp-server/app/api/mcp/[transport]/route.ts +189 -188
  23. package/mcp-server/app/api/replay/route.ts +217 -202
  24. package/mcp-server/app/layout.tsx +9 -8
  25. package/mcp-server/app/logs/LogsClient.test.ts +123 -99
  26. package/mcp-server/app/logs/LogsClient.tsx +724 -562
  27. package/mcp-server/app/logs/page.tsx +71 -72
  28. package/mcp-server/app/logs/utils.ts +99 -28
  29. package/mcp-server/app/page.tsx +10 -14
  30. package/mcp-server/app/replay/ReplayClient.tsx +120 -119
  31. package/mcp-server/app/replay/page.tsx +3 -3
  32. package/mcp-server/next.config.ts +2 -0
  33. package/mcp-server/package.json +5 -2
  34. package/mcp-server/pnpm-lock.yaml +37 -5
  35. package/mcp-server/tsconfig.json +4 -17
  36. package/package.json +16 -13
@@ -1,61 +1,61 @@
1
- import { NextRequest } from 'next/server';
2
- import { existsSync, watchFile, readFileSync } from 'fs';
1
+ import { existsSync, readFileSync, watchFile } from "fs"
2
+ import type { NextRequest } from "next/server"
3
3
 
4
4
  export async function GET(request: NextRequest) {
5
- const { searchParams } = new URL(request.url);
6
- const logPath = searchParams.get('logPath') || process.env.LOG_FILE_PATH || './ai-dev-tools/consolidated.log';
7
-
5
+ const { searchParams } = new URL(request.url)
6
+ const logPath = searchParams.get("logPath") || process.env.LOG_FILE_PATH || "./ai-dev-tools/consolidated.log"
7
+
8
8
  if (!existsSync(logPath)) {
9
- return new Response('Log file not found', { status: 404 });
9
+ return new Response("Log file not found", { status: 404 })
10
10
  }
11
11
 
12
- const encoder = new TextEncoder();
13
- let lastSize = 0;
12
+ const encoder = new TextEncoder()
13
+ let lastSize = 0
14
14
 
15
15
  const stream = new ReadableStream({
16
16
  start(controller) {
17
17
  // Send initial content
18
18
  try {
19
- const content = readFileSync(logPath, 'utf-8');
20
- const lines = content.split('\n').filter(line => line.trim());
21
- lastSize = content.length;
22
-
19
+ const content = readFileSync(logPath, "utf-8")
20
+ const lines = content.split("\n").filter((line) => line.trim())
21
+ lastSize = content.length
22
+
23
23
  // Send initial lines
24
- controller.enqueue(encoder.encode(`data: ${JSON.stringify({ lines })}\n\n`));
25
- } catch (error) {
26
- controller.enqueue(encoder.encode(`data: ${JSON.stringify({ error: 'Failed to read log' })}\n\n`));
24
+ controller.enqueue(encoder.encode(`data: ${JSON.stringify({ lines })}\n\n`))
25
+ } catch (_error) {
26
+ controller.enqueue(encoder.encode(`data: ${JSON.stringify({ error: "Failed to read log" })}\n\n`))
27
27
  }
28
28
 
29
29
  // Watch for file changes
30
30
  const watcher = watchFile(logPath, { interval: 1000 }, () => {
31
31
  try {
32
- const content = readFileSync(logPath, 'utf-8');
32
+ const content = readFileSync(logPath, "utf-8")
33
33
  if (content.length > lastSize) {
34
- const newContent = content.slice(lastSize);
35
- const newLines = newContent.split('\n').filter(line => line.trim());
34
+ const newContent = content.slice(lastSize)
35
+ const newLines = newContent.split("\n").filter((line) => line.trim())
36
36
  if (newLines.length > 0) {
37
- controller.enqueue(encoder.encode(`data: ${JSON.stringify({ newLines })}\n\n`));
37
+ controller.enqueue(encoder.encode(`data: ${JSON.stringify({ newLines })}\n\n`))
38
38
  }
39
- lastSize = content.length;
39
+ lastSize = content.length
40
40
  }
41
- } catch (error) {
42
- controller.enqueue(encoder.encode(`data: ${JSON.stringify({ error: 'Failed to read log updates' })}\n\n`));
41
+ } catch (_error) {
42
+ controller.enqueue(encoder.encode(`data: ${JSON.stringify({ error: "Failed to read log updates" })}\n\n`))
43
43
  }
44
- });
44
+ })
45
45
 
46
46
  // Cleanup on close
47
- request.signal.addEventListener('abort', () => {
48
- watcher.unref();
49
- controller.close();
50
- });
51
- },
52
- });
47
+ request.signal.addEventListener("abort", () => {
48
+ watcher.unref()
49
+ controller.close()
50
+ })
51
+ }
52
+ })
53
53
 
54
54
  return new Response(stream, {
55
55
  headers: {
56
- 'Content-Type': 'text/event-stream',
57
- 'Cache-Control': 'no-cache',
58
- 'Connection': 'keep-alive',
59
- },
60
- });
61
- }
56
+ "Content-Type": "text/event-stream",
57
+ "Cache-Control": "no-cache",
58
+ Connection: "keep-alive"
59
+ }
60
+ })
61
+ }
@@ -1,32 +1,32 @@
1
- import { NextRequest } from 'next/server';
2
- import { readFileSync, existsSync } from 'fs';
3
- import { LogsApiResponse, LogsApiError } from '@/types';
1
+ import { existsSync, readFileSync } from "fs"
2
+ import type { NextRequest } from "next/server"
3
+ import type { LogsApiError, LogsApiResponse } from "@/types"
4
4
 
5
5
  export async function GET(request: NextRequest): Promise<Response> {
6
6
  try {
7
- const { searchParams } = new URL(request.url);
8
- const lines = parseInt(searchParams.get('lines') || '50');
9
- const logPath = searchParams.get('logPath') || process.env.LOG_FILE_PATH || './ai-dev-tools/consolidated.log';
10
-
7
+ const { searchParams } = new URL(request.url)
8
+ const lines = parseInt(searchParams.get("lines") || "50", 10)
9
+ const logPath = searchParams.get("logPath") || process.env.LOG_FILE_PATH || "./ai-dev-tools/consolidated.log"
10
+
11
11
  if (!existsSync(logPath)) {
12
- const errorResponse: LogsApiError = { error: 'Log file not found' };
13
- return Response.json(errorResponse, { status: 404 });
12
+ const errorResponse: LogsApiError = { error: "Log file not found" }
13
+ return Response.json(errorResponse, { status: 404 })
14
14
  }
15
-
16
- const logContent = readFileSync(logPath, 'utf-8');
17
- const allLines = logContent.split('\n').filter(line => line.trim());
18
- const tailLines = allLines.slice(-lines);
19
-
15
+
16
+ const logContent = readFileSync(logPath, "utf-8")
17
+ const allLines = logContent.split("\n").filter((line) => line.trim())
18
+ const tailLines = allLines.slice(-lines)
19
+
20
20
  const response: LogsApiResponse = {
21
- logs: tailLines.join('\n'),
21
+ logs: tailLines.join("\n"),
22
22
  total: allLines.length
23
- };
24
-
25
- return Response.json(response);
23
+ }
24
+
25
+ return Response.json(response)
26
26
  } catch (error) {
27
27
  const errorResponse: LogsApiError = {
28
- error: error instanceof Error ? error.message : 'Unknown error'
29
- };
30
- return Response.json(errorResponse, { status: 500 });
28
+ error: error instanceof Error ? error.message : "Unknown error"
29
+ }
30
+ return Response.json(errorResponse, { status: 500 })
31
31
  }
32
- }
32
+ }