import type { LocalRdfAuthorityJournal } from '../storage/accessors/MixDataAccessor'; import type { SolidFsChange, SolidFsEntrySource, SolidFsManifest, SolidFsPrepareInput, SolidFsProjection, SolidFsSyncer } from './types'; export type SolidFsSyncJournalStage = 'local_committed' | 'failed_retryable' | 'failed_permanent' | 'reconcile_required' | 'done'; export interface SolidFsSyncJournalOptions { path: string; now?: () => number; doneRetentionMs?: number; tombstoneRetentionMs?: number; failedPermanentRetentionMs?: number; } export interface SolidFsSyncJournalOperation { id: string; txId?: string; workspace: SolidFsManifest; change: SolidFsChange; stage: SolidFsSyncJournalStage; afterHash?: string; retryCount: number; lastError?: string; createdAt: number; updatedAt: number; doneAt?: number; } export interface SolidFsJournalBootstrapInput { workspace: string; cwd: string; projection?: SolidFsProjection; source?: SolidFsEntrySource; shouldTrackPath?: (relativePath: string) => boolean; resolveResource?: (absolutePath: string, relativePath: string) => string | Promise; } export interface SolidFsJournalBootstrapResult { scanned: number; enqueued: number; skipped: number; } export interface SolidFsJournalReplayResult { attempted: number; completed: number; failed: number; reconcileRequired: number; } export interface SolidFsJournalCompactResult { deletedOps: number; } /** * Per-Pod SolidFS recovery journal. * * This is an outbox for derived work after the authority file is already * committed. It stores enough metadata to replay index/remote refreshes, but * never stores file bodies. */ export declare class SqliteSolidFsSyncJournal implements LocalRdfAuthorityJournal { private readonly db; private readonly now; private readonly doneRetentionMs; private readonly tombstoneRetentionMs; private readonly failedPermanentRetentionMs; constructor(options: SolidFsSyncJournalOptions); close(): void; recordLocalCommitted(change: SolidFsChange, workspace: SolidFsManifest, txId?: string): Promise; getOperation(id: string): SolidFsSyncJournalOperation | undefined; listOperations(stages?: SolidFsSyncJournalStage[]): SolidFsSyncJournalOperation[]; listPending(): SolidFsSyncJournalOperation[]; markDone(id: string): Promise; markRetryableFailure(id: string, error: unknown): Promise; markReconcileRequired(id: string, reason: string): Promise; markFailedPermanent(id: string, error: unknown): Promise; replayPending(syncer: SolidFsSyncer, context?: unknown): Promise; bootstrapWorkspace(input: SolidFsJournalBootstrapInput): Promise; compact(): Promise; private validateOperationForReplay; private getCheckpoint; private listCheckpoints; private upsertCheckpoint; private initializeSchema; } export declare class RootedSolidFsSyncJournal extends SqliteSolidFsSyncJournal { constructor(rootFilePath: string, cwd?: string); } export interface JournaledSolidFsSyncerOptions { syncer: SolidFsSyncer; journal: SqliteSolidFsSyncJournal; } export interface WorkspaceJournaledSolidFsSyncerOptions { syncer: SolidFsSyncer; journalRoot?: string; resolveJournalPath?: (workspace: SolidFsManifest) => string; now?: () => number; doneRetentionMs?: number; tombstoneRetentionMs?: number; failedPermanentRetentionMs?: number; } export declare class JournaledSolidFsSyncer implements SolidFsSyncer { private readonly syncer; private readonly journal; constructor(options: JournaledSolidFsSyncerOptions); shouldTrack(input: SolidFsPrepareInput): boolean; shouldTrackPath(relativePath: string): boolean; sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown, txId?: string): Promise; replayPending(context?: unknown): Promise; compact(): Promise; bootstrapWorkspace(input: Omit & { shouldTrackPath?: (relativePath: string) => boolean; }): Promise; } export declare class WorkspaceJournaledSolidFsSyncer implements SolidFsSyncer { private readonly options; private readonly syncer; private readonly journals; constructor(options: WorkspaceJournaledSolidFsSyncerOptions); shouldTrack(input: SolidFsPrepareInput): boolean; shouldTrackPath(relativePath: string): boolean; initializeWorkspace(workspace: SolidFsManifest, context?: unknown): Promise; sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown, txId?: string): Promise; replayPending(workspace: SolidFsManifest, context?: unknown): Promise; compact(workspace: SolidFsManifest): Promise; journalPathFor(workspace: SolidFsManifest): string; close(): void; private journalFor; } export declare function resolveSolidFsJournalPath(workspace: SolidFsManifest, journalRoot?: string): string; export declare function resolveLocalRdfAuthorityJournalPath(rootFilePath: string, cwd?: string): string;