Class GatewayBootstrap.Builder
java.lang.Object
io.agentscope.harness.agent.gateway.GatewayBootstrap.Builder
- Enclosing class:
- GatewayBootstrap
-
Method Summary
Modifier and TypeMethodDescriptionagent(String id, HarnessAgent agent) Registers a pre-built agent under the given id.agent(String id, Consumer<HarnessAgent.Builder> configurator) Registers an agent declared via a builder lambda.build()Builds the gateway bootstrap.Registers one or more external channels for gateway management.configureAllAgents(Consumer<HarnessAgent.Builder> customizer) Applies a customizer to every agent builder created via the lambda-basedagent(String, Consumer)method.distributedStore(DistributedStore store) Sets the distributed store used to build a durableSubagentRegistry, making subagents exposed viaexpose_to_userresolvable and re-materializable across nodes / restarts.Sets the main agent id (used as the routing fallback).Sets aChannelRuntimeContextResolverthat supplies / replaces callerRuntimeContexton each Gateway turn before identity fields are applied.
-
Method Details
-
agent
Registers a pre-built agent under the given id. -
agent
Registers an agent declared via a builder lambda. The lambda receives aHarnessAgent.Builderpre-configured with any global customizer. -
mainAgent
Sets the main agent id (used as the routing fallback). If not called, the first registered agent becomes the main agent. -
channel
Registers one or more external channels for gateway management. -
configureAllAgents
Applies a customizer to every agent builder created via the lambda-basedagent(String, Consumer)method. Useful for setting a shared model or workspace. -
distributedStore
Sets the distributed store used to build a durableSubagentRegistry, making subagents exposed viaexpose_to_userresolvable and re-materializable across nodes / restarts. When not set, the main agent's owndistributedStore(if any) is used as a fallback; otherwise exposure stays in-process. -
runtimeContextResolver
Sets aChannelRuntimeContextResolverthat supplies / replaces callerRuntimeContexton each Gateway turn before identity fields are applied. Useful for attaching tenant / auth / tool dependencies from the surrounding request. -
build
Builds the gateway bootstrap. At least one agent must be registered.- Throws:
IllegalStateException- if no agents are registered
-