Class AgenorRuntime.Builder
- Enclosing class:
AgenorRuntime
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionagentDiscovery(AgentDiscovery discovery) Sets the agent discovery capability.agentPresence(AgentPresence presence) Sets the agent presence capability.agentRegistry(AgentRegistry registry) Sets the agent registry capability.agentResolver(AgentResolver resolver) Sets the agent resolver capability.approvalGate(ApprovalGate gate) Sets the approval gate used for HITL workflows.behaviorScheduler(BehaviorScheduler behaviorScheduler) build()deadLetterQueue(DeadLetterQueue deadLetterQueue) Sets where the runtime records a message whose delivery it gave up on.fromClasspathConfig(String resourcePath) Load configuration from a classpath resourcefromFilesystemConfig(String configPath) Load configuration from the YAML / JSON fileheartbeatInterval(Duration interval) Turns on periodic heartbeats for the agents this runtime runs (ADR-028 D-3).memoryStore(MemoryStore memoryStore) messageDispatcher(MessageDispatcher dispatcher) Sets the message dispatcher.scanPackage(String packageName) scanPackages(String... packageNames) scanPackages(Collection<String> packageNames) telemetry(AgenorTelemetry telemetry) Sets the telemetry instance used to emit spans for LLM calls, guardrails, behavior execution, and HITL approvals.withConfiguration(AgenorConfiguration config) Use the provided configuration objectLoad the default configuration (agenor.yml from filesystem or classpath)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
fromFilesystemConfig
Load configuration from the YAML / JSON file- Parameters:
configPath- path to a configuration file- Returns:
- this builder
- Throws:
ConfigurationException- if loading fails or the configuration is invalid
-
fromClasspathConfig
Load configuration from a classpath resource- Parameters:
resourcePath- classpath resource path- Returns:
- this builder
- Throws:
ConfigurationException- if loading fails
-
withConfiguration
Use the provided configuration object- Parameters:
config- the configuration to use- Returns:
- this builder
- Throws:
ConfigurationException- if the configuration is null or invalid
-
withDefaultConfig
Load the default configuration (agenor.yml from filesystem or classpath)- Returns:
- this builder
- Throws:
ConfigurationException- if loading fails or the configuration is invalid
-
messageDispatcher
Sets the message dispatcher.- Parameters:
dispatcher- the dispatcher to use; must not be null- Returns:
- this builder
- Since:
- 0.20.0
-
deadLetterQueue
Sets where the runtime records a message whose delivery it gave up on.Defaults to a bounded
InMemoryDeadLetterQueue. The runtime wires this into a dispatcher it builds itself. A dispatcher supplied throughmessageDispatcher(MessageDispatcher)has to be given the same instance through its own configuration, or the runtime and the transport will each hold a view of a different set of failures.- Parameters:
deadLetterQueue- the queue; null restores the default- Returns:
- this builder
- Since:
- 0.32.0
-
agentRegistry
Sets the agent registry capability.When individual capability setters are used, the runtime assembles a composite directory from all provided capabilities.
- Parameters:
registry- the registry implementation; must not be null- Returns:
- this builder
- Since:
- 0.20.0
-
agentResolver
Sets the agent resolver capability.- Parameters:
resolver- the resolver implementation; must not be null- Returns:
- this builder
- Since:
- 0.20.0
-
agentDiscovery
Sets the agent discovery capability.- Parameters:
discovery- the discovery implementation; must not be null- Returns:
- this builder
- Since:
- 0.20.0
-
agentPresence
Sets the agent presence capability.- Parameters:
presence- the presence implementation; must not be null- Returns:
- this builder
- Since:
- 0.20.0
-
heartbeatInterval
Turns on periodic heartbeats for the agents this runtime runs (ADR-028 D-3).Off unless called. A presence backend that expires entries needs this — or an unbounded staleness window — or it will report every agent as
AgentStatus.UNKNOWNone window after start-up. The recommended cadence is 15–30 seconds, roughly a third of the backend's window.- Parameters:
interval- the cadence between heartbeats; must be positive- Returns:
- this builder
- Throws:
IllegalArgumentException- ifintervalis zero or negative- Since:
- 0.26.0
-
behaviorScheduler
-
memoryStore
-
llmMemoryManagerFactory
-
telemetry
Sets the telemetry instance used to emit spans for LLM calls, guardrails, behavior execution, and HITL approvals.- Parameters:
telemetry- the telemetry instance;nulluses noop- Returns:
this- Since:
- 0.19.0
-
approvalGate
Sets the approval gate used for HITL workflows.Defaults to an in-memory gate supplied by
agenor-runtime-extwhen not set, ornullif that module is absent. Provide a persistent implementation (e.g.JdbcApprovalGate) to survive JVM restarts.- Parameters:
gate- the approval gate; must not be null- Returns:
this- Since:
- 0.23.0
-
scanPackage
-
scanPackages
-
scanPackages
-
service
-
build
-