import { EntityType } from '@mastra/core/observability';
import { ListTracesArgs } from '@mastra/core/storage';
import { TraceDatePreset } from './types';
import { PropertyFilterField, PropertyFilterToken } from '../../ds/components/PropertyFilter/types';
export type EntityOptions = {
    label: string;
    entityType: EntityType;
};
export declare const ROOT_ENTITY_TYPES: {
    readonly AGENT: EntityType.AGENT;
    readonly WORKFLOW: EntityType.WORKFLOW_RUN;
    readonly SCORER: EntityType.SCORER;
    readonly INGEST: EntityType.RAG_INGESTION;
};
export declare const 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 type TraceStatusFilter = 'running' | 'success' | 'error';
export declare const TRACE_STATUS_OPTIONS: readonly [{
    readonly label: "Running";
    readonly value: "running";
}, {
    readonly label: "Success";
    readonly value: "success";
}, {
    readonly label: "Error";
    readonly value: "error";
}];
/** Field ids for "synthetic" filter entries — they live in dedicated URL params
 *  rather than the generic `filter*` set, but appear as rows in the Filter
 *  popover so users can manage all filters from one place. */
export declare const TRACE_SYNTHETIC_FILTER_FIELD_IDS: readonly ["rootEntityType", "status"];
export declare const TRACE_ROOT_ENTITY_TYPE_PARAM = "rootEntityType";
export declare const TRACE_STATUS_PARAM = "status";
export declare const TRACE_LIST_MODE_PARAM = "listMode";
/** Branch-mode only: identifies the anchor span that defines the displayed subtree.
 *  Stable across intra-panel span navigation (which only changes `spanId`). */
export declare const TRACE_ANCHOR_SPAN_ID_PARAM = "anchorSpanId";
export declare const TRACE_LIST_MODE_VALUES: Set<"traces" | "branches">;
export type TraceListMode = 'traces' | 'branches';
export declare const TRACE_LIST_MODE_OPTIONS: readonly [{
    readonly label: "Traces (default)";
    readonly value: "traces";
}, {
    readonly label: "Branches";
    readonly value: "branches";
}];
export declare const TRACE_DATE_PRESET_PARAM = "datePreset";
export declare const TRACE_DATE_FROM_PARAM = "dateFrom";
export declare const TRACE_DATE_TO_PARAM = "dateTo";
export declare const TRACE_DATE_PRESET_VALUES: Set<TraceDatePreset>;
export declare const TRACE_PROPERTY_FILTER_PARAM_BY_FIELD: {
    readonly tags: "filterTags";
    readonly entityId: "filterEntityId";
    readonly entityName: "filterEntityName";
    readonly traceId: "filterTraceId";
    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 TRACE_PROPERTY_FILTER_FIELD_IDS: Array<keyof typeof TRACE_PROPERTY_FILTER_PARAM_BY_FIELD>;
export declare const TRACE_STATUS_VALUES: Set<TraceStatusFilter>;
export declare const DEFAULT_TRACE_FILTERS_STORAGE_KEY = "mastra:traces:saved-filters";
/** Serialize the filter-related URL params (date + rootEntityType + status +
 *  generic filterX set) to localStorage so the user can restore them on next
 *  visit. Throws no errors — storage being unavailable is fine. */
export declare function saveTraceFiltersToStorage(params: URLSearchParams, storageKey?: string): void;
/** Forget any previously saved filter set. Called from the "Remove filters"
 *  action so the next plain sidebar nav lands on an empty page. */
export declare function clearSavedTraceFilters(storageKey?: string): void;
/** Read a previously saved filter set and return it as URLSearchParams, or
 *  null if nothing is saved or storage is unavailable. */
export declare function loadTraceFiltersFromStorage(storageKey?: string): URLSearchParams | null;
/** True when `params` carries any filter-related key — used to decide whether
 *  to hydrate from localStorage on page mount (we only hydrate when the URL is
 *  filter-clean, i.e. the user landed here via a plain sidebar nav). */
export declare function hasAnyTraceFilterParams(params: URLSearchParams): boolean;
export declare function createTracePropertyFilterFields({ 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 (URLSearchParams iterates in insertion order). This
 * is used by the Filter popover + PropertyFilterApplied pills so the UI reflects the
 * order the user created the filters in.
 */
export declare function getTracePropertyFilterTokens(searchParams: URLSearchParams): PropertyFilterToken[];
export declare function getPreservedTraceFilterParams(searchParams: URLSearchParams): URLSearchParams;
/**
 * Clear all filter params from `params` and re-add them in the given `tokens`
 * order so the URL (and therefore the PropertyFilterApplied pills) reflects the
 * creation order of filters. Handles the generic `filterX` params plus the
 * dedicated synthetic params (rootEntityType, status).
 */
export declare function applyTracePropertyFilterTokens(params: URLSearchParams, tokens: PropertyFilterToken[]): void;
export declare function buildTraceListFilters({ rootEntityType, status, dateFrom, dateTo, tokens, }: {
    rootEntityType?: string;
    status?: TraceStatusFilter;
    dateFrom?: Date;
    dateTo?: Date;
    tokens: PropertyFilterToken[];
}): ListTracesArgs['filters'];
/**
 * "Clear" semantics: 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 neutralizeFilterTokens(filterFields: PropertyFilterField[], filterTokens: PropertyFilterToken[]): PropertyFilterToken[];
