feat: add Universal Display Augmentation for AI-powered enhanced output

- Implements intelligent display fields with AI-generated titles and descriptions
- Leverages existing IntelligentTypeMatcher for semantic type detection
- Adds lazy computation with LRU caching for zero performance impact
- Enhances CLI with clean, minimal formatting (no visual clutter)
- Provides method-based API (getDisplay()) to avoid namespace conflicts
- Maintains 100% backward compatibility with existing code
- Enables by default with complete isolation architecture
- Includes comprehensive tests and documentation

The augmentation transforms search results and data display with smart,
contextual information while maintaining Soulcraft's clean aesthetic.
This commit is contained in:
David Snelling 2025-08-28 12:37:07 -07:00
parent 99c11385ab
commit b409075d0b
11 changed files with 3511 additions and 62 deletions

View file

@ -14,6 +14,7 @@ import { CacheAugmentation } from './cacheAugmentation.js'
import { IndexAugmentation } from './indexAugmentation.js'
import { MetricsAugmentation } from './metricsAugmentation.js'
import { MonitoringAugmentation } from './monitoringAugmentation.js'
import { UniversalDisplayAugmentation } from './universalDisplayAugmentation.js'
/**
* Create default augmentations for zero-config operation
@ -28,6 +29,7 @@ export function createDefaultAugmentations(
index?: boolean | Record<string, any>
metrics?: boolean | Record<string, any>
monitoring?: boolean | Record<string, any>
display?: boolean | Record<string, any>
} = {}
): BaseAugmentation[] {
const augmentations: BaseAugmentation[] = []
@ -50,6 +52,12 @@ export function createDefaultAugmentations(
augmentations.push(new MetricsAugmentation(metricsConfig))
}
// Display augmentation (AI-powered intelligent display fields)
if (config.display !== false) {
const displayConfig = typeof config.display === 'object' ? config.display : {}
augmentations.push(new UniversalDisplayAugmentation(displayConfig))
}
// Monitoring augmentation (was HealthMonitor)
// Only enable by default in distributed mode
const isDistributed = process.env.BRAINY_MODE === 'distributed' ||
@ -104,5 +112,12 @@ export const AugmentationHelpers = {
*/
getMonitoring(brain: BrainyData): MonitoringAugmentation | null {
return getAugmentation<MonitoringAugmentation>(brain, 'monitoring')
},
/**
* Get display augmentation
*/
getDisplay(brain: BrainyData): UniversalDisplayAugmentation | null {
return getAugmentation<UniversalDisplayAugmentation>(brain, 'display')
}
}