export declare type AnalyticsCatalogDataType = 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';

export declare type AnalyticsCatalogField = {
    id?: unknown;
    column_name?: unknown;
    name?: unknown;
    label?: unknown;
    alias?: unknown;
    qualifiedFieldName?: unknown;
    data_type?: unknown;
    dataType?: unknown;
    role?: unknown;
};

export declare type AnalyticsCatalogFieldSummary = {
    validMetricCandidates: string[];
    validDateCandidates: string[];
    validDimensionCandidates: string[];
};

export declare type AnalyticsMetricFormat = {
    type: 'number' | 'currency' | 'percent' | 'scientific';
    locale?: string;
    minimumFractionDigits?: number;
    maximumFractionDigits?: number;
    useGrouping?: boolean;
    prefix?: string;
    suffix?: string;
    negativeStyle?: 'minus' | 'parentheses';
    compact?: boolean;
    scale?: number;
    currency?: string;
    percentValueMode?: 'fraction' | 'whole';
} | {
    type: 'date';
    locale?: string;
    pattern?: string;
    relative?: boolean;
    timezone?: string;
    sourceTimezone?: string;
    prefix?: string;
    suffix?: string;
} | {
    type: 'string';
    prefix?: string;
    suffix?: string;
};

export declare function buildAnalyticsCatalogFieldSummary(fields: AnalyticsCatalogField[]): AnalyticsCatalogFieldSummary;

export declare function buildSemaphorQualifiedSourcePath(input: {
    capabilities: Pick<SemaphorConnectionCapabilities, 'prefixLevels' | 'dialect'>;
    source: SemaphorSourceCoordinateInput;
    quoteIdentifier?: (value: string, dialect: SemaphorDialect) => string;
}): string;

export declare function getAnalyticsCatalogFieldCandidates(field: AnalyticsCatalogField): string[];

export declare function getAnalyticsCatalogFieldName(field: AnalyticsCatalogField): string;

export declare function getSemaphorConnectionCapabilities(connectionType: string | undefined, options?: {
    connectionId?: string;
}): SemaphorConnectionCapabilities;

export declare function isAnalyticsCatalogDateField(field: AnalyticsCatalogField): boolean;

export declare function isAnalyticsCatalogDimensionField(field: AnalyticsCatalogField): boolean;

export declare function isAnalyticsCatalogMetricField(field: AnalyticsCatalogField, options?: {
    excludeIdentifiers?: boolean;
}): boolean;

export declare function isAnalyticsDateLikeDataType(value: unknown): boolean;

export declare function isAnalyticsMetricIdentifierField(field: AnalyticsCatalogField): boolean;

export declare function isAnalyticsTechnicalIdentifierField(field: AnalyticsCatalogField): boolean;

export declare function normalizeAnalyticsCatalogDataType(value: unknown): AnalyticsCatalogDataType;

export declare function normalizeAnalyticsCatalogName(value: unknown): string;

export declare function normalizeSemaphorAnalyticsFilterOperator(value: SemaphorAnalyticsFilterOperator | string | null | undefined): SemaphorAnalyticsFilterOperator | undefined;

export declare function normalizeSemaphorDialect(input: string | undefined): SemaphorDialect;

export declare function normalizeSemaphorInputOperator(value: SemaphorInputOperatorInput | string | null | undefined): SemaphorInputOperator | undefined;

export declare function parseSemaphorIsoTimeWindowBoundary(value: unknown): Date | null;

export declare function preferSemaphorFieldRefMetadata(current: SemaphorFieldRef, next: SemaphorFieldRef): SemaphorFieldRef;

export declare function preferSemaphorSourceMetadata(current: SemaphorSourceRef, next: SemaphorSourceRef): SemaphorSourceRef;

export declare const SEMAPHOR_ANALYTICS_INTENT_FIXTURES: {
    revenueKpi: {
        version: 1;
        kind: "metric";
        id: string;
        label: string;
        source: {
            readonly kind: "semantic";
            readonly domainId: "domain_sales";
            readonly datasetName: "orders";
            readonly connectionId: "conn_sales";
            readonly label: "Orders";
        };
        metrics: {
            name: string;
            role: "measure";
        }[];
        primaryMetric: {
            name: string;
            role: "measure";
        };
        comparison: {
            kind: "previous_period";
        };
        limit: number;
    };
    revenueTrend: {
        version: 1;
        kind: "records";
        id: string;
        label: string;
        source: {
            readonly kind: "semantic";
            readonly domainId: "domain_sales";
            readonly datasetName: "orders";
            readonly connectionId: "conn_sales";
            readonly label: "Orders";
        };
        fields: ({
            name: string;
            role: "date";
            dataType: "date";
            label: string;
        } | {
            name: string;
            role: "measure";
            dataType: "number";
            label?: undefined;
        })[];
        dateField: {
            name: string;
            role: "date";
            dataType: "date";
        };
        timeGrain: "month";
        limit: number;
    };
    topCustomersRecords: {
        version: 1;
        kind: "records";
        id: string;
        label: string;
        source: {
            readonly kind: "semantic";
            readonly domainId: "domain_sales";
            readonly datasetName: "orders";
            readonly connectionId: "conn_sales";
            readonly label: "Orders";
        };
        fields: ({
            name: string;
            role: "dimension";
            dataType: "string";
        } | {
            name: string;
            role: "measure";
            dataType: "number";
        })[];
        orderBy: {
            field: {
                name: string;
                role: "measure";
            };
            direction: "desc";
        };
        limit: number;
    };
    regionInputOptions: {
        version: 1;
        kind: "inputOptions";
        id: string;
        label: string;
        source: {
            readonly kind: "semantic";
            readonly domainId: "domain_sales";
            readonly datasetName: "orders";
            readonly connectionId: "conn_sales";
            readonly label: "Orders";
        };
        field: {
            name: string;
            role: "dimension";
            dataType: "string";
        };
        limit: number;
    };
    previousPeriodRevenueComparison: {
        version: 1;
        kind: "metric";
        id: string;
        label: string;
        source: {
            readonly kind: "semantic";
            readonly domainId: "domain_sales";
            readonly datasetName: "orders";
            readonly connectionId: "conn_sales";
            readonly label: "Orders";
        };
        metrics: {
            name: string;
            role: "measure";
        }[];
        primaryMetric: {
            name: string;
            role: "measure";
        };
        dateField: {
            name: string;
            role: "date";
            dataType: "date";
        };
        timeGrain: "week";
        comparison: {
            kind: "previous_period";
        };
        limit: number;
    };
    inboundSupplierConcentration: {
        version: 1;
        kind: "metric";
        id: string;
        label: string;
        source: {
            readonly kind: "semantic";
            readonly domainId: "domain_sales";
            readonly datasetName: "orders";
            readonly connectionId: "conn_sales";
            readonly label: "Orders";
        };
        metrics: {
            name: string;
            role: "measure";
        }[];
        primaryMetric: {
            name: string;
            role: "measure";
        };
        dateField: {
            name: string;
            role: "date";
            dataType: "date";
        };
        timeWindow: {
            unit: "month";
            value: number;
            anchor: "latest_available";
        };
        dimensions: {
            name: string;
            role: "dimension";
            dataType: "number";
        }[];
        filters: {
            field: {
                name: string;
                role: "dimension";
                dataType: "string";
            };
            operator: "=";
            values: string[];
        }[];
        limit: number;
    };
    boundedSqlRanking: {
        version: 1;
        kind: "sql";
        id: string;
        label: string;
        source: {
            kind: "sql";
            connectionId: string;
            dialect: "postgres";
        };
        sql: string;
        limit: number;
        rationale: string;
        fields: ({
            name: string;
            role: "dimension";
            dataType: "string";
        } | {
            name: string;
            role: "measure";
            dataType: "number";
        })[];
    };
};

export declare type SemaphorAbsoluteTimeWindow = {
    kind: 'absolute';
    start: string;
    end: string;
};

export declare type SemaphorAggregateFunction = 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';

export declare type SemaphorAnalyticsExecutionResult = {
    intentId?: string;
    queryId?: string;
    status: SemaphorAnalyticsExecutionStatus;
    resultShape?: SemaphorAnalyticsResult['kind'] | 'period_change';
    intent?: SemaphorAnalyticsIntent;
    compiledQuery?: SemaphorCompiledQuery;
    fieldsUsed?: SemaphorExecutionFieldRef[];
    result?: SemaphorAnalyticsResult;
    validation: SemaphorAnalyticsValidationResult;
    coverage?: {
        answeredObligations: string[];
        missingObligations: string[];
        warnings?: SemaphorAnalyticsValidationIssue[];
    };
    missingFields?: string[];
    warnings?: string[];
    relationshipDiagnostics?: SemaphorRelationshipDiagnostics;
    population?: SemaphorAnalyticsPopulation;
    metadata?: Record<string, unknown>;
};

export declare type SemaphorAnalyticsExecutionStatus = 'answered' | 'partial' | 'failed';

export declare type SemaphorAnalyticsFieldRole = 'metric' | 'dateField' | 'dimension' | 'input' | 'source' | 'sql';

export declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;

export declare type SemaphorAnalyticsFilterBase = {
    id?: string;
    field: SemaphorFieldRef;
    /**
     * Controls where the filter is applied in an aggregate query.
     *
     * `row` means pre-aggregation filtering (`WHERE`).
     * `aggregate` means post-aggregation filtering (`HAVING`) and is valid only
     * for measure fields the execution engine can aggregate safely.
     */
    scope?: 'row' | 'aggregate';
};

export declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';

export declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;

export declare type SemaphorAnalyticsIntentFixtureName = keyof typeof SEMAPHOR_ANALYTICS_INTENT_FIXTURES;

export declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
    operator: SemaphorAnalyticsNullFilterOperator;
    values?: never;
};

export declare type SemaphorAnalyticsNullFilterOperator = 'is_null' | 'is_not_null';

export declare type SemaphorAnalyticsObligation = {
    id: string;
    type: SemaphorAnalyticsObligationType;
    subject: string;
    prompt: string;
    metricCandidates?: string[];
    entityCandidates?: string[];
    dateFieldCandidates?: string[];
    dimensionCandidates?: string[];
    displayFieldCandidates?: string[];
    requiredFieldCandidates?: string[];
    limit?: number;
    timeWindow?: SemaphorTimeWindow;
    comparison?: 'same_period_last_year' | 'previous_period';
    required?: boolean;
};

export declare type SemaphorAnalyticsObligationType = 'record_list' | 'count' | 'trend' | 'comparison' | 'driver_analysis' | 'metric_summary' | 'analysis_table' | 'lookup' | 'unknown';

export declare type SemaphorAnalyticsPopulation = {
    scope: 'filtered_query';
    metrics: Record<string, number | string | null>;
};

export declare type SemaphorAnalyticsRecoveryPlan = {
    version: SemaphorProtocolVersion;
    kind: 'analytics_recovery_plan';
    operationIntent: SemaphorOperationIntent;
    plannedToolCalls: SemaphorRecoveryToolCall[];
    diagnostics: Array<{
        code: string;
        message: string;
        obligationId?: string;
        recommendedNextStep?: string;
    }>;
};

export declare type SemaphorAnalyticsRepairHint = {
    code: SemaphorAnalyticsValidationCode | string;
    message?: string;
    invalidField?: string;
    fieldRole?: SemaphorAnalyticsFieldRole;
    validMetricCandidates?: string[];
    validDateCandidates?: string[];
    validDimensionCandidates?: string[];
    recommendedNextStep: string;
};

export declare type SemaphorAnalyticsResult = SemaphorMetricResult | SemaphorRecordsResult | SemaphorInputOptionsResult | SemaphorSqlResult;

export declare type SemaphorAnalyticsResultBase = {
    intentId?: string;
    queryPath: SemaphorQueryPath;
    warnings?: string[];
    rowCount?: number;
    rowLimitExceeded?: boolean;
    limit?: number;
    pagination?: SemaphorPaginationMetadata;
};

export declare type SemaphorAnalyticsValidationCode = 'missing_source' | 'invalid_source_kind' | 'missing_semantic_domain' | 'missing_dataset_name' | 'missing_connection_id' | 'missing_table_name' | 'missing_sql' | 'missing_metric' | 'missing_record_fields' | 'missing_input_options_field' | 'invalid_metric' | 'invalid_metric_list' | 'invalid_date_field' | 'invalid_dimension' | 'invalid_metric_dimensions' | 'conflicting_sql' | 'sql_policy_violation' | 'unsupported_intent_for_adapter' | 'invalid_analytics_kind' | 'invalid_analytics_intent';

export declare type SemaphorAnalyticsValidationIssue = SemaphorProtocolIssue & {
    code: SemaphorAnalyticsValidationCode | string;
    fieldRole?: SemaphorAnalyticsFieldRole;
    repairHint?: SemaphorAnalyticsRepairHint;
};

export declare type SemaphorAnalyticsValidationResult = {
    ok: boolean;
    errors: SemaphorAnalyticsValidationIssue[];
    warnings: SemaphorAnalyticsValidationIssue[];
    repairHints: SemaphorAnalyticsRepairHint[];
};

export declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
    operator?: SemaphorAnalyticsValueFilterOperator;
    values: unknown[];
};

export declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;

export declare type SemaphorCompiledQuery = {
    kind: 'config';
    queryId: string;
    source: SemaphorSourceRef;
    cardType: string;
    connectionId: string;
    cardConfig: unknown;
    cardDataSource: unknown;
    activeFilters?: SemaphorAnalyticsFilter[];
    rowLimit: number;
    analyticsIntent?: SemaphorAnalyticsIntent;
} | {
    kind: 'sql';
    queryId: string;
    source: Extract<SemaphorSourceRef, {
        kind: 'sql';
    }>;
    connectionId: string;
    dialect: SemaphorDialect;
    sql: string;
    parameters?: Record<string, unknown>;
    pythonCode?: string;
    activeFilters?: SemaphorAnalyticsFilter[];
    rowLimit: number;
    analyticsIntent?: SemaphorAnalyticsIntent;
};

export declare type SemaphorConnectionCapabilities = {
    connectionId?: string;
    connectionType?: string;
    dialect: SemaphorDialect;
    path: SemaphorSourceLevel[];
    labels: Partial<Record<SemaphorSourceLevel, string>>;
    prefixLevels: SemaphorSourceLevel[];
    supportsFilterClause: boolean;
};

export declare type SemaphorDashboardIntent = {
    version: SemaphorProtocolVersion;
    kind: 'dashboard';
    title: string;
    description?: string;
    inputs?: SemaphorInputSpec[];
    sections: SemaphorDashboardSectionIntent[];
};

export declare type SemaphorDashboardSectionIntent = {
    id?: string;
    title: string;
    description?: string;
    views: SemaphorDashboardViewIntent[];
};

export declare type SemaphorDashboardViewIntent = {
    id?: string;
    title: string;
    description?: string;
    presentation: SemaphorViewPresentation;
    analytics?: SemaphorAnalyticsIntent;
    text?: string;
};

export declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';

export declare type SemaphorExecutionFieldRef = SemaphorFieldRef & {
    semanticAggregate?: SemaphorAggregateFunction;
    effectiveAggregate?: SemaphorAggregateFunction;
    aggregateSource?: SemaphorMetricAggregateSource;
};

export declare type SemaphorExperienceIntent = SemaphorDashboardIntent;

export declare type SemaphorFieldRef = {
    name: string;
    label?: string;
    role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
    dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
    source?: SemaphorSourceRef;
    aggregate?: SemaphorAggregateFunction;
};

export declare function semaphorFieldRefsMatch(left: SemaphorFieldRef, right: SemaphorFieldRef): boolean;

export declare type SemaphorInputBinding = {
    inputId: string;
    kind?: 'filter' | 'control';
    controlRole?: 'grain' | 'metric' | 'dimension' | 'aggregation' | 'sqlParam';
    operator?: SemaphorInputOperator;
    field?: SemaphorFieldRef;
};

export declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'not_contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';

export declare type SemaphorInputOperatorAlias = 'eq' | 'equals' | 'not_equals' | 'neq' | 'not equal' | 'not equals' | 'not in' | 'like' | 'not_contains' | 'not contains' | 'not_like' | 'not like' | 'not_between' | 'not between';

export declare type SemaphorInputOperatorInput = SemaphorInputOperator | SemaphorInputOperatorAlias;

export declare type SemaphorInputOptionsIntent = {
    kind: 'inputOptions';
    version?: SemaphorProtocolVersion;
    id?: string;
    label?: string;
    source: SemaphorSourceRef;
    field: SemaphorFieldRef;
    search?: string;
    limit?: number;
};

export declare type SemaphorInputOptionsResult = SemaphorAnalyticsResultBase & {
    kind: 'inputOptions';
    options: Array<{
        label: string;
        value: unknown;
        count?: number;
    }>;
};

export declare type SemaphorInputScope = {
    level: 'dashboard';
    excludeViewIds?: string[];
} | {
    level: 'section';
    sectionId: string;
    excludeViewIds?: string[];
} | {
    level: 'view';
    viewIds: string[];
};

export declare type SemaphorInputSpec = {
    id: string;
    kind: 'filter' | 'control';
    label: string;
    field: SemaphorFieldRef;
    operator?: SemaphorInputOperatorInput;
    multi?: boolean;
    defaultValue?: unknown;
    scope?: SemaphorInputScope;
};

export declare type SemaphorMetricAggregateSource = 'semantic_model' | 'caller_override' | 'default_sum';

export declare type SemaphorMetricAnalysis = {
    kind: 'period_change';
    orderBy?: 'absolute_change' | 'positive_change' | 'negative_change' | 'period';
    direction?: 'increase' | 'decrease' | 'both';
    timeWindow?: SemaphorTimeWindow;
};

export declare type SemaphorMetricIntent = {
    kind: 'metric';
    version?: SemaphorProtocolVersion;
    id?: string;
    source: SemaphorSourceRef;
    metrics: SemaphorFieldRef[];
    primaryMetric?: SemaphorFieldRef;
    label?: string;
    dateField?: SemaphorFieldRef;
    timeGrain?: SemaphorTimeGrain;
    timeWindow?: SemaphorTimeWindow;
    dimensions?: SemaphorFieldRef[];
    filters?: SemaphorAnalyticsFilter[];
    comparison?: {
        kind: 'previous_period' | 'previous_year' | 'target';
        targetValue?: number;
    };
    analysis?: SemaphorMetricAnalysis;
    orderBy?: {
        field: SemaphorFieldRef;
        direction: 'asc' | 'desc';
    };
    inputs?: SemaphorInputBinding[];
    limit?: number;
};

export declare type SemaphorMetricResult = SemaphorAnalyticsResultBase & {
    kind: 'metric';
    value: number | string | null;
    comparison?: {
        kind: NonNullable<SemaphorMetricIntent['comparison']>['kind'];
        value?: number | string | null;
        delta?: number | null;
        deltaPercent?: number | null;
    };
};

export declare type SemaphorOperationIntent = {
    version: SemaphorProtocolVersion;
    kind: 'answer_obligations';
    obligations: SemaphorAnalyticsObligation[];
    source?: SemaphorSourceRef;
    context?: Record<string, unknown>;
} | {
    version: SemaphorProtocolVersion;
    kind: 'dashboard_change';
    instruction: string;
    targetDashboardId?: string;
    analyticsIntent?: SemaphorAnalyticsIntent;
    context?: Record<string, unknown>;
} | {
    version: SemaphorProtocolVersion;
    kind: 'data_app_change';
    instruction: string;
    analyticsIntent?: SemaphorAnalyticsIntent;
    context?: Record<string, unknown>;
};

export declare type SemaphorPaginationMetadata = {
    page: number;
    pageSize: number;
    pageCount: number;
    totalCount: number;
    hasNextPage: boolean;
    hasPrevPage: boolean;
};

export declare type SemaphorPaginationRequest = {
    page: number;
    pageSize: number;
};

export declare type SemaphorProtocolIssue = {
    code: string;
    message: string;
    path?: string;
};

export declare type SemaphorProtocolVersion = 1;

export declare type SemaphorQueryPath = 'query_spec' | 'sql' | 'sql_python';

export declare type SemaphorRecordsIntent = {
    kind: 'records';
    version?: SemaphorProtocolVersion;
    source: SemaphorSourceRef;
    id?: string;
    label?: string;
    fields: SemaphorFieldRef[];
    dateField?: SemaphorFieldRef;
    timeGrain?: SemaphorTimeGrain;
    timeWindow?: SemaphorTimeWindow;
    filters?: SemaphorAnalyticsFilter[];
    limit?: number;
    pagination?: SemaphorPaginationRequest;
    orderBy?: {
        field: SemaphorFieldRef;
        direction: 'asc' | 'desc';
    };
    inputs?: SemaphorInputBinding[];
};

export declare type SemaphorRecordsResult = SemaphorAnalyticsResultBase & {
    kind: 'records';
    columns: SemaphorResultColumn[];
    records: Array<Record<string, unknown>>;
};

export declare type SemaphorRecoveryToolCall = {
    name: 'semaphor_get_dataset_schema' | 'semaphor_analyze' | 'semaphor_query_sql_advanced' | string;
    arguments: Record<string, unknown>;
    purpose: string;
    obligationId?: string;
    recoveryKind?: 'schema_discovery' | 'query_spec' | 'sql' | 'unsupported';
};

export declare type SemaphorRelationshipDiagnostics = {
    status: SemaphorRelationshipDiagnosticStatus;
    requiredSources?: SemaphorSourceRef[];
    relationshipsUsed?: string[];
    missingSources?: string[];
    warnings?: string[];
    message?: string;
    recommendedNextStep?: string;
    joinPlanSummary?: {
        baseSource?: SemaphorSourceRef;
        joinedSources?: SemaphorSourceRef[];
        joinCount?: number;
    };
    fanoutRisk?: {
        status: 'none' | 'warning' | 'error' | 'unknown';
        message?: string;
    };
};

export declare type SemaphorRelationshipDiagnosticStatus = 'not_required' | 'resolved' | 'missing' | 'ambiguous' | 'fanout_risk' | 'unknown';

export declare type SemaphorRelativeTimeWindow = {
    kind?: 'relative';
    unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
    value: number;
    anchor?: 'now' | 'latest_available';
    completeness?: 'include_partial' | 'complete_periods';
};

export declare type SemaphorResultColumn = {
    /**
     * Stable row accessor for this result. Consumers should read values with
     * `row[column.key]`; labels are display-only and may change.
     */
    key: string;
    /**
     * Semantic/source field name before result-key disambiguation.
     */
    name: string;
    /**
     * Human-facing display label.
     */
    label: string;
    role?: SemaphorFieldRef['role'];
    dataType?: SemaphorFieldRef['dataType'];
    aggregate?: SemaphorFieldRef['aggregate'];
    source?: SemaphorFieldRef['source'];
};

export declare type SemaphorSourceCoordinateInput = {
    databaseName?: string;
    schemaName?: string;
    tableName?: string;
};

export declare function semaphorSourceHasRequiredCoordinates(input: {
    capabilities: Pick<SemaphorConnectionCapabilities, 'prefixLevels'>;
    source: SemaphorSourceCoordinateInput;
}): boolean;

export declare function semaphorSourceIdentityKey(source: SemaphorSourceRef | undefined): string;

export declare type SemaphorSourceLevel = 'database' | 'schema' | 'table';

export declare type SemaphorSourceRef = {
    kind: 'semantic';
    domainId: string;
    datasetName: string;
    datasetId?: string;
    label?: string;
    connectionId?: string;
} | {
    kind: 'physical';
    connectionId: string;
    connectionType?: string;
    tableName: string;
    databaseName?: string;
    schemaName?: string;
    label?: string;
    dialect?: SemaphorDialect;
} | {
    kind: 'sql';
    connectionId: string;
    dialect?: SemaphorDialect;
    label?: string;
};

export declare function semaphorSourcesReferToSameDataset(left: SemaphorSourceRef | undefined, right: SemaphorSourceRef | undefined): boolean;

export declare type SemaphorSqlIntent = {
    kind: 'sql';
    version?: SemaphorProtocolVersion;
    id?: string;
    label?: string;
    source: Extract<SemaphorSourceRef, {
        kind: 'sql';
    }>;
    sql: string;
    defaultParameters?: Record<string, unknown>;
    pythonCode?: string;
    limit?: number;
    pagination?: SemaphorPaginationRequest;
    rationale?: string;
    fields?: SemaphorFieldRef[];
    inputs?: SemaphorInputBinding[];
};

export declare type SemaphorSqlResult = SemaphorAnalyticsResultBase & {
    kind: 'sql';
    columns: SemaphorRecordsResult['columns'];
    records: SemaphorRecordsResult['records'];
    sqlShape?: {
        statementType?: string;
        explicitLimit?: number;
        hasPythonCode?: boolean;
    };
};

export declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';

export declare type SemaphorTimeWindow = SemaphorRelativeTimeWindow | SemaphorAbsoluteTimeWindow;

export declare type SemaphorValidationResult = {
    ok: boolean;
    errors: SemaphorProtocolIssue[];
    warnings: SemaphorProtocolIssue[];
};

export declare type SemaphorViewPresentation = {
    kind: 'kpi';
    format?: 'number' | 'currency' | 'percent' | 'duration';
} | {
    kind: 'lineChart' | 'barChart' | 'areaChart';
    x?: string;
    y?: string[];
} | {
    kind: 'table';
    columns?: string[];
} | {
    kind: 'text';
};

export declare function validateSemaphorAnalyticsIntent(intent: SemaphorAnalyticsIntent): SemaphorAnalyticsValidationResult;

export declare function validateSemaphorAnalyticsRecoveryPlan(plan: SemaphorAnalyticsRecoveryPlan): SemaphorAnalyticsValidationResult;

export declare function validateSemaphorDashboardIntent(intent: SemaphorDashboardIntent): SemaphorValidationResult;

export declare function validateSemaphorOperationIntent(intent: SemaphorOperationIntent): SemaphorAnalyticsValidationResult;

export { }
