use std::path::PathBuf;
use thiserror::Error;
#[derive(Debug, Clone)]
pub struct NoteContext {
pub path: PathBuf,
pub note_type: String,
pub frontmatter: serde_yaml::Value,
pub content: String,
pub variables: serde_yaml::Value,
}
impl NoteContext {
pub fn new(
path: PathBuf,
note_type: String,
frontmatter: serde_yaml::Value,
content: String,
variables: serde_yaml::Value,
) -> Self {
Self { path, note_type, frontmatter, content, variables }
}
}
#[derive(Debug, Error)]
pub enum HookError {
#[error("template not found: {0}")]
TemplateNotFound(String),
#[error("capture not found: {0}")]
CaptureNotFound(String),
#[error("macro not found: {0}")]
MacroNotFound(String),
#[error("hook execution failed: {0}")]
Execution(String),
#[error("Lua error: {0}")]
LuaError(String),
#[error("template render error: {0}")]
TemplateRender(String),
#[error("capture execution error: {0}")]
CaptureExecution(String),
#[error("macro execution error: {0}")]
MacroExecution(String),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
}