import { resolveModel } from '../../providers/index.js';
import type { GoalUiLocale } from './goal-locale.js';
/**
 * Extract visible text from a pi-ai `AssistantMessage.content` array.
 * Handles `TextContent` (`type: 'text'`) and falls back to `ThinkingContent`
 * (`type: 'thinking'`) when the text blocks are empty — reasoning models
 * (DeepSeek-R1, Qwen-thinking, etc.) may place the entire response inside
 * thinking blocks, leaving the text portion blank.
 */
export declare function extractAssistantText(content: unknown): string;
/**
 * Strip markdown code fences (opening AND closing) from raw model output.
 * Handles `` ```json ``, `` ``` ``, and trailing `` ``` `` with optional whitespace.
 */
export declare function stripCodeFences(raw: string): string;
/** Mirrors `hermes_cli/goals.py` — strict judge, JSON-only reply. */
export declare const JUDGE_SYSTEM_PROMPT: string;
export declare const JUDGE_USER_PROMPT_TEMPLATE: string;
export declare const DEFAULT_JUDGE_TIMEOUT_MS = 60000;
export declare function truncateGoalText(text: string, limit: number): string;
export declare function resolveGoalJudgeApiKey(model: ReturnType<typeof resolveModel>): Promise<string | undefined>;
export declare function getAssistantMessageErrorReason(message: unknown): string | null;
/** Parse judge JSON — fail-open to **continue** (Hermes semantics). */
export declare function parseJudgeResponseFailOpen(raw: string): {
    done: boolean;
    reason: string;
    parseFailed: boolean;
};
export type GoalJudgeVerdict = 'done' | 'continue' | 'skipped';
/**
 * Ask the configured model whether the goal is satisfied.
 * Fail-open: any error → `continue` (Hermes — turn budget is the backstop).
 */
export declare function judgeGoalHermesStyle(goal: string, lastResponse: string, judgeModelRef: string, signal?: AbortSignal, opts?: {
    judgeTimeoutMs?: number;
    uiLocale?: GoalUiLocale;
}): Promise<{
    verdict: GoalJudgeVerdict;
    reason: string;
    parseFailed: boolean;
}>;
