import type { RunResult } from '../db-adapter/statement.js'; import { type QuestionType } from './question-type.js'; export type SearchFeedbackKind = 'shown' | 'accept' | 'reject' | 'hide' | 'click'; export type SearchFeedbackSourceType = 'decision' | 'checkpoint' | 'wiki_page' | 'case' | 'connector_event'; export interface SearchFeedbackInput { result_id: string; session_id?: string | null; query: string; result_source_type: SearchFeedbackSourceType; result_source_id: string; feedback_kind: SearchFeedbackKind; question_type?: QuestionType | null; shown_index: number; result_case_id?: string | null; clicked_result_rank?: number | null; created_at?: string; } export interface ListSearchFeedbackOptions { since?: string; until?: string; limit?: number; } export interface SearchFeedbackRow { feedback_id: string; query: string; query_hash_hex: string; question_type: QuestionType; result_source_type: SearchFeedbackSourceType; result_source_id: string; case_id: string | null; feedback_kind: SearchFeedbackKind; rank_position: number; score_before: number | null; score_after: number | null; session_id: string | null; actor: string; metadata_json: string | null; created_at: string; updated_at: string | null; } export interface RecordSearchFeedbackResult { feedback_id: string; query_hash: string; deduped: boolean; } export interface FeedbackStoreAdapter { prepare(sql: string): { run(...params: unknown[]): RunResult; get(...params: unknown[]): unknown; all(...params: unknown[]): unknown[]; }; transaction?(fn: () => T): T | (() => T); } export declare function hashQuery(query: string): string; export declare function getFeedbackRetentionDays(adapter: FeedbackStoreAdapter): number; export declare function compactShownSearchFeedback(adapter: FeedbackStoreAdapter, retentionDays?: number): number; export declare function recordSearchFeedback(adapter: FeedbackStoreAdapter, input: SearchFeedbackInput): RecordSearchFeedbackResult; export declare function listSearchFeedback(adapter: FeedbackStoreAdapter, options?: ListSearchFeedbackOptions): SearchFeedbackRow[]; //# sourceMappingURL=feedback-store.d.ts.map