ChatMessagePayload
Discriminated union covering every shape an AI agent persists onto a
ChatMessage. Member dispatch is keyed by the kind field on the stored
array (see App\GraphQL\Unions\ChatMessagePayload).
union ChatMessagePayload = ChatNarrationPayload | ChatQuestionPayload | ChatWorkflowDonePayload | ChatSegmentBuilderDonePayload | ChatActionsDonePayload | ChatValidationErrorsPayload | ChatErrorPayload
Possible types
ChatMessagePayload.ChatNarrationPayload object
Author-side narration that doesn't ask for input.
ChatMessagePayload.ChatQuestionPayload object
Agent needs the user (or parent agent) to pick from candidates.
ChatMessagePayload.ChatWorkflowDonePayload object
WorkflowAgent committed a workflow — payload carries the resulting ids and labels so the UI can deep-link.
ChatMessagePayload.ChatSegmentBuilderDonePayload object
SegmentBuilderAgent committed conditions. conditions rides as JSON for
now — the V2 typed condition tree is a separate refactor and consumers
of this surface (the future segment-builder chat UI) already parse this
shape themselves.
ChatMessagePayload.ChatActionsDonePayload object
ActionsAgent committed actions. actions rides as JSON (canonical
CreateActionHasMany shape) — parent agents splice it straight onto a
commit mutation.
ChatMessagePayload.ChatValidationErrorsPayload object
SegmentBuilder / Actions failed validation after the repair budget.
result carries the attempted (and rejected) payload so the parent
agent or UI can introspect what was tried.
ChatMessagePayload.ChatErrorPayload object
Operational failure (parse error, sub-agent threw, etc.) — surface
error to the user.
Member Of
AiAgentTurn object ● ChatMessage object


