The roster port: a 0-arity fn returning a seq of Agent.
slave->agent promotes a swarm slave map to an Agent, enriched with the
latest hivemind shout of that agent when one is known. agents keeps the
observable members of a swarm: lings and drones that are still alive, each
ling followed by its own drones. A failed agent stays visible, because an
observer has to see failure; only the dead (terminated, zombie, or marked
not alive) are dropped.
live-roster-fn is the default adapter. It resolves the host swarm's
hive-mcp.swarm.datascript.queries/get-all-slaves, and optionally
hive-mcp.hivemind.status/get-agent-messages, lazily at call time, and
degrades to [] while the host is absent, reporting through ON-WARNING. No
compile-time dependency on the host.
The roster port: a 0-arity fn returning a seq of Agent. `slave->agent` promotes a swarm slave map to an Agent, enriched with the latest hivemind shout of that agent when one is known. `agents` keeps the observable members of a swarm: lings and drones that are still alive, each ling followed by its own drones. A failed agent stays visible, because an observer has to see failure; only the dead (terminated, zombie, or marked not alive) are dropped. `live-roster-fn` is the default adapter. It resolves the host swarm's `hive-mcp.swarm.datascript.queries/get-all-slaves`, and optionally `hive-mcp.hivemind.status/get-agent-messages`, lazily at call time, and degrades to [] while the host is absent, reporting through ON-WARNING. No compile-time dependency on the host.
Qualified symbol of the optional host query for an agent's recent shouts.
Qualified symbol of the optional host query for an agent's recent shouts.
(agents slaves)(agents slaves shouts-of now)Agents for the observable members of SLAVES, each ling followed by its drones, a ling carrying its live drone count. Drones whose ling is not observable follow the lings. SHOUTS-OF is (fn [agent-id] -> shouts) and NOW epoch ms; both optional.
Agents for the observable members of SLAVES, each ling followed by its drones, a ling carrying its live drone count. Drones whose ling is not observable follow the lings. SHOUTS-OF is (fn [agent-id] -> shouts) and NOW epoch ms; both optional.
Slave statuses that mean the agent is gone, not failing.
Slave statuses that mean the agent is gone, not failing.
How long an agent that left the swarm stays visible with its final event.
How long an agent that left the swarm stays visible with its final event.
(departures old new){agent-id messages} for the agents in registry map OLD that are absent from NEW and had messages.
{agent-id messages} for the agents in registry map OLD that are absent from
NEW and had messages.(exited-agent agent shout now)AGENT as last observed, marked exited, with status and activity from its final SHOUT (a failure reads as :error, anything else as :idle).
AGENT as last observed, marked exited, with status and activity from its final SHOUT (a failure reads as :error, anything else as :idle).
(final-shout shouts)The shout of SHOUTS that best says how the agent ended, or nil: the latest failure, else the latest error report, else the latest completion, else the latest shout.
The shout of SHOUTS that best says how the agent ended, or nil: the latest failure, else the latest error report, else the latest completion, else the latest shout.
(latest-shout shouts)The most recent of SHOUTS by :timestamp, or nil.
The most recent of SHOUTS by :timestamp, or nil.
(live-roster-fn on-warning)(live-roster-fn on-warning resolve)(live-roster-fn on-warning resolve clock)(live-roster-fn on-warning resolve clock linger-ms)Roster fn over the live swarm. RESOLVE is (fn [sym] -> fn or nil), default
requiring-resolve guarded; ON-WARNING receives a message string (or nil
once the source resolves again). CLOCK is a 0-arity epoch-ms fn. An agent
that leaves the swarm lingers LINGER-MS (default default-linger-ms, 0
disables) showing how it ended; its final shouts are kept by a watch on
the host shout registry, which the fn's :olympus/close metadata removes.
Roster fn over the live swarm. RESOLVE is (fn [sym] -> fn or nil), default `requiring-resolve` guarded; ON-WARNING receives a message string (or nil once the source resolves again). CLOCK is a 0-arity epoch-ms fn. An agent that leaves the swarm lingers LINGER-MS (default `default-linger-ms`, 0 disables) showing how it ended; its final shouts are kept by a watch on the host shout registry, which the fn's :olympus/close metadata removes.
Qualified symbol of the host query the live adapter resolves.
Qualified symbol of the host query the live adapter resolves.
Longest task or activity text an Agent carries.
Longest task or activity text an Agent carries.
(observable? slave)True for a live ling or drone with an id.
True for a live ling or drone with an id.
Qualified symbol of the host's shout registry. The host drops an agent's shouts the moment the agent exits, so the adapter watches this to keep them for the linger window.
Qualified symbol of the host's shout registry. The host drops an agent's shouts the moment the agent exits, so the adapter watches this to keep them for the linger window.
(seen-text age-ms)Coarse age of AGE-MS, e.g. "<1m ago", "4m ago", "2h ago". Minute resolution on purpose: a panel is re-sent only when its text changes.
Coarse age of AGE-MS, e.g. "<1m ago", "4m ago", "2h ago". Minute resolution on purpose: a panel is re-sent only when its text changes.
(settle {:keys [previous ghosts]} current shouts-of now linger-ms)One roster tick with linger. STATE is {:previous agents :ghosts {id ghost}} from the last tick; CURRENT the agents observed now. An agent present last tick and absent now becomes a ghost built from its final shout; a ghost leaves after LINGER-MS or when its id is observed again. Returns the next state with :roster, the current agents followed by the ghosts, oldest departure first.
One roster tick with linger. STATE is {:previous agents :ghosts {id ghost}}
from the last tick; CURRENT the agents observed now. An agent present last
tick and absent now becomes a ghost built from its final shout; a ghost
leaves after LINGER-MS or when its id is observed again. Returns the next
state with :roster, the current agents followed by the ghosts, oldest
departure first.(slave->agent slave)(slave->agent slave shout now)Agent for the swarm SLAVE map. SHOUT is its latest hivemind shout or nil; NOW is epoch ms, used only to age the last activity.
Agent for the swarm SLAVE map. SHOUT is its latest hivemind shout or nil; NOW is epoch ms, used only to age the last activity.
Swarm slave status -> Agent status. Unknown statuses read as :idle.
Swarm slave status -> Agent status. Unknown statuses read as :idle.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |