mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-17 17:12:13 +02:00
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.