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.

Diagram

Allow

Deny

Event Trigger

Hook: FileCheckHook

Decision

Process

Block

Constructor

ParamField str

No description available.

ParamField str

No description available.

ParamField bool

No description available.

ParamField bool

No description available.

ParamField Optional[str]

No description available.

ParamField Optional[str]

No description available.

ParamField Any

No description available.

ParamField bool

No description available.

Usage

python
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 GitHub

praisonaiagents/hooks/verification.py at line 275


Related Documentation