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.
Properties
Section titled “Properties”run: (
text,steps,t) =>Promise<{log?:string;outcome:"success"|"failed";text:string; }>
Defined in: types/plugin-types/index.ts:163
Parameters
Section titled “Parameters”string
StepInfo[]
Returns
Section titled “Returns”Promise<{ log?: string; outcome: "success" | "failed"; text: string; }>
shouldRun
Section titled “shouldRun”shouldRun: (
text,steps?) =>boolean
Defined in: types/plugin-types/index.ts:162
Parameters
Section titled “Parameters”string
steps?
Section titled “steps?”StepInfo[]
Returns
Section titled “Returns”boolean
statusId
Section titled “statusId”statusId:
string
Defined in: types/plugin-types/index.ts:161
statusLabel
Section titled “statusLabel”statusLabel: (
t) =>string
Defined in: types/plugin-types/index.ts:160
Parameters
Section titled “Parameters”Returns
Section titled “Returns”string