import Database from 'better-sqlite3'; import { AuditSync } from '../audit/audit-sync'; import { AgentdGatewayClient } from '../gateway/gateway-client'; import { DeviceAuth } from '../gateway/auth'; import { Wallet } from '../wallet/wallet'; /** * Periodic sync scheduler (spec §7.6, §9.2). * * Runs every 5 minutes and performs: * 1. Fetch org policy from Gateway -> save to synced_policies * 2. Sync pending audit entries to Gateway * 3. Check VC revocation status for active credentials */ export declare class SyncScheduler { private readonly gatewayClient; private readonly auditSync; private readonly wallet; private readonly db; private readonly projectId; private readonly intervalMs; private readonly onPolicySynced?; private readonly deviceAuth?; private timer?; private lastSyncTime; /** Threshold in seconds before expiry to trigger proactive refresh */ private static readonly TOKEN_REFRESH_THRESHOLD_SECONDS; constructor(gatewayClient: AgentdGatewayClient, auditSync: AuditSync, wallet: Wallet, db: Database.Database, projectId: string, intervalMs?: number, onPolicySynced?: ((time: number) => void) | undefined, deviceAuth?: DeviceAuth | undefined); start(): void; stop(): void; runOnce(): Promise; /** Returns the ISO timestamp of the last completed sync, or null if no sync has run yet. */ getLastSyncTime(): string | null; /** * Proactively refresh the device session token if it is expiring soon. * Runs before other sync tasks to ensure they use a valid token. */ private refreshTokenIfNeeded; private syncOrgPolicy; private syncAudit; private checkVCRevocation; } //# sourceMappingURL=sync-scheduler.d.ts.map