/** * Configure-warning delivery helper. * * IMPORTANT — DO NOT MOVE BACK INTO `index.ts`. * * OpenCode's plugin loader (`getLegacyPlugins` in * `~/Work/OSS/opencode/packages/opencode/src/plugin/index.ts`) walks * `Object.values(mod)` of the plugin's main module and treats every * top-level export as either a server plugin function or an object * with a `.server` plugin function. Anything else throws * `TypeError: Plugin export is not a function` and the plugin fails to * load. Function exports get called as plugins, their (often `void`) * return value gets pushed into the hooks array, and the next iteration * over hooks crashes the host with * `undefined is not an object (evaluating 'z.config')` (and a sibling * `S.provider` for other hook iterations). * * Putting this helper in its own module keeps `index.ts` to exactly one * default export — the plugin function itself — and lets tests import * from this file directly. */ import { type AftProjectTransport } from "@cortexkit/aft-bridge"; import { type ConfigLoadError, type ConfigureWarningsDelivery } from "./config.js"; import { type ConfigureWarning } from "./notifications.js"; /** Buffer config syntax failures until a session-bound configure warning flush (deduped by hint). */ export declare function enqueueConfigParseWarnings(projectRoot: string, errors: readonly ConfigLoadError[]): void; export declare function drainPendingConfigParseWarnings(projectRoot: string): ConfigureWarning[]; export declare function drainPendingEagerWarnings(projectRoot: string): ConfigureWarning[]; /** Test-only reset for queued configure warnings. */ export declare function __resetConfigureWarningQueuesForTests(): void; export declare function enqueueConfigureWarningsForSession(context: { projectRoot: string; sessionId?: string | null; client?: unknown; bridge: Pick; warnings: unknown[]; configDroppedKeys?: unknown; fallbackClient: unknown; storageDir: string; pluginVersion: string; serverUrl?: string; delivery?: ConfigureWarningsDelivery; }): void; /** Deliver queued configure warnings after the session goes idle (avoids mid-turn prompt side effects). */ export declare function flushConfigureWarningsOnIdle(sessionId: string): Promise; /** @deprecated Use {@link enqueueConfigureWarningsForSession} + {@link flushConfigureWarningsOnIdle}. */ export declare function handleConfigureWarningsForSession(context: { projectRoot: string; sessionId?: string | null; client?: unknown; bridge: Pick; warnings: unknown[]; configDroppedKeys?: unknown; fallbackClient: unknown; storageDir: string; pluginVersion: string; serverUrl?: string; delivery?: ConfigureWarningsDelivery; }): Promise; //# sourceMappingURL=configure-warnings.d.ts.map