import dotenv from 'dotenv'; dotenv.config(); import WorkflowOrchestrator from './workflows/WorkflowOrchestrator'; import SessionManager from './rdrama/session/SessionManager'; import { CommentFetcher } from './rdrama/services/CommentFetcher'; import { CommentParser } from './rdrama/services/CommentParser'; // Import other necessary services or configurations async function startApplication() { // Initialize SessionManager or other global configurations const sessionManager = SessionManager.getInstance(); if (!process.env.RDRAMA_API_KEY) { throw new Error('RDRAMA_API_KEY is undefined. Please set this environment variable.'); } sessionManager.setAuthorizationToken(process.env.RDRAMA_API_KEY); // Initialize services with any required dependencies const commentFetcher = new CommentFetcher(); const commentParser = new CommentParser(); // Initialize and start your workflow const workflowOrchestrator = new WorkflowOrchestrator(commentFetcher, commentParser); await workflowOrchestrator.executeWorkflow(); } startApplication() .then(() => console.log('Application started successfully.')) .catch((error) => console.error('Application failed to start:', error));