CallbackChatSession class

Adapts an existing ACP/client controller without transferring its ownership. The host projects protocol state once, then reuses the common UI unchanged.

Inheritance

Constructors

CallbackChatSession({required Listenable changes, required ChatSessionState readState(), required Future<void> onSend(String text, List<PromptAttachment> attachments), required Future<void> onStop(), Future<void> onResolvePermission(ChatPermissionDecision)?, Future<void> onSelectPermissionOption(String)?, Future<void> onSetConfigOption(String, Object)?})

Properties

changes Listenable
final
hashCode int
The hash code for this object.
no setterinherited
onResolvePermission Future<void> Function(ChatPermissionDecision)?
final
onSelectPermissionOption Future<void> Function(String)?
final
onSend Future<void> Function(String text, List<PromptAttachment> attachments)
final
onSetConfigOption Future<void> Function(String, Object)?
final
onStop Future<void> Function()
final
readState ChatSessionState Function()
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state ChatSessionState
no setteroverride

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object notifies its listeners.
override
clearQueuedPrompts() → void
inherited
guideQueuedPrompt(int id) → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that the object notifies.
override
removeQueuedPrompt(int id) → void
inherited
reorderQueuedPrompt(int oldIndex, int newIndex) → void
inherited
resolvePermission(ChatPermissionDecision decision) Future<void>
override
selectPermissionOption(String optionId) Future<void>
override
send(String text, {List<PromptAttachment> attachments = const []}) Future<void>
override
setConfigOption(String id, Object value) Future<void>
override
setExecutionPolicy(ChatToolCallExecutionPolicy policy) → void
inherited
stop() Future<void>
override
toString() String
A string representation of this object.
inherited

Operators

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