packfs-core
Version:
Semantic filesystem operations for LLM agent frameworks with natural language understanding. See LLM_AGENT_GUIDE.md for copy-paste examples.
80 lines • 3.04 kB
TypeScript
/**
* Production-ready disk-based semantic filesystem backend
* Implements persistent semantic indexing and full LSFS operations
*/
import { SemanticFileSystemInterface } from './interface.js';
import { FileAccessIntent, FileAccessResult, ContentUpdateIntent, ContentUpdateResult, OrganizationIntent, OrganizationResult, DiscoveryIntent, DiscoveryResult, RemovalIntent, RemovalResult, WorkflowIntent, WorkflowResult, NaturalLanguageIntent, NaturalLanguageResult, SemanticConfig } from './types.js';
/**
* Production disk-based semantic filesystem with persistent indexing
*/
export declare class DiskSemanticBackend extends SemanticFileSystemInterface {
private readonly basePath;
private readonly indexPath;
private index;
private indexLoaded;
private readonly maxFileSize;
private readonly indexVersion;
private readonly logger;
private readonly errorRecovery;
private readonly excludedDirectories;
private readonly maxIndexingDepth;
private visitedPaths;
constructor(basePath: string, config?: Partial<SemanticConfig>);
/**
* Initialize the semantic backend and load/create index
*/
initialize(): Promise<void>;
accessFile(intent: FileAccessIntent): Promise<FileAccessResult>;
updateContent(intent: ContentUpdateIntent): Promise<ContentUpdateResult>;
organizeFiles(intent: OrganizationIntent): Promise<OrganizationResult>;
discoverFiles(intent: DiscoveryIntent): Promise<DiscoveryResult>;
removeFiles(intent: RemovalIntent): Promise<RemovalResult>;
executeWorkflow(workflow: WorkflowIntent): Promise<WorkflowResult>;
interpretNaturalLanguage(intent: NaturalLanguageIntent): Promise<NaturalLanguageResult>;
private ensureIndexLoaded;
private loadIndex;
private saveIndex;
private rebuildIndex;
private indexDirectory;
private updateIndexIfNeeded;
private hasModificationsSince;
private updateFileIndex;
private normalizePath;
private getFullPath;
private fileExists;
private isBinaryFile;
private calculateHash;
private extractKeywords;
private isStopWord;
private generatePreview;
private getMimeType;
private generateSemanticSignature;
private addToKeywordMap;
private removeFromKeywordMap;
private handleSingleFileAccessWithBasePath;
private handleSingleFileAccess;
private getFileMetadata;
private getFileMetadataWithBasePath;
private generateFilePreview;
private performContentUpdate;
private findFilesByTarget;
private findBySemanticQuery;
private findByCriteria;
private findByPattern;
private createDirectory;
private moveFiles;
private copyFiles;
private groupFiles;
private listFiles;
private findFiles;
private searchContent;
private searchSemantic;
private searchIntegrated;
private performDeletion;
private rollbackSteps;
/**
* Cleanup method for the disk backend
*/
cleanup(): Promise<void>;
}
//# sourceMappingURL=disk-semantic-backend.d.ts.map