1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// SPDX-License-Identifier: Apache-2.0
//
//! The conversation decision-maker seam.
//!
//! The embedder implements [`AgentBrain`] over its own engine; flowcat-core
//! ships a demo brain. The brain owns the system prompt + tool set for the
//! current state and decides what a tool call means (see DESIGN.md
//! "Trait contracts").
//!
//! [`BrainAction`] and [`ToolDecl`] are defined in [`crate::types`] (the shared
//! data-type module) and re-exported here, which is their contract location.
use Value;
// Re-export so callers can use `crate::brain::{BrainAction, ToolDecl}` as the
// design lays out, while the type definitions live in `frame`.
pub use crate;
/// Drives the conversation: provides the active prompt + tools, interprets tool
/// calls into [`BrainAction`]s, and reports completion + collected variables.
///
/// Synchronous on purpose — the brain is pure decision logic; any I/O it needs
/// (e.g. the embedder's engine) is done by the implementor before/around these calls.