messages | AgentMessage[] | Timeline for the current conversation. |
pendingActions | AgentPendingAction[] | Tool approvals and MCP connect items that are still pending. Derived from messages. |
conversationId | string | undefined | Server conversation id after create or resume. Undefined until the first successful send on a new chat. |
error | NovuError | WebChatPlanLimitError | undefined | Last error from load, send, retry, respondToAction, sendAction, or a failed agent run. |
isLoading | boolean | True while the Web Chat module loads. For an existing conversation, it stays true until the first history fetch completes. |
isRunning | boolean | True while the agent turn is in progress. Same as run.isRunning. |
typing | AgentConversationTyping | undefined | Ephemeral typing indicator. Same as run.typing. Absent when the agent is not typing. |
run | { isRunning: boolean; typing?: AgentConversationTyping } | Current agent-run snapshot. |
conversationStatus | 'active' | 'resolved' | Conversation lifecycle. The agent sets resolved with ctx.resolve(). Not a loading flag. See State. |
pagination | { status, hasMore, fetchMore } | Older history pages. Not a top-level hasMore or fetchMore. See Pagination. |
isRecovering | boolean | True while reconnect recovery is in progress. |
catchUpError | NovuError | undefined | Set when reconnect recovery fails. Separate from send and fetch error. |
refetch | () => Promise<void> | Reload the newest history page. No-op when there is no conversation id. |
sendMessage | (input: SendMessageInput) => Promise<{ data?: SendMessageResult; error?: NovuError | WebChatPlanLimitError }> | Send a user message. input is a string, or { text, metadata }. Creates a conversation when conversationId is omitted. |
retryMessage | (messageId: string) => Promise<{ data?: SendMessageResult; error?: NovuError | WebChatPlanLimitError }> | Resend a message whose status is failed. Reuses the original idempotency key. Does not create a second message. See Retry a failed send. |
respondToAction | (args: { actionId: string; decision: AgentToolApprovalDecision }) => Promise<{ data?: RespondToActionResult; error?: NovuError | WebChatPlanLimitError }> | Resolve a pending tool-approval. Pass action.id from pendingActions. Typical decisions: 'approved' or 'denied'. |
sendAction | (args: { actionId: string; sourceMessageId: string; value?: string }) => Promise<{ data?: SendActionResult; error?: NovuError | WebChatPlanLimitError }> | Click a Card button. Pass id / value from the button and message.id as sourceMessageId. Do not use this for tool approval. See Cards. |