export interface SyncSource { source: string; commit: string; version: string | null; } export interface SyncSnapshot { version: 1; updatedAt: string; sources: SyncSource[]; } /** * Extract the first semver from a changelog: matches the first `## x.y.z` * heading (e.g. `## 1.2.3`). Returns null when no match is found. */ export declare function parseChangelogVersion(changelogText: string): string | null; /** Read `/.sync.json`. Returns null when missing or unparseable. */ export declare function readSyncSnapshot(skillsDir: string): Promise; /** Atomically write `/.sync.json` (temp file + rename). */ export declare function writeSyncSnapshot(skillsDir: string, snapshot: SyncSnapshot): Promise; /** Update the entry matching `entry.source` or append it when missing. */ export declare function upsertSyncSource(snapshot: SyncSnapshot, entry: SyncSource): SyncSnapshot; /** * Diff two file inventories (relative path -> content hash). Files whose * path and hash are identical in both maps are skipped. Results are * aggregated by skill name: * - paths matching `skills///...` map to `` * - any other path maps to its first path segment */ export declare function computeSkillDelta(oldEntries: Map, newEntries: Map): { added: string[]; removed: string[]; modified: string[]; }; /** * Rewrite the pinnedCommit of a matching source inside raw manifest JSON text. * Format-preserving (regex replace, not parse/re-serialize). Throws when the * source has no pinnedCommit entry. */ export declare function rewritePinnedCommit(raw: string, source: string, newHead: string): string;