/**
 * Race an agent turn against a wall clock; on timeout, abort the in-flight turn
 * and await {@link Agent.waitForIdle} so a subsequent {@link Agent.prompt} is allowed.
 */
import type { Agent } from '@earendil-works/pi-agent-core';
import type { Config } from '../../config/schema.js';
/** Minimum per-turn timeout (1 minute). */
export declare const MIN_AGENT_TURN_TIMEOUT_MS = 60000;
/** Maximum per-turn timeout (4 hours), aligned with `maxTaskDurationMs` schema cap. */
export declare const MAX_AGENT_TURN_TIMEOUT_MS: number;
/** Default when `agents.defaults.maxTaskDurationMs` is unset (30 minutes). */
export declare const DEFAULT_AGENT_TURN_TIMEOUT_MS: number;
/**
 * Effective turn timeout from config or default.
 * Uses `agents.defaults.maxTaskDurationMs` when set (clamped to schema bounds).
 */
export declare function resolveAgentTurnTimeoutMs(config?: Config): number;
export declare function isAgentTurnTimeoutError(err: unknown): boolean;
export declare function runAgentTurnWithTimeout(agent: Agent, runTurn: () => Promise<void>, timeoutMs: number): Promise<void>;
