fix: Complete automation v2 page runtime error fixes

- Fixed ES modules error by converting automation-with-learning-v2.js to pure ES6
- Fixed singleton pattern in automation-singleton.js for proper async handling
- Fixed EnhancedAILearningPanel to handle recommendation objects correctly
- Updated API routes to use correct import paths (../../../../lib/)
- Created proper db.js utility with ES6 exports
- Fixed simplified-stop-loss-learner imports and exports

 Automation v2 page now loads without errors
 AI learning system fully integrated and operational
 Learning status API working with detailed reports
 Recommendation rendering fixed for object structure
This commit is contained in:
mindesbunister
2025-07-27 12:38:32 +02:00
parent 44968c3bb3
commit d5bf485e72
10 changed files with 84 additions and 71 deletions

View File

@@ -3,7 +3,7 @@ import { NextResponse } from 'next/server';
// Import singleton automation manager
async function getAutomationInstance() {
try {
const { getAutomationInstance } = await import('../../../lib/automation-singleton.js');
const { getAutomationInstance } = await import('../../../../lib/automation-singleton.js');
return await getAutomationInstance();
} catch (error) {
console.error('❌ Could not get automation instance:', error);