ControlPlaneStores
public final class ControlPlaneStores
io/agentscope/extensions/controlplane/store/ControlPlaneStores.java:45–207控制面 Stores,承载智能体的部署、调度与服务化运行。位于 io.agentscope.extensions.controlplane.store 包。核心成员包括 fromEnv、create、from、baseStore、sandboxExecutionGuard、sandboxSnapshotSpec。
Factory for control-plane hosted store components (/api/v1/dp/*).
AgentStateStore is deliberately excluded — callers must supply their own via
#withAgentStateStore(AgentStateStore).
`ControlPlaneStores cp = ControlPlaneStores.fromEnv();
HarnessAgent.builder()
.distributedStore(cp.withAgentStateStore(redisStore.agentStateStore()))
.filesystem(new RemoteFilesystemSpec().isolationScope(IsolationScope.USER))
.build();
`
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static ControlPlaneStores fromEnv()static | 返回 `fromEnv` 结果。 Creates a factory from environment variables:
`CONTROL_PLANE_HTTP`, `BUILDER_INTERNAL_TOKEN`,
`CONTROL_PLANE_AGENT_NAME`, `CONTROL_PLANE_NAMESPACE`. |
public static ControlPlaneStores create(String httpBase, String token, String agentName, String namespace)static | 创建并返回实例。 Creates a factory from explicit connection settings. |
public static ControlPlaneStores from(ControlPlaneConfig config)static | 创建并返回实例。 Creates a factory reusing connection settings from an `ControlPlaneConfig`. |
public BaseStore baseStore() | 返回基类存储。 Returns a control-plane backed `BaseStore`. |
public SandboxExecutionGuard sandboxExecutionGuard() | 返回沙箱执行守卫。 Returns a control-plane backed `SandboxExecutionGuard`. |
public SandboxSnapshotSpec sandboxSnapshotSpec() | 返回沙箱快照规格。 Returns a control-plane backed `SandboxSnapshotSpec`. |
public MessageBus messageBus() | 返回消息总线。 Returns a control-plane backed `MessageBus`, or `null` when the hosted-store
endpoint is unreachable so `HarnessAgent` can fall back to `WorkspaceMessageBus`. |
public AsyncToolRegistry asyncToolRegistry() | 返回异步工具注册表。 Returns a control-plane backed `AsyncToolRegistry`, or `null` when the
hosted-store endpoint is unreachable so `HarnessAgent` can fall back to the workspace
registry. |
public TaskRepository taskRepository() | 返回任务仓库。 Returns a control-plane backed `TaskRepository`, or `null` when unreachable. |
public SessionTurnGate sessionTurnGate() | 返回 `sessionTurnGate` 结果。 Returns a control-plane backed `SessionTurnGate` for distributed per-session turn
serialization. |
public DistributedStore withAgentStateStore(AgentStateStore stateStore) | 执行使用智能体状态存储相关操作。 Builds a `DistributedStore` by combining hosted components with a user-provided
`AgentStateStore`. |
方法详情Method Detail
fromEnv
public static ControlPlaneStores fromEnv()
返回 fromEnv 结果。
Creates a factory from environment variables: CONTROL_PLANE_HTTP, BUILDER_INTERNAL_TOKEN, CONTROL_PLANE_AGENT_NAME, CONTROL_PLANE_NAMESPACE.
ControlPlaneStoresio/agentscope/extensions/controlplane/store/ControlPlaneStores.java:62–68create
public static ControlPlaneStores create(String httpBase, String token, String agentName, String namespace)
创建并返回实例。
Creates a factory from explicit connection settings.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
httpBase | String | HTTP 基类(类型 `String`)。control-plane HTTP base URL |
token | String | 用于`X-Builder-Internal-Token`的内部令牌。internal token for `X-Builder-Internal-Token` |
agentName | String | 智能体名称(类型 `String`)。logical agent name |
namespace | String | 命名空间(类型 `String`)。tenant / Kubernetes namespace |
ControlPlaneStoresio/agentscope/extensions/controlplane/store/ControlPlaneStores.java:78–82from
public static ControlPlaneStores from(ControlPlaneConfig config)
创建并返回实例。
Creates a factory reusing connection settings from an ControlPlaneConfig.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
config | ControlPlaneConfig | 配置对象(类型 `ControlPlaneConfig`)。controlplane bridge config (must have `controlPlaneHttp` and token set) |
ControlPlaneStoresio/agentscope/extensions/controlplane/store/ControlPlaneStores.java:89–102baseStore
public BaseStore baseStore()
返回基类存储。
Returns a control-plane backed BaseStore.
BaseStoreio/agentscope/extensions/controlplane/store/ControlPlaneStores.java:105–107sandboxExecutionGuard
public SandboxExecutionGuard sandboxExecutionGuard()
返回沙箱执行守卫。
Returns a control-plane backed SandboxExecutionGuard.
SandboxExecutionGuardio/agentscope/extensions/controlplane/store/ControlPlaneStores.java:110–112sandboxSnapshotSpec
public SandboxSnapshotSpec sandboxSnapshotSpec()
返回沙箱快照规格。
Returns a control-plane backed SandboxSnapshotSpec.
SandboxSnapshotSpecio/agentscope/extensions/controlplane/store/ControlPlaneStores.java:115–117messageBus
public MessageBus messageBus()
返回消息总线。
Returns a control-plane backed MessageBus, or null when the hosted-store endpoint is unreachable so HarnessAgent can fall back to WorkspaceMessageBus.
MessageBusio/agentscope/extensions/controlplane/store/ControlPlaneStores.java:123–128asyncToolRegistry
public AsyncToolRegistry asyncToolRegistry()
返回异步工具注册表。
Returns a control-plane backed AsyncToolRegistry, or null when the hosted-store endpoint is unreachable so HarnessAgent can fall back to the workspace registry.
AsyncToolRegistryio/agentscope/extensions/controlplane/store/ControlPlaneStores.java:135–140taskRepository
public TaskRepository taskRepository()
返回任务仓库。
Returns a control-plane backed TaskRepository, or null when unreachable.
TaskRepositoryio/agentscope/extensions/controlplane/store/ControlPlaneStores.java:143–148sessionTurnGate
public SessionTurnGate sessionTurnGate()
返回 sessionTurnGate 结果。
Returns a control-plane backed SessionTurnGate for distributed per-session turn serialization.
SessionTurnGateio/agentscope/extensions/controlplane/store/ControlPlaneStores.java:157–159withAgentStateStore
public DistributedStore withAgentStateStore(AgentStateStore stateStore)
执行使用智能体状态存储相关操作。
Builds a DistributedStore by combining hosted components with a user-provided AgentStateStore.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
stateStore | AgentStateStore | 状态存储(类型 `AgentStateStore`)。required agent session state backend |
DistributedStoreio/agentscope/extensions/controlplane/store/ControlPlaneStores.java:168–180