@threadplane/chatInterfacev0.3.4

Message

A provider-independent chat message with delivery state, content, and optional reasoning, tools, and citations.

import type { Message } from '@threadplane/chat';

Declaration

export interface Message  {
  citations?: Citation[];
  content: string | ContentBlock[];
  delivery: MessageDelivery;
  extra?: Record<string, unknown>;
  id: string;
  name?: string;
  reasoning?: string;
  reasoningDurationMs?: number;
  role: Role;
  toolCallId?: string;
  toolCallIds?: string[];
}

Members

citations

Provider-agnostic citation list. Populated by adapters.

citations?: Citation[];

content

Plain text, or a list of structured content blocks.

content: string | ContentBlock[];

delivery

Adapter-owned authoritative delivery lifecycle state for this message.

delivery: MessageDelivery;

extra

Runtime-specific extras; do not rely on shape in portable code.

extra?: Record<string, unknown>;

id

id: string;

name

Optional display/author name.

name?: string;

reasoning

Reasoning text emitted by the model before/alongside the visible response. Populated by adapters from {type:'reasoning'} or {type:'thinking'} content blocks (LangGraph) or REASONING_MESSAGE_* events (AG-UI). Always a plain string — provider-specific shape (encrypted blocks, multi-step summaries) is absorbed by the adapter and not surfaced here.

reasoning?: string;

reasoningDurationMs

Wall-clock duration of the reasoning phase in milliseconds. Populated by the adapter when both start (first reasoning chunk) and end (first response-text chunk, or final canonical message) are known. Undefined when reasoning timing isn't available.

reasoningDurationMs?: number;

role

role: Role;

toolCallId

Present when role === 'tool'.

toolCallId?: string;

toolCallIds

IDs of tool calls emitted BY this assistant message. Populated by adapters from provider-native fields (LangGraph: tool_calls[].id; Anthropic: tool_use content blocks). Used by <chat-tool-calls> to scope its rendering to a single message — otherwise it falls back to the agent's global toolCalls list, which renders duplicates across every AI message in a thread.

toolCallIds?: string[];