AS AgentScopeAPI 手册 / API Reference

SubagentRegistry

public interface SubagentRegistry
源码Source io/agentscope/harness/agent/gateway/SubagentRegistry.java:40–71

定义子智能体注册表契约的接口。位于 io.agentscope.harness.agent.gateway 包。核心成员包括 register、find、revoke、revokeByParentSession。

Durable registry of exposed subagents, keyed by subagentId.

Decouples a subagent's user-facing handle from any single process: the in-memory HarnessGateway keeps a live-agent cache for the fast same-node path, while this registry persists the SubagentRecord recipe so that any node (or the same node after a restart) can resolve the handle and re-materialize the agent.

Implementations:

  • InMemorySubagentRegistry — default, single-process, equivalent to the legacy behaviour.

  • StoreBackedSubagentRegistry — backed by a distributed io.agentscope.harness.agent.filesystem.remote.store.BaseStore (Redis / OSS / MySQL via io.agentscope.harness.agent.DistributedStore#baseStore()).

Implementations must be thread-safe.

方法摘要Method Summary

方法Method说明Description
public void register(SubagentRecord record)
设置注册。
Persists an exposure record.
public Optional<SubagentRecord> find(String subagentId)
设置查找。
Resolves a subagent handle.
public void revoke(String subagentId)
设置该参数。
Removes a single exposure record.
default public void revokeByParentSession(String parentSessionId)
default
设置该参数。
Removes all exposure records associated with the given parent session.

方法详情Method Detail

register

public void register(SubagentRecord record)

设置注册。

Persists an exposure record.

参数Parameters
名称Name类型Type说明Description
recordSubagentRecord记录(类型 `SubagentRecord`)。the record to persist (must carry a non-null `subagentId`)
源码Source io/agentscope/harness/agent/gateway/SubagentRegistry.java:48

find

public Optional<SubagentRecord> find(String subagentId)

设置查找。

Resolves a subagent handle.

参数Parameters
名称Name类型Type说明Description
subagentIdString子智能体标识(类型 `String`)。the handle to resolve
返回Returns Optional<SubagentRecord>
返回可选。the record, or `Optional#empty()` if unknown or expired
源码Source io/agentscope/harness/agent/gateway/SubagentRegistry.java:57

revoke

public void revoke(String subagentId)

设置该参数。

Removes a single exposure record.

参数Parameters
名称Name类型Type说明Description
subagentIdString子智能体标识(类型 `String`)。The subagent id.
源码Source io/agentscope/harness/agent/gateway/SubagentRegistry.java:60

revokeByParentSession

default public void revokeByParentSession(String parentSessionId)
default

设置该参数。

Removes all exposure records associated with the given parent session.

参数Parameters
名称Name类型Type说明Description
parentSessionIdString父级会话标识(类型 `String`)。the parent session whose exposed subagents should be revoked
源码Source io/agentscope/harness/agent/gateway/SubagentRegistry.java:68–70
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.