DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
Vendored patch: native notifications and macOS build output
tauri-plugin-notifications 0.5.0-rc.14, copied verbatim from crates.io and wired in via
[patch.crates-io] in src-tauri/Cargo.toml. Changes cover Windows notification behavior,
shared model accessors, and macOS Swift build output discovery.
macOS build output
Swift build artifacts remain under Cargo's OUT_DIR. The build script queries
swift build --show-bin-path with the same scratch path, target triple and configuration
used for compilation, then verifies the static library exists before registering the link
search path. This supports both SwiftPM's architecture directories and newer Xcode build
layouts such as out/Products/Debug without assuming their directory structure.
swift-rs discovers the selected toolchain's Swift library search paths so compatibility
archives required by older macOS deployment targets are available to the Rust linker.
The application's src-tauri/build.rs also adds /usr/lib/swift to the executable's
runtime search paths so linked Swift libraries, including concurrency support, are resolved
from macOS when running the application or Rust tests.
Why
The upstream Windows backend cannot express the two notification shapes the DSH shell needs, and it never activates at all in an unpackaged build.
No text box.
Action::input/input_button_title/input_placeholderare deserialised and documented inREADME.md, butbuild_toast_xml()only ever emitted<action content=… arguments=… activationType=…>. Nothing ever wrote an<input>, so a question notification rendered without a box to type into and without the 回复 button.Button identity is lost on a cold activation. Actions carried the bare action id in
arguments=, and the notification's session identity only ever lived in the toast'slaunch=attribute — which the out-of-process COM activator never receives. A click on a toast in Action Center while the app was closed therefore arrived as a bare action id, with no way back to the originating session.The COM activator was packaged-only, and registered on the wrong apartment.
if packaged && let Some(clsid_str) = windows_config.toast_activator_clsid {DSH is not MSIX-packaged, so
is_packaged()isfalseand the branch never ran: the process registered noINotificationActivationCallback, Windows had no AUMID mapping to activate, and every click degraded to a plain shortcut launch with no payload. Even for a packaged app the registration happened on the caller's thread, which is Windows'CoInitializeExreturningRPC_E_CHANGED_MODE;CoRegisterClassObjectbinds a class to the calling apartment, and an STA serves activation calls only while it pumps messages.Replies could never reach JS. The in-process
Activatedhandler hardcoded"inputValue": nulland never calledToastActivatedEventArgs::UserInput(), and it was attached only when anotificationClickedlistener existed — so a subscriber that only listened foractionPerformed(the reply button) got no handler at all.Permission checks block the first unpackaged toast (desktop issue #812).
ToastNotifier::Setting()can returnERROR_NOT_FOUND(0x80070490) before Windows creates per-app notification settings for an unpackaged AUMID. The pre-send permission check then drops every toast, so the settings profile never gets created.
One toast click also reaches Windows through two independent routes — the in-process
Activated handler and the out-of-proc COM activator — so a naive fix delivers every click
twice.
What changed
src/models.rs— three accessors onActionso the XML builder can see the fields the frontend already sends:input(),input_placeholder(),input_button_title().Cargo.toml— the Windows feature list gainsFoundation_Collections(required byToastActivatedEventArgs::UserInput),Win32_Security(required byRegCreateKeyExW) andWin32_System_Registry/Win32_UI_WindowsAndMessaging.src/windows.rsnotification_permission()— allows the first toast attempt only when an unpackaged notifier's settings query returnsERROR_NOT_FOUND. Explicit disabled settings remain denied; packaged apps and other failures still propagate their errors. Windows still controls actual delivery, andshow()errors are not suppressed.input_element_id()/action_arguments()— helpers for the<input id>naming scheme (input-<action id>) and for the JSONarguments=payload.build_toast_xml()— emits one<input id="input-<action id>" type="text" placeHolderContent=…>peraction.input()before the<action>elements (Windows only accepts ahint-inputIdthat already exists), setshint-inputIdon the submitting action, captions that button frominput_button_title(), and writesarguments=as{"actionId": …, "data": <extra>}so the session identity survives a cold activation.decode_activation()— a new first branch decodes that JSONarguments=payload (the existingis_objectheuristic would otherwise misread it as a body tap); the three legacy arms now carryextratoo.- warm
Activatedhandler — reads the typed text throughread_user_input()and reports it asinputValue, derives button-vs-tap from the presence ofactionIdinstead ofis_object, and surfacesextranext tonotification. activation_signature()/DELIVERED/claim_activation()— collapse the in-process handler and the COM activator into exactly one event per click. Identical arguments withinDEDUP_WINDOW(1500 ms) are considered the same activation; a poisoned lock or clock anomaly fails open, because a duplicate event is preferable to a silently swallowed click.show()— attaches the in-process handler when eithernotificationClickedoractionPerformedhas a listener.register_unpackaged_app_id()— writesHKCU\Software\Classes\AppUserModelId\<app_id>(DisplayName,IconUri,CustomActivator={CLSID}) andHKCU\Software\Classes\CLSID\{CLSID}\LocalServer32= the current executable, which is the AUMID mapping an unpackaged build needs.IconUriuses the resolved PNG resource configured byplugins.notifications.windows.iconPath; Windows does not extract the toast header icon from an EXE. The resource is explicitly included inbundle.resources. Best-effort: failures are logged and the in-process path still works while the app is running.plain_icon_path()— Tauri resolvesBaseDirectory::Resourcethroughtauri_utils::platform::current_exe, which canonicalizes the executable, and Windows canonicalization hands back the\\?\verbatim form. The toast platform silently ignores anIconUriin that form and renders the notification with no app logo, so the prefix is stripped (verbatim UNC mapped back to\\server\share) before the value is written. Without this,iconPathis configured correctly and still has no visible effect.spawn_toast_activator()— registerToastActivatorFactoryon a dedicated single-threaded-apartment thread that then blocks inGetMessageW/TranslateMessage/DispatchMessageWfor the life of the process, and is registered whenever a CLSID is configured rather than only for packaged builds.
The CLSID itself comes from src-tauri/tauri.conf.json
(plugins.notifications.windows.toastActivatorClsid) and must stay in sync with any MSIX
manifest's ToastActivatorCLSID / com:Class Id.
Tests
The crate is a member of the src-tauri workspace so its native unit tests share the
application's lockfile. Windows CI runs from src-tauri:
cargo test -p tauri-plugin-notifications --lib --no-default-features --locked
Disabling default features is required: notify-rust selects the alternative desktop
backend and excludes src/windows.rs, including its permission regression tests.
Removal
Delete this directory and its [patch.crates-io] entry plus its comment and workspace
membership in src-tauri/Cargo.toml. Remove the Windows native notification test step from
.github/workflows/ci.yml. Cargo.lock regains the source + checksum lines for the
registry copy. Drop the plugins.notifications block in src-tauri/tauri.conf.json if
upstream also ships unpackaged registration.
Upstream issue: https://github.com/Choochmeque/tauri-plugin-notifications/issues (text-box support and unpackaged activation; drop this directory once they ship).