/** * User-visible notifications for AFT plugin. * * Two delivery paths based on the OpenCode client: * - Desktop: Sends ignored messages to the active session (appears in chat, hidden from LLM) * - TUI: Uses client.tui.showToast() for transient toast notifications * * Use cases: * - Feature announcements (new version, new experimental features) * - Warnings (ONNX Runtime not found, stale binary) * * Messages are identified by markers and cleaned up on subsequent startups * when no longer relevant (Desktop only — TUI toasts are inherently transient). */ import { type AftProjectTransport } from "@cortexkit/aft-bridge"; import type { ConfigureWarningsDelivery } from "./config.js"; export declare function __resetNotificationStateForTests(): void; type SdkMessage = { info?: { id?: string; role?: string; }; parts?: Array<{ type?: string; text?: string; ignored?: boolean; }>; }; export declare const SESSION_MESSAGES_LIMIT = 50; /** * @internal — exported only so tests can pin the bounded-call contract. * Production callers go through `cleanupWarnings`, which gates on a real * `readDesktopState()` before reaching this helper. */ export declare function getSessionMessages(client: unknown, sessionId: string): Promise; export interface NotificationOptions { /** The OpenCode SDK client */ client: unknown; /** Project directory used as the queue key for delayed Desktop notices. */ directory: string; /** Concrete OpenCode session/window to receive Desktop notifications. */ sessionId?: string; /** Server URL for message deletion (optional — from ctx.serverUrl) */ serverUrl?: string; } export interface ConfigureWarning { kind: "formatter_not_installed" | "checker_not_installed" | "lsp_binary_missing" | "config_parse_failed" | "config_key_dropped"; language?: string; server?: string; tool?: string; binary?: string; hint: string; } export interface ConfigureWarningOptions { client: unknown; sessionId: string; bridge: Pick; storageDir: string; pluginVersion: string; projectRoot?: string; serverUrl?: string; delivery?: ConfigureWarningsDelivery; } /** * Send a persistent warning notification. * Desktop: ignored message when sessionId is explicit; otherwise queued. * TUI: toast with warning variant (inherently transient). */ export declare function sendWarning(opts: NotificationOptions, message: string): Promise; /** * Send a feature announcement for a new version. * Tracked via a version file in storageDir — only fires once per version across all sessions. * Desktop: ignored message when sessionId is explicit; otherwise queued. * TUI: toast with info variant. */ export declare function sendFeatureAnnouncement(opts: NotificationOptions, version: string, features: string[], footer: string, storageDir?: string): Promise; export declare function deliverConfigureWarnings(opts: ConfigureWarningOptions, warnings: ConfigureWarning[]): Promise; /** * Clean up stale AFT warning messages from previous runs. * Desktop only — TUI toasts are inherently transient and don't need cleanup. */ export declare function cleanupWarnings(opts: NotificationOptions): Promise; export {}; //# sourceMappingURL=notifications.d.ts.map