 85bf1341f3
			
		
	
	85bf1341f3
	
	
	
		
			
			Frontend Enhancements: - Complete React TypeScript frontend with modern UI components - Distributed workflows management interface with real-time updates - Socket.IO integration for live agent status monitoring - Agent management dashboard with cluster visualization - Project management interface with metrics and task tracking - Responsive design with proper error handling and loading states Backend Infrastructure: - Distributed coordinator for multi-agent workflow orchestration - Cluster management API with comprehensive agent operations - Enhanced database models for agents and projects - Project service for filesystem-based project discovery - Performance monitoring and metrics collection - Comprehensive API documentation and error handling Documentation: - Complete distributed development guide (README_DISTRIBUTED.md) - Comprehensive development report with architecture insights - System configuration templates and deployment guides The platform now provides a complete web interface for managing the distributed AI cluster with real-time monitoring, workflow orchestration, and agent coordination capabilities. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
		
			
				
	
	
		
			61 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			61 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import { createRenderStep } from './render-step.mjs';
 | |
| 
 | |
| const stepsOrder = [
 | |
|     "prepare",
 | |
|     "read",
 | |
|     "update",
 | |
|     "preRender",
 | |
|     "render",
 | |
|     "postRender",
 | |
| ];
 | |
| const maxElapsed = 40;
 | |
| function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
 | |
|     let runNextFrame = false;
 | |
|     let useDefaultElapsed = true;
 | |
|     const state = {
 | |
|         delta: 0,
 | |
|         timestamp: 0,
 | |
|         isProcessing: false,
 | |
|     };
 | |
|     const steps = stepsOrder.reduce((acc, key) => {
 | |
|         acc[key] = createRenderStep(() => (runNextFrame = true));
 | |
|         return acc;
 | |
|     }, {});
 | |
|     const processStep = (stepId) => steps[stepId].process(state);
 | |
|     const processBatch = () => {
 | |
|         const timestamp = performance.now();
 | |
|         runNextFrame = false;
 | |
|         state.delta = useDefaultElapsed
 | |
|             ? 1000 / 60
 | |
|             : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);
 | |
|         state.timestamp = timestamp;
 | |
|         state.isProcessing = true;
 | |
|         stepsOrder.forEach(processStep);
 | |
|         state.isProcessing = false;
 | |
|         if (runNextFrame && allowKeepAlive) {
 | |
|             useDefaultElapsed = false;
 | |
|             scheduleNextBatch(processBatch);
 | |
|         }
 | |
|     };
 | |
|     const wake = () => {
 | |
|         runNextFrame = true;
 | |
|         useDefaultElapsed = true;
 | |
|         if (!state.isProcessing) {
 | |
|             scheduleNextBatch(processBatch);
 | |
|         }
 | |
|     };
 | |
|     const schedule = stepsOrder.reduce((acc, key) => {
 | |
|         const step = steps[key];
 | |
|         acc[key] = (process, keepAlive = false, immediate = false) => {
 | |
|             if (!runNextFrame)
 | |
|                 wake();
 | |
|             return step.schedule(process, keepAlive, immediate);
 | |
|         };
 | |
|         return acc;
 | |
|     }, {});
 | |
|     const cancel = (process) => stepsOrder.forEach((key) => steps[key].cancel(process));
 | |
|     return { schedule, cancel, state, steps };
 | |
| }
 | |
| 
 | |
| export { createRenderBatcher, stepsOrder };
 |