MessageAddedEvent
Defined in: src/hooks/events.ts:212
Event triggered when the framework adds a message to the conversation history.
Fired for user input, assistant responses, and tool-result messages added
during agent execution. Does not fire for messages preloaded via
AgentConfig.messages or messages manually pushed to agent.messages.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MessageAddedEvent(data): MessageAddedEvent;Defined in: src/hooks/events.ts:218
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | { agent: LocalAgent; message: Message; invocationState: InvocationState; } |
data.agent | LocalAgent |
data.message | Message |
data.invocationState | InvocationState |
Returns
Section titled “Returns”MessageAddedEvent
Overrides
Section titled “Overrides”Properties
Section titled “Properties”readonly type: "messageAddedEvent";Defined in: src/hooks/events.ts:213
readonly agent: LocalAgent;Defined in: src/hooks/events.ts:214
message
Section titled “message”readonly message: Message;Defined in: src/hooks/events.ts:215
invocationState
Section titled “invocationState”readonly invocationState: InvocationState;Defined in: src/hooks/events.ts:216
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): Pick<MessageAddedEvent, "type" | "message">;Defined in: src/hooks/events.ts:229
Serializes for wire transport, excluding the agent reference and invocationState. Called automatically by JSON.stringify().
Returns
Section titled “Returns”Pick<MessageAddedEvent, "type" | "message">