import { type CoreMessage } from 'ai';
import type { EngineRuntimePort } from '../engine/engine.js';
import type { YagrRequiredAction, YagrRunJournalEntry, YagrRunOptions, YagrRunResult } from '../types.js';
/**
 * Structural delimiters injected around every internal prompt (phase instructions,
 * recovery prompts). The stream filter strips everything between an open and a close
 * tag — one single regex, no coupling to the prompt wording.
 */
export declare const INTERNAL_TAG_OPEN = "\u200B\u27E8yagr:internal\u27E9\u200B";
export declare const INTERNAL_TAG_CLOSE = "\u200B\u27E8/yagr:internal\u27E9\u200B";
type ExecuteRunResult = {
    result: YagrRunResult;
    persistedMessages: CoreMessage[];
    workspaceInstructionsMayHaveChanged: boolean;
};
export declare function sanitizeAssistantOutput(text: string): string;
export declare function sanitizeAssistantMessageContent(content: CoreMessage['content']): CoreMessage['content'];
export declare function sanitizeAssistantResponseMessages(messages: readonly CoreMessage[]): CoreMessage[];
export declare function shouldAbortForInternalPromptLeak(rawText: string, visibleText?: string): boolean;
export declare function shouldAbortForRepetitiveAssistantOutput(visibleText: string): boolean;
export declare function buildGroundedSummary(_prompt: string, finishReason: string, journal: YagrRunJournalEntry[], requiredActions: YagrRequiredAction[]): string;
export declare function shouldForceGroundedFinalAnswer(journal: YagrRunJournalEntry[], requiredActions?: YagrRequiredAction[]): boolean;
export declare function finalAnswerSatisfiesGroundedWorkflowFacts(text: string, journal: YagrRunJournalEntry[]): boolean;
export declare class YagrRunEngine {
    private readonly engine;
    private readonly history;
    private readonly systemPrompt;
    constructor(engine: EngineRuntimePort, history: readonly CoreMessage[], systemPrompt: string);
    execute(prompt: string, options?: YagrRunOptions): Promise<ExecuteRunResult>;
}
export {};
//# sourceMappingURL=run-engine.d.ts.map