pub mod adapter;
#[cfg(unix)]
mod begin;
mod claude;
mod codex;
mod config;
#[cfg(unix)]
mod ending;
mod events;
mod link;
mod opencode;
pub mod text;
#[cfg(unix)]
pub mod plan;
#[cfg(unix)]
mod probe;
#[cfg(unix)]
pub mod registry;
#[cfg(unix)]
mod render;
#[cfg(unix)]
mod tree;
#[cfg(unix)]
mod turn;
#[cfg(unix)]
pub mod watch;
use std::env;
use std::path::Path;
pub use config::{Settings, load};
pub const CHILD_ENV: &str = "NEOSIAN_HARNESS_CHILD";
pub const MARKER: &str = ".neosian-harness-child";
pub fn is_child() -> bool {
if env::var_os(CHILD_ENV).is_some() {
return true;
}
env::var_os("TMPDIR").is_some_and(|dir| Path::new(&dir).join(MARKER).exists())
}
pub fn served(warn: &mut dyn FnMut(&str)) -> Option<Settings> {
if cfg!(not(unix)) || is_child() {
return None;
}
let home = crate::home::home().ok()?;
match load(&home.join("config.toml")) {
Ok(settings) => settings,
Err(message) => {
warn(&message);
None
}
}
}