import type { IntegrationMetadataRecord, IntegrationId } from "../store.js";
import type { MetadataStorage } from "./index.js";
export interface LocalMetadataStorageConfig {
    rootDir: string;
    maxTotalCacheMB?: number;
    maxSingleFileMB?: number;
}
/**
 * Local filesystem storage backend for integration metadata.
 *
 * Metadata is stored as gron-formatted files for grep-ability:
 * {rootDir}/.superblocks/integration_cache/{sessionId}/{integrationId}.gron
 *
 * Features:
 * - Per-session isolation (each server instance gets unique session ID)
 * - Automatic cleanup of old sessions on startup
 * - Periodic cleanup of inactive files (15 min TTL based on access time)
 * - Touch-on-access to keep active files alive (updates atime only, preserves mtime)
 * - Configurable size limits with automatic eviction/truncation
 */
export declare class LocalMetadataStorage implements MetadataStorage {
    private readonly SUPERBLOCKS_SYSTEM_DIR;
    private readonly CACHE_DIR;
    private readonly INACTIVITY_TTL_MS;
    private readonly CLEANUP_INTERVAL_MS;
    readonly rootDir: string;
    readonly maxSingleFileMB: number;
    readonly maxTotalCacheMB: number;
    private readonly sessionId;
    private cleanupInterval?;
    constructor(config: LocalMetadataStorageConfig);
    initialize(): Promise<void>;
    saveMetadata(integrationId: IntegrationId, metadata: IntegrationMetadataRecord): Promise<void>;
    loadMetadata(integrationId: IntegrationId): Promise<string | null>;
    getAge(integrationId: IntegrationId): Promise<number | null>;
    invalidate(integrationId: IntegrationId): Promise<void>;
    cleanup(): Promise<void>;
    private startPeriodicCleanup;
    private cleanupInactiveFiles;
    /**
     * Calculate total disk usage of the current session's cache.
     */
    private getTotalCacheSizeMB;
    /**
     * Ensure we have room in the cache. If over limit, delete oldest files.
     */
    private enforceMaxCacheSize;
    private touchFile;
    private cleanupOldSessions;
    private getCacheBaseDir;
    private getSessionDir;
    private getGronPath;
    private ensureSessionDirExists;
}
//# sourceMappingURL=local.d.ts.map