/**
 * Dashboard module — Ember read-only chat client (SPEC-189, Phase A).
 * Splits into pure decision functions (unit-tested) and a thin wiring function
 * `connectEmberStream` that binds them to injected browser globals (fetch,
 * document). The pure half holds all the logic — chunk fold for the progressively
 * streamed answer, avatar-state mapping, retry visibility, empty-input guard;
 * the wiring half is humble glue with no branching of its own and is not
 * unit-tested, mirroring the connectSetupWizardStream precedent.
 *
 * Transport: POST /api/ember/ask streaming a text/event-stream body back.
 * Read-only: the chat only asks questions and folds the streamed answer.
 *
 * Visual DNA: "Agentic OS" — see project_agentic_os_design_dna.md.
 */
/**
 * @typedef {{ type: string } & Record<string, unknown>} EmberEvent
 */
/**
 * @param {string} data
 * @returns {EmberEvent | null}
 */
export function parseEmberEvent(data: string): EmberEvent | null;
/**
 * Folds a streamed chunk into the accumulated answer. Non-chunk events leave the
 * answer untouched, so the caller can fold the whole stream blindly.
 *
 * @param {string} answer
 * @param {EmberEvent} event
 * @returns {string}
 */
export function foldAnswer(answer: string, event: EmberEvent): string;
/**
 * Maps a single stream event to the avatar state it drives. Returns null for an
 * event the avatar does not react to, so the caller keeps the previous state.
 *
 * @param {EmberEvent} event
 * @returns {'idle' | 'working' | 'error' | null}
 */
export function avatarStateFromEvent(event: EmberEvent): "idle" | "working" | "error" | null;
/**
 * @param {EmberEvent[]} events
 * @returns {boolean}
 */
export function shouldShowRetry(events: EmberEvent[]): boolean;
/**
 * Empty-input rule (R: empty input → nothing sent, field stays focused).
 *
 * @param {string} question
 * @returns {boolean}
 */
export function shouldSendQuestion(question: string): boolean;
/**
 * Thin wiring: streams a question to POST /api/ember/ask, folds the SSE body,
 * drives the reused avatar and the aria-live region. Not unit-tested (humble
 * glue) — exercised in the browser only.
 *
 * @param {Object} options
 * @param {string} options.question
 * @param {(answer: string) => void} options.onAnswer
 * @param {(state: 'idle' | 'working' | 'error') => void} options.onAvatarState
 * @param {(text: string) => void} options.onAnnounce
 * @param {(visible: boolean) => void} options.onRetryVisible
 * @param {typeof fetch} [options.fetchImplementation]
 * @returns {Promise<void>}
 */
export function connectEmberStream(options: {
    question: string;
    onAnswer: (answer: string) => void;
    onAvatarState: (state: "idle" | "working" | "error") => void;
    onAnnounce: (text: string) => void;
    onRetryVisible: (visible: boolean) => void;
    fetchImplementation?: typeof fetch | undefined;
}): Promise<void>;
export type EmberEvent = {
    type: string;
} & Record<string, unknown>;
//# sourceMappingURL=emberChat.d.ts.map