import type { AgentTool } from '@earendil-works/pi-agent-core'; export type ClarifyRequestPayload = { kind?: 'approval'; question: string; choices?: string[]; suggestedAnswer?: string; /** Stable hash of the exact operation guarded by an approval. */ approvalKey?: string; }; export type ClarifyRequestResult = { status: 'answered'; answer: string; } | { status: 'waiting'; waitId: string; expiresAt?: number; }; export type GatewayClarifyRequestFn = (context: { sessionKey: string; runId: string; toolCallId: string; }, request: ClarifyRequestPayload) => Promise; export interface ClarifyToolDeps { /** Resolve a per-turn callback; returns null when clarification is unavailable. */ resolveAskUser: (toolCallId: string) => ((request: ClarifyRequestPayload) => Promise) | null; } export declare function createClarifyTool(deps: ClarifyToolDeps): AgentTool;