mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-26 19:31:12 +01:00
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>
14 lines
949 B
TypeScript
Generated
14 lines
949 B
TypeScript
Generated
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
import type { ActionGroupId } from "./ActionGroupId";
|
|
import type { ActionId } from "./ActionId";
|
|
import type { ActionScope } from "./ActionScope";
|
|
|
|
/**
|
|
* Errors that can occur during action operations.
|
|
*/
|
|
export type ActionError = { "type": "not-found" } & ActionId | { "type": "disabled", action_id: ActionId, reason: string, } | { "type": "invalid-scope", expected: ActionScope, actual: ActionScope, } | { "type": "timeout" } & ActionId | { "type": "plugin-error" } & string | { "type": "validation-error" } & string | { "type": "permission-denied" } & string | { "type": "cancelled" } | { "type": "internal" } & string | { "type": "context-missing",
|
|
/**
|
|
* The context fields that are missing.
|
|
*/
|
|
missing_fields: Array<string>, } | { "type": "group-not-found" } & ActionGroupId | { "type": "group-already-exists" } & ActionGroupId;
|