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:
Gregory Schier
2026-08-16 07:07:55 -07:00
parent 32e92d484b
commit 57d55e1eed
24 changed files with 848 additions and 518 deletions
Generated
+20
View File
@@ -11029,6 +11029,7 @@ dependencies = [
"uuid",
"yaak",
"yaak-api",
"yaak-commands",
"yaak-common",
"yaak-core",
"yaak-crypto",
@@ -11108,6 +11109,24 @@ dependencies = [
"zip",
]
[[package]]
name = "yaak-commands"
version = "0.0.0"
dependencies = [
"log 0.4.29",
"serde_json",
"tempfile",
"thiserror 2.0.17",
"tokio",
"yaak",
"yaak-core",
"yaak-crypto",
"yaak-models",
"yaak-plugins",
"yaak-rpc-schema",
"yaak-templates",
]
[[package]]
name = "yaak-common"
version = "0.1.0"
@@ -11439,6 +11458,7 @@ version = "0.1.0"
dependencies = [
"regex 1.11.1",
"tauri",
"yaak-core",
]
[[package]]