Synapse.Orchestrator.AgentConfig (Synapse v0.1.1)
View SourceNormalized representation of a declarative agent configuration.
This module provides a strongly-typed struct backed by a NimbleOptions schema so configurations can be validated at compile- and boot-time before agents are spawned. The resulting struct is used by the orchestrator runtime to drive reconciliation and agent creation.
Summary
Types
Identifier used to reference an agent across the orchestrator runtime
Archetype supported by the orchestrator
Callable invoked for custom agents
Orchestrator behaviour configuration
Callable used to build results from action outputs
Signal configuration normalised by the schema
Signal routing patterns
Signal role mappings for orchestrators
Canonical signal topics used by the router
Spawn specialists list or strategy
Complete validated configuration
Functions
Validates and normalises a configuration map or keyword list into an
%Synapse.Orchestrator.AgentConfig{} struct.
Returns the NimbleOptions schema used to validate agent configurations.
Types
@type agent_id() :: atom()
Identifier used to reference an agent across the orchestrator runtime
@type agent_type() :: :specialist | :orchestrator | :custom
Archetype supported by the orchestrator
Callable invoked for custom agents
@type orchestration() :: %{ classify_fn: function() | {module(), atom(), [term()]}, spawn_specialists: spawn_specialists(), aggregation_fn: function() | {module(), atom(), [term()]}, fast_path_fn: function() | {module(), atom(), [term()]} | nil }
Orchestrator behaviour configuration
Callable used to build results from action outputs
@type signal_config() :: %{ subscribes: [signal_topic()], emits: [signal_topic()], roles: signal_roles() | nil }
Signal configuration normalised by the schema
@type signal_pattern() :: String.t()
Signal routing patterns
@type signal_roles() :: %{ optional(:request) => signal_topic() | nil, optional(:result) => signal_topic() | nil, optional(:summary) => signal_topic() | nil }
Signal role mappings for orchestrators
@type signal_topic() :: Synapse.Signal.topic()
Canonical signal topics used by the router
Spawn specialists list or strategy
@type t() :: %Synapse.Orchestrator.AgentConfig{ actions: [module()], custom_handler: custom_handler() | nil, depends_on: [agent_id()], id: agent_id(), metadata: map(), orchestration: orchestration() | nil, registry: atom() | nil, result_builder: result_builder() | nil, signals: signal_config(), spawn_condition: (-> boolean()) | nil, state_schema: keyword() | nil, type: agent_type() }
Complete validated configuration
Functions
@spec new(map() | keyword()) :: {:ok, t()} | {:error, NimbleOptions.ValidationError.t()}
Validates and normalises a configuration map or keyword list into an
%Synapse.Orchestrator.AgentConfig{} struct.
Returns {:ok, struct} on success or {:error, %NimbleOptions.ValidationError{}} on failure.
@spec schema() :: NimbleOptions.schema()
Returns the NimbleOptions schema used to validate agent configurations.