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
125 lines
4 KiB
TypeScript
125 lines
4 KiB
TypeScript
/**
|
|
* Storage Augmentations - Concrete Implementations
|
|
*
|
|
* These augmentations provide different storage backends for Brainy.
|
|
* Each wraps an existing storage adapter for backward compatibility.
|
|
*/
|
|
import { StorageAugmentation } from './storageAugmentation.js';
|
|
import { StorageAdapter } from '../coreTypes.js';
|
|
import { AugmentationManifest } from './manifest.js';
|
|
/**
|
|
* Memory Storage Augmentation - Fast in-memory storage
|
|
*/
|
|
export declare class MemoryStorageAugmentation extends StorageAugmentation {
|
|
readonly name = "memory-storage";
|
|
readonly category: "core";
|
|
readonly description = "High-performance in-memory storage for development and testing";
|
|
constructor(config?: any);
|
|
getManifest(): AugmentationManifest;
|
|
provideStorage(): Promise<StorageAdapter>;
|
|
protected onInitialize(): Promise<void>;
|
|
}
|
|
/**
|
|
* FileSystem Storage Augmentation - Node.js persistent storage
|
|
*/
|
|
export declare class FileSystemStorageAugmentation extends StorageAugmentation {
|
|
readonly name = "filesystem-storage";
|
|
readonly category: "core";
|
|
readonly description = "Persistent file-based storage for Node.js environments";
|
|
constructor(config?: any);
|
|
getManifest(): AugmentationManifest;
|
|
provideStorage(): Promise<StorageAdapter>;
|
|
protected onInitialize(): Promise<void>;
|
|
}
|
|
/**
|
|
* OPFS Storage Augmentation - Browser persistent storage
|
|
*/
|
|
export declare class OPFSStorageAugmentation extends StorageAugmentation {
|
|
readonly name = "opfs-storage";
|
|
readonly category: "core";
|
|
readonly description = "Persistent browser storage using Origin Private File System";
|
|
constructor(config?: any);
|
|
getManifest(): AugmentationManifest;
|
|
provideStorage(): Promise<StorageAdapter>;
|
|
protected onInitialize(): Promise<void>;
|
|
}
|
|
/**
|
|
* S3 Storage Augmentation - Amazon S3 cloud storage
|
|
*/
|
|
export declare class S3StorageAugmentation extends StorageAugmentation {
|
|
readonly name = "s3-storage";
|
|
protected config: {
|
|
bucketName: string;
|
|
region?: string;
|
|
accessKeyId: string;
|
|
secretAccessKey: string;
|
|
sessionToken?: string;
|
|
cacheConfig?: any;
|
|
operationConfig?: any;
|
|
};
|
|
constructor(config: {
|
|
bucketName: string;
|
|
region?: string;
|
|
accessKeyId: string;
|
|
secretAccessKey: string;
|
|
sessionToken?: string;
|
|
cacheConfig?: any;
|
|
operationConfig?: any;
|
|
});
|
|
provideStorage(): Promise<StorageAdapter>;
|
|
protected onInitialize(): Promise<void>;
|
|
}
|
|
/**
|
|
* R2 Storage Augmentation - Cloudflare R2 storage
|
|
*/
|
|
export declare class R2StorageAugmentation extends StorageAugmentation {
|
|
readonly name = "r2-storage";
|
|
protected config: {
|
|
bucketName: string;
|
|
accountId: string;
|
|
accessKeyId: string;
|
|
secretAccessKey: string;
|
|
cacheConfig?: any;
|
|
};
|
|
constructor(config: {
|
|
bucketName: string;
|
|
accountId: string;
|
|
accessKeyId: string;
|
|
secretAccessKey: string;
|
|
cacheConfig?: any;
|
|
});
|
|
provideStorage(): Promise<StorageAdapter>;
|
|
protected onInitialize(): Promise<void>;
|
|
}
|
|
/**
|
|
* GCS Storage Augmentation - Google Cloud Storage
|
|
*/
|
|
export declare class GCSStorageAugmentation extends StorageAugmentation {
|
|
readonly name = "gcs-storage";
|
|
protected config: {
|
|
bucketName: string;
|
|
region?: string;
|
|
accessKeyId: string;
|
|
secretAccessKey: string;
|
|
endpoint?: string;
|
|
cacheConfig?: any;
|
|
};
|
|
constructor(config: {
|
|
bucketName: string;
|
|
region?: string;
|
|
accessKeyId: string;
|
|
secretAccessKey: string;
|
|
endpoint?: string;
|
|
cacheConfig?: any;
|
|
});
|
|
provideStorage(): Promise<StorageAdapter>;
|
|
protected onInitialize(): Promise<void>;
|
|
}
|
|
/**
|
|
* Auto-select the best storage augmentation for the environment
|
|
* Maintains zero-config philosophy
|
|
*/
|
|
export declare function createAutoStorageAugmentation(options?: {
|
|
rootDirectory?: string;
|
|
requestPersistentStorage?: boolean;
|
|
}): Promise<StorageAugmentation>;
|