/**
 * Inline AI co-author client — thin, typed wrapper around the
 * `POST /ai/coauthor` endpoint exposed by `cms-core`.
 *
 * The endpoint implements four text-transformation micro-actions backed by
 * the configured AI provider. This client lives in `cms-admin` so the
 * editor (bubble menu) and the command palette (slash commands) can share
 * exactly one request path, error model, and option shape.
 *
 * Mirrors the request body documented in `packages/cms-core/src/api/handlers.ts`:
 *
 *   POST /ai/coauthor
 *   { action, text, style?, tone?, instructions?, targetLength? }
 */
export type CoauthorAction = 'rewrite' | 'expand' | 'compress' | 'proofread';
/**
 * Frozen tuple of every action the server accepts. Used both as a type-safe
 * iteration source (bubble menu pills, slash-command registration) and by
 * the runtime `isCoauthorAction` guard so callers don't drift from the
 * server's allowlist.
 */
export declare const COAUTHOR_ACTIONS: readonly ["rewrite", "expand", "compress", "proofread"];
/**
 * Hard client-side ceiling that matches `AI_CONTEXT_MAX_CHARS` in cms-core.
 * Catching this here avoids a round-trip just to get a 400 back when a user
 * pastes a giant block into the bubble menu.
 */
export declare const COAUTHOR_TEXT_MAX_CHARS = 50000;
export type ProofreadChange = {
    original: string;
    corrected: string;
    reason?: string;
};
export interface CoauthorOptions {
    /** Free-form style cue, e.g. "more concise", "academic". Used by rewrite. */
    style?: string;
    /** Tone cue, e.g. "friendly", "professional". Used by rewrite. */
    tone?: string;
    /** Free-form instructions. Used by expand. */
    instructions?: string;
    /** Target length in words. Used by compress. */
    targetLength?: number;
}
export interface CoauthorResult {
    action: CoauthorAction;
    text: string;
    /** Populated only when `action === 'proofread'`. */
    changes?: ProofreadChange[];
}
export type CoauthorOutcome = {
    ok: true;
    result: CoauthorResult;
} | {
    ok: false;
    error: string;
    status: number;
};
export declare function coauthorActionLabel(action: CoauthorAction): string;
export declare function coauthorActionDescription(action: CoauthorAction): string;
export declare function isCoauthorAction(value: unknown): value is CoauthorAction;
/**
 * Run a text-transformation micro-action against `/ai/coauthor`.
 *
 * Returns a discriminated outcome so callers can switch on `outcome.ok`
 * without a try/catch — the underlying `cmsApi` already turns every
 * non-2xx and every network failure into a structured error envelope.
 *
 * Pre-flight validation is intentionally cheap (whitespace + length) so the
 * server stays the single source of truth for richer auth/rate-limit logic.
 */
export declare function coauthorText(action: CoauthorAction, text: string, opts?: CoauthorOptions): Promise<CoauthorOutcome>;
//# sourceMappingURL=coauthor-client.d.ts.map