 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>
		
			
				
	
	
		
			63 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| module.exports = balanced;
 | |
| function balanced(a, b, str) {
 | |
|   if (a instanceof RegExp) a = maybeMatch(a, str);
 | |
|   if (b instanceof RegExp) b = maybeMatch(b, str);
 | |
| 
 | |
|   var r = range(a, b, str);
 | |
| 
 | |
|   return r && {
 | |
|     start: r[0],
 | |
|     end: r[1],
 | |
|     pre: str.slice(0, r[0]),
 | |
|     body: str.slice(r[0] + a.length, r[1]),
 | |
|     post: str.slice(r[1] + b.length)
 | |
|   };
 | |
| }
 | |
| 
 | |
| function maybeMatch(reg, str) {
 | |
|   var m = str.match(reg);
 | |
|   return m ? m[0] : null;
 | |
| }
 | |
| 
 | |
| balanced.range = range;
 | |
| function range(a, b, str) {
 | |
|   var begs, beg, left, right, result;
 | |
|   var ai = str.indexOf(a);
 | |
|   var bi = str.indexOf(b, ai + 1);
 | |
|   var i = ai;
 | |
| 
 | |
|   if (ai >= 0 && bi > 0) {
 | |
|     if(a===b) {
 | |
|       return [ai, bi];
 | |
|     }
 | |
|     begs = [];
 | |
|     left = str.length;
 | |
| 
 | |
|     while (i >= 0 && !result) {
 | |
|       if (i == ai) {
 | |
|         begs.push(i);
 | |
|         ai = str.indexOf(a, i + 1);
 | |
|       } else if (begs.length == 1) {
 | |
|         result = [ begs.pop(), bi ];
 | |
|       } else {
 | |
|         beg = begs.pop();
 | |
|         if (beg < left) {
 | |
|           left = beg;
 | |
|           right = bi;
 | |
|         }
 | |
| 
 | |
|         bi = str.indexOf(b, i + 1);
 | |
|       }
 | |
| 
 | |
|       i = ai < bi && ai >= 0 ? ai : bi;
 | |
|     }
 | |
| 
 | |
|     if (begs.length) {
 | |
|       result = [ left, right ];
 | |
|     }
 | |
|   }
 | |
| 
 | |
|   return result;
 | |
| }
 |