Struct FlowBuilder
pub struct FlowBuilder { /* private fields */ }Expand description
Builder for a Flow using the cemented verbs.
Implementations§
§impl FlowBuilder
impl FlowBuilder
pub fn step(self, id: impl Into<String>) -> FlowBuilder
pub fn step(self, id: impl Into<String>) -> FlowBuilder
Declare a new step.
pub fn after(self, dep: impl Into<String>) -> FlowBuilder
pub fn after(self, dep: impl Into<String>) -> FlowBuilder
Add a dependency (call multiple times for multiple deps).
pub fn gate(self, g: Guard) -> FlowBuilder
pub fn gate(self, g: Guard) -> FlowBuilder
Extra eligibility guard beyond dependencies.
pub fn done(self, g: Guard) -> FlowBuilder
pub fn done(self, g: Guard) -> FlowBuilder
Completion condition.
pub fn posture(self, text: impl Into<String>) -> FlowBuilder
pub fn posture(self, text: impl Into<String>) -> FlowBuilder
Instruction imposed while active.
pub fn ground(self, template: impl Into<String>) -> FlowBuilder
pub fn ground(self, template: impl Into<String>) -> FlowBuilder
A grounding template projected while active — a curated, State-
interpolated fact line that pins the model to known values. {key}
interpolates a value; {key?yes:no} picks by truthiness. See
render_ground.
pub fn allow<I, S>(self, tools: I) -> FlowBuilder
pub fn allow<I, S>(self, tools: I) -> FlowBuilder
Tools available while active (whitelist).
pub fn deny<I, S>(self, tools: I) -> FlowBuilder
pub fn deny<I, S>(self, tools: I) -> FlowBuilder
Tools forbidden while active.
pub fn terminal(self) -> FlowBuilder
pub fn terminal(self) -> FlowBuilder
Mark the current step terminal.
pub fn once(self, tool: impl Into<String>) -> FlowBuilder
pub fn once(self, tool: impl Into<String>) -> FlowBuilder
A tool may run at most once.
pub fn before(self, a: impl Into<String>, b: impl Into<String>) -> FlowBuilder
pub fn before(self, a: impl Into<String>, b: impl Into<String>) -> FlowBuilder
Ordering invariant: a before b.
pub fn require<I, S>(self, steps: I) -> FlowBuilder
pub fn require<I, S>(self, steps: I) -> FlowBuilder
Required terminal steps for completion.
pub fn ambient<I, S>(self, tools: I) -> FlowBuilder
pub fn ambient<I, S>(self, tools: I) -> FlowBuilder
Exempt cross-cutting tools from every step’s allow whitelist.
Flow-level, and order-independent with respect to .step(..). Use it for
tools that serve the conversation rather than any one step of it —
memory recall, escalation, logging. A tool named here still obeys
deny, once and never(..).until(..); see Flow::ambient.
let flow = Flow::new()
.ambient(["recall_context"])
.step("book")
.allow(["book_table"])
.done(Guard::called_ok("book_table"))
.build()
.unwrap();
assert_eq!(flow.ambient, ["recall_context"]);pub fn never(self, tool: impl Into<String>) -> NeverBuilder
pub fn never(self, tool: impl Into<String>) -> NeverBuilder
Forbid a tool until a guard holds (never(tool).until(guard)).
pub fn commit(self, tool: impl Into<String>, until: Guard) -> FlowBuilder
pub fn commit(self, tool: impl Into<String>, until: Guard) -> FlowBuilder
Commit-tool sugar: at most once, gated until until, and flagged for
confirmation. Composes once + never…until + the confirmation seam.