Skip to content
mercury framework
GitHub

InboundTurn

InboundTurn = object

Defined in: types/channel-types/index.ts:112

One inbound message, already resolved by its provider into the shape the shared layer needs.

optional abortSignal?: AbortSignal

Defined in: types/channel-types/index.ts:141

When set, aborting it cancels the turn: one still waiting never starts, and one running stops its model call. A cancelled turn isn’t an answer: finalize is never called (an open reasoning block still gets onReasoningEnd(id, true)), the sink is still released with dispose, and the turn resolves instead of throwing. The history keeps the person’s message with a marker in place of the half answer. HTTP aborts it when the client disconnects, Google Chat when the person presses Stop or sends /stop.


channel: string

Defined in: types/channel-types/index.ts:114

Stable provider id for the tool log — a free string, each provider supplies its own.


optional languageHint?: string

Defined in: types/channel-types/index.ts:165

The language the caller’s client asks for, as an Accept-Language value (it-IT,it;q=0.9,en;q=0.8), when the channel has one. The core uses it for the turn’s texts when the person saved no language of their own; it never overrides the one they saved.


logPrefix: string

Defined in: types/channel-types/index.ts:124

stderr log prefix, e.g. [chat:spaces/x:users/y] — empty for the terminal.


multiUser: boolean

Defined in: types/channel-types/index.ts:116

Whether the conversation can carry more than one person — selects the NO_REPLY system-prompt variant.


optional opening?: true

Defined in: types/channel-types/index.ts:158

Set, with an empty text, when the person hasn’t written anything and the channel asks the assistant to speak first (the HTTP surface, right after someone signs in). The core speaks only to someone it doesn’t know the name of, introducing itself and asking how to call them; otherwise the turn finalizes with an empty text and nothing is kept.


principal: Principal

Defined in: types/channel-types/index.ts:122

Who is talking, as the channel knows them. Read only by the core, never handed to tools.


optional resume?: object

Defined in: types/channel-types/index.ts:150

Set when sessionKey names a conversation its client reopens whenever it wants (one of many a person keeps, as on HTTP), rather than a single running thread (as a Google Chat space): once the core has let go of its history, the next turn rebuilds it from the archive. maxChars is the channel’s own budget for what comes back; absent, the core’s (SESSION_RESUME_MAX_CHARS), and 0 turns resuming off.

optional maxChars?: number


optional resumeAfterConfirm?: true

Defined in: types/channel-types/index.ts:130

Set when the turn resumes after a confirmation whose result goes back to the model (ConfirmReply.resume): the core runs the model on what it kept for the session, and text is ignored. With nothing kept (expired, lost to a restart, or already resumed), the core answers that the confirmed action’s answer is no longer available (core.resume.gone).


sessionKey: string

Defined in: types/channel-types/index.ts:120

Opaque session key. Derived by the provider, never parsed above it.


text: string

Defined in: types/channel-types/index.ts:118

Text handed to the model, already provider-decorated (e.g. Google Chat’s “[Da: X]” marker).


optional timeZoneHint?: string

Defined in: types/channel-types/index.ts:172

The time zone the caller’s client is in, as its IANA name (Europe/Rome), when the channel has one. The core stamps the turn with the time there when the person saved no time zone of their own; it never overrides the one they saved, and a name that isn’t a zone is ignored.