Expand description
Library-level support for --exit interactive mode.
When a session is launched with --exit [<hint>], the user prompt is
augmented with instructions telling the agent to call
zag ps kill self <result> (or zag ps kill self --file <path>) to
terminate the session and submit the final result.
This module owns the prompt template, the typed ExitHint /
ExitConstraints state, and the validation logic used by
zag ps kill to accept or reject a submitted result.
Structs§
- Exit
Constraints - All exit-mode constraints captured at session launch.
Enums§
- Exit
Hint - State of the
--exitflag for a single session. - Exit
Validation Error - Reason a
zag ps killinvocation was rejected. The CLI prints theDisplayimpl to stderr; the agent is expected to read the message and self-correct.
Functions§
- build_
exit_ suffix - Build the suffix appended to a user prompt when a session is launched
with
--exit. - exit_
template - Exit prompt template (front matter stripped) —
{HINT_SECTION},{JSON_INSTRUCTION},{SCHEMA_INSTRUCTION}are replaced at run time. - validate_
exit_ result - Validate a result string against the constraints recorded on a session
at launch time. Returns
Ok(())if the kill should proceed.