Runner class

Coordinates session lifecycle, plugins, and agent execution.

Constructors

Runner({App? app, String? appName, BaseAgent? agent, List<BasePlugin>? plugins, required BaseSessionService sessionService, BaseArtifactService? artifactService, Object? memoryService, Object? credentialService, Duration? pluginCloseTimeout, bool autoCreateSession = false})
Creates a runner from an app or direct appName/agent pair.

Properties

agent BaseAgent
Root agent executed by this runner.
getter/setter pair
app App?
Optional app container used to initialize runner defaults.
final
appName String
Effective application name used for session lookups.
getter/setter pair
artifactService BaseArtifactService?
Artifact persistence service, if configured.
final
autoCreateSession bool
Whether missing sessions should be created automatically.
final
contextCacheConfig Object?
Optional context-cache configuration forwarded to invocation context.
getter/setter pair
credentialService Object?
Credential service implementation used by auth-aware tools.
final
hashCode int
The hash code for this object.
no setterinherited
memoryService Object?
Memory service implementation or adapter payload.
final
pluginManager PluginManager
Plugin manager orchestrating lifecycle and callbacks.
final
resumabilityConfig ResumabilityConfig?
Optional resumability policy for invocation replay/resume.
getter/setter pair
resumabilityConfigOrDefault bool
Whether this runner should support invocation resumption.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionService BaseSessionService
Session service used for reads/writes during execution.
final

Methods

close() Future<void>
Closes toolsets and plugin manager resources.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rewindAsync({required String userId, required String sessionId, required String rewindBeforeInvocationId, RunConfig? runConfig}) Future<void>
Rewinds session state and artifact versions to before an invocation.
run({required String userId, required String sessionId, required Content newMessage, RunConfig? runConfig}) Stream<Event>
Convenience wrapper that forwards to runAsync.
runAsync({required String userId, required String sessionId, String? invocationId, Content? newMessage, Map<String, Object?>? stateDelta, RunConfig? runConfig}) Stream<Event>
Executes a single invocation and streams emitted events.
runDebug(Object userMessages, {String userId = 'debug_user_id', String sessionId = 'debug_session_id', RunConfig? runConfig, bool quiet = false}) Future<List<Event>>
Runs one or more debug user messages and returns collected events.
runLive({required LiveRequestQueue liveRequestQueue, String? userId, String? sessionId, Session? session, RunConfig? runConfig}) Stream<Event>
Executes live bidirectional agent streaming with liveRequestQueue.
toString() String
A string representation of this object.
inherited

Operators

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