File Check Hook • AI Agent SDK
FileCheckHook: Declarative file-assertion verification hook (no shell involved).
FileCheckHook
Defined in the verification module.
AI Agent
Declarative file-assertion verification hook (no shell involved).
Checks portable filesystem facts: – `exists : the file exists (default True). - non_empty : the file has non-zero size. - contains : the file text contains a substring. - json_field/equals` : the JSON value at a dotted path equals a value.
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph TD
event["Event Trigger"] --> hook["Hook: FileCheckHook"]
hook --> decision{"Decision"}
decision -- "Allow" --> proc["Process"]
decision -- "Deny" --> block["Block"]
style hook fill:#189AB4,color:#fff
style event fill:#8B0000,color:#fff
style proc fill:#8B0000,color:#fff
style block fill:#8B0000,color:#fffConstructor
ParamField
strNo description available.
ParamField
strNo description available.
ParamField
boolNo description available.
ParamField
boolNo description available.
ParamField
Optional[str]No description available.
ParamField
Optional[str]No description available.
ParamField
AnyNo description available.
ParamField
boolNo description available.
Usage
hook = FileCheckHook(name="changelog", path="CHANGELOG.md", non_empty=True)
hook = FileCheckHook(name="cfg", path="out.json",
json_field="status.code", equals=0)Source
View on GitHubpraisonaiagents/hooks/verification.py at line 275