import type { AfterToolCallContext, BeforeToolCallContext, BeforeToolCallResult, ShouldStopAfterTurnContext } from '@earendil-works/pi-agent-core'; export interface AgentTurnPolicy { reset(): void; beforeToolCall(context: BeforeToolCallContext, signal?: AbortSignal): Promise; afterToolCall(context: AfterToolCallContext): Promise; shouldStopAfterTurn(context: ShouldStopAfterTurnContext): boolean; } export interface AgentTurnPolicyOptions { maxTurns?: number; maxToolFailures?: number; resolveToolLimit?: (toolName: string, args: unknown) => { id: string; maxCalls: number; } | undefined; authorizeToolCall?: (context: BeforeToolCallContext, signal?: AbortSignal) => Promise; } /** One user-visible run policy. A fresh instance is created for every embedded run. */ export declare function createAgentTurnPolicy(options: AgentTurnPolicyOptions): AgentTurnPolicy;