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 managed `EdState` is created.
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 initialises its (optional) pulse client, which now happens when Ed
15 // creates the engine.
16 std::env::set_var("ONDE_DISABLE_PULSE", "1");
17
18 // Redirect HF_HOME, HF_HUB_CACHE, and TMPDIR into the shared App Group
19 // container so downloaded models are shared across Onde apps and remain
20 // writable inside the iOS / macOS sandbox.
21 setup_application_filesystem(app)?;
22
23 Ok(())
24 }