Initial commit: Brainy - Multi-Dimensional AI Database

Open source vector database with HNSW indexing, graph relationships,
and metadata facets. Features CLI with professional augmentation registry
integration for discovering extensions and capabilities.
This commit is contained in:
David Snelling 2025-08-18 17:35:06 -07:00
commit f8c45f2d8d
448 changed files with 103294 additions and 0 deletions

45
dist/errors/brainyError.d.ts vendored Normal file
View file

@ -0,0 +1,45 @@
/**
* Custom error types for Brainy operations
* Provides better error classification and handling
*/
export type BrainyErrorType = 'TIMEOUT' | 'NETWORK' | 'STORAGE' | 'NOT_FOUND' | 'RETRY_EXHAUSTED';
/**
* Custom error class for Brainy operations
* Provides error type classification and retry information
*/
export declare class BrainyError extends Error {
readonly type: BrainyErrorType;
readonly retryable: boolean;
readonly originalError?: Error;
readonly attemptNumber?: number;
readonly maxRetries?: number;
constructor(message: string, type: BrainyErrorType, retryable?: boolean, originalError?: Error, attemptNumber?: number, maxRetries?: number);
/**
* Create a timeout error
*/
static timeout(operation: string, timeoutMs: number, originalError?: Error): BrainyError;
/**
* Create a network error
*/
static network(message: string, originalError?: Error): BrainyError;
/**
* Create a storage error
*/
static storage(message: string, originalError?: Error): BrainyError;
/**
* Create a not found error
*/
static notFound(resource: string): BrainyError;
/**
* Create a retry exhausted error
*/
static retryExhausted(operation: string, maxRetries: number, lastError?: Error): BrainyError;
/**
* Check if an error is retryable
*/
static isRetryable(error: Error): boolean;
/**
* Convert a generic error to a BrainyError with appropriate classification
*/
static fromError(error: Error, operation?: string): BrainyError;
}