mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-19 22:53:08 +00:00
- Delete the 2705-line auto-mode-service.ts monolith - Create AutoModeServiceCompat as compatibility layer for routes - Create GlobalAutoModeService for cross-project operations - Update all routes to use AutoModeServiceCompat type - Add SharedServices interface for state sharing across facades - Add getActiveProjects/getActiveWorktrees to AutoLoopCoordinator - Delete obsolete monolith test files 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 { AutoModeServiceCompat } from '../../../services/auto-mode/index.js';
|
|
import { createLogger } from '@automaker/utils';
|
|
import { getErrorMessage, logError } from '../common.js';
|
|
|
|
const logger = createLogger('AutoMode');
|
|
|
|
export function createAnalyzeProjectHandler(autoModeService: AutoModeServiceCompat) {
|
|
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) });
|
|
}
|
|
};
|
|
}
|