Skip to main content

Crate ag_protocol

Crate ag_protocol 

Source
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§

AgentResponse
Wire-format protocol payload used for schema-driven provider output.
FocusedReview
Structured result returned by a focused-review utility prompt.
FocusedReviewDecision
Auditable disposition of one input suggestion during consolidation.
FocusedReviewEvidence
Source citation and actionable rationale for one focused-review finding.
FocusedReviewSuggestion
One actionable focused-review finding.
GraphProposal
Complete logical graph, without runtime identities or acceptance evidence.
GraphProposalDependency
Logical prerequisite; evidence satisfying it must come from the host.
GraphProposalExecution
Execution requirements that contain no model, Env, task, or budget IDs.
GraphProposalInput
Named input referencing a producer’s output, without an execution identity.
GraphProposalNode
One proposed invocation of an available agent definition.
GraphProposalOutput
Named complete response; it does not assert validation or acceptance.
GraphProposalResponse
Direct structured response to an initial graph-generation request.
QuestionItem
One extracted question with predefined answer choices.
ReviewCommentOutcome
Structured outcome for one forge review thread targeted by the turn.
ReviewMetadata
Direct wire response for review-request metadata reconciliation.
TurnPrompt
Structured prompt payload for one agent turn.
TurnPromptAttachment
One local image attachment referenced from a prompt placeholder.
UtilityResponse
Minimal wire response for isolated text generation tasks.

Enums§

AgentResponseParseError
Structured response parsing failure details.
FocusedReviewSeverity
Supported severity levels for actionable focused-review findings.
FocusedReviewSide
Version of a changed file cited by a focused-review finding.
GraphProposalContext
Context lifetime requested without a host-owned task identity.
GraphProposalGate
Host-established condition needed before a dependent node runs.
GraphProposalOutcome
Mutually exclusive outcomes of proposal generation.
GraphProposalPostProcessing
Requested host post-processing, independent of model tools.
GraphProposalWorkspaceAccess
Resource requirements within the session Env, never a permission grant.
ProtocolRequestProfile
Protocol-owned request family preserved across prompt submission and repair retries.
ProtocolSchemaInstructionMode
Controls whether bootstrap prompt instructions include the full protocol JSON Schema text.
ReviewCommentResolution
Agent-reported disposition for one forge review thread.
SchemaRequiredPolicy
Selects how a provider transport lists required schema properties.
TurnPromptContentPart
Ordered content piece produced when serializing one turn prompt.
TurnPromptTextSource
Source classification for one turn prompt text payload.

Functions§

agent_response_output_schema
Returns the JSON Schema used for structured assistant output.
build_protocol_repair_prompt
Builds the protocol repair prompt text for one failed parse attempt.
diff_fence
Builds a Markdown code-fence delimiter long enough to safely wrap an arbitrary prompt payload.
format_protocol_parse_debug_details
Builds one multi-line debug report for a protocol parsing failure.
parse_agent_response_strict
Parses one raw assistant message strictly as protocol payload.
parse_protocol_response_strict
Parses one response against the schema selected for its request profile.
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.
protocol_output_schema
Returns the output schema selected for one protocol request profile.
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.
workspace_instructions
Renders durable application policy for native developer/system instruction channels without replacing the provider’s built-in coding instructions.