Add yaak-actions crate for centralized action system

Implements a unified action system that serves as a single source of truth
for all operations in Yaak (Tauri app, CLI, plugins, deep links, MCP server).

Key features:
- ActionExecutor: Combined registry and execution engine with async RwLock
- ActionHandler: Trait-based handlers using async closures
- Context system: RequiredContext and CurrentContext for action availability
- Action groups: Organize related actions
- TypeScript bindings: Auto-generated via ts-rs for frontend use

Design highlights:
- Handlers are closures (no dependencies on other yaak crates)
- Registration requires both metadata and handler (prevents orphan actions)
- Flexible return values via serde_json::Value
- All methods are async using tokio

All 33 tests passing. Ready for integration with yaak-core and yaak-app.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Gregory Schier
2026-01-08 21:16:50 -08:00
parent c4ce458f79
commit 50b0e23d53
28 changed files with 1997 additions and 0 deletions
+2
View File
@@ -2,6 +2,7 @@
resolver = "2"
members = [
# Shared crates (no Tauri dependency)
"crates/yaak-actions",
"crates/yaak-core",
"crates/yaak-common",
"crates/yaak-crypto",
@@ -45,6 +46,7 @@ tokio = "1.48.0"
ts-rs = "11.1.0"
# Internal crates - shared
yaak-actions = { path = "crates/yaak-actions" }
yaak-core = { path = "crates/yaak-core" }
yaak-common = { path = "crates/yaak-common" }
yaak-crypto = { path = "crates/yaak-crypto" }