diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml new file mode 100644 index 0000000..c9431c8 --- /dev/null +++ b/.forgejo/workflows/check.yml @@ -0,0 +1,24 @@ +name: check + +# Fast-fail lint/test on short-lived work branches, before it ever reaches +# main and triggers a dev-track release build. +on: + push: + branches: ['feature/**', 'fix/**'] + +jobs: + check: + runs-on: [self-hosted, hestia] + steps: + - name: checkout + run: | + set -euo pipefail + rm -rf src && mkdir src + git clone --branch "${GITHUB_REF_NAME}" --depth 1 \ + "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src + + - name: clippy + run: cd src && bash ci/build.sh cargo clippy --workspace --all-targets --locked --features full -- -D warnings + + - name: test + run: cd src && bash ci/build.sh cargo test --workspace --locked --features full diff --git a/.forgejo/workflows/dev-release.yml b/.forgejo/workflows/dev-release.yml new file mode 100644 index 0000000..85fcaa6 --- /dev/null +++ b/.forgejo/workflows/dev-release.yml @@ -0,0 +1,82 @@ +name: dev release + +# Publishes a dev-track build on every push to `main` (the trunk +# branch — there is no separate `dev` branch). See bread-ecosystem's +# docs/release-channels.md for the release-track policy this is part of. +on: + push: + branches: ['main'] + +jobs: + build: + runs-on: [self-hosted, hestia] + steps: + - name: checkout + run: | + set -euo pipefail + rm -rf src && mkdir src + git clone --branch main --depth 1 \ + "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src + + - name: build + run: cd src && bash ci/build.sh cargo build --release --locked --workspace --features full + + - name: test + run: cd src && bash ci/build.sh cargo test --release --locked --workspace --features full + + - name: compute dev version + run: | + set -euo pipefail + cd src + # Base the dev version off the latest published stable tag, + # not Cargo.toml — Cargo.toml can go stale relative to the last + # real release (seen in practice: breadbox/breadpad/breadcrumbs/ + # breadpaper), which would make a dev build sort as OLDER than + # what's already installed and bakery would correctly refuse it. + LATEST_TAG="$(git ls-remote --tags --refs \ + "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" 'v*' \ + | awk -F/ '{print $NF}' | sed 's/^v//' | (grep -v -- '-' || true) | sort -V | tail -1)" + if [ -n "${LATEST_TAG}" ]; then + CUR="${LATEST_TAG}" + else + CUR="$(grep -m1 '^version' breadsearch/Cargo.toml | sed -E 's/.*"(.*)".*/\1/')" + fi + IFS='.' read -r MA MI PA <<< "${CUR}" + SHA="$(git rev-parse --short HEAD)" + TS="$(date -u +%Y%m%d%H%M%S)" + echo "VERSION=${MA}.${MI}.$((PA + 1))-dev.${TS}+${SHA}" >> "$GITHUB_ENV" + + - name: prepare artifacts + run: | + set -euo pipefail + PKG_DIR="/srv/breadway-dl/dev/breadsearch/${VERSION}" + mkdir -p "${PKG_DIR}" + for bin in breadsearch breadmill; do + cp "src/target/release/${bin}" "${PKG_DIR}/${bin}-x86_64" + strip "${PKG_DIR}/${bin}-x86_64" + sha256sum "${PKG_DIR}/${bin}-x86_64" | awk '{print $1}' \ + > "${PKG_DIR}/${bin}-x86_64.sha256" + done + cp src/packaging/breadmill.service "${PKG_DIR}/" + cp src/config.example.toml "${PKG_DIR}/" + cp src/bakery.toml "${PKG_DIR}/bakery.toml" + ln -sfn "${VERSION}" "/srv/breadway-dl/dev/breadsearch/latest" + + # No GitHub Release upload — dev, like the other non-stable track, + # is only distributed via dl.breadway.dev/dev/. + - name: regenerate dev index.json + env: + MINISIGN_SEC_KEY: ${{ secrets.BAKERY_MINISIGN_SEC_KEY_PATH }} + run: | + set -euo pipefail + if [ -z "${MINISIGN_SEC_KEY:-}" ]; then + echo "::error::BAKERY_MINISIGN_SEC_KEY_PATH secret not set — refusing to regenerate dev index.json unsigned (would leave a stale signature mismatched against fresh content and break bakery for everyone on the dev track)" + exit 1 + fi + rm -rf /tmp/bread-ecosystem-ci-* 2>/dev/null || true + # mktemp: a fixed clone path races when multiple repos' dev/beta + # workflows run close together on the same self-hosted runner. + ECOSYSTEM_CI_DIR="$(mktemp -d /tmp/bread-ecosystem-ci-XXXXXX)" + git clone --branch main https://git.breadway.dev/Breadway/bread-ecosystem.git "${ECOSYSTEM_CI_DIR}" + TRACK=dev bash "${ECOSYSTEM_CI_DIR}/scripts/gen-index.sh" + rm -rf "${ECOSYSTEM_CI_DIR}" diff --git a/.forgejo/workflows/mirror.yml b/.forgejo/workflows/mirror.yml deleted file mode 100644 index 37462af..0000000 --- a/.forgejo/workflows/mirror.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Mirror to GitHub - -on: - push: - branches: ['**'] - tags: ['**'] - -jobs: - mirror: - runs-on: [self-hosted, hestia] - steps: - - name: Mirror to GitHub - run: | - set -euo pipefail - git clone --mirror "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" repo.git - cd repo.git - git push --prune \ - "https://x-access-token:${{ secrets.MIRROR_TOKEN }}@github.com/Breadway/breadsearch.git" \ - '+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*' diff --git a/.forgejo/workflows/rc-release.yml b/.forgejo/workflows/rc-release.yml new file mode 100644 index 0000000..3bb6832 --- /dev/null +++ b/.forgejo/workflows/rc-release.yml @@ -0,0 +1,63 @@ +name: beta (rc) release + +# Publishes a beta-track build for any `vX.Y.Z-rc.N` prerelease tag +# pushed to `main` — there is no separate `beta` branch; "freezing" is +# just pausing pushes to main while an RC gets tested. See +# bread-ecosystem's docs/release-channels.md for the release-track policy. +on: + push: + tags: ['v*'] + +jobs: + build: + if: ${{ contains(github.ref_name, '-rc.') }} + runs-on: [self-hosted, hestia] + steps: + - name: checkout + run: | + set -euo pipefail + rm -rf src && mkdir src + git clone --branch "${GITHUB_REF_NAME}" --depth 1 \ + "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src + + - name: build + run: cd src && bash ci/build.sh cargo build --release --locked --workspace --features full + + - name: test + run: cd src && bash ci/build.sh cargo test --release --locked --workspace --features full + + - name: prepare artifacts + run: | + set -euo pipefail + VERSION="${GITHUB_REF_NAME#v}" + PKG_DIR="/srv/breadway-dl/beta/breadsearch/${VERSION}" + mkdir -p "${PKG_DIR}" + for bin in breadsearch breadmill; do + cp "src/target/release/${bin}" "${PKG_DIR}/${bin}-x86_64" + strip "${PKG_DIR}/${bin}-x86_64" + sha256sum "${PKG_DIR}/${bin}-x86_64" | awk '{print $1}' \ + > "${PKG_DIR}/${bin}-x86_64.sha256" + done + cp src/packaging/breadmill.service "${PKG_DIR}/" + cp src/config.example.toml "${PKG_DIR}/" + cp src/bakery.toml "${PKG_DIR}/bakery.toml" + ln -sfn "${VERSION}" "/srv/breadway-dl/beta/breadsearch/latest" + + # No GitHub Release upload — beta, like dev, is only distributed via + # dl.breadway.dev/beta/. + - name: regenerate beta index.json + env: + MINISIGN_SEC_KEY: ${{ secrets.BAKERY_MINISIGN_SEC_KEY_PATH }} + run: | + set -euo pipefail + if [ -z "${MINISIGN_SEC_KEY:-}" ]; then + echo "::error::BAKERY_MINISIGN_SEC_KEY_PATH secret not set — refusing to regenerate beta index.json unsigned (would leave a stale signature mismatched against fresh content and break bakery for everyone on the beta track)" + exit 1 + fi + rm -rf /tmp/bread-ecosystem-ci-* 2>/dev/null || true + # mktemp: a fixed clone path races when multiple repos' dev/beta + # workflows run close together on the same self-hosted runner. + ECOSYSTEM_CI_DIR="$(mktemp -d /tmp/bread-ecosystem-ci-XXXXXX)" + git clone https://git.breadway.dev/Breadway/bread-ecosystem.git "${ECOSYSTEM_CI_DIR}" + TRACK=beta bash "${ECOSYSTEM_CI_DIR}/scripts/gen-index.sh" + rm -rf "${ECOSYSTEM_CI_DIR}" diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index e53b875..829ff6f 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -6,6 +6,7 @@ on: jobs: build: + if: ${{ !contains(github.ref_name, '-rc.') }} runs-on: [self-hosted, hestia] steps: - name: checkout @@ -21,10 +22,19 @@ jobs: # `backend` in config.toml. All three are ort load-dynamic (dlopen) # EPs, so this doesn't require the NPU/ROCm/CUDA toolkits to be # present on the build host — see breadmill/Cargo.toml. - run: cd src && cargo build --release --locked --workspace --features full + run: | + set -euo pipefail + if [ ! -f src/ci/build.sh ]; then + echo "::error::ci/build.sh is missing — bakery release builds must go through the shared CI wrapper" + exit 1 + fi + cd src && bash ci/build.sh cargo build --release --locked --workspace --features full || { + echo "::error::cargo build --release --locked failed. If Cargo.lock drifted, update and commit it; do not drop --locked." + exit 1 + } - name: test - run: cd src && cargo test --release --locked --workspace --features full + run: cd src && bash ci/build.sh cargo test --release --locked --workspace --features full - name: prepare artifacts run: | @@ -44,8 +54,14 @@ jobs: ln -sfn "${VERSION}" "/srv/breadway-dl/breadsearch/latest" - name: regenerate index.json + env: + MINISIGN_SEC_KEY: ${{ secrets.BAKERY_MINISIGN_SEC_KEY_PATH }} run: | set -euo pipefail + if [ -z "${MINISIGN_SEC_KEY:-}" ]; then + echo "::error::BAKERY_MINISIGN_SEC_KEY_PATH secret not set — refusing to regenerate index.json unsigned (would leave a stale signature mismatched against fresh content and break bakery for everyone)" + exit 1 + fi rm -rf /tmp/bread-ecosystem-ci git clone https://git.breadway.dev/Breadway/bread-ecosystem.git /tmp/bread-ecosystem-ci bash /tmp/bread-ecosystem-ci/scripts/gen-index.sh diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..3c0ac3f --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,50 @@ +# AGENTS.md — Repo hygiene + +Scope: this file covers *repo hygiene* — branching, remotes, CI — plus a +short map of the binaries. It is not user-facing project documentation. + +This repo follows the branch/release workflow documented in `CONTRIBUTING.md` +— read and follow it for any git, branch, or release work here (the +single-trunk model, `feature/x`/`fix/x` branch naming, how RC tags work, +etc). Don't improvise a different workflow. The short version: there is one +long-lived branch, `main` — no `dev` or `beta` branch exists. `main` +auto-publishes a dev-track build on every push. "Beta" and "stable" are both +just tags, not branches: push a `vX.Y.Z-rc.N` tag to publish a beta-track +build, push a plain `vX.Y.Z` tag to cut the signed stable release. +"Freezing" for stabilization means pausing pushes to `main`, not moving a +branch. This replaced an earlier three-branch (`dev`/`beta`/`main`) model +after `main` was found to have silently rotted out of sync with `dev`/`beta` +across most repos in this ecosystem. + +When starting work on a new feature, create branch `feature/`. +When working on a bug or issue, create branch `fix/`. + +## Remotes +- `origin` — Forgejo (`git.breadway.dev` via Hestia, SSH) — authoritative. +- `github` — GitHub mirror. Push both when publishing. + +## CI +- `dev-release.yml` triggers on `push: branches: ['main']`. +- `rc-release.yml` triggers on `vX.Y.Z-rc.N` tag pushes (beta track). +- `release.yml` triggers on any other `v*` tag push (stable). + None of these run on plain commits or PRs beyond what's listed. + +## Architecture + +Two binaries + a shared lib: + +| Crate | Role | +|---|---| +| `breadsearch-shared` | XDG paths, config, IPC types, Unix-socket client | +| `breadmill` | Daemon: walk → extract → chunk → embed → index; serves queries | +| `breadsearch` | GTK4 layer-shell overlay: ranked document hits from breadmill | + +breadsearch is document/meaning search. breadbox is the app launcher. They +are not the same overlay. + +`--screenshot` (`breadsearch/src/screenshot.rs`) captures the search panel +through `bread-screenshots`; do not rewrite it just to retarget the crate pin. + +## Don't +- Don't embed credentials in remote URLs — SSH or a credential helper only. +- Don't rewrite `screenshot.rs` as part of pin/docs work. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..529208f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,84 @@ +# Contributing + +`breadsearch` — Semantic system-wide search for BOS. + +Part of the bread ecosystem; this repo follows the same branch/release +workflow as every other ecosystem product. + +## Branches + +There is one long-lived branch: **`main`**. All day-to-day work lands here. +Every push to `main` automatically builds and publishes a **dev-track** +build (see Tracks below) — a real install you can test before cutting +anything more formal. + +New work — features and bug fixes alike — goes on a short-lived branch: + +``` +feature/ +fix/ +``` + +Branch off `main`, open a PR/push back into `main` when ready. Short-lived +branches get deleted on merge — they never accumulate the kind of drift a +second long-lived branch does. + +## The release cycle + +There's no separate `beta` or release branch — "stable" and "beta" are both +just **tags** on `main`, not branches that need to be kept in sync: + +1. Work accumulates on `main` via `feature/x` / `fix/x` branches. Each push + auto-publishes a dev build — install it with `bakery track set dev` and + `bakery update --all`, then fix anything broken with another push. +2. When you want to stabilize before a real release, tag a release + candidate: `git tag vX.Y.Z-rc.1 && git push origin vX.Y.Z-rc.1` (push to + both remotes). That tag alone triggers a beta-track build — + "freezing" is just pausing pushes to `main` while you test it, not a + branch operation. Cut `-rc.2`, `-rc.3`, etc. for further fixes. +3. Once an RC has gone without issues, tag the real release: + `git tag vX.Y.Z && git push origin vX.Y.Z` — that's what triggers the + signed stable release build. + +## Tracks, from a user's perspective + +``` +bakery track show # what you're currently on (defaults to stable) +bakery track set dev # or beta, or stable +bakery update --all # pull the latest build on your current track +``` + +| Track | What it is | Published from | +|--------|-----------|-----------------| +| `stable` | The last tagged release | a `vX.Y.Z` tag | +| `beta` | Latest release candidate | a `vX.Y.Z-rc.N` tag | +| `dev` | Bleeding edge | `main`, on every push | + +Dev versions are auto-computed (`X.Y.Z-dev.+`) from the +latest published stable tag, so they always sort as newer than what you +have installed — no manual version bumping needed. Beta versions are just +the RC tag itself (already valid semver, already sorts below the real +release it's a candidate for). + +## Local development + +```sh +cargo build --release --workspace --features full +cargo test --release --workspace --features full +``` + +## CI + +- `dev-release.yml` — triggered on push to `main`. +- `rc-release.yml` — triggered on any `vX.Y.Z-rc.N` tag push. +- `release.yml` — triggered on any other `v*` tag push, cuts the actual + stable release. + +All CI runs on a self-hosted runner; nothing runs automatically on plain +commits or PRs beyond the track builds above. See +[bread-ecosystem's docs/release-channels.md](https://git.breadway.dev/Breadway/bread-ecosystem/src/branch/main/docs/release-channels.md) +for the full policy, including how a new product gets wired onto these tracks. + +## Questions + +Open an issue on this repo's Forgejo tracker. diff --git a/Cargo.lock b/Cargo.lock index 2e7fa2b..77a2b16 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,7 +25,7 @@ checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", - "cpufeatures", + "cpufeatures 0.2.17", ] [[package]] @@ -44,19 +44,69 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" dependencies = [ "memchr", ] +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + [[package]] name = "anstyle" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + [[package]] name = "arbitrary" version = "1.4.2" @@ -84,6 +134,12 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" + [[package]] name = "base64ct" version = "1.8.3" @@ -98,9 +154,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.13.0" +version = "2.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" [[package]] name = "block-buffer" @@ -120,10 +176,46 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bread-onnx" +version = "0.7.2" +source = "git+https://git.breadway.dev/Breadway/bread-ecosystem?tag=v0.7.2#30517f161724132cdeb658c04cf5e490be07ee73" +dependencies = [ + "anyhow", + "bread-utils", + "hex", + "ort", + "sha2", + "tokenizers", + "tracing", + "ureq 2.12.1", +] + +[[package]] +name = "bread-screenshots" +version = "0.7.2" +source = "git+https://git.breadway.dev/Breadway/bread-ecosystem?tag=v0.7.2#30517f161724132cdeb658c04cf5e490be07ee73" +dependencies = [ + "anyhow", + "bread-utils", + "tracing", +] + +[[package]] +name = "bread-shared" +version = "0.7.0" +source = "git+https://git.breadway.dev/Breadway/bread?tag=v0.7.0#22e34e2cf2202305d7960759dfccb54dc79f948b" +dependencies = [ + "dirs", + "serde", + "serde_json", + "toml 0.8.23", +] + [[package]] name = "bread-theme" -version = "0.2.3" -source = "git+https://github.com/Breadway/bread-ecosystem?tag=v0.2.8#5e58558dd36031433d4a8d8e70c71206c3f1f8f4" +version = "0.7.4" +source = "git+https://git.breadway.dev/Breadway/bread-ecosystem?tag=v0.7.4#fcba3760387e2523edb71350f8efea3bc851b21e" dependencies = [ "dirs", "gtk4", @@ -132,9 +224,23 @@ dependencies = [ ] [[package]] -name = "breadmill" -version = "0.2.1" +name = "bread-utils" +version = "0.7.2" +source = "git+https://git.breadway.dev/Breadway/bread-ecosystem?tag=v0.7.2#30517f161724132cdeb658c04cf5e490be07ee73" dependencies = [ + "bread-shared", + "dirs", + "gtk4", + "gtk4-layer-shell", + "serde", + "serde_json", +] + +[[package]] +name = "breadmill" +version = "0.3.3" +dependencies = [ + "bread-onnx", "breadsearch-shared", "hex", "ignore", @@ -155,10 +261,14 @@ dependencies = [ [[package]] name = "breadsearch" -version = "0.2.0" +version = "0.3.3" dependencies = [ + "anyhow", + "bread-screenshots", "bread-theme", + "bread-utils", "breadsearch-shared", + "clap", "gtk4", "gtk4-layer-shell", "serde_json", @@ -166,7 +276,7 @@ dependencies = [ [[package]] name = "breadsearch-shared" -version = "0.2.0" +version = "0.3.3" dependencies = [ "serde", "serde_json", @@ -175,12 +285,12 @@ dependencies = [ [[package]] name = "bstr" -version = "1.12.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" +checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f" dependencies = [ "memchr", - "serde", + "serde_core", ] [[package]] @@ -189,12 +299,6 @@ version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" -[[package]] -name = "bytecount" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" - [[package]] name = "byteorder" version = "1.5.0" @@ -203,9 +307,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "bzip2" @@ -232,7 +336,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cc8d9aa793480744cd9a0524fef1a2e197d9eaa0f739cde19d16aba530dcb95" dependencies = [ - "bitflags 2.13.0", + "bitflags 2.13.1", "cairo-sys-rs", "glib", "libc", @@ -246,7 +350,7 @@ checksum = "f8b4985713047f5faee02b8db6a6ef32bbb50269ff53c1aee716d1d195b76d54" dependencies = [ "glib-sys", "libc", - "system-deps", + "system-deps 7.0.8", ] [[package]] @@ -269,9 +373,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.65" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e228eec9be7c17ccb640b59b36a5cd805ea2a564a4c5e162c2f659fea30d3b96" +checksum = "509591b7bcd67f4ef775afad7662703b4935daaa6ec0e5605cfb1090b32a2b6d" dependencies = [ "find-msvc-tools", "jobserver", @@ -281,9 +385,9 @@ dependencies = [ [[package]] name = "cff-parser" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f5b6e9141c036f3ff4ce7b2f7e432b0f00dee416ddcd4f17741d189ddc2e9d" +checksum = "c5810ca1a2b5870df2aab1c03e11c40c361ba51d6e3e361e56310f1cb3b4e087" [[package]] name = "cfg-expr" @@ -301,6 +405,17 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +[[package]] +name = "chacha20" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "rand_core 0.10.1", +] + [[package]] name = "cipher" version = "0.4.4" @@ -313,24 +428,38 @@ dependencies = [ [[package]] name = "clap" -version = "4.6.1" +version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +checksum = "473c7e07f409a8d772161724aa8db6a765a2532a70f9667eeb7b49d3d02fbdca" dependencies = [ "clap_builder", + "clap_derive", ] [[package]] name = "clap_builder" -version = "4.6.0" +version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +checksum = "7b48fea5a88e9ae728a2dcbedbfc0e730f7d60da42e1cb049a83c9fb8b789889" dependencies = [ + "anstream", "anstyle", "clap_lex", "strsim", ] +[[package]] +name = "clap_derive" +version = "4.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d012d2b9d65aca7f18f4d9878a045bc17899bba951561ba5ec3c2ba1eed9a061" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 3.0.3", +] + [[package]] name = "clap_lex" version = "1.1.0" @@ -348,6 +477,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + [[package]] name = "compact_str" version = "0.9.1" @@ -365,9 +500,9 @@ dependencies = [ [[package]] name = "console" -version = "0.16.3" +version = "0.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87" +checksum = "4fe5f465a4f6fee88fad41b85d990f84c835335e85b5d9e6e63e0d06d28cba7c" dependencies = [ "encode_unicode", "libc", @@ -406,6 +541,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + [[package]] name = "crc" version = "3.4.0" @@ -432,18 +576,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.15" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +checksum = "d85363c37faeca707aef026efa9f3b34d077bce547e48f770770625c6013679e" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -451,18 +595,18 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.18" +version = "0.9.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" [[package]] name = "crypto-common" @@ -476,9 +620,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.194" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747d8437319e3a2f43d93b341c137927ca70c0f5dabeea7a005a73665e247c7e" +checksum = "824894a4a85dca76d4c95c2b9098c036f5a29f627b30c12780774f6654e60974" dependencies = [ "cc", "cxx-build", @@ -491,9 +635,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.194" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0f4697d190a142477b16aef7da8a99bfdc41e7e8b1687583c0d23a79c7afc1e" +checksum = "f1ae0b651ea5b0000b19513aef5a03f194d7e3486f2d9258b658da8677fe9036" dependencies = [ "cc", "codespan-reporting", @@ -501,39 +645,39 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 3.0.3", ] [[package]] name = "cxxbridge-cmd" -version = "1.0.194" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0956799fa8678d4c50eed028f2de1c0552ae183c76e976cf7ca8c4e36a7c328" +checksum = "fb05f91d3fb8435d9bab6ac5ce6ac1868be774325fb7fb2a91be39393b21388e" dependencies = [ "clap", "codespan-reporting", "indexmap", "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] name = "cxxbridge-flags" -version = "1.0.194" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23384a836ab4f0ad98ace7e3955ad2de39de42378ab487dc28d3990392cb283a" +checksum = "bf293202e0e3e98495785745389e8d0755b217e66f19194a5c695c25e03282ef" [[package]] name = "cxxbridge-macro" -version = "1.0.194" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6acc6b5822b9526adfb4fc377b67128fdd60aac757cc4a741a6278603f763cf" +checksum = "ca001d746947c7249ed9d332a10f7a59daedbafeb0ec68c5c18a7db7a93f6ccc" dependencies = [ "indexmap", "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] @@ -563,7 +707,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 2.0.119", ] [[package]] @@ -574,7 +718,7 @@ checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -594,9 +738,9 @@ checksum = "ac6b926516df9c60bfa16e107b21086399f8285a44ca9711344b9e553c5146e2" [[package]] name = "der" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fd89660b2dc699704064e59e9dba0147b903e85319429e131620d022be411b" +checksum = "a69dedd701da44b0536442edf09c81a64b0ab97a7a4a5e3d1971f00027cbc63d" dependencies = [ "pem-rfc7468", "zeroize", @@ -616,7 +760,7 @@ checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -637,7 +781,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -647,7 +791,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn", + "syn 2.0.119", ] [[package]] @@ -684,13 +828,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] @@ -704,9 +848,9 @@ dependencies = [ [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "encode_unicode" @@ -771,9 +915,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" [[package]] name = "field-offset" @@ -797,9 +941,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" +checksum = "d45db016d36b838f563236e9193d0ee6ce38f3f68b6c94e914b4929c96bbb890" [[package]] name = "flate2" @@ -858,24 +1002,24 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" [[package]] name = "futures-executor" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" dependencies = [ "futures-core", "futures-task", @@ -884,32 +1028,32 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" [[package]] name = "futures-macro" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] name = "futures-task" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" [[package]] name = "futures-util" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" dependencies = [ "futures-core", "futures-macro", @@ -940,14 +1084,14 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 7.0.8", ] [[package]] name = "gdk4" -version = "0.11.2" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd42fdbbf48612c6e8f47c65fb92d2e8f39c25aecd6af047e83897c1a22d2a4e" +checksum = "d81e2a6c6ecba2aab60633a98df1868b03fa0bfdce8105edc27c1bccf71f0e39" dependencies = [ "cairo-rs", "gdk-pixbuf", @@ -961,9 +1105,9 @@ dependencies = [ [[package]] name = "gdk4-sys" -version = "0.11.2" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d974ac4f15e67472c3a9728daf612590b4a5762a4b33f0edd298df0b80d043c" +checksum = "3d8f608d8d7d229975c4d0d026f5d3071598c4ddab3c5262b0a31840fec78d13" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -973,7 +1117,7 @@ dependencies = [ "libc", "pango-sys", "pkg-config", - "system-deps", + "system-deps 7.0.8", ] [[package]] @@ -1006,16 +1150,30 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "r-efi", + "r-efi 5.3.0", "wasip2", "wasm-bindgen", ] [[package]] -name = "gio" -version = "0.22.6" +name = "getrandom" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3848bcba3a35cc0a71df8ba8ecfd799d6bfb862342a53a4a915fb62213aa4e6" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 6.0.0", + "rand_core 0.10.1", + "wasm-bindgen", +] + +[[package]] +name = "gio" +version = "0.22.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b3e1f669909c326b9413bde5a742097b8c90a7d78f45326db13668984769ded" dependencies = [ "futures-channel", "futures-core", @@ -1030,14 +1188,14 @@ dependencies = [ [[package]] name = "gio-sys" -version = "0.22.0" +version = "0.22.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64729ba2772c080448f9f966dba8f4456beeb100d8c28a865ef8a0f2ef4987e1" +checksum = "353fdc7da7cd16da916104b1e0e4e7de380ec9c8aaa20d4d742d66310ab4b0d5" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 7.0.8", "windows-sys 0.61.2", ] @@ -1063,11 +1221,11 @@ dependencies = [ [[package]] name = "glib" -version = "0.22.7" +version = "0.22.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c207e04e51605dcf7b2924c41591b3a10e1438eaac5bcf448fb91f325381104a" +checksum = "ddbcf514bd1881fc1b960e4e52b4e82873f4da3bceddbd58d42827b508888100" dependencies = [ - "bitflags 2.13.0", + "bitflags 2.13.1", "futures-channel", "futures-core", "futures-executor", @@ -1091,24 +1249,24 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] name = "glib-sys" -version = "0.22.6" +version = "0.22.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7fbac234ed5bc2a28359b7bde8e1b9cdf1441cc2d7f068e4824672d7db9445" +checksum = "030967459f9f676851872c6304adea7825c6d462ec9b72554c733cf0c5952233" dependencies = [ "libc", - "system-deps", + "system-deps 7.0.8", ] [[package]] name = "globset" -version = "0.4.18" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3" +checksum = "07c34a9410465b45bd9787443bc7370f37735bad04b0f0cd57ff1a3186c98988" dependencies = [ "aho-corasick", "bstr", @@ -1125,37 +1283,35 @@ checksum = "22a861859b887a79cf461359c192c97a57d8fb0229dd291232e57aa11f6fa72c" dependencies = [ "glib-sys", "libc", - "system-deps", + "system-deps 7.0.8", ] [[package]] name = "graphene-rs" -version = "0.22.0" +version = "0.22.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d1b7881f96869f49808b6adfe906a93a57a34204952253444d68c3208d71f1" +checksum = "eb856b9c558971c3f13ab692358926da710b046932a4e087aedcc35b040d7dff" dependencies = [ "glib", "graphene-sys", - "libc", ] [[package]] name = "graphene-sys" -version = "0.22.0" +version = "0.22.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "517f062f3fd6b7fd3e57a3f038a74b3c23ca32f51199ff028aa704609943f79c" +checksum = "5c7ffdfde88f3570d3705e0d8a2433e036d387a1f2930bbf47eafcb5f569fd04" dependencies = [ "glib-sys", "libc", - "pkg-config", - "system-deps", + "system-deps 7.0.8", ] [[package]] name = "gsk4" -version = "0.11.1" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53c912dfcbd28acace5fc99c40bb9f25e1dcb73efb1f2608327f66a99acdcb62" +checksum = "b867be1c5f14dcb8f552c0eff6e9a9b1da5f8b43943e8efc3a63c889d84952ff" dependencies = [ "cairo-rs", "gdk4", @@ -1168,9 +1324,9 @@ dependencies = [ [[package]] name = "gsk4-sys" -version = "0.11.1" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7d54bbc7a9d8b6ffe4f0c95eede15ccfb365c8bf521275abe6bcfb57b18fb8a" +checksum = "5b7c7eb2e681ee896646cfb8872b431f24d09f53ba9283289d9b10caa6707088" dependencies = [ "cairo-sys-rs", "gdk4-sys", @@ -1179,14 +1335,14 @@ dependencies = [ "graphene-sys", "libc", "pango-sys", - "system-deps", + "system-deps 7.0.8", ] [[package]] name = "gtk4" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7181b837f04cbe93f79441475f7a00560a92cba7a72e38cc1a68b6f8b78eaae2" +checksum = "98a0a0466484f64b07b5b8184d43fa46be78eb0b8e04ae4e179af31d770b76d9" dependencies = [ "cairo-rs", "field-offset", @@ -1205,11 +1361,11 @@ dependencies = [ [[package]] name = "gtk4-layer-shell" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4069987ff4793699511a251028cc336b438e46565b463f111250148d574752a" +checksum = "17c28ea0f4676fdaaae7ff2413a24d0d35c8657424f84856c1103c73454c9da4" dependencies = [ - "bitflags 2.13.0", + "bitflags 2.13.1", "gdk4", "glib", "glib-sys", @@ -1220,34 +1376,34 @@ dependencies = [ [[package]] name = "gtk4-layer-shell-sys" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f566a5ec5bcc454e7fcf2ab76930887ced5365afce12c1e5201bb296b95f1b9" +checksum = "bcf19bb884ef0ef55b9e6b2b369c39b4fcc0c41e3a0c1cbc8c267720338b690b" dependencies = [ "gdk4-sys", "glib-sys", "gtk4-sys", "libc", - "system-deps", + "system-deps 8.0.0", ] [[package]] name = "gtk4-macros" -version = "0.11.0" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3581b242ba62fdff122ebb626ea641582ec326031622bd19d60f85029c804a87" +checksum = "5ac7179400a36a04de039c24206bb841c5596992b907b43b23ee8d5bdc40d00e" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] name = "gtk4-sys" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ba8e695e2640455561274e65e45f0a151619e450746007667f4b23ceae4e1b" +checksum = "82b8f954786af0b1984425c4446b77f5ff6594346181316be3f850caab1c6f01" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -1259,7 +1415,7 @@ dependencies = [ "gsk4-sys", "libc", "pango-sys", - "system-deps", + "system-deps 7.0.8", ] [[package]] @@ -1282,9 +1438,9 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5081f264ed7adee96ea4b4778b6bb9da0a7228b084587aa3bd3ff05da7c5a3b" +checksum = "32069d97bb81e38fa67eab65e3393bf804bb85969f2bc06bf13f64aef5aba248" dependencies = [ "hashbrown 0.17.1", ] @@ -1318,9 +1474,9 @@ checksum = "ec9d92d097f4749b64e8cc33d924d9f40a2d4eb91402b458014b781f5733d60f" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -1334,9 +1490,9 @@ checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "icu_collections" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513" dependencies = [ "displaydoc", "potential_utf", @@ -1348,9 +1504,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb" dependencies = [ "displaydoc", "litemap", @@ -1361,9 +1517,9 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +checksum = "12f9cf5f235641ed274641dd81c3f28d870e276763d0797aeeab72317b1c646f" dependencies = [ "icu_collections", "icu_normalizer_data", @@ -1375,16 +1531,17 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" +checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0" [[package]] name = "icu_properties" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +checksum = "7e7ca276ad3145661a65914e6daf131ca5120cd3dcee8f8f3214b8875184a148" dependencies = [ + "displaydoc", "icu_collections", "icu_locale_core", "icu_properties_data", @@ -1395,15 +1552,15 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" +checksum = "e590f038c1464a96894fd6d10127e90a8be4509f56ff7ecef851b15cee0b7caa" [[package]] name = "icu_provider" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +checksum = "92a7ed671a6aad807a8651a2e1782a6598fda9ce5185dd8158549e95a91c6428" dependencies = [ "displaydoc", "icu_locale_core", @@ -1443,9 +1600,9 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.26" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b915661dd01db3f05050265b2477bcc6527b3792388e2749b41623cc592be67d" +checksum = "00b69833ed729dc5aa7d19541d96d6cf8e9137194207a04916d658e43168402f" dependencies = [ "crossbeam-deque", "globset", @@ -1469,9 +1626,9 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.18.4" +version = "0.18.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25470f23803092da7d239834776d653104d551bc4d7eacaf31e6837854b8e9eb" +checksum = "9433806cd6b4ec1aba79c021c7e4c58fb4c3b9977c085062e611ac929998fb0c" dependencies = [ "console", "portable-atomic", @@ -1493,9 +1650,9 @@ dependencies = [ [[package]] name = "inotify-sys" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +checksum = "c033f80b2c113cdf91ab7a33faa9cbc014726dcad99880c8609af2a370edf37d" dependencies = [ "libc", ] @@ -1510,6 +1667,12 @@ dependencies = [ "generic-array", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + [[package]] name = "itertools" version = "0.14.0" @@ -1527,19 +1690,19 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "jobserver" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" dependencies = [ - "getrandom 0.3.4", + "getrandom 0.4.3", "libc", ] [[package]] name = "js-sys" -version = "0.3.102" +version = "0.3.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d04c30968dffe80775bd4d7fb676131cd04a1fb46d2686dbffbaec2d9dfd31" +checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a" dependencies = [ "cfg-if", "futures-util", @@ -1554,9 +1717,9 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] name = "kqueue" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "273c0752728918e0ac4976f2b275b6fefb9ecd400585dec929419f3844cd87b5" +checksum = "8d763e5b24120b4ddf50de6c92308156765aabfbbccebf401da7cff2d70a41ea" dependencies = [ "kqueue-sys", "libc", @@ -1568,7 +1731,7 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07293a4e297ac234359b510362495713f75ea345d5307140414f20c69ffeb087" dependencies = [ - "bitflags 2.13.0", + "bitflags 2.13.1", "libc", ] @@ -1580,9 +1743,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.186" +version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" [[package]] name = "libloading" @@ -1596,18 +1759,18 @@ dependencies = [ [[package]] name = "libredox" -version = "0.1.17" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f02ab6bace2054fb888a3c16f990117b579d14a3088e472d63c6011fa185c9d3" +checksum = "28d0a00925a9f930d679b6789b721e3a7f9ed110f41b86d2497caa780c3a070a" dependencies = [ "libc", ] [[package]] name = "libsqlite3-sys" -version = "0.38.1" +version = "0.38.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6c19a05435c21ac299d71b6a9c13db3e3f47c520517d58990a462a1397a61db" +checksum = "f1d20bef17f513b9b3004532233187769cd072d790971f4e4da0e346eb6401e8" dependencies = [ "cc", "pkg-config", @@ -1631,9 +1794,9 @@ checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litemap" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" [[package]] name = "log" @@ -1643,28 +1806,27 @@ checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "lopdf" -version = "0.38.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7184fdea2bc3cd272a1acec4030c321a8f9875e877b3f92a53f2f6033fdc289" +checksum = "25aab26d99567469098e64a02f42679f8965c6401263eefa31d8f2dcc37a221c" dependencies = [ "aes", - "bitflags 2.13.0", + "bitflags 2.13.1", "cbc", "ecb", "encoding_rs", "flate2", - "getrandom 0.3.4", + "getrandom 0.4.3", "indexmap", "itoa", "log", "md-5", "nom 8.0.0", - "nom_locate", - "rand", + "rand 0.10.2", "rangemap", "sha2", "stringprep", - "thiserror 2.0.18", + "thiserror 2.0.20", "ttf-parser", "weezl", ] @@ -1698,19 +1860,19 @@ dependencies = [ [[package]] name = "macro_rules_attribute" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65049d7923698040cd0b1ddcced9b0eb14dd22c5f86ae59c3740eab64a676520" +checksum = "b3ae8f6d608c795738406608304d30a2dfbdc8e58e44f7ba43236da5208ded3c" dependencies = [ "macro_rules_attribute-proc_macro", - "paste", + "pastey", ] [[package]] name = "macro_rules_attribute-proc_macro" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670fdfda89751bc4a84ac13eaa63e205cf0fd22b4c9a5fbfa085b63c1f1d3a30" +checksum = "fc04a4c58212d57930a24bf47d3fa87485264a3a054e9c10e042eb373573ad3c" [[package]] name = "matchers" @@ -1723,9 +1885,9 @@ dependencies = [ [[package]] name = "matrixmultiply" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" +checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7" dependencies = [ "autocfg", "rawpointer", @@ -1743,9 +1905,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.8.2" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "memoffset" @@ -1803,7 +1965,7 @@ checksum = "e4db6d5580af57bf992f59068d4ea26fd518574ff48d7639b255a36f9de6e7e9" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -1857,24 +2019,13 @@ dependencies = [ "memchr", ] -[[package]] -name = "nom_locate" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b577e2d69827c4740cba2b52efaad1c4cc7c73042860b199710b3575c68438d" -dependencies = [ - "bytecount", - "memchr", - "nom 8.0.0", -] - [[package]] name = "notify" version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.13.0", + "bitflags 2.13.1", "crossbeam-channel", "filetime", "fsevent-sys", @@ -1913,9 +2064,9 @@ checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" [[package]] name = "num-integer" -version = "0.1.46" +version = "0.1.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" dependencies = [ "num-traits", ] @@ -1931,9 +2082,9 @@ dependencies = [ [[package]] name = "numkong" -version = "7.7.0" +version = "7.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58d4bb97df102ebdde66a352a20c0bc65c7c407ee9bef12ebe317edc2458a55" +checksum = "81601dc994296baed2968db046b01589be7898837c31f2b073704c6e65ff8f04" dependencies = [ "cc", ] @@ -1944,13 +2095,19 @@ version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + [[package]] name = "onig" version = "6.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc3cbf698f9438986c11a880c90a6d04b9de27575afd28bbf45b154b6c709e2" dependencies = [ - "bitflags 2.13.0", + "bitflags 2.13.1", "libc", "once_cell", "onig_sys", @@ -1972,7 +2129,7 @@ version = "0.10.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45" dependencies = [ - "bitflags 2.13.0", + "bitflags 2.13.1", "cfg-if", "foreign-types", "libc", @@ -1988,7 +2145,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -2017,38 +2174,37 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ort" -version = "2.0.0-rc.12" +version = "2.0.0-rc.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7de3af33d24a745ffb8fab904b13478438d1cd52868e6f17735ef6e1f8bf133" +checksum = "4336a1e2b38848325241c72889086886004e589b7c74f335e60a8e8db5138a0b" dependencies = [ "libloading", "ndarray", "ort-sys", "smallvec", "tracing", - "ureq 3.3.0", + "ureq 3.4.0", ] [[package]] name = "ort-sys" -version = "2.0.0-rc.12" +version = "2.0.0-rc.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7b497d21a8b6fbb4b5a544f8fadb77e801a09ae0add9e411d31c6f89e3c1e90" +checksum = "cf211e3776eea6aec988552fa118dd746d70e1b1e5e244058d1c98015f3e5872" dependencies = [ "hmac-sha256", "lzma-rust2", - "ureq 3.3.0", + "ureq 3.4.0", ] [[package]] name = "pango" -version = "0.22.6" +version = "0.22.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "251bdc6e6487b811be0e406a21e301e07e45c0aa8fa39e00c0c8e12a91752438" +checksum = "5d800d8d0de2ad5d0fb046f5344dbaba14a003cf3dd27cc21d85893d35ea316c" dependencies = [ "gio", "glib", - "libc", "pango-sys", ] @@ -2061,7 +2217,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 7.0.8", ] [[package]] @@ -2070,6 +2226,12 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pastey" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4" + [[package]] name = "pbkdf2" version = "0.12.2" @@ -2082,9 +2244,9 @@ dependencies = [ [[package]] name = "pdf-extract" -version = "0.10.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28ba1758a3d3f361459645780e09570b573fc3c82637449e9963174c813a98" +checksum = "417e8fdc940f1d5bc62c5f89864c3a2255f74f69aa353c98509213d67df61e73" dependencies = [ "adobe-cmap-parser", "cff-parser", @@ -2120,9 +2282,9 @@ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] name = "pkg-config" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" [[package]] name = "pom" @@ -2132,9 +2294,9 @@ checksum = "60f6ce597ecdcc9a098e7fddacb1065093a3d66446fa16c675e7e71d1b5c28e6" [[package]] name = "portable-atomic" -version = "1.13.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" [[package]] name = "portable-atomic-util" @@ -2153,9 +2315,9 @@ checksum = "78451badbdaebaf17f053fd9152b3ffb33b516104eacb45e7864aaa9c712f306" [[package]] name = "potential_utf" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" dependencies = [ "zerovec", ] @@ -2181,23 +2343,23 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" dependencies = [ - "toml_edit 0.25.12+spec-1.1.0", + "toml_edit 0.25.13+spec-1.1.0", ] [[package]] name = "proc-macro2" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] [[package]] name = "quick-xml" -version = "0.40.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2474bd2e5029e7ccb6abb2ba48cf2383a333851dedf495901544281590c7da7f" +checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1" dependencies = [ "memchr", "serde", @@ -2205,9 +2367,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.46" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ "proc-macro2", ] @@ -2219,13 +2381,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] -name = "rand" -version = "0.9.4" +name = "r-efi" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" dependencies = [ "rand_chacha", - "rand_core", + "rand_core 0.9.5", +] + +[[package]] +name = "rand" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" +dependencies = [ + "chacha20", + "getrandom 0.4.3", + "rand_core 0.10.1", ] [[package]] @@ -2235,7 +2414,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.9.5", ] [[package]] @@ -2248,10 +2427,16 @@ dependencies = [ ] [[package]] -name = "rangemap" -version = "1.7.1" +name = "rand_core" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "973443cf09a9c8656b574a866ab68dfa19f0867d0340648c7d2f6a71b8a8ea68" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "rangemap" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a611d15b50743feb4c76b7d03edcb0e64f399c26961e4efe6975bc398be6aa3d" [[package]] name = "rawpointer" @@ -2303,9 +2488,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.4" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" dependencies = [ "aho-corasick", "memchr", @@ -2315,9 +2500,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.14" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" dependencies = [ "aho-corasick", "memchr", @@ -2351,16 +2536,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c51c9ae4df8a7fba42103df5c621fa3c37eccf3a3c650879e90fc48b11cc192c" dependencies = [ "hashbrown 0.16.1", - "thiserror 2.0.18", + "thiserror 2.0.20", ] [[package]] name = "rusqlite" -version = "0.40.1" +version = "0.40.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11438310b19e3109b6446c33d1ed5e889428cf2e278407bc7896bc4aaea43323" +checksum = "23f2a97da3e3873c73cb2a2e71b35c40ff95e0b1eefa8d72d8499a6928c3b5b3" dependencies = [ - "bitflags 2.13.0", + "bitflags 2.13.1", "fallible-iterator", "fallible-streaming-iterator", "hashlink", @@ -2384,7 +2569,7 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.13.0", + "bitflags 2.13.1", "errno", "libc", "linux-raw-sys", @@ -2393,9 +2578,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.41" +version = "0.23.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f" +checksum = "0283386ce02abc0151e1761d08802dfe86c173b0b494af5cbc086574e453da06" dependencies = [ "log", "once_cell", @@ -2408,18 +2593,18 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.14.1" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" +checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96" dependencies = [ "zeroize", ] [[package]] name = "rustls-webpki" -version = "0.103.13" +version = "0.103.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +checksum = "0527518605e68109d875e248ea259b6758801cf165e4b2c2733ae3b51f12535a" dependencies = [ "ring", "rustls-pki-types", @@ -2428,9 +2613,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" [[package]] name = "ryu" @@ -2468,7 +2653,7 @@ version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags 2.13.0", + "bitflags 2.13.1", "core-foundation", "core-foundation-sys", "libc", @@ -2493,9 +2678,9 @@ checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "serde" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" dependencies = [ "serde_core", "serde_derive", @@ -2503,29 +2688,29 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] name = "serde_json" -version = "1.0.150" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" dependencies = [ "itoa", "memchr", @@ -2554,12 +2739,12 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest", ] @@ -2570,7 +2755,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest", ] @@ -2591,9 +2776,9 @@ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] name = "simd-adler32" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" [[package]] name = "slab" @@ -2679,9 +2864,20 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.118" +version = "2.0.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -2696,7 +2892,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -2708,7 +2904,20 @@ dependencies = [ "cfg-expr", "heck", "pkg-config", - "toml 1.1.2+spec-1.1.0", + "toml 1.1.4+spec-1.1.0", + "version-compare", +] + +[[package]] +name = "system-deps" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83779a5c956bcb6ba627a4ecf0a9d7625db47d7537e0892d97f712ac995648a3" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml 1.1.4+spec-1.1.0", "version-compare", ] @@ -2725,7 +2934,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.3.4", + "getrandom 0.4.3", "once_cell", "rustix", "windows-sys 0.61.2", @@ -2751,11 +2960,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.18" +version = "2.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" dependencies = [ - "thiserror-impl 2.0.18", + "thiserror-impl 2.0.20", ] [[package]] @@ -2766,34 +2975,34 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] name = "thiserror-impl" -version = "2.0.18" +version = "2.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] name = "thread_local" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" dependencies = [ "cfg-if", ] [[package]] name = "time" -version = "0.3.51" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c17d80feb7334b40c484e45ed1a5273dfd8bfda537c3be2e74a06a6686f327" +checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134" dependencies = [ "deranged", "num-conv", @@ -2810,9 +3019,9 @@ checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" [[package]] name = "tinystr" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643" dependencies = [ "displaydoc", "zerovec", @@ -2820,9 +3029,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" dependencies = [ "tinyvec_macros", ] @@ -2853,7 +3062,7 @@ dependencies = [ "monostate", "onig", "paste", - "rand", + "rand 0.9.5", "rayon", "rayon-cond", "regex", @@ -2861,7 +3070,7 @@ dependencies = [ "serde", "serde_json", "spm_precompiled", - "thiserror 2.0.18", + "thiserror 2.0.20", "unicode-normalization-alignments", "unicode-segmentation", "unicode_categories", @@ -2881,9 +3090,9 @@ dependencies = [ [[package]] name = "toml" -version = "1.1.2+spec-1.1.0" +version = "1.1.4+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" +checksum = "3aace63f4bbcdfc2c965b059de67119c89c4017a70d633be6c104910f67056f5" dependencies = [ "indexmap", "serde_core", @@ -2891,7 +3100,7 @@ dependencies = [ "toml_datetime 1.1.1+spec-1.1.0", "toml_parser", "toml_writer", - "winnow 1.0.3", + "winnow 1.0.4", ] [[package]] @@ -2928,23 +3137,23 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.25.12+spec-1.1.0" +version = "0.25.13+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2153edc6955a6c354fad8f5efd38b6a8769bdccf9fe50f8e1329f81b0baa5d7" +checksum = "6975367e4d2ef766d86af01ffad14b622fecc8d4357a998fbc4deb6e9bacaf9b" dependencies = [ "indexmap", "toml_datetime 1.1.1+spec-1.1.0", "toml_parser", - "winnow 1.0.3", + "winnow 1.0.4", ] [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ - "winnow 1.0.3", + "winnow 1.0.4", ] [[package]] @@ -2955,9 +3164,9 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "toml_writer" -version = "1.1.1+spec-1.1.0" +version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" +checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2" [[package]] name = "tracing" @@ -2966,9 +3175,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "tracing-core" version = "0.1.36" @@ -3107,17 +3328,19 @@ dependencies = [ "once_cell", "rustls", "rustls-pki-types", + "serde", + "serde_json", "url", "webpki-roots 0.26.11", ] [[package]] name = "ureq" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea7109cdcd5864d4eeb1b58a1648dc9bf520360d7af16ec26d0a9354bafcfc0" +checksum = "972d7902c8735f2695410b8aed7df6ed12a47394aa1c8d7af49f0497b731a94d" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "der", "log", "native-tls", @@ -3131,11 +3354,11 @@ dependencies = [ [[package]] name = "ureq-proto" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e994ba84b0bd1b1b0cf92878b7ef898a5c1760108fe7b6010327e274917a808c" +checksum = "da5f78b09e6941e1a0f2e30e695e4b120377b54d5e0aec11b594bb57b3971613" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "http", "httparse", "log", @@ -3155,9 +3378,9 @@ dependencies = [ [[package]] name = "usearch" -version = "2.25.3" +version = "2.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c08f764417012cf6aea6d1380ef9ea8712c5795a938b726fc67b9bf7ea8824b" +checksum = "1cd7f672d20412962c457b11c858c6c5aecb949808a5345a95e1d671112bcf72" dependencies = [ "cxx", "cxx-build", @@ -3176,6 +3399,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "valuable" version = "0.1.1" @@ -3227,9 +3456,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.125" +version = "0.2.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ddb3f79143bced6de84270411622a2699cee572fc0875aeaf1e7867cf9fca1a" +checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70" dependencies = [ "cfg-if", "once_cell", @@ -3240,9 +3469,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.125" +version = "0.2.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e21a184b13fb19e157296e2c46056aec9092264fab83e4ba59e68c61b323c3d" +checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3250,22 +3479,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.125" +version = "0.2.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fecefd9c35bd935a20fc3fc344b5f29138961e4f47fb03297d88f2587afb5ebd" +checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn", + "syn 2.0.119", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.125" +version = "0.2.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23939e44bb9a5d7576fa2b563dc2e136628f1224e88a8deed09e04858b77871f" +checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf" dependencies = [ "unicode-ident", ] @@ -3282,9 +3511,9 @@ dependencies = [ [[package]] name = "webpki-root-certs" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d46a5a140e6f7afeccd8eae97eff335163939eac8b929834875168b29b3d267" +checksum = "b96554aa2acc8ccdb7e1c9a58a7a68dd5d13bccc69cd124cb09406db612a1c9b" dependencies = [ "rustls-pki-types", ] @@ -3295,14 +3524,14 @@ version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ - "webpki-roots 1.0.8", + "webpki-roots 1.0.9", ] [[package]] name = "webpki-roots" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf85cb06032201fa7c6f829d7db5a7e5aa45bcc0655327713065f6f0576731bf" +checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" dependencies = [ "rustls-pki-types", ] @@ -3509,9 +3738,9 @@ dependencies = [ [[package]] name = "winnow" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" dependencies = [ "memchr", ] @@ -3524,15 +3753,15 @@ checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] name = "writeable" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" [[package]] name = "xml-rs" -version = "0.8.28" +version = "0.8.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f" +checksum = "e450f9b2ed1dff33c94c12589a87338689467b9c4f5d8a5710bd09a847d2c8a7" [[package]] name = "xz2" @@ -3562,28 +3791,28 @@ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", "synstructure", ] [[package]] name = "zerocopy" -version = "0.8.52" +version = "0.8.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce1022995ff5ff5d841ad7d994facc23098cd40152f2c1d11cd607c6f530653f" +checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.52" +version = "0.8.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930" +checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -3603,7 +3832,7 @@ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", "synstructure", ] @@ -3624,14 +3853,14 @@ checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] name = "zerotrie" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" dependencies = [ "displaydoc", "yoke", @@ -3640,9 +3869,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.6" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +checksum = "94b5c6b5976d66c1d703c4fd17d3f5e43c8cedaacf604961b171adc7130896d8" dependencies = [ "yoke", "zerofrom", @@ -3651,13 +3880,13 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +checksum = "47402523226a02bfe5230160dc3ccc089aa6f6f19e7fcbb4e6f824bbb1b4aa62" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] @@ -3682,7 +3911,7 @@ dependencies = [ "memchr", "pbkdf2", "sha1", - "thiserror 2.0.18", + "thiserror 2.0.20", "time", "xz2", "zeroize", @@ -3692,9 +3921,9 @@ dependencies = [ [[package]] name = "zmij" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" [[package]] name = "zopfli" diff --git a/DESIGN.md b/DESIGN.md index 5ffa28e..85d7e6b 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -80,7 +80,9 @@ Start from `breadbox/breadbox/src/main.rs`. **Reuse verbatim:** the gtk4-layer-s - nomic prefixes + mean-pool + normalize must match between index and query or recall collapses. - `ort` linking: prefer the crate's downloaded/bundled ONNX Runtime to avoid version skew with Arch's `onnxruntime`. - Office formats (docx/odt) are best-effort in v1; md/txt/org/pdf are the reliable path. -- GPU EPs (ROCm/CUDA) fail to register silently at the ONNX Runtime level and fall back to CPU — always check - startup logs for `Successfully registered` before trusting a GPU build is actually accelerating. See +- GPU EPs (ROCm/CUDA/OpenVINO) fail to register silently at the ONNX Runtime level and fall back to CPU — always + check startup logs for `Successfully registered` before trusting a GPU build is actually accelerating. See [README: GPU backend notes](README.md#gpu-backend-notes) for the MIGraphX-vs-ROCMExecutionProvider distinction and the per-shape JIT-compile-and-cache behavior that matters for interactive query latency. +- CUDA and OpenVINO are compile-checked only — no NVIDIA or Intel GPU hardware in this dev environment (AMD-only) + to runtime-verify against, unlike ROCm which was confirmed end-to-end on real hardware. diff --git a/EVENTS.md b/EVENTS.md new file mode 100644 index 0000000..61f5030 --- /dev/null +++ b/EVENTS.md @@ -0,0 +1,62 @@ +# breadsearch — bread event integration + +breadsearch is a standalone document-search overlay: it works exactly the +same with or without `breadd` running. When breadd *is* present, the +`breadsearch` GTK overlay publishes events into the shared bread automation +fabric. See the parent `bread` repo's `Documentation.md` — specifically its +"Namespaces" and "Integrating a bread\* app" sections — for the general +convention this follows. + +App id: **`search`**. Transport: `bread-utils`'s `bread_client` module +(feature `bread-client`) — the overlay links it directly. Each `emit` is +its own short-lived connection (`BreadClient::emit` is fire-and-forget, +the same stance as `bread-emit`). Command verbs are only received while +`breadsearch listen` is running — that process holds the +`bread.command.search.**` subscription open. breadmill, the indexing +daemon, does not talk to breadd. + +## Events published (`bread.search.*`) + +| Event | Data | When | +|-------|------|------| +| `bread.search.opened` | `{}` | The overlay window maps (the search panel is shown). | +| `bread.search.opened_result` | `{ "path": "" }` | The user opens a hit — Enter / click opens the file, Ctrl+Enter reveals its folder. `path` is the hit's document path, not the parent folder. | +| `bread.search.open.done` | `{}` | `bread.command.search.open` was received and `breadsearch` was spawned. This is the command confirmation, not proof the overlay mapped — the spawned process is the same PID-file toggle as a keybind. | +| `bread.search.open.failed` | `{ "error": "" }` | `bread.command.search.open` was received but this binary could not be started. | + +## Commands honored (`bread.command.search.*`) + +These are only received while `breadsearch listen` is running. Publishing a +command with no subscriber is a silent no-op — that is the documented +bread convention, not a breadsearch bug. + +| Verb | Data | Effect | +|------|------|--------| +| `open` | none | Same as running `breadsearch` (PID-file toggle: show the overlay, or dismiss it if it is already up). Emits `bread.search.open.done` / `.failed`. | + +```lua +bread.spawn(function() + bread.emit("bread.command.search.open") + bread.wait("bread.search.open.done", { timeout = 5000 }) +end) +``` + +### Not implemented: extra verbs + +There is no `query` / `close` / `reindex` command verb. breadmill already +has its own query socket; inventing a bus query plane would be a new +product surface. If/when that exists, add the corresponding +`bread.command.search.*` verb at the same time, not stubbed as a no-op +ahead of it. + +## Fail-safe behavior + +- If breadd isn't installed or isn't running, `emit` is a silent no-op + (`BreadClient::emit` never blocks or errors the caller) and the + command subscription simply never receives anything — breadsearch's + overlay and breadmill's indexing/query path are entirely unaffected. +- If breadd restarts, the command subscription reconnects automatically + (`BreadClient::subscribe`'s background thread has its own backoff + loop); no restart of `breadsearch listen` is needed. +- If `breadsearch listen` is not running, commands are a graceful no-op at + the bus (no subscriber). The overlay CLI still works. diff --git a/README.md b/README.md index 446787d..71663ce 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Semantic document search for Bread OS. Type a concept — not a keyword — and get ranked hits from your documents. +This is **not** [breadbox](https://git.breadway.dev/Breadway/breadbox). breadsearch is document/meaning search over your files; breadbox is the app launcher (fuzzy `.desktop` launch). They are separate overlays with separate binaries, sockets, and keybinds — even though the search panel was originally forked from breadbox's launcher UI. + Two binaries in one Cargo workspace: - **breadmill** — background daemon. Walks configured directories, extracts text, chunks and embeds documents with [nomic-embed-text-v1.5](https://huggingface.co/nomic-ai/nomic-embed-text-v1.5) (768-dim ONNX), stores vectors in an HNSW index (usearch) backed by SQLite metadata, and serves queries over a Unix socket. Watches for filesystem changes and re-indexes incrementally. @@ -21,10 +23,11 @@ Optional features: | Feature | What it adds | |---------|-------------| -| `npu` | AMD XDNA NPU via VitisAI ONNX Runtime EP (requires Ryzen AI SDK) | -| `rocm` | AMD iGPU via the MIGraphX ONNX Runtime EP (ROCm-backed) | -| `cuda` | NVIDIA GPU via the CUDA ONNX Runtime EP | -| `full` | All three of the above in one binary | +| `npu` | AMD XDNA NPU via VitisAI ONNX Runtime EP (requires Ryzen AI SDK) | +| `rocm` | AMD iGPU via the MIGraphX ONNX Runtime EP (ROCm-backed) | +| `cuda` | NVIDIA GPU via the CUDA ONNX Runtime EP | +| `openvino` | Intel iGPU/dGPU (Arc) via the OpenVINO ONNX Runtime EP | +| `full` | All four of the above in one binary | ``` # NPU build @@ -36,25 +39,29 @@ cargo build --release -p breadmill --features rocm # CUDA (NVIDIA GPU) build cargo build --release -p breadmill --features cuda +# OpenVINO (Intel iGPU/dGPU) build +cargo build --release -p breadmill --features openvino + # All backends in one binary (what the release build ships) cargo build --release -p breadmill --features full ``` -`rocm`/`cuda`/`npu` all use `ort`'s `load-dynamic` mode: at runtime, breadmill -dlopens whatever `libonnxruntime.so` the dynamic linker resolves (or +`rocm`/`cuda`/`npu`/`openvino` all use `ort`'s `load-dynamic` mode: at runtime, +breadmill dlopens whatever `libonnxruntime.so` the dynamic linker resolves (or `ORT_DYLIB_PATH` if set). GPU acceleration only works if that ONNX Runtime build actually has the matching execution provider compiled in — breadmill logs a clear `Successfully registered` / `not enabled in this build` line for this at startup (see [GPU backend notes](#gpu-backend-notes) below). -Because all three are dlopen-based, `full` doesn't require the NPU/ROCm/CUDA -toolkits to be installed at build time — only at run time, and only for -whichever single backend you actually select via `--npu`/`--rocm`/`--cuda` -or `backend` in config.toml. The **released binaries are built with -`full`**: same binary works CPU-only out of the box, and picks up NPU/ROCm/CUDA -acceleration on a machine that has the matching ONNX Runtime available, -without needing a different download. An explicit `--npu`/`--rocm`/`--cuda` -flag always overrides `backend` in config.toml, not the other way around. +Because all four are dlopen-based, `full` doesn't require the NPU/ROCm/CUDA/ +OpenVINO toolkits to be installed at build time — only at run time, and only +for whichever single backend you actually select via +`--npu`/`--rocm`/`--cuda`/`--openvino` or `backend` in config.toml. The +**released binaries are built with `full`**: same binary works CPU-only out +of the box, and picks up NPU/ROCm/CUDA/OpenVINO acceleration on a machine +that has the matching ONNX Runtime available, without needing a different +download. An explicit `--npu`/`--rocm`/`--cuda`/`--openvino` flag always +overrides `backend` in config.toml, not the other way around. ## Setup @@ -117,6 +124,7 @@ breadmill status breadmill --npu breadmill --rocm breadmill --cuda +breadmill --openvino ``` ## Config @@ -137,7 +145,7 @@ snippet_len = 200 # max characters in result snippet [model] name = "nomic-embed-text-v1.5" dim = 768 -backend = "cpu" # "cpu", "npu", "rocm", or "cuda" +backend = "cpu" # "cpu", "npu", "rocm", "cuda", or "openvino" ``` `roots` and `excludes` support `~/` expansion. The index respects `.gitignore` files found during the walk. @@ -154,10 +162,11 @@ Set `backend = "npu"` in config (or pass `--npu`) when running a build compiled ### GPU backend notes -Both `rocm` and `cuda` need a system ONNX Runtime that was actually built with -the matching execution provider — the crate's own downloaded binary is CPU-only. -Point `ORT_DYLIB_PATH` at one, or install a distro package that provides -`libonnxruntime.so` with the EP baked in and let the dynamic linker find it. +`rocm`, `cuda`, and `openvino` all need a system ONNX Runtime that was +actually built with the matching execution provider — the crate's own +downloaded binary is CPU-only. Point `ORT_DYLIB_PATH` at one, or install a +distro package that provides `libonnxruntime.so` with the EP baked in and +let the dynamic linker find it. **ROCm (`--rocm` / `backend = "rocm"`)** targets ONNX Runtime's **MIGraphX** execution provider, not the classic `ROCMExecutionProvider`. Distro @@ -183,6 +192,18 @@ noticeable for interactive query embedding. CUDA/cuDNN install. Unverified on real NVIDIA hardware in this repo — only compile-checked, since development happened on an AMD-only machine. +**OpenVINO (`--openvino` / `backend = "openvino"`)** targets +`OpenVINOExecutionProvider` with `device_type = "GPU"`, covering both Intel +iGPUs and Arc dGPUs through the same EP (OpenVINO abstracts Intel's whole +hardware line — CPU/GPU/NPU — behind one provider and a device-type string). +Needs an OpenVINO-enabled ONNX Runtime and the OpenVINO runtime itself +installed. Its options go through a generic key/value FFI interface rather +than a fixed C struct (unlike MIGraphX's `OrtMIGraphXProviderOptions`), so it +should be less exposed to the kind of ABI-version-skew crash MIGraphX hit — +but that's inference from reading the EP's design, not something verified +against real Intel GPU hardware. Also unverified on real hardware in this +repo — only compile-checked, for the same reason as CUDA. + ## Runtime paths | Purpose | Path | diff --git a/breadmill/Cargo.toml b/breadmill/Cargo.toml index 5e3822b..c57023e 100644 --- a/breadmill/Cargo.toml +++ b/breadmill/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "breadmill" -version = "0.2.1" +version = "0.3.3" edition = "2021" license = "MIT" @@ -14,13 +14,17 @@ npu = ["ort/vitis", "ort/load-dynamic"] # libonnxruntime_providers_rocm.so, which most distros don't package. rocm = ["ort/migraphx", "ort/load-dynamic"] cuda = ["ort/cuda", "ort/load-dynamic"] +# Intel iGPU/dGPU (Arc) + CPU via OpenVINO. One EP covers Intel's whole +# hardware line by device_type string ("CPU"/"GPU"/"GPU.0"/"NPU"/"HETERO:..."); +# we always request "GPU" since CPU is already covered by the cpu backend. +openvino = ["ort/openvino", "ort/load-dynamic"] # All backends in one binary. Safe to combine: every backend here uses # ort's load-dynamic (dlopen) mode, so none of this links against an actual -# NPU/ROCm/CUDA toolkit at build time — which ONNX Runtime actually gets -# loaded (and thus which EPs are really available) is decided at runtime by -# ORT_DYLIB_PATH / the dynamic linker, per the --npu/--rocm/--cuda flag or -# `backend` config value in use for that run. -full = ["npu", "rocm", "cuda"] +# NPU/ROCm/CUDA/OpenVINO toolkit at build time — which ONNX Runtime actually +# gets loaded (and thus which EPs are really available) is decided at +# runtime by ORT_DYLIB_PATH / the dynamic linker, per the --npu/--rocm/ +# --cuda/--openvino flag or `backend` config value in use for that run. +full = ["npu", "rocm", "cuda", "openvino"] [[bin]] name = "breadmill" @@ -38,6 +42,7 @@ breadsearch-shared = { path = "../breadsearch-shared" } # needed for the plain CPU path even in the npu build. ort = { version = "2.0.0-rc.12", default-features = false, features = ["std", "tracing", "download-binaries", "tls-native", "copy-dylibs", "api-23"] } tokenizers = "0" +bread-onnx = { git = "https://git.breadway.dev/Breadway/bread-ecosystem", tag = "v0.7.2" } # Surfaces ort's own EP-registration tracing (e.g. a GPU EP silently failing to # register and falling back to CPU) as visible log output instead of nowhere. diff --git a/breadmill/src/chunk.rs b/breadmill/src/chunk.rs index dcddca8..7468f89 100644 --- a/breadmill/src/chunk.rs +++ b/breadmill/src/chunk.rs @@ -81,10 +81,9 @@ fn split_by_chars(chunk: Chunk, max_chars: usize) -> Vec { let text = &chunk.text; let mut result = Vec::new(); let mut seg_start = 0usize; - let mut count = 0usize; - for (byte_idx, _) in text.char_indices() { - if count > 0 && count % max_chars == 0 { + for (count, (byte_idx, _)) in text.char_indices().enumerate() { + if count > 0 && count.is_multiple_of(max_chars) { result.push(Chunk { text: text[seg_start..byte_idx].to_string(), start: chunk.start + seg_start, @@ -92,7 +91,6 @@ fn split_by_chars(chunk: Chunk, max_chars: usize) -> Vec { }); seg_start = byte_idx; } - count += 1; } if seg_start < text.len() { result.push(Chunk { diff --git a/breadmill/src/embed.rs b/breadmill/src/embed.rs index 9700d6c..d507951 100644 --- a/breadmill/src/embed.rs +++ b/breadmill/src/embed.rs @@ -1,10 +1,7 @@ use std::path::{Path, PathBuf}; -use ort::{ - session::{Session, builder::{GraphOptimizationLevel, SessionBuilder}}, - value::Tensor, -}; -use tokenizers::Tokenizer; +use bread_onnx::embedding::EmbeddingSession; +use bread_onnx::Provider; const DOCUMENT_PREFIX: &str = "search_document: "; const QUERY_PREFIX: &str = "search_query: "; @@ -27,26 +24,23 @@ pub enum Backend { Rocm, /// NVIDIA GPU via the CUDA ONNX Runtime execution provider. Cuda, + /// Intel iGPU/dGPU (Arc) via the OpenVINO ONNX Runtime execution + /// provider, requesting device_type "GPU". `cache_dir` stores OpenVINO's + /// compiled-model blobs between runs (its own `with_cache_dir`, not an + /// env var — unlike MIGraphX this doesn't need a workaround). + OpenVino { cache_dir: PathBuf }, } pub struct OrtEmbedder { - session: Session, - tokenizer: Tokenizer, - dim: usize, + inner: EmbeddingSession, } impl OrtEmbedder { pub fn load(model_path: &Path, tokenizer_path: &Path, dim: usize, backend: Backend) -> Result { - let builder = Session::builder() - .map_err(|e| e.to_string())? - .with_optimization_level(GraphOptimizationLevel::All) + let provider = to_provider(backend)?; + let inner = EmbeddingSession::load(model_path, tokenizer_path, dim, MAX_SEQ_LEN, &[provider]) .map_err(|e| e.to_string())?; - - let mut builder = configure_eps(builder, &backend)?; - let session = builder.commit_from_file(model_path).map_err(|e| e.to_string())?; - let tokenizer = Tokenizer::from_file(tokenizer_path).map_err(|e| e.to_string())?; - - Ok(Self { session, tokenizer, dim }) + Ok(Self { inner }) } pub fn embed_document(&mut self, text: &str) -> Result, String> { @@ -59,198 +53,71 @@ impl OrtEmbedder { fn embed_with_prefix(&mut self, text: &str, prefix: &str) -> Result, String> { let input = format!("{}{}", prefix, text); - - let encoding = self - .tokenizer - .encode(input, true) - .map_err(|e| e.to_string())?; - - let mut ids: Vec = encoding.get_ids().iter().map(|&x| x as i64).collect(); - let mut mask: Vec = encoding - .get_attention_mask() - .iter() - .map(|&x| x as i64) - .collect(); - let mut type_ids: Vec = encoding - .get_type_ids() - .iter() - .map(|&x| x as i64) - .collect(); - - if ids.len() > MAX_SEQ_LEN { - eprintln!( - "breadmill: truncating {} tokens to {} (chunk too large)", - ids.len(), - MAX_SEQ_LEN - ); - ids.truncate(MAX_SEQ_LEN); - mask.truncate(MAX_SEQ_LEN); - type_ids.truncate(MAX_SEQ_LEN); - } - - let seq_len = ids.len() as i64; - - let id_tensor = - Tensor::::from_array((vec![1i64, seq_len], ids.clone())).map_err(|e| e.to_string())?; - let mask_tensor = - Tensor::::from_array((vec![1i64, seq_len], mask.clone())).map_err(|e| e.to_string())?; - let type_tensor = - Tensor::::from_array((vec![1i64, seq_len], type_ids)).map_err(|e| e.to_string())?; - - let outputs = self - .session - .run(ort::inputs! { - "input_ids" => id_tensor, - "attention_mask" => mask_tensor, - "token_type_ids" => type_tensor, - }) - .map_err(|e| e.to_string())?; - - // last_hidden_state: shape [1, seq_len, dim] - let (shape, data) = outputs["last_hidden_state"] - .try_extract_tensor::() - .map_err(|e| e.to_string())?; - - let actual_seq = shape[1] as usize; - let actual_dim = shape[2] as usize; - - // Mean-pool over non-padding positions. Some execution providers (e.g. - // MIGraphX) pad the output sequence dimension for kernel efficiency, so - // actual_seq can exceed mask.len() — only positions covered by our own - // attention mask are meaningful, so cap the loop at whichever is shorter. - let mut result = vec![0.0f32; actual_dim]; - let mut count = 0usize; - - for t in 0..actual_seq.min(mask.len()) { - if mask[t] > 0 { - for d in 0..actual_dim { - result[d] += data[t * actual_dim + d]; - } - count += 1; - } - } - - if count > 0 { - for x in &mut result { - *x /= count as f32; - } - } - - l2_normalize(&mut result); - - // Clamp/pad to configured dim - result.truncate(self.dim); - while result.len() < self.dim { - result.push(0.0); - } - - Ok(result) + self.inner.embed(&input).map_err(|e| e.to_string()) } } -fn l2_normalize(v: &mut Vec) { - let norm: f32 = v.iter().map(|x| x * x).sum::().sqrt(); - if norm > 1e-10 { - for x in v.iter_mut() { - *x /= norm; - } - } -} +// ---- Backend -> bread_onnx::Provider ---------------------------------------- +// +// `bread_onnx::session::build_session` (via `EmbeddingSession::load`) is the +// shared session-builder + EP-fallback + loud-logging code every EP branch +// below used to hand-roll separately (`configure_eps`/`npu_session`/ +// `rocm_session`/`cuda_session`/`openvino_session`). What's genuinely +// specific to this crate — its cargo feature gates (npu/rocm/cuda/openvino), +// and NPU's `vaip_config.json` discovery — stays here. -// ---- Execution provider selection ------------------------------------------- - -fn configure_eps(builder: SessionBuilder, backend: &Backend) -> Result { +fn to_provider(backend: Backend) -> Result { match backend { - Backend::Cpu => Ok(builder), - Backend::Npu { cache_dir } => npu_session(builder, cache_dir), - Backend::Rocm => rocm_session(builder), - Backend::Cuda => cuda_session(builder), + Backend::Cpu => Ok(Provider::Cpu), + Backend::Npu { cache_dir } => npu_provider(cache_dir), + Backend::Rocm => rocm_provider(), + Backend::Cuda => cuda_provider(), + Backend::OpenVino { cache_dir } => Ok(Provider::OpenVino { device_type: "GPU".to_string(), cache_dir }), } } #[cfg(feature = "npu")] -fn npu_session(builder: SessionBuilder, cache_dir: &Path) -> Result { - let vitis_ep = build_vitis_ep(cache_dir)?; - eprintln!("breadmill: using NPU (VitisAI) execution provider"); +fn npu_provider(cache_dir: PathBuf) -> Result { + let vaip_config = find_vaip_config()?; if std::env::var("ORT_DYLIB_PATH").is_err() { eprintln!( "breadmill: hint — set ORT_DYLIB_PATH to the Ryzen AI SDK ORT, e.g.:\n \ ORT_DYLIB_PATH=~/.local/share/ryzen-ai-1.7.1/lib/libonnxruntime.so" ); } - builder - .with_execution_providers([vitis_ep, ort::ep::CPU::default().build()]) - .map_err(|e| e.to_string()) + Ok(Provider::Vitis { + config_file: vaip_config, + cache_dir: cache_dir.join("npu"), + cache_key: "nomic-embed-text-v1.5".to_string(), + }) } #[cfg(not(feature = "npu"))] -fn npu_session(builder: SessionBuilder, _cache_dir: &Path) -> Result { +fn npu_provider(_cache_dir: PathBuf) -> Result { eprintln!("breadmill: NPU backend requested but not compiled in (rebuild with --features npu); using CPU"); - Ok(builder) + Ok(Provider::Cpu) } -// ---- VitisAI EP (NPU) ------------------------------------------------------- - -#[cfg(feature = "npu")] -fn build_vitis_ep(cache_dir: &Path) -> Result { - let vaip_config = find_vaip_config()?; - let npu_cache = cache_dir.join("npu"); - std::fs::create_dir_all(&npu_cache).map_err(|e| e.to_string())?; - eprintln!("breadmill: vaip_config: {}", vaip_config.display()); - eprintln!("breadmill: NPU model cache: {}", npu_cache.display()); - Ok(ort::ep::Vitis::default() - .with_config_file(vaip_config.to_string_lossy()) - .with_cache_dir(npu_cache.to_string_lossy()) - .with_cache_key("nomic-embed-text-v1.5") - .build()) -} - -// ---- MIGraphX EP (AMD iGPU, ROCm-backed) ------------------------------------- - #[cfg(feature = "rocm")] -fn rocm_session(builder: SessionBuilder) -> Result { - eprintln!("breadmill: using MIGraphX execution provider (device 0)"); - eprintln!( - "breadmill: note — check the log line above/below for \"Successfully registered \ - `MIGraphXExecutionProvider`\"; if it's missing, the ONNX Runtime in use wasn't built \ - with MIGraphX support and inference silently fell back to CPU" - ); - builder - .with_execution_providers([ - ort::ep::MIGraphX::default().with_device_id(0).build(), - ort::ep::CPU::default().build(), - ]) - .map_err(|e| e.to_string()) +fn rocm_provider() -> Result { + Ok(Provider::MiGraphX { device_id: 0 }) } #[cfg(not(feature = "rocm"))] -fn rocm_session(builder: SessionBuilder) -> Result { +fn rocm_provider() -> Result { eprintln!("breadmill: ROCm backend requested but not compiled in (rebuild with --features rocm); using CPU"); - Ok(builder) + Ok(Provider::Cpu) } -// ---- CUDA EP (NVIDIA GPU) ---------------------------------------------------- - #[cfg(feature = "cuda")] -fn cuda_session(builder: SessionBuilder) -> Result { - eprintln!("breadmill: using CUDA execution provider (device 0)"); - eprintln!( - "breadmill: note — check the log line above/below for \"Successfully registered \ - `CUDAExecutionProvider`\"; if it's missing, the ONNX Runtime in use wasn't built \ - with CUDA support and inference silently fell back to CPU" - ); - builder - .with_execution_providers([ - ort::ep::CUDA::default().with_device_id(0).build(), - ort::ep::CPU::default().build(), - ]) - .map_err(|e| e.to_string()) +fn cuda_provider() -> Result { + Ok(Provider::Cuda { device_id: 0 }) } #[cfg(not(feature = "cuda"))] -fn cuda_session(builder: SessionBuilder) -> Result { +fn cuda_provider() -> Result { eprintln!("breadmill: CUDA backend requested but not compiled in (rebuild with --features cuda); using CPU"); - Ok(builder) + Ok(Provider::Cpu) } /// Locate the VitisAI EP config file required by the AMD Ryzen AI SDK. diff --git a/breadmill/src/indexer.rs b/breadmill/src/indexer.rs index 3ad20b5..67c7694 100644 --- a/breadmill/src/indexer.rs +++ b/breadmill/src/indexer.rs @@ -10,7 +10,7 @@ use ignore::WalkBuilder; use notify::{RecommendedWatcher, RecursiveMode, Watcher, EventKind}; use sha2::{Digest, Sha256}; -use crate::{embed::OrtEmbedder, extract, chunk, power, store::Store}; +use crate::{embed::OrtEmbedder, extract, chunk, power, store::Store, sync_ext::MutexExt}; pub struct SharedState { pub store: Mutex, @@ -64,7 +64,7 @@ impl Indexer { pub fn full_reindex(&self) { eprintln!("breadmill: full reindex triggered"); { - let mut store = self.state.store.lock().unwrap(); + let store = self.state.store.lock_recover(); // Clear all state let _ = store.conn.execute_batch("DELETE FROM chunks; DELETE FROM files;"); let _ = store.index.reserve(4096); @@ -87,7 +87,7 @@ impl Indexer { // Snapshot existing indexed files let known: HashMap = { - let store = self.state.store.lock().unwrap(); + let store = self.state.store.lock_recover(); store.all_files() .unwrap_or_default() .into_iter() @@ -155,7 +155,7 @@ impl Indexer { .collect(); if !to_delete.is_empty() { - let mut store = self.state.store.lock().unwrap(); + let mut store = self.state.store.lock_recover(); for path in to_delete { eprintln!("breadmill: removing deleted file: {}", path); let _ = store.delete_file(&path); @@ -163,7 +163,7 @@ impl Indexer { } let count = { - let store = self.state.store.lock().unwrap(); + let store = self.state.store.lock_recover(); let n = store.chunk_count(); let _ = store.save_index(&self.state_dir); n @@ -238,7 +238,7 @@ impl Indexer { self.handle_fs_event(&path); } let count = { - let store = self.state.store.lock().unwrap(); + let store = self.state.store.lock_recover(); let n = store.chunk_count(); let _ = store.save_index(&self.state_dir); n @@ -261,7 +261,7 @@ impl Indexer { if !path.is_file() { let path_str = path.to_string_lossy().into_owned(); // File deleted — remove from index - let mut store = self.state.store.lock().unwrap(); + let mut store = self.state.store.lock_recover(); let _ = store.delete_file(&path_str); return; } @@ -309,7 +309,7 @@ impl Indexer { // Check if hash changed (catches content changes without mtime change) { - let store = self.state.store.lock().unwrap(); + let store = self.state.store.lock_recover(); if let Ok(files) = store.all_files() { if files.iter().any(|f| f.path == path_str && f.hash == hash) { return; @@ -322,20 +322,22 @@ impl Indexer { // for natural-language files. let chunks = chunk::chunk_text(&text, 400, 80, 2_000); eprintln!("breadmill: embedding {} ({} chars, {} chunks)", path_str, text.len(), chunks.len()); - let mut embedder_guard = self.state.embedder.lock().unwrap(); if !self.state.model_ready.load(Ordering::Relaxed) { eprintln!("breadmill: model not ready, skipping embed for {}", path_str); return; } - let embedder = match embedder_guard.as_mut() { - Some(e) => e, - None => return, - }; + // Confirm the embedder is actually present before committing to + // clearing this file's old chunks below — same check as before, + // just without holding the embedder lock past this one glance (see + // the per-chunk locking in the loop for why). + if self.state.embedder.lock_recover().is_none() { + return; + } { - let mut store = self.state.store.lock().unwrap(); + let mut store = self.state.store.lock_recover(); let _ = store.delete_file(path_str); // remove old chunks/vectors first } @@ -344,9 +346,18 @@ impl Indexer { for (i, chunk) in chunks.iter().enumerate() { eprintln!("breadmill: embed chunk {}/{} ({} chars) for {}", i + 1, chunks.len(), chunk.text.len(), path_str); - match embedder.embed_document(&chunk.text) { + // Lock the embedder only around this single chunk's embed call — + // this used to be held for the whole file's chunk loop, so one + // large file needing a fresh MIGraphX JIT compile (60-120s for a + // new sequence length) could block every query (serve.rs locks + // this same mutex) for the entire file, not just one chunk. + let embed_result = match self.state.embedder.lock_recover().as_mut() { + Some(embedder) => embedder.embed_document(&chunk.text), + None => break, // model was unloaded mid-scan; stop here + }; + match embed_result { Ok(embedding) => { - let mut store = self.state.store.lock().unwrap(); + let mut store = self.state.store.lock_recover(); // Ensure file row exists before inserting chunks (FK constraint) let _ = store.upsert_file(path_str, mtime, &hash); let _ = store.insert_chunk( @@ -367,7 +378,7 @@ impl Indexer { eprintln!("breadmill: no chunks embedded for {}", path_str); // Record the file so the mtime+hash check skips it on the next startup // rather than re-entering the same embed-fail loop. - let store = self.state.store.lock().unwrap(); + let store = self.state.store.lock_recover(); let _ = store.upsert_file(path_str, mtime, &hash); } else { // Increment live so `status` reflects progress before the full scan ends. @@ -405,9 +416,9 @@ fn sha256_str(bytes: &[u8]) -> String { } pub fn expand_home(path: &str) -> PathBuf { - if path.starts_with("~/") { + if let Some(rest) = path.strip_prefix("~/") { let home = std::env::var("HOME").unwrap_or_else(|_| "/tmp".into()); - PathBuf::from(home).join(&path[2..]) + PathBuf::from(home).join(rest) } else { PathBuf::from(path) } diff --git a/breadmill/src/main.rs b/breadmill/src/main.rs index 8d2e9bd..0b79eef 100644 --- a/breadmill/src/main.rs +++ b/breadmill/src/main.rs @@ -1,5 +1,4 @@ use std::{ - io::Read, path::{Path, PathBuf}, sync::{Arc, atomic::Ordering}, }; @@ -13,10 +12,12 @@ mod indexer; mod power; mod serve; mod store; +mod sync_ext; use embed::{Backend, OrtEmbedder}; use indexer::{Indexer, SharedState}; use store::Store; +use sync_ext::MutexExt; const MODEL_URL: &str = "https://huggingface.co/nomic-ai/nomic-embed-text-v1.5/resolve/main/onnx/model.onnx"; @@ -39,12 +40,14 @@ fn main() { let use_npu = raw_args.iter().any(|a| a == "--npu"); let use_rocm = raw_args.iter().any(|a| a == "--rocm"); let use_cuda = raw_args.iter().any(|a| a == "--cuda"); + let use_openvino = raw_args.iter().any(|a| a == "--openvino"); // Build a view of argv without backend flags for command matching. + let backend_flags = ["--npu", "--rocm", "--cuda", "--openvino"]; let args: Vec<&str> = raw_args .iter() .skip(1) - .filter(|a| a.as_str() != "--npu" && a.as_str() != "--rocm" && a.as_str() != "--cuda") + .filter(|a| !backend_flags.contains(&a.as_str())) .map(|s| s.as_str()) .collect(); @@ -59,7 +62,7 @@ fn main() { } } Some("--reindex") | Some("reindex") => { - if let Err(e) = run_daemon(true, use_npu, use_rocm, use_cuda) { + if let Err(e) = run_daemon(true, use_npu, use_rocm, use_cuda, use_openvino) { eprintln!("breadmill: {}", e); std::process::exit(1); } @@ -76,7 +79,7 @@ fn main() { cli_status(); } None | Some("serve") | Some("--serve") => { - if let Err(e) = run_daemon(false, use_npu, use_rocm, use_cuda) { + if let Err(e) = run_daemon(false, use_npu, use_rocm, use_cuda, use_openvino) { eprintln!("breadmill: {}", e); std::process::exit(1); } @@ -84,7 +87,7 @@ fn main() { Some(cmd) => { eprintln!("breadmill: unknown command: {}", cmd); eprintln!( - "usage: breadmill [serve|reindex|fetch-model|query |status] [--npu|--rocm|--cuda] [--version]" + "usage: breadmill [serve|reindex|fetch-model|query |status] [--npu|--rocm|--cuda|--openvino] [--version]" ); std::process::exit(1); } @@ -93,7 +96,13 @@ fn main() { // ---- Daemon ----------------------------------------------------------------- -fn run_daemon(force_reindex: bool, use_npu: bool, use_rocm: bool, use_cuda: bool) -> Result<(), String> { +fn run_daemon( + force_reindex: bool, + use_npu: bool, + use_rocm: bool, + use_cuda: bool, + use_openvino: bool, +) -> Result<(), String> { let config = breadsearch_shared::Config::load(); let state_dir = breadsearch_shared::state_dir(); let cache_dir = breadsearch_shared::cache_dir(); @@ -115,6 +124,8 @@ fn run_daemon(force_reindex: bool, use_npu: bool, use_rocm: bool, use_cuda: bool "rocm" } else if use_cuda { "cuda" + } else if use_openvino { + "openvino" } else { config.model.backend.as_str() }; @@ -132,27 +143,41 @@ fn run_daemon(force_reindex: bool, use_npu: bool, use_rocm: bool, use_cuda: bool eprintln!("breadmill: CUDA backend selected"); Backend::Cuda } + "openvino" => { + eprintln!("breadmill: OpenVINO backend selected"); + Backend::OpenVino { cache_dir: cache_dir.clone() } + } _ => Backend::Cpu, }; let store = Store::open(&state_dir, dim)?; let state = Arc::new(SharedState::new(store)); - // Load embedder if model files present + // Load the embedder on a background thread — an OpenVINO/CUDA/etc EP + // compile can take minutes or hang outright, and doing this inline used + // to block the socket bind below until it finished. That turned "model + // still loading" into an indistinguishable "connection refused" for + // every client, including the GUI, for as long as the load took. The + // socket now opens immediately; serve.rs already answers "model not + // ready" (via `model_ready`) for any request that arrives before the + // background load finishes. let model_dir = model_dir(&cache_dir); let model_path = model_dir.join("model.onnx"); let tokenizer_path = model_dir.join("tokenizer.json"); if model_path.exists() && tokenizer_path.exists() { - eprintln!("breadmill: loading model..."); - match OrtEmbedder::load(&model_path, &tokenizer_path, dim, backend) { - Ok(embedder) => { - *state.embedder.lock().unwrap() = Some(embedder); - state.model_ready.store(true, Ordering::Relaxed); - eprintln!("breadmill: model loaded"); + let state_clone = Arc::clone(&state); + std::thread::spawn(move || { + eprintln!("breadmill: loading model..."); + match OrtEmbedder::load(&model_path, &tokenizer_path, dim, backend) { + Ok(embedder) => { + *state_clone.embedder.lock_recover() = Some(embedder); + state_clone.model_ready.store(true, Ordering::Relaxed); + eprintln!("breadmill: model loaded"); + } + Err(e) => eprintln!("breadmill: model load failed: {} — run --fetch-model", e), } - Err(e) => eprintln!("breadmill: model load failed: {} — run --fetch-model", e), - } + }); } else { eprintln!( "breadmill: model files not found in {} — run: breadmill --fetch-model", @@ -200,29 +225,10 @@ fn download_if_missing(url: &str, dest: &Path) -> Result<(), String> { eprintln!(" already present: {}", dest.display()); return Ok(()); } - - eprintln!(" downloading {} ...", url); - let agent = ureq::AgentBuilder::new() - .timeout(std::time::Duration::from_secs(300)) - .build(); - - let response = agent.get(url).call().map_err(|e| e.to_string())?; - let mut bytes = Vec::new(); - response - .into_reader() - .read_to_end(&mut bytes) - .map_err(|e| e.to_string())?; - - if bytes.is_empty() { - return Err(format!("empty download from {}", url)); - } - - // Write atomically via temp file - let tmp = dest.with_extension("tmp"); - std::fs::write(&tmp, &bytes).map_err(|e| e.to_string())?; - std::fs::rename(&tmp, dest).map_err(|e| e.to_string())?; - - eprintln!(" saved {} ({:.1} MB)", dest.display(), bytes.len() as f64 / 1_048_576.0); + // Shared with breadarrd's own (previously reqwest/async, now also this + // same sync/ureq implementation) model downloader — see + // bread_onnx::download's doc comment. + bread_onnx::download::ensure_file(url, dest, None).map_err(|e| e.to_string())?; Ok(()) } diff --git a/breadmill/src/serve.rs b/breadmill/src/serve.rs index cd67e67..a147235 100644 --- a/breadmill/src/serve.rs +++ b/breadmill/src/serve.rs @@ -8,6 +8,7 @@ use std::{ use breadsearch_shared::{Request, Response, StatusInfo}; use crate::indexer::SharedState; +use crate::sync_ext::MutexExt; pub fn run(socket_path: &Path, state: Arc, snippet_len: usize, search_limit: usize) { let _ = std::fs::remove_file(socket_path); @@ -86,7 +87,7 @@ fn dispatch( } let embedding = { - let mut embedder = state.embedder.lock().unwrap(); + let mut embedder = state.embedder.lock_recover(); match embedder.as_mut() { Some(e) => match e.embed_query(&query) { Ok(v) => v, @@ -101,7 +102,7 @@ fn dispatch( }; let limit = limit.min(search_limit).max(1); - let store = state.store.lock().unwrap(); + let store = state.store.lock_recover(); match store.search(&embedding, limit, snippet_len) { Ok(hits) => Response::Hits { hits }, diff --git a/breadmill/src/store.rs b/breadmill/src/store.rs index 077736d..106e4c5 100644 --- a/breadmill/src/store.rs +++ b/breadmill/src/store.rs @@ -6,7 +6,6 @@ use usearch::{Index, IndexOptions, MetricKind, ScalarKind, new_index}; pub struct Store { pub conn: Connection, pub index: Index, - pub dim: usize, } // usearch::Index wraps a raw C++ pointer; access is serialized by the Mutex. @@ -57,14 +56,37 @@ impl Store { let index = new_index(&options).map_err(|e| e.to_string())?; if idx_path.exists() { - index - .load(idx_path.to_str().unwrap()) - .map_err(|e| e.to_string())?; + // NOTE: this only catches corruption that usearch's loader + // itself detects and reports as an `Err` (e.g. a recognizable + // but wrong/incompatible header). Verified experimentally: a + // file that doesn't even look like a usearch index at all (pure + // garbage bytes) crashes the *process* with a SIGSEGV inside the + // native loader rather than returning an `Err` — no amount of + // Rust-side `Result`/`catch_unwind` handling can intercept that, + // it's a native-code robustness gap in the usearch library + // itself. This recovery path is still worth having (it's the + // difference between "won't start" and "rebuilds and starts" + // for the errors it *does* catch), but it is not a complete + // guarantee against every possible corrupt file. The atomic + // save below is the real fix for the common case this was + // written for (a crash mid-save) — it now can't produce a + // half-written `vectors.usearch` in the first place. + if let Err(e) = index.load(idx_path.to_str().unwrap()) { + eprintln!( + "breadmill: WARNING: {} failed to load ({}) — treating it as corrupt, \ + discarding it, and rebuilding the index from scratch on the next scan", + idx_path.display(), + e + ); + conn.execute_batch("DELETE FROM chunks; DELETE FROM files;") + .map_err(|e| e.to_string())?; + index.reserve(4096).map_err(|e| e.to_string())?; + } } else { index.reserve(4096).map_err(|e| e.to_string())?; } - Ok(Self { conn, index, dim }) + Ok(Self { conn, index }) } // ---- file state --------------------------------------------------------- @@ -218,11 +240,18 @@ impl Store { // ---- persistence -------------------------------------------------------- + /// Saves to a `.tmp` sibling and renames it into place — a same- + /// filesystem rename is atomic, so a crash mid-save leaves only an + /// orphaned `.tmp` file rather than a truncated/corrupt + /// `vectors.usearch` that would otherwise fail to load on next start + /// (see the recovery path in `open`). pub fn save_index(&self, state_dir: &Path) -> Result<(), String> { let idx_path = state_dir.join("vectors.usearch"); + let tmp_path = state_dir.join("vectors.usearch.tmp"); self.index - .save(idx_path.to_str().unwrap()) - .map_err(|e| e.to_string()) + .save(tmp_path.to_str().unwrap()) + .map_err(|e| e.to_string())?; + std::fs::rename(&tmp_path, &idx_path).map_err(|e| e.to_string()) } } @@ -233,3 +262,45 @@ fn truncate_to_chars(s: &str, max_chars: usize) -> String { let truncated: String = s.chars().take(max_chars).collect(); format!("{}…", truncated.trim_end()) } + +#[cfg(test)] +mod tests { + use super::*; + + fn test_dir(name: &str) -> std::path::PathBuf { + let dir = std::env::temp_dir().join(format!("breadmill-store-test-{name}-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + dir + } + + #[test] + fn save_index_leaves_no_tmp_file_behind_and_is_loadable() { + let dir = test_dir("save-atomic"); + let store = Store::open(&dir, 4).unwrap(); + store.save_index(&dir).unwrap(); + + assert!(dir.join("vectors.usearch").exists()); + assert!( + !dir.join("vectors.usearch.tmp").exists(), + "the .tmp staging file should be renamed away, not left behind" + ); + + // A fresh `open` can load what was just saved without error. + Store::open(&dir, 4).unwrap(); + + std::fs::remove_dir_all(&dir).unwrap(); + } + + // No automated test for the corrupt-index recovery branch in `open`: + // the natural way to construct a "corrupt" fixture (writing arbitrary + // garbage to vectors.usearch) was tried and crashes the *test process* + // with a SIGSEGV inside usearch's native loader before our `Result` + // handling ever gets a chance to run — see the comment on that branch + // in `open`. A real usearch file with a deliberately-broken-but-still- + // parseable header could plausibly hit the `Err` path exercised there + // instead, but reverse-engineering that format precisely enough to + // build a safe fixture wasn't worth the risk of another flaky/crashing + // test. The atomic-save test above covers the actual mechanism that + // prevents this scenario from arising in the first place. +} diff --git a/breadmill/src/sync_ext.rs b/breadmill/src/sync_ext.rs new file mode 100644 index 0000000..a891cd7 --- /dev/null +++ b/breadmill/src/sync_ext.rs @@ -0,0 +1,41 @@ +//! Poison-tolerant `Mutex` locking. +//! +//! A panic on any thread while holding `SharedState::store` or +//! `SharedState::embedder` (e.g. an untrapped ONNX Runtime panic — only PDF +//! extraction is `catch_unwind`-guarded, see `extract.rs`) poisons the +//! `Mutex`. Every subsequent plain `.lock().unwrap()` — in the indexer *and* +//! in every query handler in `serve.rs` — would then immediately panic too, +//! silently bricking indexing and search until the daemon is restarted by +//! hand. +//! +//! `Mutex` poisoning exists to flag "the data guarded by this lock might be +//! in an inconsistent state," but every lock scope in this crate is a short, +//! single-step SQLite call or usearch operation — nothing here spans a +//! multi-step invariant across a single `lock()` call — so recovering the +//! guard and logging loudly is a reasonable trade here: continuing to serve +//! (and re-attempting the operation that panicked, on the next file/query) +//! beats a daemon that silently stops answering everything after one panic. + +use std::sync::{Mutex, MutexGuard}; + +pub trait MutexExt { + /// Like `.lock().unwrap()`, but recovers from a poisoned mutex instead + /// of panicking again — logs once per recovery so it's visible in the + /// daemon's own output, not just silently swallowed. + fn lock_recover(&self) -> MutexGuard<'_, T>; +} + +impl MutexExt for Mutex { + fn lock_recover(&self) -> MutexGuard<'_, T> { + match self.lock() { + Ok(guard) => guard, + Err(poisoned) => { + eprintln!( + "breadmill: WARNING: a mutex was poisoned by a panic on another thread; \ + recovering it and continuing instead of cascading the panic" + ); + poisoned.into_inner() + } + } + } +} diff --git a/breadsearch-shared/Cargo.toml b/breadsearch-shared/Cargo.toml index c557db6..6f45d3f 100644 --- a/breadsearch-shared/Cargo.toml +++ b/breadsearch-shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "breadsearch-shared" -version = "0.2.0" +version = "0.3.3" edition = "2021" license = "MIT" diff --git a/breadsearch-shared/src/lib.rs b/breadsearch-shared/src/lib.rs index 7b8b625..5ed69c4 100644 --- a/breadsearch-shared/src/lib.rs +++ b/breadsearch-shared/src/lib.rs @@ -43,7 +43,7 @@ pub fn socket_path() -> PathBuf { // ---- Config ----------------------------------------------------------------- -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct Config { #[serde(default)] pub index: IndexConfig, @@ -129,7 +129,8 @@ pub struct ModelConfig { pub name: String, #[serde(default = "default_dim")] pub dim: usize, - /// Compute backend: "cpu", "npu" (VitisAI/XDNA), "rocm" (MIGraphX/AMD GPU), or "cuda" (NVIDIA GPU). + /// Compute backend: "cpu", "npu" (VitisAI/XDNA), "rocm" (MIGraphX/AMD GPU), + /// "cuda" (NVIDIA GPU), or "openvino" (Intel iGPU/dGPU). #[serde(default = "default_backend")] pub backend: String, } @@ -156,16 +157,6 @@ impl Default for ModelConfig { } } -impl Default for Config { - fn default() -> Self { - Self { - index: IndexConfig::default(), - search: SearchConfig::default(), - model: ModelConfig::default(), - power: PowerConfig::default(), - } - } -} #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PowerConfig { @@ -254,8 +245,7 @@ pub struct StatusInfo { pub fn send_request(req: &Request) -> std::io::Result { let mut stream = UnixStream::connect(socket_path())?; - let mut line = serde_json::to_string(req) - .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?; + let mut line = serde_json::to_string(req).map_err(std::io::Error::other)?; line.push('\n'); stream.write_all(line.as_bytes())?; stream.flush()?; diff --git a/breadsearch/Cargo.toml b/breadsearch/Cargo.toml index 5569deb..2c11e28 100644 --- a/breadsearch/Cargo.toml +++ b/breadsearch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "breadsearch" -version = "0.2.0" +version = "0.3.3" edition = "2021" license = "MIT" @@ -10,7 +10,13 @@ path = "src/main.rs" [dependencies] breadsearch-shared = { path = "../breadsearch-shared" } -bread-theme = { git = "https://github.com/Breadway/bread-ecosystem", tag = "v0.2.8", features = ["gtk"] } +bread-theme = { git = "https://git.breadway.dev/Breadway/bread-ecosystem", tag = "v0.7.4", features = ["gtk"] } +# Bread event fabric client — emit bread.search.* (fail-silent if breadd is down). +bread-utils = { git = "https://git.breadway.dev/Breadway/bread-ecosystem", tag = "v0.7.2", features = ["bread-client", "gtk"] } +# Capture primitives for `--screenshot` mode — see src/screenshot.rs. +bread-screenshots = { git = "https://git.breadway.dev/Breadway/bread-ecosystem", tag = "v0.7.2" } gtk4 = { version = "0.11", features = ["v4_12"] } gtk4-layer-shell = "0.8" serde_json = "1" +clap = { version = "4", features = ["derive"] } +anyhow = "1" diff --git a/breadsearch/src/bread_events.rs b/breadsearch/src/bread_events.rs new file mode 100644 index 0000000..d87e595 --- /dev/null +++ b/breadsearch/src/bread_events.rs @@ -0,0 +1,26 @@ +//! `bread.search.*` event integration — optional, non-blocking. See +//! `EVENTS.md` at the repo root for the full contract. breadsearch works +//! identically with or without breadd running; every call here is +//! fire-and-forget (`BreadClient::emit` never blocks or errors this +//! process) so a missing or restarting breadd never affects the overlay. + +use bread_utils::bread_client::BreadClient; + +/// This app's id in bread's sibling-app namespace registry +/// (`bread_shared::apps::KNOWN_APPS`) — events publish as `bread.search.*`. +pub const APP_ID: &str = "search"; + +fn client() -> BreadClient { + BreadClient::connect(APP_ID) +} + +pub fn emit_opened() { + client().emit("bread.search.opened", serde_json::json!({})); +} + +pub fn emit_opened_result(path: &str) { + client().emit( + "bread.search.opened_result", + serde_json::json!({ "path": path }), + ); +} diff --git a/breadsearch/src/listen.rs b/breadsearch/src/listen.rs new file mode 100644 index 0000000..aef9c84 --- /dev/null +++ b/breadsearch/src/listen.rs @@ -0,0 +1,84 @@ +//! Long-running command subscription for `bread.command.search.*`. +//! +//! `breadsearch` is still a one-shot toggle overlay by default. +//! `breadsearch listen` is the optional persistent process that can honor +//! bus commands. See `EVENTS.md`. + +use bread_utils::bread_client::{BreadClient, BreadEvent}; + +use crate::bread_events::APP_ID; + +/// Subscribe to `bread.command.search.**` and block until the process is killed. +/// +/// breadd being absent is not an error: [`BreadClient::subscribe`] reconnects +/// with backoff, and `on_event` simply isn't called until the daemon is up. +pub fn run() { + let client = BreadClient::connect(APP_ID); + if client.health().is_none() { + eprintln!( + "breadsearch: breadd unreachable; command subscription will connect when it comes back" + ); + } + + let _commands = client.subscribe("bread.command.search.**", |event| { + handle_command(&event); + }); + + eprintln!("breadsearch: listening for bread.command.search.**"); + loop { + std::thread::park(); + } +} + +/// Reacts to `bread.command.search.*` verbs. Only `open` is honored today — +/// other verbs are ignored, not stubbed as no-ops that pretend to succeed. +fn handle_command(event: &BreadEvent) { + let Some(verb) = command_verb(&event.event) else { + return; + }; + match verb { + "open" => handle_open(), + other => { + eprintln!("breadsearch: ignoring unrecognized bread.command.search.{other}"); + } + } +} + +fn handle_open() { + // Same as running `breadsearch` from a keybind: the PID-file toggle + // shows the overlay (or dismisses it if it is already up). + let result = spawn_self(); + let client = BreadClient::connect(APP_ID); + match result { + Ok(_) => client.emit("bread.search.open.done", serde_json::json!({})), + Err(e) => { + eprintln!("breadsearch: bread.command.search.open failed: {e}"); + client.emit( + "bread.search.open.failed", + serde_json::json!({ "error": e.to_string() }), + ); + } + } +} + +fn spawn_self() -> std::io::Result { + let exe = std::env::current_exe().unwrap_or_else(|_| std::path::PathBuf::from("breadsearch")); + std::process::Command::new(exe).spawn() +} + +fn command_verb(event_name: &str) -> Option<&str> { + event_name.strip_prefix("bread.command.search.") +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn command_verb_strips_search_prefix() { + assert_eq!(command_verb("bread.command.search.open"), Some("open")); + assert_eq!(command_verb("bread.command.search.query"), Some("query")); + assert_eq!(command_verb("bread.command.box.open"), None); + assert_eq!(command_verb("bread.search.opened"), None); + } +} diff --git a/breadsearch/src/main.rs b/breadsearch/src/main.rs index 58f4b47..53302ec 100644 --- a/breadsearch/src/main.rs +++ b/breadsearch/src/main.rs @@ -1,22 +1,16 @@ use bread_theme::{hex_to_rgba, ink_on, load_palette, Palette}; use breadsearch_shared::{Hit, Request, Response}; -use std::{ - cell::RefCell, - env, fs, - path::PathBuf, - process::Command, - rc::Rc, - sync::mpsc, -}; +use std::{cell::RefCell, process::Command, rc::Rc, sync::mpsc}; use gtk4::{ - glib, - pango::EllipsizeMode, - prelude::*, - Application, ApplicationWindow, Box as GBox, CssProvider, EventControllerKey, Image, Label, - ListBox, Orientation, PolicyType, ScrolledWindow, SearchEntry, SelectionMode, + glib, pango::EllipsizeMode, prelude::*, Application, Box as GBox, CssProvider, + EventControllerKey, Image, Label, ListBox, Orientation, PolicyType, ScrolledWindow, + SearchEntry, SelectionMode, }; -use gtk4_layer_shell::{Edge, KeyboardMode, Layer, LayerShell}; + +mod bread_events; +mod listen; +mod screenshot; // ---- Theming ---------------------------------------------------------------- @@ -39,47 +33,14 @@ fn build_css(p: &Palette) -> String { .hit-snippet {{ opacity: 0.75; font-size: 11px; font-style: italic; }}\ .hit-score {{ opacity: 0.5; font-size: 11px; }}\ image {{ margin-right: 8px; }}", - bg_panel = bg_panel, - surface = p.color0, - accent = p.color4, - on_bg = ink_on(&p.background), + bg_panel = bg_panel, + surface = p.color0, + accent = p.color4, + on_bg = ink_on(&p.background), on_surface = ink_on(&p.color0), ) } -// ---- PID file toggle -------------------------------------------------------- - -fn pid_file() -> PathBuf { - env::var("XDG_RUNTIME_DIR") - .map(PathBuf::from) - .unwrap_or_else(|_| PathBuf::from("/tmp")) - .join("breadsearch.pid") -} - -fn is_breadsearch_pid(pid: u32) -> bool { - fs::read_to_string(format!("/proc/{}/comm", pid)) - .map(|s| s.trim() == "breadsearch") - .unwrap_or(false) -} - -fn toggle_or_continue() -> bool { - let pf = pid_file(); - if let Ok(content) = fs::read_to_string(&pf) { - if let Ok(pid) = content.trim().parse::() { - if is_breadsearch_pid(pid) { - let _ = Command::new("kill").arg(pid.to_string()).status(); - return false; - } - } - } - let _ = fs::write(&pf, std::process::id().to_string()); - true -} - -fn cleanup_pid() { - let _ = fs::remove_file(pid_file()); -} - // ---- Row builder ------------------------------------------------------------ fn make_hit_row(hit: &Hit) -> gtk4::ListBoxRow { @@ -191,6 +152,7 @@ fn open_file(path: &str) { .stdout(std::process::Stdio::null()) .stderr(std::process::Stdio::null()) .spawn(); + bread_events::emit_opened_result(path); } fn open_folder(path: &str) { @@ -204,14 +166,22 @@ fn open_folder(path: &str) { .stdout(std::process::Stdio::null()) .stderr(std::process::Stdio::null()) .spawn(); + bread_events::emit_opened_result(path); } // ---- UI --------------------------------------------------------------------- -fn run_ui() { - let app = Application::builder() - .application_id("com.breadway.breadsearch") - .build(); +fn run_ui(screenshot_req: Option) { + let mut builder = Application::builder().application_id("com.breadway.breadsearch"); + if screenshot_req.is_some() { + // GApplication is single-instance by default; this machine typically + // already has a real breadsearch instance, so without this a + // screenshot run would just message the *existing* instance instead + // of starting a fresh one that ever sees `screenshot_req`. + builder = builder.flags(gtk4::gio::ApplicationFlags::NON_UNIQUE); + } + let app = builder.build(); + let is_screenshot_run = screenshot_req.is_some(); let debounce_id: Rc>> = Rc::new(RefCell::new(None)); @@ -225,20 +195,13 @@ fn run_ui() { bread_theme::gtk::apply_user_css(&user_css_path, &user_cell); } - let window = ApplicationWindow::builder().application(app).build(); - window.init_layer_shell(); - window.set_namespace(Some("breadsearch")); - window.set_layer(Layer::Overlay); - window.set_keyboard_mode(KeyboardMode::Exclusive); - for edge in [Edge::Top, Edge::Bottom, Edge::Left, Edge::Right] { - window.set_anchor(edge, true); - } - window.set_exclusive_zone(0); + // Full-screen transparent overlay; panel widget is positioned inside it. + let window = bread_utils::gtk_popup::new_overlay_window(app, "breadsearch"); + bread_theme::gtk::bind_window_auto(&window); let close_all: Rc = Rc::new({ let w = window.clone(); move || { - cleanup_pid(); w.close(); } }); @@ -294,16 +257,26 @@ fn run_ui() { let (tx, rx) = mpsc::sync_channel::>(1); std::thread::spawn(move || { - let req = Request::Query { query: q, limit: 10 }; + let req = Request::Query { + query: q, + limit: 10, + }; let _ = tx.send(breadsearch_shared::send_request(&req)); }); - // Poll via idle_add_local until the thread delivers its result. - // Unix socket round-trips are sub-millisecond so this fires once. + // Wait for the thread's result on a bounded timer rather than + // an `idle_add_local` — an idle source has no wait condition + // of its own, so GLib re-invokes it on every single main-loop + // iteration, i.e. a busy-spin pinning a full CPU core for as + // long as the daemon takes to answer (normally sub-ms, but + // the daemon's socket has no read timeout of its own, so a + // wedged/slow daemon previously meant an indefinite spin). + // 15ms is imperceptible added latency for a search box and + // caps this at a couple dozen checks per second instead. let rx = Rc::new(rx); let list_t = list_clone.clone(); - glib::idle_add_local(move || { + glib::timeout_add_local(std::time::Duration::from_millis(15), move || { match rx.try_recv() { Ok(result) => { populate_list(&list_t, result); @@ -347,36 +320,11 @@ fn run_ui() { glib::Propagation::Stop } Key::Down => { - let cur = list_k.selected_row().map(|r| r.index()).unwrap_or(-1); - let mut i = cur + 1; - loop { - match list_k.row_at_index(i) { - Some(r) if r.is_selectable() => { - list_k.select_row(Some(&r)); - break; - } - Some(_) => i += 1, - None => break, - } - } + bread_utils::gtk_popup::select_next_visible(&list_k); glib::Propagation::Stop } Key::Up => { - let cur = list_k.selected_row().map(|r| r.index()).unwrap_or(0); - let mut i = cur - 1; - loop { - if i < 0 { - break; - } - match list_k.row_at_index(i) { - Some(r) if r.is_selectable() => { - list_k.select_row(Some(&r)); - break; - } - Some(_) => i -= 1, - None => break, - } - } + bread_utils::gtk_popup::select_prev_visible(&list_k); glib::Propagation::Stop } _ => glib::Propagation::Proceed, @@ -394,36 +342,65 @@ fn run_ui() { }); // Click outside launcher panel → close - let close_outside = Rc::clone(&close_all); - let vbox_ref = vbox.clone(); - let win_ref = window.clone(); - let outside_click = gtk4::GestureClick::new(); - outside_click.connect_pressed(move |_, _, x, y| { - if let Some(b) = vbox_ref.compute_bounds(&win_ref) { - if x < b.x() as f64 - || x > (b.x() + b.width()) as f64 - || y < b.y() as f64 - || y > (b.y() + b.height()) as f64 - { - close_outside(); - } - } - }); - window.add_controller(outside_click); + { + let close_outside = Rc::clone(&close_all); + bread_utils::gtk_popup::close_on_outside_click(&window, &vbox, move || close_outside()); + } - window.connect_destroy(|_| cleanup_pid()); + if let Some(req) = screenshot_req.clone() { + screenshot::dispatch(&window, req); + } + + window.connect_map(|_| bread_events::emit_opened()); window.present(); search.grab_focus(); }); - app.run(); + if is_screenshot_run { + // GLib's own option parser otherwise rejects --screenshot/--output + // before clap ever sees them (`Cli::parse()` already ran in `main`, + // over the real argv). + app.run_with_args(&[] as &[&str]); + } else { + app.run(); + } } // ---- Main ------------------------------------------------------------------- fn main() { - if !toggle_or_continue() { + if std::env::args().nth(1).as_deref() == Some("listen") { + listen::run(); return; } - run_ui(); + + use clap::Parser; + let cli = screenshot::Cli::parse(); + let screenshot_req = cli.screenshot_request(); + + // `toggle_or_kill` kills whatever's holding the single-instance lock — + // a real, already-running breadsearch included. A screenshot run must + // never touch it: it's a separate, disposable instance by design (same + // reasoning as breadbar's `allow_multiple_instances`), not a toggle of + // the operator's real search panel. + // + // Kept alive for the rest of `main` — dropping it releases the + // single-instance lock and removes the pid file, which happens + // naturally once `run_ui` returns (after the window closes). + let _singleton_guard = if screenshot_req.is_some() { + None + } else { + match bread_utils::singleton::toggle_or_kill("breadsearch") { + Ok(bread_utils::singleton::Toggle::Started(guard)) => Some(guard), + Ok(bread_utils::singleton::Toggle::KilledExisting) => return, + Err(e) => { + eprintln!( + "breadsearch: single-instance lock unavailable ({e}); continuing without it" + ); + None + } + } + }; + + run_ui(screenshot_req); } diff --git a/breadsearch/src/screenshot.rs b/breadsearch/src/screenshot.rs new file mode 100644 index 0000000..ad1f6ad --- /dev/null +++ b/breadsearch/src/screenshot.rs @@ -0,0 +1,93 @@ +//! `--screenshot` CLI mode: render breadsearch's search panel, capture it +//! via `bread-screenshots`, then exit — driven by `bread-ecosystem`'s +//! `bread-capture` orchestrator, or run standalone for one-off captures. +//! +//! Same reasoning as breadbox: one view ("search"), full known-size canvas +//! capture since the panel isn't its own layer surface. Captures whatever +//! the panel shows at settle time — normally the "Type to search…" empty +//! state, since there's no query to type in an automated run. + +use bread_utils::screenshot_cli::{validate_pair, DEFAULT_HEIGHT, DEFAULT_WIDTH, SETTLE_DELAY}; +use clap::Parser; +use gtk4::prelude::*; +use std::path::PathBuf; + +#[derive(Parser)] +#[command(name = "breadsearch")] +pub struct Cli { + /// Render the named view, capture it, then exit instead of running + /// normally. Known views: "search". + #[arg(long)] + pub screenshot: Option, + + /// PNG path to write the capture to. Required together with --screenshot. + #[arg(long)] + pub output: Option, + + /// Capture canvas width — matches the isolated compositor's output width + /// (`bread-capture --isolate-width`). + #[arg(long, default_value_t = DEFAULT_WIDTH)] + pub width: u32, + + /// Capture canvas height — see `width`. + #[arg(long, default_value_t = DEFAULT_HEIGHT)] + pub height: u32, +} + +#[derive(Clone)] +pub struct ScreenshotRequest { + pub view: String, + pub output: PathBuf, + pub width: u32, + pub height: u32, +} + +impl Cli { + /// `None` for a normal run. Exits the process with an error if the + /// `--screenshot` / `--output` pair is incomplete, before any GTK setup + /// happens. + pub fn screenshot_request(&self) -> Option { + if let Err(e) = validate_pair(self.screenshot.as_deref(), self.output.as_deref()) { + eprintln!("breadsearch: {e}"); + std::process::exit(1); + } + Some(ScreenshotRequest { + view: self.screenshot.clone()?, + output: self.output.clone()?, + width: self.width, + height: self.height, + }) + } +} + +/// Wire up the given view's screenshot sequence against an already-built, +/// not-yet-presented window. Every path here ends by exiting the process — +/// it never returns control to the normal search UI. +pub fn dispatch(window: >k4::ApplicationWindow, req: ScreenshotRequest) { + match req.view.as_str() { + "search" => { + let output = req.output; + let (width, height) = (req.width as i32, req.height as i32); + window.connect_map(move |_| { + let output = output.clone(); + gtk4::glib::timeout_add_local_once(SETTLE_DELAY, move || { + finish(bread_screenshots::capture_region(0, 0, width, height, &output)); + }); + }); + } + other => { + eprintln!("breadsearch: unknown screenshot view '{other}' (known: search)"); + std::process::exit(1); + } + } +} + +fn finish(result: anyhow::Result<()>) { + match result { + Ok(()) => std::process::exit(0), + Err(e) => { + eprintln!("breadsearch: screenshot capture failed: {e}"); + std::process::exit(1); + } + } +} diff --git a/ci/bread-ecosystem.rev b/ci/bread-ecosystem.rev new file mode 100644 index 0000000..34e7aa9 --- /dev/null +++ b/ci/bread-ecosystem.rev @@ -0,0 +1 @@ +147cfbbf96ae4b171027defa1130d2caddb934b1 diff --git a/ci/build.sh b/ci/build.sh new file mode 100755 index 0000000..2c71070 --- /dev/null +++ b/ci/build.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# Delegates to bread-ecosystem's shared CI build image/script, pinned to +# the commit in ci/bread-ecosystem.rev — not `main`. bread-ecosystem's CI +# files now affect every product's release pipeline, so bumping the pin +# is a deliberate act instead of silent drift (see the bread-theme test +# that broke here for exactly that reason, before it was pinned by rev). +# +# Usage: ci/build.sh cargo build --release --locked +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +REV="$(cat "${ROOT}/ci/bread-ecosystem.rev")" + +CACHE_DIR="/tmp/bread-ecosystem-ci-${REV}" +if [ ! -d "$CACHE_DIR" ]; then + rm -rf /tmp/bread-ecosystem-ci-* + git clone https://git.breadway.dev/Breadway/bread-ecosystem.git "$CACHE_DIR" + git -C "$CACHE_DIR" checkout --quiet "$REV" +fi + +bash "${CACHE_DIR}/ci/build.sh" breadsearch "$ROOT" "$@" diff --git a/packaging/breadmill.service b/packaging/breadmill.service index 70f81e6..e6ade17 100644 --- a/packaging/breadmill.service +++ b/packaging/breadmill.service @@ -1,14 +1,16 @@ [Unit] Description=Breadmill semantic search indexer -Documentation=https://github.com/breadway/breadsearch +Documentation=https://git.breadway.dev/Breadway/breadsearch After=default.target [Service] Type=simple -# Uncomment if built with --features rocm: persists MIGraphX's compiled-kernel -# cache across restarts (each new sequence length otherwise costs a ~60-120s -# recompile). See README.md#gpu-backend-notes. -#Environment=ORT_MIGRAPHX_MODEL_CACHE_PATH=%h/.cache/breadsearch/migraphx-cache +# Required (not just a perf tweak) when backend = "rocm": without a valid +# cache dir, ONNX Runtime's MIGraphX EP reads an uninitialized cache path and +# crashes on the first query instead of just recompiling every restart. Inert +# for cpu/npu/cuda/openvino backends (openvino's cache dir is set in code, +# not via env var). See README.md#gpu-backend-notes. +Environment=ORT_MIGRAPHX_MODEL_CACHE_PATH=%h/.cache/breadsearch/migraphx-cache ExecStart=%h/.cargo/bin/breadmill Restart=on-failure RestartSec=5