 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>
		
			
				
	
	
		
			89 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			89 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| 
 | |
| var identity = require('../nodes/identity.js');
 | |
| var Scalar = require('../nodes/Scalar.js');
 | |
| var resolveBlockScalar = require('./resolve-block-scalar.js');
 | |
| var resolveFlowScalar = require('./resolve-flow-scalar.js');
 | |
| 
 | |
| function composeScalar(ctx, token, tagToken, onError) {
 | |
|     const { value, type, comment, range } = token.type === 'block-scalar'
 | |
|         ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError)
 | |
|         : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError);
 | |
|     const tagName = tagToken
 | |
|         ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
 | |
|         : null;
 | |
|     let tag;
 | |
|     if (ctx.options.stringKeys && ctx.atKey) {
 | |
|         tag = ctx.schema[identity.SCALAR];
 | |
|     }
 | |
|     else if (tagName)
 | |
|         tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
 | |
|     else if (token.type === 'scalar')
 | |
|         tag = findScalarTagByTest(ctx, value, token, onError);
 | |
|     else
 | |
|         tag = ctx.schema[identity.SCALAR];
 | |
|     let scalar;
 | |
|     try {
 | |
|         const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
 | |
|         scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res);
 | |
|     }
 | |
|     catch (error) {
 | |
|         const msg = error instanceof Error ? error.message : String(error);
 | |
|         onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg);
 | |
|         scalar = new Scalar.Scalar(value);
 | |
|     }
 | |
|     scalar.range = range;
 | |
|     scalar.source = value;
 | |
|     if (type)
 | |
|         scalar.type = type;
 | |
|     if (tagName)
 | |
|         scalar.tag = tagName;
 | |
|     if (tag.format)
 | |
|         scalar.format = tag.format;
 | |
|     if (comment)
 | |
|         scalar.comment = comment;
 | |
|     return scalar;
 | |
| }
 | |
| function findScalarTagByName(schema, value, tagName, tagToken, onError) {
 | |
|     if (tagName === '!')
 | |
|         return schema[identity.SCALAR]; // non-specific tag
 | |
|     const matchWithTest = [];
 | |
|     for (const tag of schema.tags) {
 | |
|         if (!tag.collection && tag.tag === tagName) {
 | |
|             if (tag.default && tag.test)
 | |
|                 matchWithTest.push(tag);
 | |
|             else
 | |
|                 return tag;
 | |
|         }
 | |
|     }
 | |
|     for (const tag of matchWithTest)
 | |
|         if (tag.test?.test(value))
 | |
|             return tag;
 | |
|     const kt = schema.knownTags[tagName];
 | |
|     if (kt && !kt.collection) {
 | |
|         // Ensure that the known tag is available for stringifying,
 | |
|         // but does not get used by default.
 | |
|         schema.tags.push(Object.assign({}, kt, { default: false, test: undefined }));
 | |
|         return kt;
 | |
|     }
 | |
|     onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
 | |
|     return schema[identity.SCALAR];
 | |
| }
 | |
| function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
 | |
|     const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
 | |
|         tag.test?.test(value)) || schema[identity.SCALAR];
 | |
|     if (schema.compat) {
 | |
|         const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
 | |
|             schema[identity.SCALAR];
 | |
|         if (tag.tag !== compat.tag) {
 | |
|             const ts = directives.tagString(tag.tag);
 | |
|             const cs = directives.tagString(compat.tag);
 | |
|             const msg = `Value may be parsed as either ${ts} or ${cs}`;
 | |
|             onError(token, 'TAG_RESOLVE_FAILED', msg, true);
 | |
|         }
 | |
|     }
 | |
|     return tag;
 | |
| }
 | |
| 
 | |
| exports.composeScalar = composeScalar;
 |