The result of useUiDecision in chat mode. The transcript, rendered UI, tools and loading state stay on the chat.
API
interface UseUiDecisionChatResult {decision: UseUiDecisionChatDecision; decisionError: Error | undefined;isDeciding: boolean;sendMessage: (content: string) => void;}The underlying selection decision.
Error | undefinedThe last decision failure. When set, the message was sent with every component. A DecisionSchemaError here means the components could not be decided over (for example more than 255 with 'one', or a name containing .), so no decision was asked.
booleanWhether a decision is in flight.
(content: string) => voidDecides about content, sets the chat's components to the chosen ones (plus their declared children), then sends content to the chat. When that turn finishes, errors or stops, or the chat never starts it, the chat's components are set back to the full list. Calling it again while a decision is pending aborts that decision, so only the latest message is sent.
Throws at once, like the chat's own sendMessage, when the chat cannot take a message (for example while an interrupt batch is pending). When the chat refuses the message after the decision, the components are restored and the error is exposed as decisionError.