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
102 lines
3.3 KiB
TypeScript
102 lines
3.3 KiB
TypeScript
/**
|
|
* Universal File System implementation
|
|
* Browser: Uses OPFS (Origin Private File System)
|
|
* Node.js: Uses built-in fs/promises
|
|
* Serverless: Uses memory-based fallback
|
|
*/
|
|
/**
|
|
* Universal file operations interface
|
|
*/
|
|
export interface UniversalFS {
|
|
readFile(path: string, encoding?: string): Promise<string>;
|
|
writeFile(path: string, data: string, encoding?: string): Promise<void>;
|
|
mkdir(path: string, options?: {
|
|
recursive?: boolean;
|
|
}): Promise<void>;
|
|
exists(path: string): Promise<boolean>;
|
|
readdir(path: string): Promise<string[]>;
|
|
readdir(path: string, options: {
|
|
withFileTypes: true;
|
|
}): Promise<{
|
|
name: string;
|
|
isDirectory(): boolean;
|
|
isFile(): boolean;
|
|
}[]>;
|
|
unlink(path: string): Promise<void>;
|
|
stat(path: string): Promise<{
|
|
isFile(): boolean;
|
|
isDirectory(): boolean;
|
|
}>;
|
|
access(path: string, mode?: number): Promise<void>;
|
|
}
|
|
export declare const readFile: (path: string, encoding?: string) => Promise<string>;
|
|
export declare const writeFile: (path: string, data: string, encoding?: string) => Promise<void>;
|
|
export declare const mkdir: (path: string, options?: {
|
|
recursive?: boolean;
|
|
}) => Promise<void>;
|
|
export declare const exists: (path: string) => Promise<boolean>;
|
|
export declare const readdir: {
|
|
(path: string): Promise<string[]>;
|
|
(path: string, options: {
|
|
withFileTypes: true;
|
|
}): Promise<{
|
|
name: string;
|
|
isDirectory(): boolean;
|
|
isFile(): boolean;
|
|
}[]>;
|
|
};
|
|
export declare const unlink: (path: string) => Promise<void>;
|
|
export declare const stat: (path: string) => Promise<{
|
|
isFile(): boolean;
|
|
isDirectory(): boolean;
|
|
}>;
|
|
export declare const access: (path: string, mode?: number) => Promise<void>;
|
|
declare const _default: {
|
|
readFile: (path: string, encoding?: string) => Promise<string>;
|
|
writeFile: (path: string, data: string, encoding?: string) => Promise<void>;
|
|
mkdir: (path: string, options?: {
|
|
recursive?: boolean;
|
|
}) => Promise<void>;
|
|
exists: (path: string) => Promise<boolean>;
|
|
readdir: {
|
|
(path: string): Promise<string[]>;
|
|
(path: string, options: {
|
|
withFileTypes: true;
|
|
}): Promise<{
|
|
name: string;
|
|
isDirectory(): boolean;
|
|
isFile(): boolean;
|
|
}[]>;
|
|
};
|
|
unlink: (path: string) => Promise<void>;
|
|
stat: (path: string) => Promise<{
|
|
isFile(): boolean;
|
|
isDirectory(): boolean;
|
|
}>;
|
|
access: (path: string, mode?: number) => Promise<void>;
|
|
};
|
|
export default _default;
|
|
export declare const promises: {
|
|
readFile: (path: string, encoding?: string) => Promise<string>;
|
|
writeFile: (path: string, data: string, encoding?: string) => Promise<void>;
|
|
mkdir: (path: string, options?: {
|
|
recursive?: boolean;
|
|
}) => Promise<void>;
|
|
exists: (path: string) => Promise<boolean>;
|
|
readdir: {
|
|
(path: string): Promise<string[]>;
|
|
(path: string, options: {
|
|
withFileTypes: true;
|
|
}): Promise<{
|
|
name: string;
|
|
isDirectory(): boolean;
|
|
isFile(): boolean;
|
|
}[]>;
|
|
};
|
|
unlink: (path: string) => Promise<void>;
|
|
stat: (path: string) => Promise<{
|
|
isFile(): boolean;
|
|
isDirectory(): boolean;
|
|
}>;
|
|
access: (path: string, mode?: number) => Promise<void>;
|
|
};
|