Expand description
Lifecycle hooks as the engine sees them: the events, the payload a hook is
sent, the merged answer of one run, and the trait the session holds. The
runner that parses the settings’ hooks and runs commands, prompts, HTTP
and agents is the hooks crate’s (hooks::Factory); NoHooks is what a
session runs on without it. What each event carries and what an answer can
do there is documented by hooks::catalog.
Structs§
- Hook
Block - A hook refused the action.
- Hook
Input - What a hook is sent. Which optional fields are set depends on the event.
- Hook
Session - What a session’s own hooks are built from.
- Hook
Verdict - What one run of an event’s hooks came to, merged.
- NoHooks
- No hooks: nothing runs, nothing is refused.
Enums§
- Agent
Hook Error - Hook
Event - The events a settings file keys hooks by.
Traits§
- Agent
Hook Executor - Runs a
"type": "agent"hook: the agent’s{"ok": bool, "reason": ...}as JSON text. The agent stops whenstopdoes. - Hooks
- A session’s hooks; one is shared by a session and its delegates.
- Hooks
Factory - Prompt
Hook Executor - Runs a
"type": "prompt"hook: the model’s answer, as the JSON text of a hook response. Returns soon oncestopis cancelled.
Functions§
- configures_
hooks - Whether a settings
hookssection asks for any hook: anything but nothing,null, or events each with an empty list.
Type Aliases§
- Hook
Ambient - The fields every payload of a session carries, read when the hook fires: the permission mode changes under a session, so a snapshot would go stale.