/** * [WHO]: Provides StatusDisplayController + StatusDisplayContext — chat status/error/warning * lines with auto-dismiss timers, dedup-by-last-line, priority notifications * [FROM]: Depends on injected host capability closures + @catui/tui + NotificationQueue; * no InteractiveMode reference * [TO]: Consumed by modes/interactive/interactive-mode.ts (held lazily as `this.statusDisplay` * behind thin delegators: showStatus / showError / showWarning / notify / clearStatusTimers) * [HERE]: modes/interactive/controllers/status-display-controller.ts — P7 C-3d (extracted from * InteractiveMode; behavior-preserving move) */ import { type CachedContainer, type TUI } from "@catui/tui"; import type { NotificationQueue } from "../components/notification-queue.js"; import type { BuddyState } from "../components/buddy/pet-sprites.js"; import type { InteractiveState } from "../state/interactive-state.js"; /** Host capabilities needed by the status display controller. */ export interface StatusDisplayContext { readonly chatContainer: CachedContainer; readonly state: InteractiveState; readonly ui: TUI; readonly notificationQueue: NotificationQueue; setBuddyPetState(state: BuddyState, speechBubble?: string, options?: { resetTo?: BuddyState; afterMs?: number; }): void; } export declare class StatusDisplayController { private readonly ctx; private readonly statusTimers; constructor(ctx: StatusDisplayContext); /** * Show a status message in the chat. * * If multiple status messages are emitted back-to-back (without anything else being added to the chat), * we update the previous status line instead of appending new ones to avoid log spam. * Auto-dismisses after 5 seconds. */ showStatus(message: string): void; showError(errorMessage: string): void; showWarning(warningMessage: string): void; /** * Schedule auto-removal of a status/warning message after 5 seconds. */ private scheduleStatusDismiss; /** * Cancel all pending status dismiss timers (e.g., on /clear). */ clearStatusTimers(): void; /** * Show a priority notification (floating, auto-dismiss, dedup by key). */ notify(message: string, options?: { key?: string; priority?: "immediate" | "high" | "medium" | "low"; type?: "info" | "warning" | "error"; duration?: number; }): void; }