feat(core): Add runtime engine, input parsing, and hook trait.

This commit is contained in:
2026-03-13 21:56:42 -04:00
parent d62b136a64
commit c74e4ea9fb
5 changed files with 851 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
//! Hook trait for lifecycle events. The core library defines
//! the interface; concrete implementations (shell hooks, IPC
//! hooks, etc.) live in frontend crates.
use serde_json::Value;
use crate::error::PiklError;
/// A lifecycle hook that fires on menu events. Implementations
/// live outside pikl-core (e.g. in the CLI binary) so the core
/// library stays free of process/libc deps.
#[allow(async_fn_in_trait)]
pub trait Hook: Send + Sync {
async fn run(&self, value: &Value) -> Result<(), PiklError>;
}