SwappableMessagingRepository class final
A MessagingRepository whose backing implementation can be replaced at
runtime. The CLI uses this so the agent messaging fabric can follow the
EFFECTIVE session root: when session creation falls back from the shared
root (macOS App Group) to ~/.fah/sessions, the mailboxes must move with
it — a fabric pinned to the old root would let an attached app write into
inboxes no running process ever drains.
- Implemented types
Constructors
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
-
directory(
) → Future< List< MailboxEntry> > -
The known mailboxes in the fabric, with optional cwd metadata. The
FULL set (live and stale alike) — live/dead filtering is a display
policy above this layer, not a repository concern.
override
-
drain(
String agentId) → Future< List< AgentMessage> > -
The unread messages for
agentId, oldest first, consumed (marked read). A drained message never appears again.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
peek(
String agentId) → Future< List< AgentMessage> > -
The unread messages for
agentId, oldest first, without consuming them.override -
register(
String agentId, {String? sessionName, List< AgentCapability> capabilities = const []}) → Future<void> -
Announces
agentId's mailbox in the directory (presence): an agent with no mail yet is still discoverable.sessionName, when non-empty, publishes the session's display name so peers can address this mailbox by name (goal_builderinstead ofsess1/main).capabilitiespublishes the host's discovery metadata (fabric.enable(name, capabilities)— see AgentCapability); an empty list clears any previously announced set. Called by hosts on session start/switch.override -
send(
AgentMessage message) → Future< void> -
Delivers
messageto the recipient's inbox. Implementations must assign/keep a unique AgentMessage.id and never lose a message silently (a failed delivery throws).override -
swap(
MessagingRepository repo) → void -
Atomically replaces the delegate repository. In-flight calls finish on
their old delegate; every later call goes to
repo. -
toString(
) → String -
A string representation of this object.
inherited
-
touch(
String agentId, {bool busy = false}) → Future< void> -
Refreshes
agentId's liveness marker (a heartbeat): hosts call this periodically while the agent runs so directory consumers can tell live mailboxes from abandoned ones WITHOUT any pending mail.busyreports an agent run in progress (mail still accepted — steering semantics); a freshbusybeats the liveness heuristics in directory views. Best-effort by contract — a failing backend never breaks the caller's loop.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited