Packages
A Fair Source multi-agent runtime with deterministic agent scoring and replayable run history.
Retired package: Deprecated - superseded — operator console moved to the Syntropy app
Current section
Files
Jump to
Current section
Files
lib/syntropy_web/controllers/api/agent_json.ex
defmodule SyntropyWeb.Api.AgentJSON do
@moduledoc false
alias SyntropyWeb.RuntimeViewHelpers
@spec agent(map()) :: map()
def agent(agent) do
%{
id: agent.id,
runtime_id: Map.get(agent, :runtime_id, agent.id),
node_id: Map.get(agent, :node_id, Syntropy.node_id()),
name: agent.name,
perspective: agent.perspective,
position: agent.position,
temporary: agent.temporary,
knowledge_items: agent.knowledge_items,
score_vector: agent.score_vector,
connections: RuntimeViewHelpers.ordered_connections(agent),
parent_ids: agent.parent_ids,
parent_runtime_ids: Map.get(agent, :parent_runtime_ids, []),
lineage_ids: agent.lineage_ids,
source_names: agent.source_names,
perspective_labels: agent.perspective_labels
}
end
end