@brianlovin/notion-skills
Version:
Sync agent skills from a Notion database to Claude Code, Codex, OpenCode, Cursor, Gemini CLI.
18 lines • 731 B
JavaScript
export function decideSyncAction(args) {
const { localChanged, remoteChanged, localMtime, remoteEdited } = args;
if (!localChanged && !remoteChanged)
return "skip";
if (localChanged && !remoteChanged)
return "push";
if (!localChanged && remoteChanged)
return "pull";
// Both changed → conflict. Newer side wins.
// If timestamps are missing or equal, default to remote (safer: Notion
// is the canonical store, and the user always has Notion's history).
if (!localMtime || !remoteEdited)
return "conflict-pull";
return localMtime.getTime() > remoteEdited.getTime()
? "conflict-push"
: "conflict-pull";
}
//# sourceMappingURL=sync-decision.js.map