File header
file_header
FileHeaderHook — file header extraction for protocol briefings.
Protocol hook that extracts the first ~30 lines of source files referenced
by source_body results, providing import blocks, __all__, and
TYPE_CHECKING context without requiring a full Read. Registered
as ast:file-header via axm.hooks entry point.
FileHeaderHook
Extract the first ~30 lines of source files.
Reads path from params (or working_dir from context)
and files from params. When files is not provided,
extracts file paths from source_body in context.
Source code in packages/axm-ast/src/axm_ast/hooks/file_header.py
execute(context, **params)
Execute the hook action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
dict[str, object]
|
Session context dictionary. |
required |
**params
|
object
|
Optional |
{}
|
Returns:
| Type | Description |
|---|---|
HookResult
|
HookResult with |