diff --git a/.agent/skills/repository-orientation/SKILL.md b/.agent/skills/repository-orientation/SKILL.md
index 3b48062..4917108 100644
--- a/.agent/skills/repository-orientation/SKILL.md
+++ b/.agent/skills/repository-orientation/SKILL.md
@@ -22,18 +22,30 @@ src/styles/app.css global/component CSS
src-tauri/src/models.rs Rust domain models
src-tauri/src/validation.rs input normalization/validation
src-tauri/src/storage.rs JSON config/state storage
+src-tauri/src/migration.rs versioned storage adoption/migration
src-tauri/src/activity.rs activity log
src-tauri/src/subscription.rs subscription fetch/parse
-src-tauri/src/component_detection.rs component status detection
+src-tauri/src/component_catalog.rs pinned offline package catalog
+src-tauri/src/component_inventory.rs exact native SCM/process/registry inventory
+src-tauri/src/component_detection.rs component status mapping
+src-tauri/src/component_packages.rs bundled/cache package plans
+src-tauri/src/component_cutover.rs durable legacy cutover/rollback/cleanup
+src-tauri/src/privileged_jobs.rs sealed one-shot elevation records
+src-tauri/src/privileged_runtime.rs fixed native privileged actions
+src-tauri/src/proxifyre_runtime.rs native ProxiFyre lifecycle
+src-tauri/src/singbox_runtime.rs native sing-box lifecycle
src-tauri/src/adapters/* ProxiFyre/sing-box/proxy router adapters
src-tauri/src/commands.rs Tauri command layer, currently too large
src-tauri/tests/* Rust tests
-scripts/*.ps1 Windows install/control scripts
+scripts/*.ps1 build/release/QA tooling only
```
## Source of truth
- Persistent app config/state: `C:\ProgramData\ProxyWarden\config` and `state`.
+- `config\components.json` is legacy migration input only; live component truth comes from native inventory and verified receipts.
+- Current managed roots: `C:\Program Files\ProxyWarden\components\ProxiFyre` and `...\sing-box`.
+- Offline baseline: packaged component catalog; verified downloaded cache: `C:\ProgramData\ProxyWarden\packages`.
- Generated artifacts: `C:\ProgramData\ProxyWarden\generated`.
- Frontend state is not source of truth. It should represent backend state and pending UI edits.
- Component detection/runtime status should come from backend, not guessed in UI.
@@ -45,13 +57,17 @@ scripts/*.ps1 Windows install/control scripts
3. Inspect the relevant source files listed above.
4. Determine whether the change crosses the Tauri boundary. If yes, update both Rust DTO/command and TypeScript wrapper/types.
5. Determine whether the change touches secrets, service control, generated configs, process execution, filesystem deletion, or network fetch. If yes, apply security checklist.
-6. Prefer small, isolated changes over broad rewrites.
+6. If the change touches install/service/elevation, trace `privileged_jobs.rs`/`privileged_runtime.rs` and the native component runtime. Do not introduce PowerShell runtime fallback.
+7. If the change touches packaging or release tooling, run `scripts/check-runtime-powershell-boundary.ps1 -CheckOnly`.
+8. Prefer small, isolated changes over broad rewrites.
## Do not
- Do not treat `App.tsx` or `commands.rs` as the correct permanent architecture just because they currently contain lots of logic.
- Do not introduce a second storage system.
- Do not move service/install logic into frontend.
+- Do not treat legacy `components.json`, fuzzy paths, or service name alone as ownership proof.
+- Do not add `.ps1`, `powershell.exe`, `pwsh`, or generated script text to production Rust/Tauri/NSIS paths.
- Do not claim Windows service/elevation behavior is verified unless it was actually tested on Windows.
## Output expectations
diff --git a/.agent/skills/testing-ci-release/SKILL.md b/.agent/skills/testing-ci-release/SKILL.md
index 059d5e1..91fff9b 100644
--- a/.agent/skills/testing-ci-release/SKILL.md
+++ b/.agent/skills/testing-ci-release/SKILL.md
@@ -2,7 +2,7 @@
## Когда использовать
-Используй этот skill при добавлении CI, release scripts, build fixes, test changes, dependency updates, packaging changes или перед финальным отчетом по крупной задаче.
+Используй этот skill при изменениях CI, release scripts, tests, dependencies, Tauri/NSIS packaging, offline component catalog или перед финальным отчётом по крупной задаче.
## Minimal local checks
@@ -10,109 +10,84 @@ Frontend:
```powershell
npm ci
+npm run format:check
+npm run lint
+npm run typecheck
+npm test -- --run
npm run build
```
Rust:
```powershell
-cd src-tauri
+Push-Location src-tauri
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets
+Pop-Location
```
-Tauri:
+Tauri/build/release boundaries:
```powershell
npm run tauri -- info
-npm run tauri -- build
+& .\scripts\check-runtime-powershell-boundary.ps1 -CheckOnly
+& .\scripts\update-component-bundle.ps1 -PlanOnly
+& .\scripts\update-component-bundle.ps1 -CheckOnly
+& .\scripts\audit-windows-smoke.ps1 -Mode PlanOnly
+& .\scripts\prepare-release.ps1 -PlanOnly -SkipBuild
```
-PowerShell plan-only:
-
-```powershell
-& .\scripts\install-control-app.ps1 -PlanOnly
-& .\scripts\install-proxyfier.ps1 -PlanOnly
-& .\scripts\install-singbox.ps1 -PlanOnly
-```
+`PlanOnly`/`CheckOnly` должны возвращать structured JSON с `changed: false` и не менять repo, ProgramData, services или network state.
## Interaction smoke for UI motion
-Build, lint, and unit tests do not validate motion or pointer behavior. For any hover, disclosure, stagger, or hit-target change, verify:
+Build, lint и unit tests не проверяют motion/geometry. Для hover, disclosure, stagger или hit-target изменений проверь first/repeated/rapid toggle, keyboard focus, loading/long labels, `prefers-reduced-motion`, desktop и narrow window. Если visual smoke не выполнен, так и напиши.
-- first open and first close;
-- repeated and rapid toggle;
-- hover and click before, during, and after transition;
-- keyboard focus and hidden-control tab order;
-- loading and longest localized labels;
-- `prefers-reduced-motion`;
-- desktop and narrow window geometry.
+## CI contract
-Use a controlled mock or preview state when backend status is difficult to reproduce. If no visual interaction smoke is possible, report that evidence as missing and do not claim the motion task is complete.
+Windows baseline должен включать:
-## CI recommendation
+- frontend format/lint/typecheck/tests/build;
+- Rust fmt/clippy/all-target tests;
+- Tauri environment check;
+- runtime PowerShell boundary check;
+- offline bundle PlanOnly + CheckOnly;
+- Windows audit PlanOnly;
+- release preparation PlanOnly with build skipped.
-Add GitHub Actions with at least:
-
-- frontend build on Windows and Ubuntu if practical;
-- Rust fmt/clippy/test;
-- PowerShell syntax/plan-only smoke on Windows;
-- Tauri build on Windows for release branches/tags;
-- artifact upload only for trusted release workflow.
+CI не изображает реальную SCM/UAC/driver проверку. Artifact upload и tag/publish допустимы только в отдельном trusted release workflow после принятой VM evidence.
## Dependency updates
-When changing dependencies:
-
-- Update lockfiles.
-- Check Tauri v2 compatibility.
-- Avoid adding large UI/runtime dependencies for tiny tasks.
-- Avoid adding shell/process libraries that bypass existing backend boundaries.
-- Note why dependency is needed.
+- Обновить lockfiles.
+- Проверить Tauri v2 и Windows x64 compatibility.
+- Не добавлять dependency, если stdlib/native API или уже установленный crate решает задачу.
+- Не добавлять shell/process library, возвращающую production PowerShell path.
+- Объяснить, зачем dependency нужна и какой owner её вызывает.
## Release hygiene
-Before release:
+Перед release candidate:
-- Verify app version in `package.json` and Tauri config if applicable.
-- Verify icons/assets size.
-- Verify CSP and capabilities.
-- Verify no raw secrets/test URLs in repo.
-- Verify installer scripts with `-PlanOnly`.
-- Verify clean install on Windows VM.
-- Verify external SOCKS5 flow.
-- Verify local sing-box subscription flow.
-- Verify uninstall/safe cleanup behavior.
+- версии совпадают в `package.json`, `package-lock.json`, `src-tauri/tauri.conf.json` и `src-tauri/Cargo.toml`;
+- packaged component catalog, asset hashes, licenses и `THIRD_PARTY_NOTICES.md` согласованы;
+- installer содержит consolidated offline component bundle и WebView2 Offline Installer;
+- runtime PowerShell checker проходит, bundled cleanup script отсутствует;
+- NSIS hook разделяет verify-only upgrade и full managed uninstall;
+- fresh offline VM, legacy upgrade/rollback, foreign service refusal, UAC cancel, uninstall/reboot и реальные routing flows записаны в evidence;
+- tag/publish выполняются только для того же проверенного commit.
-## Final report format
+Установка Control App не должна скрыто install/start/update routing-компоненты. Payloads могут быть в installer, но component mutation остаётся отдельным user action.
-```text
-Changed:
-- ...
+## Финальный отчёт
-Verified:
-- npm run build
-- cargo test
+Разделить:
-Not verified:
-- Windows elevated install/uninstall, because ...
+- `Проверено`: точные команды и результаты;
+- `Не проверено`: Windows VM/UAC/SCM/driver/installer gaps;
+- `Риски`: только конкретные release blockers.
-Risks:
-- ...
-```
+Не писать «все тесты проходят», если весь релевантный набор действительно не запускался.
-Do not write “all tests pass” unless all listed relevant tests actually ran. Humanity has enough fictional dashboards.
-
-## Как отчитываться
-
-Перед финальным ответом применить `.agent/skills/communication-reporting/SKILL.md` и `.agent/checklists/communication.md`.
-
-Минимум для нетривиальной задачи:
-
-- короткая сводка;
-- таблица файлов `Файл / Что изменилось / Зачем`;
-- важные места без пересказа каждой строки;
-- что проверено;
-- что не проверено;
-- конкретные риски.
+Перед ответом применить `.agent/skills/communication-reporting/SKILL.md` и `.agent/checklists/communication.md`.
diff --git a/.agent/skills/windows-services-powershell/SKILL.md b/.agent/skills/windows-services-powershell/SKILL.md
index 42bbe77..4c58a76 100644
--- a/.agent/skills/windows-services-powershell/SKILL.md
+++ b/.agent/skills/windows-services-powershell/SKILL.md
@@ -2,93 +2,73 @@
## Когда использовать
-Используй этот skill при изменениях в `scripts/*.ps1`, ProxiFyre install/start/stop/uninstall, sing-box service control, UAC/admin checks, helper/elevation boundary, component detection.
+Используй этот skill при изменениях ProxiFyre/sing-box install/start/stop/update/uninstall, UAC/admin boundary, native inventory, NSIS upgrade/uninstall или build/release/QA PowerShell scripts.
## Цель
-Сохранять service/install operations явными, безопасными и проверяемыми. Пользователь должен понимать, что приложение собирается менять в системе. Компьютер пользователя — не песочница для творческих экспериментов агента, как ни печально.
+Сохранять системные операции явными, native и проверяемыми. Production runtime не зависит от PowerShell; Rust владеет Windows SCM, registry, process, filesystem, package verification и UAC flow.
-## Инварианты
+## Runtime-инварианты
-- Install/start/stop/uninstall are explicit user actions.
-- `apply` must not silently install/uninstall/start/stop components unless that behavior is clearly designed and surfaced.
-- `-PlanOnly` scripts must be side-effect-free.
-- PowerShell output intended for UI/backend must be structured JSON.
-- Service detection must distinguish managed service from fuzzy candidate.
-- Never relax safe-path checks to make uninstall easier.
+- Install/start/stop/update/uninstall/migrate — только явные действия пользователя.
+- `apply` не устанавливает, не обновляет, не переносит и не удаляет компоненты.
+- Current managed roots — только `C:\Program Files\ProxyWarden\components\ProxiFyre` и `...\sing-box`.
+- Service control требует exact `PathName`, marker/receipt, canonical path и non-reparse checks. Имя службы или fuzzy candidate недостаточны.
+- Elevated UI action передаёт только UUID sealed job record; fixed early mode сам повторно проверяет ACL, TTL, action, paths, hashes и ownership.
+- NSIS использует только exact `--nsis-verify-upgrade` и `--nsis-uninstall-managed`; никаких user/path/script arguments.
+- Active/recovery/pending cutover journal блокирует upgrade/uninstall и не удаляется общим cleanup.
+- Runtime-generated scripts и запуск `powershell.exe`/`pwsh` запрещены.
-## Script rules
+## PowerShell allowlist
-PowerShell scripts should:
+PowerShell остаётся только для build/release/QA:
-- use `Set-StrictMode -Version Latest` where practical;
-- set `$ErrorActionPreference = 'Stop'`;
-- return structured JSON for plan/status paths;
-- avoid localized text parsing for control flow;
-- avoid writing secrets to host output;
-- have clear exit codes;
-- support `-PlanOnly` for dry-run/status checks;
-- avoid downloading/executing arbitrary remote scripts.
+- `scripts/check-runtime-powershell-boundary.ps1`;
+- `scripts/update-component-bundle.ps1`;
+- `scripts/prepare-release.ps1`;
+- `scripts/audit-windows-smoke.ps1`.
-## Elevation rules
+`PlanOnly`/`CheckOnly` должны быть side-effect-free и возвращать structured JSON с `changed: false`. Любой новый `.ps1`, `.psm1`, `.psd1`, production caller или bundled cleanup resource должен ломать boundary checker.
-When launching elevated PowerShell:
+## Native service flow
-- keep command fixed and parameters escaped;
-- avoid user-controlled script text;
-- avoid predictable temp script names;
-- do not pass secrets via command line;
-- verify script path before launch;
-- clean up temp artifacts best-effort;
-- return clear error if user cancels UAC.
+1. Получить inventory через Windows API и canonicalize все пути.
+2. Классифицировать `Missing / Managed / Foreign / Incomplete` до первой mutation.
+3. Проверить marker/receipt, service `PathName`, file identity, ACL и reparse boundary.
+4. Захватить общий lifecycle lock.
+5. Выполнить только allowlisted fixed action.
+6. Query-back подтвердить service/path/start policy/state.
+7. При ошибке оставить durable recovery state; не угадывать cleanup.
-## Service detection
+Для uninstall сначала preflight всех компонентов. `Missing` — no-op; `Foreign`/`Incomplete` — zero mutation. Running service сначала останавливается и проверяется, затем удаляется. MSI code `3010` означает success with reboot required, а не обычную ошибку.
-Preferred approach:
+## Удаление файлов
-1. Search known managed service names first.
-2. Read service `PathName` through WMI/CIM.
-3. Verify binary path and managed install metadata.
-4. Only then mark as managed/controllable.
-5. Fuzzy matches should be shown as candidates, not automatically controlled.
+- Не использовать generic recursive delete по app root.
+- Удалять только exact receipt/journal-owned entries после safe-path, ACL, reparse и file-shape checks.
+- `.proxywarden-cutover` и `.proxywarden-quarantine` удаляет только owner terminal retirement после проверки journal state.
+- Unexpected files, active jobs, process/service references или partial tombstone блокируют cleanup.
-## Testing
+## Проверка
-Pure logic can be tested cross-platform with mocks.
-
-Real verification requires Windows:
+Cross-platform/pure logic:
```powershell
-& .\scripts\install-control-app.ps1 -PlanOnly
-& .\scripts\install-proxyfier.ps1 -PlanOnly
-& .\scripts\install-singbox.ps1 -PlanOnly
-npm run tauri -- dev
+Push-Location src-tauri
+cargo fmt --all -- --check
+cargo clippy --all-targets --all-features -- -D warnings
+cargo test --all-targets
+Pop-Location
+
+& .\scripts\check-runtime-powershell-boundary.ps1 -CheckOnly
+& .\scripts\update-component-bundle.ps1 -CheckOnly
+& .\scripts\audit-windows-smoke.ps1 -Mode PlanOnly
```
-For real service tests:
+Реальная проверка требует Windows 10/11 x64 VM: UAC cancel/success, SCM create/start/stop/delete, driver/VC installer exit codes, fresh offline install, foreign same-name service refusal, legacy rollback/recovery и NSIS upgrade/uninstall/reboot.
-- Windows 10/11.
-- Admin/UAC path.
-- Fresh machine or VM snapshot.
-- Existing ProxiFyre/sing-box absent.
-- Existing fuzzy ProxiFyre-like service present, if testing safety.
-
-## Do not
-
-- Do not claim actual service operations were tested unless they were run on Windows.
-- Do not parse human-localized `sc.exe` output if structured WMI/CIM data is available.
-- Do not delete paths from fuzzy discovery alone.
-- Do not make scripts silently modify firewall/proxy/system settings outside their stated purpose.
+Не называть service/elevation behavior проверенным без этой VM evidence.
## Как отчитываться
-Перед финальным ответом применить `.agent/skills/communication-reporting/SKILL.md` и `.agent/checklists/communication.md`.
-
-Минимум для нетривиальной задачи:
-
-- короткая сводка;
-- таблица файлов `Файл / Что изменилось / Зачем`;
-- важные места без пересказа каждой строки;
-- что проверено;
-- что не проверено;
-- конкретные риски.
+Перед финальным ответом применить `.agent/skills/communication-reporting/SKILL.md` и `.agent/checklists/communication.md`. Отдельно перечислить automated evidence, Windows/manual evidence и незакрытые UAC/SCM/driver риски.
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 6615479..fb64b84 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -49,6 +49,10 @@ jobs:
working-directory: src-tauri
run: cargo clippy --all-targets --all-features -- -D warnings
+ - name: Test component catalog contract
+ working-directory: src-tauri
+ run: cargo test --test component_catalog_tests
+
- name: Run Rust tests
working-directory: src-tauri
run: cargo test --all-targets
@@ -56,18 +60,25 @@ jobs:
- name: Check Tauri environment
run: npm run tauri -- info
- - name: Plan control app installer
+ - name: Check runtime PowerShell boundary
shell: pwsh
- run: .\scripts\install-control-app.ps1 -PlanOnly
+ run: .\scripts\check-runtime-powershell-boundary.ps1 -CheckOnly
- - name: Plan ProxiFyre installer
+ - name: Plan component bundle update
shell: pwsh
- run: .\scripts\install-proxyfier.ps1 -PlanOnly
+ run: .\scripts\update-component-bundle.ps1 -PlanOnly
- - name: Plan sing-box installer
+ - name: Check component bundle
shell: pwsh
- run: .\scripts\install-singbox.ps1 -PlanOnly
+ run: .\scripts\update-component-bundle.ps1 -CheckOnly
- name: Plan Windows smoke evidence capture
shell: pwsh
run: .\scripts\audit-windows-smoke.ps1 -Mode PlanOnly
+
+ - name: Plan release preparation
+ shell: pwsh
+ run: .\scripts\prepare-release.ps1 -PlanOnly -SkipBuild
+
+ - name: Test release workflow with local Git remotes
+ run: node --test scripts/prepare-release.check.mjs
diff --git a/.gitignore b/.gitignore
index 26e00b6..eba3b37 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
node_modules/
+.pnpm-store/
+*.tsbuildinfo
dist/
releases/
src-tauri/target/
diff --git a/AGENTS.md b/AGENTS.md
index cf509aa..3c5831c 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -2,7 +2,7 @@
## Назначение
-ProxyWarden — standalone Windows desktop-приложение для удобного per-app proxy routing. Стек: Tauri 2, Rust backend, React/TypeScript frontend, Vite, PowerShell installer/control scripts. Приложение управляет выбранными Windows-приложениями через ProxiFyre и, опционально, через локальный sing-box runtime.
+ProxyWarden — standalone Windows desktop-приложение для удобного per-app proxy routing. Стек: Tauri 2, Rust backend, React/TypeScript frontend и Vite. Production install/service/UAC runtime реализован в Rust; PowerShell остаётся только build/release/QA tooling. Приложение управляет выбранными Windows-приложениями через ProxiFyre и, опционально, через локальный sing-box runtime.
Этот файл — главный контракт для кодового агента. Любой агент, который меняет репозиторий, обязан соблюдать эти правила. Да, даже если ему очень хочется «быстренько поправить одну кнопочку» и случайно переписать половину сетевого стека. Особенно тогда.
@@ -21,6 +21,9 @@ ProxyWarden — standalone Windows desktop-приложение для удоб
- `src/api/tauriCommands.ts` — единственная TypeScript-обертка над `invoke(...)`.
- Rust backend отвечает за storage, validation, config generation, component detection, service/install orchestration и structured errors.
- `C:\ProgramData\ProxyWarden\config` и `C:\ProgramData\ProxyWarden\state` — source of truth.
+- `C:\Program Files\ProxyWarden\components\ProxiFyre` и `C:\Program Files\ProxyWarden\components\sing-box` — единственные current managed component roots.
+- `config\components.json` — только legacy migration input. Реальный component status принадлежит native Windows inventory и проверенным receipts.
+- Packaged component catalog — immutable offline baseline; проверенный download cache лежит отдельно в `C:\ProgramData\ProxyWarden\packages`.
- `C:\ProgramData\ProxyWarden\generated\proxifyre-app-config.json` и `sing-box-config.json` — derived artifacts. Их можно пересоздавать.
- Install/start/stop/uninstall — только явные действия пользователя. `apply` не должен скрыто устанавливать, удалять или «чинить» компоненты.
- Subscription URL, credentials, proxy passwords и userinfo нельзя выводить полностью в UI, logs, diagnostics, crash text или activity.
@@ -47,18 +50,25 @@ src-tauri/
src/storage.rs # JSON storage, tmp/bak writes
src/activity.rs # activity log
src/subscription.rs # subscription fetch/parse
- src/component_detection.rs # ProxiFyre/sing-box detection
- src/singbox_service.rs # sing-box Windows service logic
- src/process.rs # process/system helpers
- src/helper.rs # helper/elevation boundary
+ src/component_catalog.rs # pinned offline component catalog
+ src/component_inventory.rs # exact native SCM/process/registry inventory
+ src/component_packages.rs # verified bundled/cache package plans
+ src/component_cutover.rs # durable legacy cutover/rollback/cleanup
+ src/migration.rs # versioned storage migration/adoption
+ src/privileged_jobs.rs # sealed one-shot elevated job records
+ src/privileged_runtime.rs # fixed native elevated action dispatcher
+ src/proxifyre_runtime.rs # native ProxiFyre lifecycle
+ src/singbox_runtime.rs # native sing-box lifecycle
+ src/singbox_service.rs # WinSW service spec/status logic
+ src/safe_fs.rs # safe path/ACL/reparse helpers
src/adapters/* # ProxiFyre/sing-box/proxy-router adapters
src/commands.rs # Tauri command handlers; currently too large
tests/* # Rust integration/domain tests
scripts/
- install-control-app.ps1
- install-proxyfier.ps1
- install-singbox.ps1
+ check-runtime-powershell-boundary.ps1
+ update-component-bundle.ps1
+ audit-windows-smoke.ps1
prepare-release.ps1
```
@@ -150,13 +160,16 @@ scripts/
- Не отключать CSP. Если CSP мешает, исправлять source policy, а не ставить `csp: null`.
- Не добавлять Tauri shell permissions без жесткого scope и отдельного обоснования.
- Не запускать произвольные команды из UI input.
-- Runtime-generated elevated scripts должны использовать непредсказуемые имена, safe directory/ACL и cleanup best-effort.
+- Runtime-generated elevated scripts запрещены. Elevation использует current exe, fixed early modes и sealed typed job records без arbitrary command/path arguments.
- Удаление директорий допускается только после safe-path/marker/service-path checks.
- Subscription fetch должен иметь timeout и защиту от очевидно опасных/local metadata адресов либо explicit allow-mode.
### Windows/service boundary
-- `-PlanOnly` у PowerShell scripts должен оставаться side-effect-free и возвращать structured JSON.
+- PowerShell разрешён только в build/release/QA allowlist: `check-runtime-powershell-boundary.ps1`, `update-component-bundle.ps1`, `audit-windows-smoke.ps1`, `prepare-release.ps1`.
+- `PlanOnly`/`CheckOnly` у этих scripts должны быть side-effect-free, возвращать structured JSON и иметь `changed: false`.
+- Production Rust, Tauri resources и NSIS hooks не должны запускать `powershell.exe`, `pwsh`, `.ps1` или generated script text.
+- После изменения этой границы запускать `scripts/check-runtime-powershell-boundary.ps1 -CheckOnly`.
- Install/start/stop/uninstall должны быть явными user actions.
- Fuzzy-detected service не считать managed service без проверки `PathName`/metadata.
- В Linux/macOS CI не пытаться «проверить» Windows service operations как реальные. Тестировать pure logic/mocks.
@@ -165,12 +178,6 @@ scripts/
- `src-tauri/src/commands.rs` слишком большой. Главная цель рефакторинга: разрезать на модули по use-case.
- `src/app/App.tsx` слишком большой. Главная цель frontend-рефакторинга: hooks/components/view-model helpers.
-- `tauri.conf.json` сейчас требует security review, особенно CSP и window resize settings.
-- JSON storage молча возвращает default при invalid JSON. Нужен corruption recovery через `.bak` и user-visible warning.
-- ProxiFyre config apply должен стать atomic.
-- Subscription URL redaction должен исключать userinfo/password.
-- Link subscription parser сейчас ориентирован на VLESS; не обещать больше, чем реально поддерживается.
-- Ping/select по server tag может ломаться при duplicate tags. Нужен stable server id.
## Минимальная проверка перед ответом
@@ -200,12 +207,14 @@ npm run tauri -- dev
npm run tauri -- build
```
-Для installer boundaries:
+Для offline bundle/release boundaries:
```powershell
-& .\scripts\install-control-app.ps1 -PlanOnly
-& .\scripts\install-proxyfier.ps1 -PlanOnly
-& .\scripts\install-singbox.ps1 -PlanOnly
+& .\scripts\check-runtime-powershell-boundary.ps1 -CheckOnly
+& .\scripts\update-component-bundle.ps1 -PlanOnly
+& .\scripts\update-component-bundle.ps1 -CheckOnly
+& .\scripts\audit-windows-smoke.ps1 -Mode PlanOnly
+& .\scripts\prepare-release.ps1 -PlanOnly -SkipBuild
```
Не оставлять dev/preview/Tauri dev servers запущенными после проверки.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8f20688..97d9857 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -19,10 +19,11 @@ cargo test --all-targets
Pop-Location
npm run tauri -- info
-& .\scripts\install-control-app.ps1 -PlanOnly
-& .\scripts\install-proxyfier.ps1 -PlanOnly
-& .\scripts\install-singbox.ps1 -PlanOnly
+& .\scripts\check-runtime-powershell-boundary.ps1 -CheckOnly
+& .\scripts\update-component-bundle.ps1 -PlanOnly
+& .\scripts\update-component-bundle.ps1 -CheckOnly
& .\scripts\audit-windows-smoke.ps1 -Mode PlanOnly
+& .\scripts\prepare-release.ps1 -PlanOnly -SkipBuild
```
Windows service, UAC, installer и реальный routing нельзя считать проверенными только по unit-тестам. Для таких изменений укажите выполненный ручной сценарий или явно оставьте этот пробел в отчете.
@@ -32,6 +33,8 @@ Windows service, UAC, installer и реальный routing нельзя счи
- Держите `src/api/tauriCommands.ts` единственным TypeScript facade над Tauri `invoke`.
- Не показывайте subscription URL, credentials, proxy password или `X-HWID` в логах и UI.
- Не добавляйте скрытые install/start/stop/uninstall действия в apply.
+- Не добавляйте PowerShell, `.ps1` resources или generated scripts в production runtime. PowerShell разрешён только в точном build/release/QA allowlist, который проверяет `check-runtime-powershell-boundary.ps1`.
+- Храните managed components только в `C:\Program Files\ProxyWarden\components`; `config\components.json` допустим лишь как legacy migration input, а не source of truth.
- Добавляйте минимальный тест для новой ветвящейся логики.
- Не коммитьте runtime-файлы из `C:\ProgramData\ProxyWarden` и generated output.
diff --git a/README.md b/README.md
index aa26364..c371daf 100644
--- a/README.md
+++ b/README.md
@@ -1,35 +1,36 @@
# ProxyWarden
-ProxyWarden - это standalone Windows desktop-приложение для маршрутизации выбранных программ через SOCKS5-прокси. По сути это удобная оболочка управления над внешними компонентами: обязательным маршрутизатором приложений ProxiFyre и, опционально, локальным runtime `sing-box`.
+ProxyWarden — standalone Windows desktop-приложение для маршрутизации выбранных программ через SOCKS5-прокси. Оно управляет обязательным ProxiFyre и, при необходимости, локальным `sing-box`, но само не является VPN-драйвером, proxy server или облачным control plane.
-ProxyWarden сам не является VPN-драйвером, прокси-сервером или отдельным gateway/server. Он хранит настройки, показывает состояние компонентов, генерирует конфиги и запускает только явные действия пользователя: установить, запустить, остановить, удалить или применить конфиг.
+Все системные действия остаются явными: `apply` только проверяет и применяет конфигурацию; установка, обновление, запуск, остановка, перенос и удаление компонентов выполняются отдельными командами пользователя.
## Главное
-- Работает как Windows-клиент: Tauri 2 + React/TypeScript UI + Rust backend.
-- Маршрутизирует не всю систему, а выбранные приложения: процесс, папку или конкретный `.exe`.
-- Не меняет глобальный proxy в Windows.
-- Для per-app routing нужен ProxiFyre.
-- Local sing-box нужен только для сценария с подпиской и локальным SOCKS5 endpoint.
-- Внешний SOCKS5-прокси работает без Local sing-box.
-- Применение профиля не устанавливает и не чинит компоненты скрыто.
+- Tauri 2 + React/TypeScript UI + Rust backend.
+- Маршрутизируются выбранные процессы, папки или `.exe`, а не вся система.
+- Глобальный Windows proxy не меняется.
+- Внешний SOCKS5 работает без Local sing-box.
+- Production runtime не запускает PowerShell: service/install/UAC orchestration принадлежит native Rust.
+- x64 installer содержит проверенные offline payloads компонентов и WebView2 Offline Installer; сеть для baseline-установки не нужна.
-## Из чего состоит
+## Компоненты
-| Компонент | Что это | Нужен когда | Откуда берется |
-| --- | --- | --- | --- |
-| ProxyWarden Control App | Окно управления, настройки, status/readiness, генерация конфигов | Всегда | Этот репозиторий |
-| [ProxiFyre](https://github.com/wiresock/proxifyre) | Windows-приложение/служба для перехвата трафика выбранных процессов и отправки его в SOCKS5 | Всегда для маршрутизации приложений | GitHub releases `wiresock/proxifyre` |
-| [Windows Packet Filter / NDISAPI](https://github.com/wiresock/ndisapi) | Сетевой драйвер, который нужен ProxiFyre | Устанавливается вместе с ProxiFyre, если отсутствует | GitHub releases `wiresock/ndisapi` |
-| [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/cpp/windows/latest-supported-vc-redist) | Runtime-зависимость для `ProxiFyre.exe` | Устанавливается вместе с ProxiFyre, если отсутствует | Официальный `vc_redist` Microsoft |
-| [sing-box](https://github.com/SagerNet/sing-box) | Локальный proxy/VPN runtime, который слушает `127.0.0.1:1080` | Только для маршрута через subscription/выбранный сервер | GitHub releases `SagerNet/sing-box` |
-| [WinSW](https://github.com/winsw/winsw) | Wrapper, который запускает Local sing-box как Windows-службу | Только для Local sing-box | GitHub releases `winsw/winsw` |
+| Компонент | Роль | Когда нужен |
+| --- | --- | --- |
+| ProxyWarden Control App | UI, storage, validation, config generation и orchestration | Всегда |
+| [ProxiFyre](https://github.com/wiresock/proxifyre) | Перехватывает трафик выбранных приложений и направляет его в SOCKS5 | Для любого per-app routing |
+| [Windows Packet Filter / NDISAPI](https://github.com/wiresock/ndisapi) | Сетевой драйвер ProxiFyre | Устанавливается вместе с ProxiFyre, если отсутствует |
+| [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/cpp/windows/latest-supported-vc-redist) | Runtime-зависимость ProxiFyre | Устанавливается при необходимости |
+| [sing-box](https://github.com/SagerNet/sing-box) | Создаёт локальный SOCKS5 endpoint для выбранного subscription-сервера | Только для Local sing-box flow |
+| [WinSW](https://github.com/winsw/winsw) | Запускает sing-box как Windows-службу | Только для Local sing-box flow |
-В UI и коде компонент ProxiFyre иногда проходит через внутренний id `proxyfier`. Это не отдельный продукт Proxifier; текущий backend adapter работает именно с ProxiFyre.
+Версии, SHA-256 и лицензии offline payloads зафиксированы в packaged component catalog. Установка Control App не запускает routing-компоненты: нужный компонент устанавливается отдельным действием в UI.
-## Как идут маршруты
+В UI и части внутренних DTO ProxiFyre может иметь исторический id `proxyfier`. Это не продукт Proxifier.
-Внешний SOCKS5-прокси:
+## Маршруты
+
+Внешний SOCKS5:
```text
выбранные приложения -> ProxiFyre -> внешний SOCKS5 proxy
@@ -38,192 +39,140 @@ ProxyWarden сам не является VPN-драйвером, прокси-с
Local sing-box:
```text
-выбранные приложения -> ProxiFyre -> Local sing-box 127.0.0.1:1080 -> выбранный сервер из подписки
+выбранные приложения -> ProxiFyre -> Local sing-box 127.0.0.1:1080 -> выбранный subscription-сервер
```
-Во втором сценарии ProxiFyre все равно обязателен: именно он делает маршрутизацию конкретных Windows-приложений. Local sing-box только дает локальный SOCKS5 endpoint и ходит дальше к выбранному серверу.
+Во втором маршруте ProxiFyre по-прежнему отвечает за выбор приложений. Local sing-box только предоставляет локальный SOCKS5 endpoint и соединяется с выбранным сервером.
-## Что устанавливается
+## Установка и системные пути
-### Control App
-
-Обычная сборка Tauri создает desktop-приложение ProxyWarden. Отдельный скрипт `scripts/install-control-app.ps1` сейчас подготавливает стандартные директории:
+Tauri NSIS installer устанавливает Control App per-machine. Managed runtime-компоненты лежат только под текущим app root:
```text
-C:\Program Files\ProxyWarden\ControlApp
-C:\ProgramData\ProxyWarden\config
-C:\ProgramData\ProxyWarden\state
-C:\ProgramData\ProxyWarden\generated
+C:\Program Files\ProxyWarden
+C:\Program Files\ProxyWarden\components\ProxiFyre
+C:\Program Files\ProxyWarden\components\sing-box
```
-### ProxiFyre
-
-Явная установка ProxiFyre из приложения выполняется через elevated PowerShell и ставит/обновляет:
+Службы:
```text
-C:\Tools\ProxiFyre
-C:\Tools\ProxiFyre\ProxiFyre.exe
-C:\Tools\ProxiFyre\app-config.json
-Windows service: ProxiFyreService
+ProxiFyreService
+ProxyWardenSingBox
```
-Если на машине не найдены зависимости, установщик также скачивает и ставит Microsoft Visual C++ Redistributable и Windows Packet Filter / NDISAPI.
+ProxyWarden управляет службой только после точной проверки `PathName`, marker/receipt и canonical component root. Похожее имя службы или найденная папка сами по себе не дают права на start/stop/delete.
-### Local sing-box
+## Релиз одной командой
-Явная установка Local sing-box ставит:
+В PowerShell из корня проекта:
+
+```powershell
+.\release.cmd
+```
+
+То же действие доступно как `npm run release`. Сценарий показывает изменения Git и предлагает patch/minor/major, произвольную версию или текущую ещё не выпущенную версию. Можно сразу ввести номер вроде `1.2.1`.
+
+После выбора он синхронизирует версии в package.json, package-lock.json, tauri.conf.json, Cargo.toml и Cargo.lock, проверяет frontend/Rust/offline bundle, собирает NSIS и готовит папку `releases/proxywarden-vX.Y.Z`. Затем создаёт commit со всеми текущими отслеживаемыми и неигнорируемыми новыми файлами, annotated tag `vX.Y.Z` и одним atomic push отправляет текущую ветку и этот тег в `origin`. При отсутствии изменений новый commit не нужен. Артефакты не попадают в Git.
+
+В папке релиза: `artifacts/nsis/ProxyWarden_X.Y.Z_x64-setup.exe`, `SHA256SUMS.txt`, `release-manifest.json` с точным commit/hash и `release-notes.md`. EXE загружается на сайт вручную; GitHub/Gitea release page автоматически не создаётся.
+
+Нужны Git с настроенной identity и доступом к origin, Node, установленные frontend-зависимости (`npm ci` один раз), Rust/MSVC/Windows SDK. Сам сценарий сборки использует Node напрямую и не требует npm в PATH. Запуск от администратора не нужен.
+
+```powershell
+.\release.cmd -PlanOnly # только JSON-план: без записи, сборки и сети
+.\release.cmd -Version 1.2.1 # версия без вопроса
+.\release.cmd -Version 1.2.1 -Resume # повторить только неудачный push
+```
+
+Не меняйте исходники во время сборки. Существующие теги не перезаписываются; при расхождении с удалённой веткой сценарий останавливается до изменения версий. При ошибке сборки изменения версии остаются локально для исправления, commit/tag/push не выполняются. При неудачном push готовая папка и локальный commit/tag сохраняются; `-Resume` проверяет исходники и SHA-256 перед повторной отправкой.
+
+Для локальной подготовки без commit/tag/push остаётся `scripts/prepare-release.ps1 -Version X.Y.Z`. Автоматические проверки не заменяют Windows VM/UAC/driver/routing acceptance: в manifest это отмечается отдельно.
+
+## Данные и source of truth
+
+Настройки и состояние лежат под `C:\ProgramData\ProxyWarden`:
```text
-C:\Program Files\ProxyWarden\sing-box\sing-box.exe
-C:\Program Files\ProxyWarden\sing-box\ProxyWardenSingBox.exe
-C:\Program Files\ProxyWarden\sing-box\ProxyWardenSingBox.xml
-C:\Program Files\ProxyWarden\sing-box\config.json
-Windows service: ProxyWardenSingBox
+config\profiles.json
+config\targets.json
+config\local-singbox.json
+config\storage-meta.json
+state\activity.json
+state\component-layout.json
+state\component-updates.json
+state\migrations\...
+packages\...
```
-`ProxyWardenSingBox.exe` - это WinSW wrapper. Он нужен только чтобы запускать `sing-box.exe` как Windows-службу.
+`config\components.json` не является текущим источником статуса компонентов. Это только legacy input: migration может проверить, сохранить snapshot/archive и затем перестать использовать его. Фактический install/service/version status читается из native inventory Windows и проверенных receipts.
+
+Generated artifacts можно пересоздать:
+
+```text
+generated\proxifyre-app-config.json
+generated\sing-box-config.json
+```
+
+Не редактируйте generated-файлы как основной источник правды. Subscription URL, userinfo, credentials, proxy password и внутренние migration/job records нельзя выводить целиком в UI, logs или diagnostics.
+
+## Миграция старой установки
+
+- Startup выполняет только безопасную storage adoption/migration: backup, validation, atomic commit и повторный no-op.
+- Старые component roots и службы сначала обнаруживаются read-only.
+- Перенос компонента — отдельное UAC-действие с exact identity checks, rollback journal и quarantine.
+- Foreign или incomplete installation не управляется автоматически.
+- Пока cutover journal активен, требует recovery или quarantine ещё не подтверждён к удалению, upgrade/uninstall блокируется до безопасного завершения.
## Права администратора
-Без прав администратора можно открыть приложение, редактировать настройки, добавлять приложения, вводить внешний proxy, загружать/выбирать подписку и смотреть состояние.
+Без UAC можно редактировать настройки, выбирать приложения и proxy, загружать subscription, смотреть статус и генерировать конфигурацию.
-Права администратора или UAC confirmation нужны для операций, которые меняют систему:
+UAC требуется для явных действий, которые меняют Windows:
-- установка или удаление ProxiFyre;
-- установка Windows Packet Filter / NDISAPI;
-- установка Microsoft Visual C++ Redistributable, если его нет;
-- установка или удаление Local sing-box;
-- создание, запуск и остановка Windows-служб;
-- удаление install folder для managed-компонентов.
+- install/update/uninstall ProxiFyre или Local sing-box;
+- установка Windows Packet Filter и VC++ Runtime при необходимости;
+- start/stop/create/delete Windows-служб;
+- подтверждённый legacy component cutover и его cleanup.
-Применение профиля не запускает установку. Оно генерирует derived config и пытается записать его в найденную установку ProxiFyre. Если прав на запись в папку установки не хватает, операция должна завершиться ошибкой, а не устанавливать что-то скрыто.
-
-## Поддержанная среда
-
-Подтверждено вручную сейчас:
-
-```text
-Windows 11
-PowerShell 7 как пользовательская shell для запуска команд разработки
-```
-
-Важно: Rust backend и elevated-операции сейчас запускают именно `powershell.exe` с `-NoProfile` и `-ExecutionPolicy Bypass`. На Windows это обычно Windows PowerShell 5.1. Скрипты используют стандартные команды вроде `Get-CimInstance`, `Invoke-WebRequest`, `Expand-Archive`, `Get-FileHash`, `Start-Service`, `Stop-Service`, `ConvertTo-Json`, поэтому должны быть близки к Windows PowerShell 5.1, но полный ручной тест пока был только на Windows 11 с PowerShell 7 в окружении разработки.
-
-Ожидаемая, но не полностью подтвержденная область:
-
-- Windows 10/11 desktop;
-- x64 как основной сценарий;
-- x86 и ARM64 частично учтены в installer-логике через выбор release assets, но не считаются проверенными;
-- обычный desktop/laptop без специальных требований к GPU;
-- доступ в интернет к GitHub releases и Microsoft download endpoints для установки компонентов.
-
-Linux/macOS не являются целевой платформой для этого клиента.
-
-## Где лежат настройки
-
-Source of truth лежит в JSON под `C:\ProgramData\ProxyWarden`:
-
-```text
-C:\ProgramData\ProxyWarden\config\profiles.json
-C:\ProgramData\ProxyWarden\config\targets.json
-C:\ProgramData\ProxyWarden\config\components.json
-C:\ProgramData\ProxyWarden\config\local-singbox.json
-C:\ProgramData\ProxyWarden\state\activity.json
-C:\ProgramData\ProxyWarden\state\singbox-subscription-cache.json
-```
-
-Сгенерированные файлы лежат отдельно и могут быть пересозданы:
-
-```text
-C:\ProgramData\ProxyWarden\generated\proxifyre-app-config.json
-C:\ProgramData\ProxyWarden\generated\sing-box-config.json
-```
-
-Не редактируйте generated-файлы как основной источник правды. При следующей генерации они могут быть перезаписаны.
-
-Subscription URL считается секретом. UI и diagnostics должны показывать только редактированную/сокращенную версию ссылки.
-
-При загрузке подписки ProxyWarden отправляет провайдеру стандартные идентификационные заголовки приложения и `X-HWID` - случайный постоянный UUID этой установки. Это не серийный номер оборудования, но провайдер может использовать его для связывания запросов одной установки. Проверка маршрута делает HTTPS-запросы через выбранный proxy к Cloudflare и ipify, чтобы подтвердить выход и определить внешний IP.
+Elevated mode принимает только заранее записанный typed job ID либо один из фиксированных NSIS modes. UI не передаёт произвольную команду, script text или install path.
## Типовые сценарии
### Внешний SOCKS5
-1. Запустите ProxyWarden.
-2. Установите или проверьте ProxiFyre.
-3. На вкладке `VPN / Прокси` выберите внешний proxy.
-4. Введите `host:port` или `socks5://host:port`.
-5. На вкладке `ProxiFyre` добавьте приложения.
-6. Нажмите `Применить в ProxiFyre`.
+1. Установите ProxiFyre явной кнопкой, если он отсутствует.
+2. На вкладке `VPN / Прокси` выберите внешний proxy и укажите `host:port` или `socks5://host:port`.
+3. Добавьте приложения в ProxiFyre route.
+4. Нажмите `Применить`.
Local sing-box для этого сценария не нужен.
### Local sing-box с подпиской
-1. Запустите ProxyWarden.
-2. Установите ProxiFyre.
-3. Установите Local sing-box.
-4. Вставьте subscription URL.
-5. Загрузите список серверов и выберите сервер.
-6. Добавьте приложения.
-7. Сгенерируйте/примените маршрут.
+1. Явно установите ProxiFyre и Local sing-box.
+2. Добавьте subscription URL, загрузите список и выберите сервер.
+3. Добавьте приложения и примените маршрут.
-## Установка и запуск из исходников
+## Разработка
-Нужны:
-
-- Windows 11 для подтвержденного пути разработки;
-- Node.js и npm;
-- Rust через rustup;
-- Visual Studio Build Tools с MSVC и Windows SDK;
-- Microsoft Edge WebView2 Runtime;
-- PowerShell 7 удобно использовать как shell разработки, но elevated runtime-команды приложения запускаются через `powershell.exe`.
-
-Установка зависимостей и запуск:
+Целевая платформа — Windows 10/11 x64. Для сборки нужны Node.js/npm, Rust через rustup, Visual Studio Build Tools с MSVC и Windows SDK. PowerShell 7 используется только для build/release/QA tooling; установленному приложению PowerShell не нужен.
```powershell
-cd D:\repos\ProxyWarden
-npm install
+Set-Location D:\repos\ProxyWarden
+npm ci
npm run tauri -- dev
```
-Собрать frontend:
-
-```powershell
-npm run build
-```
-
-Собрать установочный пакет Tauri:
-
-```powershell
-npm run tauri -- build
-```
-
-Запустить только browser-preview без нативных Tauri-команд:
+Browser preview не доказывает работу Tauri commands, UAC или Windows-служб:
```powershell
npm run dev -- --host 127.0.0.1
```
-Browser-preview годится для проверки интерфейса, но не доказывает работу Windows-служб, elevated-операций и Tauri command handlers.
+## Проверка
-## Installer-скрипты
-
-В репозитории есть явные entrypoint-скрипты:
-
-```powershell
-& .\scripts\install-control-app.ps1 -PlanOnly
-& .\scripts\install-proxyfier.ps1 -PlanOnly
-& .\scripts\install-singbox.ps1 -PlanOnly
-```
-
-`-PlanOnly` возвращает structured JSON и не должен иметь side effects.
-
-Реальная установка через эти скрипты требует прав администратора. `scripts/install-proxyfier.ps1` как standalone boundary сейчас ожидает локальный `-PackagePath`; путь установки из UI/backend использует отдельный elevated-скрипт, который скачивает ProxiFyre, Windows Packet Filter и runtime-зависимости сам.
-
-## Проверка для разработчика
-
-Frontend/UI:
+Frontend и Rust:
```powershell
npm run format:check
@@ -231,37 +180,34 @@ npm run lint
npm run typecheck
npm test -- --run
npm run build
+
+Push-Location src-tauri
+cargo fmt --all -- --check
+cargo clippy --all-targets --all-features -- -D warnings
+cargo test --all-targets
+Pop-Location
```
-Rust/backend:
-
-```powershell
-cd D:\repos\ProxyWarden\src-tauri
-cargo test
-```
-
-Tauri/toolchain:
+Build/release/QA boundaries:
```powershell
+& .\scripts\check-runtime-powershell-boundary.ps1 -CheckOnly
+& .\scripts\update-component-bundle.ps1 -PlanOnly
+& .\scripts\update-component-bundle.ps1 -CheckOnly
+& .\scripts\audit-windows-smoke.ps1 -Mode PlanOnly
+& .\scripts\prepare-release.ps1 -PlanOnly -SkipBuild
npm run tauri -- info
-npm run tauri -- dev
npm run tauri -- build
```
-Installer boundaries:
+`PlanOnly` и `CheckOnly` возвращают structured JSON с `changed: false`. Обновление packaged component catalog — отдельная release-команда и не является runtime action.
-```powershell
-& .\scripts\install-control-app.ps1 -PlanOnly
-& .\scripts\install-proxyfier.ps1 -PlanOnly
-& .\scripts\install-singbox.ps1 -PlanOnly
-```
+Unit tests и build не подтверждают реальный UAC/SCM/driver/routing flow. Для release candidate нужны Windows VM smoke-сценарии: fresh offline install, legacy upgrade/rollback, foreign same-name service refusal и uninstall/reboot behavior.
-## Ограничения текущей версии
+## Ограничения
-- Основной поддержанный маршрут - SOCKS5.
-- Link-подписки разбирают VLESS, VMess, Trojan и Shadowsocks; sing-box JSON также принимает поддержанные proxy outbounds. Неизвестные форматы отклоняются явно.
-- Для VLESS outbound без собственного `packet_encoding` генератор добавляет `xudp`; значение, заданное провайдером подписки, не перезаписывается.
-- ProxiFyre является текущим backend-слоем для per-app routing.
-- Local sing-box остается опциональным и не требуется для внешнего SOCKS5.
-- Elevated install/start/stop/uninstall операции считаются реализованными, но требуют дополнительной проверки на реальной Windows-машине с UAC/admin confirmation.
-- Windows 10, Windows PowerShell 5.1, ARM64 и x86 нужно отдельно подтвердить перед тем, как называть их официально поддержанными.
+- Основной routing protocol — SOCKS5.
+- Link subscriptions поддерживают только форматы, которые явно принимает текущий parser; неизвестные поля/форматы отклоняются, а не теряются молча.
+- Local sing-box остаётся optional.
+- x86 и ARM64 не входят в текущий release contract.
+- Реальные Windows service, UAC, driver и offline installer сценарии нельзя считать подтверждёнными без VM evidence.
diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md
new file mode 100644
index 0000000..e035fe1
--- /dev/null
+++ b/THIRD_PARTY_NOTICES.md
@@ -0,0 +1,41 @@
+# Third-party notices for the ProxyWarden offline bundle
+
+This file records the third-party runtime payload planned for the ProxyWarden
+`1.2.0` Windows x64 installer. It is an engineering inventory, not legal advice
+or a completed distribution approval. Exact bundled hashes and sizes are owned
+by `src-tauri/bundled/components/catalog.json`.
+
+## Managed runtime assets
+
+| Component | Pinned asset and official source | License copy | Update trust and distribution note |
+| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| ProxiFyre | `2.4.0`, [`ProxiFyre-v2.4.0-x64-signed.zip`](https://github.com/wiresock/proxifyre/releases/download/v2.4.0/ProxiFyre-v2.4.0-x64-signed.zip); [commit-pinned source archive](https://github.com/wiresock/proxifyre/archive/dd1512840e1e3bc596b06b80eda4e2dcd6a9c9ed.tar.gz) | `AGPL-3.0-only`; `src-tauri/bundled/components/proxifyre/LICENSE` | Origin is accepted only with the official GitHub release digest and the Authenticode publisher `The Anti-Cloud Corporation` on the inner executable. Before release, the project/release owner must record the corresponding-source or written-source-offer decision and approve redistribution. |
+| Windows Packet Filter | release `3.6.2`, product `3.6.2.1`, [`Windows.Packet.Filter.3.6.2.1.x64.msi`](https://github.com/wiresock/ndisapi/releases/download/v3.6.2/Windows.Packet.Filter.3.6.2.1.x64.msi); [commit-pinned source archive](https://github.com/wiresock/ndisapi/archive/417b8734e844083a10236387fba705d94a2d6bc9.tar.gz) | `MIT`; `src-tauri/bundled/components/windows-packet-filter/LICENSE` | Origin is accepted only with the official GitHub release digest and MSI Authenticode publisher `The Anti-Cloud Corporation`. The MSI is a shared system dependency; its presence alone does not prove ProxyWarden ownership and does not authorize uninstall. |
+| Microsoft Visual C++ x64 Redistributable | file/product version `14.51.36247.0`, [`VC_redist.x64.exe`](https://aka.ms/vs/18/release/14.51.36247/VC_redist.x64.exe) | `LicenseRef-Microsoft-Visual-Cpp-v14-Redistributable-2026`; [`src-tauri/bundled/components/vc-runtime/LICENSE.docx`](https://visualstudio.microsoft.com/wp-content/uploads/2025/10/Visual-C-V14-License-Redistributable_and_Runtime_ENU.docx) | Build-time refresh only. The pinned file must retain a valid Microsoft Corporation Authenticode signature; no in-app remote update is offered. This is proprietary Microsoft software, so the project/release owner must approve its redistribution under the bundled official terms before release. |
+| sing-box | `1.13.19`, [`sing-box-1.13.19-windows-amd64.zip`](https://github.com/SagerNet/sing-box/releases/download/v1.13.19/sing-box-1.13.19-windows-amd64.zip); [commit-pinned source archive](https://github.com/SagerNet/sing-box/archive/b5ebaa1fc0f2b94256180b95468e73ef53caa27d.tar.gz) | `LicenseRef-Sing-Box-Project` (GPL-3.0-or-later plus the upstream name restriction); `src-tauri/bundled/components/sing-box/LICENSE` | Origin is accepted only with the official GitHub release digest. Redistribution must preserve the GPL terms and the upstream name restriction. Before release, the project/release owner must record the corresponding-source/source-offer decision and approve the notice text. |
+| WinSW | `2.12.0`, [`WinSW.NET461.exe`](https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW.NET461.exe); [commit-pinned source archive](https://github.com/winsw/winsw/archive/eef5bade59fca0254e387ac73ed7625ba6aa7147.tar.gz) | `MIT`; `src-tauri/bundled/components/winsw/LICENSE.txt` | The selected binary is IL-only AnyCPU and is used on the x64 target with supported .NET Framework 4.8/4.8.1. Upstream supplies neither an independent digest nor an Authenticode signature for this asset, so it is `bundled-only/no-independent-proof`: remote update is disabled and a newer bundle is required to replace it. |
+
+## WebView2 prerequisite
+
+Microsoft Edge WebView2 Runtime is not part of the managed component catalog and
+does not receive an in-app update action. Tauri packages the Microsoft WebView2
+Evergreen Standalone Offline Installer into the NSIS installer through
+`bundle.windows.webviewInstallMode.type = "offlineInstaller"`. Microsoft/Windows
+owns later runtime servicing. The release evidence must prove that the offline
+payload is present and that a clean Windows 10/11 x64 machine can install and
+start ProxyWarden without network access. See the official
+[WebView2 distribution page](https://developer.microsoft.com/en-us/microsoft-edge/webview2/).
+
+## Release compliance gate
+
+No license or distribution sign-off is claimed by this file. Before tagging or
+publishing `1.2.0`, the project/release owner must record in
+`docs/goals/production-ready-offline-migration/EVIDENCE.md`:
+
+- the exact installer composition and catalog hashes;
+- the reviewed license copies and source links;
+- the corresponding-source/source-offer decisions for ProxiFyre and sing-box;
+- the Microsoft Visual C++ and WebView2 redistribution decision;
+- reviewer name/date and explicit approval.
+
+Until that record exists, license/distribution remains a release blocker.
diff --git a/package-lock.json b/package-lock.json
index bf42fec..c7417c8 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "proxywarden",
- "version": "1.1.0",
+ "version": "2.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "proxywarden",
- "version": "1.1.0",
+ "version": "2.0.0",
"dependencies": {
"@fontsource-variable/jetbrains-mono": "^5.2.8",
"@tauri-apps/api": "^2.0.0",
diff --git a/package.json b/package.json
index b02b8fb..4ce55ef 100644
--- a/package.json
+++ b/package.json
@@ -1,10 +1,12 @@
{
"name": "proxywarden",
- "version": "1.1.0",
+ "version": "2.0.0",
"private": true,
"type": "module",
"description": "Standalone Windows desktop proxy management app for ProxyWarden.",
"scripts": {
+ "release": ".\\release.cmd",
+ "test:release": "node --test scripts/prepare-release.check.mjs",
"dev": "vite",
"build": "npm run typecheck && vite build",
"typecheck": "tsc --noEmit",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
deleted file mode 100644
index 7646ea4..0000000
--- a/pnpm-lock.yaml
+++ /dev/null
@@ -1,2356 +0,0 @@
-lockfileVersion: '9.0'
-
-settings:
- autoInstallPeers: true
- excludeLinksFromLockfile: false
-
-importers:
-
- .:
- dependencies:
- '@fontsource-variable/jetbrains-mono':
- specifier: ^5.2.8
- version: 5.3.0
- '@tauri-apps/api':
- specifier: ^2.0.0
- version: 2.11.1
- '@tauri-apps/plugin-dialog':
- specifier: ^2.7.1
- version: 2.7.2
- lucide-react:
- specifier: ^1.23.0
- version: 1.25.0(react@19.2.7)
- react:
- specifier: ^19.0.0
- version: 19.2.7
- react-dom:
- specifier: ^19.0.0
- version: 19.2.7(react@19.2.7)
- devDependencies:
- '@eslint/js':
- specifier: ^10.0.1
- version: 10.0.1(eslint@10.7.0)
- '@tauri-apps/cli':
- specifier: ^2.0.0
- version: 2.11.4
- '@types/react':
- specifier: ^19.0.0
- version: 19.2.17
- '@types/react-dom':
- specifier: ^19.0.0
- version: 19.2.3(@types/react@19.2.17)
- '@vitejs/plugin-react':
- specifier: ^5.0.0
- version: 5.2.0(vite@7.3.6)
- eslint:
- specifier: ^10.7.0
- version: 10.7.0
- prettier:
- specifier: ^3.9.5
- version: 3.9.5
- typescript:
- specifier: ^5.8.0
- version: 5.9.3
- typescript-eslint:
- specifier: ^8.63.0
- version: 8.65.0(eslint@10.7.0)(typescript@5.9.3)
- vite:
- specifier: ^7.0.0
- version: 7.3.6
- vitest:
- specifier: ^3.2.4
- version: 3.2.7
-
-packages:
-
- '@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-plugin-utils@7.29.7':
- resolution: {integrity: sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==}
- engines: {node: '>=6.9.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/plugin-transform-react-jsx-self@7.29.7':
- resolution: {integrity: sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/plugin-transform-react-jsx-source@7.29.7':
- resolution: {integrity: sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-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'}
-
- '@esbuild/aix-ppc64@0.28.1':
- resolution: {integrity: sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==}
- engines: {node: '>=18'}
- cpu: [ppc64]
- os: [aix]
-
- '@esbuild/android-arm64@0.28.1':
- resolution: {integrity: sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [android]
-
- '@esbuild/android-arm@0.28.1':
- resolution: {integrity: sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==}
- engines: {node: '>=18'}
- cpu: [arm]
- os: [android]
-
- '@esbuild/android-x64@0.28.1':
- resolution: {integrity: sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [android]
-
- '@esbuild/darwin-arm64@0.28.1':
- resolution: {integrity: sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [darwin]
-
- '@esbuild/darwin-x64@0.28.1':
- resolution: {integrity: sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [darwin]
-
- '@esbuild/freebsd-arm64@0.28.1':
- resolution: {integrity: sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [freebsd]
-
- '@esbuild/freebsd-x64@0.28.1':
- resolution: {integrity: sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [freebsd]
-
- '@esbuild/linux-arm64@0.28.1':
- resolution: {integrity: sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [linux]
-
- '@esbuild/linux-arm@0.28.1':
- resolution: {integrity: sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==}
- engines: {node: '>=18'}
- cpu: [arm]
- os: [linux]
-
- '@esbuild/linux-ia32@0.28.1':
- resolution: {integrity: sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==}
- engines: {node: '>=18'}
- cpu: [ia32]
- os: [linux]
-
- '@esbuild/linux-loong64@0.28.1':
- resolution: {integrity: sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==}
- engines: {node: '>=18'}
- cpu: [loong64]
- os: [linux]
-
- '@esbuild/linux-mips64el@0.28.1':
- resolution: {integrity: sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==}
- engines: {node: '>=18'}
- cpu: [mips64el]
- os: [linux]
-
- '@esbuild/linux-ppc64@0.28.1':
- resolution: {integrity: sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==}
- engines: {node: '>=18'}
- cpu: [ppc64]
- os: [linux]
-
- '@esbuild/linux-riscv64@0.28.1':
- resolution: {integrity: sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==}
- engines: {node: '>=18'}
- cpu: [riscv64]
- os: [linux]
-
- '@esbuild/linux-s390x@0.28.1':
- resolution: {integrity: sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==}
- engines: {node: '>=18'}
- cpu: [s390x]
- os: [linux]
-
- '@esbuild/linux-x64@0.28.1':
- resolution: {integrity: sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [linux]
-
- '@esbuild/netbsd-arm64@0.28.1':
- resolution: {integrity: sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [netbsd]
-
- '@esbuild/netbsd-x64@0.28.1':
- resolution: {integrity: sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [netbsd]
-
- '@esbuild/openbsd-arm64@0.28.1':
- resolution: {integrity: sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [openbsd]
-
- '@esbuild/openbsd-x64@0.28.1':
- resolution: {integrity: sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [openbsd]
-
- '@esbuild/openharmony-arm64@0.28.1':
- resolution: {integrity: sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [openharmony]
-
- '@esbuild/sunos-x64@0.28.1':
- resolution: {integrity: sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [sunos]
-
- '@esbuild/win32-arm64@0.28.1':
- resolution: {integrity: sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [win32]
-
- '@esbuild/win32-ia32@0.28.1':
- resolution: {integrity: sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==}
- engines: {node: '>=18'}
- cpu: [ia32]
- os: [win32]
-
- '@esbuild/win32-x64@0.28.1':
- resolution: {integrity: sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [win32]
-
- '@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}
-
- '@fontsource-variable/jetbrains-mono@5.3.0':
- resolution: {integrity: sha512-F32xpS2NsGYoQi2ADSkKTgpJj7ozajsGgDJ8woTnqjmIB+dxDIqImjl4pXZVEExu8UFZ2ndhmX18EBS/hdz3Lw==}
-
- '@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==}
-
- '@rolldown/pluginutils@1.0.0-rc.3':
- resolution: {integrity: sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==}
-
- '@rollup/rollup-android-arm-eabi@4.62.2':
- resolution: {integrity: sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==}
- cpu: [arm]
- os: [android]
-
- '@rollup/rollup-android-arm64@4.62.2':
- resolution: {integrity: sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==}
- cpu: [arm64]
- os: [android]
-
- '@rollup/rollup-darwin-arm64@4.62.2':
- resolution: {integrity: sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==}
- cpu: [arm64]
- os: [darwin]
-
- '@rollup/rollup-darwin-x64@4.62.2':
- resolution: {integrity: sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==}
- cpu: [x64]
- os: [darwin]
-
- '@rollup/rollup-freebsd-arm64@4.62.2':
- resolution: {integrity: sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==}
- cpu: [arm64]
- os: [freebsd]
-
- '@rollup/rollup-freebsd-x64@4.62.2':
- resolution: {integrity: sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==}
- cpu: [x64]
- os: [freebsd]
-
- '@rollup/rollup-linux-arm-gnueabihf@4.62.2':
- resolution: {integrity: sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==}
- cpu: [arm]
- os: [linux]
- libc: [glibc]
-
- '@rollup/rollup-linux-arm-musleabihf@4.62.2':
- resolution: {integrity: sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==}
- cpu: [arm]
- os: [linux]
- libc: [musl]
-
- '@rollup/rollup-linux-arm64-gnu@4.62.2':
- resolution: {integrity: sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==}
- cpu: [arm64]
- os: [linux]
- libc: [glibc]
-
- '@rollup/rollup-linux-arm64-musl@4.62.2':
- resolution: {integrity: sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==}
- cpu: [arm64]
- os: [linux]
- libc: [musl]
-
- '@rollup/rollup-linux-loong64-gnu@4.62.2':
- resolution: {integrity: sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==}
- cpu: [loong64]
- os: [linux]
- libc: [glibc]
-
- '@rollup/rollup-linux-loong64-musl@4.62.2':
- resolution: {integrity: sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==}
- cpu: [loong64]
- os: [linux]
- libc: [musl]
-
- '@rollup/rollup-linux-ppc64-gnu@4.62.2':
- resolution: {integrity: sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==}
- cpu: [ppc64]
- os: [linux]
- libc: [glibc]
-
- '@rollup/rollup-linux-ppc64-musl@4.62.2':
- resolution: {integrity: sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==}
- cpu: [ppc64]
- os: [linux]
- libc: [musl]
-
- '@rollup/rollup-linux-riscv64-gnu@4.62.2':
- resolution: {integrity: sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==}
- cpu: [riscv64]
- os: [linux]
- libc: [glibc]
-
- '@rollup/rollup-linux-riscv64-musl@4.62.2':
- resolution: {integrity: sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==}
- cpu: [riscv64]
- os: [linux]
- libc: [musl]
-
- '@rollup/rollup-linux-s390x-gnu@4.62.2':
- resolution: {integrity: sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==}
- cpu: [s390x]
- os: [linux]
- libc: [glibc]
-
- '@rollup/rollup-linux-x64-gnu@4.62.2':
- resolution: {integrity: sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==}
- cpu: [x64]
- os: [linux]
- libc: [glibc]
-
- '@rollup/rollup-linux-x64-musl@4.62.2':
- resolution: {integrity: sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==}
- cpu: [x64]
- os: [linux]
- libc: [musl]
-
- '@rollup/rollup-openbsd-x64@4.62.2':
- resolution: {integrity: sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==}
- cpu: [x64]
- os: [openbsd]
-
- '@rollup/rollup-openharmony-arm64@4.62.2':
- resolution: {integrity: sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==}
- cpu: [arm64]
- os: [openharmony]
-
- '@rollup/rollup-win32-arm64-msvc@4.62.2':
- resolution: {integrity: sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==}
- cpu: [arm64]
- os: [win32]
-
- '@rollup/rollup-win32-ia32-msvc@4.62.2':
- resolution: {integrity: sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==}
- cpu: [ia32]
- os: [win32]
-
- '@rollup/rollup-win32-x64-gnu@4.62.2':
- resolution: {integrity: sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==}
- cpu: [x64]
- os: [win32]
-
- '@rollup/rollup-win32-x64-msvc@4.62.2':
- resolution: {integrity: sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==}
- cpu: [x64]
- os: [win32]
-
- '@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
-
- '@tauri-apps/plugin-dialog@2.7.2':
- resolution: {integrity: sha512-pX0IGm1I3I6wc+zeKYcq1GSqogK6okCNX5fOdaNU5ab1AjGS6l1E5wFNjEb7meg7ZFSp0JUs+0jQGQNyOvLrsg==}
-
- '@types/babel__core@7.20.5':
- resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==}
-
- '@types/babel__generator@7.27.0':
- resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==}
-
- '@types/babel__template@7.4.4':
- resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==}
-
- '@types/babel__traverse@7.28.0':
- resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==}
-
- '@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/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.65.0':
- resolution: {integrity: sha512-IEgob78X12rHpUmtcwFsXhZdVGJtwTVP8FiCLZkR6GlYVrl2PcuB+KhCE5BlVC/eQpQnu8WXRtkHZuPar+gCRA==}
- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- peerDependencies:
- '@typescript-eslint/parser': ^8.65.0
- eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
- typescript: '>=4.8.4 <6.1.0'
-
- '@typescript-eslint/parser@8.65.0':
- resolution: {integrity: sha512-CZ4nMxWwgu1HEEFNkeaCptra9QCtkmKdgf3sWh1rl1trIhmxLilgTV4cwcbQ4wemnT4sWQN8CaKOmdYx+g2gMA==}
- 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.65.0':
- resolution: {integrity: sha512-SxnPhbTsGahizDgbu7oqFH/xVtzIqMd/s+WtnSxNxJZJpLbdT5IPdzg8EZxO3+PoKahXmwJLeNQOpKJb3/bi7Q==}
- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- peerDependencies:
- typescript: '>=4.8.4 <6.1.0'
-
- '@typescript-eslint/scope-manager@8.65.0':
- resolution: {integrity: sha512-Esbl8OSYiVxBokYgWPf7VVWg/BE798wXhimnn9ML9Pt5qoDf8bfQlgjlKXR/k98+AcNzlLKYrpCcrcuZ9DZLgg==}
- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
-
- '@typescript-eslint/tsconfig-utils@8.65.0':
- resolution: {integrity: sha512-j6GzGqCiRdA7Qhur2VVmKZAkBLfnHFQfx4TaJGL9RMveZqCo48jSHHO0DTgizEnGhtWnqmbtCUSrqSkdiY/0Hg==}
- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- peerDependencies:
- typescript: '>=4.8.4 <6.1.0'
-
- '@typescript-eslint/type-utils@8.65.0':
- resolution: {integrity: sha512-YjaZ7PRI5qY7ax2L3PbvX0rRyGtipAReCWs0mhhDBHjH/vl0g0BonaGXrKdKpMbIIsMIwDgbk/xzkBTyAltS5g==}
- 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.65.0':
- resolution: {integrity: sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg==}
- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
-
- '@typescript-eslint/typescript-estree@8.65.0':
- resolution: {integrity: sha512-JboAE2swaYt4tb1fHhHTABE2K+OLy09XfcTbhnk4Pw96f9dd2e9iYsJ28gBggHlo5z5x1rkyWvcPoTuNTd4oGg==}
- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- peerDependencies:
- typescript: '>=4.8.4 <6.1.0'
-
- '@typescript-eslint/utils@8.65.0':
- resolution: {integrity: sha512-gXiwIHsYreboxeJucHKPvgwl7dXt50mF8s1/c00cP/WoVTyWKFdtfhRWwZiXYFU5H2O8vVoSLNrexFZjYS/SGA==}
- 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.65.0':
- resolution: {integrity: sha512-8C71BQkGjiMmXtop7pHVJu1l2NNShFdkCyD6a2ezzs5vU/L3LRtb69EtcteFwz0mYMPzIgOw0n6OV4VBUWZd7A==}
- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
-
- '@vitejs/plugin-react@5.2.0':
- resolution: {integrity: sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw==}
- engines: {node: ^20.19.0 || >=22.12.0}
- peerDependencies:
- vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0
-
- '@vitest/expect@3.2.7':
- resolution: {integrity: sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==}
-
- '@vitest/mocker@3.2.7':
- resolution: {integrity: sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==}
- peerDependencies:
- msw: ^2.4.9
- vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0
- peerDependenciesMeta:
- msw:
- optional: true
- vite:
- optional: true
-
- '@vitest/pretty-format@3.2.7':
- resolution: {integrity: sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==}
-
- '@vitest/runner@3.2.7':
- resolution: {integrity: sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==}
-
- '@vitest/snapshot@3.2.7':
- resolution: {integrity: sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==}
-
- '@vitest/spy@3.2.7':
- resolution: {integrity: sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==}
-
- '@vitest/utils@3.2.7':
- resolution: {integrity: sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==}
-
- 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==}
-
- 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.44:
- resolution: {integrity: sha512-T3ghW+sl/ZJ8w1v/yQx3qvJ9040DWoLBz8JT/CILbAKcFyG9b2MRe75v6W5uXjv6uH1lumK2Kv46y2zSkcej0Q==}
- engines: {node: '>=6.0.0'}
- hasBin: true
-
- 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
-
- cac@6.7.14:
- resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==}
- engines: {node: '>=8'}
-
- caniuse-lite@1.0.30001806:
- resolution: {integrity: sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==}
-
- chai@5.3.3:
- resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==}
- engines: {node: '>=18'}
-
- check-error@2.1.3:
- resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==}
- engines: {node: '>= 16'}
-
- 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'}
-
- csstype@3.2.3:
- resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}
-
- debug@4.4.3:
- resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}
- engines: {node: '>=6.0'}
- peerDependencies:
- supports-color: '*'
- peerDependenciesMeta:
- supports-color:
- optional: true
-
- deep-eql@5.0.2:
- resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==}
- engines: {node: '>=6'}
-
- deep-is@0.1.4:
- resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
-
- electron-to-chromium@1.5.393:
- resolution: {integrity: sha512-kiDJdIUawuEIcp9XoICKp1iTYDEbgguIPq526N1Q7jIQDeQ3CqoMx71025PI/7E48Ddtw2HuWsVjY7afEgNxmg==}
-
- es-module-lexer@1.7.0:
- resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==}
-
- esbuild@0.28.1:
- resolution: {integrity: sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==}
- engines: {node: '>=18'}
- hasBin: true
-
- 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-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.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'}
-
- 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'}
-
- 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'}
-
- isexe@2.0.0:
- resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
-
- js-tokens@4.0.0:
- resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
-
- js-tokens@9.0.1:
- resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==}
-
- 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'}
-
- locate-path@6.0.0:
- resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
- engines: {node: '>=10'}
-
- loupe@3.2.1:
- resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==}
-
- lru-cache@5.1.1:
- resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
-
- lucide-react@1.25.0:
- resolution: {integrity: sha512-/mdJTRbiwcLOQ1NZZK1amZF9rIZyvO18D6r9TngE6TG1NmqHgFuT4eE7Xrkm9UsXMbBJD1NlfwHVltCDWHrOTw==}
- peerDependencies:
- react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0
-
- magic-string@0.30.21:
- resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}
-
- 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'}
-
- 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'}
-
- 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==}
-
- pathval@2.0.1:
- resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==}
- engines: {node: '>= 14.16'}
-
- 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'}
-
- postcss@8.5.20:
- resolution: {integrity: sha512-lW616l85ucIQL+FocMmL7pQFPqBmwejrCMg+iPxyImlrANNJG9NHq/RkyCZopDhd8C3LA03PHRJDjkbGu8vvug==}
- 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
-
- 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-refresh@0.18.0:
- resolution: {integrity: sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==}
- engines: {node: '>=0.10.0'}
-
- react@19.2.7:
- resolution: {integrity: sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==}
- engines: {node: '>=0.10.0'}
-
- rollup@4.62.2:
- resolution: {integrity: sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==}
- engines: {node: '>=18.0.0', npm: '>=8.0.0'}
- hasBin: true
-
- 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@3.10.0:
- resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==}
-
- strip-literal@3.1.0:
- resolution: {integrity: sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==}
-
- tinybench@2.9.0:
- resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==}
-
- tinyexec@0.3.2:
- resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==}
-
- tinyglobby@0.2.17:
- resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==}
- engines: {node: '>=12.0.0'}
-
- tinypool@1.1.1:
- resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==}
- engines: {node: ^18.0.0 || >=20.0.0}
-
- tinyrainbow@2.0.0:
- resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==}
- engines: {node: '>=14.0.0'}
-
- tinyspy@4.0.4:
- resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==}
- engines: {node: '>=14.0.0'}
-
- ts-api-utils@2.5.0:
- resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==}
- engines: {node: '>=18.12'}
- peerDependencies:
- typescript: '>=4.8.4'
-
- type-check@0.4.0:
- resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
- engines: {node: '>= 0.8.0'}
-
- typescript-eslint@8.65.0:
- resolution: {integrity: sha512-/ggrHAwyjENDusvyxbuqxAC2dTnZg/Z8F+fgQtYIz+L6n/9HfSlEZcFGV/NsMNa6CkGk0xUjUAFwC0vHOflvIA==}
- 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@5.9.3:
- resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}
- engines: {node: '>=14.17'}
- hasBin: true
-
- 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-node@3.2.4:
- resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==}
- engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
- hasBin: true
-
- vite@7.3.6:
- resolution: {integrity: sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==}
- engines: {node: ^20.19.0 || >=22.12.0}
- hasBin: true
- peerDependencies:
- '@types/node': ^20.19.0 || >=22.12.0
- jiti: '>=1.21.0'
- less: ^4.0.0
- lightningcss: ^1.21.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
- jiti:
- optional: true
- less:
- optional: true
- lightningcss:
- 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@3.2.7:
- resolution: {integrity: sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==}
- engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
- hasBin: true
- peerDependencies:
- '@edge-runtime/vm': '*'
- '@types/debug': ^4.1.12
- '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0
- '@vitest/browser': 3.2.7
- '@vitest/ui': 3.2.7
- happy-dom: '*'
- jsdom: '*'
- peerDependenciesMeta:
- '@edge-runtime/vm':
- optional: true
- '@types/debug':
- optional: true
- '@types/node':
- optional: true
- '@vitest/browser':
- optional: true
- '@vitest/ui':
- optional: true
- happy-dom:
- optional: true
- jsdom:
- optional: true
-
- 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'}
-
- yallist@3.1.1:
- resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
-
- yocto-queue@0.1.0:
- resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
- engines: {node: '>=10'}
-
-snapshots:
-
- '@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-plugin-utils@7.29.7': {}
-
- '@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/plugin-transform-react-jsx-self@7.29.7(@babel/core@7.29.7)':
- dependencies:
- '@babel/core': 7.29.7
- '@babel/helper-plugin-utils': 7.29.7
-
- '@babel/plugin-transform-react-jsx-source@7.29.7(@babel/core@7.29.7)':
- dependencies:
- '@babel/core': 7.29.7
- '@babel/helper-plugin-utils': 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
-
- '@esbuild/aix-ppc64@0.28.1':
- optional: true
-
- '@esbuild/android-arm64@0.28.1':
- optional: true
-
- '@esbuild/android-arm@0.28.1':
- optional: true
-
- '@esbuild/android-x64@0.28.1':
- optional: true
-
- '@esbuild/darwin-arm64@0.28.1':
- optional: true
-
- '@esbuild/darwin-x64@0.28.1':
- optional: true
-
- '@esbuild/freebsd-arm64@0.28.1':
- optional: true
-
- '@esbuild/freebsd-x64@0.28.1':
- optional: true
-
- '@esbuild/linux-arm64@0.28.1':
- optional: true
-
- '@esbuild/linux-arm@0.28.1':
- optional: true
-
- '@esbuild/linux-ia32@0.28.1':
- optional: true
-
- '@esbuild/linux-loong64@0.28.1':
- optional: true
-
- '@esbuild/linux-mips64el@0.28.1':
- optional: true
-
- '@esbuild/linux-ppc64@0.28.1':
- optional: true
-
- '@esbuild/linux-riscv64@0.28.1':
- optional: true
-
- '@esbuild/linux-s390x@0.28.1':
- optional: true
-
- '@esbuild/linux-x64@0.28.1':
- optional: true
-
- '@esbuild/netbsd-arm64@0.28.1':
- optional: true
-
- '@esbuild/netbsd-x64@0.28.1':
- optional: true
-
- '@esbuild/openbsd-arm64@0.28.1':
- optional: true
-
- '@esbuild/openbsd-x64@0.28.1':
- optional: true
-
- '@esbuild/openharmony-arm64@0.28.1':
- optional: true
-
- '@esbuild/sunos-x64@0.28.1':
- optional: true
-
- '@esbuild/win32-arm64@0.28.1':
- optional: true
-
- '@esbuild/win32-ia32@0.28.1':
- optional: true
-
- '@esbuild/win32-x64@0.28.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
-
- '@fontsource-variable/jetbrains-mono@5.3.0': {}
-
- '@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
-
- '@rolldown/pluginutils@1.0.0-rc.3': {}
-
- '@rollup/rollup-android-arm-eabi@4.62.2':
- optional: true
-
- '@rollup/rollup-android-arm64@4.62.2':
- optional: true
-
- '@rollup/rollup-darwin-arm64@4.62.2':
- optional: true
-
- '@rollup/rollup-darwin-x64@4.62.2':
- optional: true
-
- '@rollup/rollup-freebsd-arm64@4.62.2':
- optional: true
-
- '@rollup/rollup-freebsd-x64@4.62.2':
- optional: true
-
- '@rollup/rollup-linux-arm-gnueabihf@4.62.2':
- optional: true
-
- '@rollup/rollup-linux-arm-musleabihf@4.62.2':
- optional: true
-
- '@rollup/rollup-linux-arm64-gnu@4.62.2':
- optional: true
-
- '@rollup/rollup-linux-arm64-musl@4.62.2':
- optional: true
-
- '@rollup/rollup-linux-loong64-gnu@4.62.2':
- optional: true
-
- '@rollup/rollup-linux-loong64-musl@4.62.2':
- optional: true
-
- '@rollup/rollup-linux-ppc64-gnu@4.62.2':
- optional: true
-
- '@rollup/rollup-linux-ppc64-musl@4.62.2':
- optional: true
-
- '@rollup/rollup-linux-riscv64-gnu@4.62.2':
- optional: true
-
- '@rollup/rollup-linux-riscv64-musl@4.62.2':
- optional: true
-
- '@rollup/rollup-linux-s390x-gnu@4.62.2':
- optional: true
-
- '@rollup/rollup-linux-x64-gnu@4.62.2':
- optional: true
-
- '@rollup/rollup-linux-x64-musl@4.62.2':
- optional: true
-
- '@rollup/rollup-openbsd-x64@4.62.2':
- optional: true
-
- '@rollup/rollup-openharmony-arm64@4.62.2':
- optional: true
-
- '@rollup/rollup-win32-arm64-msvc@4.62.2':
- optional: true
-
- '@rollup/rollup-win32-ia32-msvc@4.62.2':
- optional: true
-
- '@rollup/rollup-win32-x64-gnu@4.62.2':
- optional: true
-
- '@rollup/rollup-win32-x64-msvc@4.62.2':
- optional: true
-
- '@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
-
- '@tauri-apps/plugin-dialog@2.7.2':
- dependencies:
- '@tauri-apps/api': 2.11.1
-
- '@types/babel__core@7.20.5':
- dependencies:
- '@babel/parser': 7.29.7
- '@babel/types': 7.29.7
- '@types/babel__generator': 7.27.0
- '@types/babel__template': 7.4.4
- '@types/babel__traverse': 7.28.0
-
- '@types/babel__generator@7.27.0':
- dependencies:
- '@babel/types': 7.29.7
-
- '@types/babel__template@7.4.4':
- dependencies:
- '@babel/parser': 7.29.7
- '@babel/types': 7.29.7
-
- '@types/babel__traverse@7.28.0':
- dependencies:
- '@babel/types': 7.29.7
-
- '@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/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.65.0(@typescript-eslint/parser@8.65.0(eslint@10.7.0)(typescript@5.9.3))(eslint@10.7.0)(typescript@5.9.3)':
- dependencies:
- '@eslint-community/regexpp': 4.12.2
- '@typescript-eslint/parser': 8.65.0(eslint@10.7.0)(typescript@5.9.3)
- '@typescript-eslint/scope-manager': 8.65.0
- '@typescript-eslint/type-utils': 8.65.0(eslint@10.7.0)(typescript@5.9.3)
- '@typescript-eslint/utils': 8.65.0(eslint@10.7.0)(typescript@5.9.3)
- '@typescript-eslint/visitor-keys': 8.65.0
- eslint: 10.7.0
- ignore: 7.0.6
- natural-compare: 1.4.0
- ts-api-utils: 2.5.0(typescript@5.9.3)
- typescript: 5.9.3
- transitivePeerDependencies:
- - supports-color
-
- '@typescript-eslint/parser@8.65.0(eslint@10.7.0)(typescript@5.9.3)':
- dependencies:
- '@typescript-eslint/scope-manager': 8.65.0
- '@typescript-eslint/types': 8.65.0
- '@typescript-eslint/typescript-estree': 8.65.0(typescript@5.9.3)
- '@typescript-eslint/visitor-keys': 8.65.0
- debug: 4.4.3
- eslint: 10.7.0
- typescript: 5.9.3
- transitivePeerDependencies:
- - supports-color
-
- '@typescript-eslint/project-service@8.65.0(typescript@5.9.3)':
- dependencies:
- '@typescript-eslint/tsconfig-utils': 8.65.0(typescript@5.9.3)
- '@typescript-eslint/types': 8.65.0
- debug: 4.4.3
- typescript: 5.9.3
- transitivePeerDependencies:
- - supports-color
-
- '@typescript-eslint/scope-manager@8.65.0':
- dependencies:
- '@typescript-eslint/types': 8.65.0
- '@typescript-eslint/visitor-keys': 8.65.0
-
- '@typescript-eslint/tsconfig-utils@8.65.0(typescript@5.9.3)':
- dependencies:
- typescript: 5.9.3
-
- '@typescript-eslint/type-utils@8.65.0(eslint@10.7.0)(typescript@5.9.3)':
- dependencies:
- '@typescript-eslint/types': 8.65.0
- '@typescript-eslint/typescript-estree': 8.65.0(typescript@5.9.3)
- '@typescript-eslint/utils': 8.65.0(eslint@10.7.0)(typescript@5.9.3)
- debug: 4.4.3
- eslint: 10.7.0
- ts-api-utils: 2.5.0(typescript@5.9.3)
- typescript: 5.9.3
- transitivePeerDependencies:
- - supports-color
-
- '@typescript-eslint/types@8.65.0': {}
-
- '@typescript-eslint/typescript-estree@8.65.0(typescript@5.9.3)':
- dependencies:
- '@typescript-eslint/project-service': 8.65.0(typescript@5.9.3)
- '@typescript-eslint/tsconfig-utils': 8.65.0(typescript@5.9.3)
- '@typescript-eslint/types': 8.65.0
- '@typescript-eslint/visitor-keys': 8.65.0
- debug: 4.4.3
- minimatch: 10.2.5
- semver: 7.8.5
- tinyglobby: 0.2.17
- ts-api-utils: 2.5.0(typescript@5.9.3)
- typescript: 5.9.3
- transitivePeerDependencies:
- - supports-color
-
- '@typescript-eslint/utils@8.65.0(eslint@10.7.0)(typescript@5.9.3)':
- dependencies:
- '@eslint-community/eslint-utils': 4.9.1(eslint@10.7.0)
- '@typescript-eslint/scope-manager': 8.65.0
- '@typescript-eslint/types': 8.65.0
- '@typescript-eslint/typescript-estree': 8.65.0(typescript@5.9.3)
- eslint: 10.7.0
- typescript: 5.9.3
- transitivePeerDependencies:
- - supports-color
-
- '@typescript-eslint/visitor-keys@8.65.0':
- dependencies:
- '@typescript-eslint/types': 8.65.0
- eslint-visitor-keys: 5.0.1
-
- '@vitejs/plugin-react@5.2.0(vite@7.3.6)':
- dependencies:
- '@babel/core': 7.29.7
- '@babel/plugin-transform-react-jsx-self': 7.29.7(@babel/core@7.29.7)
- '@babel/plugin-transform-react-jsx-source': 7.29.7(@babel/core@7.29.7)
- '@rolldown/pluginutils': 1.0.0-rc.3
- '@types/babel__core': 7.20.5
- react-refresh: 0.18.0
- vite: 7.3.6
- transitivePeerDependencies:
- - supports-color
-
- '@vitest/expect@3.2.7':
- dependencies:
- '@types/chai': 5.2.3
- '@vitest/spy': 3.2.7
- '@vitest/utils': 3.2.7
- chai: 5.3.3
- tinyrainbow: 2.0.0
-
- '@vitest/mocker@3.2.7(vite@7.3.6)':
- dependencies:
- '@vitest/spy': 3.2.7
- estree-walker: 3.0.3
- magic-string: 0.30.21
- optionalDependencies:
- vite: 7.3.6
-
- '@vitest/pretty-format@3.2.7':
- dependencies:
- tinyrainbow: 2.0.0
-
- '@vitest/runner@3.2.7':
- dependencies:
- '@vitest/utils': 3.2.7
- pathe: 2.0.3
- strip-literal: 3.1.0
-
- '@vitest/snapshot@3.2.7':
- dependencies:
- '@vitest/pretty-format': 3.2.7
- magic-string: 0.30.21
- pathe: 2.0.3
-
- '@vitest/spy@3.2.7':
- dependencies:
- tinyspy: 4.0.4
-
- '@vitest/utils@3.2.7':
- dependencies:
- '@vitest/pretty-format': 3.2.7
- loupe: 3.2.1
- tinyrainbow: 2.0.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
-
- assertion-error@2.0.1: {}
-
- balanced-match@4.0.4: {}
-
- baseline-browser-mapping@2.10.44: {}
-
- brace-expansion@5.0.7:
- dependencies:
- balanced-match: 4.0.4
-
- browserslist@4.28.6:
- dependencies:
- baseline-browser-mapping: 2.10.44
- caniuse-lite: 1.0.30001806
- electron-to-chromium: 1.5.393
- node-releases: 2.0.51
- update-browserslist-db: 1.2.3(browserslist@4.28.6)
-
- cac@6.7.14: {}
-
- caniuse-lite@1.0.30001806: {}
-
- chai@5.3.3:
- dependencies:
- assertion-error: 2.0.1
- check-error: 2.1.3
- deep-eql: 5.0.2
- loupe: 3.2.1
- pathval: 2.0.1
-
- check-error@2.1.3: {}
-
- 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
-
- csstype@3.2.3: {}
-
- debug@4.4.3:
- dependencies:
- ms: 2.1.3
-
- deep-eql@5.0.2: {}
-
- deep-is@0.1.4: {}
-
- electron-to-chromium@1.5.393: {}
-
- es-module-lexer@1.7.0: {}
-
- esbuild@0.28.1:
- optionalDependencies:
- '@esbuild/aix-ppc64': 0.28.1
- '@esbuild/android-arm': 0.28.1
- '@esbuild/android-arm64': 0.28.1
- '@esbuild/android-x64': 0.28.1
- '@esbuild/darwin-arm64': 0.28.1
- '@esbuild/darwin-x64': 0.28.1
- '@esbuild/freebsd-arm64': 0.28.1
- '@esbuild/freebsd-x64': 0.28.1
- '@esbuild/linux-arm': 0.28.1
- '@esbuild/linux-arm64': 0.28.1
- '@esbuild/linux-ia32': 0.28.1
- '@esbuild/linux-loong64': 0.28.1
- '@esbuild/linux-mips64el': 0.28.1
- '@esbuild/linux-ppc64': 0.28.1
- '@esbuild/linux-riscv64': 0.28.1
- '@esbuild/linux-s390x': 0.28.1
- '@esbuild/linux-x64': 0.28.1
- '@esbuild/netbsd-arm64': 0.28.1
- '@esbuild/netbsd-x64': 0.28.1
- '@esbuild/openbsd-arm64': 0.28.1
- '@esbuild/openbsd-x64': 0.28.1
- '@esbuild/openharmony-arm64': 0.28.1
- '@esbuild/sunos-x64': 0.28.1
- '@esbuild/win32-arm64': 0.28.1
- '@esbuild/win32-ia32': 0.28.1
- '@esbuild/win32-x64': 0.28.1
-
- escalade@3.2.0: {}
-
- escape-string-regexp@4.0.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.3:
- optional: true
-
- gensync@1.0.0-beta.2: {}
-
- glob-parent@6.0.2:
- dependencies:
- is-glob: 4.0.3
-
- ignore@5.3.2: {}
-
- ignore@7.0.6: {}
-
- imurmurhash@0.1.4: {}
-
- is-extglob@2.1.1: {}
-
- is-glob@4.0.3:
- dependencies:
- is-extglob: 2.1.1
-
- isexe@2.0.0: {}
-
- js-tokens@4.0.0: {}
-
- js-tokens@9.0.1: {}
-
- 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
-
- locate-path@6.0.0:
- dependencies:
- p-locate: 5.0.0
-
- loupe@3.2.1: {}
-
- lru-cache@5.1.1:
- dependencies:
- yallist: 3.1.1
-
- lucide-react@1.25.0(react@19.2.7):
- dependencies:
- react: 19.2.7
-
- magic-string@0.30.21:
- dependencies:
- '@jridgewell/sourcemap-codec': 1.5.5
-
- 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: {}
-
- 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
-
- path-exists@4.0.0: {}
-
- path-key@3.1.1: {}
-
- pathe@2.0.3: {}
-
- pathval@2.0.1: {}
-
- picocolors@1.1.1: {}
-
- picomatch@4.0.5: {}
-
- postcss@8.5.20:
- dependencies:
- nanoid: 3.3.16
- picocolors: 1.1.1
- source-map-js: 1.2.1
-
- prelude-ls@1.2.1: {}
-
- prettier@3.9.5: {}
-
- punycode@2.3.1: {}
-
- react-dom@19.2.7(react@19.2.7):
- dependencies:
- react: 19.2.7
- scheduler: 0.27.0
-
- react-refresh@0.18.0: {}
-
- react@19.2.7: {}
-
- rollup@4.62.2:
- dependencies:
- '@types/estree': 1.0.9
- optionalDependencies:
- '@rollup/rollup-android-arm-eabi': 4.62.2
- '@rollup/rollup-android-arm64': 4.62.2
- '@rollup/rollup-darwin-arm64': 4.62.2
- '@rollup/rollup-darwin-x64': 4.62.2
- '@rollup/rollup-freebsd-arm64': 4.62.2
- '@rollup/rollup-freebsd-x64': 4.62.2
- '@rollup/rollup-linux-arm-gnueabihf': 4.62.2
- '@rollup/rollup-linux-arm-musleabihf': 4.62.2
- '@rollup/rollup-linux-arm64-gnu': 4.62.2
- '@rollup/rollup-linux-arm64-musl': 4.62.2
- '@rollup/rollup-linux-loong64-gnu': 4.62.2
- '@rollup/rollup-linux-loong64-musl': 4.62.2
- '@rollup/rollup-linux-ppc64-gnu': 4.62.2
- '@rollup/rollup-linux-ppc64-musl': 4.62.2
- '@rollup/rollup-linux-riscv64-gnu': 4.62.2
- '@rollup/rollup-linux-riscv64-musl': 4.62.2
- '@rollup/rollup-linux-s390x-gnu': 4.62.2
- '@rollup/rollup-linux-x64-gnu': 4.62.2
- '@rollup/rollup-linux-x64-musl': 4.62.2
- '@rollup/rollup-openbsd-x64': 4.62.2
- '@rollup/rollup-openharmony-arm64': 4.62.2
- '@rollup/rollup-win32-arm64-msvc': 4.62.2
- '@rollup/rollup-win32-ia32-msvc': 4.62.2
- '@rollup/rollup-win32-x64-gnu': 4.62.2
- '@rollup/rollup-win32-x64-msvc': 4.62.2
- fsevents: 2.3.3
-
- 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@3.10.0: {}
-
- strip-literal@3.1.0:
- dependencies:
- js-tokens: 9.0.1
-
- tinybench@2.9.0: {}
-
- tinyexec@0.3.2: {}
-
- tinyglobby@0.2.17:
- dependencies:
- fdir: 6.5.0(picomatch@4.0.5)
- picomatch: 4.0.5
-
- tinypool@1.1.1: {}
-
- tinyrainbow@2.0.0: {}
-
- tinyspy@4.0.4: {}
-
- ts-api-utils@2.5.0(typescript@5.9.3):
- dependencies:
- typescript: 5.9.3
-
- type-check@0.4.0:
- dependencies:
- prelude-ls: 1.2.1
-
- typescript-eslint@8.65.0(eslint@10.7.0)(typescript@5.9.3):
- dependencies:
- '@typescript-eslint/eslint-plugin': 8.65.0(@typescript-eslint/parser@8.65.0(eslint@10.7.0)(typescript@5.9.3))(eslint@10.7.0)(typescript@5.9.3)
- '@typescript-eslint/parser': 8.65.0(eslint@10.7.0)(typescript@5.9.3)
- '@typescript-eslint/typescript-estree': 8.65.0(typescript@5.9.3)
- '@typescript-eslint/utils': 8.65.0(eslint@10.7.0)(typescript@5.9.3)
- eslint: 10.7.0
- typescript: 5.9.3
- transitivePeerDependencies:
- - supports-color
-
- typescript@5.9.3: {}
-
- 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-node@3.2.4:
- dependencies:
- cac: 6.7.14
- debug: 4.4.3
- es-module-lexer: 1.7.0
- pathe: 2.0.3
- vite: 7.3.6
- transitivePeerDependencies:
- - '@types/node'
- - jiti
- - less
- - lightningcss
- - sass
- - sass-embedded
- - stylus
- - sugarss
- - supports-color
- - terser
- - tsx
- - yaml
-
- vite@7.3.6:
- dependencies:
- esbuild: 0.28.1
- fdir: 6.5.0(picomatch@4.0.5)
- picomatch: 4.0.5
- postcss: 8.5.20
- rollup: 4.62.2
- tinyglobby: 0.2.17
- optionalDependencies:
- fsevents: 2.3.3
-
- vitest@3.2.7:
- dependencies:
- '@types/chai': 5.2.3
- '@vitest/expect': 3.2.7
- '@vitest/mocker': 3.2.7(vite@7.3.6)
- '@vitest/pretty-format': 3.2.7
- '@vitest/runner': 3.2.7
- '@vitest/snapshot': 3.2.7
- '@vitest/spy': 3.2.7
- '@vitest/utils': 3.2.7
- chai: 5.3.3
- debug: 4.4.3
- expect-type: 1.4.0
- magic-string: 0.30.21
- pathe: 2.0.3
- picomatch: 4.0.5
- std-env: 3.10.0
- tinybench: 2.9.0
- tinyexec: 0.3.2
- tinyglobby: 0.2.17
- tinypool: 1.1.1
- tinyrainbow: 2.0.0
- vite: 7.3.6
- vite-node: 3.2.4
- why-is-node-running: 2.3.0
- transitivePeerDependencies:
- - jiti
- - less
- - lightningcss
- - msw
- - sass
- - sass-embedded
- - stylus
- - sugarss
- - supports-color
- - terser
- - tsx
- - yaml
-
- 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: {}
-
- yallist@3.1.1: {}
-
- yocto-queue@0.1.0: {}
diff --git a/release.cmd b/release.cmd
new file mode 100644
index 0000000..fdbc198
--- /dev/null
+++ b/release.cmd
@@ -0,0 +1,8 @@
+@echo off
+where pwsh >nul 2>nul
+if errorlevel 1 (
+ powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\prepare-release.ps1" -Publish %*
+) else (
+ pwsh -NoProfile -File "%~dp0scripts\prepare-release.ps1" -Publish %*
+)
+exit /b %errorlevel%
diff --git a/scripts/audit-windows-smoke.ps1 b/scripts/audit-windows-smoke.ps1
index 885b191..f0cd71c 100644
--- a/scripts/audit-windows-smoke.ps1
+++ b/scripts/audit-windows-smoke.ps1
@@ -2,8 +2,9 @@ param(
[ValidateSet("PlanOnly", "Capture")]
[string]$Mode = "PlanOnly",
[string]$DataRoot = "C:\ProgramData\ProxyWarden",
- [string]$ProxiFyreRoot = "C:\Tools\ProxiFyre",
- [string]$SingBoxRoot = "C:\Program Files\ProxyWarden\sing-box",
+ [string]$AppRoot = "C:\Program Files\ProxyWarden",
+ [string]$ProxiFyreRoot = "C:\Program Files\ProxyWarden\components\ProxiFyre",
+ [string]$SingBoxRoot = "C:\Program Files\ProxyWarden\components\sing-box",
[string]$ForeignServiceName = "",
[string]$OutputPath = ""
)
@@ -110,10 +111,35 @@ function Get-SecretFindingCategories {
return $findings
}
+function Get-InternalStateEvidence {
+ param([string]$Root)
+
+ $categories = [ordered]@{
+ cutoverJournal = ".proxywarden-cutover"
+ cutoverQuarantine = ".proxywarden-quarantine"
+ packageStaging = ".proxywarden-package-staging"
+ privilegedJobs = ".proxywarden-privileged-jobs"
+ serviceLogs = ".proxywarden-service-logs"
+ singBoxCleanupTombstone = ".proxywarden-sing-box-cleanup"
+ }
+
+ $result = @()
+ foreach ($entry in $categories.GetEnumerator()) {
+ $path = Join-Path $Root $entry.Value
+ $item = Get-Item -LiteralPath $path -Force -ErrorAction SilentlyContinue
+ $result += [ordered]@{
+ category = $entry.Key
+ present = $null -ne $item
+ itemType = if ($null -eq $item) { $null } elseif ($item.PSIsContainer) { "directory" } else { "file" }
+ }
+ }
+ return $result
+}
+
try {
- $quotedServiceFixture = '"C:\Program Files\ProxyWarden\sing-box\ProxyWardenSingBox.exe" -service'
+ $quotedServiceFixture = '"C:\Program Files\ProxyWarden\components\sing-box\ProxyWardenSingBox.exe" -service'
$quotedExecutable = Get-ServiceExecutablePath -PathName $quotedServiceFixture
- if (-not (Test-PathUnderRoot -Path $quotedExecutable -Root "C:\Program Files\ProxyWarden\sing-box")) {
+ if (-not (Test-PathUnderRoot -Path $quotedExecutable -Root "C:\Program Files\ProxyWarden\components\sing-box")) {
throw "Quoted service PathName ownership self-test failed."
}
@@ -122,11 +148,12 @@ try {
serviceNames = @("ProxiFyreService", "ProxyWardenSingBox")
foreignServiceName = $ForeignServiceName
roots = [ordered]@{
+ app = [IO.Path]::GetFullPath($AppRoot)
data = [IO.Path]::GetFullPath($DataRoot)
proxifyre = [IO.Path]::GetFullPath($ProxiFyreRoot)
singbox = [IO.Path]::GetFullPath($SingBoxRoot)
}
- checks = @("service-state-and-path", "managed-root-membership", "file-metadata", "secret-category-scan")
+ checks = @("service-state-and-path", "managed-root-membership", "file-metadata", "secret-category-scan", "internal-state-presence-only")
}
if ($Mode -eq "PlanOnly") {
@@ -167,6 +194,7 @@ try {
ownership = $ownership
files = @(Get-FileEvidence -Root $DataRoot)
secretFindingCategories = @(Get-SecretFindingCategories -Root $DataRoot)
+ internalState = @(Get-InternalStateEvidence -Root $AppRoot)
}
$report | ConvertTo-Json -Depth 8 | Set-Content -LiteralPath $outputFullPath -Encoding UTF8
@@ -175,6 +203,7 @@ try {
serviceCount = @($services | Where-Object found).Count
fileCount = @($report.files).Count
secretFindingCount = @($report.secretFindingCategories).Count
+ internalStateCategoryCount = @($report.internalState).Count
}
} catch {
New-Result -Success $false -Action "audit-windows-smoke.$($Mode.ToLowerInvariant())" -Changed $false -Message $_.Exception.Message -Details @{}
diff --git a/scripts/check-runtime-powershell-boundary.ps1 b/scripts/check-runtime-powershell-boundary.ps1
new file mode 100644
index 0000000..c3f93f3
--- /dev/null
+++ b/scripts/check-runtime-powershell-boundary.ps1
@@ -0,0 +1,253 @@
+[CmdletBinding()]
+param(
+ [switch]$CheckOnly
+)
+
+Set-StrictMode -Version Latest
+$ErrorActionPreference = "Stop"
+
+$RepoRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot ".."))
+$AllowedPowerShellFiles = @(
+ "scripts/audit-windows-smoke.ps1",
+ "scripts/check-runtime-powershell-boundary.ps1",
+ "scripts/prepare-release.ps1",
+ "scripts/update-component-bundle.ps1"
+)
+$ExpectedNsisFlags = @(
+ "--nsis-uninstall-managed",
+ "--nsis-verify-upgrade"
+)
+$IgnoredPathPattern = '^(?:\.git|node_modules|dist|releases|src-tauri/target)(?:/|$)'
+
+function Get-RelativeRepoPath {
+ param([string]$Path)
+
+ $rootUri = [Uri]($RepoRoot.TrimEnd("\", "/") + [IO.Path]::DirectorySeparatorChar)
+ $pathUri = [Uri][IO.Path]::GetFullPath($Path)
+ [Uri]::UnescapeDataString($rootUri.MakeRelativeUri($pathUri).ToString()).Replace("\", "/")
+}
+
+function New-Violation {
+ param(
+ [string]$Rule,
+ [string]$Path,
+ [string]$Message,
+ [int]$Line = 0
+ )
+
+ [ordered]@{
+ rule = $Rule
+ path = $Path
+ line = $Line
+ message = $Message
+ }
+}
+
+function Get-ProductionLines {
+ param([string]$Path)
+
+ $lines = @(Get-Content -LiteralPath $Path)
+ for ($index = 0; $index -lt $lines.Count; $index++) {
+ if ($lines[$index] -match '^\s*#\s*\[\s*cfg\s*\(\s*test\s*\)\s*\]') {
+ if ($index -eq 0) { return @() }
+ return @($lines[0..($index - 1)])
+ }
+ }
+ return $lines
+}
+
+function Write-Result {
+ param(
+ [bool]$Success,
+ [string]$Message,
+ [object[]]$Violations,
+ [int]$PowerShellFileCount,
+ [int]$ProductionFileCount,
+ [string[]]$ObservedNsisFlags
+ )
+
+ [ordered]@{
+ success = $Success
+ action = "runtime-powershell-boundary.check"
+ changed = $false
+ message = $Message
+ details = [ordered]@{
+ allowlistedPowerShellFiles = $AllowedPowerShellFiles
+ scannedPowerShellFileCount = $PowerShellFileCount
+ scannedProductionFileCount = $ProductionFileCount
+ expectedNsisFlags = $ExpectedNsisFlags
+ observedNsisFlags = $ObservedNsisFlags
+ violations = $Violations
+ }
+ } | ConvertTo-Json -Depth 8
+}
+
+$violations = New-Object System.Collections.Generic.List[object]
+$powerShellFileCount = 0
+$productionFileCount = 0
+$observedNsisFlags = @()
+
+try {
+ if (-not $CheckOnly) {
+ [void]$violations.Add((New-Violation `
+ -Rule "check-only-required" `
+ -Path "scripts/check-runtime-powershell-boundary.ps1" `
+ -Message "Invoke this read-only boundary as -CheckOnly."))
+ }
+
+ $powerShellFiles = @(
+ Get-ChildItem -LiteralPath $RepoRoot -Recurse -File |
+ Where-Object { $_.Extension -in @(".ps1", ".psm1", ".psd1") } |
+ ForEach-Object {
+ [ordered]@{
+ fullPath = $_.FullName
+ relativePath = Get-RelativeRepoPath -Path $_.FullName
+ }
+ } |
+ Where-Object { $_.relativePath -notmatch $IgnoredPathPattern } |
+ Sort-Object relativePath
+ )
+ $powerShellFileCount = $powerShellFiles.Count
+
+ foreach ($file in $powerShellFiles) {
+ if ($file.relativePath -notin $AllowedPowerShellFiles) {
+ [void]$violations.Add((New-Violation `
+ -Rule "unexpected-powershell-file" `
+ -Path $file.relativePath `
+ -Message "PowerShell is allowed only for the exact build/release/QA allowlist."))
+ }
+ }
+ foreach ($allowedPath in $AllowedPowerShellFiles) {
+ if ($allowedPath -notin $powerShellFiles.relativePath) {
+ [void]$violations.Add((New-Violation `
+ -Rule "missing-allowlisted-tool" `
+ -Path $allowedPath `
+ -Message "Required build/release/QA tool is missing."))
+ }
+ }
+
+ $forbiddenRuntimeFiles = @(
+ "src-tauri/src/elevated_scripts.rs",
+ "src-tauri/src/helper.rs",
+ "src-tauri/src/powershell.rs",
+ "src-tauri/src/proxifyre_scripts.rs",
+ "src-tauri/bundled/cleanup/uninstall-managed-components.ps1"
+ )
+ foreach ($relativePath in $forbiddenRuntimeFiles) {
+ if (Test-Path -LiteralPath (Join-Path $RepoRoot $relativePath.Replace("/", "\"))) {
+ [void]$violations.Add((New-Violation `
+ -Rule "legacy-runtime-file" `
+ -Path $relativePath `
+ -Message "Legacy runtime PowerShell owner must be deleted after the native cutover."))
+ }
+ }
+
+ $tauriConfigPath = Join-Path $RepoRoot "src-tauri\tauri.conf.json"
+ if ((Get-Content -LiteralPath $tauriConfigPath -Raw) -match '(?i)bundled[\\/]cleanup') {
+ [void]$violations.Add((New-Violation `
+ -Rule "bundled-cleanup-resource" `
+ -Path "src-tauri/tauri.conf.json" `
+ -Message "The installer must not package the displaced PowerShell cleanup resource."))
+ }
+
+ $productionFiles = @(
+ Get-ChildItem -LiteralPath (Join-Path $RepoRoot "src-tauri\src") -Recurse -File -Filter "*.rs"
+ Get-ChildItem -LiteralPath (Join-Path $RepoRoot "src-tauri\bundled\installer-hooks") -Recurse -File | Where-Object { $_.Extension -in @(".nsh", ".nsi") }
+ )
+ $productionFileCount = $productionFiles.Count
+ $rules = @(
+ [ordered]@{ name = "powershell-process"; pattern = '(?i)(?:command_no_window|Command::new).*\b(?:powershell|pwsh)(?:\.exe)?\b' },
+ [ordered]@{ name = "powershell-command-line"; pattern = '(?i)\b(?:powershell|pwsh)(?:\.exe)?\b\s+-[A-Za-z]' },
+ [ordered]@{ name = "powershell-policy-bypass"; pattern = '(?i)-ExecutionPolicy\b' },
+ [ordered]@{ name = "powershell-script-path"; pattern = '(?i)\.ps1\b' },
+ [ordered]@{ name = "powershell-runtime-helper"; pattern = '(?i)\b(?:run|write)_powershell_(?:command|file|script)\b' },
+ [ordered]@{ name = "legacy-module-declaration"; pattern = '(?i)\b(?:pub\s+)?mod\s+(?:elevated_scripts|helper|powershell|proxifyre_scripts)\s*;' },
+ [ordered]@{ name = "legacy-module-reexport"; pattern = '(?i)\bpub\s+use\s+crate::(?:elevated_scripts|helper|powershell|proxifyre_scripts)\b' }
+ )
+
+ $productionTextParts = New-Object System.Collections.Generic.List[string]
+ $rustTextParts = New-Object System.Collections.Generic.List[string]
+ foreach ($file in $productionFiles) {
+ $relativePath = Get-RelativeRepoPath -Path $file.FullName
+ $lines = @(Get-ProductionLines -Path $file.FullName)
+ for ($index = 0; $index -lt $lines.Count; $index++) {
+ $line = [string]$lines[$index]
+ [void]$productionTextParts.Add($line)
+ if ($file.Extension -ieq ".rs") {
+ [void]$rustTextParts.Add($line)
+ }
+ foreach ($rule in $rules) {
+ if ($line -match $rule.pattern) {
+ [void]$violations.Add((New-Violation `
+ -Rule $rule.name `
+ -Path $relativePath `
+ -Line ($index + 1) `
+ -Message "Production code still contains a PowerShell runtime boundary."))
+ }
+ }
+ }
+ }
+
+ $productionText = $productionTextParts -join "`n"
+ $rustText = $rustTextParts -join "`n"
+ $observedNsisFlags = @(
+ [regex]::Matches($productionText, '--nsis-[a-z0-9-]+', [Text.RegularExpressions.RegexOptions]::IgnoreCase) |
+ ForEach-Object { $_.Value.ToLowerInvariant() } |
+ Sort-Object -Unique
+ )
+ foreach ($flag in $ExpectedNsisFlags) {
+ if (-not $rustText.Contains($flag)) {
+ [void]$violations.Add((New-Violation `
+ -Rule "missing-nsis-runtime-mode" `
+ -Path "src-tauri/src" `
+ -Message "Rust early-mode parser is missing fixed NSIS mode: $flag"))
+ }
+ }
+ foreach ($flag in $observedNsisFlags) {
+ if ($flag -notin $ExpectedNsisFlags) {
+ [void]$violations.Add((New-Violation `
+ -Rule "unexpected-nsis-mode" `
+ -Path "src-tauri" `
+ -Message "Unexpected reserved NSIS early mode: $flag"))
+ }
+ }
+
+ $hookPath = Join-Path $RepoRoot "src-tauri\bundled\installer-hooks\proxywarden-hooks.nsh"
+ $hookText = Get-Content -LiteralPath $hookPath -Raw
+ foreach ($flag in $ExpectedNsisFlags) {
+ if (-not $hookText.Contains($flag)) {
+ [void]$violations.Add((New-Violation `
+ -Rule "missing-nsis-hook-mode" `
+ -Path "src-tauri/bundled/installer-hooks/proxywarden-hooks.nsh" `
+ -Message "Installer hook does not call fixed early mode: $flag"))
+ }
+ }
+
+ $success = $violations.Count -eq 0
+ $message = if ($success) {
+ "Runtime PowerShell boundary is clean."
+ } else {
+ "Runtime PowerShell boundary has $($violations.Count) violation(s)."
+ }
+ Write-Result `
+ -Success $success `
+ -Message $message `
+ -Violations $violations.ToArray() `
+ -PowerShellFileCount $powerShellFileCount `
+ -ProductionFileCount $productionFileCount `
+ -ObservedNsisFlags $observedNsisFlags
+ if (-not $success) { exit 1 }
+} catch {
+ $failure = New-Violation `
+ -Rule "checker-error" `
+ -Path "scripts/check-runtime-powershell-boundary.ps1" `
+ -Message $_.Exception.Message
+ Write-Result `
+ -Success $false `
+ -Message "Runtime PowerShell boundary check could not complete." `
+ -Violations @($failure) `
+ -PowerShellFileCount $powerShellFileCount `
+ -ProductionFileCount $productionFileCount `
+ -ObservedNsisFlags $observedNsisFlags
+ exit 1
+}
diff --git a/scripts/install-control-app.ps1 b/scripts/install-control-app.ps1
deleted file mode 100644
index a49e460..0000000
--- a/scripts/install-control-app.ps1
+++ /dev/null
@@ -1,79 +0,0 @@
-param(
- [string]$InstallRoot = "C:\Program Files\ProxyWarden\ControlApp",
- [string]$DataRoot = "C:\ProgramData\ProxyWarden",
- [switch]$PlanOnly,
- [switch]$Force
-)
-
-$ErrorActionPreference = "Stop"
-
-function New-Result {
- param(
- [bool]$Success,
- [string]$Action,
- [bool]$Changed,
- [string]$Message,
- [hashtable]$Details = @{}
- )
-
- [ordered]@{
- success = $Success
- action = $Action
- changed = $Changed
- message = $Message
- details = $Details
- } | ConvertTo-Json -Depth 6
-}
-
-function Test-IsAdministrator {
- $identity = [Security.Principal.WindowsIdentity]::GetCurrent()
- $principal = [Security.Principal.WindowsPrincipal]::new($identity)
- $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
-}
-
-function Ensure-Directory {
- param([string]$Path)
- if (-not (Test-Path -LiteralPath $Path)) {
- New-Item -ItemType Directory -Path $Path -Force | Out-Null
- return $true
- }
- return $false
-}
-
-try {
- $details = @{
- installRoot = $InstallRoot
- dataRoot = $DataRoot
- planOnly = [bool]$PlanOnly
- }
-
- if ($PlanOnly) {
- New-Result -Success $true -Action "install-control-app" -Changed $false -Message "Control App install plan is ready." -Details $details
- exit 0
- }
-
- if (-not (Test-IsAdministrator)) {
- New-Result -Success $false -Action "install-control-app" -Changed $false -Message "Administrator rights are required." -Details $details
- exit 1
- }
-
- $changed = $false
- $changed = (Ensure-Directory -Path $InstallRoot) -or $changed
- $changed = (Ensure-Directory -Path (Join-Path $DataRoot "config")) -or $changed
- $changed = (Ensure-Directory -Path (Join-Path $DataRoot "state")) -or $changed
- $changed = (Ensure-Directory -Path (Join-Path $DataRoot "generated")) -or $changed
-
- $markerPath = Join-Path $InstallRoot "install-control-app.marker.json"
- if ((-not (Test-Path -LiteralPath $markerPath)) -or $Force) {
- @{ component = "control-app"; installedAt = (Get-Date).ToString("o") } |
- ConvertTo-Json -Depth 4 |
- Set-Content -LiteralPath $markerPath -Encoding UTF8
- $changed = $true
- }
-
- $details.markerPath = $markerPath
- New-Result -Success $true -Action "install-control-app" -Changed $changed -Message "Control App directories are installed." -Details $details
-} catch {
- New-Result -Success $false -Action "install-control-app" -Changed $false -Message $_.Exception.Message
- exit 1
-}
diff --git a/scripts/install-proxyfier.ps1 b/scripts/install-proxyfier.ps1
deleted file mode 100644
index 74cdc63..0000000
--- a/scripts/install-proxyfier.ps1
+++ /dev/null
@@ -1,96 +0,0 @@
-param(
- [string]$InstallRoot = "C:\Program Files\ProxyWarden\components\ProxiFyre",
- [string]$PackagePath = "",
- [string]$ServiceName = "ProxiFyreService",
- [switch]$PlanOnly,
- [switch]$Force
-)
-
-$ErrorActionPreference = "Stop"
-
-function New-Result {
- param(
- [bool]$Success,
- [string]$Action,
- [bool]$Changed,
- [string]$Message,
- [hashtable]$Details = @{}
- )
-
- [ordered]@{
- success = $Success
- action = $Action
- changed = $Changed
- message = $Message
- details = $Details
- } | ConvertTo-Json -Depth 6
-}
-
-function Test-IsAdministrator {
- $identity = [Security.Principal.WindowsIdentity]::GetCurrent()
- $principal = [Security.Principal.WindowsPrincipal]::new($identity)
- $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
-}
-
-function Backup-File {
- param([string]$Path)
- if (Test-Path -LiteralPath $Path) {
- $backup = "$Path.bak"
- Copy-Item -LiteralPath $Path -Destination $backup -Force
- return $backup
- }
- return $null
-}
-
-try {
- $details = @{
- installRoot = $InstallRoot
- packagePath = $PackagePath
- serviceName = $ServiceName
- planOnly = [bool]$PlanOnly
- }
-
- if ($PlanOnly) {
- New-Result -Success $true -Action "install-proxyfier" -Changed $false -Message "Proxyfier install plan is ready." -Details $details
- exit 0
- }
-
- if (-not (Test-IsAdministrator)) {
- New-Result -Success $false -Action "install-proxyfier" -Changed $false -Message "Administrator rights are required." -Details $details
- exit 1
- }
-
- if ([string]::IsNullOrWhiteSpace($PackagePath) -or -not (Test-Path -LiteralPath $PackagePath)) {
- New-Result -Success $false -Action "install-proxyfier" -Changed $false -Message "PackagePath is required and must point to a local ProxiFyre package." -Details $details
- exit 2
- }
-
- $changed = $false
- if (-not (Test-Path -LiteralPath $InstallRoot)) {
- New-Item -ItemType Directory -Path $InstallRoot -Force | Out-Null
- $changed = $true
- }
-
- $configPath = Join-Path $InstallRoot "app-config.json"
- $backupPath = Backup-File -Path $configPath
- if ($backupPath) {
- $details.backupPath = $backupPath
- }
-
- $markerPath = Join-Path $InstallRoot "install-proxyfier.marker.json"
- if ((-not (Test-Path -LiteralPath $markerPath)) -or $Force) {
- @{
- component = "proxyfier"
- packagePath = $PackagePath
- serviceName = $ServiceName
- installedAt = (Get-Date).ToString("o")
- } | ConvertTo-Json -Depth 4 | Set-Content -LiteralPath $markerPath -Encoding UTF8
- $changed = $true
- }
-
- $details.markerPath = $markerPath
- New-Result -Success $true -Action "install-proxyfier" -Changed $changed -Message "Proxyfier install boundary completed." -Details $details
-} catch {
- New-Result -Success $false -Action "install-proxyfier" -Changed $false -Message $_.Exception.Message
- exit 1
-}
diff --git a/scripts/install-singbox.ps1 b/scripts/install-singbox.ps1
deleted file mode 100644
index f2e6cb3..0000000
--- a/scripts/install-singbox.ps1
+++ /dev/null
@@ -1,270 +0,0 @@
-param(
- [string]$InstallRoot = "C:\Program Files\ProxyWarden\components\sing-box",
- [string]$ServiceName = "ProxyWardenSingBox",
- [string]$ConfigSource = "C:\ProgramData\ProxyWarden\generated\sing-box-config.json",
- [switch]$PlanOnly,
- [switch]$Force,
- [switch]$Uninstall
-)
-
-$ErrorActionPreference = "Stop"
-
-$SingBoxReleaseApi = "https://api.github.com/repos/SagerNet/sing-box/releases/latest"
-$WinSwReleaseApi = "https://api.github.com/repos/winsw/winsw/releases/latest"
-$WrapperFile = "$ServiceName.exe"
-$ConfigFile = "config.json"
-
-function New-Result {
- param(
- [bool]$Success,
- [string]$Action,
- [bool]$Changed,
- [string]$Message,
- [hashtable]$Details = @{}
- )
-
- [ordered]@{
- success = $Success
- action = $Action
- changed = $Changed
- message = $Message
- details = $Details
- } | ConvertTo-Json -Depth 8
-}
-
-function Test-IsAdministrator {
- $identity = [Security.Principal.WindowsIdentity]::GetCurrent()
- $principal = [Security.Principal.WindowsPrincipal]::new($identity)
- $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
-}
-
-function Get-NativeArchitecture {
- $processor = Get-CimInstance Win32_Processor | Select-Object -First 1
- if ($null -ne $processor -and $processor.Architecture -eq 12) { return "arm64" }
- if ([Environment]::Is64BitOperatingSystem) { return "amd64" }
- return "386"
-}
-
-function Get-WinSwArchitecture {
- param([string]$Arch)
- if ($Arch -eq "arm64") { return "arm64" }
- if ($Arch -eq "386") { return "x86" }
- return "x64"
-}
-
-function Invoke-Download {
- param([string]$Uri, [string]$Path)
- Invoke-WebRequest -UseBasicParsing -Uri $Uri -OutFile $Path -Headers @{ "User-Agent" = "proxywarden" }
-}
-
-function Select-Asset {
- param(
- [object[]]$Assets,
- [string]$Pattern,
- [string]$Label
- )
-
- $asset = $Assets | Where-Object { $_.name -match $Pattern } | Select-Object -First 1
- if ($null -eq $asset) {
- throw "Не найден release asset для $Label по шаблону $Pattern."
- }
- return $asset
-}
-
-function Test-SafeInstallRoot {
- param([string]$Path)
- $full = [System.IO.Path]::GetFullPath($Path).TrimEnd("\")
- $leaf = Split-Path -Leaf $full
- $parent = Split-Path -Parent $full
- if ($leaf -ne "sing-box") { return $false }
- return $parent -match "\\ProxyWarden\\components$|\\proxywarden\\components$|\\ProxyWarden$|\\proxywarden$"
-}
-
-function Backup-File {
- param([string]$Path)
- if (Test-Path -LiteralPath $Path) {
- $backup = "$Path.bak"
- Copy-Item -LiteralPath $Path -Destination $backup -Force
- return $backup
- }
- return $null
-}
-
-function Write-Utf8NoBomFile {
- param(
- [string]$Path,
- [string]$Value
- )
-
- $encoding = New-Object System.Text.UTF8Encoding $false
- [System.IO.File]::WriteAllText($Path, $Value, $encoding)
-}
-
-function Write-WinSwConfig {
- param(
- [string]$Root,
- [string]$Name
- )
-
- $xmlPath = Join-Path $Root "$Name.xml"
- $logDir = Join-Path $Root "logs"
- New-Item -ItemType Directory -Path $logDir -Force | Out-Null
- $xml = @"
-
- $Name
- ProxyWarden Local sing-box
- Local sing-box runtime managed by ProxyWarden.
- %BASE%\sing-box.exe
- run -c "%BASE%\config.json"
- %BASE%\logs
-
- 10485760
- 4
-
-
-
-"@
- Write-Utf8NoBomFile -Path $xmlPath -Value $xml
- return $xmlPath
-}
-
-function Stop-And-Uninstall-Service {
- param(
- [string]$Root,
- [string]$Name
- )
-
- $wrapper = Join-Path $Root "$Name.exe"
- $service = Get-Service -Name $Name -ErrorAction SilentlyContinue
- if ($null -ne $service -and $service.Status -ne "Stopped") {
- Stop-Service -Name $Name -Force -ErrorAction SilentlyContinue
- $service = Get-Service -Name $Name -ErrorAction SilentlyContinue
- if ($null -ne $service) {
- try { $service.WaitForStatus("Stopped", [TimeSpan]::FromSeconds(15)) } catch {}
- }
- }
-
- if (Test-Path -LiteralPath $wrapper) {
- Push-Location $Root
- try { & $wrapper uninstall | Out-Null } finally { Pop-Location }
- }
-
- $service = Get-Service -Name $Name -ErrorAction SilentlyContinue
- if ($null -ne $service) {
- sc.exe delete $Name | Out-Null
- }
-}
-
-try {
- [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
- $installRootFull = [System.IO.Path]::GetFullPath($InstallRoot)
- $details = @{
- installRoot = $installRootFull
- serviceName = $ServiceName
- configSource = $ConfigSource
- singboxReleaseApi = $SingBoxReleaseApi
- winswReleaseApi = $WinSwReleaseApi
- planOnly = [bool]$PlanOnly
- uninstall = [bool]$Uninstall
- }
-
- if ($PlanOnly) {
- $details.items = @(
- @{ id = "sing-box-binary"; name = "sing-box.exe"; source = $SingBoxReleaseApi; target = (Join-Path $installRootFull "sing-box.exe") },
- @{ id = "winsw-wrapper"; name = $WrapperFile; source = $WinSwReleaseApi; target = (Join-Path $installRootFull $WrapperFile) },
- @{ id = "windows-service"; name = $ServiceName; target = "Windows Service" },
- @{ id = "config"; name = $ConfigFile; source = $ConfigSource; target = (Join-Path $installRootFull $ConfigFile) }
- )
- New-Result -Success $true -Action "install-singbox.plan" -Changed $false -Message "Local sing-box install plan is ready." -Details $details
- exit 0
- }
-
- if (-not (Test-IsAdministrator)) {
- New-Result -Success $false -Action "install-singbox" -Changed $false -Message "Administrator rights are required." -Details $details
- exit 1
- }
-
- if ($Uninstall) {
- if (-not (Test-SafeInstallRoot -Path $installRootFull)) {
- New-Result -Success $false -Action "uninstall-singbox" -Changed $false -Message "Unsafe InstallRoot for recursive uninstall." -Details $details
- exit 2
- }
-
- Stop-And-Uninstall-Service -Root $installRootFull -Name $ServiceName
- if (Test-Path -LiteralPath $installRootFull) {
- Remove-Item -LiteralPath $installRootFull -Recurse -Force
- }
- New-Result -Success $true -Action "uninstall-singbox" -Changed $true -Message "Local sing-box service and install folder were removed." -Details $details
- exit 0
- }
-
- $changed = $false
- New-Item -ItemType Directory -Path $installRootFull -Force | Out-Null
- $workDir = Join-Path ([System.IO.Path]::GetTempPath()) ("proxywarden-singbox-" + [guid]::NewGuid().ToString("N"))
- $extractDir = Join-Path $workDir "extract"
- New-Item -ItemType Directory -Path $extractDir -Force | Out-Null
-
- try {
- $arch = Get-NativeArchitecture
- $winswArch = Get-WinSwArchitecture -Arch $arch
- $details.architecture = $arch
- $details.winswArchitecture = $winswArch
-
- $singboxRelease = Invoke-RestMethod -Uri $SingBoxReleaseApi -Headers @{ "User-Agent" = "proxywarden" }
- $singboxAsset = Select-Asset $singboxRelease.assets "windows-$arch\.zip$" "sing-box"
- $singboxZip = Join-Path $workDir $singboxAsset.name
- Invoke-Download $singboxAsset.browser_download_url $singboxZip
- Expand-Archive -LiteralPath $singboxZip -DestinationPath $extractDir -Force
- $singboxExe = Get-ChildItem -LiteralPath $extractDir -Recurse -Filter "sing-box.exe" | Select-Object -First 1
- if ($null -eq $singboxExe) { throw "В архиве sing-box не найден sing-box.exe." }
- Copy-Item -LiteralPath $singboxExe.FullName -Destination (Join-Path $installRootFull "sing-box.exe") -Force
- $changed = $true
-
- $winswRelease = Invoke-RestMethod -Uri $WinSwReleaseApi -Headers @{ "User-Agent" = "proxywarden" }
- $winswAsset = Select-Asset $winswRelease.assets "WinSW-$winswArch\.exe$" "WinSW"
- Invoke-Download $winswAsset.browser_download_url (Join-Path $installRootFull $WrapperFile)
- $changed = $true
-
- $configTarget = Join-Path $installRootFull $ConfigFile
- $backupPath = Backup-File -Path $configTarget
- if ($backupPath) { $details.backupPath = $backupPath }
- if (Test-Path -LiteralPath $ConfigSource) {
- Copy-Item -LiteralPath $ConfigSource -Destination $configTarget -Force
- } elseif (-not (Test-Path -LiteralPath $configTarget)) {
- Write-Utf8NoBomFile -Path $configTarget -Value '{"log":{"level":"info","timestamp":true},"inbounds":[],"outbounds":[{"type":"direct","tag":"direct"}],"route":{"final":"direct"}}'
- }
-
- $xmlPath = Write-WinSwConfig -Root $installRootFull -Name $ServiceName
- $details.configPath = $configTarget
- $details.wrapperConfigPath = $xmlPath
-
- if ($Force) {
- Stop-And-Uninstall-Service -Root $installRootFull -Name $ServiceName
- }
-
- Push-Location $installRootFull
- try {
- $service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue
- if ($null -eq $service) {
- & ".\$WrapperFile" install
- if ($LASTEXITCODE -ne 0) { throw "WinSW install завершился с кодом $LASTEXITCODE." }
- $changed = $true
- }
- & ".\$WrapperFile" start
- if ($LASTEXITCODE -ne 0) {
- Start-Service -Name $ServiceName -ErrorAction Stop
- }
- } finally {
- Pop-Location
- }
- } finally {
- if (Test-Path -LiteralPath $workDir) {
- Remove-Item -LiteralPath $workDir -Recurse -Force -ErrorAction SilentlyContinue
- }
- }
-
- New-Result -Success $true -Action "install-singbox" -Changed $changed -Message "Local sing-box service is installed and started." -Details $details
-} catch {
- New-Result -Success $false -Action "install-singbox" -Changed $false -Message $_.Exception.Message
- exit 1
-}
diff --git a/scripts/prepare-release.check.mjs b/scripts/prepare-release.check.mjs
new file mode 100644
index 0000000..9b75c8a
--- /dev/null
+++ b/scripts/prepare-release.check.mjs
@@ -0,0 +1,262 @@
+import assert from "node:assert/strict";
+import { spawnSync } from "node:child_process";
+import {
+ mkdtempSync,
+ mkdirSync,
+ readFileSync,
+ writeFileSync,
+ rmSync,
+} from "node:fs";
+import { tmpdir } from "node:os";
+import { dirname, join, resolve, sep } from "node:path";
+import { fileURLToPath } from "node:url";
+import { test } from "node:test";
+
+const source = readFileSync(
+ join(dirname(fileURLToPath(import.meta.url)), "prepare-release.ps1"),
+ "utf8",
+).replace(/^\ufeff/, "");
+const entry = source.lastIndexOf("try {\n Push-Location $RepoRoot");
+const crlfEntry = source.lastIndexOf("try {\r\n Push-Location $RepoRoot");
+const entryOffset = Math.max(entry, crlfEntry);
+assert.ok(entryOffset > 0);
+
+function run(cwd, command, args, ok = true) {
+ const result = spawnSync(command, args, {
+ cwd,
+ encoding: "utf8",
+ timeout: 60000,
+ windowsHide: true,
+ });
+ if (ok)
+ assert.equal(
+ result.status,
+ 0,
+ `${command}: ${result.stdout}\n${result.stderr}`,
+ );
+ return result;
+}
+
+function fixture(t, build = "") {
+ const root = mkdtempSync(join(tmpdir(), "proxywarden-release-test-"));
+ t.after(() => {
+ assert.ok(resolve(root).startsWith(resolve(tmpdir()) + sep));
+ assert.ok(root.includes("proxywarden-release-test-"));
+ rmSync(root, { recursive: true, force: true });
+ });
+ const repo = join(root, "repo");
+ mkdirSync(repo);
+ const write = (path, text) => {
+ mkdirSync(dirname(join(repo, path)), { recursive: true });
+ writeFileSync(join(repo, path), text);
+ };
+ const git = (...args) => run(repo, "git", args).stdout.trim();
+ write("package.json", '{"name":"proxywarden","version":"1.2.0"}\n');
+ write(
+ "package-lock.json",
+ '{"name":"proxywarden","version":"1.2.0","packages":{"":{"name":"proxywarden","version":"1.2.0"}}}\n',
+ );
+ write("src-tauri/tauri.conf.json", '{"version":"1.2.0"}\n');
+ write(
+ "src-tauri/Cargo.toml",
+ '[package]\nname = "proxywarden"\nversion = "1.2.0"\n',
+ );
+ write(
+ "src-tauri/Cargo.lock",
+ '[[package]]\nname = "proxywarden"\nversion = "1.2.0"\n',
+ );
+ write(".gitignore", "node_modules/\nsrc-tauri/target/\nreleases/\n");
+ for (const cli of [
+ "typescript/bin/tsc",
+ "vite/bin/vite.js",
+ "@tauri-apps/cli/tauri.js",
+ "prettier/bin/prettier.cjs",
+ "eslint/bin/eslint.js",
+ "vitest/vitest.mjs",
+ ])
+ write(`node_modules/${cli}`, "fixture");
+ // Replace only expensive checks/build in this isolated copy. Git/version/artifact/push code is real.
+ const stub = `
+function Invoke-ReleaseChecks {}
+function Invoke-ReleaseBuild {
+ ${build}
+ $output = Join-Path $BundleRoot 'nsis'
+ New-Item -ItemType Directory -Path $output -Force | Out-Null
+ [IO.File]::WriteAllText((Join-Path $output "ProxyWarden_$($targetVersion)_x64-setup.exe"), 'test artifact')
+}
+`;
+ write(
+ "scripts/prepare-release.ps1",
+ "\ufeff" + source.slice(0, entryOffset) + stub + source.slice(entryOffset),
+ );
+ git("init", "-b", "master");
+ git("config", "user.name", "Release Test");
+ git("config", "user.email", "release-test@example.invalid");
+ git("config", "core.autocrlf", "false");
+ git("add", ".");
+ git("commit", "-m", "initial");
+ const remote = join(root, "origin.git");
+ run(root, "git", ["init", "--bare", remote]);
+ git("remote", "add", "origin", remote);
+ git("push", "-u", "origin", "master");
+ const release = (...args) =>
+ run(
+ repo,
+ "pwsh",
+ [
+ "-NoProfile",
+ "-File",
+ "scripts/prepare-release.ps1",
+ "-Publish",
+ ...args,
+ ],
+ false,
+ );
+ const manifest = () =>
+ JSON.parse(
+ readFileSync(
+ join(repo, "releases/proxywarden-v1.2.1/release-manifest.json"),
+ "utf8",
+ ).replace(/^\ufeff/, ""),
+ );
+ return { root, repo, remote, git, write, release, manifest };
+}
+
+test("PlanOnly is offline and leaves versions/index/refs unchanged", (t) => {
+ const f = fixture(t);
+ f.git("remote", "set-url", "origin", join(f.root, "absent.git"));
+ const before = f.git("status", "--porcelain");
+ const head = f.git("rev-parse", "HEAD");
+ const result = f.release("-PlanOnly");
+ assert.equal(result.status, 0, result.stderr);
+ const plan = JSON.parse(result.stdout);
+ assert.equal(plan.changed, false);
+ assert.equal(plan.details.targetVersion, "1.2.1");
+ assert.equal(f.git("status", "--porcelain"), before);
+ assert.equal(f.git("rev-parse", "HEAD"), head);
+});
+
+test("release commits exact dirty source, versions both locks, tags and atomically pushes", (t) => {
+ const f = fixture(t);
+ f.write("feature.txt", "new feature");
+ const result = f.release("-Version", "1.2.1");
+ assert.equal(result.status, 0, result.stdout + result.stderr);
+ const head = f.git("rev-parse", "HEAD");
+ assert.equal(f.git("rev-parse", "v1.2.1^{commit}"), head);
+ assert.equal(
+ f.git("ls-remote", "origin", "refs/heads/master").split(/\s/)[0],
+ head,
+ );
+ assert.equal(f.git("status", "--porcelain"), "");
+ assert.equal(f.manifest().gitCommit, head);
+ assert.equal(f.manifest().gitRelease.status, "pushed");
+ assert.equal(f.manifest().artifacts.length, 1);
+ assert.match(
+ readFileSync(join(f.repo, "src-tauri/Cargo.lock"), "utf8"),
+ /version = "1.2.1"/,
+ );
+ const repeat = f.release("-Version", "1.2.1");
+ assert.notEqual(repeat.status, 0);
+ assert.equal(f.git("rev-parse", "HEAD"), head);
+});
+
+test("failed build creates no commit/tag/push and preserves existing staging", (t) => {
+ const f = fixture(t, "throw 'Synthetic build failure'");
+ f.write("staged.txt", "staged");
+ f.git("add", "staged.txt");
+ const index = f.git("write-tree"),
+ head = f.git("rev-parse", "HEAD");
+ assert.notEqual(f.release("-Version", "1.2.1").status, 0);
+ assert.equal(f.git("write-tree"), index);
+ assert.equal(f.git("rev-parse", "HEAD"), head);
+ assert.equal(f.git("tag", "--list"), "");
+});
+
+test("source edit during build refuses to tag an artifact from another tree", (t) => {
+ const f = fixture(
+ t,
+ "[IO.File]::WriteAllText((Join-Path $RepoRoot 'concurrent.txt'), 'changed during build')",
+ );
+ const head = f.git("rev-parse", "HEAD");
+ const result = f.release("-Version", "1.2.1");
+ assert.notEqual(result.status, 0);
+ assert.match(result.stderr, /changed during the build/);
+ assert.match(result.stderr, /concurrent\.txt/);
+ assert.equal(f.git("rev-parse", "HEAD"), head);
+ assert.equal(f.git("tag", "--list"), "");
+});
+
+test("failed atomic push keeps artifacts and resumes without rebuilding", (t) => {
+ const f = fixture(t);
+ const hook = join(f.remote, "hooks/pre-receive");
+ writeFileSync(hook, "#!/bin/sh\nexit 1\n");
+ const before = f.git("ls-remote", "origin", "refs/heads/master");
+ const failed = f.release("-Version", "1.2.1");
+ assert.notEqual(failed.status, 0);
+ assert.equal(f.manifest().gitRelease.status, "pending-push");
+ assert.equal(f.git("ls-remote", "origin", "refs/heads/master"), before);
+ assert.equal(f.git("ls-remote", "origin", "refs/tags/v1.2.1"), "");
+ const commit = f.git("rev-parse", "HEAD");
+ rmSync(hook);
+ const resumed = f.release("-Version", "1.2.1", "-Resume");
+ assert.equal(resumed.status, 0, resumed.stdout + resumed.stderr);
+ assert.equal(f.git("rev-parse", "HEAD"), commit);
+ assert.equal(f.manifest().gitRelease.status, "pushed");
+ f.write(
+ "releases/proxywarden-v1.2.1/artifacts/nsis/ProxyWarden_1.2.1_x64-setup.exe",
+ "tampered",
+ );
+ assert.notEqual(f.release("-Version", "1.2.1", "-Resume").status, 0);
+});
+
+test("remote-only version tag and diverged branch are refused before version edits", (t) => {
+ const f = fixture(t);
+ f.git("tag", "v1.2.1");
+ f.git("push", "origin", "refs/tags/v1.2.1");
+ f.git("tag", "-d", "v1.2.1");
+ const version = readFileSync(join(f.repo, "package.json"), "utf8");
+ assert.notEqual(f.release("-Version", "1.2.1").status, 0);
+ assert.equal(readFileSync(join(f.repo, "package.json"), "utf8"), version);
+ const clone = join(f.root, "other");
+ run(f.root, "git", ["clone", "--branch", "master", f.remote, clone]);
+ run(clone, "git", ["config", "user.name", "Other"]);
+ run(clone, "git", ["config", "user.email", "other@example.invalid"]);
+ writeFileSync(join(clone, "remote-change.txt"), "remote");
+ run(clone, "git", ["add", "."]);
+ run(clone, "git", ["commit", "-m", "remote change"]);
+ run(clone, "git", ["push"]);
+ const result = f.release("-Version", "1.2.2");
+ assert.notEqual(result.status, 0);
+ assert.match(result.stderr, /Integrate them before releasing/);
+ assert.equal(readFileSync(join(f.repo, "package.json"), "utf8"), version);
+});
+
+test("invalid Windows versions and mismatched Cargo.lock fail without mutations", (t) => {
+ const f = fixture(t);
+ for (const version of ["01.2.3", "1.2.65536", "1.2.3-rc.1"])
+ assert.notEqual(f.release("-Version", version, "-PlanOnly").status, 0);
+ f.write(
+ "src-tauri/Cargo.lock",
+ '[[package]]\nname = "proxywarden"\nversion = "0.0.0"\n',
+ );
+ const result = f.release("-PlanOnly");
+ assert.notEqual(result.status, 0);
+ assert.match(result.stderr, /Version mismatch/);
+});
+
+test("unreachable origin reports the Git cause and diagnostic command without a PowerShell stack", (t) => {
+ const f = fixture(t);
+ f.git("remote", "set-url", "origin", join(f.root, "absent.git"));
+ const head = f.git("rev-parse", "HEAD");
+ const version = readFileSync(join(f.repo, "package.json"), "utf8");
+ const result = f.release("-Version", "1.2.1");
+ assert.notEqual(result.status, 0);
+ assert.match(result.stderr, /git ls-remote origin/);
+ assert.match(result.stderr, /does not appear to be a git repository/);
+ assert.doesNotMatch(
+ result.stderr,
+ /prepare-release\.ps1:\d|ScriptStackTrace|Line \|/,
+ );
+ assert.equal(f.git("rev-parse", "HEAD"), head);
+ assert.equal(readFileSync(join(f.repo, "package.json"), "utf8"), version);
+});
diff --git a/scripts/prepare-release.ps1 b/scripts/prepare-release.ps1
index 0758c3b..7971f13 100644
--- a/scripts/prepare-release.ps1
+++ b/scripts/prepare-release.ps1
@@ -1,4 +1,4 @@
-param(
+param(
[string]$Version = "",
[ValidateSet("", "patch", "minor", "major")]
[string]$Bump = "",
@@ -6,9 +6,12 @@ param(
[switch]$SkipTests,
[switch]$SkipBuild,
[switch]$PlanOnly,
+ [switch]$Publish,
+ [switch]$Resume,
[switch]$Force
)
+Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$RepoRoot = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot ".."))
@@ -16,7 +19,11 @@ $PackageJsonPath = Join-Path $RepoRoot "package.json"
$PackageLockPath = Join-Path $RepoRoot "package-lock.json"
$TauriConfigPath = Join-Path $RepoRoot "src-tauri\tauri.conf.json"
$CargoTomlPath = Join-Path $RepoRoot "src-tauri\Cargo.toml"
+$CargoLockPath = Join-Path $RepoRoot "src-tauri\Cargo.lock"
$BundleRoot = Join-Path $RepoRoot "src-tauri\target\release\bundle"
+$RuntimeBoundaryCheckPath = Join-Path $RepoRoot "scripts\check-runtime-powershell-boundary.ps1"
+$ComponentBundleScriptPath = Join-Path $RepoRoot "scripts\update-component-bundle.ps1"
+$WindowsAuditScriptPath = Join-Path $RepoRoot "scripts\audit-windows-smoke.ps1"
function Write-Utf8NoBomFile {
param(
@@ -143,9 +150,12 @@ function Set-PackageLockVersions {
function Assert-Semver {
param([string]$Value)
- if ($Value -notmatch "^\d+\.\d+\.\d+$") {
+ if ($Value -notmatch '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$') {
throw "Version '$Value' is not supported. Use numeric SemVer like 0.1.0."
}
+ foreach ($part in $Value.Split('.')) {
+ if ([long]$part -gt 65535) { throw "Version components must be between 0 and 65535 for Windows." }
+ }
}
function ConvertTo-VersionParts {
@@ -206,6 +216,9 @@ function Get-CargoPackageVersion {
function Get-VersionState {
$packageLock = Get-PackageLockVersions
+ $cargoLock = Get-Content -Raw -LiteralPath $CargoLockPath
+ $cargoMatch = [regex]::Match($cargoLock, '(?m)^name = "proxywarden"\r?\nversion = "([^"]+)"')
+ if (-not $cargoMatch.Success) { throw 'Cannot find ProxyWarden in Cargo.lock.' }
[ordered]@{
packageJson = [string](Get-FirstJsonVersion -Path $PackageJsonPath -Label "package.json")
@@ -213,6 +226,7 @@ function Get-VersionState {
packageLockRoot = [string]$packageLock.packageLockRoot
tauriConfig = [string](Get-FirstJsonVersion -Path $TauriConfigPath -Label "tauri.conf.json")
cargoToml = [string](Get-CargoPackageVersion)
+ cargoLock = $cargoMatch.Groups[1].Value
}
}
@@ -223,7 +237,8 @@ function Get-CurrentVersion {
$state.packageLock,
$state.packageLockRoot,
$state.tauriConfig,
- $state.cargoToml
+ $state.cargoToml,
+ $state.cargoLock
) | Select-Object -Unique)
if ($versions.Count -ne 1) {
@@ -247,23 +262,24 @@ function Resolve-TargetVersion {
return Get-NextVersion -Current $Current -Kind $Bump
}
- if ($PlanOnly -or -not [Environment]::UserInteractive) {
+ if ($PlanOnly) {
return Get-NextVersion -Current $Current -Kind "patch"
}
+ if (-not [Environment]::UserInteractive) { throw "Specify -Version or -Bump in non-interactive mode." }
$patch = Get-NextVersion -Current $Current -Kind "patch"
$minor = Get-NextVersion -Current $Current -Kind "minor"
$major = Get-NextVersion -Current $Current -Kind "major"
Write-Host ""
- Write-Host "Current version: $Current"
- Write-Host "Choose release version:"
+ Write-Host "Текущая версия: $Current"
+ Write-Host "Выбери номер или введи версию, например $patch :"
Write-Host " 1) patch $patch"
Write-Host " 2) minor $minor"
Write-Host " 3) major $major"
- Write-Host " 4) custom"
- Write-Host " 5) keep current $Current"
- $choice = Read-Host "Selection [1]"
+ Write-Host " 4) другая версия"
+ Write-Host " 5) текущая $Current (если ещё не выпущена)"
+ $choice = Read-Host "Версия [1]"
if ([string]::IsNullOrWhiteSpace($choice)) { $choice = "1" }
@@ -277,7 +293,7 @@ function Resolve-TargetVersion {
return $custom
}
"5" { return $Current }
- default { throw "Unknown selection '$choice'." }
+ default { Assert-Semver -Value $choice.Trim(); return $choice.Trim() }
}
}
@@ -313,6 +329,9 @@ function Set-ManifestVersions {
Set-PackageLockVersions -TargetVersion $TargetVersion
Set-FirstJsonVersion -Path $TauriConfigPath -TargetVersion $TargetVersion -Label "tauri.conf.json"
Set-CargoPackageVersion -TargetVersion $TargetVersion
+ $lock = Get-Content -Raw -LiteralPath $CargoLockPath
+ $lock = Replace-RegexGroup -Content $lock -Pattern '(?m)^name = "proxywarden"\r?\nversion = "(?[^"]+)"' -GroupName "value" -Value $TargetVersion -Label "ProxyWarden version in Cargo.lock"
+ Write-Utf8NoBomFile -Path $CargoLockPath -Value $lock
}
function Get-FullPath {
@@ -354,6 +373,7 @@ function New-ReleaseDirectory {
$releaseDir = Join-Path $root "proxywarden-v$TargetVersion"
if (Test-Path -LiteralPath $releaseDir) {
+ if ($Publish -or -not $Force) { throw "Release directory already exists: $releaseDir. Use -Resume for a failed push, or choose another version." }
if (-not (Test-IsSubPath -Parent $root -Child $releaseDir)) {
throw "Refusing to remove release directory outside OutputRoot: $releaseDir"
}
@@ -412,17 +432,51 @@ function Invoke-ReleaseBuild {
return
}
- Invoke-NativeCommand -Name "Frontend build" -FilePath "npm" -Arguments @("run", "build")
+ Invoke-NativeCommand -Name "Frontend types" -FilePath "node" -Arguments @("node_modules/typescript/bin/tsc", "--noEmit")
if (-not $SkipTests) {
- Invoke-NativeCommand -Name "Rust tests" -FilePath "cargo" -Arguments @("test") -WorkingDirectory (Join-Path $RepoRoot "src-tauri")
+ Invoke-NativeCommand -Name "Frontend formatting" -FilePath "node" -Arguments @("node_modules/prettier/bin/prettier.cjs", "--check", "src/**/*.{ts,tsx,css}")
+ Invoke-NativeCommand -Name "Frontend lint" -FilePath "node" -Arguments @("node_modules/eslint/bin/eslint.js", "src")
+ Invoke-NativeCommand -Name "Frontend tests" -FilePath "node" -Arguments @("node_modules/vitest/vitest.mjs", "run")
+ Invoke-NativeCommand -Name "Rust formatting" -FilePath "cargo" -Arguments @("fmt", "--all", "--", "--check") -WorkingDirectory (Join-Path $RepoRoot "src-tauri")
+ Invoke-NativeCommand -Name "Rust lint" -FilePath "cargo" -Arguments @("clippy", "--locked", "--all-targets", "--all-features", "--", "-D", "warnings") -WorkingDirectory (Join-Path $RepoRoot "src-tauri")
+ Invoke-NativeCommand -Name "Rust tests" -FilePath "cargo" -Arguments @("test", "--locked", "--all-targets") -WorkingDirectory (Join-Path $RepoRoot "src-tauri")
} else {
Write-Host ""
Write-Host "Skipping Rust tests because -SkipTests was provided."
}
+ Invoke-NativeCommand -Name "Frontend build" -FilePath "node" -Arguments @("node_modules/vite/bin/vite.js", "build")
Clear-ReleaseBundleOutput
- Invoke-NativeCommand -Name "Tauri release build" -FilePath "npm" -Arguments @("run", "tauri", "--", "build")
+ # Use a temporary config file: JSON command-line quoting differs between Windows PowerShell and pwsh.
+ $config = Join-Path ([IO.Path]::GetTempPath()) ("proxywarden-build-" + [guid]::NewGuid().ToString('N') + '.json')
+ try {
+ Write-Utf8NoBomFile -Path $config -Value '{"build":{"beforeBuildCommand":""}}'
+ Invoke-NativeCommand -Name "Tauri release build" -FilePath "node" -Arguments @("node_modules/@tauri-apps/cli/tauri.js", "build", "--config", $config, "--bundles", "nsis")
+ } finally { if (Test-Path -LiteralPath $config) { Remove-Item -LiteralPath $config } }
+}
+
+function Invoke-ScriptCheck {
+ param(
+ [string]$Name,
+ [string]$ScriptPath,
+ [hashtable]$Parameters
+ )
+
+ Write-Host ""
+ Write-Host "==> $Name"
+ $output = & $ScriptPath @Parameters
+ $succeeded = $?
+ $output | Write-Output
+ if (-not $succeeded) {
+ throw "$Name failed."
+ }
+}
+
+function Invoke-ReleaseChecks {
+ Invoke-ScriptCheck -Name "Runtime PowerShell boundary" -ScriptPath $RuntimeBoundaryCheckPath -Parameters @{ CheckOnly = $true }
+ Invoke-ScriptCheck -Name "Offline component bundle" -ScriptPath $ComponentBundleScriptPath -Parameters @{ CheckOnly = $true }
+ Invoke-ScriptCheck -Name "Windows smoke evidence plan" -ScriptPath $WindowsAuditScriptPath -Parameters @{ Mode = "PlanOnly" }
}
function Get-ArtifactVersionPattern {
@@ -503,7 +557,7 @@ function Get-GitValue {
param([string[]]$Arguments)
try {
- $value = & git @Arguments 2>$null
+ $value = & git --no-optional-locks @Arguments 2>$null
if ($LASTEXITCODE -eq 0) {
return ($value -join [Environment]::NewLine).Trim()
}
@@ -511,11 +565,176 @@ function Get-GitValue {
return ""
}
+function Get-GitFailureMessage {
+ param([string]$Operation, [int]$ExitCode, [string]$Diagnostic)
+ $reason = if ($Diagnostic -match 'Too many authentication failures') {
+ 'SSH-сервер отклонил слишком много попыток входа. Укажи правильный ключ и IdentitiesOnly yes для этого Git-сервера.'
+ } elseif ($Diagnostic -match 'Permission denied \(publickey|Authentication failed|could not read Username|terminal prompts disabled') {
+ 'Сервер Git отклонил вход. Проверь SSH-ключ или HTTPS-аутентификацию и доступ к репозиторию.'
+ } elseif ($Diagnostic -match 'Host key verification failed|REMOTE HOST IDENTIFICATION HAS CHANGED') {
+ 'Не подтверждён SSH-ключ сервера. Проверь его отпечаток перед повторным подключением.'
+ } elseif ($Diagnostic -match 'Could not resolve|Connection timed out|Connection refused|Network is unreachable|connect to host.*Permission denied|Failed to connect') {
+ 'Не удалось подключиться к Git-серверу. Проверь сеть/VPN, адрес и порт origin.'
+ } elseif ($Diagnostic -match 'not found|does not appear to be a git repository') {
+ 'Репозиторий недоступен по адресу origin. Проверь URL и права доступа.'
+ } else {
+ "Git не выполнил операцию $Operation (код $ExitCode)."
+ }
+ $details = "$Diagnostic".Trim() -replace '(https?://)[^/\s@]+@', '$1[redacted]@' -replace '(https?://[^\s?#]+)[?#][^\s]*', '$1'
+ if ($details.Length -gt 2500) { $details = $details.Substring(0, 2500) + '...' }
+ $next = if ($Operation -in @('ls-remote', 'fetch')) {
+ 'Проверка origin завершилась до изменения версии, сборки, commit, tag и push. Для диагностики запусти: git ls-remote origin'
+ } else { 'Подробности ответа Git приведены ниже.' }
+ return "$reason`n$next`n`nОтвет Git:`n$details"
+}
+
+function Invoke-Git {
+ param([string[]]$Arguments)
+ $stderrPath = Join-Path ([IO.Path]::GetTempPath()) ("proxywarden-git-" + [guid]::NewGuid().ToString('N') + '.log')
+ $previousPreference = $ErrorActionPreference
+ try {
+ # Windows PowerShell wraps redirected stderr as NativeCommandError; preserve it,
+ # then classify by the actual exit code instead of losing the original cause.
+ $ErrorActionPreference = 'Continue'
+ $output = & git @Arguments 2>$stderrPath
+ $exitCode = $LASTEXITCODE
+ $ErrorActionPreference = $previousPreference
+ [string]$diagnostic = ''
+ if (Test-Path -LiteralPath $stderrPath) { $diagnostic = [string](Get-Content -Raw -LiteralPath $stderrPath) }
+ if ($exitCode -ne 0) { throw (Get-GitFailureMessage -Operation $Arguments[0] -ExitCode $exitCode -Diagnostic $diagnostic) }
+ if (-not [string]::IsNullOrWhiteSpace($diagnostic)) { Write-Host $diagnostic.Trim() }
+ return ([string]($output -join "`n")).Trim()
+ } finally {
+ $ErrorActionPreference = $previousPreference
+ if (Test-Path -LiteralPath $stderrPath) { Remove-Item -LiteralPath $stderrPath }
+ }
+}
+
+function Get-SourceTree {
+ # Snapshot tracked + non-ignored new files without touching the user's staging area.
+ $previousIndex = $env:GIT_INDEX_FILE
+ $index = Join-Path ([IO.Path]::GetTempPath()) ("proxywarden-index-" + [guid]::NewGuid().ToString('N'))
+ try {
+ $env:GIT_INDEX_FILE = $index
+ Invoke-Git @('read-tree', 'HEAD') | Out-Null
+ Invoke-Git @('add', '-A', '--', '.') | Out-Null
+ return Invoke-Git @('write-tree')
+ } finally {
+ $env:GIT_INDEX_FILE = $previousIndex
+ foreach ($path in @($index, "$index.lock")) {
+ if (Test-Path -LiteralPath $path) { Remove-Item -LiteralPath $path }
+ }
+ }
+}
+
+function Get-ReleasePath {
+ param([string]$TargetVersion)
+ $root = if ([IO.Path]::IsPathRooted($OutputRoot)) { $OutputRoot } else { Join-Path $RepoRoot $OutputRoot }
+ return [IO.Path]::GetFullPath((Join-Path $root "proxywarden-v$TargetVersion"))
+}
+
+function Test-GitTag {
+ param([string]$Tag)
+ & git show-ref --verify --quiet "refs/tags/$Tag"
+ if ($LASTEXITCODE -eq 0) { return $true }
+ if ($LASTEXITCODE -ne 1) { throw "Cannot inspect local tag $Tag." }
+ return $false
+}
+
+function Get-ReleaseGitContext {
+ param([string]$TargetVersion)
+ $branch = Invoke-Git @('symbolic-ref', '--quiet', '--short', 'HEAD')
+ $headCommit = Invoke-Git @('rev-parse', 'HEAD')
+ foreach ($marker in @('MERGE_HEAD', 'CHERRY_PICK_HEAD', 'REVERT_HEAD', 'rebase-merge', 'rebase-apply')) {
+ $path = Invoke-Git @('rev-parse', '--git-path', $marker)
+ if (Test-Path -LiteralPath $path) { throw "Finish the active Git operation before releasing ($marker)." }
+ }
+ if (Invoke-Git @('diff', '--name-only', '--diff-filter=U')) { throw 'Resolve Git conflicts before releasing.' }
+ Invoke-Git @('var', 'GIT_AUTHOR_IDENT') | Out-Null
+ Invoke-Git @('var', 'GIT_COMMITTER_IDENT') | Out-Null
+ $remote = Invoke-Git @('remote', 'get-url', '--push', 'origin')
+ $tag = "v$TargetVersion"
+ if (-not $Resume -and (Test-GitTag $tag)) { throw "Tag $tag already exists. Use -Version $TargetVersion -Resume for a failed push, or choose another version." }
+ $remoteTag = Invoke-Git @('ls-remote', '--tags', 'origin', "refs/tags/$tag", "refs/tags/$tag^{}")
+ if (-not $Resume -and $remoteTag) { throw "Remote tag $tag already exists. Choose another version." }
+ $remoteBranch = Invoke-Git @('ls-remote', '--heads', 'origin', "refs/heads/$branch")
+ if ($remoteBranch) {
+ Invoke-Git @('fetch', '--no-tags', 'origin', "refs/heads/$branch") | Out-Null
+ & git merge-base --is-ancestor FETCH_HEAD HEAD
+ if ($LASTEXITCODE -ne 0) { throw "The origin/$branch branch has changes not in HEAD. Integrate them before releasing; automatic merge is not performed." }
+ }
+ return @{ branch = $branch; head = $headCommit; remote = $remote; tag = $tag }
+}
+
+function Complete-ReleaseGit {
+ param([hashtable]$Context, [string]$SourceTree, [string]$TargetVersion)
+ $currentTree = Get-SourceTree
+ if ((Invoke-Git @('rev-parse', 'HEAD')) -ne $Context.head -or
+ (Invoke-Git @('symbolic-ref', '--quiet', '--short', 'HEAD')) -ne $Context.branch -or
+ $currentTree -ne $SourceTree) {
+ $changed = Invoke-Git @('-c', 'core.quotepath=false', 'diff', '--name-only', $SourceTree, $currentTree)
+ throw "Source files or HEAD changed during the build. No release commit/tag was created.`nИсходники изменились во время сборки. Повтори сборку после завершения правок.`nИзменённые файлы:`n$changed"
+ }
+ if ((Invoke-Git @('rev-parse', 'HEAD^{tree}')) -ne $SourceTree) {
+ Invoke-Git @('add', '-A', '--', '.') | Out-Null
+ if ((Invoke-Git @('write-tree')) -ne $SourceTree) { throw 'Staged source changed. Rebuild before releasing.' }
+ Invoke-Git @('commit', '-m', "Release v$TargetVersion") | Write-Host
+ }
+ if ((Invoke-Git @('rev-parse', 'HEAD^{tree}')) -ne $SourceTree -or
+ (Get-SourceTree) -ne $SourceTree) { throw 'A Git hook changed source files. Rebuild before tagging.' }
+ return Invoke-Git @('rev-parse', 'HEAD')
+}
+
+function Push-Release {
+ param([hashtable]$Context, [string]$Commit)
+ if ((Invoke-Git @('rev-parse', 'HEAD')) -ne $Commit -or
+ (Invoke-Git @('symbolic-ref', '--quiet', '--short', 'HEAD')) -ne $Context.branch -or
+ (Invoke-Git @('remote', 'get-url', '--push', 'origin')) -ne $Context.remote) {
+ throw 'HEAD, branch or origin changed before push.'
+ }
+ if (Test-GitTag $Context.tag) {
+ if ((Invoke-Git @('rev-parse', "$($Context.tag)^{commit}")) -ne $Commit) { throw 'Existing tag points to another commit.' }
+ } else {
+ Invoke-Git @('tag', '-a', $Context.tag, $Commit, '-m', "ProxyWarden $($Context.tag)") | Out-Null
+ }
+ # One atomic push; never force or push unrelated tags. A failure leaves a resumable local release.
+ Invoke-Git @('push', '--atomic', 'origin', "${Commit}:refs/heads/$($Context.branch)", "refs/tags/$($Context.tag):refs/tags/$($Context.tag)") | Write-Host
+}
+
+function Resume-Release {
+ param([string]$TargetVersion, [hashtable]$Context)
+ $releaseDir = Get-ReleasePath $TargetVersion
+ $manifestPath = Join-Path $releaseDir 'release-manifest.json'
+ $manifest = Read-JsonFile $manifestPath
+ if (-not $manifest.PSObject.Properties['gitRelease'] -or -not $manifest.gitRelease) {
+ throw 'This folder has no completed release commit. Resume only retries a failed push; choose a new version and rebuild.'
+ }
+ if ($manifest.version -ne $TargetVersion -or $manifest.gitRelease.branch -ne $Context.branch -or
+ $manifest.gitRelease.remote -ne $Context.remote -or $manifest.gitRelease.tag -ne $Context.tag -or
+ $manifest.gitRelease.status -notin @('pending-push', 'pushed') -or
+ $manifest.gitCommit -ne $Context.head -or
+ (Invoke-Git @('rev-parse', 'HEAD^{tree}')) -ne $manifest.gitRelease.sourceTree -or
+ (Get-SourceTree) -ne $manifest.gitRelease.sourceTree) {
+ throw 'This release no longer matches HEAD/source/origin. Resume refused; use a new version.'
+ }
+ if (@($manifest.artifacts).Count -eq 0) { throw 'No artifacts to resume.' }
+ foreach ($artifact in $manifest.artifacts) {
+ $path = [IO.Path]::GetFullPath((Join-Path $releaseDir $artifact.path))
+ if (-not (Test-IsSubPath $releaseDir $path) -or
+ (Get-FileHash -LiteralPath $path -Algorithm SHA256).Hash -ne $artifact.sha256) { throw 'Release artifact checksum mismatch.' }
+ }
+ Push-Release -Context $Context -Commit $manifest.gitCommit
+ $manifest.gitRelease.status = 'pushed'
+ Write-JsonFile -Path $manifestPath -Value $manifest
+ Write-Host "Релиз отправлен. Файлы для сайта: $releaseDir"
+}
+
function Write-ReleaseMetadata {
param(
[string]$ReleaseDir,
[string]$TargetVersion,
- [object[]]$Artifacts
+ [object[]]$Artifacts,
+ [object]$GitRelease = $null
)
$artifactDir = Join-Path $ReleaseDir "artifacts"
@@ -534,6 +753,8 @@ function Write-ReleaseMetadata {
source = "local"
gitCommit = Get-GitValue -Arguments @("rev-parse", "HEAD")
gitStatus = Get-GitValue -Arguments @("status", "--short")
+ gitRelease = $GitRelease
+ windowsAcceptance = "not-verified-by-this-command"
artifacts = @($artifactItems)
}
@@ -560,7 +781,7 @@ See `SHA256SUMS.txt`.
## Release boundary
-This release contains the ProxyWarden Control App only. ProxiFyre and Local sing-box remain explicit user-managed components.
+The ProxyWarden installer contains pinned offline payloads for ProxiFyre, Windows Packet Filter, VC++ Runtime, sing-box, WinSW, and WebView2. Installing, updating, starting, stopping, or removing routing components remains an explicit user action.
"@
@@ -590,16 +811,31 @@ function New-PlanResult {
releaseDirectory = (Join-Path $outputRootFull "proxywarden-v$Target")
skipTests = [bool]$SkipTests
skipBuild = [bool]$SkipBuild
+ publish = [bool]$Publish
+ resume = [bool]$Resume
+ git = [ordered]@{
+ branch = Get-GitValue @('symbolic-ref', '--quiet', '--short', 'HEAD')
+ remote = 'origin'
+ tag = "v$Target"
+ includedChanges = Get-GitValue @('status', '--short')
+ commitAfterSuccessfulBuild = [bool]$Publish
+ atomicPush = [bool]$Publish
+ }
manifests = @(
$PackageJsonPath,
$PackageLockPath,
$TauriConfigPath,
- $CargoTomlPath
+ $CargoTomlPath,
+ $CargoLockPath
)
commands = @(
- "npm run build",
- "cd src-tauri; cargo test",
- "npm run tauri -- build"
+ ".\scripts\check-runtime-powershell-boundary.ps1 -CheckOnly",
+ ".\scripts\update-component-bundle.ps1 -CheckOnly",
+ ".\scripts\audit-windows-smoke.ps1 -Mode PlanOnly",
+ "node: TypeScript, Prettier, ESLint, Vitest, Vite",
+ "cargo fmt / clippy --locked / test --locked --all-targets",
+ "node: Tauri build --bundles nsis",
+ "if -Publish: commit source, annotated version tag, atomic branch+tag push to origin"
)
}
} | ConvertTo-Json -Depth 8
@@ -608,6 +844,15 @@ function New-PlanResult {
try {
Push-Location $RepoRoot
+ if ($Resume -and (-not $Publish -or -not $Version -or $Bump)) { throw '-Resume requires -Publish -Version X.Y.Z.' }
+ if ($Version -and $Bump) { throw 'Use either -Version or -Bump.' }
+ if ($Publish -and -not $PlanOnly -and ($SkipTests -or $SkipBuild -or $Force)) { throw 'A published release requires checks and a fresh build; SkipTests, SkipBuild and Force are not allowed.' }
+ if ($Publish -and -not $PlanOnly -and -not $Resume) {
+ Write-Host 'В релиз войдут все изменения Git ниже (кроме игнорируемых файлов).'
+ Write-Host 'После успешной сборки: commit, тег версии и push текущей ветки в origin.'
+ Write-Host 'Файлы установщика останутся локально для загрузки на сайт.'
+ Write-Host (Invoke-Git @('status', '--short'))
+ }
$currentVersion = Get-CurrentVersion
$targetVersion = Resolve-TargetVersion -Current $currentVersion
Assert-Semver -Value $targetVersion
@@ -625,12 +870,34 @@ try {
Write-Host "Preparing ProxyWarden release $targetVersion..."
Write-Host "Repository: $RepoRoot"
+ $gitContext = $null
+ if ($Publish) {
+ $gitContext = Get-ReleaseGitContext $targetVersion
+ if ($Resume) { Resume-Release -TargetVersion $targetVersion -Context $gitContext; return }
+ }
+ $releasePath = Get-ReleasePath $targetVersion
+ if ((Test-Path -LiteralPath $releasePath) -and ($Publish -or -not $Force)) {
+ throw "Release directory already exists: $releasePath. Use -Resume for a failed push, or choose another version."
+ }
+ if ($Publish -and (Test-IsSubPath $RepoRoot $releasePath)) {
+ & git check-ignore --quiet -- (Join-Path $releasePath 'release-manifest.json')
+ if ($LASTEXITCODE -ne 0) { throw 'OutputRoot must be ignored by Git, or outside the repository.' }
+ }
+ if (-not $SkipBuild) {
+ Get-Command node, cargo -ErrorAction Stop | Out-Null
+ foreach ($cli in @('typescript/bin/tsc', 'vite/bin/vite.js', '@tauri-apps/cli/tauri.js', 'prettier/bin/prettier.cjs', 'eslint/bin/eslint.js', 'vitest/vitest.mjs')) {
+ if (-not (Test-Path -LiteralPath (Join-Path $RepoRoot "node_modules/$cli"))) { throw 'Frontend dependencies are missing. Run npm ci once, then retry release.' }
+ }
+ }
+ Invoke-ReleaseChecks
+
Set-ManifestVersions -TargetVersion $targetVersion
$afterUpdateVersion = Get-CurrentVersion
if ($afterUpdateVersion -ne $targetVersion) {
throw "Version update failed. Current version is $afterUpdateVersion."
}
+ $sourceTree = if ($Publish) { Get-SourceTree } else { $null }
Invoke-ReleaseBuild
$releaseDir = New-ReleaseDirectory -TargetVersion $targetVersion
@@ -638,11 +905,24 @@ try {
Write-Checksums -ReleaseDir $releaseDir -Files $artifacts | Out-Null
Write-ReleaseMetadata -ReleaseDir $releaseDir -TargetVersion $targetVersion -Artifacts $artifacts
+ if ($Publish) {
+ $commit = Complete-ReleaseGit -Context $gitContext -SourceTree $sourceTree -TargetVersion $targetVersion
+ $gitRelease = [ordered]@{ branch = $gitContext.branch; remote = $gitContext.remote; tag = $gitContext.tag; sourceTree = $sourceTree; status = 'pending-push' }
+ Write-ReleaseMetadata -ReleaseDir $releaseDir -TargetVersion $targetVersion -Artifacts $artifacts -GitRelease $gitRelease
+ try { Push-Release -Context $gitContext -Commit $commit }
+ catch { throw "Push failed; local release is preserved. Retry: .\release.cmd -Version $targetVersion -Resume. $($_.Exception.Message)" }
+ $gitRelease.status = 'pushed'
+ Write-ReleaseMetadata -ReleaseDir $releaseDir -TargetVersion $targetVersion -Artifacts $artifacts -GitRelease $gitRelease
+ }
+
Write-Host ""
Write-Host "Release folder is ready:"
Write-Host $releaseDir
Write-Host ""
- Write-Host "Upload the files from the release folder to GitHub release v$targetVersion."
+ Write-Host 'Загрузи EXE из artifacts\nsis на сайт. SHA256SUMS.txt содержит контрольную сумму.'
+} catch {
+ [Console]::Error.WriteLine("`nРелиз не завершён.`n" + $_.Exception.Message)
+ exit 1
} finally {
Pop-Location
}
diff --git a/scripts/update-component-bundle.ps1 b/scripts/update-component-bundle.ps1
new file mode 100644
index 0000000..c6913d7
--- /dev/null
+++ b/scripts/update-component-bundle.ps1
@@ -0,0 +1,1917 @@
+[CmdletBinding()]
+param(
+ [string]$OutputDir = '',
+ [switch]$PlanOnly,
+ [switch]$CheckOnly,
+ [switch]$UseFrozenReleaseEvidence,
+ [ValidateSet('None', 'Download', 'Validation', 'Promotion')]
+ [string]$SimulateFailure = 'None'
+)
+
+$ErrorActionPreference = 'Stop'
+Set-StrictMode -Version Latest
+$ProgressPreference = 'SilentlyContinue'
+
+if ([string]::IsNullOrEmpty($OutputDir)) {
+ $OutputDir = Join-Path $PSScriptRoot '..\src-tauri\bundled\components'
+} elseif ([string]::IsNullOrWhiteSpace($OutputDir)) {
+ throw 'OutputDir must not be whitespace.'
+}
+
+$ExpectedComponents = @(
+ [PSCustomObject]@{
+ id = 'proxifyre'; version = '2.4.0'; installRole = 'proxifyre-runtime'; assetArch = 'x64'
+ assetName = 'ProxiFyre-v2.4.0-x64-signed.zip'; licenseId = 'AGPL-3.0-only'; licensePath = 'proxifyre/LICENSE'
+ policyType = 'githubReleaseDigest'; sourceUrl = 'https://github.com/wiresock/proxifyre/releases/download/v2.4.0/ProxiFyre-v2.4.0-x64-signed.zip'
+ sha256 = 'eab65fd7d8eeb716abedb5614618c641de3f9eb8326b99cee1da787141e30cac'; size = 1519694L
+ fileVersion = '2.4.0'; productVersion = '2.4.0'
+ licenseSha256 = '8486a10c4393cee1c25392769ddd3b2d6c242d6ec7928e1414efff7dfb2f07ef'; licenseSize = 34523L
+ }
+ [PSCustomObject]@{
+ id = 'windows-packet-filter'; version = '3.6.2'; installRole = 'packet-filter-driver'; assetArch = 'x64'
+ assetName = 'Windows.Packet.Filter.3.6.2.1.x64.msi'; licenseId = 'MIT'; licensePath = 'windows-packet-filter/LICENSE'
+ policyType = 'githubReleaseDigest'; sourceUrl = 'https://github.com/wiresock/ndisapi/releases/download/v3.6.2/Windows.Packet.Filter.3.6.2.1.x64.msi'
+ sha256 = '9c388c0b7f189f7fa98720bae2caecf7d64f30910838b80b438ecf8956b8502c'; size = 819200L
+ fileVersion = '3.6.2.1'; productVersion = '3.6.2.1'
+ licenseSha256 = 'b12f4cfcce43cef59100cf8c4eaf67ae5246c9a047e00f6059655f6694030efe'; licenseSize = 1070L
+ }
+ [PSCustomObject]@{
+ id = 'vc-runtime'; version = '14.51.36247.0'; installRole = 'vc-runtime-prerequisite'; assetArch = 'x64'
+ assetName = 'VC_redist.x64.exe'; licenseId = 'LicenseRef-Microsoft-Visual-Cpp-v14-Redistributable-2026'
+ licensePath = 'vc-runtime/LICENSE.docx'; policyType = 'buildTimeOnlyAuthenticode'
+ sourceUrl = 'https://aka.ms/vs/18/release/14.51.36247/VC_redist.x64.exe'
+ sha256 = '843068991daaa1f73ad9f6239bce4d0f6a07a51f18c37ea2a867e9beca71295c'; size = 18731856L
+ fileVersion = '14.51.36247.0'; productVersion = '14.51.36247.0'
+ licenseSha256 = '08651651a7602fc7c0e2763de0fde1ff9f868df2780597cd1775ee9d6441c783'; licenseSize = 39553L
+ }
+ [PSCustomObject]@{
+ id = 'sing-box'; version = '1.13.19'; installRole = 'sing-box-runtime'; assetArch = 'x64'
+ assetName = 'sing-box-1.13.19-windows-amd64.zip'; licenseId = 'LicenseRef-Sing-Box-Project'
+ licensePath = 'sing-box/LICENSE'; policyType = 'githubReleaseDigest'
+ sourceUrl = 'https://github.com/SagerNet/sing-box/releases/download/v1.13.19/sing-box-1.13.19-windows-amd64.zip'
+ sha256 = 'e011a4def2f5e2b143ed54adb2b1a20a6be407806ab4442f3667f1dd817a2c8d'; size = 21046252L
+ fileVersion = $null; productVersion = $null
+ licenseSha256 = '650d5e3b99a446fb38e820fa87a49562e0c79eab868fff58618ac487a58e554c'; licenseSize = 791L
+ }
+ [PSCustomObject]@{
+ id = 'winsw'; version = '2.12.0'; installRole = 'sing-box-service-wrapper'; assetArch = 'anycpu'
+ assetName = 'WinSW.NET461.exe'; licenseId = 'MIT'; licensePath = 'winsw/LICENSE.txt'
+ policyType = 'bundledOnlyNoIndependentProof'
+ sourceUrl = 'https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW.NET461.exe'
+ sha256 = 'b5066b7bbdfba1293e5d15cda3caaea88fbeab35bd5b38c41c913d492aadfc4f'; size = 655872L
+ fileVersion = '2.12.0.0'; productVersion = '2.12.0+eef5bade59fca0254e387ac73ed7625ba6aa7147'
+ licenseSha256 = '1cdf703c10a70e5973bf3acf2a5eeabe7746237155b92db2034aeae26fdf7802'; licenseSize = 1158L
+ }
+)
+
+function ConvertTo-ResultJson([object]$Value) {
+ $Value | ConvertTo-Json -Depth 20
+}
+
+function Assert-ExactProperties(
+ [object]$Value,
+ [string[]]$Required,
+ [string[]]$Optional,
+ [string]$Label
+) {
+ if ($null -eq $Value) {
+ throw "$Label is missing."
+ }
+
+ $names = @($Value.PSObject.Properties.Name)
+ foreach ($name in $Required) {
+ if ($names -cnotcontains $name) {
+ throw "$Label is missing required property '$name'."
+ }
+ }
+ foreach ($name in $names) {
+ if (($Required -cnotcontains $name) -and ($Optional -cnotcontains $name)) {
+ throw "$Label contains unknown property '$name'."
+ }
+ }
+}
+
+function Test-StableNumericVersion([object]$Value) {
+ if ($Value -isnot [string] -or $Value -notmatch '^[0-9]{1,10}(\.[0-9]{1,10}){1,3}$') {
+ return $false
+ }
+ return $true
+}
+
+function Test-StableProductVersion([object]$Value) {
+ if ($Value -isnot [string]) {
+ return $false
+ }
+ $parts = $Value.Split('+')
+ if ($parts.Count -eq 1) {
+ return (Test-StableNumericVersion $Value)
+ }
+ if ($parts.Count -ne 2 -or -not (Test-StableNumericVersion $parts[0])) {
+ return $false
+ }
+ return $parts[1] -match '^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*$' -and $parts[1].Length -le 128
+}
+
+function Test-WindowsReservedName([string]$Segment) {
+ $stem = $Segment.Split('.')[0].ToUpperInvariant()
+ if (@('CON', 'PRN', 'AUX', 'NUL') -contains $stem) {
+ return $true
+ }
+ return $stem -match '^(COM|LPT)[1-9]$'
+}
+
+function Assert-SafeRelativePath([object]$Value, [string]$Label) {
+ if ($Value -isnot [string] -or $Value.Length -eq 0 -or $Value.Length -gt 512) {
+ throw "$Label is not a safe relative path."
+ }
+ if ($Value.Contains('\') -or $Value.StartsWith('/') -or $Value.EndsWith('/')) {
+ throw "$Label is not a safe relative path."
+ }
+ foreach ($segment in $Value.Split('/')) {
+ if (
+ $segment.Length -eq 0 -or
+ $segment.Length -gt 128 -or
+ $segment -in @('.', '..') -or
+ $segment.EndsWith('.') -or
+ (Test-WindowsReservedName $segment) -or
+ $segment -notmatch '^[A-Za-z0-9._-]+$'
+ ) {
+ throw "$Label is not a safe relative path."
+ }
+ }
+}
+
+function Assert-PlainHttpsUrl([object]$Value, [string]$Label) {
+ if ($Value -isnot [string]) {
+ throw "$Label must be an HTTPS URL."
+ }
+ $uri = $null
+ if (-not [Uri]::TryCreate($Value, [UriKind]::Absolute, [ref]$uri)) {
+ throw "$Label must be an HTTPS URL."
+ }
+ if (
+ $uri.Scheme -ne 'https' -or
+ [string]::IsNullOrWhiteSpace($uri.Host) -or
+ -not [string]::IsNullOrEmpty($uri.UserInfo) -or
+ -not [string]::IsNullOrEmpty($uri.Query) -or
+ -not [string]::IsNullOrEmpty($uri.Fragment) -or
+ $Value -notmatch '^https://[^/:@]+(?:/|$)'
+ ) {
+ throw "$Label must be a plain HTTPS URL."
+ }
+ return $uri
+}
+
+function Test-CatalogPattern([string]$Pattern, [string]$Value) {
+ $parts = $Pattern.Split('*')
+ if ($parts.Count -eq 1) {
+ return [string]::Equals($Pattern, $Value, [StringComparison]::Ordinal)
+ }
+ if ($parts.Count -ne 2) {
+ return $false
+ }
+ return $Value.StartsWith($parts[0], [StringComparison]::Ordinal) -and
+ $Value.EndsWith($parts[1], [StringComparison]::Ordinal) -and
+ $Value.Length -ge ($parts[0].Length + $parts[1].Length)
+}
+
+function Assert-CatalogPattern([object]$Value, [string]$Label) {
+ if (
+ $Value -isnot [string] -or
+ $Value.Length -eq 0 -or
+ $Value.Length -gt 160 -or
+ @($Value.ToCharArray() | Where-Object { $_ -eq '*' }).Count -gt 1 -or
+ $Value -notmatch '^[A-Za-z0-9._+*-]+$'
+ ) {
+ throw "$Label is invalid."
+ }
+}
+
+function Assert-StringArray([object]$Value, [string]$Label) {
+ if ($Value -isnot [Array]) {
+ throw "$Label must be an array."
+ }
+ $items = @($Value)
+ if ($items.Count -eq 0) {
+ throw "$Label must not be empty."
+ }
+ $seen = @{}
+ foreach ($item in $items) {
+ if ($item -isnot [string] -or [string]::IsNullOrWhiteSpace($item) -or $item.Trim() -ne $item) {
+ throw "$Label contains an invalid value."
+ }
+ if ($seen.ContainsKey($item)) {
+ throw "$Label contains a duplicate value."
+ }
+ $seen[$item] = $true
+ }
+}
+
+function Assert-TrustPolicy([object]$Component, [Uri]$SourceUri, [string]$AssetName) {
+ $policy = $Component.updateTrustPolicy
+ if ($null -eq $policy -or $policy.PSObject.Properties.Name -cnotcontains 'type') {
+ throw "updateTrustPolicy is missing for $($Component.id)."
+ }
+
+ switch -CaseSensitive ($policy.type) {
+ 'githubReleaseDigest' {
+ Assert-ExactProperties $policy @('type', 'repository', 'tagPattern', 'assetPattern', 'requireStable') @('authenticodePublishers') "updateTrustPolicy for $($Component.id)"
+ if ($policy.repository -isnot [string] -or $policy.repository -notmatch '^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$') {
+ throw "GitHub repository is invalid for $($Component.id)."
+ }
+ Assert-CatalogPattern $policy.tagPattern 'tagPattern'
+ Assert-CatalogPattern $policy.assetPattern 'assetPattern'
+ if ($policy.requireStable -isnot [bool] -or -not $policy.requireStable) {
+ throw "GitHub release policy must require a stable release."
+ }
+ if ($policy.PSObject.Properties.Name -ccontains 'authenticodePublishers') {
+ Assert-StringArray $policy.authenticodePublishers 'authenticodePublishers'
+ }
+ if ($SourceUri.Host -ne 'github.com') {
+ throw "GitHub release source must use github.com."
+ }
+ $segments = @($SourceUri.AbsolutePath.Trim('/').Split('/'))
+ if (
+ $segments.Count -ne 6 -or
+ $segments[2] -cne 'releases' -or
+ $segments[3] -cne 'download' -or
+ -not [string]::Equals("$($segments[0])/$($segments[1])", $policy.repository, [StringComparison]::OrdinalIgnoreCase) -or
+ $segments[5] -cne $AssetName -or
+ -not (Test-CatalogPattern $policy.tagPattern $segments[4]) -or
+ -not (Test-CatalogPattern $policy.assetPattern $AssetName)
+ ) {
+ throw "GitHub source does not match trust policy for $($Component.id)."
+ }
+ }
+ 'buildTimeOnlyAuthenticode' {
+ Assert-ExactProperties $policy @('type', 'allowedSourceHosts', 'assetPattern', 'publishers') @() "updateTrustPolicy for $($Component.id)"
+ Assert-StringArray $policy.allowedSourceHosts 'allowedSourceHosts'
+ Assert-StringArray $policy.publishers 'publishers'
+ Assert-CatalogPattern $policy.assetPattern 'assetPattern'
+ $hosts = @($policy.allowedSourceHosts | ForEach-Object { $_.ToLowerInvariant() })
+ if ($hosts -notcontains $SourceUri.Host.ToLowerInvariant() -or -not (Test-CatalogPattern $policy.assetPattern $AssetName)) {
+ throw "Authenticode source does not match trust policy for $($Component.id)."
+ }
+ }
+ 'bundledOnlyNoIndependentProof' {
+ Assert-ExactProperties $policy @('type', 'reason') @() "updateTrustPolicy for $($Component.id)"
+ if (
+ $policy.reason -isnot [string] -or
+ [string]::IsNullOrWhiteSpace($policy.reason) -or
+ $policy.reason.Trim() -ne $policy.reason -or
+ $policy.reason.Length -gt 240 -or
+ $policy.reason.IndexOfAny([char[]]@(0..31)) -ge 0
+ ) {
+ throw "Bundled-only trust reason is invalid for $($Component.id)."
+ }
+ }
+ default {
+ throw "Unknown update trust policy for $($Component.id)."
+ }
+ }
+}
+
+function Assert-PinnedTrustPolicy([object]$Component) {
+ $policy = $Component.updateTrustPolicy
+ switch -CaseSensitive ($Component.id) {
+ 'proxifyre' {
+ if (
+ $policy.type -cne 'githubReleaseDigest' -or
+ $policy.repository -cne 'wiresock/proxifyre' -or
+ $policy.tagPattern -cne 'v*' -or
+ $policy.assetPattern -cne 'ProxiFyre-v*-x64-signed.zip' -or
+ @($policy.authenticodePublishers).Count -ne 1 -or
+ @($policy.authenticodePublishers)[0] -cne 'The Anti-Cloud Corporation'
+ ) { throw 'Pinned ProxiFyre trust policy mismatch.' }
+ }
+ 'windows-packet-filter' {
+ if (
+ $policy.type -cne 'githubReleaseDigest' -or
+ $policy.repository -cne 'wiresock/ndisapi' -or
+ $policy.tagPattern -cne 'v*' -or
+ $policy.assetPattern -cne 'Windows.Packet.Filter.*.x64.msi' -or
+ @($policy.authenticodePublishers).Count -ne 1 -or
+ @($policy.authenticodePublishers)[0] -cne 'The Anti-Cloud Corporation'
+ ) { throw 'Pinned Windows Packet Filter trust policy mismatch.' }
+ }
+ 'sing-box' {
+ if (
+ $policy.type -cne 'githubReleaseDigest' -or
+ $policy.repository -cne 'SagerNet/sing-box' -or
+ $policy.tagPattern -cne 'v*' -or
+ $policy.assetPattern -cne 'sing-box-*-windows-amd64.zip' -or
+ $policy.PSObject.Properties.Name -ccontains 'authenticodePublishers'
+ ) { throw 'Pinned sing-box trust policy mismatch.' }
+ }
+ 'vc-runtime' {
+ if (
+ $policy.type -cne 'buildTimeOnlyAuthenticode' -or
+ @($policy.allowedSourceHosts).Count -ne 1 -or
+ @($policy.allowedSourceHosts)[0] -cne 'aka.ms' -or
+ $policy.assetPattern -cne 'VC_redist.x64.exe' -or
+ @($policy.publishers).Count -ne 1 -or
+ @($policy.publishers)[0] -cne 'Microsoft Corporation'
+ ) { throw 'Pinned VC runtime trust policy mismatch.' }
+ }
+ 'winsw' {
+ $expectedReason = 'The official v2.12.0 asset is unsigned and has no independent release digest; runtime network update is disabled.'
+ if ($policy.type -cne 'bundledOnlyNoIndependentProof' -or $policy.reason -cne $expectedReason) {
+ throw 'Pinned WinSW trust policy mismatch.'
+ }
+ }
+ default { throw "Unknown component id '$($Component.id)'." }
+ }
+}
+
+function Assert-OfficialSource([object]$Component, [Uri]$SourceUri, [string]$AssetName) {
+ $repositories = @{
+ 'proxifyre' = 'wiresock/proxifyre'
+ 'windows-packet-filter' = 'wiresock/ndisapi'
+ 'sing-box' = 'SagerNet/sing-box'
+ 'winsw' = 'winsw/winsw'
+ }
+ if ($Component.id -ceq 'vc-runtime') {
+ if (@('aka.ms', 'download.visualstudio.microsoft.com') -notcontains $SourceUri.Host.ToLowerInvariant()) {
+ throw 'VC runtime source is not an approved Microsoft host.'
+ }
+ return
+ }
+ if (-not $repositories.ContainsKey($Component.id) -or $SourceUri.Host -ne 'github.com') {
+ throw "Component source is not an official GitHub source for $($Component.id)."
+ }
+ $segments = @($SourceUri.AbsolutePath.Trim('/').Split('/'))
+ if (
+ $segments.Count -ne 6 -or
+ -not [string]::Equals("$($segments[0])/$($segments[1])", $repositories[$Component.id], [StringComparison]::OrdinalIgnoreCase) -or
+ $segments[2] -cne 'releases' -or
+ $segments[3] -cne 'download' -or
+ $segments[4].TrimStart('v') -cne $Component.version -or
+ $segments[5] -cne $AssetName
+ ) {
+ throw "Component source is not its pinned official release for $($Component.id)."
+ }
+}
+
+function Assert-NoReparseTree([string]$Root) {
+ $items = @((Get-Item -LiteralPath $Root -Force)) + @(Get-ChildItem -LiteralPath $Root -Recurse -Force)
+ foreach ($item in $items) {
+ if (($item.Attributes -band [IO.FileAttributes]::ReparsePoint) -ne 0) {
+ throw "Bundle contains a reparse point: $($item.Name)"
+ }
+ }
+}
+
+function Remove-SafeGeneratedDirectory(
+ [string]$Path,
+ [string]$ExpectedParent,
+ [string]$LeafPattern
+) {
+ if (-not (Test-Path -LiteralPath $Path)) {
+ return
+ }
+ $fullPath = [IO.Path]::GetFullPath($Path)
+ $fullParent = [IO.Path]::GetFullPath((Split-Path -Parent $fullPath)).TrimEnd('\', '/')
+ $expectedFullParent = [IO.Path]::GetFullPath($ExpectedParent).TrimEnd('\', '/')
+ $leaf = Split-Path -Leaf $fullPath
+ if (
+ -not [string]::Equals($fullParent, $expectedFullParent, [StringComparison]::OrdinalIgnoreCase) -or
+ $leaf -notmatch $LeafPattern -or
+ -not (Test-Path -LiteralPath $fullPath -PathType Container)
+ ) {
+ throw "Refusing to remove an unexpected generated directory: $leaf"
+ }
+ Assert-NoReparseTree $fullPath
+ Remove-Item -LiteralPath $fullPath -Recurse -Force
+}
+
+function Test-SafeEmptyDirectory([string]$Path) {
+ if (-not (Test-Path -LiteralPath $Path -PathType Container)) {
+ return $false
+ }
+ Assert-NoReparseTree $Path
+ return $null -eq (Get-ChildItem -LiteralPath $Path -Force | Select-Object -First 1)
+}
+
+function Remove-SafeEmptyDirectory([string]$Path, [string]$ExpectedPath) {
+ $fullPath = [IO.Path]::GetFullPath($Path)
+ $expectedFullPath = [IO.Path]::GetFullPath($ExpectedPath)
+ if (-not [string]::Equals($fullPath, $expectedFullPath, [StringComparison]::OrdinalIgnoreCase)) {
+ throw 'Refusing to remove an unexpected empty directory.'
+ }
+ if (-not (Test-SafeEmptyDirectory $fullPath)) {
+ throw 'Refusing to remove a directory that is not a safe empty placeholder.'
+ }
+ Remove-Item -LiteralPath $fullPath -Force
+}
+
+function Get-RelativeBundlePath([string]$Root, [string]$Path) {
+ $prefix = $Root.TrimEnd('\', '/') + [IO.Path]::DirectorySeparatorChar
+ if (-not $Path.StartsWith($prefix, [StringComparison]::OrdinalIgnoreCase)) {
+ throw 'Bundle entry escaped its root.'
+ }
+ return $Path.Substring($prefix.Length).Replace('\', '/')
+}
+
+function Test-ComponentBundle([string]$Root) {
+ $resolvedRoot = [IO.Path]::GetFullPath($Root)
+ if (-not (Test-Path -LiteralPath $resolvedRoot -PathType Container)) {
+ throw "Component bundle does not exist: $resolvedRoot"
+ }
+ Assert-ValidatedParent (Split-Path -Parent $resolvedRoot)
+ Assert-NoReparseTree $resolvedRoot
+
+ $catalogPath = Join-Path $resolvedRoot 'catalog.json'
+ if (-not (Test-Path -LiteralPath $catalogPath -PathType Leaf)) {
+ throw 'catalog.json is missing.'
+ }
+ try {
+ $catalog = Get-Content -Raw -LiteralPath $catalogPath | ConvertFrom-Json
+ } catch {
+ throw "catalog.json is invalid: $($_.Exception.Message)"
+ }
+ Assert-ExactProperties $catalog @('schemaVersion', 'targetArch', 'components') @() 'catalog'
+ $schemaIsInteger = $catalog.schemaVersion -is [Int32] -or $catalog.schemaVersion -is [Int64]
+ if (
+ -not $schemaIsInteger -or
+ [Int64]$catalog.schemaVersion -ne 1 -or
+ $catalog.targetArch -isnot [string] -or
+ $catalog.targetArch -cne 'x64'
+ ) {
+ throw 'Unsupported component catalog schema or target architecture.'
+ }
+
+ $components = @($catalog.components)
+ if ($components.Count -ne $ExpectedComponents.Count) {
+ throw 'Catalog must contain exactly five components.'
+ }
+ $seenIds = @{}
+ $seenRoles = @{}
+ $seenAssets = @{}
+ $seenLicenses = @{}
+ $expectedFiles = @{ 'catalog.json' = $true }
+
+ foreach ($component in $components) {
+ Assert-ExactProperties $component @(
+ 'id', 'version', 'assetPath', 'assetArch', 'effectiveTarget', 'sha256', 'size',
+ 'sourceUrl', 'license', 'installRole', 'updateTrustPolicy'
+ ) @('fileVersion', 'productVersion') "component"
+ $expected = @($ExpectedComponents | Where-Object { $_.id -ceq $component.id })
+ if ($expected.Count -ne 1) {
+ throw "Unknown or duplicate component id '$($component.id)'."
+ }
+ if ($seenIds.ContainsKey($component.id)) {
+ throw "Duplicate component id '$($component.id)'."
+ }
+ $seenIds[$component.id] = $true
+
+ if (
+ $component.version -cne $expected[0].version -or
+ $component.installRole -cne $expected[0].installRole -or
+ $component.assetArch -cne $expected[0].assetArch -or
+ $component.effectiveTarget -cne 'x64'
+ ) {
+ throw "Catalog identity does not match the pinned x64 baseline for $($component.id)."
+ }
+ if ($seenRoles.ContainsKey($component.installRole)) {
+ throw "Duplicate installRole '$($component.installRole)'."
+ }
+ $seenRoles[$component.installRole] = $true
+ if (-not (Test-StableNumericVersion $component.version)) {
+ throw "Invalid version for $($component.id)."
+ }
+ if ($component.PSObject.Properties.Name -ccontains 'fileVersion') {
+ if (-not (Test-StableNumericVersion $component.fileVersion)) {
+ throw "Invalid fileVersion for $($component.id)."
+ }
+ }
+ if ($component.PSObject.Properties.Name -ccontains 'productVersion') {
+ if (-not (Test-StableProductVersion $component.productVersion)) {
+ throw "Invalid productVersion for $($component.id)."
+ }
+ }
+ $hasFileVersion = $component.PSObject.Properties.Name -ccontains 'fileVersion'
+ $hasProductVersion = $component.PSObject.Properties.Name -ccontains 'productVersion'
+ if (
+ ($null -eq $expected[0].fileVersion -and $hasFileVersion) -or
+ ($null -ne $expected[0].fileVersion -and (-not $hasFileVersion -or $component.fileVersion -cne $expected[0].fileVersion)) -or
+ ($null -eq $expected[0].productVersion -and $hasProductVersion) -or
+ ($null -ne $expected[0].productVersion -and (-not $hasProductVersion -or $component.productVersion -cne $expected[0].productVersion))
+ ) {
+ throw "Version metadata does not match the pinned baseline for $($component.id)."
+ }
+
+ Assert-SafeRelativePath $component.assetPath 'assetPath'
+ if (
+ $component.assetPath.Split('/')[0] -cne $component.id -or
+ $component.assetPath.Split('/')[-1] -cne $expected[0].assetName
+ ) {
+ throw "assetPath must be inside the $($component.id) directory."
+ }
+ if ($seenAssets.ContainsKey($component.assetPath)) {
+ throw "Duplicate asset path '$($component.assetPath)'."
+ }
+ $seenAssets[$component.assetPath] = $true
+
+ Assert-ExactProperties $component.license @('id', 'path') @() "license for $($component.id)"
+ if (
+ $component.license.id -isnot [string] -or
+ $component.license.id -cnotmatch '^[A-Za-z0-9.+_-]{1,96}$' -or
+ $component.license.id -cne $expected[0].licenseId
+ ) {
+ throw "Invalid license id for $($component.id)."
+ }
+ Assert-SafeRelativePath $component.license.path 'license.path'
+ if (
+ $component.license.path.Split('/')[0] -cne $component.id -or
+ $component.license.path -cne $expected[0].licensePath -or
+ $component.license.path -ceq $component.assetPath
+ ) {
+ throw "license.path must be inside the $($component.id) directory."
+ }
+ if ($seenLicenses.ContainsKey($component.license.path)) {
+ throw "Duplicate license path '$($component.license.path)'."
+ }
+ $seenLicenses[$component.license.path] = $true
+
+ if (
+ $component.sha256 -isnot [string] -or
+ $component.sha256 -cnotmatch '^[0-9a-f]{64}$' -or
+ $component.sha256 -cne $expected[0].sha256
+ ) {
+ throw "Invalid SHA-256 for $($component.id)."
+ }
+ $sizeIsInteger = $component.size -is [Int32] -or $component.size -is [Int64]
+ if (
+ -not $sizeIsInteger -or
+ [Int64]$component.size -le 0 -or
+ [Int64]$component.size -ne $expected[0].size
+ ) {
+ throw "Invalid size for $($component.id)."
+ }
+ $size = [Int64]$component.size
+ $sourceUri = Assert-PlainHttpsUrl $component.sourceUrl 'sourceUrl'
+ if ($component.sourceUrl -cne $expected[0].sourceUrl) {
+ throw "sourceUrl does not match the pinned baseline for $($component.id)."
+ }
+ $assetName = $component.assetPath.Split('/')[-1]
+ if ([Uri]::UnescapeDataString($sourceUri.Segments[-1].Trim('/')) -cne $assetName) {
+ throw "sourceUrl filename does not match assetPath for $($component.id)."
+ }
+ Assert-OfficialSource $component $sourceUri $assetName
+ Assert-TrustPolicy $component $sourceUri $assetName
+ if ($component.updateTrustPolicy.type -cne $expected[0].policyType) {
+ throw "Trust policy type does not match the pinned baseline for $($component.id)."
+ }
+ Assert-PinnedTrustPolicy $component
+
+ $assetFullPath = [IO.Path]::GetFullPath((Join-Path $resolvedRoot $component.assetPath.Replace('/', '\')))
+ $licenseFullPath = [IO.Path]::GetFullPath((Join-Path $resolvedRoot $component.license.path.Replace('/', '\')))
+ if (-not (Test-Path -LiteralPath $assetFullPath -PathType Leaf)) {
+ throw "Asset is missing for $($component.id)."
+ }
+ if (-not (Test-Path -LiteralPath $licenseFullPath -PathType Leaf)) {
+ throw "License is missing or empty for $($component.id)."
+ }
+ $licenseItem = Get-Item -LiteralPath $licenseFullPath
+ $licenseHash = (Get-FileHash -LiteralPath $licenseFullPath -Algorithm SHA256).Hash.ToLowerInvariant()
+ if ($licenseItem.Length -ne $expected[0].licenseSize -or $licenseHash -cne $expected[0].licenseSha256) {
+ throw "License hash or size mismatch for $($component.id)."
+ }
+ Assert-LocalLicenseIdentity $component.id $licenseFullPath
+ $asset = Get-Item -LiteralPath $assetFullPath
+ if ($asset.Length -ne $size) {
+ throw "Asset size mismatch for $($component.id)."
+ }
+ $actualHash = (Get-FileHash -LiteralPath $assetFullPath -Algorithm SHA256).Hash.ToLowerInvariant()
+ if ($actualHash -cne $component.sha256) {
+ throw "Asset SHA-256 mismatch for $($component.id)."
+ }
+ Assert-LocalPackageIdentity $component.id $assetFullPath
+ $expectedFiles[$component.assetPath] = $true
+ $expectedFiles[$component.license.path] = $true
+ }
+
+ $actualFiles = @{}
+ foreach ($file in Get-ChildItem -LiteralPath $resolvedRoot -Recurse -File -Force) {
+ $relative = Get-RelativeBundlePath $resolvedRoot $file.FullName
+ Assert-SafeRelativePath $relative 'bundle entry'
+ $actualFiles[$relative] = $true
+ }
+ $missing = @($expectedFiles.Keys | Where-Object { -not $actualFiles.ContainsKey($_) })
+ $extra = @($actualFiles.Keys | Where-Object { -not $expectedFiles.ContainsKey($_) })
+ if ($missing.Count -gt 0 -or $extra.Count -gt 0) {
+ throw "Bundle file set mismatch (missing: $($missing.Count), extra: $($extra.Count))."
+ }
+ return $catalog
+}
+
+function Assert-ValidatedParent([string]$ParentPath) {
+ if (-not (Test-Path -LiteralPath $ParentPath -PathType Container)) {
+ throw "Output parent directory does not exist: $ParentPath"
+ }
+ $current = Get-Item -LiteralPath $ParentPath -Force
+ while ($null -ne $current) {
+ if (($current.Attributes -band [IO.FileAttributes]::ReparsePoint) -ne 0) {
+ throw "Output parent contains a reparse point: $($current.FullName)"
+ }
+ $current = $current.Parent
+ }
+}
+
+function Get-RetryDelaySeconds([object]$Response, [int]$TransientFailures) {
+ $delaySeconds = [Math]::Pow(2, $TransientFailures - 1)
+ $retryAfter = $Response.Headers.RetryAfter
+ if ($null -ne $retryAfter) {
+ if ($null -ne $retryAfter.Delta) {
+ $delaySeconds = $retryAfter.Delta.TotalSeconds
+ } elseif ($null -ne $retryAfter.Date) {
+ $delaySeconds = ($retryAfter.Date.UtcDateTime - [DateTime]::UtcNow).TotalSeconds
+ }
+ }
+ return [Math]::Min(30, [Math]::Max(0, [Math]::Ceiling($delaySeconds)))
+}
+
+function Invoke-JsonApi([string]$Uri) {
+ $parsed = Assert-PlainHttpsUrl $Uri 'API URL'
+ if ($parsed.Host -ne 'api.github.com') {
+ throw 'Only the official GitHub API is allowed.'
+ }
+
+ Add-Type -AssemblyName System.Net.Http
+ $handler = [Net.Http.HttpClientHandler]::new()
+ $handler.AllowAutoRedirect = $false
+ $handler.AutomaticDecompression = [Net.DecompressionMethods]::GZip -bor [Net.DecompressionMethods]::Deflate
+ $client = [Net.Http.HttpClient]::new($handler)
+ $client.Timeout = [Threading.Timeout]::InfiniteTimeSpan
+ $deadline = [Threading.CancellationTokenSource]::new([TimeSpan]::FromSeconds(60))
+ [void]$client.DefaultRequestHeaders.UserAgent.ParseAdd('proxywarden-component-bundle-updater')
+ [void]$client.DefaultRequestHeaders.Accept.ParseAdd('application/vnd.github+json')
+ [void]$client.DefaultRequestHeaders.Add('X-GitHub-Api-Version', '2022-11-28')
+ $response = $null
+ try {
+ try {
+ $transientFailures = 0
+ while ($true) {
+ $response = $client.GetAsync(
+ $parsed,
+ [Net.Http.HttpCompletionOption]::ResponseHeadersRead,
+ $deadline.Token
+ ).GetAwaiter().GetResult()
+ $statusCode = [int]$response.StatusCode
+ if ($statusCode -in @(301, 302, 303, 307, 308)) {
+ throw 'GitHub API redirect was rejected for api.github.com.'
+ }
+ if ($statusCode -eq 408 -or $statusCode -eq 429 -or ($statusCode -ge 500 -and $statusCode -le 599)) {
+ $transientFailures++
+ if ($transientFailures -ge 3) {
+ throw "GitHub API failed with transient HTTP status $statusCode after three attempts at api.github.com."
+ }
+ $delaySeconds = Get-RetryDelaySeconds $response $transientFailures
+ $response.Dispose()
+ $response = $null
+ [void]([Threading.Tasks.Task]::Delay([TimeSpan]::FromSeconds($delaySeconds), $deadline.Token).GetAwaiter().GetResult())
+ continue
+ }
+ if ($statusCode -lt 200 -or $statusCode -gt 299) {
+ throw "GitHub API failed with HTTP status $statusCode at api.github.com."
+ }
+ $contentLength = $response.Content.Headers.ContentLength
+ if ($null -ne $contentLength -and [Int64]$contentLength -gt 1048576) {
+ throw 'GitHub API response exceeded 1 MiB at api.github.com.'
+ }
+ $input = $response.Content.ReadAsStreamAsync().GetAwaiter().GetResult()
+ $output = [IO.MemoryStream]::new()
+ try {
+ $buffer = [byte[]]::new(32768)
+ $total = 0L
+ while (($count = $input.ReadAsync($buffer, 0, $buffer.Length, $deadline.Token).GetAwaiter().GetResult()) -gt 0) {
+ $total += $count
+ if ($total -gt 1048576) {
+ throw 'GitHub API response exceeded 1 MiB at api.github.com.'
+ }
+ $output.Write($buffer, 0, $count)
+ }
+ $body = [Text.UTF8Encoding]::new($false, $true).GetString($output.ToArray()).TrimStart([char]0xfeff)
+ } finally {
+ $output.Dispose()
+ $input.Dispose()
+ }
+ try {
+ return $body | ConvertFrom-Json
+ } catch {
+ throw 'GitHub API returned invalid JSON from api.github.com.'
+ }
+ }
+ } catch {
+ if ($_.Exception.Message.StartsWith('GitHub API ', [StringComparison]::Ordinal)) {
+ throw
+ }
+ throw 'GitHub API request failed for api.github.com.'
+ }
+ } finally {
+ if ($null -ne $response) { $response.Dispose() }
+ $deadline.Dispose()
+ $client.Dispose()
+ $handler.Dispose()
+ }
+}
+
+function Get-PinnedRelease([string]$Repository, [string]$Tag) {
+ $release = Invoke-JsonApi "https://api.github.com/repos/$Repository/releases/tags/$Tag"
+ if ($release.tag_name -cne $Tag -or [bool]$release.draft -or [bool]$release.prerelease) {
+ throw "GitHub release $Repository/$Tag is not the expected stable release."
+ }
+ return $release
+}
+
+function Get-ReleaseEvidence([string]$Repository, [string]$Tag, [bool]$UseFrozen) {
+ if (-not $UseFrozen) {
+ return Get-PinnedRelease $Repository $Tag
+ }
+
+ $asset = switch ("$Repository@$Tag") {
+ 'wiresock/proxifyre@v2.4.0' {
+ $releaseId = 356296939L
+ $publishedAt = '2026-07-19T08:51:37Z'
+ $releaseHtmlUrl = 'https://github.com/wiresock/proxifyre/releases/tag/v2.4.0'
+ [PSCustomObject]@{
+ id = 482601136L
+ url = 'https://api.github.com/repos/wiresock/proxifyre/releases/assets/482601136'
+ name = 'ProxiFyre-v2.4.0-x64-signed.zip'
+ browser_download_url = 'https://github.com/wiresock/proxifyre/releases/download/v2.4.0/ProxiFyre-v2.4.0-x64-signed.zip'
+ size = 1519694L
+ digest = 'sha256:eab65fd7d8eeb716abedb5614618c641de3f9eb8326b99cee1da787141e30cac'
+ }
+ }
+ 'wiresock/ndisapi@v3.6.2' {
+ $releaseId = 256618257L
+ $publishedAt = '2025-10-23T09:12:20Z'
+ $releaseHtmlUrl = 'https://github.com/wiresock/ndisapi/releases/tag/v3.6.2'
+ [PSCustomObject]@{
+ id = 307688568L
+ url = 'https://api.github.com/repos/wiresock/ndisapi/releases/assets/307688568'
+ name = 'Windows.Packet.Filter.3.6.2.1.x64.msi'
+ browser_download_url = 'https://github.com/wiresock/ndisapi/releases/download/v3.6.2/Windows.Packet.Filter.3.6.2.1.x64.msi'
+ size = 819200L
+ digest = 'sha256:9c388c0b7f189f7fa98720bae2caecf7d64f30910838b80b438ecf8956b8502c'
+ }
+ }
+ 'SagerNet/sing-box@v1.13.19' {
+ $releaseId = 371636056L
+ $publishedAt = '2026-08-17T09:47:06Z'
+ $releaseHtmlUrl = 'https://github.com/SagerNet/sing-box/releases/tag/v1.13.19'
+ [PSCustomObject]@{
+ id = 517910532L
+ url = 'https://api.github.com/repos/SagerNet/sing-box/releases/assets/517910532'
+ name = 'sing-box-1.13.19-windows-amd64.zip'
+ browser_download_url = 'https://github.com/SagerNet/sing-box/releases/download/v1.13.19/sing-box-1.13.19-windows-amd64.zip'
+ size = 21046252L
+ digest = 'sha256:e011a4def2f5e2b143ed54adb2b1a20a6be407806ab4442f3667f1dd817a2c8d'
+ }
+ }
+ 'winsw/winsw@v2.12.0' {
+ $releaseId = 90528888L
+ $publishedAt = '2023-01-28T16:22:38Z'
+ $releaseHtmlUrl = 'https://github.com/winsw/winsw/releases/tag/v2.12.0'
+ [PSCustomObject]@{
+ id = 93386826L
+ url = 'https://api.github.com/repos/winsw/winsw/releases/assets/93386826'
+ name = 'WinSW.NET461.exe'
+ browser_download_url = 'https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW.NET461.exe'
+ size = 655872L
+ digest = $null
+ }
+ }
+ default { throw 'Frozen release evidence does not cover the requested repository and tag.' }
+ }
+ return [PSCustomObject]@{
+ id = $releaseId
+ url = "https://api.github.com/repos/$Repository/releases/$releaseId"
+ html_url = $releaseHtmlUrl
+ tag_name = $Tag
+ draft = $false
+ prerelease = $false
+ published_at = $publishedAt
+ assets = @($asset)
+ }
+}
+
+function Get-ReleaseAsset([object]$Release, [string]$Name) {
+ $matches = @($Release.assets | Where-Object { $_.name -ceq $Name })
+ if ($matches.Count -ne 1) {
+ throw "Expected exactly one release asset named $Name."
+ }
+ return $matches[0]
+}
+
+function Test-AllowedRedirect([Uri]$InitialUri, [Uri]$NextUri) {
+ if (
+ $NextUri.Scheme -ne 'https' -or
+ -not [string]::IsNullOrEmpty($NextUri.UserInfo) -or
+ -not $NextUri.IsDefaultPort -or
+ -not [string]::IsNullOrEmpty($NextUri.Fragment)
+ ) {
+ return $false
+ }
+ $initialHost = $InitialUri.Host.ToLowerInvariant()
+ $nextHost = $NextUri.Host.ToLowerInvariant()
+ switch ($initialHost) {
+ 'github.com' { return @('github.com', 'release-assets.githubusercontent.com') -contains $nextHost }
+ 'release-assets.githubusercontent.com' { return $nextHost -eq 'release-assets.githubusercontent.com' }
+ 'raw.githubusercontent.com' { return $nextHost -eq 'raw.githubusercontent.com' }
+ 'aka.ms' { return @('aka.ms', 'download.visualstudio.microsoft.com') -contains $nextHost }
+ 'download.visualstudio.microsoft.com' { return $nextHost -eq 'download.visualstudio.microsoft.com' }
+ 'visualstudio.microsoft.com' { return $nextHost -eq 'visualstudio.microsoft.com' }
+ default { return $false }
+ }
+}
+
+function Save-Download([string]$Uri, [string]$Path, [Int64]$MaxBytes) {
+ $initialUri = Assert-PlainHttpsUrl $Uri 'Download URL'
+ if ($MaxBytes -le 0) {
+ throw 'Download size limit must be positive.'
+ }
+ $parent = Split-Path -Parent $Path
+ [void](New-Item -ItemType Directory -Path $parent -Force)
+ $partial = "$Path.part"
+ Add-Type -AssemblyName System.Net.Http
+ $handler = [Net.Http.HttpClientHandler]::new()
+ $handler.AllowAutoRedirect = $false
+ $handler.AutomaticDecompression = [Net.DecompressionMethods]::GZip -bor [Net.DecompressionMethods]::Deflate
+ $client = [Net.Http.HttpClient]::new($handler)
+ $client.Timeout = [Threading.Timeout]::InfiniteTimeSpan
+ $deadline = [Threading.CancellationTokenSource]::new([TimeSpan]::FromSeconds(240))
+ [void]$client.DefaultRequestHeaders.UserAgent.ParseAdd('proxywarden-component-bundle-updater')
+ [void]$client.DefaultRequestHeaders.Accept.ParseAdd('application/octet-stream,*/*')
+ $currentUri = $initialUri
+ $response = $null
+ try {
+ $redirectCount = 0
+ $transientFailures = 0
+ while ($true) {
+ $response = $client.GetAsync(
+ $currentUri,
+ [Net.Http.HttpCompletionOption]::ResponseHeadersRead,
+ $deadline.Token
+ ).GetAwaiter().GetResult()
+ $statusCode = [int]$response.StatusCode
+ if ($statusCode -in @(301, 302, 303, 307, 308)) {
+ if ($redirectCount -ge 5 -or $null -eq $response.Headers.Location) {
+ throw "Download exceeded the redirect limit: $Uri"
+ }
+ $nextUri = if ($response.Headers.Location.IsAbsoluteUri) {
+ $response.Headers.Location
+ } else {
+ [Uri]::new($currentUri, $response.Headers.Location)
+ }
+ if (-not (Test-AllowedRedirect $currentUri $nextUri)) {
+ throw "Download redirect target is not allowed: $($nextUri.Host)"
+ }
+ $response.Dispose()
+ $response = $null
+ $currentUri = $nextUri
+ $redirectCount++
+ continue
+ }
+ if ($statusCode -eq 408 -or $statusCode -eq 429 -or ($statusCode -ge 500 -and $statusCode -le 599)) {
+ $transientFailures++
+ if ($transientFailures -ge 3) {
+ throw "Download failed with transient HTTP status $statusCode after three attempts."
+ }
+ $delaySeconds = Get-RetryDelaySeconds $response $transientFailures
+ $response.Dispose()
+ $response = $null
+ [void]([Threading.Tasks.Task]::Delay([TimeSpan]::FromSeconds($delaySeconds), $deadline.Token).GetAwaiter().GetResult())
+ continue
+ }
+ [void]$response.EnsureSuccessStatusCode()
+ $contentLength = $response.Content.Headers.ContentLength
+ if ($null -ne $contentLength -and [Int64]$contentLength -gt $MaxBytes) {
+ throw "Download exceeds the size limit: $Uri"
+ }
+ $input = $response.Content.ReadAsStreamAsync().GetAwaiter().GetResult()
+ $output = [IO.File]::Open($partial, [IO.FileMode]::CreateNew, [IO.FileAccess]::Write, [IO.FileShare]::None)
+ try {
+ $buffer = [byte[]]::new(65536)
+ $total = 0L
+ while (($count = $input.ReadAsync($buffer, 0, $buffer.Length, $deadline.Token).GetAwaiter().GetResult()) -gt 0) {
+ $total += $count
+ if ($total -gt $MaxBytes) {
+ throw "Download exceeds the size limit: $Uri"
+ }
+ $output.Write($buffer, 0, $count)
+ if ($script:InjectDownloadFailure) {
+ $script:InjectDownloadFailure = $false
+ throw 'Simulated bundle download failure after a partial write.'
+ }
+ }
+ } finally {
+ $output.Dispose()
+ $input.Dispose()
+ }
+ break
+ }
+ if (-not (Test-Path -LiteralPath $partial -PathType Leaf) -or (Get-Item -LiteralPath $partial).Length -le 0) {
+ throw "Downloaded file is empty: $Uri"
+ }
+ Move-Item -LiteralPath $partial -Destination $Path
+ } finally {
+ if ($null -ne $response) { $response.Dispose() }
+ $deadline.Dispose()
+ $client.Dispose()
+ $handler.Dispose()
+ Remove-Item -LiteralPath $partial -Force -ErrorAction SilentlyContinue
+ }
+}
+
+function Save-GitHubDigestAsset(
+ [object]$Release,
+ [string]$Name,
+ [string]$ExpectedUrl,
+ [string]$Destination,
+ [string]$FrozenHash,
+ [Int64]$FrozenSize
+) {
+ $asset = Get-ReleaseAsset $Release $Name
+ if ($asset.browser_download_url -cne $ExpectedUrl) {
+ throw "Official asset URL changed for $Name."
+ }
+ $digestProperty = $asset.PSObject.Properties['digest']
+ if ($null -eq $digestProperty -or $digestProperty.Value -cnotmatch '^sha256:([0-9a-f]{64})$') {
+ throw "GitHub did not provide an independent SHA-256 digest for $Name."
+ }
+ $expectedHash = $Matches[1]
+ if ($expectedHash -cne $FrozenHash -or [Int64]$asset.size -ne $FrozenSize) {
+ throw "GitHub release identity does not match the frozen baseline for $Name."
+ }
+ Save-Download $ExpectedUrl $Destination $FrozenSize
+ $item = Get-Item -LiteralPath $Destination
+ if ($item.Length -ne [Int64]$asset.size) {
+ throw "GitHub asset size mismatch for $Name."
+ }
+ $actualHash = (Get-FileHash -LiteralPath $Destination -Algorithm SHA256).Hash.ToLowerInvariant()
+ if ($actualHash -cne $expectedHash) {
+ throw "GitHub digest mismatch for $Name."
+ }
+ return [PSCustomObject]@{ hash = $actualHash; size = $item.Length; url = $ExpectedUrl }
+}
+
+function Save-PinnedAsset(
+ [string]$Uri,
+ [string]$Destination,
+ [string]$ExpectedHash,
+ [Int64]$ExpectedSize
+) {
+ Save-Download $Uri $Destination $ExpectedSize
+ $item = Get-Item -LiteralPath $Destination
+ $actualHash = (Get-FileHash -LiteralPath $Destination -Algorithm SHA256).Hash.ToLowerInvariant()
+ if ($item.Length -ne $ExpectedSize -or $actualHash -cne $ExpectedHash) {
+ throw "Pinned asset identity mismatch for $($item.Name)."
+ }
+ return [PSCustomObject]@{ hash = $actualHash; size = $item.Length; url = $Uri }
+}
+
+function Assert-AuthenticodePublisher([string]$Path, [string]$Publisher) {
+ $signature = Get-AuthenticodeSignature -LiteralPath $Path
+ if ($signature.Status -ne [Management.Automation.SignatureStatus]::Valid -or $null -eq $signature.SignerCertificate) {
+ throw "Authenticode signature is not valid for $(Split-Path -Leaf $Path)."
+ }
+ $subject = $signature.SignerCertificate.Subject
+ $escapedPublisher = [Regex]::Escape($Publisher)
+ if (
+ -not [Regex]::IsMatch($subject, "(?:^|,\s*)CN=$escapedPublisher(?:,|$)", [Text.RegularExpressions.RegexOptions]::IgnoreCase) -or
+ -not [Regex]::IsMatch($subject, "(?:^|,\s*)O=$escapedPublisher(?:,|$)", [Text.RegularExpressions.RegexOptions]::IgnoreCase)
+ ) {
+ throw "Authenticode publisher mismatch for $(Split-Path -Leaf $Path)."
+ }
+}
+
+function Assert-Unsigned([string]$Path) {
+ $signature = Get-AuthenticodeSignature -LiteralPath $Path
+ if ($signature.Status.ToString() -ne 'NotSigned') {
+ throw "Expected an unsigned pinned asset: $(Split-Path -Leaf $Path)."
+ }
+}
+
+function Assert-ManagedAnyCpu([string]$Path) {
+ $bytes = [IO.File]::ReadAllBytes($Path)
+ if ($bytes.Length -lt 256 -or $bytes[0] -ne 0x4d -or $bytes[1] -ne 0x5a) {
+ throw 'WinSW is not a valid PE file.'
+ }
+ $peOffset = [BitConverter]::ToInt32($bytes, 0x3c)
+ if (
+ $peOffset -lt 0 -or $peOffset + 256 -gt $bytes.Length -or
+ [BitConverter]::ToUInt32($bytes, $peOffset) -ne 0x00004550 -or
+ [BitConverter]::ToUInt16($bytes, $peOffset + 4) -ne 0x014c
+ ) {
+ throw 'WinSW has an invalid PE header.'
+ }
+ $sectionCount = [BitConverter]::ToUInt16($bytes, $peOffset + 6)
+ $optionalSize = [BitConverter]::ToUInt16($bytes, $peOffset + 20)
+ $optionalOffset = $peOffset + 24
+ if ([BitConverter]::ToUInt16($bytes, $optionalOffset) -ne 0x010b) {
+ throw 'WinSW must use the audited PE32 AnyCPU layout.'
+ }
+ $clrDirectoryOffset = $optionalOffset + 96 + (14 * 8)
+ if ($clrDirectoryOffset + 8 -gt $optionalOffset + $optionalSize) {
+ throw 'WinSW PE header has no CLR directory.'
+ }
+ $clrRva = [BitConverter]::ToUInt32($bytes, $clrDirectoryOffset)
+ if ($clrRva -eq 0) {
+ throw 'WinSW is not a managed assembly.'
+ }
+ $sectionOffset = $optionalOffset + $optionalSize
+ $clrFileOffset = $null
+ for ($index = 0; $index -lt $sectionCount; $index++) {
+ $offset = $sectionOffset + ($index * 40)
+ if ($offset + 40 -gt $bytes.Length) { throw 'WinSW PE section table is truncated.' }
+ $virtualSize = [BitConverter]::ToUInt32($bytes, $offset + 8)
+ $virtualAddress = [BitConverter]::ToUInt32($bytes, $offset + 12)
+ $rawSize = [BitConverter]::ToUInt32($bytes, $offset + 16)
+ $rawOffset = [BitConverter]::ToUInt32($bytes, $offset + 20)
+ $mappedSize = [Math]::Max([UInt64]$virtualSize, [UInt64]$rawSize)
+ if ([UInt64]$clrRva -ge [UInt64]$virtualAddress -and [UInt64]$clrRva -lt ([UInt64]$virtualAddress + $mappedSize)) {
+ $clrFileOffset = [Int64]$rawOffset + ([Int64]$clrRva - [Int64]$virtualAddress)
+ break
+ }
+ }
+ if ($null -eq $clrFileOffset -or $clrFileOffset + 20 -gt $bytes.Length) {
+ throw 'WinSW CLR header is outside the PE sections.'
+ }
+ $flags = [BitConverter]::ToUInt32($bytes, [int]$clrFileOffset + 16)
+ $ilOnly = ($flags -band 0x00000001) -ne 0
+ $requires32Bit = ($flags -band 0x00000002) -ne 0
+ $prefers32Bit = ($flags -band 0x00020000) -ne 0
+ if (-not $ilOnly -or $requires32Bit -or $prefers32Bit) {
+ throw 'WinSW must be ILOnly AnyCPU without 32-bit preference flags.'
+ }
+ $metadataText = [Text.Encoding]::UTF8.GetString($bytes)
+ if ($metadataText.IndexOf('.NETFramework,Version=v4.6.1', [StringComparison]::Ordinal) -lt 0) {
+ throw 'WinSW must target the audited .NET Framework 4.6.1 runtime.'
+ }
+}
+
+function Assert-PeBytesMachineX64([byte[]]$Bytes, [string]$Label) {
+ $bytes = $Bytes
+ if ($bytes.Length -lt 128 -or $bytes[0] -ne 0x4d -or $bytes[1] -ne 0x5a) {
+ throw "File is not a valid PE image: $Label"
+ }
+ $peOffset = [BitConverter]::ToInt32($bytes, 0x3c)
+ if (
+ $peOffset -lt 0 -or $peOffset + 26 -gt $bytes.Length -or
+ [BitConverter]::ToUInt32($bytes, $peOffset) -ne 0x00004550 -or
+ [BitConverter]::ToUInt16($bytes, $peOffset + 4) -ne 0x8664
+ ) {
+ throw "PE image is not x64: $Label"
+ }
+}
+
+function Assert-PeMachineX64([string]$Path) {
+ Assert-PeBytesMachineX64 ([IO.File]::ReadAllBytes($Path)) (Split-Path -Leaf $Path)
+}
+
+function Get-ZipEntryBytes([string]$Path, [string]$LeafName) {
+ Add-Type -AssemblyName System.IO.Compression.FileSystem
+ $archive = [IO.Compression.ZipFile]::OpenRead($Path)
+ try {
+ $matches = @($archive.Entries | Where-Object { $_.Name -ceq $LeafName })
+ if ($matches.Count -ne 1) {
+ throw "Archive must contain exactly one $LeafName."
+ }
+ $input = $matches[0].Open()
+ $output = [IO.MemoryStream]::new()
+ try {
+ $input.CopyTo($output)
+ return ,$output.ToArray()
+ } finally {
+ $output.Dispose()
+ $input.Dispose()
+ }
+ } finally {
+ $archive.Dispose()
+ }
+}
+
+function Get-ZipFullEntryBytes([string]$Path, [string]$FullName, [Int64]$MaxBytes) {
+ Add-Type -AssemblyName System.IO.Compression.FileSystem
+ $archive = [IO.Compression.ZipFile]::OpenRead($Path)
+ try {
+ $matches = @($archive.Entries | Where-Object { $_.FullName.Replace('\', '/') -ceq $FullName })
+ if ($matches.Count -ne 1 -or $matches[0].Length -le 0 -or $matches[0].Length -gt $MaxBytes) {
+ throw "Document archive entry is missing or too large: $FullName"
+ }
+ $input = $matches[0].Open()
+ $output = [IO.MemoryStream]::new()
+ try {
+ $input.CopyTo($output)
+ return ,$output.ToArray()
+ } finally {
+ $output.Dispose()
+ $input.Dispose()
+ }
+ } finally {
+ $archive.Dispose()
+ }
+}
+
+function Invoke-PinnedGit(
+ [string[]]$Arguments,
+ [string]$EmptyConfigPath,
+ [string]$Operation
+) {
+ $git = Get-Command git.exe -CommandType Application -ErrorAction Stop | Select-Object -First 1
+ $environmentValues = @{
+ GIT_CONFIG_GLOBAL = $EmptyConfigPath
+ GIT_CONFIG_SYSTEM = $EmptyConfigPath
+ GIT_CONFIG_NOSYSTEM = '1'
+ GIT_CONFIG_COUNT = '0'
+ GIT_TERMINAL_PROMPT = '0'
+ GCM_INTERACTIVE = 'Never'
+ GIT_LFS_SKIP_SMUDGE = '1'
+ GIT_PROTOCOL_FROM_USER = '0'
+ }
+ $previous = @{}
+ foreach ($name in $environmentValues.Keys) {
+ $previous[$name] = [PSCustomObject]@{
+ exists = Test-Path -LiteralPath "Env:$name"
+ value = [Environment]::GetEnvironmentVariable($name, 'Process')
+ }
+ [Environment]::SetEnvironmentVariable($name, $environmentValues[$name], 'Process')
+ }
+ $previousPreference = $ErrorActionPreference
+ try {
+ $ErrorActionPreference = 'Continue'
+ $output = @(& $git.Source @Arguments 2>&1)
+ $exitCode = $LASTEXITCODE
+ if ($exitCode -ne 0) {
+ throw "Pinned Git license acquisition failed during $Operation."
+ }
+ return @($output | ForEach-Object { $_.ToString() })
+ } finally {
+ $ErrorActionPreference = $previousPreference
+ foreach ($name in $environmentValues.Keys) {
+ if ($previous[$name].exists) {
+ [Environment]::SetEnvironmentVariable($name, $previous[$name].value, 'Process')
+ } else {
+ [Environment]::SetEnvironmentVariable($name, $null, 'Process')
+ }
+ }
+ }
+}
+
+function Save-LicenseFromPinnedGit(
+ [string]$RepositoryUrl,
+ [string]$RepositoryKey,
+ [string]$Tag,
+ [string]$TagObject,
+ [string]$Commit,
+ [string]$LicenseName,
+ [string]$Destination,
+ [string]$WorkRoot
+) {
+ $identity = "$RepositoryUrl|$RepositoryKey|$Tag|$TagObject|$Commit|$LicenseName"
+ $allowed = @(
+ 'https://github.com/wiresock/proxifyre.git|proxifyre|v2.4.0|dd1512840e1e3bc596b06b80eda4e2dcd6a9c9ed|dd1512840e1e3bc596b06b80eda4e2dcd6a9c9ed|LICENSE',
+ 'https://github.com/wiresock/ndisapi.git|ndisapi|v3.6.2|417b8734e844083a10236387fba705d94a2d6bc9|417b8734e844083a10236387fba705d94a2d6bc9|LICENSE',
+ 'https://github.com/SagerNet/sing-box.git|sing-box|v1.13.19|b5ebaa1fc0f2b94256180b95468e73ef53caa27d|b5ebaa1fc0f2b94256180b95468e73ef53caa27d|LICENSE',
+ 'https://github.com/winsw/winsw.git|winsw|v2.12.0|eef5bade59fca0254e387ac73ed7625ba6aa7147|eef5bade59fca0254e387ac73ed7625ba6aa7147|LICENSE.txt'
+ )
+ if ($allowed -cnotcontains $identity) {
+ throw 'Pinned Git license identity is not allowlisted.'
+ }
+ Assert-NoReparseTree $WorkRoot
+ $emptyConfigPath = Join-Path $WorkRoot 'empty.gitconfig'
+ if (-not (Test-Path -LiteralPath $emptyConfigPath)) {
+ [IO.File]::WriteAllText($emptyConfigPath, '', [Text.UTF8Encoding]::new($false))
+ }
+ $repoPath = Join-Path $WorkRoot "$RepositoryKey-repo"
+ $archivePath = Join-Path $WorkRoot "$RepositoryKey-license.zip"
+ if ((Test-Path -LiteralPath $repoPath) -or (Test-Path -LiteralPath $archivePath)) {
+ throw 'Pinned Git work path already exists.'
+ }
+
+ $remoteTag = @(Invoke-PinnedGit @(
+ 'ls-remote', '--refs', '--', $RepositoryUrl, "refs/tags/$Tag"
+ ) $emptyConfigPath "verify remote $RepositoryKey tag")
+ $remoteTagLines = @($remoteTag | Where-Object { -not [string]::IsNullOrWhiteSpace($_) })
+ $expectedRemoteTag = "$TagObject`trefs/tags/$Tag"
+ if ($remoteTagLines.Count -ne 1 -or $remoteTagLines[0].TrimEnd() -cne $expectedRemoteTag) {
+ throw "Pinned Git remote tag object mismatch for $RepositoryKey."
+ }
+
+ [void](Invoke-PinnedGit @(
+ '-c', 'init.templateDir=', 'init', '--quiet', $repoPath
+ ) $emptyConfigPath "initialize $RepositoryKey")
+ [void](Invoke-PinnedGit @(
+ '-C', $repoPath, '-c', 'core.hooksPath=NUL', 'remote', 'add', 'origin', $RepositoryUrl
+ ) $emptyConfigPath "configure $RepositoryKey origin")
+ [void](Invoke-PinnedGit @(
+ '-C', $repoPath, '-c', 'core.hooksPath=NUL', '-c', 'protocol.file.allow=never',
+ '-c', 'http.sslBackend=schannel', 'fetch', '--quiet', '--depth', '1',
+ '--no-tags', 'origin', "+refs/tags/$Tag`:refs/tags/$Tag"
+ ) $emptyConfigPath "fetch exact $RepositoryKey tag")
+ Assert-NoReparseTree $repoPath
+ $localTag = @(Invoke-PinnedGit @('-C', $repoPath, 'rev-parse', '--verify', "refs/tags/$Tag") $emptyConfigPath "verify fetched $RepositoryKey tag")
+ $localTagValue = (@($localTag | Where-Object { -not [string]::IsNullOrWhiteSpace($_) }) -join '').Trim()
+ if ($localTagValue -cne $TagObject) {
+ throw "Pinned Git fetched tag object mismatch for $RepositoryKey."
+ }
+ $head = @(Invoke-PinnedGit @('-C', $repoPath, 'rev-parse', '--verify', "refs/tags/$Tag`^{commit}") $emptyConfigPath "verify $RepositoryKey commit")
+ $headValue = (@($head | Where-Object { -not [string]::IsNullOrWhiteSpace($_) }) -join '').Trim()
+ if ($headValue -cne $Commit) {
+ throw "Pinned Git commit mismatch for $RepositoryKey."
+ }
+ [void](Invoke-PinnedGit @(
+ '-C', $repoPath, '-c', 'core.hooksPath=NUL', 'archive', '--format=zip',
+ "--output=$archivePath", $Commit, '--', $LicenseName
+ ) $emptyConfigPath "archive $RepositoryKey license")
+
+ if (-not (Test-Path -LiteralPath $archivePath -PathType Leaf)) {
+ throw "Pinned Git license archive is missing for $RepositoryKey."
+ }
+ Add-Type -AssemblyName System.IO.Compression.FileSystem
+ $archive = [IO.Compression.ZipFile]::OpenRead($archivePath)
+ try {
+ if ($archive.Entries.Count -ne 1) {
+ throw "Pinned Git archive must contain exactly one license for $RepositoryKey."
+ }
+ $entry = $archive.Entries[0]
+ $unixFileType = (($entry.ExternalAttributes -shr 16) -band 0xf000)
+ if (
+ $entry.FullName -cne $LicenseName -or
+ [string]::IsNullOrEmpty($entry.Name) -or
+ $entry.Length -le 0 -or
+ $entry.Length -gt 1048576 -or
+ ($unixFileType -ne 0 -and $unixFileType -ne 0x8000)
+ ) {
+ throw "Pinned Git archive has an invalid license entry for $RepositoryKey."
+ }
+ $input = $entry.Open()
+ $output = [IO.File]::Open($Destination, [IO.FileMode]::CreateNew, [IO.FileAccess]::Write, [IO.FileShare]::None)
+ try {
+ $buffer = [byte[]]::new(32768)
+ $total = 0L
+ while (($count = $input.Read($buffer, 0, $buffer.Length)) -gt 0) {
+ $total += $count
+ if ($total -gt 1048576) { throw 'Pinned Git license exceeds the size limit.' }
+ $output.Write($buffer, 0, $count)
+ }
+ } finally {
+ $output.Dispose()
+ $input.Dispose()
+ }
+ } finally {
+ $archive.Dispose()
+ }
+}
+
+function Assert-LocalLicenseIdentity([string]$ComponentId, [string]$Path) {
+ if ($ComponentId -ceq 'vc-runtime') {
+ $stream = $null
+ $reader = $null
+ try {
+ $settings = [Xml.XmlReaderSettings]::new()
+ $settings.DtdProcessing = [Xml.DtdProcessing]::Prohibit
+ $settings.XmlResolver = $null
+ $stream = [IO.MemoryStream]::new((Get-ZipFullEntryBytes $Path 'word/document.xml' 2097152), $false)
+ $reader = [Xml.XmlReader]::Create($stream, $settings)
+ $document = [Xml.XmlDocument]::new()
+ $document.XmlResolver = $null
+ $document.Load($reader)
+ } catch {
+ throw "VC runtime license is not the expected official DOCX: $($_.Exception.Message)"
+ } finally {
+ if ($null -ne $reader) { $reader.Dispose() }
+ if ($null -ne $stream) { $stream.Dispose() }
+ }
+ if ($null -eq $document.DocumentElement) {
+ throw 'VC runtime license DOCX has no document element.'
+ }
+ $text = [string]$document.DocumentElement.InnerText
+ if ([string]::IsNullOrWhiteSpace($text)) {
+ throw 'VC runtime license DOCX has no readable text.'
+ }
+ foreach ($marker in @('Visual C++', 'Redistributable', 'Runtime')) {
+ if ($text.IndexOf($marker, [StringComparison]::OrdinalIgnoreCase) -lt 0) {
+ throw "VC runtime license is missing the expected '$marker' marker."
+ }
+ }
+ return
+ }
+
+ $content = Get-Content -Raw -LiteralPath $Path
+ $identityContent = [Regex]::Replace($content, '\s+', ' ')
+ switch -CaseSensitive ($ComponentId) {
+ 'proxifyre' { $markers = @('GNU AFFERO GENERAL PUBLIC LICENSE') }
+ 'windows-packet-filter' { $markers = @('MIT License') }
+ 'sing-box' {
+ $markers = @(
+ 'GNU GENERAL PUBLIC LICENSE',
+ 'In addition, no derivative work may use the name or imply association with this application without prior consent.'
+ )
+ }
+ 'winsw' { $markers = @('MIT License') }
+ default { throw "Unknown license identity: $ComponentId" }
+ }
+ foreach ($marker in $markers) {
+ if ($identityContent.IndexOf($marker, [StringComparison]::OrdinalIgnoreCase) -lt 0) {
+ throw "License identity mismatch for $ComponentId."
+ }
+ }
+}
+
+function Get-MsiSummaryTemplate([string]$Path) {
+ $installer = $null
+ $database = $null
+ $summary = $null
+ try {
+ $installer = New-Object -ComObject WindowsInstaller.Installer
+ $database = $installer.OpenDatabase($Path, 0)
+ $summary = $database.SummaryInformation(0)
+ return [string]$summary.Property(7)
+ } finally {
+ foreach ($value in @($summary, $database, $installer)) {
+ if ($null -ne $value -and [Runtime.InteropServices.Marshal]::IsComObject($value)) {
+ [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($value)
+ }
+ }
+ }
+}
+
+function Assert-LocalPackageIdentity([string]$ComponentId, [string]$Path) {
+ switch ($ComponentId) {
+ 'proxifyre' {
+ Assert-ZipEntries $Path @('ProxiFyre.exe', 'socksify.dll')
+ Assert-PeBytesMachineX64 (Get-ZipEntryBytes $Path 'ProxiFyre.exe') 'ProxiFyre.exe'
+ Assert-PeBytesMachineX64 (Get-ZipEntryBytes $Path 'socksify.dll') 'socksify.dll'
+ }
+ 'windows-packet-filter' {
+ if (
+ (Get-MsiProperty $Path 'ProductVersion') -cne '3.6.2.1' -or
+ (Get-MsiProperty $Path 'ProductName') -cne 'Windows Packet Filter x64' -or
+ (Get-MsiProperty $Path 'Manufacturer') -cne 'NT KERNEL' -or
+ (Get-MsiSummaryTemplate $Path) -cnotmatch '^x64;'
+ ) { throw 'Windows Packet Filter MSI local identity mismatch.' }
+ }
+ 'vc-runtime' {
+ Assert-FileVersion $Path '14.51.36247.0' '14.51.36247.0' 'Microsoft Visual C++ v14 Redistributable (x64) - 14.51.36247'
+ }
+ 'sing-box' {
+ Assert-ZipEntries $Path @('sing-box.exe')
+ Assert-PeBytesMachineX64 (Get-ZipEntryBytes $Path 'sing-box.exe') 'sing-box.exe'
+ }
+ 'winsw' {
+ Assert-ManagedAnyCpu $Path
+ Assert-FileVersion $Path '2.12.0.0' '2.12.0+eef5bade59fca0254e387ac73ed7625ba6aa7147'
+ }
+ default { throw "Unknown local package identity: $ComponentId" }
+ }
+}
+
+function Assert-ZipEntries(
+ [string]$Path,
+ [string[]]$RequiredLeafNames,
+ [Int64]$MaxExpandedBytes = 536870912
+) {
+ Add-Type -AssemblyName System.IO.Compression.FileSystem
+ $archive = [IO.Compression.ZipFile]::OpenRead($Path)
+ try {
+ $leafNames = @()
+ $seenNames = @{}
+ $expandedBytes = 0L
+ if ($archive.Entries.Count -gt 10000) {
+ throw 'Archive contains too many entries.'
+ }
+ foreach ($entry in $archive.Entries) {
+ $name = $entry.FullName.Replace('\', '/')
+ $trimmedName = $name.TrimEnd('/')
+ $segments = @($trimmedName.Split('/'))
+ if (
+ [string]::IsNullOrEmpty($trimmedName) -or
+ $name.StartsWith('/') -or
+ $name.Contains(':') -or
+ @($segments | Where-Object {
+ $_.Length -eq 0 -or $_ -in @('.', '..') -or $_.Length -gt 128 -or
+ $_.EndsWith('.') -or $_.EndsWith(' ') -or (Test-WindowsReservedName $_) -or
+ $_ -notmatch '^[A-Za-z0-9._+ -]+$'
+ }).Count -gt 0
+ ) {
+ throw "Archive contains an unsafe entry: $name"
+ }
+ $normalized = $trimmedName.ToLowerInvariant()
+ if ($seenNames.ContainsKey($normalized)) {
+ throw "Archive contains a duplicate entry: $name"
+ }
+ $seenNames[$normalized] = $true
+ if ($entry.Length -lt 0 -or $expandedBytes -gt ($MaxExpandedBytes - $entry.Length)) {
+ throw 'Archive exceeds the expanded size limit.'
+ }
+ $expandedBytes += $entry.Length
+ if (-not [string]::IsNullOrEmpty($entry.Name)) {
+ $leafNames += $entry.Name
+ }
+ }
+ foreach ($required in $RequiredLeafNames) {
+ if (@($leafNames | Where-Object { $_ -ceq $required }).Count -ne 1) {
+ throw "Archive must contain exactly one $required."
+ }
+ }
+ } finally {
+ $archive.Dispose()
+ }
+}
+
+function Get-UniqueFile([string]$Root, [string]$Name) {
+ $matches = @(Get-ChildItem -LiteralPath $Root -Recurse -File | Where-Object { $_.Name -ceq $Name })
+ if ($matches.Count -ne 1) {
+ throw "Expected exactly one $Name in the archive."
+ }
+ return $matches[0].FullName
+}
+
+function Get-MsiProperty([string]$Path, [string]$Name) {
+ $installer = $null
+ $database = $null
+ $view = $null
+ $record = $null
+ try {
+ $installer = New-Object -ComObject WindowsInstaller.Installer
+ $database = $installer.OpenDatabase($Path, 0)
+ $query = "SELECT ``Value`` FROM ``Property`` WHERE ``Property``='$Name'"
+ $view = $database.OpenView($query)
+ $view.Execute()
+ $record = $view.Fetch()
+ if ($null -eq $record) {
+ throw "MSI property is missing: $Name"
+ }
+ return [string]$record.StringData(1)
+ } finally {
+ foreach ($value in @($record, $view, $database, $installer)) {
+ if ($null -ne $value -and [Runtime.InteropServices.Marshal]::IsComObject($value)) {
+ [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($value)
+ }
+ }
+ }
+}
+
+function Assert-FileVersion(
+ [string]$Path,
+ [string]$FileVersion,
+ [string]$ProductVersion,
+ [string]$ProductName = '',
+ [string]$CompanyName = ''
+) {
+ $info = [Diagnostics.FileVersionInfo]::GetVersionInfo($Path)
+ if ($info.FileVersion.Trim() -cne $FileVersion -or $info.ProductVersion.Trim() -cne $ProductVersion) {
+ throw "Version metadata mismatch for $(Split-Path -Leaf $Path)."
+ }
+ if (-not [string]::IsNullOrEmpty($ProductName) -and $info.ProductName.Trim() -cne $ProductName) {
+ throw "Product name mismatch for $(Split-Path -Leaf $Path)."
+ }
+ if (-not [string]::IsNullOrEmpty($CompanyName) -and $info.CompanyName.Trim() -cne $CompanyName) {
+ throw "Company name mismatch for $(Split-Path -Leaf $Path)."
+ }
+}
+
+function Write-DeterministicJson([object]$Value, [string]$Path) {
+ $json = ($Value | ConvertTo-Json -Depth 20).Replace("`r`n", "`n") + "`n"
+ [IO.File]::WriteAllText($Path, $json, [Text.UTF8Encoding]::new($false))
+}
+
+function Test-DirectoryContentEqual([string]$First, [string]$Second) {
+ if (-not (Test-Path -LiteralPath $First -PathType Container) -or -not (Test-Path -LiteralPath $Second -PathType Container)) {
+ return $false
+ }
+ try {
+ [void](Test-ComponentBundle $First)
+ [void](Test-ComponentBundle $Second)
+ } catch {
+ return $false
+ }
+ $firstFiles = @{}
+ foreach ($file in Get-ChildItem -LiteralPath $First -Recurse -File) {
+ $relative = Get-RelativeBundlePath ([IO.Path]::GetFullPath($First)) $file.FullName
+ $firstFiles[$relative] = "{0}:{1}" -f $file.Length, (Get-FileHash -LiteralPath $file.FullName -Algorithm SHA256).Hash
+ }
+ $secondFiles = @{}
+ foreach ($file in Get-ChildItem -LiteralPath $Second -Recurse -File) {
+ $relative = Get-RelativeBundlePath ([IO.Path]::GetFullPath($Second)) $file.FullName
+ $secondFiles[$relative] = "{0}:{1}" -f $file.Length, (Get-FileHash -LiteralPath $file.FullName -Algorithm SHA256).Hash
+ }
+ if ($firstFiles.Count -ne $secondFiles.Count) {
+ return $false
+ }
+ foreach ($name in $firstFiles.Keys) {
+ if (-not $secondFiles.ContainsKey($name) -or $firstFiles[$name] -ne $secondFiles[$name]) {
+ return $false
+ }
+ }
+ return $true
+}
+
+if ($PlanOnly -and $CheckOnly) {
+ throw '-PlanOnly and -CheckOnly are mutually exclusive.'
+}
+if ($CheckOnly -and $UseFrozenReleaseEvidence) {
+ throw '-UseFrozenReleaseEvidence is not applicable to local-only CheckOnly validation.'
+}
+if (($PlanOnly -or $CheckOnly) -and $SimulateFailure -ne 'None') {
+ throw '-SimulateFailure is only available for the update path.'
+}
+
+$resolvedOutputDir = [IO.Path]::GetFullPath($OutputDir)
+if ($resolvedOutputDir -eq [IO.Path]::GetPathRoot($resolvedOutputDir)) {
+ throw 'OutputDir must not be a filesystem root.'
+}
+$canonicalOutputDir = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..\src-tauri\bundled\components'))
+$tempRoot = [IO.Path]::GetFullPath([IO.Path]::GetTempPath()).TrimEnd('\', '/')
+$outputLeaf = Split-Path -Leaf $resolvedOutputDir
+$isCanonicalOutput = [string]::Equals($resolvedOutputDir, $canonicalOutputDir, [StringComparison]::OrdinalIgnoreCase)
+$isTestOutput = (
+ [string]::Equals((Split-Path -Parent $resolvedOutputDir).TrimEnd('\', '/'), $tempRoot, [StringComparison]::OrdinalIgnoreCase) -and
+ $outputLeaf -match '^proxywarden-component-bundle-test-[0-9a-f]{32}$'
+)
+if (-not $isCanonicalOutput -and -not $isTestOutput) {
+ throw 'OutputDir must be the canonical bundle or an isolated ProxyWarden test directory under the system temp root.'
+}
+if ($SimulateFailure -ne 'None' -and -not $isTestOutput) {
+ throw '-SimulateFailure is allowed only with an isolated test OutputDir.'
+}
+$releaseEvidenceLabel = if ($UseFrozenReleaseEvidence) { 'frozen-audited-2026-08-17' } else { 'live-official-api' }
+
+if ($PlanOnly) {
+ ConvertTo-ResultJson ([ordered]@{
+ mode = 'plan'
+ changed = $false
+ network = $false
+ writes = $false
+ releaseEvidence = $releaseEvidenceLabel
+ schemaVersion = 1
+ targetArch = 'x64'
+ outputDir = $resolvedOutputDir
+ components = @($ExpectedComponents | ForEach-Object { [ordered]@{ id = $_.id; version = $_.version } })
+ })
+ return
+}
+
+if ($CheckOnly) {
+ $catalog = Test-ComponentBundle $resolvedOutputDir
+ ConvertTo-ResultJson ([ordered]@{
+ mode = 'check'
+ changed = $false
+ network = $false
+ writes = $false
+ releaseEvidence = 'local-bundle-only'
+ valid = $true
+ schemaVersion = $catalog.schemaVersion
+ targetArch = $catalog.targetArch
+ outputDir = $resolvedOutputDir
+ componentCount = @($catalog.components).Count
+ })
+ return
+}
+
+$outputParent = Split-Path -Parent $resolvedOutputDir
+Assert-ValidatedParent $outputParent
+if (Test-Path -LiteralPath $resolvedOutputDir) {
+ if (-not (Test-Path -LiteralPath $resolvedOutputDir -PathType Container)) {
+ throw 'OutputDir exists but is not a directory.'
+ }
+ Assert-NoReparseTree $resolvedOutputDir
+}
+
+$operationId = [Guid]::NewGuid().ToString('N')
+$stagingDir = Join-Path $outputParent ".proxywarden-components-staging-$operationId"
+$backupDir = "$resolvedOutputDir.previous"
+$retiredBackupDir = Join-Path $outputParent ".proxywarden-components-previous-$operationId"
+$lockPath = "$resolvedOutputDir.update.lock"
+$lock = $null
+$lockOwned = $false
+$activeWasEmptyPlaceholder = $false
+$backupWasEmptyPlaceholder = $false
+$activeMoved = $false
+$oldBackupMoved = $false
+$stagingMoved = $false
+$promoted = $false
+$preserveRecoveryArtifacts = $false
+$script:InjectDownloadFailure = ($SimulateFailure -eq 'Download')
+
+try {
+ $lock = [IO.File]::Open($lockPath, [IO.FileMode]::CreateNew, [IO.FileAccess]::ReadWrite, [IO.FileShare]::None)
+ $lockOwned = $true
+ if (Test-Path -LiteralPath $resolvedOutputDir) {
+ if (Test-SafeEmptyDirectory $resolvedOutputDir) {
+ $activeWasEmptyPlaceholder = $true
+ } else {
+ [void](Test-ComponentBundle $resolvedOutputDir)
+ }
+ }
+ if (Test-Path -LiteralPath $backupDir) {
+ if (-not (Test-Path -LiteralPath $backupDir -PathType Container)) {
+ throw 'The previous bundle backup is not a directory.'
+ }
+ if (Test-SafeEmptyDirectory $backupDir) {
+ $backupWasEmptyPlaceholder = $true
+ } else {
+ [void](Test-ComponentBundle $backupDir)
+ }
+ }
+ [void](New-Item -ItemType Directory -Path $stagingDir)
+
+ $proxifyreName = 'ProxiFyre-v2.4.0-x64-signed.zip'
+ $proxifyreUrl = "https://github.com/wiresock/proxifyre/releases/download/v2.4.0/$proxifyreName"
+ $proxifyrePath = Join-Path $stagingDir "proxifyre\$proxifyreName"
+ $proxifyreRelease = Get-ReleaseEvidence 'wiresock/proxifyre' 'v2.4.0' ([bool]$UseFrozenReleaseEvidence)
+ $proxifyreAsset = Save-GitHubDigestAsset $proxifyreRelease $proxifyreName $proxifyreUrl $proxifyrePath 'eab65fd7d8eeb716abedb5614618c641de3f9eb8326b99cee1da787141e30cac' 1519694
+
+ $packetFilterName = 'Windows.Packet.Filter.3.6.2.1.x64.msi'
+ $packetFilterUrl = "https://github.com/wiresock/ndisapi/releases/download/v3.6.2/$packetFilterName"
+ $packetFilterPath = Join-Path $stagingDir "windows-packet-filter\$packetFilterName"
+ $packetFilterRelease = Get-ReleaseEvidence 'wiresock/ndisapi' 'v3.6.2' ([bool]$UseFrozenReleaseEvidence)
+ $packetFilterAsset = Save-GitHubDigestAsset $packetFilterRelease $packetFilterName $packetFilterUrl $packetFilterPath '9c388c0b7f189f7fa98720bae2caecf7d64f30910838b80b438ecf8956b8502c' 819200
+
+ $vcName = 'VC_redist.x64.exe'
+ $vcUrl = 'https://aka.ms/vs/18/release/14.51.36247/VC_redist.x64.exe'
+ $vcPath = Join-Path $stagingDir "vc-runtime\$vcName"
+ $vcAsset = Save-PinnedAsset $vcUrl $vcPath '843068991daaa1f73ad9f6239bce4d0f6a07a51f18c37ea2a867e9beca71295c' 18731856
+
+ $singBoxName = 'sing-box-1.13.19-windows-amd64.zip'
+ $singBoxUrl = "https://github.com/SagerNet/sing-box/releases/download/v1.13.19/$singBoxName"
+ $singBoxPath = Join-Path $stagingDir "sing-box\$singBoxName"
+ $singBoxRelease = Get-ReleaseEvidence 'SagerNet/sing-box' 'v1.13.19' ([bool]$UseFrozenReleaseEvidence)
+ $singBoxAsset = Save-GitHubDigestAsset $singBoxRelease $singBoxName $singBoxUrl $singBoxPath 'e011a4def2f5e2b143ed54adb2b1a20a6be407806ab4442f3667f1dd817a2c8d' 21046252
+
+ $winswName = 'WinSW.NET461.exe'
+ $winswUrl = "https://github.com/winsw/winsw/releases/download/v2.12.0/$winswName"
+ $winswPath = Join-Path $stagingDir "winsw\$winswName"
+ $winswRelease = Get-ReleaseEvidence 'winsw/winsw' 'v2.12.0' ([bool]$UseFrozenReleaseEvidence)
+ $winswReleaseAsset = Get-ReleaseAsset $winswRelease $winswName
+ $winswDigestProperty = $winswReleaseAsset.PSObject.Properties['digest']
+ if (
+ $winswReleaseAsset.browser_download_url -cne $winswUrl -or
+ [Int64]$winswReleaseAsset.size -ne 655872 -or
+ ($null -ne $winswDigestProperty -and -not [string]::IsNullOrWhiteSpace([string]$winswDigestProperty.Value))
+ ) {
+ throw 'Official WinSW asset identity changed.'
+ }
+ $winswAsset = Save-PinnedAsset $winswUrl $winswPath 'b5066b7bbdfba1293e5d15cda3caaea88fbeab35bd5b38c41c913d492aadfc4f' 655872
+
+ $licenseSources = Join-Path $stagingDir '.license-sources'
+ [void](New-Item -ItemType Directory -Path $licenseSources)
+ try {
+ Save-LicenseFromPinnedGit 'https://github.com/wiresock/proxifyre.git' 'proxifyre' 'v2.4.0' 'dd1512840e1e3bc596b06b80eda4e2dcd6a9c9ed' 'dd1512840e1e3bc596b06b80eda4e2dcd6a9c9ed' 'LICENSE' (Join-Path $stagingDir 'proxifyre\LICENSE') $licenseSources
+ Save-LicenseFromPinnedGit 'https://github.com/wiresock/ndisapi.git' 'ndisapi' 'v3.6.2' '417b8734e844083a10236387fba705d94a2d6bc9' '417b8734e844083a10236387fba705d94a2d6bc9' 'LICENSE' (Join-Path $stagingDir 'windows-packet-filter\LICENSE') $licenseSources
+ Save-LicenseFromPinnedGit 'https://github.com/SagerNet/sing-box.git' 'sing-box' 'v1.13.19' 'b5ebaa1fc0f2b94256180b95468e73ef53caa27d' 'b5ebaa1fc0f2b94256180b95468e73ef53caa27d' 'LICENSE' (Join-Path $stagingDir 'sing-box\LICENSE') $licenseSources
+ Save-LicenseFromPinnedGit 'https://github.com/winsw/winsw.git' 'winsw' 'v2.12.0' 'eef5bade59fca0254e387ac73ed7625ba6aa7147' 'eef5bade59fca0254e387ac73ed7625ba6aa7147' 'LICENSE.txt' (Join-Path $stagingDir 'winsw\LICENSE.txt') $licenseSources
+ } finally {
+ Remove-SafeGeneratedDirectory $licenseSources $stagingDir '^\.license-sources$'
+ }
+ Save-Download 'https://visualstudio.microsoft.com/wp-content/uploads/2025/10/Visual-C-V14-License-Redistributable_and_Runtime_ENU.docx' (Join-Path $stagingDir 'vc-runtime\LICENSE.docx') 5242880
+
+ Assert-ZipEntries $proxifyrePath @('ProxiFyre.exe', 'socksify.dll')
+ Assert-ZipEntries $singBoxPath @('sing-box.exe')
+ $verificationRoot = Join-Path $stagingDir '.verification'
+ [void](New-Item -ItemType Directory -Path $verificationRoot)
+ try {
+ $proxifyreExtract = Join-Path $verificationRoot 'proxifyre'
+ Expand-Archive -LiteralPath $proxifyrePath -DestinationPath $proxifyreExtract
+ $proxifyreExe = Get-UniqueFile $proxifyreExtract 'ProxiFyre.exe'
+ $socksifyDll = Get-UniqueFile $proxifyreExtract 'socksify.dll'
+ Assert-AuthenticodePublisher $proxifyreExe 'The Anti-Cloud Corporation'
+ Assert-AuthenticodePublisher $socksifyDll 'The Anti-Cloud Corporation'
+ Assert-PeMachineX64 $proxifyreExe
+ Assert-PeMachineX64 $socksifyDll
+ Assert-FileVersion $proxifyreExe '2.4.0' '2.4.0' 'ProxiFyre' 'NT KERNEL'
+
+ $singBoxExtract = Join-Path $verificationRoot 'sing-box'
+ Expand-Archive -LiteralPath $singBoxPath -DestinationPath $singBoxExtract
+ Assert-PeMachineX64 (Get-UniqueFile $singBoxExtract 'sing-box.exe')
+ } finally {
+ try {
+ Remove-SafeGeneratedDirectory $verificationRoot $stagingDir '^\.verification$'
+ } catch {
+ throw "Could not safely remove the package verification directory: $($_.Exception.Message)"
+ }
+ }
+
+ Assert-AuthenticodePublisher $packetFilterPath 'The Anti-Cloud Corporation'
+ if (
+ (Get-MsiProperty $packetFilterPath 'ProductVersion') -cne '3.6.2.1' -or
+ (Get-MsiProperty $packetFilterPath 'ProductName') -cne 'Windows Packet Filter x64' -or
+ (Get-MsiProperty $packetFilterPath 'Manufacturer') -cne 'NT KERNEL'
+ ) {
+ throw 'Windows Packet Filter MSI product identity mismatch.'
+ }
+ Assert-AuthenticodePublisher $vcPath 'Microsoft Corporation'
+ Assert-FileVersion $vcPath '14.51.36247.0' '14.51.36247.0' 'Microsoft Visual C++ v14 Redistributable (x64) - 14.51.36247'
+ Assert-Unsigned $winswPath
+ Assert-ManagedAnyCpu $winswPath
+ Assert-FileVersion $winswPath '2.12.0.0' '2.12.0+eef5bade59fca0254e387ac73ed7625ba6aa7147'
+
+ Assert-LocalLicenseIdentity 'proxifyre' (Join-Path $stagingDir 'proxifyre\LICENSE')
+ Assert-LocalLicenseIdentity 'windows-packet-filter' (Join-Path $stagingDir 'windows-packet-filter\LICENSE')
+ Assert-LocalLicenseIdentity 'vc-runtime' (Join-Path $stagingDir 'vc-runtime\LICENSE.docx')
+ Assert-LocalLicenseIdentity 'sing-box' (Join-Path $stagingDir 'sing-box\LICENSE')
+ Assert-LocalLicenseIdentity 'winsw' (Join-Path $stagingDir 'winsw\LICENSE.txt')
+
+ $catalog = [ordered]@{
+ schemaVersion = 1
+ targetArch = 'x64'
+ components = @(
+ [ordered]@{
+ id = 'proxifyre'; version = '2.4.0'; fileVersion = '2.4.0'; productVersion = '2.4.0'
+ assetPath = "proxifyre/$proxifyreName"; assetArch = 'x64'; effectiveTarget = 'x64'
+ sha256 = $proxifyreAsset.hash; size = $proxifyreAsset.size; sourceUrl = $proxifyreUrl
+ license = [ordered]@{ id = 'AGPL-3.0-only'; path = 'proxifyre/LICENSE' }
+ installRole = 'proxifyre-runtime'
+ updateTrustPolicy = [ordered]@{
+ type = 'githubReleaseDigest'; repository = 'wiresock/proxifyre'; tagPattern = 'v*'
+ assetPattern = 'ProxiFyre-v*-x64-signed.zip'; requireStable = $true
+ authenticodePublishers = @('The Anti-Cloud Corporation')
+ }
+ }
+ [ordered]@{
+ id = 'windows-packet-filter'; version = '3.6.2'; fileVersion = '3.6.2.1'; productVersion = '3.6.2.1'
+ assetPath = "windows-packet-filter/$packetFilterName"; assetArch = 'x64'; effectiveTarget = 'x64'
+ sha256 = $packetFilterAsset.hash; size = $packetFilterAsset.size; sourceUrl = $packetFilterUrl
+ license = [ordered]@{ id = 'MIT'; path = 'windows-packet-filter/LICENSE' }
+ installRole = 'packet-filter-driver'
+ updateTrustPolicy = [ordered]@{
+ type = 'githubReleaseDigest'; repository = 'wiresock/ndisapi'; tagPattern = 'v*'
+ assetPattern = 'Windows.Packet.Filter.*.x64.msi'; requireStable = $true
+ authenticodePublishers = @('The Anti-Cloud Corporation')
+ }
+ }
+ [ordered]@{
+ id = 'vc-runtime'; version = '14.51.36247.0'; fileVersion = '14.51.36247.0'; productVersion = '14.51.36247.0'
+ assetPath = "vc-runtime/$vcName"; assetArch = 'x64'; effectiveTarget = 'x64'
+ sha256 = $vcAsset.hash; size = $vcAsset.size; sourceUrl = $vcUrl
+ license = [ordered]@{ id = 'LicenseRef-Microsoft-Visual-Cpp-v14-Redistributable-2026'; path = 'vc-runtime/LICENSE.docx' }
+ installRole = 'vc-runtime-prerequisite'
+ updateTrustPolicy = [ordered]@{
+ type = 'buildTimeOnlyAuthenticode'; allowedSourceHosts = @('aka.ms')
+ assetPattern = 'VC_redist.x64.exe'; publishers = @('Microsoft Corporation')
+ }
+ }
+ [ordered]@{
+ id = 'sing-box'; version = '1.13.19'
+ assetPath = "sing-box/$singBoxName"; assetArch = 'x64'; effectiveTarget = 'x64'
+ sha256 = $singBoxAsset.hash; size = $singBoxAsset.size; sourceUrl = $singBoxUrl
+ license = [ordered]@{ id = 'LicenseRef-Sing-Box-Project'; path = 'sing-box/LICENSE' }
+ installRole = 'sing-box-runtime'
+ updateTrustPolicy = [ordered]@{
+ type = 'githubReleaseDigest'; repository = 'SagerNet/sing-box'; tagPattern = 'v*'
+ assetPattern = 'sing-box-*-windows-amd64.zip'; requireStable = $true
+ }
+ }
+ [ordered]@{
+ id = 'winsw'; version = '2.12.0'; fileVersion = '2.12.0.0'
+ productVersion = '2.12.0+eef5bade59fca0254e387ac73ed7625ba6aa7147'
+ assetPath = "winsw/$winswName"; assetArch = 'anycpu'; effectiveTarget = 'x64'
+ sha256 = $winswAsset.hash; size = $winswAsset.size; sourceUrl = $winswUrl
+ license = [ordered]@{ id = 'MIT'; path = 'winsw/LICENSE.txt' }
+ installRole = 'sing-box-service-wrapper'
+ updateTrustPolicy = [ordered]@{
+ type = 'bundledOnlyNoIndependentProof'
+ reason = 'The official v2.12.0 asset is unsigned and has no independent release digest; runtime network update is disabled.'
+ }
+ }
+ )
+ }
+ Write-DeterministicJson $catalog (Join-Path $stagingDir 'catalog.json')
+
+ if ($SimulateFailure -eq 'Validation') {
+ $corrupt = [IO.File]::Open($proxifyrePath, [IO.FileMode]::Open, [IO.FileAccess]::ReadWrite, [IO.FileShare]::None)
+ try {
+ $firstByte = $corrupt.ReadByte()
+ $corrupt.Position = 0
+ $corrupt.WriteByte([byte]($firstByte -bxor 0xff))
+ } finally {
+ $corrupt.Dispose()
+ }
+ }
+ [void](Test-ComponentBundle $stagingDir)
+
+ if ($SimulateFailure -ne 'Promotion' -and (Test-DirectoryContentEqual $resolvedOutputDir $stagingDir)) {
+ if ($backupWasEmptyPlaceholder -and (Test-Path -LiteralPath $backupDir)) {
+ Remove-SafeEmptyDirectory $backupDir $backupDir
+ $backupWasEmptyPlaceholder = $false
+ }
+ ConvertTo-ResultJson ([ordered]@{
+ mode = 'update'; changed = $false; schemaVersion = 1; targetArch = 'x64'
+ outputDir = $resolvedOutputDir; componentCount = 5; backupDir = $null
+ releaseEvidence = $releaseEvidenceLabel
+ })
+ return
+ }
+
+ if (Test-Path -LiteralPath $backupDir) {
+ if (-not (Test-Path -LiteralPath $backupDir -PathType Container)) {
+ throw 'The previous bundle backup is not a directory.'
+ }
+ if ($backupWasEmptyPlaceholder) {
+ if (-not (Test-SafeEmptyDirectory $backupDir)) {
+ throw 'The empty previous bundle placeholder changed during the update.'
+ }
+ } else {
+ [void](Test-ComponentBundle $backupDir)
+ }
+ [IO.Directory]::Move($backupDir, $retiredBackupDir)
+ $oldBackupMoved = $true
+ }
+ if (Test-Path -LiteralPath $resolvedOutputDir) {
+ if ($activeWasEmptyPlaceholder) {
+ if (-not (Test-SafeEmptyDirectory $resolvedOutputDir)) {
+ throw 'The empty active bundle placeholder changed during the update.'
+ }
+ } else {
+ [void](Test-ComponentBundle $resolvedOutputDir)
+ }
+ [IO.Directory]::Move($resolvedOutputDir, $backupDir)
+ $activeMoved = $true
+ }
+ [IO.Directory]::Move($stagingDir, $resolvedOutputDir)
+ $stagingMoved = $true
+ if ($SimulateFailure -eq 'Promotion') {
+ throw 'Simulated bundle promotion failure after activating the candidate.'
+ }
+ [void](Test-ComponentBundle $resolvedOutputDir)
+ if ($activeMoved -and $activeWasEmptyPlaceholder) {
+ Remove-SafeEmptyDirectory $backupDir $backupDir
+ $activeMoved = $false
+ $activeWasEmptyPlaceholder = $false
+ }
+ $promoted = $true
+ if ($oldBackupMoved -and (Test-Path -LiteralPath $retiredBackupDir)) {
+ try {
+ Remove-SafeGeneratedDirectory $retiredBackupDir $outputParent '^\.proxywarden-components-previous-[0-9a-f]{32}$'
+ } catch {
+ # The new active bundle and its immediate backup are already valid. Preserve an older
+ # recovery directory if safe cleanup cannot be proven.
+ }
+ if (-not (Test-Path -LiteralPath $retiredBackupDir)) {
+ $oldBackupMoved = $false
+ }
+ }
+
+ ConvertTo-ResultJson ([ordered]@{
+ mode = 'update'; changed = $true; schemaVersion = 1; targetArch = 'x64'
+ outputDir = $resolvedOutputDir; componentCount = 5
+ backupDir = $(if ($activeMoved) { $backupDir } else { $null })
+ releaseEvidence = $releaseEvidenceLabel
+ })
+} catch {
+ $updateError = $_
+ try {
+ if (-not $promoted) {
+ if ($stagingMoved) {
+ if (-not (Test-Path -LiteralPath $resolvedOutputDir) -or (Test-Path -LiteralPath $stagingDir)) {
+ throw 'Cannot preserve the failed candidate before rollback.'
+ }
+ [IO.Directory]::Move($resolvedOutputDir, $stagingDir)
+ $stagingMoved = $false
+ }
+ if ($activeMoved) {
+ if ((Test-Path -LiteralPath $resolvedOutputDir) -or -not (Test-Path -LiteralPath $backupDir)) {
+ throw 'Cannot restore the previous active bundle.'
+ }
+ [IO.Directory]::Move($backupDir, $resolvedOutputDir)
+ $activeMoved = $false
+ }
+ if ($oldBackupMoved) {
+ if ((Test-Path -LiteralPath $backupDir) -or -not (Test-Path -LiteralPath $retiredBackupDir)) {
+ throw 'Cannot restore the older recovery bundle.'
+ }
+ [IO.Directory]::Move($retiredBackupDir, $backupDir)
+ $oldBackupMoved = $false
+ }
+ }
+ } catch {
+ $preserveRecoveryArtifacts = $true
+ throw [InvalidOperationException]::new(
+ "Component bundle update failed and rollback could not be completed. Recovery artifacts were preserved. $($_.Exception.Message)",
+ $_.Exception
+ )
+ }
+ throw $updateError
+} finally {
+ if ($lockOwned) {
+ if ($null -ne $lock) {
+ $lock.Dispose()
+ }
+ if (-not $preserveRecoveryArtifacts -and (Test-Path -LiteralPath $lockPath)) {
+ $lockItem = Get-Item -LiteralPath $lockPath -Force -ErrorAction SilentlyContinue
+ if ($null -ne $lockItem -and ($lockItem.Attributes -band [IO.FileAttributes]::ReparsePoint) -eq 0) {
+ Remove-Item -LiteralPath $lockPath -Force -ErrorAction SilentlyContinue
+ }
+ }
+ $lockOwned = $false
+ }
+ if (-not $preserveRecoveryArtifacts -and (Test-Path -LiteralPath $stagingDir)) {
+ try {
+ Remove-SafeGeneratedDirectory $stagingDir $outputParent '^\.proxywarden-components-staging-[0-9a-f]{32}$'
+ } catch {
+ # Refuse unsafe recursive cleanup and leave the generated directory for inspection.
+ }
+ }
+}
diff --git a/scripts/update-proxifyre-bundle.ps1 b/scripts/update-proxifyre-bundle.ps1
deleted file mode 100644
index c050d71..0000000
--- a/scripts/update-proxifyre-bundle.ps1
+++ /dev/null
@@ -1,143 +0,0 @@
-param(
- [string]$OutputDir = (Join-Path $PSScriptRoot '..\src-tauri\bundled\proxifyre'),
- [ValidateSet('x64', 'x86', 'ARM64')]
- [string[]]$Architectures = @('x64'),
- [switch]$SkipVcRuntime
-)
-
-$ErrorActionPreference = 'Stop'
-Set-StrictMode -Version Latest
-$ProgressPreference = 'SilentlyContinue'
-
-function Invoke-JsonApi([string]$Uri) {
- Invoke-RestMethod -Uri $Uri -Headers @{
- 'User-Agent' = 'proxywarden-bundle-updater'
- 'Accept' = 'application/vnd.github+json'
- } -TimeoutSec 60 -MaximumRedirection 10
-}
-
-function Invoke-FileDownload([string]$Uri, [string]$Path) {
- $partialPath = "$Path.part"
- Remove-Item -LiteralPath $partialPath -Force -ErrorAction SilentlyContinue
-
- try {
- Invoke-WebRequest -UseBasicParsing -Uri $Uri -OutFile $partialPath -Headers @{
- 'User-Agent' = 'proxywarden-bundle-updater'
- 'Accept' = 'application/octet-stream,*/*'
- } -TimeoutSec 240 -MaximumRedirection 10
- } catch {
- Remove-Item -LiteralPath $partialPath -Force -ErrorAction SilentlyContinue
- throw
- }
-
- $item = Get-Item -LiteralPath $partialPath
- if ($item.Length -le 0) {
- Remove-Item -LiteralPath $partialPath -Force -ErrorAction SilentlyContinue
- throw "Downloaded file is empty: $Uri"
- }
-
- Move-Item -LiteralPath $partialPath -Destination $Path -Force
-}
-
-function Select-ReleaseAsset($Release, [string]$Pattern, [string]$Label) {
- $asset = $Release.assets | Where-Object { $_.name -match $Pattern } | Select-Object -First 1
- if ($null -eq $asset) {
- throw "No asset found for $Label using pattern $Pattern"
- }
-
- $asset
-}
-
-function Save-Asset([string]$Id, [string]$Name, [string]$Url, [string]$ExpectedDigest = '') {
- $path = Join-Path $OutputDir $Name
- if (Test-Path -LiteralPath $path) {
- $existing = Get-Item -LiteralPath $path
- if ($existing.Length -gt 0) {
- $existingHash = (Get-FileHash -LiteralPath $path -Algorithm SHA256).Hash.ToLowerInvariant()
- $expectedHash = ''
- if (-not [string]::IsNullOrWhiteSpace($ExpectedDigest) -and $ExpectedDigest -match '^sha256:(.+)$') {
- $expectedHash = $Matches[1].ToLowerInvariant()
- }
-
- if ([string]::IsNullOrWhiteSpace($expectedHash) -or $existingHash -eq $expectedHash) {
- Write-Host "Using existing $Name"
- return [PSCustomObject]@{
- id = $Id
- name = $Name
- sha256 = $existingHash
- size = $existing.Length
- sourceUrl = $Url
- }
- }
- }
- }
-
- Write-Host "Downloading $Name"
- Invoke-FileDownload $Url $path
-
- $hash = (Get-FileHash -LiteralPath $path -Algorithm SHA256).Hash.ToLowerInvariant()
- if (-not [string]::IsNullOrWhiteSpace($ExpectedDigest) -and $ExpectedDigest -match '^sha256:(.+)$') {
- $expected = $Matches[1].ToLowerInvariant()
- if ($hash -ne $expected) {
- throw "SHA256 mismatch for $Name. Expected $expected, got $hash."
- }
- }
-
- [PSCustomObject]@{
- id = $Id
- name = $Name
- sha256 = $hash
- size = (Get-Item -LiteralPath $path).Length
- sourceUrl = $Url
- }
-}
-
-$resolvedOutputDir = [System.IO.Path]::GetFullPath($OutputDir)
-New-Item -ItemType Directory -Force -Path $resolvedOutputDir | Out-Null
-$OutputDir = $resolvedOutputDir
-
-$selectedArchitectures = $Architectures |
- ForEach-Object {
- if ($_ -eq 'ARM64') { 'ARM64' } elseif ($_ -eq 'x86') { 'x86' } else { 'x64' }
- } |
- Select-Object -Unique
-
-$proxifyreRelease = Invoke-JsonApi 'https://api.github.com/repos/wiresock/proxifyre/releases/latest'
-$ndisapiRelease = Invoke-JsonApi 'https://api.github.com/repos/wiresock/ndisapi/releases/latest'
-
-$files = New-Object System.Collections.Generic.List[object]
-
-foreach ($arch in $selectedArchitectures) {
- $proxifyreAsset = Select-ReleaseAsset $proxifyreRelease "ProxiFyre-.*-$arch-signed\.zip$" "ProxiFyre $arch"
- $files.Add((Save-Asset "proxifyre-$($arch.ToLowerInvariant())" $proxifyreAsset.name $proxifyreAsset.browser_download_url $proxifyreAsset.digest))
-
- $ndisAsset = Select-ReleaseAsset $ndisapiRelease "Windows\.Packet\.Filter\..*\.$arch\.msi$" "Windows Packet Filter $arch"
- $files.Add((Save-Asset "packet-filter-$($arch.ToLowerInvariant())" $ndisAsset.name $ndisAsset.browser_download_url $ndisAsset.digest))
-}
-
-if (-not $SkipVcRuntime) {
- if ($selectedArchitectures | Where-Object { $_ -ne 'x86' }) {
- $files.Add((Save-Asset 'vc-runtime-x64' 'vc_redist.x64.exe' 'https://aka.ms/vc14/vc_redist.x64.exe'))
- }
- if ($selectedArchitectures -contains 'x86') {
- $files.Add((Save-Asset 'vc-runtime-x86' 'vc_redist.x86.exe' 'https://aka.ms/vc14/vc_redist.x86.exe'))
- }
-}
-
-$manifest = [PSCustomObject]@{
- generatedAt = (Get-Date).ToUniversalTime().ToString('o')
- architectures = @($selectedArchitectures)
- proxifyreRelease = $proxifyreRelease.tag_name
- windowsPacketFilterRelease = $ndisapiRelease.tag_name
- files = $files
-}
-
-$manifestPath = Join-Path $OutputDir 'manifest.json'
-$manifest | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath $manifestPath -Encoding UTF8
-
-$keepNames = @($files | ForEach-Object { $_.name }) + 'manifest.json'
-Get-ChildItem -LiteralPath $OutputDir -File |
- Where-Object { $keepNames -notcontains $_.Name } |
- ForEach-Object { Remove-Item -LiteralPath $_.FullName -Force }
-
-Write-Host "Bundle updated: $OutputDir"
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index 9f65409..9b79576 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -47,6 +47,15 @@ version = "1.0.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3"
+[[package]]
+name = "arbitrary"
+version = "1.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1"
+dependencies = [
+ "derive_arbitrary",
+]
+
[[package]]
name = "atk"
version = "0.18.2"
@@ -543,6 +552,17 @@ dependencies = [
"serde_core",
]
+[[package]]
+name = "derive_arbitrary"
+version = "1.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.118",
+]
+
[[package]]
name = "derive_more"
version = "2.1.1"
@@ -783,6 +803,7 @@ checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c"
dependencies = [
"crc32fast",
"miniz_oxide",
+ "zlib-rs",
]
[[package]]
@@ -2314,20 +2335,24 @@ dependencies = [
[[package]]
name = "proxywarden"
-version = "1.1.0"
+version = "2.0.0"
dependencies = [
"base64 0.22.1",
"percent-encoding",
+ "quick-xml",
"reqwest 0.12.28",
"serde",
"serde_json",
+ "sha2",
"tauri",
"tauri-build",
"tauri-plugin-dialog",
"thiserror 2.0.18",
"url",
"uuid",
+ "windows-sys 0.61.2",
"winreg",
+ "zip",
]
[[package]]
@@ -4847,6 +4872,25 @@ dependencies = [
"syn 2.0.118",
]
+[[package]]
+name = "zip"
+version = "4.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "caa8cd6af31c3b31c6631b8f483848b91589021b28fffe50adada48d4f4d2ed1"
+dependencies = [
+ "arbitrary",
+ "crc32fast",
+ "flate2",
+ "indexmap 2.14.0",
+ "memchr",
+]
+
+[[package]]
+name = "zlib-rs"
+version = "0.6.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34b31d188d9d685a4f9c7b46d6e36631b07058d2cfe190267adce54dc230bf12"
+
[[package]]
name = "zmij"
version = "1.0.21"
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index 91872d5..d3b9c32 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "proxywarden"
-version = "1.1.0"
+version = "2.0.0"
description = "Standalone Windows desktop proxy management app for ProxyWarden."
authors = ["ProxyWarden"]
edition = "2021"
@@ -23,6 +23,26 @@ percent-encoding = "2"
url = "2"
uuid = { version = "1", features = ["v4"] }
thiserror = "2"
+sha2 = "0.10"
+quick-xml = "0.39"
+zip = { version = "4", default-features = false, features = ["deflate-flate2-zlib-rs"] }
[target.'cfg(windows)'.dependencies]
winreg = "0.55"
+windows-sys = { version = "0.61.2", features = [
+ "Win32_Foundation",
+ "Win32_Security",
+ "Win32_Security_Authorization",
+ "Win32_Security_Cryptography",
+ "Win32_Security_Cryptography_Catalog",
+ "Win32_Security_Cryptography_Sip",
+ "Win32_Security_WinTrust",
+ "Win32_Storage_FileSystem",
+ "Win32_System_Diagnostics_ToolHelp",
+ "Win32_System_Registry",
+ "Win32_System_Services",
+ "Win32_System_SystemInformation",
+ "Win32_System_Threading",
+ "Win32_UI_Shell",
+ "Win32_UI_WindowsAndMessaging",
+] }
diff --git a/src-tauri/bundled/cleanup/uninstall-managed-components.ps1 b/src-tauri/bundled/cleanup/uninstall-managed-components.ps1
deleted file mode 100644
index d277c01..0000000
--- a/src-tauri/bundled/cleanup/uninstall-managed-components.ps1
+++ /dev/null
@@ -1,250 +0,0 @@
-param(
- [string]$InstallRoot = "",
- [switch]$ForceRemoveWindowsPacketFilter
-)
-
-Set-StrictMode -Version Latest
-$ErrorActionPreference = "Stop"
-
-function New-Result {
- param(
- [bool]$Success,
- [string]$Message,
- [hashtable]$Details = @{}
- )
-
- [ordered]@{
- success = $Success
- message = $Message
- details = $Details
- } | ConvertTo-Json -Depth 8 -Compress
-}
-
-function Get-FullPath([string]$Path) {
- return [System.IO.Path]::GetFullPath($Path).TrimEnd("\")
-}
-
-function Test-PathInside([string]$Path, [string]$Root) {
- if ([string]::IsNullOrWhiteSpace($Path)) { return $false }
- try {
- $fullPath = Get-FullPath $Path
- $fullRoot = Get-FullPath $Root
- return $fullPath.StartsWith($fullRoot + "\", [StringComparison]::OrdinalIgnoreCase)
- } catch {
- return $false
- }
-}
-
-function Assert-SafeInstallRoot([string]$Root) {
- if ([string]::IsNullOrWhiteSpace($Root)) {
- throw "InstallRoot is empty."
- }
-
- $full = Get-FullPath $Root
- if ($full -match "^[A-Za-z]:\\?$") {
- throw "Refusing to use drive root as InstallRoot: $full"
- }
- if ($full -match "\\Windows($|\\)" -or $full -match "\\ProgramData$" -or $full -match "\\Users$") {
- throw "Refusing unsafe InstallRoot: $full"
- }
-
- $knownAppFiles = @(
- (Join-Path $full "proxywarden.exe"),
- (Join-Path $full "uninstall.exe"),
- (Join-Path $full "bundled\cleanup\uninstall-managed-components.ps1")
- )
- foreach ($candidate in $knownAppFiles) {
- if (Test-Path -LiteralPath $candidate) { return $full }
- }
-
- throw "InstallRoot does not look like a ProxyWarden install directory: $full"
-}
-
-function Resolve-SafeComponentDir([string]$Root, [string]$Leaf) {
- $componentRoot = Join-Path $Root "components"
- $path = Join-Path $componentRoot $Leaf
- $full = Get-FullPath $path
- $expectedParent = Get-FullPath $componentRoot
- $actualLeaf = Split-Path -Leaf $full
-
- if ($actualLeaf -ne $Leaf) {
- throw "Unexpected component directory leaf: $full"
- }
- if (-not $full.StartsWith($expectedParent + "\", [StringComparison]::OrdinalIgnoreCase)) {
- throw "Component directory is outside ProxyWarden components root: $full"
- }
-
- return $full
-}
-
-function Read-ComponentMarker([string]$Dir) {
- $markerPath = Join-Path $Dir "proxywarden-component.json"
- if (-not (Test-Path -LiteralPath $markerPath)) { return $null }
- try {
- return Get-Content -LiteralPath $markerPath -Raw -Encoding UTF8 | ConvertFrom-Json
- } catch {
- return $null
- }
-}
-
-function Get-MarkerBool($Marker, [string]$Name) {
- if ($null -eq $Marker) { return $false }
- $property = $Marker.PSObject.Properties[$Name]
- if ($null -eq $property) { return $false }
- return [bool]$property.Value
-}
-
-function Get-ServiceRecord([string]$Name) {
- $escaped = $Name.Replace("'", "''")
- return Get-CimInstance Win32_Service -Filter "Name='$escaped'" -ErrorAction SilentlyContinue
-}
-
-function Get-ServiceImagePath($Record) {
- if ($null -eq $Record -or [string]::IsNullOrWhiteSpace([string]$Record.PathName)) {
- return $null
- }
-
- $pathName = ([string]$Record.PathName).Trim()
- if ($pathName -match '^"([^"]+)"') { return $Matches[1] }
- if ($pathName -match '^(.+?\.exe)\b') { return $Matches[1].Trim() }
- return $pathName
-}
-
-function Stop-ServiceRecord($Record) {
- if ($null -eq $Record) { return }
-
- $service = Get-Service -Name $Record.Name -ErrorAction SilentlyContinue
- if ($null -ne $service -and $service.Status -ne "Stopped") {
- Stop-Service -Name $service.Name -Force -ErrorAction SilentlyContinue
- $service = Get-Service -Name $Record.Name -ErrorAction SilentlyContinue
- if ($null -ne $service) {
- try { $service.WaitForStatus("Stopped", [TimeSpan]::FromSeconds(12)) } catch {}
- }
- }
-
- $recordAfterStop = Get-ServiceRecord $Record.Name
- if ($null -ne $recordAfterStop -and [int]$recordAfterStop.ProcessId -gt 0) {
- taskkill.exe /PID ([int]$recordAfterStop.ProcessId) /F | Out-Null
- Start-Sleep -Milliseconds 500
- }
-}
-
-function Remove-ManagedService {
- param(
- [string[]]$Names,
- [string]$InstallRoot,
- [string]$UninstallExe = ""
- )
-
- $removed = @()
- foreach ($name in $Names) {
- $record = Get-ServiceRecord $name
- if ($null -eq $record) { continue }
-
- $imagePath = Get-ServiceImagePath $record
- if (-not [string]::IsNullOrWhiteSpace($imagePath) -and -not (Test-PathInside $imagePath $InstallRoot)) {
- continue
- }
-
- Stop-ServiceRecord $record
-
- if (-not [string]::IsNullOrWhiteSpace($UninstallExe) -and (Test-Path -LiteralPath $UninstallExe)) {
- Push-Location (Split-Path -Parent $UninstallExe)
- try { & $UninstallExe uninstall | Out-Null } finally { Pop-Location }
- }
-
- $record = Get-ServiceRecord $name
- if ($null -ne $record) {
- sc.exe delete $name | Out-Null
- }
- $removed += $name
- }
-
- return $removed
-}
-
-function Remove-SafeDirectory([string]$Path, [string]$Root) {
- if (-not (Test-Path -LiteralPath $Path)) { return $false }
- if (-not (Test-PathInside $Path $Root)) {
- throw "Refusing to remove directory outside InstallRoot: $Path"
- }
- Remove-Item -LiteralPath $Path -Recurse -Force
- return $true
-}
-
-function Remove-ManagedFirewallRules {
- $removed = @()
- foreach ($name in @("ProxyWarden.ProxiFyre.Inbound", "ProxyWarden.ProxiFyre.Outbound")) {
- $rule = Get-NetFirewallRule -Name $name -ErrorAction SilentlyContinue
- if ($null -eq $rule) { continue }
- $rule | Remove-NetFirewallRule -ErrorAction Stop
- $removed += $name
- }
- return $removed
-}
-
-function Get-InstalledProgram([string]$Pattern) {
- $paths = @(
- "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*",
- "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
- )
- return Get-ItemProperty -Path $paths -ErrorAction SilentlyContinue |
- Where-Object { $_.DisplayName -match $Pattern } |
- Select-Object -First 1 DisplayName, DisplayVersion, PSChildName, UninstallString, QuietUninstallString
-}
-
-function Resolve-MsiProductCode($Program, [string]$Label) {
- if ($null -eq $Program) { return $null }
- if ($Program.PSChildName -match "^\{[0-9A-Fa-f-]{36}\}$") {
- return $Program.PSChildName
- }
- foreach ($candidate in @($Program.QuietUninstallString, $Program.UninstallString)) {
- if ($candidate -match "\{[0-9A-Fa-f-]{36}\}") {
- return $Matches[0]
- }
- }
- throw "Could not resolve MSI product code for $Label."
-}
-
-function Uninstall-MsiProgram($Program, [string]$Label) {
- $productCode = Resolve-MsiProductCode $Program $Label
- if ([string]::IsNullOrWhiteSpace($productCode)) { return $false }
-
- $logPath = Join-Path ([System.IO.Path]::GetTempPath()) "proxywarden-$Label-uninstall.log"
- $process = Start-Process -FilePath "msiexec.exe" -ArgumentList @("/x", $productCode, "/qn", "/norestart", "/L*v", $logPath) -Wait -PassThru -WindowStyle Hidden
- if ($process.ExitCode -ne 0 -and $process.ExitCode -ne 3010 -and $process.ExitCode -ne 1605) {
- throw "$Label uninstall exited with code $($process.ExitCode). MSI log: $logPath"
- }
-
- return $true
-}
-
-try {
- $details = @{}
- $root = Assert-SafeInstallRoot $InstallRoot
- $details.installRoot = $root
-
- $proxifyreDir = Resolve-SafeComponentDir $root "ProxiFyre"
- $singboxDir = Resolve-SafeComponentDir $root "sing-box"
- $proxifyreMarker = Read-ComponentMarker $proxifyreDir
- $removePacketFilter = [bool]$ForceRemoveWindowsPacketFilter -or (Get-MarkerBool $proxifyreMarker "packetFilterInstalledByProxyWarden")
-
- $details.removedProxiFyreServices = Remove-ManagedService -Names @("ProxiFyreService", "ProxiFyre") -InstallRoot $root -UninstallExe (Join-Path $proxifyreDir "ProxiFyre.exe")
- $details.removedSingBoxServices = Remove-ManagedService -Names @("ProxyWardenSingBox") -InstallRoot $root -UninstallExe (Join-Path $singboxDir "ProxyWardenSingBox.exe")
- $details.removedProxiFyreFirewallRules = Remove-ManagedFirewallRules
- $details.removedProxiFyreDir = Remove-SafeDirectory $proxifyreDir $root
- $details.removedSingBoxDir = Remove-SafeDirectory $singboxDir $root
-
- if ($removePacketFilter) {
- $packetFilter = Get-InstalledProgram "Windows Packet Filter|WinpkFilter|NDISAPI"
- $details.removedWindowsPacketFilter = Uninstall-MsiProgram $packetFilter "windows-packet-filter"
- } else {
- $details.removedWindowsPacketFilter = $false
- }
-
- New-Result -Success $true -Message "ProxyWarden managed components cleanup completed." -Details $details
- exit 0
-} catch {
- New-Result -Success $false -Message $_.Exception.Message -Details @{}
- exit 1
-}
diff --git a/src-tauri/bundled/components/catalog.json b/src-tauri/bundled/components/catalog.json
new file mode 100644
index 0000000..82c160f
--- /dev/null
+++ b/src-tauri/bundled/components/catalog.json
@@ -0,0 +1,130 @@
+{
+ "schemaVersion": 1,
+ "targetArch": "x64",
+ "components": [
+ {
+ "id": "proxifyre",
+ "version": "2.4.0",
+ "fileVersion": "2.4.0",
+ "productVersion": "2.4.0",
+ "assetPath": "proxifyre/ProxiFyre-v2.4.0-x64-signed.zip",
+ "assetArch": "x64",
+ "effectiveTarget": "x64",
+ "sha256": "eab65fd7d8eeb716abedb5614618c641de3f9eb8326b99cee1da787141e30cac",
+ "size": 1519694,
+ "sourceUrl": "https://github.com/wiresock/proxifyre/releases/download/v2.4.0/ProxiFyre-v2.4.0-x64-signed.zip",
+ "license": {
+ "id": "AGPL-3.0-only",
+ "path": "proxifyre/LICENSE"
+ },
+ "installRole": "proxifyre-runtime",
+ "updateTrustPolicy": {
+ "type": "githubReleaseDigest",
+ "repository": "wiresock/proxifyre",
+ "tagPattern": "v*",
+ "assetPattern": "ProxiFyre-v*-x64-signed.zip",
+ "requireStable": true,
+ "authenticodePublishers": [
+ "The Anti-Cloud Corporation"
+ ]
+ }
+ },
+ {
+ "id": "windows-packet-filter",
+ "version": "3.6.2",
+ "fileVersion": "3.6.2.1",
+ "productVersion": "3.6.2.1",
+ "assetPath": "windows-packet-filter/Windows.Packet.Filter.3.6.2.1.x64.msi",
+ "assetArch": "x64",
+ "effectiveTarget": "x64",
+ "sha256": "9c388c0b7f189f7fa98720bae2caecf7d64f30910838b80b438ecf8956b8502c",
+ "size": 819200,
+ "sourceUrl": "https://github.com/wiresock/ndisapi/releases/download/v3.6.2/Windows.Packet.Filter.3.6.2.1.x64.msi",
+ "license": {
+ "id": "MIT",
+ "path": "windows-packet-filter/LICENSE"
+ },
+ "installRole": "packet-filter-driver",
+ "updateTrustPolicy": {
+ "type": "githubReleaseDigest",
+ "repository": "wiresock/ndisapi",
+ "tagPattern": "v*",
+ "assetPattern": "Windows.Packet.Filter.*.x64.msi",
+ "requireStable": true,
+ "authenticodePublishers": [
+ "The Anti-Cloud Corporation"
+ ]
+ }
+ },
+ {
+ "id": "vc-runtime",
+ "version": "14.51.36247.0",
+ "fileVersion": "14.51.36247.0",
+ "productVersion": "14.51.36247.0",
+ "assetPath": "vc-runtime/VC_redist.x64.exe",
+ "assetArch": "x64",
+ "effectiveTarget": "x64",
+ "sha256": "843068991daaa1f73ad9f6239bce4d0f6a07a51f18c37ea2a867e9beca71295c",
+ "size": 18731856,
+ "sourceUrl": "https://aka.ms/vs/18/release/14.51.36247/VC_redist.x64.exe",
+ "license": {
+ "id": "LicenseRef-Microsoft-Visual-Cpp-v14-Redistributable-2026",
+ "path": "vc-runtime/LICENSE.docx"
+ },
+ "installRole": "vc-runtime-prerequisite",
+ "updateTrustPolicy": {
+ "type": "buildTimeOnlyAuthenticode",
+ "allowedSourceHosts": [
+ "aka.ms"
+ ],
+ "assetPattern": "VC_redist.x64.exe",
+ "publishers": [
+ "Microsoft Corporation"
+ ]
+ }
+ },
+ {
+ "id": "sing-box",
+ "version": "1.13.19",
+ "assetPath": "sing-box/sing-box-1.13.19-windows-amd64.zip",
+ "assetArch": "x64",
+ "effectiveTarget": "x64",
+ "sha256": "e011a4def2f5e2b143ed54adb2b1a20a6be407806ab4442f3667f1dd817a2c8d",
+ "size": 21046252,
+ "sourceUrl": "https://github.com/SagerNet/sing-box/releases/download/v1.13.19/sing-box-1.13.19-windows-amd64.zip",
+ "license": {
+ "id": "LicenseRef-Sing-Box-Project",
+ "path": "sing-box/LICENSE"
+ },
+ "installRole": "sing-box-runtime",
+ "updateTrustPolicy": {
+ "type": "githubReleaseDigest",
+ "repository": "SagerNet/sing-box",
+ "tagPattern": "v*",
+ "assetPattern": "sing-box-*-windows-amd64.zip",
+ "requireStable": true
+ }
+ },
+ {
+ "id": "winsw",
+ "version": "2.12.0",
+ "fileVersion": "2.12.0.0",
+ "productVersion": "2.12.0+eef5bade59fca0254e387ac73ed7625ba6aa7147",
+ "assetPath": "winsw/WinSW.NET461.exe",
+ "assetArch": "anycpu",
+ "effectiveTarget": "x64",
+ "sha256": "b5066b7bbdfba1293e5d15cda3caaea88fbeab35bd5b38c41c913d492aadfc4f",
+ "size": 655872,
+ "sourceUrl": "https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW.NET461.exe",
+ "license": {
+ "id": "MIT",
+ "path": "winsw/LICENSE.txt"
+ },
+ "installRole": "sing-box-service-wrapper",
+ "updateTrustPolicy": {
+ "type": "bundledOnlyNoIndependentProof",
+ "reason": "The official v2.12.0 asset is unsigned and has no independent release digest; runtime network update is disabled."
+ }
+ }
+ ]
+}
diff --git a/src-tauri/bundled/components/proxifyre/LICENSE b/src-tauri/bundled/components/proxifyre/LICENSE
new file mode 100644
index 0000000..0ad25db
--- /dev/null
+++ b/src-tauri/bundled/components/proxifyre/LICENSE
@@ -0,0 +1,661 @@
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU Affero General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+.
diff --git a/src-tauri/bundled/proxifyre/ProxiFyre-v2.2.1-x64-signed.zip b/src-tauri/bundled/components/proxifyre/ProxiFyre-v2.4.0-x64-signed.zip
similarity index 62%
rename from src-tauri/bundled/proxifyre/ProxiFyre-v2.2.1-x64-signed.zip
rename to src-tauri/bundled/components/proxifyre/ProxiFyre-v2.4.0-x64-signed.zip
index 5abd3f4..3ff732a 100644
Binary files a/src-tauri/bundled/proxifyre/ProxiFyre-v2.2.1-x64-signed.zip and b/src-tauri/bundled/components/proxifyre/ProxiFyre-v2.4.0-x64-signed.zip differ
diff --git a/src-tauri/bundled/components/sing-box/LICENSE b/src-tauri/bundled/components/sing-box/LICENSE
new file mode 100644
index 0000000..175f350
--- /dev/null
+++ b/src-tauri/bundled/components/sing-box/LICENSE
@@ -0,0 +1,17 @@
+Copyright (C) 2022 by nekohasekai
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see .
+
+In addition, no derivative work may use the name or imply association
+with this application without prior consent.
diff --git a/src-tauri/bundled/components/sing-box/sing-box-1.13.19-windows-amd64.zip b/src-tauri/bundled/components/sing-box/sing-box-1.13.19-windows-amd64.zip
new file mode 100644
index 0000000..d0c9e0b
Binary files /dev/null and b/src-tauri/bundled/components/sing-box/sing-box-1.13.19-windows-amd64.zip differ
diff --git a/src-tauri/bundled/components/vc-runtime/LICENSE.docx b/src-tauri/bundled/components/vc-runtime/LICENSE.docx
new file mode 100644
index 0000000..c1d6c04
Binary files /dev/null and b/src-tauri/bundled/components/vc-runtime/LICENSE.docx differ
diff --git a/src-tauri/bundled/proxifyre/vc_redist.x64.exe b/src-tauri/bundled/components/vc-runtime/VC_redist.x64.exe
similarity index 100%
rename from src-tauri/bundled/proxifyre/vc_redist.x64.exe
rename to src-tauri/bundled/components/vc-runtime/VC_redist.x64.exe
diff --git a/src-tauri/bundled/components/windows-packet-filter/LICENSE b/src-tauri/bundled/components/windows-packet-filter/LICENSE
new file mode 100644
index 0000000..27c98ef
--- /dev/null
+++ b/src-tauri/bundled/components/windows-packet-filter/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Vadim Smirnov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/src-tauri/bundled/proxifyre/Windows.Packet.Filter.3.6.2.1.x64.msi b/src-tauri/bundled/components/windows-packet-filter/Windows.Packet.Filter.3.6.2.1.x64.msi
similarity index 100%
rename from src-tauri/bundled/proxifyre/Windows.Packet.Filter.3.6.2.1.x64.msi
rename to src-tauri/bundled/components/windows-packet-filter/Windows.Packet.Filter.3.6.2.1.x64.msi
diff --git a/src-tauri/bundled/components/winsw/LICENSE.txt b/src-tauri/bundled/components/winsw/LICENSE.txt
new file mode 100644
index 0000000..59ea54d
--- /dev/null
+++ b/src-tauri/bundled/components/winsw/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2008-2020 Kohsuke Kawaguchi, Sun Microsystems, Inc., CloudBees, Inc., Oleg Nenashev and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/src-tauri/bundled/components/winsw/WinSW.NET461.exe b/src-tauri/bundled/components/winsw/WinSW.NET461.exe
new file mode 100644
index 0000000..ece8691
Binary files /dev/null and b/src-tauri/bundled/components/winsw/WinSW.NET461.exe differ
diff --git a/src-tauri/bundled/installer-hooks/installer-template.nsi b/src-tauri/bundled/installer-hooks/installer-template.nsi
new file mode 100644
index 0000000..2f63f86
--- /dev/null
+++ b/src-tauri/bundled/installer-hooks/installer-template.nsi
@@ -0,0 +1,809 @@
+; Upstream: tauri-cli-v2.11.4 / tauri-bundler 2.9.4
+; Original SHA256: 20f4ecc730defb71f1342eaeaec4021df13be3d843abba0effe88ea5835fa079
+; ProxyWarden: upgrade in place; never run a previous uninstaller.
+Unicode true
+ManifestDPIAware true
+; Add in `dpiAwareness` `PerMonitorV2` to manifest for Windows 10 1607+ (note this should not affect lower versions since they should be able to ignore this and pick up `dpiAware` `true` set by `ManifestDPIAware true`)
+; Currently undocumented on NSIS's website but is in the Docs folder of source tree, see
+; https://github.com/kichik/nsis/blob/5fc0b87b819a9eec006df4967d08e522ddd651c9/Docs/src/attributes.but#L286-L300
+; https://github.com/tauri-apps/tauri/pull/10106
+ManifestDPIAwareness PerMonitorV2
+
+!if "{{compression}}" == "none"
+ SetCompress off
+!else
+ ; Set the compression algorithm. We default to LZMA.
+ SetCompressor /SOLID "{{compression}}"
+!endif
+
+; Keep above !include to stay ahead of any plugin command
+; see https://github.com/tauri-apps/tauri/pull/15422#discussion_r3289239624
+{{#if signed_plugins_path}}
+!addplugindir "{{signed_plugins_path}}"
+{{/if}}
+
+!include MUI2.nsh
+!include FileFunc.nsh
+!include x64.nsh
+!include WordFunc.nsh
+!include "utils.nsh"
+!include "FileAssociation.nsh"
+!include "Win\COM.nsh"
+!include "Win\Propkey.nsh"
+!include "StrFunc.nsh"
+${StrCase}
+${StrLoc}
+
+{{#if installer_hooks}}
+!include "{{installer_hooks}}"
+{{/if}}
+
+!define WEBVIEW2APPGUID "{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}"
+
+!define MANUFACTURER "{{manufacturer}}"
+!define PRODUCTNAME "{{product_name}}"
+!define VERSION "{{version}}"
+!define VERSIONWITHBUILD "{{version_with_build}}"
+!define HOMEPAGE "{{homepage}}"
+!define INSTALLMODE "{{install_mode}}"
+!define LICENSE "{{license}}"
+!define INSTALLERICON "{{installer_icon}}"
+!define SIDEBARIMAGE "{{sidebar_image}}"
+!define HEADERIMAGE "{{header_image}}"
+!define UNINSTALLERICON "{{uninstaller_icon}}"
+!define UNINSTALLERHEADERIMAGE "{{uninstaller_header_image}}"
+!define MAINBINARYNAME "{{main_binary_name}}"
+!define MAINBINARYSRCPATH "{{main_binary_path}}"
+!define BUNDLEID "{{bundle_id}}"
+!define COPYRIGHT "{{copyright}}"
+!define OUTFILE "{{out_file}}"
+!define ARCH "{{arch}}"
+!define ADDITIONALPLUGINSPATH "{{additional_plugins_path}}"
+!define ALLOWDOWNGRADES "{{allow_downgrades}}"
+!define DISPLAYLANGUAGESELECTOR "{{display_language_selector}}"
+!define INSTALLWEBVIEW2MODE "{{install_webview2_mode}}"
+!define WEBVIEW2INSTALLERARGS "{{webview2_installer_args}}"
+!define WEBVIEW2BOOTSTRAPPERPATH "{{webview2_bootstrapper_path}}"
+!define WEBVIEW2INSTALLERPATH "{{webview2_installer_path}}"
+!define MINIMUMWEBVIEW2VERSION "{{minimum_webview2_version}}"
+!define UNINSTKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}"
+!define MANUKEY "Software\${MANUFACTURER}"
+!define MANUPRODUCTKEY "${MANUKEY}\${PRODUCTNAME}"
+!define UNINSTALLERSIGNCOMMAND "{{uninstaller_sign_cmd}}"
+!define ESTIMATEDSIZE "{{estimated_size}}"
+!define STARTMENUFOLDER "{{start_menu_folder}}"
+
+Var PassiveMode
+Var UpdateMode
+Var NoShortcutMode
+Var WixMode
+Var OldMainBinaryName
+
+Name "${PRODUCTNAME}"
+BrandingText "${COPYRIGHT}"
+OutFile "${OUTFILE}"
+
+; We don't actually use this value as default install path,
+; it's just for nsis to append the product name folder in the directory selector
+; https://nsis.sourceforge.io/Reference/InstallDir
+!define PLACEHOLDER_INSTALL_DIR "placeholder\${PRODUCTNAME}"
+InstallDir "${PLACEHOLDER_INSTALL_DIR}"
+
+VIProductVersion "${VERSIONWITHBUILD}"
+VIAddVersionKey "ProductName" "${PRODUCTNAME}"
+VIAddVersionKey "FileDescription" "${PRODUCTNAME}"
+VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
+VIAddVersionKey "FileVersion" "${VERSION}"
+VIAddVersionKey "ProductVersion" "${VERSION}"
+
+# additional plugins
+!addplugindir "${ADDITIONALPLUGINSPATH}"
+
+; Uninstaller signing command
+!if "${UNINSTALLERSIGNCOMMAND}" != ""
+ !uninstfinalize '${UNINSTALLERSIGNCOMMAND}'
+!endif
+
+; Handle install mode, `perUser`, `perMachine` or `both`
+!if "${INSTALLMODE}" == "perMachine"
+ RequestExecutionLevel admin
+!endif
+
+!if "${INSTALLMODE}" == "currentUser"
+ RequestExecutionLevel user
+!endif
+
+!if "${INSTALLMODE}" == "both"
+ !define MULTIUSER_MUI
+ !define MULTIUSER_INSTALLMODE_INSTDIR "${PRODUCTNAME}"
+ !define MULTIUSER_INSTALLMODE_COMMANDLINE
+ !if "${ARCH}" == "x64"
+ !define MULTIUSER_USE_PROGRAMFILES64
+ !else if "${ARCH}" == "arm64"
+ !define MULTIUSER_USE_PROGRAMFILES64
+ !endif
+ !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "${UNINSTKEY}"
+ !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME "CurrentUser"
+ !define MULTIUSER_INSTALLMODEPAGE_SHOWUSERNAME
+ !define MULTIUSER_INSTALLMODE_FUNCTION RestorePreviousInstallLocation
+ !define MULTIUSER_EXECUTIONLEVEL Highest
+ !include MultiUser.nsh
+!endif
+
+; Installer icon
+!if "${INSTALLERICON}" != ""
+ !define MUI_ICON "${INSTALLERICON}"
+!endif
+
+; Installer sidebar image
+!if "${SIDEBARIMAGE}" != ""
+ !define MUI_WELCOMEFINISHPAGE_BITMAP "${SIDEBARIMAGE}"
+!endif
+
+; Enable header images for installer and uninstaller pages when either image is configured.
+!if "${HEADERIMAGE}" != ""
+ !define MUI_HEADERIMAGE
+!else if "${UNINSTALLERHEADERIMAGE}" != ""
+ !define MUI_HEADERIMAGE
+!endif
+
+; Installer header image
+!if "${HEADERIMAGE}" != ""
+ !define MUI_HEADERIMAGE_BITMAP "${HEADERIMAGE}"
+!endif
+
+; Uninstaller header image
+!if "${UNINSTALLERHEADERIMAGE}" != ""
+ !define MUI_HEADERIMAGE_UNBITMAP "${UNINSTALLERHEADERIMAGE}"
+!endif
+
+; Uninstaller icon
+!if "${UNINSTALLERICON}" != ""
+ !define MUI_UNICON "${UNINSTALLERICON}"
+!endif
+
+; Define registry key to store installer language
+!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
+!define MUI_LANGDLL_REGISTRY_KEY "${MANUPRODUCTKEY}"
+!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
+
+; Installer pages, must be ordered as they appear
+; 1. Welcome Page
+!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
+!insertmacro MUI_PAGE_WELCOME
+
+; 2. License Page (if defined)
+!if "${LICENSE}" != ""
+ !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
+ !insertmacro MUI_PAGE_LICENSE "${LICENSE}"
+!endif
+
+; 3. Install mode (if it is set to `both`)
+!if "${INSTALLMODE}" == "both"
+ !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
+ !insertmacro MULTIUSER_PAGE_INSTALLMODE
+!endif
+
+; 4. Custom page to ask user if he wants to reinstall/uninstall
+; only if a previous installation was detected
+; Reinstall page removed: previous uninstallers may delete managed data.
+
+
+; 5. Choose install directory page
+!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
+!insertmacro MUI_PAGE_DIRECTORY
+
+; 6. Start menu shortcut page
+Var AppStartMenuFolder
+!if "${STARTMENUFOLDER}" != ""
+ !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
+ !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${STARTMENUFOLDER}"
+!else
+ !define MUI_PAGE_CUSTOMFUNCTION_PRE Skip
+!endif
+!insertmacro MUI_PAGE_STARTMENU Application $AppStartMenuFolder
+
+; 7. Installation page
+!insertmacro MUI_PAGE_INSTFILES
+
+; 8. Finish page
+;
+; Don't auto jump to finish page after installation page,
+; because the installation page has useful info that can be used debug any issues with the installer.
+!define MUI_FINISHPAGE_NOAUTOCLOSE
+; Use show readme button in the finish page as a button create a desktop shortcut
+!define MUI_FINISHPAGE_SHOWREADME
+!define MUI_FINISHPAGE_SHOWREADME_TEXT "$(createDesktop)"
+!define MUI_FINISHPAGE_SHOWREADME_FUNCTION CreateOrUpdateDesktopShortcut
+; Show run app after installation.
+!define MUI_FINISHPAGE_RUN
+!define MUI_FINISHPAGE_RUN_FUNCTION RunMainBinary
+!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
+!insertmacro MUI_PAGE_FINISH
+
+Function RunMainBinary
+ nsis_tauri_utils::RunAsUser "$INSTDIR\${MAINBINARYNAME}.exe" ""
+FunctionEnd
+
+; Uninstaller Pages
+; 1. Confirm uninstall page
+Var DeleteAppDataCheckbox
+Var DeleteAppDataCheckboxState
+!define /ifndef WS_EX_LAYOUTRTL 0x00400000
+!define MUI_PAGE_CUSTOMFUNCTION_SHOW un.ConfirmShow
+Function un.ConfirmShow ; Add add a `Delete app data` check box
+ ; $1 inner dialog HWND
+ ; $2 window DPI
+ ; $3 style
+ ; $4 x
+ ; $5 y
+ ; $6 width
+ ; $7 height
+ FindWindow $1 "#32770" "" $HWNDPARENT ; Find inner dialog
+ System::Call "user32::GetDpiForWindow(p r1) i .r2"
+ ${If} $(^RTL) = 1
+ StrCpy $3 "${__NSD_CheckBox_EXSTYLE} | ${WS_EX_LAYOUTRTL}"
+ IntOp $4 50 * $2
+ ${Else}
+ StrCpy $3 "${__NSD_CheckBox_EXSTYLE}"
+ IntOp $4 0 * $2
+ ${EndIf}
+ IntOp $5 100 * $2
+ IntOp $6 400 * $2
+ IntOp $7 25 * $2
+ IntOp $4 $4 / 96
+ IntOp $5 $5 / 96
+ IntOp $6 $6 / 96
+ IntOp $7 $7 / 96
+ System::Call 'user32::CreateWindowEx(i r3, w "${__NSD_CheckBox_CLASS}", w "$(deleteAppData)", i ${__NSD_CheckBox_STYLE}, i r4, i r5, i r6, i r7, p r1, i0, i0, i0) i .s'
+ Pop $DeleteAppDataCheckbox
+ SendMessage $HWNDPARENT ${WM_GETFONT} 0 0 $1
+ SendMessage $DeleteAppDataCheckbox ${WM_SETFONT} $1 1
+FunctionEnd
+!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.ConfirmLeave
+Function un.ConfirmLeave
+ SendMessage $DeleteAppDataCheckbox ${BM_GETCHECK} 0 0 $DeleteAppDataCheckboxState
+FunctionEnd
+!define MUI_PAGE_CUSTOMFUNCTION_PRE un.SkipIfPassive
+!insertmacro MUI_UNPAGE_CONFIRM
+
+; 2. Uninstalling Page
+!insertmacro MUI_UNPAGE_INSTFILES
+
+;Languages
+{{#each languages}}
+!insertmacro MUI_LANGUAGE "{{this}}"
+{{/each}}
+!insertmacro MUI_RESERVEFILE_LANGDLL
+{{#each language_files}}
+ !include "{{this}}"
+{{/each}}
+
+
+; Read-only checks run from .onInit for interactive, passive, silent and /UPDATE.
+!macro PWRejectMsi ROOT VIEW
+ SetRegView ${VIEW}
+ StrCpy $0 0
+ ${Do}
+ EnumRegKey $1 ${ROOT} "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" $0
+ ${If} $1 == ""
+ ${Break}
+ ${EndIf}
+ IntOp $0 $0 + 1
+ ReadRegStr $2 ${ROOT} "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$1" "DisplayName"
+ ${If} $2 == "${PRODUCTNAME}"
+ ReadRegDWORD $3 ${ROOT} "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$1" "WindowsInstaller"
+ ${If} $3 == 1
+ IfSilent +2
+ MessageBox MB_ICONSTOP "Обнаружена MSI-установка ProxyWarden. Автоматическое удаление старой версии заблокировано для сохранности компонентов и настроек. Требуется отдельный проверенный перенос MSI → NSIS."
+ SetErrorLevel 1603
+ Quit
+ ${EndIf}
+ ${EndIf}
+ ${Loop}
+!macroend
+
+Function .onInit
+ ${GetOptions} $CMDLINE "/P" $PassiveMode
+ ${IfNot} ${Errors}
+ StrCpy $PassiveMode 1
+ ${EndIf}
+
+ ${GetOptions} $CMDLINE "/NS" $NoShortcutMode
+ ${IfNot} ${Errors}
+ StrCpy $NoShortcutMode 1
+ ${EndIf}
+
+ ${GetOptions} $CMDLINE "/UPDATE" $UpdateMode
+ ${IfNot} ${Errors}
+ StrCpy $UpdateMode 1
+ ${EndIf}
+
+ !if "${DISPLAYLANGUAGESELECTOR}" == "true"
+ !insertmacro MUI_LANGDLL_DISPLAY
+ !endif
+
+
+ !insertmacro PWRejectMsi HKLM 32
+ !insertmacro PWRejectMsi HKCU 32
+ ${If} ${RunningX64}
+ !insertmacro PWRejectMsi HKLM 64
+ !insertmacro PWRejectMsi HKCU 64
+ ${EndIf}
+ !insertmacro SetContext
+ StrCpy $WixMode 0
+ ReadRegStr $R0 SHCTX "${UNINSTKEY}" "DisplayVersion"
+ ${If} $R0 != ""
+ nsis_tauri_utils::SemverCompare "${VERSION}" $R0
+ Pop $R0
+ ${If} $R0 = -1
+ IfSilent +2
+ MessageBox MB_ICONSTOP "Установлена более новая версия ProxyWarden. Понижение версии заблокировано."
+ SetErrorLevel 1603
+ Quit
+ ${EndIf}
+ ${EndIf}
+ !insertmacro SetContext
+
+ ${If} $INSTDIR == "${PLACEHOLDER_INSTALL_DIR}"
+ ; Set default install location
+ !if "${INSTALLMODE}" == "perMachine"
+ ${If} ${RunningX64}
+ !if "${ARCH}" == "x64"
+ StrCpy $INSTDIR "$PROGRAMFILES64\${PRODUCTNAME}"
+ !else if "${ARCH}" == "arm64"
+ StrCpy $INSTDIR "$PROGRAMFILES64\${PRODUCTNAME}"
+ !else
+ StrCpy $INSTDIR "$PROGRAMFILES\${PRODUCTNAME}"
+ !endif
+ ${Else}
+ StrCpy $INSTDIR "$PROGRAMFILES\${PRODUCTNAME}"
+ ${EndIf}
+ !else if "${INSTALLMODE}" == "currentUser"
+ StrCpy $INSTDIR "$LOCALAPPDATA\${PRODUCTNAME}"
+ !endif
+
+ Call RestorePreviousInstallLocation
+ ${EndIf}
+
+
+ !if "${INSTALLMODE}" == "both"
+ !insertmacro MULTIUSER_INIT
+ !endif
+FunctionEnd
+
+
+
+
+Section WebView2
+ ; Check if Webview2 is already installed and skip this section
+ ${If} ${RunningX64}
+ ReadRegStr $4 HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\${WEBVIEW2APPGUID}" "pv"
+ ${Else}
+ ReadRegStr $4 HKLM "SOFTWARE\Microsoft\EdgeUpdate\Clients\${WEBVIEW2APPGUID}" "pv"
+ ${EndIf}
+ ${If} $4 == ""
+ ReadRegStr $4 HKCU "SOFTWARE\Microsoft\EdgeUpdate\Clients\${WEBVIEW2APPGUID}" "pv"
+ ${EndIf}
+
+ ${If} $4 == ""
+ ; Webview2 installation
+ ;
+ ; Skip if updating
+ ${If} $UpdateMode <> 1
+ !if "${INSTALLWEBVIEW2MODE}" == "downloadBootstrapper"
+ Delete "$TEMP\MicrosoftEdgeWebview2Setup.exe"
+ DetailPrint "$(webview2Downloading)"
+ NSISdl::download "https://go.microsoft.com/fwlink/p/?LinkId=2124703" "$TEMP\MicrosoftEdgeWebview2Setup.exe"
+ Pop $0
+ ${If} $0 == "success"
+ DetailPrint "$(webview2DownloadSuccess)"
+ ${Else}
+ DetailPrint "$(webview2DownloadError)"
+ Abort "$(webview2AbortError)"
+ ${EndIf}
+ StrCpy $6 "$TEMP\MicrosoftEdgeWebview2Setup.exe"
+ Goto install_webview2
+ !endif
+
+ !if "${INSTALLWEBVIEW2MODE}" == "embedBootstrapper"
+ Delete "$TEMP\MicrosoftEdgeWebview2Setup.exe"
+ File "/oname=$TEMP\MicrosoftEdgeWebview2Setup.exe" "${WEBVIEW2BOOTSTRAPPERPATH}"
+ DetailPrint "$(installingWebview2)"
+ StrCpy $6 "$TEMP\MicrosoftEdgeWebview2Setup.exe"
+ Goto install_webview2
+ !endif
+
+ !if "${INSTALLWEBVIEW2MODE}" == "offlineInstaller"
+ Delete "$TEMP\MicrosoftEdgeWebView2RuntimeInstaller.exe"
+ File "/oname=$TEMP\MicrosoftEdgeWebView2RuntimeInstaller.exe" "${WEBVIEW2INSTALLERPATH}"
+ DetailPrint "$(installingWebview2)"
+ StrCpy $6 "$TEMP\MicrosoftEdgeWebView2RuntimeInstaller.exe"
+ Goto install_webview2
+ !endif
+
+ Goto webview2_done
+
+ install_webview2:
+ DetailPrint "$(installingWebview2)"
+ ; $6 holds the path to the webview2 installer
+ ExecWait "$6 ${WEBVIEW2INSTALLERARGS} /install" $1
+ ${If} $1 = 0
+ DetailPrint "$(webview2InstallSuccess)"
+ ${Else}
+ DetailPrint "$(webview2InstallError)"
+ Abort "$(webview2AbortError)"
+ ${EndIf}
+ webview2_done:
+ ${EndIf}
+ ${Else}
+ !if "${MINIMUMWEBVIEW2VERSION}" != ""
+ ${VersionCompare} "${MINIMUMWEBVIEW2VERSION}" "$4" $R0
+ ${If} $R0 = 1
+ update_webview:
+ DetailPrint "$(installingWebview2)"
+ ${If} ${RunningX64}
+ ReadRegStr $R1 HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate" "path"
+ ${Else}
+ ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\EdgeUpdate" "path"
+ ${EndIf}
+ ${If} $R1 == ""
+ ReadRegStr $R1 HKCU "SOFTWARE\Microsoft\EdgeUpdate" "path"
+ ${EndIf}
+ ${If} $R1 != ""
+ ; Chromium updater docs: https://source.chromium.org/chromium/chromium/src/+/main:docs/updater/user_manual.md
+ ; Modified from "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView\ModifyPath"
+ ExecWait `"$R1" /install appguid=${WEBVIEW2APPGUID}&needsadmin=true` $1
+ ${If} $1 = 0
+ DetailPrint "$(webview2InstallSuccess)"
+ ${Else}
+ MessageBox MB_ICONEXCLAMATION|MB_ABORTRETRYIGNORE "$(webview2InstallError)" IDIGNORE ignore IDRETRY update_webview
+ Quit
+ ignore:
+ ${EndIf}
+ ${EndIf}
+ ${EndIf}
+ !endif
+ ${EndIf}
+SectionEnd
+
+Section Install
+ SetOutPath $INSTDIR
+
+ !ifmacrodef NSIS_HOOK_PREINSTALL
+ !insertmacro NSIS_HOOK_PREINSTALL
+ !endif
+
+ !insertmacro CheckIfAppIsRunning "${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
+
+ ; Copy main executable
+ File "${MAINBINARYSRCPATH}"
+
+ ; Copy resources
+ {{#each resources_dirs}}
+ CreateDirectory "$INSTDIR\\{{this}}"
+ {{/each}}
+ {{#each resources}}
+ File /a "/oname={{this.[1]}}" "{{no-escape @key}}"
+ {{/each}}
+
+ ; Copy external binaries
+ {{#each binaries}}
+ File /a "/oname={{this}}" "{{no-escape @key}}"
+ {{/each}}
+
+ ; Create file associations
+ {{#each file_associations as |association| ~}}
+ {{#each association.ext as |ext| ~}}
+ !insertmacro APP_ASSOCIATE "{{ext}}" "{{or association.name ext}}" "{{association-description association.description ext}}" "$INSTDIR\${MAINBINARYNAME}.exe,0" "Open with ${PRODUCTNAME}" "$INSTDIR\${MAINBINARYNAME}.exe $\"%1$\""
+ {{/each}}
+ {{/each}}
+
+ ; Register deep links
+ {{#each deep_link_protocols as |protocol| ~}}
+ WriteRegStr SHCTX "Software\Classes\\{{protocol}}" "URL Protocol" ""
+ WriteRegStr SHCTX "Software\Classes\\{{protocol}}" "" "URL:${BUNDLEID} protocol"
+ WriteRegStr SHCTX "Software\Classes\\{{protocol}}\DefaultIcon" "" "$\"$INSTDIR\${MAINBINARYNAME}.exe$\",0"
+ WriteRegStr SHCTX "Software\Classes\\{{protocol}}\shell\open\command" "" "$\"$INSTDIR\${MAINBINARYNAME}.exe$\" $\"%1$\""
+ {{/each}}
+
+ ; Create uninstaller
+ WriteUninstaller "$INSTDIR\uninstall.exe"
+
+ ; Save $INSTDIR in registry for future installations
+ WriteRegStr SHCTX "${MANUPRODUCTKEY}" "" $INSTDIR
+
+ !if "${INSTALLMODE}" == "both"
+ ; Save install mode to be selected by default for the next installation such as updating
+ ; or when uninstalling
+ WriteRegStr SHCTX "${UNINSTKEY}" $MultiUser.InstallMode 1
+ !endif
+
+ ; Remove old main binary if it doesn't match new main binary name
+ ReadRegStr $OldMainBinaryName SHCTX "${UNINSTKEY}" "MainBinaryName"
+ ${If} $OldMainBinaryName != ""
+ ${AndIf} $OldMainBinaryName != "${MAINBINARYNAME}.exe"
+ Delete "$INSTDIR\$OldMainBinaryName"
+ ${EndIf}
+
+ ; Save current MAINBINARYNAME for future updates
+ WriteRegStr SHCTX "${UNINSTKEY}" "MainBinaryName" "${MAINBINARYNAME}.exe"
+
+ ; Registry information for add/remove programs
+ WriteRegStr SHCTX "${UNINSTKEY}" "DisplayName" "${PRODUCTNAME}"
+ WriteRegStr SHCTX "${UNINSTKEY}" "DisplayIcon" "$\"$INSTDIR\${MAINBINARYNAME}.exe$\""
+ WriteRegStr SHCTX "${UNINSTKEY}" "DisplayVersion" "${VERSION}"
+ WriteRegStr SHCTX "${UNINSTKEY}" "Publisher" "${MANUFACTURER}"
+ WriteRegStr SHCTX "${UNINSTKEY}" "InstallLocation" "$\"$INSTDIR$\""
+ WriteRegStr SHCTX "${UNINSTKEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
+ WriteRegDWORD SHCTX "${UNINSTKEY}" "NoModify" "1"
+ WriteRegDWORD SHCTX "${UNINSTKEY}" "NoRepair" "1"
+
+ ${GetSize} "$INSTDIR" "/M=uninstall.exe /S=0K /G=0" $0 $1 $2
+ IntOp $0 $0 + ${ESTIMATEDSIZE}
+ IntFmt $0 "0x%08X" $0
+ WriteRegDWORD SHCTX "${UNINSTKEY}" "EstimatedSize" "$0"
+
+ !if "${HOMEPAGE}" != ""
+ WriteRegStr SHCTX "${UNINSTKEY}" "URLInfoAbout" "${HOMEPAGE}"
+ WriteRegStr SHCTX "${UNINSTKEY}" "URLUpdateInfo" "${HOMEPAGE}"
+ WriteRegStr SHCTX "${UNINSTKEY}" "HelpLink" "${HOMEPAGE}"
+ !endif
+
+ ; Create start menu shortcut
+ !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+ Call CreateOrUpdateStartMenuShortcut
+ !insertmacro MUI_STARTMENU_WRITE_END
+
+ ; Create desktop shortcut for silent and passive installers
+ ; because finish page will be skipped
+ ${If} $PassiveMode = 1
+ ${OrIf} ${Silent}
+ Call CreateOrUpdateDesktopShortcut
+ ${EndIf}
+
+ !ifmacrodef NSIS_HOOK_POSTINSTALL
+ !insertmacro NSIS_HOOK_POSTINSTALL
+ !endif
+
+ ; Auto close this page for passive mode
+ ${If} $PassiveMode = 1
+ SetAutoClose true
+ ${EndIf}
+SectionEnd
+
+Function .onInstSuccess
+ ; Check for `/R` flag only in silent and passive installers because
+ ; GUI installer has a toggle for the user to (re)start the app
+ ${If} $PassiveMode = 1
+ ${OrIf} ${Silent}
+ ${GetOptions} $CMDLINE "/R" $R0
+ ${IfNot} ${Errors}
+ ${GetOptions} $CMDLINE "/ARGS" $R0
+ nsis_tauri_utils::RunAsUser "$INSTDIR\${MAINBINARYNAME}.exe" "$R0"
+ ${EndIf}
+ ${EndIf}
+FunctionEnd
+
+Function un.onInit
+ !insertmacro SetContext
+
+ !if "${INSTALLMODE}" == "both"
+ !insertmacro MULTIUSER_UNINIT
+ !endif
+
+ !insertmacro MUI_UNGETLANGUAGE
+
+ ${GetOptions} $CMDLINE "/P" $PassiveMode
+ ${IfNot} ${Errors}
+ StrCpy $PassiveMode 1
+ ${EndIf}
+
+ ${GetOptions} $CMDLINE "/UPDATE" $UpdateMode
+ ${IfNot} ${Errors}
+ StrCpy $UpdateMode 1
+ ${EndIf}
+FunctionEnd
+
+Section Uninstall
+
+ !ifmacrodef NSIS_HOOK_PREUNINSTALL
+ !insertmacro NSIS_HOOK_PREUNINSTALL
+ !endif
+
+ !insertmacro CheckIfAppIsRunning "${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
+
+ ; Delete the app directory and its content from disk
+ ; Copy main executable
+ Delete "$INSTDIR\${MAINBINARYNAME}.exe"
+
+ ; Delete resources
+ {{#each resources}}
+ Delete "$INSTDIR\\{{this.[1]}}"
+ {{/each}}
+
+ ; Delete external binaries
+ {{#each binaries}}
+ Delete "$INSTDIR\\{{this}}"
+ {{/each}}
+
+ ; Delete app associations
+ {{#each file_associations as |association| ~}}
+ {{#each association.ext as |ext| ~}}
+ !insertmacro APP_UNASSOCIATE "{{ext}}" "{{or association.name ext}}"
+ {{/each}}
+ {{/each}}
+
+ ; Delete deep links
+ {{#each deep_link_protocols as |protocol| ~}}
+ ReadRegStr $R7 SHCTX "Software\Classes\\{{protocol}}\shell\open\command" ""
+ ${If} $R7 == "$\"$INSTDIR\${MAINBINARYNAME}.exe$\" $\"%1$\""
+ DeleteRegKey SHCTX "Software\Classes\\{{protocol}}"
+ ${EndIf}
+ {{/each}}
+
+
+ ; Delete uninstaller
+ Delete "$INSTDIR\uninstall.exe"
+
+ {{#each resources_ancestors}}
+ RMDir /REBOOTOK "$INSTDIR\\{{this}}"
+ {{/each}}
+ RMDir "$INSTDIR"
+
+ ; Remove shortcuts if not updating
+ ${If} $UpdateMode <> 1
+ !insertmacro DeleteAppUserModelId
+
+ ; Remove start menu shortcut
+ !insertmacro MUI_STARTMENU_GETFOLDER Application $AppStartMenuFolder
+ !insertmacro IsShortcutTarget "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
+ Pop $0
+ ${If} $0 = 1
+ !insertmacro UnpinShortcut "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
+ Delete "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
+ RMDir "$SMPROGRAMS\$AppStartMenuFolder"
+ ${EndIf}
+ !insertmacro IsShortcutTarget "$SMPROGRAMS\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
+ Pop $0
+ ${If} $0 = 1
+ !insertmacro UnpinShortcut "$SMPROGRAMS\${PRODUCTNAME}.lnk"
+ Delete "$SMPROGRAMS\${PRODUCTNAME}.lnk"
+ ${EndIf}
+
+ ; Remove desktop shortcuts
+ !insertmacro IsShortcutTarget "$DESKTOP\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
+ Pop $0
+ ${If} $0 = 1
+ !insertmacro UnpinShortcut "$DESKTOP\${PRODUCTNAME}.lnk"
+ Delete "$DESKTOP\${PRODUCTNAME}.lnk"
+ ${EndIf}
+ ${EndIf}
+
+ ; Remove registry information for add/remove programs
+ !if "${INSTALLMODE}" == "both"
+ DeleteRegKey SHCTX "${UNINSTKEY}"
+ !else if "${INSTALLMODE}" == "perMachine"
+ DeleteRegKey HKLM "${UNINSTKEY}"
+ !else
+ DeleteRegKey HKCU "${UNINSTKEY}"
+ !endif
+
+ ; Removes the Autostart entry for ${PRODUCTNAME} from the HKCU Run key if it exists.
+ ; This ensures the program does not launch automatically after uninstallation if it exists.
+ ; If it doesn't exist, it does nothing.
+ ; We do this when not updating (to preserve the registry value on updates)
+ ${If} $UpdateMode <> 1
+ DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "${PRODUCTNAME}"
+ ${EndIf}
+
+ ; Delete app data if the checkbox is selected
+ ; and if not updating
+ ${If} $DeleteAppDataCheckboxState = 1
+ ${AndIf} $UpdateMode <> 1
+ ; Clear the install location $INSTDIR from registry
+ DeleteRegKey SHCTX "${MANUPRODUCTKEY}"
+ DeleteRegKey /ifempty SHCTX "${MANUKEY}"
+
+ ; Clear the install language from registry
+ DeleteRegValue HKCU "${MANUPRODUCTKEY}" "Installer Language"
+ DeleteRegKey /ifempty HKCU "${MANUPRODUCTKEY}"
+ DeleteRegKey /ifempty HKCU "${MANUKEY}"
+
+ SetShellVarContext current
+ RmDir /r "$APPDATA\${BUNDLEID}"
+ RmDir /r "$LOCALAPPDATA\${BUNDLEID}"
+ ${EndIf}
+
+ !ifmacrodef NSIS_HOOK_POSTUNINSTALL
+ !insertmacro NSIS_HOOK_POSTUNINSTALL
+ !endif
+
+ ; Auto close if passive mode or updating
+ ${If} $PassiveMode = 1
+ ${OrIf} $UpdateMode = 1
+ SetAutoClose true
+ ${EndIf}
+SectionEnd
+
+Function RestorePreviousInstallLocation
+ ReadRegStr $4 SHCTX "${MANUPRODUCTKEY}" ""
+ StrCmp $4 "" +2 0
+ StrCpy $INSTDIR $4
+FunctionEnd
+
+Function Skip
+ Abort
+FunctionEnd
+
+Function SkipIfPassive
+ ${IfThen} $PassiveMode = 1 ${|} Abort ${|}
+FunctionEnd
+Function un.SkipIfPassive
+ ${IfThen} $PassiveMode = 1 ${|} Abort ${|}
+FunctionEnd
+
+Function CreateOrUpdateStartMenuShortcut
+ ; We used to use product name as MAINBINARYNAME
+ ; migrate old shortcuts to target the new MAINBINARYNAME
+ StrCpy $R0 0
+
+ !insertmacro IsShortcutTarget "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" "$INSTDIR\$OldMainBinaryName"
+ Pop $0
+ ${If} $0 = 1
+ !insertmacro SetShortcutTarget "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
+ StrCpy $R0 1
+ ${EndIf}
+
+ !insertmacro IsShortcutTarget "$SMPROGRAMS\${PRODUCTNAME}.lnk" "$INSTDIR\$OldMainBinaryName"
+ Pop $0
+ ${If} $0 = 1
+ !insertmacro SetShortcutTarget "$SMPROGRAMS\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
+ StrCpy $R0 1
+ ${EndIf}
+
+ ${If} $R0 = 1
+ Return
+ ${EndIf}
+
+ ; Skip creating shortcut if in update mode or no shortcut mode
+ ; but always create if migrating from wix
+ ${If} $WixMode = 0
+ ${If} $UpdateMode = 1
+ ${OrIf} $NoShortcutMode = 1
+ Return
+ ${EndIf}
+ ${EndIf}
+
+ !if "${STARTMENUFOLDER}" != ""
+ CreateDirectory "$SMPROGRAMS\$AppStartMenuFolder"
+ CreateShortcut "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
+ !insertmacro SetLnkAppUserModelId "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
+ !else
+ CreateShortcut "$SMPROGRAMS\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
+ !insertmacro SetLnkAppUserModelId "$SMPROGRAMS\${PRODUCTNAME}.lnk"
+ !endif
+FunctionEnd
+
+Function CreateOrUpdateDesktopShortcut
+ ; We used to use product name as MAINBINARYNAME
+ ; migrate old shortcuts to target the new MAINBINARYNAME
+ !insertmacro IsShortcutTarget "$DESKTOP\${PRODUCTNAME}.lnk" "$INSTDIR\$OldMainBinaryName"
+ Pop $0
+ ${If} $0 = 1
+ !insertmacro SetShortcutTarget "$DESKTOP\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
+ Return
+ ${EndIf}
+
+ ; Skip creating shortcut if in update mode or no shortcut mode
+ ; but always create if migrating from wix
+ ${If} $WixMode = 0
+ ${If} $UpdateMode = 1
+ ${OrIf} $NoShortcutMode = 1
+ Return
+ ${EndIf}
+ ${EndIf}
+
+ CreateShortcut "$DESKTOP\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
+ !insertmacro SetLnkAppUserModelId "$DESKTOP\${PRODUCTNAME}.lnk"
+FunctionEnd
diff --git a/src-tauri/bundled/installer-hooks/proxywarden-hooks.nsh b/src-tauri/bundled/installer-hooks/proxywarden-hooks.nsh
index 15240a2..8832c2c 100644
--- a/src-tauri/bundled/installer-hooks/proxywarden-hooks.nsh
+++ b/src-tauri/bundled/installer-hooks/proxywarden-hooks.nsh
@@ -1,6 +1,35 @@
!macro NSIS_HOOK_PREUNINSTALL
- DetailPrint "ProxyWarden: cleaning managed components"
- nsExec::ExecToLog 'powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$INSTDIR\bundled\cleanup\uninstall-managed-components.ps1" -InstallRoot "$INSTDIR"'
- Pop $0
- DetailPrint "ProxyWarden cleanup exit code: $0"
+ ${If} $UpdateMode = 1
+ DetailPrint "ProxyWarden: verifying managed component state before update"
+ ClearErrors
+ ExecWait '"$INSTDIR\${MAINBINARYNAME}.exe" --nsis-verify-upgrade' $0
+ ${Else}
+ ; The generated Tauri guard normally runs after PREUNINSTALL. Repeat it
+ ; here so no service/filesystem mutation starts while the app is alive.
+ !insertmacro CheckIfAppIsRunning "${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
+ DetailPrint "ProxyWarden: uninstalling verified managed components"
+ ClearErrors
+ ExecWait '"$INSTDIR\${MAINBINARYNAME}.exe" --nsis-uninstall-managed' $0
+ ${EndIf}
+
+ IfErrors 0 +3
+ DetailPrint "ProxyWarden native lifecycle helper could not be launched"
+ Abort "ProxyWarden could not start the native lifecycle verifier."
+
+ ${If} $0 = 3010
+ SetRebootFlag true
+ ; The helper keeps its exact durable reboot fact until this parent has
+ ; observed 3010. Delete only that fixed published marker, then fail closed
+ ; if acknowledgement cannot be persisted before uninstall continues.
+ ClearErrors
+ Delete "$INSTDIR\.proxywarden-nsis-reboot-required.json"
+ IfErrors 0 +3
+ DetailPrint "ProxyWarden reboot acknowledgement could not be persisted"
+ Abort "ProxyWarden could not safely acknowledge the required reboot."
+ StrCpy $0 0
+ ${EndIf}
+ ${If} $0 != 0
+ DetailPrint "ProxyWarden native lifecycle check failed with exit code $0"
+ Abort "ProxyWarden could not safely verify or remove managed components."
+ ${EndIf}
!macroend
diff --git a/src-tauri/bundled/proxifyre/manifest.json b/src-tauri/bundled/proxifyre/manifest.json
deleted file mode 100644
index d0fbe01..0000000
--- a/src-tauri/bundled/proxifyre/manifest.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "generatedAt": "2026-07-09T16:13:27.3087159Z",
- "architectures": [
- "x64"
- ],
- "proxifyreRelease": "v2.2.1",
- "windowsPacketFilterRelease": "v3.6.2",
- "files": [
- {
- "id": "proxifyre-x64",
- "name": "ProxiFyre-v2.2.1-x64-signed.zip",
- "sha256": "c38ca1caa68cd730712f5c0911e4240711bf9e7684988ae64ed04ec693cce899",
- "size": 1372483,
- "sourceUrl": "https://github.com/wiresock/proxifyre/releases/download/v2.2.1/ProxiFyre-v2.2.1-x64-signed.zip"
- },
- {
- "id": "packet-filter-x64",
- "name": "Windows.Packet.Filter.3.6.2.1.x64.msi",
- "sha256": "9c388c0b7f189f7fa98720bae2caecf7d64f30910838b80b438ecf8956b8502c",
- "size": 819200,
- "sourceUrl": "https://github.com/wiresock/ndisapi/releases/download/v3.6.2/Windows.Packet.Filter.3.6.2.1.x64.msi"
- },
- {
- "id": "vc-runtime-x64",
- "name": "vc_redist.x64.exe",
- "sha256": "843068991daaa1f73ad9f6239bce4d0f6a07a51f18c37ea2a867e9beca71295c",
- "size": 18731856,
- "sourceUrl": "https://aka.ms/vc14/vc_redist.x64.exe"
- }
- ]
-}
diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json
index 802d2a2..75dd438 100644
--- a/src-tauri/capabilities/default.json
+++ b/src-tauri/capabilities/default.json
@@ -1,7 +1,7 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
- "description": "Default capability for the main ProxyWarden Windows shell. Task 8 keeps helper/install launch explicit: no shell or sidecar permission is granted here until a packaged helper is declared.",
+ "description": "Default capability for the main ProxyWarden Windows shell. Privileged lifecycle work stays behind fixed native Rust modes; no shell or sidecar permission is granted.",
"windows": ["main"],
"permissions": ["core:default", "dialog:allow-open"]
}
diff --git a/src-tauri/src/adapters/proxifyre.rs b/src-tauri/src/adapters/proxifyre.rs
index 70884d3..10b2eca 100644
--- a/src-tauri/src/adapters/proxifyre.rs
+++ b/src-tauri/src/adapters/proxifyre.rs
@@ -48,7 +48,11 @@ impl ProxiFyreAdapter {
proxies.push(ProxiFyreProxy {
app_names,
- socks5_proxy_endpoint: format!("{}:{}", target.host, target.port),
+ socks5_proxy_endpoint: if target.host.contains(':') {
+ format!("[{}]:{}", target.host, target.port)
+ } else {
+ format!("{}:{}", target.host, target.port)
+ },
supported_protocols: protocols_for_profile(profile),
});
}
diff --git a/src-tauri/src/adapters/singbox.rs b/src-tauri/src/adapters/singbox.rs
index 8f022ff..059acbc 100644
--- a/src-tauri/src/adapters/singbox.rs
+++ b/src-tauri/src/adapters/singbox.rs
@@ -1,8 +1,8 @@
use crate::models::{LocalSingBoxConfig, SubscriptionCache, SubscriptionServer};
-use crate::process::command_no_window;
+use crate::process::run_fixed_process;
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};
-use std::{env, fs, fs::OpenOptions, io::Write, path::Path};
+use std::{env, fs, path::Path, time::Duration};
pub const SINGBOX_ADAPTER_ID: &str = "singbox";
pub const SINGBOX_OUTPUT_FILE: &str = "sing-box-config.json";
@@ -41,31 +41,24 @@ impl SingBoxAdapter {
where
C: SingBoxConfigChecker + ?Sized,
{
- let selected_server = request
- .config
- .selected_server_id
- .as_deref()
- .and_then(|id| {
- request
- .subscription_cache
- .servers
- .iter()
- .find(|server| server.id == id)
- })
- .or_else(|| {
- let tag = request.config.selected_server_tag.as_deref()?;
- request
- .subscription_cache
- .servers
- .iter()
- .find(|server| server.tag == tag)
- })
- .ok_or_else(|| {
- SingBoxConfigError::new(
- SingBoxConfigErrorKind::MissingSelectedServer,
- "Сервер Local sing-box не выбран или отсутствует в текущей подписке",
- )
- })?;
+ let selected_server = if let Some(id) = request.config.selected_server_id.as_deref() {
+ request
+ .subscription_cache
+ .servers
+ .iter()
+ .find(|server| server.id == id)
+ } else {
+ let mut matches = request.subscription_cache.servers.iter().filter(|server| {
+ Some(server.tag.as_str()) == request.config.selected_server_tag.as_deref()
+ });
+ matches.next().filter(|_| matches.next().is_none())
+ }
+ .ok_or_else(|| {
+ SingBoxConfigError::new(
+ SingBoxConfigErrorKind::MissingSelectedServer,
+ "Сервер Local sing-box не выбран или отсутствует в текущей подписке",
+ )
+ })?;
let vpn_outbound = selected_outbound(
&request.subscription_cache.config,
selected_server,
@@ -213,70 +206,50 @@ impl SingBoxConfigChecker for SingBoxCommandChecker {
uuid::Uuid::new_v4().hyphenated()
));
- {
- let mut config_file = OpenOptions::new()
- .write(true)
- .create_new(true)
- .open(&config_path)
- .map_err(|error| {
- SingBoxConfigError::new(
- SingBoxConfigErrorKind::CheckFailed,
- format!(
- "Не удалось создать временный конфиг sing-box '{}': {error}",
- config_path.display()
- ),
- )
- })?;
- let write_result = config_file.write_all(config_json.as_bytes());
- drop(config_file);
- if let Err(error) = write_result {
- let _ = fs::remove_file(&config_path);
- return Err(SingBoxConfigError::new(
- SingBoxConfigErrorKind::CheckFailed,
- format!(
- "Не удалось записать временный конфиг sing-box '{}': {error}",
- config_path.display()
- ),
- ));
+ struct TemporaryConfig(std::path::PathBuf);
+ impl Drop for TemporaryConfig {
+ fn drop(&mut self) {
+ let _ = fs::remove_file(&self.0);
}
}
-
- let output = command_no_window(binary_path)
- .arg("check")
- .arg("-c")
- .arg(&config_path)
- .output()
- .map_err(|error| {
- let _ = fs::remove_file(&config_path);
+ let _temporary = TemporaryConfig(config_path.clone());
+ crate::safe_fs::write_restricted_atomic(&config_path, config_json.as_bytes()).map_err(
+ |_| {
SingBoxConfigError::new(
SingBoxConfigErrorKind::CheckFailed,
- format!(
- "Не удалось выполнить '{} check': {error}",
- binary_path.display()
- ),
+ "Не удалось безопасно создать временный конфиг sing-box",
)
- })?;
- let _ = fs::remove_file(&config_path);
-
- let stdout = String::from_utf8_lossy(&output.stdout);
- let stderr = String::from_utf8_lossy(&output.stderr);
- let message = command_message(&stdout, &stderr);
-
- if !output.status.success() {
- return Err(SingBoxConfigError::new(
+ },
+ )?;
+ // Checker output can contain credentials from the outbound. The bounded
+ // native process runner discards both streams instead of exposing them.
+ let status = run_fixed_process(
+ binary_path,
+ &[
+ "check".into(),
+ "-c".into(),
+ config_path.as_os_str().to_owned(),
+ ],
+ Duration::from_secs(30),
+ )
+ .map_err(|error| {
+ SingBoxConfigError::new(
SingBoxConfigErrorKind::CheckFailed,
- format!("Проверка sing-box не прошла: {message}"),
- ));
+ if error.kind() == std::io::ErrorKind::TimedOut {
+ "Проверка sing-box превысила 30 секунд"
+ } else {
+ "Не удалось выполнить проверку sing-box"
+ },
+ )
+ })?;
+ if !status.success() {
+ return Err(SingBoxConfigError::new(SingBoxConfigErrorKind::CheckFailed,
+ "sing-box отклонил конфигурацию выбранного сервера. Обновите подписку или выберите другой сервер."));
}
-
Ok(SingBoxCheckResult {
checked: true,
success: true,
- message: if message.is_empty() {
- "Проверка sing-box прошла успешно".to_string()
- } else {
- message
- },
+ message: "Проверка sing-box прошла успешно".to_string(),
})
}
}
@@ -295,32 +268,39 @@ fn selected_outbound(
"В cache подписки нет outbounds",
)
})?;
- let outbound = outbounds
- .iter()
- .find(|outbound| {
- let tag_matches = outbound
+ let outbound = if selected_server.id.starts_with("pw-") {
+ outbounds.iter().find(|outbound| {
+ crate::subscription::outbound_server_id(outbound) == selected_server.id
+ })
+ } else {
+ // Legacy endpoint IDs are readable only when they identify exactly one outbound.
+ let mut matches = outbounds.iter().filter(|outbound| {
+ outbound
.get("tag")
.and_then(Value::as_str)
- .is_some_and(|tag| tag.trim() == selected_server.tag);
- let server_matches = outbound
- .get("server")
- .and_then(Value::as_str)
- .is_some_and(|server| server.eq_ignore_ascii_case(&selected_server.server));
- let port_matches = outbound
- .get("server_port")
- .and_then(Value::as_u64)
- .is_some_and(|port| port == u64::from(selected_server.server_port));
- tag_matches && server_matches && port_matches
- })
- .ok_or_else(|| {
- SingBoxConfigError::new(
- SingBoxConfigErrorKind::MissingSelectedOutbound,
- format!(
- "Outbound не найден: {} ({}:{})",
- selected_server.tag, selected_server.server, selected_server.server_port
- ),
- )
- })?;
+ .is_some_and(|tag| {
+ crate::models::decode_percent_encoded_utf8(tag).trim() == selected_server.tag
+ })
+ && outbound.get("type").and_then(Value::as_str)
+ == Some(selected_server.server_type.as_str())
+ && outbound
+ .get("server")
+ .and_then(Value::as_str)
+ .is_some_and(|host| host.eq_ignore_ascii_case(&selected_server.server))
+ && outbound.get("server_port").and_then(Value::as_u64)
+ == Some(u64::from(selected_server.server_port))
+ });
+ matches.next().filter(|_| matches.next().is_none())
+ }
+ .ok_or_else(|| {
+ SingBoxConfigError::new(
+ SingBoxConfigErrorKind::MissingSelectedOutbound,
+ format!(
+ "Outbound не найден: {} ({}:{})",
+ selected_server.tag, selected_server.server, selected_server.server_port
+ ),
+ )
+ })?;
let outbound_type = outbound
.get("type")
.and_then(Value::as_str)
@@ -359,15 +339,3 @@ fn selected_outbound(
Ok(outbound)
}
-
-fn command_message(stdout: &str, stderr: &str) -> String {
- let stdout = stdout.trim();
- let stderr = stderr.trim();
-
- match (stdout.is_empty(), stderr.is_empty()) {
- (true, true) => String::new(),
- (false, true) => stdout.to_string(),
- (true, false) => stderr.to_string(),
- (false, false) => format!("{stdout}\n{stderr}"),
- }
-}
diff --git a/src-tauri/src/admin.rs b/src-tauri/src/admin.rs
index 9587b7f..b8b521f 100644
--- a/src-tauri/src/admin.rs
+++ b/src-tauri/src/admin.rs
@@ -1,89 +1,23 @@
//! Administrator-state detection and explicit UAC restart boundary.
-use crate::command_dto::{AdminStatusResponse, CommandError};
-use crate::powershell::{
- escape_single as escape_powershell_single, is_elevated as is_running_elevated,
- output_message as powershell_output_message, run_command as run_powershell_command,
-};
-use std::env;
+use crate::command_dto::AdminStatusResponse;
+use crate::process::is_process_elevated;
pub fn admin_status() -> AdminStatusResponse {
let is_windows = cfg!(windows);
- let is_elevated = is_running_elevated();
+ let is_elevated = is_process_elevated();
let message = if !is_windows {
"Проверка прав администратора нужна только в Windows.".to_string()
} else if is_elevated {
"ProxyWarden уже запущен от имени администратора.".to_string()
} else {
- "Для установки компонентов и управления службами можно перезапустить ProxyWarden от имени администратора один раз.".to_string()
+ "Права администратора будут запрошены отдельно для выбранного действия.".to_string()
};
AdminStatusResponse {
is_windows,
is_elevated,
- can_restart_elevated: is_windows && !is_elevated,
+ can_restart_elevated: false,
message,
}
}
-
-pub(crate) fn launch_app_as_admin() -> Result<(), CommandError> {
- if !cfg!(windows) {
- return Err(CommandError::new(
- "admin_restart_unsupported",
- "Перезапуск от имени администратора доступен только в Windows.",
- ));
- }
-
- if is_running_elevated() {
- return Ok(());
- }
-
- let exe_path = env::current_exe().map_err(|error| {
- CommandError::new(
- "admin_restart_failed",
- format!("Не удалось определить путь текущего приложения: {error}"),
- )
- })?;
- let working_dir = env::current_dir().ok();
- let working_dir_arg = working_dir
- .as_ref()
- .map(|path| {
- format!(
- " -WorkingDirectory '{}'",
- escape_powershell_single(&path.display().to_string())
- )
- })
- .unwrap_or_default();
- let script = format!(
- r#"
-$ErrorActionPreference = 'Stop'
-try {{
- Start-Process -FilePath '{}' -Verb RunAs{}
- exit 0
-}} catch {{
- Write-Error ($_ | Out-String)
- exit 1
-}}
-"#,
- escape_powershell_single(&exe_path.display().to_string()),
- working_dir_arg
- );
- let output = run_powershell_command(&script).map_err(|error| {
- CommandError::new(
- "admin_restart_failed",
- format!("Не удалось запросить права администратора: {error}"),
- )
- })?;
-
- if output.status.success() {
- return Ok(());
- }
-
- Err(CommandError::new(
- "admin_restart_failed",
- powershell_output_message(
- &output,
- "Перезапуск от имени администратора отменен или не был запущен.",
- ),
- ))
-}
diff --git a/src-tauri/src/apply_flow.rs b/src-tauri/src/apply_flow.rs
index cc53260..91ad07c 100644
--- a/src-tauri/src/apply_flow.rs
+++ b/src-tauri/src/apply_flow.rs
@@ -22,7 +22,7 @@ use crate::safe_fs;
use crate::storage::JsonStorage;
use crate::validation::{normalize_profile, normalize_target, ValidationError};
use serde::{Deserialize, Serialize};
-use std::{fs, path::Path};
+use std::path::Path;
use thiserror::Error;
const LOCAL_SINGBOX_TARGET_ID: &str = "local-singbox";
@@ -37,10 +37,12 @@ pub enum ApplyRouteMode {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApplyConfigurationInput {
+ #[serde(default)]
+ pub expected_revision: Option,
pub route_mode: ApplyRouteMode,
pub profile: ProfileInput,
pub external_target: Option,
- #[serde(default = "default_true")]
+ #[serde(default)]
pub disable_other_profiles: bool,
}
@@ -65,6 +67,7 @@ pub enum ApplyPhaseStatus {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApplyConfigurationResult {
+ pub saved_state: Option,
pub success: bool,
pub changed: bool,
pub partial_state: bool,
@@ -128,6 +131,19 @@ pub fn apply_configuration(
input: ApplyConfigurationInput,
services: ApplyServices<'_>,
) -> Result {
+ let read_guard = crate::configuration_transaction::read_guard(storage)
+ .map_err(|error| storage_error("configuration_locked", error))?;
+ if let Some(expected) = &input.expected_revision {
+ if crate::configuration_transaction::revision_locked(storage)
+ .map_err(|e| storage_error("configuration_read_failed", e))?
+ != *expected
+ {
+ return Err(ApplyFlowError::failure(
+ "configuration_changed",
+ "Настройки изменились. Обновите сохранённое состояние перед применением.",
+ ));
+ }
+ }
let mut phases = Vec::new();
let old_profiles = storage
.read_profiles()
@@ -142,6 +158,18 @@ pub fn apply_configuration(
proxy_config,
singbox_config,
} = prepare_apply(storage, input, &services)?;
+ let revision = crate::configuration_transaction::revision_locked(storage)
+ .map_err(|error| storage_error("configuration_read_failed", error))?;
+ drop(read_guard);
+ if let (Some(generated), Some(detected)) = (&singbox_config, &services.detected_singbox) {
+ services
+ .checker
+ .check_config(&detected.executable_path, &generated.contents)
+ .map_err(|error| ApplyFlowError::failure("singbox_preflight_failed", error.message))?;
+ }
+ let transaction =
+ crate::configuration_transaction::ConfigurationTransaction::begin(storage, Some(&revision))
+ .map_err(|error| storage_error("configuration_changed", error))?;
phases.push(phase(
"preflight",
ApplyPhaseStatus::Succeeded,
@@ -156,132 +184,95 @@ pub fn apply_configuration(
let singbox_path = singbox_config
.as_ref()
.map(|_| storage.paths().generated_dir.join(SINGBOX_OUTPUT_FILE));
- let old_proxy_contents = fs::read(&proxy_path).ok();
- let old_singbox_contents = singbox_path.as_ref().and_then(|path| fs::read(path).ok());
- let rollback_state = RollbackState {
- storage,
- old_profiles: &old_profiles,
- old_targets: &old_targets,
- proxy_path: &proxy_path,
- old_proxy_contents: old_proxy_contents.as_deref(),
- singbox_path: singbox_path.as_deref(),
- old_singbox_contents: old_singbox_contents.as_deref(),
- };
-
- if let Err(error) = storage.write_targets(&targets) {
- let rollback = rollback_source(storage, &old_profiles, &old_targets);
+ let staged = (|| {
+ storage
+ .write_targets(&targets)
+ .map_err(|e| storage_error("targets_write_failed", e))?;
+ storage
+ .write_profiles(&profiles)
+ .map_err(|e| storage_error("profiles_write_failed", e))?;
phases.push(phase(
"source-state",
- ApplyPhaseStatus::Failed,
- "Не удалось сохранить targets.",
- ));
- phases.push(rollback_phase(&rollback));
- return Ok(failed_result(
- "targets_write_failed",
- format!("Не удалось сохранить цели: {error}"),
- rollback.is_err(),
- &proxy_path,
- singbox_path.as_deref(),
- phases,
- ));
- }
- if let Err(error) = storage.write_profiles(&profiles) {
- let rollback = rollback_source(storage, &old_profiles, &old_targets);
- phases.push(phase(
- "source-state",
- ApplyPhaseStatus::Failed,
- "Не удалось сохранить profiles.",
- ));
- phases.push(rollback_phase(&rollback));
- return Ok(failed_result(
- "profiles_write_failed",
- format!("Не удалось сохранить профили: {error}"),
- rollback.is_err(),
- &proxy_path,
- singbox_path.as_deref(),
- phases,
- ));
- }
- phases.push(phase(
- "source-state",
- ApplyPhaseStatus::Succeeded,
- "Profiles и targets сохранены.",
- ));
-
- if let (Some(generated), Some(path)) = (singbox_config.as_ref(), singbox_path.as_ref()) {
- if let Err(error) = safe_fs::write_with_backup(path, generated.contents.as_bytes()) {
- return Ok(rollback_after_failure(
- &rollback_state,
- "singbox_config_write_failed",
- format!("Не удалось записать generated sing-box config: {error}"),
- "singbox-config",
- phases,
- ));
- }
- phases.push(phase(
- "singbox-config",
ApplyPhaseStatus::Succeeded,
- "Generated sing-box config записан; служба не перезапускалась.",
+ "Profiles и targets сохранены.",
));
- } else {
- phases.push(phase(
- "singbox-config",
- ApplyPhaseStatus::Skipped,
- "External SOCKS5 не использует Local sing-box.",
- ));
- }
-
- if let Err(error) = safe_fs::write_with_backup(&proxy_path, proxy_config.contents.as_bytes()) {
- return Ok(rollback_after_failure(
- &rollback_state,
- "proxifyre_config_write_failed",
- format!("Не удалось записать generated ProxiFyre config: {error}"),
- "proxifyre-config",
- phases,
- ));
- }
- phases.push(phase(
- "proxifyre-config",
- ApplyPhaseStatus::Succeeded,
- "Generated ProxiFyre config записан.",
- ));
-
- let helper_result = match services.helper.apply_proxy_config(HelperApplyRequest {
- adapter_id: &proxy_config.adapter_id,
- config_path: &proxy_path,
- config_contents: &proxy_config.contents,
- }) {
- Ok(result) if result.success => result,
- Ok(result) => {
- return Ok(rollback_after_failure(
- &rollback_state,
+ if let (Some(generated), Some(path)) = (&singbox_config, &singbox_path) {
+ safe_fs::write_restricted_with_backup(path, generated.contents.as_bytes())
+ .map_err(|e| storage_error("singbox_config_write_failed", e))?;
+ }
+ safe_fs::write_restricted_with_backup(&proxy_path, proxy_config.contents.as_bytes())
+ .map_err(|e| storage_error("proxifyre_config_write_failed", e))?;
+ let result = services
+ .helper
+ .apply_proxy_config(HelperApplyRequest {
+ adapter_id: &proxy_config.adapter_id,
+ config_path: &proxy_path,
+ config_contents: &proxy_config.contents,
+ })
+ .map_err(|e| ApplyFlowError::failure(e.code, e.message))?;
+ if !result.success {
+ return Err(ApplyFlowError::failure(
"proxifyre_apply_failed",
result.message,
- "runtime-apply",
- phases,
));
}
+ crate::route_state::record_prepared_locked(
+ storage,
+ crate::privileged_jobs::ManagedComponent::Proxifyre,
+ )
+ .map_err(|e| storage_error("prepared_state_write_failed", e))?;
+ if singbox_config.is_some() {
+ crate::route_state::record_prepared_locked(
+ storage,
+ crate::privileged_jobs::ManagedComponent::SingBox,
+ )
+ .map_err(|e| storage_error("prepared_state_write_failed", e))?;
+ }
+ Ok(result)
+ })();
+ let (helper_result, committed_revision, artifacts) = match staged {
+ Ok(result) => {
+ let artifacts = crate::route_state::read_status_locked(storage)
+ .map_err(|e| storage_error("prepared_state_read_failed", e))?;
+ let revision = transaction
+ .commit_with_revision()
+ .map_err(|error| storage_error("configuration_commit_failed", error))?;
+ (result, revision, artifacts)
+ }
Err(error) => {
- return Ok(rollback_after_failure(
- &rollback_state,
- &error.code,
- error.message,
- "runtime-apply",
+ let rollback = transaction.abort();
+ phases.push(phase(
+ "rollback",
+ if rollback.is_ok() {
+ ApplyPhaseStatus::RolledBack
+ } else {
+ ApplyPhaseStatus::Failed
+ },
+ if rollback.is_ok() {
+ "Предыдущие настройки и конфиги восстановлены."
+ } else {
+ "Восстановление не завершено; новые операции заблокированы до recovery."
+ },
+ ));
+ return Ok(failed_result(
+ if rollback.is_ok() {
+ error.code()
+ } else {
+ "configuration_recovery_required"
+ },
+ error.to_string(),
+ rollback.is_err(),
+ &proxy_path,
+ singbox_path.as_deref(),
phases,
));
}
};
- phases.push(phase(
- "runtime-apply",
- ApplyPhaseStatus::Succeeded,
- "ProxiFyre config применён без управления службой.",
- ));
phases.push(phase(
"service-control",
ApplyPhaseStatus::Skipped,
- "Apply не запускает, не останавливает и не перезапускает службы.",
+ "Apply не управляет службами.",
));
-
let mut restart_required = Vec::new();
if services.detected_proxyfier.is_some() {
restart_required.push(ComponentId::Proxyfier);
@@ -320,6 +311,19 @@ pub fn apply_configuration(
}
Ok(ApplyConfigurationResult {
+ saved_state: Some(crate::command_dto::SavedStateResponse {
+ artifacts,
+ revision: committed_revision,
+ profiles: profiles
+ .iter()
+ .map(crate::command_dto::ProfileDto::from)
+ .collect(),
+ targets: targets
+ .iter()
+ .map(crate::command_dto::TargetDto::from)
+ .collect(),
+ generated_config_path: proxy_path.display().to_string(),
+ }),
success: true,
changed: source_changed || helper_result.changed,
partial_state: false,
@@ -351,62 +355,72 @@ fn prepare_apply(
));
}
let mut profile_input = input.profile;
+ let mut profiles = storage
+ .read_profiles()
+ .map_err(|error| storage_error("profiles_read_failed", error))?;
let mut targets = storage
.read_targets()
.map_err(|error| storage_error("targets_read_failed", error))?;
- let singbox_config = match input.route_mode {
- ApplyRouteMode::External => {
- let target_input = input.external_target.ok_or_else(|| {
- ApplyFlowError::failure(
- "external_target_missing",
- "Для external маршрута требуется SOCKS5 target.",
- )
- })?;
- let target = normalize_target(target_input).map_err(ApplyFlowError::validation)?;
- profile_input.target_id = target.id.clone();
- upsert_target(&mut targets, target);
- None
- }
- ApplyRouteMode::LocalSingbox => {
- let config = storage
- .read_local_singbox_config()
- .map_err(|error| storage_error("singbox_config_read_failed", error))?;
- let cache = storage
- .read_singbox_subscription_cache()
- .map_err(|error| storage_error("singbox_cache_read_failed", error))?
- .ok_or_else(|| {
+ let clearing_profile = !profile_input.enabled && profile_input.items.is_empty();
+ let singbox_config = if clearing_profile {
+ None
+ } else {
+ match input.route_mode {
+ ApplyRouteMode::External => {
+ let target_input = input.external_target.ok_or_else(|| {
ApplyFlowError::failure(
- "singbox_subscription_cache_missing",
- "Сначала загрузите подписку Local sing-box.",
+ "external_target_missing",
+ "Для external маршрута требуется SOCKS5 target.",
)
})?;
- profile_input.target_id = LOCAL_SINGBOX_TARGET_ID.to_string();
- upsert_target(&mut targets, local_singbox_target(&config));
- Some(
- services
- .singbox_adapter
- .generate_config(
- SingBoxGenerationRequest::new(
- &config,
- &cache,
- services
- .detected_singbox
- .as_ref()
- .map(|detected| detected.executable_path.as_path()),
- ),
- services.checker,
- )
- .map_err(|error| {
- ApplyFlowError::failure("singbox_preflight_failed", error.message)
- })?,
- )
+ let mut target =
+ normalize_target(target_input).map_err(ApplyFlowError::validation)?;
+ let shared = profiles.iter().any(|existing| {
+ Some(existing.id.as_str()) != profile_input.id.as_deref()
+ && existing.target_id == target.id
+ });
+ if shared
+ && targets
+ .iter()
+ .any(|existing| existing.id == target.id && existing != &target)
+ {
+ target.id = format!("target-{}", uuid::Uuid::new_v4());
+ }
+ profile_input.target_id = target.id.clone();
+ upsert_target(&mut targets, target);
+ None
+ }
+ ApplyRouteMode::LocalSingbox => {
+ let config = storage
+ .read_local_singbox_config()
+ .map_err(|error| storage_error("singbox_config_read_failed", error))?;
+ let cache = storage
+ .read_singbox_subscription_cache()
+ .map_err(|error| storage_error("singbox_cache_read_failed", error))?
+ .ok_or_else(|| {
+ ApplyFlowError::failure(
+ "singbox_subscription_cache_missing",
+ "Сначала загрузите подписку Local sing-box.",
+ )
+ })?;
+ profile_input.target_id = LOCAL_SINGBOX_TARGET_ID.to_string();
+ upsert_target(&mut targets, local_singbox_target(&config));
+ Some(
+ services
+ .singbox_adapter
+ .generate_config(
+ SingBoxGenerationRequest::new(&config, &cache, None),
+ services.checker,
+ )
+ .map_err(|error| {
+ ApplyFlowError::failure("singbox_preflight_failed", error.message)
+ })?,
+ )
+ }
}
};
let profile = normalize_profile(profile_input).map_err(ApplyFlowError::validation)?;
- let mut profiles = storage
- .read_profiles()
- .map_err(|error| storage_error("profiles_read_failed", error))?;
if input.disable_other_profiles {
for existing in &mut profiles {
if existing.id != profile.id {
@@ -415,6 +429,14 @@ fn prepare_apply(
}
}
upsert_profile(&mut profiles, profile);
+ if !profiles.iter().any(|profile| profile.enabled)
+ && proxyfier_component_from_detection(services.detected_proxyfier.as_ref()).running
+ {
+ return Err(ApplyFlowError::failure(
+ "stop_before_clearing_route",
+ "Сначала явно остановите ProxiFyre, затем примените удаление последних правил.",
+ ));
+ }
let components = vec![
proxyfier_component_from_detection(services.detected_proxyfier.as_ref()),
@@ -462,96 +484,6 @@ fn upsert_target(targets: &mut Vec, target: Target) {
}
}
-struct RollbackState<'a> {
- storage: &'a JsonStorage,
- old_profiles: &'a [Profile],
- old_targets: &'a [Target],
- proxy_path: &'a Path,
- old_proxy_contents: Option<&'a [u8]>,
- singbox_path: Option<&'a Path>,
- old_singbox_contents: Option<&'a [u8]>,
-}
-
-fn rollback_after_failure(
- state: &RollbackState<'_>,
- code: &str,
- message: String,
- failed_phase: &str,
- mut phases: Vec,
-) -> ApplyConfigurationResult {
- phases.push(phase(failed_phase, ApplyPhaseStatus::Failed, &message));
- let source_rollback = rollback_source(state.storage, state.old_profiles, state.old_targets);
- let proxy_rollback = restore_generated(state.proxy_path, state.old_proxy_contents);
- let singbox_rollback = state
- .singbox_path
- .map(|path| restore_generated(path, state.old_singbox_contents))
- .unwrap_or(Ok(()));
- let rollback_ok = source_rollback.is_ok() && proxy_rollback.is_ok() && singbox_rollback.is_ok();
- phases.push(if rollback_ok {
- phase(
- "rollback",
- ApplyPhaseStatus::RolledBack,
- "Source state и generated artifacts восстановлены.",
- )
- } else {
- phase(
- "rollback",
- ApplyPhaseStatus::Failed,
- "Rollback завершился не полностью; проверьте файлы config/generated.",
- )
- });
- failed_result(
- code,
- message,
- !rollback_ok,
- state.proxy_path,
- state.singbox_path,
- phases,
- )
-}
-
-fn rollback_source(
- storage: &JsonStorage,
- profiles: &[Profile],
- targets: &[Target],
-) -> Result<(), String> {
- let targets_result = storage
- .write_targets(targets)
- .map_err(|error| error.to_string());
- let profiles_result = storage
- .write_profiles(profiles)
- .map_err(|error| error.to_string());
- targets_result.and(profiles_result)
-}
-
-fn restore_generated(path: &Path, previous: Option<&[u8]>) -> Result<(), String> {
- match previous {
- Some(contents) => {
- safe_fs::write_with_backup(path, contents).map_err(|error| error.to_string())
- }
- None => match fs::remove_file(path) {
- Ok(()) => Ok(()),
- Err(error) if error.kind() == std::io::ErrorKind::NotFound => Ok(()),
- Err(error) => Err(error.to_string()),
- },
- }
-}
-
-fn rollback_phase(result: &Result<(), String>) -> ApplyPhase {
- match result {
- Ok(()) => phase(
- "rollback",
- ApplyPhaseStatus::RolledBack,
- "Source state восстановлен.",
- ),
- Err(error) => phase(
- "rollback",
- ApplyPhaseStatus::Failed,
- format!("Не удалось полностью восстановить source state: {error}"),
- ),
- }
-}
-
fn failed_result(
code: &str,
message: String,
@@ -561,6 +493,7 @@ fn failed_result(
phases: Vec,
) -> ApplyConfigurationResult {
ApplyConfigurationResult {
+ saved_state: None,
success: false,
changed: false,
partial_state,
@@ -588,7 +521,3 @@ fn phase(
fn storage_error(code: &str, error: std::io::Error) -> ApplyFlowError {
ApplyFlowError::failure(code, format!("Ошибка storage: {error}"))
}
-
-fn default_true() -> bool {
- true
-}
diff --git a/src-tauri/src/command_dto.rs b/src-tauri/src/command_dto.rs
index b22405d..727315a 100644
--- a/src-tauri/src/command_dto.rs
+++ b/src-tauri/src/command_dto.rs
@@ -4,6 +4,11 @@
//! camelCase contract exposed to the React webview.
use crate::adapters::singbox::SingBoxCheckResult;
+use crate::component_catalog::ComponentId as CatalogComponentId;
+use crate::component_packages::{
+ ComponentInstallSource, ComponentUpdateState, ComponentUpdateStatus, PackageSource,
+ UpdateCheckTrust, UpdateFreshness,
+};
use crate::models::{
ActivityEntry, ActivityLevel, ComponentId, ComponentState, ComponentStatus, LocalSingBoxConfig,
Profile, ProfileInput, ProfileItem, ProfileItemInput, ProfileItemType, Protocol, ProxyProtocol,
@@ -74,6 +79,8 @@ pub struct StatusResponse {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SavedStateResponse {
+ pub artifacts: Vec,
+ pub revision: String,
pub profiles: Vec,
pub targets: Vec,
pub generated_config_path: String,
@@ -83,6 +90,7 @@ pub struct SavedStateResponse {
#[serde(rename_all = "camelCase")]
pub struct StartupSnapshotResponse {
pub admin_status: AdminStatusResponse,
+ pub migration_status: StorageMigrationStatusDto,
pub saved_state: SavedStateResponse,
pub components: Vec,
pub proxifyre_setup_status: ProxiFyreSetupStatusDto,
@@ -90,6 +98,18 @@ pub struct StartupSnapshotResponse {
pub singbox_setup_status: SingBoxSetupStatusDto,
}
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct StorageMigrationStatusDto {
+ pub storage_schema_version: u32,
+ pub component_layout_version: Option,
+ pub outcome: String,
+ pub changed: bool,
+ pub blocking: bool,
+ pub notice_code: Option,
+ pub message: String,
+}
+
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ProxiFyreSetupStatusDto {
@@ -108,22 +128,12 @@ pub struct ProxiFyreSetupItemDto {
pub details: String,
}
-#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct ProxiFyreSetupProgressDto {
- pub operation: String,
- pub status: String,
- pub active_step: Option,
- pub percent: u8,
- pub message: String,
- pub updated_at: Option,
-}
-
pub type SingBoxSetupStatusDto = SingBoxSetupStatus;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LocalSingBoxStatusResponse {
+ pub saved_state: SavedStateResponse,
pub config: LocalSingBoxConfigDto,
pub cache: Option,
pub component: ComponentStatusDto,
@@ -356,6 +366,285 @@ pub struct ComponentStatusDto {
pub actions: Vec,
}
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ComponentLifecycleResponseDto {
+ pub component: ComponentStatusDto,
+ pub changed: bool,
+ pub reboot_required: bool,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "kebab-case")]
+pub enum ManagedPackageComponentDto {
+ Proxifyre,
+ SingBox,
+}
+
+impl ManagedPackageComponentDto {
+ pub(crate) const fn catalog_id(self) -> CatalogComponentId {
+ match self {
+ Self::Proxifyre => CatalogComponentId::Proxifyre,
+ Self::SingBox => CatalogComponentId::SingBox,
+ }
+ }
+
+ pub(crate) const fn model_id(self) -> ComponentId {
+ match self {
+ Self::Proxifyre => ComponentId::Proxyfier,
+ Self::SingBox => ComponentId::Singbox,
+ }
+ }
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum ComponentUpdateFreshnessDto {
+ NeverChecked,
+ Fresh,
+ Stale,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum ComponentUpdateStateDto {
+ Current,
+ UpdateAvailable,
+ CheckStale,
+ UnknownOffline,
+ Unsupported,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum ComponentInstallSourceDto {
+ Bundled,
+ Cache,
+ External,
+ None,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum ComponentPackageSourceDto {
+ Bundled,
+ Cache,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum ComponentUpdateTrustDto {
+ Trusted,
+ MissingIndependentDigest,
+ MalformedIndependentDigest,
+ Unsupported,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ComponentPackageRequestDto {
+ pub component_id: ManagedPackageComponentDto,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ComponentPackageStatusDto {
+ pub component_id: ManagedPackageComponentDto,
+ pub installed_version: Option,
+ pub bundled_version: String,
+ pub available_offline_version: String,
+ pub latest_known_version: Option,
+ pub last_checked_at: Option,
+ pub freshness: ComponentUpdateFreshnessDto,
+ pub update_state: ComponentUpdateStateDto,
+ pub install_source: ComponentInstallSourceDto,
+ pub offline_package_source: ComponentPackageSourceDto,
+ pub can_install_offline: bool,
+ pub offline_unavailable_reason: Option,
+ pub can_download: bool,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ComponentUpdateCheckResponseDto {
+ pub trust: ComponentUpdateTrustDto,
+ pub update_available: bool,
+ pub status: ComponentPackageStatusDto,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ComponentUpdateDownloadResponseDto {
+ pub downloaded_version: String,
+ pub source: ComponentPackageSourceDto,
+ pub status: ComponentPackageStatusDto,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ComponentUpdateResponseDto {
+ pub component: ComponentStatusDto,
+ pub package: ComponentPackageStatusDto,
+ pub changed: bool,
+ pub reboot_required: bool,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum ComponentCutoverStateDto {
+ NotNeeded,
+ Ready,
+ ManualMigrationRequired,
+ InProgress,
+ AwaitingNextStart,
+ AwaitingRouteSmoke,
+ CleanupReady,
+ CleanupPending,
+ Complete,
+ RolledBack,
+ RecoveryRequired,
+ Blocked,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum ComponentCutoverModeDto {
+ ServiceSwitch,
+ ManualOnly,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum ComponentCutoverServiceStateDto {
+ Running,
+ Stopped,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ComponentCutoverStatusDto {
+ pub component_id: ManagedPackageComponentDto,
+ pub state: ComponentCutoverStateDto,
+ pub mode: ComponentCutoverModeDto,
+ pub legacy_version: Option,
+ pub current_version: Option,
+ pub bundled_version: Option,
+ pub original_service_state: Option,
+ pub legacy_path_label: Option,
+ pub current_path_label: Option,
+ pub steps: Vec,
+ pub next_start_verified: bool,
+ pub route_smoke_confirmed: bool,
+ pub can_cutover: bool,
+ pub can_confirm_route_smoke: bool,
+ pub can_cleanup: bool,
+ pub disabled_code: Option,
+ pub disabled_message: Option,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ComponentCutoverRequestDto {
+ pub component_id: ManagedPackageComponentDto,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ConfirmComponentRouteSmokeInputDto {
+ pub component_id: ManagedPackageComponentDto,
+ pub confirmed: bool,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ComponentCutoverResponseDto {
+ pub status: ComponentCutoverStatusDto,
+ pub changed: bool,
+ pub reboot_required: bool,
+}
+
+impl TryFrom<&ComponentUpdateStatus> for ComponentPackageStatusDto {
+ type Error = ();
+
+ fn try_from(status: &ComponentUpdateStatus) -> Result {
+ let component_id = match status.component_id {
+ CatalogComponentId::Proxifyre => ManagedPackageComponentDto::Proxifyre,
+ CatalogComponentId::SingBox => ManagedPackageComponentDto::SingBox,
+ CatalogComponentId::WindowsPacketFilter
+ | CatalogComponentId::VcRuntime
+ | CatalogComponentId::Winsw => return Err(()),
+ };
+ Ok(Self {
+ component_id,
+ installed_version: status.installed_version.clone(),
+ bundled_version: status.bundled_version.clone(),
+ available_offline_version: status.available_offline_version.clone(),
+ latest_known_version: status.latest_known_version.clone(),
+ last_checked_at: status.last_checked_at_unix,
+ freshness: status.freshness.into(),
+ update_state: status.update_state.into(),
+ install_source: status.install_source.into(),
+ offline_package_source: status.offline_package_source.into(),
+ can_install_offline: status.can_install_offline,
+ offline_unavailable_reason: status.offline_unavailable_reason.clone(),
+ can_download: status.can_download,
+ })
+ }
+}
+
+impl From for ComponentUpdateFreshnessDto {
+ fn from(value: UpdateFreshness) -> Self {
+ match value {
+ UpdateFreshness::NeverChecked => Self::NeverChecked,
+ UpdateFreshness::Fresh => Self::Fresh,
+ UpdateFreshness::Stale => Self::Stale,
+ }
+ }
+}
+
+impl From for ComponentUpdateStateDto {
+ fn from(value: ComponentUpdateState) -> Self {
+ match value {
+ ComponentUpdateState::Current => Self::Current,
+ ComponentUpdateState::UpdateAvailable => Self::UpdateAvailable,
+ ComponentUpdateState::CheckStale => Self::CheckStale,
+ ComponentUpdateState::UnknownOffline => Self::UnknownOffline,
+ ComponentUpdateState::Unsupported => Self::Unsupported,
+ }
+ }
+}
+
+impl From for ComponentInstallSourceDto {
+ fn from(value: ComponentInstallSource) -> Self {
+ match value {
+ ComponentInstallSource::Bundled => Self::Bundled,
+ ComponentInstallSource::Cache => Self::Cache,
+ ComponentInstallSource::External => Self::External,
+ ComponentInstallSource::None => Self::None,
+ }
+ }
+}
+
+impl From for ComponentPackageSourceDto {
+ fn from(value: PackageSource) -> Self {
+ match value {
+ PackageSource::Bundled => Self::Bundled,
+ PackageSource::Cache => Self::Cache,
+ }
+ }
+}
+
+impl From for ComponentUpdateTrustDto {
+ fn from(value: UpdateCheckTrust) -> Self {
+ match value {
+ UpdateCheckTrust::Trusted => Self::Trusted,
+ UpdateCheckTrust::MissingIndependentDigest => Self::MissingIndependentDigest,
+ UpdateCheckTrust::MalformedIndependentDigest => Self::MalformedIndependentDigest,
+ UpdateCheckTrust::Unsupported => Self::Unsupported,
+ }
+ }
+}
+
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ActivityEntryDto {
diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs
index 798f7f4..97de39b 100644
--- a/src-tauri/src/commands.rs
+++ b/src-tauri/src/commands.rs
@@ -1,32 +1,47 @@
use crate::adapters::proxifyre::ProxiFyreAdapter;
use crate::adapters::singbox::{SingBoxAdapter, SingBoxCommandChecker};
pub use crate::admin::admin_status;
-use crate::admin::launch_app_as_admin;
use crate::apply_flow::{self, ApplyConfigurationInput, ApplyConfigurationResult, ApplyFlowError};
-use crate::component_detection::{detect_proxyfier_install, detect_singbox_install};
-use crate::singbox_service::{build_singbox_setup_status_with_install_root, SingBoxServiceAction};
+use crate::component_cutover::{
+ ComponentCutoverObservation, CutoverDisplayState, CutoverPhase, LegacyServiceState,
+};
+use crate::component_detection::{
+ detect_proxyfier_install, detect_singbox_install, inventory_proxyfier, inventory_singbox,
+};
+use crate::component_inventory::{
+ authorize_component_action, component_inventory_fingerprint_for_cutover, CandidateRole,
+ ComponentClassification, ComponentInventory, InventoryAction, InventoryIssue,
+};
+use crate::component_packages::{
+ ComponentInstallSource, ComponentPackageService, ComponentPackagesError,
+ InstalledComponentSnapshot, NativePackageSignatureVerifier, ReqwestUpdateTransport,
+};
+use crate::privileged_jobs::{
+ launch_privileged_job, read_install_receipt, CanonicalComponentRoot, EpochClock,
+ InstalledPackageSource, ManagedComponent, PrivilegedAction, PrivilegedJobLaunchState,
+ PrivilegedJobResult, PrivilegedJobStatus, PrivilegedJobStore, PrivilegedJobsError,
+ PrivilegedResultCode, PrivilegedRunnerFailure, ShellExecuteElevatedJobLauncher,
+ SystemEpochClock,
+};
+use crate::privileged_runtime::{installed_cutover_external_status, LocalPrivilegedPlanResolver};
+use crate::singbox_service::build_singbox_setup_status_with_install_root;
use crate::storage::{default_config_root, JsonStorage};
+#[cfg(debug_assertions)]
+use std::path::Path;
use std::path::PathBuf;
+use uuid::Uuid;
pub use crate::clock::{Clock, SystemClock};
pub use crate::command_dto::*;
pub use crate::component_status::resolve_component_statuses;
pub use crate::configuration_use_case::{
- build_status, read_activity, read_components, read_profiles, read_saved_state,
- read_saved_state_with_proxifyre_config, read_startup_snapshot, read_targets, resolve_preview,
+ build_status, ensure_proxifyre_generated_config_ready, read_activity, read_live_components,
+ read_profiles, read_saved_state, read_startup_snapshot, read_targets, resolve_preview,
save_profile_to_storage, save_target_to_storage,
};
-pub use crate::proxifyre_runtime::wrap_elevated_package_script;
use crate::proxifyre_runtime::{
- build_proxifyre_setup_status_for_install_dir, configure_proxifyre_firewall,
- control_proxifyre_service, install_proxifyre_component, proxifyre_install_dir_for_app,
- read_proxifyre_setup_progress, singbox_install_dir_for_app, uninstall_proxifyre_component,
- ServiceControlAction,
-};
-pub use crate::proxifyre_scripts::{
- configure_proxifyre_firewall_script, install_proxifyre_script,
- install_proxifyre_script_for_target, install_proxifyre_script_with_bundle,
- uninstall_proxifyre_script,
+ build_proxifyre_setup_status_for_install_dir, proxifyre_install_dir_for_app,
+ singbox_install_dir_for_app,
};
pub use crate::proxy_apply::{
apply_profiles_with_services, apply_profiles_with_services_and_detection,
@@ -37,10 +52,7 @@ pub use crate::proxy_probe::{
ping_proxy_target_endpoint, ping_proxy_target_endpoint_with_probes, ProxyProbeEndpoint,
};
pub use crate::singbox_config::generate_singbox_config_with_services;
-pub use crate::singbox_runtime::singbox_installer_runner_script;
-use crate::singbox_runtime::{
- control_singbox_service, install_singbox_component, uninstall_singbox_component,
-};
+use crate::singbox_runtime::run_singbox_config_check_entrypoint;
pub use crate::singbox_subscription::{
fetch_singbox_subscription_with_fetcher, forget_singbox_subscription_in_storage,
ping_all_singbox_servers_in_storage, ping_singbox_server_in_storage, read_singbox_status,
@@ -51,16 +63,24 @@ pub use crate::singbox_subscription::{
#[derive(Debug, Clone)]
pub struct CommandState {
root: PathBuf,
+ startup_session_id: String,
}
impl CommandState {
pub fn new(root: impl Into) -> Self {
- Self { root: root.into() }
+ Self {
+ root: root.into(),
+ startup_session_id: Uuid::new_v4().hyphenated().to_string(),
+ }
}
pub fn storage(&self) -> JsonStorage {
JsonStorage::new(self.root.clone())
}
+
+ pub fn startup_session_id(&self) -> &str {
+ &self.startup_session_id
+ }
}
impl Default for CommandState {
@@ -70,10 +90,11 @@ impl Default for CommandState {
}
#[tauri::command]
-pub fn restart_as_admin(app: tauri::AppHandle) -> Result<(), CommandError> {
- launch_app_as_admin()?;
- app.exit(0);
- Ok(())
+pub fn restart_as_admin() -> Result<(), CommandError> {
+ Err(CommandError::new(
+ "whole_app_elevation_disabled",
+ "Перезапуск всего ProxyWarden от имени администратора отключен. Права запрашиваются отдельно для выбранного системного действия.",
+ ))
}
#[tauri::command]
@@ -81,26 +102,31 @@ pub async fn get_startup_snapshot(
state: tauri::State<'_, CommandState>,
) -> Result {
let storage = state.storage();
- tauri::async_runtime::spawn_blocking(move || read_startup_snapshot(&storage))
- .await
- .map_err(background_task_error)?
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ read_startup_snapshot(&storage, &startup_session_id)
+ })
+ .await
+ .map_err(background_task_error)?
}
#[tauri::command]
-pub fn get_saved_state(
+pub async fn get_saved_state(
state: tauri::State<'_, CommandState>,
) -> Result {
- read_saved_state(&state.storage())
+ let storage = state.storage();
+ tauri::async_runtime::spawn_blocking(move || read_saved_state(&storage))
+ .await
+ .map_err(background_task_error)?
}
#[tauri::command]
pub async fn get_components(
- state: tauri::State<'_, CommandState>,
+ _state: tauri::State<'_, CommandState>,
) -> Result, CommandError> {
- let storage = state.storage();
- tauri::async_runtime::spawn_blocking(move || read_components(&storage))
+ tauri::async_runtime::spawn_blocking(read_live_components)
.await
- .map_err(background_task_error)?
+ .map_err(background_task_error)
}
#[tauri::command]
@@ -115,16 +141,6 @@ pub async fn get_proxifyre_setup_status(
.map_err(background_task_error)
}
-#[tauri::command]
-pub async fn get_proxifyre_setup_progress(
- state: tauri::State<'_, CommandState>,
-) -> Result {
- let storage = state.storage();
- tauri::async_runtime::spawn_blocking(move || read_proxifyre_setup_progress(&storage))
- .await
- .map_err(background_task_error)?
-}
-
#[tauri::command]
pub async fn get_singbox_status(
state: tauri::State<'_, CommandState>,
@@ -150,39 +166,47 @@ pub async fn get_singbox_setup_status(
.map_err(background_task_error)
}
-#[tauri::command]
-pub fn save_singbox_subscription(
- state: tauri::State<'_, CommandState>,
- input: SaveSingBoxSubscriptionInputDto,
-) -> Result {
- save_singbox_subscription_to_storage(&state.storage(), input, &SystemClock)
-}
-
#[tauri::command]
pub async fn fetch_singbox_subscription(
state: tauri::State<'_, CommandState>,
+ subscription_url: Option,
) -> Result {
let storage = state.storage();
tauri::async_runtime::spawn_blocking(move || {
- fetch_singbox_subscription_with_fetcher(&storage, &SystemSubscriptionFetcher, &SystemClock)
+ crate::singbox_subscription::fetch_singbox_subscription_candidate(
+ &storage,
+ subscription_url.as_deref(),
+ &SystemSubscriptionFetcher,
+ &SystemClock,
+ )
})
.await
.map_err(background_task_error)?
}
#[tauri::command]
-pub fn forget_singbox_subscription(
+pub async fn forget_singbox_subscription(
state: tauri::State<'_, CommandState>,
) -> Result {
- forget_singbox_subscription_in_storage(&state.storage(), &SystemClock)
+ let storage = state.storage();
+ tauri::async_runtime::spawn_blocking(move || {
+ forget_singbox_subscription_in_storage(&storage, &SystemClock)
+ })
+ .await
+ .map_err(background_task_error)?
}
#[tauri::command]
-pub fn select_singbox_server(
+pub async fn select_singbox_server(
state: tauri::State<'_, CommandState>,
input: SelectSingBoxServerInputDto,
) -> Result {
- select_singbox_server_in_storage(&state.storage(), input, &SystemClock)
+ let storage = state.storage();
+ tauri::async_runtime::spawn_blocking(move || {
+ select_singbox_server_in_storage(&storage, input, &SystemClock)
+ })
+ .await
+ .map_err(background_task_error)?
}
#[tauri::command]
@@ -221,17 +245,16 @@ pub async fn generate_singbox_config(
) -> Result {
let storage = state.storage();
tauri::async_runtime::spawn_blocking(move || {
- let detected = detect_singbox_install();
- let binary_path = detected
- .as_ref()
- .map(|detected| detected.executable_path.as_path());
- generate_singbox_config_with_services(
- &storage,
- &SingBoxAdapter::default(),
- &SingBoxCommandChecker,
- &SystemClock,
- binary_path,
- )
+ let inventory = inventory_singbox();
+ run_singbox_config_check_entrypoint(&inventory, |binary_path| {
+ generate_singbox_config_with_services(
+ &storage,
+ &SingBoxAdapter::default(),
+ &SingBoxCommandChecker,
+ &SystemClock,
+ binary_path,
+ )
+ })
})
.await
.map_err(background_task_error)?
@@ -266,44 +289,105 @@ pub async fn apply_configuration(
}
#[tauri::command]
-pub async fn start_proxifyre_service() -> Result {
- tauri::async_runtime::spawn_blocking(|| control_proxifyre_service(ServiceControlAction::Start))
- .await
- .map_err(background_task_error)?
+pub async fn start_proxifyre_service(
+ state: tauri::State<'_, CommandState>,
+) -> Result {
+ let storage = state.storage();
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ let inventory = inventory_proxyfier();
+ lifecycle_route(&inventory, InventoryAction::Start)?;
+ ensure_proxifyre_generated_config_ready(&storage)?;
+ run_privileged_and_refresh(
+ &storage,
+ PrivilegedAction::StartProxifyre,
+ crate::models::ComponentId::Proxyfier,
+ &startup_session_id,
+ )
+ })
+ .await
+ .map_err(background_task_error)?
}
#[tauri::command]
-pub async fn stop_proxifyre_service() -> Result {
- tauri::async_runtime::spawn_blocking(|| control_proxifyre_service(ServiceControlAction::Stop))
- .await
- .map_err(background_task_error)?
+pub async fn stop_proxifyre_service(
+ state: tauri::State<'_, CommandState>,
+) -> Result {
+ let storage = state.storage();
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ let inventory = inventory_proxyfier();
+ lifecycle_route(&inventory, InventoryAction::Stop)?;
+ run_privileged_and_refresh(
+ &storage,
+ PrivilegedAction::StopProxifyre,
+ crate::models::ComponentId::Proxyfier,
+ &startup_session_id,
+ )
+ })
+ .await
+ .map_err(background_task_error)?
}
#[tauri::command]
pub async fn install_proxifyre(
- app: tauri::AppHandle,
state: tauri::State<'_, CommandState>,
-) -> Result {
+) -> Result {
let storage = state.storage();
- tauri::async_runtime::spawn_blocking(move || install_proxifyre_component(&storage, &app))
- .await
- .map_err(background_task_error)?
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ let inventory = inventory_proxyfier();
+ lifecycle_route(&inventory, InventoryAction::Install)?;
+ run_privileged_lifecycle_and_refresh(
+ &storage,
+ PrivilegedAction::InstallProxifyre,
+ crate::models::ComponentId::Proxyfier,
+ &startup_session_id,
+ )
+ })
+ .await
+ .map_err(background_task_error)?
}
#[tauri::command]
-pub async fn configure_proxifyre_firewall_rules(app: tauri::AppHandle) -> Result<(), CommandError> {
- tauri::async_runtime::spawn_blocking(move || configure_proxifyre_firewall(&app))
- .await
- .map_err(background_task_error)?
+pub async fn configure_proxifyre_firewall_rules(
+ state: tauri::State<'_, CommandState>,
+) -> Result<(), CommandError> {
+ let storage = state.storage();
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ let inventory = inventory_proxyfier();
+ lifecycle_route(&inventory, InventoryAction::ConfigureFirewall)?;
+ run_privileged_and_refresh(
+ &storage,
+ PrivilegedAction::ConfigureProxifyreFirewall,
+ crate::models::ComponentId::Proxyfier,
+ &startup_session_id,
+ )?;
+ Ok(())
+ })
+ .await
+ .map_err(background_task_error)?
}
#[tauri::command]
pub async fn uninstall_proxifyre(
- app: tauri::AppHandle,
-) -> Result {
- tauri::async_runtime::spawn_blocking(move || uninstall_proxifyre_component(&app))
- .await
- .map_err(background_task_error)?
+ state: tauri::State<'_, CommandState>,
+) -> Result {
+ let storage = state.storage();
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ let inventory = inventory_proxyfier();
+ lifecycle_route(&inventory, InventoryAction::Uninstall)?;
+ run_privileged_lifecycle_and_refresh(
+ &storage,
+ PrivilegedAction::UninstallProxifyre,
+ crate::models::ComponentId::Proxyfier,
+ &startup_session_id,
+ )
+ })
+ .await
+ .map_err(background_task_error)?
}
#[tauri::command]
@@ -311,29 +395,47 @@ pub async fn start_singbox_service(
state: tauri::State<'_, CommandState>,
) -> Result {
let storage = state.storage();
+ let startup_session_id = state.startup_session_id().to_string();
tauri::async_runtime::spawn_blocking(move || {
- let detected = detect_singbox_install();
- let binary_path = detected
- .as_ref()
- .map(|detected| detected.executable_path.as_path());
- let generated = generate_singbox_config_with_services(
+ let inventory = inventory_singbox();
+ lifecycle_route(&inventory, InventoryAction::Start)?;
+ if inventory.classification() == ComponentClassification::ManagedCurrent {
+ run_singbox_config_check_entrypoint(&inventory, |binary_path| {
+ generate_singbox_config_with_services(
+ &storage,
+ &SingBoxAdapter::default(),
+ &SingBoxCommandChecker,
+ &SystemClock,
+ binary_path,
+ )
+ })?;
+ }
+ run_privileged_and_refresh(
&storage,
- &SingBoxAdapter::default(),
- &SingBoxCommandChecker,
- &SystemClock,
- binary_path,
- )?;
- let generated_path = PathBuf::from(generated.generated_config_path);
- control_singbox_service(SingBoxServiceAction::Start, Some(generated_path.as_path()))
+ PrivilegedAction::StartSingBox,
+ crate::models::ComponentId::Singbox,
+ &startup_session_id,
+ )
})
.await
.map_err(background_task_error)?
}
#[tauri::command]
-pub async fn stop_singbox_service() -> Result {
- tauri::async_runtime::spawn_blocking(|| {
- control_singbox_service(SingBoxServiceAction::Stop, None)
+pub async fn stop_singbox_service(
+ state: tauri::State<'_, CommandState>,
+) -> Result {
+ let storage = state.storage();
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ let inventory = inventory_singbox();
+ lifecycle_route(&inventory, InventoryAction::Stop)?;
+ run_privileged_and_refresh(
+ &storage,
+ PrivilegedAction::StopSingBox,
+ crate::models::ComponentId::Singbox,
+ &startup_session_id,
+ )
})
.await
.map_err(background_task_error)?
@@ -341,21 +443,1079 @@ pub async fn stop_singbox_service() -> Result
#[tauri::command]
pub async fn install_singbox(
- app: tauri::AppHandle,
state: tauri::State<'_, CommandState>,
-) -> Result {
+) -> Result {
let storage = state.storage();
- let install_dir = singbox_install_dir_for_app(&app)?;
- tauri::async_runtime::spawn_blocking(move || install_singbox_component(&storage, &install_dir))
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ let inventory = inventory_singbox();
+ lifecycle_route(&inventory, InventoryAction::Install)?;
+ run_privileged_lifecycle_and_refresh(
+ &storage,
+ PrivilegedAction::InstallSingBox,
+ crate::models::ComponentId::Singbox,
+ &startup_session_id,
+ )
+ })
+ .await
+ .map_err(background_task_error)?
+}
+
+#[tauri::command]
+pub async fn uninstall_singbox(
+ state: tauri::State<'_, CommandState>,
+) -> Result {
+ let storage = state.storage();
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ let inventory = inventory_singbox();
+ lifecycle_route(&inventory, InventoryAction::Uninstall)?;
+ run_privileged_lifecycle_and_refresh(
+ &storage,
+ PrivilegedAction::UninstallSingBox,
+ crate::models::ComponentId::Singbox,
+ &startup_session_id,
+ )
+ })
+ .await
+ .map_err(background_task_error)?
+}
+
+#[tauri::command]
+pub async fn get_component_package_statuses(
+ state: tauri::State<'_, CommandState>,
+) -> Result, CommandError> {
+ let storage = state.storage();
+ tauri::async_runtime::spawn_blocking(move || component_package_statuses(&storage))
.await
.map_err(background_task_error)?
}
#[tauri::command]
-pub async fn uninstall_singbox() -> Result {
- tauri::async_runtime::spawn_blocking(uninstall_singbox_component)
- .await
- .map_err(background_task_error)?
+pub async fn check_component_update(
+ state: tauri::State<'_, CommandState>,
+ input: ComponentPackageRequestDto,
+) -> Result {
+ let storage = state.storage();
+ tauri::async_runtime::spawn_blocking(move || {
+ let service = open_component_package_service(&storage)?;
+ let transport = ReqwestUpdateTransport::new().map_err(|_| {
+ CommandError::new(
+ "component_update_check_failed",
+ "Не удалось подготовить безопасную проверку обновлений.",
+ )
+ })?;
+ let now = SystemEpochClock.now_epoch_seconds();
+ let check = service
+ .check_for_update(input.component_id.catalog_id(), now, &transport)
+ .map_err(component_packages_error)?;
+ let status = component_package_status(&service, input.component_id, now)?;
+ Ok(ComponentUpdateCheckResponseDto {
+ trust: check.trust.into(),
+ update_available: check.update_available,
+ status,
+ })
+ })
+ .await
+ .map_err(background_task_error)?
+}
+
+#[tauri::command]
+pub async fn download_component_update(
+ state: tauri::State<'_, CommandState>,
+ input: ComponentPackageRequestDto,
+) -> Result {
+ let storage = state.storage();
+ tauri::async_runtime::spawn_blocking(move || {
+ let service = open_component_package_service(&storage)?;
+ let transport = ReqwestUpdateTransport::new().map_err(|_| {
+ CommandError::new(
+ "component_update_download_failed",
+ "Не удалось подготовить безопасное скачивание обновления.",
+ )
+ })?;
+ let selected = service
+ .download_checked_update(
+ input.component_id.catalog_id(),
+ &transport,
+ &NativePackageSignatureVerifier,
+ )
+ .map_err(component_packages_error)?;
+ let status = component_package_status(
+ &service,
+ input.component_id,
+ SystemEpochClock.now_epoch_seconds(),
+ )?;
+ Ok(ComponentUpdateDownloadResponseDto {
+ downloaded_version: selected.version,
+ source: selected.source.into(),
+ status,
+ })
+ })
+ .await
+ .map_err(background_task_error)?
+}
+
+#[tauri::command]
+pub async fn update_component(
+ state: tauri::State<'_, CommandState>,
+ input: ComponentPackageRequestDto,
+) -> Result {
+ let storage = state.storage();
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ let inventory = inventory_for_package_component(input.component_id);
+ lifecycle_route(&inventory, InventoryAction::Update)?;
+ let action = match input.component_id {
+ ManagedPackageComponentDto::Proxifyre => PrivilegedAction::UpdateProxifyre,
+ ManagedPackageComponentDto::SingBox => PrivilegedAction::UpdateSingBox,
+ };
+ let outcome = run_privileged_action(action, &startup_session_id)?;
+ let component = refresh_component(&storage, input.component_id.model_id())?;
+ let service = open_component_package_service(&storage)?;
+ let package = component_package_status(
+ &service,
+ input.component_id,
+ SystemEpochClock.now_epoch_seconds(),
+ )?;
+ Ok(ComponentUpdateResponseDto {
+ component,
+ package,
+ changed: outcome.changed,
+ reboot_required: outcome.reboot_required,
+ })
+ })
+ .await
+ .map_err(background_task_error)?
+}
+
+#[tauri::command]
+pub async fn get_component_cutover_statuses(
+ state: tauri::State<'_, CommandState>,
+) -> Result, CommandError> {
+ let storage = state.storage();
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ component_cutover_statuses(&storage, &startup_session_id)
+ })
+ .await
+ .map_err(background_task_error)?
+}
+
+#[tauri::command]
+pub async fn cutover_component(
+ state: tauri::State<'_, CommandState>,
+ input: ComponentCutoverRequestDto,
+) -> Result {
+ require_proxifyre_cutover_component(input.component_id)?;
+ let storage = state.storage();
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ let outcome =
+ run_privileged_action(PrivilegedAction::CutoverProxifyre, &startup_session_id)?;
+ Ok(ComponentCutoverResponseDto {
+ status: component_cutover_status(
+ &storage,
+ ManagedPackageComponentDto::Proxifyre,
+ &startup_session_id,
+ )?,
+ changed: outcome.changed,
+ reboot_required: outcome.reboot_required,
+ })
+ })
+ .await
+ .map_err(background_task_error)?
+}
+
+#[tauri::command]
+pub async fn confirm_component_route_smoke(
+ state: tauri::State<'_, CommandState>,
+ input: ConfirmComponentRouteSmokeInputDto,
+) -> Result {
+ require_proxifyre_cutover_component(input.component_id)?;
+ if !input.confirmed {
+ return Err(CommandError::new(
+ "component_route_confirmation_required",
+ "Очистка старой установки требует явного подтверждения проверенного маршрута.",
+ ));
+ }
+ let storage = state.storage();
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ confirm_route_smoke_evidence(&storage, &startup_session_id)?;
+ component_cutover_status(
+ &storage,
+ ManagedPackageComponentDto::Proxifyre,
+ &startup_session_id,
+ )
+ })
+ .await
+ .map_err(background_task_error)?
+}
+
+#[tauri::command]
+pub async fn cleanup_component_quarantine(
+ state: tauri::State<'_, CommandState>,
+ input: ComponentCutoverRequestDto,
+) -> Result {
+ require_proxifyre_cutover_component(input.component_id)?;
+ let storage = state.storage();
+ let startup_session_id = state.startup_session_id().to_string();
+ tauri::async_runtime::spawn_blocking(move || {
+ let outcome = run_privileged_action(
+ PrivilegedAction::CleanupProxifyreQuarantine,
+ &startup_session_id,
+ )?;
+ Ok(ComponentCutoverResponseDto {
+ status: component_cutover_status(
+ &storage,
+ ManagedPackageComponentDto::Proxifyre,
+ &startup_session_id,
+ )?,
+ changed: outcome.changed,
+ reboot_required: outcome.reboot_required,
+ })
+ })
+ .await
+ .map_err(background_task_error)?
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+enum LifecycleRoute {
+ Privileged,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+struct PrivilegedCommandOutcome {
+ changed: bool,
+ reboot_required: bool,
+}
+
+fn lifecycle_route(
+ inventory: &ComponentInventory,
+ action: InventoryAction,
+) -> Result {
+ authorize_component_action(inventory, action).map_err(|issue| inventory_issue_error(&issue))?;
+ match inventory.classification() {
+ ComponentClassification::ManagedCurrent | ComponentClassification::Missing => {
+ Ok(LifecycleRoute::Privileged)
+ }
+ ComponentClassification::ManagedLegacy => Err(CommandError::new(
+ "legacy_cutover_required",
+ "Старая управляемая установка требует отдельного явного переноса.",
+ )),
+ ComponentClassification::Foreign | ComponentClassification::Incomplete => inventory
+ .selected_candidate()
+ .and_then(|candidate| candidate.issues.first())
+ .map(inventory_issue_error)
+ .map_or_else(
+ || {
+ Err(CommandError::new(
+ "component_ownership_mismatch",
+ "Управление компонентом заблокировано: его принадлежность ProxyWarden не подтверждена.",
+ ))
+ },
+ Err,
+ ),
+ }
+}
+
+fn inventory_issue_error(issue: &InventoryIssue) -> CommandError {
+ CommandError::new(issue.code.clone(), issue.message.clone())
+}
+
+fn run_privileged_and_refresh(
+ storage: &JsonStorage,
+ action: PrivilegedAction,
+ component_id: crate::models::ComponentId,
+ startup_session_id: &str,
+) -> Result {
+ run_privileged_action(action, startup_session_id)?;
+ refresh_component(storage, component_id)
+}
+
+fn run_privileged_lifecycle_and_refresh(
+ storage: &JsonStorage,
+ action: PrivilegedAction,
+ component_id: crate::models::ComponentId,
+ startup_session_id: &str,
+) -> Result {
+ let outcome = run_privileged_action(action, startup_session_id)?;
+ Ok(ComponentLifecycleResponseDto {
+ component: refresh_component(storage, component_id)?,
+ changed: outcome.changed,
+ reboot_required: outcome.reboot_required,
+ })
+}
+
+fn run_privileged_action(
+ action: PrivilegedAction,
+ startup_session_id: &str,
+) -> Result {
+ let store = PrivilegedJobStore::production().map_err(privileged_jobs_error)?;
+ let resolver = LocalPrivilegedPlanResolver::production(startup_session_id)
+ .map_err(privileged_runner_error)?;
+ let executable = std::env::current_exe().map_err(|_| {
+ CommandError::new(
+ "privileged_launch_failed",
+ "Не удалось определить исполняемый файл ProxyWarden для системного действия.",
+ )
+ })?;
+ let launched = launch_privileged_job(
+ &store,
+ action,
+ &executable,
+ &SystemEpochClock,
+ &resolver,
+ &ShellExecuteElevatedJobLauncher,
+ )
+ .map_err(privileged_jobs_error)?;
+
+ match launched.state {
+ PrivilegedJobLaunchState::Canceled => Err(CommandError::new(
+ "privileged_uac_cancelled",
+ "Запрос прав администратора отменен пользователем.",
+ )),
+ PrivilegedJobLaunchState::Failed => Err(CommandError::new(
+ "privileged_launch_failed",
+ "Не удалось запустить подтвержденное системное действие.",
+ )),
+ PrivilegedJobLaunchState::Indeterminate => Err(CommandError::new(
+ "privileged_result_unknown",
+ "Системное действие запущено, но его итог пока нельзя подтвердить.",
+ )),
+ PrivilegedJobLaunchState::Completed { .. } => {
+ let result = store.read_result(&launched.request).map_err(|_| {
+ CommandError::new(
+ "privileged_result_unknown",
+ "Системное действие завершилось без проверяемого итогового результата.",
+ )
+ })?;
+ privileged_terminal_result(&result)
+ }
+ }
+}
+
+fn privileged_terminal_result(
+ result: &PrivilegedJobResult,
+) -> Result {
+ match (result.status, result.code) {
+ (
+ PrivilegedJobStatus::Succeeded,
+ PrivilegedResultCode::Completed
+ | PrivilegedResultCode::NoChange
+ | PrivilegedResultCode::CutoverAwaitingNextStart
+ | PrivilegedResultCode::CutoverQuarantinePending
+ | PrivilegedResultCode::CutoverRolledBack
+ | PrivilegedResultCode::CutoverCleanupPending
+ | PrivilegedResultCode::CutoverComplete,
+ ) => Ok(PrivilegedCommandOutcome {
+ changed: result.changed,
+ reboot_required: result.reboot_required,
+ }),
+ (PrivilegedJobStatus::Failed, code) => Err(privileged_result_error(code)),
+ (PrivilegedJobStatus::Running, _) => Err(CommandError::new(
+ "privileged_result_running",
+ "Системное действие еще выполняется; успешный итог пока не подтвержден.",
+ )),
+ _ => Err(CommandError::new(
+ "privileged_result_unknown",
+ "Системное действие вернуло неподтвержденный итог.",
+ )),
+ }
+}
+
+fn privileged_result_error(code: PrivilegedResultCode) -> CommandError {
+ match code {
+ PrivilegedResultCode::PreconditionFailed => CommandError::new(
+ "component_precondition_failed",
+ "Состояние компонента изменилось или не позволяет выполнить действие.",
+ ),
+ PrivilegedResultCode::OwnershipMismatch => CommandError::new(
+ "component_ownership_mismatch",
+ "Принадлежность компонента ProxyWarden не подтверждена; действие заблокировано.",
+ ),
+ PrivilegedResultCode::PackageVerificationFailed => CommandError::new(
+ "component_package_verification_failed",
+ "Пакет компонента не прошел проверку подлинности и целостности.",
+ ),
+ PrivilegedResultCode::ServiceCollision => CommandError::new(
+ "component_service_collision",
+ "Служба с таким именем уже принадлежит другому компоненту.",
+ ),
+ PrivilegedResultCode::CleanupPending => CommandError::new(
+ "component_cleanup_pending",
+ "Основное действие выполнено, но безопасная очистка будет повторена позже.",
+ ),
+ PrivilegedResultCode::CutoverRecoveryRequired => CommandError::new(
+ "component_cutover_recovery_required",
+ "Перенос компонента требует безопасного восстановления; другие действия временно заблокированы.",
+ ),
+ PrivilegedResultCode::CutoverStateConflict => CommandError::new(
+ "component_cutover_state_conflict",
+ "Состояние переноса изменилось; перечитайте статус и повторите подходящее действие.",
+ ),
+ PrivilegedResultCode::CutoverIdentityRejected => CommandError::new(
+ "component_cutover_identity_rejected",
+ "Старая установка не совпала с доказанной конфигурацией для автоматического переноса.",
+ ),
+ PrivilegedResultCode::RunnerUnavailable
+ | PrivilegedResultCode::OperationFailed
+ | PrivilegedResultCode::Running
+ | PrivilegedResultCode::Completed
+ | PrivilegedResultCode::NoChange
+ | PrivilegedResultCode::CutoverAwaitingNextStart
+ | PrivilegedResultCode::CutoverQuarantinePending
+ | PrivilegedResultCode::CutoverRolledBack
+ | PrivilegedResultCode::CutoverCleanupPending
+ | PrivilegedResultCode::CutoverComplete => CommandError::new(
+ "component_operation_failed",
+ "Системное действие с компонентом не завершилось успешно.",
+ ),
+ }
+}
+
+fn privileged_runner_error(error: PrivilegedRunnerFailure) -> CommandError {
+ let code = match error {
+ PrivilegedRunnerFailure::PreconditionFailed => PrivilegedResultCode::PreconditionFailed,
+ PrivilegedRunnerFailure::OwnershipMismatch => PrivilegedResultCode::OwnershipMismatch,
+ PrivilegedRunnerFailure::PackageVerificationFailed => {
+ PrivilegedResultCode::PackageVerificationFailed
+ }
+ PrivilegedRunnerFailure::ServiceCollision => PrivilegedResultCode::ServiceCollision,
+ PrivilegedRunnerFailure::CleanupPending => PrivilegedResultCode::CleanupPending,
+ PrivilegedRunnerFailure::CutoverRecoveryRequired => {
+ PrivilegedResultCode::CutoverRecoveryRequired
+ }
+ PrivilegedRunnerFailure::CutoverStateConflict => PrivilegedResultCode::CutoverStateConflict,
+ PrivilegedRunnerFailure::CutoverIdentityRejected => {
+ PrivilegedResultCode::CutoverIdentityRejected
+ }
+ PrivilegedRunnerFailure::RunnerUnavailable | PrivilegedRunnerFailure::OperationFailed => {
+ PrivilegedResultCode::OperationFailed
+ }
+ };
+ privileged_result_error(code)
+}
+
+fn privileged_jobs_error(error: PrivilegedJobsError) -> CommandError {
+ match error {
+ PrivilegedJobsError::PlanChanged
+ | PrivilegedJobsError::FutureDated
+ | PrivilegedJobsError::Expired => CommandError::new(
+ "component_precondition_failed",
+ "Состояние компонента изменилось до подтверждения действия; повторите попытку.",
+ ),
+ PrivilegedJobsError::LifecycleBusy => CommandError::new(
+ "component_operation_busy",
+ "Другое системное действие с компонентами еще выполняется.",
+ ),
+ PrivilegedJobsError::InvalidArguments
+ | PrivilegedJobsError::InvalidJobId
+ | PrivilegedJobsError::InvalidNonce
+ | PrivilegedJobsError::UnsupportedSchema
+ | PrivilegedJobsError::RequestMismatch
+ | PrivilegedJobsError::NotElevated
+ | PrivilegedJobsError::Replay
+ | PrivilegedJobsError::ResultAlreadyExists
+ | PrivilegedJobsError::RecordTooLarge
+ | PrivilegedJobsError::InvalidRecord
+ | PrivilegedJobsError::InvalidReceipt
+ | PrivilegedJobsError::Io(_) => CommandError::new(
+ "component_operation_failed",
+ "Не удалось безопасно подготовить системное действие с компонентом.",
+ ),
+ }
+}
+
+fn refresh_component(
+ _storage: &JsonStorage,
+ component_id: crate::models::ComponentId,
+) -> Result {
+ read_live_components()
+ .into_iter()
+ .find(|component| component.id == component_id)
+ .ok_or_else(|| {
+ CommandError::new(
+ "component_status_unavailable",
+ "Системное действие завершилось, но обновленный статус компонента не найден.",
+ )
+ })
+}
+
+fn component_cutover_statuses(
+ storage: &JsonStorage,
+ startup_session_id: &str,
+) -> Result, CommandError> {
+ [
+ ManagedPackageComponentDto::Proxifyre,
+ ManagedPackageComponentDto::SingBox,
+ ]
+ .into_iter()
+ .map(|component| component_cutover_status(storage, component, startup_session_id))
+ .collect()
+}
+
+fn component_cutover_status(
+ storage: &JsonStorage,
+ component: ManagedPackageComponentDto,
+ startup_session_id: &str,
+) -> Result {
+ let inventory = inventory_for_package_component(component);
+ let bundled_version = open_component_package_service(storage)
+ .ok()
+ .and_then(|service| {
+ component_package_status(&service, component, SystemEpochClock.now_epoch_seconds()).ok()
+ })
+ .map(|status| status.bundled_version);
+ let current_version = inventory
+ .candidates
+ .iter()
+ .find(|candidate| candidate.role == CandidateRole::Current)
+ .and_then(|candidate| candidate.binary_version.as_deref())
+ .and_then(safe_cutover_version);
+ let legacy_version = inventory
+ .candidates
+ .iter()
+ .find(|candidate| candidate.role == CandidateRole::Legacy)
+ .and_then(|candidate| candidate.binary_version.as_deref())
+ .and_then(safe_cutover_version);
+ let legacy_candidate = inventory
+ .candidates
+ .iter()
+ .find(|candidate| candidate.role == CandidateRole::Legacy);
+ let legacy_discovered = legacy_candidate.is_some();
+
+ if component == ManagedPackageComponentDto::Proxifyre {
+ let external_status = installed_cutover_external_status();
+ if external_status != Some(crate::component_cutover::CutoverExternalMutationStatus::Absent)
+ {
+ if let Ok(Some(observation)) = storage.read_component_cutover_observation() {
+ let terminal_retirement_pending = matches!(
+ observation.state,
+ CutoverDisplayState::Complete | CutoverDisplayState::RolledBack
+ );
+ return Ok(cutover_status_from_observation(
+ storage,
+ startup_session_id,
+ observation,
+ &inventory,
+ current_version,
+ terminal_retirement_pending,
+ true,
+ ));
+ }
+ if external_status.is_some() {
+ return Ok(ComponentCutoverStatusDto {
+ component_id: component,
+ state: ComponentCutoverStateDto::RecoveryRequired,
+ mode: ComponentCutoverModeDto::ServiceSwitch,
+ legacy_version,
+ current_version,
+ bundled_version,
+ original_service_state: legacy_candidate.and_then(|candidate| {
+ candidate.service.as_ref().and_then(|service| {
+ match service.status.trim().to_ascii_lowercase().as_str() {
+ "running" => Some(ComponentCutoverServiceStateDto::Running),
+ "stopped" => Some(ComponentCutoverServiceStateDto::Stopped),
+ _ => None,
+ }
+ })
+ }),
+ legacy_path_label: legacy_discovered
+ .then(|| "Старая установка компонента".to_string()),
+ current_path_label: Some("Управляемые компоненты ProxyWarden".to_string()),
+ steps: fixed_cutover_steps(component),
+ next_start_verified: false,
+ route_smoke_confirmed: false,
+ can_cutover: true,
+ can_confirm_route_smoke: false,
+ can_cleanup: false,
+ disabled_code: None,
+ disabled_message: None,
+ });
+ }
+ }
+ }
+
+ let exact_auto_proxifyre = component == ManagedPackageComponentDto::Proxifyre
+ && inventory.classification() == ComponentClassification::ManagedLegacy
+ && legacy_candidate.is_some_and(|candidate| {
+ candidate
+ .root
+ .as_os_str()
+ .to_string_lossy()
+ .trim_end_matches(['\\', '/'])
+ .eq_ignore_ascii_case(r"C:\Tools\ProxiFyre")
+ });
+ let (state, mode, can_cutover, disabled_code, disabled_message) = if exact_auto_proxifyre
+ && bundled_version.is_some()
+ {
+ (
+ ComponentCutoverStateDto::Ready,
+ ComponentCutoverModeDto::ServiceSwitch,
+ true,
+ None,
+ None,
+ )
+ } else if exact_auto_proxifyre {
+ (
+ ComponentCutoverStateDto::Blocked,
+ ComponentCutoverModeDto::ServiceSwitch,
+ false,
+ Some("component_package_unavailable".to_string()),
+ Some(
+ "Встроенный пакет ProxiFyre недоступен или не прошел локальную проверку."
+ .to_string(),
+ ),
+ )
+ } else if legacy_discovered {
+ (
+ ComponentCutoverStateDto::ManualMigrationRequired,
+ ComponentCutoverModeDto::ManualOnly,
+ false,
+ Some("manual_migration_required".to_string()),
+ Some(if component == ManagedPackageComponentDto::SingBox {
+ "Для старой установки sing-box нет доказанной неизменяемой версии; автоматический перенос отключен."
+ } else {
+ "Эта старая установка ProxiFyre не входит в доказанный автоматический сценарий переноса."
+ }
+ .to_string()),
+ )
+ } else if matches!(
+ inventory.classification(),
+ ComponentClassification::ManagedCurrent | ComponentClassification::Missing
+ ) {
+ (
+ ComponentCutoverStateDto::NotNeeded,
+ ComponentCutoverModeDto::ServiceSwitch,
+ false,
+ None,
+ None,
+ )
+ } else {
+ (
+ ComponentCutoverStateDto::Blocked,
+ ComponentCutoverModeDto::ManualOnly,
+ false,
+ Some("component_identity_unconfirmed".to_string()),
+ Some(
+ "Принадлежность найденной установки не подтверждена; автоматический перенос заблокирован."
+ .to_string(),
+ ),
+ )
+ };
+ Ok(ComponentCutoverStatusDto {
+ component_id: component,
+ state,
+ mode,
+ legacy_version,
+ current_version,
+ bundled_version,
+ original_service_state: legacy_candidate.and_then(|candidate| {
+ candidate.service.as_ref().and_then(|service| {
+ match service.status.trim().to_ascii_lowercase().as_str() {
+ "running" => Some(ComponentCutoverServiceStateDto::Running),
+ "stopped" => Some(ComponentCutoverServiceStateDto::Stopped),
+ _ => None,
+ }
+ })
+ }),
+ legacy_path_label: legacy_discovered.then(|| "Старая установка компонента".to_string()),
+ current_path_label: Some("Управляемые компоненты ProxyWarden".to_string()),
+ steps: fixed_cutover_steps(component),
+ next_start_verified: false,
+ route_smoke_confirmed: false,
+ can_cutover,
+ can_confirm_route_smoke: false,
+ can_cleanup: false,
+ disabled_code,
+ disabled_message,
+ })
+}
+
+fn cutover_status_from_observation(
+ storage: &JsonStorage,
+ startup_session_id: &str,
+ observation: ComponentCutoverObservation,
+ inventory: &ComponentInventory,
+ current_version: Option,
+ terminal_retirement_pending: bool,
+ recovery_probe_available: bool,
+) -> ComponentCutoverStatusDto {
+ let live_inventory_fingerprint = (inventory.classification()
+ == ComponentClassification::ManagedCurrent)
+ .then(|| component_inventory_fingerprint_for_cutover(inventory));
+ let evidence = storage
+ .read_component_cutover_user_evidence()
+ .ok()
+ .flatten()
+ .filter(|evidence| {
+ evidence.cutover_id == observation.cutover_id
+ && evidence.startup_session_id == startup_session_id
+ && live_inventory_fingerprint.as_deref()
+ == Some(evidence.current_inventory_fingerprint.as_str())
+ });
+ let accepts_user_evidence = matches!(
+ (observation.state, observation.phase),
+ (
+ CutoverDisplayState::AwaitingNextStart,
+ CutoverPhase::LegacyQuarantined
+ ) | (
+ CutoverDisplayState::AwaitingRouteSmoke,
+ CutoverPhase::NextStartVerified
+ )
+ );
+ let locally_confirmed = accepts_user_evidence
+ && evidence
+ .as_ref()
+ .is_some_and(|evidence| evidence.route_smoke_confirmed);
+ let mut state = if terminal_retirement_pending {
+ ComponentCutoverStateDto::RecoveryRequired
+ } else {
+ match observation.state {
+ CutoverDisplayState::InProgress => ComponentCutoverStateDto::InProgress,
+ CutoverDisplayState::AwaitingNextStart => ComponentCutoverStateDto::AwaitingNextStart,
+ CutoverDisplayState::AwaitingRouteSmoke => ComponentCutoverStateDto::AwaitingRouteSmoke,
+ CutoverDisplayState::CleanupReady => ComponentCutoverStateDto::CleanupReady,
+ CutoverDisplayState::CleanupPending => ComponentCutoverStateDto::CleanupPending,
+ CutoverDisplayState::Complete => ComponentCutoverStateDto::Complete,
+ CutoverDisplayState::RolledBack => ComponentCutoverStateDto::RolledBack,
+ CutoverDisplayState::RecoveryRequired => ComponentCutoverStateDto::RecoveryRequired,
+ }
+ };
+ if accepts_user_evidence && evidence.is_some() {
+ state = if locally_confirmed {
+ ComponentCutoverStateDto::CleanupReady
+ } else {
+ ComponentCutoverStateDto::AwaitingRouteSmoke
+ };
+ }
+ let can_cutover = recovery_probe_available
+ || terminal_retirement_pending
+ || matches!(
+ observation.state,
+ CutoverDisplayState::InProgress | CutoverDisplayState::RecoveryRequired
+ );
+ ComponentCutoverStatusDto {
+ component_id: ManagedPackageComponentDto::Proxifyre,
+ state,
+ mode: ComponentCutoverModeDto::ServiceSwitch,
+ legacy_version: safe_cutover_version(&observation.legacy_version),
+ current_version: current_version.and_then(|version| safe_cutover_version(&version)),
+ bundled_version: safe_cutover_version(&observation.bundled_version),
+ original_service_state: Some(match observation.original_service_state {
+ LegacyServiceState::Running => ComponentCutoverServiceStateDto::Running,
+ LegacyServiceState::Stopped => ComponentCutoverServiceStateDto::Stopped,
+ }),
+ legacy_path_label: Some("Старая установка ProxiFyre".to_string()),
+ current_path_label: Some("Управляемые компоненты ProxyWarden".to_string()),
+ steps: fixed_cutover_steps(ManagedPackageComponentDto::Proxifyre),
+ next_start_verified: observation.next_start_verified,
+ route_smoke_confirmed: observation.route_smoke_confirmed
+ || (accepts_user_evidence && locally_confirmed),
+ can_cutover,
+ can_confirm_route_smoke: accepts_user_evidence
+ && evidence
+ .as_ref()
+ .is_some_and(|evidence| !evidence.route_smoke_confirmed),
+ can_cleanup: (matches!(
+ observation.state,
+ CutoverDisplayState::CleanupReady | CutoverDisplayState::CleanupPending
+ ) && observation.phase == CutoverPhase::CleanupConfirmed
+ && observation.can_cleanup)
+ || (accepts_user_evidence && locally_confirmed),
+ disabled_code: observation
+ .disabled_code
+ .as_ref()
+ .map(|_| "component_cutover_recovery_required".to_string()),
+ disabled_message: observation.disabled_code.map(|_| {
+ "Перенос требует безопасного восстановления перед другими действиями.".to_string()
+ }),
+ }
+}
+
+fn confirm_route_smoke_evidence(
+ storage: &JsonStorage,
+ startup_session_id: &str,
+) -> Result<(), CommandError> {
+ let inventory = inventory_proxyfier();
+ confirm_route_smoke_evidence_with_inventory(
+ storage,
+ startup_session_id,
+ &inventory,
+ SystemEpochClock.now_epoch_seconds(),
+ )
+}
+
+fn confirm_route_smoke_evidence_with_inventory(
+ storage: &JsonStorage,
+ startup_session_id: &str,
+ inventory: &ComponentInventory,
+ now: u64,
+) -> Result<(), CommandError> {
+ let observation = storage
+ .read_component_cutover_observation()
+ .map_err(|_| cutover_state_error())?
+ .filter(|observation| {
+ observation.component == "proxifyre"
+ && matches!(
+ (observation.state, observation.phase),
+ (
+ CutoverDisplayState::AwaitingNextStart,
+ CutoverPhase::LegacyQuarantined
+ ) | (
+ CutoverDisplayState::AwaitingRouteSmoke,
+ CutoverPhase::NextStartVerified
+ )
+ )
+ })
+ .ok_or_else(cutover_state_error)?;
+ let mut evidence = storage
+ .read_component_cutover_user_evidence()
+ .map_err(|_| cutover_state_error())?
+ .filter(|evidence| {
+ evidence.cutover_id == observation.cutover_id
+ && evidence.startup_session_id == startup_session_id
+ })
+ .ok_or_else(|| {
+ CommandError::new(
+ "component_cutover_next_start_required",
+ "Сначала перезапустите ProxyWarden и проверьте маршрут на новой установке.",
+ )
+ })?;
+ if inventory.classification() != ComponentClassification::ManagedCurrent
+ || component_inventory_fingerprint_for_cutover(inventory)
+ != evidence.current_inventory_fingerprint
+ {
+ return Err(cutover_state_error());
+ }
+ evidence.route_smoke_confirmed = true;
+ evidence.confirmed_at_epoch_seconds = Some(now);
+ storage
+ .write_component_cutover_user_evidence(&evidence)
+ .map_err(|_| cutover_state_error())
+}
+
+fn fixed_cutover_steps(component: ManagedPackageComponentDto) -> Vec {
+ if component == ManagedPackageComponentDto::SingBox {
+ return Vec::new();
+ }
+ [
+ "Проверить точную старую установку и сохранить состояние службы",
+ "Подготовить встроенный runtime в управляемом каталоге",
+ "Переключить службу с сохранением состояния Running/Stopped",
+ "Проверить новую установку и переместить старую в карантин",
+ "После следующего запуска и проверки маршрута отдельно очистить карантин",
+ ]
+ .into_iter()
+ .map(str::to_string)
+ .collect()
+}
+
+fn safe_cutover_version(value: &str) -> Option {
+ let value = value.trim();
+ (!value.is_empty()
+ && value.len() <= 32
+ && value.split('.').all(|part| {
+ !part.is_empty() && part.len() <= 10 && part.bytes().all(|byte| byte.is_ascii_digit())
+ }))
+ .then(|| value.to_string())
+}
+
+fn require_proxifyre_cutover_component(
+ component: ManagedPackageComponentDto,
+) -> Result<(), CommandError> {
+ if component == ManagedPackageComponentDto::Proxifyre {
+ Ok(())
+ } else {
+ Err(CommandError::new(
+ "manual_migration_required",
+ "Автоматический перенос старой установки sing-box не поддерживается.",
+ ))
+ }
+}
+
+fn cutover_state_error() -> CommandError {
+ CommandError::new(
+ "component_cutover_state_conflict",
+ "Состояние переноса изменилось; обновите статус и повторите действие.",
+ )
+}
+
+fn inventory_for_package_component(component: ManagedPackageComponentDto) -> ComponentInventory {
+ match component {
+ ManagedPackageComponentDto::Proxifyre => inventory_proxyfier(),
+ ManagedPackageComponentDto::SingBox => inventory_singbox(),
+ }
+}
+
+fn component_package_statuses(
+ storage: &JsonStorage,
+) -> Result, CommandError> {
+ let service = open_component_package_service(storage)?;
+ let now = SystemEpochClock.now_epoch_seconds();
+ [
+ ManagedPackageComponentDto::Proxifyre,
+ ManagedPackageComponentDto::SingBox,
+ ]
+ .into_iter()
+ .map(|component| component_package_status(&service, component, now))
+ .collect()
+}
+
+fn component_package_status(
+ service: &ComponentPackageService,
+ component: ManagedPackageComponentDto,
+ now: u64,
+) -> Result {
+ let inventory = inventory_for_package_component(component);
+ let (installed_version, install_source) = installed_package_snapshot(component, &inventory);
+ let installed = InstalledComponentSnapshot::new(installed_version.as_deref(), install_source)
+ .unwrap_or_else(|_| InstalledComponentSnapshot::not_installed());
+ let status = service
+ .update_status(component.catalog_id(), now, installed)
+ .map_err(component_packages_error)?;
+ ComponentPackageStatusDto::try_from(&status).map_err(|_| {
+ CommandError::new(
+ "component_package_status_failed",
+ "Получен статус вспомогательного пакета вместо runtime-компонента.",
+ )
+ })
+}
+
+fn installed_package_snapshot(
+ component: ManagedPackageComponentDto,
+ inventory: &ComponentInventory,
+) -> (Option, ComponentInstallSource) {
+ let Some(candidate) = inventory.selected_candidate() else {
+ return (None, ComponentInstallSource::None);
+ };
+
+ if candidate.classification == ComponentClassification::ManagedCurrent {
+ if let Ok(current_exe) = std::env::current_exe() {
+ let managed = match component {
+ ManagedPackageComponentDto::Proxifyre => ManagedComponent::Proxifyre,
+ ManagedPackageComponentDto::SingBox => ManagedComponent::SingBox,
+ };
+ if let Ok(root) = CanonicalComponentRoot::from_current_exe(¤t_exe, managed) {
+ if let Ok(receipt) = read_install_receipt(&root) {
+ let source = match receipt.source {
+ InstalledPackageSource::Bundled => ComponentInstallSource::Bundled,
+ InstalledPackageSource::Cache => ComponentInstallSource::Cache,
+ };
+ return (Some(receipt.version), source);
+ }
+ }
+ }
+ }
+
+ let version = candidate.binary_version.clone();
+ if InstalledComponentSnapshot::new(version.as_deref(), ComponentInstallSource::External).is_ok()
+ {
+ (version, ComponentInstallSource::External)
+ } else {
+ (None, ComponentInstallSource::None)
+ }
+}
+
+fn open_component_package_service(
+ storage: &JsonStorage,
+) -> Result {
+ ComponentPackageService::open(bundled_components_root()?, storage.paths())
+ .map_err(component_packages_error)
+}
+
+fn bundled_components_root() -> Result {
+ let current_exe = std::env::current_exe().map_err(|_| {
+ CommandError::new(
+ "component_package_unavailable",
+ "Не удалось определить локальный каталог компонентов ProxyWarden.",
+ )
+ })?;
+ let installed = current_exe
+ .parent()
+ .map(|parent| parent.join("bundled").join("components"));
+ if installed
+ .as_deref()
+ .is_some_and(|root| root.join("catalog.json").is_file())
+ {
+ return installed.ok_or_else(|| {
+ CommandError::new(
+ "component_package_unavailable",
+ "Локальный каталог компонентов ProxyWarden недоступен.",
+ )
+ });
+ }
+
+ #[cfg(debug_assertions)]
+ {
+ let development = Path::new(env!("CARGO_MANIFEST_DIR"))
+ .join("bundled")
+ .join("components");
+ if development.join("catalog.json").is_file() {
+ return Ok(development);
+ }
+ }
+
+ Err(CommandError::new(
+ "component_package_unavailable",
+ "В установленном приложении не найден локальный каталог компонентов.",
+ ))
+}
+
+fn component_packages_error(error: ComponentPackagesError) -> CommandError {
+ match error {
+ ComponentPackagesError::Transport
+ | ComponentPackagesError::InvalidResponse
+ | ComponentPackagesError::InvalidRedirect
+ | ComponentPackagesError::InvalidReleaseMetadata
+ | ComponentPackagesError::MissingOrAmbiguousAsset => CommandError::new(
+ "component_update_check_failed",
+ "Не удалось получить проверяемые данные об обновлении компонента.",
+ ),
+ ComponentPackagesError::NoTrustedUpdate => CommandError::new(
+ "component_update_unavailable",
+ "Для компонента нет отдельно проверенного обновления.",
+ ),
+ ComponentPackagesError::UpdateStateBusy => CommandError::new(
+ "component_update_busy",
+ "Другая операция обновления компонента еще выполняется.",
+ ),
+ ComponentPackagesError::InvalidUpdateState | ComponentPackagesError::UpdateStateIo(_) => {
+ CommandError::new(
+ "component_update_state_invalid",
+ "Локальное состояние обновлений повреждено или недоступно.",
+ )
+ }
+ ComponentPackagesError::SizeMismatch
+ | ComponentPackagesError::DigestMismatch
+ | ComponentPackagesError::SignatureVerification
+ | ComponentPackagesError::PublisherMismatch
+ | ComponentPackagesError::InvalidArchive
+ | ComponentPackagesError::PromotionConflict
+ | ComponentPackagesError::InvalidPrivilegedUpdatePlan
+ | ComponentPackagesError::UntrustedPrivilegedStaging
+ | ComponentPackagesError::UntrustedBundleRoot => CommandError::new(
+ "component_package_verification_failed",
+ "Пакет компонента не прошел проверку подлинности и целостности.",
+ ),
+ ComponentPackagesError::StagingIo(_) => CommandError::new(
+ "component_update_download_failed",
+ "Не удалось безопасно сохранить проверенный пакет обновления.",
+ ),
+ ComponentPackagesError::Catalog(_) | ComponentPackagesError::MissingBundledComponent => {
+ CommandError::new(
+ "component_package_unavailable",
+ "Локальный каталог компонентов отсутствует или поврежден.",
+ )
+ }
+ ComponentPackagesError::InvalidTimestamp
+ | ComponentPackagesError::InvalidInstalledSnapshot => CommandError::new(
+ "component_package_status_failed",
+ "Не удалось определить состояние установленного пакета компонента.",
+ ),
+ }
}
fn background_task_error(error: impl std::fmt::Display) -> CommandError {
@@ -381,3 +1541,394 @@ fn apply_flow_error(error: ApplyFlowError) -> CommandError {
.collect(),
)
}
+
+#[cfg(test)]
+mod task5_command_wiring_tests {
+ use super::*;
+ use crate::component_catalog::ComponentId as CatalogComponentId;
+ use crate::component_cutover::{
+ ComponentCutoverUserEvidence, CutoverPhase, CUTOVER_OBSERVATION_SCHEMA_VERSION,
+ CUTOVER_USER_EVIDENCE_SCHEMA_VERSION,
+ };
+ use crate::component_inventory::{
+ CandidateRole, ComponentCandidate, MarkerEvidence, ServiceEvidence,
+ };
+ use crate::component_packages::{
+ ComponentUpdateState, ComponentUpdateStatus, PackageSource, UpdateFreshness,
+ };
+
+ #[test]
+ fn whole_app_elevation_is_disabled_without_relaunching() {
+ let error = restart_as_admin().expect_err("whole-app elevation must stay disabled");
+
+ assert_eq!(error.code, "whole_app_elevation_disabled");
+ }
+
+ #[test]
+ fn lifecycle_route_requires_cutover_for_all_legacy_lifecycle_actions() {
+ let legacy = inventory_with(ComponentClassification::ManagedLegacy, Vec::new());
+
+ assert_eq!(
+ lifecycle_route(&legacy, InventoryAction::Start)
+ .expect_err("legacy start requires cutover")
+ .code,
+ "legacy_cutover_required"
+ );
+ assert_eq!(
+ lifecycle_route(&legacy, InventoryAction::Update)
+ .expect_err("legacy mutation requires cutover")
+ .code,
+ "legacy_cutover_required"
+ );
+ assert_eq!(
+ lifecycle_route(
+ &ComponentInventory::missing(crate::models::ComponentId::Proxyfier),
+ InventoryAction::Install,
+ )
+ .expect("missing install uses privileged preflight"),
+ LifecycleRoute::Privileged
+ );
+ assert_eq!(
+ lifecycle_route(
+ &ComponentInventory::missing(crate::models::ComponentId::Proxyfier),
+ InventoryAction::Start,
+ )
+ .expect_err("missing start fails before UAC")
+ .code,
+ "component_missing"
+ );
+
+ let current = inventory_with(ComponentClassification::ManagedCurrent, Vec::new());
+ assert_eq!(
+ lifecycle_route(¤t, InventoryAction::Start)
+ .expect("current start uses one-shot privileged route"),
+ LifecycleRoute::Privileged
+ );
+ assert_eq!(
+ lifecycle_route(¤t, InventoryAction::Install)
+ .expect_err("current install must fail before UAC")
+ .code,
+ "component_already_current"
+ );
+ }
+
+ #[test]
+ fn lifecycle_route_rejects_foreign_component_before_uac() {
+ let foreign = inventory_with(
+ ComponentClassification::Foreign,
+ vec![InventoryIssue::new(
+ "ownership_mismatch",
+ "foreign component",
+ )],
+ );
+
+ let error = lifecycle_route(&foreign, InventoryAction::Update)
+ .expect_err("foreign component must fail");
+
+ assert_eq!(error.code, "ownership_mismatch");
+ }
+
+ #[test]
+ fn package_status_dto_contains_no_package_paths_or_digests() {
+ let status = ComponentUpdateStatus {
+ component_id: CatalogComponentId::Proxifyre,
+ installed_version: Some("2.4.0".to_string()),
+ bundled_version: "2.4.0".to_string(),
+ available_offline_version: "2.5.0".to_string(),
+ latest_known_version: Some("2.5.0".to_string()),
+ last_checked_at_unix: Some(1_787_000_000),
+ freshness: UpdateFreshness::Fresh,
+ update_state: ComponentUpdateState::UpdateAvailable,
+ install_source: ComponentInstallSource::Bundled,
+ offline_package_source: PackageSource::Cache,
+ can_install_offline: true,
+ offline_unavailable_reason: None,
+ can_download: false,
+ };
+
+ let dto = ComponentPackageStatusDto::try_from(&status).expect("runtime DTO");
+ let json = serde_json::to_string(&dto).expect("serialize DTO");
+
+ assert!(json.contains("installedVersion"));
+ assert!(!json.contains("path"));
+ assert!(!json.contains("sha256"));
+ assert!(!json.contains("digest"));
+ }
+
+ #[test]
+ fn privileged_terminal_codes_map_to_stable_command_errors() {
+ assert_eq!(
+ privileged_result_error(PrivilegedResultCode::PreconditionFailed).code,
+ "component_precondition_failed"
+ );
+ assert_eq!(
+ privileged_result_error(PrivilegedResultCode::OwnershipMismatch).code,
+ "component_ownership_mismatch"
+ );
+ assert_eq!(
+ privileged_result_error(PrivilegedResultCode::PackageVerificationFailed).code,
+ "component_package_verification_failed"
+ );
+ assert_eq!(
+ privileged_result_error(PrivilegedResultCode::ServiceCollision).code,
+ "component_service_collision"
+ );
+ assert_eq!(
+ privileged_result_error(PrivilegedResultCode::CleanupPending).code,
+ "component_cleanup_pending"
+ );
+ }
+
+ #[test]
+ fn cutover_status_is_redacted_and_singbox_remains_manual_only() {
+ let storage = JsonStorage::new(
+ std::env::temp_dir().join(format!("proxywarden-cutover-status-{}", Uuid::new_v4())),
+ );
+ let status = cutover_status_from_observation(
+ &storage,
+ "22222222-2222-4222-8222-222222222222",
+ ComponentCutoverObservation {
+ schema_version: CUTOVER_OBSERVATION_SCHEMA_VERSION,
+ component: "proxifyre".to_string(),
+ cutover_id: "11111111-1111-4111-8111-111111111111".to_string(),
+ state: CutoverDisplayState::AwaitingNextStart,
+ phase: CutoverPhase::LegacyQuarantined,
+ original_service_state: LegacyServiceState::Stopped,
+ legacy_version: "2.2.1".to_string(),
+ bundled_version: "2.4.0".to_string(),
+ operation_fingerprint: "1".repeat(64),
+ transaction_fingerprint: "2".repeat(64),
+ evidence_fingerprint: None,
+ next_start_verified: false,
+ route_smoke_confirmed: false,
+ legacy_path_label: "Старая установка ProxiFyre".to_string(),
+ current_path_label: "Управляемые компоненты ProxyWarden".to_string(),
+ can_recover: false,
+ can_cleanup: false,
+ disabled_code: None,
+ updated_at_epoch_seconds: 1,
+ },
+ &inventory_with(ComponentClassification::ManagedCurrent, Vec::new()),
+ Some("2.4.0".to_string()),
+ false,
+ false,
+ );
+ let json = serde_json::to_string(&status).expect("serialize cutover status");
+ assert!(json.contains("awaiting_next_start"));
+ assert!(!json.contains("operationFingerprint"));
+ assert!(!json.contains("transactionFingerprint"));
+ assert!(!json.contains(r"C:\"));
+
+ assert_eq!(
+ require_proxifyre_cutover_component(ManagedPackageComponentDto::SingBox)
+ .expect_err("sing-box cutover stays manual")
+ .code,
+ "manual_migration_required"
+ );
+ }
+
+ #[test]
+ fn recovery_status_never_promotes_untrusted_local_cleanup_evidence() {
+ let root = std::env::temp_dir().join(format!(
+ "proxywarden-cutover-recovery-status-{}",
+ Uuid::new_v4()
+ ));
+ let storage = JsonStorage::new(&root);
+ let cutover_id = "11111111-1111-4111-8111-111111111111";
+ let session_id = "22222222-2222-4222-8222-222222222222";
+ let inventory = inventory_with(ComponentClassification::ManagedCurrent, Vec::new());
+ storage
+ .write_component_cutover_user_evidence(&ComponentCutoverUserEvidence {
+ schema_version: CUTOVER_USER_EVIDENCE_SCHEMA_VERSION,
+ cutover_id: cutover_id.to_string(),
+ startup_session_id: session_id.to_string(),
+ current_inventory_fingerprint: component_inventory_fingerprint_for_cutover(
+ &inventory,
+ ),
+ route_smoke_confirmed: true,
+ observed_at_epoch_seconds: 10,
+ confirmed_at_epoch_seconds: Some(11),
+ })
+ .expect("write forged UX cleanup hint");
+
+ let status = cutover_status_from_observation(
+ &storage,
+ session_id,
+ ComponentCutoverObservation {
+ schema_version: CUTOVER_OBSERVATION_SCHEMA_VERSION,
+ component: "proxifyre".to_string(),
+ cutover_id: cutover_id.to_string(),
+ state: CutoverDisplayState::RecoveryRequired,
+ phase: CutoverPhase::RecoveryRequired,
+ original_service_state: LegacyServiceState::Stopped,
+ legacy_version: "2.2.1".to_string(),
+ bundled_version: "2.4.0".to_string(),
+ operation_fingerprint: "1".repeat(64),
+ transaction_fingerprint: "2".repeat(64),
+ evidence_fingerprint: None,
+ next_start_verified: false,
+ route_smoke_confirmed: false,
+ legacy_path_label: "ignored".to_string(),
+ current_path_label: "ignored".to_string(),
+ can_recover: true,
+ can_cleanup: false,
+ disabled_code: Some("recovery_required".to_string()),
+ updated_at_epoch_seconds: 12,
+ },
+ &inventory,
+ Some("2.4.0".to_string()),
+ false,
+ false,
+ );
+
+ assert_eq!(status.state, ComponentCutoverStateDto::RecoveryRequired);
+ assert!(status.can_cutover);
+ assert!(!status.can_confirm_route_smoke);
+ assert!(!status.can_cleanup);
+ assert!(!status.route_smoke_confirmed);
+ let _ = std::fs::remove_dir_all(root);
+ }
+
+ #[test]
+ fn stale_cleanup_hint_keeps_generic_sealed_recovery_reachable() {
+ let storage = JsonStorage::new(std::env::temp_dir().join(format!(
+ "proxywarden-cutover-stale-cleanup-{}",
+ Uuid::new_v4()
+ )));
+ let status = cutover_status_from_observation(
+ &storage,
+ "22222222-2222-4222-8222-222222222222",
+ ComponentCutoverObservation {
+ schema_version: CUTOVER_OBSERVATION_SCHEMA_VERSION,
+ component: "proxifyre".to_string(),
+ cutover_id: "11111111-1111-4111-8111-111111111111".to_string(),
+ state: CutoverDisplayState::CleanupPending,
+ phase: CutoverPhase::CleanupConfirmed,
+ original_service_state: LegacyServiceState::Stopped,
+ legacy_version: "2.2.1".to_string(),
+ bundled_version: "2.4.0".to_string(),
+ operation_fingerprint: "1".repeat(64),
+ transaction_fingerprint: "2".repeat(64),
+ evidence_fingerprint: Some("3".repeat(64)),
+ next_start_verified: true,
+ route_smoke_confirmed: true,
+ legacy_path_label: "ignored".to_string(),
+ current_path_label: "ignored".to_string(),
+ can_recover: false,
+ can_cleanup: true,
+ disabled_code: None,
+ updated_at_epoch_seconds: 12,
+ },
+ &inventory_with(ComponentClassification::ManagedCurrent, Vec::new()),
+ Some("2.4.0".to_string()),
+ false,
+ true,
+ );
+
+ assert_eq!(status.state, ComponentCutoverStateDto::CleanupPending);
+ assert!(status.can_cleanup);
+ assert!(status.can_cutover);
+ }
+
+ #[test]
+ fn route_smoke_confirmation_binds_current_session_and_exact_live_inventory() {
+ let root =
+ std::env::temp_dir().join(format!("proxywarden-route-confirmation-{}", Uuid::new_v4()));
+ let storage = JsonStorage::new(&root);
+ let cutover_id = "11111111-1111-4111-8111-111111111111";
+ let session_id = "22222222-2222-4222-8222-222222222222";
+ storage
+ .write_component_cutover_observation(&ComponentCutoverObservation {
+ schema_version: CUTOVER_OBSERVATION_SCHEMA_VERSION,
+ component: "proxifyre".to_string(),
+ cutover_id: cutover_id.to_string(),
+ state: CutoverDisplayState::AwaitingNextStart,
+ phase: CutoverPhase::LegacyQuarantined,
+ original_service_state: LegacyServiceState::Stopped,
+ legacy_version: "2.2.1".to_string(),
+ bundled_version: "2.4.0".to_string(),
+ operation_fingerprint: "1".repeat(64),
+ transaction_fingerprint: "2".repeat(64),
+ evidence_fingerprint: None,
+ next_start_verified: false,
+ route_smoke_confirmed: false,
+ legacy_path_label: "ignored".to_string(),
+ current_path_label: "ignored".to_string(),
+ can_recover: false,
+ can_cleanup: false,
+ disabled_code: None,
+ updated_at_epoch_seconds: 1,
+ })
+ .expect("write observation");
+ let inventory = inventory_with(ComponentClassification::ManagedCurrent, Vec::new());
+ storage
+ .write_component_cutover_user_evidence(&ComponentCutoverUserEvidence {
+ schema_version: CUTOVER_USER_EVIDENCE_SCHEMA_VERSION,
+ cutover_id: cutover_id.to_string(),
+ startup_session_id: session_id.to_string(),
+ current_inventory_fingerprint: component_inventory_fingerprint_for_cutover(
+ &inventory,
+ ),
+ route_smoke_confirmed: false,
+ observed_at_epoch_seconds: 10,
+ confirmed_at_epoch_seconds: None,
+ })
+ .expect("write startup evidence");
+
+ assert_eq!(
+ confirm_route_smoke_evidence_with_inventory(
+ &storage,
+ "33333333-3333-4333-8333-333333333333",
+ &inventory,
+ 20,
+ )
+ .expect_err("another startup session must not confirm")
+ .code,
+ "component_cutover_next_start_required"
+ );
+ confirm_route_smoke_evidence_with_inventory(&storage, session_id, &inventory, 20)
+ .expect("confirm exact route evidence");
+ let confirmed = storage
+ .read_component_cutover_user_evidence()
+ .expect("read confirmed evidence")
+ .expect("confirmed evidence exists");
+ assert!(confirmed.route_smoke_confirmed);
+ assert_eq!(confirmed.confirmed_at_epoch_seconds, Some(20));
+ let _ = std::fs::remove_dir_all(root);
+ }
+
+ fn inventory_with(
+ classification: ComponentClassification,
+ issues: Vec,
+ ) -> ComponentInventory {
+ let root = PathBuf::from(r"C:\Legacy\ProxiFyre");
+ let executable_path = root.join("ProxiFyre.exe");
+ ComponentInventory {
+ component_id: crate::models::ComponentId::Proxyfier,
+ candidates: vec![ComponentCandidate {
+ component_id: crate::models::ComponentId::Proxyfier,
+ classification,
+ role: if classification == ComponentClassification::ManagedCurrent {
+ CandidateRole::Current
+ } else {
+ CandidateRole::Legacy
+ },
+ root,
+ executable_path: Some(executable_path.clone()),
+ binary_version: Some("2.4.0".to_string()),
+ service: Some(ServiceEvidence {
+ name: "ProxiFyreService".to_string(),
+ status: "stopped".to_string(),
+ path_name: Some(format!(r#""{}" --service"#, executable_path.display())),
+ executable_path: Some(executable_path),
+ path_matches_candidate: true,
+ binary_version: Some("2.4.0".to_string()),
+ }),
+ marker: MarkerEvidence::Valid,
+ issues,
+ }],
+ selected: Some(0),
+ issues: Vec::new(),
+ }
+ }
+}
diff --git a/src-tauri/src/component_catalog.rs b/src-tauri/src/component_catalog.rs
new file mode 100644
index 0000000..365a78c
--- /dev/null
+++ b/src-tauri/src/component_catalog.rs
@@ -0,0 +1,869 @@
+use crate::safe_fs::ensure_no_reparse_ancestors;
+use serde::{Deserialize, Serialize};
+use sha2::{Digest, Sha256};
+use std::collections::HashSet;
+use std::fs::{self, File};
+use std::io::{self, Read};
+use std::path::{Path, PathBuf};
+use thiserror::Error;
+use url::Url;
+
+pub const COMPONENT_CATALOG_SCHEMA_VERSION: u32 = 1;
+pub const COMPONENT_CATALOG_FILENAME: &str = "catalog.json";
+
+#[derive(Debug, Error)]
+pub enum ComponentCatalogError {
+ #[error("component catalog JSON is invalid: {0}")]
+ Json(#[from] serde_json::Error),
+ #[error("component catalog is invalid: {0}")]
+ Invalid(String),
+ #[error("component bundle cannot be read: {0}")]
+ Io(#[from] io::Error),
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
+#[serde(rename_all = "lowercase")]
+pub enum TargetArch {
+ X64,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
+#[serde(rename_all = "lowercase")]
+pub enum AssetArch {
+ X64,
+ Anycpu,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
+#[serde(rename_all = "kebab-case")]
+pub enum ComponentId {
+ Proxifyre,
+ WindowsPacketFilter,
+ VcRuntime,
+ SingBox,
+ Winsw,
+}
+
+impl ComponentId {
+ pub const ALL: [Self; 5] = [
+ Self::Proxifyre,
+ Self::WindowsPacketFilter,
+ Self::VcRuntime,
+ Self::SingBox,
+ Self::Winsw,
+ ];
+
+ pub const fn as_str(self) -> &'static str {
+ match self {
+ Self::Proxifyre => "proxifyre",
+ Self::WindowsPacketFilter => "windows-packet-filter",
+ Self::VcRuntime => "vc-runtime",
+ Self::SingBox => "sing-box",
+ Self::Winsw => "winsw",
+ }
+ }
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
+#[serde(rename_all = "kebab-case")]
+pub enum InstallRole {
+ ProxifyreRuntime,
+ PacketFilterDriver,
+ VcRuntimePrerequisite,
+ SingBoxRuntime,
+ SingBoxServiceWrapper,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase", deny_unknown_fields)]
+pub struct ComponentCatalog {
+ pub schema_version: u32,
+ pub target_arch: TargetArch,
+ pub components: Vec,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase", deny_unknown_fields)]
+pub struct ComponentPackage {
+ pub id: ComponentId,
+ pub version: String,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub file_version: Option,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub product_version: Option,
+ pub asset_path: String,
+ pub asset_arch: AssetArch,
+ pub effective_target: TargetArch,
+ pub sha256: String,
+ pub size: u64,
+ pub source_url: String,
+ pub license: ComponentLicense,
+ pub install_role: InstallRole,
+ pub update_trust_policy: UpdateTrustPolicy,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase", deny_unknown_fields)]
+pub struct ComponentLicense {
+ pub id: String,
+ pub path: String,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(
+ tag = "type",
+ rename_all = "camelCase",
+ rename_all_fields = "camelCase",
+ deny_unknown_fields
+)]
+pub enum UpdateTrustPolicy {
+ GithubReleaseDigest {
+ repository: String,
+ tag_pattern: String,
+ asset_pattern: String,
+ require_stable: bool,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ authenticode_publishers: Option>,
+ },
+ BuildTimeOnlyAuthenticode {
+ allowed_source_hosts: Vec,
+ asset_pattern: String,
+ publishers: Vec,
+ },
+ BundledOnlyNoIndependentProof {
+ reason: String,
+ },
+}
+
+pub fn parse_catalog(bytes: &[u8]) -> Result {
+ let catalog: ComponentCatalog = serde_json::from_slice(bytes)?;
+ validate_catalog(&catalog)?;
+ Ok(catalog)
+}
+
+pub fn validate_bundle(root: &Path) -> Result {
+ ensure_no_reparse_ancestors(root)?;
+ let catalog_path = root.join(COMPONENT_CATALOG_FILENAME);
+ require_regular_file(&catalog_path, "catalog")?;
+ let catalog = parse_catalog(&fs::read(&catalog_path)?)?;
+
+ let mut expected_files = HashSet::from([COMPONENT_CATALOG_FILENAME.to_string()]);
+ for component in &catalog.components {
+ if !expected_files.insert(component.asset_path.clone()) {
+ return Err(invalid("two components reference the same asset path"));
+ }
+ expected_files.insert(component.license.path.clone());
+
+ let asset_path = root.join(relative_path(&component.asset_path));
+ require_regular_file(&asset_path, "component asset")?;
+ let metadata = fs::metadata(&asset_path)?;
+ if metadata.len() != component.size {
+ return Err(invalid(format!(
+ "asset size does not match catalog for {}",
+ component.id.as_str()
+ )));
+ }
+ if sha256_file(&asset_path)? != component.sha256 {
+ return Err(invalid(format!(
+ "asset SHA-256 does not match catalog for {}",
+ component.id.as_str()
+ )));
+ }
+
+ let license_path = root.join(relative_path(&component.license.path));
+ require_regular_file(&license_path, "license")?;
+ if fs::metadata(license_path)?.len() == 0 {
+ return Err(invalid(format!(
+ "license file is empty for {}",
+ component.id.as_str()
+ )));
+ }
+ }
+
+ let actual_files = collect_bundle_files(root)?;
+ if actual_files != expected_files {
+ let missing = expected_files.difference(&actual_files).count();
+ let extra = actual_files.difference(&expected_files).count();
+ return Err(invalid(format!(
+ "bundle file set does not match catalog (missing: {missing}, extra: {extra})"
+ )));
+ }
+
+ Ok(catalog)
+}
+
+pub fn parse_bundled_catalog_if_present(
+ root: &Path,
+) -> Result