Skip to content
mercury framework
GitHub

PostTurnGuard

PostTurnGuard = object

Defined in: types/plugin-types/index.ts:159

A post-turn guard: something run over the model’s finished text before it reaches the user. shouldRun gates both the transformation and its status indicator; run returns the (possibly unchanged) text plus an outcome that drives the status pair and an optional diagnostic log. steps is offered to both for guards that need the turn’s tool trace (a turn resumed after a confirmation starts with the confirmed call); a guard is free to ignore it, and an older core passes none to shouldRun. A guard that throws never blocks delivery — the core wraps each one. t gives the texts of the turn’s person: the status line and anything run adds.

run: (text, steps, t) => Promise<{ log?: string; outcome: "success" | "failed"; text: string; }>

Defined in: types/plugin-types/index.ts:163

string

StepInfo[]

Translate

Promise<{ log?: string; outcome: "success" | "failed"; text: string; }>


shouldRun: (text, steps?) => boolean

Defined in: types/plugin-types/index.ts:162

string

StepInfo[]

boolean


statusId: string

Defined in: types/plugin-types/index.ts:161


statusLabel: (t) => string

Defined in: types/plugin-types/index.ts:160

Translate

string