import { type DateZoom } from '../../types/api/paginatedQuery';
import { type DashboardFilterRule, type DashboardFilters } from '../../types/filter';
import { type PullRequestProvider } from '../../types/gitIntegration';
import { type ParametersValuesMap } from '../../types/parameters';
import { type ChartKind } from '../../types/savedCharts';
import { type TraceTaskBase } from '../../types/scheduler';
import { type AiAgentEvidenceExcerpt, type AiAgentJudgeProjectContextEntry, type AiAgentRecommendation, type AiAgentReviewItemPrState, type AiAgentReviewRemediationStatus, type AiAgentRootCause } from './aiAgentReviewClassifierTypes';
export type AiAgentModelConfig = {
    modelName: string;
    modelProvider: string;
    reasoning?: boolean;
};
/**
 * Runtime state captured at pin time for a chart context. When a user pins a
 * chart from a dashboard view, these are the dashboard-level overrides that
 * were applied to the chart on screen at that moment.
 */
export type AiChartRuntimeOverrides = {
    dashboardFilters?: DashboardFilters;
    dashboardParameters?: ParametersValuesMap;
    dateZoom?: DateZoom;
};
export type AiDashboardFilterRule = Omit<DashboardFilterRule, 'id' | 'tileTargets' | 'lockedTabUuids' | 'requiredGroupId'>;
export type AiDashboardFilters = {
    dimensions: AiDashboardFilterRule[];
    metrics: AiDashboardFilterRule[];
    tableCalculations: AiDashboardFilterRule[];
};
export type AiDashboardActiveTab = {
    uuid: string;
    name: string;
};
export type AiDashboardRuntimeOverrides = {
    activeTab?: AiDashboardActiveTab;
    dashboardFilters?: AiDashboardFilters;
    dashboardParameters?: ParametersValuesMap;
    dateZoom?: DateZoom | null;
};
export type AiThread = {
    aiThreadUuid: string;
    organizationUuid: string;
    projectUuid: string;
    createdAt: Date;
    createdFrom: string;
    agentUuid: string | null;
};
export type AiPromptTokenUsage = {
    totalTokens: number;
};
/**
 * Every origin an ai_thread can be created from. Canonical source for the
 * DB column type and the admin/list filters — add new origins here.
 */
export declare const AI_THREAD_CREATED_FROM: readonly ["slack", "web_app", "evals", "scheduler"];
export type AiThreadCreatedFrom = (typeof AI_THREAD_CREATED_FROM)[number];
/** Origins for threads created through the web app path — everything but Slack. */
export declare const AI_WEB_APP_THREAD_CREATED_FROM: readonly ["web_app", "evals", "scheduler"];
export type AiWebAppThreadCreatedFrom = (typeof AI_WEB_APP_THREAD_CREATED_FROM)[number];
/** Origins handled through the Slack path. */
export declare const AI_SLACK_THREAD_CREATED_FROM: readonly ["slack", "web_app"];
export type AiSlackThreadCreatedFrom = (typeof AI_SLACK_THREAD_CREATED_FROM)[number];
/** Origins a thread can be cloned into — Slack and scheduler threads are never clone targets. */
export declare const AI_CLONED_THREAD_CREATED_FROM: readonly ["web_app", "evals"];
export type AiClonedThreadCreatedFrom = (typeof AI_CLONED_THREAD_CREATED_FROM)[number];
export type CreateSlackThread = {
    organizationUuid: string;
    projectUuid: string;
    createdFrom: AiSlackThreadCreatedFrom;
    slackUserId: string;
    slackChannelId: string;
    slackThreadTs: string;
    agentUuid: string | null;
};
export type CreateWebAppThread = {
    organizationUuid: string;
    projectUuid: string;
    userUuid: string;
    createdFrom: AiWebAppThreadCreatedFrom;
    agentUuid: string | null;
    embedSpaceUuid?: string | null;
};
export type AiPrompt = {
    organizationUuid: string;
    projectUuid: string;
    agentUuid: string | null;
    promptUuid: string;
    threadUuid: string;
    createdByUserUuid: string;
    prompt: string;
    createdAt: Date;
    response: string | null;
    errorMessage: string | null;
    humanScore: number | null;
    modelConfig: AiAgentModelConfig | null;
};
export type SlackPrompt = AiPrompt & {
    response_slack_ts: string;
    slackUserId: string;
    slackChannelId: string;
    promptSlackTs: string;
    slackThreadTs: string;
};
export type AiWebAppPrompt = AiPrompt & {
    userUuid: string;
};
export declare const isSlackPrompt: (prompt: AiPrompt) => prompt is SlackPrompt;
export type CreateSlackPrompt = {
    threadUuid: string;
    createdByUserUuid: string;
    prompt: string;
    modelConfig?: AiAgentModelConfig;
    slackUserId: string;
    slackChannelId: string;
    promptSlackTs: string;
};
export type AiPromptContextItemInput = {
    type: 'chart';
    chartUuid: string;
    chartSlug?: string | null;
    runtimeOverrides?: AiChartRuntimeOverrides;
} | {
    type: 'dashboard';
    dashboardUuid: string;
    dashboardSlug?: string | null;
    runtimeOverrides?: AiDashboardRuntimeOverrides;
} | {
    type: 'thread';
    threadUuid: string;
    promptUuid?: string | null;
} | {
    type: 'file';
    path: string;
} | {
    type: 'repository';
    fullName: string;
} | {
    type: 'pull_request';
    prUrl: string;
} | {
    type: 'proposed_change';
    fingerprint: string;
} | {
    type: 'review_finding';
    fingerprint: string;
} | {
    type: 'preview_environment';
    previewProjectUuid: string;
};
export type AiPromptContextInput = AiPromptContextItemInput[];
export type AiPromptProposedChangePayload = {
    changeKind: 'project_context';
    entry: AiAgentJudgeProjectContextEntry;
} | {
    changeKind: 'semantic_layer';
    recommendation: AiAgentRecommendation;
};
export type AiPromptContextItem = {
    type: 'chart';
    chartUuid: string;
    chartSlug: string | null;
    pinnedVersionUuid: string | null;
    displayName: string | null;
    runtimeOverrides: AiChartRuntimeOverrides | null;
    chartKind: ChartKind | null;
} | {
    type: 'dashboard';
    dashboardUuid: string;
    dashboardSlug: string | null;
    pinnedVersionUuid: string | null;
    displayName: string | null;
    runtimeOverrides: AiDashboardRuntimeOverrides | null;
} | {
    type: 'thread';
    threadUuid: string;
    promptUuid: string | null;
    displayName: string | null;
} | {
    type: 'file';
    path: string;
} | {
    type: 'repository';
    fullName: string;
} | {
    type: 'pull_request';
    prUrl: string;
    prNumber: number | null;
    provider: PullRequestProvider | null;
    status: AiAgentReviewItemPrState | null;
    title: string | null;
} | {
    type: 'proposed_change';
    fingerprint: string;
    payload: AiPromptProposedChangePayload;
} | {
    type: 'review_finding';
    fingerprint: string;
    title: string;
    rootCause: AiAgentRootCause;
    findingCount: number;
    evidenceExcerpts: AiAgentEvidenceExcerpt[];
} | {
    type: 'preview_environment';
    previewProjectUuid: string;
    previewThreadUuid: string | null;
    status: AiAgentReviewRemediationStatus | null;
    projectName: string | null;
};
export type AiPromptContext = AiPromptContextItem[];
export type CreateWebAppPrompt = {
    threadUuid: string;
    createdByUserUuid: string;
    prompt: string;
    context?: AiPromptContextInput;
    modelConfig?: AiAgentModelConfig;
    /** Inject as a hidden turn (agent responds, UI hides the user bubble). */
    hidden?: boolean;
};
export type UpdateSlackResponse = {
    promptUuid: string;
    response?: string;
    errorMessage?: string;
    humanScore?: number | null;
    tokenUsage?: AiPromptTokenUsage | null;
};
export type UpdateWebAppResponse = {
    promptUuid: string;
    response?: string;
    errorMessage?: string;
    humanScore?: number | null;
    tokenUsage?: AiPromptTokenUsage | null;
};
export type UpdateSlackResponseTs = {
    promptUuid: string;
    responseSlackTs: string;
};
export type SlackPromptJobPayload = TraceTaskBase & {
    slackPromptUuid: string;
};
export type AiAgentEvalRunJobPayload = TraceTaskBase & {
    evalRunResultUuid: string;
    evalRunUuid: string;
    agentUuid: string;
    threadUuid: string;
};
export type AiAgentReviewClassifierEventType = 'response_saved' | 'feedback_changed';
export type AiAgentReviewClassifierJobPayload = TraceTaskBase & {
    eventType: AiAgentReviewClassifierEventType;
    organizationUuid: string;
    projectUuid: string;
    agentUuid: string;
    threadUuid: string;
    promptUuid: string;
};
export type AiAgentReviewWritebackJobPayload = TraceTaskBase & {
    fingerprint: string;
    organizationUuid: string;
    projectUuid: string;
    remediationUuid?: string;
};
export type AiAgentReviewRemediationPreviewJobPayload = TraceTaskBase & {
    fingerprint: string;
    remediationUuid: string;
    prUrl: string;
    startedAt: number;
};
export type AiAgentReviewRemediationCompileJobPayload = TraceTaskBase & {
    fingerprint: string;
    remediationUuid: string;
    previewProjectUuid: string;
    compileJobUuid: string;
    startedAt: number;
};
export type AiAgentReviewRemediationRunJobPayload = TraceTaskBase & {
    fingerprint: string;
    remediationUuid: string;
    agentUuid: string;
    threadUuid: string;
};
export type EmbedArtifactVersionJobPayload = TraceTaskBase & {
    artifactVersionUuid: string;
    title: string | null;
    description: string | null;
};
export type GenerateArtifactQuestionJobPayload = TraceTaskBase & {
    artifactVersionUuid: string;
    title: string | null;
    description: string | null;
};
export type CloneThread = {
    sourceThreadUuid: string;
    sourcePromptUuid: string;
    targetUserUuid: string;
    createdFrom?: AiClonedThreadCreatedFrom;
};
//# sourceMappingURL=requestTypes.d.ts.map