import { Querier } from '@platform-modules/db';
import { e as CommentAuthor, b as CommentTarget, d as CommentStatus, a as CommentsSchema, A as Actor, S as StoreOpts, c as Comment, C as CommentInput, j as Sanitize } from './errors-D4Ae3zmj.js';
export { o as CommentModerationError, g as CommentNotFoundError, h as CommentSanitizationError, n as isCommentError } from './errors-D4Ae3zmj.js';
import 'drizzle-orm/pg-core';

/** Default classify timeout — fail-safe lands pending on hang (spec §2). */
declare const CLASSIFY_TIMEOUT_MS = 10000;
type ModeratableStatus = Extract<CommentStatus, 'published' | 'pending' | 'spam'>;
interface CommentModerator {
    classify(c: {
        body: string;
        author: CommentAuthor;
        target: CommentTarget;
    }): Promise<{
        status: ModeratableStatus;
        reason?: string;
    }>;
}
interface AiClassifyClient {
    classify(input: {
        body: string;
        author: CommentAuthor;
        target: CommentTarget;
    }): Promise<{
        spamScore: number;
    }>;
}
/**
 * postModerated — classify then insert with moderator verdict (system authority).
 * Fail-safe: throw/timeout → pending, NEVER published.
 */
declare function postModerated(db: Querier<CommentsSchema>, input: CommentInput, actor: Actor | null, sanitize: Sanitize, moderator: CommentModerator, opts?: StoreOpts): Promise<Comment>;
/**
 * moderate — re-classify an existing comment (moderator queue).
 * Classifier errors propagate; existing status unchanged on failure.
 */
declare function moderate(db: Querier<CommentsSchema>, id: string, moderator: CommentModerator, actor: Actor, opts?: StoreOpts): Promise<Comment>;
/** Reference ai-backed moderator — client errors propagate to caller fail-safe. */
declare function aiModerator(client: AiClassifyClient, opts?: {
    threshold?: number;
}): CommentModerator;

export { type AiClassifyClient, CLASSIFY_TIMEOUT_MS, type CommentModerator, aiModerator, moderate, postModerated };
