Expand description
rightkit-tauri-shell: the shared Tauri desktop shell for Right Suite apps.
What every desktop app needs around its own UI: a hardened webview, window state, a native
menu, a tray, single instance, deep links, autostart, a rich clipboard, a hang watchdog and
the window-to-engine seam. Layout is NOT part of the shell (the sidebar/titlebar layout lives
in @rightkit/react-shell, optional and replaceable); this crate is the behaviour underneath.
tauri::Builder::default()
.plugin(rightkit_tauri_shell::Shell::builder("myapp").app_name("MyApp").tray(spec).build().plugin())
.invoke_handler(rightkit_tauri_shell::handler![my_app_command])
.run(tauri::generate_context!())See API.md for per-app migration.
Re-exports§
pub use autostart::AutostartMigration;pub use autostart::AutostartOptions;pub use autostart::LegacyAutostartNames;pub use autostart::MacosBackend;pub use broker::PathBroker;pub use clipboard::ClipboardItem;pub use clipboard::ClipboardOptions;pub use clipboard::ClipboardPolicy;pub use clipboard::ImagePreference;pub use devtools::ContentWebview;pub use devtools::DevToolsError;pub use devtools::DevToolsGate;pub use devtools::DevToolsPolicy;pub use devtools::WebviewDecision;pub use error::ShellError;pub use harden::Hardening;pub use harden::HardeningScript;pub use idle::IdleErrorCallback;pub use idle::IdleFailure;pub use idle::IdlePhase;pub use idle::IdleTransition;pub use idle::IdleTransitionCallback;pub use idle::IdleTransitionKind;pub use idle::IdleTrigger;pub use login_item::LoginItemStatus;pub use menu::MenuEntry;pub use menu::MenuGroup;pub use menu::MenuSpec;pub use modules::Module;pub use modules::ModuleSet;pub use modules::ShellPlugin;pub use modules::ShellPluginBuilder;pub use opener::ExternalOpener;pub use opener::SystemOpener;pub use presence::AutoPrefs;pub use presence::PresenceState;pub use recovery::MigrationOutcome;pub use recovery::RecoverySpec;pub use single_instance::ClaimFailure;pub use single_instance::ClaimOptions;pub use single_instance::ClaimOutcome;pub use single_instance::InstanceMessage;pub use single_instance::LegacySingleInstanceNames;pub use single_instance::SingleInstance;pub use single_instance::SingleInstanceGuard;pub use site::SitePolicy;pub use stream::StreamEvent;pub use stream::StreamEventKind;pub use stream::StreamObserver;pub use stream::StreamPolicy;pub use tray::LeftClick;pub use tray::TraySpec;pub use watchdog::ShellRuntimeStatus;pub use watchdog::StallReport;pub use watchdog::WatchdogConfig;pub use watchdog::WatchdogStatus;
Modules§
- autostart
- Launch at login. Base: CodeRight
os_shell/autostart(Linux XDG.desktop, Windows HKCU Run throughreg.exewith no console), plus the macOS LaunchAgent the donor lacked (HeardRight’slogin_launchcovered it only for its own bundle). The login launch receivesAutostartOptions::args(default--background), so it never starts a second engine. - b64
- Minimal standard base64 for moving binary clipboard payloads across the JSON IPC boundary.
- broker
- Path broker: the renderer never names a file the user did not hand to the app.
- clipboard
- Rich clipboard: text, HTML, PNG image, file lists and app-defined formats, in one transaction, plus a typed “what did the person copy” contract for paste and open-from-clipboard.
- commands
- Tauri commands the frontend bridge (
@rightkit/tauri-shell) calls. Register them withcrate::handler!. They are application commands, so they need no ACL capability entry. - deep_
link - Deep links / URL schemes: validation, a queue that waits for the frontend, and registration.
- devtools
- DevTools policy: every Right app has no access to DevTools; ViewRight alone may inspect the HTML content it opens.
- error
- Typed error envelope for shell commands that need category handling in the renderer.
- frameless
- Frameless window chrome. macOS keeps the native traffic lights over an overlay title bar;
Windows/Linux drop decorations and the app draws its own title bar (the
@rightkit/react-shellTitleBar) using therk_shell_windowcontrols anddata-tauri-drag-region. - harden
- Webview hardening: no stray webview context menu, reload / zoom / history keys blocked, drag-drop cannot navigate, external links leave for the system browser.
- idle
- Webview idle / resource management for tray-resident apps.
- instance
- Single-instance arbitration over
rightkit-daemon(no extra plugin, no lock file). - lifecycle
- Startup / shutdown order and RunEvent routing.
- login_
item - macOS 13+ launch at login through
SMAppService.mainApp(ServiceManagement), the backend that replaces the LaunchAgent plist. Orthic-Labs/rightkit#247. - menu
- Native application menu: standard App / Edit / View / Window / Help structure, no browser verbs (no Reload, no zoom, no Back), plus app-defined groups.
- modules
- Modular install: opt individual shell modules out, or install only the state the broker, stream, recovery, frameless and clipboard commands need.
- nav
- Navigation and window-open policy: what a webview may load in place, what leaves for the system browser, and what is refused.
- notify
- Native notifications, badge and sound policy.
- open_
url - Standalone “open URL” hook: usable without the full Shell plugin.
- opener
- System handler for external links. Arguments are passed as argv (never through a shell) and
only schemes allowed by
crate::nav::external_scheme_allowedreach it. - presence
- Presentation-aware presence and Do-Not-Disturb.
- quit
- Opt-in quit drain.
- recovery
- Setup recovery: a crash-safe session snapshot.
- single_
instance - Standalone single instance with a typed message, usable without the shell plugin.
- site
- Site-root serving: a second custom scheme (
<app>-site://) that serves allowlisted subresources beneath a granted site root. - startup_
cache - Startup cache repair: keep the app’s cache directory usable before a plugin needs it.
- stream
- Ranged custom-protocol streaming of broker-granted files.
- tray
- System tray / menu-bar extra with a dynamic menu.
- watchdog
- Main-thread hang watchdog.
- window_
state - DPI-independent window geometry persistence and restore.
- windows
- Window creation and lifecycle helpers: hardened builders, reveal / toggle, secondary windows.
Macros§
- handler
- Build the
invoke_handlerwith the shell commands plus the app’s own.rightkit_tauri_shell::handler![my_command, other].
Structs§
- Shell
- Shell
Builder - Shell
State - Everything the shell shares at runtime (managed Tauri state).
Enums§
- Close
Behavior - What closing the main window does.
Constants§
- EVENT_
DEEP_ LINK - EVENT_
ENGINE - EVENT_
IDLE - EVENT_
MENU - EVENT_
PRESENCE - EVENT_
QUIT_ REQUESTED - Emitted instead of exiting when the host opted into
ShellBuilder::quit_drain. - EVENT_
SECOND_ INSTANCE - EVENT_
STALL - EVENT_
TRAY - EVENT_
WINDOW
Type Aliases§
- Second
Instance Callback - Called on the first instance when a later launch forwards its argv and working directory.