Source body
source_body
SourceBodyHook — symbol body extraction with line numbers.
Protocol hook that extracts the full source body of one or more symbols,
returning file path, start/end lines, and complete source code. Registered
as ast:source-body via axm.hooks entry point.
Designed for protocol agents that need to Edit a symbol directly from
the briefing without a preceding Read.
SourceBodyHook
dataclass
Extract the full source body of one or more symbols.
Reads path from params (or working_dir from context)
and symbol from params. When symbol contains newline
characters, each line is processed independently.
Source code in packages/axm-ast/src/axm_ast/hooks/source_body.py
execute(context, **params)
Execute the hook action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
dict[str, object]
|
Session context dictionary. |
required |
**params
|
object
|
Must include |
{}
|
Returns:
| Type | Description |
|---|---|
HookResult
|
HookResult with |