Skip to content

@ReplyInterpreter

@ReplyInterpreter ("@agboss/core") declares the component that converts a free-text human reply (app.resume({ pauseId, reply })) into the typed decision required by a @ChannelRole. Each @ReplyInterpreter belongs to a single @ChannelRole({ replyInterpreter }) and can be driven either by a model (DecidedBy.Model) or by deterministic TypeScript (DecidedBy.Code).

How to declare a @ReplyInterpreter (DecidedBy.Model & DecidedBy.Code)

Section titled “How to declare a @ReplyInterpreter (DecidedBy.Model & DecidedBy.Code)”

A @ReplyInterpreter name must end with -reply-interpreter. Downstream code always consumes validated types — never raw reply strings:

@ReplyInterpreter options & ReplyInterpretation reference

Section titled “@ReplyInterpreter options & ReplyInterpretation reference”
Option / Helper Applies To Description
name Both Kebab-case identifier ending with -reply-interpreter.
description Both Non-empty description of how the reply is interpreted.
decidedBy Both DecidedBy.Model or DecidedBy.Code.
model DecidedBy.Model Chat model (uses a single structured answer tool) or — for an approval role only — a decision model (Decision.noul("approved"); using a decision model on a question role fails with [reply-interpreter.decision-model]).
prompt / promptUrls DecidedBy.Model Static instructions for interpreting the reply (the pause’s ask and reply arrive in the user message).
deps DecidedBy.Code Optional constructor dependency tokens injected into the ReplyInterpreterHandler class.
ReplyInterpretation.understood(decision) DecidedBy.Code Returns a parsed decision to be validated against the channel role’s answer DTO.
ReplyInterpretation.notUnderstood({ reason }) DecidedBy.Code Rejects app.resume({ pauseId, reply }) with UninterpretableReplyError (carrying .reason) while keeping the pause Pending.