 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>
		
			
				
	
	
		
			1 line
		
	
	
		
			8.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			1 line
		
	
	
		
			8.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| {"version":3,"file":"io-ts.modern.mjs","sources":["../src/arrayToPath.ts","../src/errorsToRecord.ts","../src/io-ts.ts"],"sourcesContent":["import * as Either from 'fp-ts/Either';\nimport { pipe } from 'fp-ts/function';\n\nconst arrayToPath = (paths: Either.Either<string, number>[]): string =>\n  paths.reduce(\n    (previous, path, index) =>\n      pipe(\n        path,\n        Either.fold(\n          (key) => `${index > 0 ? '.' : ''}${key}`,\n          (key) => `[${key}]`,\n        ),\n        (path) => `${previous}${path}`,\n      ),\n    '',\n  );\n\nexport default arrayToPath;\n","import * as Either from 'fp-ts/Either';\nimport * as Option from 'fp-ts/Option';\nimport * as ReadonlyArray from 'fp-ts/ReadonlyArray';\nimport * as ReadonlyRecord from 'fp-ts/ReadonlyRecord';\nimport * as SemiGroup from 'fp-ts/Semigroup';\nimport { absurd, flow, identity, not, pipe } from 'fp-ts/function';\nimport * as t from 'io-ts';\nimport {\n  ExactType,\n  IntersectionType,\n  RefinementType,\n  TaggedUnionType,\n  UnionType,\n  ValidationError,\n} from 'io-ts';\nimport arrayToPath from './arrayToPath';\nimport { ErrorObject, FieldErrorWithPath } from './types';\n\nconst INSTANCE_TYPES_TO_FILTER = [\n  TaggedUnionType,\n  UnionType,\n  IntersectionType,\n  ExactType,\n  RefinementType,\n];\nconst formatErrorPath = (context: t.Context): string =>\n  pipe(\n    context,\n    ReadonlyArray.filterMapWithIndex((index, contextEntry) => {\n      const previousIndex = index - 1;\n      const previousContextEntry =\n        previousIndex === -1 ? undefined : context[previousIndex];\n      const shouldBeFiltered =\n        previousContextEntry === undefined ||\n        INSTANCE_TYPES_TO_FILTER.some(\n          (type) => previousContextEntry.type instanceof type,\n        );\n\n      return shouldBeFiltered ? Option.none : Option.some(contextEntry);\n    }),\n    ReadonlyArray.map(({ key }) => key),\n    ReadonlyArray.map((key) =>\n      pipe(\n        key,\n        (k) => parseInt(k, 10),\n        Either.fromPredicate(not<number>(Number.isNaN), () => key),\n      ),\n    ),\n    ReadonlyArray.toArray,\n    arrayToPath,\n  );\n\nconst formatError = (e: t.ValidationError): FieldErrorWithPath => {\n  const path = formatErrorPath(e.context);\n\n  const message = pipe(\n    e.message,\n    Either.fromNullable(e.context),\n    Either.mapLeft(\n      flow(\n        ReadonlyArray.last,\n        Option.map(\n          (contextEntry) =>\n            `expected ${contextEntry.type.name} but got ${JSON.stringify(\n              contextEntry.actual,\n            )}`,\n        ),\n        Option.getOrElseW(() =>\n          absurd<string>('Error context is missing name' as never),\n        ),\n      ),\n    ),\n    Either.getOrElseW(identity),\n  );\n\n  const type = pipe(\n    e.context,\n    ReadonlyArray.last,\n    Option.map((contextEntry) => contextEntry.type.name),\n    Option.getOrElse(() => 'unknown'),\n  );\n\n  return { message, type, path };\n};\n\n// this is almost the same function like Semigroup.getObjectSemigroup but reversed\n// in order to get the first error\nconst getObjectSemigroup = <\n  A extends Record<string, unknown> = never,\n>(): SemiGroup.Semigroup<A> => ({\n  concat: (first, second) => Object.assign({}, second, first),\n});\n\nconst concatToSingleError = (\n  errors: ReadonlyArray<FieldErrorWithPath>,\n): ErrorObject =>\n  pipe(\n    errors,\n    ReadonlyArray.map((error) => ({\n      [error.path]: {\n        type: error.type,\n        message: error.message,\n      },\n    })),\n    (errors) => SemiGroup.fold(getObjectSemigroup<ErrorObject>())({}, errors),\n  );\n\nconst appendSeveralErrors: SemiGroup.Semigroup<FieldErrorWithPath> = {\n  concat: (a, b) => ({\n    ...b,\n    types: { ...a.types, [a.type]: a.message, [b.type]: b.message },\n  }),\n};\n\nconst concatToMultipleErrors = (\n  errors: ReadonlyArray<FieldErrorWithPath>,\n): ErrorObject =>\n  pipe(\n    ReadonlyRecord.fromFoldableMap(appendSeveralErrors, ReadonlyArray.Foldable)(\n      errors,\n      (error) => [error.path, error],\n    ),\n    ReadonlyRecord.map((errorWithPath) => {\n      // eslint-disable-next-line @typescript-eslint/no-unused-vars\n      const { path, ...error } = errorWithPath;\n\n      return error;\n    }),\n  );\n\nconst errorsToRecord =\n  (validateAllFieldCriteria: boolean) =>\n  (validationErrors: ReadonlyArray<ValidationError>): ErrorObject => {\n    const concat = validateAllFieldCriteria\n      ? concatToMultipleErrors\n      : concatToSingleError;\n\n    return pipe(validationErrors, ReadonlyArray.map(formatError), concat);\n  };\n\nexport default errorsToRecord;\n","import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport * as Either from 'fp-ts/Either';\nimport { pipe } from 'fp-ts/function';\nimport errorsToRecord from './errorsToRecord';\nimport { Resolver } from './types';\n\nexport const ioTsResolver: Resolver = (codec) => (values, _context, options) =>\n  pipe(\n    values,\n    codec.decode,\n    Either.mapLeft(\n      errorsToRecord(\n        !options.shouldUseNativeValidation && options.criteriaMode === 'all',\n      ),\n    ),\n    Either.mapLeft((errors) => toNestErrors(errors, options)),\n    Either.fold(\n      (errors) => ({\n        values: {},\n        errors,\n      }),\n      (values) => {\n        options.shouldUseNativeValidation &&\n          validateFieldsNatively({}, options);\n\n        return {\n          values,\n          errors: {},\n        } as any;\n      },\n    ),\n  );\n"],"names":["arrayToPath","paths","reduce","previous","path","index","pipe","Either","fold","key","_excluded","INSTANCE_TYPES_TO_FILTER","TaggedUnionType","UnionType","IntersectionType","ExactType","RefinementType","formatError","e","context","ReadonlyArray","filterMapWithIndex","contextEntry","previousIndex","previousContextEntry","undefined","some","type","Option","none","map","k","parseInt","fromPredicate","not","Number","isNaN","toArray","message","fromNullable","mapLeft","flow","last","name","JSON","stringify","actual","getOrElseW","absurd","identity","getOrElse","concatToSingleError","errors","error","SemiGroup","getObjectSemigroup","concat","first","second","Object","assign","appendSeveralErrors","a","b","_extends","types","concatToMultipleErrors","ReadonlyRecord","fromFoldableMap","Foldable","errorWithPath","_objectWithoutPropertiesLoose","ioTsResolver","codec","values","_context","options","decode","validateAllFieldCriteria","shouldUseNativeValidation","criteriaMode","validationErrors","toNestErrors","validateFieldsNatively"],"mappings":"upBAGA,MAAMA,EAAeC,GACnBA,EAAMC,OACJ,CAACC,EAAUC,EAAMC,IACfC,EACEF,EACAG,EAAOC,KACJC,GAAQ,GAAGJ,EAAQ,EAAI,IAAM,KAAKI,IAClCA,GAAQ,IAAIA,MAEdL,GAAS,GAAGD,IAAWC,KAE5B,ICdJM,EAAA,CAAA,QAkBMC,EAA2B,CAC/BC,EACAC,EACAC,EACAC,EACAC,GA6BIC,EAAeC,IACnB,MAAMd,EA3BNE,EADuBa,EA4BMD,EAAEC,QAzB7BC,EAAcC,mBAAmB,CAAChB,EAAOiB,KACvC,MAAMC,EAAgBlB,EAAQ,EACxBmB,GACe,IAAnBD,OAAuBE,EAAYN,EAAQI,GAO7C,YAL2BE,IAAzBD,GACAb,EAAyBe,KACtBC,GAASH,EAAqBG,gBAAgBA,GAGzBC,EAAOC,KAAOD,EAAOF,KAAKJ,EAAY,GAElEF,EAAcU,IAAI,EAAGrB,SAAUA,GAC/BW,EAAcU,IAAKrB,GACjBH,EACEG,EACCsB,GAAMC,SAASD,EAAG,IACnBxB,EAA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