Skip to main content

Properties

required
Unified History API. Sub-APIs:
  • history.user — cross-platform per-user transcript store (throws if not configured)
  • history.thread — per-thread message listing
  • history.channel — channel-level messages and thread listings
Cross-platform per-user transcript store. Deprecated alias for ChatInstance.history.user — throws on access when user history was not configured (history.user or legacy transcripts + identity).
Deprecated: Use ChatInstance.history.user instead.

Methods

abortTurn()

Abort active work for a conversation, including work running in another process that shares the configured state adapter.

Parameters

string
required

Returns

Promise<void>

getLogger()

Get the configured logger, optionally with a child prefix

Parameters

string

Returns

Logger

getState()

Returns

StateAdapter

getUserName()

Returns

string

handleIncomingMessage()

Parameters

required
string
required
required

Returns

Promise<void>

processAction()

Process an incoming action event (button click) from an adapter. Handles waitUntil registration and error catching internally.

Parameters

Omit<ActionEvent<unknown>, "thread" | "openModal"> & { adapter: Adapter }
required
Type: ActionEventAdapterThe action event (without thread field, will be added)
WebhookOptions | undefined
required
Type: WebhookOptionsWebhook options including waitUntil

Returns

Promise<void>

processAgentSessionStopped()

Parameters

processAgentSessionTitleChanged()

Parameters

processAppContextChanged()

Parameters

processAppHomeOpened()

Parameters

processAssistantContextChanged()

Parameters

processAssistantThreadStarted()

Parameters

processInstalled()

Optional so custom ChatInstance implementations predating it keep compiling.

Parameters

processMemberJoinedChannel()

Parameters

processMessage()

Process an incoming message from an adapter. Handles waitUntil registration and error catching internally.

Parameters

required
The adapter that received the message
string
required
The thread ID
Message<unknown> | () => Promise<Message<unknown>>
required
Type: MessageMessageEither a parsed message, or a factory function for lazy async parsing
Webhook options including waitUntil

Returns

Promise<void>

processMessageDeleted()

Process an incoming message delete from an adapter. Handles waitUntil registration and error catching internally.

Parameters

Omit<MessageDeletedEvent<unknown>, "platform" | "adapter"> & { adapter: Adapter…
required
Type: MessageDeletedEventAdapterThe normalized delete event
Webhook options including waitUntil

Returns

Promise<void>

processMessageUpdated()

Process an incoming message update from an adapter. Handles waitUntil registration and error catching internally.

Parameters

{ adapter: Adapter; message: Message<unknown> | () => Promise<Message<unknown>>…
required
Webhook options including waitUntil

Returns

Promise<void>

processModalClose()

Process a modal close event from an adapter.

Parameters

Omit<ModalCloseEvent, "relatedThread" | "relatedMessage" | "relatedChannel">
required
Type: ModalCloseEventThe modal close event (without relatedThread/relatedMessage/relatedChannel)
string
Context ID for retrieving stored thread/message/channel context
Webhook options

processModalSubmit()

Process a modal submit event from an adapter.

Parameters

Omit<ModalSubmitEvent, "relatedThread" | "relatedMessage" | "relatedChannel">
required
Type: ModalSubmitEventThe modal submit event (without relatedThread/relatedMessage/relatedChannel)
string
Context ID for retrieving stored thread/message/channel context
Webhook options

Returns

ModalResponse

processOptionsLoad()

Process an interactive options load event from an adapter. Returns normalized select options for the adapter to render.

Parameters

Returns

OptionsLoadResult

processReaction()

Process an incoming reaction event from an adapter. Handles waitUntil registration and error catching internally.

Parameters

Omit<ReactionEvent<unknown>, "thread" | "adapter"> & { adapter: Adapter<unknown…
required
Type: ReactionEventAdapterThe reaction event (without adapter field, will be added)
Webhook options including waitUntil

Returns

void | Promise<void>

processSlashCommand()

Process an incoming slash command from an adapter. Handles waitUntil registration and error catching internally.

Parameters

Omit<SlashCommandEvent<Record<string, unknown>>, "channel" | "openModal"> & { a…
required
Type: SlashCommandEventAdapterThe slash command event
WebhookOptions | undefined
required
Type: WebhookOptionsWebhook options including waitUntil

Returns

void | Promise<void>

processUninstalled()

Optional so custom ChatInstance implementations predating it keep compiling.

Parameters