export interface SeenMarker { seenAt: number; id?: string; [key: string]: unknown; } interface StateKey { owner: string; repo: string; pr: number; } /** Compute a 16-hex-char SHA-256 prefix of a comment body. */ export declare function hashBody(body: string): string; /** * Classify a candidate item against the seen map. * * - "new" — no marker exists; surface the body and write the marker. * - "edited" — marker exists but stored hash differs from the current body; * surface the updated body and update the marker hash. * - "unchanged" — marker exists and hash matches (or marker has no hash, which * is treated conservatively as unchanged). */ export declare function classifyItem(id: string, body: string, map: Map): "new" | "edited" | "unchanged"; /** * Read the seen/ directory once and return a Set of already-seen IDs. * Prefer this over repeated hasSeen() calls to avoid EMFILE on large PRs. * Returns an empty Set if the directory does not yet exist. */ export declare function loadSeenSet(key: StateKey): Promise>; /** * Read the seen/ directory and return a Map from ID to SeenMarker. * Used when the caller needs the stored bodyHash to detect in-place edits. * Returns an empty Map if the directory does not yet exist. * * Map keys are the stored `id` field when present (guarding against * case-insensitive filesystem collisions), falling back to the filename for * legacy markers that predate this field. */ export declare function loadSeenMap(key: StateKey): Promise>; /** Return true if a "seen" marker exists for this id. */ export declare function hasSeen(key: StateKey, id: string): Promise; /** * Write (or update) a "seen" marker for this id, storing the body hash so * in-place edits can be detected on future fetches. * * - First call (no existing marker): creates `{ seenAt: now, bodyHash, id }`. * - Subsequent call, hash unchanged: no-op (skips the write). * - Subsequent call, hash changed: updates `bodyHash`, preserves original `seenAt`. * * All errors are silently swallowed — the marker is best-effort. */ export declare function markSeen(key: StateKey, id: string, body: string): Promise; export declare function markReviewInlineThreads(key: StateKey, reviewId: string, inlineThreadIds: readonly string[]): Promise; /** * Write a marker after Shepherd successfully replies to a review thread. * * `previousBody` suppresses stale GitHub fetches that have not yet included the new reply. * `body` suppresses the expected final transcript once GitHub includes Shepherd's reply. */ export declare function markReplySeen(key: StateKey, id: string, previousBody: string, body: string, replyBody: string): Promise; /** Read the full marker for inspection (returns null on miss or error). */ export declare function readSeenMarker(key: StateKey, id: string): Promise; export {};