packfs-core
Version:
Semantic filesystem operations for LLM agent frameworks with natural language understanding. See LLM_AGENT_GUIDE.md for copy-paste examples.
49 lines • 1.51 kB
TypeScript
/**
* RxDB storage backend for NoSQL document-based storage
*/
import type { FileMetadata } from '../core/types.js';
import type { BackendInterface } from './types.js';
import { RxDatabase, RxCollection, RxDocument } from 'rxdb';
export interface FileDocument {
path: string;
data: string;
size: number;
mtime: number;
isDirectory: boolean;
permissions: number;
mimeType?: string;
}
export type FileDocumentType = RxDocument<FileDocument>;
export type FileCollection = RxCollection<FileDocument>;
export interface RxDBDatabase extends RxDatabase<{
files: FileCollection;
}> {
}
export interface RxDBBackendOptions {
name?: string;
inMemory?: boolean;
password?: string;
}
export declare class RxDBBackend implements BackendInterface {
private db?;
private readonly logger;
private readonly options;
constructor(options?: RxDBBackendOptions);
initialize(): Promise<void>;
read(path: string): Promise<Buffer>;
write(path: string, data: Buffer): Promise<void>;
exists(path: string): Promise<boolean>;
stat(path: string): Promise<FileMetadata>;
list(path: string): Promise<string[]>;
delete(path: string): Promise<void>;
cleanup(): Promise<void>;
/**
* Get direct access to the RxDB database (for advanced queries)
*/
getDatabase(): RxDBDatabase | undefined;
/**
* Create indexes for better query performance
*/
createIndexes(): Promise<void>;
}
//# sourceMappingURL=rxdb.d.ts.map