SessionLifecycle class

Callbacks for session-level lifecycle events.

A session spans from the moment the CLI starts to when it exits. Implementations can track cost, enforce timeouts, or persist state.

Constructors

SessionLifecycle({Future<void> onSessionStart(SessionStartedEvent event)?, Future<void> onSessionEnd(SessionEndedEvent event)?, Future<void> onSessionPause(SessionPausedEvent event)?, Future<void> onSessionResume(SessionResumedEvent event)?})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
onSessionEnd Future<void> Function(SessionEndedEvent event)?
Fired when the session ends (graceful shutdown or timeout).
final
onSessionPause Future<void> Function(SessionPausedEvent event)?
Fired when the session is paused (e.g., backgrounded).
final
onSessionResume Future<void> Function(SessionResumedEvent event)?
Fired when the session resumes from a paused state.
final
onSessionStart Future<void> Function(SessionStartedEvent event)?
Fired when a new session begins.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited