brainy/src/augmentationRegistry.ts
David Snelling ca8eb5520e Fix TypeScript compilation issues for augmentation system
Major fixes:
- Replace augmentationPipeline.ts with compatibility layer (21 errors → 0)
- Replace augmentationRegistry.ts with compatibility stubs
- Fix CacheAugmentation: remove invalid 'memoryLimit', fix duplicate 'enabled'
- Fix ConduitAugmentation: 'deleteNoun' → 'delete' operation
- Fix Timer types: NodeJS.Timer → NodeJS.Timeout in index/metrics
- Fix log levels: 'debug' → 'info' throughout augmentations
- Fix readonly array typing in conduit operations
- Fix MetadataIndexConfig property mismatch
- Fix express/ws dynamic import patterns

Progress: 153 TypeScript errors → 106 errors (-47 errors fixed)

Remaining: Method mismatches, property name evolution, import issues
Next: Comprehensive test suite validation for all 50+ test files
2025-08-25 11:33:56 -07:00

63 lines
2 KiB
TypeScript

/**
* Augmentation Registry (Compatibility Layer)
*
* @deprecated This module provides backward compatibility for old augmentation
* loading code. All new code should use the AugmentationRegistry class directly
* on BrainyData instances.
*/
import { BrainyAugmentation } from './types/augmentations.js'
/**
* Registry of all available augmentations (for compatibility)
* @deprecated Use brain.augmentations instead
*/
export const availableAugmentations: any[] = []
/**
* Compatibility wrapper for registerAugmentation
* @deprecated Use brain.augmentations.register instead
*/
export function registerAugmentation<T extends BrainyAugmentation>(augmentation: T): T {
console.warn('registerAugmentation is deprecated. Use brain.augmentations.register instead.')
// For compatibility, just add to the list (but it won't actually do anything)
availableAugmentations.push(augmentation)
return augmentation
}
/**
* Sets the default pipeline instance (compatibility)
* @deprecated Use brain.augmentations instead
*/
export function setDefaultPipeline(pipeline: any): void {
console.warn('setDefaultPipeline is deprecated. Use brain.augmentations instead.')
}
/**
* Initializes the augmentation pipeline (compatibility)
* @deprecated Use brain.augmentations instead
*/
export function initializeAugmentationPipeline(pipelineInstance?: any): any {
console.warn('initializeAugmentationPipeline is deprecated. Use brain.augmentations instead.')
return pipelineInstance || {}
}
/**
* Enables or disables an augmentation by name (compatibility)
* @deprecated Use brain.augmentations instead
*/
export function setAugmentationEnabled(name: string, enabled: boolean): boolean {
console.warn('setAugmentationEnabled is deprecated. Use brain.augmentations instead.')
return false
}
/**
* Gets all augmentations of a specific type (compatibility)
* @deprecated Use brain.augmentations instead
*/
export function getAugmentationsByType(type: any): any[] {
console.warn('getAugmentationsByType is deprecated. Use brain.augmentations instead.')
return []
}