Optional ReadonlydenialUsage gate denial code. Populated only when stopReason == "ai_denied".
Optional ReadonlydenialUser-facing usage gate denial message. Populated only when stopReason == "ai_denied".
ReadonlyexchangesNumber of times the onTurn continuation callback was invoked. Always 0 when no callback was provided.
ReadonlyinputTotal input tokens consumed across all iterations of this call.
ReadonlyiterationsNumber of provider round-trips performed (each tool_use cycle counts as one).
ReadonlyoutputTotal output tokens consumed across all iterations of this call.
ReadonlystopReason the model stopped emitting. Provider-native when the model itself stopped — Anthropic emits "end_turn" / "max_tokens" / "tool_use"; OpenAI-compatible providers (OpenAI, Groq, Together, Mistral, …) emit "stop" / "length" / "tool_calls". Synthetic values added by the BSJS orchestration layer: "ai_denied", "budget_exceeded", "iteration_limit", "max_iterations", "on_turn_exchange_limit", "on_turn_returned_invalid". Provider/transport failures (rate limits, circuit breaker, etc.) are thrown as exceptions to the script rather than returned in this field. Scripts that need to branch on "normal end of turn" should match both "end_turn" and "stop" rather than hard-coding a single provider's vocabulary.
ReadonlytextFinal assistant text response.
ReadonlytoolSummary of tool calls executed during this call. In agent stub mode (AiAgent.sendMessage(message, false)) every entry has result: "action queued" and isError: false — no executor was invoked.
Result of B.ai.call().