Expand description
Shared Agentty protocol models, schema helpers, and prompt payloads.
This crate contains the transport-neutral wire contracts used between
Agentty frontends, session workflows, and provider adapters. It
intentionally avoids depending on the main agentty crate so future
frontends can reuse protocol parsing and turn-prompt serialization without
pulling in TUI state.
Structs§
- Agent
Response - Wire-format protocol payload used for schema-driven provider output.
- Agent
Response Summary - Structured session summary block emitted alongside protocol messages.
- Question
Item - One extracted question with predefined answer choices.
- Turn
Prompt - Structured prompt payload for one agent turn.
- Turn
Prompt Attachment - One local image attachment referenced from a prompt placeholder.
Enums§
- Agent
Response Parse Error - Structured response parsing failure details.
- Protocol
Request Profile - Protocol-owned request family preserved across prompt submission and repair retries.
- Protocol
Schema Instruction Mode - Controls whether bootstrap prompt instructions include the full protocol JSON Schema text.
- Turn
Prompt Content Part - Ordered content piece produced when serializing one turn prompt.
- Turn
Prompt Text Source - Source classification for one turn prompt text payload.
Functions§
- agent_
response_ json_ schema_ json - Returns a pretty-printed JSON Schema string for prompt instruction templating.
- agent_
response_ output_ schema - Returns the JSON Schema used for structured assistant output.
- agent_
response_ output_ schema_ json - Returns a pretty-printed JSON Schema string for prompt instruction templating.
- build_
protocol_ repair_ prompt - Builds the protocol repair prompt text for one failed parse attempt.
- format_
protocol_ parse_ debug_ details - Builds one multi-line debug report for a protocol parsing failure.
- normalize_
turn_ response - Normalizes one parsed turn response according to the request profile.
- parse_
agent_ response_ strict - Parses one raw assistant message strictly as protocol payload.
- prepend_
protocol_ instructions - Prepends structured response protocol instructions to a prompt.
- prepend_
protocol_ refresh_ reminder - Prepends a compact refresh reminder for providers that already received the full instruction contract in the active context.
- render_
prompt_ text_ for_ agent - Rewrites user-entered
@lookups into quoted agent-facing path tokens. - split_
turn_ prompt_ content - Splits prompt text into ordered text and attachment parts for transport serialization.