diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..ad3872d --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -0,0 +1,141 @@ +name: ci + +on: + push: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +env: + CI: "true" + CARGO_TERM_COLOR: always + +jobs: + portable-quality: + name: Portable quality checks + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 11.9.0 + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: pnpm + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@1.97.1 + with: + components: rustfmt, clippy + + - name: Install Linux Tauri prerequisites + shell: bash + run: | + if command -v sudo >/dev/null 2>&1; then + SUDO=sudo + else + SUDO= + fi + $SUDO apt-get update + $SUDO apt-get install -y \ + libwebkit2gtk-4.1-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + libxdo-dev \ + libssl-dev \ + patchelf + + - name: Install JavaScript dependencies + run: pnpm install --frozen-lockfile + + - name: Run frontend checks + run: pnpm check:frontend + + - name: Install Playwright Chromium + run: pnpm exec playwright install chromium + + - name: Run browser smoke tests + run: pnpm test:e2e + + - name: Run workspace package tests + run: pnpm -r --if-present run test + + - name: Check Rust formatting + run: pnpm rust:fmt + + - name: Run Rust Clippy + run: pnpm rust:clippy + + - name: Run Rust tests + run: pnpm rust:test + + - name: Run Rust check + run: pnpm rust:check + + windows-tauri: + name: Windows Tauri build + if: vars.ENABLE_WINDOWS_TAURI_CI == 'true' + runs-on: windows-latest + timeout-minutes: 45 + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 11.9.0 + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: pnpm + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@1.97.1 + with: + components: rustfmt, clippy + + - name: Install JavaScript dependencies + run: pnpm install --frozen-lockfile + + - name: Run frontend checks + run: pnpm check:frontend + + - name: Install Playwright Chromium + run: pnpm exec playwright install chromium + + - name: Run browser smoke tests + run: pnpm test:e2e + + - name: Run workspace package tests + run: pnpm -r --if-present run test + + - name: Check Rust formatting + run: pnpm rust:fmt + + - name: Run Rust Clippy + run: pnpm rust:clippy + + - name: Run Rust tests + run: pnpm rust:test + + - name: Run Rust check + run: pnpm rust:check + + - name: Build Tauri application + run: pnpm tauri:build diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..1dd37d5 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +24.17.0 diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..987464a --- /dev/null +++ b/.npmrc @@ -0,0 +1,6 @@ +save-exact=true +strict-peer-dependencies=true +auto-install-peers=false +enable-global-virtual-store=false +node-linker=hoisted +package-import-method=copy diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..dbb7715 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,11 @@ +node_modules +dist +coverage +src-tauri/target +packages/*/dist +pnpm-lock.yaml +AGENTS.md +AstrBot_Desktop_Codex_Forgejo_Predevelopment_Workflow.md +docs/01_Architecture_Design.md +docs/02_Codex_Implementation_Tasks.md +docs/protocol/v1/schemas diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a089a03 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,26 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow Semantic Versioning. + +## [Unreleased] + +### Added + +- Authoritative architecture, implementation, and repository workflow documents. +- Repository rules, ignore rules, implementation plan, progress tracking, and decision log. +- Tauri 2, React, TypeScript, Vite, and Rust workspace skeleton with tray and single-instance lifecycle. +- Independent companion and operations REST/SSE clients with local profile binding, cancellation, reconnect, Last-Event-ID, and per-slot deduplication. +- Windows Credential Manager, bounded UI Automation, selected-window in-memory capture, Event Log, process, port, foreground-window, authorized log-tail, configuration parsing, and redaction Spikes. +- Recoverable plan/dry-run/copy/verify/commit file transactions with no-overwrite conflict policies and source preservation. +- Composite-key SQLite isolation for profile, server, conversation, message, cursor, proposal, and transaction data. +- Provisional desktop-v1alpha1 Rust types, TypeScript exports, ten JSON Schemas, drift checks, and two loopback-only Mock Gateway instances. +- Frontend, browser, Rust, integration, Windows provider, soak, and Forgejo CI test entry points. +- P00 dependency review and durable Spike result records. + +### Security + +- Kept credentials and native capabilities in Rust; the React capability set remains `core:default` only. +- Added secret redaction and repository scans; no arbitrary PowerShell, CMD, shell, input-injection, registry-write, or unrestricted filesystem API is exposed. +- Kept real UNC writes, signing keys, updater keys, and release secrets outside P00. diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..0f0997c --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,6029 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e76a019e91224d279006ff972f1e984179a6e9feb050adba6ce8274aef23195" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[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.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" + +[[package]] +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + +[[package]] +name = "astrbot-desktop" +version = "0.1.0-alpha.0" +dependencies = [ + "desktop-protocol", + "eventsource-stream", + "futures-util", + "mock-gateway", + "png 0.18.1", + "quick-xml", + "regex", + "reqwest", + "rusqlite", + "secrecy", + "serde", + "serde_json", + "sha2 0.11.0", + "sysinfo", + "tauri", + "tauri-build", + "tauri-plugin-single-instance", + "tempfile", + "thiserror 2.0.18", + "time", + "tokio", + "tokio-util", + "toml 1.1.3+spec-1.1.0", + "tracing", + "tracing-subscriber", + "url", + "uuid", + "windows 0.61.3", + "yaml-rust2", + "zeroize", +] + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "pin-project-lite", + "slab", +] + +[[package]] +name = "async-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" +dependencies = [ + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-lock" +version = "3.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "async-signal" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "atk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" +dependencies = [ + "atk-sys", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "aws-lc-rs" +version = "1.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00bdb5da18dac48ca2cc7cd4a98e533e8635a58e2361d13a1a4ee3888e0d72f1" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43103168cc76fe62678a375e722fc9cb3a0146159ac5828bc4f0dfd755c2224c" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", + "pkg-config", +] + +[[package]] +name = "axum" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" +dependencies = [ + "axum-core", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde_core", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" +dependencies = [ + "serde_core", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2", +] + +[[package]] +name = "blocking" +version = "1.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + +[[package]] +name = "brotli" +version = "8.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc91aac060a7a1e25823bdccbfb6af1875b88f17c6daac97894eed8207166b3" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "5.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a32acac15fe1967bc3986b2a6347dffc965602354ea6f450ad07e8bfd253583" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "bytemuck" +version = "1.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6aedf8ae72766347502cf3cb4f41cf5e9cc37d28bee90f1fdaaae15f9cf9424" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" +dependencies = [ + "serde", +] + +[[package]] +name = "cairo-rs" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" +dependencies = [ + "bitflags 2.13.1", + "cairo-sys-rs", + "glib", + "libc", + "once_cell", + "thiserror 1.0.69", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "camino" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f2d30e4173c4026932d51d31d6b0613b1fd3014bf3f9f8943d4ba139c437ba0" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 2.0.18", +] + +[[package]] +name = "cargo_toml" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" +dependencies = [ + "serde", + "toml 0.9.12+spec-1.1.0", +] + +[[package]] +name = "cc" +version = "1.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + +[[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", +] + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "num-traits", + "serde", + "windows-link 0.2.1", +] + +[[package]] +name = "clap" +version = "4.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd059f9da4f5c36b3787f65d38ccaab1cc315f07b01f89abc8359ee6a8205011" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09628afdcc538b57f3c6341e9c8e9970f18e4a481690a64974d7023bd33548b" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-oid" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" + +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "time", + "version_check", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" +dependencies = [ + "bitflags 2.13.1", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +dependencies = [ + "bitflags 2.13.1", + "core-foundation", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +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 = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d85363c37faeca707aef026efa9f3b34d077bce547e48f770770625c6013679e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-common" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "cssparser" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "phf", + "smallvec", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "ctor" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "352d39c2f7bef1d6ad73db6f5160efcaed66d94ef8c6c573a8410c00bf909a98" +dependencies = [ + "ctor-proc-macro", + "dtor", +] + +[[package]] +name = "ctor-proc-macro" +version = "0.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1" + +[[package]] +name = "darling" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.119", +] + +[[package]] +name = "darling_macro" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "dbus" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab69f03cc8c4340c9c8e315114e1658e6775a9b16a04357973aa21cec22b32e" +dependencies = [ + "libc", + "libdbus-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "serde_core", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.119", +] + +[[package]] +name = "desktop-protocol" +version = "0.1.0-alpha.0" +dependencies = [ + "schemars 1.2.1", + "serde", + "serde_json", + "thiserror 2.0.18", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common 0.1.7", +] + +[[package]] +name = "digest" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" +dependencies = [ + "block-buffer 0.12.1", + "const-oid", + "crypto-common 0.2.2", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", +] + +[[package]] +name = "dispatch2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" +dependencies = [ + "bitflags 2.13.1", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "displaydoc" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "dlopen2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbbb781877580993a8707ec48672673ec7b81eeba04cfd2310bd28c08e47c8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "dom_query" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521e380c0c8afb8d9a1e83a1822ee03556fc3e3e7dbc1fd30be14e37f9cb3f89" +dependencies = [ + "bit-set", + "cssparser", + "foldhash", + "html5ever", + "precomputed-hash", + "selectors", + "tendril", +] + +[[package]] +name = "dpi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" +dependencies = [ + "serde", +] + +[[package]] +name = "dtoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dtor" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1057d6c64987086ff8ed0fd3fbf377a6b7d205cc7715868cd401705f715cbe4" +dependencies = [ + "dtor-proc-macro", +] + +[[package]] +name = "dtor-proc-macro" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5" + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "embed-resource" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbfdaacccebec3b28e4866b8973543c7647797db5ada1bdab552e48fe665fbbd" +dependencies = [ + "cc", + "memchr", + "rustc_version", + "toml 1.1.3+spec-1.1.0", + "vswhom", + "winreg", +] + +[[package]] +name = "embed_plist" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "endi" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" + +[[package]] +name = "enumflags2" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "event-listener" +version = "5.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "eventsource-stream" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74fef4569247a5f429d9156b9d0a2599914385dd189c539334c625d8099d90ab" +dependencies = [ + "futures-core", + "nom", + "pin-project-lite", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "fastrand" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-lite" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "gdk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", + "once_cell", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkwayland-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkx11" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" +dependencies = [ + "gdk", + "gdkx11-sys", + "gio", + "glib", + "libc", + "x11", +] + +[[package]] +name = "gdkx11-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps", + "x11", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 6.0.0", + "rand_core", + "wasm-bindgen", +] + +[[package]] +name = "gio" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "once_cell", + "pin-project-lite", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "gio-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "winapi", +] + +[[package]] +name = "glib" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" +dependencies = [ + "bitflags 2.13.1", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "glib-macros" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 2.0.2", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "glib-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "gobject-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" +dependencies = [ + "atk", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk3-macros" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashlink" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824e001ac4f3012dd16a264bec811403a67ca9deb6c102fc5049b32c4574b35f" +dependencies = [ + "hashbrown 0.16.1", +] + +[[package]] +name = "hashlink" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32069d97bb81e38fa67eab65e3393bf804bb85969f2bc06bf13f64aef5aba248" +dependencies = [ + "hashbrown 0.17.1", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "html5ever" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1054432bae2f14e0061e33d23402fbaa67a921d319d56adc6bcf887ddad1cbc2" +dependencies = [ + "log", + "markup5ever", +] + +[[package]] +name = "http" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f41fd6a08e4d4ec69df65976da761afd5ad5e58a9d4acb46bd1c953a9e3ff2" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hybrid-array" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "818356c5132c1fede50f837ca96afbe78ff42413047f4abb886217845e1b6c8c" +dependencies = [ + "typenum", +] + +[[package]] +name = "hyper" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55281c53a1894c864990125767da440a4e630446785086f52523b20033b74498" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.62.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ico" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371" +dependencies = [ + "byteorder", + "png 0.17.16", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", + "serde", + "serde_core", +] + +[[package]] +name = "infer" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" +dependencies = [ + "cfb", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "javascriptcore-rs" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" +dependencies = [ + "bitflags 1.3.2", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys 0.4.1", + "log", + "simd_cesu8", + "thiserror 2.0.18", + "walkdir", + "windows-link 0.2.1", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn 2.0.119", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "jobserver" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" +dependencies = [ + "getrandom 0.4.3", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" +dependencies = [ + "jsonptr", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "jsonptr" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dea2b27dd239b2556ed7a25ba842fe47fd602e7fc7433c2a8d6106d4d9edd70" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "keyboard-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" +dependencies = [ + "bitflags 2.13.1", + "serde", + "unicode-segmentation", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libappindicator" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "libappindicator-sys", + "log", +] + +[[package]] +name = "libappindicator-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" +dependencies = [ + "gtk-sys", + "libloading", + "once_cell", +] + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libdbus-sys" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "328c4789d42200f1eeec05bd86c9c13c7f091d2ba9a6ea35acdf51f31bc0f043" +dependencies = [ + "pkg-config", +] + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libredox" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c943259e342f1e06ff2da7a83eabdfe7f92ce10262688dbf1895ff0b3e6e4652" +dependencies = [ + "libc", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c19a05435c21ac299d71b6a9c13db3e3f47c520517d58990a462a1397a61db" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "markup5ever" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8983d30f2915feeaaab2d6babdd6bc7e9ed1a00b66b5e6d74df19aa9c0e91862" +dependencies = [ + "log", + "tendril", + "web_atoms", +] + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "mock-gateway" +version = "0.1.0-alpha.0" +dependencies = [ + "async-stream", + "axum", + "clap", + "desktop-protocol", + "reqwest", + "serde_json", + "thiserror 2.0.18", + "tokio", + "tokio-util", + "uuid", +] + +[[package]] +name = "muda" +version = "0.19.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd04e60bc0b07438a6771710ee1698f98f6ebbc7f89b61264af1563b8aeb878" +dependencies = [ + "crossbeam-channel", + "dpi", + "gtk", + "keyboard-types", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "once_cell", + "png 0.18.1", + "serde", + "thiserror 2.0.18", + "windows-sys 0.61.2", +] + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.13.1", + "jni-sys 0.3.1", + "log", + "ndk-sys", + "num_enum", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys 0.3.1", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "ntapi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-conv" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "objc2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" +dependencies = [ + "objc2-encode", + "objc2-exception-helper", +] + +[[package]] +name = "objc2-app-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" +dependencies = [ + "bitflags 2.13.1", + "block2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-cloud-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" +dependencies = [ + "bitflags 2.13.1", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-data" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags 2.13.1", + "dispatch2", + "objc2", +] + +[[package]] +name = "objc2-core-graphics" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" +dependencies = [ + "bitflags 2.13.1", + "dispatch2", + "objc2", + "objc2-core-foundation", + "objc2-io-surface", +] + +[[package]] +name = "objc2-core-image" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-location" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca347214e24bc973fc025fd0d36ebb179ff30536ed1f80252706db19ee452009" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-text" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" +dependencies = [ + "bitflags 2.13.1", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-exception-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" +dependencies = [ + "cc", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +dependencies = [ + "bitflags 2.13.1", + "block2", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-io-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33fafba39597d6dc1fb709123dfa8289d39406734be322956a69f0931c73bb15" +dependencies = [ + "libc", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-io-surface" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" +dependencies = [ + "bitflags 2.13.1", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-open-directory" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb82bed227edf5201dfedf072bba4015a33d3d4a98519837295a90f0a23f676d" +dependencies = [ + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" +dependencies = [ + "bitflags 2.13.1", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" +dependencies = [ + "bitflags 2.13.1", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-core-image", + "objc2-core-location", + "objc2-core-text", + "objc2-foundation", + "objc2-quartz-core", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-web-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" +dependencies = [ + "bitflags 2.13.1", + "block2", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "once_cell" +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 = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "pango" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" +dependencies = [ + "gio", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link 0.2.1", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "phf" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_macros", + "phf_shared", + "serde", +] + +[[package]] +name = "phf_codegen" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +dependencies = [ + "fastrand", + "phf_shared", +] + +[[package]] +name = "phf_macros" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "phf_shared" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "piper" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + +[[package]] +name = "plist" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da1d65da6dd5d1e44199ac0f58712d241c0f439f80adea8924d832384087f85" +dependencies = [ + "base64 0.22.1", + "indexmap 2.14.0", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "png" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" +dependencies = [ + "bitflags 2.13.1", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "polling" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.13+spec-1.1.0", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-xml" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1" +dependencies = [ + "memchr", +] + +[[package]] +name = "quinn" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c1a41e437b6bbd489372cd4971de128e85c855f56c57f283d20ff016cf7c0a8" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4bfc015262b9df63c8845072ce59068853ff5872180c2ce2f13038b970e560" +dependencies = [ + "aws-lc-rs", + "bytes", + "getrandom 0.4.3", + "lru-slab", + "rand", + "rand_pcg", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35a133f956daabe89a61a685c2649f13d82d5aa4bd5d12d1277e1072a21c0694" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.61.2", +] + +[[package]] +name = "quote" +version = "1.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[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", +] + +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "rand_pcg" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a" +dependencies = [ + "rand_core", +] + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.13.1", +] + +[[package]] +name = "redox_users" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +dependencies = [ + "getrandom 0.2.17", + "libredox", + "thiserror 2.0.18", +] + +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "reqwest" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "serde", + "serde_json", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rsqlite-vfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51c9ae4df8a7fba42103df5c621fa3c37eccf3a3c650879e90fc48b11cc192c" +dependencies = [ + "hashbrown 0.16.1", + "thiserror 2.0.18", +] + +[[package]] +name = "rusqlite" +version = "0.40.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11438310b19e3109b6446c33d1ed5e889428cf2e278407bc7896bc4aaea43323" +dependencies = [ + "bitflags 2.13.1", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink 0.12.1", + "libsqlite3-sys", + "smallvec", + "sqlite-wasm-rs", +] + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags 2.13.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c54fcab019b409d04215d3a17cb438fd7fbf192ee61461f20f4fe18704bc138" +dependencies = [ + "aws-lc-rs", + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pki-types" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "764899a24af3980067ee14bc143654f297b22eaebfe3c7b6b211920a5a59b046" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni 0.22.4", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + +[[package]] +name = "rustls-webpki" +version = "0.103.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "indexmap 1.9.3", + "schemars_derive 0.8.22", + "serde", + "serde_json", + "url", + "uuid", +] + +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" +dependencies = [ + "dyn-clone", + "ref-cast", + "schemars_derive 1.2.1", + "serde", + "serde_json", + "uuid", +] + +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.119", +] + +[[package]] +name = "schemars_derive" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d115b50f4aaeea07e79c1912f645c7513d81715d0420f8bc77a18c6260b307f" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.119", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "secrecy" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags 2.13.1", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "selectors" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5d9c0c92a92d33f08817311cf3f2c29a3538a8240e94a6a3c622ce652d7e00c" +dependencies = [ + "bitflags 2.13.1", + "cssparser", + "derive_more", + "log", + "new_debug_unreachable", + "phf", + "phf_codegen", + "precomputed-hash", + "rustc-hash", + "servo_arc", + "smallvec", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-untagged" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" +dependencies = [ + "erased-serde", + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "serde_json" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a5c54c7310e7b8b9577c286d7e399ddd876c3e12b3ed917a8aabc4b96e9e8c" +dependencies = [ + "base64 0.22.1", + "bs58", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.14.0", + "schemars 0.9.0", + "schemars 1.2.1", + "serde_core", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d57bc0c8b9a17920c178daa6bb924850d54a9c97ab45194bb8c17ad66bb660" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "serialize-to-javascript" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" +dependencies = [ + "serde", + "serde_json", + "serialize-to-javascript-impl", +] + +[[package]] +name = "serialize-to-javascript-impl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "servo_arc" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "digest 0.11.3", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" + +[[package]] +name = "simd_cesu8" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" +dependencies = [ + "rustc_version", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "siphasher" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" + +[[package]] +name = "socket2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "softbuffer" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3" +dependencies = [ + "bytemuck", + "js-sys", + "ndk", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "objc2-quartz-core", + "raw-window-handle", + "redox_syscall", + "tracing", + "wasm-bindgen", + "web-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "soup3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" +dependencies = [ + "futures-channel", + "gio", + "glib", + "libc", + "soup3-sys", +] + +[[package]] +name = "soup3-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "sqlite-wasm-rs" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc3efc0da82635d7e1ced0053bbbfa8c7ab9645d0bf36ceb4f7127bb85315d75" +dependencies = [ + "cc", + "js-sys", + "rsqlite-vfs", + "wasm-bindgen", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "string_cache" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared", + "precomputed-hash", +] + +[[package]] +name = "string_cache_codegen" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "swift-rs" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4057c98e2e852d51fdcfca832aac7b571f6b351ad159f9eda5db1655f8d0c4d7" +dependencies = [ + "base64 0.21.7", + "serde", + "serde_json", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "sysinfo" +version = "0.39.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2071df9448915b71c4fe6d25deaf1c22f12bd234f01540b77312bb8e41361e6" +dependencies = [ + "libc", + "memchr", + "ntapi", + "objc2-core-foundation", + "objc2-io-kit", + "objc2-open-directory", + "windows 0.62.2", +] + +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck 0.5.0", + "pkg-config", + "toml 0.8.2", + "version-compare", +] + +[[package]] +name = "tao" +version = "0.35.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1c93047acf68669466a34690ac58cca7010bd1b201e1ec86f1fd0a75d3dd4a9" +dependencies = [ + "bitflags 2.13.1", + "block2", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dbus", + "dispatch2", + "dlopen2", + "dpi", + "gdkwayland-sys", + "gdkx11-sys", + "gtk", + "jni 0.21.1", + "libc", + "log", + "ndk", + "ndk-sys", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "once_cell", + "parking_lot", + "percent-encoding", + "raw-window-handle", + "tao-macros", + "unicode-segmentation", + "url", + "windows 0.61.3", + "windows-core 0.61.2", + "windows-version", + "x11-dl", +] + +[[package]] +name = "tao-macros" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tauri" +version = "2.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "667b20e2726d572dea2de7370da16e188eb06008faf9a92fab7cdc46791190b5" +dependencies = [ + "anyhow", + "bytes", + "cookie", + "dirs", + "dunce", + "embed_plist", + "getrandom 0.3.4", + "glob", + "gtk", + "heck 0.5.0", + "http", + "jni 0.21.1", + "libc", + "log", + "mime", + "muda", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "percent-encoding", + "plist", + "raw-window-handle", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "swift-rs", + "tauri-build", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", + "tauri-utils", + "thiserror 2.0.18", + "tokio", + "tray-icon", + "url", + "webkit2gtk", + "webview2-com", + "window-vibrancy", + "windows 0.61.3", +] + +[[package]] +name = "tauri-build" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9ce40b16101cb6ea63d3e221567affd1c3a9205f95d7bc574941a10636b632" +dependencies = [ + "anyhow", + "cargo_toml", + "dirs", + "glob", + "heck 0.5.0", + "json-patch", + "schemars 0.8.22", + "semver", + "serde", + "serde_json", + "tauri-utils", + "tauri-winres", + "walkdir", +] + +[[package]] +name = "tauri-codegen" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08279169ff42f8fc45a1dbc9dcae888893ba95288142e5880c59b93a26d2cfc5" +dependencies = [ + "base64 0.22.1", + "brotli", + "ico", + "json-patch", + "plist", + "png 0.17.16", + "proc-macro2", + "quote", + "semver", + "serde", + "serde_json", + "sha2 0.10.9", + "syn 2.0.119", + "tauri-utils", + "thiserror 2.0.18", + "time", + "url", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-macros" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8b394794f399a421811d06966343e7933fcae92d59f5180b9388d1174497a45" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.119", + "tauri-codegen", + "tauri-utils", +] + +[[package]] +name = "tauri-plugin-single-instance" +version = "2.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3214becf9ef5783c0ae99a3bb25adf5353a7a16ebf53e74b909e29205735c6c" +dependencies = [ + "serde", + "serde_json", + "tauri", + "thiserror 2.0.18", + "tokio", + "tracing", + "windows-sys 0.60.2", + "zbus", +] + +[[package]] +name = "tauri-runtime" +version = "2.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0b4bc95aed361b0019067d189a1174a603d460d0f6c72606512d59fc9c12ec8" +dependencies = [ + "cookie", + "dpi", + "gtk", + "http", + "jni 0.21.1", + "objc2", + "objc2-ui-kit", + "objc2-web-kit", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror 2.0.18", + "url", + "webkit2gtk", + "webview2-com", + "windows 0.61.3", +] + +[[package]] +name = "tauri-runtime-wry" +version = "2.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e6fac707727b7a2f48e4ded90976324267371073edbb415ffb73bb0458d203f" +dependencies = [ + "gtk", + "http", + "jni 0.21.1", + "log", + "objc2", + "objc2-app-kit", + "once_cell", + "percent-encoding", + "raw-window-handle", + "softbuffer", + "tao", + "tauri-runtime", + "tauri-utils", + "url", + "webkit2gtk", + "webview2-com", + "windows 0.61.3", + "wry", +] + +[[package]] +name = "tauri-utils" +version = "2.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e176a18e67764923c4f1ce66f25ae4abe5f688384d5eb1a0fa6c77f3d90f887" +dependencies = [ + "anyhow", + "brotli", + "cargo_metadata", + "ctor", + "dom_query", + "dunce", + "glob", + "http", + "infer", + "json-patch", + "log", + "memchr", + "phf", + "plist", + "proc-macro2", + "quote", + "regex", + "schemars 0.8.22", + "semver", + "serde", + "serde-untagged", + "serde_json", + "serde_with", + "swift-rs", + "thiserror 2.0.18", + "toml 1.1.3+spec-1.1.0", + "url", + "urlpattern", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-winres" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc65d45c68858bfe420dd29e834b5d15dbecf8a07a8a16cf4d532c7b1f69d4b6" +dependencies = [ + "dunce", + "embed-resource", + "toml 1.1.3+spec-1.1.0", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.3", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "tendril" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fed54709c5b3a53d09bb1c113ea4f5ceafd1e772ddcb0030a82e1d56c087b08" +dependencies = [ + "new_debug_unreachable", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "thread_local" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18dfaaeddcb932337b5e7866ee7d0ce9b76d2fd092997146f187ec09b4558a50" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" + +[[package]] +name = "time-macros" +version = "0.2.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c431b87111666e491a90baa837f914fb45cd5dc3c268591b0220ff5057f2085f" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d988bcd52dbe076d3d46903332f58c912b87a2c49b1428419a5845154762ffee" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6328af13490e73a9b4694030fafd93f8c8c6a9dede33e821c3fc63eddf8042ba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "futures-util", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "toml" +version = "0.9.12+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" +dependencies = [ + "indexmap 2.14.0", + "serde_core", + "serde_spanned 1.1.1", + "toml_datetime 0.7.5+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 0.7.15", +] + +[[package]] +name = "toml" +version = "1.1.3+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c96ecdfa941c8fc4fcaed14f99ada8ebed502eef533015095a07e3301d4c3c" +dependencies = [ + "indexmap 2.14.0", + "serde_core", + "serde_spanned 1.1.1", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 1.0.4", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.14.0", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap 2.14.0", + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.25.13+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6975367e4d2ef766d86af01ffad14b622fecc8d4357a998fbc4deb6e9bacaf9b" +dependencies = [ + "indexmap 2.14.0", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "winnow 1.0.4", +] + +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow 1.0.4", +] + +[[package]] +name = "toml_writer" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2" + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags 2.13.1", + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "url", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "tray-icon" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65ba1e5f6b9ef9fd87e21b9c6f351554dbd717960089168fcfdef854686961dc" +dependencies = [ + "crossbeam-channel", + "dirs", + "libappindicator", + "muda", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "once_cell", + "png 0.18.1", + "serde", + "thiserror 2.0.18", + "windows-sys 0.61.2", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "uds_windows" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" +dependencies = [ + "memoffset", + "tempfile", + "windows-sys 0.61.2", +] + +[[package]] +name = "unic-char-property" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" +dependencies = [ + "unic-char-range", +] + +[[package]] +name = "unic-char-range" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" + +[[package]] +name = "unic-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" + +[[package]] +name = "unic-ucd-ident" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-version" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" +dependencies = [ + "unic-common", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", + "serde_derive", +] + +[[package]] +name = "urlpattern" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70acd30e3aa1450bc2eece896ce2ad0d178e9c079493819301573dae3c37ba6d" +dependencies = [ + "regex", + "serde", + "unic-ucd-ident", + "url", +] + +[[package]] +name = "utf8_iter" +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 = "uuid" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf3923a6f5c4c6382e0b653c4117f48d631ea17f38ed86e2a828e6f7412f5239" +dependencies = [ + "getrandom 0.4.3", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version-compare" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.119", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web_atoms" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "075474b12bcb3d2e3d4546580e9de478eeeead668a1761e2a8860c836b7ef297" +dependencies = [ + "phf", + "phf_codegen", + "string_cache", + "string_cache_codegen", +] + +[[package]] +name = "webkit2gtk" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup3", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pkg-config", + "soup3-sys", + "system-deps", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d46a5a140e6f7afeccd8eae97eff335163939eac8b929834875168b29b3d267" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "webview2-com" +version = "0.38.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7130243a7a5b33c54a444e54842e6a9e133de08b5ad7b5861cd8ed9a6a5bc96a" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows 0.61.3", + "windows-core 0.61.2", + "windows-implement", + "windows-interface", +] + +[[package]] +name = "webview2-com-macros" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a921c1b6914c367b2b823cd4cde6f96beec77d30a939c8199bb377cf9b9b54" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "webview2-com-sys" +version = "0.38.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "381336cfffd772377d291702245447a5251a2ffa5bad679c99e61bc48bacbf9c" +dependencies = [ + "thiserror 2.0.18", + "windows 0.61.3", + "windows-core 0.61.2", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "window-vibrancy" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9bec5a31f3f9362f2258fd0e9c9dd61a9ca432e7306cc78c444258f0dce9a9c" +dependencies = [ + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "raw-window-handle", + "windows-sys 0.59.0", + "windows-version", +] + +[[package]] +name = "windows" +version = "0.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections 0.2.0", + "windows-core 0.61.2", + "windows-future 0.2.1", + "windows-link 0.1.3", + "windows-numerics 0.2.0", +] + +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections 0.3.2", + "windows-core 0.62.2", + "windows-future 0.3.2", + "windows-numerics 0.3.1", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core 0.62.2", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.1.3", + "windows-result 0.3.4", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", + "windows-threading 0.1.0", +] + +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core 0.62.2", + "windows-link 0.2.1", + "windows-threading 0.2.1", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core 0.62.2", + "windows-link 0.2.1", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link 0.2.1", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" + +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.55.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb5a765337c50e9ec252c2069be9bf91c7df47afb103b642ba3a53bf8101be97" +dependencies = [ + "cfg-if", + "windows-sys 0.59.0", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "wry" +version = "0.55.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186f9871daa55fd9c016578b810d149de58367113db7fb72b462d2323ce19514" +dependencies = [ + "base64 0.22.1", + "block2", + "cookie", + "crossbeam-channel", + "dirs", + "dom_query", + "dpi", + "dunce", + "gdkx11", + "gtk", + "http", + "javascriptcore-rs", + "jni 0.21.1", + "libc", + "ndk", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "once_cell", + "percent-encoding", + "raw-window-handle", + "sha2 0.10.9", + "soup3", + "tao-macros", + "thiserror 2.0.18", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows 0.61.3", + "windows-core 0.61.2", + "windows-version", + "x11-dl", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "yaml-rust2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "631a50d867fafb7093e709d75aaee9e0e0d5deb934021fcea25ac2fe09edc51e" +dependencies = [ + "arraydeque", + "encoding_rs", + "hashlink 0.11.1", +] + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zbus" +version = "5.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe18fb60dc696039e738717b76eaea21e7a4489bbb1885020b43c94236d7e98a" +dependencies = [ + "async-broadcast", + "async-executor", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-lite", + "hex", + "libc", + "ordered-stream", + "rustix", + "serde", + "serde_repr", + "tracing", + "uds_windows", + "uuid", + "windows-sys 0.61.2", + "winnow 1.0.4", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe96480bed92df2b442a1a30df364e12d08eed03aeb061f2b8dc6afb2be91119" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.119", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8bf88b4a3ff53e883001e0e0115b297a9d53c31b9c1edd2bfdd853e3428624e" +dependencies = [ + "serde", + "winnow 1.0.4", + "zvariant", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" + +[[package]] +name = "zvariant" +version = "5.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee2a0bcd2a907786a456fff45aaaaf54c9ba5f50b71ae9ec1a4edd200c94911" +dependencies = [ + "endi", + "enumflags2", + "serde", + "winnow 1.0.4", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38a708216a18780796770bfe3f4739c7c83a3e8f789b755534bbbc06e4e23e12" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.119", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90cb9383f9b45290407a1258b202d3f8f01db719eb60b4e4055c6375af4fc7c7" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "syn 2.0.119", + "winnow 1.0.4", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..9789c67 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,46 @@ +[workspace] +members = [ + "src-tauri", + "crates/desktop-protocol", + "crates/mock-gateway", +] +resolver = "3" + +[workspace.package] +version = "0.1.0-alpha.0" +edition = "2024" +rust-version = "1.97.1" +license = "MIT OR Apache-2.0" + +[workspace.dependencies] +axum = "0.8.9" +clap = { version = "4.6.2", features = ["derive"] } +eventsource-stream = "0.2.3" +futures-util = "0.3.32" +png = "0.18.1" +quick-xml = "0.41.0" +regex = "1.13.1" +reqwest = { version = "0.13.4", default-features = false, features = ["json", "rustls", "stream"] } +rusqlite = { version = "0.40.1", features = ["bundled"] } +schemars = { version = "1.2.1", features = ["uuid1"] } +secrecy = "0.10.3" +serde = { version = "1.0.228", features = ["derive"] } +serde_json = "1.0.150" +sha2 = "0.11.0" +sysinfo = "0.39.6" +tauri = { version = "2.11.5", features = ["tray-icon"] } +tauri-build = "2.6.3" +tempfile = "3.27.0" +thiserror = "2.0.18" +time = { version = "0.3.53", features = ["formatting", "serde"] } +tokio = { version = "1.53.0", features = ["macros", "net", "rt-multi-thread", "sync", "time"] } +tokio-util = "0.7.18" +toml = "1.1.3" +tracing = "0.1.44" +tracing-subscriber = { version = "0.3.23", features = ["env-filter", "fmt"] } +ts-rs = { version = "12.0.1", features = ["uuid-impl"] } +url = "2.5.8" +uuid = { version = "1.24.0", features = ["serde", "v4"] } +windows = "0.61.3" +yaml-rust2 = "0.11.0" +zeroize = "1.9.0" diff --git a/README.md b/README.md new file mode 100644 index 0000000..fdb9bff --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ +# AstrBot Desktop + +AstrBot Desktop is a Windows companion and local-assistance client built with Tauri 2, React, TypeScript, Vite, and Rust. + +The MVP supports two isolated active AstrBot connection slots: + +- `companion` for chat, proactive messages, voice, and game companionship; +- `operations` for user-authorized, policy-controlled diagnostics and recoverable file operations. + +## Security boundaries + +- Credentials remain in Windows secure storage and are never exposed to React. +- Server tool requests are proposals; the Rust policy layer makes the final decision. +- The application does not provide arbitrary PowerShell, CMD, or shell execution. +- NAS transfers use `plan -> dry run -> copy -> verify -> commit` and preserve source files on failure. + +## Current phase + +The repository is in the P00 bootstrap and high-risk Spike phase. See [docs/implementation-plan.md](docs/implementation-plan.md) and [docs/progress.md](docs/progress.md). + +## Authoritative documents + +- `AGENTS.md` +- `docs/01_Architecture_Design.md` +- `docs/02_Codex_Implementation_Tasks.md` +- `AstrBot_Desktop_Codex_Forgejo_Predevelopment_Workflow.md` + +## Development prerequisites + +- Windows 11 +- Node.js and pnpm +- Rust stable with the MSVC target +- Visual Studio 2022 Build Tools with Desktop development with C++ +- WebView2 Evergreen Runtime + +## Local commands + +```text +pnpm install --frozen-lockfile +pnpm check:frontend +pnpm test:e2e +pnpm rust:fmt +pnpm rust:clippy +pnpm rust:test +pnpm rust:check +pnpm tauri:dev +pnpm tauri:build +``` + +On Windows, Cargo build output can be redirected away from a NAS workspace: + +```powershell +$env:CARGO_TARGET_DIR = "$env:LOCALAPPDATA\Temp\AstrBot-Desktop-target" +``` + +The 30-minute connection soak and the controlled Windows UIA/capture smoke are +ignored by the normal suite and must be invoked explicitly as documented in +[tests/README.md](tests/README.md). The UIA/capture smoke opens only a generated, +non-sensitive standard dialog and never writes captured pixels to disk. + +P00 results and unresolved environment boundaries are recorded in +[docs/spikes](docs/spikes) and [docs/progress.md](docs/progress.md). diff --git a/assets/app-icon.svg b/assets/app-icon.svg new file mode 100644 index 0000000..dbf2f96 --- /dev/null +++ b/assets/app-icon.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/crates/desktop-protocol/Cargo.toml b/crates/desktop-protocol/Cargo.toml new file mode 100644 index 0000000..8d59533 --- /dev/null +++ b/crates/desktop-protocol/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "desktop-protocol" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +publish = false +description = "Canonical AstrBot Desktop Gateway protocol types" + +[features] +default = ["schema"] +schema = ["dep:schemars"] + +[dependencies] +schemars = { workspace = true, optional = true } +serde.workspace = true +serde_json.workspace = true +thiserror.workspace = true + +[[example]] +name = "export_schemas" +required-features = ["schema"] diff --git a/crates/desktop-protocol/examples/export_schemas.rs b/crates/desktop-protocol/examples/export_schemas.rs new file mode 100644 index 0000000..d4496e4 --- /dev/null +++ b/crates/desktop-protocol/examples/export_schemas.rs @@ -0,0 +1,80 @@ +use std::{ + collections::BTreeMap, + env, + error::Error, + fs, + path::{Path, PathBuf}, +}; + +use desktop_protocol::{ + ClientCapabilities, ConnectionProfile, ConnectionSlot, DiagnosticBundle, FileTransferPlan, + GatewayEvent, RawProtocolEnvelope, ServerCapabilities, ToolProposal, ToolResult, +}; +use schemars::{JsonSchema, schema_for}; +use serde_json::Value; + +fn main() -> Result<(), Box> { + let write = env::args().any(|arg| arg == "--write"); + let output_dir = + PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../docs/protocol/v1/schemas"); + let schemas = generated_schemas()?; + + if write { + fs::create_dir_all(&output_dir)?; + for (name, schema) in schemas { + let path = output_dir.join(name); + fs::write( + path, + format!("{}\n", serde_json::to_string_pretty(&schema)?), + )?; + } + return Ok(()); + } + + let mut failures = Vec::new(); + for (name, expected) in schemas { + let path = output_dir.join(name); + match read_json(&path) { + Ok(actual) if actual == expected => {} + Ok(_) => failures.push(format!("{} is stale", path.display())), + Err(error) => failures.push(format!("{}: {error}", path.display())), + } + } + + if failures.is_empty() { + Ok(()) + } else { + Err(format!( + "protocol schema check failed; run with --write:\n{}", + failures.join("\n") + ) + .into()) + } +} + +fn generated_schemas() -> Result, serde_json::Error> { + let mut output = BTreeMap::new(); + insert::(&mut output, "connection-profile.schema.json")?; + insert::(&mut output, "connection-slot.schema.json")?; + insert::(&mut output, "server-capabilities.schema.json")?; + insert::(&mut output, "client-capabilities.schema.json")?; + insert::(&mut output, "protocol-envelope.schema.json")?; + insert::(&mut output, "gateway-event.schema.json")?; + insert::(&mut output, "tool-proposal.schema.json")?; + insert::(&mut output, "tool-result.schema.json")?; + insert::(&mut output, "diagnostic-bundle.schema.json")?; + insert::(&mut output, "file-transfer-plan.schema.json")?; + Ok(output) +} + +fn insert( + output: &mut BTreeMap<&'static str, Value>, + name: &'static str, +) -> Result<(), serde_json::Error> { + output.insert(name, serde_json::to_value(schema_for!(T))?); + Ok(()) +} + +fn read_json(path: &Path) -> Result> { + Ok(serde_json::from_str(&fs::read_to_string(path)?)?) +} diff --git a/crates/desktop-protocol/src/capabilities.rs b/crates/desktop-protocol/src/capabilities.rs new file mode 100644 index 0000000..a7e7c4e --- /dev/null +++ b/crates/desktop-protocol/src/capabilities.rs @@ -0,0 +1,32 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct CapabilityLimits { + pub max_event_bytes: u64, + pub max_message_bytes: u64, + pub replay_window_events: u32, + pub max_active_connections: u8, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct ServerCapabilities { + pub protocol_versions: Vec, + pub features: Vec, + #[serde(default)] + pub local_action_tools: Vec, + pub limits: CapabilityLimits, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct ClientCapabilities { + pub protocol_version: String, + pub app_version: String, + pub platform: String, + pub features: Vec, +} diff --git a/crates/desktop-protocol/src/connection.rs b/crates/desktop-protocol/src/connection.rs new file mode 100644 index 0000000..66d2087 --- /dev/null +++ b/crates/desktop-protocol/src/connection.rs @@ -0,0 +1,114 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub enum ActiveSlotKind { + Companion, + Operations, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub enum AstrBotProfileRole { + Companion, + Operations, + General, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "kebab-case")] +pub enum AuthenticationType { + DeviceToken, + ApiKey, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub enum ConnectionState { + Disconnected, + Connecting, + Authenticating, + Syncing, + Connected, + Reconnecting, + AuthExpired, + Incompatible, + ServerUnavailable, + Offline, + CertificateChanged, + FatalError, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct ConnectionProfile { + pub id: String, + pub display_name: String, + pub role: AstrBotProfileRole, + pub base_url: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub event_stream_url: Option, + pub authentication_type: AuthenticationType, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub credential_reference: Option, + #[serde(default)] + pub allow_insecure_http: bool, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pinned_certificate_fingerprint: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub auto_connect_slot: Option, + #[serde(default)] + pub auto_connect: bool, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub server_instance_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub server_version: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub protocol_version: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub local_tool_policy_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_connected_at: Option, + pub created_at: String, + pub updated_at: String, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct ConnectionSlot { + pub slot: ActiveSlotKind, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub profile_id: Option, + pub state: ConnectionState, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub server_instance_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub active_conversation_id: Option, + #[serde(default)] + pub unread_count: u32, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_event_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_connected_at: Option, +} + +impl ConnectionSlot { + pub fn empty(slot: ActiveSlotKind) -> Self { + Self { + slot, + profile_id: None, + state: ConnectionState::Disconnected, + server_instance_id: None, + active_conversation_id: None, + unread_count: 0, + last_event_id: None, + last_connected_at: None, + } + } +} diff --git a/crates/desktop-protocol/src/diagnostics.rs b/crates/desktop-protocol/src/diagnostics.rs new file mode 100644 index 0000000..3d77599 --- /dev/null +++ b/crates/desktop-protocol/src/diagnostics.rs @@ -0,0 +1,65 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub enum DiagnosticEntryKind { + System, + Window, + Process, + EventLog, + Network, + Port, + Service, + LogTail, + Configuration, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct RedactionSummary { + pub category: String, + pub count: u32, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct DiagnosticEntry { + pub entry_id: String, + pub kind: DiagnosticEntryKind, + pub source_label: String, + pub summary: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mime_type: Option, + #[serde(default)] + pub truncated: bool, + #[serde(default)] + pub redactions: Vec, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct DiagnosticAttachmentReference { + pub attachment_id: String, + pub mime_type: String, + pub size_bytes: u64, + pub sha256: String, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct DiagnosticBundle { + pub bundle_id: String, + pub generated_at: String, + pub scope: Vec, + pub entries: Vec, + #[serde(default)] + pub attachments: Vec, + pub total_bytes: u64, +} diff --git a/crates/desktop-protocol/src/envelope.rs b/crates/desktop-protocol/src/envelope.rs new file mode 100644 index 0000000..b9e9802 --- /dev/null +++ b/crates/desktop-protocol/src/envelope.rs @@ -0,0 +1,313 @@ +use serde::{Deserialize, Serialize, de::DeserializeOwned}; +use serde_json::Value; +use thiserror::Error; + +use crate::{ActiveSlotKind, PROTOCOL_VERSION, ServerCapabilities, ToolProposal}; + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub struct EventMetadata { + pub protocol_version: String, + pub event_id: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// Untrusted server hint. Local routing must use `BoundGatewayEvent.profile_id`. + #[serde(rename = "profileId", default, skip_serializing_if = "Option::is_none")] + pub server_profile_hint: Option, + pub server_instance_id: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conversation_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub session_id: Option, + pub timestamp: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sequence: Option, +} + +impl EventMetadata { + pub fn new( + event_id: impl Into, + server_instance_id: impl Into, + timestamp: impl Into, + sequence: u64, + ) -> Self { + Self { + protocol_version: PROTOCOL_VERSION.to_owned(), + event_id: event_id.into(), + request_id: None, + server_profile_hint: None, + server_instance_id: server_instance_id.into(), + conversation_id: None, + message_id: None, + session_id: None, + timestamp: timestamp.into(), + sequence: Some(sequence), + } + } +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct HeartbeatPayload { + pub interval_ms: u64, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct MessageDeltaPayload { + pub delta: String, + pub index: u32, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub enum FinishReason { + Stop, + Cancelled, + Error, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct MessageCompletedPayload { + pub finish_reason: FinishReason, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content: Option, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct ProactiveMessagePayload { + pub content: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub notification_title: Option, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct AgentStatusPayload { + pub state: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub detail: Option, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct GatewayErrorPayload { + pub code: String, + pub message: String, + pub retryable: bool, +} + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(tag = "eventType", content = "payload")] +pub enum GatewayEventBody { + #[serde(rename = "system.heartbeat")] + Heartbeat(HeartbeatPayload), + #[serde(rename = "message.delta")] + MessageDelta(MessageDeltaPayload), + #[serde(rename = "message.completed")] + MessageCompleted(MessageCompletedPayload), + #[serde(rename = "message.proactive")] + ProactiveMessage(ProactiveMessagePayload), + #[serde(rename = "agent.status")] + AgentStatus(AgentStatusPayload), + #[serde(rename = "tool.proposal")] + ToolProposal(ToolProposal), + #[serde(rename = "capabilities.changed")] + CapabilitiesChanged(ServerCapabilities), + #[serde(rename = "error")] + Error(GatewayErrorPayload), +} + +impl GatewayEventBody { + pub fn event_type(&self) -> &'static str { + match self { + Self::Heartbeat(_) => "system.heartbeat", + Self::MessageDelta(_) => "message.delta", + Self::MessageCompleted(_) => "message.completed", + Self::ProactiveMessage(_) => "message.proactive", + Self::AgentStatus(_) => "agent.status", + Self::ToolProposal(_) => "tool.proposal", + Self::CapabilitiesChanged(_) => "capabilities.changed", + Self::Error(_) => "error", + } + } +} + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +pub struct GatewayEvent { + #[serde(flatten)] + pub metadata: EventMetadata, + #[serde(flatten)] + pub body: GatewayEventBody, +} + +impl GatewayEvent { + pub fn new(metadata: EventMetadata, body: GatewayEventBody) -> Self { + Self { metadata, body } + } + + pub fn event_type(&self) -> &'static str { + self.body.event_type() + } +} + +/// Two-stage wire representation used before a payload type is trusted. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct ProtocolEnvelope { + pub protocol_version: String, + pub event_type: String, + pub event_id: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// This value is never used as the local profile binding. + #[serde(rename = "profileId", default, skip_serializing_if = "Option::is_none")] + pub server_profile_hint: Option, + pub server_instance_id: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conversation_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub session_id: Option, + pub timestamp: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sequence: Option, + pub payload: Value, +} + +/// Alias used by connection code to emphasize that the envelope remains +/// untrusted until it is decoded and locally bound. +pub type RawProtocolEnvelope = ProtocolEnvelope; + +impl TryFrom for GatewayEvent { + type Error = ProtocolError; + + fn try_from(raw: RawProtocolEnvelope) -> Result { + if raw.protocol_version != PROTOCOL_VERSION { + return Err(ProtocolError::IncompatibleProtocolVersion { + received: raw.protocol_version, + }); + } + require_non_empty("eventId", &raw.event_id)?; + require_non_empty("serverInstanceId", &raw.server_instance_id)?; + require_non_empty("timestamp", &raw.timestamp)?; + + let event_type = raw.event_type; + let body = match event_type.as_str() { + "system.heartbeat" => GatewayEventBody::Heartbeat(decode(&event_type, raw.payload)?), + "message.delta" => GatewayEventBody::MessageDelta(decode(&event_type, raw.payload)?), + "message.completed" => { + GatewayEventBody::MessageCompleted(decode(&event_type, raw.payload)?) + } + "message.proactive" => { + GatewayEventBody::ProactiveMessage(decode(&event_type, raw.payload)?) + } + "agent.status" => GatewayEventBody::AgentStatus(decode(&event_type, raw.payload)?), + "tool.proposal" => GatewayEventBody::ToolProposal(decode(&event_type, raw.payload)?), + "capabilities.changed" => { + GatewayEventBody::CapabilitiesChanged(decode(&event_type, raw.payload)?) + } + "error" => GatewayEventBody::Error(decode(&event_type, raw.payload)?), + _ => return Err(ProtocolError::UnsupportedEventType { event_type }), + }; + + Ok(Self { + metadata: EventMetadata { + protocol_version: PROTOCOL_VERSION.to_owned(), + event_id: raw.event_id, + request_id: raw.request_id, + server_profile_hint: raw.server_profile_hint, + server_instance_id: raw.server_instance_id, + conversation_id: raw.conversation_id, + message_id: raw.message_id, + session_id: raw.session_id, + timestamp: raw.timestamp, + sequence: raw.sequence, + }, + body, + }) + } +} + +fn decode(event_type: &str, payload: Value) -> Result { + serde_json::from_value(payload).map_err(|source| ProtocolError::InvalidPayload { + event_type: event_type.to_owned(), + source, + }) +} + +fn require_non_empty(field: &'static str, value: &str) -> Result<(), ProtocolError> { + if value.trim().is_empty() { + Err(ProtocolError::EmptyRequiredField { field }) + } else { + Ok(()) + } +} + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct BoundGatewayEvent { + /// Trusted local profile binding supplied by the connection object. + pub profile_id: String, + pub slot: ActiveSlotKind, + pub event: GatewayEvent, +} + +impl BoundGatewayEvent { + pub fn bind( + raw: RawProtocolEnvelope, + local_profile_id: impl Into, + slot: ActiveSlotKind, + expected_server_instance_id: &str, + ) -> Result { + let local_profile_id = local_profile_id.into(); + require_non_empty("localProfileId", &local_profile_id)?; + let event = GatewayEvent::try_from(raw)?; + if event.metadata.server_instance_id != expected_server_instance_id { + return Err(ProtocolError::ServerInstanceMismatch { + expected: expected_server_instance_id.to_owned(), + received: event.metadata.server_instance_id, + }); + } + Ok(Self { + profile_id: local_profile_id, + slot, + event, + }) + } +} + +#[derive(Debug, Error)] +pub enum ProtocolError { + #[error("unsupported protocol version: {received}")] + IncompatibleProtocolVersion { received: String }, + #[error("required field {field} is empty")] + EmptyRequiredField { field: &'static str }, + #[error("unsupported gateway event type: {event_type}")] + UnsupportedEventType { event_type: String }, + #[error("invalid payload for {event_type}: {source}")] + InvalidPayload { + event_type: String, + #[source] + source: serde_json::Error, + }, + #[error("server instance mismatch: expected {expected}, received {received}")] + ServerInstanceMismatch { expected: String, received: String }, +} diff --git a/crates/desktop-protocol/src/file_transfer.rs b/crates/desktop-protocol/src/file_transfer.rs new file mode 100644 index 0000000..059b4c9 --- /dev/null +++ b/crates/desktop-protocol/src/file_transfer.rs @@ -0,0 +1,50 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub enum ConflictAction { + Copy, + Rename, + Skip, + Ask, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub enum SourceCleanupPolicy { + Keep, + Recycle, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct FileTransferPlanItem { + /// Opaque, short-lived mapping held by the local client. Never a raw path. + pub source_path_token: String, + /// Display-only value for local review; never used as an execution path. + pub display_source_path: String, + pub destination_relative_path: String, + pub size_bytes: u64, + pub category_reason: String, + pub conflict_action: ConflictAction, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct FileTransferPlan { + pub plan_id: String, + /// Locally bound profile. A remote value must never select the executor. + pub profile_id: String, + pub source_selection_id: String, + pub nas_target_id: String, + pub items: Vec, + pub total_bytes: u64, + pub conflict_count: u32, + pub warning_count: u32, + pub source_cleanup_policy: SourceCleanupPolicy, + pub expires_at: String, +} diff --git a/crates/desktop-protocol/src/http.rs b/crates/desktop-protocol/src/http.rs new file mode 100644 index 0000000..380374c --- /dev/null +++ b/crates/desktop-protocol/src/http.rs @@ -0,0 +1,89 @@ +use serde::{Deserialize, Serialize}; + +use crate::ClientCapabilities; + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct HealthResponse { + pub status: String, + pub protocol_version: String, + pub server_instance_id: String, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct ServerInfo { + pub server_instance_id: String, + pub display_name: String, + pub server_version: String, + pub protocol_version: String, + pub server_time: String, +} + +/// Contains secret material and intentionally does not derive `Debug`. +#[derive(Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct AuthLoginRequest { + pub client_id: String, + pub device_id: String, + pub credential: String, + pub capabilities: ClientCapabilities, +} + +/// Contains secret material and intentionally does not derive `Debug`. +#[derive(Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct AuthLoginResponse { + pub access_token: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub refresh_token: Option, + pub expires_in_seconds: u64, +} + +/// Contains secret material and intentionally does not derive `Debug`. +#[derive(Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct AuthRefreshRequest { + pub refresh_token: String, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct SendMessageRequest { + pub conversation_id: String, + pub content: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub client_request_id: Option, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct AcceptedMessage { + pub request_id: String, + pub message_id: String, + pub accepted_at: String, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct EventAcknowledgement { + pub event_id: String, + pub acknowledged: bool, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct GatewayErrorResponse { + pub code: String, + pub message: String, + pub retryable: bool, +} diff --git a/crates/desktop-protocol/src/lib.rs b/crates/desktop-protocol/src/lib.rs new file mode 100644 index 0000000..abe21c7 --- /dev/null +++ b/crates/desktop-protocol/src/lib.rs @@ -0,0 +1,26 @@ +//! Canonical protocol types for the stable AstrBot Desktop Gateway boundary. +//! +//! Types in this crate deliberately separate untrusted wire data from locally +//! bound desktop events. A server supplied `profileId` is never authoritative. + +mod capabilities; +mod connection; +mod diagnostics; +mod envelope; +mod file_transfer; +mod http; +mod tools; + +pub use capabilities::*; +pub use connection::*; +pub use diagnostics::*; +pub use envelope::*; +pub use file_transfer::*; +pub use http::*; +pub use tools::*; + +/// Protocol version implemented by the P00 desktop contract. +pub const PROTOCOL_VERSION: &str = "desktop-v1alpha1"; + +/// Stable REST prefix for this protocol major version. +pub const API_PREFIX: &str = "/desktop/v1"; diff --git a/crates/desktop-protocol/src/tools.rs b/crates/desktop-protocol/src/tools.rs new file mode 100644 index 0000000..8b00ad8 --- /dev/null +++ b/crates/desktop-protocol/src/tools.rs @@ -0,0 +1,80 @@ +use serde::{Deserialize, Serialize}; +use serde_json::Value; + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "kebab-case")] +pub enum RiskLevel { + Read, + ReversibleWrite, + Destructive, +} + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct ToolProposal { + pub action_id: String, + pub tool_name: String, + pub reason: String, + pub risk_level: RiskLevel, + pub arguments: Value, + pub requested_at: String, + pub expires_at: String, + pub requires_approval: bool, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub enum ToolResultStatus { + Rejected, + Completed, + Failed, + Cancelled, +} + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct ToolResult { + pub action_id: String, + pub status: ToolResultStatus, + pub summary: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_code: Option, + pub completed_at: String, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub enum LocalActionDecisionKind { + Accepted, + Rejected, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct LocalActionDecision { + pub action_id: String, + pub decision: LocalActionDecisionKind, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + pub decided_at: String, +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct LocalActionProgress { + pub action_id: String, + pub phase: String, + pub completed_units: u64, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_units: Option, + pub updated_at: String, +} diff --git a/crates/desktop-protocol/tests/protocol_contract.rs b/crates/desktop-protocol/tests/protocol_contract.rs new file mode 100644 index 0000000..ce9b048 --- /dev/null +++ b/crates/desktop-protocol/tests/protocol_contract.rs @@ -0,0 +1,92 @@ +use desktop_protocol::{ + ActiveSlotKind, BoundGatewayEvent, GatewayEventBody, PROTOCOL_VERSION, ProtocolError, + RawProtocolEnvelope, RiskLevel, ToolProposal, +}; +use serde_json::json; + +fn raw_event(payload: serde_json::Value) -> RawProtocolEnvelope { + RawProtocolEnvelope { + protocol_version: PROTOCOL_VERSION.to_owned(), + event_type: "system.heartbeat".to_owned(), + event_id: "shared-event-id".to_owned(), + request_id: None, + server_profile_hint: Some("spoofed-operations-profile".to_owned()), + server_instance_id: "server-companion".to_owned(), + conversation_id: Some("same-conversation".to_owned()), + message_id: None, + session_id: None, + timestamp: "2026-01-01T00:00:00Z".to_owned(), + sequence: Some(1), + payload, + } +} + +#[test] +fn local_profile_binding_ignores_server_profile_hint() { + let bound = BoundGatewayEvent::bind( + raw_event(json!({ "intervalMs": 1_000 })), + "local-companion-profile", + ActiveSlotKind::Companion, + "server-companion", + ) + .expect("valid event should bind"); + + assert_eq!(bound.profile_id, "local-companion-profile"); + assert_eq!(bound.slot, ActiveSlotKind::Companion); + assert_eq!( + bound.event.metadata.server_profile_hint.as_deref(), + Some("spoofed-operations-profile") + ); + assert!(matches!(bound.event.body, GatewayEventBody::Heartbeat(_))); +} + +#[test] +fn server_instance_mismatch_is_rejected() { + let error = BoundGatewayEvent::bind( + raw_event(json!({ "intervalMs": 1_000 })), + "local-profile", + ActiveSlotKind::Companion, + "different-server", + ) + .expect_err("changed server identity must be rejected"); + + assert!(matches!( + error, + ProtocolError::ServerInstanceMismatch { .. } + )); +} + +#[test] +fn unsupported_event_type_is_explicit_and_non_panicking() { + let mut raw = raw_event(json!({})); + raw.event_type = "future.event".to_owned(); + + let error = desktop_protocol::GatewayEvent::try_from(raw) + .expect_err("unknown event should be surfaced to the caller"); + assert!(matches!(error, ProtocolError::UnsupportedEventType { .. })); +} + +#[test] +fn tool_proposal_rejects_unknown_outer_fields() { + let value = json!({ + "actionId": "action-1", + "toolName": "query_recent_event_logs", + "reason": "Inspect an application failure", + "riskLevel": "read", + "arguments": { "provider": "Application", "maxEntries": 20 }, + "requestedAt": "2026-01-01T00:00:00Z", + "expiresAt": "2026-01-01T00:05:00Z", + "requiresApproval": true, + "executeCommand": "not-allowed" + }); + + assert!(serde_json::from_value::(value).is_err()); +} + +#[test] +fn tool_risk_level_uses_stable_wire_values() { + assert_eq!( + serde_json::to_value(RiskLevel::ReversibleWrite).unwrap(), + json!("reversible-write") + ); +} diff --git a/crates/mock-gateway/Cargo.toml b/crates/mock-gateway/Cargo.toml new file mode 100644 index 0000000..1d1e373 --- /dev/null +++ b/crates/mock-gateway/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "mock-gateway" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +publish = false +description = "Deterministic loopback-only AstrBot Desktop Gateway mock" + +[dependencies] +async-stream = "0.3" +axum.workspace = true +clap.workspace = true +desktop-protocol = { path = "../desktop-protocol" } +serde_json.workspace = true +thiserror.workspace = true +tokio = { workspace = true, features = ["signal"] } +tokio-util = { workspace = true, features = ["rt"] } +uuid.workspace = true + +[dev-dependencies] +reqwest.workspace = true diff --git a/crates/mock-gateway/src/config.rs b/crates/mock-gateway/src/config.rs new file mode 100644 index 0000000..37a2350 --- /dev/null +++ b/crates/mock-gateway/src/config.rs @@ -0,0 +1,73 @@ +use std::{ + net::{IpAddr, Ipv4Addr, SocketAddr}, + time::Duration, +}; + +use clap::ValueEnum; + +#[derive(Clone, Copy, Debug, Eq, PartialEq, ValueEnum)] +pub enum MockInstanceKind { + Companion, + Operations, +} + +impl MockInstanceKind { + pub fn slug(self) -> &'static str { + match self { + Self::Companion => "companion", + Self::Operations => "operations", + } + } + + pub fn display_name(self) -> &'static str { + match self { + Self::Companion => "Mock Companion", + Self::Operations => "Mock Operations", + } + } + + pub fn server_instance_id(self) -> String { + format!("mock-{}-1", self.slug()) + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, ValueEnum)] +pub enum MockScenario { + Steady, + DisconnectOnce, + DuplicateEvents, + AuthReject, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum AuthMode { + Accept, + Reject, +} + +#[derive(Clone, Debug)] +pub struct MockGatewayConfig { + pub instance: MockInstanceKind, + pub bind_addr: SocketAddr, + pub scenario: MockScenario, + pub heartbeat_interval: Option, + pub replay_capacity: usize, +} + +impl MockGatewayConfig { + pub fn new(instance: MockInstanceKind, port: u16) -> Self { + Self { + instance, + bind_addr: SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port), + scenario: MockScenario::Steady, + heartbeat_interval: Some(Duration::from_secs(1)), + replay_capacity: 256, + } + } + + pub fn for_test(instance: MockInstanceKind) -> Self { + let mut config = Self::new(instance, 0); + config.heartbeat_interval = None; + config + } +} diff --git a/crates/mock-gateway/src/lib.rs b/crates/mock-gateway/src/lib.rs new file mode 100644 index 0000000..9819a82 --- /dev/null +++ b/crates/mock-gateway/src/lib.rs @@ -0,0 +1,240 @@ +mod config; +mod routes; +mod state; + +use std::{io, net::SocketAddr, sync::Arc}; + +pub use config::{AuthMode, MockGatewayConfig, MockInstanceKind, MockScenario}; +use desktop_protocol::{ + GatewayEvent, GatewayEventBody, HeartbeatPayload, ProactiveMessagePayload, RiskLevel, + ToolProposal, +}; +use state::AppState; +use thiserror::Error; +use tokio::{net::TcpListener, sync::Mutex, task::JoinHandle}; +use tokio_util::sync::CancellationToken; + +#[derive(Clone)] +pub struct MockGatewayHandle { + inner: Arc, +} + +struct HandleInner { + state: Arc, + address: SocketAddr, + shutdown: CancellationToken, + server_task: Mutex>>>, + scenario_task: Mutex>>, +} + +impl MockGatewayHandle { + pub fn base_url(&self) -> String { + format!("http://{}", self.inner.address) + } + + pub fn server_instance_id(&self) -> &str { + &self.inner.state.server_instance_id + } + + pub async fn emit_event(&self, event: GatewayEvent) -> Result<(), MockGatewayError> { + if event.metadata.server_instance_id != self.server_instance_id() { + return Err(MockGatewayError::EventServerInstanceMismatch { + expected: self.server_instance_id().to_owned(), + received: event.metadata.server_instance_id, + }); + } + self.inner.state.publish(event).await; + Ok(()) + } + + pub async fn emit_body(&self, body: GatewayEventBody) -> GatewayEvent { + let event = self.inner.state.create_event(body, None, None, None); + self.inner.state.publish(event.clone()).await; + event + } + + pub async fn emit_proactive_message(&self) -> GatewayEvent { + self.emit_body(GatewayEventBody::ProactiveMessage( + ProactiveMessagePayload { + content: "Deterministic proactive mock message".to_owned(), + notification_title: Some(self.inner.state.instance.display_name().to_owned()), + }, + )) + .await + } + + pub async fn emit_tool_proposal(&self) -> GatewayEvent { + self.emit_body(GatewayEventBody::ToolProposal(ToolProposal { + action_id: "mock-action-event-log-1".to_owned(), + tool_name: "query_recent_event_logs".to_owned(), + reason: "Inspect a bounded set of recent Application events".to_owned(), + risk_level: RiskLevel::Read, + arguments: serde_json::json!({ + "provider": "Application", + "sinceMinutes": 15, + "maxEntries": 20 + }), + requested_at: state::FIXED_TIMESTAMP.to_owned(), + expires_at: "2030-01-01T00:05:00Z".to_owned(), + requires_approval: true, + })) + .await + } + + pub fn disconnect_streams(&self) { + self.inner.state.disconnect_streams(); + } + + pub async fn replay_event(&self, event_id: &str) -> bool { + self.inner.state.replay_event(event_id).await + } + + pub fn set_auth_mode(&self, mode: AuthMode) { + self.inner.state.set_auth_mode(mode); + } + + pub async fn acknowledged_event_ids(&self) -> Vec { + self.inner.state.acknowledged_event_ids().await + } + + pub async fn shutdown(&self) -> Result<(), MockGatewayError> { + self.inner.shutdown.cancel(); + + if let Some(task) = self.inner.scenario_task.lock().await.take() { + task.await?; + } + if let Some(task) = self.inner.server_task.lock().await.take() { + task.await??; + } + Ok(()) + } +} + +pub async fn spawn_mock_gateway( + config: MockGatewayConfig, +) -> Result { + if !config.bind_addr.ip().is_loopback() { + return Err(MockGatewayError::NonLoopbackBind(config.bind_addr)); + } + + let listener = TcpListener::bind(config.bind_addr).await?; + let address = listener.local_addr()?; + let state = Arc::new(AppState::new(&config)); + let router = routes::router(state.clone()); + let shutdown = CancellationToken::new(); + let server_shutdown = shutdown.clone(); + let server_task = tokio::spawn(async move { + axum::serve(listener, router) + .with_graceful_shutdown(server_shutdown.cancelled_owned()) + .await + }); + + let scenario_task = config.heartbeat_interval.map(|interval| { + let task_state = state.clone(); + let task_shutdown = shutdown.clone(); + let scenario = config.scenario; + tokio::spawn(async move { + run_scenario(task_state, scenario, interval, task_shutdown).await; + }) + }); + + Ok(MockGatewayHandle { + inner: Arc::new(HandleInner { + state, + address, + shutdown, + server_task: Mutex::new(Some(server_task)), + scenario_task: Mutex::new(scenario_task), + }), + }) +} + +async fn run_scenario( + state: Arc, + scenario: MockScenario, + interval: std::time::Duration, + shutdown: CancellationToken, +) { + if scenario == MockScenario::AuthReject { + state.set_auth_mode(AuthMode::Reject); + } + + let mut ticker = tokio::time::interval(interval); + let mut ticks = 0_u64; + loop { + tokio::select! { + _ = shutdown.cancelled() => break, + _ = ticker.tick() => { + ticks += 1; + let heartbeat = state.create_event( + GatewayEventBody::Heartbeat(HeartbeatPayload { + interval_ms: interval.as_millis().try_into().unwrap_or(u64::MAX), + }), + None, + None, + None, + ); + state.publish(heartbeat.clone()).await; + + if ticks == 2 { + match state.instance { + MockInstanceKind::Companion => { + let event = state.create_event( + GatewayEventBody::ProactiveMessage(ProactiveMessagePayload { + content: "Deterministic proactive mock message".to_owned(), + notification_title: Some("Mock Companion".to_owned()), + }), + None, + Some("mock-companion-conversation".to_owned()), + None, + ); + state.publish(event).await; + } + MockInstanceKind::Operations => { + let event = state.create_event( + GatewayEventBody::ToolProposal(ToolProposal { + action_id: "mock-action-event-log-1".to_owned(), + tool_name: "query_recent_event_logs".to_owned(), + reason: "Inspect a bounded set of recent Application events".to_owned(), + risk_level: RiskLevel::Read, + arguments: serde_json::json!({ + "provider": "Application", + "sinceMinutes": 15, + "maxEntries": 20 + }), + requested_at: state::FIXED_TIMESTAMP.to_owned(), + expires_at: "2030-01-01T00:05:00Z".to_owned(), + requires_approval: true, + }), + None, + Some("mock-operations-conversation".to_owned()), + None, + ); + state.publish(event).await; + } + } + } + + match scenario { + MockScenario::DisconnectOnce if ticks == 3 => state.disconnect_streams(), + MockScenario::DuplicateEvents if ticks.is_multiple_of(3) => { + state.broadcast_duplicate(&heartbeat); + } + _ => {} + } + } + } + } +} + +#[derive(Debug, Error)] +pub enum MockGatewayError { + #[error("mock gateway refuses non-loopback bind address {0}")] + NonLoopbackBind(SocketAddr), + #[error("event server instance mismatch: expected {expected}, received {received}")] + EventServerInstanceMismatch { expected: String, received: String }, + #[error(transparent)] + Io(#[from] io::Error), + #[error(transparent)] + Join(#[from] tokio::task::JoinError), +} diff --git a/crates/mock-gateway/src/main.rs b/crates/mock-gateway/src/main.rs new file mode 100644 index 0000000..9260b12 --- /dev/null +++ b/crates/mock-gateway/src/main.rs @@ -0,0 +1,36 @@ +use std::time::Duration; + +use clap::Parser; +use mock_gateway::{MockGatewayConfig, MockInstanceKind, MockScenario, spawn_mock_gateway}; + +#[derive(Debug, Parser)] +#[command(name = "mock-gateway")] +#[command(about = "Loopback-only deterministic AstrBot Desktop Gateway mock")] +struct Args { + #[arg(long, value_enum)] + instance: MockInstanceKind, + #[arg(long)] + port: u16, + #[arg(long, value_enum, default_value = "steady")] + scenario: MockScenario, + #[arg(long, default_value_t = 1_000)] + heartbeat_ms: u64, +} + +#[tokio::main] +async fn main() -> Result<(), Box> { + let args = Args::parse(); + let mut config = MockGatewayConfig::new(args.instance, args.port); + config.scenario = args.scenario; + config.heartbeat_interval = Some(Duration::from_millis(args.heartbeat_ms.max(1))); + + let gateway = spawn_mock_gateway(config).await?; + println!( + "{} listening at {}", + gateway.server_instance_id(), + gateway.base_url() + ); + tokio::signal::ctrl_c().await?; + gateway.shutdown().await?; + Ok(()) +} diff --git a/crates/mock-gateway/src/routes.rs b/crates/mock-gateway/src/routes.rs new file mode 100644 index 0000000..b40b37e --- /dev/null +++ b/crates/mock-gateway/src/routes.rs @@ -0,0 +1,375 @@ +use std::{convert::Infallible, sync::Arc, time::Duration}; + +use axum::{ + Json, Router, + extract::{Path, State}, + http::{HeaderMap, StatusCode, header::AUTHORIZATION}, + response::{ + IntoResponse, Response, Sse, + sse::{Event, KeepAlive}, + }, + routing::{get, post}, +}; +use desktop_protocol::{ + AuthLoginRequest, AuthLoginResponse, AuthRefreshRequest, EventAcknowledgement, FinishReason, + GatewayErrorResponse, GatewayEvent, GatewayEventBody, HealthResponse, LocalActionDecision, + LocalActionDecisionKind, LocalActionProgress, MessageCompletedPayload, MessageDeltaPayload, + PROTOCOL_VERSION, SendMessageRequest, ServerCapabilities, ServerInfo, ToolResult, +}; +use tokio::sync::broadcast::error::RecvError; + +use crate::state::{AppState, FIXED_TIMESTAMP}; + +pub(crate) fn router(state: Arc) -> Router { + Router::new() + .route("/desktop/v1/health", get(health)) + .route("/desktop/v1/server-info", get(server_info)) + .route("/desktop/v1/capabilities", get(capabilities)) + .route("/desktop/v1/auth/login", post(auth_login)) + .route("/desktop/v1/auth/refresh", post(auth_refresh)) + .route("/desktop/v1/messages", post(send_message)) + .route("/desktop/v1/events/stream", get(event_stream)) + .route("/desktop/v1/events/{event_id}/ack", post(acknowledge_event)) + .route( + "/desktop/v1/local-actions/{action_id}/accepted", + post(local_action_accepted), + ) + .route( + "/desktop/v1/local-actions/{action_id}/rejected", + post(local_action_rejected), + ) + .route( + "/desktop/v1/local-actions/{action_id}/progress", + post(local_action_progress), + ) + .route( + "/desktop/v1/local-actions/{action_id}/result", + post(local_action_result), + ) + .with_state(state) +} + +async fn health(State(state): State>) -> Json { + Json(HealthResponse { + status: "ok".to_owned(), + protocol_version: PROTOCOL_VERSION.to_owned(), + server_instance_id: state.server_instance_id.clone(), + }) +} + +async fn server_info(State(state): State>) -> Json { + Json(ServerInfo { + server_instance_id: state.server_instance_id.clone(), + display_name: state.display_name.clone(), + server_version: "0.1.0-mock".to_owned(), + protocol_version: PROTOCOL_VERSION.to_owned(), + server_time: FIXED_TIMESTAMP.to_owned(), + }) +} + +async fn capabilities(State(state): State>) -> Json { + Json(state.capabilities.clone()) +} + +async fn auth_login( + State(state): State>, + Json(request): Json, +) -> Response { + if state.auth_is_rejected() + || request.client_id.trim().is_empty() + || request.device_id.trim().is_empty() + || request.credential.trim().is_empty() + { + return error_response( + StatusCode::UNAUTHORIZED, + "auth_rejected", + "mock authentication rejected", + false, + ); + } + + let (access_token, refresh_token) = state.issue_tokens().await; + Json(AuthLoginResponse { + access_token, + refresh_token: Some(refresh_token), + expires_in_seconds: 300, + }) + .into_response() +} + +async fn auth_refresh( + State(state): State>, + Json(request): Json, +) -> Response { + let Some((access_token, refresh_token)) = state.refresh_tokens(&request.refresh_token).await + else { + return error_response( + StatusCode::UNAUTHORIZED, + "refresh_rejected", + "mock refresh rejected", + false, + ); + }; + Json(AuthLoginResponse { + access_token, + refresh_token: Some(refresh_token), + expires_in_seconds: 300, + }) + .into_response() +} + +async fn send_message( + State(state): State>, + headers: HeaderMap, + Json(request): Json, +) -> Response { + if let Err(response) = require_auth(&state, &headers).await { + return response; + } + if request.conversation_id.trim().is_empty() || request.content.trim().is_empty() { + return error_response( + StatusCode::BAD_REQUEST, + "invalid_message", + "conversationId and content are required", + false, + ); + } + + let accepted = state.accept_message(); + let reply = match state.instance { + crate::MockInstanceKind::Companion => "Deterministic companion response", + crate::MockInstanceKind::Operations => "Deterministic operations response", + }; + + let delta = state.create_event( + GatewayEventBody::MessageDelta(MessageDeltaPayload { + delta: reply.to_owned(), + index: 0, + }), + Some(accepted.request_id.clone()), + Some(request.conversation_id.clone()), + Some(accepted.message_id.clone()), + ); + state.publish(delta).await; + + let completed = state.create_event( + GatewayEventBody::MessageCompleted(MessageCompletedPayload { + finish_reason: FinishReason::Stop, + content: Some(reply.to_owned()), + }), + Some(accepted.request_id.clone()), + Some(request.conversation_id), + Some(accepted.message_id.clone()), + ); + state.publish(completed).await; + + (StatusCode::ACCEPTED, Json(accepted)).into_response() +} + +async fn event_stream(State(state): State>, headers: HeaderMap) -> Response { + if let Err(response) = require_auth(&state, &headers).await { + return response; + } + + let last_event_id = headers + .get("last-event-id") + .and_then(|value| value.to_str().ok()) + .map(str::to_owned); + let mut events = state.subscribe_events(); + let mut disconnects = state.subscribe_disconnects(); + let replay = state.events_after(last_event_id.as_deref()).await; + + let stream = async_stream::stream! { + yield Ok::(Event::default().comment("connected")); + for event in replay { + if let Some(frame) = to_sse_event(&event) { + yield Ok::(frame); + } + } + loop { + tokio::select! { + result = disconnects.changed() => { + if result.is_ok() { + break; + } + } + result = events.recv() => { + match result { + Ok(event) => { + if let Some(frame) = to_sse_event(&event) { + yield Ok::(frame); + } + } + Err(RecvError::Lagged(_)) => continue, + Err(RecvError::Closed) => break, + } + } + } + } + }; + + Sse::new(stream) + .keep_alive( + KeepAlive::new() + .interval(Duration::from_secs(15)) + .text("keep-alive"), + ) + .into_response() +} + +async fn acknowledge_event( + State(state): State>, + headers: HeaderMap, + Path(event_id): Path, +) -> Response { + if let Err(response) = require_auth(&state, &headers).await { + return response; + } + if event_id.trim().is_empty() { + return error_response( + StatusCode::BAD_REQUEST, + "invalid_event_id", + "event id is required", + false, + ); + } + state.acknowledge(event_id.clone()).await; + Json(EventAcknowledgement { + event_id, + acknowledged: true, + }) + .into_response() +} + +async fn local_action_accepted( + State(state): State>, + headers: HeaderMap, + Path(action_id): Path, + Json(decision): Json, +) -> Response { + validate_decision( + &state, + &headers, + &action_id, + &decision, + LocalActionDecisionKind::Accepted, + ) + .await +} + +async fn local_action_rejected( + State(state): State>, + headers: HeaderMap, + Path(action_id): Path, + Json(decision): Json, +) -> Response { + validate_decision( + &state, + &headers, + &action_id, + &decision, + LocalActionDecisionKind::Rejected, + ) + .await +} + +async fn validate_decision( + state: &AppState, + headers: &HeaderMap, + action_id: &str, + decision: &LocalActionDecision, + expected: LocalActionDecisionKind, +) -> Response { + if let Err(response) = require_auth(state, headers).await { + return response; + } + if decision.action_id != action_id || decision.decision != expected { + return error_response( + StatusCode::BAD_REQUEST, + "invalid_action_decision", + "path and decision payload do not match", + false, + ); + } + StatusCode::NO_CONTENT.into_response() +} + +async fn local_action_progress( + State(state): State>, + headers: HeaderMap, + Path(action_id): Path, + Json(progress): Json, +) -> Response { + if let Err(response) = require_auth(&state, &headers).await { + return response; + } + if progress.action_id != action_id { + return error_response( + StatusCode::BAD_REQUEST, + "invalid_action_progress", + "path and progress payload do not match", + false, + ); + } + StatusCode::NO_CONTENT.into_response() +} + +async fn local_action_result( + State(state): State>, + headers: HeaderMap, + Path(action_id): Path, + Json(result): Json, +) -> Response { + if let Err(response) = require_auth(&state, &headers).await { + return response; + } + if result.action_id != action_id { + return error_response( + StatusCode::BAD_REQUEST, + "invalid_action_result", + "path and result payload do not match", + false, + ); + } + StatusCode::NO_CONTENT.into_response() +} + +async fn require_auth(state: &AppState, headers: &HeaderMap) -> Result<(), Response> { + let token = headers + .get(AUTHORIZATION) + .and_then(|value| value.to_str().ok()) + .and_then(|value| value.strip_prefix("Bearer ")) + .map(str::to_owned); + if state.is_authorized(token.as_deref()).await { + Ok(()) + } else { + Err(error_response( + StatusCode::UNAUTHORIZED, + "unauthorized", + "valid bearer authentication is required", + false, + )) + } +} + +fn to_sse_event(event: &GatewayEvent) -> Option { + let data = serde_json::to_string(event).ok()?; + Some( + Event::default() + .id(event.metadata.event_id.clone()) + .event(event.event_type()) + .data(data), + ) +} + +fn error_response(status: StatusCode, code: &str, message: &str, retryable: bool) -> Response { + ( + status, + Json(GatewayErrorResponse { + code: code.to_owned(), + message: message.to_owned(), + retryable, + }), + ) + .into_response() +} diff --git a/crates/mock-gateway/src/state.rs b/crates/mock-gateway/src/state.rs new file mode 100644 index 0000000..f9f997c --- /dev/null +++ b/crates/mock-gateway/src/state.rs @@ -0,0 +1,250 @@ +use std::{ + collections::{HashSet, VecDeque}, + sync::atomic::{AtomicU8, AtomicU64, Ordering}, +}; + +use desktop_protocol::{ + AcceptedMessage, CapabilityLimits, EventMetadata, GatewayEvent, GatewayEventBody, + PROTOCOL_VERSION, ServerCapabilities, +}; +use tokio::sync::{Mutex, RwLock, broadcast, watch}; +use uuid::Uuid; + +use crate::{AuthMode, MockGatewayConfig, MockInstanceKind, MockScenario}; + +pub(crate) const FIXED_TIMESTAMP: &str = "2030-01-01T00:00:00Z"; + +struct SessionTokens { + access: String, + refresh: String, +} + +pub(crate) struct AppState { + pub(crate) instance: MockInstanceKind, + pub(crate) server_instance_id: String, + pub(crate) display_name: String, + pub(crate) capabilities: ServerCapabilities, + replay_capacity: usize, + sequence: AtomicU64, + request_sequence: AtomicU64, + auth_mode: AtomicU8, + tokens: RwLock>, + event_sender: broadcast::Sender, + disconnect_sender: watch::Sender, + replay_buffer: Mutex>, + acknowledged_event_ids: Mutex>, +} + +impl AppState { + pub(crate) fn new(config: &MockGatewayConfig) -> Self { + let (event_sender, _) = broadcast::channel(config.replay_capacity.max(16)); + let (disconnect_sender, _) = watch::channel(0_u64); + let initial_auth_mode = if config.scenario == MockScenario::AuthReject { + AuthMode::Reject + } else { + AuthMode::Accept + }; + Self { + instance: config.instance, + server_instance_id: config.instance.server_instance_id(), + display_name: config.instance.display_name().to_owned(), + capabilities: capabilities_for(config.instance), + replay_capacity: config.replay_capacity.max(1), + sequence: AtomicU64::new(0), + request_sequence: AtomicU64::new(0), + auth_mode: AtomicU8::new(auth_mode_value(initial_auth_mode)), + tokens: RwLock::new(None), + event_sender, + disconnect_sender, + replay_buffer: Mutex::new(VecDeque::with_capacity(config.replay_capacity.max(1))), + acknowledged_event_ids: Mutex::new(HashSet::new()), + } + } + + pub(crate) fn set_auth_mode(&self, mode: AuthMode) { + self.auth_mode + .store(auth_mode_value(mode), Ordering::Release); + } + + pub(crate) fn auth_is_rejected(&self) -> bool { + self.auth_mode.load(Ordering::Acquire) == auth_mode_value(AuthMode::Reject) + } + + pub(crate) async fn issue_tokens(&self) -> (String, String) { + let tokens = SessionTokens { + access: format!("mock-session-{}", Uuid::new_v4()), + refresh: format!("mock-refresh-{}", Uuid::new_v4()), + }; + let response = (tokens.access.clone(), tokens.refresh.clone()); + *self.tokens.write().await = Some(tokens); + response + } + + pub(crate) async fn refresh_tokens(&self, presented_refresh: &str) -> Option<(String, String)> { + let matches = self + .tokens + .read() + .await + .as_ref() + .is_some_and(|tokens| tokens.refresh == presented_refresh); + if matches && !self.auth_is_rejected() { + Some(self.issue_tokens().await) + } else { + None + } + } + + pub(crate) async fn is_authorized(&self, presented_access: Option<&str>) -> bool { + if self.auth_is_rejected() { + return false; + } + let Some(presented_access) = presented_access else { + return false; + }; + self.tokens + .read() + .await + .as_ref() + .is_some_and(|tokens| tokens.access == presented_access) + } + + pub(crate) fn create_event( + &self, + body: GatewayEventBody, + request_id: Option, + conversation_id: Option, + message_id: Option, + ) -> GatewayEvent { + let sequence = self.sequence.fetch_add(1, Ordering::Relaxed) + 1; + let mut metadata = EventMetadata::new( + format!("{}-event-{sequence:06}", self.instance.slug()), + self.server_instance_id.clone(), + FIXED_TIMESTAMP, + sequence, + ); + metadata.request_id = request_id; + metadata.conversation_id = conversation_id; + metadata.message_id = message_id; + GatewayEvent::new(metadata, body) + } + + pub(crate) async fn publish(&self, event: GatewayEvent) { + let mut replay = self.replay_buffer.lock().await; + replay.push_back(event.clone()); + while replay.len() > self.replay_capacity { + replay.pop_front(); + } + drop(replay); + let _ = self.event_sender.send(event); + } + + pub(crate) fn broadcast_duplicate(&self, event: &GatewayEvent) { + let _ = self.event_sender.send(event.clone()); + } + + pub(crate) async fn replay_event(&self, event_id: &str) -> bool { + let event = self + .replay_buffer + .lock() + .await + .iter() + .find(|event| event.metadata.event_id == event_id) + .cloned(); + if let Some(event) = event { + self.broadcast_duplicate(&event); + true + } else { + false + } + } + + pub(crate) async fn events_after(&self, last_event_id: Option<&str>) -> Vec { + let Some(last_event_id) = last_event_id else { + return Vec::new(); + }; + let replay = self.replay_buffer.lock().await; + let Some(index) = replay + .iter() + .position(|event| event.metadata.event_id == last_event_id) + else { + return Vec::new(); + }; + replay.iter().skip(index + 1).cloned().collect() + } + + pub(crate) fn subscribe_events(&self) -> broadcast::Receiver { + self.event_sender.subscribe() + } + + pub(crate) fn subscribe_disconnects(&self) -> watch::Receiver { + self.disconnect_sender.subscribe() + } + + pub(crate) fn disconnect_streams(&self) { + let next = self.disconnect_sender.borrow().wrapping_add(1); + let _ = self.disconnect_sender.send(next); + } + + pub(crate) async fn acknowledge(&self, event_id: String) { + self.acknowledged_event_ids.lock().await.insert(event_id); + } + + pub(crate) async fn acknowledged_event_ids(&self) -> Vec { + let mut values: Vec<_> = self + .acknowledged_event_ids + .lock() + .await + .iter() + .cloned() + .collect(); + values.sort(); + values + } + + pub(crate) fn accept_message(&self) -> AcceptedMessage { + let sequence = self.request_sequence.fetch_add(1, Ordering::Relaxed) + 1; + AcceptedMessage { + request_id: format!("{}-request-{sequence:06}", self.instance.slug()), + message_id: format!("{}-message-{sequence:06}", self.instance.slug()), + accepted_at: FIXED_TIMESTAMP.to_owned(), + } + } +} + +fn auth_mode_value(mode: AuthMode) -> u8 { + match mode { + AuthMode::Accept => 0, + AuthMode::Reject => 1, + } +} + +fn capabilities_for(instance: MockInstanceKind) -> ServerCapabilities { + let mut features = vec![ + "auth.refresh".to_owned(), + "chat.text".to_owned(), + "events.ack".to_owned(), + "events.sse".to_owned(), + ]; + let local_action_tools = match instance { + MockInstanceKind::Companion => { + features.push("messages.proactive".to_owned()); + Vec::new() + } + MockInstanceKind::Operations => { + features.push("local-actions.proposals".to_owned()); + features.push("diagnostics.readonly".to_owned()); + vec!["query_recent_event_logs".to_owned()] + } + }; + ServerCapabilities { + protocol_versions: vec![PROTOCOL_VERSION.to_owned()], + features, + local_action_tools, + limits: CapabilityLimits { + max_event_bytes: 262_144, + max_message_bytes: 65_536, + replay_window_events: 256, + max_active_connections: 2, + }, + } +} diff --git a/crates/mock-gateway/tests/dual_instance.rs b/crates/mock-gateway/tests/dual_instance.rs new file mode 100644 index 0000000..25a7025 --- /dev/null +++ b/crates/mock-gateway/tests/dual_instance.rs @@ -0,0 +1,278 @@ +use std::{ + net::{IpAddr, Ipv4Addr, SocketAddr}, + time::Duration, +}; + +use desktop_protocol::{ + ActiveSlotKind, AuthLoginRequest, AuthLoginResponse, BoundGatewayEvent, ClientCapabilities, + EventMetadata, GatewayEvent, GatewayEventBody, HealthResponse, HeartbeatPayload, + PROTOCOL_VERSION, RawProtocolEnvelope, +}; +use mock_gateway::{MockGatewayConfig, MockGatewayError, MockInstanceKind, spawn_mock_gateway}; +use reqwest::{Client, Response, StatusCode}; +use serde_json::Value; +use tokio::time::timeout; +use uuid::Uuid; + +#[tokio::test] +async fn refuses_non_loopback_bind_addresses() { + let mut config = MockGatewayConfig::for_test(MockInstanceKind::Companion); + config.bind_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::UNSPECIFIED), 0); + let result = spawn_mock_gateway(config).await; + assert!(matches!(result, Err(MockGatewayError::NonLoopbackBind(_)))); +} + +#[tokio::test] +async fn companion_and_operations_streams_are_independent_and_replay_by_cursor() { + let companion = spawn_mock_gateway(MockGatewayConfig::for_test(MockInstanceKind::Companion)) + .await + .unwrap(); + let operations = spawn_mock_gateway(MockGatewayConfig::for_test(MockInstanceKind::Operations)) + .await + .unwrap(); + let client = Client::new(); + + let companion_health: HealthResponse = client + .get(format!("{}/desktop/v1/health", companion.base_url())) + .send() + .await + .unwrap() + .error_for_status() + .unwrap() + .json() + .await + .unwrap(); + let operations_health: HealthResponse = client + .get(format!("{}/desktop/v1/health", operations.base_url())) + .send() + .await + .unwrap() + .error_for_status() + .unwrap() + .json() + .await + .unwrap(); + assert_ne!( + companion_health.server_instance_id, + operations_health.server_instance_id + ); + + let companion_token = login(&client, &companion.base_url()).await; + let operations_token = login(&client, &operations.base_url()).await; + let mut companion_stream = + open_stream(&client, &companion.base_url(), &companion_token, None).await; + let mut operations_stream = + open_stream(&client, &operations.base_url(), &operations_token, None).await; + let mut companion_buffer = String::new(); + let mut operations_buffer = String::new(); + + let shared_event_id = "same-event-id"; + companion + .emit_event(event_for( + shared_event_id, + companion.server_instance_id(), + 1, + )) + .await + .unwrap(); + operations + .emit_event(event_for( + shared_event_id, + operations.server_instance_id(), + 1, + )) + .await + .unwrap(); + + let companion_wire = next_sse_data(&mut companion_stream, &mut companion_buffer).await; + let operations_wire = next_sse_data(&mut operations_stream, &mut operations_buffer).await; + assert_eq!(companion_wire["eventId"], shared_event_id); + assert_eq!(operations_wire["eventId"], shared_event_id); + assert_ne!( + companion_wire["serverInstanceId"], + operations_wire["serverInstanceId"] + ); + + let companion_bound = bind_wire( + companion_wire, + "local-companion", + ActiveSlotKind::Companion, + companion.server_instance_id(), + ); + let operations_bound = bind_wire( + operations_wire, + "local-operations", + ActiveSlotKind::Operations, + operations.server_instance_id(), + ); + assert_eq!(companion_bound.profile_id, "local-companion"); + assert_eq!(operations_bound.profile_id, "local-operations"); + + companion.disconnect_streams(); + let operations_second = operations + .emit_body(GatewayEventBody::Heartbeat(HeartbeatPayload { + interval_ms: 1_000, + })) + .await; + let operations_wire = next_sse_data(&mut operations_stream, &mut operations_buffer).await; + assert_eq!( + operations_wire["eventId"], + operations_second.metadata.event_id + ); + + let companion_second = companion + .emit_body(GatewayEventBody::Heartbeat(HeartbeatPayload { + interval_ms: 1_000, + })) + .await; + drop(companion_stream); + let mut resumed = open_stream( + &client, + &companion.base_url(), + &companion_token, + Some(shared_event_id), + ) + .await; + let mut resumed_buffer = String::new(); + let replayed = next_sse_data(&mut resumed, &mut resumed_buffer).await; + assert_eq!(replayed["eventId"], companion_second.metadata.event_id); + drop(resumed); + drop(operations_stream); + + companion.shutdown().await.unwrap(); + operations.shutdown().await.unwrap(); +} + +#[tokio::test] +async fn duplicate_events_are_emitted_with_the_original_event_id() { + let gateway = spawn_mock_gateway(MockGatewayConfig::for_test(MockInstanceKind::Companion)) + .await + .unwrap(); + let client = Client::new(); + let token = login(&client, &gateway.base_url()).await; + let mut stream = open_stream(&client, &gateway.base_url(), &token, None).await; + let mut buffer = String::new(); + + let event = gateway + .emit_body(GatewayEventBody::Heartbeat(HeartbeatPayload { + interval_ms: 1_000, + })) + .await; + let first = next_sse_data(&mut stream, &mut buffer).await; + assert!(gateway.replay_event(&event.metadata.event_id).await); + let duplicate = next_sse_data(&mut stream, &mut buffer).await; + assert_eq!(first["eventId"], duplicate["eventId"]); + drop(stream); + + gateway.shutdown().await.unwrap(); +} + +#[tokio::test] +async fn rejected_authentication_is_scoped_to_one_instance() { + let companion = spawn_mock_gateway(MockGatewayConfig::for_test(MockInstanceKind::Companion)) + .await + .unwrap(); + let operations = spawn_mock_gateway(MockGatewayConfig::for_test(MockInstanceKind::Operations)) + .await + .unwrap(); + operations.set_auth_mode(mock_gateway::AuthMode::Reject); + let client = Client::new(); + + let companion_response = login_response(&client, &companion.base_url()).await; + let operations_response = login_response(&client, &operations.base_url()).await; + assert!(companion_response.status().is_success()); + assert_eq!(operations_response.status(), StatusCode::UNAUTHORIZED); + + companion.shutdown().await.unwrap(); + operations.shutdown().await.unwrap(); +} + +fn event_for(event_id: &str, server_instance_id: &str, sequence: u64) -> GatewayEvent { + GatewayEvent::new( + EventMetadata::new( + event_id, + server_instance_id, + "2026-01-01T00:00:00Z", + sequence, + ), + GatewayEventBody::Heartbeat(HeartbeatPayload { interval_ms: 1_000 }), + ) +} + +fn bind_wire( + value: Value, + profile_id: &str, + slot: ActiveSlotKind, + expected_server: &str, +) -> BoundGatewayEvent { + let raw: RawProtocolEnvelope = serde_json::from_value(value).unwrap(); + BoundGatewayEvent::bind(raw, profile_id, slot, expected_server).unwrap() +} + +async fn login(client: &Client, base_url: &str) -> String { + let response = login_response(client, base_url) + .await + .error_for_status() + .unwrap(); + response + .json::() + .await + .unwrap() + .access_token +} + +async fn login_response(client: &Client, base_url: &str) -> Response { + client + .post(format!("{base_url}/desktop/v1/auth/login")) + .json(&AuthLoginRequest { + client_id: "integration-client".to_owned(), + device_id: "integration-device".to_owned(), + credential: Uuid::new_v4().to_string(), + capabilities: ClientCapabilities { + protocol_version: PROTOCOL_VERSION.to_owned(), + app_version: "0.1.0-test".to_owned(), + platform: "windows".to_owned(), + features: vec!["events.sse".to_owned()], + }, + }) + .send() + .await + .unwrap() +} + +async fn open_stream( + client: &Client, + base_url: &str, + token: &str, + last_event_id: Option<&str>, +) -> Response { + let mut request = client + .get(format!("{base_url}/desktop/v1/events/stream")) + .bearer_auth(token); + if let Some(last_event_id) = last_event_id { + request = request.header("Last-Event-ID", last_event_id); + } + request.send().await.unwrap().error_for_status().unwrap() +} + +async fn next_sse_data(response: &mut Response, buffer: &mut String) -> Value { + timeout(Duration::from_secs(3), async { + loop { + while let Some(frame_end) = buffer.find("\n\n") { + let frame = buffer[..frame_end].to_owned(); + buffer.drain(..frame_end + 2); + if let Some(data) = frame.lines().find_map(|line| line.strip_prefix("data: ")) { + return serde_json::from_str(data).unwrap(); + } + } + let chunk = response + .chunk() + .await + .unwrap() + .expect("SSE stream closed before an event arrived"); + buffer.push_str(std::str::from_utf8(&chunk).unwrap()); + } + }) + .await + .expect("timed out waiting for SSE data") +} diff --git a/crates/mock-gateway/tests/soak.rs b/crates/mock-gateway/tests/soak.rs new file mode 100644 index 0000000..8036107 --- /dev/null +++ b/crates/mock-gateway/tests/soak.rs @@ -0,0 +1,115 @@ +use std::time::Duration; + +use desktop_protocol::{AuthLoginRequest, AuthLoginResponse, ClientCapabilities, PROTOCOL_VERSION}; +use mock_gateway::{MockGatewayConfig, MockInstanceKind, spawn_mock_gateway}; +use reqwest::{Client, Response}; +use serde_json::Value; +use tokio::time::{Instant, timeout}; +use uuid::Uuid; + +#[tokio::test] +#[ignore = "manual P00 acceptance run: holds two SSE streams for 30 minutes"] +async fn dual_sse_soak_30_minutes_without_cross_routing() { + let companion = spawn_mock_gateway(MockGatewayConfig::new(MockInstanceKind::Companion, 0)) + .await + .unwrap(); + let operations = spawn_mock_gateway(MockGatewayConfig::new(MockInstanceKind::Operations, 0)) + .await + .unwrap(); + let client = Client::new(); + let companion_token = login(&client, &companion.base_url()).await; + let operations_token = login(&client, &operations.base_url()).await; + let mut companion_stream = open_stream(&client, &companion.base_url(), &companion_token).await; + let mut operations_stream = + open_stream(&client, &operations.base_url(), &operations_token).await; + let mut companion_buffer = String::new(); + let mut operations_buffer = String::new(); + let mut companion_events = 0_u64; + let mut operations_events = 0_u64; + let started_at = Instant::now(); + let deadline = started_at + Duration::from_secs(30 * 60); + + while Instant::now() < deadline { + tokio::select! { + event = next_sse_data(&mut companion_stream, &mut companion_buffer) => { + assert_eq!(event["serverInstanceId"], companion.server_instance_id()); + companion_events += 1; + } + event = next_sse_data(&mut operations_stream, &mut operations_buffer) => { + assert_eq!(event["serverInstanceId"], operations.server_instance_id()); + operations_events += 1; + } + } + } + + println!( + "soak summary: elapsed_seconds={} companion_events={} operations_events={}", + started_at.elapsed().as_secs(), + companion_events, + operations_events + ); + assert!(companion_events >= 1_700, "companion stream stalled"); + assert!(operations_events >= 1_700, "operations stream stalled"); + drop(companion_stream); + drop(operations_stream); + companion.shutdown().await.unwrap(); + operations.shutdown().await.unwrap(); +} + +async fn login(client: &Client, base_url: &str) -> String { + client + .post(format!("{base_url}/desktop/v1/auth/login")) + .json(&AuthLoginRequest { + client_id: "soak-client".to_owned(), + device_id: "soak-device".to_owned(), + credential: Uuid::new_v4().to_string(), + capabilities: ClientCapabilities { + protocol_version: PROTOCOL_VERSION.to_owned(), + app_version: "0.1.0-soak".to_owned(), + platform: "windows".to_owned(), + features: vec!["events.sse".to_owned()], + }, + }) + .send() + .await + .unwrap() + .error_for_status() + .unwrap() + .json::() + .await + .unwrap() + .access_token +} + +async fn open_stream(client: &Client, base_url: &str, token: &str) -> Response { + client + .get(format!("{base_url}/desktop/v1/events/stream")) + .bearer_auth(token) + .send() + .await + .unwrap() + .error_for_status() + .unwrap() +} + +async fn next_sse_data(response: &mut Response, buffer: &mut String) -> Value { + timeout(Duration::from_secs(5), async { + loop { + while let Some(frame_end) = buffer.find("\n\n") { + let frame = buffer[..frame_end].to_owned(); + buffer.drain(..frame_end + 2); + if let Some(data) = frame.lines().find_map(|line| line.strip_prefix("data: ")) { + return serde_json::from_str(data).unwrap(); + } + } + let chunk = response + .chunk() + .await + .unwrap() + .expect("SSE stream closed during soak test"); + buffer.push_str(std::str::from_utf8(&chunk).unwrap()); + } + }) + .await + .expect("SSE stream stalled during soak test") +} diff --git a/docs/decisions/ADR-0001-p00-root-workspace-layout.md b/docs/decisions/ADR-0001-p00-root-workspace-layout.md new file mode 100644 index 0000000..5ae6b11 --- /dev/null +++ b/docs/decisions/ADR-0001-p00-root-workspace-layout.md @@ -0,0 +1,36 @@ +# ADR-0001: Use a Root-Level Desktop Application for P00 + +- Status: Accepted +- Date: 2026-07-18 +- Scope: Repository layout and build orchestration + +## Context + +The architecture document illustrates a future monorepo with the desktop application under apps/desktop. The predevelopment workflow separately recommends root-level src and src-tauri directories. P00 has one product application plus supporting protocol and Mock Gateway packages, so an additional application directory would add path and command complexity without isolating a second deployable application. + +## Options considered + +1. Put the desktop application under apps/desktop immediately. +2. Keep the desktop application at the repository root and place reusable development packages under packages. +3. Create separate repositories for the desktop application, protocol, and Mock Gateway. + +## Decision + +P00 uses a root-level React/Vite application and root-level src-tauri directory. Reusable protocol types, fixtures, and the Mock Gateway may live under packages and are managed by the root pnpm workspace. + +Moving the desktop application under apps/desktop is deferred until a second independently deployable application creates a concrete need. + +## Rationale + +- Matches the explicit P00 workflow. +- Keeps Tauri and Vite generated conventions simple. +- Avoids premature monorepo nesting. +- Still permits package-level isolation for protocol and test tooling. +- Does not change the React/Rust security boundary. + +## Consequences + +- Root scripts are the canonical entry points for frontend, Rust, and Tauri checks. +- CI paths refer to src-tauri/Cargo.toml. +- A future layout move will require path updates in scripts, CI, and documentation. +- No package may introduce a second product UI without a separate decision. diff --git a/docs/decisions/ADR-0002-bind-profile-identity-at-rust-connection-boundary.md b/docs/decisions/ADR-0002-bind-profile-identity-at-rust-connection-boundary.md new file mode 100644 index 0000000..db599d1 --- /dev/null +++ b/docs/decisions/ADR-0002-bind-profile-identity-at-rust-connection-boundary.md @@ -0,0 +1,39 @@ +# ADR-0002: Bind Profile Identity at the Rust Connection Boundary + +- Status: Accepted +- Date: 2026-07-18 +- Scope: Protocol identity, dual-instance isolation, and connection lifecycle + +## Context + +The desktop client maintains two simultaneously active connection slots: companion and operations. A remote event can contain identifiers such as profile_id, server_instance_id, conversation_id, and message_id. The remote service is not authoritative for the local profile assignment, and conversation or message identifiers may overlap across servers. + +## Options considered + +1. Merge both SSE streams and route events using remote conversation_id values. +2. Trust a remote profile_id field and route events from a shared client. +3. Maintain one independently owned connection session per active slot and attach the selected local profile identity before events leave the Rust networking layer. + +## Decision + +Each active slot owns an independent REST client, SSE stream, cancellation handle, retry state, Last-Event-ID cursor, and deduplication cache. + +The Rust networking layer binds every accepted event to the locally selected profile_id. A remote profile_id is treated as untrusted protocol data and cannot override local routing. + +Persisted or cached server data is keyed by at least profile_id, server_instance_id, and conversation_id. Message-level data additionally uses message_id where applicable. + +The initial Mock Gateway protocol is explicitly provisional and identified as desktop-v1alpha1 until it is reviewed against a real AstrBot Gateway. + +## Rationale + +- Prevents cross-instance message and authorization confusion. +- Allows either connection to fail, cancel, or reconnect independently. +- Makes the operations-slot security check deterministic. +- Preserves isolation when two servers reuse the same conversation or message IDs. + +## Consequences + +- Shared global retry, cursor, and deduplication state is prohibited. +- Tests must inject identical and malicious identifiers across both mock instances. +- A server identity change freezes local-tool eligibility until the user reconfirms it. +- Real AstrBot compatibility remains unverified while the Gateway is unavailable. diff --git a/docs/decisions/ADR-0003-rust-owned-native-security-boundary.md b/docs/decisions/ADR-0003-rust-owned-native-security-boundary.md new file mode 100644 index 0000000..c7b6d09 --- /dev/null +++ b/docs/decisions/ADR-0003-rust-owned-native-security-boundary.md @@ -0,0 +1,41 @@ +# ADR-0003: Keep Native Security-Critical Capabilities in Rust + +- Status: Accepted +- Date: 2026-07-18 +- Scope: Credentials, diagnostics, local actions, and file transactions + +## Context + +AstrBot Desktop needs Windows Credential Manager access, bounded diagnostics, UI Automation, window capture, event-log queries, and recoverable NAS file transactions. Remote model output, screen content, and file content are untrusted. Exposing generic operating-system execution or unrestricted paths would violate the project security model. + +## Options considered + +1. Expose broad filesystem or command APIs to React and enforce safety in the UI. +2. Add a generic command runner and restrict it through prompts or string validation. +3. Expose only typed, bounded Tauri commands backed by Rust policy checks and Windows-native APIs. + +## Decision + +All credentials, operating-system inspection, local policy decisions, and filesystem mutations remain in Rust. + +React receives only display-safe results, opaque credential references, bounded path-selection tokens, and explicit operation states. It never receives credential values or unrestricted filesystem access. + +The product does not include a shell plugin or any generic PowerShell, CMD, shell, registry-write, keyboard-script, or arbitrary-path execution API. + +Local actions follow schema validation, tool allowlisting, profile and slot validation, path-scope validation, risk classification, authorization, execution, and audit. + +P00 NAS validation uses plan, dry run, temporary copy, size and SHA-256 verification, and atomic destination commit. Source files are preserved; source cleanup is represented only as a non-executed plan field. + +## Rationale + +- Makes security enforcement independent of UI state and remote prompts. +- Limits the native attack surface to explicit operations. +- Keeps secret values out of React, SQLite ordinary fields, logs, and snapshots. +- Preserves source data during an interrupted or failed NAS operation. + +## Consequences + +- Windows-native behavior requires Windows-specific tests and cannot be certified by Linux CI. +- Unsupported or elevated targets must fail safely without privilege escalation. +- New native tools require an explicit schema, allowlist entry, risk level, tests, and audit behavior. +- Destructive cleanup, updater signing, and broader desktop control require separate decisions and authorization. diff --git a/docs/decisions/README.md b/docs/decisions/README.md new file mode 100644 index 0000000..be2a678 --- /dev/null +++ b/docs/decisions/README.md @@ -0,0 +1,5 @@ +# Architecture Decision Records + +Use `ADR-NNNN-short-title.md` for decisions that materially affect the protocol, security model, database schema, public interfaces, or long-term architecture. + +Use `pending-decisions.md` for unresolved or operational questions that do not yet justify an ADR. diff --git a/docs/decisions/pending-decisions.md b/docs/decisions/pending-decisions.md new file mode 100644 index 0000000..5783ed4 --- /dev/null +++ b/docs/decisions/pending-decisions.md @@ -0,0 +1,52 @@ +# Pending Decisions + +## PD-0001: Forgejo transport for the development machine + +- Status: resolved for HTTP push; SSH remains unavailable +- Current value: `ssh://git@localhost:18086/YokiiroBW/AstrBot-Desktop.git` +- Push URL: `http://192.168.31.210:18085/YokiiroBW/AstrBot-Desktop.git` +- Observation: the authenticated Forgejo API confirmed `YokiiroBW/AstrBot-Desktop` existed, was empty, used `main`, and granted push permission before initialization. +- SSH observation: `localhost:18086` refuses connections. `192.168.31.210:18086` answers but rejects the available SSH key. +- Push observation: Git Credential Manager was cleared and reauthenticated without placing a secret in the repository or chat. The approved non-forced HTTP push succeeded and remote `main` now points to `0d12b94`. +- Decision: retain the SSH URL as the fetch URL for future key repair and use the explicitly approved HTTP URL as the push URL for this workflow. +- Safety impact: no force push or history overwrite occurred; `feat/p00-bootstrap` was created from the pushed baseline. + +## PD-0002: P00 branch naming + +- Status: resolved for this predevelopment workflow +- Decision: use `feat/p00-bootstrap` as explicitly required by the workflow and current user request. +- Follow-up: subsequent stages use the branch names in `AGENTS.md`. + +## PD-0003: Node.js release line + +- Status: monitor during bootstrap +- Current environment: Node.js 24. +- Decision: use the installed version initially; pin package-manager and dependency versions in the repository and record any Tauri/Vite incompatibility found by actual builds. + +## PD-0004: P00 source layout + +- Status: resolved for P00 +- Observation: the architecture document illustrates an `apps/desktop` monorepo, while the predevelopment workflow recommends root-level `src` and `src-tauri` directories. +- Decision: keep the single desktop application at the repository root during P00 and use Cargo workspace crates for protocol and Mock Gateway isolation. +- Reason: there is only one application, and the workflow explicitly recommends the root layout; this avoids an extra package layer without preventing a later move if a second application appears. + +## PD-0005: Source cleanup in the NAS Spike + +- Status: resolved for P00 +- Conflict: the implementation task mentions cleanup after verification, while the workflow and safety rules require source preservation and prohibit irreversible tests. +- Decision: P00 always preserves source files and tests cleanup policy only as a non-executed plan field. +- Follow-up: reversible recycle-bin behavior requires a later explicitly authorized Spike. + +## PD-0006: Provisional desktop gateway contract + +- Status: resolved for P00 +- Decision: define a provisional `desktop-v1alpha1` contract and Mock Gateway without claiming compatibility with an unavailable real AstrBot Gateway. +- Follow-up: authentication fields, error codes, event retention, ACK timing, and capability names require a later real-gateway contract review. + +## PD-0007: Repository-local Git author identity + +- Status: resolved +- Decision: the user explicitly approved `YokiiroBW `. +- Implementation: the identity is configured only in this repository. +- Result: two Conventional Commit baseline commits were created on `main`, pushed normally, and followed by scoped feature-branch commits. +- Safety impact: no global Git identity was changed. diff --git a/docs/dependency-review.md b/docs/dependency-review.md new file mode 100644 index 0000000..acd4034 --- /dev/null +++ b/docs/dependency-review.md @@ -0,0 +1,57 @@ +# P00 Dependency Review + +Date: 2026-07-18 + +This review covers direct dependencies introduced for the isolated P00 Spikes. Versions are pinned in +`package.json`, `pnpm-lock.yaml`, `Cargo.toml`, and `Cargo.lock`. ?Maintained? below means the +selected release line is current enough to resolve, compile, lint, test, and build on the audited +toolchain; it is not a promise of future upstream maintenance. + +## Frontend and desktop dependencies + +| Dependency | Purpose | Maintenance and alternatives | Native compile | Permission or attack-surface effect | +| --------------------------------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| React, React DOM | Minimal status UI and future interaction layer | Active release line; alternatives would replace the mandated React baseline | No | Browser-side rendering only | +| Zod | Runtime validation for frontend-facing typed data | Active release line; manual validators are possible but easier to drift | No | Reduces acceptance of malformed data | +| Tauri API and CLI | Mandated Tauri 2 application runtime and build tooling | Active Tauri 2 release line; changing it would violate the baseline | Rust build for the desktop binary | Adds only configured Tauri core capabilities; no shell or broad filesystem plugin is enabled | +| Vite and React plugin | Development server and production web bundle | Active release line; alternative bundlers are unnecessary for P00 | esbuild binaries are dependency-managed | Development/build-time surface only | +| TypeScript and type packages | Static frontend typing | Active release line; no equivalent is needed under the mandated stack | No | Build-time only | +| ESLint, TypeScript ESLint, React lint plugins | Static correctness and hook checks | Active release lines; alternatives provide similar checks | No | Build-time only | +| Prettier | Deterministic formatting | Active release line; alternatives would add no P00 value | No | Build-time only | +| Vitest, Testing Library, jsdom | Frontend unit and component tests | Active release lines; Jest is an alternative with more configuration | Some transitive optional binaries may be platform-specific | Test-only; no release capability | +| Playwright Test | Browser smoke testing | Active release line; WebDriver alternatives are less aligned with the existing test | Browser executable is external to the app | Test-only; browsers are not shipped with the desktop binary | + +## Rust runtime dependencies + +| Dependency group | Purpose | Maintenance and alternatives | Native compile | Permission or attack-surface effect | +| ----------------------------------------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `tauri`, `tauri-build`, `tauri-plugin-single-instance` | Desktop lifecycle, tray, IPC bootstrap, single instance | Mandated and on the Tauri 2 line; no framework substitution approved | Yes | Native window/tray lifecycle only; capabilities remain explicit | +| `reqwest` with rustls, `eventsource-stream`, `futures-util` | REST and SSE clients | Current release lines; manual HTTP/SSE parsing would increase risk | Rustls is compiled in Rust | Outbound HTTP(S) to configured gateways; redirects are disabled | +| `tokio`, `tokio-util` | Independent async connections, cancellation, timers | Current release lines; required by the selected HTTP/server ecosystem | No external native library | Concurrency only; no new OS permission | +| `secrecy`, `zeroize` | Reduce accidental secret exposure and clear owned buffers | Current small crates; custom wrappers are possible but easier to misuse | No | Narrows secret exposure | +| `rusqlite` with bundled SQLite | Disposable schema/isolation Spike and future local storage | Current release line; system SQLite would reduce reproducibility | Yes, bundled SQLite C code | Local database files only; credentials remain excluded | +| `windows` | Typed Windows Credential Manager, UIA, GDI, Event Log, process, and port APIs | Official Microsoft projection; direct FFI is the higher-risk alternative | Links Windows system libraries | Adds only explicitly selected Win32 API feature sets; no input injection, registry write, or shell API | +| `sysinfo` | Read-only process metadata fallback | Current release line; direct Win32-only implementation is an alternative | Platform-specific Rust code | Read-only process inspection | +| `png` | In-memory encoding of one explicitly selected window | Current focused crate; Windows Imaging Component is an alternative | No external library | No disk write; bounded pixel allocation | +| `quick-xml` | Bounded Event Log XML parsing | Current release line; manual parsing is unsafe | No | Parses only returned event XML | +| `regex` | Local redaction and bounded format checks | Widely maintained; manual scanners are possible but error-prone | No | Reduces disclosure risk | +| `serde`, `serde_json`, `toml`, `yaml-rust2` | Typed protocol and bounded configuration fixtures | Active ecosystem crates; handwritten parsers are higher risk | No | Parsing only; file access remains separately authorized | +| `sha2` | File transaction verification | Current cryptographic primitive crate; platform hashing APIs are an alternative | No | Read-only hashing of authorized fixture data | +| `uuid`, `time`, `url` | Identifiers, timestamps, and URL validation | Active ecosystem crates; custom implementations would increase ambiguity | No | Validation and metadata only | +| `thiserror`, `tracing`, `tracing-subscriber` | Structured errors and sanitized diagnostics | Active ecosystem crates; standard-library-only alternatives are more verbose | No | Logs must still pass redaction rules | + +## Protocol and Mock-only dependencies + +| Dependency | Purpose | Maintenance and alternatives | Native compile | Permission or attack-surface effect | +| ------------------------------ | ------------------------------------------------------- | ---------------------------------------------------------------------- | -------------------------- | ------------------------------------------------------------------------ | +| `schemars` | Export checked JSON Schema from canonical Rust types | Active release line; handwritten schema is the drift-prone alternative | No | Build/test tooling only | +| `ts-rs` | Export TypeScript protocol types | Active release line; handwritten duplication is the alternative | No | Build/test tooling only | +| `axum`, `async-stream`, `clap` | Loopback-only dual Mock Gateway and CLI | Active release lines; custom HTTP server code is riskier | No external native library | Mock refuses non-loopback bind addresses and is not a release dependency | +| `tempfile` | Disposable database, log, and file-transaction fixtures | Active release line; manual temp naming is less safe | No | Test-only generated paths | + +## Review outcome + +- No dependency exposes arbitrary PowerShell, CMD, shell, keyboard, mouse, registry-write, or unrestricted filesystem execution. +- Native compilation is limited to the mandated Tauri/Windows stack and bundled SQLite. +- Mock and test dependencies do not enter the release dependency graph. +- Dependency updates require lockfile review, the full P00 check set, and a repeat of affected Windows Spikes. diff --git a/docs/implementation-plan.md b/docs/implementation-plan.md new file mode 100644 index 0000000..c7e78c5 --- /dev/null +++ b/docs/implementation-plan.md @@ -0,0 +1,36 @@ +# P00 Bootstrap Implementation Plan + +## Objective + +Establish a reproducible Tauri 2 + React + TypeScript + Rust baseline and complete the high-risk technical Spikes required before formal feature development. + +## Ordered work + +1. Normalize repository documents and Git metadata on `main`. +2. Verify Forgejo is empty before the first `main` push; never overwrite remote history. +3. Create `feat/p00-bootstrap` from the pushed `main` baseline. +4. Establish the Tauri 2 application and typed frontend-to-Rust IPC. +5. Implement two independent REST/SSE clients and a dual-instance Mock Gateway. +6. Verify Windows secure credential CRUD without exposing secret values to React or logs. +7. Verify bounded Windows diagnostics: foreground window, UI Automation, selected-window capture, process information, event logs, ports, network targets, authorized log tails, configuration parsing, and redaction. +8. Verify NAS transactions only in a dedicated generated fixture directory: dry run, temporary copy, size/hash verification, atomic commit, conflict handling, interruption recovery, and source preservation. +9. Define protocol schemas and capability negotiation types. +10. Add frontend, Rust, integration, and Forgejo CI checks. +11. Run and record all checks, commit by independently verifiable increments, and push the feature branch without merging `main`. + +## Safety gates + +- No arbitrary command execution is exposed by product code. +- No real credential is used in fixtures, logs, snapshots, or commits. +- No NAS Spike touches an existing user file or directory. +- No remote branch is changed until `git ls-remote` succeeds and remote history is reviewed. +- No test or build is marked successful without captured execution results. + +## Current handoff status + +- Rust/MSVC/Tauri are verified and no longer block local work. +- Git Credential Manager reauthentication succeeded and the non-forced HTTP push created the remote `main` baseline at `0d12b94`. +- Development is active on `feat/p00-bootstrap`; the remaining repository handoff step is a normal push of this feature branch. +- The configured SSH fetch endpoint still refuses connections and the LAN SSH endpoint rejects the available key, but the approved HTTP push URL is operational. +- Forgejo runner labels/jobs remain unverified, so the committed workflow is not claimed successful. +- Real UNC execution still requires a user-authorized disposable fixture. diff --git a/docs/progress.md b/docs/progress.md new file mode 100644 index 0000000..98321be --- /dev/null +++ b/docs/progress.md @@ -0,0 +1,72 @@ +# Development Progress + +## Current phase + +P00 bootstrap implementation and high-risk Spike verification is complete; the feature branch is published and awaiting user PR review. + +## Completed + +- Read `AGENTS.md` and all authoritative architecture, implementation, and Forgejo workflow documents. +- Verified the Windows, Git, Node.js, package-manager, WebView2, Rust, Tauri, and MSVC environment. +- Initialized a local Git repository on `main`. +- Configured `origin` as `ssh://git@localhost:18086/YokiiroBW/AstrBot-Desktop.git`. +- Verified through authenticated Forgejo API and HTTP Git that the remote repository existed, was empty, used `main`, and granted push permission before the baseline push. +- Reauthenticated through Git Credential Manager and non-forced pushed the `main` baseline to Forgejo at `0d12b94`. +- Created and switched to `feat/p00-bootstrap` from the pushed `main` baseline. +- Built the Tauri 2 + React + TypeScript + Rust skeleton with tray, single-instance, CSP, and minimal `core:default` capability. +- Implemented independent companion/operations REST and SSE clients and passed the corrected 30-minute soak. +- Implemented and tested Windows Credential Manager, UI Automation, selected-window capture, Event Log, process, port, foreground-window, authorized log-tail, configuration parsing, and redaction Spikes. +- Implemented and tested composite-key SQLite isolation and recoverable local file transactions with source preservation. +- Added provisional protocol types, ten JSON Schemas, TypeScript exports, drift checks, and two loopback-only Mock Gateway instances. +- Added frontend, Playwright, Rust, integration, Windows-provider, soak, and Forgejo CI entry points. +- Built the Windows release executable and SHA-256-recorded NSIS installer. +- Added dependency, Spike, progress, changelog, and pending-decision records. +- Committed the implementation, test, and CI increments with Conventional Commit subjects. + +## In progress + +- Preparing the final PR draft and handoff report without merging `main`. + +## Remaining + +- Open and review the Forgejo PR from `feat/p00-bootstrap` to `main`; do not merge automatically. +- Run the Forgejo workflow when a compatible runner is available. +- Execute a real UNC transaction only after an authorized disposable fixture is supplied. +- Add the combined end-to-end test that keeps configured streams active while the real Tauri window is hidden to tray. + +## Blockers + +- Configured Forgejo SSH `localhost:18086` refuses connections. +- LAN SSH `192.168.31.210:18086` responds but rejects the available public key. +- HTTP Git push is operational after Git Credential Manager reauthentication and is no longer a blocker. +- Forgejo runner labels/jobs could not be verified; the jobs API endpoint returned 404. + +## Test status + +- `pnpm check:frontend`: passed; 1 Vitest test and production Vite build. +- `pnpm test:e2e`: passed; 1 Chromium smoke test. +- Rust fmt/check/Clippy with warnings denied: passed. +- `cargo test --workspace`: 40 passed, 2 explicit manual tests ignored. +- Controlled Windows UIA/PrintWindow smoke: 1 passed. +- Corrected dual-SSE soak: 1800.02 seconds, 1800 companion events, 1801 operations events, passed. +- Protocol Schema drift check: passed. +- Tauri development smoke, release executable, and NSIS installer build: passed. +- pnpm 11.9.0 frozen lockfile-only validation: passed using a local temporary store to avoid the pnpm UNC project-registry limitation. +- Forgejo CI and a real UNC transaction were not executed and are not claimed successful. + +## Current branch + +`feat/p00-bootstrap` + +## Recent commits + +- `5e6e8d5 docs(project): add architecture and implementation specifications` +- `0d12b94 chore(repo): initialize repository and ignore rules` +- `01607c6 feat(p00): add Tauri desktop spike foundation` +- `69b432b test(p00): add frontend browser rust and windows checks` +- `d4af979 ci(forgejo): add portable and windows quality workflows` +- `353a439 docs(p00): record spike results and unresolved boundaries` + +## Next step + +Provide the verified test report and PR draft. The user can then review the Forgejo diff and decide whether to merge; `main` remains unchanged by this workflow. diff --git a/docs/protocol/README.md b/docs/protocol/README.md new file mode 100644 index 0000000..cd5ea8d --- /dev/null +++ b/docs/protocol/README.md @@ -0,0 +1,5 @@ +# Desktop Gateway Protocol + +This directory contains versioned schemas and examples for the stable AstrBot Desktop Gateway boundary. The desktop client must not depend directly on AstrBot internal APIs. + +All inbound events are bound to the local connection profile in the Rust connection layer. A server-supplied local `profile_id` is never trusted as the routing authority. diff --git a/docs/protocol/v1/README.md b/docs/protocol/v1/README.md new file mode 100644 index 0000000..e1cc330 --- /dev/null +++ b/docs/protocol/v1/README.md @@ -0,0 +1,49 @@ +# AstrBot Desktop Gateway Protocol v1 + +Status: provisional P00 contract for desktop development and the local Mock Gateway. +Compatibility with a real AstrBot Gateway must not be claimed until the server-side contract is reviewed. + +## Source of truth + +Rust types in `crates/desktop-protocol` are authoritative. JSON Schema files in `schemas/` are generated and checked with: + +```text +cargo run -p desktop-protocol --example export_schemas -- --write +cargo run -p desktop-protocol --example export_schemas +``` + +Generated Schema files must not be edited manually. + +## Trust boundary + +An inbound `profileId` is an untrusted server hint. The Rust connection object binds each accepted event to its local `profile_id` and `companion` or `operations` slot. `serverInstanceId` must match the identity obtained from `server-info`. + +The React application never connects directly to this protocol and never receives access or refresh tokens. + +## Versioning + +- REST prefix: `/desktop/v1` +- Envelope version: `1.0` +- Breaking wire changes require a new major REST prefix and protocol version. +- Unknown event types are reported as unsupported and safely skipped; they are not routed to the UI. +- Security-sensitive payloads reject unknown outer fields. + +## Mock instances + +Run each instance in a separate process when manually testing independent failure: + +```text +cargo run -p mock-gateway -- --instance companion --port 43101 +cargo run -p mock-gateway -- --instance operations --port 43102 +``` + +The Mock Gateway refuses non-loopback bind addresses. It uses only runtime-generated mock credentials, has no shell/file/NAS capability, and is not a Tauri release dependency. + +Available fixed scenarios: + +- `steady` +- `disconnect-once` +- `duplicate-events` +- `auth-reject` + +The 30-minute dual-SSE soak is an explicit local Spike acceptance run and must be recorded separately; its result is not implied by unit tests. diff --git a/docs/protocol/v1/examples/companion-message-delta.json b/docs/protocol/v1/examples/companion-message-delta.json new file mode 100644 index 0000000..b672f35 --- /dev/null +++ b/docs/protocol/v1/examples/companion-message-delta.json @@ -0,0 +1,14 @@ +{ + "protocolVersion": "1.0", + "eventId": "companion-event-000001", + "serverInstanceId": "mock-companion-1", + "conversationId": "same-conversation", + "messageId": "companion-message-000001", + "timestamp": "2026-01-01T00:00:00Z", + "sequence": 1, + "eventType": "message.delta", + "payload": { + "delta": "Deterministic companion response", + "index": 0 + } +} diff --git a/docs/protocol/v1/examples/health-companion.json b/docs/protocol/v1/examples/health-companion.json new file mode 100644 index 0000000..e713362 --- /dev/null +++ b/docs/protocol/v1/examples/health-companion.json @@ -0,0 +1,5 @@ +{ + "status": "ok", + "protocolVersion": "1.0", + "serverInstanceId": "mock-companion-1" +} diff --git a/docs/protocol/v1/examples/operations-tool-proposal.json b/docs/protocol/v1/examples/operations-tool-proposal.json new file mode 100644 index 0000000..d0e0575 --- /dev/null +++ b/docs/protocol/v1/examples/operations-tool-proposal.json @@ -0,0 +1,23 @@ +{ + "protocolVersion": "1.0", + "eventId": "operations-event-000001", + "serverInstanceId": "mock-operations-1", + "conversationId": "same-conversation", + "timestamp": "2030-01-01T00:00:00Z", + "sequence": 1, + "eventType": "tool.proposal", + "payload": { + "actionId": "mock-action-event-log-1", + "toolName": "query_recent_event_logs", + "reason": "Inspect a bounded set of recent Application events", + "riskLevel": "read", + "arguments": { + "provider": "Application", + "sinceMinutes": 15, + "maxEntries": 20 + }, + "requestedAt": "2030-01-01T00:00:00Z", + "expiresAt": "2030-01-01T00:05:00Z", + "requiresApproval": true + } +} diff --git a/docs/protocol/v1/examples/server-capabilities-operations.json b/docs/protocol/v1/examples/server-capabilities-operations.json new file mode 100644 index 0000000..738a316 --- /dev/null +++ b/docs/protocol/v1/examples/server-capabilities-operations.json @@ -0,0 +1,18 @@ +{ + "protocolVersions": ["1.0"], + "features": [ + "auth.refresh", + "chat.text", + "events.ack", + "events.sse", + "local-actions.proposals", + "diagnostics.readonly" + ], + "localActionTools": ["query_recent_event_logs"], + "limits": { + "maxEventBytes": 262144, + "maxMessageBytes": 65536, + "replayWindowEvents": 256, + "maxActiveConnections": 2 + } +} diff --git a/docs/protocol/v1/http.md b/docs/protocol/v1/http.md new file mode 100644 index 0000000..8c104b2 --- /dev/null +++ b/docs/protocol/v1/http.md @@ -0,0 +1,54 @@ +# Desktop Gateway v1 HTTP and SSE surface + +## Public discovery + +```text +GET /desktop/v1/health +GET /desktop/v1/server-info +GET /desktop/v1/capabilities +``` + +`server-info.serverInstanceId` becomes the expected server identity for the active connection. A later mismatch freezes that connection rather than silently rebinding it. + +## Authentication + +```text +POST /desktop/v1/auth/login +POST /desktop/v1/auth/refresh +``` + +Credentials and returned tokens remain in the Rust layer. Request and response bodies containing credential material must not derive or use unrestricted debug logging. + +## Messaging and events + +```text +POST /desktop/v1/messages +GET /desktop/v1/events/stream +POST /desktop/v1/events/{event_id}/ack +``` + +SSE frames carry both the SSE `id` and the complete JSON event envelope in `data`. Reconnect uses the `Last-Event-ID` request header. Replay and de-duplication are scoped to the local connection profile, so the same event ID on two server instances remains two distinct events. + +Initial event types: + +```text +system.heartbeat +message.delta +message.completed +message.proactive +agent.status +tool.proposal +capabilities.changed +error +``` + +## Local action reporting + +```text +POST /desktop/v1/local-actions/{action_id}/accepted +POST /desktop/v1/local-actions/{action_id}/rejected +POST /desktop/v1/local-actions/{action_id}/progress +POST /desktop/v1/local-actions/{action_id}/result +``` + +A `tool.proposal` is only an untrusted proposal. Schema validation, tool registry validation, slot/profile checks, server identity verification, expiry checks, local policy, and user authorization happen before any local execution. diff --git a/docs/protocol/v1/schemas/README.md b/docs/protocol/v1/schemas/README.md new file mode 100644 index 0000000..b518ec1 --- /dev/null +++ b/docs/protocol/v1/schemas/README.md @@ -0,0 +1,30 @@ +# Generated JSON Schemas + +This directory is populated from the authoritative Rust types by: + +```text +cargo run -p desktop-protocol --example export_schemas -- --write +``` + +The non-writing form checks committed files for semantic equality and fails if they are missing or stale: + +```text +cargo run -p desktop-protocol --example export_schemas +``` + +Expected generated files: + +```text +connection-profile.schema.json +connection-slot.schema.json +server-capabilities.schema.json +client-capabilities.schema.json +protocol-envelope.schema.json +gateway-event.schema.json +tool-proposal.schema.json +tool-result.schema.json +diagnostic-bundle.schema.json +file-transfer-plan.schema.json +``` + +No generated files are claimed current until the Rust toolchain has run the exporter successfully. diff --git a/docs/protocol/v1/schemas/client-capabilities.schema.json b/docs/protocol/v1/schemas/client-capabilities.schema.json new file mode 100644 index 0000000..1492e6b --- /dev/null +++ b/docs/protocol/v1/schemas/client-capabilities.schema.json @@ -0,0 +1,29 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "appVersion": { + "type": "string" + }, + "features": { + "items": { + "type": "string" + }, + "type": "array" + }, + "platform": { + "type": "string" + }, + "protocolVersion": { + "type": "string" + } + }, + "required": [ + "protocolVersion", + "appVersion", + "platform", + "features" + ], + "title": "ClientCapabilities", + "type": "object" +} diff --git a/docs/protocol/v1/schemas/connection-profile.schema.json b/docs/protocol/v1/schemas/connection-profile.schema.json new file mode 100644 index 0000000..30e8cf7 --- /dev/null +++ b/docs/protocol/v1/schemas/connection-profile.schema.json @@ -0,0 +1,128 @@ +{ + "$defs": { + "ActiveSlotKind": { + "enum": [ + "companion", + "operations" + ], + "type": "string" + }, + "AstrBotProfileRole": { + "enum": [ + "companion", + "operations", + "general" + ], + "type": "string" + }, + "AuthenticationType": { + "enum": [ + "device-token", + "api-key" + ], + "type": "string" + } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "allowInsecureHttp": { + "default": false, + "type": "boolean" + }, + "authenticationType": { + "$ref": "#/$defs/AuthenticationType" + }, + "autoConnect": { + "default": false, + "type": "boolean" + }, + "autoConnectSlot": { + "anyOf": [ + { + "$ref": "#/$defs/ActiveSlotKind" + }, + { + "type": "null" + } + ] + }, + "baseUrl": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "credentialReference": { + "type": [ + "string", + "null" + ] + }, + "displayName": { + "type": "string" + }, + "eventStreamUrl": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + }, + "lastConnectedAt": { + "type": [ + "string", + "null" + ] + }, + "localToolPolicyId": { + "type": [ + "string", + "null" + ] + }, + "pinnedCertificateFingerprint": { + "type": [ + "string", + "null" + ] + }, + "protocolVersion": { + "type": [ + "string", + "null" + ] + }, + "role": { + "$ref": "#/$defs/AstrBotProfileRole" + }, + "serverInstanceId": { + "type": [ + "string", + "null" + ] + }, + "serverVersion": { + "type": [ + "string", + "null" + ] + }, + "updatedAt": { + "type": "string" + } + }, + "required": [ + "id", + "displayName", + "role", + "baseUrl", + "authenticationType", + "createdAt", + "updatedAt" + ], + "title": "ConnectionProfile", + "type": "object" +} diff --git a/docs/protocol/v1/schemas/connection-slot.schema.json b/docs/protocol/v1/schemas/connection-slot.schema.json new file mode 100644 index 0000000..607c6ca --- /dev/null +++ b/docs/protocol/v1/schemas/connection-slot.schema.json @@ -0,0 +1,80 @@ +{ + "$defs": { + "ActiveSlotKind": { + "enum": [ + "companion", + "operations" + ], + "type": "string" + }, + "ConnectionState": { + "enum": [ + "disconnected", + "connecting", + "authenticating", + "syncing", + "connected", + "reconnecting", + "authExpired", + "incompatible", + "serverUnavailable", + "offline", + "certificateChanged", + "fatalError" + ], + "type": "string" + } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "activeConversationId": { + "type": [ + "string", + "null" + ] + }, + "lastConnectedAt": { + "type": [ + "string", + "null" + ] + }, + "lastEventId": { + "type": [ + "string", + "null" + ] + }, + "profileId": { + "type": [ + "string", + "null" + ] + }, + "serverInstanceId": { + "type": [ + "string", + "null" + ] + }, + "slot": { + "$ref": "#/$defs/ActiveSlotKind" + }, + "state": { + "$ref": "#/$defs/ConnectionState" + }, + "unreadCount": { + "default": 0, + "format": "uint32", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "slot", + "state" + ], + "title": "ConnectionSlot", + "type": "object" +} diff --git a/docs/protocol/v1/schemas/diagnostic-bundle.schema.json b/docs/protocol/v1/schemas/diagnostic-bundle.schema.json new file mode 100644 index 0000000..f78fb55 --- /dev/null +++ b/docs/protocol/v1/schemas/diagnostic-bundle.schema.json @@ -0,0 +1,152 @@ +{ + "$defs": { + "DiagnosticAttachmentReference": { + "additionalProperties": false, + "properties": { + "attachmentId": { + "type": "string" + }, + "mimeType": { + "type": "string" + }, + "sha256": { + "type": "string" + }, + "sizeBytes": { + "format": "uint64", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "attachmentId", + "mimeType", + "sizeBytes", + "sha256" + ], + "type": "object" + }, + "DiagnosticEntry": { + "additionalProperties": false, + "properties": { + "content": { + "type": [ + "string", + "null" + ] + }, + "entryId": { + "type": "string" + }, + "kind": { + "$ref": "#/$defs/DiagnosticEntryKind" + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "redactions": { + "default": [], + "items": { + "$ref": "#/$defs/RedactionSummary" + }, + "type": "array" + }, + "sourceLabel": { + "type": "string" + }, + "summary": { + "type": "string" + }, + "truncated": { + "default": false, + "type": "boolean" + } + }, + "required": [ + "entryId", + "kind", + "sourceLabel", + "summary" + ], + "type": "object" + }, + "DiagnosticEntryKind": { + "enum": [ + "system", + "window", + "process", + "eventLog", + "network", + "port", + "service", + "logTail", + "configuration" + ], + "type": "string" + }, + "RedactionSummary": { + "additionalProperties": false, + "properties": { + "category": { + "type": "string" + }, + "count": { + "format": "uint32", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "category", + "count" + ], + "type": "object" + } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "attachments": { + "default": [], + "items": { + "$ref": "#/$defs/DiagnosticAttachmentReference" + }, + "type": "array" + }, + "bundleId": { + "type": "string" + }, + "entries": { + "items": { + "$ref": "#/$defs/DiagnosticEntry" + }, + "type": "array" + }, + "generatedAt": { + "type": "string" + }, + "scope": { + "items": { + "type": "string" + }, + "type": "array" + }, + "totalBytes": { + "format": "uint64", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "bundleId", + "generatedAt", + "scope", + "entries", + "totalBytes" + ], + "title": "DiagnosticBundle", + "type": "object" +} diff --git a/docs/protocol/v1/schemas/file-transfer-plan.schema.json b/docs/protocol/v1/schemas/file-transfer-plan.schema.json new file mode 100644 index 0000000..8c94771 --- /dev/null +++ b/docs/protocol/v1/schemas/file-transfer-plan.schema.json @@ -0,0 +1,114 @@ +{ + "$defs": { + "ConflictAction": { + "enum": [ + "copy", + "rename", + "skip", + "ask" + ], + "type": "string" + }, + "FileTransferPlanItem": { + "additionalProperties": false, + "properties": { + "categoryReason": { + "type": "string" + }, + "conflictAction": { + "$ref": "#/$defs/ConflictAction" + }, + "destinationRelativePath": { + "type": "string" + }, + "displaySourcePath": { + "description": "Display-only value for local review; never used as an execution path.", + "type": "string" + }, + "sizeBytes": { + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "sourcePathToken": { + "description": "Opaque, short-lived mapping held by the local client. Never a raw path.", + "type": "string" + } + }, + "required": [ + "sourcePathToken", + "displaySourcePath", + "destinationRelativePath", + "sizeBytes", + "categoryReason", + "conflictAction" + ], + "type": "object" + }, + "SourceCleanupPolicy": { + "enum": [ + "keep", + "recycle" + ], + "type": "string" + } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "conflictCount": { + "format": "uint32", + "minimum": 0, + "type": "integer" + }, + "expiresAt": { + "type": "string" + }, + "items": { + "items": { + "$ref": "#/$defs/FileTransferPlanItem" + }, + "type": "array" + }, + "nasTargetId": { + "type": "string" + }, + "planId": { + "type": "string" + }, + "profileId": { + "description": "Locally bound profile. A remote value must never select the executor.", + "type": "string" + }, + "sourceCleanupPolicy": { + "$ref": "#/$defs/SourceCleanupPolicy" + }, + "sourceSelectionId": { + "type": "string" + }, + "totalBytes": { + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "warningCount": { + "format": "uint32", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "planId", + "profileId", + "sourceSelectionId", + "nasTargetId", + "items", + "totalBytes", + "conflictCount", + "warningCount", + "sourceCleanupPolicy", + "expiresAt" + ], + "title": "FileTransferPlan", + "type": "object" +} diff --git a/docs/protocol/v1/schemas/gateway-event.schema.json b/docs/protocol/v1/schemas/gateway-event.schema.json new file mode 100644 index 0000000..911daa5 --- /dev/null +++ b/docs/protocol/v1/schemas/gateway-event.schema.json @@ -0,0 +1,422 @@ +{ + "$defs": { + "AgentStatusPayload": { + "additionalProperties": false, + "properties": { + "detail": { + "type": [ + "string", + "null" + ] + }, + "state": { + "type": "string" + } + }, + "required": [ + "state" + ], + "type": "object" + }, + "CapabilityLimits": { + "additionalProperties": false, + "properties": { + "maxActiveConnections": { + "format": "uint8", + "maximum": 255, + "minimum": 0, + "type": "integer" + }, + "maxEventBytes": { + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "maxMessageBytes": { + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "replayWindowEvents": { + "format": "uint32", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "maxEventBytes", + "maxMessageBytes", + "replayWindowEvents", + "maxActiveConnections" + ], + "type": "object" + }, + "FinishReason": { + "enum": [ + "stop", + "cancelled", + "error" + ], + "type": "string" + }, + "GatewayErrorPayload": { + "additionalProperties": false, + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "retryable": { + "type": "boolean" + } + }, + "required": [ + "code", + "message", + "retryable" + ], + "type": "object" + }, + "HeartbeatPayload": { + "additionalProperties": false, + "properties": { + "intervalMs": { + "format": "uint64", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "intervalMs" + ], + "type": "object" + }, + "MessageCompletedPayload": { + "additionalProperties": false, + "properties": { + "content": { + "type": [ + "string", + "null" + ] + }, + "finishReason": { + "$ref": "#/$defs/FinishReason" + } + }, + "required": [ + "finishReason" + ], + "type": "object" + }, + "MessageDeltaPayload": { + "additionalProperties": false, + "properties": { + "delta": { + "type": "string" + }, + "index": { + "format": "uint32", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "delta", + "index" + ], + "type": "object" + }, + "ProactiveMessagePayload": { + "additionalProperties": false, + "properties": { + "content": { + "type": "string" + }, + "notificationTitle": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "content" + ], + "type": "object" + }, + "RiskLevel": { + "enum": [ + "read", + "reversible-write", + "destructive" + ], + "type": "string" + }, + "ServerCapabilities": { + "additionalProperties": false, + "properties": { + "features": { + "items": { + "type": "string" + }, + "type": "array" + }, + "limits": { + "$ref": "#/$defs/CapabilityLimits" + }, + "localActionTools": { + "default": [], + "items": { + "type": "string" + }, + "type": "array" + }, + "protocolVersions": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "protocolVersions", + "features", + "limits" + ], + "type": "object" + }, + "ToolProposal": { + "additionalProperties": false, + "properties": { + "actionId": { + "type": "string" + }, + "arguments": true, + "expiresAt": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "requestedAt": { + "type": "string" + }, + "requiresApproval": { + "type": "boolean" + }, + "riskLevel": { + "$ref": "#/$defs/RiskLevel" + }, + "toolName": { + "type": "string" + } + }, + "required": [ + "actionId", + "toolName", + "reason", + "riskLevel", + "arguments", + "requestedAt", + "expiresAt", + "requiresApproval" + ], + "type": "object" + } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "oneOf": [ + { + "properties": { + "eventType": { + "const": "system.heartbeat", + "type": "string" + }, + "payload": { + "$ref": "#/$defs/HeartbeatPayload" + } + }, + "required": [ + "eventType", + "payload" + ], + "type": "object" + }, + { + "properties": { + "eventType": { + "const": "message.delta", + "type": "string" + }, + "payload": { + "$ref": "#/$defs/MessageDeltaPayload" + } + }, + "required": [ + "eventType", + "payload" + ], + "type": "object" + }, + { + "properties": { + "eventType": { + "const": "message.completed", + "type": "string" + }, + "payload": { + "$ref": "#/$defs/MessageCompletedPayload" + } + }, + "required": [ + "eventType", + "payload" + ], + "type": "object" + }, + { + "properties": { + "eventType": { + "const": "message.proactive", + "type": "string" + }, + "payload": { + "$ref": "#/$defs/ProactiveMessagePayload" + } + }, + "required": [ + "eventType", + "payload" + ], + "type": "object" + }, + { + "properties": { + "eventType": { + "const": "agent.status", + "type": "string" + }, + "payload": { + "$ref": "#/$defs/AgentStatusPayload" + } + }, + "required": [ + "eventType", + "payload" + ], + "type": "object" + }, + { + "properties": { + "eventType": { + "const": "tool.proposal", + "type": "string" + }, + "payload": { + "$ref": "#/$defs/ToolProposal" + } + }, + "required": [ + "eventType", + "payload" + ], + "type": "object" + }, + { + "properties": { + "eventType": { + "const": "capabilities.changed", + "type": "string" + }, + "payload": { + "$ref": "#/$defs/ServerCapabilities" + } + }, + "required": [ + "eventType", + "payload" + ], + "type": "object" + }, + { + "properties": { + "eventType": { + "const": "error", + "type": "string" + }, + "payload": { + "$ref": "#/$defs/GatewayErrorPayload" + } + }, + "required": [ + "eventType", + "payload" + ], + "type": "object" + } + ], + "properties": { + "conversationId": { + "type": [ + "string", + "null" + ] + }, + "eventId": { + "type": "string" + }, + "messageId": { + "type": [ + "string", + "null" + ] + }, + "profileId": { + "description": "Untrusted server hint. Local routing must use `BoundGatewayEvent.profile_id`.", + "type": [ + "string", + "null" + ] + }, + "protocolVersion": { + "type": "string" + }, + "requestId": { + "type": [ + "string", + "null" + ] + }, + "sequence": { + "format": "uint64", + "minimum": 0, + "type": [ + "integer", + "null" + ] + }, + "serverInstanceId": { + "type": "string" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "timestamp": { + "type": "string" + } + }, + "required": [ + "protocolVersion", + "eventId", + "serverInstanceId", + "timestamp" + ], + "title": "GatewayEvent", + "type": "object" +} diff --git a/docs/protocol/v1/schemas/protocol-envelope.schema.json b/docs/protocol/v1/schemas/protocol-envelope.schema.json new file mode 100644 index 0000000..78e7699 --- /dev/null +++ b/docs/protocol/v1/schemas/protocol-envelope.schema.json @@ -0,0 +1,72 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "Two-stage wire representation used before a payload type is trusted.", + "properties": { + "conversationId": { + "type": [ + "string", + "null" + ] + }, + "eventId": { + "type": "string" + }, + "eventType": { + "type": "string" + }, + "messageId": { + "type": [ + "string", + "null" + ] + }, + "payload": true, + "profileId": { + "description": "This value is never used as the local profile binding.", + "type": [ + "string", + "null" + ] + }, + "protocolVersion": { + "type": "string" + }, + "requestId": { + "type": [ + "string", + "null" + ] + }, + "sequence": { + "format": "uint64", + "minimum": 0, + "type": [ + "integer", + "null" + ] + }, + "serverInstanceId": { + "type": "string" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "timestamp": { + "type": "string" + } + }, + "required": [ + "protocolVersion", + "eventType", + "eventId", + "serverInstanceId", + "timestamp", + "payload" + ], + "title": "ProtocolEnvelope", + "type": "object" +} diff --git a/docs/protocol/v1/schemas/server-capabilities.schema.json b/docs/protocol/v1/schemas/server-capabilities.schema.json new file mode 100644 index 0000000..af93f32 --- /dev/null +++ b/docs/protocol/v1/schemas/server-capabilities.schema.json @@ -0,0 +1,70 @@ +{ + "$defs": { + "CapabilityLimits": { + "additionalProperties": false, + "properties": { + "maxActiveConnections": { + "format": "uint8", + "maximum": 255, + "minimum": 0, + "type": "integer" + }, + "maxEventBytes": { + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "maxMessageBytes": { + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "replayWindowEvents": { + "format": "uint32", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "maxEventBytes", + "maxMessageBytes", + "replayWindowEvents", + "maxActiveConnections" + ], + "type": "object" + } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "features": { + "items": { + "type": "string" + }, + "type": "array" + }, + "limits": { + "$ref": "#/$defs/CapabilityLimits" + }, + "localActionTools": { + "default": [], + "items": { + "type": "string" + }, + "type": "array" + }, + "protocolVersions": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "protocolVersions", + "features", + "limits" + ], + "title": "ServerCapabilities", + "type": "object" +} diff --git a/docs/protocol/v1/schemas/tool-proposal.schema.json b/docs/protocol/v1/schemas/tool-proposal.schema.json new file mode 100644 index 0000000..5f49695 --- /dev/null +++ b/docs/protocol/v1/schemas/tool-proposal.schema.json @@ -0,0 +1,50 @@ +{ + "$defs": { + "RiskLevel": { + "enum": [ + "read", + "reversible-write", + "destructive" + ], + "type": "string" + } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "actionId": { + "type": "string" + }, + "arguments": true, + "expiresAt": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "requestedAt": { + "type": "string" + }, + "requiresApproval": { + "type": "boolean" + }, + "riskLevel": { + "$ref": "#/$defs/RiskLevel" + }, + "toolName": { + "type": "string" + } + }, + "required": [ + "actionId", + "toolName", + "reason", + "riskLevel", + "arguments", + "requestedAt", + "expiresAt", + "requiresApproval" + ], + "title": "ToolProposal", + "type": "object" +} diff --git a/docs/protocol/v1/schemas/tool-result.schema.json b/docs/protocol/v1/schemas/tool-result.schema.json new file mode 100644 index 0000000..2c98087 --- /dev/null +++ b/docs/protocol/v1/schemas/tool-result.schema.json @@ -0,0 +1,44 @@ +{ + "$defs": { + "ToolResultStatus": { + "enum": [ + "rejected", + "completed", + "failed", + "cancelled" + ], + "type": "string" + } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "actionId": { + "type": "string" + }, + "completedAt": { + "type": "string" + }, + "errorCode": { + "type": [ + "string", + "null" + ] + }, + "result": true, + "status": { + "$ref": "#/$defs/ToolResultStatus" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "actionId", + "status", + "summary", + "completedAt" + ], + "title": "ToolResult", + "type": "object" +} diff --git a/docs/reports/p00-bootstrap-report.md b/docs/reports/p00-bootstrap-report.md new file mode 100644 index 0000000..f9543ba --- /dev/null +++ b/docs/reports/p00-bootstrap-report.md @@ -0,0 +1,130 @@ +# P00 Bootstrap Verification and PR Draft + +Date: 2026-07-18 + +## Delivery status + +Local implementation and verification are complete. Git Credential Manager reauthentication succeeded, the `main` baseline was pushed non-forced to Forgejo at `0d12b94`, and `feat/p00-bootstrap` was published and verified at `353a439`. + +Implementation, test, CI, and documentation increments are committed on the feature branch. Forgejo CI has not run because runner availability remains unverified; no CI success is claimed. + +No merge to `main` has been performed. + +## Environment + +- Windows NT 10.0.26100.0, PowerShell 5.1.26100.7920 +- Git 2.54.0.windows.1 +- Node.js 24.17.0, npm 11.13.0, pnpm 11.9.0 +- rustc/cargo 1.97.1 +- Tauri CLI 2.11.4, Tauri crate 2.11.5 +- WebView2 Runtime 131.0.2903.86 +- MSVC link environment verified by debug/release and NSIS builds + +## Completed scope + +- Tauri 2 + React + TypeScript + Vite + Rust skeleton, tray, single-instance, CSP, and minimal capability configuration. +- Two independent companion/operations REST and SSE clients with local profile binding, state, cancellation, reconnect, Last-Event-ID, and deduplication. +- Windows Credential Manager CRUD with generated fake credentials and cleanup. +- Bounded UI Automation, selected-window in-memory PrintWindow capture, closed-window identity rejection, Event Log, process, port, foreground-window, authorized log-tail, configuration parsing, and redaction Spikes. +- Composite-key SQLite isolation. +- Recoverable plan/dry-run/copy/size+SHA-256 verify/atomic commit file transactions with ask/rename/skip and source preservation. +- Provisional desktop-v1alpha1 protocol types, TypeScript exports, ten JSON Schemas, and dual loopback Mock Gateway. +- Frontend, browser, Rust, integration, Windows-provider, soak, and Forgejo CI entry points. +- Dependency review, Spike reports, progress records, and changelog. + +## Test report + +| Check | Result | +| ------------------------------------------------------- | ------------------------------------------------------------------------------ | +| pnpm frozen lockfile-only validation | Passed with pnpm 11.9.0 and a local temporary store; no dependency scripts run | +| Frontend format, ESLint, TypeScript, Vitest, Vite build | Passed; 1 Vitest test | +| Playwright Chromium smoke | Passed; 1 test | +| cargo fmt --all -- --check | Passed | +| cargo check --workspace --all-targets | Passed | +| cargo clippy --workspace --all-targets -- -D warnings | Passed | +| cargo test --workspace | Passed; 40 tests, 2 explicit manual tests ignored | +| Controlled Windows UIA/PrintWindow smoke | Passed; 1 test, 0.12 seconds | +| Protocol Schema drift check | Passed | +| Corrected dual-SSE soak | Passed; 1800.02 seconds, companion 1800, operations 1801 | +| Tauri development launch | Passed; `AstrBot Desktop` window responsive and safely stopped | +| Tauri release executable | Passed | +| Tauri NSIS installer | Passed | + +Soak resource samples: + +- Working set: approximately 11.4-12.1 MiB. +- Private memory: approximately 2.0-2.4 MiB. +- Final pre-exit cumulative CPU: 1.38 seconds. +- No cross-routing assertion, stream stall, or failed shutdown in the corrected run. + +NSIS artifact: + +- File: `AstrBot Desktop_0.1.0-alpha.0_x64-setup.exe` +- Size: 3,552,257 bytes +- SHA-256: `BF87DCD13B81C18EFC9A2DB8DE6E201396FFBB9ABA0EABC579A22479C004816C` + +## Security review + +- Tauri window capability contains only `core:default`. +- No shell plugin or product API for PowerShell, CMD, arbitrary shell, input injection, registry write, or unrestricted filesystem execution exists. +- Credential values remain in Rust/Windows Credential Manager; React has no credential read command. +- Repository secret scan found only the documented redaction example and deliberate fake test fixtures. +- File-transaction deletion calls are limited to transaction-owned temporary destination files and generated test-fixture cleanup; P00 never deletes the source. +- No real UNC path, NAS credential, signing key, updater key, private key, or production token was used. + +## Unresolved issues + +1. `ssh://git@localhost:18086/...` refuses connections. +2. `ssh://git@192.168.31.210:18086/...` responds but rejects the available key; approved HTTP push is the working transport. +3. Forgejo CI has not run; runner jobs/labels could not be verified and the jobs API returned 404. +4. Real UNC/SMB behavior is not tested because no authorized disposable fixture was provided. +5. A real elevated or custom-drawn window remains a manual UIA/capture boundary test. +6. The connection layer and tray lifecycle passed separately; configured Gateway sessions are not yet wired into Tauri setup for a combined tray-hidden end-to-end run. +7. Real AstrBot Gateway protocol compatibility is unverified; desktop-v1alpha1 remains provisional. +8. Code signing, updater signing, updater endpoint, and release publication remain outside P00. +9. pnpm 11 project registration cannot create its store symlink when the project/store are on this UNC share; local temporary store plus frozen-store is the verified lockfile-only workaround. + +## Commit list + +Branch commit sequence: + +1. `5e6e8d5 docs(project): add architecture and implementation specifications` +2. `0d12b94 chore(repo): initialize repository and ignore rules` +3. `01607c6 feat(p00): add Tauri desktop spike foundation` +4. `69b432b test(p00): add frontend browser rust and windows checks` +5. `d4af979 ci(forgejo): add portable and windows quality workflows` +6. `353a439 docs(p00): record spike results and unresolved boundaries` +7. `docs(p00): record Forgejo branch publication` + +## Forgejo PR title + +`feat(p00): bootstrap Tauri desktop and validate high-risk spikes` + +## Forgejo PR body + +### Summary + +- bootstrap the Tauri 2 + React + TypeScript + Rust desktop workspace; +- add isolated companion and operations REST/SSE clients and dual Mock Gateway; +- add provisional protocol Schema, Windows secure/native Spikes, SQLite isolation, and recoverable file transactions; +- add frontend, browser, Rust, Windows, soak, and Forgejo CI checks. + +### Verification + +- frontend quality/build and Chromium smoke pass; +- Rust fmt/check/Clippy and 40 normal tests pass; +- controlled UIA/PrintWindow smoke passes; +- corrected 30-minute dual-SSE soak passes with 1800/1801 isolated events; +- Tauri development launch, release executable, and NSIS installer build pass. + +### Known boundaries + +- Forgejo CI is not yet executed; +- real UNC, elevated/custom-drawn window, real AstrBot Gateway, signing, and updater verification remain pending; +- connection tasks are not yet wired into a combined real tray-hidden session test. + +### Safety + +- no arbitrary shell or unrestricted desktop/filesystem capability; +- no real credentials or destructive source-file operations; +- no force push and no automatic merge to `main`. diff --git a/docs/spikes/P00-01-dual-rest-sse-connections.md b/docs/spikes/P00-01-dual-rest-sse-connections.md new file mode 100644 index 0000000..d4e69f8 --- /dev/null +++ b/docs/spikes/P00-01-dual-rest-sse-connections.md @@ -0,0 +1,70 @@ +# P00-01: Dual REST and SSE Connections + +- Status: Connection isolation and 30-minute soak passed; end-to-end tray-hidden wiring remains pending +- Date recorded: 2026-07-18 +- MVP gate: Required before formal dual-connection development + +## Objective + +Verify that one Tauri process can maintain independent companion and operations REST/SSE sessions while the main window is hidden, without event mixing or shared failure state. + +## Environment + +- Host: Windows 11 x64 +- Mock transport: loopback only +- Rust toolchain: rustc/cargo 1.97.1 +- MSVC C++ build tools: verified by native builds +- Forgejo: HTTP Git reachable and baseline pushed; no CI result exists + +## Minimal validation implementation + +The Spike is expected to provide: + +- Two independently constructed REST clients. +- Two independently constructed SSE clients. +- Local companion and operations profile bindings. +- Per-session cancellation, retry, Last-Event-ID, and deduplication state. +- A dual-instance Mock Gateway with health, server-info, capabilities, authentication, SSE, disconnect, and duplicate-event controls. +- Sanitized metrics and state snapshots. + +The Rust connection object must overwrite or ignore any remote profile_id when producing a locally routed event. + +## Required execution + +1. Start Mock A and Mock B on loopback using dynamically allocated ports. +2. Connect both slots and confirm independent health and capability responses. +3. Stream uniquely attributable events from both mocks. +4. Inject identical conversation_id, message_id, and event payload values. +5. Inject a conflicting remote profile_id and confirm the local binding wins. +6. Replay an event_id and confirm it is delivered once. +7. Stop A, verify B continues, then repeat in the other direction. +8. Hide the main window to the tray and verify both streams continue. +9. Run a 30-minute soak and record CPU, memory, reconnect count, event count, and duplicates suppressed. + +## Actual execution result + +Passed for the isolated connection layer. Two loopback Mock Gateways and two independent Rust GatewayClients verified local profile binding, per-slot state/cancellation/Last-Event-ID/deduplication, duplicate suppression, server identity checks, one-slot disconnect/reconnect, and continued events from the unaffected slot. + +The first long run completed the event loop but exposed a test-harness shutdown defect: the two SSE Response values were still alive when graceful Mock shutdown began. The run was correctly recorded as failed, the streams were explicitly dropped before shutdown, event-count output was added, and the full test was restarted from zero. + +The corrected soak passed after 1800.02 seconds with 1800 companion events and 1801 operations events and no server-instance cross-routing assertion. Process samples ranged from about 11.4 to 12.1 MiB working set, about 2.0 to 2.4 MiB private memory, and 1.38 seconds cumulative CPU at the final pre-exit sample. + +Tauri development launch, tray creation, close-to-hide handling, and process responsiveness were verified separately. P00 does not yet wire saved Gateway profiles into the application setup, so a combined end-to-end run that hides the real Tauri window while these two configured streams remain active is still pending formal connection integration. + +## Log summary + +Commands: `cargo test --workspace` and `cargo test -p mock-gateway --test soak -- --ignored --nocapture`. Results: connection/reconnect/dedup integration tests passed; corrected soak passed with the counts and resources above. + +## Known limitations + +- Real AstrBot Gateway compatibility is unverified. +- The provisional protocol may change after a real Gateway review. +- A loopback Mock does not validate TLS, proxy, certificate, or real-network behavior. + +## Security impact + +Profile binding at the Rust connection boundary is mandatory. A merged SSE stream or remote-controlled profile identity could route an operations proposal to the wrong local policy context. + +## Recommendation + +Keep connection ownership per slot and add deterministic clock/backoff injection for unit tests. Do not proceed to formal dual-chat UI until the isolation, failure, and soak checks have recorded results. diff --git a/docs/spikes/P00-02-windows-credential-manager.md b/docs/spikes/P00-02-windows-credential-manager.md new file mode 100644 index 0000000..a8f8f91 --- /dev/null +++ b/docs/spikes/P00-02-windows-credential-manager.md @@ -0,0 +1,59 @@ +# P00-02: Windows Credential Manager + +- Status: Passed on the audited Windows host +- Date recorded: 2026-07-18 +- MVP gate: Required before storing any AstrBot or NAS credential + +## Objective + +Verify create, read, update, and delete operations for a test-only generic credential while keeping the secret value inside Rust and outside React, ordinary SQLite fields, logs, snapshots, and repository files. + +## Environment + +- Host: Windows 11 x64 +- Secure store target: Windows Credential Manager +- Rust toolchain: rustc/cargo 1.97.1 +- MSVC C++ build tools: verified by Rust and Tauri native builds +- Administrative elevation: not permitted or required + +## Minimal validation implementation + +The Spike is expected to expose typed Rust operations that accept a logical credential reference and return metadata or an opaque reference. Secret bytes must use bounded lifetimes and must not implement debug output that reveals their value. + +React may request save, replace, existence, and delete operations, but a read operation must not return the credential value across Tauri IPC. + +## Required execution + +1. Create a uniquely named test-only credential containing a fake generated value. +2. Read it in Rust and compare without printing the value. +3. Replace it and confirm the old value is no longer returned. +4. Delete it and confirm a structured not-found result. +5. Verify missing, denied, oversized, and malformed-reference error paths. +6. Scan application logs, frontend state, SQLite data, snapshots, and terminal output for the fake value. +7. Confirm the test credential is removed at the end. + +## Actual execution result + +Passed. The Windows-only Rust test created a uniquely named generic credential containing a generated fake value, read it inside Rust, replaced it, confirmed the replacement, deleted it, and confirmed the deleted value was unavailable. The cleanup path ran even when an assertion would fail, and a post-run check found no remaining test credential. + +Reference and size validation tests cover empty, malformed, and oversized inputs before native access. The public secure-store surface returns metadata or an opaque reference; it does not expose the secret through Tauri IPC or React. + +The workspace secret scan reported only the security-rule example in `AGENTS.md` and deliberate fake redaction fixtures. No real credential, Authorization header, private key, or NAS secret was found. + +## Log summary + +Command: `cargo test --workspace` on Windows, including the Credential Manager CRUD test. Result: passed. Terminal output contained only test names and result categories; the generated fake secret was never printed. + +## Known limitations + +- Windows Credential Manager behavior cannot be certified by Linux CI. +- Locked sessions, policy restrictions, roaming behavior, and credential-size limits still require Windows tests. +- NAS authentication integration is outside this isolated CRUD Spike. + +## Security impact + +Failure would block all authenticated AstrBot and NAS connections. Falling back to plaintext configuration, SQLite, environment files, or logs is prohibited. + +## Recommendation + +Use the Windows-native credential APIs behind a narrow Rust trait. Persist only a credential reference. Treat inability to access secure storage as an explicit user-visible error rather than a reason to weaken storage. diff --git a/docs/spikes/P00-03-ui-automation-and-window-capture.md b/docs/spikes/P00-03-ui-automation-and-window-capture.md new file mode 100644 index 0000000..a148d7c --- /dev/null +++ b/docs/spikes/P00-03-ui-automation-and-window-capture.md @@ -0,0 +1,64 @@ +# P00-03: UI Automation and Selected-Window Capture + +- Status: Passed for a controlled non-elevated standard dialog; elevated/custom-drawn manual coverage remains +- Date recorded: 2026-07-18 +- MVP gate: Required for bounded error-window diagnostics + +## Objective + +Verify read-only extraction from a standard Windows dialog and a user-selected, single-window capture fallback without running the application as administrator or broadening access to the desktop. + +## Environment + +- Host: Windows 11 x64 +- Target class: standard non-elevated Windows dialog +- Rust toolchain: rustc/cargo 1.97.1 +- MSVC C++ build tools: verified by the Windows test and Tauri build +- Elevated target testing: negative boundary only + +## Minimal validation implementation + +The Spike is expected to: + +- Identify the current foreground window. +- Return bounded title, process, and UI Automation text fields. +- Report unsupported, inaccessible, closed, or elevated targets safely. +- Capture only the window explicitly selected by the user. +- Keep image bytes in Rust until a display-safe preview is produced. +- Delete transient capture data after the diagnostic flow unless the user explicitly saves it. + +## Required execution + +1. Open a standard non-elevated dialog with known text. +2. Read its title and UI Automation text. +3. Verify an unsupported or custom-drawn window produces a structured fallback result. +4. Select one window and capture only its client/window bounds. +5. Verify a closed or invalid handle does not capture another window. +6. Attempt an elevated target and confirm a safe access-denied result without elevation. +7. Confirm transient image data is removed after the test. + +## Actual execution result + +The ignored Windows smoke test opened a test-owned standard MessageBox containing fixed, non-sensitive text. It selected only that foreground HWND, verified title and process identity, read the expected title/body through UI Automation, captured the same selected window through PrintWindow, and validated an in-memory PNG without writing image bytes to disk. + +The test then closed the controlled dialog and verified that the expired HWND identity returned `WindowChanged` and could not capture a replacement window. The test passed in 0.12 seconds. + +An elevated target was not created because that would require a UAC/elevation action outside this bounded Spike. The implementation maps access denied and element-unavailable HRESULTs to structured errors, but a real elevated/custom-drawn target remains an explicit manual boundary test. + +## Log summary + +Command: `cargo test -p astrbot-desktop --test windows_dialog_smoke -- --ignored --nocapture`. Result: 1 passed. Output contained test status only; no extracted text or pixel bytes were logged or persisted. + +## Known limitations + +- UI Automation does not expose all custom-rendered content. +- Protected, elevated, DRM, or hardware-accelerated windows may reject inspection or capture. +- DPI scaling and multi-monitor coordinates require explicit tests. + +## Security impact + +Window content can contain personal or secret data. Capture must be user-selected, bounded to one target, previewable, and excluded from durable logs. + +## Recommendation + +Keep UI Automation as the preferred text path and selected-window capture as an explicit fallback. Do not add continuous desktop capture, global hooks, input injection, or privilege escalation. diff --git a/docs/spikes/P00-04-event-log-and-read-only-diagnostics.md b/docs/spikes/P00-04-event-log-and-read-only-diagnostics.md new file mode 100644 index 0000000..731318f --- /dev/null +++ b/docs/spikes/P00-04-event-log-and-read-only-diagnostics.md @@ -0,0 +1,61 @@ +# P00-04: Event Log and Read-Only Diagnostics + +- Status: Passed for bounded local and loopback diagnostics +- Date recorded: 2026-07-18 +- MVP gate: Required before exposing local diagnostic tools + +## Objective + +Verify bounded, read-only collection of Windows event summaries, process and foreground-window metadata, port occupancy, network-target reachability, authorized log tails, configuration parsing, and local redaction. + +## Environment + +- Host: Windows 11 x64 +- Rust toolchain: rustc/cargo 1.97.1 +- MSVC C++ build tools: verified by native builds +- Network targets: no production target authorized for this Spike +- Event-log scope: explicit provider and time range only + +## Minimal validation implementation + +Each diagnostic operation must have a typed argument schema and explicit limits. It must return structured summaries, not arbitrary command output or unrelated full logs. + +File reads must require a user-authorized path token, enforce size limits, prefer log tails, reject binary content, and redact before any preview or upload. + +## Required execution + +1. Query a known provider over a short time window and return a bounded summary. +2. Apply provider, time, level, and optional process filtering. +3. Inspect one explicitly identified process without controlling it. +4. Check one port and one explicitly supplied network target. +5. Read the tail of a disposable authorized log fixture. +6. Parse JSON, YAML, TOML, and INI fixtures with limits. +7. Redact fake tokens, passwords, cookies, API keys, URL credentials, connection-string passwords, and PEM material. +8. Verify invalid provider, permission denial, timeout, malformed file, and oversized input errors. + +## Actual execution result + +Passed. Windows-native tests executed a bounded recent Event Log query, inspected the current process and foreground-window metadata, identified the owner PID of a test-created TCP listener, and exercised structured error handling. + +Disposable local fixtures verified authorized log-tail reads, JSON/YAML/TOML/INI parsing limits, binary/oversized rejection, and redaction of fake bearer tokens, passwords, cookies, API keys, URL credentials, connection-string secrets, and PEM material. + +Network reachability coverage is limited to explicit loopback fixtures; no production or user network target was contacted. + +## Log summary + +Commands: `cargo test --workspace` plus the Windows native-provider tests. Result: passed. Event content and fake secrets were not printed; only bounded result categories and test status were retained. + +## Known limitations + +- Some event channels require permissions unavailable to a standard user. +- Provider names and event schemas vary by installed software. +- Reachability is not proof that an application protocol is healthy. +- Parser support does not authorize arbitrary file access. + +## Security impact + +Overbroad queries can disclose unrelated personal or security information. Every diagnostic must be locally authorized, scope-limited, and redacted before leaving Rust. + +## Recommendation + +Implement independent typed tools rather than a generic diagnostics command. Keep all Windows queries read-only and return partial results with explicit access boundaries. diff --git a/docs/spikes/P00-05-nas-file-transaction.md b/docs/spikes/P00-05-nas-file-transaction.md new file mode 100644 index 0000000..c7bc579 --- /dev/null +++ b/docs/spikes/P00-05-nas-file-transaction.md @@ -0,0 +1,70 @@ +# P00-05: NAS File Transaction + +- Status: Local transaction and recovery passed; real UNC execution blocked by missing authorized fixture +- Date recorded: 2026-07-18 +- MVP gate: Required before any NAS write feature + +## Objective + +Verify a recoverable UNC transaction using plan, dry run, temporary copy, size and SHA-256 verification, atomic destination commit, conflict handling, and interruption recovery while preserving the source. + +## Environment + +- Host: Windows 11 x64 +- Authorized UNC fixture: not supplied +- Rust toolchain: rustc/cargo 1.97.1 +- MSVC C++ build tools: verified by native builds +- Real user or production files: prohibited + +## Minimal validation implementation + +The Spike is expected to operate only on a user-authorized disposable source fixture and destination share. It must: + +- Tokenize the selected source path. +- Reject paths outside the authorized source and destination roots. +- Produce a non-mutating dry-run plan. +- Copy to a unique temporary destination. +- Verify byte count and SHA-256. +- Commit by renaming within the destination filesystem. +- Apply ask, rename, or skip conflict policy without overwrite. +- Persist resumable transaction state without credentials. +- Preserve the source in every P00 outcome. + +## Required execution + +1. Obtain explicit user authorization for disposable source and UNC destination fixtures. +2. Generate unique test data inside the fixture. +3. Execute and inspect a dry run. +4. Copy to a temporary destination and verify size and SHA-256. +5. Commit to the final name and confirm the source still exists. +6. Exercise ask, rename, and skip conflicts. +7. Interrupt during copy and verify no final destination is exposed. +8. Resume or restart safely and verify source preservation. +9. Inject hash mismatch and confirm no commit or cleanup occurs. + +## Actual execution result + +The transaction implementation and disposable local-fixture tests passed. They cover non-mutating plan/dry-run, copy to a unique temporary name, byte-count and SHA-256 verification, atomic final rename, ask/rename/skip conflict behavior without overwrite, injected interruption and hash mismatch, restart-safe state, and source preservation. + +No real UNC path was read or written. The user did not identify an authorized disposable source directory and destination share, so executing the same flow against a NAS would violate the project safety rule. + +This is an environment/authorization block for the UNC transport check, not a claim that SMB interruption behavior passed. + +## Log summary + +Command: `cargo test --workspace` on generated temporary directories. Result: passed. No source fixture was deleted, no existing destination was overwritten, and no NAS credential was used or logged. + +## Known limitations + +- Atomic rename guarantees depend on the destination filesystem and share behavior. +- Network interruption and SMB caching can affect observability. +- P00 does not validate recycle-bin or source-cleanup behavior. +- Performance on large files remains unmeasured. + +## Security impact + +Silent overwrite or premature source cleanup can cause data loss. Credentials must remain in Windows secure storage, and remote payloads must never provide unrestricted local or UNC paths. + +## Recommendation + +Do not enable NAS writes until this Spike has executed against a disposable authorized share. P00 must preserve sources and treat source cleanup only as a non-executed plan field. diff --git a/docs/spikes/P00-06-sqlite-profile-isolation.md b/docs/spikes/P00-06-sqlite-profile-isolation.md new file mode 100644 index 0000000..d80cd21 --- /dev/null +++ b/docs/spikes/P00-06-sqlite-profile-isolation.md @@ -0,0 +1,59 @@ +# P00-06: SQLite Profile Isolation + +- Status: Passed on a disposable SQLite database +- Date recorded: 2026-07-18 +- MVP gate: Required before persistent dual-instance data + +## Objective + +Verify schema and repository isolation for multiple saved profiles and two active slots, including collisions in server, conversation, message, cursor, proposal, and transaction identifiers. + +## Environment + +- SQLite implementation: rusqlite 0.40.1 with bundled SQLite +- Rust toolchain: rustc/cargo 1.97.1 +- Migration execution: transactional disposable fixture +- Persistent user database: not created + +## Minimal validation implementation + +The Spike is expected to use a disposable database and transactional migrations. Server-derived tables must include profile_id and server_instance_id. Conversation and message keys must remain unique within their profile and server context. + +Credential values must never be stored; only opaque credential references are permitted. + +## Required execution + +1. Create at least five profiles with only two active slots. +2. Store identical conversation_id and message_id values for two different profiles. +3. Store independent SSE cursors, unread counts, errors, proposals, and transaction summaries. +4. Query each profile and verify no cross-profile result. +5. Verify a duplicate within the same composite key is rejected or deterministically updated. +6. Verify credential values are absent from all tables. +7. Interrupt a transaction and confirm rollback or recovery. +8. Reopen the database and repeat isolation checks. + +## Actual execution result + +Passed. Tests created multiple saved profiles with only companion and operations active slots, inserted intentionally colliding server/conversation/message identifiers under different composite profile keys, and verified independent reads. + +Tests also covered separate SSE cursors, unread/error state, proposals and file-transaction summaries, duplicate composite-key behavior, transaction rollback, reopen/requery behavior, and schema inspection confirming that credential values are absent. + +All database files were disposable test fixtures; no migration touched user data. + +## Log summary + +Command: `cargo test --workspace`. Result: passed, including SQLite migration and isolation tests. Logs contained test status only and no stored content values. + +## Known limitations + +- Migration backup and recovery behavior remain unverified. +- WAL behavior on abrupt process termination remains unverified. +- Encryption at rest is not provided by ordinary SQLite and does not replace Credential Manager. + +## Security impact + +Incorrect composite keys can mix conversations or local-tool state between companion and operations profiles. Storing credential values would violate the security model. + +## Recommendation + +Use transactional migrations, foreign keys, explicit composite uniqueness, and a disposable database for isolation tests. Any migration with potential data loss requires a separate stop-and-review decision. diff --git a/docs/spikes/P00-07-protocol-and-mock-gateway.md b/docs/spikes/P00-07-protocol-and-mock-gateway.md new file mode 100644 index 0000000..196d6be --- /dev/null +++ b/docs/spikes/P00-07-protocol-and-mock-gateway.md @@ -0,0 +1,59 @@ +# P00-07: Protocol Schema and Dual Mock Gateway + +- Status: Passed for the provisional desktop-v1alpha1 contract +- Date recorded: 2026-07-18 +- MVP gate: Required for repeatable connection and policy tests + +## Objective + +Define a provisional desktop-v1alpha1 protocol and verify two independently configurable Mock Gateway instances without claiming compatibility with an unavailable real AstrBot Gateway. + +## Environment + +- Forgejo API and HTTP Git endpoint reachable; SSH origin remains unusable +- Real AstrBot Gateway: not connected +- Package dependencies: installed from pnpm/Cargo lockfiles +- Mock execution: two loopback instances verified + +## Minimal validation implementation + +The provisional schema must cover ConnectionProfile, ConnectionSlot, ConnectionState, ServerCapabilities, ClientCapabilities, ProtocolEnvelope, GatewayEvent, ToolProposal, ToolResult, DiagnosticBundle, and FileTransferPlan. + +The Mock Gateway must expose health, server information, capabilities, fake authentication, SSE, proactive messages, disconnect injection, duplicate events, companion messages, and operations tool proposals. It must support two simultaneous instances with independent identity and behavior. + +## Required execution + +1. Validate representative valid fixtures against every schema. +2. Reject missing, unknown, malformed, oversized, and wrong-version fields as defined by policy. +3. Start two mocks on dynamic loopback ports. +4. Verify independent server_instance_id and capabilities. +5. Exercise authentication success and failure with fake values. +6. Stream normal, duplicate, delayed, disconnected, and tool-proposal events. +7. Confirm companion-origin tool proposals are rejected by the client policy boundary. +8. Record any divergence found during a later real Gateway review. + +## Actual execution result + +Passed for the provisional contract. The canonical Rust protocol package exports ten JSON Schemas and TypeScript types. Valid/invalid fixtures, unknown-field rejection, protocol-version checks, and schema drift checks passed. + +Two independently configured loopback Mock Gateways passed health, server-info, capability, fake-auth success/failure, SSE, duplicate-event, disconnect/reconnect, proactive companion message, and operations tool-proposal tests. + +Client integration tests verified local Rust-side profile binding, independent event-id deduplication, identical remote identifiers without cross-routing, and one-slot reconnect while the other slot continued. Compatibility with a real AstrBot Gateway remains explicitly unclaimed. + +## Log summary + +Commands: protocol contract/schema tests, Mock Gateway tests, and `cargo test --workspace`. Results: 5 protocol tests, 4 Mock Gateway integration tests, and the wider Rust suite passed. Only generated fake credentials were used. + +## Known limitations + +- Endpoint names, authentication fields, ACK behavior, event retention, error codes, and capability names are provisional. +- Mock success cannot prove interoperability with AstrBot. +- Loopback HTTP tests do not validate production TLS or certificate identity. + +## Security impact + +Schemas form the first validation boundary for untrusted remote data. Mock convenience behavior must not weaken production parsing, profile binding, role checks, or TLS validation. + +## Recommendation + +Version the schema explicitly, keep invalid fixtures alongside valid ones, and require a real Gateway contract review before declaring protocol compatibility. diff --git a/docs/spikes/P00-08-build-ci-and-release-readiness.md b/docs/spikes/P00-08-build-ci-and-release-readiness.md new file mode 100644 index 0000000..cfdf6fd --- /dev/null +++ b/docs/spikes/P00-08-build-ci-and-release-readiness.md @@ -0,0 +1,70 @@ +# P00-08: Build, CI, and Release Readiness + +- Status: Local Windows build passed; Forgejo CI, signing, and updater release configuration remain pending +- Date recorded: 2026-07-18 +- MVP gate: Required before declaring P00 complete + +## Objective + +Verify reproducible frontend, Rust, Tauri development, Windows production-build, Forgejo CI, installer, updater, and signing prerequisites without creating temporary release credentials or claiming unexecuted jobs passed. + +## Environment + +- Node.js: 24.17.0 detected +- pnpm: 11.9.0 detected +- Rust/Cargo: 1.97.1 detected and verified +- MSVC C++ build tools: verified by debug and release links +- WebView2: previously detected +- Forgejo SSH endpoint: connection refused at localhost:18086 +- Forgejo runner labels: unknown +- Windows code-signing certificate: not configured +- Tauri updater signing key and endpoint: not configured + +## Minimal validation implementation + +The repository pins Node, pnpm, Rust, direct JavaScript dependencies, and lockfiles. Local scripts cover frontend and Rust checks. Forgejo CI provides: + +- A portable Linux quality job for frontend, workspace, and Rust checks. +- A Windows Tauri job guarded by the ENABLE_WINDOWS_TAURI_CI repository variable. +- No publication, release upload, or long-lived secret use. + +## Required execution + +1. Install dependencies from committed lockfiles. +2. Run frontend format, lint, typecheck, unit tests, and production build. +3. Run Rust fmt, Clippy with warnings denied, tests, and check. +4. Start Tauri development mode on Windows and verify IPC plus tray hide/restore. +5. Run the Windows Tauri production build. +6. Inspect Forgejo runner labels and enable only jobs with verified prerequisites. +7. Run the Forgejo workflow and retain sanitized results. +8. Record installer bundle prerequisites. +9. Record code-signing and updater requirements without generating temporary production keys. + +## Actual execution result + +Local Windows validation passed: frontend format/lint/type/unit/build checks, Playwright Chrome smoke, Rust fmt/check/Clippy/tests, Tauri development launch, release executable build, and NSIS bundle generation all completed successfully. + +The first two bundle attempts timed out while Tauri downloaded its official NSIS archive. The official tauri-bundler 2.9.4 source confirmed the standard cache path and embedded SHA-1 values. The NSIS 3.11 archive and nsis-tauri-utils 0.5.3 DLL were then downloaded from their official Tauri release URLs, matched the embedded SHA-1 values, installed into the standard cache, and the bundle succeeded. + +Installer: `AstrBot Desktop_0.1.0-alpha.0_x64-setup.exe`, 3,552,257 bytes, SHA-256 `BF87DCD13B81C18EFC9A2DB8DE6E201396FFBB9ABA0EABC579A22479C004816C`. + +Forgejo API confirmed the repository existed and was empty before initialization. Git Credential Manager reauthentication then enabled a normal, non-forced HTTP push of `main` at `0d12b94`, and `feat/p00-bootstrap` was created from that baseline. The configured SSH origin `localhost:18086` still refuses connections; the LAN SSH endpoint responds but rejects the available key. The workflow file has not run, and the action-runner jobs endpoint returned 404, so no CI success is claimed. + +## Log summary + +Local command logs support the Windows build claims. No Forgejo workflow, code-signing, updater-signing, or publication result exists. + +## Known limitations + +- The ubuntu-latest and windows-latest labels are assumptions until a Forgejo act_runner is inspected. +- Linux checks cannot certify Windows Credential Manager, UI Automation, Event Log, window capture, UNC behavior, tray behavior, or Windows bundling. +- Action availability and outbound registry access are unknown. +- Code signing and updater verification remain release-stage work. + +## Security impact + +CI must not receive AstrBot, NAS, SSH, signing, or updater secrets during P00. Action references should be pinned to reviewed commit hashes after runner connectivity is restored. + +## Recommendation + +Treat Windows local checks as mandatory until a trusted Windows runner is configured. Mark the Windows job skipped when the enabling variable is absent, and never interpret that skip as a successful Windows build. diff --git a/docs/spikes/README.md b/docs/spikes/README.md new file mode 100644 index 0000000..dfdacac --- /dev/null +++ b/docs/spikes/README.md @@ -0,0 +1,5 @@ +# Technical Spikes + +Each Spike report must record its objective, environment, minimal implementation, actual commands and results, log summary, limitations, security impact, MVP blocking status, and recommended production approach. + +Reports must distinguish verified behavior from planned or blocked work. diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..47bffc7 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,48 @@ +import eslint from "@eslint/js"; +import globals from "globals"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; +import tseslint from "typescript-eslint"; + +export default tseslint.config( + { + ignores: [ + "dist", + "coverage", + "target", + "src-tauri/target", + "packages/*/dist", + ], + }, + eslint.configs.recommended, + ...tseslint.configs.recommended, + { + files: ["**/*.{ts,tsx}"], + languageOptions: { + ecmaVersion: 2022, + globals: globals.browser, + parserOptions: { + projectService: true, + tsconfigRootDir: import.meta.dirname, + }, + }, + plugins: { + "react-hooks": reactHooks, + "react-refresh": reactRefresh, + }, + rules: { + ...reactHooks.configs.recommended.rules, + "react-hooks/set-state-in-effect": "off", + "react-refresh/only-export-components": [ + "warn", + { allowConstantExport: true }, + ], + }, + }, + { + files: ["**/*.config.{js,ts}", "eslint.config.js"], + languageOptions: { + globals: globals.node, + }, + }, +); diff --git a/index.html b/index.html new file mode 100644 index 0000000..4fa05c2 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + AstrBot Desktop + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..3544c72 --- /dev/null +++ b/package.json @@ -0,0 +1,61 @@ +{ + "name": "astrbot-desktop", + "version": "0.1.0-alpha.0", + "private": true, + "type": "module", + "packageManager": "pnpm@11.9.0", + "engines": { + "node": ">=24.17.0 <25", + "pnpm": ">=11.9.0 <12" + }, + "scripts": { + "dev": "node ./node_modules/vite/bin/vite.js --configLoader runner", + "tauri": "node ./node_modules/@tauri-apps/cli/tauri.js", + "tauri:dev": "node ./node_modules/@tauri-apps/cli/tauri.js dev", + "tauri:build": "node ./node_modules/@tauri-apps/cli/tauri.js build", + "build": "node ./node_modules/typescript/bin/tsc -b && node ./node_modules/vite/bin/vite.js build --configLoader runner", + "format": "node ./node_modules/prettier/bin/prettier.cjs --write .", + "format:check": "node ./node_modules/prettier/bin/prettier.cjs --check .", + "lint": "node ./node_modules/eslint/bin/eslint.js . --max-warnings 0", + "typecheck": "node ./node_modules/typescript/bin/tsc -b --pretty false", + "test": "node ./node_modules/vitest/vitest.mjs run --configLoader runner", + "test:watch": "node ./node_modules/vitest/vitest.mjs --configLoader runner", + "pretest:e2e": "node ./node_modules/typescript/bin/tsc -b && node ./node_modules/vite/bin/vite.js build --configLoader runner", + "test:e2e": "node ./node_modules/@playwright/test/cli.js test", + "check:frontend": "node ./node_modules/prettier/bin/prettier.cjs --check . && node ./node_modules/eslint/bin/eslint.js . --max-warnings 0 && node ./node_modules/typescript/bin/tsc -b --pretty false && node ./node_modules/vitest/vitest.mjs run --configLoader runner && node ./node_modules/vite/bin/vite.js build --configLoader runner", + "rust:fmt": "cargo fmt --all -- --check", + "rust:check": "cargo check --workspace --all-targets", + "rust:clippy": "cargo clippy --workspace --all-targets -- -D warnings", + "rust:test": "cargo test --workspace", + "mock:dev": "cargo run -p mock-gateway -- --instance companion --port 43101", + "mock:test": "cargo test -p mock-gateway", + "check:rust": "cargo fmt --all -- --check && cargo clippy --workspace --all-targets -- -D warnings && cargo test --workspace && cargo check --workspace --all-targets" + }, + "dependencies": { + "@tauri-apps/api": "2.11.1", + "react": "19.2.7", + "react-dom": "19.2.7", + "zod": "4.4.3" + }, + "devDependencies": { + "@eslint/js": "10.0.1", + "@playwright/test": "1.61.1", + "@tauri-apps/cli": "2.11.4", + "@testing-library/jest-dom": "6.9.1", + "@testing-library/react": "16.3.2", + "@types/node": "24.13.3", + "@types/react": "19.2.17", + "@types/react-dom": "19.2.3", + "@vitejs/plugin-react": "6.0.3", + "eslint": "10.7.0", + "eslint-plugin-react-hooks": "7.1.1", + "eslint-plugin-react-refresh": "0.5.3", + "globals": "17.5.0", + "jsdom": "29.1.1", + "prettier": "3.9.5", + "typescript": "6.0.3", + "typescript-eslint": "8.64.0", + "vite": "8.1.5", + "vitest": "4.1.10" + } +} diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 0000000..8a11d75 --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,28 @@ +import { defineConfig, devices } from "@playwright/test"; + +const desktopChrome = { + ...devices["Desktop Chrome"], + ...(process.env.CI ? {} : { channel: "chrome" as const }), +}; + +export default defineConfig({ + testDir: "./tests/e2e", + outputDir: "test-results", + timeout: 30_000, + fullyParallel: true, + forbidOnly: Boolean(process.env.CI), + retries: process.env.CI ? 1 : 0, + reporter: process.env.CI ? "line" : "list", + use: { + baseURL: "http://127.0.0.1:4173", + trace: "retain-on-failure", + }, + projects: [{ name: "chromium", use: desktopChrome }], + webServer: { + command: + "node ./node_modules/vite/bin/vite.js preview --host 127.0.0.1 --port 4173 --strictPort", + url: "http://127.0.0.1:4173", + reuseExistingServer: !process.env.CI, + timeout: 120_000, + }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..c07d2f0 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,2644 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@tauri-apps/api': + specifier: 2.11.1 + version: 2.11.1 + react: + specifier: 19.2.7 + version: 19.2.7 + react-dom: + specifier: 19.2.7 + version: 19.2.7(react@19.2.7) + zod: + specifier: 4.4.3 + version: 4.4.3 + devDependencies: + '@eslint/js': + specifier: 10.0.1 + version: 10.0.1(eslint@10.7.0) + '@playwright/test': + specifier: 1.61.1 + version: 1.61.1 + '@tauri-apps/cli': + specifier: 2.11.4 + version: 2.11.4 + '@testing-library/jest-dom': + specifier: 6.9.1 + version: 6.9.1 + '@testing-library/react': + specifier: 16.3.2 + version: 16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7) + '@types/node': + specifier: 24.13.3 + version: 24.13.3 + '@types/react': + specifier: 19.2.17 + version: 19.2.17 + '@types/react-dom': + specifier: 19.2.3 + version: 19.2.3(@types/react@19.2.17) + '@vitejs/plugin-react': + specifier: 6.0.3 + version: 6.0.3(vite@8.1.5(@types/node@24.13.3)) + eslint: + specifier: 10.7.0 + version: 10.7.0 + eslint-plugin-react-hooks: + specifier: 7.1.1 + version: 7.1.1(eslint@10.7.0) + eslint-plugin-react-refresh: + specifier: 0.5.3 + version: 0.5.3(eslint@10.7.0) + globals: + specifier: 17.5.0 + version: 17.5.0 + jsdom: + specifier: 29.1.1 + version: 29.1.1 + prettier: + specifier: 3.9.5 + version: 3.9.5 + typescript: + specifier: 6.0.3 + version: 6.0.3 + typescript-eslint: + specifier: 8.64.0 + version: 8.64.0(eslint@10.7.0)(typescript@6.0.3) + vite: + specifier: 8.1.5 + version: 8.1.5(@types/node@24.13.3) + vitest: + specifier: 4.1.10 + version: 4.1.10(@types/node@24.13.3)(jsdom@29.1.1)(vite@8.1.5(@types/node@24.13.3)) + +packages: + + '@adobe/css-tools@4.5.0': + resolution: {integrity: sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==} + + '@asamuzakjp/css-color@5.1.11': + resolution: {integrity: sha512-KVw6qIiCTUQhByfTd78h2yD1/00waTmm9uy/R7Ck/ctUyAPj+AEDLkQIdJW0T8+qGgj3j5bpNKK7Q3G+LedJWg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + + '@asamuzakjp/dom-selector@7.1.1': + resolution: {integrity: sha512-67RZDnYRc8H/8MLDgQCDE//zoqVFwajkepHZgmXrbwybzXOEwOWGPYGmALYl9J2DOLfFPPs6kKCqmbzV895hTQ==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + + '@asamuzakjp/generational-cache@1.0.1': + resolution: {integrity: sha512-wajfB8KqzMCN2KGNFdLkReeHncd0AslUSrvHVvvYWuU8ghncRJoA50kT3zP9MVL0+9g4/67H+cdvBskj9THPzg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + + '@asamuzakjp/nwsapi@2.3.9': + resolution: {integrity: sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q==} + + '@babel/code-frame@7.29.7': + resolution: {integrity: sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==} + engines: {node: '>=6.9.0'} + + '@babel/compat-data@7.29.7': + resolution: {integrity: sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==} + engines: {node: '>=6.9.0'} + + '@babel/core@7.29.7': + resolution: {integrity: sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==} + engines: {node: '>=6.9.0'} + + '@babel/generator@7.29.7': + resolution: {integrity: sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==} + engines: {node: '>=6.9.0'} + + '@babel/helper-compilation-targets@7.29.7': + resolution: {integrity: sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==} + engines: {node: '>=6.9.0'} + + '@babel/helper-globals@7.29.7': + resolution: {integrity: sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-imports@7.29.7': + resolution: {integrity: sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-transforms@7.29.7': + resolution: {integrity: sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-string-parser@7.29.7': + resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.29.7': + resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-option@7.29.7': + resolution: {integrity: sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==} + engines: {node: '>=6.9.0'} + + '@babel/helpers@7.29.7': + resolution: {integrity: sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.29.7': + resolution: {integrity: sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/runtime@7.29.7': + resolution: {integrity: sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==} + engines: {node: '>=6.9.0'} + + '@babel/template@7.29.7': + resolution: {integrity: sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==} + engines: {node: '>=6.9.0'} + + '@babel/traverse@7.29.7': + resolution: {integrity: sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.29.7': + resolution: {integrity: sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==} + engines: {node: '>=6.9.0'} + + '@bramus/specificity@2.4.2': + resolution: {integrity: sha512-ctxtJ/eA+t+6q2++vj5j7FYX3nRu311q1wfYH3xjlLOsczhlhxAg2FWNUXhpGvAw3BWo1xBcvOV6/YLc2r5FJw==} + hasBin: true + + '@csstools/color-helpers@6.1.0': + resolution: {integrity: sha512-064IFJdjTfUqnjpCVpMOdbr8FLQBhinbZj6yRv2An2E41O/pLEXqfFRWqGq/SxlE5PEUYTlvWsG2r8MswAVvkg==} + engines: {node: '>=20.19.0'} + + '@csstools/css-calc@3.2.1': + resolution: {integrity: sha512-DtdHlgXh5ZkA43cwBcAm+huzgJiwx3ZTWVjBs94kwz2xKqSimDA3lBgCjphYgwgVUMWatSM0pDd8TILB1yrVVg==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@csstools/css-parser-algorithms': ^4.0.0 + '@csstools/css-tokenizer': ^4.0.0 + + '@csstools/css-color-parser@4.1.9': + resolution: {integrity: sha512-paQcIaOO53Rk5+YrBaBjm/SgrV4INImjo2BT1DtQRYr+XeTRbeAYlS+jxXp9drqvKmtFnWRJKIalDLhZZDu42A==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@csstools/css-parser-algorithms': ^4.0.0 + '@csstools/css-tokenizer': ^4.0.0 + + '@csstools/css-parser-algorithms@4.0.0': + resolution: {integrity: sha512-+B87qS7fIG3L5h3qwJ/IFbjoVoOe/bpOdh9hAjXbvx0o8ImEmUsGXN0inFOnk2ChCFgqkkGFQ+TpM5rbhkKe4w==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@csstools/css-tokenizer': ^4.0.0 + + '@csstools/css-syntax-patches-for-csstree@1.1.6': + resolution: {integrity: sha512-TcJCWFbXLPpJYq6z7bfOyjWYJDiDg2/I4gyUC9pqPNqHFRIey0EB0q0L5cSnQDfWJg8Jd6VadakxdIez/3zkqQ==} + peerDependencies: + css-tree: ^3.2.1 + peerDependenciesMeta: + css-tree: + optional: true + + '@csstools/css-tokenizer@4.0.0': + resolution: {integrity: sha512-QxULHAm7cNu72w97JUNCBFODFaXpbDg+dP8b/oWFAZ2MTRppA3U00Y2L1HqaS4J6yBqxwa/Y3nMBaxVKbB/NsA==} + engines: {node: '>=20.19.0'} + + '@emnapi/core@1.11.1': + resolution: {integrity: sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==} + + '@emnapi/runtime@1.11.1': + resolution: {integrity: sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==} + + '@emnapi/wasi-threads@1.2.2': + resolution: {integrity: sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==} + + '@eslint-community/eslint-utils@4.9.1': + resolution: {integrity: sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + + '@eslint-community/regexpp@4.12.2': + resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + '@eslint/config-array@0.23.5': + resolution: {integrity: sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/config-helpers@0.6.0': + resolution: {integrity: sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/core@1.2.1': + resolution: {integrity: sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/js@10.0.1': + resolution: {integrity: sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: ^10.0.0 + peerDependenciesMeta: + eslint: + optional: true + + '@eslint/object-schema@3.0.5': + resolution: {integrity: sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/plugin-kit@0.7.2': + resolution: {integrity: sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@exodus/bytes@1.15.1': + resolution: {integrity: sha512-S6mL0yNB/Abt9Ei4tq8gDhcczc4S3+vQ4ra7vxnAf+YHC02srtqxKKZghx2Dq6p0e66THKwR6r8N6P95wEty7Q==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + peerDependencies: + '@noble/hashes': ^1.8.0 || ^2.0.0 + peerDependenciesMeta: + '@noble/hashes': + optional: true + + '@humanfs/core@0.19.2': + resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} + engines: {node: '>=18.18.0'} + + '@humanfs/node@0.16.8': + resolution: {integrity: sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==} + engines: {node: '>=18.18.0'} + + '@humanfs/types@0.15.0': + resolution: {integrity: sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==} + engines: {node: '>=18.18.0'} + + '@humanwhocodes/module-importer@1.0.1': + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + + '@humanwhocodes/retry@0.4.3': + resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} + engines: {node: '>=18.18'} + + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + + '@jridgewell/remapping@2.3.5': + resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + + '@napi-rs/wasm-runtime@1.1.6': + resolution: {integrity: sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==} + peerDependencies: + '@emnapi/core': ^1.7.1 + '@emnapi/runtime': ^1.7.1 + + '@oxc-project/types@0.139.0': + resolution: {integrity: sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==} + + '@playwright/test@1.61.1': + resolution: {integrity: sha512-8nKv6+0RJSL9FE4jYOEGXnPeM/Hg12qZpmqzZjRh3qM0Y7c3z1mrOTfFLids72RDQYVh9WpLEfR5WdpNX4fkig==} + engines: {node: '>=18'} + hasBin: true + + '@rolldown/binding-android-arm64@1.1.5': + resolution: {integrity: sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.1.5': + resolution: {integrity: sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.1.5': + resolution: {integrity: sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.1.5': + resolution: {integrity: sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.1.5': + resolution: {integrity: sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.1.5': + resolution: {integrity: sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.1.5': + resolution: {integrity: sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.1.5': + resolution: {integrity: sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.1.5': + resolution: {integrity: sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.1.5': + resolution: {integrity: sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.1.5': + resolution: {integrity: sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.1.5': + resolution: {integrity: sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.1.5': + resolution: {integrity: sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.1.5': + resolution: {integrity: sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.1.5': + resolution: {integrity: sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.1': + resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} + + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + + '@tauri-apps/api@2.11.1': + resolution: {integrity: sha512-M2FPuYND2m+wh5hfW9ZpSdxMPdEJovPBWwoHJmwUpysTYNHaOkVFN419m/K0LIgjb/7KU2vBgsUepJWugQCvAA==} + + '@tauri-apps/cli-darwin-arm64@2.11.4': + resolution: {integrity: sha512-1ryOF3ZhpZ/nemHV5zVwBQBz9jDGKmKPvWPADOhc83ig0P4bMc2iER4NbC6r9sjeIZ6RVQ4g3RZIYvezhcl4TQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@tauri-apps/cli-darwin-x64@2.11.4': + resolution: {integrity: sha512-uFsGQAAfuyz1k/yGLmkWfkBlgKAqZfxqlHmLWx81QU27RJWfmbNHCIq8T8w1e+VClleIuZUjpHWfoE4E3DLo3A==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@tauri-apps/cli-linux-arm-gnueabihf@2.11.4': + resolution: {integrity: sha512-IaHZn5CdBL21oUmjiVOS1ctw6Ip1O0pjp70FwOWmYz1myWe0SY96ZIj2FYf7pT0m8bI2h/hrs5ZbEXXh44/MkQ==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + + '@tauri-apps/cli-linux-arm64-gnu@2.11.4': + resolution: {integrity: sha512-N41/ukTRVe6XSuUTESuFdGeOW2i7k62tK+6gHK5Kd5/q5RPvvi19GaWAVPPb9u95HSGmTChSolBfzynUsssFaA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@tauri-apps/cli-linux-arm64-musl@2.11.4': + resolution: {integrity: sha512-v277UnT/fB64xAfSroL5N3Km3tLmvATWqJJw/wRI+g6o+HkeD0slyE7gOhNs1MbjE41R7bQOTxMVoL3aomUJmw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@tauri-apps/cli-linux-riscv64-gnu@2.11.4': + resolution: {integrity: sha512-qqgNkQ2u1yZHxjhxsZaxUtRDW8dIqIYm33rx/mzwQv0SfY9x1B+iraj8vWeFiXjjSVVhEMepXSOts1TqPzvXNQ==} + engines: {node: '>= 10'} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@tauri-apps/cli-linux-x64-gnu@2.11.4': + resolution: {integrity: sha512-2VRNWl84FOH0m2giiDkO2h0QXlcMJeX+zJDpI5kDIQAx6s+geF3v48F4DXfJez4GS/FdoDGnPnw1C2iYGbQ7bQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@tauri-apps/cli-linux-x64-musl@2.11.4': + resolution: {integrity: sha512-o9GyhYor/nc7xarmwDE3ka2szuW3uuZzXjHWh64Q8YX5AtSgxdQkFWzrY4O8KiGtVNvFBI14H3Q49Qj5TOIP/A==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@tauri-apps/cli-win32-arm64-msvc@2.11.4': + resolution: {integrity: sha512-ld5Ehb598m0VkYyylRPNeCFsBe/km0jxis6KgMpl3IGY6I/i1RwQXO05I1AsXUXO2WC6AvB/Lw4qTf/asiuEiQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@tauri-apps/cli-win32-ia32-msvc@2.11.4': + resolution: {integrity: sha512-12Hxi0XX/H5VFxO/bGgHkFWhml9VMgEOu9CidjeCeTNQ1l6fpUlbiGgSP7CLI3PFtW9/FfbeHieZ+kyWK5H7CA==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + + '@tauri-apps/cli-win32-x64-msvc@2.11.4': + resolution: {integrity: sha512-+vDiqBIU5dMISg/wNvX3sF+ZHfgJGJ5T0AcO+EHNXV9GGAG+P5fzodlDXD3QdKCRgZxMoCm5PPvj3BqLNjBthw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@tauri-apps/cli@2.11.4': + resolution: {integrity: sha512-R8xGtMpwyetawSqm9kYOuMmEqkhUbvcUy8n0aNXIxollKBLESUu5f4Fx+64hgASYm1H+jSWq6jCW6zqTnH6hqQ==} + engines: {node: '>= 10'} + hasBin: true + + '@testing-library/dom@10.4.1': + resolution: {integrity: sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==} + engines: {node: '>=18'} + + '@testing-library/jest-dom@6.9.1': + resolution: {integrity: sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==} + engines: {node: '>=14', npm: '>=6', yarn: '>=1'} + + '@testing-library/react@16.3.2': + resolution: {integrity: sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==} + engines: {node: '>=18'} + peerDependencies: + '@testing-library/dom': ^10.0.0 + '@types/react': ^18.0.0 || ^19.0.0 + '@types/react-dom': ^18.0.0 || ^19.0.0 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@tybys/wasm-util@0.10.3': + resolution: {integrity: sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==} + + '@types/aria-query@5.0.4': + resolution: {integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==} + + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/esrecurse@4.3.1': + resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==} + + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + + '@types/node@24.13.3': + resolution: {integrity: sha512-Dh8vAsV36ig5wa9OX4pXvMc9D3Veibfw2wix0CUwYODLD8nkj9UsLjASr49nPg+2eKzxhBV+v7L8pXvT4e639Q==} + + '@types/react-dom@19.2.3': + resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==} + peerDependencies: + '@types/react': ^19.2.0 + + '@types/react@19.2.17': + resolution: {integrity: sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==} + + '@typescript-eslint/eslint-plugin@8.64.0': + resolution: {integrity: sha512-CGvQPBxN3wZLu6Rz2kFUpZeoCm78xUic92ck39KPePkO1NPOwjCqdQnm5Q87tpWw9vcBvW8XLrDXjH9PWYtJ3Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + '@typescript-eslint/parser': ^8.64.0 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/parser@8.64.0': + resolution: {integrity: sha512-KA0OshtlcCCXmbfqyZkM5pV3/WNraJf7DkJRLpyrmwPtud57H5BDX7C3k0LPSPxpprfRL+cJDGabF10mvNCoCw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/project-service@8.64.0': + resolution: {integrity: sha512-tk4WpOJ6IEbGrVHaNmM0YRrwAD3exZlIK3iadQNAxh4YKk6jvUQ4ecq18n+v7+meh+cJ3j+D8nbk8sRKhlwLQg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/scope-manager@8.64.0': + resolution: {integrity: sha512-CXEaFdYXjSTgKhisNkwCcJwTP8Pl+fmRrEQrri4nm3vU743bALrxzLmq7fHG/7e6a5xO0lDYeURpZmBuhHk54w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/tsconfig-utils@8.64.0': + resolution: {integrity: sha512-2yo8rRNKuzbVWQp5kslhANqZ2uDAeROQHBRZNPu8JDsHmeFNj/XJJhX/FhNUWmkHHvoNsKa6+tHJiig87EzsQw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/type-utils@8.64.0': + resolution: {integrity: sha512-XWG4Fmmv/6SvyS9nH8jWrKs6terwJvE8cyRt1CzYYqzp9OrPhCT4cMc/f7C6RZCwG+qMmiffJS1/qJP8G1URtg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/types@8.64.0': + resolution: {integrity: sha512-qjhfuTfLXjA4IOzXvz0rTjT01BqEiIgPoUeMwiEjnaHKJMTNo8rH5pYW1a2L/0Dnux2fPC85AeyJoWaGa8WxTA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/typescript-estree@8.64.0': + resolution: {integrity: sha512-Pztpsn1aCE1oWDvDEfUk31nngvvF7vUB5SwHFEaZIFpvw7WJtqUHHL4plBZDA9HfWJJjL13BdG0YrJInTUvoVA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/utils@8.64.0': + resolution: {integrity: sha512-aJUGVB3+U0htrrCjoA8qukw8cm8fNCGAxK/tVoS70k8aeb7DETKeFozRiVFIwEeN9WJLsjaP3ph8I60tY2XZoQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/visitor-keys@8.64.0': + resolution: {integrity: sha512-mrtuL8Nsn6gi2H4mo5KMTp823M+3Q19Ew/i+Zlikq20tIMm99C3Ez0dCmkWWnxut20esQvTg8aUSEhMcAOXhEw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@vitejs/plugin-react@6.0.3': + resolution: {integrity: sha512-vmFvco5/QuC2f9Oj+wTk0+9XeDFkHxSamwZKYc7MxYwKICfvUvlMhqKI0VuICPltGqh1neqBKDvO4kes1ya8vg==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + '@rolldown/plugin-babel': ^0.1.7 || ^0.2.0 + babel-plugin-react-compiler: ^1.0.0 + vite: ^8.0.0 + peerDependenciesMeta: + '@rolldown/plugin-babel': + optional: true + babel-plugin-react-compiler: + optional: true + + '@vitest/expect@4.1.10': + resolution: {integrity: sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==} + + '@vitest/mocker@4.1.10': + resolution: {integrity: sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==} + peerDependencies: + msw: ^2.4.9 + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@4.1.10': + resolution: {integrity: sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==} + + '@vitest/runner@4.1.10': + resolution: {integrity: sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==} + + '@vitest/snapshot@4.1.10': + resolution: {integrity: sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==} + + '@vitest/spy@4.1.10': + resolution: {integrity: sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==} + + '@vitest/utils@4.1.10': + resolution: {integrity: sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==} + + acorn-jsx@5.3.2: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + + acorn@8.17.0: + resolution: {integrity: sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==} + engines: {node: '>=0.4.0'} + hasBin: true + + ajv@6.15.0: + resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + + aria-query@5.3.0: + resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} + + aria-query@5.3.2: + resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} + engines: {node: '>= 0.4'} + + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} + + baseline-browser-mapping@2.10.43: + resolution: {integrity: sha512-AjYpR78kDWAY3Efj+cDTFH9t9SCoL7OoTp1BOb0mQV7S+6CiLwnWM3FyxhJtdPufDFKzmCSFoUncKjWgJEZTCQ==} + engines: {node: '>=6.0.0'} + hasBin: true + + bidi-js@1.0.3: + resolution: {integrity: sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==} + + brace-expansion@5.0.7: + resolution: {integrity: sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==} + engines: {node: 18 || 20 || >=22} + + browserslist@4.28.6: + resolution: {integrity: sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + + caniuse-lite@1.0.30001806: + resolution: {integrity: sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==} + + chai@6.2.2: + resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} + engines: {node: '>=18'} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + + css-tree@3.2.1: + resolution: {integrity: sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} + + css.escape@1.5.1: + resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} + + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + + data-urls@7.0.0: + resolution: {integrity: sha512-23XHcCF+coGYevirZceTVD7NdJOqVn+49IHyxgszm+JIiHLoB2TkmPtsYkNWT1pvRSGkc35L6NHs0yHkN2SumA==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + decimal.js@10.6.0: + resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} + + deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + + dequal@2.0.3: + resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} + engines: {node: '>=6'} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + dom-accessibility-api@0.5.16: + resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} + + dom-accessibility-api@0.6.3: + resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==} + + electron-to-chromium@1.5.392: + resolution: {integrity: sha512-1yQq3VQCZRwsnYc67Oc+1fge6Lwtn0hzi6zmEVkB61Zx21kTbwJAW4dFLadl5Rc1tKhG/kSpYXnfiAhu0f0a1g==} + + entities@8.0.0: + resolution: {integrity: sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==} + engines: {node: '>=20.19.0'} + + es-module-lexer@2.3.1: + resolution: {integrity: sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA==} + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + + eslint-plugin-react-hooks@7.1.1: + resolution: {integrity: sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==} + engines: {node: '>=18'} + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0 + + eslint-plugin-react-refresh@0.5.3: + resolution: {integrity: sha512-5EMmLCV98Pi4o/f/3DP/v/tNqLHMIc9I8LKClNDWhZ9JTho89/kQcitCXQBMG7sAfVRK0Ie3T2EDOzp1YXYiVA==} + peerDependencies: + eslint: ^9 || ^10 + + eslint-scope@9.1.2: + resolution: {integrity: sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + eslint-visitor-keys@5.0.1: + resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + eslint@10.7.0: + resolution: {integrity: sha512-GVTD7s1vdIl6UYvAfriOPeY1Df8LIZjfofLvHwde+erDHGGuHyuM6xoxRxmHiebhYuD2p1vN4wWh0XzPARSGDQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true + + espree@11.2.0: + resolution: {integrity: sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + esquery@1.7.0: + resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} + engines: {node: '>=0.10'} + + esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + + estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + + esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + + expect-type@1.4.0: + resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==} + engines: {node: '>=12.0.0'} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + + fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + file-entry-cache@8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} + + find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + + flat-cache@4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} + + flatted@3.4.2: + resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==} + + fsevents@2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + + globals@17.5.0: + resolution: {integrity: sha512-qoV+HK2yFl/366t2/Cb3+xxPUo5BuMynomoDmiaZBIdbs+0pYbjfZU+twLhGKp4uCZ/+NbtpVepH5bGCxRyy2g==} + engines: {node: '>=18'} + + hermes-estree@0.25.1: + resolution: {integrity: sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==} + + hermes-parser@0.25.1: + resolution: {integrity: sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==} + + html-encoding-sniffer@6.0.0: + resolution: {integrity: sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + + ignore@7.0.6: + resolution: {integrity: sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw==} + engines: {node: '>= 4'} + + imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + indent-string@4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} + engines: {node: '>=8'} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-potential-custom-element-name@1.0.1: + resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + jsdom@29.1.1: + resolution: {integrity: sha512-ECi4Fi2f7BdJtUKTflYRTiaMxIB0O6zfR1fX0GXpUrf6flp8QIYn1UT20YQqdSOfk2dfkCwS8LAFoJDEppNK5Q==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24.0.0} + peerDependencies: + canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + + json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + + json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + + json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + + keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + + levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + + lightningcss-android-arm64@1.32.0: + resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.32.0: + resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.32.0: + resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.32.0: + resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.32.0: + resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.32.0: + resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + lightningcss-linux-arm64-musl@1.32.0: + resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + lightningcss-linux-x64-gnu@1.32.0: + resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + lightningcss-linux-x64-musl@1.32.0: + resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + lightningcss-win32-arm64-msvc@1.32.0: + resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.32.0: + resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.32.0: + resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} + engines: {node: '>= 12.0.0'} + + locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + + lru-cache@11.5.2: + resolution: {integrity: sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==} + engines: {node: 20 || >=22} + + lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + + lz-string@1.5.0: + resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} + hasBin: true + + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + + mdn-data@2.27.1: + resolution: {integrity: sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==} + + min-indent@1.0.1: + resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} + engines: {node: '>=4'} + + minimatch@10.2.5: + resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} + engines: {node: 18 || 20 || >=22} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + nanoid@3.3.16: + resolution: {integrity: sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + node-releases@2.0.51: + resolution: {integrity: sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==} + engines: {node: '>=18'} + + obug@2.1.4: + resolution: {integrity: sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==} + engines: {node: '>=12.20.0'} + + optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} + engines: {node: '>= 0.8.0'} + + p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + + p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + + parse5@8.0.1: + resolution: {integrity: sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==} + + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.5: + resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==} + engines: {node: '>=12'} + + playwright-core@1.61.1: + resolution: {integrity: sha512-h7Qlt6m4REp25qvIdvbDtVmD4LqVXfpRxhORv9L0jzETM05p4fuPJ3dKyuSXQxDSbXnmS79HAgi9589lGSpLkg==} + engines: {node: '>=18'} + hasBin: true + + playwright@1.61.1: + resolution: {integrity: sha512-DWnY5o3YbLWK4GovuAVwpqL+1VwGNdUGrRr++8j8PtQQzvAVZUIMjKQ90fY689sEJZJBbZVw1rXaOKSTitkzPQ==} + engines: {node: '>=18'} + hasBin: true + + postcss@8.5.19: + resolution: {integrity: sha512-Mz8SaolMd8nB+G13WkORcxQKHZ/NE4xXevtkJHVuG+guo9/wYKlIMTKAqGdEmYOXR2ijPjTYNHssizdaVSUNdQ==} + engines: {node: ^10 || ^12 || >=14} + + prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + prettier@3.9.5: + resolution: {integrity: sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg==} + engines: {node: '>=14'} + hasBin: true + + pretty-format@27.5.1: + resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + react-dom@19.2.7: + resolution: {integrity: sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ==} + peerDependencies: + react: ^19.2.7 + + react-is@17.0.2: + resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} + + react@19.2.7: + resolution: {integrity: sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==} + engines: {node: '>=0.10.0'} + + redent@3.0.0: + resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} + engines: {node: '>=8'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + rolldown@1.1.5: + resolution: {integrity: sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + saxes@6.0.0: + resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} + engines: {node: '>=v12.22.7'} + + scheduler@0.27.0: + resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} + + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + + semver@7.8.5: + resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} + engines: {node: '>=10'} + hasBin: true + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + + std-env@4.2.0: + resolution: {integrity: sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==} + + strip-indent@3.0.0: + resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} + engines: {node: '>=8'} + + symbol-tree@3.2.4: + resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} + + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@1.2.4: + resolution: {integrity: sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==} + engines: {node: '>=18'} + + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} + + tinyrainbow@3.1.0: + resolution: {integrity: sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==} + engines: {node: '>=14.0.0'} + + tldts-core@7.4.9: + resolution: {integrity: sha512-DxKfPBI52p2msTEu7MPhdpdDTBhhVQg1a/8PjQckeyAvO13eMYElX545grIp6nnTGIMZlRvFZPvFhvI/WIz2Vg==} + + tldts@7.4.9: + resolution: {integrity: sha512-3kZ8wQQ/k5DrChD4X4FVvr2D7E5uoRgAqkPyLpSCGUvqOvqu+JEdr3mwMUaVWb+vMHZaKhF5fp2PBigKsui7hA==} + hasBin: true + + tough-cookie@6.0.2: + resolution: {integrity: sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==} + engines: {node: '>=16'} + + tr46@6.0.0: + resolution: {integrity: sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==} + engines: {node: '>=20'} + + ts-api-utils@2.5.0: + resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} + engines: {node: '>=18.12'} + peerDependencies: + typescript: '>=4.8.4' + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + + typescript-eslint@8.64.0: + resolution: {integrity: sha512-0qg+pDNMnqYzqH9AnNK+39tejHvsShUOUUoRUgtnTGE7QuMZhiFDnozq8nHJVq+Wae6NMLKNWLg5WmkcC/ndyQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@7.18.2: + resolution: {integrity: sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==} + + undici@7.28.0: + resolution: {integrity: sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA==} + engines: {node: '>=20.18.1'} + + update-browserslist-db@1.2.3: + resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + vite@8.1.5: + resolution: {integrity: sha512-7ULLwsCdYx/nRyrpiEwvqb5TFHrMVZyBt+rg/OAXT7rgj/z+DtTDyKFeLAdDkubDVDKD8jOsndmy7m55XcfUsw==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.3.0 + esbuild: ^0.27.0 || ^0.28.0 + jiti: '>=1.21.0' + less: ^4.0.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + '@vitejs/devtools': + optional: true + esbuild: + optional: true + jiti: + optional: true + less: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@4.1.10: + resolution: {integrity: sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==} + engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@opentelemetry/api': ^1.9.0 + '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 + '@vitest/browser-playwright': 4.1.10 + '@vitest/browser-preview': 4.1.10 + '@vitest/browser-webdriverio': 4.1.10 + '@vitest/coverage-istanbul': 4.1.10 + '@vitest/coverage-v8': 4.1.10 + '@vitest/ui': 4.1.10 + happy-dom: '*' + jsdom: '*' + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@opentelemetry/api': + optional: true + '@types/node': + optional: true + '@vitest/browser-playwright': + optional: true + '@vitest/browser-preview': + optional: true + '@vitest/browser-webdriverio': + optional: true + '@vitest/coverage-istanbul': + optional: true + '@vitest/coverage-v8': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + + w3c-xmlserializer@5.0.0: + resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} + engines: {node: '>=18'} + + webidl-conversions@8.0.1: + resolution: {integrity: sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==} + engines: {node: '>=20'} + + whatwg-mimetype@5.0.0: + resolution: {integrity: sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==} + engines: {node: '>=20'} + + whatwg-url@16.0.1: + resolution: {integrity: sha512-1to4zXBxmXHV3IiSSEInrreIlu02vUOvrhxJJH5vcxYTBDAx51cqZiKdyTxlecdKNSjj8EcxGBxNf6Vg+945gw==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + + word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + + xml-name-validator@5.0.0: + resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==} + engines: {node: '>=18'} + + xmlchars@2.2.0: + resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + + zod-validation-error@4.0.2: + resolution: {integrity: sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==} + engines: {node: '>=18.0.0'} + peerDependencies: + zod: ^3.25.0 || ^4.0.0 + + zod@4.4.3: + resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} + +snapshots: + + '@adobe/css-tools@4.5.0': {} + + '@asamuzakjp/css-color@5.1.11': + dependencies: + '@asamuzakjp/generational-cache': 1.0.1 + '@csstools/css-calc': 3.2.1(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0) + '@csstools/css-color-parser': 4.1.9(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0) + '@csstools/css-parser-algorithms': 4.0.0(@csstools/css-tokenizer@4.0.0) + '@csstools/css-tokenizer': 4.0.0 + + '@asamuzakjp/dom-selector@7.1.1': + dependencies: + '@asamuzakjp/generational-cache': 1.0.1 + '@asamuzakjp/nwsapi': 2.3.9 + bidi-js: 1.0.3 + css-tree: 3.2.1 + is-potential-custom-element-name: 1.0.1 + + '@asamuzakjp/generational-cache@1.0.1': {} + + '@asamuzakjp/nwsapi@2.3.9': {} + + '@babel/code-frame@7.29.7': + dependencies: + '@babel/helper-validator-identifier': 7.29.7 + js-tokens: 4.0.0 + picocolors: 1.1.1 + + '@babel/compat-data@7.29.7': {} + + '@babel/core@7.29.7': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.7 + '@babel/helper-compilation-targets': 7.29.7 + '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7) + '@babel/helpers': 7.29.7 + '@babel/parser': 7.29.7 + '@babel/template': 7.29.7 + '@babel/traverse': 7.29.7 + '@babel/types': 7.29.7 + '@jridgewell/remapping': 2.3.5 + convert-source-map: 2.0.0 + debug: 4.4.3 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/generator@7.29.7': + dependencies: + '@babel/parser': 7.29.7 + '@babel/types': 7.29.7 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + jsesc: 3.1.0 + + '@babel/helper-compilation-targets@7.29.7': + dependencies: + '@babel/compat-data': 7.29.7 + '@babel/helper-validator-option': 7.29.7 + browserslist: 4.28.6 + lru-cache: 5.1.1 + semver: 6.3.1 + + '@babel/helper-globals@7.29.7': {} + + '@babel/helper-module-imports@7.29.7': + dependencies: + '@babel/traverse': 7.29.7 + '@babel/types': 7.29.7 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.29.7(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-module-imports': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + '@babel/traverse': 7.29.7 + transitivePeerDependencies: + - supports-color + + '@babel/helper-string-parser@7.29.7': {} + + '@babel/helper-validator-identifier@7.29.7': {} + + '@babel/helper-validator-option@7.29.7': {} + + '@babel/helpers@7.29.7': + dependencies: + '@babel/template': 7.29.7 + '@babel/types': 7.29.7 + + '@babel/parser@7.29.7': + dependencies: + '@babel/types': 7.29.7 + + '@babel/runtime@7.29.7': {} + + '@babel/template@7.29.7': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/parser': 7.29.7 + '@babel/types': 7.29.7 + + '@babel/traverse@7.29.7': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.7 + '@babel/helper-globals': 7.29.7 + '@babel/parser': 7.29.7 + '@babel/template': 7.29.7 + '@babel/types': 7.29.7 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + + '@babel/types@7.29.7': + dependencies: + '@babel/helper-string-parser': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + + '@bramus/specificity@2.4.2': + dependencies: + css-tree: 3.2.1 + + '@csstools/color-helpers@6.1.0': {} + + '@csstools/css-calc@3.2.1(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0)': + dependencies: + '@csstools/css-parser-algorithms': 4.0.0(@csstools/css-tokenizer@4.0.0) + '@csstools/css-tokenizer': 4.0.0 + + '@csstools/css-color-parser@4.1.9(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0)': + dependencies: + '@csstools/color-helpers': 6.1.0 + '@csstools/css-calc': 3.2.1(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0) + '@csstools/css-parser-algorithms': 4.0.0(@csstools/css-tokenizer@4.0.0) + '@csstools/css-tokenizer': 4.0.0 + + '@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0)': + dependencies: + '@csstools/css-tokenizer': 4.0.0 + + '@csstools/css-syntax-patches-for-csstree@1.1.6(css-tree@3.2.1)': + optionalDependencies: + css-tree: 3.2.1 + + '@csstools/css-tokenizer@4.0.0': {} + + '@emnapi/core@1.11.1': + dependencies: + '@emnapi/wasi-threads': 1.2.2 + tslib: 2.8.1 + optional: true + + '@emnapi/runtime@1.11.1': + dependencies: + tslib: 2.8.1 + optional: true + + '@emnapi/wasi-threads@1.2.2': + dependencies: + tslib: 2.8.1 + optional: true + + '@eslint-community/eslint-utils@4.9.1(eslint@10.7.0)': + dependencies: + eslint: 10.7.0 + eslint-visitor-keys: 3.4.3 + + '@eslint-community/regexpp@4.12.2': {} + + '@eslint/config-array@0.23.5': + dependencies: + '@eslint/object-schema': 3.0.5 + debug: 4.4.3 + minimatch: 10.2.5 + transitivePeerDependencies: + - supports-color + + '@eslint/config-helpers@0.6.0': + dependencies: + '@eslint/core': 1.2.1 + + '@eslint/core@1.2.1': + dependencies: + '@types/json-schema': 7.0.15 + + '@eslint/js@10.0.1(eslint@10.7.0)': + optionalDependencies: + eslint: 10.7.0 + + '@eslint/object-schema@3.0.5': {} + + '@eslint/plugin-kit@0.7.2': + dependencies: + '@eslint/core': 1.2.1 + levn: 0.4.1 + + '@exodus/bytes@1.15.1': {} + + '@humanfs/core@0.19.2': + dependencies: + '@humanfs/types': 0.15.0 + + '@humanfs/node@0.16.8': + dependencies: + '@humanfs/core': 0.19.2 + '@humanfs/types': 0.15.0 + '@humanwhocodes/retry': 0.4.3 + + '@humanfs/types@0.15.0': {} + + '@humanwhocodes/module-importer@1.0.1': {} + + '@humanwhocodes/retry@0.4.3': {} + + '@jridgewell/gen-mapping@0.3.13': + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/remapping@2.3.5': + dependencies: + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/sourcemap-codec@1.5.5': {} + + '@jridgewell/trace-mapping@0.3.31': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + + '@napi-rs/wasm-runtime@1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)': + dependencies: + '@emnapi/core': 1.11.1 + '@emnapi/runtime': 1.11.1 + '@tybys/wasm-util': 0.10.3 + optional: true + + '@oxc-project/types@0.139.0': {} + + '@playwright/test@1.61.1': + dependencies: + playwright: 1.61.1 + + '@rolldown/binding-android-arm64@1.1.5': + optional: true + + '@rolldown/binding-darwin-arm64@1.1.5': + optional: true + + '@rolldown/binding-darwin-x64@1.1.5': + optional: true + + '@rolldown/binding-freebsd-x64@1.1.5': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.1.5': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.1.5': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.1.5': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.1.5': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.1.5': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.1.5': + optional: true + + '@rolldown/binding-linux-x64-musl@1.1.5': + optional: true + + '@rolldown/binding-openharmony-arm64@1.1.5': + optional: true + + '@rolldown/binding-wasm32-wasi@1.1.5': + dependencies: + '@emnapi/core': 1.11.1 + '@emnapi/runtime': 1.11.1 + '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.1.5': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.1.5': + optional: true + + '@rolldown/pluginutils@1.0.1': {} + + '@standard-schema/spec@1.1.0': {} + + '@tauri-apps/api@2.11.1': {} + + '@tauri-apps/cli-darwin-arm64@2.11.4': + optional: true + + '@tauri-apps/cli-darwin-x64@2.11.4': + optional: true + + '@tauri-apps/cli-linux-arm-gnueabihf@2.11.4': + optional: true + + '@tauri-apps/cli-linux-arm64-gnu@2.11.4': + optional: true + + '@tauri-apps/cli-linux-arm64-musl@2.11.4': + optional: true + + '@tauri-apps/cli-linux-riscv64-gnu@2.11.4': + optional: true + + '@tauri-apps/cli-linux-x64-gnu@2.11.4': + optional: true + + '@tauri-apps/cli-linux-x64-musl@2.11.4': + optional: true + + '@tauri-apps/cli-win32-arm64-msvc@2.11.4': + optional: true + + '@tauri-apps/cli-win32-ia32-msvc@2.11.4': + optional: true + + '@tauri-apps/cli-win32-x64-msvc@2.11.4': + optional: true + + '@tauri-apps/cli@2.11.4': + optionalDependencies: + '@tauri-apps/cli-darwin-arm64': 2.11.4 + '@tauri-apps/cli-darwin-x64': 2.11.4 + '@tauri-apps/cli-linux-arm-gnueabihf': 2.11.4 + '@tauri-apps/cli-linux-arm64-gnu': 2.11.4 + '@tauri-apps/cli-linux-arm64-musl': 2.11.4 + '@tauri-apps/cli-linux-riscv64-gnu': 2.11.4 + '@tauri-apps/cli-linux-x64-gnu': 2.11.4 + '@tauri-apps/cli-linux-x64-musl': 2.11.4 + '@tauri-apps/cli-win32-arm64-msvc': 2.11.4 + '@tauri-apps/cli-win32-ia32-msvc': 2.11.4 + '@tauri-apps/cli-win32-x64-msvc': 2.11.4 + + '@testing-library/dom@10.4.1': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/runtime': 7.29.7 + '@types/aria-query': 5.0.4 + aria-query: 5.3.0 + dom-accessibility-api: 0.5.16 + lz-string: 1.5.0 + picocolors: 1.1.1 + pretty-format: 27.5.1 + + '@testing-library/jest-dom@6.9.1': + dependencies: + '@adobe/css-tools': 4.5.0 + aria-query: 5.3.2 + css.escape: 1.5.1 + dom-accessibility-api: 0.6.3 + picocolors: 1.1.1 + redent: 3.0.0 + + '@testing-library/react@16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7)': + dependencies: + '@babel/runtime': 7.29.7 + '@testing-library/dom': 10.4.1 + react: 19.2.7 + react-dom: 19.2.7(react@19.2.7) + optionalDependencies: + '@types/react': 19.2.17 + '@types/react-dom': 19.2.3(@types/react@19.2.17) + + '@tybys/wasm-util@0.10.3': + dependencies: + tslib: 2.8.1 + optional: true + + '@types/aria-query@5.0.4': {} + + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + + '@types/deep-eql@4.0.2': {} + + '@types/esrecurse@4.3.1': {} + + '@types/estree@1.0.9': {} + + '@types/json-schema@7.0.15': {} + + '@types/node@24.13.3': + dependencies: + undici-types: 7.18.2 + + '@types/react-dom@19.2.3(@types/react@19.2.17)': + dependencies: + '@types/react': 19.2.17 + + '@types/react@19.2.17': + dependencies: + csstype: 3.2.3 + + '@typescript-eslint/eslint-plugin@8.64.0(@typescript-eslint/parser@8.64.0(eslint@10.7.0)(typescript@6.0.3))(eslint@10.7.0)(typescript@6.0.3)': + dependencies: + '@eslint-community/regexpp': 4.12.2 + '@typescript-eslint/parser': 8.64.0(eslint@10.7.0)(typescript@6.0.3) + '@typescript-eslint/scope-manager': 8.64.0 + '@typescript-eslint/type-utils': 8.64.0(eslint@10.7.0)(typescript@6.0.3) + '@typescript-eslint/utils': 8.64.0(eslint@10.7.0)(typescript@6.0.3) + '@typescript-eslint/visitor-keys': 8.64.0 + eslint: 10.7.0 + ignore: 7.0.6 + natural-compare: 1.4.0 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@8.64.0(eslint@10.7.0)(typescript@6.0.3)': + dependencies: + '@typescript-eslint/scope-manager': 8.64.0 + '@typescript-eslint/types': 8.64.0 + '@typescript-eslint/typescript-estree': 8.64.0(typescript@6.0.3) + '@typescript-eslint/visitor-keys': 8.64.0 + debug: 4.4.3 + eslint: 10.7.0 + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/project-service@8.64.0(typescript@6.0.3)': + dependencies: + '@typescript-eslint/tsconfig-utils': 8.64.0(typescript@6.0.3) + '@typescript-eslint/types': 8.64.0 + debug: 4.4.3 + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/scope-manager@8.64.0': + dependencies: + '@typescript-eslint/types': 8.64.0 + '@typescript-eslint/visitor-keys': 8.64.0 + + '@typescript-eslint/tsconfig-utils@8.64.0(typescript@6.0.3)': + dependencies: + typescript: 6.0.3 + + '@typescript-eslint/type-utils@8.64.0(eslint@10.7.0)(typescript@6.0.3)': + dependencies: + '@typescript-eslint/types': 8.64.0 + '@typescript-eslint/typescript-estree': 8.64.0(typescript@6.0.3) + '@typescript-eslint/utils': 8.64.0(eslint@10.7.0)(typescript@6.0.3) + debug: 4.4.3 + eslint: 10.7.0 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/types@8.64.0': {} + + '@typescript-eslint/typescript-estree@8.64.0(typescript@6.0.3)': + dependencies: + '@typescript-eslint/project-service': 8.64.0(typescript@6.0.3) + '@typescript-eslint/tsconfig-utils': 8.64.0(typescript@6.0.3) + '@typescript-eslint/types': 8.64.0 + '@typescript-eslint/visitor-keys': 8.64.0 + debug: 4.4.3 + minimatch: 10.2.5 + semver: 7.8.5 + tinyglobby: 0.2.17 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@8.64.0(eslint@10.7.0)(typescript@6.0.3)': + dependencies: + '@eslint-community/eslint-utils': 4.9.1(eslint@10.7.0) + '@typescript-eslint/scope-manager': 8.64.0 + '@typescript-eslint/types': 8.64.0 + '@typescript-eslint/typescript-estree': 8.64.0(typescript@6.0.3) + eslint: 10.7.0 + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/visitor-keys@8.64.0': + dependencies: + '@typescript-eslint/types': 8.64.0 + eslint-visitor-keys: 5.0.1 + + '@vitejs/plugin-react@6.0.3(vite@8.1.5(@types/node@24.13.3))': + dependencies: + '@rolldown/pluginutils': 1.0.1 + vite: 8.1.5(@types/node@24.13.3) + + '@vitest/expect@4.1.10': + dependencies: + '@standard-schema/spec': 1.1.0 + '@types/chai': 5.2.3 + '@vitest/spy': 4.1.10 + '@vitest/utils': 4.1.10 + chai: 6.2.2 + tinyrainbow: 3.1.0 + + '@vitest/mocker@4.1.10(vite@8.1.5(@types/node@24.13.3))': + dependencies: + '@vitest/spy': 4.1.10 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + vite: 8.1.5(@types/node@24.13.3) + + '@vitest/pretty-format@4.1.10': + dependencies: + tinyrainbow: 3.1.0 + + '@vitest/runner@4.1.10': + dependencies: + '@vitest/utils': 4.1.10 + pathe: 2.0.3 + + '@vitest/snapshot@4.1.10': + dependencies: + '@vitest/pretty-format': 4.1.10 + '@vitest/utils': 4.1.10 + magic-string: 0.30.21 + pathe: 2.0.3 + + '@vitest/spy@4.1.10': {} + + '@vitest/utils@4.1.10': + dependencies: + '@vitest/pretty-format': 4.1.10 + convert-source-map: 2.0.0 + tinyrainbow: 3.1.0 + + acorn-jsx@5.3.2(acorn@8.17.0): + dependencies: + acorn: 8.17.0 + + acorn@8.17.0: {} + + ajv@6.15.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + + ansi-regex@5.0.1: {} + + ansi-styles@5.2.0: {} + + aria-query@5.3.0: + dependencies: + dequal: 2.0.3 + + aria-query@5.3.2: {} + + assertion-error@2.0.1: {} + + balanced-match@4.0.4: {} + + baseline-browser-mapping@2.10.43: {} + + bidi-js@1.0.3: + dependencies: + require-from-string: 2.0.2 + + brace-expansion@5.0.7: + dependencies: + balanced-match: 4.0.4 + + browserslist@4.28.6: + dependencies: + baseline-browser-mapping: 2.10.43 + caniuse-lite: 1.0.30001806 + electron-to-chromium: 1.5.392 + node-releases: 2.0.51 + update-browserslist-db: 1.2.3(browserslist@4.28.6) + + caniuse-lite@1.0.30001806: {} + + chai@6.2.2: {} + + convert-source-map@2.0.0: {} + + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + css-tree@3.2.1: + dependencies: + mdn-data: 2.27.1 + source-map-js: 1.2.1 + + css.escape@1.5.1: {} + + csstype@3.2.3: {} + + data-urls@7.0.0: + dependencies: + whatwg-mimetype: 5.0.0 + whatwg-url: 16.0.1 + transitivePeerDependencies: + - '@noble/hashes' + + debug@4.4.3: + dependencies: + ms: 2.1.3 + + decimal.js@10.6.0: {} + + deep-is@0.1.4: {} + + dequal@2.0.3: {} + + detect-libc@2.1.2: {} + + dom-accessibility-api@0.5.16: {} + + dom-accessibility-api@0.6.3: {} + + electron-to-chromium@1.5.392: {} + + entities@8.0.0: {} + + es-module-lexer@2.3.1: {} + + escalade@3.2.0: {} + + escape-string-regexp@4.0.0: {} + + eslint-plugin-react-hooks@7.1.1(eslint@10.7.0): + dependencies: + '@babel/core': 7.29.7 + '@babel/parser': 7.29.7 + eslint: 10.7.0 + hermes-parser: 0.25.1 + zod: 4.4.3 + zod-validation-error: 4.0.2(zod@4.4.3) + transitivePeerDependencies: + - supports-color + + eslint-plugin-react-refresh@0.5.3(eslint@10.7.0): + dependencies: + eslint: 10.7.0 + + eslint-scope@9.1.2: + dependencies: + '@types/esrecurse': 4.3.1 + '@types/estree': 1.0.9 + esrecurse: 4.3.0 + estraverse: 5.3.0 + + eslint-visitor-keys@3.4.3: {} + + eslint-visitor-keys@5.0.1: {} + + eslint@10.7.0: + dependencies: + '@eslint-community/eslint-utils': 4.9.1(eslint@10.7.0) + '@eslint-community/regexpp': 4.12.2 + '@eslint/config-array': 0.23.5 + '@eslint/config-helpers': 0.6.0 + '@eslint/core': 1.2.1 + '@eslint/plugin-kit': 0.7.2 + '@humanfs/node': 0.16.8 + '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.4.3 + '@types/estree': 1.0.9 + ajv: 6.15.0 + cross-spawn: 7.0.6 + debug: 4.4.3 + escape-string-regexp: 4.0.0 + eslint-scope: 9.1.2 + eslint-visitor-keys: 5.0.1 + espree: 11.2.0 + esquery: 1.7.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 8.0.0 + find-up: 5.0.0 + glob-parent: 6.0.2 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + json-stable-stringify-without-jsonify: 1.0.1 + minimatch: 10.2.5 + natural-compare: 1.4.0 + optionator: 0.9.4 + transitivePeerDependencies: + - supports-color + + espree@11.2.0: + dependencies: + acorn: 8.17.0 + acorn-jsx: 5.3.2(acorn@8.17.0) + eslint-visitor-keys: 5.0.1 + + esquery@1.7.0: + dependencies: + estraverse: 5.3.0 + + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 + + estraverse@5.3.0: {} + + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.9 + + esutils@2.0.3: {} + + expect-type@1.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-json-stable-stringify@2.1.0: {} + + fast-levenshtein@2.0.6: {} + + fdir@6.5.0(picomatch@4.0.5): + optionalDependencies: + picomatch: 4.0.5 + + file-entry-cache@8.0.0: + dependencies: + flat-cache: 4.0.1 + + find-up@5.0.0: + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + + flat-cache@4.0.1: + dependencies: + flatted: 3.4.2 + keyv: 4.5.4 + + flatted@3.4.2: {} + + fsevents@2.3.2: + optional: true + + fsevents@2.3.3: + optional: true + + gensync@1.0.0-beta.2: {} + + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 + + globals@17.5.0: {} + + hermes-estree@0.25.1: {} + + hermes-parser@0.25.1: + dependencies: + hermes-estree: 0.25.1 + + html-encoding-sniffer@6.0.0: + dependencies: + '@exodus/bytes': 1.15.1 + transitivePeerDependencies: + - '@noble/hashes' + + ignore@5.3.2: {} + + ignore@7.0.6: {} + + imurmurhash@0.1.4: {} + + indent-string@4.0.0: {} + + is-extglob@2.1.1: {} + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + is-potential-custom-element-name@1.0.1: {} + + isexe@2.0.0: {} + + js-tokens@4.0.0: {} + + jsdom@29.1.1: + dependencies: + '@asamuzakjp/css-color': 5.1.11 + '@asamuzakjp/dom-selector': 7.1.1 + '@bramus/specificity': 2.4.2 + '@csstools/css-syntax-patches-for-csstree': 1.1.6(css-tree@3.2.1) + '@exodus/bytes': 1.15.1 + css-tree: 3.2.1 + data-urls: 7.0.0 + decimal.js: 10.6.0 + html-encoding-sniffer: 6.0.0 + is-potential-custom-element-name: 1.0.1 + lru-cache: 11.5.2 + parse5: 8.0.1 + saxes: 6.0.0 + symbol-tree: 3.2.4 + tough-cookie: 6.0.2 + undici: 7.28.0 + w3c-xmlserializer: 5.0.0 + webidl-conversions: 8.0.1 + whatwg-mimetype: 5.0.0 + whatwg-url: 16.0.1 + xml-name-validator: 5.0.0 + transitivePeerDependencies: + - '@noble/hashes' + + jsesc@3.1.0: {} + + json-buffer@3.0.1: {} + + json-schema-traverse@0.4.1: {} + + json-stable-stringify-without-jsonify@1.0.1: {} + + json5@2.2.3: {} + + keyv@4.5.4: + dependencies: + json-buffer: 3.0.1 + + levn@0.4.1: + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + + lightningcss-android-arm64@1.32.0: + optional: true + + lightningcss-darwin-arm64@1.32.0: + optional: true + + lightningcss-darwin-x64@1.32.0: + optional: true + + lightningcss-freebsd-x64@1.32.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.32.0: + optional: true + + lightningcss-linux-arm64-gnu@1.32.0: + optional: true + + lightningcss-linux-arm64-musl@1.32.0: + optional: true + + lightningcss-linux-x64-gnu@1.32.0: + optional: true + + lightningcss-linux-x64-musl@1.32.0: + optional: true + + lightningcss-win32-arm64-msvc@1.32.0: + optional: true + + lightningcss-win32-x64-msvc@1.32.0: + optional: true + + lightningcss@1.32.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.32.0 + lightningcss-darwin-arm64: 1.32.0 + lightningcss-darwin-x64: 1.32.0 + lightningcss-freebsd-x64: 1.32.0 + lightningcss-linux-arm-gnueabihf: 1.32.0 + lightningcss-linux-arm64-gnu: 1.32.0 + lightningcss-linux-arm64-musl: 1.32.0 + lightningcss-linux-x64-gnu: 1.32.0 + lightningcss-linux-x64-musl: 1.32.0 + lightningcss-win32-arm64-msvc: 1.32.0 + lightningcss-win32-x64-msvc: 1.32.0 + + locate-path@6.0.0: + dependencies: + p-locate: 5.0.0 + + lru-cache@11.5.2: {} + + lru-cache@5.1.1: + dependencies: + yallist: 3.1.1 + + lz-string@1.5.0: {} + + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + + mdn-data@2.27.1: {} + + min-indent@1.0.1: {} + + minimatch@10.2.5: + dependencies: + brace-expansion: 5.0.7 + + ms@2.1.3: {} + + nanoid@3.3.16: {} + + natural-compare@1.4.0: {} + + node-releases@2.0.51: {} + + obug@2.1.4: {} + + optionator@0.9.4: + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.5 + + p-limit@3.1.0: + dependencies: + yocto-queue: 0.1.0 + + p-locate@5.0.0: + dependencies: + p-limit: 3.1.0 + + parse5@8.0.1: + dependencies: + entities: 8.0.0 + + path-exists@4.0.0: {} + + path-key@3.1.1: {} + + pathe@2.0.3: {} + + picocolors@1.1.1: {} + + picomatch@4.0.5: {} + + playwright-core@1.61.1: {} + + playwright@1.61.1: + dependencies: + playwright-core: 1.61.1 + optionalDependencies: + fsevents: 2.3.2 + + postcss@8.5.19: + dependencies: + nanoid: 3.3.16 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + prelude-ls@1.2.1: {} + + prettier@3.9.5: {} + + pretty-format@27.5.1: + dependencies: + ansi-regex: 5.0.1 + ansi-styles: 5.2.0 + react-is: 17.0.2 + + punycode@2.3.1: {} + + react-dom@19.2.7(react@19.2.7): + dependencies: + react: 19.2.7 + scheduler: 0.27.0 + + react-is@17.0.2: {} + + react@19.2.7: {} + + redent@3.0.0: + dependencies: + indent-string: 4.0.0 + strip-indent: 3.0.0 + + require-from-string@2.0.2: {} + + rolldown@1.1.5: + dependencies: + '@oxc-project/types': 0.139.0 + '@rolldown/pluginutils': 1.0.1 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.1.5 + '@rolldown/binding-darwin-arm64': 1.1.5 + '@rolldown/binding-darwin-x64': 1.1.5 + '@rolldown/binding-freebsd-x64': 1.1.5 + '@rolldown/binding-linux-arm-gnueabihf': 1.1.5 + '@rolldown/binding-linux-arm64-gnu': 1.1.5 + '@rolldown/binding-linux-arm64-musl': 1.1.5 + '@rolldown/binding-linux-ppc64-gnu': 1.1.5 + '@rolldown/binding-linux-s390x-gnu': 1.1.5 + '@rolldown/binding-linux-x64-gnu': 1.1.5 + '@rolldown/binding-linux-x64-musl': 1.1.5 + '@rolldown/binding-openharmony-arm64': 1.1.5 + '@rolldown/binding-wasm32-wasi': 1.1.5 + '@rolldown/binding-win32-arm64-msvc': 1.1.5 + '@rolldown/binding-win32-x64-msvc': 1.1.5 + + saxes@6.0.0: + dependencies: + xmlchars: 2.2.0 + + scheduler@0.27.0: {} + + semver@6.3.1: {} + + semver@7.8.5: {} + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + + siginfo@2.0.0: {} + + source-map-js@1.2.1: {} + + stackback@0.0.2: {} + + std-env@4.2.0: {} + + strip-indent@3.0.0: + dependencies: + min-indent: 1.0.1 + + symbol-tree@3.2.4: {} + + tinybench@2.9.0: {} + + tinyexec@1.2.4: {} + + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.5) + picomatch: 4.0.5 + + tinyrainbow@3.1.0: {} + + tldts-core@7.4.9: {} + + tldts@7.4.9: + dependencies: + tldts-core: 7.4.9 + + tough-cookie@6.0.2: + dependencies: + tldts: 7.4.9 + + tr46@6.0.0: + dependencies: + punycode: 2.3.1 + + ts-api-utils@2.5.0(typescript@6.0.3): + dependencies: + typescript: 6.0.3 + + tslib@2.8.1: + optional: true + + type-check@0.4.0: + dependencies: + prelude-ls: 1.2.1 + + typescript-eslint@8.64.0(eslint@10.7.0)(typescript@6.0.3): + dependencies: + '@typescript-eslint/eslint-plugin': 8.64.0(@typescript-eslint/parser@8.64.0(eslint@10.7.0)(typescript@6.0.3))(eslint@10.7.0)(typescript@6.0.3) + '@typescript-eslint/parser': 8.64.0(eslint@10.7.0)(typescript@6.0.3) + '@typescript-eslint/typescript-estree': 8.64.0(typescript@6.0.3) + '@typescript-eslint/utils': 8.64.0(eslint@10.7.0)(typescript@6.0.3) + eslint: 10.7.0 + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + typescript@6.0.3: {} + + undici-types@7.18.2: {} + + undici@7.28.0: {} + + update-browserslist-db@1.2.3(browserslist@4.28.6): + dependencies: + browserslist: 4.28.6 + escalade: 3.2.0 + picocolors: 1.1.1 + + uri-js@4.4.1: + dependencies: + punycode: 2.3.1 + + vite@8.1.5(@types/node@24.13.3): + dependencies: + lightningcss: 1.32.0 + picomatch: 4.0.5 + postcss: 8.5.19 + rolldown: 1.1.5 + tinyglobby: 0.2.17 + optionalDependencies: + '@types/node': 24.13.3 + fsevents: 2.3.3 + + vitest@4.1.10(@types/node@24.13.3)(jsdom@29.1.1)(vite@8.1.5(@types/node@24.13.3)): + dependencies: + '@vitest/expect': 4.1.10 + '@vitest/mocker': 4.1.10(vite@8.1.5(@types/node@24.13.3)) + '@vitest/pretty-format': 4.1.10 + '@vitest/runner': 4.1.10 + '@vitest/snapshot': 4.1.10 + '@vitest/spy': 4.1.10 + '@vitest/utils': 4.1.10 + es-module-lexer: 2.3.1 + expect-type: 1.4.0 + magic-string: 0.30.21 + obug: 2.1.4 + pathe: 2.0.3 + picomatch: 4.0.5 + std-env: 4.2.0 + tinybench: 2.9.0 + tinyexec: 1.2.4 + tinyglobby: 0.2.17 + tinyrainbow: 3.1.0 + vite: 8.1.5(@types/node@24.13.3) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 24.13.3 + jsdom: 29.1.1 + transitivePeerDependencies: + - msw + + w3c-xmlserializer@5.0.0: + dependencies: + xml-name-validator: 5.0.0 + + webidl-conversions@8.0.1: {} + + whatwg-mimetype@5.0.0: {} + + whatwg-url@16.0.1: + dependencies: + '@exodus/bytes': 1.15.1 + tr46: 6.0.0 + webidl-conversions: 8.0.1 + transitivePeerDependencies: + - '@noble/hashes' + + which@2.0.2: + dependencies: + isexe: 2.0.0 + + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + + word-wrap@1.2.5: {} + + xml-name-validator@5.0.0: {} + + xmlchars@2.2.0: {} + + yallist@3.1.1: {} + + yocto-queue@0.1.0: {} + + zod-validation-error@4.0.2(zod@4.4.3): + dependencies: + zod: 4.4.3 + + zod@4.4.3: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..924b55f --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - packages/* diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..b358f07 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,5 @@ +[toolchain] +channel = "1.97.1" +profile = "minimal" +components = ["rustfmt", "clippy"] +targets = ["x86_64-pc-windows-msvc"] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml new file mode 100644 index 0000000..8ee15d8 --- /dev/null +++ b/src-tauri/Cargo.toml @@ -0,0 +1,63 @@ +[package] +name = "astrbot-desktop" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +description = "AstrBot Windows companion and local-assistance desktop client" + +[lib] +name = "astrbot_desktop_lib" +crate-type = ["staticlib", "cdylib", "rlib"] + +[build-dependencies] +tauri-build.workspace = true + +[dependencies] +desktop-protocol = { path = "../crates/desktop-protocol" } +eventsource-stream.workspace = true +futures-util.workspace = true +png.workspace = true +quick-xml.workspace = true +regex.workspace = true +reqwest.workspace = true +rusqlite.workspace = true +secrecy.workspace = true +serde.workspace = true +serde_json.workspace = true +sha2.workspace = true +sysinfo.workspace = true +tauri.workspace = true +tauri-plugin-single-instance = "2.4.3" +thiserror.workspace = true +time.workspace = true +tokio.workspace = true +tokio-util.workspace = true +toml.workspace = true +tracing.workspace = true +tracing-subscriber.workspace = true +url.workspace = true +uuid.workspace = true +yaml-rust2.workspace = true +zeroize.workspace = true + +[target.'cfg(windows)'.dependencies] +windows = { workspace = true, features = [ + "Win32_Foundation", + "Win32_Graphics_Gdi", + "Win32_NetworkManagement_IpHelper", + "Win32_Networking_WinSock", + "Win32_Security_Credentials", + "Win32_Storage_FileSystem", + "Win32_Storage_Xps", + "Win32_System_Com", + "Win32_System_EventLog", + "Win32_System_ProcessStatus", + "Win32_System_Threading", + "Win32_UI_Accessibility", + "Win32_UI_WindowsAndMessaging", +] } + +[dev-dependencies] +tempfile.workspace = true +mock-gateway = { path = "../crates/mock-gateway" } diff --git a/src-tauri/build.rs b/src-tauri/build.rs new file mode 100644 index 0000000..261851f --- /dev/null +++ b/src-tauri/build.rs @@ -0,0 +1,3 @@ +fn main() { + tauri_build::build(); +} diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json new file mode 100644 index 0000000..e60f440 --- /dev/null +++ b/src-tauri/capabilities/default.json @@ -0,0 +1,7 @@ +{ + "$schema": "../gen/schemas/desktop-schema.json", + "identifier": "default", + "description": "Minimal capability set for the main AstrBot Desktop window.", + "windows": ["main"], + "permissions": ["core:default"] +} diff --git a/src-tauri/icons/128x128.png b/src-tauri/icons/128x128.png new file mode 100644 index 0000000..6904563 Binary files /dev/null and b/src-tauri/icons/128x128.png differ diff --git a/src-tauri/icons/128x128@2x.png b/src-tauri/icons/128x128@2x.png new file mode 100644 index 0000000..b971a1b Binary files /dev/null and b/src-tauri/icons/128x128@2x.png differ diff --git a/src-tauri/icons/32x32.png b/src-tauri/icons/32x32.png new file mode 100644 index 0000000..b40b51c Binary files /dev/null and b/src-tauri/icons/32x32.png differ diff --git a/src-tauri/icons/64x64.png b/src-tauri/icons/64x64.png new file mode 100644 index 0000000..59478a5 Binary files /dev/null and b/src-tauri/icons/64x64.png differ diff --git a/src-tauri/icons/Square107x107Logo.png b/src-tauri/icons/Square107x107Logo.png new file mode 100644 index 0000000..63ab7ef Binary files /dev/null and b/src-tauri/icons/Square107x107Logo.png differ diff --git a/src-tauri/icons/Square142x142Logo.png b/src-tauri/icons/Square142x142Logo.png new file mode 100644 index 0000000..117f556 Binary files /dev/null and b/src-tauri/icons/Square142x142Logo.png differ diff --git a/src-tauri/icons/Square150x150Logo.png b/src-tauri/icons/Square150x150Logo.png new file mode 100644 index 0000000..f02b68c Binary files /dev/null and b/src-tauri/icons/Square150x150Logo.png differ diff --git a/src-tauri/icons/Square284x284Logo.png b/src-tauri/icons/Square284x284Logo.png new file mode 100644 index 0000000..6b90354 Binary files /dev/null and b/src-tauri/icons/Square284x284Logo.png differ diff --git a/src-tauri/icons/Square30x30Logo.png b/src-tauri/icons/Square30x30Logo.png new file mode 100644 index 0000000..bd4053b Binary files /dev/null and b/src-tauri/icons/Square30x30Logo.png differ diff --git a/src-tauri/icons/Square310x310Logo.png b/src-tauri/icons/Square310x310Logo.png new file mode 100644 index 0000000..6f5b053 Binary files /dev/null and b/src-tauri/icons/Square310x310Logo.png differ diff --git a/src-tauri/icons/Square44x44Logo.png b/src-tauri/icons/Square44x44Logo.png new file mode 100644 index 0000000..6eb254f Binary files /dev/null and b/src-tauri/icons/Square44x44Logo.png differ diff --git a/src-tauri/icons/Square71x71Logo.png b/src-tauri/icons/Square71x71Logo.png new file mode 100644 index 0000000..0c122d5 Binary files /dev/null and b/src-tauri/icons/Square71x71Logo.png differ diff --git a/src-tauri/icons/Square89x89Logo.png b/src-tauri/icons/Square89x89Logo.png new file mode 100644 index 0000000..318b4cd Binary files /dev/null and b/src-tauri/icons/Square89x89Logo.png differ diff --git a/src-tauri/icons/StoreLogo.png b/src-tauri/icons/StoreLogo.png new file mode 100644 index 0000000..c5510dc Binary files /dev/null and b/src-tauri/icons/StoreLogo.png differ diff --git a/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml b/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..2ffbf24 --- /dev/null +++ b/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..30332a0 Binary files /dev/null and b/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..bb99d40 Binary files /dev/null and b/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..bd727aa Binary files /dev/null and b/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..c4b59c7 Binary files /dev/null and b/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..9b66ed3 Binary files /dev/null and b/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..e7ad8a9 Binary files /dev/null and b/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..8e011c3 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..5636634 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..1852b8f Binary files /dev/null and b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..2fbaa8e Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..b7a8917 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..d747f52 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..6b05d43 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..1c728f0 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..8900e5d Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/values/ic_launcher_background.xml b/src-tauri/icons/android/values/ic_launcher_background.xml new file mode 100644 index 0000000..ea9c223 --- /dev/null +++ b/src-tauri/icons/android/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #fff + \ No newline at end of file diff --git a/src-tauri/icons/icon.icns b/src-tauri/icons/icon.icns new file mode 100644 index 0000000..0ee094b Binary files /dev/null and b/src-tauri/icons/icon.icns differ diff --git a/src-tauri/icons/icon.ico b/src-tauri/icons/icon.ico new file mode 100644 index 0000000..c7f6e35 Binary files /dev/null and b/src-tauri/icons/icon.ico differ diff --git a/src-tauri/icons/icon.png b/src-tauri/icons/icon.png new file mode 100644 index 0000000..cfe987a Binary files /dev/null and b/src-tauri/icons/icon.png differ diff --git a/src-tauri/icons/ios/AppIcon-20x20@1x.png b/src-tauri/icons/ios/AppIcon-20x20@1x.png new file mode 100644 index 0000000..88e68d8 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-20x20@1x.png differ diff --git a/src-tauri/icons/ios/AppIcon-20x20@2x-1.png b/src-tauri/icons/ios/AppIcon-20x20@2x-1.png new file mode 100644 index 0000000..3da5a92 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-20x20@2x-1.png differ diff --git a/src-tauri/icons/ios/AppIcon-20x20@2x.png b/src-tauri/icons/ios/AppIcon-20x20@2x.png new file mode 100644 index 0000000..3da5a92 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-20x20@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-20x20@3x.png b/src-tauri/icons/ios/AppIcon-20x20@3x.png new file mode 100644 index 0000000..cfcb074 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-20x20@3x.png differ diff --git a/src-tauri/icons/ios/AppIcon-29x29@1x.png b/src-tauri/icons/ios/AppIcon-29x29@1x.png new file mode 100644 index 0000000..7755b53 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-29x29@1x.png differ diff --git a/src-tauri/icons/ios/AppIcon-29x29@2x-1.png b/src-tauri/icons/ios/AppIcon-29x29@2x-1.png new file mode 100644 index 0000000..e465e53 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-29x29@2x-1.png differ diff --git a/src-tauri/icons/ios/AppIcon-29x29@2x.png b/src-tauri/icons/ios/AppIcon-29x29@2x.png new file mode 100644 index 0000000..e465e53 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-29x29@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-29x29@3x.png b/src-tauri/icons/ios/AppIcon-29x29@3x.png new file mode 100644 index 0000000..26b698f Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-29x29@3x.png differ diff --git a/src-tauri/icons/ios/AppIcon-40x40@1x.png b/src-tauri/icons/ios/AppIcon-40x40@1x.png new file mode 100644 index 0000000..3da5a92 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-40x40@1x.png differ diff --git a/src-tauri/icons/ios/AppIcon-40x40@2x-1.png b/src-tauri/icons/ios/AppIcon-40x40@2x-1.png new file mode 100644 index 0000000..840d4f8 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-40x40@2x-1.png differ diff --git a/src-tauri/icons/ios/AppIcon-40x40@2x.png b/src-tauri/icons/ios/AppIcon-40x40@2x.png new file mode 100644 index 0000000..840d4f8 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-40x40@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-40x40@3x.png b/src-tauri/icons/ios/AppIcon-40x40@3x.png new file mode 100644 index 0000000..786e841 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-40x40@3x.png differ diff --git a/src-tauri/icons/ios/AppIcon-512@2x.png b/src-tauri/icons/ios/AppIcon-512@2x.png new file mode 100644 index 0000000..712a305 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-512@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-60x60@2x.png b/src-tauri/icons/ios/AppIcon-60x60@2x.png new file mode 100644 index 0000000..786e841 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-60x60@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-60x60@3x.png b/src-tauri/icons/ios/AppIcon-60x60@3x.png new file mode 100644 index 0000000..704a14f Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-60x60@3x.png differ diff --git a/src-tauri/icons/ios/AppIcon-76x76@1x.png b/src-tauri/icons/ios/AppIcon-76x76@1x.png new file mode 100644 index 0000000..a338d04 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-76x76@1x.png differ diff --git a/src-tauri/icons/ios/AppIcon-76x76@2x.png b/src-tauri/icons/ios/AppIcon-76x76@2x.png new file mode 100644 index 0000000..a53cbcd Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-76x76@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png b/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png new file mode 100644 index 0000000..fbce856 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png differ diff --git a/src-tauri/src/database/mod.rs b/src-tauri/src/database/mod.rs new file mode 100644 index 0000000..3decc58 --- /dev/null +++ b/src-tauri/src/database/mod.rs @@ -0,0 +1,134 @@ +use rusqlite::{Connection, OptionalExtension, params}; +use thiserror::Error; + +pub struct ProfileMessageStore { + connection: Connection, +} + +impl ProfileMessageStore { + pub fn in_memory() -> Result { + let connection = Connection::open_in_memory()?; + let store = Self { connection }; + store.migrate()?; + Ok(store) + } + + fn migrate(&self) -> Result<(), DatabaseError> { + self.connection.execute_batch( + " + PRAGMA foreign_keys = ON; + CREATE TABLE IF NOT EXISTS messages ( + profile_id TEXT NOT NULL, + server_instance_id TEXT NOT NULL, + conversation_id TEXT NOT NULL, + message_id TEXT NOT NULL, + content TEXT NOT NULL, + PRIMARY KEY (profile_id, server_instance_id, conversation_id, message_id) + ); + ", + )?; + Ok(()) + } + + pub fn insert_message( + &self, + profile_id: &str, + server_instance_id: &str, + conversation_id: &str, + message_id: &str, + content: &str, + ) -> Result<(), DatabaseError> { + self.connection.execute( + " + INSERT INTO messages ( + profile_id, + server_instance_id, + conversation_id, + message_id, + content + ) VALUES (?1, ?2, ?3, ?4, ?5) + ", + params![ + profile_id, + server_instance_id, + conversation_id, + message_id, + content + ], + )?; + Ok(()) + } + + pub fn message_content( + &self, + profile_id: &str, + server_instance_id: &str, + conversation_id: &str, + message_id: &str, + ) -> Result, DatabaseError> { + Ok(self + .connection + .query_row( + " + SELECT content + FROM messages + WHERE profile_id = ?1 + AND server_instance_id = ?2 + AND conversation_id = ?3 + AND message_id = ?4 + ", + params![profile_id, server_instance_id, conversation_id, message_id], + |row| row.get(0), + ) + .optional()?) + } +} + +#[derive(Debug, Error)] +pub enum DatabaseError { + #[error("SQLite operation failed")] + Sqlite(#[from] rusqlite::Error), +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn identical_remote_ids_remain_isolated_by_profile_and_server() { + let store = ProfileMessageStore::in_memory().expect("store"); + store + .insert_message( + "profile-a", + "server-a", + "same-conversation", + "same-message", + "A", + ) + .expect("insert A"); + store + .insert_message( + "profile-b", + "server-b", + "same-conversation", + "same-message", + "B", + ) + .expect("insert B"); + + assert_eq!( + store + .message_content("profile-a", "server-a", "same-conversation", "same-message") + .expect("query A") + .as_deref(), + Some("A") + ); + assert_eq!( + store + .message_content("profile-b", "server-b", "same-conversation", "same-message") + .expect("query B") + .as_deref(), + Some("B") + ); + } +} diff --git a/src-tauri/src/diagnostics/authorization.rs b/src-tauri/src/diagnostics/authorization.rs new file mode 100644 index 0000000..e5aa3ed --- /dev/null +++ b/src-tauri/src/diagnostics/authorization.rs @@ -0,0 +1,100 @@ +use std::{ + fmt, + fs::{File, OpenOptions}, + io::{self, Read, Seek, SeekFrom}, + path::Path, + time::{Duration, Instant}, +}; + +use uuid::Uuid; + +/// A file selected by the local user and kept open by the Rust layer. +/// +/// The real path is deliberately not exposed. Keeping the handle open also +/// prevents a later server payload from swapping the selected path. +pub struct AuthorizedFile { + token: Uuid, + file: File, + display_name: String, + expires_at: Instant, +} + +impl AuthorizedFile { + pub fn open_local_selection(path: &Path, ttl: Duration) -> io::Result { + let file = OpenOptions::new().read(true).open(path)?; + if !file.metadata()?.is_file() { + return Err(io::Error::new( + io::ErrorKind::InvalidInput, + "the selected object is not a regular file", + )); + } + + let display_name = path + .file_name() + .and_then(|value| value.to_str()) + .unwrap_or("selected-file") + .to_owned(); + + Ok(Self { + token: Uuid::new_v4(), + file, + display_name, + expires_at: Instant::now() + ttl, + }) + } + + pub fn token(&self) -> Uuid { + self.token + } + + pub fn display_name(&self) -> &str { + &self.display_name + } + + pub fn is_expired(&self) -> bool { + Instant::now() >= self.expires_at + } + + pub(crate) fn ensure_active(&self) -> io::Result<()> { + if self.is_expired() { + return Err(io::Error::new( + io::ErrorKind::PermissionDenied, + "the local file authorization has expired", + )); + } + Ok(()) + } + + pub(crate) fn try_clone_file(&self) -> io::Result { + self.ensure_active()?; + self.file.try_clone() + } + + pub(crate) fn read_bounded(&self, maximum_bytes: usize) -> io::Result> { + self.ensure_active()?; + let mut file = self.file.try_clone()?; + let length = file.metadata()?.len(); + if length > maximum_bytes as u64 { + return Err(io::Error::new( + io::ErrorKind::InvalidData, + "the selected file exceeds the configured read limit", + )); + } + + file.seek(SeekFrom::Start(0))?; + let mut bytes = Vec::with_capacity(length as usize); + file.read_to_end(&mut bytes)?; + Ok(bytes) + } +} + +impl fmt::Debug for AuthorizedFile { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter + .debug_struct("AuthorizedFile") + .field("token", &self.token) + .field("display_name", &self.display_name) + .field("expired", &self.is_expired()) + .finish_non_exhaustive() + } +} diff --git a/src-tauri/src/diagnostics/config.rs b/src-tauri/src/diagnostics/config.rs new file mode 100644 index 0000000..2b294a7 --- /dev/null +++ b/src-tauri/src/diagnostics/config.rs @@ -0,0 +1,368 @@ +use std::{fmt, io, sync::OnceLock}; + +use quick_xml::{Reader, events::Event}; +use regex::{Captures, Regex}; +use serde_json::Value as JsonValue; + +use super::{ + authorization::AuthorizedFile, + redaction::{REDACTED, Redactor, is_sensitive_key}, +}; + +pub const MAX_CONFIG_BYTES: usize = 1024 * 1024; +const MAX_DEPTH: usize = 64; +const MAX_NODES: usize = 10_000; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ConfigFormat { + Json, + Toml, + Yaml, + Ini, + Xml, + DotEnv, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct ParsedConfig { + pub display_name: String, + pub format: ConfigFormat, + pub redacted_text: String, +} + +#[derive(Debug)] +pub enum ConfigError { + AuthorizationExpired, + TooLarge, + InvalidUtf8, + UnsupportedConstruct(&'static str), + InvalidSyntax(&'static str), + Io(io::Error), +} + +impl fmt::Display for ConfigError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::AuthorizationExpired => { + formatter.write_str("the local file authorization has expired") + } + Self::TooLarge => formatter.write_str("the selected config exceeds the read limit"), + Self::InvalidUtf8 => formatter.write_str("the selected config is not UTF-8 text"), + Self::UnsupportedConstruct(kind) => { + write!(formatter, "the selected config contains unsupported {kind}") + } + Self::InvalidSyntax(format) => write!(formatter, "the selected {format} is invalid"), + Self::Io(error) => write!(formatter, "config read failed: {}", error.kind()), + } + } +} + +impl std::error::Error for ConfigError {} + +pub fn parse_authorized_config( + authorized: &AuthorizedFile, + format: ConfigFormat, + redactor: &Redactor, +) -> Result { + authorized + .ensure_active() + .map_err(|_| ConfigError::AuthorizationExpired)?; + let bytes = authorized.read_bounded(MAX_CONFIG_BYTES).map_err(|error| { + if error.kind() == io::ErrorKind::InvalidData { + ConfigError::TooLarge + } else { + ConfigError::Io(error) + } + })?; + let text = std::str::from_utf8(&bytes).map_err(|_| ConfigError::InvalidUtf8)?; + + let normalized = match format { + ConfigFormat::Json => parse_json(text, redactor)?, + ConfigFormat::Toml => parse_toml(text, redactor)?, + ConfigFormat::Yaml => validate_yaml(text)?, + ConfigFormat::Ini => validate_ini(text)?, + ConfigFormat::Xml => validate_xml(text)?, + ConfigFormat::DotEnv => validate_dotenv(text)?, + }; + + let redacted_text = redact_xml_elements(&redactor.redact(&normalized)); + Ok(ParsedConfig { + display_name: authorized.display_name().to_owned(), + format, + redacted_text, + }) +} + +fn parse_json(text: &str, redactor: &Redactor) -> Result { + let mut value = + serde_json::from_str::(text).map_err(|_| ConfigError::InvalidSyntax("JSON"))?; + let mut nodes = 0; + redact_json_value(&mut value, redactor, 0, &mut nodes)?; + serde_json::to_string_pretty(&value).map_err(|_| ConfigError::InvalidSyntax("JSON")) +} + +fn redact_json_value( + value: &mut JsonValue, + redactor: &Redactor, + depth: usize, + nodes: &mut usize, +) -> Result<(), ConfigError> { + enforce_limits(depth, nodes)?; + match value { + JsonValue::Object(map) => { + for (key, child) in map { + if is_sensitive_key(key) { + *child = JsonValue::String(REDACTED.to_owned()); + } else { + redact_json_value(child, redactor, depth + 1, nodes)?; + } + } + } + JsonValue::Array(values) => { + for child in values { + redact_json_value(child, redactor, depth + 1, nodes)?; + } + } + JsonValue::String(value) => *value = redactor.redact(value), + _ => {} + } + Ok(()) +} + +fn parse_toml(text: &str, redactor: &Redactor) -> Result { + let mut value = text + .parse::() + .map_err(|_| ConfigError::InvalidSyntax("TOML"))?; + let mut nodes = 0; + redact_toml_value(&mut value, redactor, 0, &mut nodes)?; + toml::to_string_pretty(&value).map_err(|_| ConfigError::InvalidSyntax("TOML")) +} + +fn redact_toml_value( + value: &mut toml::Value, + redactor: &Redactor, + depth: usize, + nodes: &mut usize, +) -> Result<(), ConfigError> { + enforce_limits(depth, nodes)?; + match value { + toml::Value::Table(table) => { + for (key, child) in table { + if is_sensitive_key(key) { + *child = toml::Value::String(REDACTED.to_owned()); + } else { + redact_toml_value(child, redactor, depth + 1, nodes)?; + } + } + } + toml::Value::Array(values) => { + for child in values { + redact_toml_value(child, redactor, depth + 1, nodes)?; + } + } + toml::Value::String(value) => *value = redactor.redact(value), + _ => {} + } + Ok(()) +} + +fn enforce_limits(depth: usize, nodes: &mut usize) -> Result<(), ConfigError> { + if depth > MAX_DEPTH { + return Err(ConfigError::UnsupportedConstruct("nesting depth")); + } + *nodes += 1; + if *nodes > MAX_NODES { + return Err(ConfigError::UnsupportedConstruct("node count")); + } + Ok(()) +} + +fn validate_yaml(text: &str) -> Result { + let mut nodes = 0_usize; + for line in text.lines() { + let trimmed = line.trim(); + if trimmed.is_empty() || trimmed.starts_with('#') || matches!(trimmed, "---" | "...") { + continue; + } + if trimmed.contains("<<:") + || trimmed.starts_with('!') + || trimmed.starts_with('&') + || trimmed.starts_with('*') + || trimmed.contains(": &") + || trimmed.contains(": *") + { + return Err(ConfigError::UnsupportedConstruct( + "YAML tag, anchor, or alias", + )); + } + let indentation = line + .chars() + .take_while(|character| character.is_whitespace()) + .count(); + if indentation > MAX_DEPTH * 2 { + return Err(ConfigError::UnsupportedConstruct("YAML nesting depth")); + } + if !trimmed.starts_with('-') && !trimmed.contains(':') { + return Err(ConfigError::InvalidSyntax("YAML")); + } + nodes += 1; + if nodes > MAX_NODES { + return Err(ConfigError::UnsupportedConstruct("YAML node count")); + } + } + Ok(text.to_owned()) +} + +fn validate_ini(text: &str) -> Result { + let mut nodes = 0_usize; + for line in text.lines() { + let trimmed = line.trim(); + if trimmed.is_empty() || trimmed.starts_with('#') || trimmed.starts_with(';') { + continue; + } + let is_section = trimmed.starts_with('[') && trimmed.ends_with(']'); + if !is_section && !trimmed.contains('=') { + return Err(ConfigError::InvalidSyntax("INI")); + } + nodes += 1; + if nodes > MAX_NODES { + return Err(ConfigError::UnsupportedConstruct("INI entry count")); + } + } + Ok(text.to_owned()) +} + +fn validate_dotenv(text: &str) -> Result { + let mut entries = 0_usize; + for line in text.lines() { + let trimmed = line.trim(); + if trimmed.is_empty() || trimmed.starts_with('#') { + continue; + } + let assignment = trimmed.strip_prefix("export ").unwrap_or(trimmed); + let (key, _) = assignment + .split_once('=') + .ok_or(ConfigError::InvalidSyntax(".env"))?; + if key.is_empty() + || !key.chars().enumerate().all(|(index, value)| { + value == '_' + || (value.is_ascii_alphanumeric() && (index > 0 || !value.is_ascii_digit())) + }) + { + return Err(ConfigError::InvalidSyntax(".env")); + } + entries += 1; + if entries > MAX_NODES { + return Err(ConfigError::UnsupportedConstruct(".env entry count")); + } + } + Ok(text.to_owned()) +} + +fn validate_xml(text: &str) -> Result { + let lowercase = text.to_ascii_lowercase(); + if lowercase.contains(" { + depth += 1; + nodes += 1; + if depth > MAX_DEPTH || nodes > MAX_NODES { + return Err(ConfigError::UnsupportedConstruct("XML depth or node count")); + } + } + Ok(Event::End(_)) => depth = depth.saturating_sub(1), + Ok(Event::Empty(_)) => { + nodes += 1; + if nodes > MAX_NODES { + return Err(ConfigError::UnsupportedConstruct("XML node count")); + } + } + Ok(Event::DocType(_)) => return Err(ConfigError::UnsupportedConstruct("XML DTD")), + Ok(Event::Eof) => break, + Ok(_) => {} + Err(_) => return Err(ConfigError::InvalidSyntax("XML")), + } + buffer.clear(); + } + Ok(text.to_owned()) +} + +fn redact_xml_elements(text: &str) -> String { + static XML_SECRET: OnceLock = OnceLock::new(); + let pattern = XML_SECRET.get_or_init(|| { + Regex::new( + r"(?is)(?P<(?:access[_-]?token|refresh[_-]?token|api[_-]?key|client[_-]?secret|private[_-]?key|password|passwd|secret|cookie|authorization)(?:\s[^>]*)?>).*?(?P)", + ) + .expect("the XML redaction regex is valid") + }); + pattern + .replace_all(text, |captures: &Captures<'_>| { + format!("{}{}{}", &captures["open"], REDACTED, &captures["close"]) + }) + .into_owned() +} + +#[cfg(test)] +mod tests { + use std::{fs, time::Duration}; + + use super::*; + + fn parse_fixture(contents: &str, format: ConfigFormat) -> Result { + let path = std::env::temp_dir().join(format!("astrbot-config-{}", uuid::Uuid::new_v4())); + fs::write(&path, contents).expect("write config fixture"); + let result = { + let authorized = AuthorizedFile::open_local_selection(&path, Duration::from_secs(5)) + .expect("authorize config fixture"); + parse_authorized_config(&authorized, format, &Redactor::default()) + }; + fs::remove_file(path).expect("remove config fixture"); + result + } + + #[test] + fn recursively_redacts_json_fields() { + let parsed = parse_fixture( + r#"{"database":{"password":"canary-value"},"safe":"visible"}"#, + ConfigFormat::Json, + ) + .expect("parse JSON"); + assert!(!parsed.redacted_text.contains("canary-value")); + assert!(parsed.redacted_text.contains("visible")); + } + + #[test] + fn rejects_yaml_aliases_and_xml_entities() { + assert!(matches!( + parse_fixture("defaults: &defaults\n token: value", ConfigFormat::Yaml), + Err(ConfigError::UnsupportedConstruct(_)) + )); + assert!(matches!( + parse_fixture( + "]>&y;", + ConfigFormat::Xml + ), + Err(ConfigError::UnsupportedConstruct(_)) + )); + } + + #[test] + fn redacts_xml_sensitive_elements() { + let parsed = parse_fixture( + "canary-valuevisible", + ConfigFormat::Xml, + ) + .expect("parse XML"); + assert!(!parsed.redacted_text.contains("canary-value")); + assert!(parsed.redacted_text.contains("visible")); + } +} diff --git a/src-tauri/src/diagnostics/log_tail.rs b/src-tauri/src/diagnostics/log_tail.rs new file mode 100644 index 0000000..ca96dd2 --- /dev/null +++ b/src-tauri/src/diagnostics/log_tail.rs @@ -0,0 +1,238 @@ +use std::{ + fmt, + io::{self, Read, Seek, SeekFrom}, +}; + +use super::{authorization::AuthorizedFile, redaction::Redactor}; + +pub const DEFAULT_MAX_BYTES: usize = 64 * 1024; +pub const HARD_MAX_BYTES: usize = 1024 * 1024; +pub const DEFAULT_MAX_LINES: usize = 200; +pub const HARD_MAX_LINES: usize = 500; +const MAX_LINE_CHARACTERS: usize = 8 * 1024; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum TextEncoding { + Utf8, + Utf16LittleEndian, + Utf16BigEndian, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct TailOptions { + pub maximum_bytes: usize, + pub maximum_lines: usize, +} + +impl Default for TailOptions { + fn default() -> Self { + Self { + maximum_bytes: DEFAULT_MAX_BYTES, + maximum_lines: DEFAULT_MAX_LINES, + } + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct TailResult { + pub display_name: String, + pub text: String, + pub encoding: TextEncoding, + pub file_size: u64, + pub bytes_read: usize, + pub truncated_at_start: bool, + pub truncated_lines: bool, +} + +#[derive(Debug)] +pub enum TailError { + InvalidLimit, + AuthorizationExpired, + BinaryFile, + InvalidUtf16, + Io(io::Error), +} + +impl fmt::Display for TailError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::InvalidLimit => formatter.write_str("the log-tail limit is invalid"), + Self::AuthorizationExpired => { + formatter.write_str("the local file authorization has expired") + } + Self::BinaryFile => formatter.write_str("the selected file appears to be binary"), + Self::InvalidUtf16 => formatter.write_str("the selected UTF-16 file is malformed"), + Self::Io(error) => write!(formatter, "log-tail I/O failed: {}", error.kind()), + } + } +} + +impl std::error::Error for TailError {} + +pub fn read_authorized_tail( + authorized: &AuthorizedFile, + options: TailOptions, + redactor: &Redactor, +) -> Result { + if options.maximum_bytes == 0 + || options.maximum_bytes > HARD_MAX_BYTES + || options.maximum_lines == 0 + || options.maximum_lines > HARD_MAX_LINES + { + return Err(TailError::InvalidLimit); + } + authorized + .ensure_active() + .map_err(|_| TailError::AuthorizationExpired)?; + + let mut file = authorized.try_clone_file().map_err(TailError::Io)?; + let file_size = file.metadata().map_err(TailError::Io)?.len(); + let mut prefix = [0_u8; 3]; + file.seek(SeekFrom::Start(0)).map_err(TailError::Io)?; + let prefix_length = file.read(&mut prefix).map_err(TailError::Io)?; + let (encoding, bom_length) = detect_encoding(&prefix[..prefix_length]); + + let mut start = file_size.saturating_sub(options.maximum_bytes as u64); + if matches!( + encoding, + TextEncoding::Utf16LittleEndian | TextEncoding::Utf16BigEndian + ) && start > bom_length as u64 + && !(start - bom_length as u64).is_multiple_of(2) + { + start += 1; + } + + file.seek(SeekFrom::Start(start)).map_err(TailError::Io)?; + let mut bytes = Vec::with_capacity((file_size - start) as usize); + file.read_to_end(&mut bytes).map_err(TailError::Io)?; + let bytes_read = bytes.len(); + if start == 0 && bom_length > 0 && bytes.len() >= bom_length { + bytes.drain(..bom_length); + } + + let mut text = decode_text(&bytes, encoding)?; + let truncated_at_start = start > bom_length as u64; + if truncated_at_start { + text = text + .split_once('\n') + .map(|(_, remainder)| remainder.to_owned()) + .unwrap_or_default(); + } + + let mut lines = text.lines().map(truncate_line).collect::>(); + let truncated_lines = lines.len() > options.maximum_lines; + if truncated_lines { + let keep_from = lines.len() - options.maximum_lines; + lines.drain(..keep_from); + } + let text = redactor.redact(&lines.join("\n")); + + Ok(TailResult { + display_name: authorized.display_name().to_owned(), + text, + encoding, + file_size, + bytes_read, + truncated_at_start, + truncated_lines, + }) +} + +fn detect_encoding(prefix: &[u8]) -> (TextEncoding, usize) { + if prefix.starts_with(&[0xEF, 0xBB, 0xBF]) { + (TextEncoding::Utf8, 3) + } else if prefix.starts_with(&[0xFF, 0xFE]) { + (TextEncoding::Utf16LittleEndian, 2) + } else if prefix.starts_with(&[0xFE, 0xFF]) { + (TextEncoding::Utf16BigEndian, 2) + } else { + (TextEncoding::Utf8, 0) + } +} + +fn decode_text(bytes: &[u8], encoding: TextEncoding) -> Result { + match encoding { + TextEncoding::Utf8 => { + if bytes.contains(&0) { + return Err(TailError::BinaryFile); + } + Ok(String::from_utf8_lossy(bytes).into_owned()) + } + TextEncoding::Utf16LittleEndian | TextEncoding::Utf16BigEndian => { + if !bytes.len().is_multiple_of(2) { + return Err(TailError::InvalidUtf16); + } + let values = bytes + .chunks_exact(2) + .map(|pair| match encoding { + TextEncoding::Utf16LittleEndian => u16::from_le_bytes([pair[0], pair[1]]), + TextEncoding::Utf16BigEndian => u16::from_be_bytes([pair[0], pair[1]]), + TextEncoding::Utf8 => unreachable!(), + }) + .collect::>(); + String::from_utf16(&values).map_err(|_| TailError::InvalidUtf16) + } + } +} + +fn truncate_line(line: &str) -> String { + let mut characters = line.chars(); + let truncated = characters + .by_ref() + .take(MAX_LINE_CHARACTERS) + .collect::(); + if characters.next().is_some() { + format!("{truncated}…") + } else { + truncated + } +} + +#[cfg(test)] +mod tests { + use std::{fs, time::Duration}; + + use super::*; + + #[test] + fn reads_only_the_tail_and_redacts_it() { + let path = std::env::temp_dir().join(format!("astrbot-tail-{}.log", uuid::Uuid::new_v4())); + let canary = format!("secret-{}", uuid::Uuid::new_v4()); + let contents = format!("old line\nsecond line\npassword={canary}\nlast line\n"); + fs::write(&path, contents).expect("write test log"); + + { + let authorized = AuthorizedFile::open_local_selection(&path, Duration::from_secs(5)) + .expect("authorize test log"); + let result = read_authorized_tail( + &authorized, + TailOptions { + maximum_bytes: 64, + maximum_lines: 2, + }, + &Redactor::new([&canary]), + ) + .expect("read tail"); + + assert!(!result.text.contains(&canary)); + assert!(result.text.contains("last line")); + assert!(result.truncated_lines || result.truncated_at_start); + } + + fs::remove_file(path).expect("remove test log"); + } + + #[test] + fn rejects_binary_files() { + let path = std::env::temp_dir().join(format!("astrbot-tail-{}.bin", uuid::Uuid::new_v4())); + fs::write(&path, [1_u8, 0, 2, 0]).expect("write binary fixture"); + { + let authorized = AuthorizedFile::open_local_selection(&path, Duration::from_secs(5)) + .expect("authorize binary fixture"); + let result = + read_authorized_tail(&authorized, TailOptions::default(), &Redactor::default()); + assert!(matches!(result, Err(TailError::BinaryFile))); + } + fs::remove_file(path).expect("remove binary fixture"); + } +} diff --git a/src-tauri/src/diagnostics/mod.rs b/src-tauri/src/diagnostics/mod.rs new file mode 100644 index 0000000..89411d5 --- /dev/null +++ b/src-tauri/src/diagnostics/mod.rs @@ -0,0 +1,5 @@ +pub mod authorization; +pub mod config; +pub mod log_tail; +pub mod network; +pub mod redaction; diff --git a/src-tauri/src/diagnostics/network.rs b/src-tauri/src/diagnostics/network.rs new file mode 100644 index 0000000..4e05932 --- /dev/null +++ b/src-tauri/src/diagnostics/network.rs @@ -0,0 +1,159 @@ +use std::{fmt, net::SocketAddr, time::Duration}; + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct NetworkTarget { + pub host: String, + pub port: u16, + pub timeout: Duration, +} + +impl NetworkTarget { + pub fn validate(&self) -> Result<(), NetworkCheckError> { + let host = self.host.trim(); + if host.is_empty() || host.len() > 253 { + return Err(NetworkCheckError::InvalidTarget); + } + if self.port == 0 + || host + .chars() + .any(|character| character.is_whitespace() || "/\\@,*?".contains(character)) + || host.contains("://") + { + return Err(NetworkCheckError::InvalidTarget); + } + if self.timeout.is_zero() || self.timeout > Duration::from_secs(10) { + return Err(NetworkCheckError::InvalidTimeout); + } + Ok(()) + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct NetworkAttempt { + pub address: SocketAddr, + pub connected: bool, + pub error_kind: Option, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct NetworkCheckResult { + pub resolved_addresses: usize, + pub connected_address: Option, + pub attempts: Vec, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum NetworkCheckError { + InvalidTarget, + InvalidTimeout, + ResolutionTimedOut, + ResolutionFailed(String), + NoAddresses, +} + +impl fmt::Display for NetworkCheckError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::InvalidTarget => formatter.write_str("the network target is invalid"), + Self::InvalidTimeout => formatter.write_str("the network timeout is invalid"), + Self::ResolutionTimedOut => formatter.write_str("network name resolution timed out"), + Self::ResolutionFailed(kind) => { + write!(formatter, "network name resolution failed: {kind}") + } + Self::NoAddresses => formatter.write_str("the network target resolved to no addresses"), + } + } +} + +impl std::error::Error for NetworkCheckError {} + +pub async fn check_tcp_target( + target: &NetworkTarget, +) -> Result { + target.validate()?; + + let resolution = tokio::time::timeout( + target.timeout, + tokio::net::lookup_host((target.host.as_str(), target.port)), + ) + .await + .map_err(|_| NetworkCheckError::ResolutionTimedOut)? + .map_err(|error| NetworkCheckError::ResolutionFailed(error.kind().to_string()))?; + + let addresses = resolution.take(3).collect::>(); + if addresses.is_empty() { + return Err(NetworkCheckError::NoAddresses); + } + + let mut attempts = Vec::with_capacity(addresses.len()); + let mut connected_address = None; + for address in addresses.iter().copied() { + match tokio::time::timeout(target.timeout, tokio::net::TcpStream::connect(address)).await { + Ok(Ok(stream)) => { + drop(stream); + connected_address = Some(address); + attempts.push(NetworkAttempt { + address, + connected: true, + error_kind: None, + }); + break; + } + Ok(Err(error)) => attempts.push(NetworkAttempt { + address, + connected: false, + error_kind: Some(error.kind().to_string()), + }), + Err(_) => attempts.push(NetworkAttempt { + address, + connected: false, + error_kind: Some("timed-out".to_owned()), + }), + } + } + + Ok(NetworkCheckResult { + resolved_addresses: addresses.len(), + connected_address, + attempts, + }) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[tokio::test] + async fn connects_only_to_the_requested_loopback_port() { + let listener = tokio::net::TcpListener::bind(("127.0.0.1", 0)) + .await + .expect("bind loopback listener"); + let port = listener.local_addr().expect("listener address").port(); + let target = NetworkTarget { + host: "127.0.0.1".to_owned(), + port, + timeout: Duration::from_secs(1), + }; + + let result = check_tcp_target(&target).await.expect("check succeeds"); + assert!(result.connected_address.is_some()); + assert_eq!(result.attempts.len(), 1); + } + + #[test] + fn rejects_scanning_and_url_shaped_targets() { + for host in [ + "https://example.test", + "10.0.0.*", + "host,other", + "user@host", + ] { + let target = NetworkTarget { + host: host.to_owned(), + port: 443, + timeout: Duration::from_secs(1), + }; + assert_eq!(target.validate(), Err(NetworkCheckError::InvalidTarget)); + } + } +} diff --git a/src-tauri/src/diagnostics/redaction.rs b/src-tauri/src/diagnostics/redaction.rs new file mode 100644 index 0000000..60dbceb --- /dev/null +++ b/src-tauri/src/diagnostics/redaction.rs @@ -0,0 +1,150 @@ +use std::sync::OnceLock; + +use regex::{Captures, Regex}; + +pub const REDACTED: &str = "[REDACTED]"; + +#[derive(Clone, Debug, Default)] +pub struct Redactor { + known_secrets: Vec, +} + +impl Redactor { + pub fn new(known_secrets: I) -> Self + where + I: IntoIterator, + S: AsRef, + { + let mut secrets = known_secrets + .into_iter() + .map(|value| value.as_ref().to_owned()) + .filter(|value| value.chars().count() >= 4) + .collect::>(); + secrets.sort_by_key(|value| std::cmp::Reverse(value.len())); + secrets.dedup(); + Self { + known_secrets: secrets, + } + } + + pub fn redact(&self, input: &str) -> String { + let mut output = input.to_owned(); + for secret in &self.known_secrets { + output = output.replace(secret, REDACTED); + } + + output = pem_private_key_regex() + .replace_all(&output, REDACTED) + .into_owned(); + output = url_credentials_regex() + .replace_all(&output, "${scheme}[REDACTED]@") + .into_owned(); + output = bearer_regex() + .replace_all(&output, "${prefix}[REDACTED]") + .into_owned(); + key_value_regex() + .replace_all(&output, |captures: &Captures<'_>| { + format!("{}{}", &captures["prefix"], REDACTED) + }) + .into_owned() + } + + pub fn redact_value_for_key(&self, key: &str, value: &str) -> String { + if is_sensitive_key(key) { + REDACTED.to_owned() + } else { + self.redact(value) + } + } +} + +pub fn is_sensitive_key(key: &str) -> bool { + let normalized = key + .chars() + .filter(|character| character.is_ascii_alphanumeric()) + .flat_map(char::to_lowercase) + .collect::(); + + const SENSITIVE_SUFFIXES: &[&str] = &[ + "token", + "accesstoken", + "refreshtoken", + "apikey", + "secret", + "clientsecret", + "password", + "passwd", + "privatekey", + "cookie", + "authorization", + ]; + + SENSITIVE_SUFFIXES + .iter() + .any(|suffix| normalized == *suffix || normalized.ends_with(suffix)) +} + +fn key_value_regex() -> &'static Regex { + static INSTANCE: OnceLock = OnceLock::new(); + INSTANCE.get_or_init(|| { + Regex::new( + r#"(?im)(?P[\"']?(?:access[_-]?token|refresh[_-]?token|api[_-]?key|client[_-]?secret|private[_-]?key|password|passwd|secret|cookie|authorization)[\"']?\s*[:=]\s*)(?:\"[^\"\r\n]*\"|'[^'\r\n]*'|[^\s,;#\r\n]+)"#, + ) + .expect("the sensitive key regex is valid") + }) +} + +fn bearer_regex() -> &'static Regex { + static INSTANCE: OnceLock = OnceLock::new(); + INSTANCE.get_or_init(|| { + Regex::new(r"(?i)\b(?Pbearer\s+)[A-Za-z0-9._~+/=-]{8,}") + .expect("the bearer regex is valid") + }) +} + +fn url_credentials_regex() -> &'static Regex { + static INSTANCE: OnceLock = OnceLock::new(); + INSTANCE.get_or_init(|| { + Regex::new(r"(?i)\b(?P[a-z][a-z0-9+.-]*://)[^/@\s:]+:[^/@\s]+@") + .expect("the URL credential regex is valid") + }) +} + +fn pem_private_key_regex() -> &'static Regex { + static INSTANCE: OnceLock = OnceLock::new(); + INSTANCE.get_or_init(|| { + Regex::new( + r"(?is)-----BEGIN(?: [A-Z0-9]+)* PRIVATE KEY-----.*?-----END(?: [A-Z0-9]+)* PRIVATE KEY-----", + ) + .expect("the PEM private key regex is valid") + }) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn redacts_known_and_pattern_based_secrets() { + let canary = format!("canary-{}", uuid::Uuid::new_v4()); + let input = format!( + "token={canary}\nAuthorization: Bearer abcdefghijklmnop\nurl=https://alice:password@example.test/path\npassword = hunter2" + ); + let redacted = Redactor::new([&canary]).redact(&input); + + assert!(!redacted.contains(&canary)); + assert!(!redacted.contains("abcdefghijklmnop")); + assert!(!redacted.contains("alice:password")); + assert!(!redacted.contains("hunter2")); + assert!(redacted.contains(REDACTED)); + } + + #[test] + fn recognizes_normalized_sensitive_keys() { + assert!(is_sensitive_key("database_password")); + assert!(is_sensitive_key("api-key")); + assert!(is_sensitive_key("Refresh.Token")); + assert!(!is_sensitive_key("token_count")); + assert!(!is_sensitive_key("username")); + } +} diff --git a/src-tauri/src/file_transfer/executor.rs b/src-tauri/src/file_transfer/executor.rs new file mode 100644 index 0000000..4236ced --- /dev/null +++ b/src-tauri/src/file_transfer/executor.rs @@ -0,0 +1,385 @@ +use std::{ + fmt, + fs::{self, File, OpenOptions}, + io::{self, Read, Write}, + path::{Path, PathBuf}, +}; + +use sha2::{Digest, Sha256}; + +use super::{ + model::{ApprovedTransfer, ConflictPolicy, TransferReport, TransferState}, + path_policy::renamed_candidate, +}; + +const COPY_BUFFER_BYTES: usize = 1024 * 1024; + +pub trait TransferHook { + fn after_chunk(&self, _copied_bytes: u64) -> io::Result<()> { + Ok(()) + } + + fn after_copy(&self, _temporary_path: &Path) -> io::Result<()> { + Ok(()) + } +} + +#[derive(Clone, Copy, Debug, Default)] +pub struct NoopTransferHook; + +impl TransferHook for NoopTransferHook {} + +#[derive(Debug)] +pub enum TransferError { + NotApproved, + Conflict, + SourceChanged, + CopyPaused(io::ErrorKind), + VerificationFailed, + CommitFailed(io::ErrorKind), + Io(io::ErrorKind), +} + +impl fmt::Display for TransferError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::NotApproved => formatter.write_str("the transfer has not been approved locally"), + Self::Conflict => formatter.write_str("the destination already exists"), + Self::SourceChanged => formatter.write_str("the source changed after planning"), + Self::CopyPaused(kind) => write!(formatter, "the transfer paused during copy: {kind}"), + Self::VerificationFailed => formatter.write_str("the copied file failed verification"), + Self::CommitFailed(kind) => { + write!( + formatter, + "the verified file could not be committed: {kind}" + ) + } + Self::Io(kind) => write!(formatter, "the file transaction failed: {kind}"), + } + } +} + +impl std::error::Error for TransferError {} + +pub fn execute_approved_transfer( + transfer: &mut ApprovedTransfer, + hook: &dyn TransferHook, +) -> Result { + if !matches!( + transfer.inner.state, + TransferState::Approved | TransferState::Paused + ) { + return Err(TransferError::NotApproved); + } + + cleanup_owned_temporary_file(transfer)?; + let (destination_relative, final_path) = resolve_conflict(transfer)?; + if final_path.is_none() { + transfer.inner.state = TransferState::Completed; + return Ok(TransferReport { + plan_id: transfer.inner.id, + source_display_name: transfer.inner.source.display_name().to_owned(), + destination_relative, + copied_bytes: 0, + sha256: None, + skipped: true, + source_preserved: true, + }); + } + let final_path = final_path.expect("the non-skipped destination is present"); + let parent = final_path + .parent() + .ok_or(TransferError::Io(io::ErrorKind::InvalidInput))?; + let temporary_path = parent.join(format!( + ".astrbot-{}-{}.part", + transfer.inner.id, + uuid::Uuid::new_v4() + )); + transfer.inner.temp_path = Some(temporary_path.clone()); + transfer.inner.state = TransferState::Copying; + + let mut source = transfer + .inner + .source + .open_verified() + .map_err(|_| TransferError::SourceChanged)?; + let mut destination = OpenOptions::new() + .write(true) + .create_new(true) + .open(&temporary_path) + .map_err(|error| TransferError::Io(error.kind()))?; + + let mut source_hasher = Sha256::new(); + let mut buffer = vec![0_u8; COPY_BUFFER_BYTES]; + let mut copied_bytes = 0_u64; + loop { + let read = source + .read(&mut buffer) + .map_err(|error| pause(transfer, error.kind()))?; + if read == 0 { + break; + } + destination + .write_all(&buffer[..read]) + .map_err(|error| pause(transfer, error.kind()))?; + source_hasher.update(&buffer[..read]); + copied_bytes += read as u64; + hook.after_chunk(copied_bytes) + .map_err(|error| pause(transfer, error.kind()))?; + } + destination + .sync_all() + .map_err(|error| pause(transfer, error.kind()))?; + drop(destination); + + if transfer.inner.source.verify_unchanged().is_err() { + transfer.inner.state = TransferState::Failed; + remove_owned_temp(&temporary_path); + transfer.inner.temp_path = None; + return Err(TransferError::SourceChanged); + } + + hook.after_copy(&temporary_path) + .map_err(|error| pause(transfer, error.kind()))?; + transfer.inner.state = TransferState::Verifying; + let source_hash = source_hasher.finalize().to_vec(); + let destination_metadata = + fs::metadata(&temporary_path).map_err(|error| TransferError::Io(error.kind()))?; + let destination_hash = hash_file(&temporary_path)?; + if destination_metadata.len() != transfer.inner.source.size() + || copied_bytes != transfer.inner.source.size() + || source_hash != destination_hash + { + transfer.inner.state = TransferState::VerifyFailed; + remove_owned_temp(&temporary_path); + transfer.inner.temp_path = None; + return Err(TransferError::VerificationFailed); + } + + transfer.inner.state = TransferState::Committing; + match crate::windows::file_ops::commit_no_replace(&temporary_path, &final_path) { + Ok(()) => {} + Err(error) if error.kind() == io::ErrorKind::AlreadyExists => { + transfer.inner.state = TransferState::Conflict; + return Err(TransferError::Conflict); + } + Err(error) => { + transfer.inner.state = TransferState::Failed; + return Err(TransferError::CommitFailed(error.kind())); + } + } + + transfer.inner.temp_path = None; + transfer.inner.state = TransferState::Completed; + Ok(TransferReport { + plan_id: transfer.inner.id, + source_display_name: transfer.inner.source.display_name().to_owned(), + destination_relative, + copied_bytes, + sha256: Some(hex_lower(&destination_hash)), + skipped: false, + source_preserved: true, + }) +} + +fn resolve_conflict( + transfer: &mut ApprovedTransfer, +) -> Result<(PathBuf, Option), TransferError> { + let initial = transfer + .inner + .destination_root + .resolve_existing_parent(&transfer.inner.destination_relative) + .map_err(|error| TransferError::Io(error.kind()))?; + if !initial.exists() { + return Ok((transfer.inner.destination_relative.clone(), Some(initial))); + } + + match transfer.inner.conflict_policy { + ConflictPolicy::Ask => { + transfer.inner.state = TransferState::Conflict; + Err(TransferError::Conflict) + } + ConflictPolicy::Skip => Ok((transfer.inner.destination_relative.clone(), None)), + ConflictPolicy::Rename => { + for sequence in 1..=999 { + let relative = renamed_candidate(&transfer.inner.destination_relative, sequence) + .ok_or(TransferError::Io(io::ErrorKind::InvalidInput))?; + let candidate = transfer + .inner + .destination_root + .resolve_existing_parent(&relative) + .map_err(|error| TransferError::Io(error.kind()))?; + if !candidate.exists() { + return Ok((relative, Some(candidate))); + } + } + transfer.inner.state = TransferState::Conflict; + Err(TransferError::Conflict) + } + } +} + +fn cleanup_owned_temporary_file(transfer: &mut ApprovedTransfer) -> Result<(), TransferError> { + if let Some(path) = transfer.inner.temp_path.take() + && path.exists() + { + fs::remove_file(path).map_err(|error| TransferError::Io(error.kind()))?; + } + Ok(()) +} + +fn pause(transfer: &mut ApprovedTransfer, kind: io::ErrorKind) -> TransferError { + transfer.inner.state = TransferState::Paused; + TransferError::CopyPaused(kind) +} + +fn hash_file(path: &Path) -> Result, TransferError> { + let mut file = File::open(path).map_err(|error| TransferError::Io(error.kind()))?; + let mut hasher = Sha256::new(); + let mut buffer = vec![0_u8; COPY_BUFFER_BYTES]; + loop { + let read = file + .read(&mut buffer) + .map_err(|error| TransferError::Io(error.kind()))?; + if read == 0 { + break; + } + hasher.update(&buffer[..read]); + } + Ok(hasher.finalize().to_vec()) +} + +fn remove_owned_temp(path: &Path) { + let _ = fs::remove_file(path); +} + +fn hex_lower(bytes: &[u8]) -> String { + const HEX: &[u8; 16] = b"0123456789abcdef"; + let mut output = String::with_capacity(bytes.len() * 2); + for byte in bytes { + output.push(HEX[(byte >> 4) as usize] as char); + output.push(HEX[(byte & 0x0f) as usize] as char); + } + output +} + +#[cfg(test)] +mod tests { + use std::{ + fs, io, + path::{Path, PathBuf}, + sync::atomic::{AtomicBool, Ordering}, + }; + + use super::*; + use crate::file_transfer::model::{ConflictPolicy, PreparedTransfer}; + + struct FailOnceAfter { + threshold: u64, + failed: AtomicBool, + } + + impl TransferHook for FailOnceAfter { + fn after_chunk(&self, copied_bytes: u64) -> io::Result<()> { + if copied_bytes >= self.threshold && !self.failed.swap(true, Ordering::SeqCst) { + Err(io::Error::new( + io::ErrorKind::ConnectionAborted, + "injected network loss", + )) + } else { + Ok(()) + } + } + } + + struct CorruptAfterCopy; + + impl TransferHook for CorruptAfterCopy { + fn after_copy(&self, temporary_path: &Path) -> io::Result<()> { + fs::write(temporary_path, b"corrupted") + } + } + + fn fixture() -> (PathBuf, PathBuf, PathBuf) { + let root = std::env::temp_dir().join(format!("astrbot-transfer-{}", uuid::Uuid::new_v4())); + let source_dir = root.join("source"); + let destination = root.join("destination"); + fs::create_dir_all(&source_dir).expect("create source directory"); + fs::create_dir_all(&destination).expect("create destination directory"); + let source = source_dir.join("input.bin"); + fs::write(&source, vec![0x5a_u8; COPY_BUFFER_BYTES + 64]).expect("write source fixture"); + (root, source, destination) + } + + #[test] + fn copies_verifies_commits_and_preserves_source() { + let (root, source, destination) = fixture(); + let plan = + PreparedTransfer::plan(&source, &destination, "archive.bin", ConflictPolicy::Ask) + .expect("plan transfer"); + assert!(!destination.join("archive.bin").exists()); + assert!(!plan.dry_run().writes_performed); + let mut approved = plan.approve_local_user(); + + let report = + execute_approved_transfer(&mut approved, &NoopTransferHook).expect("execute transfer"); + assert!(source.exists()); + assert!(destination.join("archive.bin").exists()); + assert!(report.source_preserved); + assert_eq!(report.sha256.as_deref().map(str::len), Some(64)); + fs::remove_dir_all(root).expect("remove transfer fixture"); + } + + #[test] + fn resumes_from_zero_after_injected_network_loss() { + let (root, source, destination) = fixture(); + let plan = + PreparedTransfer::plan(&source, &destination, "archive.bin", ConflictPolicy::Ask) + .expect("plan transfer"); + let mut approved = plan.approve_local_user(); + let hook = FailOnceAfter { + threshold: 32, + failed: AtomicBool::new(false), + }; + + assert!(matches!( + execute_approved_transfer(&mut approved, &hook), + Err(TransferError::CopyPaused(io::ErrorKind::ConnectionAborted)) + )); + assert!(source.exists()); + assert!(!destination.join("archive.bin").exists()); + execute_approved_transfer(&mut approved, &NoopTransferHook).expect("resume transfer"); + assert!(destination.join("archive.bin").exists()); + fs::remove_dir_all(root).expect("remove transfer fixture"); + } + + #[test] + fn refuses_corrupt_copy_and_existing_destination() { + let (root, source, destination) = fixture(); + let plan = + PreparedTransfer::plan(&source, &destination, "archive.bin", ConflictPolicy::Ask) + .expect("plan transfer"); + let mut approved = plan.approve_local_user(); + assert!(matches!( + execute_approved_transfer(&mut approved, &CorruptAfterCopy), + Err(TransferError::VerificationFailed) + )); + assert!(source.exists()); + assert!(!destination.join("archive.bin").exists()); + + fs::write(destination.join("archive.bin"), b"sentinel").expect("write conflict sentinel"); + let plan = + PreparedTransfer::plan(&source, &destination, "archive.bin", ConflictPolicy::Ask) + .expect("plan conflicting transfer"); + let mut approved = plan.approve_local_user(); + assert!(matches!( + execute_approved_transfer(&mut approved, &NoopTransferHook), + Err(TransferError::Conflict) + )); + assert_eq!( + fs::read(destination.join("archive.bin")).expect("read sentinel"), + b"sentinel" + ); + fs::remove_dir_all(root).expect("remove transfer fixture"); + } +} diff --git a/src-tauri/src/file_transfer/mod.rs b/src-tauri/src/file_transfer/mod.rs new file mode 100644 index 0000000..84b0a2f --- /dev/null +++ b/src-tauri/src/file_transfer/mod.rs @@ -0,0 +1,9 @@ +pub mod executor; +pub mod model; +pub mod path_policy; + +pub use executor::{NoopTransferHook, TransferError, TransferHook, execute_approved_transfer}; +pub use model::{ + ApprovedTransfer, ConflictPolicy, DryRunSummary, PreparedTransfer, TransferReport, + TransferState, +}; diff --git a/src-tauri/src/file_transfer/model.rs b/src-tauri/src/file_transfer/model.rs new file mode 100644 index 0000000..43bc598 --- /dev/null +++ b/src-tauri/src/file_transfer/model.rs @@ -0,0 +1,282 @@ +use std::{ + fmt, + fs::{self, File, OpenOptions}, + io, + path::{Path, PathBuf}, + time::SystemTime, +}; + +use uuid::Uuid; + +use super::path_policy::{PathPolicyError, validate_relative_destination}; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ConflictPolicy { + Ask, + Rename, + Skip, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum TransferState { + Planned, + Approved, + Copying, + Verifying, + Committing, + Paused, + Conflict, + VerifyFailed, + Failed, + Completed, +} + +pub struct AuthorizedSource { + canonical_path: PathBuf, + display_name: String, + size: u64, + modified_at: Option, +} + +impl AuthorizedSource { + pub fn open_local_selection(path: &Path) -> io::Result { + let canonical_path = fs::canonicalize(path)?; + let metadata = fs::metadata(&canonical_path)?; + if !metadata.is_file() { + return Err(io::Error::new( + io::ErrorKind::InvalidInput, + "the selected source is not a regular file", + )); + } + let display_name = canonical_path + .file_name() + .and_then(|value| value.to_str()) + .unwrap_or("selected-file") + .to_owned(); + Ok(Self { + canonical_path, + display_name, + size: metadata.len(), + modified_at: metadata.modified().ok(), + }) + } + + pub fn display_name(&self) -> &str { + &self.display_name + } + + pub fn size(&self) -> u64 { + self.size + } + + pub(crate) fn open_verified(&self) -> io::Result { + if fs::canonicalize(&self.canonical_path)? != self.canonical_path { + return Err(io::Error::new( + io::ErrorKind::PermissionDenied, + "the selected source identity changed", + )); + } + let file = OpenOptions::new().read(true).open(&self.canonical_path)?; + self.verify_metadata(&file.metadata()?)?; + Ok(file) + } + + pub(crate) fn verify_unchanged(&self) -> io::Result<()> { + self.verify_metadata(&fs::metadata(&self.canonical_path)?) + } + + fn verify_metadata(&self, metadata: &fs::Metadata) -> io::Result<()> { + if !metadata.is_file() + || metadata.len() != self.size + || self + .modified_at + .is_some_and(|expected| metadata.modified().ok() != Some(expected)) + { + return Err(io::Error::new( + io::ErrorKind::InvalidData, + "the selected source changed after planning", + )); + } + Ok(()) + } +} + +impl fmt::Debug for AuthorizedSource { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter + .debug_struct("AuthorizedSource") + .field("display_name", &self.display_name) + .field("size", &self.size) + .finish_non_exhaustive() + } +} + +pub struct DestinationRoot { + canonical_path: PathBuf, +} + +impl DestinationRoot { + pub fn open_configured(path: &Path) -> io::Result { + let canonical_path = fs::canonicalize(path)?; + if !fs::metadata(&canonical_path)?.is_dir() { + return Err(io::Error::new( + io::ErrorKind::InvalidInput, + "the configured destination root is not a directory", + )); + } + Ok(Self { canonical_path }) + } + + pub(crate) fn resolve_existing_parent(&self, relative: &Path) -> io::Result { + let parent_relative = relative.parent().unwrap_or_else(|| Path::new("")); + let parent = fs::canonicalize(self.canonical_path.join(parent_relative))?; + if !path_is_within(&self.canonical_path, &parent) { + return Err(io::Error::new( + io::ErrorKind::PermissionDenied, + "the destination parent escapes the configured root", + )); + } + Ok(parent.join(relative.file_name().ok_or_else(|| { + io::Error::new( + io::ErrorKind::InvalidInput, + "the destination has no file name", + ) + })?)) + } +} + +impl fmt::Debug for DestinationRoot { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter + .debug_struct("DestinationRoot") + .finish_non_exhaustive() + } +} + +fn path_is_within(root: &Path, candidate: &Path) -> bool { + #[cfg(windows)] + { + let root = root.to_string_lossy().to_ascii_lowercase(); + let candidate = candidate.to_string_lossy().to_ascii_lowercase(); + candidate == root + || candidate + .strip_prefix(&root) + .is_some_and(|suffix| suffix.starts_with(['\\', '/'])) + } + #[cfg(not(windows))] + { + candidate == root || candidate.starts_with(root) + } +} + +pub struct PreparedTransfer { + pub(crate) id: Uuid, + pub(crate) source: AuthorizedSource, + pub(crate) destination_root: DestinationRoot, + pub(crate) destination_relative: PathBuf, + pub(crate) conflict_policy: ConflictPolicy, + pub(crate) state: TransferState, + pub(crate) temp_path: Option, +} + +impl PreparedTransfer { + pub fn plan( + source_path: &Path, + configured_destination_root: &Path, + destination_relative: &str, + conflict_policy: ConflictPolicy, + ) -> Result { + let source = AuthorizedSource::open_local_selection(source_path).map_err(PlanError::Io)?; + let destination_root = + DestinationRoot::open_configured(configured_destination_root).map_err(PlanError::Io)?; + let destination_relative = + validate_relative_destination(destination_relative).map_err(PlanError::PathPolicy)?; + destination_root + .resolve_existing_parent(&destination_relative) + .map_err(PlanError::Io)?; + + Ok(Self { + id: Uuid::new_v4(), + source, + destination_root, + destination_relative, + conflict_policy, + state: TransferState::Planned, + temp_path: None, + }) + } + + pub fn dry_run(&self) -> DryRunSummary { + DryRunSummary { + plan_id: self.id, + source_display_name: self.source.display_name().to_owned(), + destination_relative: self.destination_relative.clone(), + size: self.source.size(), + conflict_policy: self.conflict_policy, + writes_performed: false, + } + } + + pub fn approve_local_user(self) -> ApprovedTransfer { + ApprovedTransfer { + inner: PreparedTransfer { + state: TransferState::Approved, + ..self + }, + } + } +} + +#[derive(Debug)] +pub enum PlanError { + PathPolicy(PathPolicyError), + Io(io::Error), +} + +impl fmt::Display for PlanError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::PathPolicy(error) => { + write!(formatter, "destination policy rejected the plan: {error}") + } + Self::Io(error) => write!(formatter, "file-transfer planning failed: {}", error.kind()), + } + } +} + +impl std::error::Error for PlanError {} + +pub struct ApprovedTransfer { + pub(crate) inner: PreparedTransfer, +} + +impl ApprovedTransfer { + pub fn id(&self) -> Uuid { + self.inner.id + } + + pub fn state(&self) -> TransferState { + self.inner.state + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct DryRunSummary { + pub plan_id: Uuid, + pub source_display_name: String, + pub destination_relative: PathBuf, + pub size: u64, + pub conflict_policy: ConflictPolicy, + pub writes_performed: bool, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct TransferReport { + pub plan_id: Uuid, + pub source_display_name: String, + pub destination_relative: PathBuf, + pub copied_bytes: u64, + pub sha256: Option, + pub skipped: bool, + pub source_preserved: bool, +} diff --git a/src-tauri/src/file_transfer/path_policy.rs b/src-tauri/src/file_transfer/path_policy.rs new file mode 100644 index 0000000..e7e54b0 --- /dev/null +++ b/src-tauri/src/file_transfer/path_policy.rs @@ -0,0 +1,148 @@ +use std::{fmt, path::PathBuf}; + +pub const MAX_RELATIVE_PATH_CHARACTERS: usize = 240; +pub const MAX_COMPONENT_CHARACTERS: usize = 120; + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum PathPolicyError { + Empty, + AbsoluteOrDevicePath, + Traversal, + EmptyComponent, + InvalidCharacter, + ReservedName, + TrailingDotOrSpace, + TooLong, +} + +impl fmt::Display for PathPolicyError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + let message = match self { + Self::Empty => "the destination path is empty", + Self::AbsoluteOrDevicePath => "absolute, UNC, and device paths are not allowed", + Self::Traversal => "parent and current-directory path components are not allowed", + Self::EmptyComponent => "empty destination path components are not allowed", + Self::InvalidCharacter => "the destination contains a Windows-invalid character", + Self::ReservedName => "the destination contains a Windows-reserved name", + Self::TrailingDotOrSpace => "destination components cannot end with a dot or space", + Self::TooLong => "the destination path exceeds the configured limit", + }; + formatter.write_str(message) + } +} + +impl std::error::Error for PathPolicyError {} + +pub fn validate_relative_destination(input: &str) -> Result { + if input.is_empty() { + return Err(PathPolicyError::Empty); + } + if input.chars().count() > MAX_RELATIVE_PATH_CHARACTERS { + return Err(PathPolicyError::TooLong); + } + + let lowercase = input.to_ascii_lowercase(); + let drive_prefixed = input + .as_bytes() + .get(1) + .is_some_and(|character| *character == b':'); + if input.starts_with(['\\', '/']) + || drive_prefixed + || lowercase.starts_with(r"\\?\") + || lowercase.starts_with(r"\\.\") + || lowercase.contains("globalroot") + { + return Err(PathPolicyError::AbsoluteOrDevicePath); + } + + let mut safe = PathBuf::new(); + for component in input.split(['\\', '/']) { + if component.is_empty() { + return Err(PathPolicyError::EmptyComponent); + } + if matches!(component, "." | "..") { + return Err(PathPolicyError::Traversal); + } + if component.chars().count() > MAX_COMPONENT_CHARACTERS { + return Err(PathPolicyError::TooLong); + } + if component.ends_with(['.', ' ']) { + return Err(PathPolicyError::TrailingDotOrSpace); + } + if component + .chars() + .any(|character| character.is_control() || r#"<>:"|?*"#.contains(character)) + { + return Err(PathPolicyError::InvalidCharacter); + } + if is_reserved_windows_name(component) { + return Err(PathPolicyError::ReservedName); + } + safe.push(component); + } + + Ok(safe) +} + +pub fn renamed_candidate(relative: &std::path::Path, sequence: u16) -> Option { + let parent = relative + .parent() + .unwrap_or_else(|| std::path::Path::new("")); + let stem = relative.file_stem()?.to_str()?; + let extension = relative.extension().and_then(|value| value.to_str()); + let name = match extension { + Some(extension) => format!("{stem} ({sequence}).{extension}"), + None => format!("{stem} ({sequence})"), + }; + let mut candidate = parent.to_path_buf(); + candidate.push(name); + Some(candidate) +} + +fn is_reserved_windows_name(component: &str) -> bool { + let base = component + .split_once('.') + .map(|(base, _)| base) + .unwrap_or(component) + .trim_end_matches(['.', ' ']) + .to_ascii_uppercase(); + + matches!(base.as_str(), "CON" | "PRN" | "AUX" | "NUL") + || (base.len() == 4 + && (base.starts_with("COM") || base.starts_with("LPT")) + && matches!(base.as_bytes()[3], b'1'..=b'9')) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn accepts_only_bounded_relative_windows_paths() { + assert_eq!( + validate_relative_destination(r"logs\2026\report.txt").expect("valid path"), + PathBuf::from("logs").join("2026").join("report.txt") + ); + + for invalid in [ + r"C:\secret.txt", + r"\\server\share\file.txt", + r"..\secret.txt", + r"safe\..\secret.txt", + r"safe\NUL.txt", + r"safe\file.txt:stream", + r"safe\trailing. ", + r"\\?\GLOBALROOT\Device\HarddiskVolume1\x", + ] { + assert!(validate_relative_destination(invalid).is_err(), "{invalid}"); + } + } + + #[test] + fn creates_bounded_rename_candidates() { + assert_eq!( + renamed_candidate(std::path::Path::new(r"folder\report.txt"), 2), + Some(PathBuf::from("folder").join("report (2).txt")) + ); + } +} diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs new file mode 100644 index 0000000..216b0c2 --- /dev/null +++ b/src-tauri/src/lib.rs @@ -0,0 +1,81 @@ +pub mod database; +pub mod diagnostics; +pub mod file_transfer; +pub mod networking; +pub mod secure_store; +pub mod windows; + +use serde::Serialize; +use tauri::{ + Manager, WindowEvent, + menu::{Menu, MenuItem}, + tray::TrayIconBuilder, +}; + +#[derive(Debug, Clone, Serialize)] +#[serde(rename_all = "camelCase")] +struct BootstrapStatus { + app_version: &'static str, + platform: &'static str, + rust_core: &'static str, + protocol_version: &'static str, +} + +#[tauri::command] +fn bootstrap_status() -> BootstrapStatus { + BootstrapStatus { + app_version: env!("CARGO_PKG_VERSION"), + platform: "windows", + rust_core: "ready", + protocol_version: desktop_protocol::PROTOCOL_VERSION, + } +} + +pub fn run() { + tracing_subscriber::fmt() + .with_env_filter( + tracing_subscriber::EnvFilter::try_from_default_env() + .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")), + ) + .with_target(false) + .compact() + .init(); + + tauri::Builder::default() + .plugin(tauri_plugin_single_instance::init(|app, _, _| { + if let Some(window) = app.get_webview_window("main") { + let _ = window.show(); + let _ = window.set_focus(); + } + })) + .setup(|app| { + let show = MenuItem::with_id(app, "show", "Show AstrBot Desktop", true, None::<&str>)?; + let quit = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?; + let menu = Menu::with_items(app, &[&show, &quit])?; + + TrayIconBuilder::with_id("main") + .menu(&menu) + .on_menu_event(|app, event| match event.id.as_ref() { + "show" => { + if let Some(window) = app.get_webview_window("main") { + let _ = window.show(); + let _ = window.set_focus(); + } + } + "quit" => app.exit(0), + _ => {} + }) + .build(app)?; + + Ok(()) + }) + .on_window_event(|window, event| { + if let WindowEvent::CloseRequested { api, .. } = event { + api.prevent_close(); + let _ = window.hide(); + } + }) + .invoke_handler(tauri::generate_handler![bootstrap_status]) + .run(tauri::generate_context!()) + .expect("failed to run AstrBot Desktop"); +} diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs new file mode 100644 index 0000000..9a66adf --- /dev/null +++ b/src-tauri/src/main.rs @@ -0,0 +1,5 @@ +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +fn main() { + astrbot_desktop_lib::run(); +} diff --git a/src-tauri/src/networking/gateway_client.rs b/src-tauri/src/networking/gateway_client.rs new file mode 100644 index 0000000..1090320 --- /dev/null +++ b/src-tauri/src/networking/gateway_client.rs @@ -0,0 +1,301 @@ +use desktop_protocol::{ActiveSlotKind, ConnectionState, RawProtocolEnvelope}; +use secrecy::{ExposeSecret, SecretString}; +use std::{ + collections::{HashSet, VecDeque}, + sync::Arc, + time::Duration, +}; + +use eventsource_stream::Eventsource; +use futures_util::StreamExt; +use reqwest::header::{ACCEPT, HeaderValue}; +use serde::Serialize; +use serde_json::Value; +use thiserror::Error; +use tokio::sync::{Mutex, mpsc, watch}; +use tokio_util::sync::CancellationToken; + +use super::SlotKind; + +#[derive(Debug, Clone)] +pub struct GatewayClientConfig { + pub profile_id: String, + pub slot: SlotKind, + pub base_url: String, + pub expected_server_instance_id: String, + pub bearer_token: Option, +} + +#[derive(Debug, Clone, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct BoundGatewayEvent { + pub profile_id: String, + pub slot: SlotKind, + pub event_id: String, + pub event_type: String, + pub server_instance_id: String, + pub payload: Value, +} + +#[derive(Debug, Error)] +pub enum GatewayError { + #[error("gateway request failed")] + Request(#[from] reqwest::Error), + #[error("gateway returned HTTP {0}")] + HttpStatus(reqwest::StatusCode), + #[error("invalid SSE event")] + Event(#[from] eventsource_stream::EventStreamError), + #[error("invalid gateway event payload")] + Json(#[from] serde_json::Error), + #[error("gateway protocol validation failed")] + Protocol(#[from] desktop_protocol::ProtocolError), + #[error("server identity changed")] + ServerIdentityChanged, + #[error("gateway event channel closed")] + ChannelClosed, +} + +const MAX_DEDUPLICATED_EVENTS: usize = 4_096; + +#[derive(Default)] +struct EventDeduplicator { + ids: HashSet, + order: VecDeque, +} + +impl EventDeduplicator { + fn insert(&mut self, event_id: String) -> bool { + if !self.ids.insert(event_id.clone()) { + return false; + } + + self.order.push_back(event_id); + if self.order.len() > MAX_DEDUPLICATED_EVENTS + && let Some(expired) = self.order.pop_front() + { + self.ids.remove(&expired); + } + true + } +} + +pub struct GatewayClient { + config: GatewayClientConfig, + http: reqwest::Client, + seen_event_ids: Arc>, + last_event_id: Arc>>, + state_tx: watch::Sender, +} + +impl GatewayClient { + pub fn new(config: GatewayClientConfig) -> Result { + let (state_tx, _) = watch::channel(ConnectionState::Disconnected); + let http = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .connect_timeout(Duration::from_secs(5)) + .timeout(Duration::from_secs(30)) + .build()?; + + Ok(Self { + config, + http, + seen_event_ids: Arc::new(Mutex::new(EventDeduplicator::default())), + last_event_id: Arc::new(Mutex::new(None)), + state_tx, + }) + } + + pub fn state_receiver(&self) -> watch::Receiver { + self.state_tx.subscribe() + } + + fn set_state(&self, state: ConnectionState) { + self.state_tx.send_replace(state); + } + + pub async fn health(&self) -> Result { + let response = self + .http + .get(format!("{}/desktop/v1/health", self.config.base_url)) + .send() + .await?; + + if !response.status().is_success() { + return Err(GatewayError::HttpStatus(response.status())); + } + + Ok(response.json().await?) + } + + pub async fn stream_once( + &self, + last_event_id: Option<&str>, + sender: &mpsc::Sender, + cancellation: &CancellationToken, + ) -> Result<(), GatewayError> { + self.set_state(ConnectionState::Connecting); + let mut request = self + .http + .get(format!("{}/desktop/v1/events/stream", self.config.base_url)) + .header(ACCEPT, HeaderValue::from_static("text/event-stream")); + if let Some(token) = &self.config.bearer_token { + request = request.bearer_auth(token.expose_secret()); + } + + if let Some(event_id) = last_event_id { + request = request.header("Last-Event-ID", event_id); + } + + let response = request.send().await?; + if !response.status().is_success() { + return Err(GatewayError::HttpStatus(response.status())); + } + self.set_state(ConnectionState::Connected); + + let mut stream = response.bytes_stream().eventsource(); + + loop { + tokio::select! { + _ = cancellation.cancelled() => { + self.set_state(ConnectionState::Disconnected); + return Ok(()); + }, + next = stream.next() => { + let Some(next) = next else { + return Ok(()); + }; + let event = next?; + if event.data.is_empty() { + continue; + } + + let raw: RawProtocolEnvelope = serde_json::from_str(&event.data)?; + let payload = raw.payload.clone(); + let bound = desktop_protocol::BoundGatewayEvent::bind( + raw, + self.config.profile_id.clone(), + protocol_slot(self.config.slot), + &self.config.expected_server_instance_id, + )?; + let event_id = bound.event.metadata.event_id.clone(); + let event_type = bound.event.event_type().to_owned(); + let server_instance_id = bound.event.metadata.server_instance_id.clone(); + + let mut seen = self.seen_event_ids.lock().await; + if !seen.insert(event_id.clone()) { + continue; + } + drop(seen); + + sender + .send(BoundGatewayEvent { + profile_id: bound.profile_id, + slot: self.config.slot, + event_id: event_id.clone(), + event_type, + server_instance_id, + payload, + }) + .await + .map_err(|_| GatewayError::ChannelClosed)?; + *self.last_event_id.lock().await = Some(event_id); + } + } + } + } + + pub async fn run_reconnecting( + &self, + sender: &mpsc::Sender, + cancellation: &CancellationToken, + ) -> Result<(), GatewayError> { + let mut retry_delay = Duration::from_millis(100); + + loop { + if cancellation.is_cancelled() { + self.set_state(ConnectionState::Disconnected); + return Ok(()); + } + + let last_event_id = self.last_event_id.lock().await.clone(); + let result = self + .stream_once(last_event_id.as_deref(), sender, cancellation) + .await; + + if cancellation.is_cancelled() { + self.set_state(ConnectionState::Disconnected); + return Ok(()); + } + + match result { + Ok(()) => retry_delay = Duration::from_millis(100), + Err(error) => { + if let Some(state) = terminal_state(&error) { + self.set_state(state); + return Err(error); + } + tracing::warn!( + profile_id = %self.config.profile_id, + error = %error, + "gateway SSE connection will retry" + ); + } + } + + self.set_state(ConnectionState::Reconnecting); + tokio::select! { + _ = cancellation.cancelled() => { + self.set_state(ConnectionState::Disconnected); + return Ok(()); + } + _ = tokio::time::sleep(retry_delay) => {} + } + retry_delay = std::cmp::min(retry_delay.saturating_mul(2), Duration::from_secs(5)); + } + } +} + +fn protocol_slot(slot: SlotKind) -> ActiveSlotKind { + match slot { + SlotKind::Companion => ActiveSlotKind::Companion, + SlotKind::Operations => ActiveSlotKind::Operations, + } +} + +fn terminal_state(error: &GatewayError) -> Option { + match error { + GatewayError::HttpStatus(status) + if matches!( + *status, + reqwest::StatusCode::UNAUTHORIZED | reqwest::StatusCode::FORBIDDEN + ) => + { + Some(ConnectionState::AuthExpired) + } + GatewayError::Protocol(_) | GatewayError::ServerIdentityChanged => { + Some(ConnectionState::Incompatible) + } + GatewayError::ChannelClosed => Some(ConnectionState::FatalError), + _ => None, + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[tokio::test] + async fn duplicate_cache_is_scoped_to_one_client() { + let client = GatewayClient::new(GatewayClientConfig { + bearer_token: None, + profile_id: "profile-a".into(), + slot: SlotKind::Companion, + base_url: "http://127.0.0.1:1".into(), + expected_server_instance_id: "mock-a".into(), + }) + .expect("client"); + + assert!(client.seen_event_ids.lock().await.insert("same-id".into())); + assert!(!client.seen_event_ids.lock().await.insert("same-id".into())); + } +} diff --git a/src-tauri/src/networking/manager.rs b/src-tauri/src/networking/manager.rs new file mode 100644 index 0000000..e2e743e --- /dev/null +++ b/src-tauri/src/networking/manager.rs @@ -0,0 +1,64 @@ +use serde::{Deserialize, Serialize}; + +use super::{GatewayClient, GatewayClientConfig, GatewayError}; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub enum SlotKind { + Companion, + Operations, +} + +pub struct DualConnectionManager { + companion: GatewayClient, + operations: GatewayClient, +} + +impl DualConnectionManager { + pub fn new( + companion: GatewayClientConfig, + operations: GatewayClientConfig, + ) -> Result { + if companion.slot != SlotKind::Companion || operations.slot != SlotKind::Operations { + return Err(GatewayError::ServerIdentityChanged); + } + + Ok(Self { + companion: GatewayClient::new(companion)?, + operations: GatewayClient::new(operations)?, + }) + } + + pub fn companion(&self) -> &GatewayClient { + &self.companion + } + + pub fn operations(&self) -> &GatewayClient { + &self.operations + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn rejects_swapped_slot_configuration() { + let companion = GatewayClientConfig { + profile_id: "a".into(), + slot: SlotKind::Operations, + base_url: "http://127.0.0.1:1".into(), + bearer_token: None, + expected_server_instance_id: "a".into(), + }; + let operations = GatewayClientConfig { + profile_id: "b".into(), + slot: SlotKind::Companion, + base_url: "http://127.0.0.1:2".into(), + expected_server_instance_id: "b".into(), + bearer_token: None, + }; + + assert!(DualConnectionManager::new(companion, operations).is_err()); + } +} diff --git a/src-tauri/src/networking/mod.rs b/src-tauri/src/networking/mod.rs new file mode 100644 index 0000000..8413b85 --- /dev/null +++ b/src-tauri/src/networking/mod.rs @@ -0,0 +1,5 @@ +mod gateway_client; +mod manager; + +pub use gateway_client::{BoundGatewayEvent, GatewayClient, GatewayClientConfig, GatewayError}; +pub use manager::{DualConnectionManager, SlotKind}; diff --git a/src-tauri/src/secure_store/mod.rs b/src-tauri/src/secure_store/mod.rs new file mode 100644 index 0000000..2bdd09d --- /dev/null +++ b/src-tauri/src/secure_store/mod.rs @@ -0,0 +1,4 @@ +#[cfg(windows)] +pub use crate::windows::credential_manager::{ + CredentialReference, SecureCredentialStore, WindowsCredentialStore, +}; diff --git a/src-tauri/src/windows/capture.rs b/src-tauri/src/windows/capture.rs new file mode 100644 index 0000000..2f46052 --- /dev/null +++ b/src-tauri/src/windows/capture.rs @@ -0,0 +1,363 @@ +use std::fmt; + +#[cfg(windows)] +use std::mem::size_of; + +use super::foreground_window::{ForegroundWindowError, WindowSelection}; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct CaptureLimits { + pub maximum_width: u32, + pub maximum_height: u32, + pub maximum_pixels: u64, +} + +impl Default for CaptureLimits { + fn default() -> Self { + Self { + maximum_width: 8192, + maximum_height: 8192, + maximum_pixels: 16_000_000, + } + } +} + +impl CaptureLimits { + pub fn validate(self) -> Result { + if self.maximum_width == 0 + || self.maximum_width > 8192 + || self.maximum_height == 0 + || self.maximum_height > 8192 + || self.maximum_pixels == 0 + || self.maximum_pixels > 16_000_000 + { + return Err(WindowCaptureError::InvalidLimits); + } + Ok(self) + } + + #[cfg(any(windows, test))] + fn validate_dimensions(self, width: u32, height: u32) -> Result<(), WindowCaptureError> { + let pixels = u64::from(width) + .checked_mul(u64::from(height)) + .ok_or(WindowCaptureError::WindowTooLarge { width, height })?; + if width == 0 + || height == 0 + || width > self.maximum_width + || height > self.maximum_height + || pixels > self.maximum_pixels + { + return Err(WindowCaptureError::WindowTooLarge { width, height }); + } + Ok(()) + } +} + +pub struct WindowCapture { + pub width: u32, + pub height: u32, + pub png_bytes: Vec, +} + +impl fmt::Debug for WindowCapture { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter + .debug_struct("WindowCapture") + .field("width", &self.width) + .field("height", &self.height) + .field("png_bytes", &format_args!("{} bytes", self.png_bytes.len())) + .finish() + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum WindowCaptureError { + InvalidLimits, + WindowTooLarge { width: u32, height: u32 }, + Selection(ForegroundWindowError), + CaptureFailed, + EncodingFailed, + UnsupportedPlatform, + Platform(u32), +} + +impl fmt::Display for WindowCaptureError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::InvalidLimits => formatter.write_str("the window-capture limits are invalid"), + Self::WindowTooLarge { width, height } => { + write!( + formatter, + "the selected window is too large to capture ({width}x{height})" + ) + } + Self::Selection(error) => write!(formatter, "the selected window is invalid: {error}"), + Self::CaptureFailed => { + formatter.write_str("PrintWindow could not capture the selected window") + } + Self::EncodingFailed => formatter.write_str("the captured bitmap could not be encoded"), + Self::UnsupportedPlatform => { + formatter.write_str("window capture is unavailable on this platform") + } + Self::Platform(code) => { + write!(formatter, "window capture failed with Win32 error {code}") + } + } + } +} + +impl std::error::Error for WindowCaptureError {} + +/// Captures the exact window authorized by a short-lived WindowSelection. +/// +/// No arbitrary HWND is accepted, no image is written to disk, and dimensions +/// are checked before allocating the BGRA and PNG buffers. +pub fn capture_selected_window( + selection: &WindowSelection, + limits: CaptureLimits, +) -> Result { + let limits = limits.validate()?; + selection + .validate() + .map_err(WindowCaptureError::Selection)?; + capture_selected_window_native(selection, limits) +} + +#[cfg(windows)] +fn capture_selected_window_native( + selection: &WindowSelection, + limits: CaptureLimits, +) -> Result { + use windows::Win32::{ + Foundation::{HWND, RECT}, + Graphics::Gdi::{ + BI_RGB, BITMAPINFO, BITMAPINFOHEADER, CreateCompatibleBitmap, CreateCompatibleDC, + DIB_RGB_COLORS, GetDC, GetDIBits, HGDIOBJ, SelectObject, + }, + Storage::Xps::{PRINT_WINDOW_FLAGS, PrintWindow}, + UI::WindowsAndMessaging::GetWindowRect, + }; + + let window = HWND(selection.raw_handle() as *mut core::ffi::c_void); + let mut rectangle = RECT::default(); + unsafe { GetWindowRect(window, &mut rectangle) }.map_err(map_windows_error)?; + let width_i32 = rectangle + .right + .checked_sub(rectangle.left) + .ok_or(WindowCaptureError::CaptureFailed)?; + let height_i32 = rectangle + .bottom + .checked_sub(rectangle.top) + .ok_or(WindowCaptureError::CaptureFailed)?; + let width = u32::try_from(width_i32).map_err(|_| WindowCaptureError::CaptureFailed)?; + let height = u32::try_from(height_i32).map_err(|_| WindowCaptureError::CaptureFailed)?; + limits.validate_dimensions(width, height)?; + + let screen_dc = unsafe { GetDC(None) }; + if screen_dc.0.is_null() { + return Err(last_windows_error()); + } + let screen_dc = ScreenDc(screen_dc); + let memory_dc = unsafe { CreateCompatibleDC(Some(screen_dc.0)) }; + if memory_dc.0.is_null() { + return Err(last_windows_error()); + } + let memory_dc = MemoryDc(memory_dc); + let bitmap = unsafe { CreateCompatibleBitmap(screen_dc.0, width_i32, height_i32) }; + if bitmap.0.is_null() { + return Err(last_windows_error()); + } + let bitmap = Bitmap(bitmap); + + { + let previous = unsafe { SelectObject(memory_dc.0, HGDIOBJ(bitmap.0.0)) }; + if previous.0.is_null() { + return Err(last_windows_error()); + } + let _selection_guard = SelectedGdiObject { + dc: memory_dc.0, + previous, + }; + + const PW_RENDERFULLCONTENT: PRINT_WINDOW_FLAGS = PRINT_WINDOW_FLAGS(2); + let captured = unsafe { PrintWindow(window, memory_dc.0, PW_RENDERFULLCONTENT) }.as_bool() + || unsafe { PrintWindow(window, memory_dc.0, PRINT_WINDOW_FLAGS(0)) }.as_bool(); + if !captured { + return Err(WindowCaptureError::CaptureFailed); + } + } + + let byte_len = usize::try_from(u64::from(width) * u64::from(height) * 4) + .map_err(|_| WindowCaptureError::WindowTooLarge { width, height })?; + let mut bgra = vec![0_u8; byte_len]; + let mut bitmap_info = BITMAPINFO { + bmiHeader: BITMAPINFOHEADER { + biSize: size_of::() as u32, + biWidth: width_i32, + // Negative height asks GetDIBits for top-down rows. + biHeight: -height_i32, + biPlanes: 1, + biBitCount: 32, + biCompression: BI_RGB.0, + biSizeImage: byte_len as u32, + ..BITMAPINFOHEADER::default() + }, + ..BITMAPINFO::default() + }; + let copied_rows = unsafe { + GetDIBits( + screen_dc.0, + bitmap.0, + 0, + height, + Some(bgra.as_mut_ptr().cast()), + &mut bitmap_info, + DIB_RGB_COLORS, + ) + }; + if copied_rows != height_i32 { + return Err(last_windows_error()); + } + + for pixel in bgra.chunks_exact_mut(4) { + pixel.swap(0, 2); + // BI_RGB device-dependent bitmaps commonly leave alpha at zero. + pixel[3] = 255; + } + let png_bytes = encode_rgba_png(width, height, &bgra)?; + Ok(WindowCapture { + width, + height, + png_bytes, + }) +} + +#[cfg(not(windows))] +fn capture_selected_window_native( + _selection: &WindowSelection, + _limits: CaptureLimits, +) -> Result { + Err(WindowCaptureError::UnsupportedPlatform) +} + +#[cfg(any(windows, test))] +fn encode_rgba_png(width: u32, height: u32, pixels: &[u8]) -> Result, WindowCaptureError> { + let expected = usize::try_from(u64::from(width) * u64::from(height) * 4) + .map_err(|_| WindowCaptureError::EncodingFailed)?; + if pixels.len() != expected { + return Err(WindowCaptureError::EncodingFailed); + } + + let mut encoded = Vec::new(); + { + let mut encoder = png::Encoder::new(&mut encoded, width, height); + encoder.set_color(png::ColorType::Rgba); + encoder.set_depth(png::BitDepth::Eight); + let mut writer = encoder + .write_header() + .map_err(|_| WindowCaptureError::EncodingFailed)?; + writer + .write_image_data(pixels) + .map_err(|_| WindowCaptureError::EncodingFailed)?; + } + Ok(encoded) +} + +#[cfg(windows)] +struct ScreenDc(windows::Win32::Graphics::Gdi::HDC); + +#[cfg(windows)] +impl Drop for ScreenDc { + fn drop(&mut self) { + unsafe { + windows::Win32::Graphics::Gdi::ReleaseDC(None, self.0); + } + } +} + +#[cfg(windows)] +struct MemoryDc(windows::Win32::Graphics::Gdi::HDC); + +#[cfg(windows)] +impl Drop for MemoryDc { + fn drop(&mut self) { + unsafe { + let _ = windows::Win32::Graphics::Gdi::DeleteDC(self.0); + } + } +} + +#[cfg(windows)] +struct Bitmap(windows::Win32::Graphics::Gdi::HBITMAP); + +#[cfg(windows)] +impl Drop for Bitmap { + fn drop(&mut self) { + use windows::Win32::Graphics::Gdi::{DeleteObject, HGDIOBJ}; + + unsafe { + let _ = DeleteObject(HGDIOBJ(self.0.0)); + } + } +} + +#[cfg(windows)] +struct SelectedGdiObject { + dc: windows::Win32::Graphics::Gdi::HDC, + previous: windows::Win32::Graphics::Gdi::HGDIOBJ, +} + +#[cfg(windows)] +impl Drop for SelectedGdiObject { + fn drop(&mut self) { + unsafe { + windows::Win32::Graphics::Gdi::SelectObject(self.dc, self.previous); + } + } +} + +#[cfg(windows)] +fn map_windows_error(error: windows::core::Error) -> WindowCaptureError { + WindowCaptureError::Platform(error.code().0 as u32) +} + +#[cfg(windows)] +fn last_windows_error() -> WindowCaptureError { + let code = unsafe { windows::Win32::Foundation::GetLastError() }.0; + if code == 0 { + WindowCaptureError::CaptureFailed + } else { + WindowCaptureError::Platform(code) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn caps_capture_dimensions_and_pixel_count() { + assert!(CaptureLimits::default().validate().is_ok()); + assert_eq!( + CaptureLimits { + maximum_pixels: u64::MAX, + ..CaptureLimits::default() + } + .validate(), + Err(WindowCaptureError::InvalidLimits) + ); + assert_eq!( + CaptureLimits::default().validate_dimensions(8192, 8192), + Err(WindowCaptureError::WindowTooLarge { + width: 8192, + height: 8192, + }) + ); + } + + #[test] + fn encodes_an_opaque_rgba_pixel_without_disk_io() { + let bytes = encode_rgba_png(1, 1, &[1, 2, 3, 255]).expect("encode pixel"); + assert_eq!(&bytes[..8], b"\x89PNG\r\n\x1a\n"); + } +} diff --git a/src-tauri/src/windows/credential_manager.rs b/src-tauri/src/windows/credential_manager.rs new file mode 100644 index 0000000..a06e189 --- /dev/null +++ b/src-tauri/src/windows/credential_manager.rs @@ -0,0 +1,308 @@ +use std::{fmt, io}; + +use uuid::Uuid; +use zeroize::Zeroizing; + +const TARGET_PREFIX: &str = "AstrBotDesktop/v1"; +const MAX_CREDENTIAL_BLOB_BYTES: usize = 2560; + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub struct CredentialReference(Uuid); + +impl CredentialReference { + pub fn new() -> Self { + Self(Uuid::new_v4()) + } + + pub fn from_uuid(value: Uuid) -> Self { + Self(value) + } + + pub fn as_uuid(self) -> Uuid { + self.0 + } + + fn target_name(self) -> String { + format!("{TARGET_PREFIX}/{}", self.0) + } +} + +impl Default for CredentialReference { + fn default() -> Self { + Self::new() + } +} + +pub struct SecretCredential { + username: Option>, + secret: Zeroizing>, +} + +impl SecretCredential { + pub fn new(secret: Vec) -> Result { + Self::with_username(None, secret) + } + + pub fn with_username( + username: Option, + secret: Vec, + ) -> Result { + if secret.is_empty() || secret.len() > MAX_CREDENTIAL_BLOB_BYTES { + return Err(SecureStoreError::InvalidSecretLength); + } + if username.as_ref().is_some_and(|value| value.contains('\0')) { + return Err(SecureStoreError::InvalidUsername); + } + Ok(Self { + username: username.map(Zeroizing::new), + secret: Zeroizing::new(secret), + }) + } + + pub fn username(&self) -> Option<&str> { + self.username.as_deref().map(String::as_str) + } + + pub fn secret(&self) -> &[u8] { + self.secret.as_slice() + } +} + +impl fmt::Debug for SecretCredential { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter + .debug_struct("SecretCredential") + .field("username_present", &self.username.is_some()) + .field("secret", &"[REDACTED]") + .finish() + } +} + +#[derive(Debug)] +pub enum SecureStoreError { + UnsupportedPlatform, + InvalidSecretLength, + InvalidUsername, + Platform(io::ErrorKind), + InvalidStoredValue, +} + +impl fmt::Display for SecureStoreError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::UnsupportedPlatform => { + formatter.write_str("Windows Credential Manager is unavailable") + } + Self::InvalidSecretLength => formatter.write_str("the credential length is invalid"), + Self::InvalidUsername => formatter.write_str("the credential username is invalid"), + Self::Platform(kind) => write!(formatter, "credential storage failed: {kind}"), + Self::InvalidStoredValue => formatter.write_str("the stored credential is invalid"), + } + } +} + +impl std::error::Error for SecureStoreError {} + +pub trait SecureCredentialStore { + fn write( + &self, + reference: CredentialReference, + credential: &SecretCredential, + ) -> Result<(), SecureStoreError>; + + fn read( + &self, + reference: CredentialReference, + ) -> Result, SecureStoreError>; + + fn delete(&self, reference: CredentialReference) -> Result; +} + +#[derive(Clone, Copy, Debug, Default)] +pub struct WindowsCredentialStore; + +#[cfg(windows)] +impl SecureCredentialStore for WindowsCredentialStore { + fn write( + &self, + reference: CredentialReference, + credential: &SecretCredential, + ) -> Result<(), SecureStoreError> { + use windows::{ + Win32::Security::Credentials::{ + CRED_PERSIST_LOCAL_MACHINE, CRED_TYPE_GENERIC, CREDENTIALW, CredWriteW, + }, + core::PWSTR, + }; + + let mut target = to_wide(&reference.target_name()); + let mut username = to_wide(credential.username().unwrap_or("AstrBotDesktop")); + let native = CREDENTIALW { + Type: CRED_TYPE_GENERIC, + TargetName: PWSTR(target.as_mut_ptr()), + CredentialBlobSize: credential.secret().len() as u32, + CredentialBlob: credential.secret().as_ptr().cast_mut(), + Persist: CRED_PERSIST_LOCAL_MACHINE, + UserName: PWSTR(username.as_mut_ptr()), + ..Default::default() + }; + + unsafe { CredWriteW(&native, 0) }.map_err(|_| platform_error()) + } + + fn read( + &self, + reference: CredentialReference, + ) -> Result, SecureStoreError> { + use std::{ffi::c_void, slice}; + use windows::{ + Win32::{ + Foundation::ERROR_NOT_FOUND, + Security::Credentials::{CRED_TYPE_GENERIC, CREDENTIALW, CredFree, CredReadW}, + }, + core::{HRESULT, PCWSTR}, + }; + + struct Allocation(*mut CREDENTIALW); + impl Drop for Allocation { + fn drop(&mut self) { + if !self.0.is_null() { + unsafe { CredFree(self.0.cast::()) }; + } + } + } + + let target = to_wide(&reference.target_name()); + let mut pointer = std::ptr::null_mut::(); + if let Err(error) = unsafe { + CredReadW( + PCWSTR(target.as_ptr()), + CRED_TYPE_GENERIC, + None, + &mut pointer, + ) + } { + if error.code() == HRESULT::from_win32(ERROR_NOT_FOUND.0) { + return Ok(None); + } + return Err(platform_error()); + } + let allocation = Allocation(pointer); + let native = + unsafe { allocation.0.as_ref() }.ok_or(SecureStoreError::InvalidStoredValue)?; + if native.CredentialBlobSize == 0 + || native.CredentialBlobSize as usize > MAX_CREDENTIAL_BLOB_BYTES + || native.CredentialBlob.is_null() + { + return Err(SecureStoreError::InvalidStoredValue); + } + + let secret = unsafe { + slice::from_raw_parts(native.CredentialBlob, native.CredentialBlobSize as usize) + } + .to_vec(); + let username = if native.UserName.is_null() { + None + } else { + unsafe { PCWSTR(native.UserName.0).to_string() }.ok() + }; + SecretCredential::with_username(username, secret).map(Some) + } + + fn delete(&self, reference: CredentialReference) -> Result { + use windows::{ + Win32::{ + Foundation::ERROR_NOT_FOUND, + Security::Credentials::{CRED_TYPE_GENERIC, CredDeleteW}, + }, + core::{HRESULT, PCWSTR}, + }; + + let target = to_wide(&reference.target_name()); + match unsafe { CredDeleteW(PCWSTR(target.as_ptr()), CRED_TYPE_GENERIC, None) } { + Ok(()) => Ok(true), + Err(error) if error.code() == HRESULT::from_win32(ERROR_NOT_FOUND.0) => Ok(false), + Err(_) => Err(platform_error()), + } + } +} + +#[cfg(not(windows))] +impl SecureCredentialStore for WindowsCredentialStore { + fn write( + &self, + _reference: CredentialReference, + _credential: &SecretCredential, + ) -> Result<(), SecureStoreError> { + Err(SecureStoreError::UnsupportedPlatform) + } + + fn read( + &self, + _reference: CredentialReference, + ) -> Result, SecureStoreError> { + Err(SecureStoreError::UnsupportedPlatform) + } + + fn delete(&self, _reference: CredentialReference) -> Result { + Err(SecureStoreError::UnsupportedPlatform) + } +} + +#[cfg(windows)] +fn to_wide(value: &str) -> Vec { + use std::os::windows::ffi::OsStrExt; + std::ffi::OsStr::new(value) + .encode_wide() + .chain(std::iter::once(0)) + .collect() +} + +#[cfg(windows)] +fn platform_error() -> SecureStoreError { + SecureStoreError::Platform(io::Error::last_os_error().kind()) +} + +#[cfg(all(test, windows))] +mod tests { + use super::*; + + #[test] + fn writes_reads_updates_and_deletes_a_unique_test_credential() { + let store = WindowsCredentialStore; + let reference = CredentialReference::new(); + let first = SecretCredential::new(format!("first-{}", Uuid::new_v4()).into_bytes()) + .expect("create first secret"); + let second = SecretCredential::with_username( + Some("spike-user".to_owned()), + format!("second-{}", Uuid::new_v4()).into_bytes(), + ) + .expect("create second secret"); + + let result = (|| { + store.write(reference, &first)?; + let read = store + .read(reference)? + .ok_or(SecureStoreError::InvalidStoredValue)?; + assert_eq!(read.secret(), first.secret()); + + store.write(reference, &second)?; + let read = store + .read(reference)? + .ok_or(SecureStoreError::InvalidStoredValue)?; + assert_eq!(read.secret(), second.secret()); + assert_eq!(read.username(), Some("spike-user")); + Ok::<_, SecureStoreError>(()) + })(); + + let deletion = store.delete(reference); + result.expect("credential round trip"); + assert!(deletion.expect("delete credential")); + assert!( + store + .read(reference) + .expect("read deleted credential") + .is_none() + ); + } +} diff --git a/src-tauri/src/windows/event_log.rs b/src-tauri/src/windows/event_log.rs new file mode 100644 index 0000000..bdd8779 --- /dev/null +++ b/src-tauri/src/windows/event_log.rs @@ -0,0 +1,526 @@ +use std::{fmt, time::Duration}; + +#[cfg(windows)] +use std::mem::size_of; + +#[cfg(any(windows, test))] +use quick_xml::{ + Reader, XmlVersion, + events::{BytesStart, Event}, +}; + +#[cfg(windows)] +const MAX_EVENT_XML_BYTES: u32 = 64 * 1024; +#[cfg(any(windows, test))] +const MAX_REDACTED_FIELDS: usize = 16; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum EventLogChannel { + Application, + System, +} + +impl EventLogChannel { + #[cfg(windows)] + fn as_str(self) -> &'static str { + match self { + Self::Application => "Application", + Self::System => "System", + } + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct EventLogQuery { + pub channel: EventLogChannel, + pub provider: Option, + pub process_id: Option, + pub since: Duration, + pub limit: u16, +} + +impl EventLogQuery { + pub fn validate(&self) -> Result<(), EventLogError> { + if self.since.is_zero() || self.since > Duration::from_secs(24 * 60 * 60) { + return Err(EventLogError::InvalidTimeRange); + } + if self.limit == 0 || self.limit > 100 { + return Err(EventLogError::InvalidLimit); + } + if self.process_id == Some(0) { + return Err(EventLogError::InvalidProcessId); + } + if let Some(provider) = &self.provider + && (provider.is_empty() + || provider.len() > 128 + || provider.trim() != provider + || provider.chars().any(|character| { + !(character.is_ascii_alphanumeric() + || matches!(character, ' ' | '-' | '_' | '.' | '/' | '(' | ')')) + })) + { + return Err(EventLogError::InvalidProvider); + } + Ok(()) + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct EventLogSummary { + pub provider: String, + pub event_id: u32, + pub level: Option, + pub process_id: Option, + pub timestamp: Option, + /// EventData field names are retained for diagnostics, but values are never + /// returned by this provider. + pub redacted_data: Vec<(String, String)>, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum EventLogError { + InvalidTimeRange, + InvalidLimit, + InvalidProcessId, + InvalidProvider, + AccessDenied, + EventTooLarge, + MalformedEvent, + UnsupportedPlatform, + Platform(u32), +} + +impl fmt::Display for EventLogError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::InvalidTimeRange => formatter.write_str("the Event Log time range is invalid"), + Self::InvalidLimit => formatter.write_str("the Event Log result limit is invalid"), + Self::InvalidProcessId => formatter.write_str("the Event Log process id is invalid"), + Self::InvalidProvider => formatter.write_str("the Event Log provider is invalid"), + Self::AccessDenied => formatter.write_str( + "the selected Event Log channel is not readable at the current integrity level", + ), + Self::EventTooLarge => { + formatter.write_str("an Event Log record exceeds the safety cap") + } + Self::MalformedEvent => formatter.write_str("an Event Log record is malformed"), + Self::UnsupportedPlatform => { + formatter.write_str("Windows Event Log is unavailable on this platform") + } + Self::Platform(code) => { + write!( + formatter, + "Windows Event Log failed with HRESULT 0x{code:08x}" + ) + } + } + } +} + +impl std::error::Error for EventLogError {} + +/// Runs a typed, bounded Event Log query. +/// +/// Channel names are an enum and the XPath expression is constructed locally +/// from validated provider, time, and process fields. Returned summaries omit +/// message text and replace every EventData value with [REDACTED]. +pub fn query_recent_events(query: &EventLogQuery) -> Result, EventLogError> { + query.validate()?; + query_recent_events_native(query) +} + +#[cfg(windows)] +fn query_recent_events_native( + query: &EventLogQuery, +) -> Result, EventLogError> { + use windows::{ + Win32::{ + Foundation::ERROR_NO_MORE_ITEMS, + System::EventLog::{ + EVT_HANDLE, EvtNext, EvtQuery, EvtQueryChannelPath, EvtQueryReverseDirection, + }, + }, + core::{HRESULT, PCWSTR}, + }; + + let channel = wide_null(query.channel.as_str()); + let xpath = build_xpath(query); + let xpath = wide_null(&xpath); + let flags = EvtQueryChannelPath.0 | EvtQueryReverseDirection.0; + let result_set = unsafe { + EvtQuery( + None, + PCWSTR(channel.as_ptr()), + PCWSTR(xpath.as_ptr()), + flags, + ) + } + .map(OwnedEventHandle) + .map_err(map_windows_error)?; + + let mut summaries = Vec::with_capacity(usize::from(query.limit)); + let maximum_scanned = usize::from(query.limit) * 4; + let mut scanned = 0_usize; + + while summaries.len() < usize::from(query.limit) && scanned < maximum_scanned { + let mut raw_handles = [0_isize; 8]; + let mut returned = 0_u32; + match unsafe { EvtNext(result_set.0, &mut raw_handles, 0, 0, &mut returned) } { + Ok(()) => {} + Err(error) if error.code() == HRESULT::from_win32(ERROR_NO_MORE_ITEMS.0) => { + break; + } + Err(error) => return Err(map_windows_error(error)), + } + + let handles = raw_handles[..returned as usize] + .iter() + .copied() + .filter(|handle| *handle != 0) + .map(|handle| OwnedEventHandle(EVT_HANDLE(handle))) + .collect::>(); + for handle in &handles { + if summaries.len() >= usize::from(query.limit) || scanned >= maximum_scanned { + break; + } + scanned += 1; + let xml = match render_event_xml(handle.0) { + Ok(xml) => xml, + Err(EventLogError::EventTooLarge | EventLogError::MalformedEvent) => continue, + Err(error) => return Err(error), + }; + let summary = match parse_event_xml(&xml) { + Ok(summary) => summary, + Err(EventLogError::MalformedEvent) => continue, + Err(error) => return Err(error), + }; + if query + .provider + .as_ref() + .is_some_and(|provider| provider != &summary.provider) + || query + .process_id + .is_some_and(|process_id| summary.process_id != Some(process_id)) + { + continue; + } + summaries.push(summary); + } + + if returned == 0 { + break; + } + } + + Ok(summaries) +} + +#[cfg(not(windows))] +fn query_recent_events_native( + _query: &EventLogQuery, +) -> Result, EventLogError> { + Err(EventLogError::UnsupportedPlatform) +} + +#[cfg(windows)] +fn build_xpath(query: &EventLogQuery) -> String { + let milliseconds = query.since.as_millis(); + let mut clauses = vec![format!( + "TimeCreated[timediff(@SystemTime) <= {milliseconds}]" + )]; + if let Some(provider) = &query.provider { + clauses.push(format!("Provider[@Name='{provider}']")); + } + if let Some(process_id) = query.process_id { + clauses.push(format!("Execution[@ProcessID={process_id}]")); + } + format!("*[System[{}]]", clauses.join(" and ")) +} + +#[cfg(windows)] +fn render_event_xml( + event: windows::Win32::System::EventLog::EVT_HANDLE, +) -> Result { + use windows::{ + Win32::{ + Foundation::ERROR_INSUFFICIENT_BUFFER, + System::EventLog::{EvtRender, EvtRenderEventXml}, + }, + core::HRESULT, + }; + + let mut required_bytes = 0_u32; + let mut property_count = 0_u32; + match unsafe { + EvtRender( + None, + event, + EvtRenderEventXml.0, + 0, + None, + &mut required_bytes, + &mut property_count, + ) + } { + Ok(()) if required_bytes == 0 => return Err(EventLogError::MalformedEvent), + Ok(()) => {} + Err(error) if error.code() == HRESULT::from_win32(ERROR_INSUFFICIENT_BUFFER.0) => {} + Err(error) => return Err(map_windows_error(error)), + } + + if required_bytes == 0 || required_bytes > MAX_EVENT_XML_BYTES { + return Err(EventLogError::EventTooLarge); + } + let mut buffer = vec![0_u16; (required_bytes as usize).div_ceil(size_of::())]; + unsafe { + EvtRender( + None, + event, + EvtRenderEventXml.0, + required_bytes, + Some(buffer.as_mut_ptr().cast()), + &mut required_bytes, + &mut property_count, + ) + } + .map_err(map_windows_error)?; + + let unit_count = (required_bytes as usize / size_of::()).min(buffer.len()); + let unit_count = buffer[..unit_count] + .iter() + .position(|unit| *unit == 0) + .unwrap_or(unit_count); + String::from_utf16(&buffer[..unit_count]).map_err(|_| EventLogError::MalformedEvent) +} + +#[cfg(windows)] +struct OwnedEventHandle(windows::Win32::System::EventLog::EVT_HANDLE); + +#[cfg(windows)] +impl Drop for OwnedEventHandle { + fn drop(&mut self) { + if self.0.0 != 0 { + unsafe { + let _ = windows::Win32::System::EventLog::EvtClose(self.0); + } + } + } +} + +#[cfg(windows)] +fn wide_null(value: &str) -> Vec { + value.encode_utf16().chain(std::iter::once(0)).collect() +} + +#[cfg(windows)] +fn map_windows_error(error: windows::core::Error) -> EventLogError { + use windows::{ + Win32::Foundation::{E_ACCESSDENIED, ERROR_ACCESS_DENIED}, + core::HRESULT, + }; + + let code = error.code(); + if code == E_ACCESSDENIED || code == HRESULT::from_win32(ERROR_ACCESS_DENIED.0) { + EventLogError::AccessDenied + } else { + EventLogError::Platform(code.0 as u32) + } +} + +#[derive(Default)] +#[cfg(any(windows, test))] +struct ParsedEvent { + provider: Option, + event_id: Option, + level: Option, + process_id: Option, + timestamp: Option, + redacted_data: Vec<(String, String)>, +} + +#[derive(Clone, Copy)] +#[cfg(any(windows, test))] +enum TextField { + EventId, + Level, +} + +#[cfg(any(windows, test))] +fn parse_event_xml(xml: &str) -> Result { + let mut reader = Reader::from_str(xml); + reader.config_mut().trim_text(true); + let mut buffer = Vec::new(); + let mut parsed = ParsedEvent::default(); + let mut text_field = None; + let mut in_event_data = false; + + loop { + match reader.read_event_into(&mut buffer) { + Ok(Event::Start(element)) => { + inspect_element(&reader, &element, in_event_data, &mut parsed)?; + match element.name().as_ref() { + b"EventID" => text_field = Some(TextField::EventId), + b"Level" => text_field = Some(TextField::Level), + b"EventData" => in_event_data = true, + _ => {} + } + } + Ok(Event::Empty(element)) => { + inspect_element(&reader, &element, in_event_data, &mut parsed)?; + } + Ok(Event::Text(text)) => { + let value = text.decode().map_err(|_| EventLogError::MalformedEvent)?; + match text_field { + Some(TextField::EventId) => { + parsed.event_id = value.trim().parse::().ok(); + } + Some(TextField::Level) => { + parsed.level = value.trim().parse::().ok(); + } + None => {} + } + } + Ok(Event::End(element)) => match element.name().as_ref() { + b"EventID" | b"Level" => text_field = None, + b"EventData" => in_event_data = false, + _ => {} + }, + Ok(Event::DocType(_)) => return Err(EventLogError::MalformedEvent), + Ok(Event::Eof) => break, + Ok(_) => {} + Err(_) => return Err(EventLogError::MalformedEvent), + } + buffer.clear(); + } + + Ok(EventLogSummary { + provider: parsed + .provider + .unwrap_or_else(|| "unknown-provider".to_owned()), + event_id: parsed.event_id.ok_or(EventLogError::MalformedEvent)?, + level: parsed.level, + process_id: parsed.process_id, + timestamp: parsed.timestamp, + redacted_data: parsed.redacted_data, + }) +} + +#[cfg(any(windows, test))] +fn inspect_element( + reader: &Reader<&[u8]>, + element: &BytesStart<'_>, + in_event_data: bool, + parsed: &mut ParsedEvent, +) -> Result<(), EventLogError> { + match element.name().as_ref() { + b"Provider" => { + parsed.provider = attribute_value(reader, element, b"Name")? + .map(|value| sanitize_metadata(&value, 128, "unknown-provider")); + } + b"TimeCreated" => { + parsed.timestamp = attribute_value(reader, element, b"SystemTime")? + .map(|value| sanitize_metadata(&value, 64, "invalid-time")); + } + b"Execution" => { + parsed.process_id = attribute_value(reader, element, b"ProcessID")? + .and_then(|value| value.parse::().ok()); + } + b"Data" if in_event_data && parsed.redacted_data.len() < MAX_REDACTED_FIELDS => { + let fallback = format!("data_{}", parsed.redacted_data.len() + 1); + let name = attribute_value(reader, element, b"Name")? + .map(|value| sanitize_metadata(&value, 64, &fallback)) + .unwrap_or(fallback); + parsed.redacted_data.push((name, "[REDACTED]".to_owned())); + } + _ => {} + } + Ok(()) +} + +#[cfg(any(windows, test))] +fn attribute_value( + reader: &Reader<&[u8]>, + element: &BytesStart<'_>, + name: &[u8], +) -> Result, EventLogError> { + for attribute in element.attributes().with_checks(false) { + let attribute = attribute.map_err(|_| EventLogError::MalformedEvent)?; + if attribute.key.as_ref() == name { + return attribute + .decoded_and_normalized_value(XmlVersion::Implicit1_0, reader.decoder()) + .map(|value| Some(value.into_owned())) + .map_err(|_| EventLogError::MalformedEvent); + } + } + Ok(None) +} + +#[cfg(any(windows, test))] +fn sanitize_metadata(value: &str, maximum_chars: usize, fallback: &str) -> String { + let value = value.trim(); + if value.is_empty() + || value.chars().any(|character| { + !(character.is_alphanumeric() + || matches!( + character, + ' ' | '-' | '_' | '.' | '/' | '(' | ')' | ':' | '+' + )) + }) + { + return fallback.to_owned(); + } + value.chars().take(maximum_chars).collect() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn rejects_xpath_shaped_provider_and_unbounded_query() { + let query = EventLogQuery { + channel: EventLogChannel::Application, + provider: Some("Provider'] or *[".to_owned()), + process_id: None, + since: Duration::from_secs(60), + limit: 10, + }; + assert_eq!(query.validate(), Err(EventLogError::InvalidProvider)); + + let query = EventLogQuery { + provider: None, + limit: 101, + ..query + }; + assert_eq!(query.validate(), Err(EventLogError::InvalidLimit)); + } + + #[test] + fn parses_only_system_metadata_and_redacts_event_data_values() { + let xml = r#"10002not-a-real-secret"#; + let summary = parse_event_xml(xml).expect("parse event"); + assert_eq!(summary.provider, "Application Error"); + assert_eq!(summary.event_id, 1000); + assert_eq!(summary.level, Some(2)); + assert_eq!(summary.process_id, Some(42)); + assert_eq!( + summary.redacted_data, + vec![("password".to_owned(), "[REDACTED]".to_owned())] + ); + assert!(!format!("{summary:?}").contains("not-a-real-secret")); + } + + #[cfg(windows)] + #[test] + fn queries_the_application_channel_with_a_bounded_result() { + let events = query_recent_events(&EventLogQuery { + channel: EventLogChannel::Application, + provider: None, + process_id: None, + since: Duration::from_secs(60 * 60), + limit: 2, + }) + .expect("query Application events"); + assert!(events.len() <= 2); + } +} diff --git a/src-tauri/src/windows/file_ops.rs b/src-tauri/src/windows/file_ops.rs new file mode 100644 index 0000000..2755a01 --- /dev/null +++ b/src-tauri/src/windows/file_ops.rs @@ -0,0 +1,46 @@ +use std::{io, path::Path}; + +#[cfg(not(windows))] +use std::fs; + +#[cfg(windows)] +pub fn commit_no_replace(temporary: &Path, final_path: &Path) -> io::Result<()> { + use std::os::windows::ffi::OsStrExt; + use windows::{ + Win32::Storage::FileSystem::{MOVEFILE_WRITE_THROUGH, MoveFileExW}, + core::PCWSTR, + }; + + if final_path.exists() { + return Err(io::Error::new( + io::ErrorKind::AlreadyExists, + "the destination already exists", + )); + } + + let temporary_wide = temporary + .as_os_str() + .encode_wide() + .chain(std::iter::once(0)) + .collect::>(); + let final_wide = final_path + .as_os_str() + .encode_wide() + .chain(std::iter::once(0)) + .collect::>(); + + unsafe { + MoveFileExW( + PCWSTR(temporary_wide.as_ptr()), + PCWSTR(final_wide.as_ptr()), + MOVEFILE_WRITE_THROUGH, + ) + } + .map_err(|_| io::Error::last_os_error()) +} + +#[cfg(not(windows))] +pub fn commit_no_replace(temporary: &Path, final_path: &Path) -> io::Result<()> { + fs::hard_link(temporary, final_path)?; + fs::remove_file(temporary) +} diff --git a/src-tauri/src/windows/foreground_window.rs b/src-tauri/src/windows/foreground_window.rs new file mode 100644 index 0000000..692898b --- /dev/null +++ b/src-tauri/src/windows/foreground_window.rs @@ -0,0 +1,189 @@ +use std::{ + fmt, io, + time::{Duration, Instant}, +}; + +use uuid::Uuid; + +use super::process::{ProcessInspectError, process_creation_time}; + +const MAX_WINDOW_TEXT_UNITS: usize = 1024; +const MAX_SELECTION_TTL: Duration = Duration::from_secs(5 * 60); + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct ForegroundWindowSummary { + pub selection_token: Uuid, + pub title: String, + pub class_name: String, + pub process_id: u32, + pub process_creation_time_100ns: u64, +} + +pub struct WindowSelection { + token: Uuid, + raw_handle: isize, + title: String, + class_name: String, + process_id: u32, + process_creation_time_100ns: u64, + expires_at: Instant, +} + +impl WindowSelection { + pub fn summary(&self) -> ForegroundWindowSummary { + ForegroundWindowSummary { + selection_token: self.token, + title: self.title.clone(), + class_name: self.class_name.clone(), + process_id: self.process_id, + process_creation_time_100ns: self.process_creation_time_100ns, + } + } + + pub fn is_expired(&self) -> bool { + Instant::now() >= self.expires_at + } + + pub fn validate(&self) -> Result<(), ForegroundWindowError> { + if self.is_expired() { + return Err(ForegroundWindowError::AuthorizationExpired); + } + validate_native_identity(self) + } + + pub(crate) fn raw_handle(&self) -> isize { + self.raw_handle + } +} + +impl fmt::Debug for WindowSelection { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter + .debug_struct("WindowSelection") + .field("token", &self.token) + .field("title", &self.title) + .field("class_name", &self.class_name) + .field("process_id", &self.process_id) + .field("expired", &self.is_expired()) + .finish_non_exhaustive() + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum ForegroundWindowError { + InvalidTtl, + NoForegroundWindow, + WindowChanged, + AuthorizationExpired, + AccessDenied, + UnsupportedPlatform, + Platform(io::ErrorKind), +} + +impl fmt::Display for ForegroundWindowError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::InvalidTtl => formatter.write_str("the window authorization TTL is invalid"), + Self::NoForegroundWindow => { + formatter.write_str("there is no inspectable foreground window") + } + Self::WindowChanged => formatter.write_str("the selected window identity changed"), + Self::AuthorizationExpired => { + formatter.write_str("the selected window authorization expired") + } + Self::AccessDenied => { + formatter.write_str("the selected window is above the current integrity level") + } + Self::UnsupportedPlatform => { + formatter.write_str("foreground-window inspection is unavailable") + } + Self::Platform(kind) => { + write!(formatter, "foreground-window inspection failed: {kind}") + } + } + } +} + +impl std::error::Error for ForegroundWindowError {} + +#[cfg(windows)] +pub fn inspect_foreground_window(ttl: Duration) -> Result { + use windows::Win32::UI::WindowsAndMessaging::{ + GetClassNameW, GetForegroundWindow, GetWindowTextW, GetWindowThreadProcessId, + }; + + if ttl.is_zero() || ttl > MAX_SELECTION_TTL { + return Err(ForegroundWindowError::InvalidTtl); + } + let window = unsafe { GetForegroundWindow() }; + if window.0.is_null() { + return Err(ForegroundWindowError::NoForegroundWindow); + } + let mut process_id = 0_u32; + unsafe { GetWindowThreadProcessId(window, Some(&mut process_id)) }; + if process_id == 0 { + return Err(ForegroundWindowError::NoForegroundWindow); + } + + let mut title_buffer = vec![0_u16; MAX_WINDOW_TEXT_UNITS]; + let title_length = unsafe { GetWindowTextW(window, &mut title_buffer) }; + title_buffer.truncate(title_length.max(0) as usize); + let mut class_buffer = vec![0_u16; 256]; + let class_length = unsafe { GetClassNameW(window, &mut class_buffer) }; + class_buffer.truncate(class_length.max(0) as usize); + let process_creation_time_100ns = + process_creation_time(process_id).map_err(map_process_error)?; + + Ok(WindowSelection { + token: Uuid::new_v4(), + raw_handle: window.0 as isize, + title: String::from_utf16_lossy(&title_buffer), + class_name: String::from_utf16_lossy(&class_buffer), + process_id, + process_creation_time_100ns, + expires_at: Instant::now() + ttl, + }) +} + +#[cfg(not(windows))] +pub fn inspect_foreground_window(_ttl: Duration) -> Result { + Err(ForegroundWindowError::UnsupportedPlatform) +} + +#[cfg(windows)] +fn validate_native_identity(selection: &WindowSelection) -> Result<(), ForegroundWindowError> { + use windows::Win32::{ + Foundation::HWND, + UI::WindowsAndMessaging::{GetWindowThreadProcessId, IsWindow}, + }; + + let window = HWND(selection.raw_handle as *mut _); + if !unsafe { IsWindow(Some(window)) }.as_bool() { + return Err(ForegroundWindowError::WindowChanged); + } + let mut process_id = 0_u32; + unsafe { GetWindowThreadProcessId(window, Some(&mut process_id)) }; + if process_id != selection.process_id + || process_creation_time(process_id).map_err(map_process_error)? + != selection.process_creation_time_100ns + { + return Err(ForegroundWindowError::WindowChanged); + } + Ok(()) +} + +#[cfg(not(windows))] +fn validate_native_identity(_selection: &WindowSelection) -> Result<(), ForegroundWindowError> { + Err(ForegroundWindowError::UnsupportedPlatform) +} + +fn map_process_error(error: ProcessInspectError) -> ForegroundWindowError { + match error { + ProcessInspectError::AccessDenied => ForegroundWindowError::AccessDenied, + ProcessInspectError::UnsupportedPlatform => ForegroundWindowError::UnsupportedPlatform, + ProcessInspectError::Platform(kind) => ForegroundWindowError::Platform(kind), + ProcessInspectError::Exited | ProcessInspectError::InvalidProcessId => { + ForegroundWindowError::WindowChanged + } + } +} diff --git a/src-tauri/src/windows/mod.rs b/src-tauri/src/windows/mod.rs new file mode 100644 index 0000000..524ed8a --- /dev/null +++ b/src-tauri/src/windows/mod.rs @@ -0,0 +1,8 @@ +pub mod capture; +pub mod credential_manager; +pub mod event_log; +pub mod file_ops; +pub mod foreground_window; +pub mod ports; +pub mod process; +pub mod uia; diff --git a/src-tauri/src/windows/ports.rs b/src-tauri/src/windows/ports.rs new file mode 100644 index 0000000..5ba9bdd --- /dev/null +++ b/src-tauri/src/windows/ports.rs @@ -0,0 +1,357 @@ +use std::{fmt, net::IpAddr}; + +#[cfg(windows)] +use std::{ + ffi::c_void, + mem::{align_of, size_of}, + net::{Ipv4Addr, Ipv6Addr}, +}; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum TransportProtocol { + Tcp, + Udp, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct LocalPortQuery { + pub protocol: TransportProtocol, + pub port: u16, +} + +impl LocalPortQuery { + pub fn validate(self) -> Result { + if self.port == 0 { + return Err(PortInspectError::InvalidPort); + } + Ok(self) + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct PortOwner { + pub protocol: TransportProtocol, + pub local_address: IpAddr, + pub port: u16, + pub process_id: u32, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum PortInspectError { + InvalidPort, + TableTooLarge, + MalformedTable, + TooManyOwners, + UnsupportedPlatform, + Platform(u32), +} + +impl fmt::Display for PortInspectError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::InvalidPort => formatter.write_str("the local port is invalid"), + Self::TableTooLarge => { + formatter.write_str("the IP Helper table exceeds the safety cap") + } + Self::MalformedTable => formatter.write_str("the IP Helper table is malformed"), + Self::TooManyOwners => { + formatter.write_str("the local port has too many owners to report") + } + Self::UnsupportedPlatform => { + formatter.write_str("IP Helper port inspection is unavailable on this platform") + } + Self::Platform(code) => { + write!( + formatter, + "IP Helper port inspection failed with Win32 error {code}" + ) + } + } + } +} + +impl std::error::Error for PortInspectError {} + +/// Checks one exact local port in the TCP or UDP owner-PID tables. +/// +/// Port ranges and scans are not representable. The result contains only local +/// bind addresses and owning process IDs; no remote endpoint data is returned. +pub fn inspect_local_port(query: LocalPortQuery) -> Result, PortInspectError> { + let query = query.validate()?; + inspect_local_port_native(query) +} + +#[cfg(windows)] +fn inspect_local_port_native(query: LocalPortQuery) -> Result, PortInspectError> { + use windows::Win32::{ + NetworkManagement::IpHelper::{ + GetExtendedTcpTable, GetExtendedUdpTable, MIB_TCP6ROW_OWNER_PID, MIB_TCPROW_OWNER_PID, + MIB_UDP6ROW_OWNER_PID, MIB_UDPROW_OWNER_PID, TCP_TABLE_OWNER_PID_ALL, + UDP_TABLE_OWNER_PID, + }, + Networking::WinSock::{AF_INET, AF_INET6}, + }; + + let mut owners = Vec::new(); + match query.protocol { + TransportProtocol::Tcp => { + let ipv4 = query_table(|buffer, size| unsafe { + GetExtendedTcpTable( + buffer, + size, + false, + AF_INET.0 as u32, + TCP_TABLE_OWNER_PID_ALL, + 0, + ) + })?; + for row in table_rows::(&ipv4)? { + if decode_port(row.dwLocalPort) == query.port { + push_owner( + &mut owners, + PortOwner { + protocol: query.protocol, + local_address: IpAddr::V4(Ipv4Addr::from( + row.dwLocalAddr.to_ne_bytes(), + )), + port: query.port, + process_id: row.dwOwningPid, + }, + )?; + } + } + + let ipv6 = query_table(|buffer, size| unsafe { + GetExtendedTcpTable( + buffer, + size, + false, + AF_INET6.0 as u32, + TCP_TABLE_OWNER_PID_ALL, + 0, + ) + })?; + for row in table_rows::(&ipv6)? { + if decode_port(row.dwLocalPort) == query.port { + push_owner( + &mut owners, + PortOwner { + protocol: query.protocol, + local_address: IpAddr::V6(Ipv6Addr::from(row.ucLocalAddr)), + port: query.port, + process_id: row.dwOwningPid, + }, + )?; + } + } + } + TransportProtocol::Udp => { + let ipv4 = query_table(|buffer, size| unsafe { + GetExtendedUdpTable( + buffer, + size, + false, + AF_INET.0 as u32, + UDP_TABLE_OWNER_PID, + 0, + ) + })?; + for row in table_rows::(&ipv4)? { + if decode_port(row.dwLocalPort) == query.port { + push_owner( + &mut owners, + PortOwner { + protocol: query.protocol, + local_address: IpAddr::V4(Ipv4Addr::from( + row.dwLocalAddr.to_ne_bytes(), + )), + port: query.port, + process_id: row.dwOwningPid, + }, + )?; + } + } + + let ipv6 = query_table(|buffer, size| unsafe { + GetExtendedUdpTable( + buffer, + size, + false, + AF_INET6.0 as u32, + UDP_TABLE_OWNER_PID, + 0, + ) + })?; + for row in table_rows::(&ipv6)? { + if decode_port(row.dwLocalPort) == query.port { + push_owner( + &mut owners, + PortOwner { + protocol: query.protocol, + local_address: IpAddr::V6(Ipv6Addr::from(row.ucLocalAddr)), + port: query.port, + process_id: row.dwOwningPid, + }, + )?; + } + } + } + } + + owners.sort_by(|left, right| { + left.local_address + .to_string() + .cmp(&right.local_address.to_string()) + .then(left.process_id.cmp(&right.process_id)) + }); + owners.dedup(); + Ok(owners) +} + +#[cfg(not(windows))] +fn inspect_local_port_native(_query: LocalPortQuery) -> Result, PortInspectError> { + Err(PortInspectError::UnsupportedPlatform) +} + +#[cfg(windows)] +const MAX_TABLE_BYTES: usize = 32 * 1024 * 1024; +#[cfg(windows)] +const MAX_TABLE_ROWS: usize = 1_000_000; +#[cfg(windows)] +const MAX_MATCHING_OWNERS: usize = 1024; + +#[cfg(windows)] +struct AlignedTable { + words: Vec, + byte_len: usize, +} + +#[cfg(windows)] +impl AlignedTable { + fn pointer(&mut self) -> *mut c_void { + self.words.as_mut_ptr().cast() + } + + fn bytes(&self) -> *const u8 { + self.words.as_ptr().cast() + } +} + +#[cfg(windows)] +fn query_table( + mut query: impl FnMut(Option<*mut c_void>, *mut u32) -> u32, +) -> Result { + use windows::Win32::Foundation::ERROR_INSUFFICIENT_BUFFER; + + let mut required_bytes = 0_u32; + let first_result = query(None, &mut required_bytes); + if first_result != 0 && first_result != ERROR_INSUFFICIENT_BUFFER.0 { + return Err(PortInspectError::Platform(first_result)); + } + + for _ in 0..3 { + let byte_len = (required_bytes as usize).max(size_of::()); + if byte_len > MAX_TABLE_BYTES { + return Err(PortInspectError::TableTooLarge); + } + let word_count = byte_len.div_ceil(size_of::()); + let mut table = AlignedTable { + words: vec![0; word_count], + byte_len, + }; + let result = query(Some(table.pointer()), &mut required_bytes); + if result == 0 { + table.byte_len = table + .byte_len + .min(required_bytes as usize) + .max(size_of::()); + return Ok(table); + } + if result != ERROR_INSUFFICIENT_BUFFER.0 { + return Err(PortInspectError::Platform(result)); + } + } + + Err(PortInspectError::TableTooLarge) +} + +#[cfg(windows)] +fn table_rows(table: &AlignedTable) -> Result<&[Row], PortInspectError> { + let count = unsafe { table.bytes().cast::().read_unaligned() as usize }; + if count > MAX_TABLE_ROWS { + return Err(PortInspectError::TableTooLarge); + } + + let row_offset = size_of::().div_ceil(align_of::()) * align_of::(); + let row_bytes = count + .checked_mul(size_of::()) + .and_then(|value| value.checked_add(row_offset)) + .ok_or(PortInspectError::TableTooLarge)?; + if row_bytes > table.byte_len { + return Err(PortInspectError::MalformedTable); + } + + let pointer = unsafe { table.bytes().add(row_offset).cast::() }; + Ok(unsafe { std::slice::from_raw_parts(pointer, count) }) +} + +#[cfg(any(windows, test))] +fn decode_port(value: u32) -> u16 { + u16::from_be(value as u16) +} + +#[cfg(windows)] +fn push_owner(owners: &mut Vec, owner: PortOwner) -> Result<(), PortInspectError> { + if owners.len() >= MAX_MATCHING_OWNERS { + return Err(PortInspectError::TooManyOwners); + } + owners.push(owner); + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn rejects_port_zero() { + assert_eq!( + LocalPortQuery { + protocol: TransportProtocol::Tcp, + port: 0, + } + .validate(), + Err(PortInspectError::InvalidPort) + ); + } + + #[test] + fn decodes_network_order_ports() { + assert_eq!(decode_port(0x901f), 8080); + } + + #[cfg(windows)] + #[test] + fn finds_the_current_process_tcp_listener() { + use std::{net::TcpListener, thread, time::Duration}; + + let listener = TcpListener::bind((Ipv4Addr::LOCALHOST, 0)).expect("bind loopback listener"); + let port = listener.local_addr().expect("listener address").port(); + let mut owners = Vec::new(); + for _ in 0..10 { + owners = inspect_local_port(LocalPortQuery { + protocol: TransportProtocol::Tcp, + port, + }) + .expect("inspect listener port"); + if owners + .iter() + .any(|owner| owner.process_id == std::process::id()) + { + return; + } + thread::sleep(Duration::from_millis(20)); + } + panic!("the current process was not reported for TCP port {port}: {owners:?}"); + } +} diff --git a/src-tauri/src/windows/process.rs b/src-tauri/src/windows/process.rs new file mode 100644 index 0000000..a48047b --- /dev/null +++ b/src-tauri/src/windows/process.rs @@ -0,0 +1,134 @@ +use std::{fmt, io}; + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct ProcessSummary { + pub process_id: u32, + pub executable_name: String, + pub creation_time_100ns: u64, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum ProcessInspectError { + InvalidProcessId, + AccessDenied, + Exited, + UnsupportedPlatform, + Platform(io::ErrorKind), +} + +impl fmt::Display for ProcessInspectError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::InvalidProcessId => formatter.write_str("the process id is invalid"), + Self::AccessDenied => formatter + .write_str("the process cannot be inspected at the current integrity level"), + Self::Exited => formatter.write_str("the process exited before it could be inspected"), + Self::UnsupportedPlatform => { + formatter.write_str("Windows process inspection is unavailable") + } + Self::Platform(kind) => write!(formatter, "process inspection failed: {kind}"), + } + } +} + +impl std::error::Error for ProcessInspectError {} + +#[cfg(windows)] +pub fn inspect_process(process_id: u32) -> Result { + use std::path::Path; + use windows::{ + Win32::{ + Foundation::{CloseHandle, FILETIME, HANDLE}, + System::Threading::{ + GetProcessTimes, OpenProcess, PROCESS_NAME_WIN32, + PROCESS_QUERY_LIMITED_INFORMATION, QueryFullProcessImageNameW, + }, + }, + core::PWSTR, + }; + + struct OwnedHandle(HANDLE); + impl Drop for OwnedHandle { + fn drop(&mut self) { + let _ = unsafe { CloseHandle(self.0) }; + } + } + + if process_id == 0 { + return Err(ProcessInspectError::InvalidProcessId); + } + let handle = unsafe { OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, false, process_id) } + .map(OwnedHandle) + .map_err(|_| map_last_process_error())?; + + let mut creation = FILETIME::default(); + let mut exit = FILETIME::default(); + let mut kernel = FILETIME::default(); + let mut user = FILETIME::default(); + unsafe { GetProcessTimes(handle.0, &mut creation, &mut exit, &mut kernel, &mut user) } + .map_err(|_| map_last_process_error())?; + + let mut path_buffer = vec![0_u16; 32_768]; + let mut path_length = path_buffer.len() as u32; + unsafe { + QueryFullProcessImageNameW( + handle.0, + PROCESS_NAME_WIN32, + PWSTR(path_buffer.as_mut_ptr()), + &mut path_length, + ) + } + .map_err(|_| map_last_process_error())?; + path_buffer.truncate(path_length as usize); + let path = String::from_utf16_lossy(&path_buffer); + let executable_name = Path::new(&path) + .file_name() + .and_then(|value| value.to_str()) + .unwrap_or("unknown-process") + .to_owned(); + + Ok(ProcessSummary { + process_id, + executable_name, + creation_time_100ns: file_time_value(creation), + }) +} + +#[cfg(not(windows))] +pub fn inspect_process(_process_id: u32) -> Result { + Err(ProcessInspectError::UnsupportedPlatform) +} + +pub(crate) fn process_creation_time(process_id: u32) -> Result { + inspect_process(process_id).map(|summary| summary.creation_time_100ns) +} + +#[cfg(windows)] +fn file_time_value(value: windows::Win32::Foundation::FILETIME) -> u64 { + ((value.dwHighDateTime as u64) << 32) | value.dwLowDateTime as u64 +} + +#[cfg(windows)] +fn map_last_process_error() -> ProcessInspectError { + use windows::Win32::Foundation::{ERROR_ACCESS_DENIED, ERROR_INVALID_PARAMETER}; + + let error = io::Error::last_os_error(); + match error.raw_os_error().map(|value| value as u32) { + Some(code) if code == ERROR_ACCESS_DENIED.0 => ProcessInspectError::AccessDenied, + Some(code) if code == ERROR_INVALID_PARAMETER.0 => ProcessInspectError::Exited, + _ => ProcessInspectError::Platform(error.kind()), + } +} + +#[cfg(all(test, windows))] +mod tests { + use super::*; + + #[test] + fn inspects_the_current_process_without_debug_privilege() { + let summary = inspect_process(std::process::id()).expect("inspect current process"); + assert_eq!(summary.process_id, std::process::id()); + assert!(!summary.executable_name.is_empty()); + assert_ne!(summary.creation_time_100ns, 0); + } +} diff --git a/src-tauri/src/windows/uia.rs b/src-tauri/src/windows/uia.rs new file mode 100644 index 0000000..4c2a036 --- /dev/null +++ b/src-tauri/src/windows/uia.rs @@ -0,0 +1,339 @@ +use std::fmt; + +#[cfg(windows)] +use std::collections::{HashSet, VecDeque}; + +use super::foreground_window::{ForegroundWindowError, WindowSelection}; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct UiaReadLimits { + pub maximum_depth: u8, + pub maximum_nodes: u16, + pub maximum_text_bytes: usize, +} + +impl Default for UiaReadLimits { + fn default() -> Self { + Self { + maximum_depth: 8, + maximum_nodes: 200, + maximum_text_bytes: 16 * 1024, + } + } +} + +impl UiaReadLimits { + pub fn validate(self) -> Result { + if self.maximum_depth == 0 + || self.maximum_depth > 16 + || self.maximum_nodes == 0 + || self.maximum_nodes > 500 + || self.maximum_text_bytes == 0 + || self.maximum_text_bytes > 64 * 1024 + { + return Err(UiaReadError::InvalidLimits); + } + Ok(self) + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct UiaTextSnapshot { + pub text: String, + pub visited_nodes: u16, + pub password_nodes_skipped: u16, + pub foreign_process_nodes_skipped: u16, + pub truncated: bool, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum UiaReadError { + InvalidLimits, + Selection(ForegroundWindowError), + AccessDenied, + ElementUnavailable, + UnsupportedPlatform, + Platform(i32), +} + +impl fmt::Display for UiaReadError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::InvalidLimits => formatter.write_str("the UI Automation limits are invalid"), + Self::Selection(error) => write!(formatter, "the selected window is invalid: {error}"), + Self::AccessDenied => formatter.write_str( + "the selected window is above the current UI Automation integrity level", + ), + Self::ElementUnavailable => { + formatter.write_str("the selected UI Automation element became unavailable") + } + Self::UnsupportedPlatform => { + formatter.write_str("UI Automation is unavailable on this platform") + } + Self::Platform(code) => { + write!( + formatter, + "UI Automation failed with HRESULT 0x{:08x}", + *code as u32 + ) + } + } + } +} + +impl std::error::Error for UiaReadError {} + +/// Reads names from the selected window's UI Automation control tree. +/// +/// Traversal cannot escape the selected HWND or its original process. Password +/// and foreign-process elements are skipped, and callers must provide bounded +/// depth, node-count, and output-size limits. +pub fn read_standard_dialog_text( + selection: &WindowSelection, + limits: UiaReadLimits, +) -> Result { + let limits = limits.validate()?; + selection.validate().map_err(UiaReadError::Selection)?; + read_standard_dialog_text_native(selection, limits) +} + +#[cfg(windows)] +fn read_standard_dialog_text_native( + selection: &WindowSelection, + limits: UiaReadLimits, +) -> Result { + use windows::Win32::{ + Foundation::HWND, + System::Com::{CLSCTX_INPROC_SERVER, CoCreateInstance}, + UI::Accessibility::{CUIAutomation, IUIAutomation}, + }; + + let _com_guard = initialize_com()?; + let automation: IUIAutomation = + unsafe { CoCreateInstance(&CUIAutomation, None, CLSCTX_INPROC_SERVER) } + .map_err(map_automation_error)?; + let root = unsafe { + automation.ElementFromHandle(HWND(selection.raw_handle() as *mut core::ffi::c_void)) + } + .map_err(map_automation_error)?; + + let expected_process_id = selection.summary().process_id; + let root_process_id = unsafe { root.CurrentProcessId() }.map_err(map_automation_error)?; + if root_process_id <= 0 || root_process_id as u32 != expected_process_id { + return Err(UiaReadError::Selection( + ForegroundWindowError::WindowChanged, + )); + } + + let walker = unsafe { automation.ControlViewWalker() }.map_err(map_automation_error)?; + let mut queue = VecDeque::from([(root, 0_u8)]); + let mut seen_text = HashSet::new(); + let mut text = String::new(); + let mut visited_nodes = 0_u16; + let mut password_nodes_skipped = 0_u16; + let mut foreign_process_nodes_skipped = 0_u16; + let mut truncated = false; + + while let Some((element, depth)) = queue.pop_front() { + if visited_nodes >= limits.maximum_nodes { + truncated = true; + break; + } + visited_nodes += 1; + + let process_id = match unsafe { element.CurrentProcessId() } { + Ok(value) => value, + Err(error) if is_element_unavailable(&error) => { + truncated = true; + continue; + } + Err(error) => return Err(map_automation_error(error)), + }; + if process_id <= 0 || process_id as u32 != expected_process_id { + foreign_process_nodes_skipped = foreign_process_nodes_skipped.saturating_add(1); + continue; + } + + match unsafe { element.CurrentIsPassword() } { + Ok(value) if value.as_bool() => { + password_nodes_skipped = password_nodes_skipped.saturating_add(1); + continue; + } + Ok(_) => match unsafe { element.CurrentName() } { + Ok(value) => { + let value = value.to_string(); + let value = value.trim(); + if !value.is_empty() + && seen_text.insert(value.to_owned()) + && !append_bounded_line(&mut text, value, limits.maximum_text_bytes) + { + truncated = true; + break; + } + } + Err(error) if is_element_unavailable(&error) => truncated = true, + Err(error) => return Err(map_automation_error(error)), + }, + // A failed password-property read is treated as sensitive rather + // than risking disclosure of a credential field. + Err(error) if is_element_unavailable(&error) || error.code().is_ok() => { + password_nodes_skipped = password_nodes_skipped.saturating_add(1); + truncated = true; + continue; + } + Err(error) => return Err(map_automation_error(error)), + } + + if depth >= limits.maximum_depth { + if optional_element(unsafe { walker.GetFirstChildElement(&element) })?.is_some() { + truncated = true; + } + continue; + } + + let mut child = optional_element(unsafe { walker.GetFirstChildElement(&element) })?; + while let Some(element) = child { + if usize::from(visited_nodes) + queue.len() >= usize::from(limits.maximum_nodes) { + truncated = true; + break; + } + child = optional_element(unsafe { walker.GetNextSiblingElement(&element) })?; + queue.push_back((element, depth + 1)); + } + } + + Ok(UiaTextSnapshot { + text, + visited_nodes, + password_nodes_skipped, + foreign_process_nodes_skipped, + truncated, + }) +} + +#[cfg(not(windows))] +fn read_standard_dialog_text_native( + _selection: &WindowSelection, + _limits: UiaReadLimits, +) -> Result { + Err(UiaReadError::UnsupportedPlatform) +} + +#[cfg(windows)] +struct ComInitializationGuard(bool); + +#[cfg(windows)] +impl Drop for ComInitializationGuard { + fn drop(&mut self) { + if self.0 { + unsafe { windows::Win32::System::Com::CoUninitialize() }; + } + } +} + +#[cfg(windows)] +fn initialize_com() -> Result { + use windows::Win32::{ + Foundation::RPC_E_CHANGED_MODE, + System::Com::{COINIT_MULTITHREADED, CoInitializeEx}, + }; + + let result = unsafe { CoInitializeEx(None, COINIT_MULTITHREADED) }; + if result.is_ok() { + Ok(ComInitializationGuard(true)) + } else if result == RPC_E_CHANGED_MODE { + Ok(ComInitializationGuard(false)) + } else { + Err(map_automation_hresult(result)) + } +} + +#[cfg(windows)] +fn optional_element( + result: windows::core::Result, +) -> Result, UiaReadError> { + match result { + Ok(element) => Ok(Some(element)), + // A successful COM call with a null interface is represented by + // windows-core as an empty error whose HRESULT is S_OK. + Err(error) if error.code().is_ok() || is_element_unavailable(&error) => Ok(None), + Err(error) => Err(map_automation_error(error)), + } +} + +#[cfg(windows)] +fn is_element_unavailable(error: &windows::core::Error) -> bool { + error.code().0 as u32 == windows::Win32::UI::Accessibility::UIA_E_ELEMENTNOTAVAILABLE +} + +#[cfg(windows)] +fn map_automation_error(error: windows::core::Error) -> UiaReadError { + map_automation_hresult(error.code()) +} + +#[cfg(windows)] +fn map_automation_hresult(code: windows::core::HRESULT) -> UiaReadError { + use windows::Win32::{ + Foundation::E_ACCESSDENIED, UI::Accessibility::UIA_E_ELEMENTNOTAVAILABLE, + }; + + if code == E_ACCESSDENIED { + UiaReadError::AccessDenied + } else if code.0 as u32 == UIA_E_ELEMENTNOTAVAILABLE { + UiaReadError::ElementUnavailable + } else { + UiaReadError::Platform(code.0) + } +} + +#[cfg(any(windows, test))] +fn append_bounded_line(target: &mut String, value: &str, maximum_bytes: usize) -> bool { + let separator_bytes = usize::from(!target.is_empty()); + if target.len() + separator_bytes + value.len() <= maximum_bytes { + if separator_bytes == 1 { + target.push('\n'); + } + target.push_str(value); + return true; + } + + let remaining = maximum_bytes.saturating_sub(target.len()); + if remaining <= separator_bytes { + return false; + } + if separator_bytes == 1 { + target.push('\n'); + } + let available = maximum_bytes - target.len(); + let mut boundary = available.min(value.len()); + while boundary > 0 && !value.is_char_boundary(boundary) { + boundary -= 1; + } + target.push_str(&value[..boundary]); + false +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn rejects_unbounded_requests_before_native_access() { + assert_eq!( + UiaReadLimits { + maximum_depth: 255, + ..UiaReadLimits::default() + } + .validate(), + Err(UiaReadError::InvalidLimits) + ); + } + + #[test] + fn truncates_text_only_at_utf8_boundaries() { + let mut text = String::new(); + assert!(!append_bounded_line(&mut text, "错误窗口", 5)); + assert_eq!(text, "错"); + assert!(text.len() <= 5); + } +} diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json new file mode 100644 index 0000000..cb3b96b --- /dev/null +++ b/src-tauri/tauri.conf.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://schema.tauri.app/config/2", + "productName": "AstrBot Desktop", + "version": "0.1.0-alpha.0", + "identifier": "com.yokiirobw.astrbot-desktop", + "build": { + "beforeDevCommand": "npm run dev", + "devUrl": "http://127.0.0.1:1420", + "beforeBuildCommand": "npm run build", + "frontendDist": "../dist" + }, + "app": { + "windows": [ + { + "label": "main", + "title": "AstrBot Desktop", + "width": 1100, + "height": 760, + "minWidth": 720, + "minHeight": 520, + "center": true, + "resizable": true + } + ], + "security": { + "csp": "default-src 'self'; connect-src ipc: http://ipc.localhost http://127.0.0.1:*; img-src 'self' asset: http://asset.localhost data:; style-src 'self' 'unsafe-inline'; script-src 'self'" + } + }, + "bundle": { + "active": true, + "targets": ["nsis"], + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.ico" + ] + } +} diff --git a/src-tauri/tests/dual_gateway_integration.rs b/src-tauri/tests/dual_gateway_integration.rs new file mode 100644 index 0000000..42a1016 --- /dev/null +++ b/src-tauri/tests/dual_gateway_integration.rs @@ -0,0 +1,255 @@ +use std::{collections::HashSet, sync::Arc, time::Duration}; + +use astrbot_desktop_lib::networking::{GatewayClient, GatewayClientConfig, SlotKind}; +use desktop_protocol::{ + AuthLoginRequest, AuthLoginResponse, ClientCapabilities, ConnectionState, EventMetadata, + GatewayEvent, GatewayEventBody, HeartbeatPayload, PROTOCOL_VERSION, +}; +use mock_gateway::{MockGatewayConfig, MockInstanceKind, MockScenario, spawn_mock_gateway}; +use tokio::sync::mpsc; +use tokio_util::sync::CancellationToken; + +async fn login(base_url: &str) -> String { + let response = reqwest::Client::new() + .post(format!("{base_url}/desktop/v1/auth/login")) + .json(&AuthLoginRequest { + client_id: "integration-client".into(), + device_id: "integration-device".into(), + credential: "fixture-only-not-a-real-secret".into(), + capabilities: ClientCapabilities { + protocol_version: PROTOCOL_VERSION.into(), + app_version: "0.1.0-alpha.0".into(), + platform: "windows".into(), + features: vec!["sse".into()], + }, + }) + .send() + .await + .expect("login request") + .error_for_status() + .expect("login status") + .json::() + .await + .expect("login response"); + + response.access_token +} + +fn heartbeat(event_id: &str, server_instance_id: &str) -> GatewayEvent { + GatewayEvent::new( + EventMetadata::new(event_id, server_instance_id, "2026-07-18T00:00:00Z", 1), + GatewayEventBody::Heartbeat(HeartbeatPayload { interval_ms: 1_000 }), + ) +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn dual_sse_streams_bind_local_profiles_and_isolate_deduplication() { + let companion = spawn_mock_gateway(MockGatewayConfig::for_test(MockInstanceKind::Companion)) + .await + .expect("companion mock"); + let operations = spawn_mock_gateway(MockGatewayConfig::for_test(MockInstanceKind::Operations)) + .await + .expect("operations mock"); + + let companion_client = Arc::new( + GatewayClient::new(GatewayClientConfig { + profile_id: "profile-companion".into(), + slot: SlotKind::Companion, + base_url: companion.base_url(), + expected_server_instance_id: companion.server_instance_id().into(), + bearer_token: Some(login(&companion.base_url()).await.into()), + }) + .expect("companion client"), + ); + let operations_client = Arc::new( + GatewayClient::new(GatewayClientConfig { + profile_id: "profile-operations".into(), + slot: SlotKind::Operations, + base_url: operations.base_url(), + expected_server_instance_id: operations.server_instance_id().into(), + bearer_token: Some(login(&operations.base_url()).await.into()), + }) + .expect("operations client"), + ); + + let (sender, mut receiver) = mpsc::channel(16); + let companion_cancel = CancellationToken::new(); + let operations_cancel = CancellationToken::new(); + + let companion_task = { + let client = companion_client.clone(); + let sender = sender.clone(); + let cancellation = companion_cancel.clone(); + tokio::spawn(async move { client.stream_once(None, &sender, &cancellation).await }) + }; + let operations_task = { + let client = operations_client.clone(); + let sender = sender.clone(); + let cancellation = operations_cancel.clone(); + tokio::spawn(async move { client.stream_once(None, &sender, &cancellation).await }) + }; + drop(sender); + + tokio::time::sleep(Duration::from_millis(100)).await; + + let shared_id = "shared-event-id"; + let companion_event = heartbeat(shared_id, companion.server_instance_id()); + let operations_event = heartbeat(shared_id, operations.server_instance_id()); + companion + .emit_event(companion_event.clone()) + .await + .expect("emit companion"); + operations + .emit_event(operations_event) + .await + .expect("emit operations"); + + let first = tokio::time::timeout(Duration::from_secs(3), receiver.recv()) + .await + .expect("first timeout") + .expect("first event"); + let second = tokio::time::timeout(Duration::from_secs(3), receiver.recv()) + .await + .expect("second timeout") + .expect("second event"); + + let bindings = HashSet::from([ + (first.profile_id.as_str(), first.slot), + (second.profile_id.as_str(), second.slot), + ]); + assert!(bindings.contains(&("profile-companion", SlotKind::Companion))); + assert!(bindings.contains(&("profile-operations", SlotKind::Operations))); + assert_eq!(first.event_id, shared_id); + assert_eq!(second.event_id, shared_id); + + companion + .emit_event(companion_event) + .await + .expect("replay duplicate"); + operations + .emit_event(heartbeat( + "operations-after-companion-duplicate", + operations.server_instance_id(), + )) + .await + .expect("emit operations follow-up"); + + let follow_up = tokio::time::timeout(Duration::from_secs(3), receiver.recv()) + .await + .expect("follow-up timeout") + .expect("follow-up event"); + assert_eq!(follow_up.profile_id, "profile-operations"); + assert_eq!(follow_up.event_id, "operations-after-companion-duplicate"); + + companion.disconnect_streams(); + operations_cancel.cancel(); + companion_cancel.cancel(); + + companion_task + .await + .expect("companion task") + .expect("companion stream"); + operations_task + .await + .expect("operations task") + .expect("operations stream"); + companion.shutdown().await.expect("companion shutdown"); + operations.shutdown().await.expect("operations shutdown"); +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn reconnects_one_slot_without_interrupting_the_other() { + let mut companion_config = MockGatewayConfig::for_test(MockInstanceKind::Companion); + companion_config.scenario = MockScenario::DisconnectOnce; + companion_config.heartbeat_interval = Some(Duration::from_millis(50)); + let mut operations_config = MockGatewayConfig::for_test(MockInstanceKind::Operations); + operations_config.heartbeat_interval = Some(Duration::from_millis(50)); + + let companion = spawn_mock_gateway(companion_config) + .await + .expect("companion reconnect mock"); + let operations = spawn_mock_gateway(operations_config) + .await + .expect("operations steady mock"); + + let companion_client = Arc::new( + GatewayClient::new(GatewayClientConfig { + profile_id: "profile-companion-reconnect".into(), + slot: SlotKind::Companion, + base_url: companion.base_url(), + expected_server_instance_id: companion.server_instance_id().into(), + bearer_token: Some(login(&companion.base_url()).await.into()), + }) + .expect("companion reconnect client"), + ); + let operations_client = Arc::new( + GatewayClient::new(GatewayClientConfig { + profile_id: "profile-operations-steady".into(), + slot: SlotKind::Operations, + base_url: operations.base_url(), + expected_server_instance_id: operations.server_instance_id().into(), + bearer_token: Some(login(&operations.base_url()).await.into()), + }) + .expect("operations steady client"), + ); + + let (sender, mut receiver) = mpsc::channel(64); + let companion_cancel = CancellationToken::new(); + let operations_cancel = CancellationToken::new(); + + let companion_task = { + let client = companion_client.clone(); + let sender = sender.clone(); + let cancellation = companion_cancel.clone(); + tokio::spawn(async move { client.run_reconnecting(&sender, &cancellation).await }) + }; + let operations_task = { + let client = operations_client.clone(); + let sender = sender.clone(); + let cancellation = operations_cancel.clone(); + tokio::spawn(async move { client.run_reconnecting(&sender, &cancellation).await }) + }; + drop(sender); + + let (companion_events, operations_events) = + tokio::time::timeout(Duration::from_secs(5), async { + let mut companion_events = 0_usize; + let mut operations_events = 0_usize; + while companion_events < 8 || operations_events < 8 { + let event = receiver.recv().await.expect("reconnect event channel"); + match event.profile_id.as_str() { + "profile-companion-reconnect" => companion_events += 1, + "profile-operations-steady" => operations_events += 1, + unexpected => panic!("unexpected local profile binding: {unexpected}"), + } + } + (companion_events, operations_events) + }) + .await + .expect("both slots continue after one disconnect"); + + assert!(companion_events >= 8); + assert!(operations_events >= 8); + + companion_cancel.cancel(); + operations_cancel.cancel(); + companion_task + .await + .expect("companion reconnect task") + .expect("companion reconnect result"); + operations_task + .await + .expect("operations steady task") + .expect("operations steady result"); + assert_eq!( + *companion_client.state_receiver().borrow(), + ConnectionState::Disconnected + ); + assert_eq!( + *operations_client.state_receiver().borrow(), + ConnectionState::Disconnected + ); + + companion.shutdown().await.expect("companion shutdown"); + operations.shutdown().await.expect("operations shutdown"); +} diff --git a/src-tauri/tests/windows_dialog_smoke.rs b/src-tauri/tests/windows_dialog_smoke.rs new file mode 100644 index 0000000..e90d747 --- /dev/null +++ b/src-tauri/tests/windows_dialog_smoke.rs @@ -0,0 +1,99 @@ +#![cfg(windows)] + +use std::{thread, time::Duration}; + +use astrbot_desktop_lib::windows::{ + capture::{CaptureLimits, WindowCaptureError, capture_selected_window}, + foreground_window::{ForegroundWindowError, inspect_foreground_window}, + uia::{UiaReadLimits, read_standard_dialog_text}, +}; +use windows::{ + Win32::{ + Foundation::{HWND, LPARAM, WPARAM}, + UI::WindowsAndMessaging::{ + FindWindowW, GetForegroundWindow, MB_OK, MessageBoxW, PostMessageW, + SetForegroundWindow, WM_CLOSE, + }, + }, + core::w, +}; + +const TEST_TITLE: &str = "AstrBot Desktop P00 Safe Provider Test"; +const TEST_BODY: &str = "Known non-sensitive UI Automation fixture text."; + +struct DialogGuard(HWND); + +impl Drop for DialogGuard { + fn drop(&mut self) { + unsafe { + let _ = PostMessageW(Some(self.0), WM_CLOSE, WPARAM(0), LPARAM(0)); + } + } +} + +fn wait_for_test_dialog() -> HWND { + for _ in 0..100 { + if let Ok(window) = + unsafe { FindWindowW(w!("#32770"), w!("AstrBot Desktop P00 Safe Provider Test")) } + && !window.0.is_null() + { + return window; + } + thread::sleep(Duration::from_millis(50)); + } + panic!("the controlled test dialog did not appear"); +} + +#[test] +#[ignore = "opens a controlled, non-sensitive Windows dialog for native provider validation"] +fn reads_and_captures_only_the_controlled_standard_dialog() { + let dialog_thread = thread::spawn(|| unsafe { + let _ = MessageBoxW( + None, + w!("Known non-sensitive UI Automation fixture text."), + w!("AstrBot Desktop P00 Safe Provider Test"), + MB_OK, + ); + }); + + let window = wait_for_test_dialog(); + let guard = DialogGuard(window); + assert!(unsafe { SetForegroundWindow(window) }.as_bool()); + + for _ in 0..40 { + if unsafe { GetForegroundWindow() } == window { + break; + } + thread::sleep(Duration::from_millis(50)); + } + assert_eq!(unsafe { GetForegroundWindow() }, window); + + let selection = inspect_foreground_window(Duration::from_secs(30)) + .expect("select the controlled foreground dialog"); + assert_eq!(selection.summary().title, TEST_TITLE); + assert_eq!(selection.summary().process_id, std::process::id()); + + let text = read_standard_dialog_text(&selection, UiaReadLimits::default()) + .expect("read the controlled dialog through UI Automation"); + assert!(text.text.contains(TEST_TITLE)); + assert!(text.text.contains(TEST_BODY)); + assert_eq!(text.password_nodes_skipped, 0); + + let capture = capture_selected_window(&selection, CaptureLimits::default()) + .expect("capture the explicitly selected controlled dialog"); + assert!(capture.width > 0); + assert!(capture.height > 0); + assert_eq!(&capture.png_bytes[..8], b"\x89PNG\r\n\x1a\n"); + + drop(guard); + dialog_thread.join().expect("close the controlled dialog"); + + assert_eq!( + selection.validate(), + Err(ForegroundWindowError::WindowChanged) + ); + assert_eq!( + capture_selected_window(&selection, CaptureLimits::default()).unwrap_err(), + WindowCaptureError::Selection(ForegroundWindowError::WindowChanged) + ); +} diff --git a/src/App.test.tsx b/src/App.test.tsx new file mode 100644 index 0000000..8830a1f --- /dev/null +++ b/src/App.test.tsx @@ -0,0 +1,27 @@ +import { invoke } from "@tauri-apps/api/core"; +import { render, screen } from "@testing-library/react"; +import { beforeEach, describe, expect, it, vi } from "vitest"; + +import { App } from "./App"; + +vi.mock("@tauri-apps/api/core", () => ({ + invoke: vi.fn(), +})); + +describe("App", () => { + beforeEach(() => { + vi.mocked(invoke).mockResolvedValue({ + appVersion: "0.1.0-alpha.0", + platform: "windows", + rustCore: "ready", + protocolVersion: "desktop-v1alpha1", + }); + }); + + it("renders the verified Rust bootstrap status", async () => { + render(); + + expect(await screen.findByText("ready")).toBeInTheDocument(); + expect(screen.getByText("desktop-v1alpha1")).toBeInTheDocument(); + }); +}); diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..e9ecf5d --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,79 @@ +import { invoke } from "@tauri-apps/api/core"; +import { useCallback, useEffect, useState } from "react"; + +import type { BootstrapStatus } from "./types/bootstrap"; + +const initialStatus: BootstrapStatus = { + appVersion: "unknown", + platform: "unknown", + rustCore: "pending", + protocolVersion: "desktop-v1alpha1", +}; + +export function App() { + const [status, setStatus] = useState(initialStatus); + const [error, setError] = useState(null); + + const refreshStatus = useCallback(async () => { + try { + const result = await invoke("bootstrap_status"); + setStatus(result); + setError(null); + } catch (reason) { + setError(reason instanceof Error ? reason.message : String(reason)); + } + }, []); + + useEffect(() => { + void refreshStatus(); + }, [refreshStatus]); + + return ( +
+
+

P00 · bootstrap

+

AstrBot Desktop

+

+ 双实例陪伴与本机助手的安全 Windows 客户端工程底座。 +

+
+ +
+ + + + +
+ + {error ?

IPC unavailable: {error}

: null} + +
+

安全边界

+
    +
  • 凭据只在 Rust 与 Windows 安全存储之间流动。
  • +
  • 两个 REST/SSE 槽位保持独立状态与事件来源。
  • +
  • 本机操作必须经过白名单、策略与用户授权。
  • +
  • 文件事务默认保留源文件,且不会静默覆盖。
  • +
+
+ + +
+ ); +} + +interface StatusCardProps { + label: string; + value: string; +} + +function StatusCard({ label, value }: StatusCardProps) { + return ( +
+ {label} + {value} +
+ ); +} diff --git a/src/main.tsx b/src/main.tsx new file mode 100644 index 0000000..7118da5 --- /dev/null +++ b/src/main.tsx @@ -0,0 +1,17 @@ +import { StrictMode } from "react"; +import { createRoot } from "react-dom/client"; + +import { App } from "./App"; +import "./styles.css"; + +const rootElement = document.getElementById("root"); + +if (!rootElement) { + throw new Error("Root element was not found"); +} + +createRoot(rootElement).render( + + + , +); diff --git a/src/styles.css b/src/styles.css new file mode 100644 index 0000000..0e302e7 --- /dev/null +++ b/src/styles.css @@ -0,0 +1,156 @@ +:root { + font-family: + Inter, + ui-sans-serif, + system-ui, + -apple-system, + BlinkMacSystemFont, + "Segoe UI", + sans-serif; + color: #eef3ff; + background: #08111f; + font-synthesis: none; + text-rendering: optimizeLegibility; +} + +* { + box-sizing: border-box; +} + +body { + min-width: 320px; + min-height: 100vh; + margin: 0; + background: + radial-gradient( + circle at top left, + rgb(52 98 180 / 35%), + transparent 38rem + ), + #08111f; +} + +button { + padding: 0.8rem 1.1rem; + border: 1px solid #6aa3ff; + border-radius: 0.75rem; + color: #f7faff; + background: #173766; + cursor: pointer; +} + +button:hover { + background: #204b88; +} + +.app-shell { + width: min(920px, calc(100% - 2rem)); + margin: 0 auto; + padding: 4rem 0; +} + +.hero { + margin-bottom: 2rem; +} + +.eyebrow { + margin: 0; + color: #8db9ff; + font-weight: 700; + letter-spacing: 0.12em; + text-transform: uppercase; +} + +h1 { + margin: 0.4rem 0; + font-size: clamp(2.4rem, 8vw, 5rem); + line-height: 1; +} + +.subtitle { + max-width: 44rem; + color: #b9c8e4; + font-size: 1.1rem; +} + +.status-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); + gap: 1rem; +} + +.status-card, +.boundaries, +.error-banner { + border: 1px solid rgb(137 175 232 / 28%); + border-radius: 1rem; + background: rgb(13 29 52 / 78%); + box-shadow: 0 1rem 3rem rgb(0 0 0 / 18%); +} + +.status-card { + display: grid; + gap: 0.55rem; + padding: 1.2rem; +} + +.status-card span { + color: #9fb2d2; + font-size: 0.85rem; +} + +.status-card strong { + color: #f6f9ff; + overflow-wrap: anywhere; +} + +.boundaries { + margin: 1rem 0; + padding: 1.2rem 1.5rem; +} + +.boundaries h2 { + margin-top: 0; +} + +.boundaries li + li { + margin-top: 0.55rem; +} + +.error-banner { + padding: 1rem; + color: #ffd3d3; + border-color: rgb(255 115 115 / 45%); +} + +@media (prefers-color-scheme: light) { + :root { + color: #102039; + background: #eff5ff; + } + + body { + background: + radial-gradient( + circle at top left, + rgb(87 142 235 / 24%), + transparent 38rem + ), + #eff5ff; + } + + .status-card, + .boundaries, + .error-banner { + background: rgb(255 255 255 / 86%); + } + + .status-card strong { + color: #102039; + } + + .status-card span, + .subtitle { + color: #405775; + } +} diff --git a/src/test/setup.ts b/src/test/setup.ts new file mode 100644 index 0000000..f149f27 --- /dev/null +++ b/src/test/setup.ts @@ -0,0 +1 @@ +import "@testing-library/jest-dom/vitest"; diff --git a/src/types/bootstrap.ts b/src/types/bootstrap.ts new file mode 100644 index 0000000..6589e90 --- /dev/null +++ b/src/types/bootstrap.ts @@ -0,0 +1,6 @@ +export interface BootstrapStatus { + appVersion: string; + platform: string; + rustCore: "ready" | "pending"; + protocolVersion: string; +} diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..07fbcdc --- /dev/null +++ b/tests/README.md @@ -0,0 +1,107 @@ +# Test Strategy + +## Current status + +Local P00 frontend, Rust, browser, Tauri, Windows-native, installer, and 30-minute dual-SSE checks have recorded results. + +As of 2026-07-18: + +- Forgejo API/HTTP Git are reachable and the repository is verified empty; the configured SSH origin is not usable. +- Forgejo workflow execution and runner labels remain unverified. +- Rust 1.97.1, MSVC linking, Tauri development, release executable, and NSIS bundling are verified locally. +- No user-authorized UNC test directory has been supplied. + +Unexecuted or externally blocked items remain labeled below and are not counted as passes. + +## Test layers + +| Layer | Intended command or procedure | Platform | Current result | +| --------------------------------------------------- | --------------------------------------- | ---------------- | --------------------------------------------------------------- | +| Frontend format, lint, typecheck, unit tests, build | `pnpm check:frontend` | Windows or Linux | Passed | +| Browser smoke | `pnpm test:e2e` | Windows | Passed: 1 Chromium test | +| Rust formatting | `cargo fmt --all -- --check` | Rust host | Passed | +| Rust Clippy | `cargo clippy ... -- -D warnings` | Rust host | Passed | +| Rust unit and integration tests | `cargo test --workspace` | Rust host | Passed: 40 tests; 2 explicit manual tests ignored | +| Rust compile check | `cargo check --workspace --all-targets` | Rust host | Passed | +| Tauri development smoke | `pnpm tauri:dev` | Windows | Passed: window launched and remained responsive | +| Tauri NSIS production build | `pnpm tauri:build` | Windows | Passed: executable and NSIS installer | +| Forgejo portable CI | `.forgejo/workflows/ci.yml` | Linux runner | Not executed: runner/API availability unverified | +| Forgejo Windows build | `ENABLE_WINDOWS_TAURI_CI=true` | Windows runner | Disabled pending a verified runner | +| UNC transaction Spike | Authorized disposable UNC fixture | Windows plus NAS | Local fixture passed; real UNC blocked by missing authorization | + +## Automated coverage expectations + +### Protocol and dual Mock Gateway + +- Health, server-info, and capabilities endpoints for two mock instances. +- Authentication success and failure using fake credentials only. +- Concurrent A and B SSE streams. +- Rust-side local profile binding despite a conflicting remote profile_id. +- Independent connection state, cancellation, retry, and Last-Event-ID values. +- Duplicate event_id suppression. +- Disconnecting either mock without interrupting the other. +- Identical conversation_id and message_id values across profiles without data mixing. + +### Policy and redaction + +- Companion-slot local-tool proposals are rejected. +- Unknown tool names, expired requests, and wrong server identities are rejected. +- Path traversal, unauthorized UNC paths, and arbitrary absolute paths are rejected. +- Fake bearer tokens, passwords, cookies, API keys, URL credentials, and PEM material are redacted. +- Tests and snapshots never contain a real credential. + +### File transactions + +- Planning and dry-run do not mutate source or destination. +- Copy uses a temporary destination. +- Size and SHA-256 must match before final commit. +- ask, rename, and skip conflict policies never silently overwrite. +- Interruption or verification failure preserves the source. +- P00 never performs source cleanup. + +## Windows manual and integration matrix + +### Dual connection soak + +Run two loopback Mock Gateway instances for at least 30 minutes. Record event counts per profile, duplicates suppressed, reconnect attempts, final connection states, process CPU, and resident memory. Stop A and B separately and confirm the surviving stream continues. + +Status: passed after the shutdown-order fix. 1800.02 seconds, 1800 companion events, 1801 operations events, no cross-routing assertion. Final pre-exit sample: 1.38 CPU seconds, about 12.1 MiB working set, about 2.4 MiB private memory. + +Command: `cargo test -p mock-gateway --test soak -- --ignored --nocapture`. + +### Credential Manager + +Use a clearly named test-only credential. Verify create, read, update, and delete from Rust; verify only an opaque reference is persisted; scan application output and storage for the fake secret value; remove the test credential at the end. + +Status: passed with a generated fake secret; CRUD and cleanup verified. + +### UI Automation and window capture + +Use a standard non-elevated Windows dialog. Record structured UI Automation text when available. Verify a user-selected single-window capture fallback. Treat an elevated target as an expected access boundary; do not elevate the application or bypass Windows security. + +Status: controlled non-elevated standard dialog passed; elevated/custom-drawn manual boundary remains. + +### Event log and bounded diagnostics + +Query only an explicit provider, time range, and optional process identifier. Return a structured summary rather than unrelated log content. Verify foreground-window, process, port, network-target, authorized log-tail, configuration parser, and redaction error paths. + +Status: passed for bounded local and loopback fixtures. + +### UNC file transaction + +The user must explicitly identify a disposable source fixture and destination share. Generate unique test data, preserve the source, inject interruption only within the fixture, and never use an existing personal or production file. Record dry-run output, temporary copy, byte count, hash, final rename, conflict result, and recovery behavior. + +Status: local transaction/recovery tests passed; real UNC remains blocked until an authorized disposable fixture is supplied. + +## Result recording + +Every executed check must record: + +- Date and environment. +- Exact command or bounded manual procedure. +- Exit code or observed result. +- Sanitized log summary. +- Known limitations. +- Whether the result blocks MVP. + +An unexecuted, skipped, or blocked item must retain that label. A configured workflow or test is not evidence that it passed. diff --git a/tests/e2e/bootstrap.spec.ts b/tests/e2e/bootstrap.spec.ts new file mode 100644 index 0000000..9204191 --- /dev/null +++ b/tests/e2e/bootstrap.spec.ts @@ -0,0 +1,16 @@ +import { expect, test } from "@playwright/test"; + +test("renders the bootstrap shell and safe browser fallback", async ({ + page, +}) => { + await page.goto("/"); + + await expect( + page.getByRole("heading", { name: "AstrBot Desktop" }), + ).toBeVisible(); + await expect(page.getByText("desktop-v1alpha1")).toBeVisible(); + await expect( + page.getByText("IPC unavailable:", { exact: false }), + ).toBeVisible(); + await expect(page.getByRole("button")).toBeEnabled(); +}); diff --git a/tsconfig.app.json b/tsconfig.app.json new file mode 100644 index 0000000..b632c25 --- /dev/null +++ b/tsconfig.app.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2022", + "useDefineForClassFields": true, + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "allowJs": false, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "types": ["vitest/globals", "@testing-library/jest-dom"] + }, + "include": ["src"] +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..1ffef60 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 0000000..3b9bfb6 --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "ES2023", + "lib": ["ES2023"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "strict": true + }, + "include": [ + "vite.config.ts", + "playwright.config.ts", + "tests/e2e/**/*.ts", + "eslint.config.js" + ] +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..329e750 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,33 @@ +import { configDefaults, defineConfig } from "vitest/config"; +import react from "@vitejs/plugin-react"; + +const host = process.env.TAURI_DEV_HOST; + +export default defineConfig({ + plugins: [react()], + clearScreen: false, + server: { + host: host ?? "127.0.0.1", + port: 1420, + strictPort: true, + hmr: host + ? { + protocol: "ws", + host, + port: 1421, + } + : undefined, + watch: { + ignored: ["**/src-tauri/**", "**/target/**"], + usePolling: true, + interval: 500, + }, + }, + test: { + exclude: [...configDefaults.exclude, "tests/e2e/**"], + environment: "jsdom", + setupFiles: "./src/test/setup.ts", + restoreMocks: true, + clearMocks: true, + }, +});