#![warn(clippy::disallowed_methods)]
pub mod apple_fm;
pub mod apple_speech;
pub mod apple_speech_session;
pub mod apple_speech_shadow;
pub mod apple_speech_worker;
pub(crate) mod audio_budget;
pub mod audio_decode_worker;
pub mod autoresearch;
pub(crate) mod bounded_child;
#[cfg(target_os = "macos")]
pub(crate) mod macos_graph_xpc;
pub mod orukeet;
#[cfg(unix)]
pub fn install_validated_outer_process_group(process_group: i32) -> std::io::Result<()> {
bounded_child::install_validated_outer_process_group(process_group)
}
pub fn exit_without_cxx_teardown(code: i32) -> ! {
#[cfg(target_os = "macos")]
unsafe {
libc::_exit(code)
}
#[cfg(not(target_os = "macos"))]
std::process::exit(code)
}
#[cfg(test)]
mod exit_teardown_tests {
const CHILD_MARKER: &str = "MINUTES_INTERNAL_TEST_EXIT_HELD_STDOUT_CHILD";
const CHILD_EXIT_CODE: i32 = 23;
#[test]
fn exit_without_cxx_teardown_does_not_block_on_a_held_stdout_lock() {
if std::env::var_os(CHILD_MARKER).is_some() {
std::thread::spawn(|| {
let _held = std::io::stdout().lock();
std::thread::sleep(std::time::Duration::from_secs(120));
});
std::thread::sleep(std::time::Duration::from_millis(300));
super::exit_without_cxx_teardown(CHILD_EXIT_CODE);
}
let exe = std::env::current_exe().expect("test binary path");
let mut child = crate::engine_process::command(exe)
.args([
"--exact",
"exit_teardown_tests::exit_without_cxx_teardown_does_not_block_on_a_held_stdout_lock",
"--test-threads=1",
])
.env(CHILD_MARKER, "1")
.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null())
.spawn()
.expect("re-exec the test binary in its child role");
let deadline = std::time::Instant::now() + std::time::Duration::from_secs(30);
loop {
match child.try_wait().expect("poll the child") {
Some(status) => {
assert_eq!(
status.code(),
Some(CHILD_EXIT_CODE),
"the child should exit cleanly under a held stdout lock"
);
return;
}
None if std::time::Instant::now() >= deadline => {
let _ = child.kill();
let _ = child.wait();
panic!(
"exit_without_cxx_teardown blocked while another thread held the \
stdout lock; an emergency exit path must not wait on that lock"
);
}
None => std::thread::sleep(std::time::Duration::from_millis(50)),
}
}
}
}
#[cfg(any(test, all(feature = "streaming", feature = "whisper")))]
pub(crate) mod bounded_inference;
pub mod calendar;
pub mod capture;
pub mod config;
pub mod context_store;
pub mod copilot;
pub mod daily_notes;
pub mod derived;
pub mod desktop_context;
pub mod desktop_control;
pub mod device_monitor;
pub mod diarize;
pub mod dictation_cleanup;
pub mod dictation_commands;
pub mod dictation_context;
pub mod dictation_memory;
pub(crate) mod engine_process;
pub(crate) mod entity_cluster;
#[cfg(test)]
mod entity_resolution_eval;
pub mod error;
pub mod events;
pub mod ffmpeg;
pub mod graph;
pub mod graph_worker;
pub mod health;
pub mod i18n;
pub mod interaction;
pub mod jobs;
pub mod knowledge;
pub mod knowledge_extract;
pub mod live_partials;
pub mod live_session;
pub mod live_sidekick;
pub mod logging;
pub mod macos_permissions;
pub mod markdown;
pub mod name_correction;
#[cfg(test)]
mod name_eval;
pub mod notes;
pub mod ollama;
pub mod overlays;
pub mod palette;
pub mod parakeet;
pub mod parakeet_sidecar;
pub mod partial_quality;
pub(crate) mod person_identity;
pub mod pid;
pub mod pipeline;
#[cfg(all(
feature = "pocketstation-capture",
any(target_os = "linux", target_os = "windows")
))]
mod pocketstation_capture;
pub mod policy_fs;
pub mod process_trace;
pub mod resummarize;
pub mod retention;
pub(crate) mod resample;
pub mod screen;
#[cfg(any(target_os = "macos", target_os = "windows", all(test, unix)))]
pub(crate) mod sealed_audio;
pub mod search;
pub mod search_index;
pub mod sensitive;
pub mod sherpa_engine;
#[cfg(feature = "engine-sherpa")]
pub mod sherpa_plugin;
pub(crate) mod stem_probe;
pub mod stem_tail;
#[cfg(feature = "streaming-diarize")]
pub mod streaming_diarize;
pub mod summarize;
pub mod system_audio_backend;
pub mod template;
#[doc(hidden)]
pub mod test_support;
pub mod transcribe;
pub mod transcription_coordinator;
pub mod vault;
pub mod vocabulary;
pub mod voice;
#[cfg(feature = "voice-live")]
pub mod voice_live;
pub mod watch;
#[cfg(feature = "streaming")]
pub mod streaming;
#[cfg(feature = "streaming")]
pub mod vad;
#[cfg(feature = "streaming")]
pub mod silero_smoothing;
#[cfg(feature = "vad-ort")]
pub mod silero_vad;
#[cfg(all(feature = "streaming", feature = "whisper"))]
pub mod streaming_whisper;
#[cfg(all(feature = "streaming", feature = "whisper"))]
pub mod dictation;
#[cfg(all(feature = "streaming", feature = "whisper"))]
pub mod live_transcript;
#[cfg(any(test, all(feature = "streaming", feature = "whisper")))]
mod sidecar_timing;
#[cfg(target_os = "macos")]
pub mod hotkey_macos;
pub use config::Config;
pub use error::{MinutesError, Result};
pub use markdown::{ContentType, WriteResult};
pub use pid::CaptureMode;
pub use pipeline::process;
pub use template::{Template, TemplateResolver, TemplateSource, DEFAULT_TEMPLATE_SLUG};
#[cfg(feature = "streaming")]
pub use streaming::{AudioChunk, AudioStream};
#[cfg(feature = "streaming")]
pub use vad::{Vad, VadEngine, VadResult};
pub fn install_whisper_logging_hooks() {
#[cfg(feature = "whisper")]
whisper_rs::install_logging_hooks();
}
#[cfg(test)]
pub(crate) fn test_worker_binary_is_available() -> bool {
use std::sync::OnceLock;
static AVAILABLE: OnceLock<bool> = OnceLock::new();
*AVAILABLE.get_or_init(|| {
crate::audio_decode_worker::bounded_decode_fallback_available(
&crate::config::Config::default(),
)
})
}
#[cfg(test)]
pub(crate) fn test_home_env_lock() -> std::sync::MutexGuard<'static, ()> {
crate::test_support::home_env_lock()
}