Crate gestura_core_hooks

Crate gestura_core_hooks 

Source
Expand description

Safe-by-default hooks engine for event-driven command templates.

gestura-core-hooks provides a small hooks system for wiring specific agent or application events to command templates, while keeping execution tightly constrained and auditable.

§Safety model

Hooks are intentionally conservative:

  • hook execution is opt-in
  • configured programs must appear in allowed_programs
  • templates are rendered from explicit HookContext values
  • execution records are captured for inspection and testing

This crate focuses on the hooks data model and execution engine rather than broader pipeline orchestration.

§Main entry points

  • HookDefinition and HookCommandTemplate: the declarative hook model
  • HookEvent: supported events that can trigger hooks
  • HooksSettings: engine configuration including allow-listed programs
  • HookEngine: safe dispatcher that resolves and runs matching hooks
  • HookExecutionRecord: audit-friendly result of a hook run

Structs§

HookCommandTemplate
A command template for a hook.
HookContext
Runtime context provided to hooks.
HookDefinition
A single hook definition.
HookEngine
Hook engine.
HookExecutionRecord
A record of a hook execution.
HooksSettings
Global hooks settings.
ProcessHookExecutor
Executor that spawns local OS processes.

Enums§

HookEvent
A hook event.

Traits§

HookExecutor
A hook executor.

Functions§

render_template
Render template by replacing {{key}} placeholders with values in vars.

Type Aliases§

TemplateVars
Template variables map used for hook command rendering.