dev3000 0.0.48 → 0.0.49

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,74 @@
1
+ import { NextRequest } from 'next/server';
2
+ import { appendFileSync, mkdirSync, existsSync } from 'fs';
3
+ import { dirname } from 'path';
4
+
5
+ interface LogEntry {
6
+ entry: string;
7
+ source?: string;
8
+ }
9
+
10
+ export async function POST(request: NextRequest): Promise<Response> {
11
+ try {
12
+ const body = await request.json();
13
+ const { entry, source }: LogEntry = body;
14
+
15
+ if (!entry) {
16
+ return Response.json({ error: 'Log entry is required' }, {
17
+ status: 400,
18
+ headers: {
19
+ 'Access-Control-Allow-Origin': '*',
20
+ 'Access-Control-Allow-Methods': 'POST, OPTIONS',
21
+ 'Access-Control-Allow-Headers': 'Content-Type',
22
+ }
23
+ });
24
+ }
25
+
26
+ const logPath = process.env.LOG_FILE_PATH || './ai-dev-tools/consolidated.log';
27
+
28
+ // Ensure directory exists
29
+ const logDir = dirname(logPath);
30
+ if (!existsSync(logDir)) {
31
+ mkdirSync(logDir, { recursive: true });
32
+ }
33
+
34
+ // Append the log entry
35
+ const logLine = `${entry}\n`;
36
+ appendFileSync(logPath, logLine, 'utf-8');
37
+
38
+ return Response.json({
39
+ success: true,
40
+ message: 'Log entry appended',
41
+ source: source || 'unknown'
42
+ }, {
43
+ headers: {
44
+ 'Access-Control-Allow-Origin': '*',
45
+ 'Access-Control-Allow-Methods': 'POST, OPTIONS',
46
+ 'Access-Control-Allow-Headers': 'Content-Type',
47
+ }
48
+ });
49
+
50
+ } catch (error) {
51
+ console.error('Failed to append log:', error);
52
+ return Response.json({
53
+ error: error instanceof Error ? error.message : 'Unknown error'
54
+ }, {
55
+ status: 500,
56
+ headers: {
57
+ 'Access-Control-Allow-Origin': '*',
58
+ 'Access-Control-Allow-Methods': 'POST, OPTIONS',
59
+ 'Access-Control-Allow-Headers': 'Content-Type',
60
+ }
61
+ });
62
+ }
63
+ }
64
+
65
+ export async function OPTIONS(): Promise<Response> {
66
+ return new Response(null, {
67
+ status: 200,
68
+ headers: {
69
+ 'Access-Control-Allow-Origin': '*',
70
+ 'Access-Control-Allow-Methods': 'POST, OPTIONS',
71
+ 'Access-Control-Allow-Headers': 'Content-Type',
72
+ },
73
+ });
74
+ }
@@ -5,7 +5,7 @@ import { join, dirname, basename } from 'path';
5
5
  import { parseLogEntries } from './utils';
6
6
 
7
7
  interface PageProps {
8
- searchParams: { file?: string; mode?: 'head' | 'tail' };
8
+ searchParams: Promise<{ file?: string; mode?: 'head' | 'tail' }>;
9
9
  }
10
10
 
11
11
  async function getLogFiles() {
@@ -82,17 +82,20 @@ async function getLogData(logPath: string, mode: 'head' | 'tail' = 'tail', lines
82
82
  export default async function LogsPage({ searchParams }: PageProps) {
83
83
  const version = process.env.DEV3000_VERSION || '0.0.0';
84
84
 
85
+ // Await searchParams (Next.js 15 requirement)
86
+ const params = await searchParams;
87
+
85
88
  // Get available log files
86
89
  const { files, currentFile } = await getLogFiles();
87
90
 
88
91
  // If no file specified and we have files, redirect to latest
89
- if (!searchParams.file && files.length > 0) {
92
+ if (!params.file && files.length > 0) {
90
93
  const latestFile = files[0].name;
91
94
  redirect(`/logs?file=${encodeURIComponent(latestFile)}`);
92
95
  }
93
96
 
94
97
  // If no file specified and no files available, render with empty data
95
- if (!searchParams.file) {
98
+ if (!params.file) {
96
99
  return (
97
100
  <LogsClient
98
101
  version={version}
@@ -107,9 +110,9 @@ export default async function LogsPage({ searchParams }: PageProps) {
107
110
  }
108
111
 
109
112
  // Find the selected log file
110
- const selectedFile = files.find(f => f.name === searchParams.file);
113
+ const selectedFile = files.find(f => f.name === params.file);
111
114
  const logPath = selectedFile?.path || currentFile;
112
- const mode = (searchParams.mode as 'head' | 'tail') || 'tail';
115
+ const mode = (params.mode as 'head' | 'tail') || 'tail';
113
116
 
114
117
  // Get initial log data server-side
115
118
  const logData = await getLogData(logPath, mode);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dev3000",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "AI-powered development tools with browser monitoring and MCP server integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -63,7 +63,7 @@
63
63
  "format": "biome format --write .",
64
64
  "test": "vitest run",
65
65
  "test-postinstall": "tsx scripts/test-postinstall.ts",
66
- "postinstall": "cd mcp-server && pnpm install --frozen-lockfile --silent --no-optional || true",
66
+ "postinstall": "echo 'Starting postinstall...' && cd mcp-server && echo 'Installing mcp-server dependencies...' && timeout 30s pnpm install --no-frozen-lockfile --ignore-scripts && echo 'Postinstall completed successfully!' || echo 'Postinstall failed or timed out, but continuing...'",
67
67
  "release": "./scripts/release.sh",
68
68
  "test-canary": "./scripts/test-canary.sh"
69
69
  }