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>
69 lines
2.3 KiB
JavaScript
69 lines
2.3 KiB
JavaScript
import { useState, useEffect } from 'react';
|
|
import { useConstant } from '../../utils/use-constant.mjs';
|
|
import { getOrigin, checkTargetForNewValues } from '../../render/utils/setters.mjs';
|
|
import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';
|
|
import { createBox } from '../../projection/geometry/models.mjs';
|
|
import { VisualElement } from '../../render/VisualElement.mjs';
|
|
import { animateVisualElement } from '../interfaces/visual-element.mjs';
|
|
|
|
const createObject = () => ({});
|
|
class StateVisualElement extends VisualElement {
|
|
build() { }
|
|
measureInstanceViewportBox() {
|
|
return createBox();
|
|
}
|
|
resetTransform() { }
|
|
restoreTransform() { }
|
|
removeValueFromRenderState() { }
|
|
renderInstance() { }
|
|
scrapeMotionValuesFromProps() {
|
|
return createObject();
|
|
}
|
|
getBaseTargetFromProps() {
|
|
return undefined;
|
|
}
|
|
readValueFromInstance(_state, key, options) {
|
|
return options.initialState[key] || 0;
|
|
}
|
|
sortInstanceNodePosition() {
|
|
return 0;
|
|
}
|
|
makeTargetAnimatableFromInstance({ transition, transitionEnd, ...target }) {
|
|
const origin = getOrigin(target, transition || {}, this);
|
|
checkTargetForNewValues(this, target, origin);
|
|
return { transition, transitionEnd, ...target };
|
|
}
|
|
}
|
|
const useVisualState = makeUseVisualState({
|
|
scrapeMotionValuesFromProps: createObject,
|
|
createRenderState: createObject,
|
|
});
|
|
/**
|
|
* This is not an officially supported API and may be removed
|
|
* on any version.
|
|
*/
|
|
function useAnimatedState(initialState) {
|
|
const [animationState, setAnimationState] = useState(initialState);
|
|
const visualState = useVisualState({}, false);
|
|
const element = useConstant(() => {
|
|
return new StateVisualElement({ props: {}, visualState, presenceContext: null }, { initialState });
|
|
});
|
|
useEffect(() => {
|
|
element.mount({});
|
|
return () => element.unmount();
|
|
}, [element]);
|
|
useEffect(() => {
|
|
element.update({
|
|
onUpdate: (v) => {
|
|
setAnimationState({ ...v });
|
|
},
|
|
}, null);
|
|
}, [setAnimationState, element]);
|
|
const startAnimation = useConstant(() => (animationDefinition) => {
|
|
return animateVisualElement(element, animationDefinition);
|
|
});
|
|
return [animationState, startAnimation];
|
|
}
|
|
|
|
export { useAnimatedState };
|