/**
 * Usher — a signal-only mid-task watcher (rung 4 of continuous-working-awareness).
 *
 * On each substantive inbound turn (chained on the same onMessageLogged seam the
 * capture loop uses, AFTER capture), the Usher asks: does this turn re-activate a
 * FADED context — something tracked but below the briefing tier, so a session-start
 * briefing wouldn't have carried it? If so it emits a re-surface SIGNAL to the
 * UsherSignalStore (a pull surface). It NEVER injects (rung 5, gated on the Usher's
 * measured precision).
 *
 * Invariants (carried from the capture loop): best-effort never-throws,
 * fire-and-forget (off the delivery path), degrade-safe (no provider / no
 * candidates / LLM error → no signal), framework-agnostic (injected provider via
 * the LlmQueue, never a raw client). Spec: docs/specs/cwa-usher.md.
 */
import type { IntelligenceProvider } from './types.js';
import type { TopicIntentStore } from './TopicIntent.js';
import type { UsherSignalStore } from './UsherSignalStore.js';
import { type CaptureTurnEntry } from './TopicIntentCapture.js';
/** A faded candidate the Usher considers re-surfacing. */
export interface FadedCandidate {
    refId: string;
    text: string;
    kind: string;
}
/** The LLM step: given the new turn + faded candidates, which does it re-activate? */
export interface UsherReactivation {
    refId: string;
    reason: string;
}
export type UsherCheckFn = (turnText: string, candidates: FadedCandidate[]) => Promise<UsherReactivation[]>;
export type UsherDegradeReason = 'no-intelligence' | 'error';
export declare function buildUsherPrompt(turnText: string, candidates: FadedCandidate[]): string;
export declare function parseUsherResponse(raw: string, candidates: FadedCandidate[]): UsherReactivation[];
/**
 * Production check fn factory: buildUsherPrompt → injected provider → parse.
 * Degrade-safe: no provider / throw → []. `onDegrade` fires for observability
 * without weakening degrade-safety.
 */
export declare function createUsherCheckFn(intelligence?: IntelligenceProvider, onDegrade?: (reason: UsherDegradeReason) => void): UsherCheckFn;
export interface UsherDeps {
    store: TopicIntentStore;
    signalStore: UsherSignalStore;
    checkFn: UsherCheckFn;
    /** Skip under quota pressure. */
    shouldShed?: () => boolean;
    rateCeiling?: {
        maxPerWindow: number;
        windowMs: number;
    };
    now?: () => number;
}
export type UsherOutcome = 'signalled' | 'no-reactivation' | 'no-candidates' | 'skipped-prefilter' | 'skipped-shed' | 'skipped-rate' | 'no-topic' | 'degraded';
export declare function usherCheckTurn(deps: UsherDeps, entry: CaptureTurnEntry, rateState?: Map<number, number[]>): Promise<UsherOutcome>;
/** Stateful Usher closure (owns per-topic rate state). Wire onto the inbound seam. */
export declare function createUsherLoop(deps: UsherDeps): (entry: CaptureTurnEntry) => Promise<UsherOutcome>;
//# sourceMappingURL=Usher.d.ts.map