 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>
		
			
				
	
	
		
			91 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			91 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| 
 | |
| var identity = require('../nodes/identity.js');
 | |
| var Scalar = require('../nodes/Scalar.js');
 | |
| var YAMLMap = require('../nodes/YAMLMap.js');
 | |
| var YAMLSeq = require('../nodes/YAMLSeq.js');
 | |
| var resolveBlockMap = require('./resolve-block-map.js');
 | |
| var resolveBlockSeq = require('./resolve-block-seq.js');
 | |
| var resolveFlowCollection = require('./resolve-flow-collection.js');
 | |
| 
 | |
| function resolveCollection(CN, ctx, token, onError, tagName, tag) {
 | |
|     const coll = token.type === 'block-map'
 | |
|         ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError, tag)
 | |
|         : token.type === 'block-seq'
 | |
|             ? resolveBlockSeq.resolveBlockSeq(CN, ctx, token, onError, tag)
 | |
|             : resolveFlowCollection.resolveFlowCollection(CN, ctx, token, onError, tag);
 | |
|     const Coll = coll.constructor;
 | |
|     // If we got a tagName matching the class, or the tag name is '!',
 | |
|     // then use the tagName from the node class used to create it.
 | |
|     if (tagName === '!' || tagName === Coll.tagName) {
 | |
|         coll.tag = Coll.tagName;
 | |
|         return coll;
 | |
|     }
 | |
|     if (tagName)
 | |
|         coll.tag = tagName;
 | |
|     return coll;
 | |
| }
 | |
| function composeCollection(CN, ctx, token, props, onError) {
 | |
|     const tagToken = props.tag;
 | |
|     const tagName = !tagToken
 | |
|         ? null
 | |
|         : ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));
 | |
|     if (token.type === 'block-seq') {
 | |
|         const { anchor, newlineAfterProp: nl } = props;
 | |
|         const lastProp = anchor && tagToken
 | |
|             ? anchor.offset > tagToken.offset
 | |
|                 ? anchor
 | |
|                 : tagToken
 | |
|             : (anchor ?? tagToken);
 | |
|         if (lastProp && (!nl || nl.offset < lastProp.offset)) {
 | |
|             const message = 'Missing newline after block sequence props';
 | |
|             onError(lastProp, 'MISSING_CHAR', message);
 | |
|         }
 | |
|     }
 | |
|     const expType = token.type === 'block-map'
 | |
|         ? 'map'
 | |
|         : token.type === 'block-seq'
 | |
|             ? 'seq'
 | |
|             : token.start.source === '{'
 | |
|                 ? 'map'
 | |
|                 : 'seq';
 | |
|     // shortcut: check if it's a generic YAMLMap or YAMLSeq
 | |
|     // before jumping into the custom tag logic.
 | |
|     if (!tagToken ||
 | |
|         !tagName ||
 | |
|         tagName === '!' ||
 | |
|         (tagName === YAMLMap.YAMLMap.tagName && expType === 'map') ||
 | |
|         (tagName === YAMLSeq.YAMLSeq.tagName && expType === 'seq')) {
 | |
|         return resolveCollection(CN, ctx, token, onError, tagName);
 | |
|     }
 | |
|     let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);
 | |
|     if (!tag) {
 | |
|         const kt = ctx.schema.knownTags[tagName];
 | |
|         if (kt && kt.collection === expType) {
 | |
|             ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
 | |
|             tag = kt;
 | |
|         }
 | |
|         else {
 | |
|             if (kt) {
 | |
|                 onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
 | |
|             }
 | |
|             else {
 | |
|                 onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
 | |
|             }
 | |
|             return resolveCollection(CN, ctx, token, onError, tagName);
 | |
|         }
 | |
|     }
 | |
|     const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
 | |
|     const res = tag.resolve?.(coll, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg), ctx.options) ?? coll;
 | |
|     const node = identity.isNode(res)
 | |
|         ? res
 | |
|         : new Scalar.Scalar(res);
 | |
|     node.range = coll.range;
 | |
|     node.tag = tagName;
 | |
|     if (tag?.format)
 | |
|         node.format = tag.format;
 | |
|     return node;
 | |
| }
 | |
| 
 | |
| exports.composeCollection = composeCollection;
 |