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>
		
			
				
	
	
		
			105 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			105 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| "use strict";
 | |
| Object.defineProperty(exports, "__esModule", { value: true });
 | |
| exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
 | |
| const fsStat = require("@nodelib/fs.stat");
 | |
| const rpl = require("run-parallel");
 | |
| const constants_1 = require("../constants");
 | |
| const utils = require("../utils");
 | |
| const common = require("./common");
 | |
| function read(directory, settings, callback) {
 | |
|     if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
 | |
|         readdirWithFileTypes(directory, settings, callback);
 | |
|         return;
 | |
|     }
 | |
|     readdir(directory, settings, callback);
 | |
| }
 | |
| exports.read = read;
 | |
| function readdirWithFileTypes(directory, settings, callback) {
 | |
|     settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
 | |
|         if (readdirError !== null) {
 | |
|             callFailureCallback(callback, readdirError);
 | |
|             return;
 | |
|         }
 | |
|         const entries = dirents.map((dirent) => ({
 | |
|             dirent,
 | |
|             name: dirent.name,
 | |
|             path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
 | |
|         }));
 | |
|         if (!settings.followSymbolicLinks) {
 | |
|             callSuccessCallback(callback, entries);
 | |
|             return;
 | |
|         }
 | |
|         const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
 | |
|         rpl(tasks, (rplError, rplEntries) => {
 | |
|             if (rplError !== null) {
 | |
|                 callFailureCallback(callback, rplError);
 | |
|                 return;
 | |
|             }
 | |
|             callSuccessCallback(callback, rplEntries);
 | |
|         });
 | |
|     });
 | |
| }
 | |
| exports.readdirWithFileTypes = readdirWithFileTypes;
 | |
| function makeRplTaskEntry(entry, settings) {
 | |
|     return (done) => {
 | |
|         if (!entry.dirent.isSymbolicLink()) {
 | |
|             done(null, entry);
 | |
|             return;
 | |
|         }
 | |
|         settings.fs.stat(entry.path, (statError, stats) => {
 | |
|             if (statError !== null) {
 | |
|                 if (settings.throwErrorOnBrokenSymbolicLink) {
 | |
|                     done(statError);
 | |
|                     return;
 | |
|                 }
 | |
|                 done(null, entry);
 | |
|                 return;
 | |
|             }
 | |
|             entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
 | |
|             done(null, entry);
 | |
|         });
 | |
|     };
 | |
| }
 | |
| function readdir(directory, settings, callback) {
 | |
|     settings.fs.readdir(directory, (readdirError, names) => {
 | |
|         if (readdirError !== null) {
 | |
|             callFailureCallback(callback, readdirError);
 | |
|             return;
 | |
|         }
 | |
|         const tasks = names.map((name) => {
 | |
|             const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
 | |
|             return (done) => {
 | |
|                 fsStat.stat(path, settings.fsStatSettings, (error, stats) => {
 | |
|                     if (error !== null) {
 | |
|                         done(error);
 | |
|                         return;
 | |
|                     }
 | |
|                     const entry = {
 | |
|                         name,
 | |
|                         path,
 | |
|                         dirent: utils.fs.createDirentFromStats(name, stats)
 | |
|                     };
 | |
|                     if (settings.stats) {
 | |
|                         entry.stats = stats;
 | |
|                     }
 | |
|                     done(null, entry);
 | |
|                 });
 | |
|             };
 | |
|         });
 | |
|         rpl(tasks, (rplError, entries) => {
 | |
|             if (rplError !== null) {
 | |
|                 callFailureCallback(callback, rplError);
 | |
|                 return;
 | |
|             }
 | |
|             callSuccessCallback(callback, entries);
 | |
|         });
 | |
|     });
 | |
| }
 | |
| exports.readdir = readdir;
 | |
| function callFailureCallback(callback, error) {
 | |
|     callback(error);
 | |
| }
 | |
| function callSuccessCallback(callback, result) {
 | |
|     callback(null, result);
 | |
| }
 |