import { CreateFeedbackRequest, Feedback, FeedbackScreenshot, type FeedbackSubmissionResponse } from "@opengeni/contracts"; import { type Database } from "./database.js"; export declare class FeedbackConflictError extends Error { } export declare class FeedbackTargetNotFoundError extends Error { } /** A screenshot as stored on the row: its public metadata plus where the bytes are. */ export type StoredFeedbackScreenshot = FeedbackScreenshot & { objectKey: string; }; /** * What the server records with a report, for whoever investigates it: the * server build that received it and, when the report names the chat in view * and its author can read that chat, the chat's state and latest turn at that * moment. Stored once with the report; never returned to clients. */ export interface FeedbackDiagnostics { server: { version?: string; revision?: string; }; /** * The person a service principal recorded the report for, such as the * Teams user rating an organization agent's reply, which is recorded as * the agent. */ onBehalfOf?: { subjectId: string; }; session?: { id: string; status: string; visibility: string; lastSequence: number; latestTurn?: { id: string; status: string; model: string; reasoningEffort: string; createdAt: string; startedAt: string | null; finishedAt: string | null; }; }; } /** Object key for one screenshot. The digest makes a different image a different object. */ export declare function feedbackScreenshotObjectKey(input: { accountId: string; workspaceId: string; idempotencyKey: string; index: number; sha256: string; }): string; /** * Creates feedback. Screenshot bytes must already be in object storage under * {@link feedbackScreenshotObjectKey}; `screenshots` describes them in order. */ export declare function createFeedback(db: Database, input: { accountId: string; workspaceId: string; subjectId: string; principalKind: string | null; request: CreateFeedbackRequest; screenshots?: StoredFeedbackScreenshot[]; /** The receiving server's version and deployment revision, when known. */ server?: { version?: string | undefined; revision?: string | undefined; }; /** See FeedbackDiagnostics.onBehalfOf. */ onBehalfOf?: { subjectId: string; }; }): Promise; /** One of the author's own screenshots, or null when it is not theirs or does not exist. */ export declare function getOwnFeedbackScreenshot(db: Database, input: { workspaceId: string; subjectId: string; feedbackId: string; index: number; }): Promise; /** Exact scope: omitting sessionId returns general feedback only, never private-session rows. */ export declare function listOwnFeedback(db: Database, input: { workspaceId: string; subjectId: string; sessionId?: string | undefined; limit?: number | undefined; includeTurns?: boolean | undefined; }): Promise;