/**
 * @fileoverview Pure, framework-agnostic helpers for the Knowledge Hub
 * "Analytics" resource's AI-agent integration.
 *
 * These functions are free of Angular / component dependencies so they can be
 * unit-tested in isolation. The component
 * ({@link AnalyticsResourceComponent}) supplies a plain snapshot of its current
 * state (active tab, filters, and the per-tab aggregate values it has computed)
 * and these helpers shape it into the key-value `AgentContext` object that flows
 * to the async chat agent and the realtime co-agent via
 * `NavigationService.SetAgentContext`. They also resolve agent-supplied
 * references (a source by name, a tab id) the way a user refers to them.
 *
 * 🚨 SAFETY: these helpers only SHAPE read-only aggregate state and RESOLVE
 * references — no mutation, no side effects. Nothing here exposes raw record
 * bodies; only the aggregate metrics, filters, and salient display names the
 * surface already shows on screen.
 */
/** The analytics navigation tabs the surface exposes. */
export declare const ANALYTICS_TABS: readonly ["overview", "tags", "sources", "pipeline", "quality", "cost"];
/** An Analytics tab id. */
export type AnalyticsTab = (typeof ANALYTICS_TABS)[number];
/** Type-guard for an Analytics tab id; keeps the switch tool tolerant of bad input. */
export declare function isValidAnalyticsTab(tab: unknown): tab is AnalyticsTab;
/** The date-range filter labels the surface offers. */
export declare const ANALYTICS_DATE_RANGES: readonly ["7D", "30D", "90D", "YTD", "All"];
/** An Analytics date-range label. */
export type AnalyticsDateRange = (typeof ANALYTICS_DATE_RANGES)[number];
/** Type-guard for a date-range label; keeps the date-range tool tolerant. */
export declare function isValidAnalyticsDateRange(range: unknown): range is AnalyticsDateRange;
/** Upper bound on how many list entries we publish in any one context field. */
export declare const ANALYTICS_CONTEXT_LIST_CAP = 25;
/** Cap an array to {@link ANALYTICS_CONTEXT_LIST_CAP} entries. Pure; never mutates input. */
export declare function capAnalyticsList<T>(items: readonly T[]): T[];
/**
 * Resolve an agent-supplied name reference (case-insensitive) against a list of
 * available names. Tries exact match first, then first case-insensitive
 * *contains* match. Pure + deterministic; returns the matched name or null.
 *
 * @param input - whatever the agent passed (a source name, an entity-filter label)
 * @param names - the names available on the surface
 */
export declare function resolveAnalyticsName(input: string, names: readonly string[]): string | null;
/**
 * A "no match" tolerant error for a name lookup. Lists the available names
 * (bounded) so the agent can retry. Never throws.
 */
export declare function buildAnalyticsNotFoundError(input: string, availableNames: readonly string[], noun: string): {
    Success: false;
    ErrorMessage: string;
};
/** A KPI summary (label + value) shown on the overview tab. */
export interface AnalyticsKPI {
    Label: string;
    Value: string;
    Delta: string;
}
/** A top-tag summary the tags tab shows (name, usage, avg weight, top entity). */
export interface AnalyticsTopTag {
    Name: string;
    UsageCount: number;
    AvgWeight: number;
    TopEntity: string;
}
/** A source-comparison summary the sources tab shows. */
export interface AnalyticsSourceSummary {
    Name: string;
    Items: number;
    AvgWeight: number;
    Status: string;
}
/** A co-occurring tag-pair summary the tags tab shows. */
export interface AnalyticsCoOccurrencePair {
    TagAName: string;
    TagBName: string;
    Count: number;
}
/** A cost-KPI summary the cost tab shows. */
export interface AnalyticsCostKPI {
    Label: string;
    Value: string;
}
/**
 * The plain, component-supplied snapshot used to build the Analytics agent
 * context. Mirrors the salient slice of the component's state: the active tab,
 * the date-range + entity filters, whether data is loading / a drill-down is
 * open, the always-on KPI strip, and the active tab's deep slice.
 */
export interface AnalyticsAgentContextInput {
    /** The active analytics tab. */
    ActiveTab: AnalyticsTab;
    /** The active date-range filter label. */
    DateRange: string;
    /** The active entity-filter label. */
    EntityFilter: string;
    /** The entity-filter labels the surface offers. */
    EntityFilterOptions: string[];
    /** Whether the surface is still loading its raw data. */
    IsLoading: boolean;
    /** The open drill-down target key, or null when none. */
    DrillDownTarget: string | null;
    /** Always-on KPI strip (label/value/delta). Component supplies all; helper bounds. */
    KPIs: AnalyticsKPI[];
    /** Pipeline status text shown in the sidebar. */
    PipelineStatusText: string;
    /** Whether the pipeline status is OK (vs error). */
    PipelineStatusOk: boolean;
    /** Tags-tab: the top tags. Component supplies all; helper bounds. */
    TopTags: AnalyticsTopTag[];
    /** Tags-tab: co-occurring tag pairs. */
    CoOccurrencePairs: AnalyticsCoOccurrencePair[];
    /** Tags-tab: when co-occurrence was last computed (relative), or null. */
    CoOccurrenceLastComputed: string | null;
    /** Sources-tab: the source comparison rows. */
    SourceComparison: AnalyticsSourceSummary[];
    /** Sources-tab: the currently selected source name. */
    SelectedSourceName: string;
    /** Quality-tab: the quality score (0-100). */
    QualityScore: number;
    /** Quality-tab: confidence stats (label/value pairs). */
    ConfidenceStats: {
        Label: string;
        Value: string;
    }[];
    /** Cost-tab: the cost KPIs. */
    CostKPIs: AnalyticsCostKPI[];
}
/**
 * Build the agent-visible context object for the Analytics surface. The active
 * tab decides which deep slice is merged onto the always-on common slice
 * (mode-scoped context). Pure function (no `this`) so it's unit-testable.
 *
 * @param input - the component's current state snapshot
 * @returns a flat key-value object suitable for `SetAgentContext`
 */
export declare function buildAnalyticsAgentContext(input: AnalyticsAgentContextInput): Record<string, unknown>;
//# sourceMappingURL=analytics-agent-context.d.ts.map