messages | PersonaMessage[] | All messages — user and assistant — in the current conversation. Each assistant message may have toolCalls, reasoning, and isReasoning fields populated during streaming. |
input | string | The current text input value. |
setInput | (value: string) => void | Replace the entire input value. |
handleInputChange | (e: ChangeEvent) => void | Direct wire for <input onChange> or <textarea onChange>. |
handleSubmit | (e?: FormEvent) => void | Direct wire for <form onSubmit>. Calls sendMessage() with the current input. Prevents default. |
sendMessage | (content?, override?) => Promise<void> | Send a message. content defaults to input. override can set agentId, threadId, or resume for this send only. |
isStreaming | boolean | true while a response is being received. |
isLoading | boolean | Alias for isStreaming. |
isLoadingHistory | boolean | true while loading a thread’s past messages via GET /threads/:id/messages. |
error | Error | null | The last error. Cleared automatically on the next sendMessage. |
interrupt | PersonaInterrupt | null | Set when the agent pauses for HITL approval or a clarification question. See Handling interrupts below. |
resumeInterrupt | (resume, displayContent) => void | Resume a paused interrupt. resume is the answer/approval payload. displayContent is the text shown in the user’s chat bubble (e.g. “Approved” or the typed answer). |
files | Record<string, PersonaWorkspaceFile> | The agent’s virtual workspace files — populated from STATE_SNAPSHOT events. Keys are file paths. |
todos | PersonaTodo[] | The agent’s current plan/todo items, updated with each STATE_SNAPSHOT. Each has content and status. |
presentedFile | PersonaPresentedFile | null | Set when the agent calls present_file — contains path, title, and description. |
dismissPresentedFile | () => void | Clears presentedFile back to null. |
openWorkspaceFile | (path: string) => void | Manually opens a workspace file in presentedFile. |
stop | () => void | Aborts the current stream. The assistant message stays at whatever content was received so far. |
reload | () => void | Resends the last user message (replays the turn). Useful when the response errored or was interrupted. |
clear | () => void | Resets all state — messages, files, todos, errors, interrupts, presented file. Does not delete anything server-side. |
setMessages | (msgs: PersonaMessage[]) => void | Replace the entire message array. |
loadThreadMessages | (id: string) => Promise<PersonaMessage[]> | Manually load a thread’s message history. Returns the loaded messages and updates messages state. |