Add comprehensive frontend UI and distributed infrastructure

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>
This commit is contained in:
anthonyrawlins
2025-07-10 08:41:59 +10:00
parent fc0eec91ef
commit 85bf1341f3
28348 changed files with 2646896 additions and 69 deletions

View File

@@ -0,0 +1,85 @@
import { CSSProperties } from 'react';
type ToastType = 'success' | 'error' | 'loading' | 'blank' | 'custom';
type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
type Renderable = React.ReactElement | string | null;
interface IconTheme {
primary: string;
secondary: string;
}
type ValueFunction<TValue, TArg> = (arg: TArg) => TValue;
type ValueOrFunction<TValue, TArg> = TValue | ValueFunction<TValue, TArg>;
declare const resolveValue: <TValue, TArg>(valOrFunction: ValueOrFunction<TValue, TArg>, arg: TArg) => TValue;
interface Toast {
type: ToastType;
id: string;
message: ValueOrFunction<Renderable, Toast>;
icon?: Renderable;
duration?: number;
pauseDuration: number;
position?: ToastPosition;
removeDelay?: number;
ariaProps: {
role: 'status' | 'alert';
'aria-live': 'assertive' | 'off' | 'polite';
};
style?: CSSProperties;
className?: string;
iconTheme?: IconTheme;
createdAt: number;
visible: boolean;
dismissed: boolean;
height?: number;
}
type ToastOptions = Partial<Pick<Toast, 'id' | 'icon' | 'duration' | 'ariaProps' | 'className' | 'style' | 'position' | 'iconTheme' | 'removeDelay'>>;
type DefaultToastOptions = ToastOptions & {
[key in ToastType]?: ToastOptions;
};
interface ToasterProps {
position?: ToastPosition;
toastOptions?: DefaultToastOptions;
reverseOrder?: boolean;
gutter?: number;
containerStyle?: React.CSSProperties;
containerClassName?: string;
children?: (toast: Toast) => React.ReactElement;
}
type Message = ValueOrFunction<Renderable, Toast>;
type ToastHandler = (message: Message, options?: ToastOptions) => string;
declare const toast: {
(message: Message, opts?: ToastOptions): string;
error: ToastHandler;
success: ToastHandler;
loading: ToastHandler;
custom: ToastHandler;
dismiss(toastId?: string): void;
remove(toastId?: string): void;
promise<T>(promise: Promise<T> | (() => Promise<T>), msgs: {
loading: Renderable;
success?: ValueOrFunction<Renderable, T>;
error?: ValueOrFunction<Renderable, any>;
}, opts?: DefaultToastOptions): Promise<T>;
};
declare const useToaster: (toastOptions?: DefaultToastOptions) => {
toasts: Toast[];
handlers: {
updateHeight: (toastId: string, height: number) => void;
startPause: () => void;
endPause: () => void;
calculateOffset: (toast: Toast, opts?: {
reverseOrder?: boolean;
gutter?: number;
defaultPosition?: ToastPosition;
}) => number;
};
};
interface State {
toasts: Toast[];
pausedAt: number | undefined;
}
declare const useStore: (toastOptions?: DefaultToastOptions) => State;
export { DefaultToastOptions, IconTheme, Renderable, Toast, ToastOptions, ToastPosition, ToastType, ToasterProps, ValueFunction, ValueOrFunction, toast as default, resolveValue, toast, useToaster, useStore as useToasterStore };

View File

@@ -0,0 +1,2 @@
"use strict";var P=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var M=(e,t)=>{for(var r in t)P(e,r,{get:t[r],enumerable:!0})},U=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of v(t))!I.call(e,n)&&n!==r&&P(e,n,{get:()=>t[n],enumerable:!(a=_(t,n))||a.enumerable});return e};var F=e=>U(P({},"__esModule",{value:!0}),e);var j={};M(j,{default:()=>Y,resolveValue:()=>m,toast:()=>s,useToaster:()=>V,useToasterStore:()=>g});module.exports=F(j);var w=e=>typeof e=="function",m=(e,t)=>w(e)?e(t):e;var R=(()=>{let e=0;return()=>(++e).toString()})(),J=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})();var p=require("react"),N=20;var h=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,N)};case 1:return{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:r}=t;return h(e,{type:e.toasts.find(o=>o.id===r.id)?1:0,toast:r});case 3:let{toastId:a}=t;return{...e,toasts:e.toasts.map(o=>o.id===a||a===void 0?{...o,dismissed:!0,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let n=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+n}))}}},A=[],l={toasts:[],pausedAt:void 0},c=e=>{l=h(l,e),A.forEach(t=>{t(l)})},k={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},g=(e={})=>{let[t,r]=(0,p.useState)(l),a=(0,p.useRef)(l);(0,p.useEffect)(()=>(a.current!==l&&r(l),A.push(r),()=>{let o=A.indexOf(r);o>-1&&A.splice(o,1)}),[]);let n=t.toasts.map(o=>{var T,i,d;return{...e,...e[o.type],...o,removeDelay:o.removeDelay||((T=e[o.type])==null?void 0:T.removeDelay)||(e==null?void 0:e.removeDelay),duration:o.duration||((i=e[o.type])==null?void 0:i.duration)||(e==null?void 0:e.duration)||k[o.type],style:{...e.style,...(d=e[o.type])==null?void 0:d.style,...o.style}}});return{...t,toasts:n}};var H=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||R()}),y=e=>(t,r)=>{let a=H(t,e,r);return c({type:2,toast:a}),a.id},s=(e,t)=>y("blank")(e,t);s.error=y("error");s.success=y("success");s.loading=y("loading");s.custom=y("custom");s.dismiss=e=>{c({type:3,toastId:e})};s.remove=e=>c({type:4,toastId:e});s.promise=(e,t,r)=>{let a=s.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(n=>{let o=t.success?m(t.success,n):void 0;return o?s.success(o,{id:a,...r,...r==null?void 0:r.success}):s.dismiss(a),n}).catch(n=>{let o=t.error?m(t.error,n):void 0;o?s.error(o,{id:a,...r,...r==null?void 0:r.error}):s.dismiss(a)}),e};var f=require("react");var L=(e,t)=>{c({type:1,toast:{id:e,height:t}})},Q=()=>{c({type:5,time:Date.now()})},S=new Map,B=1e3,W=(e,t=B)=>{if(S.has(e))return;let r=setTimeout(()=>{S.delete(e),c({type:4,toastId:e})},t);S.set(e,r)},V=e=>{let{toasts:t,pausedAt:r}=g(e);(0,f.useEffect)(()=>{if(r)return;let o=Date.now(),T=t.map(i=>{if(i.duration===1/0)return;let d=(i.duration||0)+i.pauseDuration-(o-i.createdAt);if(d<0){i.visible&&s.dismiss(i.id);return}return setTimeout(()=>s.dismiss(i.id),d)});return()=>{T.forEach(i=>i&&clearTimeout(i))}},[t,r]);let a=(0,f.useCallback)(()=>{r&&c({type:6,time:Date.now()})},[r]),n=(0,f.useCallback)((o,T)=>{let{reverseOrder:i=!1,gutter:d=8,defaultPosition:b}=T||{},D=t.filter(u=>(u.position||b)===(o.position||b)&&u.height),x=D.findIndex(u=>u.id===o.id),E=D.filter((u,O)=>O<x&&u.visible).length;return D.filter(u=>u.visible).slice(...i?[E+1]:[0,E]).reduce((u,O)=>u+(O.height||0)+d,0)},[t]);return(0,f.useEffect)(()=>{t.forEach(o=>{if(o.dismissed)W(o.id,o.removeDelay);else{let T=S.get(o.id);T&&(clearTimeout(T),S.delete(o.id))}})},[t]),{toasts:t,handlers:{updateHeight:L,startPause:Q,endPause:a,calculateOffset:n}}};var Y=s;0&&(module.exports={resolveValue,toast,useToaster,useToasterStore});
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
var V=e=>typeof e=="function",m=(e,t)=>V(e)?e(t):e;var P=(()=>{let e=0;return()=>(++e).toString()})(),B=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})();import{useEffect as x,useState as _,useRef as v}from"react";var I=20;var b=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,I)};case 1:return{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:r}=t;return b(e,{type:e.toasts.find(o=>o.id===r.id)?1:0,toast:r});case 3:let{toastId:n}=t;return{...e,toasts:e.toasts.map(o=>o.id===n||n===void 0?{...o,dismissed:!0,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},y=[],l={toasts:[],pausedAt:void 0},c=e=>{l=b(l,e),y.forEach(t=>{t(l)})},M={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},g=(e={})=>{let[t,r]=_(l),n=v(l);x(()=>(n.current!==l&&r(l),y.push(r),()=>{let o=y.indexOf(r);o>-1&&y.splice(o,1)}),[]);let i=t.toasts.map(o=>{var T,a,d;return{...e,...e[o.type],...o,removeDelay:o.removeDelay||((T=e[o.type])==null?void 0:T.removeDelay)||(e==null?void 0:e.removeDelay),duration:o.duration||((a=e[o.type])==null?void 0:a.duration)||(e==null?void 0:e.duration)||M[o.type],style:{...e.style,...(d=e[o.type])==null?void 0:d.style,...o.style}}});return{...t,toasts:i}};var F=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||P()}),p=e=>(t,r)=>{let n=F(t,e,r);return c({type:2,toast:n}),n.id},s=(e,t)=>p("blank")(e,t);s.error=p("error");s.success=p("success");s.loading=p("loading");s.custom=p("custom");s.dismiss=e=>{c({type:3,toastId:e})};s.remove=e=>c({type:4,toastId:e});s.promise=(e,t,r)=>{let n=s.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(i=>{let o=t.success?m(t.success,i):void 0;return o?s.success(o,{id:n,...r,...r==null?void 0:r.success}):s.dismiss(n),i}).catch(i=>{let o=t.error?m(t.error,i):void 0;o?s.error(o,{id:n,...r,...r==null?void 0:r.error}):s.dismiss(n)}),e};import{useEffect as E,useCallback as R}from"react";var w=(e,t)=>{c({type:1,toast:{id:e,height:t}})},N=()=>{c({type:5,time:Date.now()})},f=new Map,k=1e3,C=(e,t=k)=>{if(f.has(e))return;let r=setTimeout(()=>{f.delete(e),c({type:4,toastId:e})},t);f.set(e,r)},H=e=>{let{toasts:t,pausedAt:r}=g(e);E(()=>{if(r)return;let o=Date.now(),T=t.map(a=>{if(a.duration===1/0)return;let d=(a.duration||0)+a.pauseDuration-(o-a.createdAt);if(d<0){a.visible&&s.dismiss(a.id);return}return setTimeout(()=>s.dismiss(a.id),d)});return()=>{T.forEach(a=>a&&clearTimeout(a))}},[t,r]);let n=R(()=>{r&&c({type:6,time:Date.now()})},[r]),i=R((o,T)=>{let{reverseOrder:a=!1,gutter:d=8,defaultPosition:D}=T||{},S=t.filter(u=>(u.position||D)===(o.position||D)&&u.height),h=S.findIndex(u=>u.id===o.id),O=S.filter((u,A)=>A<h&&u.visible).length;return S.filter(u=>u.visible).slice(...a?[O+1]:[0,O]).reduce((u,A)=>u+(A.height||0)+d,0)},[t]);return E(()=>{t.forEach(o=>{if(o.dismissed)C(o.id,o.removeDelay);else{let T=f.get(o.id);T&&(clearTimeout(T),f.delete(o.id))}})},[t]),{toasts:t,handlers:{updateHeight:w,startPause:N,endPause:n,calculateOffset:i}}};var ie=s;export{ie as default,m as resolveValue,s as toast,H as useToaster,g as useToasterStore};
//# sourceMappingURL=index.mjs.map

File diff suppressed because one or more lines are too long