import { i as writeJsonFile, n as readJsonFile } from "./json-store-WWsFzXub.js";
import path from "path";
//#region src/fs/sync-state.ts
function getSyncStatePath(dataDir) {
	return path.join(dataDir, ".agentic", "sync-state.json");
}
function readSyncState(dataDir) {
	return readJsonFile(getSyncStatePath(dataDir), {});
}
function updateSlugSyncState(dataDir, slug, update) {
	const state = readSyncState(dataDir);
	state[slug] = {
		...state[slug],
		...update
	};
	writeJsonFile(getSyncStatePath(dataDir), state);
}
function getLastGmailSync(dataDir, slug) {
	const ts = readSyncState(dataDir)[slug]?.lastGmailSync;
	return ts ? new Date(ts) : void 0;
}
//#endregion
export { readSyncState as n, updateSlugSyncState as r, getLastGmailSync as t };

//# sourceMappingURL=sync-state-DMZgzpez.js.map