import { WorkspaceScopedResource } from './base.js';
import type { ListParams } from '../core/utils.js';
export interface ListCallsParams extends ListParams {
    status?: string;
    agent_id?: string;
    start_date?: string;
    end_date?: string;
    phone_number?: string;
    direction?: string;
    min_duration?: number;
    max_duration?: number;
    search?: string;
    include_simulated?: boolean;
    service_id?: string;
}
/**
 * Access call records and intelligence.
 * Calls are read-only in the SDK — they are created by the voice pipeline.
 */
export declare class CallsResource extends WorkspaceScopedResource {
    /** List calls with optional filtering */
    list(params?: ListCallsParams): Promise<{
        continuation_token?: number | null | undefined;
        has_more: boolean;
        items: {
            call_sid?: string | null | undefined;
            caller_id?: string | null | undefined;
            completion_reason?: ("completed" | "abandoned" | "escalated" | "transferred" | "timeout" | "error" | "voicemail" | "no_answer" | "caller_hangup" | "forwarded" | "terminal_state" | "warm_transfer_completed" | "no_inbound_audio" | "cancelled") | null | undefined;
            direction?: ("inbound" | "outbound" | "playground" | "simulated" | "test") | null | undefined;
            duration_seconds?: number | null | undefined;
            entity_id: string;
            escalation_status?: ("none" | "requested" | "connected" | "handback" | "completed") | null | undefined;
            final_state?: string | null | undefined;
            fork_turn_index?: number | null | undefined;
            has_recording?: boolean | null | undefined;
            parent_session_id?: string | null | undefined;
            phone_number?: string | null | undefined;
            quality_score?: number | null | undefined;
            run_id?: string | null | undefined;
            service_id?: string | null | undefined;
            source?: ("real" | "simulated" | "playground" | "scribe") | null | undefined;
            started_at?: string | null | undefined;
            status?: ("initiated" | "ringing" | "in-progress" | "completed" | "busy" | "no-answer" | "canceled" | "failed" | "unknown") | null | undefined;
            turns?: number | null | undefined;
        }[];
        total: number;
    } & import("../index.js").ResponseMetadata>;
    listAutoPaging(params?: ListCallsParams): AsyncGenerator<{
        call_sid?: string | null | undefined;
        caller_id?: string | null | undefined;
        completion_reason?: ("completed" | "abandoned" | "escalated" | "transferred" | "timeout" | "error" | "voicemail" | "no_answer" | "caller_hangup" | "forwarded" | "terminal_state" | "warm_transfer_completed" | "no_inbound_audio" | "cancelled") | null | undefined;
        direction?: ("inbound" | "outbound" | "playground" | "simulated" | "test") | null | undefined;
        duration_seconds?: number | null | undefined;
        entity_id: string;
        escalation_status?: ("none" | "requested" | "connected" | "handback" | "completed") | null | undefined;
        final_state?: string | null | undefined;
        fork_turn_index?: number | null | undefined;
        has_recording?: boolean | null | undefined;
        parent_session_id?: string | null | undefined;
        phone_number?: string | null | undefined;
        quality_score?: number | null | undefined;
        run_id?: string | null | undefined;
        service_id?: string | null | undefined;
        source?: ("real" | "simulated" | "playground" | "scribe") | null | undefined;
        started_at?: string | null | undefined;
        status?: ("initiated" | "ringing" | "in-progress" | "completed" | "busy" | "no-answer" | "canceled" | "failed" | "unknown") | null | undefined;
        turns?: number | null | undefined;
    }, any, any>;
    /** Get full call detail including turns, escalation, safety, and recording info */
    get(callId: string): Promise<{
        audit?: {
            event_count?: number | undefined;
            latest_event?: {
                [x: string]: unknown;
            } | null | undefined;
        } | null | undefined;
        barge_in_events?: {
            discarded_texts?: string[] | null | undefined;
            interrupted_speaker_id?: string | null | undefined;
            interrupted_text?: string | null | undefined;
            interrupting_speaker_id?: string | null | undefined;
            total_barge_ins?: number | null | undefined;
            type: "barge_in";
        }[] | undefined;
        call_analysis?: {
            [x: string]: unknown;
        } | null | undefined;
        call_duration_seconds?: number | undefined;
        call_end_time?: string | null | undefined;
        call_sid?: string | null | undefined;
        call_start_time?: string | null | undefined;
        caller_id?: string | null | undefined;
        completion_reason?: ("completed" | "abandoned" | "escalated" | "transferred" | "timeout" | "error" | "voicemail" | "no_answer" | "caller_hangup" | "forwarded" | "terminal_state" | "warm_transfer_completed" | "no_inbound_audio" | "cancelled") | null | undefined;
        conference_sid?: string | null | undefined;
        config?: {
            agent_id?: string | null | undefined;
            agent_name?: string | null | undefined;
            agent_version?: number | null | undefined;
            context_graph_id?: string | null | undefined;
            context_graph_version?: number | null | undefined;
            gpt_audio_model?: string | null | undefined;
            initial_state?: string | null | undefined;
            navigation_model?: string | null | undefined;
        } | null | undefined;
        conversation_summary?: {
            [x: string]: unknown;
        } | null | undefined;
        direction?: ("inbound" | "outbound" | "playground" | "simulated" | "test") | null | undefined;
        emotional_summary?: {
            average_arousal?: number | null | undefined;
            average_valence?: number | null | undefined;
            barge_in_count?: number | null | undefined;
            dominant_emotion?: string | null | undefined;
            emotional_shifts?: number | null | undefined;
            final_trend?: string | null | undefined;
            peak_negative_emotion?: string | null | undefined;
            peak_negative_valence?: number | null | undefined;
            segment_count?: number | null | undefined;
        } | null | undefined;
        error?: string | null | undefined;
        escalation?: {
            agent_confidence?: number | null | undefined;
            completed_at?: string | null | undefined;
            concept?: string | null | undefined;
            connected_at?: string | null | undefined;
            escalation_id?: string | null | undefined;
            handle_time_seconds?: number | null | undefined;
            human_segment_turn_count?: number | null | undefined;
            immediate?: boolean | undefined;
            operator_entity_id?: string | null | undefined;
            operator_type?: string | null | undefined;
            regulatory_basis?: string | null | undefined;
            requested_at?: string | null | undefined;
            risk_score?: number | null | undefined;
            similarity?: number | null | undefined;
            status: "none" | "requested" | "connected" | "handback" | "completed";
            trigger?: string | null | undefined;
            trigger_source?: string | null | undefined;
            wait_seconds?: number | null | undefined;
        } | null | undefined;
        final_state?: string | null | undefined;
        fork_turn_index?: number | null | undefined;
        forwarding?: {
            forward_to: string;
            forwarded_at?: string | null | undefined;
            should_disconnect: boolean;
            warm_transfer?: boolean | undefined;
        } | null | undefined;
        has_recording?: boolean | undefined;
        human_segments?: {
            speaker_role: string;
            timestamp?: string | null | undefined;
            transcript: string;
        }[] | undefined;
        id: string;
        media_start_time?: string | null | undefined;
        parent_session_id?: string | null | undefined;
        participants?: {
            display_name?: string | null | undefined;
            joined_at: string;
            left_at?: string | null | undefined;
            participant_id: string;
            phone_number?: string | null | undefined;
            role: "caller" | "agent" | "operator";
        }[] | undefined;
        per_turn_accuracy?: (number | null)[] | null | undefined;
        phone_number?: string | null | undefined;
        quality_score?: number | null | undefined;
        recording_path?: string | null | undefined;
        run_id?: string | null | undefined;
        safety?: {
            concept_matches?: {
                agent_action?: string | null | undefined;
                agent_confidence?: number | null | undefined;
                agent_reasoning?: string | null | undefined;
                at?: string | null | undefined;
                concept: string;
                similarity: number;
            }[] | undefined;
            concern_turn_count?: number | undefined;
            peak_concern_level?: number | undefined;
            trajectory?: string | null | undefined;
            triage_history?: {
                [x: string]: unknown;
            }[] | undefined;
        } | null | undefined;
        safety_summary?: {
            [x: string]: unknown;
        } | null | undefined;
        score?: number | null | undefined;
        score_rationale?: string | null | undefined;
        service_id?: string | null | undefined;
        source?: string | null | undefined;
        states_visited?: string[] | undefined;
        status?: string | undefined;
        timeline?: {
            avg_perceived_latency_ms?: number | null | undefined;
            avg_processing_gap_ms?: number | null | undefined;
            duration_seconds: number;
            lanes?: {
                actor?: {
                    kind: "agent" | "human" | "operator" | "system" | "tool";
                    label: string;
                    participant_id?: string | null | undefined;
                    role: "agent" | "caller" | "operator" | "runtime" | "state" | "tool";
                } | null | undefined;
                id: string;
                label: string;
                order: number;
                track: "agent" | "caller" | "operator" | "system" | "tool";
            }[] | undefined;
            max_processing_gap_ms?: number | null | undefined;
            segments: {
                actor?: {
                    kind: "agent" | "human" | "operator" | "system" | "tool";
                    label: string;
                    participant_id?: string | null | undefined;
                    role: "agent" | "caller" | "operator" | "runtime" | "state" | "tool";
                } | null | undefined;
                audio_ttfb_ms?: number | null | undefined;
                audio_window_end?: number | null | undefined;
                audio_window_start?: number | null | undefined;
                call_id?: string | null | undefined;
                duration_ms?: number | null | undefined;
                e2e_ttfb_ms?: number | null | undefined;
                emotion?: string | null | undefined;
                end: number;
                endpoint_name?: string | null | undefined;
                engine_ms?: number | null | undefined;
                eot_confidence?: number | null | undefined;
                from_state?: string | null | undefined;
                integration_name?: string | null | undefined;
                label: string;
                lane: "agent" | "caller" | "events" | "operator" | "system" | "tool";
                lane_id?: string | null | undefined;
                nav_ms?: number | null | undefined;
                order?: number | null | undefined;
                parent_call_id?: string | null | undefined;
                protocol?: string | null | undefined;
                render_ms?: number | null | undefined;
                start: number;
                state?: string | null | undefined;
                stt_confidence?: number | null | undefined;
                succeeded?: boolean | null | undefined;
                to_state?: string | null | undefined;
                tool_name?: string | null | undefined;
                track?: ("agent" | "caller" | "operator" | "system" | "tool") | null | undefined;
                turn_index: number;
                type: "agent_speech" | "barge_in" | "caller_speech" | "filler_hesitation" | "filler_nav" | "greeting" | "interrupted_speech" | "processing_gap" | "silence" | "silence_check" | "state_transition" | "tool_call";
                valence?: number | null | undefined;
            }[];
            timebase?: {
                end?: number | undefined;
                origin?: "media_start" | "call_start" | "synthetic" | undefined;
                start?: number | undefined;
                unit?: "seconds" | undefined;
            } | null | undefined;
            total_agent_speech_seconds?: number | undefined;
            total_silence_seconds?: number | undefined;
            total_user_speech_seconds?: number | undefined;
            turns: {
                active_end: number;
                active_start: number;
                seek_to: number;
                turn_index: number;
            }[];
        } | null | undefined;
        transcript_accuracy?: number | null | undefined;
        triggered_behaviors?: string[] | undefined;
        turns?: {
            agent_action?: string | null | undefined;
            agent_speech_end_ms?: number | null | undefined;
            agent_speech_start_ms?: number | null | undefined;
            agent_transcript?: string | null | undefined;
            audio_ttfb_ms?: number | null | undefined;
            audio_window_end_ms?: number | null | undefined;
            audio_window_start_ms?: number | null | undefined;
            emotion_label?: string | null | undefined;
            emotion_valence?: number | null | undefined;
            engine_ms?: number | null | undefined;
            eot_confidence?: number | null | undefined;
            filler_type?: string | null | undefined;
            id?: string | null | undefined;
            inner_thoughts?: string[] | undefined;
            interrupted?: boolean | undefined;
            nav_ms?: number | null | undefined;
            render_ms?: number | null | undefined;
            speaker_id?: string | null | undefined;
            speaker_role?: string | null | undefined;
            state?: string | undefined;
            state_transitions?: {
                annotation?: string | null | undefined;
                readonly from_state: string;
                next_state?: string | undefined;
                previous_state?: string | undefined;
                readonly to_state: string;
                type?: string | null | undefined;
            }[] | undefined;
            stt_confidence?: number | null | undefined;
            timestamp?: string | null | undefined;
            tool_calls?: {
                call_id?: string | null | undefined;
                duration_ms?: number | null | undefined;
                endpoint_name?: string | null | undefined;
                error_message?: string | null | undefined;
                input?: {
                    [x: string]: unknown;
                } | null | undefined;
                integration_name?: string | null | undefined;
                output?: string | null | undefined;
                protocol?: string | null | undefined;
                succeeded?: boolean | undefined;
                tool_name: string;
            }[] | undefined;
            trigger?: string | undefined;
            user_speech_end_ms?: number | null | undefined;
            user_speech_start_ms?: number | null | undefined;
            user_transcript?: string | null | undefined;
        }[] | undefined;
        twilio_recording_duration?: number | null | undefined;
        twilio_recording_sid?: string | null | undefined;
        verified_transcript?: string | null | undefined;
        verified_words?: {
            [x: string]: unknown;
        }[] | null | undefined;
        workspace_id?: string | undefined;
    } & import("../index.js").ResponseMetadata>;
    /** Get the canonical playback timeline for a call */
    getTimeline(callId: string): Promise<{
        avg_perceived_latency_ms?: number | null | undefined;
        avg_processing_gap_ms?: number | null | undefined;
        duration_seconds: number;
        lanes?: {
            actor?: {
                kind: "agent" | "human" | "operator" | "system" | "tool";
                label: string;
                participant_id?: string | null | undefined;
                role: "agent" | "caller" | "operator" | "runtime" | "state" | "tool";
            } | null | undefined;
            id: string;
            label: string;
            order: number;
            track: "agent" | "caller" | "operator" | "system" | "tool";
        }[] | undefined;
        max_processing_gap_ms?: number | null | undefined;
        segments: {
            actor?: {
                kind: "agent" | "human" | "operator" | "system" | "tool";
                label: string;
                participant_id?: string | null | undefined;
                role: "agent" | "caller" | "operator" | "runtime" | "state" | "tool";
            } | null | undefined;
            audio_ttfb_ms?: number | null | undefined;
            audio_window_end?: number | null | undefined;
            audio_window_start?: number | null | undefined;
            call_id?: string | null | undefined;
            duration_ms?: number | null | undefined;
            e2e_ttfb_ms?: number | null | undefined;
            emotion?: string | null | undefined;
            end: number;
            endpoint_name?: string | null | undefined;
            engine_ms?: number | null | undefined;
            eot_confidence?: number | null | undefined;
            from_state?: string | null | undefined;
            integration_name?: string | null | undefined;
            label: string;
            lane: "agent" | "caller" | "events" | "operator" | "system" | "tool";
            lane_id?: string | null | undefined;
            nav_ms?: number | null | undefined;
            order?: number | null | undefined;
            parent_call_id?: string | null | undefined;
            protocol?: string | null | undefined;
            render_ms?: number | null | undefined;
            start: number;
            state?: string | null | undefined;
            stt_confidence?: number | null | undefined;
            succeeded?: boolean | null | undefined;
            to_state?: string | null | undefined;
            tool_name?: string | null | undefined;
            track?: ("agent" | "caller" | "operator" | "system" | "tool") | null | undefined;
            turn_index: number;
            type: "agent_speech" | "barge_in" | "caller_speech" | "filler_hesitation" | "filler_nav" | "greeting" | "interrupted_speech" | "processing_gap" | "silence" | "silence_check" | "state_transition" | "tool_call";
            valence?: number | null | undefined;
        }[];
        timebase?: {
            end?: number | undefined;
            origin?: "media_start" | "call_start" | "synthetic" | undefined;
            start?: number | undefined;
            unit?: "seconds" | undefined;
        } | null | undefined;
        total_agent_speech_seconds?: number | undefined;
        total_silence_seconds?: number | undefined;
        total_user_speech_seconds?: number | undefined;
        turns: {
            active_end: number;
            active_start: number;
            seek_to: number;
            turn_index: number;
        }[];
    } & import("../index.js").ResponseMetadata>;
    /** Get AI intelligence for a call */
    getIntelligence(callId: string): Promise<{
        call_id: string;
        call_sid?: string | null | undefined;
        completion_reason?: ("completed" | "abandoned" | "escalated" | "transferred" | "timeout" | "error" | "voicemail" | "no_answer" | "caller_hangup" | "forwarded" | "terminal_state" | "warm_transfer_completed" | "no_inbound_audio" | "cancelled") | null | undefined;
        conversation_summary?: {
            avg_turn_duration_seconds?: number | null | undefined;
            barge_in_count?: number | undefined;
            loop_count?: number | undefined;
            topic_changes?: number | undefined;
        } | null | undefined;
        created_at?: string | null | undefined;
        direction?: "inbound" | "outbound" | "playground" | "simulated" | "test" | undefined;
        duration_seconds?: number | undefined;
        emotion_summary?: {
            avg_valence?: number | null | undefined;
            caller_distress_detected?: boolean | undefined;
            dominant_emotion?: string | null | undefined;
            emotion_shifts?: number | undefined;
        } | null | undefined;
        final_state?: string | null | undefined;
        key_moments?: {
            description: string;
            severity?: "info" | "warning" | "error" | undefined;
            turn?: number | null | undefined;
            type: "latency_spike" | "silence" | "barge_in" | "loop" | "tool_failure" | "escalation" | "safety_flag" | "high_risk" | "elevated_risk";
        }[] | undefined;
        latency_summary?: {
            p50_audio_ttfb_ms?: number | null | undefined;
            p95_audio_ttfb_ms?: number | null | undefined;
            silence_ratio?: number | null | undefined;
            total_silence_seconds?: number | null | undefined;
        } | null | undefined;
        operator_summary?: {
            escalated?: boolean | undefined;
            operator_handle_time_seconds?: number | null | undefined;
        } | null | undefined;
        quality_breakdown?: {
            components: {
                name: "latency" | "silence" | "barge_ins" | "loops" | "escalation" | "tool_failures";
                penalty: number;
                severity?: "none" | "minor" | "major" | "critical" | undefined;
                threshold?: string | null | undefined;
                value?: number | null | undefined;
            }[];
            score: number;
            workspace_avg?: number | null | undefined;
            workspace_percentile?: number | null | undefined;
        } | null | undefined;
        quality_score?: number | null | undefined;
        risk_summary?: {
            composite_score?: number | undefined;
            flags?: string[] | undefined;
            level?: "low" | "medium" | "high" | "critical" | undefined;
        } | null | undefined;
        safety_summary?: {
            categories?: string[] | undefined;
            match_count?: number | undefined;
        } | null | undefined;
        tool_summary?: {
            failed?: number | undefined;
            failure_rate?: number | undefined;
            total_calls?: number | undefined;
        } | null | undefined;
    } & import("../index.js").ResponseMetadata>;
    /** Get active intelligence across all in-progress calls */
    getActiveIntelligence(): Promise<{
        [x: string]: unknown;
    }[] & import("../index.js").ResponseMetadata>;
    /** Get performance benchmarks for a time period */
    getBenchmarks(params?: {
        days?: number;
    }): Promise<{
        avg_duration_seconds?: number | null | undefined;
        avg_quality_score?: number | null | undefined;
        escalation_rate?: number | undefined;
        p25_quality_score?: number | null | undefined;
        p50_quality_score?: number | null | undefined;
        p75_quality_score?: number | null | undefined;
        quality_distribution?: {
            [x: string]: number;
        } | undefined;
        total_calls?: number | undefined;
    } & import("../index.js").ResponseMetadata>;
    /** Get phone number call volume breakdown */
    getPhoneVolume(params?: {
        days?: number;
    }): Promise<{
        avg_duration_seconds?: number | null | undefined;
        by_date?: {
            count: number;
            date: string;
        }[] | undefined;
        inbound: number;
        outbound: number;
        phone_number: string;
        total_calls: number;
    }[] & import("../index.js").ResponseMetadata>;
    /** Get deep call trace analysis */
    getTraceAnalysis(callId: string): Promise<{
        call_entity_id?: string | null | undefined;
        call_sid: string;
        coaching?: {
            expected_impact?: string | null | undefined;
            moment_timestamp?: number | null | undefined;
            observation: string;
            recommendation: string;
        }[] | undefined;
        computed_at?: string | null | undefined;
        counterfactuals?: {
            actual: string;
            alternative: string;
            predicted_impact: string;
            timestamp_seconds?: number | null | undefined;
        }[] | undefined;
        deep_understanding?: string | null | undefined;
        emergent_patterns?: string[] | undefined;
        emotional_arc?: string | null | undefined;
        emotional_shifts?: {
            agent_awareness?: string | null | undefined;
            from_state?: string | null | undefined;
            timestamp_seconds?: number | null | undefined;
            to_state?: string | null | undefined;
            trigger?: string | null | undefined;
        }[] | undefined;
        interaction_dynamics?: {
            information_density?: string | null | undefined;
            rapport_trajectory?: string | null | undefined;
            repair_effectiveness?: string | null | undefined;
            turn_taking_quality?: string | null | undefined;
        } | null | undefined;
        key_moment_count?: number | undefined;
        key_moments?: {
            alternative?: string | null | undefined;
            decision_factors?: {
                factor: string;
                source_type: string;
            }[] | undefined;
            quality?: ("optimal" | "adequate" | "suboptimal") | null | undefined;
            reasoning?: string | null | undefined;
            timestamp_seconds?: number | null | undefined;
            what_happened: string;
        }[] | undefined;
        missed_opportunities?: string[] | undefined;
        outcome?: ("succeeded" | "partially" | "failed" | "abandoned") | null | undefined;
        signal_response_alignment?: {
            agent_response: string;
            alignment: "aligned" | "misaligned" | "partial";
            insight?: string | null | undefined;
            signal: string;
        }[] | undefined;
        status?: "ready" | "pending" | "unavailable" | undefined;
        summary?: string | null | undefined;
    } & import("../index.js").ResponseMetadata>;
}
//# sourceMappingURL=calls.d.ts.map