IConversationManager
Defined in: agent/interfaces.ts:13
Manages the conversation history and message building. This interface abstracts conversation state management from the orchestration logic.
Methods
Section titled “Methods”addAssistantMessage()
Section titled “addAssistantMessage()”addAssistantMessage(
content):void
Defined in: agent/interfaces.ts:23
Adds an assistant message to the conversation.
Parameters
Section titled “Parameters”content
Section titled “content”string
Returns
Section titled “Returns”void
addGadgetCallResult()
Section titled “addGadgetCallResult()”addGadgetCallResult(
gadgetName,parameters,result,invocationId,media?,mediaIds?):void
Defined in: agent/interfaces.ts:30
Adds a gadget call and its result to the conversation. The invocationId is shown to the LLM so it can reference previous calls when building dependencies. Optionally includes media outputs (images, audio, etc.) for multimodal results.
Parameters
Section titled “Parameters”gadgetName
Section titled “gadgetName”string
parameters
Section titled “parameters”Record<string, unknown>
result
Section titled “result”string
invocationId
Section titled “invocationId”string
media?
Section titled “media?”mediaIds?
Section titled “mediaIds?”string[]
Returns
Section titled “Returns”void
addUserMessage()
Section titled “addUserMessage()”addUserMessage(
content):void
Defined in: agent/interfaces.ts:18
Adds a user message to the conversation. Supports multimodal content (text + images/audio).
Parameters
Section titled “Parameters”content
Section titled “content”Returns
Section titled “Returns”void
getBaseMessages()
Section titled “getBaseMessages()”getBaseMessages():
LLMMessage[]
Defined in: agent/interfaces.ts:54
Gets the base messages (system prompts, gadget instructions). These are never compacted and always included at the start.
Returns
Section titled “Returns”getConversationHistory()
Section titled “getConversationHistory()”getConversationHistory():
LLMMessage[]
Defined in: agent/interfaces.ts:70
Gets full conversation history including initial messages and runtime history. Used for REPL session continuation - returns everything except base (system) messages. This combines:
- initialMessages: History from previous sessions (set via withHistory())
- historyBuilder: Messages from the current session
Returns
Section titled “Returns”getHistoryMessages()
Section titled “getHistoryMessages()”getHistoryMessages():
LLMMessage[]
Defined in: agent/interfaces.ts:48
Gets only the conversation history messages (excludes base messages). Used by compaction to determine what can be compressed.
Returns
Section titled “Returns”getMessages()
Section titled “getMessages()”getMessages():
LLMMessage[]
Defined in: agent/interfaces.ts:42
Gets the complete conversation history including base messages (system prompts, gadget instructions).
Returns
Section titled “Returns”replaceHistory()
Section titled “replaceHistory()”replaceHistory(
newHistory):void
Defined in: agent/interfaces.ts:61
Replaces the conversation history with new messages. Used by compaction to update history after compression.
Parameters
Section titled “Parameters”newHistory
Section titled “newHistory”The compacted history messages to replace with
Returns
Section titled “Returns”void