MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / transition

Function transition

atomic-agent/src/turn/phase.rs:452–459  ·  view source on GitHub ↗

Compute the next phase and required actions given the current phase and an event. This is a **pure function** with no side effects. The caller (orchestrator) is responsible for executing the returned actions. Unknown or empty phase values are normalized to `Idle` for backward compatibility with session state files created before phase tracking. # Arguments `current` — The current session phase

(current: Phase, event: Event, ctx: TransitionContext)

Source from the content-addressed store, hash-verified

450/// assert!(r.requires_recording());
451/// ```
452pub fn transition(current: Phase, event: Event, ctx: TransitionContext) -> TransitionResult {
453 match current {
454 Phase::Idle => transition_from_idle(event),
455 Phase::Active => transition_from_active(event),
456 Phase::ActiveRecorded => transition_from_active_recorded(event),
457 Phase::Ended => transition_from_ended(event, ctx),
458 }
459}
460
461fn transition_from_idle(event: Event) -> TransitionResult {
462 match event {

Calls 4

transition_from_idleFunction · 0.85
transition_from_activeFunction · 0.85
transition_from_endedFunction · 0.85