export interface JournalMeta { format: 'jsonl'; tailHash: string; byteLength: number; lineCount: number; } export interface RemotePeerConfig { url: string; repoId: string; name?: string; lastAckHash?: string; lastAckAt?: string; } export interface RemoteConfigFile { default?: RemotePeerConfig; [name: string]: RemotePeerConfig | undefined; } export interface RemoteSecrets { apiKey?: string; } export interface HttpResponse { status: number; body: string; } export interface HttpTransport { get(url: string, headers?: Record): Promise; post(url: string, body: unknown, headers?: Record): Promise; } export interface RemoteStatus { local: JournalMeta | null; remote: JournalMeta | null; synced: boolean; diverged: boolean; } export interface PushResult { pushed: boolean; tailHash: string; previousTail?: string; } export interface PullResult { path: string; tailHash: string; lineCount: number; } export declare function defaultFetchTransport(): HttpTransport; export declare function trellisDir(rootPath: string): string; export declare function opsPathForRoot(rootPath: string): string; export declare function configPathForRoot(rootPath: string): string; export declare function secretsPathForRoot(rootPath: string): string; export declare function readRemoteSecrets(rootPath: string): RemoteSecrets; export declare function writeRemoteSecrets(rootPath: string, secrets: RemoteSecrets): void; export declare function readRemoteConfig(rootPath: string): RemoteConfigFile; export declare function writeRemoteConfig(rootPath: string, remote: RemoteConfigFile): void; export declare function getDefaultRemote(rootPath: string): RemotePeerConfig | null; export declare function authHeaders(rootPath: string): Record; export declare function readJournalMeta(opsPath: string): JournalMeta | null; export declare function fetchRemoteTail(peer: RemotePeerConfig, transport: HttpTransport, headers: Record): Promise; export declare function remoteStatus(rootPath: string, transport?: HttpTransport): Promise; export declare function pushRemoteLedger(rootPath: string, transport?: HttpTransport, opts?: { dryRun?: boolean; }): Promise; export declare function pullRemoteLedger(rootPath: string, transport?: HttpTransport, opts?: { to?: string; }): Promise; export declare function validateJsonl(raw: string): void; export declare function tailIsNewer(a: string, b: string): boolean; export declare function installPulledOps(rootPath: string, opts?: { from?: string; force?: boolean; }): { installed: boolean; from: string; backup?: string; }; export declare function addRemote(rootPath: string, url: string, opts?: { name?: string; repoId?: string; apiKey?: string; }): RemotePeerConfig; export declare function remoteAckWindowMs(): number; export declare function hasRecentRemoteAck(rootPath: string): boolean; export declare function assertRecentRemoteAckForRepair(rootPath: string, opts?: { iKnow?: boolean; confirmDestructive?: boolean; }): void; /** In-memory sprite for tests. */ export declare class MemoryRemoteSprite implements HttpTransport { private tips; private checkpoints; get(url: string): Promise; post(url: string, body: unknown): Promise; /** Test helper: set remote ahead of local without push from client. */ seedRemote(repoId: string, meta: JournalMeta, checkpoint: string): void; } //# sourceMappingURL=oplog-remote.d.ts.map