 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>
		
			
				
	
	
		
			106 lines
		
	
	
		
			3.9 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			106 lines
		
	
	
		
			3.9 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| 
 | |
| var Alias = require('../nodes/Alias.js');
 | |
| var identity = require('../nodes/identity.js');
 | |
| var composeCollection = require('./compose-collection.js');
 | |
| var composeScalar = require('./compose-scalar.js');
 | |
| var resolveEnd = require('./resolve-end.js');
 | |
| var utilEmptyScalarPosition = require('./util-empty-scalar-position.js');
 | |
| 
 | |
| const CN = { composeNode, composeEmptyNode };
 | |
| function composeNode(ctx, token, props, onError) {
 | |
|     const atKey = ctx.atKey;
 | |
|     const { spaceBefore, comment, anchor, tag } = props;
 | |
|     let node;
 | |
|     let isSrcToken = true;
 | |
|     switch (token.type) {
 | |
|         case 'alias':
 | |
|             node = composeAlias(ctx, token, onError);
 | |
|             if (anchor || tag)
 | |
|                 onError(token, 'ALIAS_PROPS', 'An alias node must not specify any properties');
 | |
|             break;
 | |
|         case 'scalar':
 | |
|         case 'single-quoted-scalar':
 | |
|         case 'double-quoted-scalar':
 | |
|         case 'block-scalar':
 | |
|             node = composeScalar.composeScalar(ctx, token, tag, onError);
 | |
|             if (anchor)
 | |
|                 node.anchor = anchor.source.substring(1);
 | |
|             break;
 | |
|         case 'block-map':
 | |
|         case 'block-seq':
 | |
|         case 'flow-collection':
 | |
|             node = composeCollection.composeCollection(CN, ctx, token, props, onError);
 | |
|             if (anchor)
 | |
|                 node.anchor = anchor.source.substring(1);
 | |
|             break;
 | |
|         default: {
 | |
|             const message = token.type === 'error'
 | |
|                 ? token.message
 | |
|                 : `Unsupported token (type: ${token.type})`;
 | |
|             onError(token, 'UNEXPECTED_TOKEN', message);
 | |
|             node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError);
 | |
|             isSrcToken = false;
 | |
|         }
 | |
|     }
 | |
|     if (anchor && node.anchor === '')
 | |
|         onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
 | |
|     if (atKey &&
 | |
|         ctx.options.stringKeys &&
 | |
|         (!identity.isScalar(node) ||
 | |
|             typeof node.value !== 'string' ||
 | |
|             (node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
 | |
|         const msg = 'With stringKeys, all keys must be strings';
 | |
|         onError(tag ?? token, 'NON_STRING_KEY', msg);
 | |
|     }
 | |
|     if (spaceBefore)
 | |
|         node.spaceBefore = true;
 | |
|     if (comment) {
 | |
|         if (token.type === 'scalar' && token.source === '')
 | |
|             node.comment = comment;
 | |
|         else
 | |
|             node.commentBefore = comment;
 | |
|     }
 | |
|     // @ts-expect-error Type checking misses meaning of isSrcToken
 | |
|     if (ctx.options.keepSourceTokens && isSrcToken)
 | |
|         node.srcToken = token;
 | |
|     return node;
 | |
| }
 | |
| function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
 | |
|     const token = {
 | |
|         type: 'scalar',
 | |
|         offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos),
 | |
|         indent: -1,
 | |
|         source: ''
 | |
|     };
 | |
|     const node = composeScalar.composeScalar(ctx, token, tag, onError);
 | |
|     if (anchor) {
 | |
|         node.anchor = anchor.source.substring(1);
 | |
|         if (node.anchor === '')
 | |
|             onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
 | |
|     }
 | |
|     if (spaceBefore)
 | |
|         node.spaceBefore = true;
 | |
|     if (comment) {
 | |
|         node.comment = comment;
 | |
|         node.range[2] = end;
 | |
|     }
 | |
|     return node;
 | |
| }
 | |
| function composeAlias({ options }, { offset, source, end }, onError) {
 | |
|     const alias = new Alias.Alias(source.substring(1));
 | |
|     if (alias.source === '')
 | |
|         onError(offset, 'BAD_ALIAS', 'Alias cannot be an empty string');
 | |
|     if (alias.source.endsWith(':'))
 | |
|         onError(offset + source.length - 1, 'BAD_ALIAS', 'Alias ending in : is ambiguous', true);
 | |
|     const valueEnd = offset + source.length;
 | |
|     const re = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError);
 | |
|     alias.range = [offset, valueEnd, re.offset];
 | |
|     if (re.comment)
 | |
|         alias.comment = re.comment;
 | |
|     return alias;
 | |
| }
 | |
| 
 | |
| exports.composeEmptyNode = composeEmptyNode;
 | |
| exports.composeNode = composeNode;
 |