/**
 * Loki access-log field names (Traefik JSON access log, flattened by Loki's
 * `| json`). Overridable via env in case the shipped field names differ — the
 * exact names are validated against real logs during rollout.
 */
export interface LokiFields {
    host: string;
    path: string;
    userAgent: string;
}
export declare const DEFAULT_LOKI_FIELDS: LokiFields;
/** Regex (anchored) matching automation request paths from the shared denylist. */
export declare function automationPathRegex(): string;
/** Case-insensitive regex matching automation user-agents from the shared denylist. */
export declare function automationUaRegex(): string;
/**
 * LogQL instant query counting *proper* requests to `host` over the trailing
 * window — requests whose path and user-agent are NOT on the automation denylist.
 */
export declare function buildProperRequestCountQuery(selector: string, host: string, windowSeconds: number, fields?: LokiFields): string;
/** LogQL counting ALL requests to `host` (incl. automation) over the window. */
export declare function buildTotalRequestCountQuery(selector: string, host: string, windowSeconds: number, fields?: LokiFields): string;
/**
 * Activity classification for a studio host:
 *  - ACTIVE  — at least one proper (non-automation) request in the window.
 *  - IDLE    — access logs exist for the host but NONE are proper requests.
 *  - UNKNOWN — no access logs at all (signal unavailable) or the query failed.
 *
 * The UNKNOWN vs IDLE distinction is critical: a host with zero total log lines
 * means we can't measure (Traefik access logs off / not reaching Loki), NOT that
 * the studio is idle. Every live studio is polled by the observability worker
 * every 15s, so once access logs work total-requests is always > 0 — making
 * `total == 0` a reliable "can't measure" signal. The keeper sleeps only on IDLE.
 */
export type HostActivity = "ACTIVE" | "IDLE" | "UNKNOWN";
export interface LokiClient {
    classifyHostActivity(host: string, windowSeconds: number): Promise<HostActivity>;
}
export declare function createLokiClient(opts: {
    lokiUrl: string;
    selector: string;
    fields?: LokiFields;
    fetchTimeoutMs?: number;
    logger?: {
        warn: (m: string) => void;
    };
}): LokiClient;
//# sourceMappingURL=loki.d.ts.map