/**
 * Franklin Agent Loop
 * The core reasoning-action cycle: prompt → model → extract capabilities → execute → repeat.
 */
import type { AgentConfig, ContentPart, Dialogue, StreamEvent } from './types.js';
/**
 * Detect when the gateway leaked an upstream rate-limit / quota error as a
 * 200-OK text content block instead of a real HTTP error. The Anthropic
 * provider in particular surfaces per-day TPM exhaustion as a bracketed
 * "[Error: Too many tokens per day, please wait before trying again.]"
 * message glued into the assistant text channel, which then poisons grounding
 * checks and gets persisted to session history as if it were a real reply.
 *
 * Treat any assistant turn whose entire text payload is a single bracketed
 * `[Error: ...]` line — and contains no tool_use / thinking blocks — as a
 * masquerading transport error. The caller throws to let the existing
 * classifier + retry path take over.
 */
export declare function looksLikeGatewayErrorAsText(parts: ContentPart[]): {
    match: boolean;
    message: string;
};
/**
 * Identify models known to hallucinate tool calls (invented names, literal
 * `[TOOLCALL]` / `<tool_call>` text in answers) — they need the explicit
 * "Available tools" inventory appended to the system prompt. Strong frontier
 * models skip the nag so their prompt cache doesn't turn over.
 *
 * Exported so tests can pin the classification without a live API.
 */
export declare function isWeakModel(model: string): boolean;
/**
 * Run a multi-turn interactive session.
 * Each user message triggers a full agent loop.
 * Returns the accumulated conversation history.
 */
export declare function interactiveSession(config: AgentConfig, getUserInput: () => Promise<string | null>, onEvent: (event: StreamEvent) => void, onAbortReady?: (abort: () => void) => void): Promise<Dialogue[]>;
