mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-03 08:53:36 +00:00
Resolves merge conflicts: - apps/server/src/routes/terminal/common.ts: Keep randomBytes import, use @automaker/utils for createLogger - apps/ui/eslint.config.mjs: Use main's explicit globals list with XMLHttpRequest and MediaQueryListEvent additions - apps/ui/src/components/views/terminal-view.tsx: Keep our terminal improvements (killAllSessions, beforeunload, better error handling) - apps/ui/src/config/terminal-themes.ts: Keep our search highlight colors for all themes - apps/ui/src/store/app-store.ts: Keep our terminal settings persistence improvements (merge function) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
/**
|
|
* POST /analyze-project endpoint - Analyze project
|
|
*/
|
|
|
|
import type { Request, Response } from 'express';
|
|
import type { AutoModeService } from '../../../services/auto-mode-service.js';
|
|
import { createLogger } from '@automaker/utils';
|
|
import { getErrorMessage, logError } from '../common.js';
|
|
|
|
const logger = createLogger('AutoMode');
|
|
|
|
export function createAnalyzeProjectHandler(autoModeService: AutoModeService) {
|
|
return async (req: Request, res: Response): Promise<void> => {
|
|
try {
|
|
const { projectPath } = req.body as { projectPath: string };
|
|
|
|
if (!projectPath) {
|
|
res.status(400).json({ success: false, error: 'projectPath is required' });
|
|
return;
|
|
}
|
|
|
|
// Start analysis in background
|
|
autoModeService.analyzeProject(projectPath).catch((error) => {
|
|
logger.error(`[AutoMode] Project analysis error:`, error);
|
|
});
|
|
|
|
res.json({ success: true, message: 'Project analysis started' });
|
|
} catch (error) {
|
|
logError(error, 'Analyze project failed');
|
|
res.status(500).json({ success: false, error: getErrorMessage(error) });
|
|
}
|
|
};
|
|
}
|