 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>
		
			
				
	
	
		
			42 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import { mix } from '../../utils/mix.mjs';
 | |
| 
 | |
| function calcLength(axis) {
 | |
|     return axis.max - axis.min;
 | |
| }
 | |
| function isNear(value, target = 0, maxDistance = 0.01) {
 | |
|     return Math.abs(value - target) <= maxDistance;
 | |
| }
 | |
| function calcAxisDelta(delta, source, target, origin = 0.5) {
 | |
|     delta.origin = origin;
 | |
|     delta.originPoint = mix(source.min, source.max, delta.origin);
 | |
|     delta.scale = calcLength(target) / calcLength(source);
 | |
|     if (isNear(delta.scale, 1, 0.0001) || isNaN(delta.scale))
 | |
|         delta.scale = 1;
 | |
|     delta.translate =
 | |
|         mix(target.min, target.max, delta.origin) - delta.originPoint;
 | |
|     if (isNear(delta.translate) || isNaN(delta.translate))
 | |
|         delta.translate = 0;
 | |
| }
 | |
| function calcBoxDelta(delta, source, target, origin) {
 | |
|     calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);
 | |
|     calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);
 | |
| }
 | |
| function calcRelativeAxis(target, relative, parent) {
 | |
|     target.min = parent.min + relative.min;
 | |
|     target.max = target.min + calcLength(relative);
 | |
| }
 | |
| function calcRelativeBox(target, relative, parent) {
 | |
|     calcRelativeAxis(target.x, relative.x, parent.x);
 | |
|     calcRelativeAxis(target.y, relative.y, parent.y);
 | |
| }
 | |
| function calcRelativeAxisPosition(target, layout, parent) {
 | |
|     target.min = layout.min - parent.min;
 | |
|     target.max = target.min + calcLength(layout);
 | |
| }
 | |
| function calcRelativePosition(target, layout, parent) {
 | |
|     calcRelativeAxisPosition(target.x, layout.x, parent.x);
 | |
|     calcRelativeAxisPosition(target.y, layout.y, parent.y);
 | |
| }
 | |
| 
 | |
| export { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear };
 |