Expand description
Pure translations between Leviath’s own types and the Agent Client Protocol.
Everything here is a total function over plain data - no I/O, no daemon, no
async - so the stdio server in leviath-cli is left with only sequencing to
do, and every mapping decision is unit-testable in isolation.
Constants§
- OPTION_
ALLOW_ ALWAYS - The option id returned when the user approves this tool for the whole session.
- OPTION_
ALLOW_ ONCE - The option id returned when the user approves a single tool call.
- OPTION_
REJECT_ ONCE - The option id returned when the user rejects a tool call.
Functions§
- flatten_
prompt - Flatten a prompt’s content blocks into the single task/message string Leviath agents consume.
- is_
permission_ request - Whether an interaction can be answered over the protocol at all.
- parse_
region_ markers - Parse
---region:<name>---markers out of a flattened prompt into a name→content map. - permission_
request - Build a
session/request_permissionrequest from a Leviath tool-approval interaction. - stop_
reason_ for - The stop reason to report for a run that has reached
status, orNonewhile the run has not stopped at all. - stop_
reason_ for_ label stop_reason_forover the string labels carried by completion events, which report a terminal status by name rather than as aRunStatus. An unexpected label reads as an ordinary end of turn.