import { EntityType } from '@mastra/core/observability';
import { ListLogsArgs } from '@mastra/core/storage';
import { LogLevel } from './types';
import { PropertyFilterField, PropertyFilterToken } from '../../ds/components/PropertyFilter/types';
export type LogsDatePreset = 'all' | 'last-24h' | 'last-3d' | 'last-7d' | 'last-14d' | 'last-30d' | 'custom';
export type LogsEntityOptions = {
    label: string;
    entityType: EntityType;
};
export declare const LOGS_ROOT_ENTITY_TYPES: {
    readonly AGENT: EntityType.AGENT;
    readonly WORKFLOW: EntityType.WORKFLOW_RUN;
    readonly SCORER: EntityType.SCORER;
    readonly INGEST: EntityType.RAG_INGESTION;
};
export declare const LOGS_ROOT_ENTITY_TYPE_OPTIONS: readonly [{
    readonly label: "Agent";
    readonly entityType: EntityType.AGENT;
}, {
    readonly label: "Workflow";
    readonly entityType: EntityType.WORKFLOW_RUN;
}, {
    readonly label: "Scorer";
    readonly entityType: EntityType.SCORER;
}, {
    readonly label: "Ingest";
    readonly entityType: EntityType.RAG_INGESTION;
}];
export declare const LOG_LEVEL_VALUES: readonly LogLevel[];
export declare const LOG_LEVEL_OPTIONS: readonly [{
    readonly label: "Debug";
    readonly value: "debug";
}, {
    readonly label: "Info";
    readonly value: "info";
}, {
    readonly label: "Warn";
    readonly value: "warn";
}, {
    readonly label: "Error";
    readonly value: "error";
}, {
    readonly label: "Fatal";
    readonly value: "fatal";
}];
export declare const LOGS_ROOT_ENTITY_TYPE_PARAM = "rootEntityType";
export declare const LOGS_DATE_PRESET_PARAM = "datePreset";
export declare const LOGS_DATE_FROM_PARAM = "dateFrom";
export declare const LOGS_DATE_TO_PARAM = "dateTo";
export declare const LOGS_DATE_PRESET_VALUES: Set<LogsDatePreset>;
/**
 * Generic filter URL params (filterX keys). Fields that carry multiple values
 * (tags, level) use repeated params; everything else is a single string.
 */
export declare const LOGS_PROPERTY_FILTER_PARAM_BY_FIELD: {
    readonly level: "filterLevel";
    readonly tags: "filterTags";
    readonly entityName: "filterEntityName";
    readonly traceId: "filterTraceId";
    readonly spanId: "filterSpanId";
    readonly runId: "filterRunId";
    readonly threadId: "filterThreadId";
    readonly sessionId: "filterSessionId";
    readonly requestId: "filterRequestId";
    readonly resourceId: "filterResourceId";
    readonly userId: "filterUserId";
    readonly organizationId: "filterOrganizationId";
    readonly serviceName: "filterServiceName";
    readonly environment: "filterEnvironment";
    readonly experimentId: "filterExperimentId";
};
export declare const LOGS_PROPERTY_FILTER_FIELD_IDS: Array<keyof typeof LOGS_PROPERTY_FILTER_PARAM_BY_FIELD>;
export declare const DEFAULT_LOGS_FILTERS_STORAGE_KEY = "mastra:logs:saved-filters";
export declare function saveLogsFiltersToStorage(params: URLSearchParams, storageKey?: string): void;
export declare function clearSavedLogsFilters(storageKey?: string): void;
export declare function loadLogsFiltersFromStorage(storageKey?: string): URLSearchParams | null;
export declare function hasAnyLogsFilterParams(params: URLSearchParams): boolean;
export declare function createLogsPropertyFilterFields({ availableTags, availableRootEntityNames, availableServiceNames, availableEnvironments, loading, }: {
    availableTags: string[];
    availableRootEntityNames: string[];
    availableServiceNames: string[];
    availableEnvironments: string[];
    loading?: {
        tags?: boolean;
        entityNames?: boolean;
        serviceNames?: boolean;
        environments?: boolean;
    };
}): PropertyFilterField[];
/**
 * Read filter tokens from URL search params preserving the order in which
 * each filter was first added. Fields in LOGS_ARRAY_FIELD_IDS are read as
 * string[]; an empty sentinel (`filterX=`) keeps the pill alive post-Reset.
 */
export declare function getLogsPropertyFilterTokens(searchParams: URLSearchParams): PropertyFilterToken[];
export declare function getPreservedLogsFilterParams(searchParams: URLSearchParams): URLSearchParams;
export declare function applyLogsPropertyFilterTokens(params: URLSearchParams, tokens: PropertyFilterToken[]): void;
export declare function buildLogsListFilters({ rootEntityType, dateFrom, dateTo, tokens, }: {
    rootEntityType?: string;
    dateFrom?: Date;
    dateTo?: Date;
    tokens: PropertyFilterToken[];
}): ListLogsArgs['filters'];
/**
 * "Clear" semantics for the logs toolbar: keep all filter pills but neutralize each value.
 * '' for text fields, 'Any' for single-select pick-multi, [] for multi-select pick-multi.
 * Date range is intentionally NOT touched here — that's a separate concern.
 */
export declare function neutralizeLogsFilterTokens(filterFields: PropertyFilterField[], filterTokens: PropertyFilterToken[]): PropertyFilterToken[];
