/** * Persistent daily maintenance marker. * * Records the last calendar date (LOCAL time) on which a given heavy * maintenance task ran, so it fires AT MOST ONCE PER DAY and SURVIVES * server restarts. This breaks the freeze→restart loop that occurred when * startup consolidation / daily rotation re-ran on every process restart. * * The marker is a tiny JSON map of `{ markerKey: "YYYY-MM-DD" }` stored at * `/.remote-copilot-mcp/daily-maintenance.json`. It is only read and * written at startup / on a slow scheduler tick — never in a hot loop — so * synchronous fs calls are fine. All fs/JSON errors are swallowed: a missing * or corrupt file is treated as "not run today" so the work still happens * (safe default), and a failed write never crashes the caller. */ /** * LOCAL calendar date as zero-padded `YYYY-MM-DD`. * Uses getFullYear/getMonth+1/getDate — NOT toISOString(), which is UTC and * would flip the "day" boundary for users in non-UTC timezones. */ export declare function dailyKey(d?: Date): string; /** * Pure, testable predicate: does the marker map say `key` ran on date `d`? * True iff `map[key] === dailyKey(d)`. */ export declare function markerSaysRanOn(map: Record, key: string, d: Date): boolean; /** Best-effort read of the marker map at an explicit path. Missing/corrupt file → empty map. */ export declare function readMarkerMapFrom(filePath: string): Record; /** * True iff the marker file at `filePath` says `key` ran on today's (LOCAL) * date. A missing/corrupt marker file returns false (safe default → work runs). */ export declare function hasRunTodayAt(filePath: string, key: string, now?: Date): boolean; /** * Best-effort claim of "ran today" for `key` in the marker file at `filePath`. * Reads the existing map, sets `map[key] = dailyKey(now)`, ensures the * directory exists, and writes it. Swallows ALL fs/JSON errors — never throws. */ export declare function markRanTodayAt(filePath: string, key: string, now?: Date): void; /** * True iff the stored value for `key` equals today's (LOCAL) date. * A missing/corrupt marker file returns false (safe default → work runs). */ export declare function hasRunToday(key: string, now?: Date): boolean; /** * Best-effort claim of "ran today" for `key`. Delegates to markRanTodayAt with * the real marker file path. Swallows ALL fs/JSON errors — never throws. */ export declare function markRanToday(key: string, now?: Date): void; //# sourceMappingURL=daily-marker.d.ts.map