Newer
Older
TelosDB / docs / directory_structure_analysis.md

Directory Structure Analysis

Debug Mode (bun dev)

  • Root: d:\develop\sqlitevector (Repo Root)
  • Assets: d:\develop\sqlitevector\build_assets_tmp\
  • Execution: src-tauri/target/debug/app.exe is run, but CWD is often src-tauri or Repo Root depending on launch config.
  • Sidecar: bin/llama-server.exe (or build_assets_tmp/llama-server.exe if prepared)

Release Mode (MSI / Bundle)

Based on target/release/bundle structure:

  • Installation Root: %ProgramFiles%\sqlitevector\
  • Executable: sqlitevector.exe
  • Resources: resources\ (Tauri flattens resources config here)
    • tauri.conf.json config: "resources": ["../../build_assets_tmp/**/*"]
    • Result:
      • mcp.json -> resources/mcp.json (Directly under resources)
      • config.json -> resources/config.json
      • models/ -> resources/models/
      • vec0.dll, llama.dll -> resources/vec0.dll, resources/llama.dll
  • Sidecar: llama-server-x86_64-pc-windows-msvc.exe (placed next to main exe or in resources depending on externalBin usage)
    • Current tauri.conf.json: "externalBin": ["../../bin/llama-server"]
    • Tauri places external binaries in the same folder as the main executable, with target triple suffix.

The Discrepancy

  • Code expects: resource_dir().join("build_assets_tmp").join("mcp.json")
  • Actual MSI: resource_dir().join("mcp.json")

Tauri's resources option copies the contents of the specified directory if it ends in /**/*, or preserves structure otherwise.

  • Configuration: ["../../build_assets_tmp/**/*"]
  • This tells Tauri: "Take everything inside build_assets_tmp and put it at the root of the app's resources folder."

Solution

We must support both structures:

  1. Debug: RepoRoot/build_assets_tmp/mcp.json
  2. Release: App/resources/mcp.json (Flat)

We should NOT try to force build_assets_tmp folder creation inside resources in Release mode, as flattening is standard Tauri behavior for top-level resource inclusion. Instead, lib.rs should be smart enough to check both.