chore: recovery checkpoint - v3.0 API successfully recovered
CRITICAL CHECKPOINT - DO NOT PUSH TO GITHUB Recovery Status: - Successfully recovered brainy.ts from compiled JavaScript - All core v3.0 API methods functional (add, get, update, delete, relate, find, etc.) - Neural subsystem intact (562KB embedded patterns, NLP working) - Augmentation pipeline operational (20+ augmentations) - HNSW clustering system complete - Triple Intelligence compiled (needs constructor fix) - Test suite validates functionality Changes preserved: - 898 files with changes from last 3 days - 144,475 insertions - All augmentation improvements - All test coverage enhancements - Complete v3.0 feature set This is a LOCAL checkpoint only - contains recovered work after corruption incident. Created backup in .backups/brainy-full-20250910-151314.tar.gz Branch: recovery-checkpoint-20250910-151433 Date: Wed Sep 10 03:18:04 PM PDT 2025
This commit is contained in:
parent
f65455fb22
commit
8ff382ca3b
895 changed files with 143654 additions and 28268 deletions
191
.recovery-workspace/dist-backup-20250910-141917/augmentations/universalDisplayAugmentation.d.ts
vendored
Normal file
191
.recovery-workspace/dist-backup-20250910-141917/augmentations/universalDisplayAugmentation.d.ts
vendored
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
/**
|
||||
* Universal Display Augmentation
|
||||
*
|
||||
* 🎨 Provides intelligent display fields for any noun or verb using AI-powered analysis
|
||||
*
|
||||
* Features:
|
||||
* - ✅ Leverages existing BrainyTypes for semantic type detection
|
||||
* - ✅ Complete icon coverage for all 31 NounTypes + 40+ VerbTypes
|
||||
* - ✅ Zero performance impact with lazy computation and intelligent caching
|
||||
* - ✅ Perfect isolation - can be disabled, replaced, or configured
|
||||
* - ✅ Clean developer experience with zero conflicts
|
||||
* - ✅ TypeScript support with full autocomplete
|
||||
*
|
||||
* Usage:
|
||||
* ```typescript
|
||||
* // User data access (unchanged)
|
||||
* result.firstName // "John"
|
||||
* result.metadata.title // "CEO"
|
||||
*
|
||||
* // Enhanced display (new capabilities)
|
||||
* result.getDisplay('title') // "John Doe" (AI-computed)
|
||||
* result.getDisplay('description') // "CEO at Acme Corp" (enhanced)
|
||||
* result.getDisplay('type') // "Person" (from AI detection)
|
||||
* result.getDisplay() // All display fields
|
||||
* ```
|
||||
*/
|
||||
import { BaseAugmentation, AugmentationContext, MetadataAccess } from './brainyAugmentation.js';
|
||||
import type { DisplayConfig, DisplayAugmentationStats } from './display/types.js';
|
||||
/**
|
||||
* Universal Display Augmentation
|
||||
*
|
||||
* Self-contained augmentation that provides intelligent display fields
|
||||
* for any data type using existing Brainy AI infrastructure
|
||||
*/
|
||||
export declare class UniversalDisplayAugmentation extends BaseAugmentation {
|
||||
readonly name = "display";
|
||||
readonly version = "1.0.0";
|
||||
readonly timing: "after";
|
||||
readonly priority = 50;
|
||||
readonly metadata: MetadataAccess;
|
||||
operations: any;
|
||||
readonly category: "core";
|
||||
readonly description = "AI-powered intelligent display fields for enhanced data visualization";
|
||||
computedFields: {
|
||||
display: {
|
||||
title: {
|
||||
type: "string";
|
||||
description: string;
|
||||
};
|
||||
description: {
|
||||
type: "string";
|
||||
description: string;
|
||||
};
|
||||
type: {
|
||||
type: "string";
|
||||
description: string;
|
||||
};
|
||||
tags: {
|
||||
type: "array";
|
||||
description: string;
|
||||
};
|
||||
relationship: {
|
||||
type: "string";
|
||||
description: string;
|
||||
};
|
||||
confidence: {
|
||||
type: "number";
|
||||
description: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
private computationEngine;
|
||||
private displayCache;
|
||||
private requestDeduplicator;
|
||||
protected config: DisplayConfig;
|
||||
protected context: AugmentationContext | undefined;
|
||||
constructor(config?: Partial<DisplayConfig>);
|
||||
/**
|
||||
* Initialize the augmentation with AI components
|
||||
* @param context Brainy context
|
||||
*/
|
||||
initialize(context: AugmentationContext): Promise<void>;
|
||||
/**
|
||||
* Execute augmentation - attach display capabilities to results
|
||||
* @param operation The operation being performed
|
||||
* @param params Operation parameters
|
||||
* @param next Function to execute main operation
|
||||
* @returns Enhanced result with display capabilities
|
||||
*/
|
||||
execute<T = any>(operation: string, params: any, next: () => Promise<T>): Promise<T>;
|
||||
/**
|
||||
* Check if operation should be enhanced
|
||||
* @param operation Operation name
|
||||
* @returns True if should enhance
|
||||
*/
|
||||
private shouldEnhanceOperation;
|
||||
/**
|
||||
* Enhance result with display capabilities
|
||||
* @param result The operation result
|
||||
* @param operation The operation type
|
||||
* @returns Enhanced result
|
||||
*/
|
||||
private enhanceWithDisplayCapabilities;
|
||||
/**
|
||||
* Enhance a single entity with display capabilities
|
||||
* @param entity The entity to enhance
|
||||
* @returns Enhanced entity
|
||||
*/
|
||||
private enhanceEntity;
|
||||
/**
|
||||
* Create getDisplay method for an entity
|
||||
* @param entity The entity
|
||||
* @param isVerb Whether it's a verb entity
|
||||
* @returns getDisplay function
|
||||
*/
|
||||
private createGetDisplayMethod;
|
||||
/**
|
||||
* Create getAvailableFields method
|
||||
* @returns getAvailableFields function
|
||||
*/
|
||||
private createGetAvailableFieldsMethod;
|
||||
/**
|
||||
* Create getAvailableAugmentations method
|
||||
* @returns getAvailableAugmentations function
|
||||
*/
|
||||
private createGetAvailableAugmentationsMethod;
|
||||
/**
|
||||
* Create explore method for debugging
|
||||
* @param entity The entity
|
||||
* @returns explore function
|
||||
*/
|
||||
private createExploreMethod;
|
||||
/**
|
||||
* Check if an entity is a verb
|
||||
* @param entity The entity to check
|
||||
* @returns True if it's a verb
|
||||
*/
|
||||
private isVerbEntity;
|
||||
/**
|
||||
* Get coverage information
|
||||
* @returns Coverage info string
|
||||
*/
|
||||
private getCoverageInfo;
|
||||
/**
|
||||
* Get augmentation statistics
|
||||
* @returns Performance and usage statistics
|
||||
*/
|
||||
getStats(): DisplayAugmentationStats;
|
||||
/**
|
||||
* Configure the augmentation at runtime
|
||||
* @param newConfig Partial configuration to merge
|
||||
*/
|
||||
configure(newConfig: Partial<DisplayConfig>): void;
|
||||
/**
|
||||
* Clear all cached display data
|
||||
*/
|
||||
clearCache(): void;
|
||||
/**
|
||||
* Precompute display fields for a batch of entities
|
||||
* @param entities Array of entities to precompute
|
||||
*/
|
||||
precomputeBatch(entities: Array<{
|
||||
id: string;
|
||||
data: any;
|
||||
}>): Promise<void>;
|
||||
/**
|
||||
* Optional check if this augmentation should run
|
||||
* @param operation Operation name
|
||||
* @param params Operation parameters
|
||||
* @returns True if should execute
|
||||
*/
|
||||
shouldExecute(operation: string, params: any): boolean;
|
||||
/**
|
||||
* Cleanup when augmentation is shut down
|
||||
*/
|
||||
shutdown(): Promise<void>;
|
||||
}
|
||||
/**
|
||||
* Factory function to create display augmentation with default config
|
||||
* @param config Optional configuration overrides
|
||||
* @returns Configured display augmentation instance
|
||||
*/
|
||||
export declare function createDisplayAugmentation(config?: Partial<DisplayConfig>): UniversalDisplayAugmentation;
|
||||
/**
|
||||
* Default configuration for the display augmentation
|
||||
*/
|
||||
export declare const DEFAULT_DISPLAY_CONFIG: DisplayConfig;
|
||||
/**
|
||||
* Export for easy import and registration
|
||||
*/
|
||||
export default UniversalDisplayAugmentation;
|
||||
Loading…
Add table
Add a link
Reference in a new issue