mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 06:42:03 +00:00
This commit introduces significant updates to the cursor model handling and auto mode features. The cursor model IDs have been standardized to a canonical format, ensuring backward compatibility while migrating legacy IDs. New endpoints for starting and stopping the auto mode loop have been added, allowing for better control over project-specific auto mode operations. Key changes: - Updated cursor model IDs to use the 'cursor-' prefix for consistency. - Added new API endpoints: `/start` and `/stop` for managing auto mode. - Enhanced the status endpoint to provide detailed project-specific auto mode information. - Improved error handling and logging throughout the auto mode service. - Migrated legacy model IDs to their canonical counterparts in various components. This update aims to streamline the user experience and ensure a smooth transition for existing users while providing new functionalities.
81 lines
2.9 KiB
TypeScript
81 lines
2.9 KiB
TypeScript
/**
|
|
* Auto Mode routes - HTTP API for autonomous feature implementation
|
|
*
|
|
* Uses the AutoModeService for real feature execution with Claude Agent SDK
|
|
*/
|
|
|
|
import { Router } from 'express';
|
|
import type { AutoModeService } from '../../services/auto-mode-service.js';
|
|
import { validatePathParams } from '../../middleware/validate-paths.js';
|
|
import { createStopFeatureHandler } from './routes/stop-feature.js';
|
|
import { createStatusHandler } from './routes/status.js';
|
|
import { createRunFeatureHandler } from './routes/run-feature.js';
|
|
import { createStartHandler } from './routes/start.js';
|
|
import { createStopHandler } from './routes/stop.js';
|
|
import { createVerifyFeatureHandler } from './routes/verify-feature.js';
|
|
import { createResumeFeatureHandler } from './routes/resume-feature.js';
|
|
import { createContextExistsHandler } from './routes/context-exists.js';
|
|
import { createAnalyzeProjectHandler } from './routes/analyze-project.js';
|
|
import { createFollowUpFeatureHandler } from './routes/follow-up-feature.js';
|
|
import { createCommitFeatureHandler } from './routes/commit-feature.js';
|
|
import { createApprovePlanHandler } from './routes/approve-plan.js';
|
|
import { createResumeInterruptedHandler } from './routes/resume-interrupted.js';
|
|
|
|
export function createAutoModeRoutes(autoModeService: AutoModeService): Router {
|
|
const router = Router();
|
|
|
|
// Auto loop control routes
|
|
router.post('/start', validatePathParams('projectPath'), createStartHandler(autoModeService));
|
|
router.post('/stop', validatePathParams('projectPath'), createStopHandler(autoModeService));
|
|
|
|
router.post('/stop-feature', createStopFeatureHandler(autoModeService));
|
|
router.post('/status', validatePathParams('projectPath?'), createStatusHandler(autoModeService));
|
|
router.post(
|
|
'/run-feature',
|
|
validatePathParams('projectPath'),
|
|
createRunFeatureHandler(autoModeService)
|
|
);
|
|
router.post(
|
|
'/verify-feature',
|
|
validatePathParams('projectPath'),
|
|
createVerifyFeatureHandler(autoModeService)
|
|
);
|
|
router.post(
|
|
'/resume-feature',
|
|
validatePathParams('projectPath'),
|
|
createResumeFeatureHandler(autoModeService)
|
|
);
|
|
router.post(
|
|
'/context-exists',
|
|
validatePathParams('projectPath'),
|
|
createContextExistsHandler(autoModeService)
|
|
);
|
|
router.post(
|
|
'/analyze-project',
|
|
validatePathParams('projectPath'),
|
|
createAnalyzeProjectHandler(autoModeService)
|
|
);
|
|
router.post(
|
|
'/follow-up-feature',
|
|
validatePathParams('projectPath', 'imagePaths[]'),
|
|
createFollowUpFeatureHandler(autoModeService)
|
|
);
|
|
router.post(
|
|
'/commit-feature',
|
|
validatePathParams('projectPath', 'worktreePath?'),
|
|
createCommitFeatureHandler(autoModeService)
|
|
);
|
|
router.post(
|
|
'/approve-plan',
|
|
validatePathParams('projectPath'),
|
|
createApprovePlanHandler(autoModeService)
|
|
);
|
|
router.post(
|
|
'/resume-interrupted',
|
|
validatePathParams('projectPath'),
|
|
createResumeInterruptedHandler(autoModeService)
|
|
);
|
|
|
|
return router;
|
|
}
|