 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>
		
			
				
	
	
		
			82 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			82 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import { useContext } from 'react';
 | |
| import { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';
 | |
| import { PresenceContext } from '../../context/PresenceContext.mjs';
 | |
| import { resolveVariantFromProps } from '../../render/utils/resolve-variants.mjs';
 | |
| import { useConstant } from '../../utils/use-constant.mjs';
 | |
| import { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';
 | |
| import { MotionContext } from '../../context/MotionContext/index.mjs';
 | |
| import { isControllingVariants, isVariantNode } from '../../render/utils/is-controlling-variants.mjs';
 | |
| 
 | |
| function makeState({ scrapeMotionValuesFromProps, createRenderState, onMount, }, props, context, presenceContext) {
 | |
|     const state = {
 | |
|         latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),
 | |
|         renderState: createRenderState(),
 | |
|     };
 | |
|     if (onMount) {
 | |
|         state.mount = (instance) => onMount(props, instance, state);
 | |
|     }
 | |
|     return state;
 | |
| }
 | |
| const makeUseVisualState = (config) => (props, isStatic) => {
 | |
|     const context = useContext(MotionContext);
 | |
|     const presenceContext = useContext(PresenceContext);
 | |
|     const make = () => makeState(config, props, context, presenceContext);
 | |
|     return isStatic ? make() : useConstant(make);
 | |
| };
 | |
| function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
 | |
|     const values = {};
 | |
|     const motionValues = scrapeMotionValues(props, {});
 | |
|     for (const key in motionValues) {
 | |
|         values[key] = resolveMotionValue(motionValues[key]);
 | |
|     }
 | |
|     let { initial, animate } = props;
 | |
|     const isControllingVariants$1 = isControllingVariants(props);
 | |
|     const isVariantNode$1 = isVariantNode(props);
 | |
|     if (context &&
 | |
|         isVariantNode$1 &&
 | |
|         !isControllingVariants$1 &&
 | |
|         props.inherit !== false) {
 | |
|         if (initial === undefined)
 | |
|             initial = context.initial;
 | |
|         if (animate === undefined)
 | |
|             animate = context.animate;
 | |
|     }
 | |
|     let isInitialAnimationBlocked = presenceContext
 | |
|         ? presenceContext.initial === false
 | |
|         : false;
 | |
|     isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;
 | |
|     const variantToSet = isInitialAnimationBlocked ? animate : initial;
 | |
|     if (variantToSet &&
 | |
|         typeof variantToSet !== "boolean" &&
 | |
|         !isAnimationControls(variantToSet)) {
 | |
|         const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];
 | |
|         list.forEach((definition) => {
 | |
|             const resolved = resolveVariantFromProps(props, definition);
 | |
|             if (!resolved)
 | |
|                 return;
 | |
|             const { transitionEnd, transition, ...target } = resolved;
 | |
|             for (const key in target) {
 | |
|                 let valueTarget = target[key];
 | |
|                 if (Array.isArray(valueTarget)) {
 | |
|                     /**
 | |
|                      * Take final keyframe if the initial animation is blocked because
 | |
|                      * we want to initialise at the end of that blocked animation.
 | |
|                      */
 | |
|                     const index = isInitialAnimationBlocked
 | |
|                         ? valueTarget.length - 1
 | |
|                         : 0;
 | |
|                     valueTarget = valueTarget[index];
 | |
|                 }
 | |
|                 if (valueTarget !== null) {
 | |
|                     values[key] = valueTarget;
 | |
|                 }
 | |
|             }
 | |
|             for (const key in transitionEnd)
 | |
|                 values[key] = transitionEnd[key];
 | |
|         });
 | |
|     }
 | |
|     return values;
 | |
| }
 | |
| 
 | |
| export { makeUseVisualState };
 |