FakeAgentInterface class final

The agent interface state of one FakeWorld; FakeAgentInterface.of gives the one of a world.

Properties

autocompleteRequests → List<({String commandId, String option, String value})>
Every autocompleteCommand request in order: command ID, option and value.
final
commands → Map<String, JsonMap>
The registered commands by ID (API Command).
final
hashCode → int
The hash code for this object.
no setterinherited
interactions → Map<String, JsonMap>
The interactions by principal|client_interaction_id (API Interaction).
final
invocations → List<JsonMap>
Every accepted invokeCommand in order (API CommandInvoke with the command and the person).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sessions → Map<String, List<JsonMap>>
The agent sessions per thread (API AgentSession), oldest first.
final
suggestions → Map<String, FakeAutocomplete>
The option suggestions by command ID.
final
world → FakeWorld
The world.
final

Methods

addEarlierSession(String threadId, String agentId, String externalRef) → JsonMap
Adds an earlier session of agentId in threadId with externalRef (/resume chooses it).
commandsOf(String channelId) → List<JsonMap>
The commands offered in channelId (listChannelCommands): those of agents that see the channel, on the instance, the channel's space or the channel; the operator's first, then by lower-case name, owner and ID. The fake has no guest rule and no app commands.
componentById(String componentId) → ({JsonMap component, JsonMap message})?
The component componentId with its message, or null.
currentSession(String threadId, String agentId) → JsonMap
The current agent session of agentId in threadId, created on first use (09 9).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postAnchor(String agentId, String runId) → String
Writes the live box anchor of runId (kind = run, 09 5.4): an agent message without text behind the triggering message, then its run_id as message.updated.
postCard(String agentId, String threadId, String text, List<JsonMap> components, {String? runId}) → String
Posts a card of agentId into threadId (kind = card, 09 11): the message with text, then its components (ComponentCreate-like maps with custom_id, type, definition and optional single_use, required_capability, restricted_to, expires_at) bound to runId; the components follow as message.updated, as the server writes the card row before its components (09 11.4). Returns the message ID.
registerCommand(String ownerId, String name, {String description = '', List<JsonMap> options = const [], bool control = false, String scopeKind = 'instance', String? scopeId, FakeAutocomplete? autocomplete}) → String
Registers the command name of ownerId on the instance (or scopeKind and scopeId) and appends command.changed; returns its ID.
replaceSession(String threadId, String agentId, {required String reason, String? externalRef}) → JsonMap
Ends the current session of threadId with reason and starts a new one, bound to externalRef when given (resetAgentSession, bindAgentSession).
toString() → String
A string representation of this object.
inherited
used(String componentId) → bool
Whether componentId was used (a card's script waits for it).

Operators

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

Static Methods

of(FakeWorld world) → FakeAgentInterface
The agent interface of world, created on first use.