import { type ClarificationResponseAction, type ClarificationSubmission, type ClarificationWaitSnapshot } from '@xopcai/gateway-contract'; import type { GatewayPrincipal } from '../../gateway/security/gateway-principal.js'; import type { ResolveClarificationResult } from '../../storage/sqlite/clarification-wait-repository.js'; import type { ExternalInteractionRequest, ExternalInteractionResponse } from './types.js'; export type ExternalClarifyStreamEvent = { type: string; [key: string]: unknown; }; /** * Pause an active external agent turn for a live approval or user-input prompt, * queuing concurrent prompts per conversation so each is presented cleanly via * xopc's standard `clarify_request` stream event. */ export declare function waitForExternalInteraction(input: { conversationId: string; transcriptId: string; runId: string; actor?: GatewayPrincipal; request: ExternalInteractionRequest; signal: AbortSignal; emitClarifyEvent: (event: ExternalClarifyStreamEvent) => void; }): Promise; export declare function getActiveExternalInteractionSnapshot(conversationId: string): ClarificationWaitSnapshot | undefined; export declare function hasExternalInteraction(id: string): boolean; export declare function canAccessExternalInteraction(id: string, actor: GatewayPrincipal | undefined): boolean; export declare function resolveExternalInteraction(input: ClarificationSubmission & { id: string; expectedVersion?: number; action: ClarificationResponseAction; }): ResolveClarificationResult | undefined; export declare function cancelExternalInteractionsForConversation(conversationId: string): void;