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,13 @@
import { StateCreator, StoreMutatorIdentifier } from '../vanilla';
type Write<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
type Combine = <T extends object, U extends object, Mps extends [
StoreMutatorIdentifier,
unknown
][] = [
], Mcs extends [
StoreMutatorIdentifier,
unknown
][] = [
]>(initialState: T, additionalStateCreator: StateCreator<T, Mps, Mcs, U>) => StateCreator<Write<T, U>, Mps, Mcs>;
export declare const combine: Combine;
export {};

View File

@@ -0,0 +1,102 @@
import { StateCreator, StoreApi, StoreMutatorIdentifier } from '../vanilla';
type Config = Parameters<(Window extends {
__REDUX_DEVTOOLS_EXTENSION__?: infer T;
} ? T : {
connect: (param: any) => any;
})['connect']>[0];
declare module '../vanilla' {
interface StoreMutators<S, A> {
'zustand/devtools': WithDevtools<S>;
}
}
type Cast<T, U> = T extends U ? T : U;
type Write<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
type TakeTwo<T> = T extends {
length: 0;
} ? [
undefined,
undefined
] : T extends {
length: 1;
} ? [
/*a0*/ ...Cast<T, unknown[]>,
/*a1*/ undefined
] : T extends {
length: 0 | 1;
} ? [
/*a0*/ ...Cast<T, unknown[]>,
/*a1*/ undefined
] : T extends {
length: 2;
} ? T : T extends {
length: 1 | 2;
} ? T : T extends {
length: 0 | 1 | 2;
} ? T : T extends [
infer A0,
infer A1,
...unknown[]
] ? [
A0,
A1
] : T extends [
infer A0,
(infer A1)?,
...unknown[]
] ? [
A0,
A1?
] : T extends [
(infer A0)?,
(infer A1)?,
...unknown[]
] ? [
A0?,
A1?
] : never;
type WithDevtools<S> = Write<S, StoreDevtools<S>>;
type StoreDevtools<S> = S extends {
setState: (...a: infer Sa) => infer Sr;
} ? {
setState<A extends string | {
type: string;
}>(...a: [
/*a*/ ...TakeTwo<Sa>,
/*action*/ A
]): Sr;
} : never;
export interface DevtoolsOptions extends Config {
name?: string;
enabled?: boolean;
anonymousActionType?: string;
store?: string;
}
type Devtools = <T, Mps extends [
StoreMutatorIdentifier,
unknown
][] = [
], Mcs extends [
StoreMutatorIdentifier,
unknown
][] = [
]>(initializer: StateCreator<T, [
...Mps,
[
'zustand/devtools',
never
]
], Mcs>, devtoolsOptions?: DevtoolsOptions) => StateCreator<T, Mps, [
[
'zustand/devtools',
never
],
...Mcs
]>;
declare module '../vanilla' {
interface StoreMutators<S, A> {
'zustand/devtools': WithDevtools<S>;
}
}
export type NamedSet<T> = WithDevtools<StoreApi<T>>['setState'];
export declare const devtools: Devtools;
export {};

View File

@@ -0,0 +1,60 @@
import { Draft } from 'immer';
import { StateCreator, StoreMutatorIdentifier } from '../vanilla';
type Immer = <T, Mps extends [
StoreMutatorIdentifier,
unknown
][] = [
], Mcs extends [
StoreMutatorIdentifier,
unknown
][] = [
]>(initializer: StateCreator<T, [
...Mps,
[
'zustand/immer',
never
]
], Mcs>) => StateCreator<T, Mps, [
[
'zustand/immer',
never
],
...Mcs
]>;
declare module '../vanilla' {
interface StoreMutators<S, A> {
['zustand/immer']: WithImmer<S>;
}
}
type Write<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
type SkipTwo<T> = T extends {
length: 0;
} ? [
] : T extends {
length: 1;
} ? [
] : T extends {
length: 0 | 1;
} ? [
] : T extends [
unknown,
unknown,
...infer A
] ? A : T extends [
unknown,
unknown?,
...infer A
] ? A : T extends [
unknown?,
unknown?,
...infer A
] ? A : never;
type WithImmer<S> = Write<S, StoreImmer<S>>;
type StoreImmer<S> = S extends {
getState: () => infer T;
setState: infer SetState;
} ? SetState extends (...a: infer A) => infer Sr ? {
setState(nextStateOrUpdater: T | Partial<T> | ((state: Draft<T>) => void), shouldReplace?: boolean | undefined, ...a: SkipTwo<A>): Sr;
} : never : never;
export declare const immer: Immer;
export {};

View File

@@ -0,0 +1,139 @@
import { StateCreator, StoreMutatorIdentifier } from '../vanilla';
export interface StateStorage {
getItem: (name: string) => string | null | Promise<string | null>;
setItem: (name: string, value: string) => unknown | Promise<unknown>;
removeItem: (name: string) => unknown | Promise<unknown>;
}
export type StorageValue<S> = {
state: S;
version?: number;
};
export interface PersistStorage<S> {
getItem: (name: string) => StorageValue<S> | null | Promise<StorageValue<S> | null>;
setItem: (name: string, value: StorageValue<S>) => unknown | Promise<unknown>;
removeItem: (name: string) => unknown | Promise<unknown>;
}
type JsonStorageOptions = {
reviver?: (key: string, value: unknown) => unknown;
replacer?: (key: string, value: unknown) => unknown;
};
export declare function createJSONStorage<S>(getStorage: () => StateStorage, options?: JsonStorageOptions): PersistStorage<S> | undefined;
export interface PersistOptions<S, PersistedState = S> {
/** Name of the storage (must be unique) */
name: string;
/**
* @deprecated Use `storage` instead.
* A function returning a storage.
* The storage must fit `window.localStorage`'s api (or an async version of it).
* For example the storage could be `AsyncStorage` from React Native.
*
* @default () => localStorage
*/
getStorage?: () => StateStorage;
/**
* @deprecated Use `storage` instead.
* Use a custom serializer.
* The returned string will be stored in the storage.
*
* @default JSON.stringify
*/
serialize?: (state: StorageValue<S>) => string | Promise<string>;
/**
* @deprecated Use `storage` instead.
* Use a custom deserializer.
* Must return an object matching StorageValue<S>
*
* @param str The storage's current value.
* @default JSON.parse
*/
deserialize?: (str: string) => StorageValue<PersistedState> | Promise<StorageValue<PersistedState>>;
/**
* Use a custom persist storage.
*
* Combining `createJSONStorage` helps creating a persist storage
* with JSON.parse and JSON.stringify.
*
* @default createJSONStorage(() => localStorage)
*/
storage?: PersistStorage<PersistedState> | undefined;
/**
* Filter the persisted value.
*
* @params state The state's value
*/
partialize?: (state: S) => PersistedState;
/**
* A function returning another (optional) function.
* The main function will be called before the state rehydration.
* The returned function will be called after the state rehydration or when an error occurred.
*/
onRehydrateStorage?: (state: S) => ((state?: S, error?: unknown) => void) | void;
/**
* If the stored state's version mismatch the one specified here, the storage will not be used.
* This is useful when adding a breaking change to your store.
*/
version?: number;
/**
* A function to perform persisted state migration.
* This function will be called when persisted state versions mismatch with the one specified here.
*/
migrate?: (persistedState: unknown, version: number) => PersistedState | Promise<PersistedState>;
/**
* A function to perform custom hydration merges when combining the stored state with the current one.
* By default, this function does a shallow merge.
*/
merge?: (persistedState: unknown, currentState: S) => S;
/**
* An optional boolean that will prevent the persist middleware from triggering hydration on initialization,
* This allows you to call `rehydrate()` at a specific point in your apps rendering life-cycle.
*
* This is useful in SSR application.
*
* @default false
*/
skipHydration?: boolean;
}
type PersistListener<S> = (state: S) => void;
type StorePersist<S, Ps> = {
persist: {
setOptions: (options: Partial<PersistOptions<S, Ps>>) => void;
clearStorage: () => void;
rehydrate: () => Promise<void> | void;
hasHydrated: () => boolean;
onHydrate: (fn: PersistListener<S>) => () => void;
onFinishHydration: (fn: PersistListener<S>) => () => void;
getOptions: () => Partial<PersistOptions<S, Ps>>;
};
};
type Persist = <T, Mps extends [
StoreMutatorIdentifier,
unknown
][] = [
], Mcs extends [
StoreMutatorIdentifier,
unknown
][] = [
], U = T>(initializer: StateCreator<T, [
...Mps,
[
'zustand/persist',
unknown
]
], Mcs>, options: PersistOptions<T, U>) => StateCreator<T, Mps, [
[
'zustand/persist',
U
],
...Mcs
]>;
declare module '../vanilla' {
interface StoreMutators<S, A> {
'zustand/persist': WithPersist<S, A>;
}
}
type Write<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
type WithPersist<S, A> = S extends {
getState: () => infer T;
} ? Write<S, StorePersist<T, A>> : never;
export declare const persist: Persist;
export {};

View File

@@ -0,0 +1,30 @@
import { StateCreator, StoreMutatorIdentifier } from '../vanilla';
type Write<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
type Action = {
type: string;
};
type StoreRedux<A> = {
dispatch: (a: A) => A;
dispatchFromDevtools: true;
};
type ReduxState<A> = {
dispatch: StoreRedux<A>['dispatch'];
};
type WithRedux<S, A> = Write<S, StoreRedux<A>>;
type Redux = <T, A extends Action, Cms extends [
StoreMutatorIdentifier,
unknown
][] = [
]>(reducer: (state: T, action: A) => T, initialState: T) => StateCreator<Write<T, ReduxState<A>>, Cms, [
[
'zustand/redux',
A
]
]>;
declare module '../vanilla' {
interface StoreMutators<S, A> {
'zustand/redux': WithRedux<S, A>;
}
}
export declare const redux: Redux;
export {};

View File

@@ -0,0 +1,42 @@
import { StateCreator, StoreMutatorIdentifier } from '../vanilla';
type SubscribeWithSelector = <T, Mps extends [
StoreMutatorIdentifier,
unknown
][] = [
], Mcs extends [
StoreMutatorIdentifier,
unknown
][] = [
]>(initializer: StateCreator<T, [
...Mps,
[
'zustand/subscribeWithSelector',
never
]
], Mcs>) => StateCreator<T, Mps, [
[
'zustand/subscribeWithSelector',
never
],
...Mcs
]>;
type Write<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
type WithSelectorSubscribe<S> = S extends {
getState: () => infer T;
} ? Write<S, StoreSubscribeWithSelector<T>> : never;
declare module '../vanilla' {
interface StoreMutators<S, A> {
['zustand/subscribeWithSelector']: WithSelectorSubscribe<S>;
}
}
type StoreSubscribeWithSelector<T> = {
subscribe: {
(listener: (selectedState: T, previousSelectedState: T) => void): () => void;
<U>(selector: (state: T) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
equalityFn?: (a: U, b: U) => boolean;
fireImmediately?: boolean;
}): () => void;
};
};
export declare const subscribeWithSelector: SubscribeWithSelector;
export {};