Interfaces

MessageMiddlewareContext

Interface: MessageMiddlewareContext

Defined in: src/core/agent/middleware/types.ts:218

The message a message middleware is deciding about.

Properties

content

readonly content: string

Defined in: src/core/agent/middleware/types.ts:228

The content as THIS middleware sees it — earlier transforms applied.


history

readonly history: readonly LLMMessage[]

Defined in: src/core/agent/middleware/types.ts:230

Conversation so far. Empty at 'input'.


identity?

readonly optional identity?: MemoryIdentity

Defined in: src/core/agent/middleware/types.ts:231


phase

readonly phase: "input" | "output"

Defined in: src/core/agent/middleware/types.ts:226

'input' runs at the very top of the run, BEFORE the user's message is committed — so the window strategies, the injections, the slots, the request bytes and every later slice all see the transformed text and agree with each other. 'output' runs where the final answer is captured, so the record and the caller receive the same string.


signal?

readonly optional signal?: AbortSignal

Defined in: src/core/agent/middleware/types.ts:232

On this page