import { type H3Event } from "h3"; import { type ActionEntry, type AgentApprovalBinding } from "../agent/production-agent.js"; export declare const REALTIME_VOICE_SESSION_PATH = "/_agent-native/realtime-voice/session"; export declare const REALTIME_VOICE_TOOL_PATH = "/_agent-native/realtime-voice/tool"; export declare const REALTIME_VOICE_MAX_SDP_BYTES: number; export declare const REALTIME_VOICE_MAX_TOOL_BODY_BYTES: number; export declare const REALTIME_VOICE_MAX_TOOL_OUTPUT_CHARS = 16000; export declare const REALTIME_VOICE_MAX_TOOLS = 32; export declare const REALTIME_VOICE_MAX_TOOL_SCHEMA_BYTES = 32000; export declare const REALTIME_VOICE_MAX_SESSION_BYTES = 64000; export declare const REALTIME_VOICE_TOOL_GRANT_TTL_MS: number; export declare const REALTIME_VOICE_CAPABILITY_HEADER = "X-Agent-Native-Realtime-Capability"; export declare const REALTIME_VOICE_PROTOCOL_HEADER = "X-Agent-Native-Realtime-Protocol"; export declare const REALTIME_VOICE_MODEL_HEADER = "X-Agent-Native-Realtime-Model"; export declare const REALTIME_VOICE_INTELLIGENCE_HEADER = "X-Agent-Native-Realtime-Intelligence"; export declare const REALTIME_VOICE_PRIORITY_TOOLS_HEADER = "X-Agent-Native-Realtime-Priority-Tools"; export declare const REALTIME_VOICE_INTELLIGENCE_LEVELS: readonly ["instant", "balanced", "deep"]; export type RealtimeVoiceIntelligence = (typeof REALTIME_VOICE_INTELLIGENCE_LEVELS)[number]; export interface RealtimeVoiceRequestContext { event: H3Event; userEmail: string; orgId?: string; browserTabId?: string; } export interface RealtimeVoiceToolExecutionRequest extends RealtimeVoiceRequestContext { name: string; args: Record; callId: string; /** The mounted actions plus the caller's own; run the call against these. */ actions: Record; /** * The approval record the user approved, from the call that asked. It runs * only this call's exact arguments, and only once. */ approvalId?: string; sessionId?: string; } export interface RealtimeVoiceToolExecutionResult { status: "completed" | "failed" | "approval_required"; output: string; approvalKey?: string; /** The approval record the call asked for, so a decision names exactly it. */ approvalId?: string; } export interface RealtimeVoiceInstructions { /** The spoken model (or the only model on the Realtime protocol). */ voice: string; /** The delegated model that calls the tools. */ tools: string; } export interface MountRealtimeVoiceRoutesOptions { model?: string; voice?: string; /** * How the voice agent talks and sizes its actions. Both the spoken model and * the tool-using model read it, ahead of the app context. */ voiceInstructions?: string; /** * Tools loaded at session start after the framework's navigation and search * tools, so common requests skip a `tool-search` round trip. */ priorityToolNames?: readonly string[]; /** The intelligence a session uses until the user picks one. */ defaultIntelligence?: RealtimeVoiceIntelligence; /** App context for the tool-using model. */ instructions?: string; getInstructions?: (context: RealtimeVoiceRequestContext) => string | null | undefined | Promise; resolveOrgId?: (event: H3Event) => string | null | undefined | Promise; /** * The caller's own actions, such as their connected MCP servers' tools, * resolved for each voice request on top of the mounted ones. A mounted * action keeps its name. */ resolveRequestActions?: (context: RealtimeVoiceRequestContext) => Promise>; executeTool: (request: RealtimeVoiceToolExecutionRequest) => RealtimeVoiceToolExecutionResult | Promise; } export declare function resolveRealtimeVoiceTranscriptionLanguage(acceptLanguage: string | null | undefined): string; export declare function resolveRealtimeVoiceLanguagePreference(value: string | null | undefined, acceptLanguage: string | null | undefined): string; export declare function resolveRealtimeVoiceIntelligence(value: string | null | undefined, fallback?: RealtimeVoiceIntelligence): RealtimeVoiceIntelligence; export declare function resolveRealtimeVoiceReasoningEffort(value: string | null | undefined, protocol?: "live" | "realtime"): "minimal" | "low" | "medium" | "high"; export declare function resolveRealtimeVoicePreference(value: string | null | undefined, fallback: string): string; export declare function composeRealtimeVoiceInstructions(input: { protocol: "live" | "realtime"; voiceInstructions?: string | null | undefined; appInstructions?: string | null | undefined; }): RealtimeVoiceInstructions; export declare function realtimeVoiceSafetyIdentifier(userEmail: string): Promise; /** The thread a voice tool call runs in: its session's, or its own. */ export declare function realtimeVoiceThreadId(request: { sessionId?: string | undefined; callId: string; }): string; /** * Approval hooks for one voice tool call. A voice session is one approval * scope, so the approval a call asks for is consumed by the user's approved * retry of that exact call, and an "always allow" from chat applies here too. */ export declare function realtimeVoiceApprovalHooks(request: Pick): { approvedToolCalls?: string[] | undefined; approvedToolCallAskId?: string | undefined; onApprovalRequired: (binding: AgentApprovalBinding) => Promise; /** The approval record this call asked for, once it asked. */ recordedApprovalId: () => string | undefined; consumeApproval: (binding: AgentApprovalBinding) => Promise; isToolAlwaysAllowed: (binding: AgentApprovalBinding) => Promise; }; export declare function mountRealtimeVoiceRoutes(nitroApp: any, actions: Record, options: MountRealtimeVoiceRoutesOptions): { sessionPath: string; toolPath: string; };