 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>
		
			
				
	
	
		
			64 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			64 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import compareAsc from "../compareAsc/index.js";
 | |
| import add from "../add/index.js";
 | |
| import differenceInDays from "../differenceInDays/index.js";
 | |
| import differenceInHours from "../differenceInHours/index.js";
 | |
| import differenceInMinutes from "../differenceInMinutes/index.js";
 | |
| import differenceInMonths from "../differenceInMonths/index.js";
 | |
| import differenceInSeconds from "../differenceInSeconds/index.js";
 | |
| import differenceInYears from "../differenceInYears/index.js";
 | |
| import toDate from "../toDate/index.js";
 | |
| import requiredArgs from "../_lib/requiredArgs/index.js";
 | |
| /**
 | |
|  * @name intervalToDuration
 | |
|  * @category Common Helpers
 | |
|  * @summary Convert interval to duration
 | |
|  *
 | |
|  * @description
 | |
|  * Convert a interval object to a duration object.
 | |
|  *
 | |
|  * @param {Interval} interval - the interval to convert to duration
 | |
|  *
 | |
|  * @returns {Duration} The duration Object
 | |
|  * @throws {TypeError} Requires 2 arguments
 | |
|  * @throws {RangeError} `start` must not be Invalid Date
 | |
|  * @throws {RangeError} `end` must not be Invalid Date
 | |
|  *
 | |
|  * @example
 | |
|  * // Get the duration between January 15, 1929 and April 4, 1968.
 | |
|  * intervalToDuration({
 | |
|  *   start: new Date(1929, 0, 15, 12, 0, 0),
 | |
|  *   end: new Date(1968, 3, 4, 19, 5, 0)
 | |
|  * })
 | |
|  * // => { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 }
 | |
|  */
 | |
| export default function intervalToDuration(interval) {
 | |
|   requiredArgs(1, arguments);
 | |
|   var start = toDate(interval.start);
 | |
|   var end = toDate(interval.end);
 | |
|   if (isNaN(start.getTime())) throw new RangeError('Start Date is invalid');
 | |
|   if (isNaN(end.getTime())) throw new RangeError('End Date is invalid');
 | |
|   var duration = {};
 | |
|   duration.years = Math.abs(differenceInYears(end, start));
 | |
|   var sign = compareAsc(end, start);
 | |
|   var remainingMonths = add(start, {
 | |
|     years: sign * duration.years
 | |
|   });
 | |
|   duration.months = Math.abs(differenceInMonths(end, remainingMonths));
 | |
|   var remainingDays = add(remainingMonths, {
 | |
|     months: sign * duration.months
 | |
|   });
 | |
|   duration.days = Math.abs(differenceInDays(end, remainingDays));
 | |
|   var remainingHours = add(remainingDays, {
 | |
|     days: sign * duration.days
 | |
|   });
 | |
|   duration.hours = Math.abs(differenceInHours(end, remainingHours));
 | |
|   var remainingMinutes = add(remainingHours, {
 | |
|     hours: sign * duration.hours
 | |
|   });
 | |
|   duration.minutes = Math.abs(differenceInMinutes(end, remainingMinutes));
 | |
|   var remainingSeconds = add(remainingMinutes, {
 | |
|     minutes: sign * duration.minutes
 | |
|   });
 | |
|   duration.seconds = Math.abs(differenceInSeconds(end, remainingSeconds));
 | |
|   return duration;
 | |
| } |