Skip to main content

aurum_core/remote/
mod.rs

1//! Shared remote HTTP client and response validation (JOE-1587, JOE-1588, JOE-1934).
2//!
3//! All OpenRouter STT/cleanup traffic should go through this module so
4//! endpoint policy, redirects, credentials, and body caps stay consistent.
5//!
6//! Provider-specific origins, auth, and headers live in [`policy`] named
7//! [`ProviderHttpPolicy`] implementations — not hard-coded in the client.
8
9mod canary_matrix;
10mod client;
11mod interrupt;
12mod limits;
13mod openai_speech;
14mod policy;
15mod status;
16mod stt_chunk;
17mod wire_format;
18
19pub use client::{
20    map_http_status, validate_endpoint, HardenedHttpClient, RemoteEndpoint, RemotePolicy,
21};
22pub use interrupt::{read_body_limited_with_op, send_with_op};
23pub use limits::{
24    read_body_limited, validate_segments, validate_text_bounds, RemoteBodyLimits, TranscriptLimits,
25    DEFAULT_CHAT_BODY_CAP, DEFAULT_CLEANUP_BODY_CAP, DEFAULT_STT_BODY_CAP,
26};
27pub use openai_speech::{parse_pcm_content_type, OpenAiSpeechRequest, SpeechResponseFormat};
28pub use policy::{
29    normalize_request_path, AuthScheme, ElevenLabsHttpPolicy, OpenAiHttpPolicy,
30    OpenRouterHttpPolicy, ProviderHttpPolicy, XaiHttpPolicy, ELEVENLABS_DEFAULT_BASE,
31    ELEVENLABS_ORIGIN, OPENAI_DEFAULT_BASE, OPENAI_ORIGIN, OPENROUTER_APP_CATEGORIES,
32    OPENROUTER_APP_REFERER, OPENROUTER_APP_TITLE, OPENROUTER_DEFAULT_BASE, OPENROUTER_ORIGIN,
33    XAI_DEFAULT_BASE, XAI_ORIGIN,
34};
35pub use status::{public_network_reason, redact_secret, redact_secret_with};
36pub use stt_chunk::{
37    effective_chunk_secs, needs_time_chunk, plan_chunk_windows, soft_split_text_segments,
38    stitch_chunk_results, transcribe_maybe_chunked, DEFAULT_REMOTE_STT_CHUNK_SECS,
39};
40pub use wire_format::{resolve_encoded_format, ExpectedWireFormat};