export type SenderType = 'human' | 'ai_agent'; export type TurnLifecycleState = 'idle' | 'thinking' | 'streaming' | 'tool' | 'waiting_input' | 'completed' | 'interrupted'; export type TurnMessageSemantics = 'progress' | 'turn_complete' | 'control'; export type DeliveryIntent = 'queue' | 'interrupt' | 'interleave' | 'stop'; export type InboundDisposition = 'queued' | 'accepted_now' | 'interleaved' | 'trigger_suppressed' | 'rejected' | 'cancelled'; export interface TurnMetadata { turnId?: string | null; turnSemantics?: TurnMessageSemantics; deliveryIntent?: DeliveryIntent; replyBehavior?: 'allow_auto_reply' | 'suppress_auto_reply'; inboundDisposition?: InboundDisposition; requestedTurnMode?: string; } export interface TriggerDecision { allow: boolean; semantics: TurnMessageSemantics; reason: string; } export interface TurnStateLike { state: TurnLifecycleState; openedAt?: number; updatedAt?: number; turnUpdatedAt?: number | null; } export declare const ACTIVE_TURN_STALE_THRESHOLD_MS: number; export declare const WAITING_INPUT_STALE_THRESHOLD_MS: number; export declare function normalizeTurnMetadata(metadata: unknown): TurnMetadata | null; export declare function isTurnOpen(turnState: TurnStateLike | null | undefined): boolean; export declare function getTurnStateStaleThresholdMs(state: TurnLifecycleState): number; export declare function isTurnStateStale(turnState: TurnStateLike | null | undefined): boolean; export declare function resolveTurnMessageSemantics(input: { senderType: SenderType; metadata?: unknown; }): TurnMessageSemantics; export declare function shouldPromoteConversationMessage(input: { senderType: SenderType; metadata?: unknown; }): boolean; export declare function shouldTriggerAgentTurn(input: { senderType: SenderType; metadata?: unknown; }): TriggerDecision; export declare function normalizeRuntimeTurnState(value: unknown): TurnStateLike | null;