Raxol.Agent.Session (Raxol Agent v2.6.0)

Copy Markdown View Source

Manages a single agent's TEA application lifecycle.

Follows the same pattern as Raxol.SSH.Session: wraps a Lifecycle instance with environment: :agent. Agents register in Raxol.Agent.Registry for discovery by other agents.

Summary

Functions

Returns a specification to start this module under a supervisor.

Read the agent's current model.

Read the agent's view as a semantic tree (layout keys stripped).

Read the agent's latest view tree.

Send a message into the agent's TEA loop.

Types

t()

@type t() :: %Raxol.Agent.Session{
  app_module: module(),
  id: term(),
  lifecycle_pid: pid() | nil,
  team_id: term() | nil
}

Functions

child_spec(init_arg)

@spec child_spec(keyword()) :: Supervisor.child_spec()

Returns a specification to start this module under a supervisor.

See Supervisor.

get_model(agent_id)

@spec get_model(term()) :: {:ok, term()} | {:error, :not_found}

Read the agent's current model.

get_semantic_view(agent_id)

@spec get_semantic_view(term()) :: {:ok, term()} | {:error, :not_found}

Read the agent's view as a semantic tree (layout keys stripped).

get_view_tree(agent_id)

@spec get_view_tree(term()) :: {:ok, term()} | {:error, :not_found}

Read the agent's latest view tree.

send_message(agent_id, message)

@spec send_message(term(), term()) :: :ok | {:error, :not_found}

Send a message into the agent's TEA loop.

start_link(init_opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()