import { z } from 'zod';
import type { ApiSuccess } from '../../types/api/success';
import type { PullRequestProvider } from '../../types/gitIntegration';
import type { MetricQuery } from '../../types/metricQuery';
import type { QueryHistoryStatus } from '../../types/queryHistory';
import type { AiAgentDocumentStructuredSummary } from './documentTypes';
import type { AiAgentReviewClassifierEventType } from './requestTypes';
export type AiAgentReviewClassifierSubject = {
    type: 'turn_review';
    assistantPromptUuid: string;
    threadUuid: string;
    agentUuid: string;
    projectUuid: string;
    organizationUuid: string;
};
export type AiAgentInteractionSource = 'app' | 'slack';
export type AiAgentTurnSignalSourceRef = {
    source: 'app';
    threadUuid: string;
    promptUuid: string;
    appUrl: string | null;
} | {
    source: 'slack';
    channelId: string;
    threadTs: string | null;
    messageTs: string;
    slackPermalink: string | null;
};
export type AiAgentTurnSignal = 'normal_refinement' | 'implicit_correction' | 'explicit_dispute' | 'retry_after_failure' | 'output_shape_correction' | 'new_question' | 'acceptance_or_continuation' | 'product_capability_request' | 'human_intervention' | 'ambiguous';
export type AiAgentImplicitSignalSource = 'next_user_correction' | 'next_user_dispute' | 'next_user_retry' | 'output_shape_correction' | 'tool_error' | 'assistant_no_answer' | 'product_capability_request' | 'human_intervention';
export type AiAgentReviewClassifierConfidence = 'low' | 'medium' | 'high';
export type AiAgentRootCause = 'semantic_layer' | 'project_context' | 'agent_configuration' | 'product_capability' | 'runtime_reliability' | 'feedback_quality' | 'not_a_failure' | 'ambiguous';
export type AiAgentFixTarget = 'semantic_yaml_patch' | 'project_context_rule' | 'agent_configuration_change' | 'dbt_modeling_ticket' | 'semantic_layer_ticket' | 'product_capability_ticket' | 'runtime_reliability_ticket' | 'feedback_needed' | 'no_action';
export type AiAgentConfigurationSetting = 'instructions' | 'knowledge_documents' | 'data_access' | 'self_improvement' | 'sql_mode' | 'mcp_servers' | 'explore_tags' | 'space_access' | 'user_or_group_access' | 'unknown';
export type AiAgentAvailableCapability = 'semantic_query' | 'chart_generation' | 'dashboard_generation' | 'data_value_search' | 'chart_data_access' | 'sql_runner' | 'context_improvement' | 'semantic_change_proposals' | 'content_editing' | 'mcp_tools';
export type AiAgentKnowledgeDocumentSnapshot = {
    uuid: string;
    name: string;
    updatedAt: string;
    summary: AiAgentDocumentStructuredSummary;
};
export type AiAgentMcpServerSnapshot = {
    name: string;
    enabledToolNames: string[];
};
export type AiAgentConfigSnapshot = {
    capturedAt: string;
    agentUpdatedAt: string | null;
    settings: AiAgentConfigurationSetting[];
    availableCapabilities: AiAgentAvailableCapability[];
    instructionHash: string | null;
    instructionSummary: string | null;
    knowledgeDocuments: AiAgentKnowledgeDocumentSnapshot[];
    mcpServers: AiAgentMcpServerSnapshot[];
};
export declare const getAiAgentConfigSnapshotHash: (snapshot: AiAgentConfigSnapshot) => string;
export type AiAgentRuntimeContextSnapshot = {
    userUuid: string | null;
    canRunSql: boolean;
    canManageAgent: boolean;
};
export type AiAgentModelMetadata = {
    provider: string | null;
    model: string | null;
};
export type AiAgentEvidenceWindow = {
    userPromptUuid: string;
    explicitFeedbackUuid: string | null;
    nextUserPromptUuid: string | null;
    previousPromptUuids: string[];
};
export type AiAgentSemanticTargetRef = {
    type: 'model';
    modelName: string;
} | {
    type: 'explore';
    modelName: string;
    exploreName: string;
} | {
    type: 'join';
    modelName: string;
    joinName: string;
    exploreName?: string;
} | {
    type: 'dimension';
    modelName: string;
    dimensionName: string;
} | {
    type: 'metric';
    modelName: string;
    metricName: string;
    dimensionName?: string;
} | {
    type: 'additional_dimension';
    modelName: string;
    parentDimensionName: string;
    dimensionName: string;
} | {
    type: 'required_filter';
    modelName: string;
    exploreName: string;
    fieldName: string;
} | {
    type: 'ai_hint';
    modelName: string;
    targetType: 'model' | 'dimension' | 'metric';
    targetName: string;
};
export type AiAgentTargetRef = AiAgentSemanticTargetRef | {
    type: 'agent';
    agentUuid: string;
} | {
    type: 'agent_config';
    setting: AiAgentConfigurationSetting;
} | {
    type: 'product_capability';
    capabilityKey: string;
} | {
    type: 'runtime';
    key: string;
} | {
    type: 'content';
    chartUuid: string | null;
    dashboardUuid: string | null;
    tileUuid: string | null;
};
export type AiAgentEvidenceExcerpt = {
    source: 'user_prompt' | 'assistant_answer' | 'next_user_prompt' | 'conversation_context' | 'tool_call' | 'tool_result' | 'agent_config';
    text: string;
    redacted: boolean;
};
export type AiAgentRecommendationAction = 'update_semantic_yaml' | 'update_agent_instructions' | 'add_knowledge_document' | 'enable_data_access' | 'enable_sql_mode' | 'enable_self_improvement' | 'configure_mcp_server' | 'adjust_explore_tags' | 'update_access' | 'route_to_product_work' | 'request_more_evidence' | 'no_action';
export type AiAgentRecommendation = {
    actionType: AiAgentRecommendationAction;
    title: string;
    rationale: string;
    targetRefs: AiAgentTargetRef[];
};
export type AiAgentReviewClassifierTurnSignal = {
    subject: AiAgentReviewClassifierSubject;
    interactionSource: AiAgentInteractionSource;
    sourceRef: AiAgentTurnSignalSourceRef;
    signal: AiAgentTurnSignal;
    implicitSignalSources: AiAgentImplicitSignalSource[];
    confidence: AiAgentReviewClassifierConfidence;
    promotedToFinding: boolean;
    promotionReason: string | null;
    toolEvidenceRefs: string[];
    runtimeContextSnapshot: AiAgentRuntimeContextSnapshot;
    modelMetadata: AiAgentModelMetadata;
};
export type AiAgentFindingReviewStatus = 'unreviewed' | 'accepted' | 'rejected' | 'needs_more_evidence';
export type AiAgentReviewItemStatus = 'triage' | 'open' | 'in_progress' | 'resolved' | 'dismissed' | 'duplicate';
export type AiAgentReviewItemDismissedReason = 'not_actionable' | 'expected_behavior' | 'duplicate' | 'low_confidence' | 'other';
export type AiAgentReviewItemDedupCandidate = {
    key: string;
    title: string;
    status: AiAgentReviewItemStatus;
    dismissedReason: AiAgentReviewItemDismissedReason | null;
    primaryRootCause: AiAgentRootCause;
    objectSummary: string | null;
};
export declare const shouldReopenReviewItem: (status: AiAgentReviewItemStatus, dismissedReason: AiAgentReviewItemDismissedReason | null) => boolean;
export type AiAgentReviewItemOwnerType = 'semantic_layer_owner' | 'agent_admin' | 'product' | 'support' | 'unknown';
export type AiAgentReviewItemPrState = 'open' | 'merged' | 'closed';
export type AiAgentReviewItemWritebackStatus = 'queued' | 'running' | 'completed' | 'failed';
export type AiAgentReviewItemWritebackStrategy = 'semantic_layer' | 'project_context';
export type AiAgentReviewItemWritebackBlockedReason = 'reviews_disabled' | 'unsupported_root_cause' | 'missing_project' | 'missing_agent' | 'missing_project_context_entry' | 'project_context_disabled' | 'unsupported_source_control' | 'git_app_not_installed' | 'missing_writeback_config' | 'pull_request_open' | 'source_thread_writeback_exists' | 'terminal_state' | 'writeback_in_progress';
export type AiAgentReviewItemWritebackEligibility = {
    eligible: true;
    provider: PullRequestProvider;
    strategy: AiAgentReviewItemWritebackStrategy;
    reason: null;
} | {
    eligible: false;
    provider: PullRequestProvider | null;
    strategy: AiAgentReviewItemWritebackStrategy | null;
    reason: AiAgentReviewItemWritebackBlockedReason;
};
export type AiAgentReviewRemediationStatus = 'queued' | 'running' | 'pr_open' | 'preview_ready' | 'resolved' | 'failed';
export type AiAgentReviewRemediation = {
    uuid: string;
    fingerprint: string;
    organizationUuid: string;
    sourceFindingUuid: string | null;
    sourcePromptUuid: string | null;
    sourceThreadUuid: string | null;
    sourceProjectUuid: string;
    sourceAgentUuid: string;
    workThreadUuid: string | null;
    pullRequestUuid: string | null;
    linkedPrUrl: string | null;
    previewProjectUuid: string | null;
    previewAgentUuid: string | null;
    previewThreadUuid: string | null;
    status: AiAgentReviewRemediationStatus;
    errorMessage: string | null;
    retryPrompt: string | null;
    createdByUserUuid: string | null;
    resolvedByUserUuid: string | null;
    resolvedAt: Date | null;
    createdAt: Date;
    updatedAt: Date;
};
export declare const aiAgentJudgeProjectContextEntrySchema: z.ZodEffects<z.ZodObject<{
    op: z.ZodEnum<["create", "update"]>;
    id: z.ZodNullable<z.ZodString>;
    kind: z.ZodEnum<["definition", "context"]>;
    content: z.ZodString;
    terms: z.ZodArray<z.ZodString, "many">;
    objects: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
    id: string | null;
    kind: "definition" | "context";
    content: string;
    terms: string[];
    objects: string[];
    op: "create" | "update";
}, {
    id: string | null;
    kind: "definition" | "context";
    content: string;
    terms: string[];
    objects: string[];
    op: "create" | "update";
}>, {
    id: string | null;
    kind: "definition" | "context";
    content: string;
    terms: string[];
    objects: string[];
    op: "create" | "update";
}, {
    id: string | null;
    kind: "definition" | "context";
    content: string;
    terms: string[];
    objects: string[];
    op: "create" | "update";
}>;
export type AiAgentJudgeProjectContextEntry = {
    op: 'create' | 'update';
    id: string | null;
    kind: 'definition' | 'context';
    content: string;
    terms: string[];
    objects: string[];
};
export declare const aiAgentReviewClassifierJudgeOutputSchema: z.ZodEffects<z.ZodObject<{
    signal: z.ZodEnum<["normal_refinement", "implicit_correction", "explicit_dispute", "retry_after_failure", "output_shape_correction", "new_question", "acceptance_or_continuation", "product_capability_request", "human_intervention", "ambiguous"]>;
    implicitSignalSources: z.ZodArray<z.ZodEnum<["next_user_correction", "next_user_dispute", "next_user_retry", "output_shape_correction", "tool_error", "assistant_no_answer", "product_capability_request", "human_intervention"]>, "many">;
    confidence: z.ZodEnum<["low", "medium", "high"]>;
    promotedToFinding: z.ZodBoolean;
    promotionReason: z.ZodNullable<z.ZodString>;
    matchedExistingItemKey: z.ZodNullable<z.ZodString>;
    primaryRootCause: z.ZodEnum<["semantic_layer", "project_context", "agent_configuration", "product_capability", "runtime_reliability", "feedback_quality", "not_a_failure", "ambiguous"]>;
    secondaryRootCauses: z.ZodArray<z.ZodEnum<["semantic_layer", "project_context", "agent_configuration", "product_capability", "runtime_reliability", "feedback_quality", "not_a_failure", "ambiguous"]>, "many">;
    subcategories: z.ZodArray<z.ZodString, "many">;
    fixTargets: z.ZodArray<z.ZodEnum<["semantic_yaml_patch", "project_context_rule", "agent_configuration_change", "dbt_modeling_ticket", "semantic_layer_ticket", "product_capability_ticket", "runtime_reliability_ticket", "feedback_needed", "no_action"]>, "many">;
    targetRefs: z.ZodArray<z.ZodObject<{
        type: z.ZodEnum<["model", "explore", "join", "dimension", "metric", "additional_dimension", "required_filter", "ai_hint", "agent", "agent_config", "product_capability", "runtime"]>;
        label: z.ZodString;
        modelName: z.ZodNullable<z.ZodString>;
        fieldName: z.ZodNullable<z.ZodString>;
        setting: z.ZodNullable<z.ZodEnum<["instructions", "knowledge_documents", "data_access", "self_improvement", "sql_mode", "mcp_servers", "explore_tags", "space_access", "user_or_group_access", "unknown"]>>;
        key: z.ZodNullable<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        label: string;
        key: string | null;
        type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
        fieldName: string | null;
        modelName: string | null;
        setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
    }, {
        label: string;
        key: string | null;
        type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
        fieldName: string | null;
        modelName: string | null;
        setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
    }>, "many">;
    agentConfigurationSettings: z.ZodArray<z.ZodEnum<["instructions", "knowledge_documents", "data_access", "self_improvement", "sql_mode", "mcp_servers", "explore_tags", "space_access", "user_or_group_access", "unknown"]>, "many">;
    ownerType: z.ZodEnum<["semantic_layer_owner", "agent_admin", "product", "support", "unknown"]>;
    evidenceExcerpts: z.ZodArray<z.ZodObject<{
        source: z.ZodEnum<["user_prompt", "assistant_answer", "next_user_prompt", "conversation_context", "tool_call", "tool_result", "agent_config"]>;
        text: z.ZodString;
        redacted: z.ZodBoolean;
    }, "strip", z.ZodTypeAny, {
        source: "agent_config" | "user_prompt" | "assistant_answer" | "next_user_prompt" | "conversation_context" | "tool_call" | "tool_result";
        text: string;
        redacted: boolean;
    }, {
        source: "agent_config" | "user_prompt" | "assistant_answer" | "next_user_prompt" | "conversation_context" | "tool_call" | "tool_result";
        text: string;
        redacted: boolean;
    }>, "many">;
    recommendation: z.ZodNullable<z.ZodObject<{
        actionType: z.ZodEnum<["update_semantic_yaml", "update_agent_instructions", "add_knowledge_document", "enable_data_access", "enable_sql_mode", "enable_self_improvement", "configure_mcp_server", "adjust_explore_tags", "update_access", "route_to_product_work", "request_more_evidence", "no_action"]>;
        title: z.ZodString;
        rationale: z.ZodString;
        targetRefs: z.ZodArray<z.ZodObject<{
            type: z.ZodEnum<["model", "explore", "join", "dimension", "metric", "additional_dimension", "required_filter", "ai_hint", "agent", "agent_config", "product_capability", "runtime"]>;
            label: z.ZodString;
            modelName: z.ZodNullable<z.ZodString>;
            fieldName: z.ZodNullable<z.ZodString>;
            setting: z.ZodNullable<z.ZodEnum<["instructions", "knowledge_documents", "data_access", "self_improvement", "sql_mode", "mcp_servers", "explore_tags", "space_access", "user_or_group_access", "unknown"]>>;
            key: z.ZodNullable<z.ZodString>;
        }, "strip", z.ZodTypeAny, {
            label: string;
            key: string | null;
            type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
            fieldName: string | null;
            modelName: string | null;
            setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
        }, {
            label: string;
            key: string | null;
            type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
            fieldName: string | null;
            modelName: string | null;
            setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
        }>, "many">;
    }, "strip", z.ZodTypeAny, {
        targetRefs: {
            label: string;
            key: string | null;
            type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
            fieldName: string | null;
            modelName: string | null;
            setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
        }[];
        actionType: "no_action" | "update_semantic_yaml" | "update_agent_instructions" | "add_knowledge_document" | "enable_data_access" | "enable_sql_mode" | "enable_self_improvement" | "configure_mcp_server" | "adjust_explore_tags" | "update_access" | "route_to_product_work" | "request_more_evidence";
        title: string;
        rationale: string;
    }, {
        targetRefs: {
            label: string;
            key: string | null;
            type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
            fieldName: string | null;
            modelName: string | null;
            setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
        }[];
        actionType: "no_action" | "update_semantic_yaml" | "update_agent_instructions" | "add_knowledge_document" | "enable_data_access" | "enable_sql_mode" | "enable_self_improvement" | "configure_mcp_server" | "adjust_explore_tags" | "update_access" | "route_to_product_work" | "request_more_evidence";
        title: string;
        rationale: string;
    }>>;
    reviewItem: z.ZodObject<{
        title: z.ZodString;
        description: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        description: string;
        title: string;
    }, {
        description: string;
        title: string;
    }>;
    projectContextEntry: z.ZodNullable<z.ZodEffects<z.ZodObject<{
        op: z.ZodEnum<["create", "update"]>;
        id: z.ZodNullable<z.ZodString>;
        kind: z.ZodEnum<["definition", "context"]>;
        content: z.ZodString;
        terms: z.ZodArray<z.ZodString, "many">;
        objects: z.ZodArray<z.ZodString, "many">;
    }, "strip", z.ZodTypeAny, {
        id: string | null;
        kind: "definition" | "context";
        content: string;
        terms: string[];
        objects: string[];
        op: "create" | "update";
    }, {
        id: string | null;
        kind: "definition" | "context";
        content: string;
        terms: string[];
        objects: string[];
        op: "create" | "update";
    }>, {
        id: string | null;
        kind: "definition" | "context";
        content: string;
        terms: string[];
        objects: string[];
        op: "create" | "update";
    }, {
        id: string | null;
        kind: "definition" | "context";
        content: string;
        terms: string[];
        objects: string[];
        op: "create" | "update";
    }>>;
}, "strip", z.ZodTypeAny, {
    signal: "normal_refinement" | "implicit_correction" | "explicit_dispute" | "retry_after_failure" | "output_shape_correction" | "new_question" | "acceptance_or_continuation" | "product_capability_request" | "human_intervention" | "ambiguous";
    implicitSignalSources: ("output_shape_correction" | "product_capability_request" | "human_intervention" | "next_user_correction" | "next_user_dispute" | "next_user_retry" | "tool_error" | "assistant_no_answer")[];
    confidence: "high" | "medium" | "low";
    promotedToFinding: boolean;
    promotionReason: string | null;
    matchedExistingItemKey: string | null;
    primaryRootCause: "ambiguous" | "semantic_layer" | "project_context" | "agent_configuration" | "product_capability" | "runtime_reliability" | "feedback_quality" | "not_a_failure";
    secondaryRootCauses: ("ambiguous" | "semantic_layer" | "project_context" | "agent_configuration" | "product_capability" | "runtime_reliability" | "feedback_quality" | "not_a_failure")[];
    subcategories: string[];
    fixTargets: ("semantic_yaml_patch" | "project_context_rule" | "agent_configuration_change" | "dbt_modeling_ticket" | "semantic_layer_ticket" | "product_capability_ticket" | "runtime_reliability_ticket" | "feedback_needed" | "no_action")[];
    targetRefs: {
        label: string;
        key: string | null;
        type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
        fieldName: string | null;
        modelName: string | null;
        setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
    }[];
    agentConfigurationSettings: ("unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access")[];
    ownerType: "unknown" | "semantic_layer_owner" | "agent_admin" | "product" | "support";
    evidenceExcerpts: {
        source: "agent_config" | "user_prompt" | "assistant_answer" | "next_user_prompt" | "conversation_context" | "tool_call" | "tool_result";
        text: string;
        redacted: boolean;
    }[];
    recommendation: {
        targetRefs: {
            label: string;
            key: string | null;
            type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
            fieldName: string | null;
            modelName: string | null;
            setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
        }[];
        actionType: "no_action" | "update_semantic_yaml" | "update_agent_instructions" | "add_knowledge_document" | "enable_data_access" | "enable_sql_mode" | "enable_self_improvement" | "configure_mcp_server" | "adjust_explore_tags" | "update_access" | "route_to_product_work" | "request_more_evidence";
        title: string;
        rationale: string;
    } | null;
    reviewItem: {
        description: string;
        title: string;
    };
    projectContextEntry: {
        id: string | null;
        kind: "definition" | "context";
        content: string;
        terms: string[];
        objects: string[];
        op: "create" | "update";
    } | null;
}, {
    signal: "normal_refinement" | "implicit_correction" | "explicit_dispute" | "retry_after_failure" | "output_shape_correction" | "new_question" | "acceptance_or_continuation" | "product_capability_request" | "human_intervention" | "ambiguous";
    implicitSignalSources: ("output_shape_correction" | "product_capability_request" | "human_intervention" | "next_user_correction" | "next_user_dispute" | "next_user_retry" | "tool_error" | "assistant_no_answer")[];
    confidence: "high" | "medium" | "low";
    promotedToFinding: boolean;
    promotionReason: string | null;
    matchedExistingItemKey: string | null;
    primaryRootCause: "ambiguous" | "semantic_layer" | "project_context" | "agent_configuration" | "product_capability" | "runtime_reliability" | "feedback_quality" | "not_a_failure";
    secondaryRootCauses: ("ambiguous" | "semantic_layer" | "project_context" | "agent_configuration" | "product_capability" | "runtime_reliability" | "feedback_quality" | "not_a_failure")[];
    subcategories: string[];
    fixTargets: ("semantic_yaml_patch" | "project_context_rule" | "agent_configuration_change" | "dbt_modeling_ticket" | "semantic_layer_ticket" | "product_capability_ticket" | "runtime_reliability_ticket" | "feedback_needed" | "no_action")[];
    targetRefs: {
        label: string;
        key: string | null;
        type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
        fieldName: string | null;
        modelName: string | null;
        setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
    }[];
    agentConfigurationSettings: ("unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access")[];
    ownerType: "unknown" | "semantic_layer_owner" | "agent_admin" | "product" | "support";
    evidenceExcerpts: {
        source: "agent_config" | "user_prompt" | "assistant_answer" | "next_user_prompt" | "conversation_context" | "tool_call" | "tool_result";
        text: string;
        redacted: boolean;
    }[];
    recommendation: {
        targetRefs: {
            label: string;
            key: string | null;
            type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
            fieldName: string | null;
            modelName: string | null;
            setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
        }[];
        actionType: "no_action" | "update_semantic_yaml" | "update_agent_instructions" | "add_knowledge_document" | "enable_data_access" | "enable_sql_mode" | "enable_self_improvement" | "configure_mcp_server" | "adjust_explore_tags" | "update_access" | "route_to_product_work" | "request_more_evidence";
        title: string;
        rationale: string;
    } | null;
    reviewItem: {
        description: string;
        title: string;
    };
    projectContextEntry: {
        id: string | null;
        kind: "definition" | "context";
        content: string;
        terms: string[];
        objects: string[];
        op: "create" | "update";
    } | null;
}>, {
    signal: "normal_refinement" | "implicit_correction" | "explicit_dispute" | "retry_after_failure" | "output_shape_correction" | "new_question" | "acceptance_or_continuation" | "product_capability_request" | "human_intervention" | "ambiguous";
    implicitSignalSources: ("output_shape_correction" | "product_capability_request" | "human_intervention" | "next_user_correction" | "next_user_dispute" | "next_user_retry" | "tool_error" | "assistant_no_answer")[];
    confidence: "high" | "medium" | "low";
    promotedToFinding: boolean;
    promotionReason: string | null;
    matchedExistingItemKey: string | null;
    primaryRootCause: "ambiguous" | "semantic_layer" | "project_context" | "agent_configuration" | "product_capability" | "runtime_reliability" | "feedback_quality" | "not_a_failure";
    secondaryRootCauses: ("ambiguous" | "semantic_layer" | "project_context" | "agent_configuration" | "product_capability" | "runtime_reliability" | "feedback_quality" | "not_a_failure")[];
    subcategories: string[];
    fixTargets: ("semantic_yaml_patch" | "project_context_rule" | "agent_configuration_change" | "dbt_modeling_ticket" | "semantic_layer_ticket" | "product_capability_ticket" | "runtime_reliability_ticket" | "feedback_needed" | "no_action")[];
    targetRefs: {
        label: string;
        key: string | null;
        type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
        fieldName: string | null;
        modelName: string | null;
        setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
    }[];
    agentConfigurationSettings: ("unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access")[];
    ownerType: "unknown" | "semantic_layer_owner" | "agent_admin" | "product" | "support";
    evidenceExcerpts: {
        source: "agent_config" | "user_prompt" | "assistant_answer" | "next_user_prompt" | "conversation_context" | "tool_call" | "tool_result";
        text: string;
        redacted: boolean;
    }[];
    recommendation: {
        targetRefs: {
            label: string;
            key: string | null;
            type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
            fieldName: string | null;
            modelName: string | null;
            setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
        }[];
        actionType: "no_action" | "update_semantic_yaml" | "update_agent_instructions" | "add_knowledge_document" | "enable_data_access" | "enable_sql_mode" | "enable_self_improvement" | "configure_mcp_server" | "adjust_explore_tags" | "update_access" | "route_to_product_work" | "request_more_evidence";
        title: string;
        rationale: string;
    } | null;
    reviewItem: {
        description: string;
        title: string;
    };
    projectContextEntry: {
        id: string | null;
        kind: "definition" | "context";
        content: string;
        terms: string[];
        objects: string[];
        op: "create" | "update";
    } | null;
}, {
    signal: "normal_refinement" | "implicit_correction" | "explicit_dispute" | "retry_after_failure" | "output_shape_correction" | "new_question" | "acceptance_or_continuation" | "product_capability_request" | "human_intervention" | "ambiguous";
    implicitSignalSources: ("output_shape_correction" | "product_capability_request" | "human_intervention" | "next_user_correction" | "next_user_dispute" | "next_user_retry" | "tool_error" | "assistant_no_answer")[];
    confidence: "high" | "medium" | "low";
    promotedToFinding: boolean;
    promotionReason: string | null;
    matchedExistingItemKey: string | null;
    primaryRootCause: "ambiguous" | "semantic_layer" | "project_context" | "agent_configuration" | "product_capability" | "runtime_reliability" | "feedback_quality" | "not_a_failure";
    secondaryRootCauses: ("ambiguous" | "semantic_layer" | "project_context" | "agent_configuration" | "product_capability" | "runtime_reliability" | "feedback_quality" | "not_a_failure")[];
    subcategories: string[];
    fixTargets: ("semantic_yaml_patch" | "project_context_rule" | "agent_configuration_change" | "dbt_modeling_ticket" | "semantic_layer_ticket" | "product_capability_ticket" | "runtime_reliability_ticket" | "feedback_needed" | "no_action")[];
    targetRefs: {
        label: string;
        key: string | null;
        type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
        fieldName: string | null;
        modelName: string | null;
        setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
    }[];
    agentConfigurationSettings: ("unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access")[];
    ownerType: "unknown" | "semantic_layer_owner" | "agent_admin" | "product" | "support";
    evidenceExcerpts: {
        source: "agent_config" | "user_prompt" | "assistant_answer" | "next_user_prompt" | "conversation_context" | "tool_call" | "tool_result";
        text: string;
        redacted: boolean;
    }[];
    recommendation: {
        targetRefs: {
            label: string;
            key: string | null;
            type: "join" | "metric" | "dimension" | "product_capability" | "model" | "explore" | "additional_dimension" | "required_filter" | "ai_hint" | "agent" | "agent_config" | "runtime";
            fieldName: string | null;
            modelName: string | null;
            setting: "unknown" | "instructions" | "knowledge_documents" | "data_access" | "self_improvement" | "sql_mode" | "mcp_servers" | "explore_tags" | "space_access" | "user_or_group_access" | null;
        }[];
        actionType: "no_action" | "update_semantic_yaml" | "update_agent_instructions" | "add_knowledge_document" | "enable_data_access" | "enable_sql_mode" | "enable_self_improvement" | "configure_mcp_server" | "adjust_explore_tags" | "update_access" | "route_to_product_work" | "request_more_evidence";
        title: string;
        rationale: string;
    } | null;
    reviewItem: {
        description: string;
        title: string;
    };
    projectContextEntry: {
        id: string | null;
        kind: "definition" | "context";
        content: string;
        terms: string[];
        objects: string[];
        op: "create" | "update";
    } | null;
}>;
export type AiAgentReviewClassifierJudgeOutput = z.infer<typeof aiAgentReviewClassifierJudgeOutputSchema>;
export type AiAgentReviewItem = {
    uuid: string;
    fingerprint: string;
    source: AiAgentReviewItemSource;
    organizationUuid: string;
    projectUuid: string | null;
    agentUuid: string | null;
    title: string;
    description: string;
    primaryRootCause: AiAgentRootCause;
    priority: AiAgentReviewItemPriority;
    targetRefs: AiAgentTargetRef[];
    status: AiAgentReviewItemStatus;
    dismissedReason: AiAgentReviewItemDismissedReason | null;
    ownerType: AiAgentReviewItemOwnerType;
    assignedToUserUuid: string | null;
    firstSeenAt: Date;
    lastSeenAt: Date;
    findingCount: number;
    statusUpdatedAt: Date;
    statusUpdatedByUserUuid: string | null;
    linkedIssueUrl: string | null;
    linkedPrUrl: string | null;
    prState: AiAgentReviewItemPrState | null;
    prWritebackStatus: AiAgentReviewItemWritebackStatus | null;
    prWritebackMessage: string | null;
    boardPosition: number | null;
    createdByUserUuid: string | null;
    createdAt: Date;
    updatedAt: Date;
};
export type AiAgentReviewItemSource = 'ai_finding' | 'manual';
export type AiAgentReviewItemPriority = 'urgent' | 'high' | 'medium' | 'low' | 'none';
export type AiAgentReviewItemSummary = AiAgentReviewItem & {
    /**
     * Legacy boolean kept for current clients. New clients should use
     * writebackEligibility for the blocking reason and provider.
     */
    writebackEligible: boolean;
    writebackEligibility: AiAgentReviewItemWritebackEligibility;
    remediation: AiAgentReviewRemediation | null;
    latestFinding: {
        uuid: string;
        promptUuid: string;
        threadUuid: string;
        projectUuid: string;
        agentUuid: string;
        subcategories: string[];
        fixTargets: AiAgentFixTarget[];
        targetRefs: AiAgentTargetRef[];
        evidenceExcerpts: AiAgentEvidenceExcerpt[];
        recommendation: AiAgentRecommendation | null;
        projectContextEntry: AiAgentJudgeProjectContextEntry | null;
        createdAt: Date;
    } | null;
};
export type ApiAiAgentReviewItemsResponse = ApiSuccess<AiAgentReviewItemSummary[]>;
export type UpdateAiAgentReviewItemStatus = {
    status: AiAgentReviewItemStatus;
    dismissedReason: AiAgentReviewItemDismissedReason | null;
    boardPosition?: number | null;
};
export type UpdateAiAgentReviewItemAssignee = {
    assignedToUserUuid: string | null;
};
export type CreateAiAgentReviewItem = {
    title: string;
    description: string | null;
    projectUuid: string;
    agentUuid: string | null;
    assignedToUserUuid: string | null;
    primaryRootCause: AiAgentRootCause | null;
    priority: AiAgentReviewItemPriority;
    targetRefs: AiAgentTargetRef[];
};
export type UpdateAiAgentReviewItemPriority = {
    priority: AiAgentReviewItemPriority;
};
export type CreateAiAgentReviewItemComment = {
    body: string;
};
export type ReorderAiAgentReviewItems = {
    orderedFingerprints: string[];
};
export type ApiAiAgentReviewItemResponse = ApiSuccess<AiAgentReviewItemSummary>;
/**
 * Preview of the file change a writeback PR would make, computed deterministically
 * (no PR opened). Only available for the project_context strategy — semantic_layer
 * runs in a sandbox, so there is no static diff to show before the PR is created.
 */
export type AiAgentReviewItemWritebackPreview = {
    available: true;
    fileName: string;
    before: string;
    after: string;
    op: 'create' | 'update';
    entryId: string;
} | {
    available: false;
};
export type ApiAiAgentReviewItemWritebackPreviewResponse = ApiSuccess<AiAgentReviewItemWritebackPreview>;
export type AiAgentReviewItemPrDiffFile = {
    path: string;
    status: string;
    additions: number;
    deletions: number;
    before: string;
    after: string;
};
export type AiAgentReviewItemPrDiff = {
    prUrl: string;
    files: AiAgentReviewItemPrDiffFile[];
    totalAdditions: number;
    totalDeletions: number;
    truncated: boolean;
};
export type ApiAiAgentReviewItemPrDiffResponse = ApiSuccess<AiAgentReviewItemPrDiff>;
export type AiAgentReviewRemediationEventDetail = {
    eventType: 'finding_opened';
    payload: {
        excerpt: string | null;
        sourceThreadUuid: string | null;
        sourcePromptUuid: string | null;
    };
} | {
    eventType: 'writeback_completed';
    payload: {
        files: string[];
        additions: number | null;
        deletions: number | null;
    };
} | {
    eventType: 'pr_opened';
    payload: {
        prUrl: string;
        prNumber: number | null;
    };
} | {
    eventType: 'pr_updated';
    payload: {
        prUrl: string | null;
    };
} | {
    eventType: 'preview_compiled';
    payload: {
        previewProjectUuid: string;
    };
} | {
    eventType: 'verification_completed';
    payload: {
        previewThreadUuid: string;
    };
} | {
    eventType: 'pr_merged';
    payload: {
        prUrl: string;
    };
} | {
    eventType: 'pr_closed';
    payload: {
        prUrl: string;
    };
} | {
    eventType: 'resolved';
    payload: Record<string, never>;
} | {
    eventType: 'failed';
    payload: {
        errorMessage: string | null;
    };
};
export type AiAgentReviewRemediationEventType = AiAgentReviewRemediationEventDetail['eventType'];
export type AiAgentReviewRemediationEvent = {
    uuid: string;
    remediationUuid: string | null;
    occurredAt: Date;
    createdByUserUuid: string | null;
} & AiAgentReviewRemediationEventDetail;
export type AiAgentReviewItemEventDetail = {
    eventType: 'created';
    payload: {
        rootCause: AiAgentRootCause | null;
    };
} | {
    eventType: 'status_changed';
    payload: {
        from: AiAgentReviewItemStatus | null;
        to: AiAgentReviewItemStatus;
        dismissedReason: AiAgentReviewItemDismissedReason | null;
    };
} | {
    eventType: 'assignee_changed';
    payload: {
        fromUserUuid: string | null;
        toUserUuid: string | null;
    };
} | {
    eventType: 'recurred';
    payload: {
        threadUuid: string;
        promptUuid: string;
    };
} | {
    eventType: 'priority_changed';
    payload: {
        from: AiAgentReviewItemPriority;
        to: AiAgentReviewItemPriority;
    };
} | {
    eventType: 'comment_added';
    payload: {
        body: string;
    };
};
export type AiAgentReviewItemEventType = AiAgentReviewItemEventDetail['eventType'];
export type AiAgentReviewItemEvent = {
    uuid: string;
    fingerprint: string;
    occurredAt: Date;
    createdByUserUuid: string | null;
} & AiAgentReviewItemEventDetail;
/** One row of the merged issue activity feed. */
export type AiAgentReviewActivityEvent = ({
    kind: 'remediation';
} & AiAgentReviewRemediationEvent) | ({
    kind: 'issue';
} & AiAgentReviewItemEvent);
/**
 * The in-flight step of a remediation, derived from current status + which
 * events exist — never stored. Renders as the single accented "live" row.
 */
export type AiAgentReviewRemediationLiveState = 'writeback' | 'compiling' | 'verifying';
export type AiAgentReviewItemActivity = {
    events: AiAgentReviewActivityEvent[];
    liveState: AiAgentReviewRemediationLiveState | null;
    /** Streaming progress text for the live row (writeback step messages). */
    liveMessage: string | null;
    /**
     * True when the PR changed after the latest verdict — derived from event
     * ordering (latest pr_opened/pr_updated/writeback_completed occurred after
     * the latest verification_completed). Drives the "Retest" prompt.
     */
    verdictStale: boolean;
};
export type ApiAiAgentReviewItemActivityResponse = ApiSuccess<AiAgentReviewItemActivity>;
export type AiAgentReviewSignalSummary = {
    uuid: string;
    runUuid: string;
    promptUuid: string;
    threadUuid: string;
    projectUuid: string;
    agentUuid: string;
    signal: AiAgentTurnSignal;
    implicitSignalSources: AiAgentImplicitSignalSource[];
    confidence: AiAgentReviewClassifierConfidence;
    promotedToFinding: boolean;
    promotionReason: string | null;
    createdAt: Date;
    runScope: AiAgentReviewClassifierRunScope;
    prompt: string;
    responsePreview: string | null;
    errorMessage: string | null;
    finding: {
        uuid: string;
        reviewItemUuid: string | null;
        primaryRootCause: AiAgentRootCause;
        subcategories: string[];
        fixTargets: AiAgentFixTarget[];
        evidenceExcerpts: AiAgentEvidenceExcerpt[];
        recommendation: AiAgentRecommendation | null;
    } | null;
};
export type ApiAiAgentReviewSignalsResponse = ApiSuccess<AiAgentReviewSignalSummary[]>;
export type AiAgentReviewReplayCaptureRequest = {
    signalUuids: string[];
};
export type AiAgentReviewReplayCaptureEntry = {
    signalUuid: string;
    promptUuid: string | null;
    threadUuid: string | null;
    captureError: string | null;
    input: unknown;
};
export type ApiAiAgentReviewReplayCaptureResponse = ApiSuccess<AiAgentReviewReplayCaptureEntry[]>;
export type AiAgentReviewClassifierRunStatus = 'queued' | 'running' | 'completed' | 'failed';
export type AiAgentReviewClassifierRunScope = {
    type: 'backfill';
    startedAt: string;
    endedAt: string;
    projectUuid?: string;
    agentUuid?: string;
    dryRun?: boolean;
} | {
    type: 'live_event';
    eventType: AiAgentReviewClassifierEventType;
    promptUuid: string;
    threadUuid: string;
    projectUuid: string;
    agentUuid: string;
} | {
    type: 'manual';
    requestedByUserUuid: string;
    filters: Record<string, unknown>;
};
export type AiAgentReviewClassifierRun = {
    uuid: string;
    organizationUuid: string;
    status: AiAgentReviewClassifierRunStatus;
    reviewAgentVersion: string;
    judgePromptHash: string;
    agentConfigSnapshotHash: string | null;
    agentConfigSnapshot: AiAgentConfigSnapshot | null;
    agentConfigSnapshotAgentUpdatedAt: Date | null;
    runScope: AiAgentReviewClassifierRunScope;
    totalTurns: number;
    processedTurns: number;
    signalCount: number;
    findingCount: number;
    reviewItemCount: number;
    errorMessage: string | null;
    completedAt: Date | null;
    createdAt: Date;
    updatedAt: Date;
};
export type AiAgentReviewClassifierTurnSnapshot = {
    promptUuid: string;
    userPrompt: string;
    assistantResponse: string | null;
    errorMessage: string | null;
    createdAt: Date;
    respondedAt: Date | null;
};
export type AiAgentReviewClassifierContextTurn = AiAgentReviewClassifierTurnSnapshot & {
    relation: 'previous' | 'next' | 'referenced';
};
export type AiAgentReviewClassifierTurnCandidate = {
    subject: AiAgentReviewClassifierSubject;
    interactionSource: AiAgentInteractionSource;
    sourceRef: AiAgentTurnSignalSourceRef;
    targetTurn: AiAgentReviewClassifierTurnSnapshot;
    contextTurns: AiAgentReviewClassifierContextTurn[];
    userPrompt: string;
    assistantResponse: string | null;
    errorMessage: string | null;
    humanScore: number | null;
    humanFeedback: string | null;
    createdAt: Date;
    respondedAt: Date | null;
    nextUserPromptUuid: string | null;
    nextUserPrompt: string | null;
    modelMetadata: AiAgentModelMetadata;
    tokenUsageTotal: number | null;
    queryHistory: AiAgentReviewClassifierQueryHistorySummary[];
    supportingEvidence: AiAgentReviewClassifierSupportingEvidence[];
    toolOutcomes: AiAgentReviewClassifierToolOutcome[];
    pendingApprovalTimeout: boolean;
};
export type AiAgentReviewClassifierToolOutcome = {
    toolCallId: string;
    toolName: string;
    status: 'success' | 'error' | 'unknown';
};
export type AiAgentReviewClassifierQueryHistorySummary = {
    queryUuid: string;
    status: QueryHistoryStatus;
    error: string | null;
    createdAt: Date;
    totalRowCount: number | null;
    warehouseExecutionTimeMs: number | null;
    metricQuery: Pick<MetricQuery, 'exploreName' | 'dimensions' | 'metrics' | 'filters' | 'sorts'>;
};
export type AiAgentReviewClassifierSupportingEvidence = {
    source: 'tool_trace';
    toolCallId: string;
    toolName: string;
    parentToolCallId: string | null;
    createdAt: Date;
    relevanceScore: number;
    toolArgsPreview: string | null;
    resultPreview: string | null;
};
export type AiAgentReviewClassifierSignalFinding = {
    primaryRootCause: AiAgentRootCause;
    secondaryRootCauses: AiAgentRootCause[];
    subcategories: string[];
    fixTargets: AiAgentFixTarget[];
    targetRefs: AiAgentTargetRef[];
    evidenceExcerpts: AiAgentEvidenceExcerpt[];
    recommendation: AiAgentRecommendation | null;
    projectContextEntry: AiAgentJudgeProjectContextEntry | null;
    reviewItem: {
        fingerprint: string;
        title: string;
        description: string;
        ownerType: AiAgentReviewItemOwnerType;
    };
};
export type AiAgentReviewItemFingerprintInput = {
    organizationUuid: string;
    projectUuid: string | null;
    agentUuid: string | null;
    threadUuid?: string | null;
    primaryRootCause: AiAgentRootCause;
    subcategories: string[];
    fixTargets: AiAgentFixTarget[];
    targetRefs: AiAgentTargetRef[];
    agentConfigurationSettings: AiAgentConfigurationSetting[];
    capabilityKey: string | null;
};
type AiAgentReviewItemFingerprintScope = {
    type: 'organization';
    organizationUuid: string;
} | {
    type: 'project';
    organizationUuid: string;
    projectUuid: string;
} | {
    type: 'agent';
    organizationUuid: string;
    agentUuid: string;
};
export declare const getAiAgentReviewItemFingerprintScope: (input: Pick<AiAgentReviewItemFingerprintInput, "organizationUuid" | "projectUuid" | "agentUuid" | "primaryRootCause">) => AiAgentReviewItemFingerprintScope;
export declare const getAiAgentReviewItemFingerprint: (input: AiAgentReviewItemFingerprintInput) => string;
export {};
//# sourceMappingURL=aiAgentReviewClassifierTypes.d.ts.map