diff --git a/.gitignore b/.gitignore
index 2483ea8..35f130d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,5 +9,6 @@ __pycache__/
/apps/desktop/src-tauri/gen/
/apps/desktop/src-tauri/resources/searchi-gemma-worker*
/apps/desktop/src-tauri/resources/embeddinggemma2/
+/apps/desktop/src-tauri/resources/media-runtime/bin/
/apps/desktop/src-tauri/icons/android/
/apps/desktop/src-tauri/icons/ios/
diff --git a/AGENTS.md b/AGENTS.md
index 2f2118c..662a7d3 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -10,6 +10,9 @@ readiness without completed release gates and recorded evidence.
- Production uses available GPU/hardware acceleration with reliable CPU fallback;
the CPU-only rule is a VM testing constraint, not a product restriction.
- Keep the Rust engine independent of the desktop shell; CLI and UI share its API.
+- Prefer established Rust crates and proven retrieval algorithms over custom
+ implementations. Keep platform adapters small, bound allocations and queues,
+ and measure performance before adding caches or changing ranking policies.
- Use bounded work, explicit errors, versioned storage, and offline defaults.
- Never substitute simulated embeddings for working semantic search.
- Production semantic search must use Google EmbeddingGemma 2 as in DigUp.
diff --git a/Cargo.lock b/Cargo.lock
index 21f4b7f..e8219e8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -207,6 +207,18 @@ version = "3.20.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
+[[package]]
+name = "bytemuck"
+version = "1.25.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"
+
+[[package]]
+name = "byteorder-lite"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
+
[[package]]
name = "bytes"
version = "1.12.1"
@@ -705,6 +717,15 @@ version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
+[[package]]
+name = "fdeflate"
+version = "0.3.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c"
+dependencies = [
+ "simd-adler32",
+]
+
[[package]]
name = "find-msvc-tools"
version = "0.1.14"
@@ -718,7 +739,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb"
dependencies = [
"crc32fast",
- "miniz_oxide",
+ "miniz_oxide 0.9.1",
"zlib-rs",
]
@@ -1098,6 +1119,32 @@ dependencies = [
"icu_properties",
]
+[[package]]
+name = "image"
+version = "0.25.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"
+dependencies = [
+ "bytemuck",
+ "byteorder-lite",
+ "image-webp",
+ "moxcms",
+ "num-traits",
+ "png",
+ "zune-core",
+ "zune-jpeg",
+]
+
+[[package]]
+name = "image-webp"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3"
+dependencies = [
+ "byteorder-lite",
+ "quick-error",
+]
+
[[package]]
name = "indexmap"
version = "2.14.2"
@@ -1145,6 +1192,12 @@ version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
+[[package]]
+name = "jpeg-decoder"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00810f1d8b74be64b13dbf3db89ac67740615d6c891f0e7b6179326533011a07"
+
[[package]]
name = "js-sys"
version = "0.3.106"
@@ -1300,6 +1353,16 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
+[[package]]
+name = "miniz_oxide"
+version = "0.8.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
+dependencies = [
+ "adler2",
+ "simd-adler32",
+]
+
[[package]]
name = "miniz_oxide"
version = "0.9.1"
@@ -1343,6 +1406,16 @@ dependencies = [
"syn 2.0.119",
]
+[[package]]
+name = "moxcms"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b"
+dependencies = [
+ "num-traits",
+ "pxfm",
+]
+
[[package]]
name = "multiversion_no_op"
version = "1.0.0"
@@ -1486,6 +1559,19 @@ version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
+[[package]]
+name = "png"
+version = "0.18.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61"
+dependencies = [
+ "bitflags",
+ "crc32fast",
+ "fdeflate",
+ "flate2",
+ "miniz_oxide 0.8.9",
+]
+
[[package]]
name = "portable-atomic"
version = "1.15.0"
@@ -1528,6 +1614,18 @@ dependencies = [
"unicode-ident",
]
+[[package]]
+name = "pxfm"
+version = "0.1.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea"
+
+[[package]]
+name = "quick-error"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
+
[[package]]
name = "quick-xml"
version = "0.42.0"
@@ -1946,11 +2044,26 @@ dependencies = [
"zip",
]
+[[package]]
+name = "searchi-media"
+version = "0.1.0"
+dependencies = [
+ "anyhow",
+ "image",
+ "serde",
+ "serde_json",
+ "sha2 0.10.9",
+ "tempfile",
+]
+
[[package]]
name = "searchi-semantic"
version = "0.1.0"
dependencies = [
"anyhow",
+ "base64 0.22.1",
+ "image",
+ "jpeg-decoder",
"ort",
"serde",
"serde_json",
@@ -1966,6 +2079,7 @@ dependencies = [
"fs2",
"rusqlite",
"searchi-core",
+ "searchi-media",
"searchi-semantic",
"serde",
"serde_json",
@@ -2880,3 +2994,18 @@ dependencies = [
"log",
"simd-adler32",
]
+
+[[package]]
+name = "zune-core"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b"
+
+[[package]]
+name = "zune-jpeg"
+version = "0.5.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296"
+dependencies = [
+ "zune-core",
+]
diff --git a/Cargo.toml b/Cargo.toml
index 664184f..f4d8a11 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,5 @@
[workspace]
-members = ["crates/searchi-core", "crates/searchi-cli", "crates/searchi-semantic", "crates/searchi-service", "crates/searchi-assets"]
+members = ["crates/searchi-core", "crates/searchi-cli", "crates/searchi-semantic", "crates/searchi-service", "crates/searchi-assets", "crates/searchi-media"]
resolver = "2"
[workspace.package]
diff --git a/README.md b/README.md
index 6d78833..132478e 100644
--- a/README.md
+++ b/README.md
@@ -2,89 +2,144 @@
**Find what matters. Locally.**
-Local desktop search for Windows, macOS and Linux. Under active development;
-production readiness is tracked in [the roadmap](docs/ROADMAP.md).
+Local desktop search for Windows, macOS and Linux, under active development.
+Production readiness is tracked in [the roadmap](docs/ROADMAP.md).
-## Architecture
+## What works
-`crates/searchi-core` owns persistent indexing and retrieval. `crates/searchi-cli`
-provides a headless interface. `apps/desktop` hosts the Tauri desktop app.
-Search combines indexed filenames, SQLite FTS5 keyword retrieval, and real
-Google EmbeddingGemma 2 semantic search with a persistent HNSW index. PDF pages
-and DOCX paragraphs retain source locations. Image, audio, and video search remain
-planned; the provisioned media projector is not yet used. Granola is not required.
-The desktop UI is primary; the CLI builds separately without GUI dependencies.
+Search combines instant indexed filenames, SQLite FTS5 content retrieval, and
+**real Google EmbeddingGemma 2** vectors in a persisted HNSW index. PDF pages,
+DOCX paragraphs and text passages retain their source locations. The same
+shared Rust service now indexes **images, video frames, movie soundtracks,
+audio and music**: actual pixels and sound enter Google's media projector in
+the same 768-dimensional space as text queries. No generated captions,
+simulated embeddings, replacement model, or Granola service is required.
+Existing artist/title tags contribute keyword matches.
-Production uses supported hardware acceleration with CPU fallback. All testing
-in the Windows development VM uses CPU only. Indexed content stays
-local. Treat the index as sensitive: it contains extracted document text.
+The desktop is the primary interface. It automatically prepares verified local
+models, indexes selected folders, and prewarms its query worker. Image previews
+and audio/video controls use narrowly scoped local assets; timestamp results
+seek inside the preview without autoplay. Open file launches the default
+application, whose exact opening position is not controlled by Searchi.
+The CLI provides the same retrieval engine without a GUI.
-The desktop automatically downloads and verifies missing Google artifacts
-(approximately 865 MB), reuses its local cache, and warms the query session in
-the background. Development builds must build and stage the native worker first;
-production installers and signing remain release gates. First-query performance
-is measured separately from repeated-query performance.
+**Media search is experimental.** File retrieval works on the independent seed
+corpus, but precise spoken-topic timestamps, music hard negatives, and no-answer
+handling still need improvement. Nearest-neighbor results are not calibrated
+confidence. Video frames are sampled across the movie; every fleeting scene is
+not guaranteed. Audio windows cover the primary stream within explicit resource
+limits. See [actual media quality and failures](docs/MEDIA-QUALITY.md).
+
+Production supports compiled hardware acceleration with CPU fallback. All
+Windows VM tests use CPU only. Files, extracted text, metadata and embeddings
+stay local; treat the index as sensitive. Initial verified model provisioning
+requires approximately 865 MB of downloads. Search performs no remote inference.
## Copy-and-paste setup prompt
-Paste this into your coding agent:
-
```text
Set up Searchi from https://tea.karlcom.de/karl/searchi.git in a new searchi
-directory, or reuse the existing checkout without overwriting local changes.
-Read AGENTS.md, SKILLS.md, docs/ROADMAP.md, and apps/desktop/README.md first.
-Inspect the OS and installed tools. Install missing supported prerequisites:
-Git, stable Rust, Node.js 24+, Python 3, CMake, native C/C++ tools and Tauri's
-platform dependencies. Preserve existing credentials and never print secrets.
-From the repository root, build and stage the pinned Google runtime:
+folder, or reuse the checkout without overwriting local changes. Read AGENTS.md,
+SKILLS.md, docs/ROADMAP.md, docs/BUILDING.md and apps/desktop/README.md first.
+Inspect the OS/tools. Install supported missing prerequisites: Git, stable Rust,
+Node.js 24 LTS, Python 3.11+, CMake, native C/C++ tools and Tauri dependencies.
+Preserve credentials and never print secrets. Prefer established Rust crates
+and portable native tools; keep engine APIs shared by CLI and desktop.
+For Karl's Windows VM set SEARCHI_FORCE_CPU=1 and
+WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS='--disable-gpu --disable-accelerated-video-decode'
+before tests or launch. Never enable a GPU provider in that VM.
+From the repository root:
python tools/embeddinggemma2/build_runtime.py --backend cpu --jobs 2
python tools/embeddinggemma2/stage_runtime.py --backend cpu
-Run cargo test --workspace --locked, cargo fmt --all -- --check, and
+python tools/media-runtime/provision.py --stage
+The decoder manifest supports Windows/Linux x86-64 and ARM64; macOS decoder
+packaging is still a gate. On unsupported hosts report the real blocker and
+use explicitly verified native tools only when their provenance is known.
+Run cargo test --workspace --locked, cargo fmt --all --check and
cargo clippy --workspace --all-targets --locked -- -D warnings.
Run cargo test --manifest-path apps/desktop/src-tauri/Cargo.toml --locked.
-In apps/desktop run npm ci, npm test, npm run format:check, and npm run build.
-For Karl's Windows VM set SEARCHI_FORCE_CPU=1 and
-WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--disable-gpu before tests or launch.
-Launch the real app using npm run tauri dev from apps/desktop. Allow automatic
-verified Google model setup; never substitute another model or mock results.
-Ask which folders I want indexed; do not index my whole home automatically.
-Verify filename and remembered-content searches on my selected files, including
-persistence after restart. Report actual checks and blockers. Do not publish a
-release or claim production readiness, GPU validation, or untested OS coverage.
+In apps/desktop run npm ci, npm test, npm run format:check and npm run build.
+Launch the real app with npm run tauri -- dev. Allow automatic verified Google
+model setup and retained-worker warmup. Never substitute another model or mocks.
+Ask which folders I want indexed; don't index my whole home automatically.
+Verify filename/content/image/music/video searches and persistence on selected
+files. Inspect media failure reports and actual preview seeking. Read
+MEDIA-QUALITY.md before claiming precise speech timestamps or reliable absence.
+Report actual checks and blockers. Do not publish a release or claim production
+readiness, GPU validation, native visual QA, or untested OS coverage.
```
-This is developer setup, not an installer. See the [desktop guide](apps/desktop/README.md)
-and [official Tauri prerequisites](https://v2.tauri.app/start/prerequisites/).
-The worker builder also supports `auto`, `metal`, `vulkan`, and `cuda`; those
-require platform SDKs and separate hardware validation.
+This is developer setup, not an installer. The worker builder also accepts
+`auto`, `metal`, `vulkan` and `cuda`; each requires its platform SDK and separate
+hardware validation. Standalone FFmpeg/FFprobe and notices are staged for the
+desktop; end users should not install tools or configure decoder paths.
-## Development
+## Headless setup
-Install stable Rust and the platform's C/C++ build prerequisites. Run:
+Build with `cargo build --release --locked -p searchi-cli`. No Node, Tauri,
+WebView or display server is needed. Build the native Google worker separately,
+and provision verified assets and FFmpeg tools:
```sh
-cargo test --workspace
-cargo fmt --all -- --check
-cargo clippy --workspace --all-targets -- -D warnings
+python tools/embeddinggemma2/build_runtime.py --backend cpu --jobs 2
+python tools/media-runtime/provision.py
+cargo run -p searchi-cli -- setup --model-dir .searchi/models/embeddinggemma2
+cargo run -p searchi-cli -- index --db searchi.sqlite --root /path/to/files
+```
+
+On native Linux, unified document/media indexing and hybrid search use:
+
+```sh
+./target/release/searchi embed --db searchi.sqlite --model-dir .searchi/models/embeddinggemma2 --embedding-worker .searchi/runtime/cpu/searchi-gemma-worker --ffmpeg .searchi/media-runtime/bin/ffmpeg --ffprobe .searchi/media-runtime/bin/ffprobe --cpu-threads 1
+./target/release/searchi search --db searchi.sqlite 'the recording about orange soil' --model-dir .searchi/models/embeddinggemma2 --embedding-worker .searchi/runtime/cpu/searchi-gemma-worker --cpu-threads 1
+```
+
+These are current interfaces, not executed Linux release evidence. Windows uses
+`Release/searchi-gemma-worker.exe` and `ffmpeg.exe`/`ffprobe.exe` instead.
+`embed` includes media by default and reports failures. Use `--text-only`
+explicitly for document-only vectors. `setup` provisions Google assets, not
+worker/decoder executables. Installed release CLIs discover decoders under
+`media-runtime/bin` beside the CLI; explicit paired paths or
+`SEARCHI_FFMPEG_PATH`/`SEARCHI_FFPROBE_PATH` override discovery. Search never
+silently downloads missing helpers. CLI invocations load their own worker;
+the desktop retains a prewarmed worker for interactive queries.
+
+## Search performance
+
+Normal searches show result counts, measured search time and time until results
+are displayed. Enable **Performance details** in desktop settings to
+inspect UI scheduling, native queue/lock time, keyword retrieval, actual Google
+query inference, ANN/cache/filter work and ranking. Export the current trace as
+local JSON for comparison; tracing sends no telemetry and excludes search text
+and file paths. Nested stages and parallel retrieval lanes overlap.
+
+For headless diagnostics, append `--performance --json` for basic metrics or
+`--debug-performance --json` for the detailed response. Plain `--json` retains
+the existing results-array format. See [timing boundaries, trace schema and
+reproducible measurements](docs/PERFORMANCE.md).
+
+## Development and release
+
+The Rust engine, service, media adapter and CLI live under `crates/`; the Tauri
+shell is `apps/desktop`. SQLite, image/jpeg-decoder, USearch/NumKong, and Tauri
+provide established storage, decoding, ANN/SIMD and desktop facilities.
+Extraction and inference use bounded isolated work with explicit errors.
+
+```sh
+cargo test --workspace --locked
+cargo fmt --all --check
+cargo clippy --workspace --all-targets --locked -- -D warnings
cargo run -p searchi-cli -- --help
```
-Desktop development instructions live in `apps/desktop/README.md`.
-Agent constraints and workflows live in [AGENTS.md](AGENTS.md) and
-[SKILLS.md](SKILLS.md). Use Node.js 24+ for frontend state tests.
-The approved visual identity and desktop direction live in [the brand guide](docs/BRAND.md).
+See [desktop setup](apps/desktop/README.md), [build/platform constraints](docs/BUILDING.md),
+[semantic bounds](docs/SEMANTIC.md), [executed validation](docs/VALIDATION.md),
+and [brand direction](docs/BRAND.md). Native visual QA, operating-system builds,
+macOS decoder packaging, installers, licensing distribution, signatures,
+upgrades and representative production quality remain release gates.
+Cross-platform source support does not mean signed macOS installers can be
+built on Windows. CI declarations are not evidence of executed platform jobs.
-For a headless build, run `cargo build --release --locked -p searchi-cli`.
-No Node, Tauri, or WebView is needed. Semantic commands additionally need the
-native worker and Google assets; `searchi setup` provisions the model cache.
-Platform and CI details live in [the build guide](docs/BUILDING.md).
-Native CI builds must pass on all supported systems before release. Cross-platform
-source support does not imply signed macOS installers can be built on Windows.
-
-## Release policy
-
-Do not publish until the roadmap's release gates have evidence. Record benchmark
-hardware, corpus size, cold/warm state and p95 latency. Signing credentials are
-supplied through CI secrets, never source control.
-
-Licensed under [MIT](LICENSE). Repository author: Karl.
+Record benchmark hardware, corpus, cold/warm state and p95 latency. Never ship
+signing credentials in source control. Licensed under [MIT](LICENSE).
+Repository author: Karl.
diff --git a/SKILLS.md b/SKILLS.md
index e056e64..2ffa3ed 100644
--- a/SKILLS.md
+++ b/SKILLS.md
@@ -42,7 +42,7 @@ Use stable Rust and Node.js 24+. Before Windows VM tests or launch:
```powershell
$env:SEARCHI_FORCE_CPU = '1'
-$env:WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS = '--disable-gpu'
+$env:WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS = '--disable-gpu --disable-accelerated-video-decode'
```
From the repository root:
@@ -74,6 +74,9 @@ cargo test -p searchi-semantic --test gemma_cpu -- --ignored --nocapture
Record actual outputs, hardware, corpus size, background preparation, first-input
latency and warm latency in the relevant validation report. Unexecuted platform
checks stay open. Compilation alone is not UI interaction verification.
+Use the opt-in measured search APIs and docs/PERFORMANCE.md for granular traces.
+Keep basic and debug overhead separate; do not sum nested stages or parallel
+lanes, or label DOM updates as actual paint. Retain raw measurement samples.
## Commit and hand off
diff --git a/apps/desktop/README.md b/apps/desktop/README.md
index 774c6b5..971e08e 100644
--- a/apps/desktop/README.md
+++ b/apps/desktop/README.md
@@ -1,11 +1,24 @@
# Searchi desktop
-This Tauri 2 shell calls the same Rust core as the CLI and the real Google EmbeddingGemma 2 service. It provides folder indexing, native folder selection, progressive filename/content/semantic search, folder/extension/size/date filters, keyboard navigation, escaped text previews, native open/reveal actions, persisted selected folders/resource settings, and a global shortcut. There are no mocked results or embeddings. Watchers and release installers remain roadmap work.
+This Tauri 2 shell calls the same Rust core as the CLI and the real Google EmbeddingGemma 2 service. It provides folder indexing, native folder selection, progressive filename/content/semantic search, folder/extension/size/date/media-duration filters, keyboard navigation, escaped text and scoped image/audio/video previews, native open/reveal actions, persisted selected folders/resource settings, and a global shortcut. There are no mocked results or embeddings. Watchers and release installers remain roadmap work.
## Develop
-Install Node.js LTS, Rust stable, and the platform prerequisites documented at https://v2.tauri.app/start/prerequisites/. Windows requires MSVC build tools and WebView2; Linux requires WebKitGTK and system development packages; macOS requires Xcode command line tools.
+Install Node.js 24 LTS, Rust stable, and the platform prerequisites documented at https://v2.tauri.app/start/prerequisites/. Windows requires MSVC build tools and WebView2; Linux requires WebKitGTK and system development packages; macOS requires Xcode command line tools.
+Before launching from a checkout, build and stage both native helpers from the
+repository root. These explicit setup commands access the network and verify
+pinned artifacts; they do not install tools globally:
+
+```sh
+python tools/embeddinggemma2/build_runtime.py --backend cpu --jobs 2
+python tools/embeddinggemma2/stage_runtime.py --backend cpu
+python tools/media-runtime/provision.py --stage
+```
+
+The decoder manifest currently has Windows/Linux x86-64 and ARM64 artifacts;
+a vetted macOS decoder package remains a release gate. Build `cpu` in the
+Windows VM. Production acceleration requires separate platform/hardware QA.
```sh
cd apps/desktop
npm ci
@@ -25,7 +38,7 @@ The desktop index is stored in the platform app-data directory under `dev.search
On first launch, the native app downloads and verifies the pinned Google model artifacts (310 MB text model plus 555 MB media projector, approximately 865 MB total) into app-managed storage and prepares the packaged embedding worker. No model paths, runtime paths, or terminal setup are required. The UI shows native download bytes, verification/warming states, the actual worker device, and explicit errors with a retry control. The first download requires network access; file extraction, embeddings, and queries stay local.
-After a folder is indexed, semantic indexing starts automatically when the model is ready. Existing keyword results stay searchable during setup/indexing. Progress is indeterminate during embedding because the native command does not expose a chunk completion count. Failed automatic builds retry only after a changed index/status revision or an explicit rebuild, avoiding repeated failure loops. Status polls run once per second while setup/indexing/warming is active and stop when idle.
+After a folder is indexed, unified document/media semantic indexing starts automatically when the model and packaged media helpers are ready. Images use actual pixels; video frames and full primary-stream audio windows use the Google media projector. Audio/music files also retain artist/title metadata for keyword retrieval. The UI reports unavailable decoder/runtime support and per-file failures while keeping text search available. Existing keyword results stay searchable during setup/indexing. Progress is indeterminate during embedding because the native command does not expose a chunk completion count. Failed automatic builds retry only after a changed index/status revision or an explicit rebuild, avoiding repeated failure loops. Status polls run once per second while setup/indexing/warming is active and stop when idle.
Each query captures one immutable filter snapshot. Keyword results appear first; real hybrid results follow after the query settles. `src/search-state.ts` bounds each lane to one active native request and one latest pending request, discards old revisions, and retries a busy request at most once. Escape clears both pending lanes and their timers; already-running native work finishes without changing cleared results. Hybrid updates preserve the selected file and keyboard focus where possible.
@@ -38,7 +51,7 @@ node --test tests/search-state.test.mjs
For Windows VM UI testing, disable WebView2 GPU rendering as well, before starting Tauri in PowerShell:
```powershell
-$env:WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS = '--disable-gpu'
+$env:WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS = '--disable-gpu --disable-accelerated-video-decode'
$env:SEARCHI_FORCE_CPU = '1'
npm.cmd run tauri dev
```
@@ -56,3 +69,38 @@ Visual fidelity remains subject to native screenshot QA. Compilation and state t
## Verification and packaging
`npm run build` checks strict TypeScript and creates production frontend assets. `npm run tauri build -- --no-bundle` compiles the native shell when platform prerequisites are installed. Installer bundling is intentionally disabled until release icons, signing and native platform checks are complete. Native Windows, macOS, and Linux checks must be recorded separately; a frontend build does not prove the native shell works.
+
+## Media preview and quality
+
+The result pane renders images and audio/video controls through Tauri's scoped
+asset protocol. Native preparation verifies the selected path belongs to a
+current indexed file before exposing it. There is no general filesystem access
+or local HTTP server. Players use metadata preload, never autoplay, and seek
+matched millisecond timestamps after metadata loads. Selection changes and
+Escape pause/unload playback; stale preparation responses cannot replace the
+current preview. Unsupported WebView codecs show an Open file fallback.
+
+Opening the default application does not guarantee exact-location navigation.
+Preview seeking uses the returned window/frame start, which may differ from the
+actual utterance. The [independent media quality report](../../docs/MEDIA-QUALITY.md)
+records real file recall, speech alignment failures, music hard negatives and
+unmet no-answer handling. Genuine multimodal support is implemented; production
+quality and native playback/visual interaction QA remain open gates.
+
+## Performance details
+
+Normal results show the actual native search duration and latest result-display
+latency from input. The **Performance details** checkbox in Settings is opt-in
+and captured per request. Its expandable panel separates input debounce,
+intentional semantic delay, pending-lane queue, failed attempts and bounded retry
+wait, invocation time, native stage hierarchy and synchronous result DOM updates.
+First response and hybrid-final latency are distinct; keyword-only results do not
+claim semantic completion. Native spans use a command-relative clock and nested
+or parallel spans must not be summed. Invocation minus native total is explicitly
+an estimated transport/serialization/scheduling residual, not an exact IPC cost.
+DOM update timings do not claim actual screen paint or deferred media loading.
+
+The local clipboard report excludes queries, paths, filenames, snippets and error
+strings. It captures available model/device/thread/runtime context without
+guessing missing values. Histories are bounded and dropped counts remain visible.
+Clipboard failure is explicit; no diagnostic telemetry is uploaded.
diff --git a/apps/desktop/src-tauri/Cargo.lock b/apps/desktop/src-tauri/Cargo.lock
index 02d32a2..80fae53 100644
--- a/apps/desktop/src-tauri/Cargo.lock
+++ b/apps/desktop/src-tauri/Cargo.lock
@@ -412,6 +412,12 @@ version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
+[[package]]
+name = "byteorder-lite"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
+
[[package]]
name = "bytes"
version = "1.12.1"
@@ -1845,6 +1851,12 @@ dependencies = [
"pin-project-lite",
]
+[[package]]
+name = "http-range"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573"
+
[[package]]
name = "httparse"
version = "1.10.1"
@@ -2063,6 +2075,32 @@ dependencies = [
"icu_properties",
]
+[[package]]
+name = "image"
+version = "0.25.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"
+dependencies = [
+ "bytemuck",
+ "byteorder-lite",
+ "image-webp",
+ "moxcms",
+ "num-traits",
+ "png 0.18.1",
+ "zune-core",
+ "zune-jpeg",
+]
+
+[[package]]
+name = "image-webp"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3"
+dependencies = [
+ "byteorder-lite",
+ "quick-error",
+]
+
[[package]]
name = "indexmap"
version = "1.9.3"
@@ -2257,6 +2295,12 @@ dependencies = [
"syn 2.0.119",
]
+[[package]]
+name = "jpeg-decoder"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00810f1d8b74be64b13dbf3db89ac67740615d6c891f0e7b6179326533011a07"
+
[[package]]
name = "js-sys"
version = "0.3.106"
@@ -2522,6 +2566,16 @@ dependencies = [
"windows-sys 0.61.2",
]
+[[package]]
+name = "moxcms"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b"
+dependencies = [
+ "num-traits",
+ "pxfm",
+]
+
[[package]]
name = "muda"
version = "0.20.0"
@@ -3157,6 +3211,18 @@ dependencies = [
"unicode-ident",
]
+[[package]]
+name = "pxfm"
+version = "0.1.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea"
+
+[[package]]
+name = "quick-error"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
+
[[package]]
name = "quick-xml"
version = "0.42.0"
@@ -3652,8 +3718,11 @@ dependencies = [
name = "searchi-desktop"
version = "0.1.0"
dependencies = [
+ "anyhow",
+ "image",
"searchi-assets",
"searchi-core",
+ "searchi-media",
"searchi-service",
"serde",
"serde_json",
@@ -3665,11 +3734,26 @@ dependencies = [
"tempfile",
]
+[[package]]
+name = "searchi-media"
+version = "0.1.0"
+dependencies = [
+ "anyhow",
+ "image",
+ "serde",
+ "serde_json",
+ "sha2 0.10.9",
+ "tempfile",
+]
+
[[package]]
name = "searchi-semantic"
version = "0.1.0"
dependencies = [
"anyhow",
+ "base64 0.22.1",
+ "image",
+ "jpeg-decoder",
"serde",
"serde_json",
"sha2 0.10.9",
@@ -3683,6 +3767,7 @@ dependencies = [
"fs2",
"rusqlite",
"searchi-core",
+ "searchi-media",
"searchi-semantic",
"serde",
"sha2 0.10.9",
@@ -4218,6 +4303,7 @@ dependencies = [
"gtk",
"heck 0.5.0",
"http",
+ "http-range",
"jni",
"libc",
"log",
@@ -5993,6 +6079,21 @@ dependencies = [
"simd-adler32",
]
+[[package]]
+name = "zune-core"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b"
+
+[[package]]
+name = "zune-jpeg"
+version = "0.5.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296"
+dependencies = [
+ "zune-core",
+]
+
[[package]]
name = "zvariant"
version = "5.15.0"
diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml
index e929ed5..8d03ab4 100644
--- a/apps/desktop/src-tauri/Cargo.toml
+++ b/apps/desktop/src-tauri/Cargo.toml
@@ -14,7 +14,8 @@ custom-protocol = ["tauri/custom-protocol"]
tauri-build = { version = "2", features = [] }
[dependencies]
-tauri = { version = "2", features = [] }
+anyhow = "1"
+tauri = { version = "2", features = ["protocol-asset"] }
tauri-plugin-dialog = "2"
tauri-plugin-opener = "2"
tauri-plugin-global-shortcut = "2"
@@ -24,3 +25,5 @@ tempfile = "3"
searchi-core = { path = "../../../crates/searchi-core" }
searchi-service = { path = "../../../crates/searchi-service" }
searchi-assets = { path = "../../../crates/searchi-assets" }
+searchi-media = { path = "../../../crates/searchi-media" }
+image = { version = "0.25", default-features = false, features = ["jpeg", "png", "webp", "bmp"] }
diff --git a/apps/desktop/src-tauri/resources/media-runtime/licenses/LICENSE.txt b/apps/desktop/src-tauri/resources/media-runtime/licenses/LICENSE.txt
new file mode 100644
index 0000000..65c5ca8
--- /dev/null
+++ b/apps/desktop/src-tauri/resources/media-runtime/licenses/LICENSE.txt
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/apps/desktop/src-tauri/resources/media-runtime/licenses/ffmpeg-n9.0.2-27-g7e93014c5b-win64-lgpl-9.0/LICENSE.txt b/apps/desktop/src-tauri/resources/media-runtime/licenses/ffmpeg-n9.0.2-27-g7e93014c5b-win64-lgpl-9.0/LICENSE.txt
new file mode 100644
index 0000000..65c5ca8
--- /dev/null
+++ b/apps/desktop/src-tauri/resources/media-runtime/licenses/ffmpeg-n9.0.2-27-g7e93014c5b-win64-lgpl-9.0/LICENSE.txt
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/apps/desktop/src-tauri/resources/media-runtime/manifest.json b/apps/desktop/src-tauri/resources/media-runtime/manifest.json
new file mode 100644
index 0000000..74366a0
--- /dev/null
+++ b/apps/desktop/src-tauri/resources/media-runtime/manifest.json
@@ -0,0 +1,11 @@
+{
+ "provider": "BtbN/FFmpeg-Builds",
+ "release": "autobuild-2026-10-12-13-12",
+ "version": "9.0.2-27-g7e93014c5b",
+ "platforms": {
+ "windows-x86_64": {"archive": "ffmpeg-n9.0.2-27-g7e93014c5b-win64-lgpl-9.0.zip", "bytes": 171476229, "sha256": "104a019fe34c0747b208bde4842a0bac8b70a307cc2bb33aa4648fc15ddb2e39"},
+ "windows-aarch64": {"archive": "ffmpeg-n9.0.2-27-g7e93014c5b-winarm64-lgpl-9.0.zip", "bytes": 118006941, "sha256": "68d3bac585b80b6f17e459eb4a203ed1f01b7635d4c611f1685de1ae65ca0987"},
+ "linux-x86_64": {"archive": "ffmpeg-n9.0.2-27-g7e93014c5b-linux64-lgpl-9.0.tar.xz", "bytes": 137901812, "sha256": "12445b38a4700ba1ae7c9c7e57062f602c927dc4187555bfadc9f3e2f75f05b0"},
+ "linux-aarch64": {"archive": "ffmpeg-n9.0.2-27-g7e93014c5b-linuxarm64-lgpl-9.0.tar.xz", "bytes": 117008524, "sha256": "c9160ae8440c17c016fb2f6b3fcce4bb9d633a15845e908b2303948a7724f227"}
+ }
+}
diff --git a/apps/desktop/src-tauri/src/main.rs b/apps/desktop/src-tauri/src/main.rs
index 60c674c..019619a 100644
--- a/apps/desktop/src-tauri/src/main.rs
+++ b/apps/desktop/src-tauri/src/main.rs
@@ -4,9 +4,11 @@ mod model_download;
mod semantic_commands;
mod settings;
+use searchi_core::metrics::{MetricsMode, SearchMetrics, SearchResponse, TraceCollector};
use searchi_core::{IndexReport, IndexStats, SearchIndex, SearchOptions, SearchResult};
use semantic_commands::{
- hybrid_search, index_embeddings, semantic_status, setup_model, SemanticState,
+ hybrid_search, hybrid_search_measured, index_embeddings, semantic_status, setup_model,
+ SemanticState,
};
use serde::{Deserialize, Serialize};
use settings::{Settings, SettingsStore};
@@ -31,6 +33,46 @@ struct AppState {
semantic: Arc,
}
+#[derive(Serialize)]
+struct MeasuredFailure {
+ message: String,
+ metrics: SearchMetrics,
+}
+
+impl MeasuredFailure {
+ fn new(message: impl Into, trace: TraceCollector) -> Self {
+ Self {
+ message: message.into(),
+ metrics: trace.finish(0),
+ }
+ }
+
+ fn task(message: impl Into, started: std::time::Instant) -> Self {
+ Self {
+ message: message.into(),
+ metrics: SearchMetrics {
+ total_ms: started.elapsed().as_secs_f64() * 1000.0,
+ result_count: 0,
+ trace: None,
+ dropped_spans: 1,
+ },
+ }
+ }
+}
+
+fn measured_outcome(
+ result: Result, String>,
+ trace: TraceCollector,
+) -> Result, MeasuredFailure> {
+ match result {
+ Ok(results) => Ok(SearchResponse {
+ metrics: trace.finish(results.len()),
+ results,
+ }),
+ Err(message) => Err(MeasuredFailure::new(message, trace)),
+ }
+}
+
#[derive(Serialize)]
struct DesktopStatus {
settings: Settings,
@@ -78,6 +120,8 @@ struct Filters {
extension: Option,
min_size: Option,
max_size: Option,
+ min_duration_ms: Option,
+ max_duration_ms: Option,
modified_after_unix_ms: Option,
modified_before_unix_ms: Option,
}
@@ -89,6 +133,8 @@ impl From for SearchOptions {
extension: value.extension,
min_size: value.min_size,
max_size: value.max_size,
+ min_duration_ms: value.min_duration_ms,
+ max_duration_ms: value.max_duration_ms,
modified_after_unix_ms: value.modified_after_unix_ms,
modified_before_unix_ms: value.modified_before_unix_ms,
}
@@ -114,6 +160,46 @@ async fn search(
.map_err(|e| e.to_string())?
}
+/// Measured command preserves the legacy array-returning API for integrations.
+#[tauri::command]
+async fn search_measured(
+ query: String,
+ filters: Option,
+ debug_performance: bool,
+ state: State<'_, AppState>,
+) -> Result, MeasuredFailure> {
+ let started = std::time::Instant::now();
+ let mut trace = TraceCollector::new(if debug_performance {
+ MetricsMode::Debug
+ } else {
+ MetricsMode::Basic
+ });
+ let queue = trace.begin("desktop.worker_queue", None);
+ let lexical = state.lexical.clone();
+ tauri::async_runtime::spawn_blocking(move || {
+ trace.end(queue, Default::default());
+ let result = (|| {
+ let index = trace.timed("desktop.lexical_lock", None, |_, _| {
+ lexical
+ .try_lock()
+ .map_err(|_| "Keyword worker is busy; try the latest query again.".to_owned())
+ })?;
+ index
+ .search_with_options_traced(
+ &query,
+ 50,
+ &filters.unwrap_or_default().into(),
+ &mut trace,
+ None,
+ )
+ .map_err(|error| error.to_string())
+ })();
+ measured_outcome(result, trace)
+ })
+ .await
+ .map_err(|error| MeasuredFailure::task(error.to_string(), started))?
+}
+
#[tauri::command]
async fn pick_folder(app: tauri::AppHandle) -> Result