Skip to main content

Class: ChatConversationStore

Defined in: .source/wunderland/src/channels/chat/ChatConversationStore.ts:18

Persists conversation history in SQLite for chat task responder sessions. Each conversation is keyed by chatId and trimmed to a configurable limit.

Constructors

Constructor

new ChatConversationStore(dbPath, limit?): ChatConversationStore

Defined in: .source/wunderland/src/channels/chat/ChatConversationStore.ts:28

Parameters

dbPath

string

Path to the SQLite database file.

limit?

number = 50

Maximum messages per conversation (oldest trimmed first).

Returns

ChatConversationStore

Methods

addMessage()

addMessage(msg): Promise<void>

Defined in: .source/wunderland/src/channels/chat/ChatConversationStore.ts:54

Add a message to the conversation history. Trims excess if over limit.

Parameters

msg

Omit<ConversationMessage, "id" | "createdAt">

Returns

Promise<void>


close()

close(): void

Defined in: .source/wunderland/src/channels/chat/ChatConversationStore.ts:81

Close the database connection.

Returns

void


getHistory()

getHistory(chatId): Promise<ConversationMessage[]>

Defined in: .source/wunderland/src/channels/chat/ChatConversationStore.ts:73

Get recent conversation history for a chat, ordered oldest first.

Parameters

chatId

string

Returns

Promise<ConversationMessage[]>