1mod agent;
8mod execute;
9mod shutdown;
10mod trace;
11#[cfg(windows)]
12mod winsvc;
13
14#[cfg(target_os = "macos")]
17fn main() -> anyhow::Result<()> {
18 anyhow::bail!("unsupported on macos")
19}
20
21#[cfg(any(target_os = "linux", target_os = "windows"))]
22fn main() -> anyhow::Result<()> {
23 #[cfg(windows)]
24 if std::env::args().nth(1).as_deref() == Some("--service") {
25 return winsvc::start_service();
26 }
27
28 pal_async::DefaultPool::run_with(async |driver| {
29 let agent = agent::Agent::new(driver).await?;
30 agent.run().await
31 })
32}