Functions
Session
Alias of ::session/Session
bump-counter
fn (store: ::hot::store/Map, key: Str, delta: Int): Int
Increment a numeric counter in a store and return the new value.
create-runtime
fn (agent-name: Str): AgentRuntime
fn (agent-name: Str, opts: Map?): AgentRuntime
Create standard state/stats/errors stores for an agent name.
list-registered-sessions
fn (rt: AgentRuntime): Vec<::ai::session/Session>
Materialize registered sessions from the runtime state store.
now-epoch-secs
fn (): Int
Current Unix epoch seconds.
ns
Alias of ::ai::agent::runtime/
Runtime helpers shared by long-lived AI agents: scoped stores, registered sessions, simple counters, and rolling error logs.
record-error
fn (rt: AgentRuntime, where: Str, msg: Str): Any
Append a rolling error entry to the runtime error store.
register-session
fn (rt: AgentRuntime, session: ::ai::session/Session): Vec
Add a session to the runtime's registered-session index. Idempotent.
today-bucket
fn (): Int
Day number since Unix epoch, useful for naturally sortable daily counters.
Types
AgentRuntime
AgentRuntime type {
agent-name: Str,
state-store: ::hot::store/Map,
stats-store: ::hot::store/Map,
errors-store: ::hot::store/Map,
notify-store: ::hot::store/Map,
max-errors: Int
}
Per-agent runtime stores and configuration.
Four stores are kept distinct so unrelated read paths never collide:
state-store for arbitrary state (incl. registered sessions),
stats-store for counters, errors-store for the rolling error
log, and notify-store for the agent notification ledger used by
::ai::agent::notify.