AgentProtocolEvent class sealed

One harness-owned protocol event decoded into the grid-side vocabulary.

Available extensions
Annotations
  • @freezed

Constructors

AgentProtocolEvent.completed({required Map<String, String> result, required UsageReport usage})
Reports harness completion with structured result and usage.
const
factory
AgentProtocolEvent.failed({required String reason, @Default.new(CapabilityFailureKind.work) CapabilityFailureKind kind, @Default.new(<String, String>{}) Map<String, String> fields})
Reports a harness protocol failure, and WHY it failed.
const
factory
AgentProtocolEvent.permissionFallback({required AgentPermissionDecision decision})
Reports an authorization the CHANNEL itself already settled — always a cancellation, never a grant.
const
factory
AgentProtocolEvent.permissionRequested({required AgentPermissionRequest request})
Reports one mid-turn permission ask awaiting the STATION's answer.
const
factory
AgentProtocolEvent.progress({@Default.new(<String, String>{}) Map<String, String> fields})
Reports non-terminal harness progress.
const
factory
AgentProtocolEvent.sessionBound({required String attemptId, required String protocolSessionId})
Reports that the harness bound a protocol session for attemptId.
const
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<TResult extends Object?>({required TResult progress(AgentProtocolProgress value), required TResult completed(AgentProtocolCompleted value), required TResult failed(AgentProtocolFailed value), required TResult sessionBound(AgentProtocolSessionBound value), required TResult permissionRequested(AgentProtocolPermissionRequested value), required TResult permissionFallback(AgentProtocolPermissionFallback value)}) → TResult

Available on AgentProtocolEvent, provided by the AgentProtocolEventPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? progress(AgentProtocolProgress value)?, TResult? completed(AgentProtocolCompleted value)?, TResult? failed(AgentProtocolFailed value)?, TResult? sessionBound(AgentProtocolSessionBound value)?, TResult? permissionRequested(AgentProtocolPermissionRequested value)?, TResult? permissionFallback(AgentProtocolPermissionFallback value)?}) → TResult?

Available on AgentProtocolEvent, provided by the AgentProtocolEventPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult progress(AgentProtocolProgress value)?, TResult completed(AgentProtocolCompleted value)?, TResult failed(AgentProtocolFailed value)?, TResult sessionBound(AgentProtocolSessionBound value)?, TResult permissionRequested(AgentProtocolPermissionRequested value)?, TResult permissionFallback(AgentProtocolPermissionFallback value)?, required TResult orElse()}) → TResult

Available on AgentProtocolEvent, provided by the AgentProtocolEventPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>({TResult progress(Map<String, String> fields)?, TResult completed(Map<String, String> result, UsageReport usage)?, TResult failed(String reason, CapabilityFailureKind kind, Map<String, String> fields)?, TResult sessionBound(String attemptId, String protocolSessionId)?, TResult permissionRequested(AgentPermissionRequest request)?, TResult permissionFallback(AgentPermissionDecision decision)?, required TResult orElse()}) → TResult

Available on AgentProtocolEvent, provided by the AgentProtocolEventPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult progress(Map<String, String> fields), required TResult completed(Map<String, String> result, UsageReport usage), required TResult failed(String reason, CapabilityFailureKind kind, Map<String, String> fields), required TResult sessionBound(String attemptId, String protocolSessionId), required TResult permissionRequested(AgentPermissionRequest request), required TResult permissionFallback(AgentPermissionDecision decision)}) → TResult

Available on AgentProtocolEvent, provided by the AgentProtocolEventPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>({TResult? progress(Map<String, String> fields)?, TResult? completed(Map<String, String> result, UsageReport usage)?, TResult? failed(String reason, CapabilityFailureKind kind, Map<String, String> fields)?, TResult? sessionBound(String attemptId, String protocolSessionId)?, TResult? permissionRequested(AgentPermissionRequest request)?, TResult? permissionFallback(AgentPermissionDecision decision)?}) → TResult?

Available on AgentProtocolEvent, provided by the AgentProtocolEventPatterns extension

A variant of when that fallback to returning null

Operators

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