import { type DbExec } from "../db/client.js"; import type { Visibility } from "../sharing/schema.js"; import type { ReviewActorKind, ReviewComment, ReviewCommentKind, ReviewCommentReaction, ReviewThreadPreference, ReviewMention, ReviewResolutionTarget, ReviewScope, ReviewStatus, ReviewStatusEntry } from "./types.js"; type ReviewThreadStatus = "open" | "resolved"; export interface InsertReviewCommentInput { id?: string; resourceType: string; resourceId: string; threadId?: string | null; parentCommentId?: string | null; targetId?: string | null; kind?: ReviewCommentKind; anchor?: unknown; body: string; authorEmail?: string | null; authorName?: string | null; createdBy?: ReviewActorKind; resolutionTarget?: ReviewResolutionTarget | null; replyRouteTarget?: ReviewResolutionTarget | null; mentions?: ReviewMention[]; ownerEmail?: string | null; orgId?: string | null; visibility?: Visibility | null; metadata?: Record | null; } export interface InsertReviewCommentResult { comment: ReviewComment; replayed: boolean; } export interface UpdateReviewCommentInput { body?: string; anchor?: unknown; mentions?: ReviewMention[]; } export interface QueryReviewCommentsInput { resourceType: string; resourceId: string; scope: ReviewScope; bypassScope?: boolean; includeResolved?: boolean; includeDeleted?: boolean; targetId?: string | null; newestFirst?: boolean; rootOnly?: boolean; resolutionTargets?: readonly (ReviewResolutionTarget | null)[]; unconsumedOnly?: boolean; limit?: number; } export interface GetReviewThreadSummaryInput { resourceType: string; resourceId: string; scope: ReviewScope; bypassScope?: boolean; targetId?: string | null; } export interface ReviewThreadSummary { openCount: number; agentQueueCount: number; } export interface UpsertReviewStatusInput { resourceType: string; resourceId: string; status: ReviewStatus; note?: string | null; updatedBy?: string | null; ownerEmail?: string | null; orgId?: string | null; visibility?: Visibility | null; metadata?: Record | null; } export declare const reviewStore: import("../db/store-registry.js").Store; export declare function ensureReviewTables(): Promise; export declare function setReviewCommentReaction(input: { commentId: string; actorEmail: string; reaction: string; active: boolean; }): Promise<{ commentId: string; actorEmail: string; reaction: string; active: boolean; }>; export declare function setReviewThreadPreference(input: { threadId: string; userEmail: string; muted?: boolean; unread?: boolean; }): Promise<{ threadId: string; muted: boolean; unread: boolean; }>; export declare function setReviewThreadUnreadPreferences(input: { threadIds: string[]; userEmail: string; unread: boolean; resource: { resourceType: string; resourceId: string; }; }): Promise<{ threadId: string; muted: boolean; unread: boolean; }[]>; export declare function getReviewDiscussionStateForComments(comments: Pick[], userEmail: string | null): Promise<{ reactions: Record; threadPreferences: Record; }>; export declare function filterUnmutedReviewThreadRecipients(threadId: string, recipients: string[]): Promise; export declare function insertReviewComment(input: InsertReviewCommentInput): Promise; export declare function insertReviewCommentIdempotently(input: InsertReviewCommentInput & { id: string; }): Promise; export declare function reviewCommentNotificationCompleted(id: string): Promise; export declare function markReviewCommentNotificationCompleted(id: string): Promise; export declare function claimReviewNotificationDelivery(commentId: string, recipientEmail: string): Promise<{ status: "claimed"; token: string; } | { status: "sent" | "busy"; }>; export declare function finishReviewNotificationDelivery(commentId: string, recipientEmail: string, token: string): Promise; export declare function releaseReviewNotificationDelivery(commentId: string, recipientEmail: string, token: string): Promise; export declare function insertReviewReply(input: InsertReviewCommentInput & { threadId: string; parentCommentId: string; }, routeTarget: ReviewResolutionTarget | null, resource: { resourceType: string; resourceId: string; }): Promise; export declare function insertReviewReplyIdempotently(input: InsertReviewCommentInput & { id: string; threadId: string; parentCommentId: string; }, routeTarget: ReviewResolutionTarget | null, resource: { resourceType: string; resourceId: string; }): Promise; export declare function insertReviewCommentWithClient(input: InsertReviewCommentInput, client: DbExec): Promise; export declare function queryReviewComments(input: QueryReviewCommentsInput): Promise; export declare function getReviewThreadSummary(input: GetReviewThreadSummaryInput): Promise; export declare function getReviewCommentById(id: string, scope: ReviewScope, options?: { bypassScope?: boolean; }): Promise; export declare function getReviewThreadRoot(threadId: string, resource: { resourceType: string; resourceId: string; }, scope: ReviewScope, options?: { bypassScope?: boolean; }): Promise; export declare function updateReviewCommentAnchor(input: { commentId: string; resourceType: string; resourceId: string; anchor: unknown; }): Promise; export declare function resolveReviewThread(threadId: string, resolvedBy?: string | null, resource?: { resourceType: string; resourceId: string; }, resolutionNote?: string, status?: ReviewThreadStatus): Promise; export declare function resolveReviewThreadWithClient(client: DbExec, threadId: string, resolvedBy?: string | null, resource?: { resourceType: string; resourceId: string; }, resolutionNote?: string, status?: ReviewThreadStatus): Promise; export declare function routeReviewThread(threadId: string, resolutionTarget: ReviewResolutionTarget, resource: { resourceType: string; resourceId: string; }): Promise; export declare function sendReviewThreadToAgent(threadId: string, resource: { resourceType: string; resourceId: string; }): Promise; export declare function deleteReviewComment(id: string, deletedBy?: string | null): Promise; export declare function updateReviewComment(id: string, input: UpdateReviewCommentInput, resource?: { resourceType: string; resourceId: string; }): Promise; export declare function consumeReviewFeedback(ids: string[], consumedAt?: string, resource?: { resourceType: string; resourceId: string; }): Promise; export declare function upsertReviewStatus(input: UpsertReviewStatusInput): Promise; export declare function getReviewStatus(resourceType: string, resourceId: string, scope: ReviewScope, options?: { bypassScope?: boolean; }): Promise; export declare function __resetReviewInitForTests(): void; export declare function reviewCommentIdForClientOperation(clientOperationId: string): string; export {};