Skip to main content

Module lifecycle

Module lifecycle 

Source

Structs§

HookMessage
LifecycleHookCommandPreview
A lifecycle hook command exactly as the engine will execute it, with its canonical snake_case event key. Displayed to the user so an approval covers the precise command set.
LifecycleHookEngine
PermissionRequestHookDecision
PermissionRequestHookOutcome
PermissionUpdateRequest
PreCompactHookOutcome
StopHookOutcome

Enums§

HookMessageLevel
NotificationHookType
PermissionDecisionBehavior
PermissionDecisionScope
PermissionUpdateDestination
PermissionUpdateKind
PreToolHookDecision
SessionEndReason
SessionStartTrigger

Functions§

carry_or_restore_workspace_hook_approval
Carry an in-memory approval from a previous engine onto a rebuilt engine (primary-agent switch or config reload), falling back to the persisted record. A session-only approval that could not be persisted (e.g. dot-config write failure) survives the rebuild while the command set is unchanged, instead of being silently dropped mid-session. Fails closed in every other case: a changed command set, a previously unapproved engine, or a gated engine with no matching persisted record leaves the rebuilt engine gated.
restore_workspace_hook_approval
Restore a persisted workspace lifecycle-hook approval onto a freshly built engine. The persisted record only applies when its digest still matches the engine’s exact command set; any configuration change since approval leaves the engine fail-closed.