1 pub mod setup_application_filesystem;
2
3 use setup_application_filesystem::setup_application_filesystem;
4 use tauri::App;
5
6 /// Run all setup steps. Called from `tauri::Builder::setup()`.
7 ///
8 /// Both steps must run **before** any `onde` / `hf-hub` / `mistral.rs` code,
9 /// i.e. before the chat `ENGINE` lazily initialises.
10 pub fn setup(app: &App) -> Result<(), Box<dyn std::error::Error>> {
11 // Siti runs fully offline. Disable onde's pulse telemetry so no usage
12 // beacons are ever sent, regardless of whether GresIQ credentials happen
13 // to be embedded in the onde build. `ChatEngine` reads this env var when
14 // it lazily initialises its (optional) pulse client.
15 std::env::set_var("ONDE_DISABLE_PULSE", "1");
16
17 // Redirect HF_HOME, HF_HUB_CACHE, and TMPDIR into the shared App Group
18 // container so downloaded models are shared across Onde apps and remain
19 // writable inside the iOS / macOS sandbox.
20 setup_application_filesystem(app)?;
21
22 Ok(())
23 }