mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-24 20:34:05 +02:00
Add a Host trait and move DB/model commands off Tauri
Command handlers took Tauri types, so running them anywhere else meant rewriting them. `yaak_commands::Host` is what a handler actually needs from its surroundings: who the client is, what it's looking at, and the shared managers. Handlers are generic over it and keep the router's shape, so another host registers one with rpc_handler_async! and no adapter at all. 28 commands move: models, deletes, response reads, encryption, plugin info, export. ClientCtx implements Host, so the desktop adapters are one line and behavior is unchanged. PluginHost is separate because PluginManager is "spawn a Node sidecar and talk to it" — a browser host runs plugins in a worker and can't hand one back. Only 4 of the 28 need it; the rest work without a plugin runtime, and the compiler says which is which. Also drops yaak_core::AppContext, an earlier sketch of this that was never implemented.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
resolver = "2"
|
||||
members = [
|
||||
"crates/yaak",
|
||||
"crates/yaak-commands",
|
||||
# Common/foundation crates
|
||||
"crates/common/yaak-database",
|
||||
"crates/common/yaak-rpc",
|
||||
@@ -69,6 +70,7 @@ yaak-rpc-schema = { path = "crates/common/yaak-rpc-schema" }
|
||||
# Internal crates - shared
|
||||
yaak-core = { path = "crates/yaak-core" }
|
||||
yaak = { path = "crates/yaak" }
|
||||
yaak-commands = { path = "crates/yaak-commands" }
|
||||
yaak-common = { path = "crates/yaak-common" }
|
||||
yaak-crypto = { path = "crates/yaak-crypto" }
|
||||
yaak-git = { path = "crates/yaak-git" }
|
||||
|
||||
Reference in New Issue
Block a user