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>
1.8 KiB
1.8 KiB
Legacy environment support for circular equal comparators
Starting in 4.x.x, WeakMap is expected to be available in the environment. All modern browsers support this global object, however there may be situations where a legacy environmental support is required (example: IE11). If you need to support such an environment and polyfilling is not an option, creating a custom comparator that uses a custom cache implementation with the same contract is a simple solution.
import { createCustomEqual, sameValueZeroEqual } from 'fast-equals';
import type { Cache } from 'fast-equals';
function getCache(): Cache<any, any> {
const entries: Array<[object, any]> = [];
return {
delete(key) {
for (let index = 0; index < entries.length; ++index) {
if (entries[index][0] === key) {
entries.splice(index, 1);
return true;
}
}
return false;
},
get(key) {
for (let index = 0; index < entries.length; ++index) {
if (entries[index][0] === key) {
return entries[index][1];
}
}
},
set(key, value) {
for (let index = 0; index < entries.length; ++index) {
if (entries[index][0] === key) {
entries[index][1] = value;
return this;
}
}
entries.push([key, value]);
return this;
},
};
}
interface Meta {
customMethod(): void;
customValue: string;
}
const meta = {
customMethod() {
console.log('hello!');
},
customValue: 'goodbye',
};
const circularDeepEqual = createCustomEqual<Cache>({
circular: true,
createState: () => ({
cache: getCache(),
meta,
}),
});
const circularShallowEqual = createCustomEqual<Cache>({
circular: true,
comparator: sameValueZeroEqual,
createState: () => ({
cache: getCache(),
meta,
}),
});