@personaai/react:
Core message types
PersonaRole
PersonaMessage
The central type — represents one message in the conversation. Used by useChat’s messages
array and as the argument to onFinish.
isReasoning is true, reasoning contains the partial thinking text and content
is still empty — the model hasn’t started generating the final answer yet. When REASONING_END
fires, isReasoning goes false and content starts filling.
When toolCalls is non-empty, each entry is a PersonaToolCall representing one tool
invocation. A single assistant turn can have multiple tool calls, and each one goes through
the cycle: TOOL_CALL_CHUNK (args streaming) → TOOL_CALL_RESULT (result arrives).
PersonaToolCall
args arrives in chunks — the first TOOL_CALL_CHUNK sets toolCallId and toolName,
and subsequent chunks append to args. By the time TOOL_CALL_RESULT arrives, args
is the complete JSON string.
isError is detected by the hook parsing result for {status: 'error', message} — the
backend doesn’t set a boolean field on the event itself.
subagentActivity only appears on task (subagent) tool calls, accumulating live updates
as the subagent runs.
PersonaSubagentActivityEntry
text entries carry delta
(text the subagent is generating). tool_start entries carry toolName and args (the
subagent is calling another tool). tool_result entries carry result (that tool finished).
Interrupt types (HITL & clarifications)
PersonaInterrupt
A discriminated union — either a HITL approval request or a clarification question. Set on
useChat’s interrupt field when the stream pauses.
PersonaHitlActionRequest
PersonaClarificationQuestion
PersonaResumeValue
What to pass in sendMessage(content, { resume }) to unpause a paused run:
hitl interrupts, use the decisions shape. For clarification interrupts, use the
answers shape.
Workspace & file types
PersonaWorkspaceFile
The agent’s own virtual filesystem — files the agent has written via write_file tool calls,
tracked through STATE_SNAPSHOT events. Distinct from PersonaFileItem (user uploads).
snake_case timestamps (created_at/modified_at) to
camelCase by the hook.
PersonaPresentedFile
Set when the agent calls present_file — a signal to highlight a specific workspace file.
PersonaFileItem
A user-uploaded file (from useFiles). Distinct from PersonaWorkspaceFile — different
hook, different API, different shape.
PersonaTodo
An item from the agent’s plan — updated with each STATE_SNAPSHOT event.
Memory types
PersonaMemoryFile
PersonaMemoryAgentGroup
PersonaMemoryList
Thread types
PersonaThread
agentId is a bare string on create()/get() responses, but populated as a full object
on list() responses.
Agent types
PersonaAgentSummary
Connection types
PersonaHealthInfo
Provider types
PersonaProviderProps
The props for <PersonaProvider>:
Hook option types
UseChatOptions
SendMessageOverride
Per-send overrides for sendMessage:
Streaming event type
See Streaming Events for the fullPersonaStreamingEvent union with every variant documented.