Skip to content

NeedsClarification

Defined in: packages/protocol/src/lib/needs-clarification.ts:33

A Planner result that asks the user a question. It may also carry the changes the Planner could already make alongside the question: for “Show Apple and Alphabet stock” it can lay out Apple and ask which Alphabet share class the user means. Without layout and executionPlan it leaves the screen unchanged.

M is the request’s layout mode and picks the layout shape, as GridResponse and TilingResponse do for a plan result. The default accepts either shape.

Only valid when the chart request set skipReply: true. A caller that leaves skipReply unset expects a reply-bearing response, so the Engine rejects this result on that path. Engine validation accepts it when the flag is set, but Engine.handle still refuses it with Err(ValidationError) on field skipReply, because a chart_response has no shape for a question. A replyless plan result does ship, with userMessage absent.

M extends LayoutMode = LayoutMode

readonly optional executionPlan?: readonly object[]

Defined in: packages/protocol/src/lib/needs-clarification.ts:52

Actions the Planner could already plan, in order, with the same shape and limit as a plan result’s execution plan. A caller that acts on the clarification runs them after applying layout. Absent means no Actions.


readonly optional layout?: ClarificationLayoutFor<M>

Defined in: packages/protocol/src/lib/needs-clarification.ts:45

Layout the Planner could already settle, in the request’s mode. A caller that acts on the clarification applies it before asking the question. Absent means the current layout stays as it is.


readonly optional options?: readonly string[]

Defined in: packages/protocol/src/lib/needs-clarification.ts:39

Suggested answers the caller may offer the user. Each one is non-blank.


readonly question: string

Defined in: packages/protocol/src/lib/needs-clarification.ts:37

The question the Planner needs answered before it can proceed. Never blank.


readonly type: "needs_clarification"

Defined in: packages/protocol/src/lib/needs-clarification.ts:35

Discriminant that tells this result apart from a plan result.


readonly optional verdicts?: readonly PlannerReasonVerdict[]

Defined in: packages/protocol/src/lib/needs-clarification.ts:58

Verdicts on the request’s user_intent reasons, one per reason id the Planner can name. A reason without a verdict shares this result’s outcome. Absent means every reason does.